From c2e7aef97970bcd24d77bd45d4aa63be177ccb12 Mon Sep 17 00:00:00 2001 From: zouyaoji <370681295@qq.com> Date: Thu, 29 Apr 2021 17:27:21 +0800 Subject: [PATCH] update --- .eslintrc.js | 72 + .gitignore | 2 +- README.md | 34 + index.html | 2 +- package-lock.json | 2448 +- package.json | 18 +- public/Cesium/Cesium.d.ts | 20758 ++++---- public/Cesium/Cesium.js | 2 +- public/Cesium/ThirdParty/Workers/deflate.js | 2 +- public/Cesium/ThirdParty/Workers/inflate.js | 2 +- ...rcType-dc1c5aee.js => ArcType-2b58731c.js} | 0 ...2f.js => AttributeCompression-10c27d9c.js} | 2 +- .../Workers/BoundingRectangle-07202124.js | 1 + .../Workers/BoundingRectangle-7ee12c46.js | 1 - ...ry-c7d4febc.js => BoxGeometry-0609cbde.js} | 2 +- public/Cesium/Workers/Cartesian2-8417ca3d.js | 1 - public/Cesium/Workers/Cartesian2-8646c5a1.js | 1 + public/Cesium/Workers/Check-24483042.js | 1 + public/Cesium/Workers/Check-d18af7c4.js | 1 - .../{Color-b0d12252.js => Color-98c5f877.js} | 2 +- ...4e9f6.js => ComponentDatatype-1a100acd.js} | 2 +- ...CoplanarPolygonGeometryLibrary-32520d7a.js | 1 + ...CoplanarPolygonGeometryLibrary-6c63fe5e.js | 1 - .../CorridorGeometryLibrary-1ea8b9ee.js | 1 + .../CorridorGeometryLibrary-dd337458.js | 1 - .../Workers/CylinderGeometry-7778847f.js | 1 - .../Workers/CylinderGeometry-a5313e27.js | 1 + .../CylinderGeometryLibrary-85e5e690.js | 1 + .../CylinderGeometryLibrary-daf6cec5.js | 1 - ...2ee4ae7.js => EllipseGeometry-8e3bce61.js} | 2 +- .../EllipseGeometryLibrary-2412418f.js | 1 - .../EllipseGeometryLibrary-e452d6b7.js | 1 + ....js => EllipseOutlineGeometry-61cb55e1.js} | 2 +- ...5072b.js => EllipsoidGeodesic-cc216670.js} | 2 +- .../Workers/EllipsoidGeometry-8e9adb8a.js | 1 + .../Workers/EllipsoidGeometry-cb484b79.js | 1 - ...s => EllipsoidOutlineGeometry-b505f2ae.js} | 2 +- .../Workers/EllipsoidRhumbLine-2b7999f3.js | 1 + .../Workers/EllipsoidRhumbLine-8cb2e5a4.js | 1 - ...b.js => EllipsoidTangentPlane-325a8e68.js} | 2 +- ...933de.js => EncodedCartesian3-bf827957.js} | 2 +- .../Workers/FrustumGeometry-00e2e34e.js | 1 - .../Workers/FrustumGeometry-c7d19501.js | 1 + ...19cfe.js => GeometryAttribute-374f805d.js} | 2 +- ...94d8.js => GeometryAttributes-caa08d6c.js} | 2 +- .../Workers/GeometryInstance-6aa9010a.js | 1 + .../Workers/GeometryInstance-d919cab6.js | 1 - .../GeometryOffsetAttribute-718fa138.js | 1 + .../GeometryOffsetAttribute-def3b741.js | 1 - .../Workers/GeometryPipeline-571ff4c9.js | 1 + .../Workers/GeometryPipeline-5e672526.js | 1 - ...-d47ad6f6.js => IndexDatatype-82ceea78.js} | 2 +- .../Workers/IntersectionTests-5394f658.js | 1 + .../Workers/IntersectionTests-7d224a2f.js | 1 - .../{Math-4e53b694.js => Math-d6182036.js} | 2 +- .../Workers/OrientedBoundingBox-18b4901f.js | 1 - .../Workers/OrientedBoundingBox-eb360dc3.js | 1 + .../{Plane-4aa8974d.js => Plane-13ae4b1b.js} | 2 +- ....js => PolygonGeometryLibrary-2a7648d9.js} | 2 +- ...fd1975b.js => PolygonPipeline-97a7160d.js} | 2 +- .../Workers/PolylinePipeline-232a4d9a.js | 1 - .../Workers/PolylinePipeline-3803a6c2.js | 1 + .../PolylineVolumeGeometryLibrary-4d0ebb44.js | 1 + .../PolylineVolumeGeometryLibrary-a2a20b2b.js | 1 - .../Workers/PrimitivePipeline-5ce755e1.js | 1 - .../Workers/PrimitivePipeline-c76ef883.js | 1 + .../RectangleGeometryLibrary-57cd4923.js | 1 + .../RectangleGeometryLibrary-b88eec5f.js | 1 - .../Cesium/Workers/RuntimeError-7f634f5d.js | 1 - .../Cesium/Workers/RuntimeError-88a32665.js | 1 + ...3cbc4e6.js => TerrainEncoding-c552e269.js} | 2 +- public/Cesium/Workers/Transforms-79117a7b.js | 1 + public/Cesium/Workers/Transforms-a73b3b3b.js | 1 - .../Cesium/Workers/VertexFormat-81ec7207.js | 1 + .../Cesium/Workers/VertexFormat-e8cbf5b3.js | 1 - ...01b.js => WallGeometryLibrary-0e5f04d3.js} | 2 +- ...76bb35d1.js => WebGLConstants-95ceb4e9.js} | 0 ...8.js => WebMercatorProjection-66cc0482.js} | 2 +- .../Workers/arrayRemoveDuplicates-0f62a181.js | 1 - .../Workers/arrayRemoveDuplicates-3fea1e5f.js | 1 + .../Workers/cesiumWorkerBootstrapper.js | 2 +- public/Cesium/Workers/combineGeometry.js | 2 +- public/Cesium/Workers/createBoxGeometry.js | 2 +- .../Workers/createBoxOutlineGeometry.js | 2 +- public/Cesium/Workers/createCircleGeometry.js | 2 +- .../Workers/createCircleOutlineGeometry.js | 2 +- .../Workers/createCoplanarPolygonGeometry.js | 2 +- .../createCoplanarPolygonOutlineGeometry.js | 2 +- .../Cesium/Workers/createCorridorGeometry.js | 2 +- .../Workers/createCorridorOutlineGeometry.js | 2 +- .../Cesium/Workers/createCylinderGeometry.js | 2 +- .../Workers/createCylinderOutlineGeometry.js | 2 +- .../Cesium/Workers/createEllipseGeometry.js | 2 +- .../Workers/createEllipseOutlineGeometry.js | 2 +- .../Cesium/Workers/createEllipsoidGeometry.js | 2 +- .../Workers/createEllipsoidOutlineGeometry.js | 2 +- .../Cesium/Workers/createFrustumGeometry.js | 2 +- .../Workers/createFrustumOutlineGeometry.js | 2 +- public/Cesium/Workers/createGeometry.js | 2 +- .../Workers/createGroundPolylineGeometry.js | 2 +- public/Cesium/Workers/createPlaneGeometry.js | 2 +- .../Workers/createPlaneOutlineGeometry.js | 2 +- .../Cesium/Workers/createPolygonGeometry.js | 2 +- .../Workers/createPolygonOutlineGeometry.js | 2 +- .../Cesium/Workers/createPolylineGeometry.js | 2 +- .../Workers/createPolylineVolumeGeometry.js | 2 +- .../createPolylineVolumeOutlineGeometry.js | 2 +- .../Cesium/Workers/createRectangleGeometry.js | 2 +- .../Workers/createRectangleOutlineGeometry.js | 2 +- .../Workers/createSimplePolylineGeometry.js | 2 +- public/Cesium/Workers/createSphereGeometry.js | 2 +- .../Workers/createSphereOutlineGeometry.js | 2 +- .../Workers/createTaskProcessorWorker.js | 2 +- .../createVectorTileClampedPolylines.js | 1 + .../Workers/createVectorTileGeometries.js | 2 +- .../Cesium/Workers/createVectorTilePoints.js | 2 +- .../Workers/createVectorTilePolygons.js | 2 +- .../Workers/createVectorTilePolylines.js | 2 +- ...VerticesFromGoogleEarthEnterpriseBuffer.js | 2 +- .../Workers/createVerticesFromHeightmap.js | 2 +- .../createVerticesFromQuantizedTerrainMesh.js | 2 +- public/Cesium/Workers/createWallGeometry.js | 2 +- .../Workers/createWallOutlineGeometry.js | 2 +- public/Cesium/Workers/decodeDraco.js | 2 +- .../decodeGoogleEarthEnterprisePacket.js | 2 +- public/Cesium/Workers/transcodeCRNToDXT.js | 2 +- .../Cesium/Workers/transferTypedArrayTest.js | 2 +- .../Workers/upsampleQuantizedTerrainMesh.js | 2 +- .../{when-208fe5b0.js => when-54335d57.js} | 2 +- public/favicon.ico | Bin 4286 -> 4286 bytes src/App.vue | 22 +- src/components/HelloWorld.vue | 114 +- src/main.js | 15 - src/main.ts | 18 + src/shims-vue.d.ts | 5 + src/vue-cesium.d.ts | 42445 ++++++++++++++++ tsconfig.json | 15 + vite.config.js => vite.config.ts | 0 138 files changed, 55461 insertions(+), 10698 deletions(-) create mode 100644 .eslintrc.js create mode 100644 README.md rename public/Cesium/Workers/{ArcType-dc1c5aee.js => ArcType-2b58731c.js} (100%) rename public/Cesium/Workers/{AttributeCompression-f02ec82f.js => AttributeCompression-10c27d9c.js} (52%) create mode 100644 public/Cesium/Workers/BoundingRectangle-07202124.js delete mode 100644 public/Cesium/Workers/BoundingRectangle-7ee12c46.js rename public/Cesium/Workers/{BoxGeometry-c7d4febc.js => BoxGeometry-0609cbde.js} (75%) delete mode 100644 public/Cesium/Workers/Cartesian2-8417ca3d.js create mode 100644 public/Cesium/Workers/Cartesian2-8646c5a1.js create mode 100644 public/Cesium/Workers/Check-24483042.js delete mode 100644 public/Cesium/Workers/Check-d18af7c4.js rename public/Cesium/Workers/{Color-b0d12252.js => Color-98c5f877.js} (98%) rename public/Cesium/Workers/{ComponentDatatype-9204e9f6.js => ComponentDatatype-1a100acd.js} (94%) create mode 100644 public/Cesium/Workers/CoplanarPolygonGeometryLibrary-32520d7a.js delete mode 100644 public/Cesium/Workers/CoplanarPolygonGeometryLibrary-6c63fe5e.js create mode 100644 public/Cesium/Workers/CorridorGeometryLibrary-1ea8b9ee.js delete mode 100644 public/Cesium/Workers/CorridorGeometryLibrary-dd337458.js delete mode 100644 public/Cesium/Workers/CylinderGeometry-7778847f.js create mode 100644 public/Cesium/Workers/CylinderGeometry-a5313e27.js create mode 100644 public/Cesium/Workers/CylinderGeometryLibrary-85e5e690.js delete mode 100644 public/Cesium/Workers/CylinderGeometryLibrary-daf6cec5.js rename public/Cesium/Workers/{EllipseGeometry-42ee4ae7.js => EllipseGeometry-8e3bce61.js} (85%) delete mode 100644 public/Cesium/Workers/EllipseGeometryLibrary-2412418f.js create mode 100644 public/Cesium/Workers/EllipseGeometryLibrary-e452d6b7.js rename public/Cesium/Workers/{EllipseOutlineGeometry-ab13c628.js => EllipseOutlineGeometry-61cb55e1.js} (86%) rename public/Cesium/Workers/{EllipsoidGeodesic-8015072b.js => EllipsoidGeodesic-cc216670.js} (53%) create mode 100644 public/Cesium/Workers/EllipsoidGeometry-8e9adb8a.js delete mode 100644 public/Cesium/Workers/EllipsoidGeometry-cb484b79.js rename public/Cesium/Workers/{EllipsoidOutlineGeometry-dd7f7ad1.js => EllipsoidOutlineGeometry-b505f2ae.js} (56%) create mode 100644 public/Cesium/Workers/EllipsoidRhumbLine-2b7999f3.js delete mode 100644 public/Cesium/Workers/EllipsoidRhumbLine-8cb2e5a4.js rename public/Cesium/Workers/{EllipsoidTangentPlane-9123a53b.js => EllipsoidTangentPlane-325a8e68.js} (95%) rename public/Cesium/Workers/{EncodedCartesian3-874933de.js => EncodedCartesian3-bf827957.js} (83%) delete mode 100644 public/Cesium/Workers/FrustumGeometry-00e2e34e.js create mode 100644 public/Cesium/Workers/FrustumGeometry-c7d19501.js rename public/Cesium/Workers/{GeometryAttribute-04a19cfe.js => GeometryAttribute-374f805d.js} (95%) rename public/Cesium/Workers/{GeometryAttributes-b0b294d8.js => GeometryAttributes-caa08d6c.js} (76%) create mode 100644 public/Cesium/Workers/GeometryInstance-6aa9010a.js delete mode 100644 public/Cesium/Workers/GeometryInstance-d919cab6.js create mode 100644 public/Cesium/Workers/GeometryOffsetAttribute-718fa138.js delete mode 100644 public/Cesium/Workers/GeometryOffsetAttribute-def3b741.js create mode 100644 public/Cesium/Workers/GeometryPipeline-571ff4c9.js delete mode 100644 public/Cesium/Workers/GeometryPipeline-5e672526.js rename public/Cesium/Workers/{IndexDatatype-d47ad6f6.js => IndexDatatype-82ceea78.js} (87%) create mode 100644 public/Cesium/Workers/IntersectionTests-5394f658.js delete mode 100644 public/Cesium/Workers/IntersectionTests-7d224a2f.js rename public/Cesium/Workers/{Math-4e53b694.js => Math-d6182036.js} (97%) delete mode 100644 public/Cesium/Workers/OrientedBoundingBox-18b4901f.js create mode 100644 public/Cesium/Workers/OrientedBoundingBox-eb360dc3.js rename public/Cesium/Workers/{Plane-4aa8974d.js => Plane-13ae4b1b.js} (84%) rename public/Cesium/Workers/{PolygonGeometryLibrary-d175a7f1.js => PolygonGeometryLibrary-2a7648d9.js} (93%) rename public/Cesium/Workers/{PolygonPipeline-bfd1975b.js => PolygonPipeline-97a7160d.js} (75%) delete mode 100644 public/Cesium/Workers/PolylinePipeline-232a4d9a.js create mode 100644 public/Cesium/Workers/PolylinePipeline-3803a6c2.js create mode 100644 public/Cesium/Workers/PolylineVolumeGeometryLibrary-4d0ebb44.js delete mode 100644 public/Cesium/Workers/PolylineVolumeGeometryLibrary-a2a20b2b.js delete mode 100644 public/Cesium/Workers/PrimitivePipeline-5ce755e1.js create mode 100644 public/Cesium/Workers/PrimitivePipeline-c76ef883.js create mode 100644 public/Cesium/Workers/RectangleGeometryLibrary-57cd4923.js delete mode 100644 public/Cesium/Workers/RectangleGeometryLibrary-b88eec5f.js delete mode 100644 public/Cesium/Workers/RuntimeError-7f634f5d.js create mode 100644 public/Cesium/Workers/RuntimeError-88a32665.js rename public/Cesium/Workers/{TerrainEncoding-73cbc4e6.js => TerrainEncoding-c552e269.js} (77%) create mode 100644 public/Cesium/Workers/Transforms-79117a7b.js delete mode 100644 public/Cesium/Workers/Transforms-a73b3b3b.js create mode 100644 public/Cesium/Workers/VertexFormat-81ec7207.js delete mode 100644 public/Cesium/Workers/VertexFormat-e8cbf5b3.js rename public/Cesium/Workers/{WallGeometryLibrary-1012701b.js => WallGeometryLibrary-0e5f04d3.js} (80%) rename public/Cesium/Workers/{WebGLConstants-76bb35d1.js => WebGLConstants-95ceb4e9.js} (100%) rename public/Cesium/Workers/{WebMercatorProjection-ffb6b9f8.js => WebMercatorProjection-66cc0482.js} (56%) delete mode 100644 public/Cesium/Workers/arrayRemoveDuplicates-0f62a181.js create mode 100644 public/Cesium/Workers/arrayRemoveDuplicates-3fea1e5f.js create mode 100644 public/Cesium/Workers/createVectorTileClampedPolylines.js rename public/Cesium/Workers/{when-208fe5b0.js => when-54335d57.js} (77%) delete mode 100644 src/main.js create mode 100644 src/main.ts create mode 100644 src/shims-vue.d.ts create mode 100644 src/vue-cesium.d.ts create mode 100644 tsconfig.json rename vite.config.js => vite.config.ts (100%) diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..9833865 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,72 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:vue/vue3-recommended', + ], + parserOptions: { + ecmaVersion: 12, + parser: '@typescript-eslint/parser', + sourceType: 'module', + }, + plugins: ['vue', '@typescript-eslint'], + rules: { + // js/ts + 'eol-last': 'error', + 'no-trailing-spaces': 'error', + 'comma-style': ['error', 'last'], + // 'comma-dangle': ['error', 'always-multiline'], + quotes: [ + 'error', + 'single', + { avoidEscape: true, allowTemplateLiterals: true }, + ], + camelcase: ['error', { properties: 'never' }], + semi: ['error', 'never'], + indent: ['error', 2, { SwitchCase: 1 }], + 'object-curly-spacing': ['error', 'always'], + 'arrow-parens': ['error', 'as-needed'], + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/member-delimiter-style': [ + 'error', + { + multiline: { + delimiter: 'none', + requireLast: false, + }, + singleline: { + delimiter: 'semi', + requireLast: true, + }, + }, + ], + '@typescript-eslint/no-this-alias': 'off', + // vue + 'vue/no-v-html': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/html-self-closing': [ + 'error', + { + html: { + void: 'never', + normal: 'never', + component: 'always', + }, + }, + ], + 'vue/max-attributes-per-line': [ + 'error', + { + singleline: 4, + multiline: 1, + }, + ], + 'vue/require-default-prop': 'off', + 'vue/html-closing-bracket-spacing': 'error', + }, +}; diff --git a/.gitignore b/.gitignore index 53f7466..d451ff1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules .DS_Store dist dist-ssr -*.local \ No newline at end of file +*.local diff --git a/README.md b/README.md new file mode 100644 index 0000000..b74b2a5 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# element-plus-vite-starter + +> A starter kit for vue-cesium generated by vue-cli + +

+ +

+ + +This template should help get you started developing with Vue 3 and Typescript in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur). Make sure to enable `vetur.experimental.templateInterpolationService` in settings! + +### If Using ` + diff --git a/package-lock.json b/package-lock.json index 429b235..55ce8ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,65 +9,252 @@ "resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-0.0.7.tgz", "integrity": "sha512-DNqyIo9AfN0ic2I+9F6qiGFOmoeLVhcqUU2MT4/t3vTAiZhnlMWqr6kXXwh7IjXhD1Na7XaK8/IL2b7Ml+g4tw==" }, + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, "@babel/helper-validator-identifier": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" }, + "@babel/highlight": { + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", + "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, "@babel/parser": { - "version": "7.13.13", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.13.tgz", - "integrity": "sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw==" + "version": "7.13.16", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.16.tgz", + "integrity": "sha512-6bAg36mCwuqLO0hbR+z7PHuqWiCeP7Dzg73OpQwsAB1Eb8HnGEz5xYBzCfbu+YjoaJsJs+qheDxVAuqbt3ILEw==" }, "@babel/types": { - "version": "7.13.14", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz", - "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==", + "version": "7.13.17", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.17.tgz", + "integrity": "sha512-RawydLgxbOPDlTLJNtoIypwdmAy//uQIzlKt2+iBiJaRlVuI6QLUxVAyWGNfOzp8Yu4L4lLIacoCyTNtpb4wiA==", "requires": { "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } }, + "@eslint/eslintrc": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", + "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, + "@types/json-schema": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", + "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.0.tgz", + "integrity": "sha512-U8SP9VOs275iDXaL08Ln1Fa/wLXfj5aTr/1c0t0j6CdbOnxh+TruXu1p4I0NAvdPBQgoPjHsgKn28mOi0FzfoA==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "4.22.0", + "@typescript-eslint/scope-manager": "4.22.0", + "debug": "^4.1.1", + "functional-red-black-tree": "^1.0.1", + "lodash": "^4.17.15", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.0.tgz", + "integrity": "sha512-xJXHHl6TuAxB5AWiVrGhvbGL8/hbiCQ8FiWwObO3r0fnvBdrbWEDy1hlvGQOAWc6qsCWuWMKdVWlLAEMpxnddg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.22.0", + "@typescript-eslint/types": "4.22.0", + "@typescript-eslint/typescript-estree": "4.22.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.22.0.tgz", + "integrity": "sha512-z/bGdBJJZJN76nvAY9DkJANYgK3nlRstRRi74WHm3jjgf2I8AglrSY+6l7ogxOmn55YJ6oKZCLLy+6PW70z15Q==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "4.22.0", + "@typescript-eslint/types": "4.22.0", + "@typescript-eslint/typescript-estree": "4.22.0", + "debug": "^4.1.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.22.0.tgz", + "integrity": "sha512-OcCO7LTdk6ukawUM40wo61WdeoA7NM/zaoq1/2cs13M7GyiF+T4rxuA4xM+6LeHWjWbss7hkGXjFDRcKD4O04Q==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.22.0", + "@typescript-eslint/visitor-keys": "4.22.0" + } + }, + "@typescript-eslint/types": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.22.0.tgz", + "integrity": "sha512-sW/BiXmmyMqDPO2kpOhSy2Py5w6KvRRsKZnV0c4+0nr4GIcedJwXAq+RHNK4lLVEZAJYFltnnk1tJSlbeS9lYA==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.22.0.tgz", + "integrity": "sha512-TkIFeu5JEeSs5ze/4NID+PIcVjgoU3cUQUIZnH3Sb1cEn1lBo7StSV5bwPuJQuoxKXlzAObjYTilOEKRuhR5yg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.22.0", + "@typescript-eslint/visitor-keys": "4.22.0", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.0.tgz", + "integrity": "sha512-nnMu4F+s4o0sll6cBSsTeVsT4cwxB7zECK3dFxzEjPBii9xLpq4yqqsy/FU5zMfan6G60DKZSCXAa3sHJZrcYw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.22.0", + "eslint-visitor-keys": "^2.0.0" + } + }, "@vitejs/plugin-vue": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.2.1.tgz", - "integrity": "sha512-TG+LbEUNwfFrx1VyN+iq+PsiGd9MT16hUdJY+BnMXj3MrLAF8m3VYUspTDM3aXoh48YDmAkMjG4gWFRg3lbG5A==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.2.2.tgz", + "integrity": "sha512-5BI2WFfs/Z0pAV4S/IQf1oH3bmFYlL5ATMBHgTt1Lf7hAnfpNd5oUAAs6hZPfk3QhvyUQgtk0rJBlabwNFcBJQ==", "dev": true }, "@vue/compiler-core": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.10.tgz", - "integrity": "sha512-rayD+aODgX9CWgWv0cAI+whPLyMmtkWfNGsZpdpsaIloh8mY2hX8+SvE1Nn3755YhGWJ/7oaDEcNpOctGwZbsA==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.11.tgz", + "integrity": "sha512-6sFj6TBac1y2cWCvYCA8YzHJEbsVkX7zdRs/3yK/n1ilvRqcn983XvpBbnN3v4mZ1UiQycTvOiajJmOgN9EVgw==", "requires": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.0.10", + "@vue/shared": "3.0.11", "estree-walker": "^2.0.1", "source-map": "^0.6.1" } }, "@vue/compiler-dom": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.10.tgz", - "integrity": "sha512-SzN1li9xAxtqkZimR1AFU2t1N0vzsAJxR/5764xoS0xedwhUU9s8s+Tks2FNMLsXiqdkP2Qd4zAM+9EwTbZmRw==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.11.tgz", + "integrity": "sha512-+3xB50uGeY5Fv9eMKVJs2WSRULfgwaTJsy23OIltKgMrynnIj8hTYY2UL97HCoz78aDw1VDXdrBQ4qepWjnQcw==", "requires": { - "@vue/compiler-core": "3.0.10", - "@vue/shared": "3.0.10" + "@vue/compiler-core": "3.0.11", + "@vue/shared": "3.0.11" } }, "@vue/compiler-sfc": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.0.10.tgz", - "integrity": "sha512-LLbXHwKMM72aomKsj9AySkLP1xIHREh/3w0nueenKhsWuaKTL1/XUhIPml23+Z+tX55qeJiUIHDeJuFSxfgQfg==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.0.11.tgz", + "integrity": "sha512-7fNiZuCecRleiyVGUWNa6pn8fB2fnuJU+3AGjbjl7r1P5wBivfl02H4pG+2aJP5gh2u+0wXov1W38tfWOphsXw==", "dev": true, "requires": { "@babel/parser": "^7.13.9", "@babel/types": "^7.13.0", - "@vue/compiler-core": "3.0.10", - "@vue/compiler-dom": "3.0.10", - "@vue/compiler-ssr": "3.0.10", - "@vue/shared": "3.0.10", + "@vue/compiler-core": "3.0.11", + "@vue/compiler-dom": "3.0.11", + "@vue/compiler-ssr": "3.0.11", + "@vue/shared": "3.0.11", "consolidate": "^0.16.0", "estree-walker": "^2.0.1", "hash-sum": "^2.0.0", @@ -81,46 +268,148 @@ } }, "@vue/compiler-ssr": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.0.10.tgz", - "integrity": "sha512-skrPSp9pjZG3unqHpUaEaRRpO1yYxbCXRfJ1kZW8PTGAg5g3Y/hrUet5+Q6zCIZwr5j1mSMBSLXMDCjFuyyZLg==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.0.11.tgz", + "integrity": "sha512-66yUGI8SGOpNvOcrQybRIhl2M03PJ+OrDPm78i7tvVln86MHTKhM3ERbALK26F7tXl0RkjX4sZpucCpiKs3MnA==", "dev": true, "requires": { - "@vue/compiler-dom": "3.0.10", - "@vue/shared": "3.0.10" + "@vue/compiler-dom": "3.0.11", + "@vue/shared": "3.0.11" } }, "@vue/reactivity": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.10.tgz", - "integrity": "sha512-0GOSqlIv/a5wy4r6fAcdaglQ8v2sLYMRUpu49yK8Z2vHccK85Ym3R9C9K3vo6dfBRGbbCVvoKxYtQw49LvE8Ug==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.11.tgz", + "integrity": "sha512-SKM3YKxtXHBPMf7yufXeBhCZ4XZDKP9/iXeQSC8bBO3ivBuzAi4aZi0bNoeE2IF2iGfP/AHEt1OU4ARj4ao/Xw==", "requires": { - "@vue/shared": "3.0.10" + "@vue/shared": "3.0.11" } }, "@vue/runtime-core": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.10.tgz", - "integrity": "sha512-qKhCOwHGff5YEdyClO1gf9Q9xgaPPz/qJ2GyzNZkPb00WcXJ3l+yTgHZWaSywRLs9GD1y9Ff3C0MIowzj95NHA==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.11.tgz", + "integrity": "sha512-87XPNwHfz9JkmOlayBeCCfMh9PT2NBnv795DSbi//C/RaAnc/bGZgECjmkD7oXJ526BZbgk9QZBPdFT8KMxkAg==", "requires": { - "@vue/reactivity": "3.0.10", - "@vue/shared": "3.0.10" + "@vue/reactivity": "3.0.11", + "@vue/shared": "3.0.11" } }, "@vue/runtime-dom": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.10.tgz", - "integrity": "sha512-8yRAALc/884UlYWY7hJImecvow1Cngbl2B6n0ThYTms08FVQ3W9tdW0MEvR3JVit06JyQLS1Qvwdn1PwNPPDqg==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.11.tgz", + "integrity": "sha512-jm3FVQESY3y2hKZ2wlkcmFDDyqaPyU3p1IdAX92zTNeCH7I8zZ37PtlE1b9NlCtzV53WjB4TZAYh9yDCMIEumA==", "requires": { - "@vue/runtime-core": "3.0.10", - "@vue/shared": "3.0.10", + "@vue/runtime-core": "3.0.11", + "@vue/shared": "3.0.11", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.0.10.tgz", - "integrity": "sha512-p8GJ+bGpEGiEHICwcCH/EtJnkZQllrOfm1J2J+Ep0ydMte25bPnArgrY/h2Tn1LKqqR3LXyQlOSYY6gJgiW2LQ==" + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.0.11.tgz", + "integrity": "sha512-b+zB8A2so8eCE0JsxjL24J7vdGl8rzPQ09hZNhystm+KqSbKcAej1A+Hbva1rCMmTTqA+hFnUSDc5kouEo0JzA==" + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-includes": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", + "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.5" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "array.prototype.flat": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", + "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "big-integer": { + "version": "1.6.48", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", + "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", + "dev": true }, "big.js": { "version": "5.2.2", @@ -128,18 +417,156 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, + "binary": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", + "integrity": "sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=", + "dev": true, + "requires": { + "buffers": "~0.1.1", + "chainsaw": "~0.1.0" + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "buffer-indexof-polyfill": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz", + "integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==", + "dev": true + }, + "buffers": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", + "integrity": "sha1-skV5w77U1tOWru5tmorn9Ugqt7s=", + "dev": true + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chainsaw": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", + "integrity": "sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=", + "dev": true, + "requires": { + "traverse": ">=0.3.0 <0.4" + } + }, + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "colorette": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", "dev": true }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, "consolidate": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.16.0.tgz", @@ -149,6 +576,29 @@ "bluebird": "^3.7.2" } }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -156,9 +606,66 @@ "dev": true }, "csstype": { - "version": "2.6.16", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.16.tgz", - "integrity": "sha512-61FBWoDHp/gRtsoDkq/B1nWrCUG/ok1E3tUrcNbZjsE9Cxd9yzUirjS3+nAATB8U4cTtaQmAHbNndoFz5L6C9Q==" + "version": "2.6.17", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz", + "integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==" + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "emojis-list": { "version": "3.0.0", @@ -166,159 +673,1152 @@ "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", + "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.2", + "is-callable": "^1.2.3", + "is-negative-zero": "^2.0.1", + "is-regex": "^1.1.2", + "is-string": "^1.0.5", + "object-inspect": "^1.9.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "string.prototype.trimend": "^1.0.4", + "string.prototype.trimstart": "^1.0.4", + "unbox-primitive": "^1.0.0" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "esbuild": { "version": "0.9.7", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.7.tgz", "integrity": "sha512-VtUf6aQ89VTmMLKrWHYG50uByMF4JQlVysb8dmg6cOgW8JnFCipmz7p+HNBl+RR3LLCuBxFGVauAe2wfnF9bLg==", "dev": true }, - "estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "eslint": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.25.0.tgz", + "integrity": "sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw==", "dev": true, - "optional": true + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.21", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "eslint-config-standard": { + "version": "16.0.2", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.2.tgz", + "integrity": "sha512-fx3f1rJDsl9bY7qzyX8SAtP8GBSk6MfXFaTfaGgk12aAYW4gJSyRm7dM790L6cbXv63fvjY4XeSzXnb4WM+SKw==", "dev": true }, - "generic-names": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/generic-names/-/generic-names-2.0.1.tgz", - "integrity": "sha512-kPCHWa1m9wGG/OwQpeweTwM/PYiQLrUIxXbt/P4Nic3LbGjCP0YwrALHW1uNLKZ0LIMg+RF+XRlj2ekT9ZlZAQ==", + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", "dev": true, "requires": { - "loader-utils": "^1.1.0" + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", "dev": true, "requires": { - "function-bind": "^1.1.1" + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, - "hash-sum": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", - "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", - "dev": true + "eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dev": true, + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + } }, - "icss-replace-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", - "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", - "dev": true + "eslint-plugin-import": { + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.4", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } }, - "icss-utils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true + "eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "dev": true, + "requires": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } }, - "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", - "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "eslint-plugin-promise": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz", + "integrity": "sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ==", "dev": true }, - "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "eslint-plugin-vue": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.9.0.tgz", + "integrity": "sha512-2Q0qQp5+5h+pZvJKCbG1/jCRUYrdgAz5BYKGyTlp2NU8mx09u3Hp7PsH6d5qef6ojuPoCXMnrbbDxeoplihrSw==", "dev": true, "requires": { - "has": "^1.0.3" + "eslint-utils": "^2.1.0", + "natural-compare": "^1.4.0", + "semver": "^7.3.2", + "vue-eslint-parser": "^7.6.0" } }, - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { - "minimist": "^1.2.0" + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", + "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "generic-names": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generic-names/-/generic-names-2.0.1.tgz", + "integrity": "sha512-kPCHWa1m9wGG/OwQpeweTwM/PYiQLrUIxXbt/P4Nic3LbGjCP0YwrALHW1uNLKZ0LIMg+RF+XRlj2ekT9ZlZAQ==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0" + } + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "13.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", + "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, + "globby": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", + "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "hash-sum": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz", + "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "icss-replace-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", + "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", + "dev": true + }, + "icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-bigint": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz", + "integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==", + "dev": true + }, + "is-boolean-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", + "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "dev": true, + "requires": { + "call-bind": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", + "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", + "dev": true + }, + "is-core-module": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.3.0.tgz", + "integrity": "sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", + "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", + "dev": true + }, + "is-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", + "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.1" + } + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "listenercount": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz", + "integrity": "sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc=", + "dev": true + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "merge-source-map": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mitt": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-2.1.0.tgz", + "integrity": "sha512-ILj2TpLiysu2wkBbWjAmww7TkZb65aiQO+DkVdUTBpBXq+MHYiETENkKFMtsJZX1Lf4pe4QOrTSjIfUwN5lRdg==" + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nanoid": { + "version": "3.1.22", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz", + "integrity": "sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "object-inspect": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.2.tgz", + "integrity": "sha512-gz58rdPpadwztRrPjZE9DZLOABUpTGdcANUgOwBFO1C+HZZhePoP83M65WGDmbpwFYJSWqavbl4SgDn4k8RYTA==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.values": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz", + "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2", + "has": "^1.0.3" } }, - "loader-utils": { + "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" + "wrappy": "1" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { - "yallist": "^3.0.2" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "sourcemap-codec": "^1.4.4" + "p-try": "^1.0.0" } }, - "merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "source-map": "^0.6.1" + "p-limit": "^1.1.0" } }, - "mgrs": { + "p-try": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mgrs/-/mgrs-1.0.0.tgz", - "integrity": "sha1-+5FYjnjJACVnI5XLQLJffNatGCk=" + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, - "mitt": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mitt/-/mitt-2.1.0.tgz", - "integrity": "sha512-ILj2TpLiysu2wkBbWjAmww7TkZb65aiQO+DkVdUTBpBXq+MHYiETENkKFMtsJZX1Lf4pe4QOrTSjIfUwN5lRdg==" + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, - "nanoid": { - "version": "3.1.22", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz", - "integrity": "sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==", + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { @@ -327,10 +1827,37 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picomatch": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", + "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, "postcss": { - "version": "8.2.9", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.9.tgz", - "integrity": "sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q==", + "version": "8.2.12", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.12.tgz", + "integrity": "sha512-BJnGT5+0q2tzvs6oQfnY2NpEJ7rIXNfBnZtQOKCIsweeWXBXeDd5k31UgTdS3d/c02ouspufn37mTaHWkJyzMQ==", "dev": true, "requires": { "colorette": "^1.2.2", @@ -390,14 +1917,12 @@ } }, "postcss-selector-parser": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz", - "integrity": "sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.5.tgz", + "integrity": "sha512-aFYPoYmXbZ1V6HZaSvat08M97A8HqO6Pjz+PiNpw/DhuRrC72XWAdp3hL6wusDCN31sSmcZyMGa2hZEuX+Xfhg==", "dev": true, "requires": { "cssesc": "^3.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1", "util-deprecate": "^1.0.2" } }, @@ -407,15 +1932,95 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, - "proj4": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/proj4/-/proj4-2.7.2.tgz", - "integrity": "sha512-x/EboBmIq48a9FED0Z9zWCXkd8VIpXHLsyEXljGtsnzeztC41bFjPjJ0S//wBbNLDnDYRe0e6c3FSSiqMCebDA==", + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "dependencies": { + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + } + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, "requires": { - "mgrs": "1.0.0", - "wkt-parser": "^1.2.4" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -426,15 +2031,141 @@ "path-parse": "^1.0.6" } }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "rollup": { - "version": "2.44.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.44.0.tgz", - "integrity": "sha512-rGSF4pLwvuaH/x4nAS+zP6UNn5YUDWf/TeEU5IoXSZKBbKRNTCI3qMnYXKZgrC0D2KzS2baiOZt1OlqhMu5rnQ==", + "version": "2.45.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.45.2.tgz", + "integrity": "sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==", "dev": true, "requires": { "fsevents": "~2.3.1" } }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -446,33 +2177,302 @@ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", "integrity": "sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=", "dev": true }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", + "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.5.1.tgz", + "integrity": "sha512-xGDXWTBJxahkzPQCsn1S9ESHEenU7TbMD5Iv4FeopXv/XwJyWatFjfbor+6ipI10/MNPXBYUamYukOrbPZ9L/w==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ajv": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.1.0.tgz", + "integrity": "sha512-B/Sk2Ix7A36fs/ZkuGLIR86EdjbgR6fsAcbx9lOP/QBSXujDNbVmIS/U4Itz5k8fPFDeVZl/zQ/gJW4Jrq6XjQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, - "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "traverse": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", + "integrity": "sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=", + "dev": true + }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true + }, + "unbox-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" + } + }, + "unzipper": { + "version": "0.10.11", + "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.11.tgz", + "integrity": "sha512-+BrAq2oFqWod5IESRjL3S8baohbevGcVA+teAIOYWM3pDVdseogqbzhhvvmiyQrUNKFUnDMtELW3X8ykbyDCJw==", + "dev": true, + "requires": { + "big-integer": "^1.6.17", + "binary": "~0.3.0", + "bluebird": "~3.4.1", + "buffer-indexof-polyfill": "~1.0.0", + "duplexer2": "~0.1.4", + "fstream": "^1.0.12", + "graceful-fs": "^4.2.2", + "listenercount": "~1.0.1", + "readable-stream": "~2.3.6", + "setimmediate": "~1.0.4" + }, + "dependencies": { + "bluebird": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", + "integrity": "sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM=", + "dev": true + } + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "vite": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.1.5.tgz", - "integrity": "sha512-tYU5iaYeUgQYvK/CNNz3tiJ8vYqPWfCE9IQ7K0iuzYovWw7lzty7KRYGWwV3CQPh0NKxWjOczAqiJsCL0Xb+Og==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.2.3.tgz", + "integrity": "sha512-PtjyBL4GtACM+uT5q5hi2+AlMBbb6YI2b2bam6QI8ZdZt4FezseF0yZHQx0G+b3po9jIJ/GS5N9gc5Yq9Rue7g==", "dev": true, "requires": { "esbuild": "^0.9.3", @@ -483,30 +2483,100 @@ } }, "vue": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.10.tgz", - "integrity": "sha512-6arZ722uqIArSNUU94aqx0Pq0IMHFqYZuJ+U+q9HGdZZu11VFpyFP/L/hakijGFKp56Jr0yxJdWbDiJGWPxwww==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.11.tgz", + "integrity": "sha512-3/eUi4InQz8MPzruHYSTQPxtM3LdZ1/S/BvaU021zBnZi0laRUyH6pfuE4wtUeLvI8wmUNwj5wrZFvbHUXL9dw==", "requires": { - "@vue/compiler-dom": "3.0.10", - "@vue/runtime-dom": "3.0.10", - "@vue/shared": "3.0.10" + "@vue/compiler-dom": "3.0.11", + "@vue/runtime-dom": "3.0.11", + "@vue/shared": "3.0.11" } }, "vue-cesium": { - "version": "3.0.1-beta.0", - "resolved": "https://registry.npmjs.org/vue-cesium/-/vue-cesium-3.0.1-beta.0.tgz", - "integrity": "sha512-PqmiGLdKFOAI6NnYTGo1uXCzqsjEHdA4wHweYlEV6Bh1VCh03VwRK1QdSvxRv2v9TnYFuCUMmn+DwurahbZtUg==", + "version": "3.0.1-beta.5.2", + "resolved": "https://registry.npmjs.org/vue-cesium/-/vue-cesium-3.0.1-beta.5.2.tgz", + "integrity": "sha512-ik+HTxyM2Qg/rn6DlK/uoeS7pmCtk99lMp7m2mrbliHaTLb9fMFlCJBDe5hR2WLSKzkUOC6UfGdvNbfhRwQlng==", "requires": { "@amap/amap-jsapi-loader": "^0.0.7", "lodash": "^4.17.20", - "mitt": "^2.1.0", - "proj4": "^2.7.2" + "mitt": "^2.1.0" } }, - "wkt-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.2.4.tgz", - "integrity": "sha512-ZzKnc7ml/91fOPh5bANBL4vUlWPIYYv11waCtWTkl2TRN+LEmBg60Q1MA8gqV4hEp4MGfSj9JiHz91zw/gTDXg==" + "vue-eslint-parser": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.6.0.tgz", + "integrity": "sha512-QXxqH8ZevBrtiZMZK0LpwaMfevQi9UL7lY6Kcp+ogWHC88AuwUPwwCIzkOUc1LR4XsYAt/F9yHXAB/QoD17QXA==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-scope": "^5.0.0", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.2.1", + "esquery": "^1.4.0", + "lodash": "^4.17.15" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + } + } + }, + "vue-tsc": { + "version": "0.0.24", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-0.0.24.tgz", + "integrity": "sha512-Qx0V7jkWMtvddtaWa1SA8YKkBCRmjq9zZUB2UIMZiso6JSH538oHD2VumSzkoDnAfFbY3t0/j1mB2abpA0bGWA==", + "dev": true, + "requires": { + "unzipper": "0.10.11" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "yallist": { "version": "3.1.1", diff --git a/package.json b/package.json index 1ac43e6..69797c3 100644 --- a/package.json +++ b/package.json @@ -3,16 +3,26 @@ "version": "0.0.0", "scripts": { "dev": "vite", - "build": "vite build", + "build": "vue-tsc --noEmit && vite build", "serve": "vite preview" }, "dependencies": { "vue": "^3.0.5", - "vue-cesium": "^3.0.1-beta.0" + "vue-cesium": "^3.0.1-beta.5.2" }, "devDependencies": { - "@vitejs/plugin-vue": "^1.1.5", + "@typescript-eslint/eslint-plugin": "^4.22.0", + "@typescript-eslint/parser": "^4.22.0", + "@vitejs/plugin-vue": "^1.2.2", "@vue/compiler-sfc": "^3.0.5", - "vite": "^2.1.3" + "eslint": "^7.25.0", + "eslint-config-standard": "^16.0.2", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.3.1", + "eslint-plugin-vue": "^7.9.0", + "typescript": "^4.1.3", + "vite": "^2.2.3", + "vue-tsc": "^0.0.24" } } diff --git a/public/Cesium/Cesium.d.ts b/public/Cesium/Cesium.d.ts index 1218ce1..16479f2 100644 --- a/public/Cesium/Cesium.d.ts +++ b/public/Cesium/Cesium.d.ts @@ -9,12 +9,12 @@ interface DictionaryLike { /** * Enum containing WebGL Constant values by name. - * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context - * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}). - * - * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/} - * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/} - * specifications. +for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context +(For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}). + +These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/} +and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/} +specifications. */ export enum WebGLConstants { DEPTH_BUFFER_BIT = 256, @@ -599,21 +599,21 @@ export enum WebGLConstants { MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047 }/** * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps - * retrieved from Elevation Tiles of an an ArcGIS ImageService. +retrieved from Elevation Tiles of an an ArcGIS ImageService. * @example * var terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({ - * url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer', - * token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..' - * }); - * viewer.terrainProvider = terrainProvider; - * - * + url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer', + token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..' +}); +viewer.terrainProvider = terrainProvider; + + * @param options - Object with the following properties: * @param options.url - The URL of the ArcGIS ImageServer service. * @param [options.token] - The authorization token to use to connect to the service. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. - * If neither parameter is specified, the WGS84 ellipsoid is used. + this parameter is ignored and the tiling scheme's ellipsoid is used instead. + If neither parameter is specified, the WGS84 ellipsoid is used. */ export class ArcGISTiledElevationTerrainProvider { constructor(options: { @@ -623,18 +623,18 @@ export class ArcGISTiledElevationTerrainProvider { }); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit - * the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. + the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. */ credit: Credit; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. + not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. */ tilingScheme: GeographicTilingScheme; /** @@ -647,34 +647,34 @@ export class ArcGISTiledElevationTerrainProvider { readonly readyPromise: Promise; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask - * indicates which areas of the globe are water rather than land, so they can be rendered - * as a reflective surface with animated waves. This function should not be - * called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. */ hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. - * This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. + This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. */ hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as - * at points and in rectangles. This function should not be called before - * {@link TerrainProvider#ready} returns true. This property may be undefined if availability - * information is not available. + at points and in rectangles. This function should not be called before + {@link TerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. */ availability: TileAvailability; /** * Requests the geometry for a given tile. This function should not be called before - * {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain - * data and indicates that all child tiles are available. + {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain + data and indicates that all child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method - * returns undefined instead of a promise, it is an indication that too many requests are already - * pending and the request will be retried later. + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** @@ -721,7 +721,7 @@ export enum ArcType { /** * A collection of key-value pairs that is stored as a hash for easy - * lookup but also provides an array for fast iteration. +lookup but also provides an array for fast iteration. */ export class AssociativeArray { constructor(); @@ -731,8 +731,8 @@ export class AssociativeArray { length: number; /** * Gets an unordered array of all values in the collection. - * This is a live array that will automatically reflect the values in the collection, - * it should not be modified directly. + This is a live array that will automatically reflect the values in the collection, + it should not be modified directly. */ values: any[]; /** @@ -743,7 +743,7 @@ export class AssociativeArray { contains(key: string | number): boolean; /** * Associates the provided key with the provided value. If the key already - * exists, it is overwritten with the new value. + exists, it is overwritten with the new value. * @param key - A unique identifier. * @param value - The value to associate with the provided key. */ @@ -788,10 +788,10 @@ export class AxisAlignedBoundingBox { center: Cartesian3; /** * Computes an instance of an AxisAlignedBoundingBox. The box is determined by - * finding the points spaced the farthest apart on the x, y, and z axes. + finding the points spaced the farthest apart on the x, y, and z axes. * @example * // Compute an axis aligned bounding box enclosing two points. - * var box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]); + var box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]); * @param positions - List of points that the bounding box will enclose. Each point must have a x, y, and z properties. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided. @@ -806,7 +806,7 @@ export class AxisAlignedBoundingBox { static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; /** * Compares the provided AxisAlignedBoundingBox componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first AxisAlignedBoundingBox. * @param [right] - The second AxisAlignedBoundingBox. * @returns true if left and right are equal, false otherwise. @@ -817,9 +817,9 @@ export class AxisAlignedBoundingBox { * @param box - The bounding box to test. * @param plane - The plane to test against. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane - * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is - * on the opposite side, and {@link Intersect.INTERSECTING} if the box - * intersects the plane. + the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is + on the opposite side, and {@link Intersect.INTERSECTING} if the box + intersects the plane. */ static intersectPlane(box: AxisAlignedBoundingBox, plane: Plane): Intersect; /** @@ -832,20 +832,69 @@ export class AxisAlignedBoundingBox { * Determines which side of a plane this box is located. * @param plane - The plane to test against. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane - * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is - * on the opposite side, and {@link Intersect.INTERSECTING} if the box - * intersects the plane. + the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is + on the opposite side, and {@link Intersect.INTERSECTING} if the box + intersects the plane. */ intersectPlane(plane: Plane): Intersect; /** * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side AxisAlignedBoundingBox. * @returns true if they are equal, false otherwise. */ equals(right?: AxisAlignedBoundingBox): boolean; } +/** + * Computes the barycentric coordinates for a point with respect to a triangle. + * @example + * // Returns Cartesian3.UNIT_X +var p = new Cesium.Cartesian3(-1.0, 0.0, 0.0); +var b = Cesium.barycentricCoordinates(p, + new Cesium.Cartesian3(-1.0, 0.0, 0.0), + new Cesium.Cartesian3( 1.0, 0.0, 0.0), + new Cesium.Cartesian3( 0.0, 1.0, 1.0)); + * @param point - The point to test. + * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis. + * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis. + * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ +export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3; + +/** + * Finds an item in a sorted array. + * @example + * // Create a comparator function to search through an array of numbers. +function comparator(a, b) { + return a - b; +}; +var numbers = [0, 2, 4, 6, 8]; +var index = Cesium.binarySearch(numbers, 6, comparator); // 3 + * @param array - The sorted array to search. + * @param itemToFind - The item to find in the array. + * @param comparator - The function to use to compare the item to + elements in the array. + * @returns The index of itemToFind in the array, if it exists. If itemToFind + does not exist, the return value is a negative number which is the bitwise complement (~) + of the index before which the itemToFind should be inserted in order to maintain the + sorted order of the array. + */ +export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number; + +/** + * A function used to compare two items while performing a binary search. + * @example + * function compareNumbers(a, b) { + return a - b; +} + * @param a - An item in the array. + * @param b - The item being searched for. + */ +export type binarySearchComparator = (a: any, b: any) => number; + /** * Provides geocoding through Bing Maps. * @param options - Object with the following properties: @@ -916,7 +965,7 @@ export class BoundingRectangle { static unpack(array: number[], startingIndex?: number, result?: BoundingRectangle): BoundingRectangle; /** * Computes a bounding rectangle enclosing the list of 2D points. - * The rectangle is oriented with the corner at the bottom left. + The rectangle is oriented with the corner at the bottom left. * @param positions - List of points that the bounding rectangle will enclose. Each point must have x and y properties. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. @@ -962,7 +1011,7 @@ export class BoundingRectangle { static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect; /** * Compares the provided BoundingRectangles componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first BoundingRectangle. * @param [right] - The second BoundingRectangle. * @returns true if left and right are equal, false otherwise. @@ -982,7 +1031,7 @@ export class BoundingRectangle { intersect(right: BoundingRectangle): Intersect; /** * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side BoundingRectangle. * @returns true if they are equal, false otherwise. */ @@ -1006,8 +1055,8 @@ export class BoundingSphere { radius: number; /** * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points. - * The bounding sphere is computed by running two algorithms, a naive algorithm and - * Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit. + The bounding sphere is computed by running two algorithms, a naive algorithm and + Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit. * @param [positions] - An array of points that the bounding sphere will enclose. Each point must have x, y, and z properties. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided. @@ -1023,7 +1072,7 @@ export class BoundingSphere { static fromRectangle2D(rectangle?: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere; /** * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the - * object's minimum and maximum heights over the rectangle. + object's minimum and maximum heights over the rectangle. * @param [rectangle] - The rectangle around which to create a bounding sphere. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D. * @param [minimumHeight = 0.0] - The minimum height over the rectangle. @@ -1034,7 +1083,7 @@ export class BoundingSphere { static fromRectangleWithHeights2D(rectangle?: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere; /** * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points - * on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids. + on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids. * @param [rectangle] - The valid rectangle used to create a bounding sphere. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle. * @param [surfaceHeight = 0.0] - The height above the surface of the ellipsoid. @@ -1044,52 +1093,52 @@ export class BoundingSphere { static fromRectangle3D(rectangle?: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere; /** * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are - * stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two - * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to - * ensure a tight fit. + stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two + algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to + ensure a tight fit. * @example * // Compute the bounding sphere from 3 positions, each specified relative to a center. - * // In addition to the X, Y, and Z coordinates, the points array contains two additional - * // elements per point which are ignored for the purpose of computing the bounding sphere. - * var center = new Cesium.Cartesian3(1.0, 2.0, 3.0); - * var points = [1.0, 2.0, 3.0, 0.1, 0.2, - * 4.0, 5.0, 6.0, 0.1, 0.2, - * 7.0, 8.0, 9.0, 0.1, 0.2]; - * var sphere = Cesium.BoundingSphere.fromVertices(points, center, 5); + // In addition to the X, Y, and Z coordinates, the points array contains two additional + // elements per point which are ignored for the purpose of computing the bounding sphere. + var center = new Cesium.Cartesian3(1.0, 2.0, 3.0); + var points = [1.0, 2.0, 3.0, 0.1, 0.2, + 4.0, 5.0, 6.0, 0.1, 0.2, + 7.0, 8.0, 9.0, 0.1, 0.2]; + var sphere = Cesium.BoundingSphere.fromVertices(points, center, 5); * @param [positions] - An array of points that the bounding sphere will enclose. Each point - * is formed from three elements in the array in the order X, Y, Z. + is formed from three elements in the array in the order X, Y, Z. * @param [center = Cartesian3.ZERO] - The position to which the positions are relative, which need not be the - * origin of the coordinate system. This is useful when the positions are to be used for - * relative-to-center (RTC) rendering. + origin of the coordinate system. This is useful when the positions are to be used for + relative-to-center (RTC) rendering. * @param [stride = 3] - The number of array elements per vertex. It must be at least 3, but it may - * be higher. Regardless of the value of this parameter, the X coordinate of the first position - * is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index - * 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If - * the stride is 5, however, two array elements are skipped and the next position begins at array - * index 5. + be higher. Regardless of the value of this parameter, the X coordinate of the first position + is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index + 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If + the stride is 5, however, two array elements are skipped and the next position begins at array + index 5. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided. */ static fromVertices(positions?: number[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere; /** * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are - * stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two - * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to - * ensure a tight fit. + stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two + algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to + ensure a tight fit. * @param [positionsHigh] - An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point - * is formed from three elements in the array in the order X, Y, Z. + is formed from three elements in the array in the order X, Y, Z. * @param [positionsLow] - An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point - * is formed from three elements in the array in the order X, Y, Z. + is formed from three elements in the array in the order X, Y, Z. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided. */ static fromEncodedCartesianVertices(positionsHigh?: number[], positionsLow?: number[], result?: BoundingSphere): BoundingSphere; /** * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere - * tighly and fully encompases the box. + tighly and fully encompases the box. * @example * // Create a bounding sphere around the unit cube - * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); + var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); * @param [corner] - The minimum height over the rectangle. * @param [oppositeCorner] - The maximum height over the rectangle. * @param [result] - The object onto which to store the result. @@ -1167,9 +1216,9 @@ export class BoundingSphere { * @param sphere - The bounding sphere to test. * @param plane - The plane to test against. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane - * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is - * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere - * intersects the plane. + the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is + on the opposite side, and {@link Intersect.INTERSECTING} if the sphere + intersects the plane. */ static intersectPlane(sphere: BoundingSphere, plane: Plane): Intersect; /** @@ -1184,9 +1233,9 @@ export class BoundingSphere { * Computes the estimated distance squared from the closest point on a bounding sphere to a point. * @example * // Sort bounding spheres from back to front - * spheres.sort(function(a, b) { - * return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC); - * }); + spheres.sort(function(a, b) { + return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC); + }); * @param sphere - The sphere. * @param cartesian - The point * @returns The estimated distance squared from the bounding sphere to the point. @@ -1194,12 +1243,12 @@ export class BoundingSphere { static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number; /** * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale - * The transformation matrix is not verified to have a uniform scale of 1. - * This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}. + The transformation matrix is not verified to have a uniform scale of 1. + This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}. * @example * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid); - * var boundingSphere = new Cesium.BoundingSphere(); - * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); + var boundingSphere = new Cesium.BoundingSphere(); + var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); * @param sphere - The bounding sphere to apply the transformation to. * @param transform - The transformation matrix to apply to the bounding sphere. * @param [result] - The object onto which to store the result. @@ -1208,10 +1257,10 @@ export class BoundingSphere { static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere; /** * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction - * plus/minus the radius of the bounding sphere. - *
- * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the - * closest and farthest planes from position that intersect the bounding sphere. + plus/minus the radius of the bounding sphere. +
+ If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the + closest and farthest planes from position that intersect the bounding sphere. * @param sphere - The bounding sphere to calculate the distance to. * @param position - The position to calculate the distance from. * @param direction - The direction from position. @@ -1236,7 +1285,7 @@ export class BoundingSphere { static isOccluded(sphere: BoundingSphere, occluder: Occluder): boolean; /** * Compares the provided BoundingSphere componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first BoundingSphere. * @param [right] - The second BoundingSphere. * @returns true if left and right are equal, false otherwise. @@ -1246,28 +1295,28 @@ export class BoundingSphere { * Determines which side of a plane the sphere is located. * @param plane - The plane to test against. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane - * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is - * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere - * intersects the plane. + the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is + on the opposite side, and {@link Intersect.INTERSECTING} if the sphere + intersects the plane. */ intersectPlane(plane: Plane): Intersect; /** * Computes the estimated distance squared from the closest point on a bounding sphere to a point. * @example * // Sort bounding spheres from back to front - * spheres.sort(function(a, b) { - * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC); - * }); + spheres.sort(function(a, b) { + return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC); + }); * @param cartesian - The point * @returns The estimated distance squared from the bounding sphere to the point. */ distanceSquaredTo(cartesian: Cartesian3): number; /** * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction - * plus/minus the radius of the bounding sphere. - *
- * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the - * closest and farthest planes from position that intersect the bounding sphere. + plus/minus the radius of the bounding sphere. +
+ If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the + closest and farthest planes from position that intersect the bounding sphere. * @param position - The position to calculate the distance from. * @param direction - The direction from position. * @param [result] - A Interval to store the nearest and farthest distances. @@ -1282,7 +1331,7 @@ export class BoundingSphere { isOccluded(occluder: Occluder): boolean; /** * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side BoundingSphere. * @returns true if they are equal, false otherwise. */ @@ -1304,11 +1353,11 @@ export class BoundingSphere { * Describes a cube centered at the origin. * @example * var box = new Cesium.BoxGeometry({ - * vertexFormat : Cesium.VertexFormat.POSITION_ONLY, - * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0), - * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0) - * }); - * var geometry = Cesium.BoxGeometry.createGeometry(box); + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0), + minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0) +}); +var geometry = Cesium.BoxGeometry.createGeometry(box); * @param options - Object with the following properties: * @param options.minimum - The minimum x, y, and z coordinates of the box. * @param options.maximum - The maximum x, y, and z coordinates of the box. @@ -1324,10 +1373,10 @@ export class BoxGeometry { * Creates a cube centered at the origin given its dimensions. * @example * var box = Cesium.BoxGeometry.fromDimensions({ - * vertexFormat : Cesium.VertexFormat.POSITION_ONLY, - * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0) - * }); - * var geometry = Cesium.BoxGeometry.createGeometry(box); + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0) + }); + var geometry = Cesium.BoxGeometry.createGeometry(box); * @param options - Object with the following properties: * @param options.dimensions - The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3, respectively. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. @@ -1340,13 +1389,13 @@ export class BoxGeometry { * Creates a cube from the dimensions of an AxisAlignedBoundingBox. * @example * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ])); - * var box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb); + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ])); + var box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb); * @param boundingBox - A description of the AxisAlignedBoundingBox. */ static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxGeometry; @@ -1382,10 +1431,10 @@ export class BoxGeometry { * A description of the outline of a cube centered at the origin. * @example * var box = new Cesium.BoxOutlineGeometry({ - * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0), - * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0) - * }); - * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box); + maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0), + minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0) +}); +var geometry = Cesium.BoxOutlineGeometry.createGeometry(box); * @param options - Object with the following properties: * @param options.minimum - The minimum x, y, and z coordinates of the box. * @param options.maximum - The maximum x, y, and z coordinates of the box. @@ -1399,9 +1448,9 @@ export class BoxOutlineGeometry { * Creates an outline of a cube centered at the origin given its dimensions. * @example * var box = Cesium.BoxOutlineGeometry.fromDimensions({ - * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0) - * }); - * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box); + dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0) + }); + var geometry = Cesium.BoxOutlineGeometry.createGeometry(box); * @param options - Object with the following properties: * @param options.dimensions - The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3, respectively. */ @@ -1412,15 +1461,15 @@ export class BoxOutlineGeometry { * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox. * @example * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ])); - * var box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb); - * - * + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ])); + var box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb); + + * @param boundingBox - A description of the AxisAlignedBoundingBox. */ static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxOutlineGeometry; @@ -1452,6 +1501,26 @@ export class BoxOutlineGeometry { static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry | undefined; } +/** + * Given a relative URL under the Cesium base URL, returns an absolute URL. + * @example + * var viewer = new Cesium.Viewer("cesiumContainer", { + imageryProvider: new Cesium.TileMapServiceImageryProvider({ + url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), + }), + baseLayerPicker: false, +}); + * @param relativeUrl - The relative path. + * @returns The absolutely URL representation of the provided path. + */ +export function buildModuleUrl(relativeUrl: string): string; + +/** + * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}. + * @param requestID - The value returned by {@link requestAnimationFrame}. + */ +export function cancelAnimationFrame(requestID: number): void; + /** * A 2D Cartesian point. * @param [x = 0.0] - The X component. @@ -1484,7 +1553,7 @@ export class Cartesian2 { static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2; /** * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the - * x and y properties of the Cartesian3 and drops z. + x and y properties of the Cartesian3 and drops z. * @param cartesian - The Cartesian3 instance to create a Cartesian2 instance from. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. @@ -1492,7 +1561,7 @@ export class Cartesian2 { static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; /** * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the - * x and y properties of the Cartesian4 and drops z and w. + x and y properties of the Cartesian4 and drops z and w. * @param cartesian - The Cartesian4 instance to create a Cartesian2 instance from. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. @@ -1536,12 +1605,12 @@ export class Cartesian2 { * Creates a Cartesian2 from two consecutive elements in an array. * @example * // Create a Cartesian2 with (1.0, 2.0) - * var v = [1.0, 2.0]; - * var p = Cesium.Cartesian2.fromArray(v); - * - * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array - * var v2 = [0.0, 0.0, 1.0, 2.0]; - * var p2 = Cesium.Cartesian2.fromArray(v2, 2); + var v = [1.0, 2.0]; + var p = Cesium.Cartesian2.fromArray(v); + + // Create a Cartesian2 with (1.0, 2.0) using an offset into an array + var v2 = [0.0, 0.0, 1.0, 2.0]; + var p2 = Cesium.Cartesian2.fromArray(v2, 2); * @param array - The array whose two consecutive elements correspond to the x and y components, respectively. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component. * @param [result] - The object onto which to store the result. @@ -1592,7 +1661,7 @@ export class Cartesian2 { * Computes the distance between two points. * @example * // Returns 1.0 - * var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0)); + var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0)); * @param left - The first point to compute the distance from. * @param right - The second point to compute the distance to. * @returns The distance between two points. @@ -1600,10 +1669,10 @@ export class Cartesian2 { static distance(left: Cartesian2, right: Cartesian2): number; /** * Computes the squared distance between two points. Comparing squared distances - * using this function is more efficient than comparing distances using {@link Cartesian2#distance}. + using this function is more efficient than comparing distances using {@link Cartesian2#distance}. * @example * // Returns 4.0, not 2.0 - * var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0)); + var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0)); * @param left - The first point to compute the distance from. * @param right - The second point to compute the distance to. * @returns The distance between two points. @@ -1717,7 +1786,7 @@ export class Cartesian2 { static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2; /** * Compares the provided Cartesians componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first Cartesian. * @param [right] - The second Cartesian. * @returns true if left and right are equal, false otherwise. @@ -1725,8 +1794,8 @@ export class Cartesian2 { static equals(left?: Cartesian2, right?: Cartesian2): boolean; /** * Compares the provided Cartesians componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [left] - The first Cartesian. * @param [right] - The second Cartesian. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. @@ -1754,15 +1823,15 @@ export class Cartesian2 { clone(result?: Cartesian2): Cartesian2; /** * Compares this Cartesian against the provided Cartesian componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side Cartesian. * @returns true if they are equal, false otherwise. */ equals(right?: Cartesian2): boolean; /** * Compares this Cartesian against the provided Cartesian componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [right] - The right hand side Cartesian. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. @@ -1821,7 +1890,7 @@ export class Cartesian3 { static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; /** * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the - * x, y, and z properties of the Cartesian4 and drops w. + x, y, and z properties of the Cartesian4 and drops w. * @param cartesian - The Cartesian4 instance to create a Cartesian3 instance from. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. @@ -1865,12 +1934,12 @@ export class Cartesian3 { * Creates a Cartesian3 from three consecutive elements in an array. * @example * // Create a Cartesian3 with (1.0, 2.0, 3.0) - * var v = [1.0, 2.0, 3.0]; - * var p = Cesium.Cartesian3.fromArray(v); - * - * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array - * var v2 = [0.0, 0.0, 1.0, 2.0, 3.0]; - * var p2 = Cesium.Cartesian3.fromArray(v2, 2); + var v = [1.0, 2.0, 3.0]; + var p = Cesium.Cartesian3.fromArray(v); + + // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array + var v2 = [0.0, 0.0, 1.0, 2.0, 3.0]; + var p2 = Cesium.Cartesian3.fromArray(v2, 2); * @param array - The array whose three consecutive elements correspond to the x, y, and z components, respectively. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component. * @param [result] - The object onto which to store the result. @@ -1921,7 +1990,7 @@ export class Cartesian3 { * Computes the distance between two points. * @example * // Returns 1.0 - * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); + var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); * @param left - The first point to compute the distance from. * @param right - The second point to compute the distance to. * @returns The distance between two points. @@ -1929,10 +1998,10 @@ export class Cartesian3 { static distance(left: Cartesian3, right: Cartesian3): number; /** * Computes the squared distance between two points. Comparing squared distances - * using this function is more efficient than comparing distances using {@link Cartesian3#distance}. + using this function is more efficient than comparing distances using {@link Cartesian3#distance}. * @example * // Returns 4.0, not 2.0 - * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); + var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); * @param left - The first point to compute the distance from. * @param right - The second point to compute the distance to. * @returns The distance between two points. @@ -2047,7 +2116,7 @@ export class Cartesian3 { static projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3; /** * Compares the provided Cartesians componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first Cartesian. * @param [right] - The second Cartesian. * @returns true if left and right are equal, false otherwise. @@ -2055,8 +2124,8 @@ export class Cartesian3 { static equals(left?: Cartesian3, right?: Cartesian3): boolean; /** * Compares the provided Cartesians componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [left] - The first Cartesian. * @param [right] - The second Cartesian. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. @@ -2168,15 +2237,15 @@ export class Cartesian3 { clone(result?: Cartesian3): Cartesian3; /** * Compares this Cartesian against the provided Cartesian componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side Cartesian. * @returns true if they are equal, false otherwise. */ equals(right?: Cartesian3): boolean; /** * Compares this Cartesian against the provided Cartesian componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [right] - The right hand side Cartesian. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. @@ -2227,7 +2296,7 @@ export class Cartesian4 { static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4; /** * Creates a Cartesian4 instance from a {@link Color}. red, green, blue, - * and alpha map to x, y, z, and w, respectively. + and alpha map to x, y, z, and w, respectively. * @param color - The source color. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. @@ -2278,12 +2347,12 @@ export class Cartesian4 { * Creates a Cartesian4 from four consecutive elements in an array. * @example * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) - * var v = [1.0, 2.0, 3.0, 4.0]; - * var p = Cesium.Cartesian4.fromArray(v); - * - * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array - * var v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0]; - * var p2 = Cesium.Cartesian4.fromArray(v2, 2); + var v = [1.0, 2.0, 3.0, 4.0]; + var p = Cesium.Cartesian4.fromArray(v); + + // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array + var v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0]; + var p2 = Cesium.Cartesian4.fromArray(v2, 2); * @param array - The array whose four consecutive elements correspond to the x, y, z, and w components, respectively. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component. * @param [result] - The object onto which to store the result. @@ -2334,9 +2403,9 @@ export class Cartesian4 { * Computes the 4-space distance between two points. * @example * // Returns 1.0 - * var d = Cesium.Cartesian4.distance( - * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0), - * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); + var d = Cesium.Cartesian4.distance( + new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0), + new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); * @param left - The first point to compute the distance from. * @param right - The second point to compute the distance to. * @returns The distance between two points. @@ -2344,12 +2413,12 @@ export class Cartesian4 { static distance(left: Cartesian4, right: Cartesian4): number; /** * Computes the squared distance between two points. Comparing squared distances - * using this function is more efficient than comparing distances using {@link Cartesian4#distance}. + using this function is more efficient than comparing distances using {@link Cartesian4#distance}. * @example * // Returns 4.0, not 2.0 - * var d = Cesium.Cartesian4.distance( - * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0), - * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); + var d = Cesium.Cartesian4.distance( + new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0), + new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); * @param left - The first point to compute the distance from. * @param right - The second point to compute the distance to. * @returns The distance between two points. @@ -2449,7 +2518,7 @@ export class Cartesian4 { static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4; /** * Compares the provided Cartesians componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first Cartesian. * @param [right] - The second Cartesian. * @returns true if left and right are equal, false otherwise. @@ -2457,8 +2526,8 @@ export class Cartesian4 { static equals(left?: Cartesian4, right?: Cartesian4): boolean; /** * Compares the provided Cartesians componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [left] - The first Cartesian. * @param [right] - The second Cartesian. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. @@ -2494,15 +2563,15 @@ export class Cartesian4 { clone(result?: Cartesian4): Cartesian4; /** * Compares this Cartesian against the provided Cartesian componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side Cartesian. * @returns true if they are equal, false otherwise. */ equals(right?: Cartesian4): boolean; /** * Compares this Cartesian against the provided Cartesian componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [right] - The right hand side Cartesian. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. @@ -2545,7 +2614,7 @@ export class Cartographic { height: number; /** * Creates a new Cartographic instance from longitude and latitude - * specified in radians. + specified in radians. * @param longitude - The longitude, in radians. * @param latitude - The latitude, in radians. * @param [height = 0.0] - The height, in meters, above the ellipsoid. @@ -2555,8 +2624,8 @@ export class Cartographic { static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic; /** * Creates a new Cartographic instance from longitude and latitude - * specified in degrees. The values in the resulting object will - * be in radians. + specified in degrees. The values in the resulting object will + be in radians. * @param longitude - The longitude, in degrees. * @param latitude - The latitude, in degrees. * @param [height = 0.0] - The height, in meters, above the ellipsoid. @@ -2566,7 +2635,7 @@ export class Cartographic { static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic; /** * Creates a new Cartographic instance from a Cartesian position. The values in the - * resulting object will be in radians. + resulting object will be in radians. * @param cartesian - The Cartesian position to convert to cartographic representation. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies. * @param [result] - The object onto which to store the result. @@ -2575,7 +2644,7 @@ export class Cartographic { static fromCartesian(cartesian: Cartesian3, ellipsoid?: Ellipsoid, result?: Cartographic): Cartographic; /** * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted - * object should be in radians. + object should be in radians. * @param cartographic - Input to be converted into a Cartesian3 output. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies. * @param [result] - The object onto which to store the result. @@ -2591,7 +2660,7 @@ export class Cartographic { static clone(cartographic: Cartographic, result?: Cartographic): Cartographic; /** * Compares the provided cartographics componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first cartographic. * @param [right] - The second cartographic. * @returns true if left and right are equal, false otherwise. @@ -2599,8 +2668,8 @@ export class Cartographic { static equals(left?: Cartographic, right?: Cartographic): boolean; /** * Compares the provided cartographics componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [left] - The first cartographic. * @param [right] - The second cartographic. * @param [epsilon = 0] - The epsilon to use for equality testing. @@ -2619,15 +2688,15 @@ export class Cartographic { clone(result?: Cartographic): Cartographic; /** * Compares the provided against this cartographic componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The second cartographic. * @returns true if left and right are equal, false otherwise. */ equals(right?: Cartographic): boolean; /** * Compares the provided against this cartographic componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [right] - The second cartographic. * @param [epsilon = 0] - The epsilon to use for equality testing. * @returns true if left and right are within the provided epsilon, false otherwise. @@ -2642,7 +2711,7 @@ export class Cartographic { /** * Geocodes queries containing longitude and latitude coordinates and an optional height. - * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters. +Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters. */ export class CartographicGeocoderService { constructor(); @@ -2654,31 +2723,31 @@ export class CartographicGeocoderService { /** * A Catmull-Rom spline is a cubic spline where the tangent at control points, - * except the first and last, are computed using the previous and next control points. - * Catmull-Rom splines are in the class C1. +except the first and last, are computed using the previous and next control points. +Catmull-Rom splines are in the class C1. * @example * // spline above the earth from Philadelphia to Los Angeles - * var spline = new Cesium.CatmullRomSpline({ - * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], - * points : [ - * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), - * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), - * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), - * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), - * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) - * ] - * }); - * - * var p0 = spline.evaluate(times[i]); // equal to positions[i] - * var p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i] +var spline = new Cesium.CatmullRomSpline({ + times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ] +}); + +var p0 = spline.evaluate(times[i]); // equal to positions[i] +var p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i] * @param options - Object with the following properties: * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. - * The values are in no way connected to the clock time. They are the parameterization for the curve. + The values are in no way connected to the clock time. They are the parameterization for the curve. * @param options.points - The array of {@link Cartesian3} control points. * @param [options.firstTangent] - The tangent of the curve at the first control point. - * If the tangent is not given, it will be estimated. + If the tangent is not given, it will be estimated. * @param [options.lastTangent] - The tangent of the curve at the last control point. - * If the tangent is not given, it will be estimated. + If the tangent is not given, it will be estimated. */ export class CatmullRomSpline { constructor(options: { @@ -2705,7 +2774,7 @@ export class CatmullRomSpline { readonly lastTangent: Cartesian3; /** * Finds an index i in times such that the parameter - * time is in the interval [times[i], times[i + 1]]. + time is in the interval [times[i], times[i + 1]]. * @param time - The time. * @returns The index for the element at the start of the interval. */ @@ -2735,12 +2804,12 @@ export class CatmullRomSpline { * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format. * @example * // Create Arctic DEM terrain with normals. - * var viewer = new Cesium.Viewer('cesiumContainer', { - * terrainProvider : new Cesium.CesiumTerrainProvider({ - * url : Cesium.IonResource.fromAssetId(3956), - * requestVertexNormals : true - * }) - * }); +var viewer = new Cesium.Viewer('cesiumContainer', { + terrainProvider : new Cesium.CesiumTerrainProvider({ + url : Cesium.IonResource.fromAssetId(3956), + requestVertexNormals : true + }) +}); * @param options - Object with the following properties: * @param options.url - The URL of the Cesium terrain server. * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available. @@ -2760,31 +2829,31 @@ export class CesiumTerrainProvider { }); /** * Requests the geometry for a given tile. This function should not be called before - * {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and - * may optionally include a water mask and an indication of which child tiles are available. + {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and + may optionally include a water mask and an indication of which child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method - * returns undefined instead of a promise, it is an indication that too many requests are already - * pending and the request will be retried later. + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit - * the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true. + the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true. */ credit: Credit; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link CesiumTerrainProvider#ready} returns true. + not be called before {@link CesiumTerrainProvider#ready} returns true. */ tilingScheme: GeographicTilingScheme; /** @@ -2797,47 +2866,47 @@ export class CesiumTerrainProvider { readonly readyPromise: Promise; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask - * indicates which areas of the globe are water rather than land, so they can be rendered - * as a reflective surface with animated waves. This function should not be - * called before {@link CesiumTerrainProvider#ready} returns true. + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link CesiumTerrainProvider#ready} returns true. */ hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. - * This function should not be called before {@link CesiumTerrainProvider#ready} returns true. + This function should not be called before {@link CesiumTerrainProvider#ready} returns true. */ hasVertexNormals: boolean; /** * Gets a value indicating whether or not the requested tiles include metadata. - * This function should not be called before {@link CesiumTerrainProvider#ready} returns true. + This function should not be called before {@link CesiumTerrainProvider#ready} returns true. */ hasMetadata: boolean; /** * Boolean flag that indicates if the client should request vertex normals from the server. - * Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and - * if the server provides vertex normals. + Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and + if the server provides vertex normals. */ requestVertexNormals: boolean; /** * Boolean flag that indicates if the client should request a watermask from the server. - * Watermask data is appended to the standard tile mesh data only if the client requests the watermask and - * if the server provides a watermask. + Watermask data is appended to the standard tile mesh data only if the client requests the watermask and + if the server provides a watermask. */ requestWaterMask: boolean; /** * Boolean flag that indicates if the client should request metadata from the server. - * Metadata is appended to the standard tile mesh data only if the client requests the metadata and - * if the server provides a metadata. + Metadata is appended to the standard tile mesh data only if the client requests the metadata and + if the server provides a metadata. */ requestMetadata: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as - * at points and in rectangles. This function should not be called before - * {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability - * information is not available. Note that this reflects tiles that are known to be available currently. - * Additional tiles may be discovered to be available in the future, e.g. if availability information - * exists deeper in the tree rather than it all being discoverable at the root. However, a tile that - * is available now will not become unavailable in the future. + at points and in rectangles. This function should not be called before + {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. Note that this reflects tiles that are known to be available currently. + Additional tiles may be discovered to be available in the future, e.g. if availability information + exists deeper in the tree rather than it all being discoverable at the root. However, a tile that + is available now will not become unavailable in the future. */ availability: TileAvailability; /** @@ -2868,11 +2937,11 @@ export class CesiumTerrainProvider { * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. * @example * // Create a circle. - * var circle = new Cesium.CircleGeometry({ - * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), - * radius : 100000.0 - * }); - * var geometry = Cesium.CircleGeometry.createGeometry(circle); +var circle = new Cesium.CircleGeometry({ + center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), + radius : 100000.0 +}); +var geometry = Cesium.CircleGeometry.createGeometry(circle); * @param options - Object with the following properties: * @param options.center - The circle's center point in the fixed frame. * @param options.radius - The radius in meters. @@ -2926,11 +2995,11 @@ export class CircleGeometry { * A description of the outline of a circle on the ellipsoid. * @example * // Create a circle. - * var circle = new Cesium.CircleOutlineGeometry({ - * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), - * radius : 100000.0 - * }); - * var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle); +var circle = new Cesium.CircleOutlineGeometry({ + center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), + radius : 100000.0 +}); +var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle); * @param options - Object with the following properties: * @param options.center - The circle's center point in the fixed frame. * @param options.radius - The radius in meters. @@ -2982,13 +3051,13 @@ export class CircleOutlineGeometry { * A simple clock for keeping track of simulated time. * @example * // Create a clock that loops on Christmas day 2013 and runs in real-time. - * var clock = new Cesium.Clock({ - * startTime : Cesium.JulianDate.fromIso8601("2013-12-25"), - * currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"), - * stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"), - * clockRange : Cesium.ClockRange.LOOP_STOP, - * clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER - * }); +var clock = new Cesium.Clock({ + startTime : Cesium.JulianDate.fromIso8601("2013-12-25"), + currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"), + stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"), + clockRange : Cesium.ClockRange.LOOP_STOP, + clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER +}); * @param [options] - Object with the following properties: * @param [options.startTime] - The start time of the clock. * @param [options.stopTime] - The stop time of the clock. @@ -3020,14 +3089,14 @@ export class Clock { stopTime: JulianDate; /** * Determines how the clock should behave when - * {@link Clock#startTime} or {@link Clock#stopTime} - * is reached. + {@link Clock#startTime} or {@link Clock#stopTime} + is reached. */ clockRange: ClockRange; /** * Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered, - * for example. The clock will only advance time when both - * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true. + for example. The clock will only advance time when both + {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true. */ canAnimate: boolean; /** @@ -3040,41 +3109,41 @@ export class Clock { onStop: Event; /** * The current time. - * Changing this property will change - * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to - * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. + Changing this property will change + {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to + {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. */ currentTime: JulianDate; /** * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards. - * If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance. - * If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the - * elapsed system time since the last call to {@link Clock#tick}. - * Changing this property will change - * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to - * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. + If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance. + If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the + elapsed system time since the last call to {@link Clock#tick}. + Changing this property will change + {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to + {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. */ multiplier: number; /** * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent. - * Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set - * {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and - * {@link Clock#currentTime} to the current system clock time. + Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set + {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and + {@link Clock#currentTime} to the current system clock time. */ clockStep: ClockStep; /** * Indicates whether {@link Clock#tick} should attempt to advance time. - * The clock will only advance time when both - * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true. - * Changing this property will change - * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to - * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. + The clock will only advance time when both + {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true. + Changing this property will change + {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to + {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. */ shouldAnimate: boolean; /** * Advances the clock from the current time based on the current configuration options. - * tick should be called every frame, regardless of whether animation is taking place - * or not. To control animation, use the {@link Clock#shouldAnimate} property. + tick should be called every frame, regardless of whether animation is taking place + or not. To control animation, use the {@link Clock#shouldAnimate} property. * @returns The new value of the {@link Clock#currentTime} property. */ tick(): JulianDate; @@ -3082,7 +3151,7 @@ export class Clock { /** * Constants used by {@link Clock#tick} to determine behavior - * when {@link Clock#startTime} or {@link Clock#stopTime} is reached. +when {@link Clock#startTime} or {@link Clock#stopTime} is reached. */ export enum ClockRange { /** @@ -3091,43 +3160,51 @@ export enum ClockRange { UNBOUNDED = 0, /** * When {@link Clock#startTime} or {@link Clock#stopTime} is reached, - * {@link Clock#tick} will not advance {@link Clock#currentTime} any further. + {@link Clock#tick} will not advance {@link Clock#currentTime} any further. */ CLAMPED = 1, /** * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance - * {@link Clock#currentTime} to the opposite end of the interval. When - * time is moving backwards, {@link Clock#tick} will not advance past - * {@link Clock#startTime} + {@link Clock#currentTime} to the opposite end of the interval. When + time is moving backwards, {@link Clock#tick} will not advance past + {@link Clock#startTime} */ LOOP_STOP = 2 } /** * Constants to determine how much time advances with each call - * to {@link Clock#tick}. +to {@link Clock#tick}. */ export enum ClockStep { /** * {@link Clock#tick} advances the current time by a fixed step, - * which is the number of seconds specified by {@link Clock#multiplier}. + which is the number of seconds specified by {@link Clock#multiplier}. */ TICK_DEPENDENT = 0, /** * {@link Clock#tick} advances the current time by the amount of system - * time elapsed since the previous call multiplied by {@link Clock#multiplier}. + time elapsed since the previous call multiplied by {@link Clock#multiplier}. */ SYSTEM_CLOCK_MULTIPLIER = 1, /** * {@link Clock#tick} sets the clock to the current system time; - * ignoring all other settings. + ignoring all other settings. */ SYSTEM_CLOCK = 2 } +/** + * Clones an object, returning a new object containing the same properties. + * @param object - The object to clone. + * @param [deep = false] - If true, all properties will be deep cloned recursively. + * @returns The cloned object. + */ +export function clone(object: any, deep?: boolean): any; + /** * A color, specified using red, green, blue, and alpha values, - * which range from 0 (no intensity) to 1.0 (full intensity). +which range from 0 (no intensity) to 1.0 (full intensity). * @param [red = 1.0] - The red component. * @param [green = 1.0] - The green component. * @param [blue = 1.0] - The blue component. @@ -3153,7 +3230,7 @@ export class Color { alpha: number; /** * Creates a Color instance from a {@link Cartesian4}. x, y, z, - * and w map to red, green, blue, and alpha, respectively. + and w map to red, green, blue, and alpha, respectively. * @param cartesian - The source cartesian. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Color instance if one was not provided. @@ -3161,7 +3238,7 @@ export class Color { static fromCartesian4(cartesian: Cartesian4, result?: Color): Color; /** * Creates a new Color specified using red, green, blue, and alpha values - * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0. + that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0. * @param [red = 255] - The red component. * @param [green = 255] - The green component. * @param [blue = 255] - The blue component. @@ -3172,7 +3249,7 @@ export class Color { static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color; /** * Creates a new Color that has the same red, green, and blue components - * of the specified color, but with the specified alpha value. + of the specified color, but with the specified alpha value. * @example * var translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9); * @param color - The base color @@ -3183,7 +3260,7 @@ export class Color { static fromAlpha(color: Color, alpha: number, result?: Color): Color; /** * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness - * of the system. + of the system. * @example * var color = Cesium.Color.fromRgba(0x67ADDFFF); * @param rgba - A single numeric unsigned 32-bit RGBA value. @@ -3203,25 +3280,25 @@ export class Color { static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number, result?: Color): Color; /** * Creates a random color using the provided options. For reproducible random colors, you should - * call {@link Math#setRandomNumberSeed} once at the beginning of your application. + call {@link Math#setRandomNumberSeed} once at the beginning of your application. * @example * //Create a completely random color - * var color = Cesium.Color.fromRandom(); - * - * //Create a random shade of yellow. - * var color = Cesium.Color.fromRandom({ - * red : 1.0, - * green : 1.0, - * alpha : 1.0 - * }); - * - * //Create a random bright color. - * var color = Cesium.Color.fromRandom({ - * minimumRed : 0.75, - * minimumGreen : 0.75, - * minimumBlue : 0.75, - * alpha : 1.0 - * }); + var color = Cesium.Color.fromRandom(); + + //Create a random shade of yellow. + var color = Cesium.Color.fromRandom({ + red : 1.0, + green : 1.0, + alpha : 1.0 + }); + + //Create a random bright color. + var color = Cesium.Color.fromRandom({ + minimumRed : 0.75, + minimumGreen : 0.75, + minimumBlue : 0.75, + alpha : 1.0 + }); * @param [options] - Object with the following properties: * @param [options.red] - If specified, the red component to use instead of a randomized value. * @param [options.minimumRed = 0.0] - The maximum red value to generate if none was specified. @@ -3256,7 +3333,7 @@ export class Color { * Creates a Color instance from a CSS color value. * @example * var cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF'); - * var green = Cesium.Color.fromCssColorString('green'); + var green = Cesium.Color.fromCssColorString('green'); * @param color - The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format. * @param [result] - The object to store the result in, if undefined a new instance will be created. * @returns The color object, or undefined if the string was not a valid CSS color. @@ -3284,14 +3361,14 @@ export class Color { static unpack(array: number[], startingIndex?: number, result?: Color): Color; /** * Converts a 'byte' color component in the range of 0 to 255 into - * a 'float' color component in the range of 0 to 1.0. + a 'float' color component in the range of 0 to 1.0. * @param number - The number to be converted. * @returns The converted number. */ static byteToFloat(number: number): number; /** * Converts a 'float' color component in the range of 0 to 1.0 into - * a 'byte' color component in the range of 0 to 255. + a 'byte' color component in the range of 0 to 255. * @param number - The number to be converted. * @returns The converted number. */ @@ -3346,14 +3423,14 @@ export class Color { toCssHexString(): string; /** * Converts this color to an array of red, green, blue, and alpha values - * that are in the range of 0 to 255. + that are in the range of 0 to 255. * @param [result] - The array to store the result in, if undefined a new instance will be created. * @returns The modified result parameter or a new instance if result was undefined. */ toBytes(result?: number[]): number[]; /** * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness - * of the system. + of the system. * @example * var rgba = Cesium.Color.BLUE.toRgba(); * @returns A single numeric unsigned 32-bit RGBA value. @@ -3379,7 +3456,7 @@ export class Color { darken(magnitude: number, result: Color): Color; /** * Creates a new Color that has the same red, green, and blue components - * as this Color, but with the specified alpha value. + as this Color, but with the specified alpha value. * @example * var translucentRed = Cesium.Color.RED.withAlpha(0.9); * @param alpha - The new alpha component. @@ -3454,737 +3531,737 @@ export class Color { static divideByScalar(color: Color, scalar: number, result: Color): Color; /** * An immutable Color instance initialized to CSS color #F0F8FF - * + */ static readonly ALICEBLUE: Color; /** * An immutable Color instance initialized to CSS color #FAEBD7 - * + */ static readonly ANTIQUEWHITE: Color; /** * An immutable Color instance initialized to CSS color #00FFFF - * + */ static readonly AQUA: Color; /** * An immutable Color instance initialized to CSS color #7FFFD4 - * + */ static readonly AQUAMARINE: Color; /** * An immutable Color instance initialized to CSS color #F0FFFF - * + */ static readonly AZURE: Color; /** * An immutable Color instance initialized to CSS color #F5F5DC - * + */ static readonly BEIGE: Color; /** * An immutable Color instance initialized to CSS color #FFE4C4 - * + */ static readonly BISQUE: Color; /** * An immutable Color instance initialized to CSS color #000000 - * + */ static readonly BLACK: Color; /** * An immutable Color instance initialized to CSS color #FFEBCD - * + */ static readonly BLANCHEDALMOND: Color; /** * An immutable Color instance initialized to CSS color #0000FF - * + */ static readonly BLUE: Color; /** * An immutable Color instance initialized to CSS color #8A2BE2 - * + */ static readonly BLUEVIOLET: Color; /** * An immutable Color instance initialized to CSS color #A52A2A - * + */ static readonly BROWN: Color; /** * An immutable Color instance initialized to CSS color #DEB887 - * + */ static readonly BURLYWOOD: Color; /** * An immutable Color instance initialized to CSS color #5F9EA0 - * + */ static readonly CADETBLUE: Color; /** * An immutable Color instance initialized to CSS color #7FFF00 - * + */ static readonly CHARTREUSE: Color; /** * An immutable Color instance initialized to CSS color #D2691E - * + */ static readonly CHOCOLATE: Color; /** * An immutable Color instance initialized to CSS color #FF7F50 - * + */ static readonly CORAL: Color; /** * An immutable Color instance initialized to CSS color #6495ED - * + */ static readonly CORNFLOWERBLUE: Color; /** * An immutable Color instance initialized to CSS color #FFF8DC - * + */ static readonly CORNSILK: Color; /** * An immutable Color instance initialized to CSS color #DC143C - * + */ static readonly CRIMSON: Color; /** * An immutable Color instance initialized to CSS color #00FFFF - * + */ static readonly CYAN: Color; /** * An immutable Color instance initialized to CSS color #00008B - * + */ static readonly DARKBLUE: Color; /** * An immutable Color instance initialized to CSS color #008B8B - * + */ static readonly DARKCYAN: Color; /** * An immutable Color instance initialized to CSS color #B8860B - * + */ static readonly DARKGOLDENROD: Color; /** * An immutable Color instance initialized to CSS color #A9A9A9 - * + */ static readonly DARKGRAY: Color; /** * An immutable Color instance initialized to CSS color #006400 - * + */ static readonly DARKGREEN: Color; /** * An immutable Color instance initialized to CSS color #A9A9A9 - * + */ static readonly DARKGREY: Color; /** * An immutable Color instance initialized to CSS color #BDB76B - * + */ static readonly DARKKHAKI: Color; /** * An immutable Color instance initialized to CSS color #8B008B - * + */ static readonly DARKMAGENTA: Color; /** * An immutable Color instance initialized to CSS color #556B2F - * + */ static readonly DARKOLIVEGREEN: Color; /** * An immutable Color instance initialized to CSS color #FF8C00 - * + */ static readonly DARKORANGE: Color; /** * An immutable Color instance initialized to CSS color #9932CC - * + */ static readonly DARKORCHID: Color; /** * An immutable Color instance initialized to CSS color #8B0000 - * + */ static readonly DARKRED: Color; /** * An immutable Color instance initialized to CSS color #E9967A - * + */ static readonly DARKSALMON: Color; /** * An immutable Color instance initialized to CSS color #8FBC8F - * + */ static readonly DARKSEAGREEN: Color; /** * An immutable Color instance initialized to CSS color #483D8B - * + */ static readonly DARKSLATEBLUE: Color; /** * An immutable Color instance initialized to CSS color #2F4F4F - * + */ static readonly DARKSLATEGRAY: Color; /** * An immutable Color instance initialized to CSS color #2F4F4F - * + */ static readonly DARKSLATEGREY: Color; /** * An immutable Color instance initialized to CSS color #00CED1 - * + */ static readonly DARKTURQUOISE: Color; /** * An immutable Color instance initialized to CSS color #9400D3 - * + */ static readonly DARKVIOLET: Color; /** * An immutable Color instance initialized to CSS color #FF1493 - * + */ static readonly DEEPPINK: Color; /** * An immutable Color instance initialized to CSS color #00BFFF - * + */ static readonly DEEPSKYBLUE: Color; /** * An immutable Color instance initialized to CSS color #696969 - * + */ static readonly DIMGRAY: Color; /** * An immutable Color instance initialized to CSS color #696969 - * + */ static readonly DIMGREY: Color; /** * An immutable Color instance initialized to CSS color #1E90FF - * + */ static readonly DODGERBLUE: Color; /** * An immutable Color instance initialized to CSS color #B22222 - * + */ static readonly FIREBRICK: Color; /** * An immutable Color instance initialized to CSS color #FFFAF0 - * + */ static readonly FLORALWHITE: Color; /** * An immutable Color instance initialized to CSS color #228B22 - * + */ static readonly FORESTGREEN: Color; /** * An immutable Color instance initialized to CSS color #FF00FF - * + */ static readonly FUCHSIA: Color; /** * An immutable Color instance initialized to CSS color #DCDCDC - * + */ static readonly GAINSBORO: Color; /** * An immutable Color instance initialized to CSS color #F8F8FF - * + */ static readonly GHOSTWHITE: Color; /** * An immutable Color instance initialized to CSS color #FFD700 - * + */ static readonly GOLD: Color; /** * An immutable Color instance initialized to CSS color #DAA520 - * + */ static readonly GOLDENROD: Color; /** * An immutable Color instance initialized to CSS color #808080 - * + */ static readonly GRAY: Color; /** * An immutable Color instance initialized to CSS color #008000 - * + */ static readonly GREEN: Color; /** * An immutable Color instance initialized to CSS color #ADFF2F - * + */ static readonly GREENYELLOW: Color; /** * An immutable Color instance initialized to CSS color #808080 - * + */ static readonly GREY: Color; /** * An immutable Color instance initialized to CSS color #F0FFF0 - * + */ static readonly HONEYDEW: Color; /** * An immutable Color instance initialized to CSS color #FF69B4 - * + */ static readonly HOTPINK: Color; /** * An immutable Color instance initialized to CSS color #CD5C5C - * + */ static readonly INDIANRED: Color; /** * An immutable Color instance initialized to CSS color #4B0082 - * + */ static readonly INDIGO: Color; /** * An immutable Color instance initialized to CSS color #FFFFF0 - * + */ static readonly IVORY: Color; /** * An immutable Color instance initialized to CSS color #F0E68C - * + */ static readonly KHAKI: Color; /** * An immutable Color instance initialized to CSS color #E6E6FA - * + */ static readonly LAVENDER: Color; /** * An immutable Color instance initialized to CSS color #FFF0F5 - * + */ static readonly LAVENDAR_BLUSH: Color; /** * An immutable Color instance initialized to CSS color #7CFC00 - * + */ static readonly LAWNGREEN: Color; /** * An immutable Color instance initialized to CSS color #FFFACD - * + */ static readonly LEMONCHIFFON: Color; /** * An immutable Color instance initialized to CSS color #ADD8E6 - * + */ static readonly LIGHTBLUE: Color; /** * An immutable Color instance initialized to CSS color #F08080 - * + */ static readonly LIGHTCORAL: Color; /** * An immutable Color instance initialized to CSS color #E0FFFF - * + */ static readonly LIGHTCYAN: Color; /** * An immutable Color instance initialized to CSS color #FAFAD2 - * + */ static readonly LIGHTGOLDENRODYELLOW: Color; /** * An immutable Color instance initialized to CSS color #D3D3D3 - * + */ static readonly LIGHTGRAY: Color; /** * An immutable Color instance initialized to CSS color #90EE90 - * + */ static readonly LIGHTGREEN: Color; /** * An immutable Color instance initialized to CSS color #D3D3D3 - * + */ static readonly LIGHTGREY: Color; /** * An immutable Color instance initialized to CSS color #FFB6C1 - * + */ static readonly LIGHTPINK: Color; /** * An immutable Color instance initialized to CSS color #20B2AA - * + */ static readonly LIGHTSEAGREEN: Color; /** * An immutable Color instance initialized to CSS color #87CEFA - * + */ static readonly LIGHTSKYBLUE: Color; /** * An immutable Color instance initialized to CSS color #778899 - * + */ static readonly LIGHTSLATEGRAY: Color; /** * An immutable Color instance initialized to CSS color #778899 - * + */ static readonly LIGHTSLATEGREY: Color; /** * An immutable Color instance initialized to CSS color #B0C4DE - * + */ static readonly LIGHTSTEELBLUE: Color; /** * An immutable Color instance initialized to CSS color #FFFFE0 - * + */ static readonly LIGHTYELLOW: Color; /** * An immutable Color instance initialized to CSS color #00FF00 - * + */ static readonly LIME: Color; /** * An immutable Color instance initialized to CSS color #32CD32 - * + */ static readonly LIMEGREEN: Color; /** * An immutable Color instance initialized to CSS color #FAF0E6 - * + */ static readonly LINEN: Color; /** * An immutable Color instance initialized to CSS color #FF00FF - * + */ static readonly MAGENTA: Color; /** * An immutable Color instance initialized to CSS color #800000 - * + */ static readonly MAROON: Color; /** * An immutable Color instance initialized to CSS color #66CDAA - * + */ static readonly MEDIUMAQUAMARINE: Color; /** * An immutable Color instance initialized to CSS color #0000CD - * + */ static readonly MEDIUMBLUE: Color; /** * An immutable Color instance initialized to CSS color #BA55D3 - * + */ static readonly MEDIUMORCHID: Color; /** * An immutable Color instance initialized to CSS color #9370DB - * + */ static readonly MEDIUMPURPLE: Color; /** * An immutable Color instance initialized to CSS color #3CB371 - * + */ static readonly MEDIUMSEAGREEN: Color; /** * An immutable Color instance initialized to CSS color #7B68EE - * + */ static readonly MEDIUMSLATEBLUE: Color; /** * An immutable Color instance initialized to CSS color #00FA9A - * + */ static readonly MEDIUMSPRINGGREEN: Color; /** * An immutable Color instance initialized to CSS color #48D1CC - * + */ static readonly MEDIUMTURQUOISE: Color; /** * An immutable Color instance initialized to CSS color #C71585 - * + */ static readonly MEDIUMVIOLETRED: Color; /** * An immutable Color instance initialized to CSS color #191970 - * + */ static readonly MIDNIGHTBLUE: Color; /** * An immutable Color instance initialized to CSS color #F5FFFA - * + */ static readonly MINTCREAM: Color; /** * An immutable Color instance initialized to CSS color #FFE4E1 - * + */ static readonly MISTYROSE: Color; /** * An immutable Color instance initialized to CSS color #FFE4B5 - * + */ static readonly MOCCASIN: Color; /** * An immutable Color instance initialized to CSS color #FFDEAD - * + */ static readonly NAVAJOWHITE: Color; /** * An immutable Color instance initialized to CSS color #000080 - * + */ static readonly NAVY: Color; /** * An immutable Color instance initialized to CSS color #FDF5E6 - * + */ static readonly OLDLACE: Color; /** * An immutable Color instance initialized to CSS color #808000 - * + */ static readonly OLIVE: Color; /** * An immutable Color instance initialized to CSS color #6B8E23 - * + */ static readonly OLIVEDRAB: Color; /** * An immutable Color instance initialized to CSS color #FFA500 - * + */ static readonly ORANGE: Color; /** * An immutable Color instance initialized to CSS color #FF4500 - * + */ static readonly ORANGERED: Color; /** * An immutable Color instance initialized to CSS color #DA70D6 - * + */ static readonly ORCHID: Color; /** * An immutable Color instance initialized to CSS color #EEE8AA - * + */ static readonly PALEGOLDENROD: Color; /** * An immutable Color instance initialized to CSS color #98FB98 - * + */ static readonly PALEGREEN: Color; /** * An immutable Color instance initialized to CSS color #AFEEEE - * + */ static readonly PALETURQUOISE: Color; /** * An immutable Color instance initialized to CSS color #DB7093 - * + */ static readonly PALEVIOLETRED: Color; /** * An immutable Color instance initialized to CSS color #FFEFD5 - * + */ static readonly PAPAYAWHIP: Color; /** * An immutable Color instance initialized to CSS color #FFDAB9 - * + */ static readonly PEACHPUFF: Color; /** * An immutable Color instance initialized to CSS color #CD853F - * + */ static readonly PERU: Color; /** * An immutable Color instance initialized to CSS color #FFC0CB - * + */ static readonly PINK: Color; /** * An immutable Color instance initialized to CSS color #DDA0DD - * + */ static readonly PLUM: Color; /** * An immutable Color instance initialized to CSS color #B0E0E6 - * + */ static readonly POWDERBLUE: Color; /** * An immutable Color instance initialized to CSS color #800080 - * + */ static readonly PURPLE: Color; /** * An immutable Color instance initialized to CSS color #FF0000 - * + */ static readonly RED: Color; /** * An immutable Color instance initialized to CSS color #BC8F8F - * + */ static readonly ROSYBROWN: Color; /** * An immutable Color instance initialized to CSS color #4169E1 - * + */ static readonly ROYALBLUE: Color; /** * An immutable Color instance initialized to CSS color #8B4513 - * + */ static readonly SADDLEBROWN: Color; /** * An immutable Color instance initialized to CSS color #FA8072 - * + */ static readonly SALMON: Color; /** * An immutable Color instance initialized to CSS color #F4A460 - * + */ static readonly SANDYBROWN: Color; /** * An immutable Color instance initialized to CSS color #2E8B57 - * + */ static readonly SEAGREEN: Color; /** * An immutable Color instance initialized to CSS color #FFF5EE - * + */ static readonly SEASHELL: Color; /** * An immutable Color instance initialized to CSS color #A0522D - * + */ static readonly SIENNA: Color; /** * An immutable Color instance initialized to CSS color #C0C0C0 - * + */ static readonly SILVER: Color; /** * An immutable Color instance initialized to CSS color #87CEEB - * + */ static readonly SKYBLUE: Color; /** * An immutable Color instance initialized to CSS color #6A5ACD - * + */ static readonly SLATEBLUE: Color; /** * An immutable Color instance initialized to CSS color #708090 - * + */ static readonly SLATEGRAY: Color; /** * An immutable Color instance initialized to CSS color #708090 - * + */ static readonly SLATEGREY: Color; /** * An immutable Color instance initialized to CSS color #FFFAFA - * + */ static readonly SNOW: Color; /** * An immutable Color instance initialized to CSS color #00FF7F - * + */ static readonly SPRINGGREEN: Color; /** * An immutable Color instance initialized to CSS color #4682B4 - * + */ static readonly STEELBLUE: Color; /** * An immutable Color instance initialized to CSS color #D2B48C - * + */ static readonly TAN: Color; /** * An immutable Color instance initialized to CSS color #008080 - * + */ static readonly TEAL: Color; /** * An immutable Color instance initialized to CSS color #D8BFD8 - * + */ static readonly THISTLE: Color; /** * An immutable Color instance initialized to CSS color #FF6347 - * + */ static readonly TOMATO: Color; /** * An immutable Color instance initialized to CSS color #40E0D0 - * + */ static readonly TURQUOISE: Color; /** * An immutable Color instance initialized to CSS color #EE82EE - * + */ static readonly VIOLET: Color; /** * An immutable Color instance initialized to CSS color #F5DEB3 - * + */ static readonly WHEAT: Color; /** * An immutable Color instance initialized to CSS color #FFFFFF - * + */ static readonly WHITE: Color; /** * An immutable Color instance initialized to CSS color #F5F5F5 - * + */ static readonly WHITESMOKE: Color; /** * An immutable Color instance initialized to CSS color #FFFF00 - * + */ static readonly YELLOW: Color; /** * An immutable Color instance initialized to CSS color #9ACD32 - * + */ static readonly YELLOWGREEN: Color; /** * An immutable Color instance initialized to CSS transparent. - * + */ static readonly TRANSPARENT: Color; } @@ -4193,16 +4270,16 @@ export class Color { * Value and type information for per-instance geometry color. * @example * var instance = new Cesium.GeometryInstance({ - * geometry : Cesium.BoxGeometry.fromDimensions({ - * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) - * }), - * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( - * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), - * id : 'box', - * attributes : { - * color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha) - * } - * }); + geometry : Cesium.BoxGeometry.fromDimensions({ + dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + id : 'box', + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha) + } +}); * @param [red = 1.0] - The red component. * @param [green = 1.0] - The green component. * @param [blue = 1.0] - The blue component. @@ -4216,7 +4293,7 @@ export class ColorGeometryInstanceAttribute { value: Uint8Array; /** * The datatype of each component in the attribute, e.g., individual elements in - * {@link ColorGeometryInstanceAttribute#value}. + {@link ColorGeometryInstanceAttribute#value}. */ readonly componentDatatype: ComponentDatatype; /** @@ -4225,19 +4302,19 @@ export class ColorGeometryInstanceAttribute { readonly componentsPerAttribute: number; /** * When true and componentDatatype is an integer format, - * indicate that the components should be mapped to the range [0, 1] (unsigned) - * or [-1, 1] (signed) when they are accessed as floating-point for rendering. + indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. */ readonly normalize: boolean; /** * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}. * @example * var instance = new Cesium.GeometryInstance({ - * geometry : geometry, - * attributes : { - * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE), - * } - * }); + geometry : geometry, + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE), + } + }); * @param color - The color. * @returns The new {@link ColorGeometryInstanceAttribute} instance. */ @@ -4246,7 +4323,7 @@ export class ColorGeometryInstanceAttribute { * Converts a color to a typed array that can be used to assign a color attribute. * @example * var attributes = primitive.getGeometryInstanceAttributes('an id'); - * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color); * @param color - The color. * @param [result] - The array to store the result in, if undefined a new instance will be created. * @returns The modified result parameter or a new instance if result was undefined. @@ -4254,7 +4331,7 @@ export class ColorGeometryInstanceAttribute { static toValue(color: Color, result?: Uint8Array): Uint8Array; /** * Compares the provided ColorGeometryInstanceAttributes and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first ColorGeometryInstanceAttribute. * @param [right] - The second ColorGeometryInstanceAttribute. * @returns true if left and right are equal, false otherwise. @@ -4262,50 +4339,79 @@ export class ColorGeometryInstanceAttribute { static equals(left?: ColorGeometryInstanceAttribute, right?: ColorGeometryInstanceAttribute): boolean; } +/** + * Merges two objects, copying their properties onto a new combined object. When two objects have the same +property, the value of the property on the first object is used. If either object is undefined, +it will be treated as an empty object. + * @example + * var object1 = { + propOne : 1, + propTwo : { + value1 : 10 + } +} +var object2 = { + propTwo : 2 +} +var final = Cesium.combine(object1, object2); + +// final === { +// propOne : 1, +// propTwo : { +// value1 : 10 +// } +// } + * @param [object1] - The first object to merge. + * @param [object2] - The second object to merge. + * @param [deep = false] - Perform a recursive merge. + * @returns The combined object containing all properties from both objects. + */ +export function combine(object1?: any, object2?: any, deep?: boolean): any; + /** * WebGL component datatypes. Components are intrinsics, - * which form attributes, which form vertices. +which form attributes, which form vertices. */ export enum ComponentDatatype { /** * 8-bit signed byte corresponding to gl.BYTE and the type - * of an element in Int8Array. + of an element in Int8Array. */ BYTE = WebGLConstants.BYTE, /** * 8-bit unsigned byte corresponding to UNSIGNED_BYTE and the type - * of an element in Uint8Array. + of an element in Uint8Array. */ UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE, /** * 16-bit signed short corresponding to SHORT and the type - * of an element in Int16Array. + of an element in Int16Array. */ SHORT = WebGLConstants.SHORT, /** * 16-bit unsigned short corresponding to UNSIGNED_SHORT and the type - * of an element in Uint16Array. + of an element in Uint16Array. */ UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT, /** * 32-bit signed int corresponding to INT and the type - * of an element in Int32Array. + of an element in Int32Array. */ INT = WebGLConstants.INT, /** * 32-bit unsigned int corresponding to UNSIGNED_INT and the type - * of an element in Uint32Array. + of an element in Uint32Array. */ UNSIGNED_INT = WebGLConstants.UNSIGNED_INT, /** * 32-bit floating-point corresponding to FLOAT and the type - * of an element in Float32Array. + of an element in Float32Array. */ FLOAT = WebGLConstants.FLOAT, /** * 64-bit floating-point corresponding to gl.DOUBLE (in Desktop OpenGL; - * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute}) - * and the type of an element in Float64Array. + this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute}) + and the type of an element in Float64Array. */ DOUBLE = WebGLConstants.DOUBLE } @@ -4352,14 +4458,14 @@ export class CompressedTextureBuffer { * A description of a polygon composed of arbitrary coplanar positions. * @example * var polygonGeometry = new Cesium.CoplanarPolygonGeometry({ - * polygonHierarchy: new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArrayHeights([ - * -90.0, 30.0, 0.0, - * -90.0, 30.0, 300000.0, - * -80.0, 30.0, 300000.0, - * -80.0, 30.0, 0.0 - * ])) - * }); + polygonHierarchy: new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArrayHeights([ + -90.0, 30.0, 0.0, + -90.0, 30.0, 300000.0, + -80.0, 30.0, 300000.0, + -80.0, 30.0, 0.0 + ])) +}); * @param options - Object with the following properties: * @param options.polygonHierarchy - A polygon hierarchy that can include holes. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. @@ -4381,16 +4487,16 @@ export class CoplanarPolygonGeometry { * A description of a coplanar polygon from an array of positions. * @example * // create a polygon from points - * var polygon = Cesium.CoplanarPolygonGeometry.fromPositions({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ]) - * }); - * var geometry = Cesium.PolygonGeometry.createGeometry(polygon); + var polygon = Cesium.CoplanarPolygonGeometry.fromPositions({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + }); + var geometry = Cesium.PolygonGeometry.createGeometry(polygon); * @param options - Object with the following properties: * @param options.positions - An array of positions that defined the corner points of the polygon. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. @@ -4431,14 +4537,14 @@ export class CoplanarPolygonGeometry { * A description of the outline of a polygon composed of arbitrary coplanar positions. * @example * var polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArrayHeights([ - * -90.0, 30.0, 0.0, - * -90.0, 30.0, 1000.0, - * -80.0, 30.0, 1000.0, - * -80.0, 30.0, 0.0 - * ]) - * }); - * var geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline); + positions : Cesium.Cartesian3.fromDegreesArrayHeights([ + -90.0, 30.0, 0.0, + -90.0, 30.0, 1000.0, + -80.0, 30.0, 1000.0, + -80.0, 30.0, 0.0 + ]) +}); +var geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline); * @param options - Object with the following properties: * @param options.polygonHierarchy - A polygon hierarchy that can include holes. */ @@ -4488,20 +4594,20 @@ export class CoplanarPolygonOutlineGeometry { export enum CornerType { /** * - * - * Corner has a smooth edge. + + Corner has a smooth edge. */ ROUNDED = 0, /** * - * - * Corner point is the intersection of adjacent edges. + + Corner point is the intersection of adjacent edges. */ MITERED = 1, /** * - * - * Corner is clipped. + + Corner is clipped. */ BEVELED = 2 } @@ -4510,10 +4616,10 @@ export enum CornerType { * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. * @example * var corridor = new Cesium.CorridorGeometry({ - * vertexFormat : Cesium.VertexFormat.POSITION_ONLY, - * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]), - * width : 100000 - * }); + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]), + width : 100000 +}); * @param options - Object with the following properties: * @param options.positions - An array of positions that define the center of the corridor. * @param options.width - The distance between the edges of the corridor in meters. @@ -4583,9 +4689,9 @@ export class CorridorGeometry { * A description of a corridor outline. * @example * var corridor = new Cesium.CorridorOutlineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]), - * width : 100000 - * }); + positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]), + width : 100000 +}); * @param options - Object with the following properties: * @param options.positions - An array of positions that define the center of the corridor outline. * @param options.width - The distance between the edges of the corridor outline. @@ -4633,11 +4739,42 @@ export class CorridorOutlineGeometry { static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined; } +/** + * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time. + * @example + * this.guid = Cesium.createGuid(); + */ +export function createGuid(): string; + +/** + * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}. + * @example + * // Create Cesium World Terrain with default settings +var viewer = new Cesium.Viewer('cesiumContainer', { + terrainProvider : Cesium.createWorldTerrain(); +}); + * @example + * // Create Cesium World Terrain with water and normals. +var viewer = new Cesium.Viewer('cesiumContainer', { + terrainProvider : Cesium.createWorldTerrain({ + requestWaterMask : true, + requestVertexNormals : true + }); +}); + * @param [options] - Object with the following properties: + * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available. + * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available. + */ +export function createWorldTerrain(options?: { + requestVertexNormals?: boolean; + requestWaterMask?: boolean; +}): CesiumTerrainProvider; + /** * A credit contains data pertaining to how to display attributions/credits for certain content on the screen. * @example * //Create a credit with a tooltip, image and link - * var credit = new Cesium.Credit(''); +var credit = new Cesium.Credit(''); * @param html - An string representing an html code snippet * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover */ @@ -4708,13 +4845,13 @@ export class CullingVolume { constructor(planes?: Cartesian4[]); /** * Each plane is represented by a Cartesian4 object, where the x, y, and z components - * define the unit vector normal to the plane, and the w component is the distance of the - * plane from the origin. + define the unit vector normal to the plane, and the w component is the distance of the + plane from the origin. */ planes: Cartesian4[]; /** * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere. - * The planes are aligned to the x, y, and z axes in world coordinates. + The planes are aligned to the x, y, and z axes in world coordinates. * @param boundingSphere - The bounding sphere used to create the culling volume. * @param [result] - The object onto which to store the result. * @returns The culling volume created from the bounding sphere. @@ -4732,12 +4869,12 @@ export class CullingVolume { * A description of a cylinder. * @example * // create cylinder geometry - * var cylinder = new Cesium.CylinderGeometry({ - * length: 200000, - * topRadius: 80000, - * bottomRadius: 200000, - * }); - * var geometry = Cesium.CylinderGeometry.createGeometry(cylinder); +var cylinder = new Cesium.CylinderGeometry({ + length: 200000, + topRadius: 80000, + bottomRadius: 200000, +}); +var geometry = Cesium.CylinderGeometry.createGeometry(cylinder); * @param options - Object with the following properties: * @param options.length - The length of the cylinder. * @param options.topRadius - The radius of the top of the cylinder. @@ -4785,12 +4922,12 @@ export class CylinderGeometry { * A description of the outline of a cylinder. * @example * // create cylinder geometry - * var cylinder = new Cesium.CylinderOutlineGeometry({ - * length: 200000, - * topRadius: 80000, - * bottomRadius: 200000, - * }); - * var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder); +var cylinder = new Cesium.CylinderOutlineGeometry({ + length: 200000, + topRadius: 80000, + bottomRadius: 200000, +}); +var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder); * @param options - Object with the following properties: * @param options.length - The length of the cylinder. * @param options.topRadius - The radius of the top of the cylinder. @@ -4836,7 +4973,7 @@ export class CylinderOutlineGeometry { /** * A simple proxy that appends the desired resource as the sole query parameter - * to the given proxy URL. +to the given proxy URL. * @param proxy - The proxy URL that will be used to requests all resources. */ export class DefaultProxy extends Proxy { @@ -4849,15 +4986,58 @@ export class DefaultProxy extends Proxy { getURL(resource: string): string; } +/** + * Returns the first parameter if not undefined, otherwise the second parameter. +Useful for setting a default value for a parameter. + * @example + * param = Cesium.defaultValue(param, 'default'); + * @returns Returns the first parameter if not undefined, otherwise the second parameter. + */ +export function defaultValue(a: any, b: any): any; + +/** + * @example + * if (Cesium.defined(positions)) { + doSomething(); +} else { + doSomethingElse(); +} + * @param value - The object. + * @returns Returns true if the object is defined, returns false otherwise. + */ +export function defined(value: any): boolean; + +/** + * Destroys an object. Each of the object's functions, including functions in its prototype, +is replaced with a function that throws a {@link DeveloperError}, except for the object's +isDestroyed function, which is set to a function that returns true. +The object's properties are removed with delete. +

+This function is used by objects that hold native resources, e.g., WebGL resources, which +need to be explicitly released. Client code calls an object's destroy function, +which then releases the native resource and calls destroyObject to put itself +in a destroyed state. + * @example + * // How a texture would destroy itself. +this.destroy = function () { + _gl.deleteTexture(_texture); + return Cesium.destroyObject(this); +}; + * @param object - The object to destroy. + * @param [message] - The message to include in the exception that is thrown if + a destroyed object's function is called. + */ +export function destroyObject(object: any, message?: string): void; + /** * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument, - * argument out of range, etc. This exception should only be thrown during development; - * it usually indicates a bug in the calling code. This exception should never be - * caught; instead the calling code should strive not to generate it. - *

- * On the other hand, a {@link RuntimeError} indicates an exception that may - * be thrown at runtime, e.g., out of memory, that the calling code should be prepared - * to catch. +argument out of range, etc. This exception should only be thrown during development; +it usually indicates a bug in the calling code. This exception should never be +caught; instead the calling code should strive not to generate it. +

+On the other hand, a {@link RuntimeError} indicates an exception that may +be thrown at runtime, e.g., out of memory, that the calling code should be prepared +to catch. * @param [message] - The error message for this exception. */ export class DeveloperError extends Error { @@ -4880,7 +5060,7 @@ export class DeveloperError extends Error { * Determines visibility based on the distance to the camera. * @example * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters. - * billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0); +billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0); * @param [near = 0.0] - The smallest distance in the interval where the object is visible. * @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible. */ @@ -4946,18 +5126,18 @@ export class DistanceDisplayCondition { * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition. * @example * var instance = new Cesium.GeometryInstance({ - * geometry : new Cesium.BoxGeometry({ - * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, - * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0), - * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0) - * }), - * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( - * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), - * id : 'box', - * attributes : { - * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0) - * } - * }); + geometry : new Cesium.BoxGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, + minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0), + maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0) + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + id : 'box', + attributes : { + distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0) + } +}); * @param [near = 0.0] - The near distance. * @param [far = Number.MAX_VALUE] - The far distance. */ @@ -4969,7 +5149,7 @@ export class DistanceDisplayConditionGeometryInstanceAttribute { value: Float32Array; /** * The datatype of each component in the attribute, e.g., individual elements in - * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}. + {@link DistanceDisplayConditionGeometryInstanceAttribute#value}. */ readonly componentDatatype: ComponentDatatype; /** @@ -4978,20 +5158,20 @@ export class DistanceDisplayConditionGeometryInstanceAttribute { readonly componentsPerAttribute: number; /** * When true and componentDatatype is an integer format, - * indicate that the components should be mapped to the range [0, 1] (unsigned) - * or [-1, 1] (signed) when they are accessed as floating-point for rendering. + indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. */ readonly normalize: boolean; /** * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}. * @example * var distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0); - * var instance = new Cesium.GeometryInstance({ - * geometry : geometry, - * attributes : { - * distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition) - * } - * }); + var instance = new Cesium.GeometryInstance({ + geometry : geometry, + attributes : { + distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition) + } + }); * @param distanceDisplayCondition - The distance display condition. * @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance. */ @@ -5000,7 +5180,7 @@ export class DistanceDisplayConditionGeometryInstanceAttribute { * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute. * @example * var attributes = primitive.getGeometryInstanceAttributes('an id'); - * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition); + attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition); * @param distanceDisplayCondition - The distance display condition value. * @param [result] - The array to store the result in, if undefined a new instance will be created. * @returns The modified result parameter or a new instance if result was undefined. @@ -5010,8 +5190,8 @@ export class DistanceDisplayConditionGeometryInstanceAttribute { /** * Easing functions for use with TweenCollection. These function are from - * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the - * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}. +{@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the +{@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}. */ export namespace EasingFunction { /** @@ -5142,12 +5322,12 @@ export namespace EasingFunction { * Function interface for implementing a custom easing function. * @example * function quadraticIn(time) { - * return time * time; - * } + return time * time; + } * @example * function quadraticOut(time) { - * return time * (2.0 - time); - * } + return time * (2.0 - time); + } * @param time - The time in the range [0, 1]. */ type Callback = (time: number) => number; @@ -5157,13 +5337,13 @@ export namespace EasingFunction { * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. * @example * // Create an ellipse. - * var ellipse = new Cesium.EllipseGeometry({ - * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), - * semiMajorAxis : 500000.0, - * semiMinorAxis : 300000.0, - * rotation : Cesium.Math.toRadians(60.0) - * }); - * var geometry = Cesium.EllipseGeometry.createGeometry(ellipse); +var ellipse = new Cesium.EllipseGeometry({ + center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), + semiMajorAxis : 500000.0, + semiMinorAxis : 300000.0, + rotation : Cesium.Math.toRadians(60.0) +}); +var geometry = Cesium.EllipseGeometry.createGeometry(ellipse); * @param options - Object with the following properties: * @param options.center - The ellipse's center point in the fixed frame. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters. @@ -5241,12 +5421,12 @@ export class EllipseGeometry { * A description of the outline of an ellipse on an ellipsoid. * @example * var ellipse = new Cesium.EllipseOutlineGeometry({ - * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), - * semiMajorAxis : 500000.0, - * semiMinorAxis : 300000.0, - * rotation : Cesium.Math.toRadians(60.0) - * }); - * var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse); + center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), + semiMajorAxis : 500000.0, + semiMinorAxis : 300000.0, + rotation : Cesium.Math.toRadians(60.0) +}); +var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse); * @param options - Object with the following properties: * @param options.center - The ellipse's center point in the fixed frame. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters. @@ -5300,11 +5480,11 @@ export class EllipseOutlineGeometry { /** * A quadratic surface defined in Cartesian coordinates by the equation - * (x / a)^2 + (y / b)^2 + (z / c)^2 = 1. Primarily used - * by Cesium to represent the shape of planetary bodies. - * - * Rather than constructing this object directly, one of the provided - * constants is normally used. +(x / a)^2 + (y / b)^2 + (z / c)^2 = 1. Primarily used +by Cesium to represent the shape of planetary bodies. + +Rather than constructing this object directly, one of the provided +constants is normally used. * @param [x = 0] - The radius in the x direction. * @param [y = 0] - The radius in the y direction. * @param [z = 0] - The radius in the z direction. @@ -5343,7 +5523,7 @@ export class Ellipsoid { * Duplicates an Ellipsoid instance. * @param ellipsoid - The ellipsoid to duplicate. * @param [result] - The object onto which to store the result, or undefined if a new - * instance should be created. + instance should be created. * @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined) */ static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid; @@ -5351,7 +5531,7 @@ export class Ellipsoid { * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions. * @param [result] - The object onto which to store the result, or undefined if a new - * instance should be created. + instance should be created. * @returns A new Ellipsoid instance. */ static fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid; @@ -5370,7 +5550,7 @@ export class Ellipsoid { /** * Duplicates an Ellipsoid instance. * @param [result] - The object onto which to store the result, or undefined if a new - * instance should be created. + instance should be created. * @returns The cloned Ellipsoid. */ clone(result?: Ellipsoid): Ellipsoid; @@ -5419,8 +5599,8 @@ export class Ellipsoid { * Converts the provided cartographic to Cartesian representation. * @example * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid. - * var position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000); - * var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position); + var position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000); + var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position); * @param cartographic - The cartographic position. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Cartesian3 instance if none was provided. @@ -5430,10 +5610,10 @@ export class Ellipsoid { * Converts the provided array of cartographics to an array of Cartesians. * @example * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid. - * var positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0), - * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100), - * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)]; - * var cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions); + var positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0), + new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100), + new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)]; + var cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions); * @param cartographics - An array of cartographic positions. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Array instance if none was provided. @@ -5441,11 +5621,11 @@ export class Ellipsoid { cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[]; /** * Converts the provided cartesian to cartographic representation. - * The cartesian is undefined at the center of the ellipsoid. + The cartesian is undefined at the center of the ellipsoid. * @example * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid. - * var position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73); - * var cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position); + var position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73); + var cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position); * @param cartesian - The Cartesian position to convert to cartographic representation. * @param [result] - The object onto which to store the result. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid. @@ -5455,10 +5635,10 @@ export class Ellipsoid { * Converts the provided array of cartesians to an array of cartographics. * @example * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid. - * var positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73), - * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73), - * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)] - * var cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions); + var positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73), + new Cesium.Cartesian3(17832.13, 83234.53, 952313.73), + new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)] + var cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions); * @param cartesians - An array of Cartesian positions. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Array instance if none was provided. @@ -5466,8 +5646,8 @@ export class Ellipsoid { cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[]; /** * Scales the provided Cartesian position along the geodetic surface normal - * so that it is on the surface of this ellipsoid. If the position is - * at the center of the ellipsoid, this function returns undefined. + so that it is on the surface of this ellipsoid. If the position is + at the center of the ellipsoid, this function returns undefined. * @param cartesian - The Cartesian position to scale. * @param [result] - The object onto which to store the result. * @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center. @@ -5475,7 +5655,7 @@ export class Ellipsoid { scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; /** * Scales the provided Cartesian position along the geocentric surface normal - * so that it is on the surface of this ellipsoid. + so that it is on the surface of this ellipsoid. * @param cartesian - The Cartesian position to scale. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Cartesian3 instance if none was provided. @@ -5483,27 +5663,27 @@ export class Ellipsoid { scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; /** * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying - * its components by the result of {@link Ellipsoid#oneOverRadii}. + its components by the result of {@link Ellipsoid#oneOverRadii}. * @param position - The position to transform. * @param [result] - The position to which to copy the result, or undefined to create and - * return a new instance. + return a new instance. * @returns The position expressed in the scaled space. The returned instance is the - * one passed as the result parameter if it is not undefined, or a new instance of it is. + one passed as the result parameter if it is not undefined, or a new instance of it is. */ transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3; /** * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying - * its components by the result of {@link Ellipsoid#radii}. + its components by the result of {@link Ellipsoid#radii}. * @param position - The position to transform. * @param [result] - The position to which to copy the result, or undefined to create and - * return a new instance. + return a new instance. * @returns The position expressed in the unscaled space. The returned instance is the - * one passed as the result parameter if it is not undefined, or a new instance of it is. + one passed as the result parameter if it is not undefined, or a new instance of it is. */ transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3; /** * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The other Ellipsoid. * @returns true if they are equal, false otherwise. */ @@ -5517,17 +5697,17 @@ export class Ellipsoid { * Computes a point which is the intersection of the surface normal with the z-axis. * @param position - the position. must be on the surface of the ellipsoid. * @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid. - * In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center. - * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis). - * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2 + In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center. + In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis). + Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2 * @param [result] - The cartesian to which to copy the result, or undefined to create and - * return a new instance. + return a new instance. * @returns the intersection point if it's inside the ellipsoid, undefined otherwise */ getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined; /** * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using - * Gauss-Legendre 10th order quadrature. + Gauss-Legendre 10th order quadrature. * @param rectangle - The rectangle used for computing the surface area. * @returns The approximate area of the rectangle on the surface of this ellipsoid. */ @@ -5592,10 +5772,10 @@ export class EllipsoidGeodesic { * A description of an ellipsoid centered at the origin. * @example * var ellipsoid = new Cesium.EllipsoidGeometry({ - * vertexFormat : Cesium.VertexFormat.POSITION_ONLY, - * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0) - * }); - * var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid); + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0) +}); +var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid); * @param [options] - Object with the following properties: * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions. @@ -5651,11 +5831,11 @@ export class EllipsoidGeometry { * A description of the outline of an ellipsoid centered at the origin. * @example * var ellipsoid = new Cesium.EllipsoidOutlineGeometry({ - * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0), - * stackPartitions: 6, - * slicePartitions: 5 - * }); - * var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid); + radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0), + stackPartitions: 6, + slicePartitions: 5 +}); +var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid); * @param [options] - Object with the following properties: * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions. @@ -5767,7 +5947,7 @@ export class EllipsoidRhumbLine { interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic; /** * Provides the location of a point at the indicated longitude along the rhumb line. - * If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line. + If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line. * @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading. * @param [result] - The object in which to store the result. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections. @@ -5775,7 +5955,7 @@ export class EllipsoidRhumbLine { findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic; /** * Provides the location of a point at the indicated latitude along the rhumb line. - * If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line. + If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line. * @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading. * @param [result] - The object in which to store the result. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections. @@ -5785,8 +5965,8 @@ export class EllipsoidRhumbLine { /** * A plane tangent to the provided ellipsoid at the provided origin. - * If origin is not on the surface of the ellipsoid, it's surface projection will be used. - * If origin is at the center of the ellipsoid, an exception will be thrown. +If origin is not on the surface of the ellipsoid, it's surface projection will be used. +If origin is at the center of the ellipsoid, an exception will be thrown. * @param origin - The point on the surface of the ellipsoid where the tangent plane touches. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use. */ @@ -5818,7 +5998,7 @@ export class EllipsoidTangentPlane { readonly zAxis: Cartesian3; /** * Creates a new instance from the provided ellipsoid and the center - * point of the provided Cartesians. + point of the provided Cartesians. * @param cartesians - The list of positions surrounding the center point. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use. * @returns The new instance of EllipsoidTangentPlane. @@ -5833,7 +6013,7 @@ export class EllipsoidTangentPlane { projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; /** * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin. - * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included. + The resulting array may be shorter than the input array - if a single projection is impossible it will not be included. * @param cartesians - The array of points to project. * @param [result] - The array of Cartesian2 instances onto which to store results. * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided. @@ -5871,14 +6051,14 @@ export class EllipsoidTangentPlane { /** * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal - * surface. +surface. * @param [options] - Object with the following properties: * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal - * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme} - * is used. +surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme} +is used. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. +this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither +parameter is specified, the WGS84 ellipsoid is used. */ export class EllipsoidTerrainProvider { constructor(options?: { @@ -5887,18 +6067,18 @@ export class EllipsoidTerrainProvider { }); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit - * the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true. + the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true. */ credit: Credit; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link EllipsoidTerrainProvider#ready} returns true. + not be called before {@link EllipsoidTerrainProvider#ready} returns true. */ tilingScheme: GeographicTilingScheme; /** @@ -5911,34 +6091,34 @@ export class EllipsoidTerrainProvider { readonly readyPromise: Promise; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask - * indicates which areas of the globe are water rather than land, so they can be rendered - * as a reflective surface with animated waves. This function should not be - * called before {@link EllipsoidTerrainProvider#ready} returns true. + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link EllipsoidTerrainProvider#ready} returns true. */ hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. - * This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true. + This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true. */ hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as - * at points and in rectangles. This function should not be called before - * {@link TerrainProvider#ready} returns true. This property may be undefined if availability - * information is not available. + at points and in rectangles. This function should not be called before + {@link TerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. */ availability: TileAvailability; /** * Requests the geometry for a given tile. This function should not be called before - * {@link TerrainProvider#ready} returns true. The result includes terrain - * data and indicates that all child tiles are available. + {@link TerrainProvider#ready} returns true. The result includes terrain + data and indicates that all child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method - * returns undefined instead of a promise, it is an indication that too many requests are already - * pending and the request will be retried later. + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** @@ -5967,19 +6147,19 @@ export class EllipsoidTerrainProvider { /** * A generic utility class for managing subscribers for a particular event. - * This class is usually instantiated inside of a container class and - * exposed as a property for others to subscribe to. +This class is usually instantiated inside of a container class and +exposed as a property for others to subscribe to. * @example * MyObject.prototype.myListener = function(arg1, arg2) { - * this.myArg1Copy = arg1; - * this.myArg2Copy = arg2; - * } - * - * var myObjectInstance = new MyObject(); - * var evt = new Cesium.Event(); - * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance); - * evt.raiseEvent('1', '2'); - * evt.removeEventListener(MyObject.prototype.myListener); + this.myArg1Copy = arg1; + this.myArg2Copy = arg2; +} + +var myObjectInstance = new MyObject(); +var evt = new Cesium.Event(); +evt.addEventListener(MyObject.prototype.myListener, myObjectInstance); +evt.raiseEvent('1', '2'); +evt.removeEventListener(MyObject.prototype.myListener); */ export class Event { constructor(); @@ -5989,11 +6169,11 @@ export class Event { readonly numberOfListeners: number; /** * Registers a callback function to be executed whenever the event is raised. - * An optional scope can be provided to serve as the this pointer - * in which the function will execute. + An optional scope can be provided to serve as the this pointer + in which the function will execute. * @param listener - The function to be executed when the event is raised. * @param [scope] - An optional object scope to serve as the this - * pointer in which the listener function will execute. + pointer in which the listener function will execute. * @returns A function that will remove this event listener when invoked. */ addEventListener(listener: (...params: any[]) => any, scope?: any): Event.RemoveCallback; @@ -6020,16 +6200,16 @@ export namespace Event { /** * A convenience object that simplifies the common pattern of attaching event listeners - * to several events, then removing all those listeners at once later, for example, in - * a destroy method. +to several events, then removing all those listeners at once later, for example, in +a destroy method. * @example * var helper = new Cesium.EventHelper(); - * - * helper.add(someObject.event, listener1, this); - * helper.add(otherObject.event, listener2, this); - * - * // later... - * helper.removeAll(); + +helper.add(someObject.event, listener1, this); +helper.add(otherObject.event, listener2, this); + +// later... +helper.removeAll(); */ export class EventHelper { constructor(); @@ -6038,7 +6218,7 @@ export class EventHelper { * @param event - The event to attach to. * @param listener - The function to be executed when the event is raised. * @param [scope] - An optional object scope to serve as the this - * pointer in which the listener function will execute. + pointer in which the listener function will execute. * @returns A function that will remove this event listener when invoked. */ add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback; @@ -6057,7 +6237,7 @@ export namespace EventHelper { /** * Constants to determine how an interpolated value is extrapolated - * when querying outside the bounds of available data. +when querying outside the bounds of available data. */ export enum ExtrapolationType { /** @@ -6076,7 +6256,7 @@ export enum ExtrapolationType { /** * A set of functions to detect whether the current browser supports - * various features. +various features. */ export namespace FeatureDetection { /** @@ -6101,6 +6281,14 @@ export namespace FeatureDetection { function supportsWebAssembly(): boolean; } +/** + * Formats an error object into a String. If available, uses name, message, and stack +properties, otherwise, falls back on toString(). + * @param object - The item to find in the array. + * @returns A string containing the formatted error. + */ +export function formatError(object: any): string; + /** * Describes a frustum at the given the origin and orientation. * @param options - Object with the following properties: @@ -6189,25 +6377,25 @@ export class FrustumOutlineGeometry { export namespace Fullscreen { /** * The element that is currently fullscreen, if any. To simply check if the - * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}. + browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}. */ const element: any; /** * The name of the event on the document that is fired when fullscreen is - * entered or exited. This event name is intended for use with addEventListener. - * In your event handler, to determine if the browser is in fullscreen mode or not, - * use {@link Fullscreen#fullscreen}. + entered or exited. This event name is intended for use with addEventListener. + In your event handler, to determine if the browser is in fullscreen mode or not, + use {@link Fullscreen#fullscreen}. */ const changeEventName: string; /** * The name of the event that is fired when a fullscreen error - * occurs. This event name is intended for use with addEventListener. + occurs. This event name is intended for use with addEventListener. */ const errorEventName: string; /** * Determine whether the browser will allow an element to be made fullscreen, or not. - * For example, by default, iframes cannot go fullscreen unless the containing page - * adds an "allowfullscreen" attribute (or prefixed equivalent). + For example, by default, iframes cannot go fullscreen unless the containing page + adds an "allowfullscreen" attribute (or prefixed equivalent). */ const enabled: boolean; /** @@ -6217,44 +6405,29 @@ export namespace Fullscreen { /** * Detects whether the browser supports the standard fullscreen API. * @returns true if the browser supports the standard fullscreen API, - * false otherwise. + false otherwise. */ function supportsFullscreen(): boolean; /** * Asynchronously requests the browser to enter fullscreen mode on the given element. - * If fullscreen mode is not supported by the browser, does nothing. + If fullscreen mode is not supported by the browser, does nothing. * @example * // Put the entire page into fullscreen. - * Cesium.Fullscreen.requestFullscreen(document.body) - * - * // Place only the Cesium canvas into fullscreen. - * Cesium.Fullscreen.requestFullscreen(scene.canvas) + Cesium.Fullscreen.requestFullscreen(document.body) + + // Place only the Cesium canvas into fullscreen. + Cesium.Fullscreen.requestFullscreen(scene.canvas) * @param element - The HTML element which will be placed into fullscreen mode. * @param [vrDevice] - The HMDVRDevice device. */ function requestFullscreen(element: any, vrDevice?: any): void; /** * Asynchronously exits fullscreen mode. If the browser is not currently - * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing. + in fullscreen, or if fullscreen mode is not supported by the browser, does nothing. */ function exitFullscreen(): void; } -/** - * The type of geocoding to be performed by a {@link GeocoderService}. - */ -export enum GeocodeType { - /** - * Perform a search where the input is considered complete. - */ - SEARCH = 0, - /** - * Perform an auto-complete using partial input, typically - * reserved for providing possible results as a user is typing. - */ - AUTOCOMPLETE = 1 -} - export namespace GeocoderService { /** * @property displayName - The display name for a location @@ -6268,7 +6441,7 @@ export namespace GeocoderService { /** * Provides geocoding through an external service. This type describes an interface and - * is not intended to be used. +is not intended to be used. */ export class GeocoderService { constructor(); @@ -6279,11 +6452,26 @@ export class GeocoderService { geocode(query: string, type?: GeocodeType): Promise; } +/** + * The type of geocoding to be performed by a {@link GeocoderService}. + */ +export enum GeocodeType { + /** + * Perform a search where the input is considered complete. + */ + SEARCH = 0, + /** + * Perform an auto-complete using partial input, typically + reserved for providing possible results as a user is typing. + */ + AUTOCOMPLETE = 1 +} + /** * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying - * them by the {@link Ellipsoid#maximumRadius}. This projection - * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It - * is also known as EPSG:4326. +them by the {@link Ellipsoid#maximumRadius}. This projection +is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It +is also known as EPSG:4326. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid. */ export class GeographicProjection { @@ -6294,42 +6482,42 @@ export class GeographicProjection { readonly ellipsoid: Ellipsoid; /** * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters. - * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the - * ellipsoid. Z is the unmodified height. + X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the + ellipsoid. Z is the unmodified height. * @param cartographic - The coordinates to project. * @param [result] - An instance into which to copy the result. If this parameter is - * undefined, a new instance is created and returned. + undefined, a new instance is created and returned. * @returns The projected coordinates. If the result parameter is not undefined, the - * coordinates are copied there and that instance is returned. Otherwise, a new instance is - * created and returned. + coordinates are copied there and that instance is returned. Otherwise, a new instance is + created and returned. */ project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; /** * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic} - * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively, - * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate. + coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively, + divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate. * @param cartesian - The Cartesian position to unproject with height (z) in meters. * @param [result] - An instance into which to copy the result. If this parameter is - * undefined, a new instance is created and returned. + undefined, a new instance is created and returned. * @returns The unprojected coordinates. If the result parameter is not undefined, the - * coordinates are copied there and that instance is returned. Otherwise, a new instance is - * created and returned. + coordinates are copied there and that instance is returned. Otherwise, a new instance is + created and returned. */ unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; } /** * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where - * longitude and latitude are directly mapped to X and Y. This projection is commonly - * known as geographic, equirectangular, equidistant cylindrical, or plate carrée. +longitude and latitude are directly mapped to X and Y. This projection is commonly +known as geographic, equirectangular, equidistant cylindrical, or plate carrée. * @param [options] - Object with the following properties: * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to - * the WGS84 ellipsoid. +the WGS84 ellipsoid. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme. * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of - * the tile tree. +the tile tree. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of - * the tile tree. +the tile tree. */ export class GeographicTilingScheme { constructor(options?: { @@ -6364,24 +6552,24 @@ export class GeographicTilingScheme { getNumberOfYTilesAtLevel(level: number): number; /** * Transforms a rectangle specified in geodetic radians to the native coordinate system - * of this tiling scheme. + of this tiling scheme. * @param rectangle - The rectangle to transform. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the native rectangle if 'result' - * is undefined. + is undefined. */ rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates - * of the tiling scheme. + of the tiling scheme. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the rectangle - * if 'result' is undefined. + if 'result' is undefined. */ tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; /** @@ -6390,52 +6578,52 @@ export class GeographicTilingScheme { * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the rectangle - * if 'result' is undefined. + if 'result' is undefined. */ tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; /** * Calculates the tile x, y coordinates of the tile containing - * a given cartographic position. + a given cartographic position. * @param position - The position. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the tile x, y coordinates - * if 'result' is undefined. + if 'result' is undefined. */ positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; } /** * A geometry representation with attributes forming vertices and optional index data - * defining primitives. Geometries and an {@link Appearance}, which describes the shading, - * can be assigned to a {@link Primitive} for visualization. A Primitive can - * be created from many heterogeneous - in many cases - geometries for performance. - *

- * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}. - *

+defining primitives. Geometries and an {@link Appearance}, which describes the shading, +can be assigned to a {@link Primitive} for visualization. A Primitive can +be created from many heterogeneous - in many cases - geometries for performance. +

+Geometries can be transformed and optimized using functions in {@link GeometryPipeline}. +

* @example * // Create geometry with a position attribute and indexed lines. - * var positions = new Float64Array([ - * 0.0, 0.0, 0.0, - * 7500000.0, 0.0, 0.0, - * 0.0, 7500000.0, 0.0 - * ]); - * - * var geometry = new Cesium.Geometry({ - * attributes : { - * position : new Cesium.GeometryAttribute({ - * componentDatatype : Cesium.ComponentDatatype.DOUBLE, - * componentsPerAttribute : 3, - * values : positions - * }) - * }, - * indices : new Uint16Array([0, 1, 1, 2, 2, 0]), - * primitiveType : Cesium.PrimitiveType.LINES, - * boundingSphere : Cesium.BoundingSphere.fromVertices(positions) - * }); +var positions = new Float64Array([ + 0.0, 0.0, 0.0, + 7500000.0, 0.0, 0.0, + 0.0, 7500000.0, 0.0 +]); + +var geometry = new Cesium.Geometry({ + attributes : { + position : new Cesium.GeometryAttribute({ + componentDatatype : Cesium.ComponentDatatype.DOUBLE, + componentsPerAttribute : 3, + values : positions + }) + }, + indices : new Uint16Array([0, 1, 1, 2, 2, 0]), + primitiveType : Cesium.PrimitiveType.LINES, + boundingSphere : Cesium.BoundingSphere.fromVertices(positions) +}); * @param options - Object with the following properties: * @param options.attributes - Attributes, which make up the geometry's vertices. * @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry. @@ -6451,60 +6639,60 @@ export class Geometry { }); /** * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a - * {@link GeometryAttribute} containing the attribute's data. - *

- * Attributes are always stored non-interleaved in a Geometry. - *

- *

- * There are reserved attribute names with well-known semantics. The following attributes - * are created by a Geometry (depending on the provided {@link VertexFormat}. - *

    - *
  • position - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.
  • - *
  • normal - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.
  • - *
  • st - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.
  • - *
  • bitangent - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.
  • - *
  • tangent - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.
  • - *
- *

- *

- * The following attribute names are generally not created by a Geometry, but are added - * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare - * the geometry for rendering. - *

    - *
  • position3DHigh - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
  • - *
  • position3DLow - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
  • - *
  • position3DHigh - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
  • - *
  • position2DLow - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
  • - *
  • color - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.
  • - *
  • pickColor - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.
  • - *
- *

+ {@link GeometryAttribute} containing the attribute's data. +

+ Attributes are always stored non-interleaved in a Geometry. +

+

+ There are reserved attribute names with well-known semantics. The following attributes + are created by a Geometry (depending on the provided {@link VertexFormat}. +

    +
  • position - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.
  • +
  • normal - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.
  • +
  • st - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.
  • +
  • bitangent - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.
  • +
  • tangent - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.
  • +
+

+

+ The following attribute names are generally not created by a Geometry, but are added + to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare + the geometry for rendering. +

    +
  • position3DHigh - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
  • +
  • position3DLow - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
  • +
  • position3DHigh - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
  • +
  • position2DLow - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.
  • +
  • color - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.
  • +
  • pickColor - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.
  • +
+

* @example * geometry.attributes.position = new Cesium.GeometryAttribute({ - * componentDatatype : Cesium.ComponentDatatype.FLOAT, - * componentsPerAttribute : 3, - * values : new Float32Array(0) - * }); + componentDatatype : Cesium.ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : new Float32Array(0) + }); */ attributes: GeometryAttributes; /** * Optional index data that - along with {@link Geometry#primitiveType} - - * determines the primitives in the geometry. + determines the primitives in the geometry. */ indices: any[]; /** * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES}, - * but can varying based on the specific geometry. + but can varying based on the specific geometry. */ primitiveType: PrimitiveType; /** * An optional bounding sphere that fully encloses the geometry. This is - * commonly used for culling. + commonly used for culling. */ boundingSphere: BoundingSphere; /** * Computes the number of vertices in a geometry. The runtime is linear with - * respect to the number of attributes in a vertex, not the number of vertices. + respect to the number of attributes in a vertex, not the number of vertices. * @example * var numVertices = Cesium.Geometry.computeNumberOfVertices(geometry); * @param geometry - The geometry. @@ -6515,23 +6703,23 @@ export class Geometry { /** * Values and type information for geometry attributes. A {@link Geometry} - * generally contains one or more attributes. All attributes together form - * the geometry's vertices. +generally contains one or more attributes. All attributes together form +the geometry's vertices. * @example * var geometry = new Cesium.Geometry({ - * attributes : { - * position : new Cesium.GeometryAttribute({ - * componentDatatype : Cesium.ComponentDatatype.FLOAT, - * componentsPerAttribute : 3, - * values : new Float32Array([ - * 0.0, 0.0, 0.0, - * 7500000.0, 0.0, 0.0, - * 0.0, 7500000.0, 0.0 - * ]) - * }) - * }, - * primitiveType : Cesium.PrimitiveType.LINE_LOOP - * }); + attributes : { + position : new Cesium.GeometryAttribute({ + componentDatatype : Cesium.ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : new Float32Array([ + 0.0, 0.0, 0.0, + 7500000.0, 0.0, 0.0, + 0.0, 7500000.0, 0.0 + ]) + }) + }, + primitiveType : Cesium.PrimitiveType.LINE_LOOP +}); * @param [options] - Object with the following properties: * @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values. * @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes. @@ -6547,114 +6735,114 @@ export class GeometryAttribute { }); /** * The datatype of each component in the attribute, e.g., individual elements in - * {@link GeometryAttribute#values}. + {@link GeometryAttribute#values}. */ componentDatatype: ComponentDatatype; /** * A number between 1 and 4 that defines the number of components in an attributes. - * For example, a position attribute with x, y, and z components would have 3 as - * shown in the code example. + For example, a position attribute with x, y, and z components would have 3 as + shown in the code example. * @example * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT; - * attribute.componentsPerAttribute = 3; - * attribute.values = new Float32Array([ - * 0.0, 0.0, 0.0, - * 7500000.0, 0.0, 0.0, - * 0.0, 7500000.0, 0.0 - * ]); + attribute.componentsPerAttribute = 3; + attribute.values = new Float32Array([ + 0.0, 0.0, 0.0, + 7500000.0, 0.0, 0.0, + 0.0, 7500000.0, 0.0 + ]); */ componentsPerAttribute: number; /** * When true and componentDatatype is an integer format, - * indicate that the components should be mapped to the range [0, 1] (unsigned) - * or [-1, 1] (signed) when they are accessed as floating-point for rendering. - *

- * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}. - *

+ indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. +

+ This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}. +

* @example * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE; - * attribute.componentsPerAttribute = 4; - * attribute.normalize = true; - * attribute.values = new Uint8Array([ - * Cesium.Color.floatToByte(color.red), - * Cesium.Color.floatToByte(color.green), - * Cesium.Color.floatToByte(color.blue), - * Cesium.Color.floatToByte(color.alpha) - * ]); + attribute.componentsPerAttribute = 4; + attribute.normalize = true; + attribute.values = new Uint8Array([ + Cesium.Color.floatToByte(color.red), + Cesium.Color.floatToByte(color.green), + Cesium.Color.floatToByte(color.blue), + Cesium.Color.floatToByte(color.alpha) + ]); */ normalize: boolean; /** * The values for the attributes stored in a typed array. In the code example, - * every three elements in values defines one attributes since - * componentsPerAttribute is 3. + every three elements in values defines one attributes since + componentsPerAttribute is 3. * @example * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT; - * attribute.componentsPerAttribute = 3; - * attribute.values = new Float32Array([ - * 0.0, 0.0, 0.0, - * 7500000.0, 0.0, 0.0, - * 0.0, 7500000.0, 0.0 - * ]); + attribute.componentsPerAttribute = 3; + attribute.values = new Float32Array([ + 0.0, 0.0, 0.0, + 7500000.0, 0.0, 0.0, + 0.0, 7500000.0, 0.0 + ]); */ values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; } /** * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a - * {@link GeometryAttribute} containing the attribute's data. - *

- * Attributes are always stored non-interleaved in a Geometry. - *

+{@link GeometryAttribute} containing the attribute's data. +

+Attributes are always stored non-interleaved in a Geometry. +

*/ export class GeometryAttributes { constructor(); /** * The 3D position attribute. - *

- * 64-bit floating-point (for precision). 3 components per attribute. - *

+

+ 64-bit floating-point (for precision). 3 components per attribute. +

*/ position: GeometryAttribute; /** * The normal attribute (normalized), which is commonly used for lighting. - *

- * 32-bit floating-point. 3 components per attribute. - *

+

+ 32-bit floating-point. 3 components per attribute. +

*/ normal: GeometryAttribute; /** * The 2D texture coordinate attribute. - *

- * 32-bit floating-point. 2 components per attribute - *

+

+ 32-bit floating-point. 2 components per attribute +

*/ st: GeometryAttribute; /** * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. - *

- * 32-bit floating-point. 3 components per attribute. - *

+

+ 32-bit floating-point. 3 components per attribute. +

*/ bitangent: GeometryAttribute; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. - *

- * 32-bit floating-point. 3 components per attribute. - *

+

+ 32-bit floating-point. 3 components per attribute. +

*/ tangent: GeometryAttribute; /** * The color attribute. - *

- * 8-bit unsigned integer. 4 components per attribute. - *

+

+ 8-bit unsigned integer. 4 components per attribute. +

*/ color: GeometryAttribute; } /** * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance} - * for asynchronous geometry creation. +for asynchronous geometry creation. */ export class GeometryFactory { constructor(); @@ -6668,35 +6856,35 @@ export class GeometryFactory { /** * Geometry instancing allows one {@link Geometry} object to be positions in several - * different locations and colored uniquely. For example, one {@link BoxGeometry} can - * be instanced several times, each with a different modelMatrix to change - * its position, rotation, and scale. +different locations and colored uniquely. For example, one {@link BoxGeometry} can +be instanced several times, each with a different modelMatrix to change +its position, rotation, and scale. * @example * // Create geometry for a box, and two instances that refer to it. - * // One instance positions the box on the bottom and colored aqua. - * // The other instance positions the box on the top and color white. - * var geometry = Cesium.BoxGeometry.fromDimensions({ - * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, - * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) - * }); - * var instanceBottom = new Cesium.GeometryInstance({ - * geometry : geometry, - * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( - * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), - * attributes : { - * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) - * }, - * id : 'bottom' - * }); - * var instanceTop = new Cesium.GeometryInstance({ - * geometry : geometry, - * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( - * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()), - * attributes : { - * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) - * }, - * id : 'top' - * }); +// One instance positions the box on the bottom and colored aqua. +// The other instance positions the box on the top and color white. +var geometry = Cesium.BoxGeometry.fromDimensions({ + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, + dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) +}); +var instanceBottom = new Cesium.GeometryInstance({ + geometry : geometry, + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) + }, + id : 'bottom' +}); +var instanceTop = new Cesium.GeometryInstance({ + geometry : geometry, + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) + }, + id : 'top' +}); * @param options - Object with the following properties: * @param options.geometry - The geometry to instance. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates. @@ -6716,9 +6904,9 @@ export class GeometryInstance { geometry: Geometry; /** * The 4x4 transformation matrix that transforms the geometry from model to world coordinates. - * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates. - * Local reference frames can be used by providing a different transformation matrix, like that returned - * by {@link Transforms.eastNorthUpToFixedFrame}. + When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. */ modelMatrix: Matrix4; /** @@ -6727,7 +6915,7 @@ export class GeometryInstance { id: any; /** * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}. - * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance. + {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance. */ attributes: any; } @@ -6736,21 +6924,21 @@ export class GeometryInstance { * Values and type information for per-instance geometry attributes. * @example * var instance = new Cesium.GeometryInstance({ - * geometry : Cesium.BoxGeometry.fromDimensions({ - * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) - * }), - * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( - * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), - * id : 'box', - * attributes : { - * color : new Cesium.GeometryInstanceAttribute({ - * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, - * componentsPerAttribute : 4, - * normalize : true, - * value : [255, 255, 0, 255] - * }) - * } - * }); + geometry : Cesium.BoxGeometry.fromDimensions({ + dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + id : 'box', + attributes : { + color : new Cesium.GeometryInstanceAttribute({ + componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, + componentsPerAttribute : 4, + normalize : true, + value : [255, 255, 0, 255] + }) + } +}); * @param options - Object with the following properties: * @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values. * @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes. @@ -6766,52 +6954,52 @@ export class GeometryInstanceAttribute { }); /** * The datatype of each component in the attribute, e.g., individual elements in - * {@link GeometryInstanceAttribute#value}. + {@link GeometryInstanceAttribute#value}. */ componentDatatype: ComponentDatatype; /** * A number between 1 and 4 that defines the number of components in an attributes. - * For example, a position attribute with x, y, and z components would have 3 as - * shown in the code example. + For example, a position attribute with x, y, and z components would have 3 as + shown in the code example. * @example * show : new Cesium.GeometryInstanceAttribute({ - * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, - * componentsPerAttribute : 1, - * normalize : true, - * value : [1.0] - * }) + componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, + componentsPerAttribute : 1, + normalize : true, + value : [1.0] + }) */ componentsPerAttribute: number; /** * When true and componentDatatype is an integer format, - * indicate that the components should be mapped to the range [0, 1] (unsigned) - * or [-1, 1] (signed) when they are accessed as floating-point for rendering. - *

- * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}. - *

+ indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. +

+ This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}. +

* @example * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE; - * attribute.componentsPerAttribute = 4; - * attribute.normalize = true; - * attribute.value = [ - * Cesium.Color.floatToByte(color.red), - * Cesium.Color.floatToByte(color.green), - * Cesium.Color.floatToByte(color.blue), - * Cesium.Color.floatToByte(color.alpha) - * ]; + attribute.componentsPerAttribute = 4; + attribute.normalize = true; + attribute.value = [ + Cesium.Color.floatToByte(color.red), + Cesium.Color.floatToByte(color.green), + Cesium.Color.floatToByte(color.blue), + Cesium.Color.floatToByte(color.alpha) + ]; */ normalize: boolean; /** * The values for the attributes stored in a typed array. In the code example, - * every three elements in values defines one attributes since - * componentsPerAttribute is 3. + every three elements in values defines one attributes since + componentsPerAttribute is 3. * @example * show : new Cesium.GeometryInstanceAttribute({ - * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, - * componentsPerAttribute : 1, - * normalize : true, - * value : [1.0] - * }) + componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, + componentsPerAttribute : 1, + normalize : true, + value : [1.0] + }) */ value: number[]; } @@ -6822,11 +7010,11 @@ export class GeometryInstanceAttribute { export namespace GeometryPipeline { /** * Converts a geometry's triangle indices to line indices. If the geometry has an indices - * and its primitiveType is TRIANGLES, TRIANGLE_STRIP, - * TRIANGLE_FAN, it is converted to LINES; otherwise, the geometry is not changed. - *

- * This is commonly used to create a wireframe geometry for visual debugging. - *

+ and its primitiveType is TRIANGLES, TRIANGLE_STRIP, + TRIANGLE_FAN, it is converted to LINES; otherwise, the geometry is not changed. +

+ This is commonly used to create a wireframe geometry for visual debugging. +

* @example * geometry = Cesium.GeometryPipeline.toWireframe(geometry); * @param geometry - The geometry to modify. @@ -6835,8 +7023,8 @@ export namespace GeometryPipeline { function toWireframe(geometry: Geometry): Geometry; /** * Creates a new {@link Geometry} with LINES representing the provided - * attribute (attributeName) for the provided geometry. This is used to - * visualize vector attributes like normals, tangents, and bitangents. + attribute (attributeName) for the provided geometry. This is used to + visualize vector attributes like normals, tangents, and bitangents. * @example * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); * @param geometry - The Geometry instance with the attribute. @@ -6847,14 +7035,14 @@ export namespace GeometryPipeline { function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry; /** * Creates an object that maps attribute names to unique locations (indices) - * for matching vertex attributes and shader programs. + for matching vertex attributes and shader programs. * @example * var attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry); - * // Example output - * // { - * // 'position' : 0, - * // 'normal' : 1 - * // } + // Example output + // { + // 'position' : 0, + // 'normal' : 1 + // } * @param geometry - The geometry, which is not modified, to create the object for. * @returns An object with attribute name / index pairs. */ @@ -6869,8 +7057,8 @@ export namespace GeometryPipeline { function reorderForPreVertexCache(geometry: Geometry): Geometry; /** * Reorders a geometry's indices to achieve better performance from the GPU's - * post vertex-shader cache by using the Tipsify algorithm. If the geometry primitiveType - * is not TRIANGLES or the geometry does not have an indices, this function has no effect. + post vertex-shader cache by using the Tipsify algorithm. If the geometry primitiveType + is not TRIANGLES or the geometry does not have an indices, this function has no effect. * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); * @param geometry - The geometry to modify. @@ -6880,11 +7068,11 @@ export namespace GeometryPipeline { function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry; /** * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the - * indices fit into unsigned shorts. This is used to meet the WebGL requirements - * when unsigned int indices are not supported. - *

- * If the geometry does not have any indices, this function has no effect. - *

+ indices fit into unsigned shorts. This is used to meet the WebGL requirements + when unsigned int indices are not supported. +

+ If the geometry does not have any indices, this function has no effect. +

* @example * var geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry); * @param geometry - The geometry to be split into multiple geometries. @@ -6893,10 +7081,10 @@ export namespace GeometryPipeline { function fitToUnsignedShortIndices(geometry: Geometry): Geometry[]; /** * Projects a geometry's 3D position attribute to 2D, replacing the position - * attribute with separate position3D and position2D attributes. - *

- * If the geometry does not have a position, this function has no effect. - *

+ attribute with separate position3D and position2D attributes. +

+ If the geometry does not have a position, this function has no effect. +

* @example * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D'); * @param geometry - The geometry to modify. @@ -6909,10 +7097,10 @@ export namespace GeometryPipeline { function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry; /** * Encodes floating-point geometry attribute values as two separate attributes to improve - * rendering precision. - *

- * This is commonly used to create high-precision position vertex attributes. - *

+ rendering precision. +

+ This is commonly used to create high-precision position vertex attributes. +

* @example * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow'); * @param geometry - The geometry to modify. @@ -6924,9 +7112,9 @@ export namespace GeometryPipeline { function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry; /** * Transforms a geometry instance to world coordinates. This changes - * the instance's modelMatrix to {@link Matrix4.IDENTITY} and transforms the - * following attributes if they are present: position, normal, - * tangent, and bitangent. + the instance's modelMatrix to {@link Matrix4.IDENTITY} and transforms the + following attributes if they are present: position, normal, + tangent, and bitangent. * @example * Cesium.GeometryPipeline.transformToWorldCoordinates(instance); * @param instance - The geometry instance to modify. @@ -6935,8 +7123,8 @@ export namespace GeometryPipeline { function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance; /** * Computes per-vertex normals for a geometry containing TRIANGLES by averaging the normals of - * all triangles incident to the vertex. The result is a new normal attribute added to the geometry. - * This assumes a counter-clockwise winding order. + all triangles incident to the vertex. The result is a new normal attribute added to the geometry. + This assumes a counter-clockwise winding order. * @example * Cesium.GeometryPipeline.computeNormal(geometry); * @param geometry - The geometry to modify. @@ -6945,12 +7133,12 @@ export namespace GeometryPipeline { function computeNormal(geometry: Geometry): Geometry; /** * Computes per-vertex tangents and bitangents for a geometry containing TRIANGLES. - * The result is new tangent and bitangent attributes added to the geometry. - * This assumes a counter-clockwise winding order. - *

- * Based on Computing Tangent Space Basis Vectors - * for an Arbitrary Mesh by Eric Lengyel. - *

+ The result is new tangent and bitangent attributes added to the geometry. + This assumes a counter-clockwise winding order. +

+ Based on Computing Tangent Space Basis Vectors + for an Arbitrary Mesh by Eric Lengyel. +

* @example * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); * @param geometry - The geometry to modify. @@ -6967,9 +7155,73 @@ export namespace GeometryPipeline { function compressVertices(geometry: Geometry): Geometry; } +/** + * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri. + * @example + * //absolute Uri will be "https://test.com/awesome.png"; +var absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com'); + * @param relative - The relative Uri. + * @param [base] - The base Uri. + * @returns The absolute Uri of the given relative Uri. + */ +export function getAbsoluteUri(relative: string, base?: string): string; + +/** + * Given a URI, returns the base path of the URI. + * @example + * // basePath will be "/Gallery/"; +var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false'); + +// basePath will be "/Gallery/?value=true&example=false"; +var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true); + * @param uri - The Uri. + * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri + * @returns The base path of the Uri. + */ +export function getBaseUri(uri: string, includeQuery?: boolean): string; + +/** + * Given a URI, returns the extension of the URI. + * @example + * //extension will be "czml"; +var extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false'); + * @param uri - The Uri. + * @returns The extension of the Uri. + */ +export function getExtensionFromUri(uri: string): string; + +/** + * Given a URI, returns the last segment of the URI, removing any path or query information. + * @example + * //fileName will be"simple.czml"; +var fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false'); + * @param uri - The Uri. + * @returns The last segment of the Uri. + */ +export function getFilenameFromUri(uri: string): string; + +/** + * Extract a pixel array from a loaded image. Draws the image +into a canvas so it can read the pixels back. + * @param image - The image to extract pixels from. + * @param width - The width of the image. If not defined, then image.width is assigned. + * @param height - The height of the image. If not defined, then image.height is assigned. + * @returns The pixels of the image. + */ +export function getImagePixels(image: HTMLImageElement, width: number, height: number): ImageData; + +/** + * Gets a timestamp that can be used in measuring the time between events. Timestamps +are expressed in milliseconds, but it is not specified what the milliseconds are +measured from. This function uses performance.now() if it is available, or Date.now() +otherwise. + * @returns The timestamp in milliseconds since some unspecified reference time. + */ +export function getTimestamp(): number; + /** * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider - * and GoogleEarthEnterpriseTerrainProvider to share metadata requests. + and GoogleEarthEnterpriseTerrainProvider to share metadata requests. * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery */ export class GoogleEarthEnterpriseMetadata { @@ -7020,7 +7272,7 @@ export class GoogleEarthEnterpriseMetadata { readonly readyPromise: Promise; /** * Converts a tiles (x, y, level) position into a quadkey used to request an image - * from a Google Earth Enterprise server. + from a Google Earth Enterprise server. * @param x - The tile's x coordinate. * @param y - The tile's y coordinate. * @param level - The tile's zoom level. @@ -7028,7 +7280,7 @@ export class GoogleEarthEnterpriseMetadata { static tileXYToQuadKey(x: number, y: number, level: number): void; /** * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the - * (x, y, level) position. + (x, y, level) position. * @param quadkey - The tile's quad key */ static quadKeyToTileXY(quadkey: string): void; @@ -7038,28 +7290,28 @@ export class GoogleEarthEnterpriseMetadata { * Terrain data for a single tile from a Google Earth Enterprise server. * @example * var buffer = ... - * var childTileMask = ... - * var terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({ - * buffer : heightBuffer, - * childTileMask : childTileMask - * }); +var childTileMask = ... +var terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({ + buffer : heightBuffer, + childTileMask : childTileMask +}); * @param options - Object with the following properties: * @param options.buffer - The buffer containing terrain data. * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values. * @param options.negativeElevationThreshold - Threshold for negative values * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. - * If a child's bit is set, geometry will be requested for that tile as well when it - * is needed. If the bit is cleared, the child tile is not requested and geometry is - * instead upsampled from the parent. The bit values are as follows: - * - * - * - * - * - * - *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northeast
38Northwest
+ If a child's bit is set, geometry will be requested for that tile as well when it + is needed. If the bit is cleared, the child tile is not requested and geometry is + instead upsampled from the parent. The bit values are as follows: + + + + + + +
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northeast
38Northwest
* @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; - * otherwise, false. + otherwise, false. * @param [options.credits] - Array of credits for this tile. */ export class GoogleEarthEnterpriseTerrainData { @@ -7077,8 +7329,8 @@ export class GoogleEarthEnterpriseTerrainData { credits: Credit[]; /** * The water mask included in this terrain data, if any. A water mask is a rectangular - * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. - * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; /** @@ -7087,13 +7339,13 @@ export class GoogleEarthEnterpriseTerrainData { * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position. If the position - * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly - * incorrect for positions far outside the rectangle. + is outside the rectangle, this method will extrapolate the height, which is likely to be wildly + incorrect for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; /** * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the - * height samples in this instance, interpolated if necessary. + height samples in this instance, interpolated if necessary. * @param tilingScheme - The tiling scheme of this terrain data. * @param thisX - The X coordinate of this tile in the tiling scheme. * @param thisY - The Y coordinate of this tile in the tiling scheme. @@ -7102,15 +7354,15 @@ export class GoogleEarthEnterpriseTerrainData { * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled heightmap terrain data for the descendant tile, - * or undefined if too many asynchronous upsample operations are in progress and the request has been - * deferred. + or undefined if too many asynchronous upsample operations are in progress and the request has been + deferred. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** * Determines if a given child tile is available, based on the - * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed - * to be one of the four children of this tile. If non-child tile coordinates are - * given, the availability of the southeast child tile is returned. + {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed + to be one of the four children of this tile. If non-child tile coordinates are + given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. @@ -7120,9 +7372,9 @@ export class GoogleEarthEnterpriseTerrainData { isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution - * terrain data. If this value is false, the data was obtained from some other source, such - * as by downloading it from a remote server. This method should return true for instances - * returned from a call to {@link HeightmapTerrainData#upsample}. + terrain data. If this value is false, the data was obtained from some other source, such + as by downloading it from a remote server. This method should return true for instances + returned from a call to {@link HeightmapTerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; @@ -7132,9 +7384,9 @@ export class GoogleEarthEnterpriseTerrainData { * Provides tiled terrain using the Google Earth Enterprise REST API. * @example * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d'); - * var gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({ - * metadata : geeMetadata - * }); +var gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({ + metadata : geeMetadata +}); * @param options - Object with the following properties: * @param options.url - The url of the Google Earth Enterprise server hosting the imagery. * @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider. @@ -7158,13 +7410,13 @@ export class GoogleEarthEnterpriseTerrainProvider { readonly proxy: Proxy; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -7177,39 +7429,39 @@ export class GoogleEarthEnterpriseTerrainProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit - * the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. + the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask - * indicates which areas of the globe are water rather than land, so they can be rendered - * as a reflective surface with animated waves. This function should not be - * called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. */ hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. - * This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. + This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. */ hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as - * at points and in rectangles. This function should not be called before - * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability - * information is not available. + at points and in rectangles. This function should not be called before + {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. */ availability: TileAvailability; /** * Requests the geometry for a given tile. This function should not be called before - * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and - * may optionally include a water mask and an indication of which child tiles are available. + {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and + may optionally include a water mask and an indication of which child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method - * returns undefined instead of a promise, it is an indication that too many requests are already - * pending and the request will be retried later. + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** @@ -7238,7 +7490,7 @@ export class GoogleEarthEnterpriseTerrainProvider { /** * Represents a Gregorian date in a more precise format than the JavaScript Date object. - * In addition to submillisecond precision, this object can also represent leap seconds. +In addition to submillisecond precision, this object can also represent leap seconds. * @param [year] - The year as a whole number. * @param [month] - The month as a whole number with range [1, 12]. * @param [day] - The day of the month as a whole number starting at 1. @@ -7288,14 +7540,14 @@ export class GregorianDate { * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}. * @example * var positions = Cesium.Cartesian3.fromDegreesArray([ - * -112.1340164450331, 36.05494287836128, - * -112.08821010582645, 36.097804071380715, - * -112.13296079730024, 36.168769146801104 - * ]); - * - * var geometry = new Cesium.GroundPolylineGeometry({ - * positions : positions - * }); + -112.1340164450331, 36.05494287836128, + -112.08821010582645, 36.097804071380715, + -112.13296079730024, 36.168769146801104 +]); + +var geometry = new Cesium.GroundPolylineGeometry({ + positions : positions +}); * @param options - Options with the following properties: * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored. * @param [options.width = 1.0] - The screen space width in pixels. @@ -7317,12 +7569,12 @@ export class GroundPolylineGeometry { width: number; /** * The distance interval used for interpolating options.points. Zero indicates no interpolation. - * Default of 9999.0 allows centimeter accuracy with 32 bit floating point. + Default of 9999.0 allows centimeter accuracy with 32 bit floating point. */ granularity: boolean; /** * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop. - * If the geometry has two positions this parameter will be ignored. + If the geometry has two positions this parameter will be ignored. */ loop: boolean; /** @@ -7348,9 +7600,9 @@ export class GroundPolylineGeometry { /** * Defines a heading angle, pitch angle, and range in a local frame. - * Heading is the rotation from the local north direction where a positive angle is increasing eastward. - * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch - * angles are below the plane. Range is the distance from the center of the frame. +Heading is the rotation from the local north direction where a positive angle is increasing eastward. +Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch +angles are below the plane. Range is the distance from the center of the frame. * @param [heading = 0.0] - The heading angle in radians. * @param [pitch = 0.0] - The pitch angle in radians. * @param [range = 0.0] - The distance from the center in meters. @@ -7363,7 +7615,7 @@ export class HeadingPitchRange { heading: number; /** * Pitch is the rotation from the local xy-plane. Positive pitch angles - * are above the plane. Negative pitch angles are below the plane. + are above the plane. Negative pitch angles are below the plane. */ pitch: number; /** @@ -7381,8 +7633,8 @@ export class HeadingPitchRange { /** * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the - * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about - * the positive x axis. +negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about +the positive x axis. * @param [heading = 0.0] - The heading component in radians. * @param [pitch = 0.0] - The pitch component in radians. * @param [roll = 0.0] - The roll component in radians. @@ -7426,7 +7678,7 @@ export class HeadingPitchRoll { static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll; /** * Compares the provided HeadingPitchRolls componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first HeadingPitchRoll. * @param [right] - The second HeadingPitchRoll. * @returns true if left and right are equal, false otherwise. @@ -7434,8 +7686,8 @@ export class HeadingPitchRoll { static equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean; /** * Compares the provided HeadingPitchRolls componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [left] - The first HeadingPitchRoll. * @param [right] - The second HeadingPitchRoll. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. @@ -7451,15 +7703,15 @@ export class HeadingPitchRoll { clone(result?: HeadingPitchRoll): HeadingPitchRoll; /** * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side HeadingPitchRoll. * @returns true if they are equal, false otherwise. */ equals(right?: HeadingPitchRoll): boolean; /** * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [right] - The right hand side HeadingPitchRoll. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. @@ -7489,70 +7741,70 @@ export enum HeightmapEncoding { /** * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap - * is a rectangular array of heights in row-major order from north to south and west to east. +is a rectangular array of heights in row-major order from north to south and west to east. * @example * var buffer = ... - * var heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth); - * var childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0]; - * var waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1); - * var terrainData = new Cesium.HeightmapTerrainData({ - * buffer : heightBuffer, - * width : 65, - * height : 65, - * childTileMask : childTileMask, - * waterMask : waterMask - * }); +var heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth); +var childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0]; +var waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1); +var terrainData = new Cesium.HeightmapTerrainData({ + buffer : heightBuffer, + width : 65, + height : 65, + childTileMask : childTileMask, + waterMask : waterMask +}); * @param options - Object with the following properties: * @param options.buffer - The buffer containing height data. * @param options.width - The width (longitude direction) of the heightmap, in samples. * @param options.height - The height (latitude direction) of the heightmap, in samples. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. - * If a child's bit is set, geometry will be requested for that tile as well when it - * is needed. If the bit is cleared, the child tile is not requested and geometry is - * instead upsampled from the parent. The bit values are as follows: - * - * - * - * - * - * - *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
+ If a child's bit is set, geometry will be requested for that tile as well when it + is needed. If the bit is cleared, the child tile is not requested and geometry is + instead upsampled from the parent. The bit values are as follows: + + + + + + +
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
* @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square - * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. - * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. * @param [options.structure] - An object describing the structure of the height data. * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain - * the height above the heightOffset, in meters. The heightOffset is added to the resulting - * height after multiplying by the scale. + the height above the heightOffset, in meters. The heightOffset is added to the resulting + height after multiplying by the scale. * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final - * height in meters. The offset is added after the height sample is multiplied by the - * heightScale. + height in meters. The offset is added after the height sample is multiplied by the + heightScale. * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height - * sample. This is usually 1, indicating that each element is a separate height sample. If - * it is greater than 1, that number of elements together form the height sample, which is - * computed according to the structure.elementMultiplier and structure.isBigEndian properties. + sample. This is usually 1, indicating that each element is a separate height sample. If + it is greater than 1, that number of elements together form the height sample, which is + computed according to the structure.elementMultiplier and structure.isBigEndian properties. * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of - * one height to the first element of the next height. + one height to the first element of the next height. * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the - * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier - * is 256, the height is computed as follows: - * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256` - * This is assuming that the isBigEndian property is false. If it is true, the order of the - * elements is reversed. + stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier + is 256, the height is computed as follows: + `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256` + This is assuming that the isBigEndian property is false. If it is true, the order of the + elements is reversed. * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the - * stride property is greater than 1. If this property is false, the first element is the - * low-order element. If it is true, the first element is the high-order element. + stride property is greater than 1. If this property is false, the first element is the + low-order element. If it is true, the first element is the high-order element. * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower - * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height - * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is - * not specified, no minimum value is enforced. + than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height + buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is + not specified, no minimum value is enforced. * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher - * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height - * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger - * than 65535. If this parameter is not specified, no maximum value is enforced. + than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height + buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger + than 65535. If this parameter is not specified, no maximum value is enforced. * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; - * otherwise, false. + otherwise, false. */ export class HeightmapTerrainData { constructor(options: { @@ -7580,8 +7832,8 @@ export class HeightmapTerrainData { credits: Credit[]; /** * The water mask included in this terrain data, if any. A water mask is a square - * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. - * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; /** @@ -7590,13 +7842,13 @@ export class HeightmapTerrainData { * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position. If the position - * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly - * incorrect for positions far outside the rectangle. + is outside the rectangle, this method will extrapolate the height, which is likely to be wildly + incorrect for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; /** * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the - * height samples in this instance, interpolated if necessary. + height samples in this instance, interpolated if necessary. * @param tilingScheme - The tiling scheme of this terrain data. * @param thisX - The X coordinate of this tile in the tiling scheme. * @param thisY - The Y coordinate of this tile in the tiling scheme. @@ -7605,15 +7857,15 @@ export class HeightmapTerrainData { * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled heightmap terrain data for the descendant tile, - * or undefined if too many asynchronous upsample operations are in progress and the request has been - * deferred. + or undefined if too many asynchronous upsample operations are in progress and the request has been + deferred. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** * Determines if a given child tile is available, based on the - * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed - * to be one of the four children of this tile. If non-child tile coordinates are - * given, the availability of the southeast child tile is returned. + {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed + to be one of the four children of this tile. If non-child tile coordinates are + given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. @@ -7623,9 +7875,9 @@ export class HeightmapTerrainData { isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution - * terrain data. If this value is false, the data was obtained from some other source, such - * as by downloading it from a remote server. This method should return true for instances - * returned from a call to {@link HeightmapTerrainData#upsample}. + terrain data. If this value is false, the data was obtained from some other source, such + as by downloading it from a remote server. This method should return true for instances + returned from a call to {@link HeightmapTerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; @@ -7646,11 +7898,11 @@ export namespace HermitePolynomialApproximation { * Interpolates values using Hermite Polynomial Approximation. * @param x - The independent variable for which the dependent variables will be interpolated. * @param xTable - The array of independent variables to use to interpolate. The values - * in this array must be in increasing order and the same value must not occur twice in the array. + in this array must be in increasing order and the same value must not occur twice in the array. * @param yTable - The array of dependent variables to use to interpolate. For a set of three - * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. * @param yStride - The number of dependent variable values in yTable corresponding to - * each independent variable value in xTable. + each independent variable value in xTable. * @param [result] - An existing array into which to store the result. * @returns The array of interpolated values, or the result parameter if one was provided. */ @@ -7659,11 +7911,11 @@ export namespace HermitePolynomialApproximation { * Interpolates values using Hermite Polynomial Approximation. * @param x - The independent variable for which the dependent variables will be interpolated. * @param xTable - The array of independent variables to use to interpolate. The values - * in this array must be in increasing order and the same value must not occur twice in the array. + in this array must be in increasing order and the same value must not occur twice in the array. * @param yTable - The array of dependent variables to use to interpolate. For a set of three - * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. * @param yStride - The number of dependent variable values in yTable corresponding to - * each independent variable value in xTable. + each independent variable value in xTable. * @param inputOrder - The number of derivatives supplied for input. * @param outputOrder - The number of derivatives desired for output. * @param [result] - An existing array into which to store the result. @@ -7674,40 +7926,40 @@ export namespace HermitePolynomialApproximation { /** * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times - * must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming - * tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between points[i] and - * points[i + 1], the tangents at the points will be outTangents[i] and inTangents[i], - * respectively. +must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming +tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between points[i] and +points[i + 1], the tangents at the points will be outTangents[i] and inTangents[i], +respectively. * @example * // Create a G1 continuous Hermite spline - * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; - * var spline = new Cesium.HermiteSpline({ - * times : times, - * points : [ - * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), - * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), - * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), - * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), - * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) - * ], - * outTangents : [ - * new Cesium.Cartesian3(1125196, -161816, 270551), - * new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5), - * new Cesium.Cartesian3(-2096917, 48379.5, -292683.5), - * new Cesium.Cartesian3(-890902.5, 408999.5, -447115) - * ], - * inTangents : [ - * new Cesium.Cartesian3(-1993381, -731813, 368057), - * new Cesium.Cartesian3(-4193834, 96759, -585367), - * new Cesium.Cartesian3(-1781805, 817999, -894230), - * new Cesium.Cartesian3(1165345, 112641, 47281) - * ] - * }); - * - * var p0 = spline.evaluate(times[0]); +var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; +var spline = new Cesium.HermiteSpline({ + times : times, + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ], + outTangents : [ + new Cesium.Cartesian3(1125196, -161816, 270551), + new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5), + new Cesium.Cartesian3(-2096917, 48379.5, -292683.5), + new Cesium.Cartesian3(-890902.5, 408999.5, -447115) + ], + inTangents : [ + new Cesium.Cartesian3(-1993381, -731813, 368057), + new Cesium.Cartesian3(-4193834, 96759, -585367), + new Cesium.Cartesian3(-1781805, 817999, -894230), + new Cesium.Cartesian3(1165345, 112641, 47281) + ] +}); + +var p0 = spline.evaluate(times[0]); * @param options - Object with the following properties: * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. - * The values are in no way connected to the clock time. They are the parameterization for the curve. + The values are in no way connected to the clock time. They are the parameterization for the curve. * @param options.points - The array of {@link Cartesian3} control points. * @param options.inTangents - The array of {@link Cartesian3} incoming tangents at each control point. * @param options.outTangents - The array of {@link Cartesian3} outgoing tangents at each control point. @@ -7737,30 +7989,30 @@ export class HermiteSpline { readonly outTangents: Cartesian3[]; /** * Creates a spline where the tangents at each control point are the same. - * The curves are guaranteed to be at least in the class C1. + The curves are guaranteed to be at least in the class C1. * @example * var points = [ - * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), - * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), - * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), - * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), - * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) - * ]; - * - * // Add tangents - * var tangents = new Array(points.length); - * tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551); - * var temp = new Cesium.Cartesian3(); - * for (var i = 1; i < tangents.length - 1; ++i) { - * tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3()); - * } - * tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281); - * - * var spline = Cesium.HermiteSpline.createC1({ - * times : times, - * points : points, - * tangents : tangents - * }); + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ]; + + // Add tangents + var tangents = new Array(points.length); + tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551); + var temp = new Cesium.Cartesian3(); + for (var i = 1; i < tangents.length - 1; ++i) { + tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3()); + } + tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281); + + var spline = Cesium.HermiteSpline.createC1({ + times : times, + points : points, + tangents : tangents + }); * @param options - Object with the following properties: * @param options.times - The array of control point times. * @param options.points - The array of control points. @@ -7774,19 +8026,19 @@ export class HermiteSpline { }): HermiteSpline; /** * Creates a natural cubic spline. The tangents at the control points are generated - * to create a curve in the class C2. + to create a curve in the class C2. * @example * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles. - * var spline = Cesium.HermiteSpline.createNaturalCubic({ - * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], - * points : [ - * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), - * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), - * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), - * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), - * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) - * ] - * }); + var spline = Cesium.HermiteSpline.createNaturalCubic({ + times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ] + }); * @param options - Object with the following properties: * @param options.times - The array of control point times. * @param options.points - The array of control points. @@ -7798,21 +8050,21 @@ export class HermiteSpline { }): HermiteSpline | LinearSpline; /** * Creates a clamped cubic spline. The tangents at the interior control points are generated - * to create a curve in the class C2. + to create a curve in the class C2. * @example * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles. - * var spline = Cesium.HermiteSpline.createClampedCubic({ - * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], - * points : [ - * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), - * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), - * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), - * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), - * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) - * ], - * firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551), - * lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281) - * }); + var spline = Cesium.HermiteSpline.createClampedCubic({ + times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ], + firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551), + lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281) + }); * @param options - Object with the following properties: * @param options.times - The array of control point times. * @param options.points - The array of control points. @@ -7828,7 +8080,7 @@ export class HermiteSpline { }): HermiteSpline | LinearSpline; /** * Finds an index i in times such that the parameter - * time is in the interval [times[i], times[i + 1]]. + time is in the interval [times[i], times[i + 1]]. * @param time - The time. * @returns The index for the element at the start of the interval. */ @@ -7856,22 +8108,22 @@ export class HermiteSpline { /** * Constants for WebGL index datatypes. These corresponds to the - * type parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}. +type parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}. */ export enum IndexDatatype { /** * 8-bit unsigned byte corresponding to UNSIGNED_BYTE and the type - * of an element in Uint8Array. + of an element in Uint8Array. */ UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE, /** * 16-bit unsigned short corresponding to UNSIGNED_SHORT and the type - * of an element in Uint16Array. + of an element in Uint16Array. */ UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT, /** * 32-bit unsigned int corresponding to UNSIGNED_INT and the type - * of an element in Uint32Array. + of an element in Uint32Array. */ UNSIGNED_INT = WebGLConstants.UNSIGNED_INT } @@ -7891,25 +8143,25 @@ export namespace InterpolationAlgorithm { * Performs zero order interpolation. * @param x - The independent variable for which the dependent variables will be interpolated. * @param xTable - The array of independent variables to use to interpolate. The values - * in this array must be in increasing order and the same value must not occur twice in the array. + in this array must be in increasing order and the same value must not occur twice in the array. * @param yTable - The array of dependent variables to use to interpolate. For a set of three - * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. * @param yStride - The number of dependent variable values in yTable corresponding to - * each independent variable value in xTable. + each independent variable value in xTable. * @param [result] - An existing array into which to store the result. * @returns The array of interpolated values, or the result parameter if one was provided. */ function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[]; /** * Performs higher order interpolation. Not all interpolators need to support high-order interpolation, - * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead. + if this function remains undefined on implementing objects, interpolateOrderZero will be used instead. * @param x - The independent variable for which the dependent variables will be interpolated. * @param xTable - The array of independent variables to use to interpolate. The values - * in this array must be in increasing order and the same value must not occur twice in the array. + in this array must be in increasing order and the same value must not occur twice in the array. * @param yTable - The array of dependent variables to use to interpolate. For a set of three - * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. * @param yStride - The number of dependent variable values in yTable corresponding to - * each independent variable value in xTable. + each independent variable value in xTable. * @param inputOrder - The number of derivatives supplied for input. * @param outputOrder - The number of derivatives desired for output. * @param [result] - An existing array into which to store the result. @@ -7926,9 +8178,9 @@ export interface InterpolationAlgorithm { /** * This enumerated type is used in determining where, relative to the frustum, an - * object is located. The object can either be fully contained within the frustum (INSIDE), - * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely - * outside of the frustum's 6 planes (OUTSIDE). +object is located. The object can either be fully contained within the frustum (INSIDE), +partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely +outside of the frustum's 6 planes (OUTSIDE). */ export enum Intersect { /** @@ -7945,6 +8197,73 @@ export enum Intersect { INSIDE = 1 } +/** + * Contains functions for operating on 2D triangles. + */ +export namespace Intersections2D { + /** + * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting + polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2, + 3, or 4 vertices. + * @example + * var result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4); + // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5] + * @param threshold - The threshold coordinate value at which to clip the triangle. + * @param keepAbove - true to keep the portion of the triangle above the threshold, or false + to keep the portion below. + * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order. + * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order. + * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order. + * @param [result] - The array into which to copy the result. If this parameter is not supplied, + a new array is constructed and returned. + * @returns The polygon that results after the clip, specified as a list of + vertices. The vertices are specified in counter-clockwise order. + Each vertex is either an index from the existing list (identified as + a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle. + For new vertices, the -1 is followed by three additional numbers: the + index of each of the two original vertices forming the line segment that + the new vertex lies on, and the fraction of the distance from the first + vertex to the second one. + */ + function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[]; + /** + * Compute the barycentric coordinates of a 2D position within a 2D triangle. + * @example + * var result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5); + // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0); + * @param x - The x coordinate of the position for which to find the barycentric coordinates. + * @param y - The y coordinate of the position for which to find the barycentric coordinates. + * @param x1 - The x coordinate of the triangle's first vertex. + * @param y1 - The y coordinate of the triangle's first vertex. + * @param x2 - The x coordinate of the triangle's second vertex. + * @param y2 - The y coordinate of the triangle's second vertex. + * @param x3 - The x coordinate of the triangle's third vertex. + * @param y3 - The y coordinate of the triangle's third vertex. + * @param [result] - The instance into to which to copy the result. If this parameter + is undefined, a new instance is created and returned. + * @returns The barycentric coordinates of the position within the triangle. + */ + function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3; + /** + * Compute the intersection between 2 line segments + * @example + * var result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1); + // result === new Cesium.Cartesian2(0.0, 1.0); + * @param x00 - The x coordinate of the first line's first vertex. + * @param y00 - The y coordinate of the first line's first vertex. + * @param x01 - The x coordinate of the first line's second vertex. + * @param y01 - The y coordinate of the first line's second vertex. + * @param x10 - The x coordinate of the second line's first vertex. + * @param y10 - The y coordinate of the second line's first vertex. + * @param x11 - The x coordinate of the second line's second vertex. + * @param y11 - The y coordinate of the second line's second vertex. + * @param [result] - The instance into to which to copy the result. If this parameter + is undefined, a new instance is created and returned. + * @returns The intersection point, undefined if there is no intersection point or lines are coincident. + */ + function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2; +} + /** * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids. */ @@ -7959,29 +8278,29 @@ export namespace IntersectionTests { function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3; /** * Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray. - * - * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf| - * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore. + + Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf| + Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore. * @param ray - The ray. * @param p0 - The first vertex of the triangle. * @param p1 - The second vertex of the triangle. * @param p2 - The third vertex of the triangle. * @param [cullBackFaces = false] - If true, will only compute an intersection with the front face of the triangle - * and return undefined for intersections with the back face. + and return undefined for intersections with the back face. * @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection. */ function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number; /** * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate. - * - * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf| - * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore. + + Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf| + Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore. * @param ray - The ray. * @param p0 - The first vertex of the triangle. * @param p1 - The second vertex of the triangle. * @param p2 - The third vertex of the triangle. * @param [cullBackFaces = false] - If true, will only compute an intersection with the front face of the triangle - * and return undefined for intersections with the back face. + and return undefined for intersections with the back face. * @param [result] - The Cartesian3 onto which to store the result. * @returns The intersection point or undefined if there is no intersections. */ @@ -7994,7 +8313,7 @@ export namespace IntersectionTests { * @param p1 - The second vertex of the triangle. * @param p2 - The third vertex of the triangle. * @param [cullBackFaces = false] - If true, will only compute an intersection with the front face of the triangle - * and return undefined for intersections with the back face. + and return undefined for intersections with the back face. * @param [result] - The Cartesian3 onto which to store the result. * @returns The intersection point or undefined if there is no intersections. */ @@ -8034,14 +8353,14 @@ export namespace IntersectionTests { * Computes the intersection of a line segment and a plane. * @example * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); - * var normal = ellipsoid.geodeticSurfaceNormal(origin); - * var plane = Cesium.Plane.fromPointNormal(origin, normal); - * - * var p0 = new Cesium.Cartesian3(...); - * var p1 = new Cesium.Cartesian3(...); - * - * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin. - * var intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane); + var normal = ellipsoid.geodeticSurfaceNormal(origin); + var plane = Cesium.Plane.fromPointNormal(origin, normal); + + var p0 = new Cesium.Cartesian3(...); + var p1 = new Cesium.Cartesian3(...); + + // find the intersection of the line segment from p0 to p1 and the tangent plane at origin. + var intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane); * @param endPoint0 - An end point of the line segment. * @param endPoint1 - The other end point of the line segment. * @param plane - The plane. @@ -8053,15 +8372,15 @@ export namespace IntersectionTests { * Computes the intersection of a triangle and a plane * @example * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); - * var normal = ellipsoid.geodeticSurfaceNormal(origin); - * var plane = Cesium.Plane.fromPointNormal(origin, normal); - * - * var p0 = new Cesium.Cartesian3(...); - * var p1 = new Cesium.Cartesian3(...); - * var p2 = new Cesium.Cartesian3(...); - * - * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane - * var triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane); + var normal = ellipsoid.geodeticSurfaceNormal(origin); + var plane = Cesium.Plane.fromPointNormal(origin, normal); + + var p0 = new Cesium.Cartesian3(...); + var p1 = new Cesium.Cartesian3(...); + var p2 = new Cesium.Cartesian3(...); + + // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane + var triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane); * @param p0 - First point of the triangle * @param p1 - Second point of the triangle * @param p2 - Third point of the triangle @@ -8071,73 +8390,6 @@ export namespace IntersectionTests { function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any; } -/** - * Contains functions for operating on 2D triangles. - */ -export namespace Intersections2D { - /** - * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting - * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2, - * 3, or 4 vertices. - * @example - * var result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4); - * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5] - * @param threshold - The threshold coordinate value at which to clip the triangle. - * @param keepAbove - true to keep the portion of the triangle above the threshold, or false - * to keep the portion below. - * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order. - * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order. - * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order. - * @param [result] - The array into which to copy the result. If this parameter is not supplied, - * a new array is constructed and returned. - * @returns The polygon that results after the clip, specified as a list of - * vertices. The vertices are specified in counter-clockwise order. - * Each vertex is either an index from the existing list (identified as - * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle. - * For new vertices, the -1 is followed by three additional numbers: the - * index of each of the two original vertices forming the line segment that - * the new vertex lies on, and the fraction of the distance from the first - * vertex to the second one. - */ - function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[]; - /** - * Compute the barycentric coordinates of a 2D position within a 2D triangle. - * @example - * var result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5); - * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0); - * @param x - The x coordinate of the position for which to find the barycentric coordinates. - * @param y - The y coordinate of the position for which to find the barycentric coordinates. - * @param x1 - The x coordinate of the triangle's first vertex. - * @param y1 - The y coordinate of the triangle's first vertex. - * @param x2 - The x coordinate of the triangle's second vertex. - * @param y2 - The y coordinate of the triangle's second vertex. - * @param x3 - The x coordinate of the triangle's third vertex. - * @param y3 - The y coordinate of the triangle's third vertex. - * @param [result] - The instance into to which to copy the result. If this parameter - * is undefined, a new instance is created and returned. - * @returns The barycentric coordinates of the position within the triangle. - */ - function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3; - /** - * Compute the intersection between 2 line segments - * @example - * var result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1); - * // result === new Cesium.Cartesian2(0.0, 1.0); - * @param x00 - The x coordinate of the first line's first vertex. - * @param y00 - The y coordinate of the first line's first vertex. - * @param x01 - The x coordinate of the first line's second vertex. - * @param y01 - The y coordinate of the first line's second vertex. - * @param x10 - The x coordinate of the second line's first vertex. - * @param y10 - The y coordinate of the second line's first vertex. - * @param x11 - The x coordinate of the second line's second vertex. - * @param y11 - The y coordinate of the second line's second vertex. - * @param [result] - The instance into to which to copy the result. If this parameter - * is undefined, a new instance is created and returned. - * @returns The intersection point, undefined if there is no intersection point or lines are coincident. - */ - function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2; -} - /** * Represents the closed interval [start, stop]. * @param [start = 0.0] - The beginning of the interval. @@ -8157,10 +8409,10 @@ export class Interval { /** * Default settings for accessing the Cesium ion API. - * - * An ion access token is only required if you are using any ion related APIs. - * A default access token is provided for evaluation purposes only. - * Sign up for a free ion account and get your own access token at {@link https://cesium.com} + +An ion access token is only required if you are using any ion related APIs. +A default access token is provided for evaluation purposes only. +Sign up for a free ion account and get your own access token at {@link https://cesium.com} */ export namespace Ion { /** @@ -8195,7 +8447,7 @@ export class IonGeocoderService { /** * A {@link Resource} instance that encapsulates Cesium ion asset access. - * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}. +This object is normally not instantiated directly, use {@link IonResource.fromAssetId}. * @param endpoint - The result of the Cesium ion asset endpoint service. * @param endpointResource - The resource used to retreive the endpoint. */ @@ -8205,13 +8457,13 @@ export class IonResource extends Resource { * Asynchronously creates an instance. * @example * //Load a Cesium3DTileset with asset ID of 124624234 - * viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) })); + viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) })); * @example * //Load a CZML file with asset ID of 10890 - * Cesium.IonResource.fromAssetId(10890) - * .then(function (resource) { - * viewer.dataSources.add(Cesium.CzmlDataSource.load(resource)); - * }); + Cesium.IonResource.fromAssetId(10890) + .then(function (resource) { + viewer.dataSources.add(Cesium.CzmlDataSource.load(resource)); + }); * @param assetId - The Cesium ion asset id. * @param [options] - An object with the following properties: * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use. @@ -8234,20 +8486,20 @@ export class IonResource extends Resource { clone(result?: Resource): Resource; /** * Asynchronously loads the given image resource. Returns a promise that will resolve to - * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an - * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load. + an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an + {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load. * @example * // load a single image asynchronously - * resource.fetchImage().then(function(image) { - * // use the loaded image - * }).otherwise(function(error) { - * // an error occurred - * }); - * - * // load several images in parallel - * when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) { - * // images is an array containing all the loaded images - * }); + resource.fetchImage().then(function(image) { + // use the loaded image + }).otherwise(function(error) { + // an error occurred + }); + + // load several images in parallel + when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) { + // images is an array containing all the loaded images + }); * @param [options] - An object with the following properties. * @param [options.preferBlob = false] - If true, we will load the image via a blob. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an ImageBitmap is returned. @@ -8261,33 +8513,42 @@ export class IonResource extends Resource { }): Promise | Promise | undefined; } +/** + * Determines if a given date is a leap year. + * @example + * var leapYear = Cesium.isLeapYear(2000); // true + * @param year - The year to be tested. + * @returns True if year is a leap year. + */ +export function isLeapYear(year: number): boolean; + /** * Constants related to ISO8601 support. */ export namespace Iso8601 { /** * A {@link JulianDate} representing the earliest time representable by an ISO8601 date. - * This is equivalent to the date string '0000-01-01T00:00:00Z' + This is equivalent to the date string '0000-01-01T00:00:00Z' */ const MINIMUM_VALUE: JulianDate; /** * A {@link JulianDate} representing the latest time representable by an ISO8601 date. - * This is equivalent to the date string '9999-12-31T24:00:00Z' + This is equivalent to the date string '9999-12-31T24:00:00Z' */ const MAXIMUM_VALUE: JulianDate; /** * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval. - * This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z' + This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z' */ const MAXIMUM_INTERVAL: JulianDate; } /** * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC). - * For increased precision, this class stores the whole number part of the date and the seconds - * part of the date in separate components. In order to be safe for arithmetic and represent - * leap seconds, the date is always stored in the International Atomic Time standard - * {@link TimeStandard.TAI}. +For increased precision, this class stores the whole number part of the date and the seconds +part of the date in separate components. In order to be safe for arithmetic and represent +leap seconds, the date is always stored in the International Atomic Time standard +{@link TimeStandard.TAI}. * @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly. * @param [secondsOfDay = 0.0] - The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly. * @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined. @@ -8318,8 +8579,8 @@ export class JulianDate { static fromDate(date: Date, result?: JulianDate): JulianDate; /** * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date. - * This method is superior to Date.parse because it will handle all valid formats defined by the ISO 8601 - * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations. + This method is superior to Date.parse because it will handle all valid formats defined by the ISO 8601 + specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations. * @param iso8601String - An ISO 8601 date. * @param [result] - An existing instance to use for the result. * @returns The modified result parameter or a new instance if none was provided. @@ -8327,7 +8588,7 @@ export class JulianDate { static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate; /** * Creates a new instance that represents the current system time. - * This is equivalent to calling JulianDate.fromDate(new Date());. + This is equivalent to calling JulianDate.fromDate(new Date());. * @param [result] - An existing instance to use for the result. * @returns The modified result parameter or a new instance if none was provided. */ @@ -8341,9 +8602,9 @@ export class JulianDate { static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate; /** * Creates a JavaScript Date from the provided instance. - * Since JavaScript dates are only accurate to the nearest millisecond and - * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead. - * If the provided JulianDate is during a leap second, the previous second is used. + Since JavaScript dates are only accurate to the nearest millisecond and + cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead. + If the provided JulianDate is during a leap second, the previous second is used. * @param julianDate - The date to be converted. * @returns A new instance representing the provided date. */ @@ -8378,9 +8639,9 @@ export class JulianDate { static equals(left?: JulianDate, right?: JulianDate): boolean; /** * Compares two instances and returns true if they are within epsilon seconds of - * each other. That is, in order for the dates to be considered equal (and for - * this function to return true), the absolute value of the difference between them, in - * seconds, must be less than epsilon. + each other. That is, in order for the dates to be considered equal (and for + this function to return true), the absolute value of the difference between them, in + seconds, must be less than epsilon. * @param [left] - The first instance. * @param [right] - The second instance. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances. @@ -8487,9 +8748,9 @@ export class JulianDate { equals(right?: JulianDate): boolean; /** * Compares this and the provided instance and returns true if they are within epsilon seconds of - * each other. That is, in order for the dates to be considered equal (and for - * this function to return true), the absolute value of the difference between them, in - * seconds, must be less than epsilon. + each other. That is, in order for the dates to be considered equal (and for + this function to return true), the absolute value of the difference between them, in + seconds, must be less than epsilon. * @param [right] - The second instance. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances. * @returns true if the two dates are within epsilon seconds of each other; otherwise false. @@ -8508,7 +8769,7 @@ export class JulianDate { /** * This enumerated type is for representing keyboard modifiers. These are keys - * that are held down in addition to other event types. +that are held down in addition to other event types. */ export enum KeyboardEventModifier { /** @@ -8539,11 +8800,11 @@ export namespace LagrangePolynomialApproximation { * Interpolates values using Lagrange Polynomial Approximation. * @param x - The independent variable for which the dependent variables will be interpolated. * @param xTable - The array of independent variables to use to interpolate. The values - * in this array must be in increasing order and the same value must not occur twice in the array. + in this array must be in increasing order and the same value must not occur twice in the array. * @param yTable - The array of dependent variables to use to interpolate. For a set of three - * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. * @param yStride - The number of dependent variable values in yTable corresponding to - * each independent variable value in xTable. + each independent variable value in xTable. * @param [result] - An existing array into which to store the result. * @returns The array of interpolated values, or the result parameter if one was provided. */ @@ -8552,7 +8813,7 @@ export namespace LagrangePolynomialApproximation { /** * Describes a single leap second, which is constructed from a {@link JulianDate} and a - * numerical offset representing the number of seconds TAI is ahead of the UTC time standard. +numerical offset representing the number of seconds TAI is ahead of the UTC time standard. * @param [date] - A Julian date representing the time of the leap second. * @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date. */ @@ -8564,7 +8825,7 @@ export class LeapSecond { julianDate: JulianDate; /** * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time - * of this leap second. + of this leap second. */ offset: number; } @@ -8575,8 +8836,8 @@ export class LeapSecond { export namespace LinearApproximation { /** * Given the desired degree, returns the number of data points required for interpolation. - * Since linear interpolation can only generate a first degree polynomial, this function - * always returns 2. + Since linear interpolation can only generate a first degree polynomial, this function + always returns 2. * @param degree - The desired degree of interpolation. * @returns This function always returns 2. */ @@ -8585,11 +8846,11 @@ export namespace LinearApproximation { * Interpolates values using linear approximation. * @param x - The independent variable for which the dependent variables will be interpolated. * @param xTable - The array of independent variables to use to interpolate. The values - * in this array must be in increasing order and the same value must not occur twice in the array. + in this array must be in increasing order and the same value must not occur twice in the array. * @param yTable - The array of dependent variables to use to interpolate. For a set of three - * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. * @param yStride - The number of dependent variable values in yTable corresponding to - * each independent variable value in xTable. + each independent variable value in xTable. * @param [result] - An existing array into which to store the result. * @returns The array of interpolated values, or the result parameter if one was provided. */ @@ -8600,21 +8861,21 @@ export namespace LinearApproximation { * A spline that uses piecewise linear interpolation to create a curve. * @example * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; - * var spline = new Cesium.LinearSpline({ - * times : times, - * points : [ - * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), - * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), - * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), - * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), - * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) - * ] - * }); - * - * var p0 = spline.evaluate(times[0]); +var spline = new Cesium.LinearSpline({ + times : times, + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ] +}); + +var p0 = spline.evaluate(times[0]); * @param options - Object with the following properties: * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. - * The values are in no way connected to the clock time. They are the parameterization for the curve. + The values are in no way connected to the clock time. They are the parameterization for the curve. * @param options.points - The array of {@link Cartesian3} control points. */ export class LinearSpline { @@ -8632,7 +8893,7 @@ export class LinearSpline { readonly points: Cartesian3[]; /** * Finds an index i in times such that the parameter - * time is in the interval [times[i], times[i + 1]]. + time is in the interval [times[i], times[i + 1]]. * @param time - The time. * @returns The index for the element at the start of the interval. */ @@ -8658,9 +8919,64 @@ export class LinearSpline { evaluate(time: number, result?: Cartesian3): Cartesian3; } +/** + * Asynchronously loads and parses the given URL to a CRN file or parses the raw binary data of a CRN file. +Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded, +or reject if the URL failed to load or failed to parse the data. The data is loaded +using XMLHttpRequest, which means that in order to make requests to another origin, +the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * // load a single URL asynchronously +Cesium.loadCRN('some/url').then(function(textureData) { + var width = textureData.width; + var height = textureData.height; + var format = textureData.internalFormat; + var arrayBufferView = textureData.bufferView; + // use the data to create a texture +}).otherwise(function(error) { + // an error occurred +}); + * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer. + * @returns A promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + */ +export function loadCRN(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise | undefined; + +/** + * Asynchronously loads and parses the given URL to a KTX file or parses the raw binary data of a KTX file. +Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded, +or reject if the URL failed to load or failed to parse the data. The data is loaded +using XMLHttpRequest, which means that in order to make requests to another origin, +the server must have Cross-Origin Resource Sharing (CORS) headers enabled. +

+The following are part of the KTX format specification but are not supported: +

    +
  • Big-endian files
  • +
  • Metadata
  • +
  • 3D textures
  • +
  • Texture Arrays
  • +
  • Cubemaps
  • +
  • Mipmaps
  • +
+

+ * @example + * // load a single URL asynchronously +Cesium.loadKTX('some/url').then(function(ktxData) { + var width = ktxData.width; + var height = ktxData.height; + var format = ktxData.internalFormat; + var arrayBufferView = ktxData.bufferView; + // use the data to create a texture +}).otherwise(function(error) { + // an error occurred +}); + * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer. + * @returns A promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. + */ +export function loadKTX(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise | undefined; + /** * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a - * flat map like Cesium's 2D and Columbus View modes. +flat map like Cesium's 2D and Columbus View modes. */ export class MapProjection { constructor(); @@ -8672,21 +8988,21 @@ export class MapProjection { * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters. * @param cartographic - The coordinates to project. * @param [result] - An instance into which to copy the result. If this parameter is - * undefined, a new instance is created and returned. + undefined, a new instance is created and returned. * @returns The projected coordinates. If the result parameter is not undefined, the - * coordinates are copied there and that instance is returned. Otherwise, a new instance is - * created and returned. + coordinates are copied there and that instance is returned. Otherwise, a new instance is + created and returned. */ project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; /** * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic} - * coordinates, in radians. + coordinates, in radians. * @param cartesian - The Cartesian position to unproject with height (z) in meters. * @param [result] - An instance into which to copy the result. If this parameter is - * undefined, a new instance is created and returned. + undefined, a new instance is created and returned. * @returns The unprojected coordinates. If the result parameter is not undefined, the - * coordinates are copied there and that instance is returned. Otherwise, a new instance is - * created and returned. + coordinates are copied there and that instance is returned. Otherwise, a new instance is + created and returned. */ unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; } @@ -8781,7 +9097,7 @@ export namespace Math { const EPSILON21 = 1e-21; /** * The gravitational parameter of the Earth in meters cubed - * per second squared as defined by the WGS84 model: 3.986004418e14 + per second squared as defined by the WGS84 model: 3.986004418e14 */ const GRAVITATIONALPARAMETER = 398600441800000; /** @@ -8790,8 +9106,8 @@ export namespace Math { const SOLAR_RADIUS = 695500000; /** * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on - * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000", - * Celestial Mechanics 82: 83-110, 2002. + Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000", + Celestial Mechanics 82: 83-110, 2002. */ const LUNAR_RADIUS = 1737400; /** @@ -8804,15 +9120,15 @@ export namespace Math { const FOUR_GIGABYTES: number; /** * Returns the sign of the value; 1 if the value is positive, -1 if the value is - * negative, or 0 if the value is 0. + negative, or 0 if the value is 0. * @param value - The value to return the sign of. * @returns The sign of value. */ function sign(value: number): number; /** * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. - * This is similar to {@link Math#sign} except that returns 1.0 instead of - * 0.0 when the input value is 0.0. + This is similar to {@link Math#sign} except that returns 1.0 instead of + 0.0 when the input value is 0.0. * @param value - The value to return the sign of. * @returns The sign of value. */ @@ -8841,40 +9157,40 @@ export namespace Math { function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number; /** * Returns the hyperbolic sine of a number. - * The hyperbolic sine of value is defined to be - * (ex - e-x)/2.0 - * where e is Euler's number, approximately 2.71828183. - * - *

Special cases: - *

    - *
  • If the argument is NaN, then the result is NaN.
  • - * - *
  • If the argument is infinite, then the result is an infinity - * with the same sign as the argument.
  • - * - *
  • If the argument is zero, then the result is a zero with the - * same sign as the argument.
  • - *
- *

+ The hyperbolic sine of value is defined to be + (ex - e-x)/2.0 + where e is Euler's number, approximately 2.71828183. + +

Special cases: +

    +
  • If the argument is NaN, then the result is NaN.
  • + +
  • If the argument is infinite, then the result is an infinity + with the same sign as the argument.
  • + +
  • If the argument is zero, then the result is a zero with the + same sign as the argument.
  • +
+

* @param value - The number whose hyperbolic sine is to be returned. * @returns The hyperbolic sine of value. */ function sinh(value: number): number; /** * Returns the hyperbolic cosine of a number. - * The hyperbolic cosine of value is defined to be - * (ex + e-x)/2.0 - * where e is Euler's number, approximately 2.71828183. - * - *

Special cases: - *

    - *
  • If the argument is NaN, then the result is NaN.
  • - * - *
  • If the argument is infinite, then the result is positive infinity.
  • - * - *
  • If the argument is zero, then the result is 1.0.
  • - *
- *

+ The hyperbolic cosine of value is defined to be + (ex + e-x)/2.0 + where e is Euler's number, approximately 2.71828183. + +

Special cases: +

    +
  • If the argument is NaN, then the result is NaN.
  • + +
  • If the argument is infinite, then the result is positive infinity.
  • + +
  • If the argument is zero, then the result is 1.0.
  • +
+

* @param value - The number whose hyperbolic cosine is to be returned. * @returns The hyperbolic cosine of value. */ @@ -8953,17 +9269,17 @@ export namespace Math { * Converts a longitude value, in radians, to the range [-Math.PI, Math.PI). * @example * // Convert 270 degrees to -90 degrees longitude - * var longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0)); + var longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0)); * @param angle - The longitude value, in radians, to convert to the range [-Math.PI, Math.PI). * @returns The equivalent longitude value in the range [-Math.PI, Math.PI). */ function convertLongitudeRange(angle: number): number; /** * Convenience function that clamps a latitude value, in radians, to the range [-Math.PI/2, Math.PI/2). - * Useful for sanitizing data before use in objects requiring correct range. + Useful for sanitizing data before use in objects requiring correct range. * @example * // Clamp 108 degrees latitude to 90 degrees latitude - * var latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0)); + var latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0)); * @param angle - The latitude value, in radians, to clamp to the range [-Math.PI/2, Math.PI/2). * @returns The latitude value clamped to the range [-Math.PI/2, Math.PI/2). */ @@ -8989,14 +9305,14 @@ export namespace Math { function mod(m: number, n: number): number; /** * Determines if two values are equal using an absolute or relative tolerance test. This is useful - * to avoid problems due to roundoff error when comparing floating-point values directly. The values are - * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed. - * Use this test if you are unsure of the magnitudes of left and right. + to avoid problems due to roundoff error when comparing floating-point values directly. The values are + first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed. + Use this test if you are unsure of the magnitudes of left and right. * @example * var a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true - * var b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false - * var c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true - * var d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false + var b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false + var c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true + var d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false * @param left - The first value to compare. * @param right - The other value to compare. * @param [relativeEpsilon = 0] - The maximum inclusive delta between left and right for the relative tolerance test. @@ -9006,51 +9322,51 @@ export namespace Math { function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; /** * Determines if the left value is less than the right value. If the two values are within - * absoluteEpsilon of each other, they are considered equal and this function returns false. + absoluteEpsilon of each other, they are considered equal and this function returns false. * @param left - The first number to compare. * @param right - The second number to compare. * @param absoluteEpsilon - The absolute epsilon to use in comparison. * @returns true if left is less than right by more than - * absoluteEpsilon. false if left is greater or if the two - * values are nearly equal. + absoluteEpsilon. false if left is greater or if the two + values are nearly equal. */ function lessThan(left: number, right: number, absoluteEpsilon: number): boolean; /** * Determines if the left value is less than or equal to the right value. If the two values are within - * absoluteEpsilon of each other, they are considered equal and this function returns true. + absoluteEpsilon of each other, they are considered equal and this function returns true. * @param left - The first number to compare. * @param right - The second number to compare. * @param absoluteEpsilon - The absolute epsilon to use in comparison. * @returns true if left is less than right or if the - * the values are nearly equal. + the values are nearly equal. */ function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean; /** * Determines if the left value is greater the right value. If the two values are within - * absoluteEpsilon of each other, they are considered equal and this function returns false. + absoluteEpsilon of each other, they are considered equal and this function returns false. * @param left - The first number to compare. * @param right - The second number to compare. * @param absoluteEpsilon - The absolute epsilon to use in comparison. * @returns true if left is greater than right by more than - * absoluteEpsilon. false if left is less or if the two - * values are nearly equal. + absoluteEpsilon. false if left is less or if the two + values are nearly equal. */ function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean; /** * Determines if the left value is greater than or equal to the right value. If the two values are within - * absoluteEpsilon of each other, they are considered equal and this function returns true. + absoluteEpsilon of each other, they are considered equal and this function returns true. * @param left - The first number to compare. * @param right - The second number to compare. * @param absoluteEpsilon - The absolute epsilon to use in comparison. * @returns true if left is greater than right or if the - * the values are nearly equal. + the values are nearly equal. */ function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean; /** * Computes the factorial of the provided number. * @example * //Compute 7!, which is equal to 5040 - * var computedFactorial = Cesium.Math.factorial(7); + var computedFactorial = Cesium.Math.factorial(7); * @param n - The number whose factorial is to be computed. * @returns The factorial of the provided number or undefined if the number is less than 0. */ @@ -9059,7 +9375,7 @@ export namespace Math { * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value. * @example * var n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6 - * var n = Cesium.Math.incrementWrap(10, 10, 0); // returns 0 + var n = Cesium.Math.incrementWrap(10, 10, 0); // returns 0 * @param [n] - The number to be incremented. * @param [maximumValue] - The maximum incremented value before rolling over to the minimum value. * @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded. @@ -9068,30 +9384,30 @@ export namespace Math { function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number; /** * Determines if a non-negative integer is a power of two. - * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript. + The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript. * @example * var t = Cesium.Math.isPowerOfTwo(16); // true - * var f = Cesium.Math.isPowerOfTwo(20); // false + var f = Cesium.Math.isPowerOfTwo(20); // false * @param n - The integer to test in the range [0, (2^32)-1]. * @returns true if the number if a power of two; otherwise, false. */ function isPowerOfTwo(n: number): boolean; /** * Computes the next power-of-two integer greater than or equal to the provided non-negative integer. - * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript. + The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript. * @example * var n = Cesium.Math.nextPowerOfTwo(29); // 32 - * var m = Cesium.Math.nextPowerOfTwo(32); // 32 + var m = Cesium.Math.nextPowerOfTwo(32); // 32 * @param n - The integer to test in the range [0, 2^31]. * @returns The next power-of-two integer. */ function nextPowerOfTwo(n: number): number; /** * Computes the previous power-of-two integer less than or equal to the provided non-negative integer. - * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript. + The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript. * @example * var n = Cesium.Math.previousPowerOfTwo(29); // 16 - * var m = Cesium.Math.previousPowerOfTwo(32); // 32 + var m = Cesium.Math.previousPowerOfTwo(32); // 32 * @param n - The integer to test in the range [0, (2^32)-1]. * @returns The previous power-of-two integer. */ @@ -9106,13 +9422,13 @@ export namespace Math { function clamp(value: number, min: number, max: number): number; /** * Sets the seed used by the random number generator - * in {@link Math#nextRandomNumber}. + in {@link Math#nextRandomNumber}. * @param seed - An integer used as the seed. */ function setRandomNumberSeed(seed: number): void; /** * Generates a random floating point number in the range of [0.0, 1.0) - * using a Mersenne twister. + using a Mersenne twister. * @returns A random number in the range of [0.0, 1.0). */ function nextRandomNumber(): number; @@ -9125,18 +9441,18 @@ export namespace Math { function randomBetween(min: number, max: number): number; /** * Computes Math.acos(value), but first clamps value to the range [-1.0, 1.0] - * so that the function will never return NaN. + so that the function will never return NaN. * @param value - The value for which to compute acos. * @returns The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0, - * whichever is closer, if the value is outside the range. + whichever is closer, if the value is outside the range. */ function acosClamped(value: number): number; /** * Computes Math.asin(value), but first clamps value to the range [-1.0, 1.0] - * so that the function will never return NaN. + so that the function will never return NaN. * @param value - The value for which to compute asin. * @returns The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0, - * whichever is closer, if the value is outside the range. + whichever is closer, if the value is outside the range. */ function asinClamped(value: number): number; /** @@ -9155,7 +9471,7 @@ export namespace Math { function logBase(number: number, base: number): number; /** * Finds the cube root of a number. - * Returns NaN if number is not provided. + Returns NaN if number is not provided. * @param [number] - The number. * @returns The result. */ @@ -9168,19 +9484,19 @@ export namespace Math { function log2(number: number): number; /** * Computes a fast approximation of Atan for input in the range [-1, 1]. - * - * Based on Michal Drobot's approximation from ShaderFastLibs, - * which in turn is based on "Efficient approximations for the arctangent function," - * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. - * Adapted from ShaderFastLibs under MIT License. + + Based on Michal Drobot's approximation from ShaderFastLibs, + which in turn is based on "Efficient approximations for the arctangent function," + Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. + Adapted from ShaderFastLibs under MIT License. * @param x - An input number in the range [-1, 1] * @returns An approximation of atan(x) */ function fastApproximateAtan(x: number): number; /** * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars. - * - * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html + + Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html * @param x - An input number that isn't zero if y is zero. * @param y - An input number that isn't zero if x is zero. * @returns An approximation of atan2(x, y) @@ -9193,7 +9509,7 @@ export interface Matrix2 extends ArrayLike { /** * A 2x2 matrix, indexable as a column-major order array. - * Constructor parameters are in row-major order for code readability. +Constructor parameters are in row-major order for code readability. * @param [column0Row0 = 0.0] - The value for column 0, row 0. * @param [column1Row0 = 0.0] - The value for column 1, row 0. * @param [column0Row1 = 0.0] - The value for column 0, row 1. @@ -9232,15 +9548,15 @@ export class Matrix2 implements ArrayLike { * Creates a Matrix2 from 4 consecutive elements in an array. * @example * // Create the Matrix2: - * // [1.0, 2.0] - * // [1.0, 2.0] - * - * var v = [1.0, 1.0, 2.0, 2.0]; - * var m = Cesium.Matrix2.fromArray(v); - * - * // Create same Matrix2 with using an offset into an array - * var v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0]; - * var m2 = Cesium.Matrix2.fromArray(v2, 2); + // [1.0, 2.0] + // [1.0, 2.0] + + var v = [1.0, 1.0, 2.0, 2.0]; + var m = Cesium.Matrix2.fromArray(v); + + // Create same Matrix2 with using an offset into an array + var v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0]; + var m2 = Cesium.Matrix2.fromArray(v2, 2); * @param array - The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix. * @param [result] - The object onto which to store the result. @@ -9256,7 +9572,7 @@ export class Matrix2 implements ArrayLike { static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2; /** * Creates a Matrix2 instance from a row-major order array. - * The resulting matrix will be in column-major order. + The resulting matrix will be in column-major order. * @param values - The row-major order array. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. @@ -9266,9 +9582,9 @@ export class Matrix2 implements ArrayLike { * Computes a Matrix2 instance representing a non-uniform scale. * @example * // Creates - * // [7.0, 0.0] - * // [0.0, 8.0] - * var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0)); + // [7.0, 0.0] + // [0.0, 8.0] + var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0)); * @param scale - The x and y scale factors. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. @@ -9278,9 +9594,9 @@ export class Matrix2 implements ArrayLike { * Computes a Matrix2 instance representing a uniform scale. * @example * // Creates - * // [2.0, 0.0] - * // [0.0, 2.0] - * var m = Cesium.Matrix2.fromUniformScale(2.0); + // [2.0, 0.0] + // [0.0, 2.0] + var m = Cesium.Matrix2.fromUniformScale(2.0); * @param scale - The uniform scale factor. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. @@ -9290,9 +9606,9 @@ export class Matrix2 implements ArrayLike { * Creates a rotation matrix. * @example * // Rotate a point 45 degrees counterclockwise. - * var p = new Cesium.Cartesian2(5, 6); - * var m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0)); - * var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2()); + var p = new Cesium.Cartesian2(5, 6); + var m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0)); + var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2()); * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. @@ -9300,7 +9616,7 @@ export class Matrix2 implements ArrayLike { static fromRotation(angle: number, result?: Matrix2): Matrix2; /** * Creates an Array from the provided Matrix2 instance. - * The array will be in column-major order. + The array will be in column-major order. * @param matrix - The matrix to use.. * @param [result] - The Array onto which to store the result. * @returns The modified Array parameter or a new Array instance if one was not provided. @@ -9310,9 +9626,9 @@ export class Matrix2 implements ArrayLike { * Computes the array index of the element at the provided row and column. * @example * var myMatrix = new Cesium.Matrix2(); - * var column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0); - * var column1Row0 = myMatrix[column1Row0Index] - * myMatrix[column1Row0Index] = 10.0; + var column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0); + var column1Row0 = myMatrix[column1Row0Index] + myMatrix[column1Row0Index] = 10.0; * @param row - The zero-based index of the row. * @param column - The zero-based index of the column. * @returns The index of the element at the provided row and column. @@ -9361,7 +9677,7 @@ export class Matrix2 implements ArrayLike { static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2; /** * Computes the maximum scale assuming the matrix is an affine transformation. - * The maximum scale is the maximum length of the column vectors. + The maximum scale is the maximum length of the column vectors. * @param matrix - The matrix. * @returns The maximum scale. */ @@ -9410,7 +9726,7 @@ export class Matrix2 implements ArrayLike { * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix. * @example * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m); - * Cesium.Matrix2.multiplyByScale(m, scale, m); + Cesium.Matrix2.multiplyByScale(m, scale, m); * @param matrix - The matrix on the left-hand side. * @param scale - The non-uniform scale on the right-hand side. * @param result - The object onto which to store the result. @@ -9440,7 +9756,7 @@ export class Matrix2 implements ArrayLike { static abs(matrix: Matrix2, result: Matrix2): Matrix2; /** * Compares the provided matrices componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first matrix. * @param [right] - The second matrix. * @returns true if left and right are equal, false otherwise. @@ -9448,8 +9764,8 @@ export class Matrix2 implements ArrayLike { static equals(left?: Matrix2, right?: Matrix2): boolean; /** * Compares the provided matrices componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [left] - The first matrix. * @param [right] - The second matrix. * @param [epsilon = 0] - The epsilon to use for equality testing. @@ -9468,28 +9784,28 @@ export class Matrix2 implements ArrayLike { * The index into Matrix2 for column 0, row 0. * @example * var matrix = new Cesium.Matrix2(); - * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0 + matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0 */ static readonly COLUMN0ROW0: number; /** * The index into Matrix2 for column 0, row 1. * @example * var matrix = new Cesium.Matrix2(); - * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0 + matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0 */ static readonly COLUMN0ROW1: number; /** * The index into Matrix2 for column 1, row 0. * @example * var matrix = new Cesium.Matrix2(); - * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0 + matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0 */ static readonly COLUMN1ROW0: number; /** * The index into Matrix2 for column 1, row 1. * @example * var matrix = new Cesium.Matrix2(); - * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0 + matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0 */ static readonly COLUMN1ROW1: number; /** @@ -9504,15 +9820,15 @@ export class Matrix2 implements ArrayLike { clone(result?: Matrix2): Matrix2; /** * Compares this matrix to the provided matrix componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side matrix. * @returns true if they are equal, false otherwise. */ equals(right?: Matrix2): boolean; /** * Compares this matrix to the provided matrix componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [right] - The right hand side matrix. * @param [epsilon = 0] - The epsilon to use for equality testing. * @returns true if they are within the provided epsilon, false otherwise. @@ -9520,7 +9836,7 @@ export class Matrix2 implements ArrayLike { equalsEpsilon(right?: Matrix2, epsilon?: number): boolean; /** * Creates a string representing this Matrix with each row being - * on a separate line and in the format '(column0, column1)'. + on a separate line and in the format '(column0, column1)'. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'. */ toString(): string; @@ -9531,7 +9847,7 @@ export interface Matrix3 extends ArrayLike { /** * A 3x3 matrix, indexable as a column-major order array. - * Constructor parameters are in row-major order for code readability. +Constructor parameters are in row-major order for code readability. * @param [column0Row0 = 0.0] - The value for column 0, row 0. * @param [column1Row0 = 0.0] - The value for column 1, row 0. * @param [column2Row0 = 0.0] - The value for column 2, row 0. @@ -9575,16 +9891,16 @@ export class Matrix3 implements ArrayLike { * Creates a Matrix3 from 9 consecutive elements in an array. * @example * // Create the Matrix3: - * // [1.0, 2.0, 3.0] - * // [1.0, 2.0, 3.0] - * // [1.0, 2.0, 3.0] - * - * var v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0]; - * var m = Cesium.Matrix3.fromArray(v); - * - * // Create same Matrix3 with using an offset into an array - * var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0]; - * var m2 = Cesium.Matrix3.fromArray(v2, 2); + // [1.0, 2.0, 3.0] + // [1.0, 2.0, 3.0] + // [1.0, 2.0, 3.0] + + var v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0]; + var m = Cesium.Matrix3.fromArray(v); + + // Create same Matrix3 with using an offset into an array + var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0]; + var m2 = Cesium.Matrix3.fromArray(v2, 2); * @param array - The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix. * @param [result] - The object onto which to store the result. @@ -9600,7 +9916,7 @@ export class Matrix3 implements ArrayLike { static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3; /** * Creates a Matrix3 instance from a row-major order array. - * The resulting matrix will be in column-major order. + The resulting matrix will be in column-major order. * @param values - The row-major order array. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. @@ -9624,10 +9940,10 @@ export class Matrix3 implements ArrayLike { * Computes a Matrix3 instance representing a non-uniform scale. * @example * // Creates - * // [7.0, 0.0, 0.0] - * // [0.0, 8.0, 0.0] - * // [0.0, 0.0, 9.0] - * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); + // [7.0, 0.0, 0.0] + // [0.0, 8.0, 0.0] + // [0.0, 0.0, 9.0] + var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); * @param scale - The x, y, and z scale factors. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. @@ -9637,10 +9953,10 @@ export class Matrix3 implements ArrayLike { * Computes a Matrix3 instance representing a uniform scale. * @example * // Creates - * // [2.0, 0.0, 0.0] - * // [0.0, 2.0, 0.0] - * // [0.0, 0.0, 2.0] - * var m = Cesium.Matrix3.fromUniformScale(2.0); + // [2.0, 0.0, 0.0] + // [0.0, 2.0, 0.0] + // [0.0, 0.0, 2.0] + var m = Cesium.Matrix3.fromUniformScale(2.0); * @param scale - The uniform scale factor. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. @@ -9650,10 +9966,10 @@ export class Matrix3 implements ArrayLike { * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * @example * // Creates - * // [0.0, -9.0, 8.0] - * // [9.0, 0.0, -7.0] - * // [-8.0, 7.0, 0.0] - * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); + // [0.0, -9.0, 8.0] + // [9.0, 0.0, -7.0] + // [-8.0, 7.0, 0.0] + var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); * @param vector - the vector on the left hand side of the cross product operation. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. @@ -9663,9 +9979,9 @@ export class Matrix3 implements ArrayLike { * Creates a rotation matrix around the x-axis. * @example * // Rotate a point 45 degrees counterclockwise around the x-axis. - * var p = new Cesium.Cartesian3(5, 6, 7); - * var m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0)); - * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); + var p = new Cesium.Cartesian3(5, 6, 7); + var m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0)); + var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. @@ -9675,9 +9991,9 @@ export class Matrix3 implements ArrayLike { * Creates a rotation matrix around the y-axis. * @example * // Rotate a point 45 degrees counterclockwise around the y-axis. - * var p = new Cesium.Cartesian3(5, 6, 7); - * var m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0)); - * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); + var p = new Cesium.Cartesian3(5, 6, 7); + var m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0)); + var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. @@ -9687,9 +10003,9 @@ export class Matrix3 implements ArrayLike { * Creates a rotation matrix around the z-axis. * @example * // Rotate a point 45 degrees counterclockwise around the z-axis. - * var p = new Cesium.Cartesian3(5, 6, 7); - * var m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0)); - * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); + var p = new Cesium.Cartesian3(5, 6, 7); + var m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0)); + var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. @@ -9697,7 +10013,7 @@ export class Matrix3 implements ArrayLike { static fromRotationZ(angle: number, result?: Matrix3): Matrix3; /** * Creates an Array from the provided Matrix3 instance. - * The array will be in column-major order. + The array will be in column-major order. * @param matrix - The matrix to use.. * @param [result] - The Array onto which to store the result. * @returns The modified Array parameter or a new Array instance if one was not provided. @@ -9707,9 +10023,9 @@ export class Matrix3 implements ArrayLike { * Computes the array index of the element at the provided row and column. * @example * var myMatrix = new Cesium.Matrix3(); - * var column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0); - * var column1Row0 = myMatrix[column1Row0Index] - * myMatrix[column1Row0Index] = 10.0; + var column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0); + var column1Row0 = myMatrix[column1Row0Index] + myMatrix[column1Row0Index] = 10.0; * @param row - The zero-based index of the row. * @param column - The zero-based index of the column. * @returns The index of the element at the provided row and column. @@ -9758,7 +10074,7 @@ export class Matrix3 implements ArrayLike { static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3; /** * Computes the maximum scale assuming the matrix is an affine transformation. - * The maximum scale is the maximum length of the column vectors. + The maximum scale is the maximum length of the column vectors. * @param matrix - The matrix. * @returns The maximum scale. */ @@ -9807,7 +10123,7 @@ export class Matrix3 implements ArrayLike { * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix. * @example * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m); - * Cesium.Matrix3.multiplyByScale(m, scale, m); + Cesium.Matrix3.multiplyByScale(m, scale, m); * @param matrix - The matrix on the left-hand side. * @param scale - The non-uniform scale on the right-hand side. * @param result - The object onto which to store the result. @@ -9837,29 +10153,29 @@ export class Matrix3 implements ArrayLike { static getRotation(matrix: Matrix3, result: Matrix3): Matrix3; /** * Computes the eigenvectors and eigenvalues of a symmetric matrix. - *

- * Returns a diagonal matrix and unitary matrix such that: - * matrix = unitary matrix * diagonal matrix * transpose(unitary matrix) - *

- *

- * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns - * of the unitary matrix are the corresponding eigenvectors. - *

+

+ Returns a diagonal matrix and unitary matrix such that: + matrix = unitary matrix * diagonal matrix * transpose(unitary matrix) +

+

+ The values along the diagonal of the diagonal matrix are the eigenvalues. The columns + of the unitary matrix are the corresponding eigenvectors. +

* @example * var a = //... symetric matrix - * var result = { - * unitary : new Cesium.Matrix3(), - * diagonal : new Cesium.Matrix3() - * }; - * Cesium.Matrix3.computeEigenDecomposition(a, result); - * - * var unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3()); - * var b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3()); - * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a - * - * var lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue - * var v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector - * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) + var result = { + unitary : new Cesium.Matrix3(), + diagonal : new Cesium.Matrix3() + }; + Cesium.Matrix3.computeEigenDecomposition(a, result); + + var unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3()); + var b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3()); + Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a + + var lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue + var v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector + var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) * @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric. * @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result. * @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively. @@ -9894,7 +10210,7 @@ export class Matrix3 implements ArrayLike { static inverseTranspose(matrix: Matrix3, result: Matrix3): Matrix3; /** * Compares the provided matrices componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first matrix. * @param [right] - The second matrix. * @returns true if left and right are equal, false otherwise. @@ -9902,8 +10218,8 @@ export class Matrix3 implements ArrayLike { static equals(left?: Matrix3, right?: Matrix3): boolean; /** * Compares the provided matrices componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [left] - The first matrix. * @param [right] - The second matrix. * @param [epsilon = 0] - The epsilon to use for equality testing. @@ -9966,15 +10282,15 @@ export class Matrix3 implements ArrayLike { clone(result?: Matrix3): Matrix3; /** * Compares this matrix to the provided matrix componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side matrix. * @returns true if they are equal, false otherwise. */ equals(right?: Matrix3): boolean; /** * Compares this matrix to the provided matrix componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [right] - The right hand side matrix. * @param [epsilon = 0] - The epsilon to use for equality testing. * @returns true if they are within the provided epsilon, false otherwise. @@ -9982,7 +10298,7 @@ export class Matrix3 implements ArrayLike { equalsEpsilon(right?: Matrix3, epsilon?: number): boolean; /** * Creates a string representing this Matrix with each row being - * on a separate line and in the format '(column0, column1, column2)'. + on a separate line and in the format '(column0, column1, column2)'. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'. */ toString(): string; @@ -9993,7 +10309,7 @@ export interface Matrix4 extends ArrayLike { /** * A 4x4 matrix, indexable as a column-major order array. - * Constructor parameters are in row-major order for code readability. +Constructor parameters are in row-major order for code readability. * @param [column0Row0 = 0.0] - The value for column 0, row 0. * @param [column1Row0 = 0.0] - The value for column 1, row 0. * @param [column2Row0 = 0.0] - The value for column 2, row 0. @@ -10044,17 +10360,17 @@ export class Matrix4 implements ArrayLike { * Creates a Matrix4 from 16 consecutive elements in an array. * @example * // Create the Matrix4: - * // [1.0, 2.0, 3.0, 4.0] - * // [1.0, 2.0, 3.0, 4.0] - * // [1.0, 2.0, 3.0, 4.0] - * // [1.0, 2.0, 3.0, 4.0] - * - * var v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0]; - * var m = Cesium.Matrix4.fromArray(v); - * - * // Create same Matrix4 with using an offset into an array - * var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0]; - * var m2 = Cesium.Matrix4.fromArray(v2, 2); + // [1.0, 2.0, 3.0, 4.0] + // [1.0, 2.0, 3.0, 4.0] + // [1.0, 2.0, 3.0, 4.0] + // [1.0, 2.0, 3.0, 4.0] + + var v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0]; + var m = Cesium.Matrix4.fromArray(v); + + // Create same Matrix4 with using an offset into an array + var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0]; + var m2 = Cesium.Matrix4.fromArray(v2, 2); * @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix. * @param [result] - The object onto which to store the result. @@ -10070,7 +10386,7 @@ export class Matrix4 implements ArrayLike { static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4; /** * Computes a Matrix4 instance from a row-major order array. - * The resulting matrix will be in column-major order. + The resulting matrix will be in column-major order. * @param values - The row-major order array. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. @@ -10078,7 +10394,7 @@ export class Matrix4 implements ArrayLike { static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4; /** * Computes a Matrix4 instance from a Matrix3 representing the rotation - * and a Cartesian3 representing the translation. + and a Cartesian3 representing the translation. * @param rotation - The upper left portion of the matrix representing the rotation. * @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. @@ -10087,13 +10403,13 @@ export class Matrix4 implements ArrayLike { static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4; /** * Computes a Matrix4 instance from a translation, rotation, and scale (TRS) - * representation with the rotation represented as a quaternion. + representation with the rotation represented as a quaternion. * @example * var result = Cesium.Matrix4.fromTranslationQuaternionRotationScale( - * new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation - * Cesium.Quaternion.IDENTITY, // rotation - * new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale - * result); + new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation + Cesium.Quaternion.IDENTITY, // rotation + new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale + result); * @param translation - The translation transformation. * @param rotation - The rotation transformation. * @param scale - The non-uniform scale transformation. @@ -10119,11 +10435,11 @@ export class Matrix4 implements ArrayLike { * Computes a Matrix4 instance representing a non-uniform scale. * @example * // Creates - * // [7.0, 0.0, 0.0, 0.0] - * // [0.0, 8.0, 0.0, 0.0] - * // [0.0, 0.0, 9.0, 0.0] - * // [0.0, 0.0, 0.0, 1.0] - * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); + // [7.0, 0.0, 0.0, 0.0] + // [0.0, 8.0, 0.0, 0.0] + // [0.0, 0.0, 9.0, 0.0] + // [0.0, 0.0, 0.0, 1.0] + var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); * @param scale - The x, y, and z scale factors. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. @@ -10133,11 +10449,11 @@ export class Matrix4 implements ArrayLike { * Computes a Matrix4 instance representing a uniform scale. * @example * // Creates - * // [2.0, 0.0, 0.0, 0.0] - * // [0.0, 2.0, 0.0, 0.0] - * // [0.0, 0.0, 2.0, 0.0] - * // [0.0, 0.0, 0.0, 1.0] - * var m = Cesium.Matrix4.fromUniformScale(2.0); + // [2.0, 0.0, 0.0, 0.0] + // [0.0, 2.0, 0.0, 0.0] + // [0.0, 0.0, 2.0, 0.0] + // [0.0, 0.0, 0.0, 1.0] + var m = Cesium.Matrix4.fromUniformScale(2.0); * @param scale - The uniform scale factor. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. @@ -10199,12 +10515,12 @@ export class Matrix4 implements ArrayLike { * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates. * @example * // Create viewport transformation using an explicit viewport and depth range. - * var m = Cesium.Matrix4.computeViewportTransformation({ - * x : 0.0, - * y : 0.0, - * width : 1024.0, - * height : 768.0 - * }, 0.0, 1.0, new Cesium.Matrix4()); + var m = Cesium.Matrix4.computeViewportTransformation({ + x : 0.0, + y : 0.0, + width : 1024.0, + height : 768.0 + }, 0.0, 1.0, new Cesium.Matrix4()); * @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1. * @param [nearDepthRange = 0.0] - The near plane distance in window coordinates. * @param [farDepthRange = 1.0] - The far plane distance in window coordinates. @@ -10224,17 +10540,17 @@ export class Matrix4 implements ArrayLike { static computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4; /** * Computes an Array from the provided Matrix4 instance. - * The array will be in column-major order. + The array will be in column-major order. * @example * //create an array from an instance of Matrix4 - * // m = [10.0, 14.0, 18.0, 22.0] - * // [11.0, 15.0, 19.0, 23.0] - * // [12.0, 16.0, 20.0, 24.0] - * // [13.0, 17.0, 21.0, 25.0] - * var a = Cesium.Matrix4.toArray(m); - * - * // m remains the same - * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] + // m = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + var a = Cesium.Matrix4.toArray(m); + + // m remains the same + //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] * @param matrix - The matrix to use.. * @param [result] - The Array onto which to store the result. * @returns The modified Array parameter or a new Array instance if one was not provided. @@ -10244,9 +10560,9 @@ export class Matrix4 implements ArrayLike { * Computes the array index of the element at the provided row and column. * @example * var myMatrix = new Cesium.Matrix4(); - * var column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0); - * var column1Row0 = myMatrix[column1Row0Index]; - * myMatrix[column1Row0Index] = 10.0; + var column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0); + var column1Row0 = myMatrix[column1Row0Index]; + myMatrix[column1Row0Index] = 10.0; * @param row - The zero-based index of the row. * @param column - The zero-based index of the column. * @returns The index of the element at the provided row and column. @@ -10256,19 +10572,19 @@ export class Matrix4 implements ArrayLike { * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance. * @example * //returns a Cartesian4 instance with values from the specified column - * // m = [10.0, 11.0, 12.0, 13.0] - * // [14.0, 15.0, 16.0, 17.0] - * // [18.0, 19.0, 20.0, 21.0] - * // [22.0, 23.0, 24.0, 25.0] - * - * //Example 1: Creates an instance of Cartesian - * var a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4()); + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + //Example 1: Creates an instance of Cartesian + var a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4()); * @example * //Example 2: Sets values for Cartesian instance - * var a = new Cesium.Cartesian4(); - * Cesium.Matrix4.getColumn(m, 2, a); - * - * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; + var a = new Cesium.Cartesian4(); + Cesium.Matrix4.getColumn(m, 2, a); + + // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; * @param matrix - The matrix to use. * @param index - The zero-based index of the column to retrieve. * @param result - The object onto which to store the result. @@ -10279,18 +10595,18 @@ export class Matrix4 implements ArrayLike { * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance. * @example * //creates a new Matrix4 instance with new column values from the Cartesian4 instance - * // m = [10.0, 11.0, 12.0, 13.0] - * // [14.0, 15.0, 16.0, 17.0] - * // [18.0, 19.0, 20.0, 21.0] - * // [22.0, 23.0, 24.0, 25.0] - * - * var a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4()); - * - * // m remains the same - * // a = [10.0, 11.0, 99.0, 13.0] - * // [14.0, 15.0, 98.0, 17.0] - * // [18.0, 19.0, 97.0, 21.0] - * // [22.0, 23.0, 96.0, 25.0] + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4()); + + // m remains the same + // a = [10.0, 11.0, 99.0, 13.0] + // [14.0, 15.0, 98.0, 17.0] + // [18.0, 19.0, 97.0, 21.0] + // [22.0, 23.0, 96.0, 25.0] * @param matrix - The matrix to use. * @param index - The zero-based index of the column to set. * @param cartesian - The Cartesian whose values will be assigned to the specified column. @@ -10300,7 +10616,7 @@ export class Matrix4 implements ArrayLike { static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4; /** * Computes a new matrix that replaces the translation in the rightmost column of the provided - * matrix with the provided translation. This assumes the matrix is an affine transformation + matrix with the provided translation. This assumes the matrix is an affine transformation * @param matrix - The matrix to use. * @param translation - The translation that replaces the translation of the provided matrix. * @param result - The object onto which to store the result. @@ -10319,19 +10635,19 @@ export class Matrix4 implements ArrayLike { * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance. * @example * //returns a Cartesian4 instance with values from the specified column - * // m = [10.0, 11.0, 12.0, 13.0] - * // [14.0, 15.0, 16.0, 17.0] - * // [18.0, 19.0, 20.0, 21.0] - * // [22.0, 23.0, 24.0, 25.0] - * - * //Example 1: Returns an instance of Cartesian - * var a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4()); + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + //Example 1: Returns an instance of Cartesian + var a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4()); * @example * //Example 2: Sets values for a Cartesian instance - * var a = new Cesium.Cartesian4(); - * Cesium.Matrix4.getRow(m, 2, a); - * - * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; + var a = new Cesium.Cartesian4(); + Cesium.Matrix4.getRow(m, 2, a); + + // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; * @param matrix - The matrix to use. * @param index - The zero-based index of the row to retrieve. * @param result - The object onto which to store the result. @@ -10342,18 +10658,18 @@ export class Matrix4 implements ArrayLike { * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance. * @example * //create a new Matrix4 instance with new row values from the Cartesian4 instance - * // m = [10.0, 11.0, 12.0, 13.0] - * // [14.0, 15.0, 16.0, 17.0] - * // [18.0, 19.0, 20.0, 21.0] - * // [22.0, 23.0, 24.0, 25.0] - * - * var a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4()); - * - * // m remains the same - * // a = [10.0, 11.0, 12.0, 13.0] - * // [14.0, 15.0, 16.0, 17.0] - * // [99.0, 98.0, 97.0, 96.0] - * // [22.0, 23.0, 24.0, 25.0] + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4()); + + // m remains the same + // a = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [99.0, 98.0, 97.0, 96.0] + // [22.0, 23.0, 24.0, 25.0] * @param matrix - The matrix to use. * @param index - The zero-based index of the row to set. * @param cartesian - The Cartesian whose values will be assigned to the specified row. @@ -10370,8 +10686,8 @@ export class Matrix4 implements ArrayLike { static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3; /** * Computes the maximum scale assuming the matrix is an affine transformation. - * The maximum scale is the maximum length of the column vectors in the upper-left - * 3x3 matrix. + The maximum scale is the maximum length of the column vectors in the upper-left + 3x3 matrix. * @param matrix - The matrix. * @returns The maximum scale. */ @@ -10402,16 +10718,16 @@ export class Matrix4 implements ArrayLike { static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; /** * Computes the product of two matrices assuming the matrices are - * affine transformation matrices, where the upper left 3x3 elements - * are a rotation matrix, and the upper three elements in the fourth - * column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. - * The matrix is not verified to be in the proper form. - * This method is faster than computing the product for general 4x4 - * matrices using {@link Matrix4.multiply}. + affine transformation matrices, where the upper left 3x3 elements + are a rotation matrix, and the upper three elements in the fourth + column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. + The matrix is not verified to be in the proper form. + This method is faster than computing the product for general 4x4 + matrices using {@link Matrix4.multiply}. * @example * var m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0); - * var m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0)); - * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); + var m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0)); + var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); * @param left - The first matrix. * @param right - The second matrix. * @param result - The object onto which to store the result. @@ -10420,11 +10736,11 @@ export class Matrix4 implements ArrayLike { static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; /** * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]) - * by a 3x3 rotation matrix. This is an optimization - * for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m); with less allocations and arithmetic operations. + by a 3x3 rotation matrix. This is an optimization + for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m); with less allocations and arithmetic operations. * @example * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m); - * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); + Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); * @param matrix - The matrix on the left-hand side. * @param rotation - The 3x3 rotation matrix on the right-hand side. * @param result - The object onto which to store the result. @@ -10433,11 +10749,11 @@ export class Matrix4 implements ArrayLike { static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4; /** * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]) - * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization - * for Matrix4.multiply(m, Matrix4.fromTranslation(position), m); with less allocations and arithmetic operations. + by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization + for Matrix4.multiply(m, Matrix4.fromTranslation(position), m); with less allocations and arithmetic operations. * @example * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m); - * Cesium.Matrix4.multiplyByTranslation(m, position, m); + Cesium.Matrix4.multiplyByTranslation(m, position, m); * @param matrix - The matrix on the left-hand side. * @param translation - The translation on the right-hand side. * @param result - The object onto which to store the result. @@ -10446,13 +10762,13 @@ export class Matrix4 implements ArrayLike { static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4; /** * Multiplies an affine transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]) - * by an implicit uniform scale matrix. This is an optimization - * for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);, where - * m must be an affine matrix. - * This function performs fewer allocations and arithmetic operations. + by an implicit uniform scale matrix. This is an optimization + for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);, where + m must be an affine matrix. + This function performs fewer allocations and arithmetic operations. * @example * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m); - * Cesium.Matrix4.multiplyByUniformScale(m, scale, m); + Cesium.Matrix4.multiplyByUniformScale(m, scale, m); * @param matrix - The affine matrix on the left-hand side. * @param scale - The uniform scale on the right-hand side. * @param result - The object onto which to store the result. @@ -10461,13 +10777,13 @@ export class Matrix4 implements ArrayLike { static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4; /** * Multiplies an affine transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]) - * by an implicit non-uniform scale matrix. This is an optimization - * for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);, where - * m must be an affine matrix. - * This function performs fewer allocations and arithmetic operations. + by an implicit non-uniform scale matrix. This is an optimization + for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);, where + m must be an affine matrix. + This function performs fewer allocations and arithmetic operations. * @example * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m); - * Cesium.Matrix4.multiplyByScale(m, scale, m); + Cesium.Matrix4.multiplyByScale(m, scale, m); * @param matrix - The affine matrix on the left-hand side. * @param scale - The non-uniform scale on the right-hand side. * @param result - The object onto which to store the result. @@ -10484,13 +10800,13 @@ export class Matrix4 implements ArrayLike { static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4; /** * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector} - * with a {@link Cartesian4} with a w component of zero. + with a {@link Cartesian4} with a w component of zero. * @example * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0); - * var result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3()); - * // A shortcut for - * // Cartesian3 p = ... - * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); + var result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3()); + // A shortcut for + // Cartesian3 p = ... + // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); * @param matrix - The matrix. * @param cartesian - The point. * @param result - The object onto which to store the result. @@ -10499,10 +10815,10 @@ export class Matrix4 implements ArrayLike { static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3; /** * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector} - * with a {@link Cartesian4} with a w component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}. + with a {@link Cartesian4} with a w component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}. * @example * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0); - * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); + var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); * @param matrix - The matrix. * @param cartesian - The point. * @param result - The object onto which to store the result. @@ -10513,18 +10829,18 @@ export class Matrix4 implements ArrayLike { * Computes the product of a matrix and a scalar. * @example * //create a Matrix4 instance which is a scaled version of the supplied Matrix4 - * // m = [10.0, 11.0, 12.0, 13.0] - * // [14.0, 15.0, 16.0, 17.0] - * // [18.0, 19.0, 20.0, 21.0] - * // [22.0, 23.0, 24.0, 25.0] - * - * var a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4()); - * - * // m remains the same - * // a = [-20.0, -22.0, -24.0, -26.0] - * // [-28.0, -30.0, -32.0, -34.0] - * // [-36.0, -38.0, -40.0, -42.0] - * // [-44.0, -46.0, -48.0, -50.0] + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4()); + + // m remains the same + // a = [-20.0, -22.0, -24.0, -26.0] + // [-28.0, -30.0, -32.0, -34.0] + // [-36.0, -38.0, -40.0, -42.0] + // [-44.0, -46.0, -48.0, -50.0] * @param matrix - The matrix. * @param scalar - The number to multiply by. * @param result - The object onto which to store the result. @@ -10535,18 +10851,18 @@ export class Matrix4 implements ArrayLike { * Computes a negated copy of the provided matrix. * @example * //create a new Matrix4 instance which is a negation of a Matrix4 - * // m = [10.0, 11.0, 12.0, 13.0] - * // [14.0, 15.0, 16.0, 17.0] - * // [18.0, 19.0, 20.0, 21.0] - * // [22.0, 23.0, 24.0, 25.0] - * - * var a = Cesium.Matrix4.negate(m, new Cesium.Matrix4()); - * - * // m remains the same - * // a = [-10.0, -11.0, -12.0, -13.0] - * // [-14.0, -15.0, -16.0, -17.0] - * // [-18.0, -19.0, -20.0, -21.0] - * // [-22.0, -23.0, -24.0, -25.0] + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.negate(m, new Cesium.Matrix4()); + + // m remains the same + // a = [-10.0, -11.0, -12.0, -13.0] + // [-14.0, -15.0, -16.0, -17.0] + // [-18.0, -19.0, -20.0, -21.0] + // [-22.0, -23.0, -24.0, -25.0] * @param matrix - The matrix to negate. * @param result - The object onto which to store the result. * @returns The modified result parameter. @@ -10556,18 +10872,18 @@ export class Matrix4 implements ArrayLike { * Computes the transpose of the provided matrix. * @example * //returns transpose of a Matrix4 - * // m = [10.0, 11.0, 12.0, 13.0] - * // [14.0, 15.0, 16.0, 17.0] - * // [18.0, 19.0, 20.0, 21.0] - * // [22.0, 23.0, 24.0, 25.0] - * - * var a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4()); - * - * // m remains the same - * // a = [10.0, 14.0, 18.0, 22.0] - * // [11.0, 15.0, 19.0, 23.0] - * // [12.0, 16.0, 20.0, 24.0] - * // [13.0, 17.0, 21.0, 25.0] + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4()); + + // m remains the same + // a = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] * @param matrix - The matrix to transpose. * @param result - The object onto which to store the result. * @returns The modified result parameter. @@ -10582,27 +10898,27 @@ export class Matrix4 implements ArrayLike { static abs(matrix: Matrix4, result: Matrix4): Matrix4; /** * Compares the provided matrices componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @example * //compares two Matrix4 instances - * - * // a = [10.0, 14.0, 18.0, 22.0] - * // [11.0, 15.0, 19.0, 23.0] - * // [12.0, 16.0, 20.0, 24.0] - * // [13.0, 17.0, 21.0, 25.0] - * - * // b = [10.0, 14.0, 18.0, 22.0] - * // [11.0, 15.0, 19.0, 23.0] - * // [12.0, 16.0, 20.0, 24.0] - * // [13.0, 17.0, 21.0, 25.0] - * - * if(Cesium.Matrix4.equals(a,b)) { - * console.log("Both matrices are equal"); - * } else { - * console.log("They are not equal"); - * } - * - * //Prints "Both matrices are equal" on the console + + // a = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + + // b = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + + if(Cesium.Matrix4.equals(a,b)) { + console.log("Both matrices are equal"); + } else { + console.log("They are not equal"); + } + + //Prints "Both matrices are equal" on the console * @param [left] - The first matrix. * @param [right] - The second matrix. * @returns true if left and right are equal, false otherwise. @@ -10610,28 +10926,28 @@ export class Matrix4 implements ArrayLike { static equals(left?: Matrix4, right?: Matrix4): boolean; /** * Compares the provided matrices componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @example * //compares two Matrix4 instances - * - * // a = [10.5, 14.5, 18.5, 22.5] - * // [11.5, 15.5, 19.5, 23.5] - * // [12.5, 16.5, 20.5, 24.5] - * // [13.5, 17.5, 21.5, 25.5] - * - * // b = [10.0, 14.0, 18.0, 22.0] - * // [11.0, 15.0, 19.0, 23.0] - * // [12.0, 16.0, 20.0, 24.0] - * // [13.0, 17.0, 21.0, 25.0] - * - * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){ - * console.log("Difference between both the matrices is less than 0.1"); - * } else { - * console.log("Difference between both the matrices is not less than 0.1"); - * } - * - * //Prints "Difference between both the matrices is not less than 0.1" on the console + + // a = [10.5, 14.5, 18.5, 22.5] + // [11.5, 15.5, 19.5, 23.5] + // [12.5, 16.5, 20.5, 24.5] + // [13.5, 17.5, 21.5, 25.5] + + // b = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + + if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){ + console.log("Difference between both the matrices is less than 0.1"); + } else { + console.log("Difference between both the matrices is not less than 0.1"); + } + + //Prints "Difference between both the matrices is not less than 0.1" on the console * @param [left] - The first matrix. * @param [right] - The second matrix. * @param [epsilon = 0] - The epsilon to use for equality testing. @@ -10649,18 +10965,18 @@ export class Matrix4 implements ArrayLike { * Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is an affine transformation matrix. * @example * // returns a Matrix3 instance from a Matrix4 instance - * - * // m = [10.0, 14.0, 18.0, 22.0] - * // [11.0, 15.0, 19.0, 23.0] - * // [12.0, 16.0, 20.0, 24.0] - * // [13.0, 17.0, 21.0, 25.0] - * - * var b = new Cesium.Matrix3(); - * Cesium.Matrix4.getMatrix3(m,b); - * - * // b = [10.0, 14.0, 18.0] - * // [11.0, 15.0, 19.0] - * // [12.0, 16.0, 20.0] + + // m = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + + var b = new Cesium.Matrix3(); + Cesium.Matrix4.getMatrix3(m,b); + + // b = [10.0, 14.0, 18.0] + // [11.0, 15.0, 19.0] + // [12.0, 16.0, 20.0] * @param matrix - The matrix to use. * @param result - The object onto which to store the result. * @returns The modified result parameter. @@ -10668,9 +10984,9 @@ export class Matrix4 implements ArrayLike { static getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3; /** * Computes the inverse of the provided matrix using Cramers Rule. - * If the determinant is zero, the matrix can not be inverted, and an exception is thrown. - * If the matrix is an affine transformation matrix, it is more efficient - * to invert it with {@link Matrix4.inverseTransformation}. + If the determinant is zero, the matrix can not be inverted, and an exception is thrown. + If the matrix is an affine transformation matrix, it is more efficient + to invert it with {@link Matrix4.inverseTransformation}. * @param matrix - The matrix to invert. * @param result - The object onto which to store the result. * @returns The modified result parameter. @@ -10678,12 +10994,12 @@ export class Matrix4 implements ArrayLike { static inverse(matrix: Matrix4, result: Matrix4): Matrix4; /** * Computes the inverse of the provided matrix assuming it is - * an affine transformation matrix, where the upper left 3x3 elements - * are a rotation matrix, and the upper three elements in the fourth - * column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. - * The matrix is not verified to be in the proper form. - * This method is faster than computing the inverse for a general 4x4 - * matrix using {@link Matrix4.inverse}. + an affine transformation matrix, where the upper left 3x3 elements + are a rotation matrix, and the upper three elements in the fourth + column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. + The matrix is not verified to be in the proper form. + This method is faster than computing the inverse for a general 4x4 + matrix using {@link Matrix4.inverse}. * @param matrix - The matrix to invert. * @param result - The object onto which to store the result. * @returns The modified result parameter. @@ -10780,15 +11096,15 @@ export class Matrix4 implements ArrayLike { clone(result?: Matrix4): Matrix4; /** * Compares this matrix to the provided matrix componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side matrix. * @returns true if they are equal, false otherwise. */ equals(right?: Matrix4): boolean; /** * Compares this matrix to the provided matrix componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [right] - The right hand side matrix. * @param [epsilon = 0] - The epsilon to use for equality testing. * @returns true if they are within the provided epsilon, false otherwise. @@ -10796,12 +11112,39 @@ export class Matrix4 implements ArrayLike { equalsEpsilon(right?: Matrix4, epsilon?: number): boolean; /** * Computes a string representing this Matrix with each row being - * on a separate line and in the format '(column0, column1, column2, column3)'. + on a separate line and in the format '(column0, column1, column2, column3)'. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'. */ toString(): string; } +/** + * A stable merge sort. + * @example + * // Assume array contains BoundingSpheres in world coordinates. +// Sort them in ascending order of distance from the camera. +var position = camera.positionWC; +Cesium.mergeSort(array, function(a, b, position) { + return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position); +}, position); + * @param array - The array to sort. + * @param comparator - The function to use to compare elements in the array. + * @param [userDefinedObject] - Any item to pass as the third parameter to comparator. + */ +export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void; + +/** + * A function used to compare two items while performing a merge sort. + * @example + * function compareNumbers(a, b, userDefinedObject) { + return a - b; +} + * @param a - An item in the array. + * @param b - An item in the array. + * @param [userDefinedObject] - An object that was passed to {@link mergeSort}. + */ +export type mergeSortComparator = (a: any, b: any, userDefinedObject?: any) => number; + /** * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space. * @param [near = 0.0] - The lower bound of the camera range. @@ -10856,7 +11199,7 @@ export class NearFarScalar { static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar; /** * Compares the provided NearFarScalar and returns true if they are equal, - * false otherwise. + false otherwise. * @param [left] - The first NearFarScalar. * @param [right] - The second NearFarScalar. * @returns true if left and right are equal; otherwise false. @@ -10870,22 +11213,37 @@ export class NearFarScalar { clone(result?: NearFarScalar): NearFarScalar; /** * Compares this instance to the provided NearFarScalar and returns true if they are equal, - * false otherwise. + false otherwise. * @param [right] - The right hand side NearFarScalar. * @returns true if left and right are equal; otherwise false. */ equals(right?: NearFarScalar): boolean; } +/** + * Converts an object representing a set of name/value pairs into a query string, +with names and values encoded properly for use in a URL. Values that are arrays +will produce multiple values with the same name. + * @example + * var str = Cesium.objectToQuery({ + key1 : 'some value', + key2 : 'a/b', + key3 : ['x', 'y'] +}); + * @param obj - The object containing data to encode. + * @returns An encoded query string. + */ +export function objectToQuery(obj: any): string; + /** * Creates an Occluder derived from an object's position and radius, as well as the camera position. - * The occluder can be used to determine whether or not other objects are visible or hidden behind the - * visible horizon defined by the occluder and camera position. +The occluder can be used to determine whether or not other objects are visible or hidden behind the +visible horizon defined by the occluder and camera position. * @example * // Construct an occluder one unit away from the origin with a radius of one. - * var cameraPosition = Cesium.Cartesian3.ZERO; - * var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1); - * var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition); +var cameraPosition = Cesium.Cartesian3.ZERO; +var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1); +var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition); * @param occluderBoundingSphere - The bounding sphere surrounding the occluder. * @param cameraPosition - The coordinate of the viewer/camera. */ @@ -10915,10 +11273,10 @@ export class Occluder { * Determines whether or not a point, the occludee, is hidden from view by the occluder. * @example * var cameraPosition = new Cesium.Cartesian3(0, 0, 0); - * var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25); - * var occluder = new Cesium.Occluder(littleSphere, cameraPosition); - * var point = new Cesium.Cartesian3(0, 0, -3); - * occluder.isPointVisible(point); //returns true + var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25); + var occluder = new Cesium.Occluder(littleSphere, cameraPosition); + var point = new Cesium.Cartesian3(0, 0, -3); + occluder.isPointVisible(point); //returns true * @param occludee - The point surrounding the occludee object. * @returns true if the occludee is visible; otherwise false. */ @@ -10927,10 +11285,10 @@ export class Occluder { * Determines whether or not a sphere, the occludee, is hidden from view by the occluder. * @example * var cameraPosition = new Cesium.Cartesian3(0, 0, 0); - * var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25); - * var occluder = new Cesium.Occluder(littleSphere, cameraPosition); - * var bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1); - * occluder.isBoundingSphereVisible(bigSphere); //returns true + var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25); + var occluder = new Cesium.Occluder(littleSphere, cameraPosition); + var bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1); + occluder.isBoundingSphereVisible(bigSphere); //returns true * @param occludee - The bounding sphere surrounding the occludee object. * @returns true if the occludee is visible; otherwise false. */ @@ -10939,37 +11297,37 @@ export class Occluder { * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible). * @example * var sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5); - * var sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5); - * var cameraPosition = new Cesium.Cartesian3(0, 0, 0); - * var occluder = new Cesium.Occluder(sphere1, cameraPosition); - * occluder.computeVisibility(sphere2); //returns Visibility.NONE + var sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5); + var cameraPosition = new Cesium.Cartesian3(0, 0, 0); + var occluder = new Cesium.Occluder(sphere1, cameraPosition); + occluder.computeVisibility(sphere2); //returns Visibility.NONE * @param occludeeBS - The bounding sphere of the occludee. * @returns Visibility.NONE if the occludee is not visible, - * Visibility.PARTIAL if the occludee is partially visible, or - * Visibility.FULL if the occludee is fully visible. + Visibility.PARTIAL if the occludee is partially visible, or + Visibility.FULL if the occludee is fully visible. */ computeVisibility(occludeeBS: BoundingSphere): Visibility; /** * Computes a point that can be used as the occludee position to the visibility functions. - * Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around - * an object that is used for visibility; however it is also possible to compute a point that if - * seen/not seen would also indicate if an object is visible/not visible. This function is better - * called for objects that do not move relative to the occluder and is large, such as a chunk of - * terrain. You are better off not calling this and using the object's bounding sphere for objects - * such as a satellite or ground vehicle. + Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around + an object that is used for visibility; however it is also possible to compute a point that if + seen/not seen would also indicate if an object is visible/not visible. This function is better + called for objects that do not move relative to the occluder and is large, such as a chunk of + terrain. You are better off not calling this and using the object's bounding sphere for objects + such as a satellite or ground vehicle. * @example * var cameraPosition = new Cesium.Cartesian3(0, 0, 0); - * var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2); - * var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition); - * var positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)]; - * var tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions); - * var occludeePosition = tileOccluderSphere.center; - * var occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions); + var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2); + var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition); + var positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)]; + var tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions); + var occludeePosition = tileOccluderSphere.center; + var occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions); * @param occluderBoundingSphere - The bounding sphere surrounding the occluder. * @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located. * @param positions - List of altitude points on the horizon near the surface of the occluder. * @returns An object containing two attributes: occludeePoint and valid - * which is a boolean value. + which is a boolean value. */ static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any; /** @@ -10977,7 +11335,7 @@ export class Occluder { * @param rectangle - The rectangle used to create a bounding sphere. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle. * @returns An object containing two attributes: occludeePoint and valid - * which is a boolean value. + which is a boolean value. */ static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any; } @@ -10986,9 +11344,9 @@ export class Occluder { * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server. * @example * // Configure a Viewer to use the OpenCage Geocoder - * var viewer = new Cesium.Viewer('cesiumContainer', { - * geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '') - * }); +var viewer = new Cesium.Viewer('cesiumContainer', { + geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '') +}); * @param url - The endpoint to the OpenCage server. * @param apiKey - The OpenCage API Key. * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt): @@ -11026,17 +11384,17 @@ export class OpenCageGeocoderService { /** * Creates an instance of an OrientedBoundingBox. - * An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases. +An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases. * @example * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale. - * var center = new Cesium.Cartesian3(1.0, 0.0, 0.0); - * var halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3()); - * - * var obb = new Cesium.OrientedBoundingBox(center, halfAxes); +var center = new Cesium.Cartesian3(1.0, 0.0, 0.0); +var halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3()); + +var obb = new Cesium.OrientedBoundingBox(center, halfAxes); * @param [center = Cartesian3.ZERO] - The center of the box. * @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box. - * Equivalently, the transformation matrix, to rotate and scale a 0x0x0 - * cube centered at the origin. + Equivalently, the transformation matrix, to rotate and scale a 0x0x0 + cube centered at the origin. */ export class OrientedBoundingBox { constructor(center?: Cartesian3, halfAxes?: Matrix3); @@ -11070,11 +11428,11 @@ export class OrientedBoundingBox { static unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox; /** * Computes an instance of an OrientedBoundingBox of the given positions. - * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis). - * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf + This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis). + Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf * @example * // Compute an object oriented bounding box enclosing two points. - * var box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]); + var box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]); * @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided. @@ -11082,7 +11440,7 @@ export class OrientedBoundingBox { static fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox; /** * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}. - * There are no guarantees about the orientation of the bounding box. + There are no guarantees about the orientation of the bounding box. * @param rectangle - The cartographic rectangle on the surface of the ellipsoid. * @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile. * @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile. @@ -11103,18 +11461,18 @@ export class OrientedBoundingBox { * @param box - The oriented bounding box to test. * @param plane - The plane to test against. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane - * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is - * on the opposite side, and {@link Intersect.INTERSECTING} if the box - * intersects the plane. + the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is + on the opposite side, and {@link Intersect.INTERSECTING} if the box + intersects the plane. */ static intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect; /** * Computes the estimated distance squared from the closest point on a bounding box to a point. * @example * // Sort bounding boxes from back to front - * boxes.sort(function(a, b) { - * return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC); - * }); + boxes.sort(function(a, b) { + return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC); + }); * @param box - The box. * @param cartesian - The point * @returns The estimated distance squared from the bounding sphere to the point. @@ -11122,9 +11480,9 @@ export class OrientedBoundingBox { static distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number; /** * The distances calculated by the vector from the center of the bounding box to position projected onto direction. - *
- * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the - * closest and farthest planes from position that intersect the bounding box. +
+ If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the + closest and farthest planes from position that intersect the bounding box. * @param box - The bounding box to calculate the distance to. * @param position - The position to calculate the distance from. * @param direction - The direction from position. @@ -11143,27 +11501,27 @@ export class OrientedBoundingBox { * Determines which side of a plane the oriented bounding box is located. * @param plane - The plane to test against. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane - * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is - * on the opposite side, and {@link Intersect.INTERSECTING} if the box - * intersects the plane. + the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is + on the opposite side, and {@link Intersect.INTERSECTING} if the box + intersects the plane. */ intersectPlane(plane: Plane): Intersect; /** * Computes the estimated distance squared from the closest point on a bounding box to a point. * @example * // Sort bounding boxes from back to front - * boxes.sort(function(a, b) { - * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC); - * }); + boxes.sort(function(a, b) { + return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC); + }); * @param cartesian - The point * @returns The estimated distance squared from the bounding sphere to the point. */ distanceSquaredTo(cartesian: Cartesian3): number; /** * The distances calculated by the vector from the center of the bounding box to position projected onto direction. - *
- * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the - * closest and farthest planes from position that intersect the bounding box. +
+ If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the + closest and farthest planes from position that intersect the bounding box. * @param position - The position to calculate the distance from. * @param direction - The direction from position. * @param [result] - A Interval to store the nearest and farthest distances. @@ -11178,7 +11536,7 @@ export class OrientedBoundingBox { isOccluded(occluder: Occluder): boolean; /** * Compares the provided OrientedBoundingBox componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param left - The first OrientedBoundingBox. * @param right - The second OrientedBoundingBox. * @returns true if left and right are equal, false otherwise. @@ -11192,7 +11550,7 @@ export class OrientedBoundingBox { clone(result?: OrientedBoundingBox): OrientedBoundingBox; /** * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side OrientedBoundingBox. * @returns true if they are equal, false otherwise. */ @@ -11201,15 +11559,15 @@ export class OrientedBoundingBox { /** * The viewing frustum is defined by 6 planes. - * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components - * define the unit vector normal to the plane, and the w component is the distance of the - * plane from the origin/camera position. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. * @example * var maxRadii = ellipsoid.maximumRadius; - * - * var frustum = new Cesium.OrthographicFrustum(); - * frustum.near = 0.01 * maxRadii; - * frustum.far = 50.0 * maxRadii; + +var frustum = new Cesium.OrthographicFrustum(); +frustum.near = 0.01 * maxRadii; +frustum.far = 50.0 * maxRadii; * @param [options] - An object with the following properties: * @param [options.width] - The width of the frustum in meters. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height. @@ -11267,8 +11625,8 @@ export class OrthographicFrustum { * Creates a culling volume for this frustum. * @example * // Check if a bounding volume intersects the frustum. - * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); - * var intersect = cullingVolume.computeVisibility(boundingVolume); + var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + var intersect = cullingVolume.computeVisibility(boundingVolume); * @param position - The eye position. * @param direction - The view direction. * @param up - The up direction. @@ -11279,8 +11637,8 @@ export class OrthographicFrustum { * Returns the pixel's width and height in meters. * @example * // Example 1 - * // Get the width and height of a pixel. - * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2()); + // Get the width and height of a pixel. + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2()); * @param drawingBufferWidth - The width of the drawing buffer. * @param drawingBufferHeight - The height of the drawing buffer. * @param distance - The distance to the near plane in meters. @@ -11297,15 +11655,15 @@ export class OrthographicFrustum { clone(result?: OrthographicFrustum): OrthographicFrustum; /** * Compares the provided OrthographicFrustum componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The right hand side OrthographicFrustum. * @returns true if they are equal, false otherwise. */ equals(other?: OrthographicFrustum): boolean; /** * Compares the provided OrthographicFrustum componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param other - The right hand side OrthographicFrustum. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. @@ -11316,19 +11674,19 @@ export class OrthographicFrustum { /** * The viewing frustum is defined by 6 planes. - * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components - * define the unit vector normal to the plane, and the w component is the distance of the - * plane from the origin/camera position. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. * @example * var maxRadii = ellipsoid.maximumRadius; - * - * var frustum = new Cesium.OrthographicOffCenterFrustum(); - * frustum.right = maxRadii * Cesium.Math.PI; - * frustum.left = -c.frustum.right; - * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth); - * frustum.bottom = -c.frustum.top; - * frustum.near = 0.01 * maxRadii; - * frustum.far = 50.0 * maxRadii; + +var frustum = new Cesium.OrthographicOffCenterFrustum(); +frustum.right = maxRadii * Cesium.Math.PI; +frustum.left = -c.frustum.right; +frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth); +frustum.bottom = -c.frustum.top; +frustum.near = 0.01 * maxRadii; +frustum.far = 50.0 * maxRadii; * @param [options] - An object with the following properties: * @param [options.left] - The left clipping plane distance. * @param [options.right] - The right clipping plane distance. @@ -11378,8 +11736,8 @@ export class OrthographicOffCenterFrustum { * Creates a culling volume for this frustum. * @example * // Check if a bounding volume intersects the frustum. - * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); - * var intersect = cullingVolume.computeVisibility(boundingVolume); + var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + var intersect = cullingVolume.computeVisibility(boundingVolume); * @param position - The eye position. * @param direction - The view direction. * @param up - The up direction. @@ -11390,8 +11748,8 @@ export class OrthographicOffCenterFrustum { * Returns the pixel's width and height in meters. * @example * // Example 1 - * // Get the width and height of a pixel. - * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2()); + // Get the width and height of a pixel. + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2()); * @param drawingBufferWidth - The width of the drawing buffer. * @param drawingBufferHeight - The height of the drawing buffer. * @param distance - The distance to the near plane in meters. @@ -11408,15 +11766,15 @@ export class OrthographicOffCenterFrustum { clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum; /** * Compares the provided OrthographicOffCenterFrustum componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The right hand side OrthographicOffCenterFrustum. * @returns true if they are equal, false otherwise. */ equals(other?: OrthographicOffCenterFrustum): boolean; /** * Compares the provided OrthographicOffCenterFrustum componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param other - The right hand side OrthographicOffCenterFrustum. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. @@ -11449,16 +11807,16 @@ export namespace Packable { /** * Static interface for types which can store their values as packed - * elements in an array. These methods and properties are expected to be - * defined on a constructor function. +elements in an array. These methods and properties are expected to be +defined on a constructor function. */ export interface Packable { } /** * Static interface for {@link Packable} types which are interpolated in a - * different representation than their packed value. These methods and - * properties are expected to be defined on a constructor function. +different representation than their packed value. These methods and +properties are expected to be defined on a constructor function. */ export namespace PackableForInterpolation { /** @@ -11489,14 +11847,14 @@ export namespace PackableForInterpolation { * Provides geocoding via a {@link https://pelias.io/|Pelias} server. * @example * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/ - * var viewer = new Cesium.Viewer('cesiumContainer', { - * geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({ - * url: 'https://api.geocode.earth/v1/', - * queryParameters: { - * api_key: '' - * } - * })) - * }); +var viewer = new Cesium.Viewer('cesiumContainer', { + geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({ + url: 'https://api.geocode.earth/v1/', + queryParameters: { + api_key: '' + } + })) +}); * @param url - The endpoint to the Pelias server. */ export class PeliasGeocoderService { @@ -11514,16 +11872,16 @@ export class PeliasGeocoderService { /** * The viewing frustum is defined by 6 planes. - * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components - * define the unit vector normal to the plane, and the w component is the distance of the - * plane from the origin/camera position. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. * @example * var frustum = new Cesium.PerspectiveFrustum({ - * fov : Cesium.Math.PI_OVER_THREE, - * aspectRatio : canvas.clientWidth / canvas.clientHeight - * near : 1.0, - * far : 1000.0 - * }); + fov : Cesium.Math.PI_OVER_THREE, + aspectRatio : canvas.clientWidth / canvas.clientHeight + near : 1.0, + far : 1000.0 +}); * @param [options] - An object with the following properties: * @param [options.fov] - The angle of the field of view (FOV), in radians. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height. @@ -11543,8 +11901,8 @@ export class PerspectiveFrustum { }); /** * The angle of the field of view (FOV), in radians. This angle will be used - * as the horizontal FOV if the width is greater than the height, otherwise - * it will be the vertical FOV. + as the horizontal FOV if the width is greater than the height, otherwise + it will be the vertical FOV. */ fov: number; /** @@ -11603,8 +11961,8 @@ export class PerspectiveFrustum { * Creates a culling volume for this frustum. * @example * // Check if a bounding volume intersects the frustum. - * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); - * var intersect = cullingVolume.computeVisibility(boundingVolume); + var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + var intersect = cullingVolume.computeVisibility(boundingVolume); * @param position - The eye position. * @param direction - The view direction. * @param up - The up direction. @@ -11615,18 +11973,18 @@ export class PerspectiveFrustum { * Returns the pixel's width and height in meters. * @example * // Example 1 - * // Get the width and height of a pixel. - * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2()); + // Get the width and height of a pixel. + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2()); * @example * // Example 2 - * // Get the width and height of a pixel if the near plane was set to 'distance'. - * // For example, get the size of a pixel of an image on a billboard. - * var position = camera.position; - * var direction = camera.direction; - * var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive - * var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector - * var distance = Cesium.Cartesian3.magnitude(toCenterProj); - * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2()); + // Get the width and height of a pixel if the near plane was set to 'distance'. + // For example, get the size of a pixel of an image on a billboard. + var position = camera.position; + var direction = camera.direction; + var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive + var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector + var distance = Cesium.Cartesian3.magnitude(toCenterProj); + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2()); * @param drawingBufferWidth - The width of the drawing buffer. * @param drawingBufferHeight - The height of the drawing buffer. * @param distance - The distance to the near plane in meters. @@ -11643,15 +12001,15 @@ export class PerspectiveFrustum { clone(result?: PerspectiveFrustum): PerspectiveFrustum; /** * Compares the provided PerspectiveFrustum componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The right hand side PerspectiveFrustum. * @returns true if they are equal, false otherwise. */ equals(other?: PerspectiveFrustum): boolean; /** * Compares the provided PerspectiveFrustum componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param other - The right hand side PerspectiveFrustum. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. @@ -11662,18 +12020,18 @@ export class PerspectiveFrustum { /** * The viewing frustum is defined by 6 planes. - * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components - * define the unit vector normal to the plane, and the w component is the distance of the - * plane from the origin/camera position. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. * @example * var frustum = new Cesium.PerspectiveOffCenterFrustum({ - * left : -1.0, - * right : 1.0, - * top : 1.0, - * bottom : -1.0, - * near : 1.0, - * far : 100.0 - * }); + left : -1.0, + right : 1.0, + top : 1.0, + bottom : -1.0, + near : 1.0, + far : 100.0 +}); * @param [options] - An object with the following properties: * @param [options.left] - The left clipping plane distance. * @param [options.right] - The right clipping plane distance. @@ -11727,8 +12085,8 @@ export class PerspectiveOffCenterFrustum { * Creates a culling volume for this frustum. * @example * // Check if a bounding volume intersects the frustum. - * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); - * var intersect = cullingVolume.computeVisibility(boundingVolume); + var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + var intersect = cullingVolume.computeVisibility(boundingVolume); * @param position - The eye position. * @param direction - The view direction. * @param up - The up direction. @@ -11739,18 +12097,18 @@ export class PerspectiveOffCenterFrustum { * Returns the pixel's width and height in meters. * @example * // Example 1 - * // Get the width and height of a pixel. - * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2()); + // Get the width and height of a pixel. + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2()); * @example * // Example 2 - * // Get the width and height of a pixel if the near plane was set to 'distance'. - * // For example, get the size of a pixel of an image on a billboard. - * var position = camera.position; - * var direction = camera.direction; - * var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive - * var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector - * var distance = Cesium.Cartesian3.magnitude(toCenterProj); - * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2()); + // Get the width and height of a pixel if the near plane was set to 'distance'. + // For example, get the size of a pixel of an image on a billboard. + var position = camera.position; + var direction = camera.direction; + var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive + var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector + var distance = Cesium.Cartesian3.magnitude(toCenterProj); + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2()); * @param drawingBufferWidth - The width of the drawing buffer. * @param drawingBufferHeight - The height of the drawing buffer. * @param distance - The distance to the near plane in meters. @@ -11767,15 +12125,15 @@ export class PerspectiveOffCenterFrustum { clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum; /** * Compares the provided PerspectiveOffCenterFrustum componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The right hand side PerspectiveOffCenterFrustum. * @returns true if they are equal, false otherwise. */ equals(other?: PerspectiveOffCenterFrustum): boolean; /** * Compares the provided PerspectiveOffCenterFrustum componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param other - The right hand side PerspectiveOffCenterFrustum. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. @@ -11786,11 +12144,11 @@ export class PerspectiveOffCenterFrustum { /** * A utility class for generating custom map pins as canvas elements. - *

- *
- *
- * Example pins generated using both the maki icon set, which ships with Cesium, and single character text. - *
+

+
+
+Example pins generated using both the maki icon set, which ships with Cesium, and single character text. +
*/ export class PinBuilder { constructor(); @@ -11819,7 +12177,7 @@ export class PinBuilder { fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise; /** * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible - * while still being contained completely within the pin. + while still being contained completely within the pin. * @param text - The text to be stamped onto the pin. * @param color - The color of the pin. * @param size - The size of the pin, in pixels. @@ -11900,21 +12258,21 @@ export enum PixelFormat { /** * A plane in Hessian Normal Form defined by - *
- * ax + by + cz + d = 0
- * 
- * where (a, b, c) is the plane's normal, d is the signed - * distance to the plane, and (x, y, z) is any point on - * the plane. +
+ax + by + cz + d = 0
+
+where (a, b, c) is the plane's normal, d is the signed +distance to the plane, and (x, y, z) is any point on +the plane. * @example * // The plane x=0 - * var plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0); +var plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0); * @param normal - The plane's normal (normalized). * @param distance - The shortest distance from the origin to the plane. The sign of - * distance determines which side of the plane the origin - * is on. If distance is positive, the origin is in the half-space - * in the direction of the normal; if negative, the origin is in the half-space - * opposite to the normal; if zero, the plane passes through the origin. +distance determines which side of the plane the origin +is on. If distance is positive, the origin is in the half-space +in the direction of the normal; if negative, the origin is in the half-space +opposite to the normal; if zero, the plane passes through the origin. */ export class Plane { constructor(normal: Cartesian3, distance: number); @@ -11924,18 +12282,18 @@ export class Plane { normal: Cartesian3; /** * The shortest distance from the origin to the plane. The sign of - * distance determines which side of the plane the origin - * is on. If distance is positive, the origin is in the half-space - * in the direction of the normal; if negative, the origin is in the half-space - * opposite to the normal; if zero, the plane passes through the origin. + distance determines which side of the plane the origin + is on. If distance is positive, the origin is in the half-space + in the direction of the normal; if negative, the origin is in the half-space + opposite to the normal; if zero, the plane passes through the origin. */ distance: number; /** * Creates a plane from a normal and a point on the plane. * @example * var point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0); - * var normal = ellipsoid.geodeticSurfaceNormal(point); - * var tangentPlane = Cesium.Plane.fromPointNormal(point, normal); + var normal = ellipsoid.geodeticSurfaceNormal(point); + var tangentPlane = Cesium.Plane.fromPointNormal(point, normal); * @param point - The point on the plane. * @param normal - The plane's normal (normalized). * @param [result] - The object onto which to store the result. @@ -11951,10 +12309,10 @@ export class Plane { static fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane; /** * Computes the signed shortest distance of a point to a plane. - * The sign of the distance determines which side of the plane the point - * is on. If the distance is positive, the point is in the half-space - * in the direction of the normal; if negative, the point is in the half-space - * opposite to the normal; if zero, the plane passes through the point. + The sign of the distance determines which side of the plane the point + is on. If the distance is positive, the point is in the half-space + in the direction of the normal; if negative, the point is in the half-space + opposite to the normal; if zero, the plane passes through the point. * @param plane - The plane. * @param point - The point. * @returns The signed shortest distance of the point to the plane. @@ -11985,7 +12343,7 @@ export class Plane { static clone(plane: Plane, result?: Plane): Plane; /** * Compares the provided Planes by normal and distance and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param left - The first plane. * @param right - The second plane. * @returns true if left and right are equal, false otherwise. @@ -12009,8 +12367,8 @@ export class Plane { * Describes geometry representing a plane centered at the origin, with a unit width and length. * @example * var planeGeometry = new Cesium.PlaneGeometry({ - * vertexFormat : Cesium.VertexFormat.POSITION_ONLY - * }); + vertexFormat : Cesium.VertexFormat.POSITION_ONLY +}); * @param [options] - Object with the following properties: * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. */ @@ -12077,74 +12435,91 @@ export class PlaneOutlineGeometry { static createGeometry(): Geometry | undefined; } +/** + * Determines if a point is inside a triangle. + * @example + * // Returns true +var p = new Cesium.Cartesian2(0.25, 0.25); +var b = Cesium.pointInsideTriangle(p, + new Cesium.Cartesian2(0.0, 0.0), + new Cesium.Cartesian2(1.0, 0.0), + new Cesium.Cartesian2(0.0, 1.0)); + * @param point - The point to test. + * @param p0 - The first point of the triangle. + * @param p1 - The second point of the triangle. + * @param p2 - The third point of the triangle. + * @returns true if the point is inside the triangle; otherwise, false. + */ +export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean; + /** * A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. * @example * // 1. create a polygon from points - * var polygon = new Cesium.PolygonGeometry({ - * polygonHierarchy : new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ]) - * ) - * }); - * var geometry = Cesium.PolygonGeometry.createGeometry(polygon); - * - * // 2. create a nested polygon with holes - * var polygonWithHole = new Cesium.PolygonGeometry({ - * polygonHierarchy : new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -109.0, 30.0, - * -95.0, 30.0, - * -95.0, 40.0, - * -109.0, 40.0 - * ]), - * [new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -107.0, 31.0, - * -107.0, 39.0, - * -97.0, 39.0, - * -97.0, 31.0 - * ]), - * [new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -105.0, 33.0, - * -99.0, 33.0, - * -99.0, 37.0, - * -105.0, 37.0 - * ]), - * [new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -103.0, 34.0, - * -101.0, 34.0, - * -101.0, 36.0, - * -103.0, 36.0 - * ]) - * )] - * )] - * )] - * ) - * }); - * var geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole); - * - * // 3. create extruded polygon - * var extrudedPolygon = new Cesium.PolygonGeometry({ - * polygonHierarchy : new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ]) - * ), - * extrudedHeight: 300000 - * }); - * var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon); +var polygon = new Cesium.PolygonGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + ) +}); +var geometry = Cesium.PolygonGeometry.createGeometry(polygon); + +// 2. create a nested polygon with holes +var polygonWithHole = new Cesium.PolygonGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -109.0, 30.0, + -95.0, 30.0, + -95.0, 40.0, + -109.0, 40.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -107.0, 31.0, + -107.0, 39.0, + -97.0, 39.0, + -97.0, 31.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -105.0, 33.0, + -99.0, 33.0, + -99.0, 37.0, + -105.0, 37.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -103.0, 34.0, + -101.0, 34.0, + -101.0, 36.0, + -103.0, 36.0 + ]) + )] + )] + )] + ) +}); +var geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole); + +// 3. create extruded polygon +var extrudedPolygon = new Cesium.PolygonGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + ), + extrudedHeight: 300000 +}); +var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon); * @param options - Object with the following properties: * @param options.polygonHierarchy - A polygon hierarchy that can include holes. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface. @@ -12180,16 +12555,16 @@ export class PolygonGeometry { * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. * @example * // create a polygon from points - * var polygon = Cesium.PolygonGeometry.fromPositions({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ]) - * }); - * var geometry = Cesium.PolygonGeometry.createGeometry(polygon); + var polygon = Cesium.PolygonGeometry.fromPositions({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + }); + var geometry = Cesium.PolygonGeometry.createGeometry(polygon); * @param options - Object with the following properties: * @param options.positions - An array of positions that defined the corner points of the polygon. * @param [options.height = 0.0] - The height of the polygon. @@ -12257,7 +12632,7 @@ export class PolygonGeometry { /** * An hierarchy of linear rings which define a polygon and its holes. - * The holes themselves may also have holes which nest inner polygons. +The holes themselves may also have holes which nest inner polygons. * @param [positions] - A linear ring defining the outer boundary of the polygon or hole. * @param [holes] - An array of polygon hierarchies defining holes in the polygon. */ @@ -12277,70 +12652,70 @@ export class PolygonHierarchy { * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. * @example * // 1. create a polygon outline from points - * var polygon = new Cesium.PolygonOutlineGeometry({ - * polygonHierarchy : new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ]) - * ) - * }); - * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon); - * - * // 2. create a nested polygon with holes outline - * var polygonWithHole = new Cesium.PolygonOutlineGeometry({ - * polygonHierarchy : new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -109.0, 30.0, - * -95.0, 30.0, - * -95.0, 40.0, - * -109.0, 40.0 - * ]), - * [new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -107.0, 31.0, - * -107.0, 39.0, - * -97.0, 39.0, - * -97.0, 31.0 - * ]), - * [new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -105.0, 33.0, - * -99.0, 33.0, - * -99.0, 37.0, - * -105.0, 37.0 - * ]), - * [new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -103.0, 34.0, - * -101.0, 34.0, - * -101.0, 36.0, - * -103.0, 36.0 - * ]) - * )] - * )] - * )] - * ) - * }); - * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole); - * - * // 3. create extruded polygon outline - * var extrudedPolygon = new Cesium.PolygonOutlineGeometry({ - * polygonHierarchy : new Cesium.PolygonHierarchy( - * Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ]) - * ), - * extrudedHeight: 300000 - * }); - * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon); +var polygon = new Cesium.PolygonOutlineGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + ) +}); +var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon); + +// 2. create a nested polygon with holes outline +var polygonWithHole = new Cesium.PolygonOutlineGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -109.0, 30.0, + -95.0, 30.0, + -95.0, 40.0, + -109.0, 40.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -107.0, 31.0, + -107.0, 39.0, + -97.0, 39.0, + -97.0, 31.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -105.0, 33.0, + -99.0, 33.0, + -99.0, 37.0, + -105.0, 37.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -103.0, 34.0, + -101.0, 34.0, + -101.0, 36.0, + -103.0, 36.0 + ]) + )] + )] + )] + ) +}); +var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole); + +// 3. create extruded polygon outline +var extrudedPolygon = new Cesium.PolygonOutlineGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + ), + extrudedHeight: 300000 +}); +var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon); * @param options - Object with the following properties: * @param options.polygonHierarchy - A polygon hierarchy that can include holes. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface. @@ -12386,16 +12761,16 @@ export class PolygonOutlineGeometry { * A description of a polygon outline from an array of positions. * @example * // create a polygon from points - * var polygon = Cesium.PolygonOutlineGeometry.fromPositions({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0, - * -75.0, 30.0, - * -70.0, 30.0, - * -68.0, 40.0 - * ]) - * }); - * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon); + var polygon = Cesium.PolygonOutlineGeometry.fromPositions({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + }); + var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon); * @param options - Object with the following properties: * @param options.positions - An array of positions that defined the corner points of the polygon. * @param [options.height = 0.0] - The height of the polygon. @@ -12424,19 +12799,19 @@ export class PolygonOutlineGeometry { /** * A description of a polyline modeled as a line strip; the first two positions define a line segment, - * and each additional position defines a line segment from the previous position. The polyline is capable of - * displaying with a material. +and each additional position defines a line segment from the previous position. The polyline is capable of +displaying with a material. * @example * // A polyline with two connected line segments - * var polyline = new Cesium.PolylineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * 0.0, 0.0, - * 5.0, 0.0, - * 5.0, 5.0 - * ]), - * width : 10.0 - * }); - * var geometry = Cesium.PolylineGeometry.createGeometry(polyline); +var polyline = new Cesium.PolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0, + 5.0, 5.0 + ]), + width : 10.0 +}); +var geometry = Cesium.PolylineGeometry.createGeometry(polyline); * @param options - Object with the following properties: * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip. * @param [options.width = 1.0] - The width in pixels. @@ -12490,22 +12865,22 @@ export class PolylineGeometry { * A description of a polyline with a volume (a 2D shape extruded along a polyline). * @example * function computeCircle(radius) { - * var positions = []; - * for (var i = 0; i < 360; i++) { - * var radians = Cesium.Math.toRadians(i); - * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians))); - * } - * return positions; - * } - * - * var volume = new Cesium.PolylineVolumeGeometry({ - * vertexFormat : Cesium.VertexFormat.POSITION_ONLY, - * polylinePositions : Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0 - * ]), - * shapePositions : computeCircle(100000.0) - * }); + var positions = []; + for (var i = 0; i < 360; i++) { + var radians = Cesium.Math.toRadians(i); + positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians))); + } + return positions; +} + +var volume = new Cesium.PolylineVolumeGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + polylinePositions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0 + ]), + shapePositions : computeCircle(100000.0) +}); * @param options - Object with the following properties: * @param options.polylinePositions - An array of {@link Cartesian3} positions that define the center of the polyline volume. * @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline @@ -12555,21 +12930,21 @@ export class PolylineVolumeGeometry { * A description of a polyline with a volume (a 2D shape extruded along a polyline). * @example * function computeCircle(radius) { - * var positions = []; - * for (var i = 0; i < 360; i++) { - * var radians = Cesium.Math.toRadians(i); - * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians))); - * } - * return positions; - * } - * - * var volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({ - * polylinePositions : Cesium.Cartesian3.fromDegreesArray([ - * -72.0, 40.0, - * -70.0, 35.0 - * ]), - * shapePositions : computeCircle(100000.0) - * }); + var positions = []; + for (var i = 0; i < 360; i++) { + var radians = Cesium.Math.toRadians(i); + positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians))); + } + return positions; +} + +var volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({ + polylinePositions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0 + ]), + shapePositions : computeCircle(100000.0) +}); * @param options - Object with the following properties: * @param options.polylinePositions - An array of positions that define the center of the polyline volume. * @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline @@ -12627,7 +13002,7 @@ export enum PrimitiveType { LINES = WebGLConstants.LINES, /** * Line loop primitive where each vertex (or index) after the first connects a line to - * the previous vertex, and the last vertex implicitly connects to the first. + the previous vertex, and the last vertex implicitly connects to the first. */ LINE_LOOP = WebGLConstants.LINE_LOOP, /** @@ -12640,13 +13015,13 @@ export enum PrimitiveType { TRIANGLES = WebGLConstants.TRIANGLES, /** * Triangle strip primitive where each vertex (or index) after the first two connect to - * the previous two vertices forming a triangle. For example, this can be used to model a wall. + the previous two vertices forming a triangle. For example, this can be used to model a wall. */ TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP, /** * Triangle fan primitive where each vertex (or index) after the first two connect to - * the previous vertex and the first vertex forming a triangle. For example, this can be used - * to model a cone or circle. + the previous vertex and the first vertex forming a triangle. For example, this can be used + to model a cone or circle. */ TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN } @@ -12688,46 +13063,46 @@ export namespace QuadraticRealPolynomial { /** * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized - * mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed - * as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner - * of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile - * and 32767 at the maximum height in the tile. +mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed +as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner +of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile +and 32767 at the maximum height in the tile. * @example * var data = new Cesium.QuantizedMeshTerrainData({ - * minimumHeight : -100, - * maximumHeight : 2101, - * quantizedVertices : new Uint16Array([// order is SW NW SE NE - * // longitude - * 0, 0, 32767, 32767, - * // latitude - * 0, 32767, 0, 32767, - * // heights - * 16384, 0, 32767, 16384]), - * indices : new Uint16Array([0, 3, 1, - * 0, 2, 3]), - * boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000), - * orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())), - * horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0), - * westIndices : [0, 1], - * southIndices : [0, 1], - * eastIndices : [2, 3], - * northIndices : [1, 3], - * westSkirtHeight : 1.0, - * southSkirtHeight : 1.0, - * eastSkirtHeight : 1.0, - * northSkirtHeight : 1.0 - * }); + minimumHeight : -100, + maximumHeight : 2101, + quantizedVertices : new Uint16Array([// order is SW NW SE NE + // longitude + 0, 0, 32767, 32767, + // latitude + 0, 32767, 0, 32767, + // heights + 16384, 0, 32767, 16384]), + indices : new Uint16Array([0, 3, 1, + 0, 2, 3]), + boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000), + orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())), + horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0), + westIndices : [0, 1], + southIndices : [0, 1], + eastIndices : [2, 3], + northIndices : [1, 3], + westSkirtHeight : 1.0, + southSkirtHeight : 1.0, + eastSkirtHeight : 1.0, + northSkirtHeight : 1.0 +}); * @param options - Object with the following properties: * @param options.quantizedVertices - The buffer containing the quantized mesh. * @param options.indices - The indices specifying how the quantized vertices are linked - * together into triangles. Each three indices specifies one triangle. + together into triangles. Each three indices specifies one triangle. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh. * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point - * is below the horizon, the entire tile is assumed to be below the horizon as well. - * The point is expressed in ellipsoid-scaled coordinates. + is below the horizon, the entire tile is assumed to be below the horizon as well. + The point is expressed in ellipsoid-scaled coordinates. * @param options.westIndices - The indices of the vertices on the western edge of the tile. * @param options.southIndices - The indices of the vertices on the southern edge of the tile. * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile. @@ -12737,18 +13112,18 @@ export namespace QuadraticRealPolynomial { * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile. * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. - * If a child's bit is set, geometry will be requested for that tile as well when it - * is needed. If the bit is cleared, the child tile is not requested and geometry is - * instead upsampled from the parent. The bit values are as follows: - * - * - * - * - * - * - *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
+ If a child's bit is set, geometry will be requested for that tile as well when it + is needed. If the bit is cleared, the child tile is not requested and geometry is + instead upsampled from the parent. The bit values are as follows: + + + + + + +
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
* @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; - * otherwise, false. + otherwise, false. * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding * @param [options.waterMask] - The buffer containing the watermask. * @param [options.credits] - Array of credits for this tile. @@ -12782,13 +13157,13 @@ export class QuantizedMeshTerrainData { credits: Credit[]; /** * The water mask included in this terrain data, if any. A water mask is a rectangular - * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. - * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; /** * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the - * vertices in this instance, interpolated if necessary. + vertices in this instance, interpolated if necessary. * @param tilingScheme - The tiling scheme of this terrain data. * @param thisX - The X coordinate of this tile in the tiling scheme. * @param thisY - The Y coordinate of this tile in the tiling scheme. @@ -12797,8 +13172,8 @@ export class QuantizedMeshTerrainData { * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled heightmap terrain data for the descendant tile, - * or undefined if too many asynchronous upsample operations are in progress and the request has been - * deferred. + or undefined if too many asynchronous upsample operations are in progress and the request has been + deferred. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** @@ -12807,14 +13182,14 @@ export class QuantizedMeshTerrainData { * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position. The position is clamped to - * the rectangle, so expect incorrect results for positions far outside the rectangle. + the rectangle, so expect incorrect results for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; /** * Determines if a given child tile is available, based on the - * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed - * to be one of the four children of this tile. If non-child tile coordinates are - * given, the availability of the southeast child tile is returned. + {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed + to be one of the four children of this tile. If non-child tile coordinates are + given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. @@ -12824,9 +13199,9 @@ export class QuantizedMeshTerrainData { isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution - * terrain data. If this value is false, the data was obtained from some other source, such - * as by downloading it from a remote server. This method should return true for instances - * returned from a call to {@link HeightmapTerrainData#upsample}. + terrain data. If this value is false, the data was obtained from some other source, such + as by downloading it from a remote server. This method should return true for instances + returned from a call to {@link HeightmapTerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; @@ -12900,8 +13275,8 @@ export class Quaternion { static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion; /** * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the - * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about - * the positive x axis. + negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about + the positive x axis. * @param headingPitchRoll - The rotation expressed as a heading, pitch and roll. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Quaternion instance if none was provided. @@ -13090,7 +13465,7 @@ export class Quaternion { static exp(cartesian: Cartesian3, result: Quaternion): Quaternion; /** * Computes an inner quadrangle point. - *

This will compute quaternions that ensure a squad curve is C1.

+

This will compute quaternions that ensure a squad curve is C1.

* @param q0 - The first quaternion. * @param q1 - The second quaternion. * @param q2 - The third quaternion. @@ -13102,13 +13477,13 @@ export class Quaternion { * Computes the spherical quadrangle interpolation between quaternions. * @example * // 1. compute the squad interpolation between two quaternions on a curve - * var s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion()); - * var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion()); - * var q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion()); - * - * // 2. compute the squad interpolation as above but where the first quaternion is a end point. - * var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion()); - * var q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion()); + var s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion()); + var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion()); + var q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion()); + + // 2. compute the squad interpolation as above but where the first quaternion is a end point. + var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion()); + var q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion()); * @param q0 - The first quaternion. * @param q1 - The second quaternion. * @param s0 - The first inner quadrangle. @@ -13120,7 +13495,7 @@ export class Quaternion { static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion; /** * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions. - * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10-6. + This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10-6. * @param start - The value corresponding to t at 0.0. * @param end - The value corresponding to t at 1.0. * @param t - The point along t at which to interpolate. @@ -13130,7 +13505,7 @@ export class Quaternion { static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; /** * Computes the spherical quadrangle interpolation between quaternions. - * An implementation that is faster than {@link Quaternion#squad}, but less accurate. + An implementation that is faster than {@link Quaternion#squad}, but less accurate. * @param q0 - The first quaternion. * @param q1 - The second quaternion. * @param s0 - The first inner quadrangle. @@ -13142,7 +13517,7 @@ export class Quaternion { static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion; /** * Compares the provided quaternions componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [left] - The first quaternion. * @param [right] - The second quaternion. * @returns true if left and right are equal, false otherwise. @@ -13150,8 +13525,8 @@ export class Quaternion { static equals(left?: Quaternion, right?: Quaternion): boolean; /** * Compares the provided quaternions componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [left] - The first quaternion. * @param [right] - The second quaternion. * @param [epsilon = 0] - The epsilon to use for equality testing. @@ -13174,15 +13549,15 @@ export class Quaternion { clone(result?: Quaternion): Quaternion; /** * Compares this and the provided quaternion componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side quaternion. * @returns true if left and right are equal, false otherwise. */ equals(right?: Quaternion): boolean; /** * Compares this and the provided quaternion componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [right] - The right hand side quaternion. * @param [epsilon = 0] - The epsilon to use for equality testing. * @returns true if left and right are within the provided epsilon, false otherwise. @@ -13197,10 +13572,10 @@ export class Quaternion { /** * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve. - * The generated curve is in the class C1. +The generated curve is in the class C1. * @param options - Object with the following properties: * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. - * The values are in no way connected to the clock time. They are the parameterization for the curve. + The values are in no way connected to the clock time. They are the parameterization for the curve. * @param options.points - The array of {@link Quaternion} control points. */ export class QuaternionSpline { @@ -13218,7 +13593,7 @@ export class QuaternionSpline { readonly points: Quaternion[]; /** * Finds an index i in times such that the parameter - * time is in the interval [times[i], times[i + 1]]. + time is in the interval [times[i], times[i + 1]]. * @param time - The time. * @returns The index for the element at the start of the interval. */ @@ -13244,6 +13619,23 @@ export class QuaternionSpline { evaluate(time: number, result?: Quaternion): Quaternion; } +/** + * Parses a query string into an object, where the keys and values of the object are the +name/value pairs from the query string, decoded. If a name appears multiple times, +the value in the object will be an array of values. + * @example + * var obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y'); +// obj will be: +// { +// key1 : 'some value', +// key2 : 'a/b', +// key3 : ['x', 'y'] +// } + * @param queryString - The query string. + * @returns An object containing the parameters parsed from the query string. + */ +export function queryToObject(queryString: string): any; + /** * A queue that can enqueue items at the end, and dequeue items from the front. */ @@ -13289,8 +13681,8 @@ export namespace Queue { * A function used to compare two items while sorting a queue. * @example * function compareNumbers(a, b) { - * return a - b; - * } + return a - b; + } * @param a - An item in the array. * @param b - An item in the array. */ @@ -13321,11 +13713,11 @@ export class Ray { static clone(ray: Ray, result?: Ray): Ray; /** * Computes the point along the ray given by r(t) = o + t*d, - * where o is the origin of the ray and d is the direction. + where o is the origin of the ray and d is the direction. * @example * //Get the first intersection point of a ray and an ellipsoid. - * var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid); - * var point = Cesium.Ray.getPoint(ray, intersection.start); + var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid); + var point = Cesium.Ray.getPoint(ray, intersection.start); * @param ray - The ray. * @param t - A scalar value. * @param [result] - The object in which the result will be stored. @@ -13447,8 +13839,8 @@ export class Rectangle { static clone(rectangle: Rectangle, result?: Rectangle): Rectangle; /** * Compares the provided Rectangles componentwise and returns - * true if they pass an absolute or relative tolerance test, - * false otherwise. + true if they pass an absolute or relative tolerance test, + false otherwise. * @param [left] - The first Rectangle. * @param [right] - The second Rectangle. * @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing. @@ -13463,14 +13855,14 @@ export class Rectangle { clone(result?: Rectangle): Rectangle; /** * Compares the provided Rectangle with this Rectangle componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The Rectangle to compare. * @returns true if the Rectangles are equal, false otherwise. */ equals(other?: Rectangle): boolean; /** * Compares the provided rectangles and returns true if they are equal, - * false otherwise. + false otherwise. * @param [left] - The first Rectangle. * @param [right] - The second Rectangle. * @returns true if left and right are equal; otherwise false. @@ -13478,8 +13870,8 @@ export class Rectangle { static equals(left?: Rectangle, right?: Rectangle): boolean; /** * Compares the provided Rectangle with this Rectangle componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [other] - The Rectangle to compare. * @param [epsilon = 0] - The epsilon to use for equality testing. * @returns true if the Rectangles are within the provided epsilon, false otherwise. @@ -13527,10 +13919,10 @@ export class Rectangle { static center(rectangle: Rectangle, result?: Cartographic): Cartographic; /** * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are - * latitude and longitude in radians and produces a correct intersection, taking into account the fact that - * the same angle can be represented with multiple values as well as the wrapping of longitude at the - * anti-meridian. For a simple intersection that ignores these factors and can be used with projected - * coordinates, see {@link Rectangle.simpleIntersection}. + latitude and longitude in radians and produces a correct intersection, taking into account the fact that + the same angle can be represented with multiple values as well as the wrapping of longitude at the + anti-meridian. For a simple intersection that ignores these factors and can be used with projected + coordinates, see {@link Rectangle.simpleIntersection}. * @param rectangle - On rectangle to find an intersection * @param otherRectangle - Another rectangle to find an intersection * @param [result] - The object onto which to store the result. @@ -13539,9 +13931,9 @@ export class Rectangle { static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined; /** * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function - * does not attempt to put the angular coordinates into a consistent range or to account for crossing the - * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude - * and longitude (i.e. projected coordinates). + does not attempt to put the angular coordinates into a consistent range or to account for crossing the + anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude + and longitude (i.e. projected coordinates). * @param rectangle - On rectangle to find an intersection * @param otherRectangle - Another rectangle to find an intersection * @param [result] - The object onto which to store the result. @@ -13573,8 +13965,8 @@ export class Rectangle { static contains(rectangle: Rectangle, cartographic: Cartographic): boolean; /** * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to - * {@link BoundingSphere#fromPoints}. Sampling is necessary to account - * for rectangles that cover the poles or cross the equator. + {@link BoundingSphere#fromPoints}. Sampling is necessary to account + for rectangles that cover the poles or cross the equator. * @param rectangle - The rectangle to subsample. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use. * @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid. @@ -13592,21 +13984,21 @@ export class Rectangle { * A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. * @example * // 1. create a rectangle - * var rectangle = new Cesium.RectangleGeometry({ - * ellipsoid : Cesium.Ellipsoid.WGS84, - * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), - * height : 10000.0 - * }); - * var geometry = Cesium.RectangleGeometry.createGeometry(rectangle); - * - * // 2. create an extruded rectangle without a top - * var rectangle = new Cesium.RectangleGeometry({ - * ellipsoid : Cesium.Ellipsoid.WGS84, - * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), - * height : 10000.0, - * extrudedHeight: 300000 - * }); - * var geometry = Cesium.RectangleGeometry.createGeometry(rectangle); +var rectangle = new Cesium.RectangleGeometry({ + ellipsoid : Cesium.Ellipsoid.WGS84, + rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), + height : 10000.0 +}); +var geometry = Cesium.RectangleGeometry.createGeometry(rectangle); + +// 2. create an extruded rectangle without a top +var rectangle = new Cesium.RectangleGeometry({ + ellipsoid : Cesium.Ellipsoid.WGS84, + rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), + height : 10000.0, + extrudedHeight: 300000 +}); +var geometry = Cesium.RectangleGeometry.createGeometry(rectangle); * @param options - Object with the following properties: * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. @@ -13676,11 +14068,11 @@ export class RectangleGeometry { * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin. * @example * var rectangle = new Cesium.RectangleOutlineGeometry({ - * ellipsoid : Cesium.Ellipsoid.WGS84, - * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), - * height : 10000.0 - * }); - * var geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle); + ellipsoid : Cesium.Ellipsoid.WGS84, + rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), + height : 10000.0 +}); +var geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle); * @param options - Object with the following properties: * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies. @@ -13781,21 +14173,21 @@ export class Request { priorityFunction: Request.PriorityCallback; /** * Priority is a unit-less value where lower values represent higher priority. - * For world-based objects, this is usually the distance from the camera. - * A request that does not have a priority function defaults to a priority of 0. - * - * If priorityFunction is defined, this value is updated every frame with the result of that call. + For world-based objects, this is usually the distance from the camera. + A request that does not have a priority function defaults to a priority of 0. + + If priorityFunction is defined, this value is updated every frame with the result of that call. */ priority: number; /** * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the - * request will be throttled and sent based on priority. + request will be throttled and sent based on priority. */ readonly throttle: boolean; /** * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections - * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value - * to true is preferable for requests going through HTTP/1 servers. + for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value + to true is preferable for requests going through HTTP/1 servers. */ readonly throttleByServer: boolean; /** @@ -13829,28 +14221,50 @@ export namespace Request { type PriorityCallback = () => number; } +/** + * A browser-independent function to request a new animation frame. This is used to create +an application's draw loop as shown in the example below. + * @example + * // Create a draw loop using requestAnimationFrame. The +// tick callback function is called for every animation frame. +function tick() { + scene.render(); + Cesium.requestAnimationFrame(tick); +} +tick(); + * @param callback - The function to call when the next frame should be drawn. + * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request. + */ +export function requestAnimationFrame(callback: requestAnimationFrameCallback): number; + +/** + * A function that will be called when the next frame should be drawn. + * @param timestamp - A timestamp for the frame, in milliseconds. + */ +export type requestAnimationFrameCallback = (timestamp: number) => void; + /** * An event that is raised when a request encounters an error. * @param [statusCode] - The HTTP error status code, such as 404. * @param [response] - The response included along with the error. * @param [responseHeaders] - The response headers, represented either as an object literal or as a - * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function. + string in the format returned by XMLHttpRequest's getAllResponseHeaders() function. */ export class RequestErrorEvent { constructor(statusCode?: number, response?: any, responseHeaders?: string | any); /** * The HTTP error status code, such as 404. If the error does not have a particular - * HTTP code, this property will be undefined. + HTTP code, this property will be undefined. */ statusCode: number; /** * The response included along with the error. If the error does not include a response, - * this property will be undefined. + this property will be undefined. */ response: any; /** * The headers included in the response, represented as an object literal of key/value pairs. - * If the error does not include any headers, this property will be undefined. + If the error does not include any headers, this property will be undefined. */ responseHeaders: any; /** @@ -13862,9 +14276,9 @@ export class RequestErrorEvent { /** * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability - * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position, - * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the - * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired. +to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position, +a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the +number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired. */ export namespace RequestScheduler { /** @@ -13873,16 +14287,16 @@ export namespace RequestScheduler { var maximumRequests: number; /** * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically - * listed in {@link requestsByServer} do not observe this limit. + listed in {@link requestsByServer} do not observe this limit. */ var maximumRequestsPerServer: number; /** * A per server key list of overrides to use for throttling instead of maximumRequestsPerServer * @example * RequestScheduler.requestsByServer = { - * 'api.cesium.com:443': 18, - * 'assets.cesium.com:443': 18 - * }; + 'api.cesium.com:443': 18, + 'assets.cesium.com:443': 18 + }; */ var requestsByServer: any; /** @@ -13947,33 +14361,33 @@ export enum RequestType { * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests. * @example * function refreshTokenRetryCallback(resource, error) { - * if (error.statusCode === 403) { - * // 403 status code means a new token should be generated - * return getNewAccessToken() - * .then(function(token) { - * resource.queryParameters.access_token = token; - * return true; - * }) - * .otherwise(function() { - * return false; - * }); - * } - * - * return false; - * } - * - * var resource = new Resource({ - * url: 'http://server.com/path/to/resource.json', - * proxy: new DefaultProxy('/proxy/'), - * headers: { - * 'X-My-Header': 'valueOfHeader' - * }, - * queryParameters: { - * 'access_token': '123-435-456-000' - * }, - * retryCallback: refreshTokenRetryCallback, - * retryAttempts: 1 - * }); + if (error.statusCode === 403) { + // 403 status code means a new token should be generated + return getNewAccessToken() + .then(function(token) { + resource.queryParameters.access_token = token; + return true; + }) + .otherwise(function() { + return false; + }); + } + + return false; +} + +var resource = new Resource({ + url: 'http://server.com/path/to/resource.json', + proxy: new DefaultProxy('/proxy/'), + headers: { + 'X-My-Header': 'valueOfHeader' + }, + queryParameters: { + 'access_token': '123-435-456-000' + }, + retryCallback: refreshTokenRetryCallback, + retryAttempts: 1 +}); * @param options - A url or an object with the following properties * @param options.url - The url of the resource. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. @@ -14053,7 +14467,7 @@ export class Resource { hasHeaders: boolean; /** * Override Object#toString so that implicit string conversion gives the - * complete URL represented by this Resource. + complete URL represented by this Resource. * @returns The URL represented by this Resource */ toString(): string; @@ -14066,20 +14480,20 @@ export class Resource { getUrlComponent(query?: boolean, proxy?: boolean): string; /** * Combines the specified object and the existing query parameters. This allows you to add many parameters at once, - * as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value. + as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value. * @param params - The query parameters * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined. */ setQueryParameters(params: any, useAsDefault?: boolean): void; /** * Combines the specified object and the existing query parameters. This allows you to add many parameters at once, - * as opposed to adding them one at a time to the queryParameters property. + as opposed to adding them one at a time to the queryParameters property. * @param params - The query parameters */ appendQueryParameters(params: any): void; /** * Combines the specified object and the existing template values. This allows you to add many values at once, - * as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended. + as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended. * @param template - The template values * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined. */ @@ -14127,16 +14541,16 @@ export class Resource { appendForwardSlash(): void; /** * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to - * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * // load a single URL asynchronously - * resource.fetchArrayBuffer().then(function(arrayBuffer) { - * // use the data - * }).otherwise(function(error) { - * // an error occurred - * }); + resource.fetchArrayBuffer().then(function(arrayBuffer) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchArrayBuffer(): Promise | undefined; @@ -14165,16 +14579,16 @@ export class Resource { }): Promise | undefined; /** * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to - * a Blob once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + a Blob once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * // load a single URL asynchronously - * resource.fetchBlob().then(function(blob) { - * // use the data - * }).otherwise(function(error) { - * // an error occurred - * }); + resource.fetchBlob().then(function(blob) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchBlob(): Promise | undefined; @@ -14203,20 +14617,20 @@ export class Resource { }): Promise | undefined; /** * Asynchronously loads the given image resource. Returns a promise that will resolve to - * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an - * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load. + an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an + {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load. * @example * // load a single image asynchronously - * resource.fetchImage().then(function(image) { - * // use the loaded image - * }).otherwise(function(error) { - * // an error occurred - * }); - * - * // load several images in parallel - * when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) { - * // images is an array containing all the loaded images - * }); + resource.fetchImage().then(function(image) { + // use the loaded image + }).otherwise(function(error) { + // an error occurred + }); + + // load several images in parallel + when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) { + // images is an array containing all the loaded images + }); * @param [options] - An object with the following properties. * @param [options.preferBlob = false] - If true, we will load the image via a blob. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an ImageBitmap is returned. @@ -14259,22 +14673,22 @@ export class Resource { }): Promise | Promise | undefined; /** * Asynchronously loads the given resource as text. Returns a promise that will resolve to - * a String once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + a String once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * // load text from a URL, setting a custom header - * var resource = new Resource({ - * url: 'http://someUrl.com/someJson.txt', - * headers: { - * 'X-Custom-Header' : 'some value' - * } - * }); - * resource.fetchText().then(function(text) { - * // Do something with the text - * }).otherwise(function(error) { - * // an error occurred - * }); + var resource = new Resource({ + url: 'http://someUrl.com/someJson.txt', + headers: { + 'X-Custom-Header' : 'some value' + } + }); + resource.fetchText().then(function(text) { + // Do something with the text + }).otherwise(function(error) { + // an error occurred + }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchText(): Promise | undefined; @@ -14303,17 +14717,17 @@ export class Resource { }): Promise | undefined; /** * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to - * a JSON object once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function - * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not - * already specified. + a JSON object once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function + adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not + already specified. * @example * resource.fetchJson().then(function(jsonData) { - * // Do something with the JSON object - * }).otherwise(function(error) { - * // an error occurred - * }); + // Do something with the JSON object + }).otherwise(function(error) { + // an error occurred + }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchJson(): Promise | undefined; @@ -14342,18 +14756,18 @@ export class Resource { }): Promise | undefined; /** * Asynchronously loads the given resource as XML. Returns a promise that will resolve to - * an XML Document once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + an XML Document once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * // load XML from a URL, setting a custom header - * Cesium.loadXML('http://someUrl.com/someXML.xml', { - * 'X-Custom-Header' : 'some value' - * }).then(function(document) { - * // Do something with the document - * }).otherwise(function(error) { - * // an error occurred - * }); + Cesium.loadXML('http://someUrl.com/someXML.xml', { + 'X-Custom-Header' : 'some value' + }).then(function(document) { + // Do something with the document + }).otherwise(function(error) { + // an error occurred + }); * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ fetchXML(): Promise | undefined; @@ -14384,11 +14798,11 @@ export class Resource { * Requests a resource using JSONP. * @example * // load a data asynchronously - * resource.fetchJsonp().then(function(data) { - * // use the loaded data - * }).otherwise(function(error) { - * // an error occurred - * }); + resource.fetchJsonp().then(function(data) { + // use the loaded data + }).otherwise(function(error) { + // an error occurred + }); * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. */ @@ -14420,17 +14834,17 @@ export class Resource { }): Promise | undefined; /** * Asynchronously loads the given resource. Returns a promise that will resolve to - * the result once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use - * the more specific functions eg. fetchJson, fetchBlob, etc. + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use + the more specific functions eg. fetchJson, fetchBlob, etc. * @example * resource.fetch() - * .then(function(body) { - * // use the data - * }).otherwise(function(error) { - * // an error occurred - * }); + .then(function(body) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. @@ -14471,16 +14885,16 @@ export class Resource { }): Promise | undefined; /** * Asynchronously deletes the given resource. Returns a promise that will resolve to - * the result once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.delete() - * .then(function(body) { - * // use the data - * }).otherwise(function(error) { - * // an error occurred - * }); + .then(function(body) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. @@ -14523,16 +14937,16 @@ export class Resource { }): Promise | undefined; /** * Asynchronously gets headers the given resource. Returns a promise that will resolve to - * the result once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.head() - * .then(function(headers) { - * // use the data - * }).otherwise(function(error) { - * // an error occurred - * }); + .then(function(headers) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. @@ -14573,16 +14987,16 @@ export class Resource { }): Promise | undefined; /** * Asynchronously gets options the given resource. Returns a promise that will resolve to - * the result once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.options() - * .then(function(headers) { - * // use the data - * }).otherwise(function(error) { - * // an error occurred - * }); + .then(function(headers) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. * @param [options.headers] - Additional HTTP headers to send with the request, if any. @@ -14623,16 +15037,16 @@ export class Resource { }): Promise | undefined; /** * Asynchronously posts data to the given resource. Returns a promise that will resolve to - * the result once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.post(data) - * .then(function(result) { - * // use the result - * }).otherwise(function(error) { - * // an error occurred - * }); + .then(function(result) { + // use the result + }).otherwise(function(error) { + // an error occurred + }); * @param data - Data that is posted with the resource. * @param [options] - Object with the following properties: * @param [options.data] - Data that is posted with the resource. @@ -14678,16 +15092,16 @@ export class Resource { }): Promise | undefined; /** * Asynchronously puts data to the given resource. Returns a promise that will resolve to - * the result once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.put(data) - * .then(function(result) { - * // use the result - * }).otherwise(function(error) { - * // an error occurred - * }); + .then(function(result) { + // use the result + }).otherwise(function(error) { + // an error occurred + }); * @param data - Data that is posted with the resource. * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. @@ -14731,16 +15145,16 @@ export class Resource { }): Promise | undefined; /** * Asynchronously patches data to the given resource. Returns a promise that will resolve to - * the result once loaded, or reject if the resource failed to load. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. * @example * resource.patch(data) - * .then(function(result) { - * // use the result - * }).otherwise(function(error) { - * // an error occurred - * }); + .then(function(result) { + // use the result + }).otherwise(function(error) { + // an error occurred + }); * @param data - Data that is posted with the resource. * @param [options] - Object with the following properties: * @param [options.responseType] - The type of response. This controls the type of item returned. @@ -14799,12 +15213,12 @@ export namespace Resource { /** * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g., - * out of memory, could not compile shader, etc. If a function may throw this - * exception, the calling code should be prepared to catch it. - *

- * On the other hand, a {@link DeveloperError} indicates an exception due - * to a developer error, e.g., invalid argument, that usually indicates a bug in the - * calling code. +out of memory, could not compile shader, etc. If a function may throw this +exception, the calling code should be prepared to catch it. +

+On the other hand, a {@link DeveloperError} indicates an exception due +to a developer error, e.g., invalid argument, that usually indicates a bug in the +calling code. * @param [message] - The error message for this exception. */ export class RuntimeError extends Error { @@ -14823,9 +15237,62 @@ export class RuntimeError extends Error { readonly stack: string; } +/** + * Initiates a terrain height query for an array of {@link Cartographic} positions by +requesting tiles from a terrain provider, sampling, and interpolating. The interpolation +matches the triangles used to render the terrain at the specified level. The query +happens asynchronously, so this function returns a promise that is resolved when +the query completes. Each point height is modified in place. If a height can not be +determined because no terrain data is available for the specified level at that location, +or another error occurs, the height is set to undefined. As is typical of the +{@link Cartographic} type, the supplied height is a height above the reference ellipsoid +(such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other +words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the +terrain level of detail as input, if you need to get the altitude of the terrain as precisely +as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}. + * @example + * // Query the terrain height of two Cartographic positions +var terrainProvider = Cesium.createWorldTerrain(); +var positions = [ + Cesium.Cartographic.fromDegrees(86.925145, 27.988257), + Cesium.Cartographic.fromDegrees(87.0, 28.0) +]; +var promise = Cesium.sampleTerrain(terrainProvider, 11, positions); +Cesium.when(promise, function(updatedPositions) { + // positions[0].height and positions[1].height have been updated. + // updatedPositions is just a reference to positions. +}); + * @param terrainProvider - The terrain provider from which to query heights. + * @param level - The terrain level-of-detail from which to query terrain heights. + * @param positions - The positions to update with terrain heights. + * @returns A promise that resolves to the provided list of positions when terrain the query has completed. + */ +export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise; + +/** + * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset. + * @example + * // Query the terrain height of two Cartographic positions +var terrainProvider = Cesium.createWorldTerrain(); +var positions = [ + Cesium.Cartographic.fromDegrees(86.925145, 27.988257), + Cesium.Cartographic.fromDegrees(87.0, 28.0) +]; +var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions); +Cesium.when(promise, function(updatedPositions) { + // positions[0].height and positions[1].height have been updated. + // updatedPositions is just a reference to positions. +}); + * @param terrainProvider - The terrain provider from which to query heights. + * @param positions - The positions to update with terrain heights. + * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This + promise will reject if the terrain provider's `availability` property is undefined. + */ +export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise; + /** * Handles user input events. Custom functions can be added to be executed on - * when the user enters input. +when the user enters input. * @param [element = document] - The element to add events to. */ export class ScreenSpaceEventHandler { @@ -14835,14 +15302,14 @@ export class ScreenSpaceEventHandler { * @param action - Function to be executed when the input event occurs. * @param type - The ScreenSpaceEventType of input event. * @param [modifier] - A KeyboardEventModifier key that is held when a type - * event occurs. + event occurs. */ setInputAction(action: (...params: any[]) => any, type: number, modifier?: number): void; /** * Returns the function to be executed on an input event. * @param type - The ScreenSpaceEventType of input event. * @param [modifier] - A KeyboardEventModifier key that is held when a type - * event occurs. + event occurs. * @returns The function to be executed on an input event. */ getInputAction(type: number, modifier?: number): (...params: any[]) => any; @@ -14850,35 +15317,35 @@ export class ScreenSpaceEventHandler { * Removes the function to be executed on an input event. * @param type - The ScreenSpaceEventType of input event. * @param [modifier] - A KeyboardEventModifier key that is held when a type - * event occurs. + event occurs. */ removeInputAction(type: number, modifier?: number): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes listeners held by this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * handler = handler && handler.destroy(); */ destroy(): void; /** * The amount of time, in milliseconds, that mouse events will be disabled after - * receiving any touch events, such that any emulated mouse events will be ignored. + receiving any touch events, such that any emulated mouse events will be ignored. */ static mouseEmulationIgnoreMilliseconds: number; /** * The amount of time, in milliseconds, before a touch on the screen becomes a - * touch and hold. + touch and hold. */ static touchHoldDelayMilliseconds: number; } @@ -14953,18 +15420,18 @@ export enum ScreenSpaceEventType { * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown. * @example * var instance = new Cesium.GeometryInstance({ - * geometry : new Cesium.BoxGeometry({ - * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, - * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0), - * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0) - * }), - * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( - * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), - * id : 'box', - * attributes : { - * show : new Cesium.ShowGeometryInstanceAttribute(false) - * } - * }); + geometry : new Cesium.BoxGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, + minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0), + maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0) + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + id : 'box', + attributes : { + show : new Cesium.ShowGeometryInstanceAttribute(false) + } +}); * @param [show = true] - Determines if the geometry instance will be shown. */ export class ShowGeometryInstanceAttribute { @@ -14975,7 +15442,7 @@ export class ShowGeometryInstanceAttribute { value: Uint8Array; /** * The datatype of each component in the attribute, e.g., individual elements in - * {@link ColorGeometryInstanceAttribute#value}. + {@link ColorGeometryInstanceAttribute#value}. */ readonly componentDatatype: ComponentDatatype; /** @@ -14984,15 +15451,15 @@ export class ShowGeometryInstanceAttribute { readonly componentsPerAttribute: number; /** * When true and componentDatatype is an integer format, - * indicate that the components should be mapped to the range [0, 1] (unsigned) - * or [-1, 1] (signed) when they are accessed as floating-point for rendering. + indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. */ readonly normalize: boolean; /** * Converts a boolean show to a typed array that can be used to assign a show attribute. * @example * var attributes = primitive.getGeometryInstanceAttributes('an id'); - * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show); * @param show - The show value. * @param [result] - The array to store the result in, if undefined a new instance will be created. * @returns The modified result parameter or a new instance if result was undefined. @@ -15002,7 +15469,7 @@ export class ShowGeometryInstanceAttribute { /** * Contains functions for finding the Cartesian coordinates of the sun and the moon in the - * Earth-centered inertial frame. +Earth-centered inertial frame. */ export namespace Simon1994PlanetaryPositions { /** @@ -15023,17 +15490,17 @@ export namespace Simon1994PlanetaryPositions { /** * A description of a polyline modeled as a line strip; the first two positions define a line segment, - * and each additional position defines a line segment from the previous position. +and each additional position defines a line segment from the previous position. * @example * // A polyline with two connected line segments - * var polyline = new Cesium.SimplePolylineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * 0.0, 0.0, - * 5.0, 0.0, - * 5.0, 5.0 - * ]) - * }); - * var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline); +var polyline = new Cesium.SimplePolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0, + 5.0, 5.0 + ]) +}); +var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline); * @param options - Object with the following properties: * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors. @@ -15083,10 +15550,10 @@ export class SimplePolylineGeometry { * A description of a sphere centered at the origin. * @example * var sphere = new Cesium.SphereGeometry({ - * radius : 100.0, - * vertexFormat : Cesium.VertexFormat.POSITION_ONLY - * }); - * var geometry = Cesium.SphereGeometry.createGeometry(sphere); + radius : 100.0, + vertexFormat : Cesium.VertexFormat.POSITION_ONLY +}); +var geometry = Cesium.SphereGeometry.createGeometry(sphere); * @param [options] - Object with the following properties: * @param [options.radius = 1.0] - The radius of the sphere. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks. @@ -15132,11 +15599,11 @@ export class SphereGeometry { * A description of the outline of a sphere. * @example * var sphere = new Cesium.SphereOutlineGeometry({ - * radius : 100.0, - * stackPartitions : 6, - * slicePartitions: 5 - * }); - * var geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere); + radius : 100.0, + stackPartitions : 6, + slicePartitions: 5 +}); +var geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere); * @param [options] - Object with the following properties: * @param [options.radius = 1.0] - The radius of the sphere. * @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines). @@ -15262,7 +15729,7 @@ export class Spherical { /** * Creates a curve parameterized and evaluated by time. This type describes an interface - * and is not intended to be instantiated directly. +and is not intended to be instantiated directly. */ export class Spline { constructor(); @@ -15283,7 +15750,7 @@ export class Spline { evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[]; /** * Finds an index i in times such that the parameter - * time is in the interval [times[i], times[i + 1]]. + time is in the interval [times[i], times[i + 1]]. * @param time - The time. * @param startIndex - The index from which to start the search. * @returns The index for the element at the start of the interval. @@ -15303,47 +15770,54 @@ export class Spline { clampTime(time: number): number; } +/** + * Subdivides an array into a number of smaller, equal sized arrays. + * @param array - The array to divide. + * @param numberOfArrays - The number of arrays to divide the provided array into. + */ +export function subdivideArray(array: any[], numberOfArrays: number): void; + /** * A wrapper around a web worker that allows scheduling tasks for a given worker, - * returning results asynchronously via a promise. - * - * The Worker is not constructed until a task is scheduled. +returning results asynchronously via a promise. + +The Worker is not constructed until a task is scheduled. * @param workerPath - The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder. * @param [maximumActiveTasks = Number.POSITIVE_INFINITY] - The maximum number of active tasks. Once exceeded, - * scheduleTask will not queue any more tasks, allowing - * work to be rescheduled in future frames. + scheduleTask will not queue any more tasks, allowing + work to be rescheduled in future frames. */ export class TaskProcessor { constructor(workerPath: string, maximumActiveTasks?: number); /** * Schedule a task to be processed by the web worker asynchronously. If there are currently more - * tasks active than the maximum set by the constructor, will immediately return undefined. - * Otherwise, returns a promise that will resolve to the result posted back by the worker when - * finished. + tasks active than the maximum set by the constructor, will immediately return undefined. + Otherwise, returns a promise that will resolve to the result posted back by the worker when + finished. * @example * var taskProcessor = new Cesium.TaskProcessor('myWorkerPath'); - * var promise = taskProcessor.scheduleTask({ - * someParameter : true, - * another : 'hello' - * }); - * if (!Cesium.defined(promise)) { - * // too many active tasks - try again later - * } else { - * Cesium.when(promise, function(result) { - * // use the result of the task - * }); - * } + var promise = taskProcessor.scheduleTask({ + someParameter : true, + another : 'hello' + }); + if (!Cesium.defined(promise)) { + // too many active tasks - try again later + } else { + Cesium.when(promise, function(result) { + // use the result of the task + }); + } * @param parameters - Any input data that will be posted to the worker. * @param [transferableObjects] - An array of objects contained in parameters that should be - * transferred to the worker instead of copied. + transferred to the worker instead of copied. * @returns Either a promise that will resolve to the result when available, or undefined - * if there are too many active tasks, + if there are too many active tasks, */ scheduleTask(parameters: any, transferableObjects?: object[]): Promise | undefined; /** * Posts a message to a web worker with configuration to initialize loading - * and compiling a web assembly module asychronously, as well as an optional - * fallback JavaScript module to use if Web Assembly is not supported. + and compiling a web assembly module asychronously, as well as an optional + fallback JavaScript module to use if Web Assembly is not supported. * @param [webAssemblyOptions] - An object with the following properties: * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module. * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file. @@ -15357,24 +15831,24 @@ export class TaskProcessor { }): Promise; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys this object. This will immediately terminate the Worker. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. */ destroy(): void; } /** * Terrain data for a single tile. This type describes an - * interface and is not intended to be instantiated directly. +interface and is not intended to be instantiated directly. */ export class TerrainData { constructor(); @@ -15384,8 +15858,8 @@ export class TerrainData { credits: Credit[]; /** * The water mask included in this terrain data, if any. A water mask is a rectangular - * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. - * Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. */ waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; /** @@ -15394,15 +15868,15 @@ export class TerrainData { * @param longitude - The longitude in radians. * @param latitude - The latitude in radians. * @returns The terrain height at the specified position. If the position - * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly - * incorrect for positions far outside the rectangle. + is outside the rectangle, this method will extrapolate the height, which is likely to be wildly + incorrect for positions far outside the rectangle. */ interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; /** * Determines if a given child tile is available, based on the - * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed - * to be one of the four children of this tile. If non-child tile coordinates are - * given, the availability of the southeast child tile is returned. + {@link TerrainData#childTileMask}. The given child tile coordinates are assumed + to be one of the four children of this tile. If non-child tile coordinates are + given, the availability of the southeast child tile is returned. * @param thisX - The tile X coordinate of this (the parent) tile. * @param thisY - The tile Y coordinate of this (the parent) tile. * @param childX - The tile X coordinate of the child tile to check for availability. @@ -15420,15 +15894,15 @@ export class TerrainData { * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. * @returns A promise for upsampled terrain data for the descendant tile, - * or undefined if too many asynchronous upsample operations are in progress and the request has been - * deferred. + or undefined if too many asynchronous upsample operations are in progress and the request has been + deferred. */ upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise | undefined; /** * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution - * terrain data. If this value is false, the data was obtained from some other source, such - * as by downloading it from a remote server. This method should return true for instances - * returned from a call to {@link TerrainData#upsample}. + terrain data. If this value is false, the data was obtained from some other source, such + as by downloading it from a remote server. This method should return true for instances + returned from a call to {@link TerrainData#upsample}. * @returns True if this instance was created by upsampling; otherwise, false. */ wasCreatedByUpsampling(): boolean; @@ -15436,26 +15910,26 @@ export class TerrainData { /** * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is - * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an - * interface and is not intended to be instantiated directly. +organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an +interface and is not intended to be instantiated directly. */ export class TerrainProvider { constructor(); /** * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ errorEvent: Event; /** * Gets the credit to display when this terrain provider is active. Typically this is used to credit - * the source of the terrain. This function should - * not be called before {@link TerrainProvider#ready} returns true. + the source of the terrain. This function should + not be called before {@link TerrainProvider#ready} returns true. */ credit: Credit; /** * Gets the tiling scheme used by the provider. This function should - * not be called before {@link TerrainProvider#ready} returns true. + not be called before {@link TerrainProvider#ready} returns true. */ tilingScheme: TilingScheme; /** @@ -15468,28 +15942,28 @@ export class TerrainProvider { readonly readyPromise: Promise; /** * Gets a value indicating whether or not the provider includes a water mask. The water mask - * indicates which areas of the globe are water rather than land, so they can be rendered - * as a reflective surface with animated waves. This function should not be - * called before {@link TerrainProvider#ready} returns true. + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link TerrainProvider#ready} returns true. */ hasWaterMask: boolean; /** * Gets a value indicating whether or not the requested tiles include vertex normals. - * This function should not be called before {@link TerrainProvider#ready} returns true. + This function should not be called before {@link TerrainProvider#ready} returns true. */ hasVertexNormals: boolean; /** * Gets an object that can be used to determine availability of terrain from this provider, such as - * at points and in rectangles. This function should not be called before - * {@link TerrainProvider#ready} returns true. This property may be undefined if availability - * information is not available. + at points and in rectangles. This function should not be called before + {@link TerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. */ availability: TileAvailability; /** * Gets a list of indices for a triangle mesh representing a regular grid. Calling - * this function multiple times with the same grid width and height returns the - * same list of indices. The total number of vertices must be less than or equal - * to 65536. + this function multiple times with the same grid width and height returns the + same list of indices. The total number of vertices must be less than or equal + to 65536. * @param width - The number of vertices in the regular grid in the horizontal direction. * @param height - The number of vertices in the regular grid in the vertical direction. * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less. @@ -15497,10 +15971,10 @@ export class TerrainProvider { static getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array; /** * Specifies the quality of terrain created from heightmaps. A value of 1.0 will - * ensure that adjacent heightmap vertices are separated by no more than - * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly. - * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the - * screen pixels between adjacent heightmap vertices and thus rendering more quickly. + ensure that adjacent heightmap vertices are separated by no more than + {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly. + A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the + screen pixels between adjacent heightmap vertices and thus rendering more quickly. */ static heightmapTerrainQuality: number; /** @@ -15513,20 +15987,20 @@ export class TerrainProvider { static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number; /** * Requests the geometry for a given tile. This function should not be called before - * {@link TerrainProvider#ready} returns true. The result must include terrain data and - * may optionally include a water mask and an indication of which child tiles are available. + {@link TerrainProvider#ready} returns true. The result must include terrain data and + may optionally include a water mask and an indication of which child tiles are available. * @param x - The X coordinate of the tile for which to request geometry. * @param y - The Y coordinate of the tile for which to request geometry. * @param level - The level of the tile for which to request geometry. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the requested geometry. If this method - * returns undefined instead of a promise, it is an indication that too many requests are already - * pending and the request will be retried later. + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. */ requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Gets the maximum geometric error allowed in a tile at a given level. This function should not be - * called before {@link TerrainProvider#ready} returns true. + called before {@link TerrainProvider#ready} returns true. * @param level - The tile level for which to get the maximum geometric error. * @returns The maximum geometric error. */ @@ -15558,7 +16032,7 @@ export class TileAvailability { constructor(tilingScheme: TilingScheme, maximumLevel: number); /** * Marks a rectangular range of tiles in a particular level as being available. For best performance, - * add your ranges in order of increasing level. + add your ranges in order of increasing level. * @param level - The level. * @param startX - The X coordinate of the first available tiles at the level. * @param startY - The Y coordinate of the first available tiles at the level. @@ -15568,18 +16042,18 @@ export class TileAvailability { addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void; /** * Determines the level of the most detailed tile covering the position. This function - * usually completes in time logarithmic to the number of rectangles added with - * {@link TileAvailability#addAvailableTileRange}. + usually completes in time logarithmic to the number of rectangles added with + {@link TileAvailability#addAvailableTileRange}. * @param position - The position for which to determine the maximum available level. The height component is ignored. * @returns The level of the most detailed tile covering the position. */ computeMaximumLevelAtPosition(position: Cartographic): number; /** * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed - * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this - * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function - * usually completes in time logarithmic to the number of rectangles added with - * {@link TileAvailability#addAvailableTileRange}. + tiles may be available in parts of the rectangle, but not the whole thing. The return value of this + function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function + usually completes in time logarithmic to the number of rectangles added with + {@link TileAvailability#addAvailableTileRange}. * @param rectangle - The rectangle. * @returns The best available level for the entire rectangle. */ @@ -15594,15 +16068,15 @@ export class TileAvailability { isTileAvailable(level: number, x: number, y: number): boolean; /** * Computes a bit mask indicating which of a tile's four children exist. - * If a child's bit is set, a tile is available for that child. If it is cleared, - * the tile is not available. The bit values are as follows: - * - * - * - * - * - * - *
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
+ If a child's bit is set, a tile is available for that child. If it is cleared, + the tile is not available. The bit values are as follows: + + + + + + +
Bit PositionBit ValueChild Tile
01Southwest
12Southeast
24Northwest
38Northeast
* @param level - The level of the parent tile. * @param x - The X coordinate of the parent tile. * @param y - The Y coordinate of the parent tile. @@ -15616,11 +16090,11 @@ export class TileAvailability { * @param provider - The imagery or terrain provider that experienced the error. * @param message - A message describing the error. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error - * is not specific to a particular tile. + is not specific to a particular tile. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error - * is not specific to a particular tile. + is not specific to a particular tile. * @param [level] - The level of the tile that experienced the error, or undefined if the error - * is not specific to a particular tile. + is not specific to a particular tile. * @param [timesRetried = 0] - The number of times this operation has been retried. * @param [error] - The error or exception that occurred, if any. */ @@ -15636,17 +16110,17 @@ export class TileProviderError { message: string; /** * The X coordinate of the tile that experienced the error. If the error is not specific - * to a particular tile, this property will be undefined. + to a particular tile, this property will be undefined. */ x: number; /** * The Y coordinate of the tile that experienced the error. If the error is not specific - * to a particular tile, this property will be undefined. + to a particular tile, this property will be undefined. */ y: number; /** * The level-of-detail of the tile that experienced the error. If the error is not specific - * to a particular tile, this property will be undefined. + to a particular tile, this property will be undefined. */ level: number; /** @@ -15655,8 +16129,8 @@ export class TileProviderError { timesRetried: number; /** * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider - * will set the initial value of this property before raising the event, but any listeners - * can change it. The value after the last listener is invoked will be acted upon. + will set the initial value of this property before raising the event, but any listeners + can change it. The value after the last listener is invoked will be acted upon. */ retry: boolean; /** @@ -15665,34 +16139,34 @@ export class TileProviderError { error: Error; /** * Handles an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by - * logging the error to the console if the event has no listeners. This method also tracks the number - * of times the operation has been retried and will automatically retry if requested to do so by the - * event listeners. + logging the error to the console if the event has no listeners. This method also tracks the number + of times the operation has been retried and will automatically retry if requested to do so by the + event listeners. * @param previousError - The error instance returned by this function the last - * time it was called for this error, or undefined if this is the first time this error has - * occurred. + time it was called for this error, or undefined if this is the first time this error has + occurred. * @param provider - The imagery or terrain provider that encountered the error. * @param event - The event to raise to inform listeners of the error. * @param message - The message describing the error. * @param x - The X coordinate of the tile that experienced the error, or undefined if the - * error is not specific to a particular tile. + error is not specific to a particular tile. * @param y - The Y coordinate of the tile that experienced the error, or undefined if the - * error is not specific to a particular tile. + error is not specific to a particular tile. * @param level - The level-of-detail of the tile that experienced the error, or undefined if the - * error is not specific to a particular tile. + error is not specific to a particular tile. * @param retryFunction - The function to call to retry the operation. If undefined, the - * operation will not be retried. + operation will not be retried. * @param [errorDetails] - The error or exception that occurred, if any. * @returns The error instance that was passed to the event listeners and that - * should be passed to this function the next time it is called for the same error in order - * to track retry counts. + should be passed to this function the next time it is called for the same error in order + to track retry counts. */ static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError; /** * Handles success of an operation by resetting the retry count of a previous error, if any. This way, - * if the error occurs again in the future, the listeners will be informed that it has not yet been retried. + if the error occurs again in the future, the listeners will be informed that it has not yet been retried. * @param previousError - The previous error, or undefined if this operation has - * not previously resulted in an error. + not previously resulted in an error. */ static handleSuccess(previousError: TileProviderError): void; } @@ -15706,10 +16180,10 @@ export namespace TileProviderError { /** * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero, - * the coarsest, least-detailed level, the number of tiles is configurable. - * At level of detail one, each of the level zero tiles has four children, two in each direction. - * At level of detail two, each of the level one tiles has four children, two in each direction. - * This continues for as many levels as are present in the geometry or imagery source. +the coarsest, least-detailed level, the number of tiles is configurable. +At level of detail one, each of the level zero tiles has four children, two in each direction. +At level of detail two, each of the level one tiles has four children, two in each direction. +This continues for as many levels as are present in the geometry or imagery source. */ export class TilingScheme { constructor(); @@ -15739,24 +16213,24 @@ export class TilingScheme { getNumberOfYTilesAtLevel(level: number): number; /** * Transforms a rectangle specified in geodetic radians to the native coordinate system - * of this tiling scheme. + of this tiling scheme. * @param rectangle - The rectangle to transform. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the native rectangle if 'result' - * is undefined. + is undefined. */ rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates - * of the tiling scheme. + of the tiling scheme. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the rectangle - * if 'result' is undefined. + if 'result' is undefined. */ tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; /** @@ -15765,63 +16239,63 @@ export class TilingScheme { * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the rectangle - * if 'result' is undefined. + if 'result' is undefined. */ tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; /** * Calculates the tile x, y coordinates of the tile containing - * a given cartographic position. + a given cartographic position. * @param position - The position. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the tile x, y coordinates - * if 'result' is undefined. + if 'result' is undefined. */ positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; } /** * An interval defined by a start and a stop time; optionally including those times as part of the interval. - * Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}. +Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}. * @example * // Create an instance that spans August 1st, 1980 and is associated - * // with a Cartesian position. - * var timeInterval = new Cesium.TimeInterval({ - * start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'), - * stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'), - * isStartIncluded : true, - * isStopIncluded : false, - * data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082) - * }); +// with a Cartesian position. +var timeInterval = new Cesium.TimeInterval({ + start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'), + stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'), + isStartIncluded : true, + isStopIncluded : false, + data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082) +}); * @example * // Create two instances from ISO 8601 intervals with associated numeric data - * // then compute their intersection, summing the data they contain. - * var left = Cesium.TimeInterval.fromIso8601({ - * iso8601 : '2000/2010', - * data : 2 - * }); - * - * var right = Cesium.TimeInterval.fromIso8601({ - * iso8601 : '1995/2005', - * data : 3 - * }); - * - * //The result of the below intersection will be an interval equivalent to - * //var intersection = Cesium.TimeInterval.fromIso8601({ - * // iso8601 : '2000/2005', - * // data : 5 - * //}); - * var intersection = new Cesium.TimeInterval(); - * Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) { - * return leftData + rightData; - * }); +// then compute their intersection, summing the data they contain. +var left = Cesium.TimeInterval.fromIso8601({ + iso8601 : '2000/2010', + data : 2 +}); + +var right = Cesium.TimeInterval.fromIso8601({ + iso8601 : '1995/2005', + data : 3 +}); + +//The result of the below intersection will be an interval equivalent to +//var intersection = Cesium.TimeInterval.fromIso8601({ +// iso8601 : '2000/2005', +// data : 5 +//}); +var intersection = new Cesium.TimeInterval(); +Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) { + return leftData + rightData; +}); * @example * // Check if an interval contains a specific time. - * var dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z'); - * var containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck); +var dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z'); +var containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck); * @param [options] - Object with the following properties: * @param [options.start = new JulianDate()] - The start time of the interval. * @param [options.stop = new JulianDate()] - The stop time of the interval. @@ -15901,9 +16375,9 @@ export class TimeInterval { static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean; /** * Compares two instances and returns true if they are within epsilon seconds of - * each other. That is, in order for the dates to be considered equal (and for - * this function to return true), the absolute value of the difference between them, in - * seconds, must be less than epsilon. + each other. That is, in order for the dates to be considered equal (and for + this function to return true), the absolute value of the difference between them, in + seconds, must be less than epsilon. * @param [left] - The first instance. * @param [right] - The second instance. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances. @@ -15935,7 +16409,7 @@ export class TimeInterval { clone(result?: TimeInterval): TimeInterval; /** * Compares this instance against the provided instance componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side interval. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns true if they are equal, false otherwise. @@ -15943,8 +16417,8 @@ export class TimeInterval { equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean; /** * Compares this instance against the provided instance componentwise and returns - * true if they are within the provided epsilon, - * false otherwise. + true if they are within the provided epsilon, + false otherwise. * @param [right] - The right hand side interval. * @param [epsilon = 0] - The epsilon to use for equality testing. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. @@ -16013,7 +16487,7 @@ export class TimeIntervalCollection { readonly isEmpty: boolean; /** * Compares this instance against the provided instance componentwise and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side collection. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. * @returns true if they are equal, false otherwise. @@ -16051,14 +16525,14 @@ export class TimeIntervalCollection { * Finds and returns the index of the interval in the collection that contains the specified date. * @param date - The date to search for. * @returns The index of the interval that contains the specified date, if no such interval exists, - * it returns a negative number which is the bitwise complement of the index of the next interval that - * starts after the date, or if no interval starts after the specified date, the bitwise complement of - * the length of the collection. + it returns a negative number which is the bitwise complement of the index of the next interval that + starts after the date, or if no interval starts after the specified date, the bitwise complement of + the length of the collection. */ indexOf(date: JulianDate): number; /** * Returns the first interval in the collection that matches the specified parameters. - * All parameters are optional and undefined parameters are treated as a don't care condition. + All parameters are optional and undefined parameters are treated as a don't care condition. * @param [options] - Object with the following properties: * @param [options.start] - The start time of the interval. * @param [options.stop] - The stop time of the interval. @@ -16074,15 +16548,15 @@ export class TimeIntervalCollection { }): TimeInterval | undefined; /** * Adds an interval to the collection, merging intervals that contain the same data and - * splitting intervals of different data as needed in order to maintain a non-overlapping collection. - * The data in the new interval takes precedence over any existing intervals in the collection. + splitting intervals of different data as needed in order to maintain a non-overlapping collection. + The data in the new interval takes precedence over any existing intervals in the collection. * @param interval - The interval to add. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. */ addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void; /** * Removes the specified interval from this interval collection, creating a hole over the specified interval. - * The data property of the input interval is ignored. + The data property of the input interval is ignored. * @param interval - The interval to remove. * @returns true if the interval was removed, false if no part of the interval was in the collection. */ @@ -16187,15 +16661,15 @@ export class TimeIntervalCollection { export enum TimeStandard { /** * Represents the coordinated Universal Time (UTC) time standard. - * - * UTC is related to TAI according to the relationship - * UTC = TAI - deltaT where deltaT is the number of leap - * seconds which have been introduced as of the time in TAI. + + UTC is related to TAI according to the relationship + UTC = TAI - deltaT where deltaT is the number of leap + seconds which have been introduced as of the time in TAI. */ UTC = 0, /** * Represents the International Atomic Time (TAI) time standard. - * TAI is the principal time standard to which the other time standards are related. + TAI is the principal time standard to which the other time standards are related. */ TAI = 1 } @@ -16206,18 +16680,18 @@ export enum TimeStandard { export namespace Transforms { /** * Generates a function that computes a 4x4 transformation matrix from a reference frame - * centered at the provided origin to the provided ellipsoid's fixed reference frame. + centered at the provided origin to the provided ellipsoid's fixed reference frame. * @param firstAxis - name of the first axis of the local reference frame. Must be - * 'east', 'north', 'up', 'west', 'south' or 'down'. + 'east', 'north', 'up', 'west', 'south' or 'down'. * @param secondAxis - name of the second axis of the local reference frame. Must be - * 'east', 'north', 'up', 'west', 'south' or 'down'. + 'east', 'north', 'up', 'west', 'south' or 'down'. * @returns The function that will computes a - * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters, + 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters, */ function localFrameToFixedFrameGenerator(firstAxis: string, secondAxis: string): Transforms.LocalFrameToFixedFrame; /** * Computes a 4x4 transformation matrix from a reference frame - * centered at the provided origin to the provided ellipsoid's fixed reference frame. + centered at the provided origin to the provided ellipsoid's fixed reference frame. * @param origin - The center point of the local reference frame. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. * @param [result] - The object onto which to store the result. @@ -16225,17 +16699,17 @@ export namespace Transforms { type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4; /** * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes - * centered at the provided origin to the provided ellipsoid's fixed reference frame. - * The local axes are defined as: - *
    - *
  • The x axis points in the local east direction.
  • - *
  • The y axis points in the local north direction.
  • - *
  • The z axis points in the direction of the ellipsoid surface normal which passes through the position.
  • - *
+ centered at the provided origin to the provided ellipsoid's fixed reference frame. + The local axes are defined as: +
    +
  • The x axis points in the local east direction.
  • +
  • The y axis points in the local north direction.
  • +
  • The z axis points in the direction of the ellipsoid surface normal which passes through the position.
  • +
* @example * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame. - * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center); + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center); * @param origin - The center point of the local reference frame. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. * @param [result] - The object onto which to store the result. @@ -16244,17 +16718,17 @@ export namespace Transforms { function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; /** * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes - * centered at the provided origin to the provided ellipsoid's fixed reference frame. - * The local axes are defined as: - *
    - *
  • The x axis points in the local north direction.
  • - *
  • The y axis points in the local east direction.
  • - *
  • The z axis points in the opposite direction of the ellipsoid surface normal which passes through the position.
  • - *
+ centered at the provided origin to the provided ellipsoid's fixed reference frame. + The local axes are defined as: +
    +
  • The x axis points in the local north direction.
  • +
  • The y axis points in the local east direction.
  • +
  • The z axis points in the opposite direction of the ellipsoid surface normal which passes through the position.
  • +
* @example * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame. - * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var transform = Cesium.Transforms.northEastDownToFixedFrame(center); + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var transform = Cesium.Transforms.northEastDownToFixedFrame(center); * @param origin - The center point of the local reference frame. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. * @param [result] - The object onto which to store the result. @@ -16263,17 +16737,17 @@ export namespace Transforms { function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; /** * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes - * centered at the provided origin to the provided ellipsoid's fixed reference frame. - * The local axes are defined as: - *
    - *
  • The x axis points in the local north direction.
  • - *
  • The y axis points in the direction of the ellipsoid surface normal which passes through the position.
  • - *
  • The z axis points in the local east direction.
  • - *
+ centered at the provided origin to the provided ellipsoid's fixed reference frame. + The local axes are defined as: +
    +
  • The x axis points in the local north direction.
  • +
  • The y axis points in the direction of the ellipsoid surface normal which passes through the position.
  • +
  • The z axis points in the local east direction.
  • +
* @example * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame. - * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var transform = Cesium.Transforms.northUpEastToFixedFrame(center); + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var transform = Cesium.Transforms.northUpEastToFixedFrame(center); * @param origin - The center point of the local reference frame. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. * @param [result] - The object onto which to store the result. @@ -16282,17 +16756,17 @@ export namespace Transforms { function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; /** * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes - * centered at the provided origin to the provided ellipsoid's fixed reference frame. - * The local axes are defined as: - *
    - *
  • The x axis points in the local north direction.
  • - *
  • The y axis points in the local west direction.
  • - *
  • The z axis points in the direction of the ellipsoid surface normal which passes through the position.
  • - *
+ centered at the provided origin to the provided ellipsoid's fixed reference frame. + The local axes are defined as: +
    +
  • The x axis points in the local north direction.
  • +
  • The y axis points in the local west direction.
  • +
  • The z axis points in the direction of the ellipsoid surface normal which passes through the position.
  • +
* @example * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame. - * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var transform = Cesium.Transforms.northWestUpToFixedFrame(center); + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var transform = Cesium.Transforms.northWestUpToFixedFrame(center); * @param origin - The center point of the local reference frame. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. * @param [result] - The object onto which to store the result. @@ -16301,73 +16775,73 @@ export namespace Transforms { function northWestUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; /** * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles - * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north - * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles - * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. + centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north + direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles + are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. * @example * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame. - * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var heading = -Cesium.Math.PI_OVER_TWO; - * var pitch = Cesium.Math.PI_OVER_FOUR; - * var roll = 0.0; - * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); - * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var heading = -Cesium.Math.PI_OVER_TWO; + var pitch = Cesium.Math.PI_OVER_FOUR; + var roll = 0.0; + var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); + var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); * @param origin - The center point of the local reference frame. * @param headingPitchRoll - The heading, pitch, and roll. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation - * matrix from a reference frame to the provided ellipsoid's fixed reference frame + matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Matrix4 instance if none was provided. */ function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Matrix4): Matrix4; /** * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles - * centered at the provided origin. Heading is the rotation from the local north - * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles - * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. + centered at the provided origin. Heading is the rotation from the local north + direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles + are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. * @example * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame. - * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var heading = -Cesium.Math.PI_OVER_TWO; - * var pitch = Cesium.Math.PI_OVER_FOUR; - * var roll = 0.0; - * var hpr = new HeadingPitchRoll(heading, pitch, roll); - * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var heading = -Cesium.Math.PI_OVER_TWO; + var pitch = Cesium.Math.PI_OVER_FOUR; + var roll = 0.0; + var hpr = new HeadingPitchRoll(heading, pitch, roll); + var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); * @param origin - The center point of the local reference frame. * @param headingPitchRoll - The heading, pitch, and roll. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation - * matrix from a reference frame to the provided ellipsoid's fixed reference frame + matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Quaternion instance if none was provided. */ function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Quaternion): Quaternion; /** * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north - * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles - * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. + direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles + are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. * @param transform - The transform * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation - * matrix from a reference frame to the provided ellipsoid's fixed reference frame + matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new HeadingPitchRoll instance if none was provided. */ function fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: HeadingPitchRoll): HeadingPitchRoll; /** * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the - * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC. + pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC. * @example * //Set the view to the inertial frame. - * scene.postUpdate.addEventListener(function(scene, time) { - * var now = Cesium.JulianDate.now(); - * var offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3()); - * var transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now)); - * var inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4()); - * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset); - * camera.lookAtTransform(transform, offset); - * }); + scene.postUpdate.addEventListener(function(scene, time) { + var now = Cesium.JulianDate.now(); + var offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3()); + var transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now)); + var inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4()); + Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset); + camera.lookAtTransform(transform, offset); + }); * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Matrix3 instance if none was provided. @@ -16375,60 +16849,60 @@ export namespace Transforms { function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; /** * Preloads the data necessary to transform between the ICRF and Fixed axes, in either - * direction, over a given interval. This function returns a promise that, when resolved, - * indicates that the preload has completed. + direction, over a given interval. This function returns a promise that, when resolved, + indicates that the preload has completed. * @example * var interval = new Cesium.TimeInterval(...); - * when(Cesium.Transforms.preloadIcrfFixed(interval), function() { - * // the data is now loaded - * }); + when(Cesium.Transforms.preloadIcrfFixed(interval), function() { + // the data is now loaded + }); * @param timeInterval - The interval to preload. * @returns A promise that, when resolved, indicates that the preload has completed - * and evaluation of the transformation between the fixed and ICRF axes will - * no longer return undefined for a time inside the interval. + and evaluation of the transformation between the fixed and ICRF axes will + no longer return undefined for a time inside the interval. */ function preloadIcrfFixed(timeInterval: TimeInterval): Promise; /** * Computes a rotation matrix to transform a point or vector from the International Celestial - * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF) - * at a given time. This function may return undefined if the data necessary to - * do the transformation is not yet loaded. + Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF) + at a given time. This function may return undefined if the data necessary to + do the transformation is not yet loaded. * @example * scene.postUpdate.addEventListener(function(scene, time) { - * // View in ICRF. - * var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time); - * if (Cesium.defined(icrfToFixed)) { - * var offset = Cesium.Cartesian3.clone(camera.position); - * var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed); - * camera.lookAtTransform(transform, offset); - * } - * }); + // View in ICRF. + var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time); + if (Cesium.defined(icrfToFixed)) { + var offset = Cesium.Cartesian3.clone(camera.position); + var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed); + camera.lookAtTransform(transform, offset); + } + }); * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. If this parameter is - * not specified, a new instance is created and returned. + not specified, a new instance is created and returned. * @returns The rotation matrix, or undefined if the data necessary to do the - * transformation is not yet loaded. + transformation is not yet loaded. */ function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; /** * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF) - * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes - * at a given time. This function may return undefined if the data necessary to - * do the transformation is not yet loaded. + to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes + at a given time. This function may return undefined if the data necessary to + do the transformation is not yet loaded. * @example * // Transform a point from the ICRF axes to the Fixed axes. - * var now = Cesium.JulianDate.now(); - * var pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now); - * var pointInInertial = new Cesium.Cartesian3(); - * if (Cesium.defined(fixedToIcrf)) { - * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial); - * } + var now = Cesium.JulianDate.now(); + var pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now); + var pointInInertial = new Cesium.Cartesian3(); + if (Cesium.defined(fixedToIcrf)) { + pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial); + } * @param date - The time at which to compute the rotation matrix. * @param [result] - The object onto which to store the result. If this parameter is - * not specified, a new instance is created and returned. + not specified, a new instance is created and returned. * @returns The rotation matrix, or undefined if the data necessary to do the - * transformation is not yet loaded. + transformation is not yet loaded. */ function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3; /** @@ -16473,7 +16947,7 @@ export class TranslationRotationScale { scale: Cartesian3; /** * Compares this instance against the provided instance and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [right] - The right hand side TranslationRotationScale. * @returns true if they are equal, false otherwise. */ @@ -16482,24 +16956,24 @@ export class TranslationRotationScale { /** * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve - * a system of linear equations where the coefficient matrix is a tridiagonal matrix. +a system of linear equations where the coefficient matrix is a tridiagonal matrix. */ export namespace TridiagonalSystemSolver { /** * Solves a tridiagonal system of linear equations. * @example * var lowerDiagonal = [1.0, 1.0, 1.0, 1.0]; - * var diagonal = [2.0, 4.0, 4.0, 4.0, 2.0]; - * var upperDiagonal = [1.0, 1.0, 1.0, 1.0]; - * var rightHandSide = [ - * new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0), - * new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0), - * new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0), - * new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0), - * new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0) - * ]; - * - * var solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide); + var diagonal = [2.0, 4.0, 4.0, 4.0, 2.0]; + var upperDiagonal = [1.0, 1.0, 1.0, 1.0]; + var rightHandSide = [ + new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0), + new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0), + new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0), + new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0), + new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0) + ]; + + var solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide); * @param diagonal - An array with length n that contains the diagonal of the coefficient matrix. * @param lower - An array with length n - 1 that contains the lower diagonal of the coefficient matrix. * @param upper - An array with length n - 1 that contains the upper diagonal of the coefficient matrix. @@ -16511,14 +16985,14 @@ export namespace TridiagonalSystemSolver { /** * A singleton that contains all of the servers that are trusted. Credentials will be sent with - * any requests to these servers. +any requests to these servers. */ export namespace TrustedServers { /** * Adds a trusted server to the registry * @example * // Add a trusted server - * TrustedServers.add('my.server.com', 80); + TrustedServers.add('my.server.com', 80); * @param host - The host to be added. * @param port - The port used to access the host. */ @@ -16527,7 +17001,7 @@ export namespace TrustedServers { * Removes a trusted server from the registry * @example * // Remove a trusted server - * TrustedServers.remove('my.server.com', 80); + TrustedServers.remove('my.server.com', 80); * @param host - The host to be removed. * @param port - The port used to access the host. */ @@ -16536,15 +17010,15 @@ export namespace TrustedServers { * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url. * @example * // Add server - * TrustedServers.add('my.server.com', 81); - * - * // Check if server is trusted - * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) { - * // my.server.com:81 is trusted - * } - * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) { - * // my.server.com isn't trusted - * } + TrustedServers.add('my.server.com', 81); + + // Check if server is trusted + if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) { + // my.server.com:81 is trusted + } + if (TrustedServers.contains('https://my.server.com/path/to/file.png')) { + // my.server.com isn't trusted + } * @param url - The url to be tested against the trusted list * @returns Returns true if url is trusted, false otherwise. */ @@ -16553,165 +17027,65 @@ export namespace TrustedServers { * Clears the registry * @example * // Remove a trusted server - * TrustedServers.clear(); + TrustedServers.clear(); */ function clear(): void; } -/** - * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps - * retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}. - * @example - * var terrainProvider = new Cesium.VRTheWorldTerrainProvider({ - * url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/' - * }); - * viewer.terrainProvider = terrainProvider; - * @param options - Object with the following properties: - * @param options.url - The URL of the VR-TheWorld TileMap. - * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid. If this parameter is not - * specified, the WGS84 ellipsoid is used. - * @param [options.credit] - A credit for the data source, which is displayed on the canvas. - */ -export class VRTheWorldTerrainProvider { - constructor(options: { - url: Resource | string; - ellipsoid?: Ellipsoid; - credit?: Credit | string; - }); - /** - * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. - */ - errorEvent: Event; - /** - * Gets the credit to display when this terrain provider is active. Typically this is used to credit - * the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true. - */ - credit: Credit; - /** - * Gets the tiling scheme used by this provider. This function should - * not be called before {@link VRTheWorldTerrainProvider#ready} returns true. - */ - tilingScheme: GeographicTilingScheme; - /** - * Gets a value indicating whether or not the provider is ready for use. - */ - ready: boolean; - /** - * Gets a promise that resolves to true when the provider is ready for use. - */ - readonly readyPromise: Promise; - /** - * Gets a value indicating whether or not the provider includes a water mask. The water mask - * indicates which areas of the globe are water rather than land, so they can be rendered - * as a reflective surface with animated waves. This function should not be - * called before {@link VRTheWorldTerrainProvider#ready} returns true. - */ - hasWaterMask: boolean; - /** - * Gets a value indicating whether or not the requested tiles include vertex normals. - * This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true. - */ - hasVertexNormals: boolean; - /** - * Gets an object that can be used to determine availability of terrain from this provider, such as - * at points and in rectangles. This function should not be called before - * {@link TerrainProvider#ready} returns true. This property may be undefined if availability - * information is not available. - */ - availability: TileAvailability; - /** - * Requests the geometry for a given tile. This function should not be called before - * {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain - * data and indicates that all child tiles are available. - * @param x - The X coordinate of the tile for which to request geometry. - * @param y - The Y coordinate of the tile for which to request geometry. - * @param level - The level of the tile for which to request geometry. - * @param [request] - The request object. Intended for internal use only. - * @returns A promise for the requested geometry. If this method - * returns undefined instead of a promise, it is an indication that too many requests are already - * pending and the request will be retried later. - */ - requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; - /** - * Gets the maximum geometric error allowed in a tile at a given level. - * @param level - The tile level for which to get the maximum geometric error. - * @returns The maximum geometric error. - */ - getLevelMaximumGeometricError(level: number): number; - /** - * Determines whether data for a tile is available to be loaded. - * @param x - The X coordinate of the tile for which to request geometry. - * @param y - The Y coordinate of the tile for which to request geometry. - * @param level - The level of the tile for which to request geometry. - * @returns Undefined if not supported, otherwise true or false. - */ - getTileDataAvailable(x: number, y: number, level: number): boolean; - /** - * Makes sure we load availability data for a tile - * @param x - The X coordinate of the tile for which to request geometry. - * @param y - The Y coordinate of the tile for which to request geometry. - * @param level - The level of the tile for which to request geometry. - * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded - */ - loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise; -} - /** * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided - * to a {@link Geometry} to request that certain properties be computed, e.g., just position, - * position and normal, etc. +to a {@link Geometry} to request that certain properties be computed, e.g., just position, +position and normal, etc. * @example * // Create a vertex format with position and 2D texture coordinate attributes. - * var format = new Cesium.VertexFormat({ - * position : true, - * st : true - * }); +var format = new Cesium.VertexFormat({ + position : true, + st : true +}); * @param [options] - An object with boolean properties corresponding to VertexFormat properties as shown in the code example. */ export class VertexFormat { constructor(options?: any); /** * When true, the vertex has a 3D position attribute. - *

- * 64-bit floating-point (for precision). 3 components per attribute. - *

+

+ 64-bit floating-point (for precision). 3 components per attribute. +

*/ position: boolean; /** * When true, the vertex has a normal attribute (normalized), which is commonly used for lighting. - *

- * 32-bit floating-point. 3 components per attribute. - *

+

+ 32-bit floating-point. 3 components per attribute. +

*/ normal: boolean; /** * When true, the vertex has a 2D texture coordinate attribute. - *

- * 32-bit floating-point. 2 components per attribute - *

+

+ 32-bit floating-point. 2 components per attribute +

*/ st: boolean; /** * When true, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. - *

- * 32-bit floating-point. 3 components per attribute. - *

+

+ 32-bit floating-point. 3 components per attribute. +

*/ bitangent: boolean; /** * When true, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. - *

- * 32-bit floating-point. 3 components per attribute. - *

+

+ 32-bit floating-point. 3 components per attribute. +

*/ tangent: boolean; /** * When true, the vertex has an RGB color attribute. - *

- * 8-bit unsigned byte. 3 components per attribute. - *

+

+ 8-bit unsigned byte. 3 components per attribute. +

*/ color: boolean; /** @@ -16720,18 +17094,18 @@ export class VertexFormat { static readonly POSITION_ONLY: VertexFormat; /** * An immutable vertex format with position and normal attributes. - * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}. + This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}. */ static readonly POSITION_AND_NORMAL: VertexFormat; /** * An immutable vertex format with position, normal, and st attributes. - * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport} - * is TEXTURED/code>. + This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport} + is TEXTURED/code>. */ static readonly POSITION_NORMAL_AND_ST: VertexFormat; /** * An immutable vertex format with position and st attributes. - * This is compatible with {@link EllipsoidSurfaceAppearance}. + This is compatible with {@link EllipsoidSurfaceAppearance}. */ static readonly POSITION_AND_ST: VertexFormat; /** @@ -16744,9 +17118,9 @@ export class VertexFormat { static readonly ALL: VertexFormat; /** * An immutable vertex format with position, normal, and st attributes. - * This is compatible with most appearances and materials; however - * normal and st attributes are not always required. When this is - * known in advance, another VertexFormat should be used. + This is compatible with most appearances and materials; however + normal and st attributes are not always required. When this is + known in advance, another VertexFormat should be used. */ static readonly DEFAULT: VertexFormat; /** @@ -16799,10 +17173,10 @@ export class VideoSynchronizer { epoch: JulianDate; /** * Gets or sets the amount of time in seconds the video's currentTime - * and the clock's currentTime can diverge before a video seek is performed. - * Lower values make the synchronization more accurate but video - * performance might suffer. Higher values provide better performance - * but at the cost of accuracy. + and the clock's currentTime can diverge before a video seek is performed. + Lower values make the synchronization more accurate but video + performance might suffer. Higher values provide better performance + but at the cost of accuracy. */ tolerance: number; /** @@ -16826,9 +17200,9 @@ export class VideoSynchronizer { /** * This enumerated type is used in determining to what extent an object, the occludee, - * is visible during horizon culling. An occluder may fully block an occludee, in which case - * it has no visibility, may partially block an occludee from view, or may not block it at all, - * leading to full visibility. +is visible during horizon culling. An occluder may fully block an occludee, in which case +it has no visibility, may partially block an occludee from view, or may not block it at all, +leading to full visibility. */ export enum Visibility { /** @@ -16845,28 +17219,128 @@ export enum Visibility { FULL = 1 } +/** + * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps +retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}. + * @example + * var terrainProvider = new Cesium.VRTheWorldTerrainProvider({ + url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/' +}); +viewer.terrainProvider = terrainProvider; + * @param options - Object with the following properties: + * @param options.url - The URL of the VR-TheWorld TileMap. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid. If this parameter is not + specified, the WGS84 ellipsoid is used. + * @param [options.credit] - A credit for the data source, which is displayed on the canvas. + */ +export class VRTheWorldTerrainProvider { + constructor(options: { + url: Resource | string; + ellipsoid?: Ellipsoid; + credit?: Credit | string; + }); + /** + * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + errorEvent: Event; + /** + * Gets the credit to display when this terrain provider is active. Typically this is used to credit + the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true. + */ + credit: Credit; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link VRTheWorldTerrainProvider#ready} returns true. + */ + tilingScheme: GeographicTilingScheme; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise; + /** + * Gets a value indicating whether or not the provider includes a water mask. The water mask + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link VRTheWorldTerrainProvider#ready} returns true. + */ + hasWaterMask: boolean; + /** + * Gets a value indicating whether or not the requested tiles include vertex normals. + This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true. + */ + hasVertexNormals: boolean; + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + at points and in rectangles. This function should not be called before + {@link TerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. + */ + availability: TileAvailability; + /** + * Requests the geometry for a given tile. This function should not be called before + {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain + data and indicates that all child tiles are available. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the requested geometry. If this method + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. + */ + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise | undefined; + /** + * Gets the maximum geometric error allowed in a tile at a given level. + * @param level - The tile level for which to get the maximum geometric error. + * @returns The maximum geometric error. + */ + getLevelMaximumGeometricError(level: number): number; + /** + * Determines whether data for a tile is available to be loaded. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if not supported, otherwise true or false. + */ + getTileDataAvailable(x: number, y: number, level: number): boolean; + /** + * Makes sure we load availability data for a tile + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + */ + loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise; +} + /** * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points, - * which extrude down to the ground. Optionally, they can extrude downwards to a specified height. +which extrude down to the ground. Optionally, they can extrude downwards to a specified height. * @example * // create a wall that spans from ground level to 10000 meters - * var wall = new Cesium.WallGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArrayHeights([ - * 19.0, 47.0, 10000.0, - * 19.0, 48.0, 10000.0, - * 20.0, 48.0, 10000.0, - * 20.0, 47.0, 10000.0, - * 19.0, 47.0, 10000.0 - * ]) - * }); - * var geometry = Cesium.WallGeometry.createGeometry(wall); +var wall = new Cesium.WallGeometry({ + positions : Cesium.Cartesian3.fromDegreesArrayHeights([ + 19.0, 47.0, 10000.0, + 19.0, 48.0, 10000.0, + 20.0, 48.0, 10000.0, + 20.0, 47.0, 10000.0, + 19.0, 47.0, 10000.0 + ]) +}); +var geometry = Cesium.WallGeometry.createGeometry(wall); * @param options - Object with the following properties: * @param options.positions - An array of Cartesian objects, which are the points of the wall. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. * @param [options.maximumHeights] - An array parallel to positions that give the maximum height of the - * wall at positions. If undefined, the height of each position in used. + wall at positions. If undefined, the height of each position in used. * @param [options.minimumHeights] - An array parallel to positions that give the minimum height of the - * wall at positions. If undefined, the height at each position is 0.0. + wall at positions. If undefined, the height at each position is 0.0. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. */ @@ -16901,27 +17375,27 @@ export class WallGeometry { static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry; /** * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points, - * which extrude down to the ground. Optionally, they can extrude downwards to a specified height. + which extrude down to the ground. Optionally, they can extrude downwards to a specified height. * @example * // create a wall that spans from 10000 meters to 20000 meters - * var wall = Cesium.WallGeometry.fromConstantHeights({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * 19.0, 47.0, - * 19.0, 48.0, - * 20.0, 48.0, - * 20.0, 47.0, - * 19.0, 47.0, - * ]), - * minimumHeight : 20000.0, - * maximumHeight : 10000.0 - * }); - * var geometry = Cesium.WallGeometry.createGeometry(wall); + var wall = Cesium.WallGeometry.fromConstantHeights({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 19.0, 47.0, + 19.0, 48.0, + 20.0, 48.0, + 20.0, 47.0, + 19.0, 47.0, + ]), + minimumHeight : 20000.0, + maximumHeight : 10000.0 + }); + var geometry = Cesium.WallGeometry.createGeometry(wall); * @param options - Object with the following properties: * @param options.positions - An array of Cartesian objects, which are the points of the wall. * @param [options.maximumHeight] - A constant that defines the maximum height of the - * wall at positions. If undefined, the height of each position in used. + wall at positions. If undefined, the height of each position in used. * @param [options.minimumHeight] - A constant that defines the minimum height of the - * wall at positions. If undefined, the height at each position is 0.0. + wall at positions. If undefined, the height at each position is 0.0. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. */ @@ -16942,26 +17416,26 @@ export class WallGeometry { /** * A description of a wall outline. A wall is defined by a series of points, - * which extrude down to the ground. Optionally, they can extrude downwards to a specified height. +which extrude down to the ground. Optionally, they can extrude downwards to a specified height. * @example * // create a wall outline that spans from ground level to 10000 meters - * var wall = new Cesium.WallOutlineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArrayHeights([ - * 19.0, 47.0, 10000.0, - * 19.0, 48.0, 10000.0, - * 20.0, 48.0, 10000.0, - * 20.0, 47.0, 10000.0, - * 19.0, 47.0, 10000.0 - * ]) - * }); - * var geometry = Cesium.WallOutlineGeometry.createGeometry(wall); +var wall = new Cesium.WallOutlineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArrayHeights([ + 19.0, 47.0, 10000.0, + 19.0, 48.0, 10000.0, + 20.0, 48.0, 10000.0, + 20.0, 47.0, 10000.0, + 19.0, 47.0, 10000.0 + ]) +}); +var geometry = Cesium.WallOutlineGeometry.createGeometry(wall); * @param options - Object with the following properties: * @param options.positions - An array of Cartesian objects, which are the points of the wall. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. * @param [options.maximumHeights] - An array parallel to positions that give the maximum height of the - * wall at positions. If undefined, the height of each position in used. + wall at positions. If undefined, the height of each position in used. * @param [options.minimumHeights] - An array parallel to positions that give the minimum height of the - * wall at positions. If undefined, the height at each position is 0.0. + wall at positions. If undefined, the height at each position is 0.0. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation */ export class WallOutlineGeometry { @@ -16994,27 +17468,27 @@ export class WallOutlineGeometry { static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry; /** * A description of a walloutline. A wall is defined by a series of points, - * which extrude down to the ground. Optionally, they can extrude downwards to a specified height. + which extrude down to the ground. Optionally, they can extrude downwards to a specified height. * @example * // create a wall that spans from 10000 meters to 20000 meters - * var wall = Cesium.WallOutlineGeometry.fromConstantHeights({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * 19.0, 47.0, - * 19.0, 48.0, - * 20.0, 48.0, - * 20.0, 47.0, - * 19.0, 47.0, - * ]), - * minimumHeight : 20000.0, - * maximumHeight : 10000.0 - * }); - * var geometry = Cesium.WallOutlineGeometry.createGeometry(wall); + var wall = Cesium.WallOutlineGeometry.fromConstantHeights({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 19.0, 47.0, + 19.0, 48.0, + 20.0, 48.0, + 20.0, 47.0, + 19.0, 47.0, + ]), + minimumHeight : 20000.0, + maximumHeight : 10000.0 + }); + var geometry = Cesium.WallOutlineGeometry.createGeometry(wall); * @param options - Object with the following properties: * @param options.positions - An array of Cartesian objects, which are the points of the wall. * @param [options.maximumHeight] - A constant that defines the maximum height of the - * wall at positions. If undefined, the height of each position in used. + wall at positions. If undefined, the height of each position in used. * @param [options.minimumHeight] - A constant that defines the minimum height of the - * wall at positions. If undefined, the height at each position is 0.0. + wall at positions. If undefined, the height at each position is 0.0. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation */ static fromConstantHeights(options: { @@ -17033,8 +17507,8 @@ export class WallOutlineGeometry { /** * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This - * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using - * the spherical (rather than ellipsoidal) equations. +projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using +the spherical (rather than ellipsoidal) equations. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid. */ export class WebMercatorProjection { @@ -17045,48 +17519,48 @@ export class WebMercatorProjection { readonly ellipsoid: Ellipsoid; /** * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude - * in the range -PI/2 to PI/2. + in the range -PI/2 to PI/2. * @param mercatorAngle - The angle to convert. * @returns The geodetic latitude in radians. */ static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number; /** * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator - * angle in the range -PI to PI. + angle in the range -PI to PI. * @param latitude - The geodetic latitude in radians. * @returns The Mercator angle. */ static geodeticLatitudeToMercatorAngle(latitude: number): number; /** * The maximum latitude (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 - * to cut it off sooner because it grows exponentially with increasing latitude. - * The logic behind this particular cutoff value, which is the one used by - * Google Maps, Bing Maps, and Esri, is that it makes the projection - * square. That is, the rectangle is equal in the X and Y directions. - * - * The constant value is computed by calling: - * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI) + (EPSG:3857) projection. Technically, the Mercator projection is defined + for any latitude up to (but not including) 90 degrees, but it makes sense + to cut it off sooner because it grows exponentially with increasing latitude. + The logic behind this particular cutoff value, which is the one used by + Google Maps, Bing Maps, and Esri, is that it makes the projection + square. That is, the rectangle is equal in the X and Y directions. + + The constant value is computed by calling: + WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI) */ static MaximumLatitude: number; /** * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator - * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height - * is copied unmodified to the Z coordinate. + X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height + is copied unmodified to the Z coordinate. * @param cartographic - The cartographic coordinates in radians. * @param [result] - The instance to which to copy the result, or undefined if a - * new instance should be created. + new instance should be created. * @returns The equivalent web mercator X, Y, Z coordinates, in meters. */ project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; /** * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic} - * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the - * height. + containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the + height. * @param cartesian - The web mercator Cartesian position to unrproject with height (z) in meters. * @param [result] - The instance to which to copy the result, or undefined if a - * new instance should be created. + new instance should be created. * @returns The equivalent cartographic coordinates. */ unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; @@ -17094,22 +17568,22 @@ export class WebMercatorProjection { /** * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is - * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online. +the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online. * @param [options] - Object with the following properties: * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to - * the WGS84 ellipsoid. +the WGS84 ellipsoid. * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of - * the tile tree. + the tile tree. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of - * the tile tree. + the tile tree. * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the - * tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire - * globe is covered in the longitude direction and an equal distance is covered in the latitude - * direction, resulting in a square projection. + tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire + globe is covered in the longitude direction and an equal distance is covered in the latitude + direction, resulting in a square projection. * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the - * tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire - * globe is covered in the longitude direction and an equal distance is covered in the latitude - * direction, resulting in a square projection. + tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire + globe is covered in the longitude direction and an equal distance is covered in the latitude + direction, resulting in a square projection. */ export class WebMercatorTilingScheme { constructor(options?: { @@ -17145,24 +17619,24 @@ export class WebMercatorTilingScheme { getNumberOfYTilesAtLevel(level: number): number; /** * Transforms a rectangle specified in geodetic radians to the native coordinate system - * of this tiling scheme. + of this tiling scheme. * @param rectangle - The rectangle to transform. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the native rectangle if 'result' - * is undefined. + is undefined. */ rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; /** * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates - * of the tiling scheme. + of the tiling scheme. * @param x - The integer x coordinate of the tile. * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the rectangle - * if 'result' is undefined. + if 'result' is undefined. */ tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; /** @@ -17171,20 +17645,20 @@ export class WebMercatorTilingScheme { * @param y - The integer y coordinate of the tile. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the rectangle - * if 'result' is undefined. + if 'result' is undefined. */ tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; /** * Calculates the tile x, y coordinates of the tile containing - * a given cartographic position. + a given cartographic position. * @param position - The position. * @param level - The tile level-of-detail. Zero is the least detailed. * @param [result] - The instance to which to copy the result, or undefined if a new instance - * should be created. + should be created. * @returns The specified 'result', or a new object containing the tile x, y coordinates - * if 'result' is undefined. + if 'result' is undefined. */ positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; } @@ -17193,20 +17667,20 @@ export class WebMercatorTilingScheme { * A spline that linearly interpolates over an array of weight values used by morph targets. * @example * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; - * var weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets - * var spline = new Cesium.WeightSpline({ - * times : times, - * weights : weights - * }); - * - * var p0 = spline.evaluate(times[0]); +var weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets +var spline = new Cesium.WeightSpline({ + times : times, + weights : weights +}); + +var p0 = spline.evaluate(times[0]); * @param options - Object with the following properties: * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. - * The values are in no way connected to the clock time. They are the parameterization for the curve. + The values are in no way connected to the clock time. They are the parameterization for the curve. * @param options.weights - The array of floating-point control weights given. The weights are ordered such - * that all weights for the targets are given in chronological order and order in which they appear in - * the glTF from which the morph targets come. This means for 2 targets, weights = [w(0,0), w(0,1), w(1,0), w(1,1) ...] - * where i and j in w(i,j) are the time indices and target indices, respectively. + that all weights for the targets are given in chronological order and order in which they appear in + the glTF from which the morph targets come. This means for 2 targets, weights = [w(0,0), w(0,1), w(1,0), w(1,1) ...] + where i and j in w(i,j) are the time indices and target indices, respectively. */ export class WeightSpline { constructor(options: { @@ -17223,7 +17697,7 @@ export class WeightSpline { readonly weights: number[]; /** * Finds an index i in times such that the parameter - * time is in the interval [times[i], times[i + 1]]. + time is in the interval [times[i], times[i + 1]]. * @param time - The time. * @returns The index for the element at the start of the interval. */ @@ -17263,483 +17737,9 @@ export enum WindingOrder { COUNTER_CLOCKWISE = WebGLConstants.CCW } -/** - * Computes the barycentric coordinates for a point with respect to a triangle. - * @example - * // Returns Cartesian3.UNIT_X - * var p = new Cesium.Cartesian3(-1.0, 0.0, 0.0); - * var b = Cesium.barycentricCoordinates(p, - * new Cesium.Cartesian3(-1.0, 0.0, 0.0), - * new Cesium.Cartesian3( 1.0, 0.0, 0.0), - * new Cesium.Cartesian3( 0.0, 1.0, 1.0)); - * @param point - The point to test. - * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis. - * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis. - * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis. - * @param [result] - The object onto which to store the result. - * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. - */ -export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3; - -/** - * Finds an item in a sorted array. - * @example - * // Create a comparator function to search through an array of numbers. - * function comparator(a, b) { - * return a - b; - * }; - * var numbers = [0, 2, 4, 6, 8]; - * var index = Cesium.binarySearch(numbers, 6, comparator); // 3 - * @param array - The sorted array to search. - * @param itemToFind - The item to find in the array. - * @param comparator - The function to use to compare the item to - * elements in the array. - * @returns The index of itemToFind in the array, if it exists. If itemToFind - * does not exist, the return value is a negative number which is the bitwise complement (~) - * of the index before which the itemToFind should be inserted in order to maintain the - * sorted order of the array. - */ -export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number; - -/** - * A function used to compare two items while performing a binary search. - * @example - * function compareNumbers(a, b) { - * return a - b; - * } - * @param a - An item in the array. - * @param b - The item being searched for. - */ -export type binarySearchComparator = (a: any, b: any) => number; - -/** - * Given a relative URL under the Cesium base URL, returns an absolute URL. - * @example - * var viewer = new Cesium.Viewer("cesiumContainer", { - * imageryProvider: new Cesium.TileMapServiceImageryProvider({ - * url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), - * }), - * baseLayerPicker: false, - * }); - * @param relativeUrl - The relative path. - * @returns The absolutely URL representation of the provided path. - */ -export function buildModuleUrl(relativeUrl: string): string; - -/** - * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}. - * @param requestID - The value returned by {@link requestAnimationFrame}. - */ -export function cancelAnimationFrame(requestID: number): void; - -/** - * Clones an object, returning a new object containing the same properties. - * @param object - The object to clone. - * @param [deep = false] - If true, all properties will be deep cloned recursively. - * @returns The cloned object. - */ -export function clone(object: any, deep?: boolean): any; - -/** - * Merges two objects, copying their properties onto a new combined object. When two objects have the same - * property, the value of the property on the first object is used. If either object is undefined, - * it will be treated as an empty object. - * @example - * var object1 = { - * propOne : 1, - * propTwo : { - * value1 : 10 - * } - * } - * var object2 = { - * propTwo : 2 - * } - * var final = Cesium.combine(object1, object2); - * - * // final === { - * // propOne : 1, - * // propTwo : { - * // value1 : 10 - * // } - * // } - * @param [object1] - The first object to merge. - * @param [object2] - The second object to merge. - * @param [deep = false] - Perform a recursive merge. - * @returns The combined object containing all properties from both objects. - */ -export function combine(object1?: any, object2?: any, deep?: boolean): any; - -/** - * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time. - * @example - * this.guid = Cesium.createGuid(); - */ -export function createGuid(): string; - -/** - * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}. - * @example - * // Create Cesium World Terrain with default settings - * var viewer = new Cesium.Viewer('cesiumContainer', { - * terrainProvider : Cesium.createWorldTerrain(); - * }); - * @example - * // Create Cesium World Terrain with water and normals. - * var viewer = new Cesium.Viewer('cesiumContainer', { - * terrainProvider : Cesium.createWorldTerrain({ - * requestWaterMask : true, - * requestVertexNormals : true - * }); - * }); - * @param [options] - Object with the following properties: - * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available. - * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available. - */ -export function createWorldTerrain(options?: { - requestVertexNormals?: boolean; - requestWaterMask?: boolean; -}): CesiumTerrainProvider; - -/** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * @example - * param = Cesium.defaultValue(param, 'default'); - * @returns Returns the first parameter if not undefined, otherwise the second parameter. - */ -export function defaultValue(a: any, b: any): any; - -/** - * @example - * if (Cesium.defined(positions)) { - * doSomething(); - * } else { - * doSomethingElse(); - * } - * @param value - The object. - * @returns Returns true if the object is defined, returns false otherwise. - */ -export function defined(value: any): boolean; - -/** - * Destroys an object. Each of the object's functions, including functions in its prototype, - * is replaced with a function that throws a {@link DeveloperError}, except for the object's - * isDestroyed function, which is set to a function that returns true. - * The object's properties are removed with delete. - *

- * This function is used by objects that hold native resources, e.g., WebGL resources, which - * need to be explicitly released. Client code calls an object's destroy function, - * which then releases the native resource and calls destroyObject to put itself - * in a destroyed state. - * @example - * // How a texture would destroy itself. - * this.destroy = function () { - * _gl.deleteTexture(_texture); - * return Cesium.destroyObject(this); - * }; - * @param object - The object to destroy. - * @param [message] - The message to include in the exception that is thrown if - * a destroyed object's function is called. - */ -export function destroyObject(object: any, message?: string): void; - -/** - * Formats an error object into a String. If available, uses name, message, and stack - * properties, otherwise, falls back on toString(). - * @param object - The item to find in the array. - * @returns A string containing the formatted error. - */ -export function formatError(object: any): string; - -/** - * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri. - * @example - * //absolute Uri will be "https://test.com/awesome.png"; - * var absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com'); - * @param relative - The relative Uri. - * @param [base] - The base Uri. - * @returns The absolute Uri of the given relative Uri. - */ -export function getAbsoluteUri(relative: string, base?: string): string; - -/** - * Given a URI, returns the base path of the URI. - * @example - * // basePath will be "/Gallery/"; - * var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false'); - * - * // basePath will be "/Gallery/?value=true&example=false"; - * var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true); - * @param uri - The Uri. - * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri - * @returns The base path of the Uri. - */ -export function getBaseUri(uri: string, includeQuery?: boolean): string; - -/** - * Given a URI, returns the extension of the URI. - * @example - * //extension will be "czml"; - * var extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false'); - * @param uri - The Uri. - * @returns The extension of the Uri. - */ -export function getExtensionFromUri(uri: string): string; - -/** - * Given a URI, returns the last segment of the URI, removing any path or query information. - * @example - * //fileName will be"simple.czml"; - * var fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false'); - * @param uri - The Uri. - * @returns The last segment of the Uri. - */ -export function getFilenameFromUri(uri: string): string; - -/** - * Extract a pixel array from a loaded image. Draws the image - * into a canvas so it can read the pixels back. - * @param image - The image to extract pixels from. - * @param width - The width of the image. If not defined, then image.width is assigned. - * @param height - The height of the image. If not defined, then image.height is assigned. - * @returns The pixels of the image. - */ -export function getImagePixels(image: HTMLImageElement, width: number, height: number): ImageData; - -/** - * Gets a timestamp that can be used in measuring the time between events. Timestamps - * are expressed in milliseconds, but it is not specified what the milliseconds are - * measured from. This function uses performance.now() if it is available, or Date.now() - * otherwise. - * @returns The timestamp in milliseconds since some unspecified reference time. - */ -export function getTimestamp(): number; - -/** - * Determines if a given date is a leap year. - * @example - * var leapYear = Cesium.isLeapYear(2000); // true - * @param year - The year to be tested. - * @returns True if year is a leap year. - */ -export function isLeapYear(year: number): boolean; - -/** - * Asynchronously loads and parses the given URL to a CRN file or parses the raw binary data of a CRN file. - * Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded, - * or reject if the URL failed to load or failed to parse the data. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. - * @example - * // load a single URL asynchronously - * Cesium.loadCRN('some/url').then(function(textureData) { - * var width = textureData.width; - * var height = textureData.height; - * var format = textureData.internalFormat; - * var arrayBufferView = textureData.bufferView; - * // use the data to create a texture - * }).otherwise(function(error) { - * // an error occurred - * }); - * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer. - * @returns A promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. - */ -export function loadCRN(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise | undefined; - -/** - * Asynchronously loads and parses the given URL to a KTX file or parses the raw binary data of a KTX file. - * Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded, - * or reject if the URL failed to load or failed to parse the data. The data is loaded - * using XMLHttpRequest, which means that in order to make requests to another origin, - * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. - *

- * The following are part of the KTX format specification but are not supported: - *

    - *
  • Big-endian files
  • - *
  • Metadata
  • - *
  • 3D textures
  • - *
  • Texture Arrays
  • - *
  • Cubemaps
  • - *
  • Mipmaps
  • - *
- *

- * @example - * // load a single URL asynchronously - * Cesium.loadKTX('some/url').then(function(ktxData) { - * var width = ktxData.width; - * var height = ktxData.height; - * var format = ktxData.internalFormat; - * var arrayBufferView = ktxData.bufferView; - * // use the data to create a texture - * }).otherwise(function(error) { - * // an error occurred - * }); - * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer. - * @returns A promise that will resolve to the requested data when loaded. Returns undefined if request.throttle is true and the request does not have high enough priority. - */ -export function loadKTX(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise | undefined; - -/** - * A stable merge sort. - * @example - * // Assume array contains BoundingSpheres in world coordinates. - * // Sort them in ascending order of distance from the camera. - * var position = camera.positionWC; - * Cesium.mergeSort(array, function(a, b, position) { - * return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position); - * }, position); - * @param array - The array to sort. - * @param comparator - The function to use to compare elements in the array. - * @param [userDefinedObject] - Any item to pass as the third parameter to comparator. - */ -export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void; - -/** - * A function used to compare two items while performing a merge sort. - * @example - * function compareNumbers(a, b, userDefinedObject) { - * return a - b; - * } - * @param a - An item in the array. - * @param b - An item in the array. - * @param [userDefinedObject] - An object that was passed to {@link mergeSort}. - */ -export type mergeSortComparator = (a: any, b: any, userDefinedObject?: any) => number; - -/** - * Converts an object representing a set of name/value pairs into a query string, - * with names and values encoded properly for use in a URL. Values that are arrays - * will produce multiple values with the same name. - * @example - * var str = Cesium.objectToQuery({ - * key1 : 'some value', - * key2 : 'a/b', - * key3 : ['x', 'y'] - * }); - * @param obj - The object containing data to encode. - * @returns An encoded query string. - */ -export function objectToQuery(obj: any): string; - -/** - * Determines if a point is inside a triangle. - * @example - * // Returns true - * var p = new Cesium.Cartesian2(0.25, 0.25); - * var b = Cesium.pointInsideTriangle(p, - * new Cesium.Cartesian2(0.0, 0.0), - * new Cesium.Cartesian2(1.0, 0.0), - * new Cesium.Cartesian2(0.0, 1.0)); - * @param point - The point to test. - * @param p0 - The first point of the triangle. - * @param p1 - The second point of the triangle. - * @param p2 - The third point of the triangle. - * @returns true if the point is inside the triangle; otherwise, false. - */ -export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean; - -/** - * Parses a query string into an object, where the keys and values of the object are the - * name/value pairs from the query string, decoded. If a name appears multiple times, - * the value in the object will be an array of values. - * @example - * var obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y'); - * // obj will be: - * // { - * // key1 : 'some value', - * // key2 : 'a/b', - * // key3 : ['x', 'y'] - * // } - * @param queryString - The query string. - * @returns An object containing the parameters parsed from the query string. - */ -export function queryToObject(queryString: string): any; - -/** - * A browser-independent function to request a new animation frame. This is used to create - * an application's draw loop as shown in the example below. - * @example - * // Create a draw loop using requestAnimationFrame. The - * // tick callback function is called for every animation frame. - * function tick() { - * scene.render(); - * Cesium.requestAnimationFrame(tick); - * } - * tick(); - * @param callback - The function to call when the next frame should be drawn. - * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request. - */ -export function requestAnimationFrame(callback: requestAnimationFrameCallback): number; - -/** - * A function that will be called when the next frame should be drawn. - * @param timestamp - A timestamp for the frame, in milliseconds. - */ -export type requestAnimationFrameCallback = (timestamp: number) => void; - -/** - * Initiates a terrain height query for an array of {@link Cartographic} positions by - * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation - * matches the triangles used to render the terrain at the specified level. The query - * happens asynchronously, so this function returns a promise that is resolved when - * the query completes. Each point height is modified in place. If a height can not be - * determined because no terrain data is available for the specified level at that location, - * or another error occurs, the height is set to undefined. As is typical of the - * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid - * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other - * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the - * terrain level of detail as input, if you need to get the altitude of the terrain as precisely - * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}. - * @example - * // Query the terrain height of two Cartographic positions - * var terrainProvider = Cesium.createWorldTerrain(); - * var positions = [ - * Cesium.Cartographic.fromDegrees(86.925145, 27.988257), - * Cesium.Cartographic.fromDegrees(87.0, 28.0) - * ]; - * var promise = Cesium.sampleTerrain(terrainProvider, 11, positions); - * Cesium.when(promise, function(updatedPositions) { - * // positions[0].height and positions[1].height have been updated. - * // updatedPositions is just a reference to positions. - * }); - * @param terrainProvider - The terrain provider from which to query heights. - * @param level - The terrain level-of-detail from which to query terrain heights. - * @param positions - The positions to update with terrain heights. - * @returns A promise that resolves to the provided list of positions when terrain the query has completed. - */ -export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise; - -/** - * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset. - * @example - * // Query the terrain height of two Cartographic positions - * var terrainProvider = Cesium.createWorldTerrain(); - * var positions = [ - * Cesium.Cartographic.fromDegrees(86.925145, 27.988257), - * Cesium.Cartographic.fromDegrees(87.0, 28.0) - * ]; - * var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions); - * Cesium.when(promise, function(updatedPositions) { - * // positions[0].height and positions[1].height have been updated. - * // updatedPositions is just a reference to positions. - * }); - * @param terrainProvider - The terrain provider from which to query heights. - * @param positions - The positions to update with terrain heights. - * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This - * promise will reject if the terrain provider's `availability` property is undefined. - */ -export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise; - -/** - * Subdivides an array into a number of smaller, equal sized arrays. - * @param array - The array to divide. - * @param numberOfArrays - The number of arrays to divide the provided array into. - */ -export function subdivideArray(array: any[], numberOfArrays: number): void; - /** * Writes the given text into a new canvas. The canvas will be sized to fit the text. - * If text is blank, returns undefined. +If text is blank, returns undefined. * @param text - The text to write. * @param [options] - Object with the following properties: * @param [options.font = '10px sans-serif'] - The CSS font to use. @@ -17752,8 +17752,8 @@ export function subdivideArray(array: any[], numberOfArrays: number): void; * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas. * @param [options.padding = 0] - The pixel size of the padding to add around the text. * @returns A new canvas with the given text drawn into it. The dimensions object - * from measureText will also be added to the returned canvas. If text is - * blank, returns undefined. + from measureText will also be added to the returned canvas. If text is + blank, returns undefined. */ export function writeTextToCanvas(text: string, options?: { font?: string; @@ -17817,12 +17817,12 @@ export namespace BillboardGraphics { /** * Describes a two dimensional icon located at the position of the containing {@link Entity}. - *

- *

- *
- * Example billboards - *
- *

+

+

+
+Example billboards +
+

* @param [options] - Object describing initialization options */ export class BillboardGraphics { @@ -17841,50 +17841,50 @@ export class BillboardGraphics { image: Property | undefined; /** * Gets or sets the numeric Property specifying the uniform scale to apply to the image. - * A scale greater than 1.0 enlarges the billboard while a scale less than 1.0 shrinks it. - *

- *

- *
- * From left to right in the above image, the scales are 0.5, 1.0, and 2.0. - *
- *

+ A scale greater than 1.0 enlarges the billboard while a scale less than 1.0 shrinks it. +

+

+
+ From left to right in the above image, the scales are 0.5, 1.0, and 2.0. +
+

*/ scale: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space - * from the origin of this billboard. This is commonly used to align multiple billboards and labels at - * the same position, e.g., an image and text. The screen space origin is the top, left corner of the - * canvas; x increases from left to right, and y increases from top to bottom. - *

- *

- * - * - * - *
default
b.pixeloffset = new Cartesian2(50, 25);
- * The billboard's origin is indicated by the yellow point. - *
- *

+ from the origin of this billboard. This is commonly used to align multiple billboards and labels at + the same position, e.g., an image and text. The screen space origin is the top, left corner of the + canvas; x increases from left to right, and y increases from top to bottom. +

+

+ + + +
default
b.pixeloffset = new Cartesian2(50, 25);
+ The billboard's origin is indicated by the yellow point. +
+

*/ pixelOffset: Property | undefined; /** * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates. - * Eye coordinates is a left-handed coordinate system, where x points towards the viewer's - * right, y points up, and z points into the screen. - *

- * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to - * arrange a billboard above its corresponding 3D model. - *

- * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always - * appear on top of the Earth regardless of the viewer's or Earth's orientation. - *

- *

- * - * - * - *
- * b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0); - *
- *

+ Eye coordinates is a left-handed coordinate system, where x points towards the viewer's + right, y points up, and z points into the screen. +

+ An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to + arrange a billboard above its corresponding 3D model. +

+ Below, the billboard is positioned at the center of the Earth but an eye offset makes it always + appear on top of the Earth regardless of the viewer's or Earth's orientation. +

+

+ + + +
+ b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0); +
+

*/ eyeOffset: Property | undefined; /** @@ -17901,28 +17901,28 @@ export class BillboardGraphics { heightReference: Property | undefined; /** * Gets or sets the Property specifying the {@link Color} that is multiplied with the image. - * This has two common use cases. First, the same white texture may be used by many different billboards, - * each with a different color, to create colored billboards. Second, the color's alpha component can be - * used to make the billboard translucent as shown below. An alpha of 0.0 makes the billboard - * transparent, and 1.0 makes the billboard opaque. - *

- *

- * - * - * - *
default
alpha : 0.5
- *
- *

+ This has two common use cases. First, the same white texture may be used by many different billboards, + each with a different color, to create colored billboards. Second, the color's alpha component can be + used to make the billboard translucent as shown below. An alpha of 0.0 makes the billboard + transparent, and 1.0 makes the billboard opaque. +

+

+ + + +
default
alpha : 0.5
+
+

*/ color: Property | undefined; /** * Gets or sets the numeric Property specifying the rotation of the image - * counter clockwise from the alignedAxis. + counter clockwise from the alignedAxis. */ rotation: Property | undefined; /** * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation - * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen. + in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen. */ alignedAxis: Property | undefined; /** @@ -17931,42 +17931,42 @@ export class BillboardGraphics { sizeInMeters: Property | undefined; /** * Gets or sets the numeric Property specifying the width of the billboard in pixels. - * When undefined, the native width is used. + When undefined, the native width is used. */ width: Property | undefined; /** * Gets or sets the numeric Property specifying the height of the billboard in pixels. - * When undefined, the native height is used. + When undefined, the native height is used. */ height: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera. - * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the billboard's scale remains clamped to the nearest bound. + A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's scale remains clamped to the nearest bound. */ scaleByDistance: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera. - * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. + A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's translucency remains clamped to the nearest bound. */ translucencyByDistance: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera. - * A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound. + A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound. */ pixelOffsetScaleByDistance: Property | undefined; /** * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a - * sub-region of the image to use for the billboard, rather than the entire image, - * measured in pixels from the bottom-left. + sub-region of the image to use for the billboard, rather than the entire image, + measured in pixels from the bottom-left. */ imageSubRegion: Property | undefined; /** @@ -17975,7 +17975,7 @@ export class BillboardGraphics { distanceDisplayCondition: Property | undefined; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. - * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: Property | undefined; /** @@ -17986,7 +17986,7 @@ export class BillboardGraphics { clone(result?: BillboardGraphics): BillboardGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: BillboardGraphics): void; @@ -18001,7 +18001,7 @@ export class BillboardVisualizer { constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); /** * Updates the primitives created by this visualizer to match their - * Entity counterpart at the given time. + Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ @@ -18019,7 +18019,7 @@ export class BillboardVisualizer { /** * A {@link GeometryUpdater} for boxes. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -18111,7 +18111,7 @@ export class BoxGraphics { outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the box - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -18126,7 +18126,7 @@ export class BoxGraphics { clone(result?: BoxGraphics): BoxGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: BoxGraphics): void; @@ -18145,7 +18145,7 @@ export class CallbackProperty { readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever setCallback is called. + The definition is changed whenever setCallback is called. */ readonly definitionChanged: Event; /** @@ -18163,7 +18163,7 @@ export class CallbackProperty { setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -18195,8 +18195,8 @@ export namespace Cesium3DTilesetGraphics { /** * A 3D Tiles tileset represented by an {@link Entity}. - * The tileset modelMatrix is determined by the containing Entity position and orientation - * or is left unset if position is undefined. +The tileset modelMatrix is determined by the containing Entity position and orientation +or is left unset if position is undefined. * @param [options] - Object describing initialization options */ export class Cesium3DTilesetGraphics { @@ -18225,7 +18225,7 @@ export class Cesium3DTilesetGraphics { clone(result?: Cesium3DTilesetGraphics): Cesium3DTilesetGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: Cesium3DTilesetGraphics): void; @@ -18240,7 +18240,7 @@ export class Cesium3DTilesetVisualizer { constructor(scene: Scene, entityCollection: EntityCollection); /** * Updates models created this visualizer to match their - * Entity counterpart at the given time. + Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ @@ -18271,13 +18271,13 @@ export class CheckerboardMaterialProperty { }); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -18307,7 +18307,7 @@ export class CheckerboardMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -18322,13 +18322,13 @@ export class ColorMaterialProperty { constructor(color?: Property | Color); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -18350,7 +18350,7 @@ export class ColorMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -18359,11 +18359,11 @@ export class ColorMaterialProperty { /** * Non-destructively composites multiple {@link EntityCollection} instances into a single collection. - * If a Entity with the same ID exists in multiple collections, it is non-destructively - * merged into a single new entity instance. If an entity has the same property in multiple - * collections, the property of the Entity in the last collection of the list it - * belongs to is used. CompositeEntityCollection can be used almost anywhere that a - * EntityCollection is used. +If a Entity with the same ID exists in multiple collections, it is non-destructively +merged into a single new entity instance. If an entity has the same property in multiple +collections, the property of the Entity in the last collection of the list it +belongs to is used. CompositeEntityCollection can be used almost anywhere that a +EntityCollection is used. * @param [collections] - The initial list of EntityCollection instances to merge. * @param [owner] - The data source (or composite entity collection) which created this collection. */ @@ -18371,7 +18371,7 @@ export class CompositeEntityCollection { constructor(collections?: EntityCollection[], owner?: DataSource | CompositeEntityCollection); /** * Gets the event that is fired when entities are added or removed from the collection. - * The generated event is a {@link EntityCollection.collectionChangedEventCallback}. + The generated event is a {@link EntityCollection.collectionChangedEventCallback}. */ readonly collectionChanged: Event; /** @@ -18380,7 +18380,7 @@ export class CompositeEntityCollection { readonly id: string; /** * Gets the array of Entity instances in the collection. - * This array should not be modified directly. + This array should not be modified directly. */ readonly values: Entity[]; /** @@ -18391,14 +18391,14 @@ export class CompositeEntityCollection { * Adds a collection to the composite. * @param collection - the collection to add. * @param [index] - the index to add the collection at. If omitted, the collection will - * added on top of all existing collections. + added on top of all existing collections. */ addCollection(collection: EntityCollection, index?: number): void; /** * Removes a collection from this composite, if present. * @param collection - The collection to remove. * @returns true if the collection was in the composite and was removed, - * false if the collection was not in the composite. + false if the collection was not in the composite. */ removeCollection(collection: EntityCollection): boolean; /** @@ -18454,29 +18454,29 @@ export class CompositeEntityCollection { lowerCollectionToBottom(collection: EntityCollection): void; /** * Prevents {@link EntityCollection#collectionChanged} events from being raised - * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which - * point a single event will be raised that covers all suspended operations. - * This allows for many items to be added and removed efficiently. - * While events are suspended, recompositing of the collections will - * also be suspended, as this can be a costly operation. - * This function can be safely called multiple times as long as there - * are corresponding calls to {@link EntityCollection#resumeEvents}. + until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which + point a single event will be raised that covers all suspended operations. + This allows for many items to be added and removed efficiently. + While events are suspended, recompositing of the collections will + also be suspended, as this can be a costly operation. + This function can be safely called multiple times as long as there + are corresponding calls to {@link EntityCollection#resumeEvents}. */ suspendEvents(): void; /** * Resumes raising {@link EntityCollection#collectionChanged} events immediately - * when an item is added or removed. Any modifications made while while events were suspended - * will be triggered as a single event when this function is called. This function also ensures - * the collection is recomposited if events are also resumed. - * This function is reference counted and can safely be called multiple times as long as there - * are corresponding calls to {@link EntityCollection#resumeEvents}. + when an item is added or removed. Any modifications made while while events were suspended + will be triggered as a single event when this function is called. This function also ensures + the collection is recomposited if events are also resumed. + This function is reference counted and can safely be called multiple times as long as there + are corresponding calls to {@link EntityCollection#resumeEvents}. */ resumeEvents(): void; /** * Computes the maximum availability of the entities in the collection. - * If the collection contains a mix of infinitely available data and non-infinite data, - * It will return the interval pertaining to the non-infinite data only. If all - * data is infinite, an infinite interval will be returned. + If the collection contains a mix of infinitely available data and non-infinite data, + It will return the interval pertaining to the non-infinite data only. If all + data is infinite, an infinite interval will be returned. * @returns The availability of entities in the collection. */ computeAvailability(): TimeInterval; @@ -18495,13 +18495,13 @@ export class CompositeMaterialProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever setValue is called with data different - * than the current value. + The definition is changed whenever setValue is called with data different + than the current value. */ readonly definitionChanged: Event; /** @@ -18523,7 +18523,7 @@ export class CompositeMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -18538,13 +18538,13 @@ export class CompositePositionProperty { constructor(referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever setValue is called with data different - * than the current value. + The definition is changed whenever setValue is called with data different + than the current value. */ readonly definitionChanged: Event; /** @@ -18553,9 +18553,9 @@ export class CompositePositionProperty { intervals: TimeIntervalCollection; /** * Gets or sets the reference frame which this position presents itself as. - * Each PositionProperty making up this object has it's own reference frame, - * so this property merely exposes a "preferred" reference frame for clients - * to use. + Each PositionProperty making up this object has it's own reference frame, + so this property merely exposes a "preferred" reference frame for clients + to use. */ referenceFrame: ReferenceFrame; /** @@ -18575,7 +18575,7 @@ export class CompositePositionProperty { getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -18584,39 +18584,39 @@ export class CompositePositionProperty { /** * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the - * data property of each {@link TimeInterval} is another Property instance which is - * evaluated at the provided time. +data property of each {@link TimeInterval} is another Property instance which is +evaluated at the provided time. * @example * var constantProperty = ...; - * var sampledProperty = ...; - * - * //Create a composite property from two previously defined properties - * //where the property is valid on August 1st, 2012 and uses a constant - * //property for the first half of the day and a sampled property for the - * //remaining half. - * var composite = new Cesium.CompositeProperty(); - * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ - * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z', - * data : constantProperty - * })); - * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ - * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z', - * isStartIncluded : false, - * isStopIncluded : false, - * data : sampledProperty - * })); +var sampledProperty = ...; + +//Create a composite property from two previously defined properties +//where the property is valid on August 1st, 2012 and uses a constant +//property for the first half of the day and a sampled property for the +//remaining half. +var composite = new Cesium.CompositeProperty(); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z', + data : constantProperty +})); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z', + isStartIncluded : false, + isStopIncluded : false, + data : sampledProperty +})); */ export class CompositeProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever setValue is called with data different - * than the current value. + The definition is changed whenever setValue is called with data different + than the current value. */ readonly definitionChanged: Event; /** @@ -18632,7 +18632,7 @@ export class CompositeProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -18641,7 +18641,7 @@ export class CompositeProperty { /** * A {@link PositionProperty} whose value does not change in respect to the - * {@link ReferenceFrame} in which is it defined. +{@link ReferenceFrame} in which is it defined. * @param [value] - The property value. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. */ @@ -18649,13 +18649,13 @@ export class ConstantPositionProperty { constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -18685,7 +18685,7 @@ export class ConstantPositionProperty { getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -18700,13 +18700,13 @@ export class ConstantProperty { constructor(value?: any); /** * Gets a value indicating if this property is constant. - * This property always returns true. + This property always returns true. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever setValue is called with data different - * than the current value. + The definition is changed whenever setValue is called with data different + than the current value. */ readonly definitionChanged: Event; /** @@ -18723,7 +18723,7 @@ export class ConstantProperty { setValue(value: any): void; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -18742,7 +18742,7 @@ export class ConstantProperty { /** * A {@link GeometryUpdater} for corridors. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -18808,8 +18808,8 @@ export namespace CorridorGraphics { /** * Describes a corridor, which is a shape defined by a centerline and width that - * conforms to the curvature of the globe. It can be placed on the surface or at altitude - * and can optionally be extruded into a volume. +conforms to the curvature of the globe. It can be placed on the surface or at altitude +and can optionally be extruded into a volume. * @param [options] - Object describing initialization options */ export class CorridorGraphics { @@ -18840,8 +18840,8 @@ export class CorridorGraphics { heightReference: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the corridor extrusion. - * Setting this property creates a corridor shaped volume starting at height and ending - * at this altitude. + Setting this property creates a corridor shaped volume starting at height and ending + at this altitude. */ extrudedHeight: Property | undefined; /** @@ -18878,7 +18878,7 @@ export class CorridorGraphics { outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the corridor - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -18901,7 +18901,7 @@ export class CorridorGraphics { clone(result?: CorridorGraphics): CorridorGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: CorridorGraphics): void; @@ -18911,15 +18911,15 @@ export class CorridorGraphics { * A {@link DataSource} implementation which can be used to manually manage a group of entities. * @example * var dataSource = new Cesium.CustomDataSource('myData'); - * - * var entity = dataSource.entities.add({ - * position : Cesium.Cartesian3.fromDegrees(1, 2, 0), - * billboard : { - * image : 'image.png' - * } - * }); - * - * viewer.dataSources.add(dataSource); + +var entity = dataSource.entities.add({ + position : Cesium.Cartesian3.fromDegrees(1, 2, 0), + billboard : { + image : 'image.png' + } +}); + +viewer.dataSources.add(dataSource); * @param [name] - A human-readable name for this instance. */ export class CustomDataSource { @@ -18962,9 +18962,9 @@ export class CustomDataSource { clustering: EntityCluster; /** * Updates the data source to the provided time. This function is optional and - * is not required to be implemented. It is provided for data sources which - * retrieve data based on the current animation time or scene state. - * If implemented, update will be called by {@link DataSourceDisplay} once a frame. + is not required to be implemented. It is provided for data sources which + retrieve data based on the current animation time or scene state. + If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ @@ -18973,7 +18973,7 @@ export class CustomDataSource { /** * A {@link GeometryUpdater} for cylinders. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -19031,7 +19031,7 @@ export namespace CylinderGraphics { /** * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius. - * The center position and orientation are determined by the containing {@link Entity}. +The center position and orientation are determined by the containing {@link Entity}. * @param [options] - Object describing initialization options */ export class CylinderGraphics { @@ -19090,7 +19090,7 @@ export class CylinderGraphics { slices: Property | undefined; /** * Get or sets the enum Property specifying whether the cylinder - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -19105,7 +19105,7 @@ export class CylinderGraphics { clone(result?: CylinderGraphics): CylinderGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: CylinderGraphics): void; @@ -19142,8 +19142,8 @@ export class CzmlDataSource { name: string; /** * Gets the clock settings defined by the loaded CZML. If no clock is explicitly - * defined in the CZML, the combined availability of all objects is returned. If - * only static data exists, this value is undefined. + defined in the CZML, the combined availability of all objects is returned. If + only static data exists, this value is undefined. */ clock: DataSourceClock; /** @@ -19201,16 +19201,16 @@ export class CzmlDataSource { load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise; /** * Updates the data source to the provided time. This function is optional and - * is not required to be implemented. It is provided for data sources which - * retrieve data based on the current animation time or scene state. - * If implemented, update will be called by {@link DataSourceDisplay} once a frame. + is not required to be implemented. It is provided for data sources which + retrieve data based on the current animation time or scene state. + If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ update(time: JulianDate): boolean; /** * A helper function used by custom CZML updater functions - * which creates or updates a {@link Property} from a CZML packet. + which creates or updates a {@link Property} from a CZML packet. * @param type - The constructor function for the property being processed. * @param object - The object on which the property will be added or updated. * @param propertyName - The name of the property on the object. @@ -19222,7 +19222,7 @@ export class CzmlDataSource { static processPacketData(type: (...params: any[]) => any, object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; /** * A helper function used by custom CZML updater functions - * which creates or updates a {@link PositionProperty} from a CZML packet. + which creates or updates a {@link PositionProperty} from a CZML packet. * @param object - The object on which the property will be added or updated. * @param propertyName - The name of the property on the object. * @param packetData - The CZML packet being processed. @@ -19233,7 +19233,7 @@ export class CzmlDataSource { static processPositionPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; /** * A helper function used by custom CZML updater functions - * which creates or updates a {@link MaterialProperty} from a CZML packet. + which creates or updates a {@link MaterialProperty} from a CZML packet. * @param object - The object on which the property will be added or updated. * @param propertyName - The name of the property on the object. * @param packetData - The CZML packet being processed. @@ -19246,8 +19246,8 @@ export class CzmlDataSource { /** * Defines the interface for data sources, which turn arbitrary data into a - * {@link EntityCollection} for generic consumption. This object is an interface - * for documentation purposes and is not intended to be instantiated directly. +{@link EntityCollection} for generic consumption. This object is an interface +for documentation purposes and is not intended to be instantiated directly. */ export class DataSource { constructor(); @@ -19289,9 +19289,9 @@ export class DataSource { clustering: EntityCluster; /** * Updates the data source to the provided time. This function is optional and - * is not required to be implemented. It is provided for data sources which - * retrieve data based on the current animation time or scene state. - * If implemented, update will be called by {@link DataSourceDisplay} once a frame. + is not required to be implemented. It is provided for data sources which + retrieve data based on the current animation time or scene state. + If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ @@ -19300,7 +19300,7 @@ export class DataSource { /** * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied - * to the {@link Clock} when the DataSource is loaded. +to the {@link Clock} when the DataSource is loaded. */ export class DataSourceClock { constructor(); @@ -19310,32 +19310,32 @@ export class DataSourceClock { readonly definitionChanged: Event; /** * Gets or sets the desired start time of the clock. - * See {@link Clock#startTime}. + See {@link Clock#startTime}. */ startTime: JulianDate; /** * Gets or sets the desired stop time of the clock. - * See {@link Clock#stopTime}. + See {@link Clock#stopTime}. */ stopTime: JulianDate; /** * Gets or sets the desired current time when this data source is loaded. - * See {@link Clock#currentTime}. + See {@link Clock#currentTime}. */ currentTime: JulianDate; /** * Gets or sets the desired clock range setting. - * See {@link Clock#clockRange}. + See {@link Clock#clockRange}. */ clockRange: ClockRange; /** * Gets or sets the desired clock step setting. - * See {@link Clock#clockStep}. + See {@link Clock#clockStep}. */ clockStep: ClockStep; /** * Gets or sets the desired clock multiplier. - * See {@link Clock#multiplier}. + See {@link Clock#multiplier}. */ multiplier: number; /** @@ -19352,7 +19352,7 @@ export class DataSourceClock { equals(other: DataSourceClock): boolean; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: DataSourceClock): void; @@ -19374,24 +19374,24 @@ export class DataSourceCollection { readonly length: number; /** * An event that is raised when a data source is added to the collection. - * Event handlers are passed the data source that was added. + Event handlers are passed the data source that was added. */ readonly dataSourceAdded: Event; /** * An event that is raised when a data source is removed from the collection. - * Event handlers are passed the data source that was removed. + Event handlers are passed the data source that was removed. */ readonly dataSourceRemoved: Event; /** * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source - * that was moved, its new index after the move, and its old index prior to the move. + that was moved, its new index after the move, and its old index prior to the move. */ readonly dataSourceMoved: Event; /** * Adds a data source to the collection. * @param dataSource - A data source or a promise to a data source to add to the collection. - * When passing a promise, the data source will not actually be added - * to the collection until the promise resolves successfully. + When passing a promise, the data source will not actually be added + to the collection until the promise resolves successfully. * @returns A Promise that resolves once the data source has been added to the collection. */ add(dataSource: DataSource | Promise): Promise; @@ -19400,7 +19400,7 @@ export class DataSourceCollection { * @param dataSource - The data source to remove. * @param [destroy = false] - Whether to destroy the data source in addition to removing it. * @returns true if the data source was in the collection and was removed, - * false if the data source was not in the collection. + false if the data source was not in the collection. */ remove(dataSource: DataSource, destroy?: boolean): boolean; /** @@ -19454,17 +19454,17 @@ export class DataSourceCollection { lowerToBottom(dataSource: DataSource): void; /** * Returns true if this object was destroyed; otherwise, false. - * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. + If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the resources held by all data sources in this collection. Explicitly destroying this - * object allows for deterministic release of WebGL resources, instead of relying on the garbage - * collector. Once this object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + object allows for deterministic release of WebGL resources, instead of relying on the garbage + collector. Once this object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy(); */ @@ -19477,7 +19477,7 @@ export class DataSourceCollection { * @param options.scene - The scene in which to display the data. * @param options.dataSourceCollection - The data sources to display. * @param [options.visualizersCallback = DataSourceDisplay.defaultVisualizersCallback] - A function which creates an array of visualizers used for visualization. - * If undefined, all standard visualizers are used. + If undefined, all standard visualizers are used. */ export class DataSourceDisplay { constructor(options: { @@ -19487,7 +19487,7 @@ export class DataSourceDisplay { }); /** * Gets or sets the default function which creates an array of visualizers used for visualization. - * By default, this function uses all standard visualizers. + By default, this function uses all standard visualizers. */ static defaultVisualizersCallback(): void; /** @@ -19500,9 +19500,9 @@ export class DataSourceDisplay { dataSources: DataSourceCollection; /** * Gets the default data source instance which can be used to - * manually create and visualize entities not tied to - * a specific data source. This instance is always available - * and does not appear in the list dataSources collection. + manually create and visualize entities not tied to + a specific data source. This instance is always available + and does not appear in the list dataSources collection. */ defaultDataSource: CustomDataSource; /** @@ -19511,19 +19511,19 @@ export class DataSourceDisplay { readonly ready: boolean; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * dataSourceDisplay = dataSourceDisplay.destroy(); */ @@ -19541,8 +19541,8 @@ export namespace DataSourceDisplay { * A function which creates an array of visualizers used for visualization. * @example * function createVisualizers(scene, dataSource) { - * return [new Cesium.BillboardVisualizer(scene, dataSource.entities)]; - * } + return [new Cesium.BillboardVisualizer(scene, dataSource.entities)]; + } * @param scene - The scene to create visualizers for. * @param dataSource - The data source to create visualizers for. */ @@ -19551,7 +19551,7 @@ export namespace DataSourceDisplay { /** * A {@link GeometryUpdater} for ellipses. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -19625,9 +19625,9 @@ export namespace EllipseGraphics { /** * Describes an ellipse defined by a center point and semi-major and semi-minor axes. - * The ellipse conforms to the curvature of the globe and can be placed on the surface or - * at altitude and can optionally be extruded into a volume. - * The center point is determined by the containing {@link Entity}. +The ellipse conforms to the curvature of the globe and can be placed on the surface or +at altitude and can optionally be extruded into a volume. +The center point is determined by the containing {@link Entity}. * @param [options] - Object describing initialization options */ export class EllipseGraphics { @@ -19658,7 +19658,7 @@ export class EllipseGraphics { heightReference: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion. - * Setting this property creates volume starting at height and ending at this altitude. + Setting this property creates volume starting at height and ending at this altitude. */ extrudedHeight: Property | undefined; /** @@ -19703,7 +19703,7 @@ export class EllipseGraphics { numberOfVerticalLines: Property | undefined; /** * Get or sets the enum Property specifying whether the ellipse - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -19726,7 +19726,7 @@ export class EllipseGraphics { clone(result?: EllipseGraphics): EllipseGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: EllipseGraphics): void; @@ -19734,7 +19734,7 @@ export class EllipseGraphics { /** * A {@link GeometryUpdater} for ellipsoids. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -19878,7 +19878,7 @@ export class EllipsoidGraphics { subdivisions: Property | undefined; /** * Get or sets the enum Property specifying whether the ellipsoid - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -19893,7 +19893,7 @@ export class EllipsoidGraphics { clone(result?: EllipsoidGraphics): EllipsoidGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: EllipsoidGraphics): void; @@ -19965,8 +19965,8 @@ export namespace Entity { /** * Entity instances aggregate multiple forms of visualization into a single high-level object. - * They can be created manually and added to {@link Viewer#entities} or be produced by - * data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}. +They can be created manually and added to {@link Viewer#entities} or be produced by +data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}. * @param [options] - Object describing initialization options */ export class Entity { @@ -19977,10 +19977,10 @@ export class Entity { entityCollection: EntityCollection; /** * The availability, if any, associated with this object. - * If availability is undefined, it is assumed that this object's - * other properties will return valid data for any provided time. - * If availability exists, the objects other properties will only - * provide valid data if queried within the given interval. + If availability is undefined, it is assumed that this object's + other properties will return valid data for any provided time. + If availability exists, the objects other properties will only + provide valid data if queried within the given interval. */ availability: TimeIntervalCollection | undefined; /** @@ -19993,17 +19993,17 @@ export class Entity { readonly definitionChanged: Event; /** * Gets or sets the name of the object. The name is intended for end-user - * consumption and does not need to be unique. + consumption and does not need to be unique. */ name: string | undefined; /** * Gets or sets whether this entity should be displayed. When set to true, - * the entity is only displayed if the parent entity's show property is also true. + the entity is only displayed if the parent entity's show property is also true. */ show: boolean; /** * Gets whether this entity is being displayed, taking into account - * the visibility of any ancestor entities. + the visibility of any ancestor entities. */ isShowing: boolean; /** @@ -20096,8 +20096,8 @@ export class Entity { rectangle: RectangleGraphics | undefined; /** * Gets or sets the suggested initial offset when tracking this object. - * The offset is typically defined in the east-north-up reference frame, - * but may be another frame depending on the object's velocity. + The offset is typically defined in the east-north-up reference frame, + but may be another frame depending on the object's velocity. */ viewFrom: Property | undefined; /** @@ -20112,8 +20112,8 @@ export class Entity { isAvailable(time: JulianDate): boolean; /** * Adds a property to this object. Once a property is added, it can be - * observed with {@link Entity#definitionChanged} and composited - * with {@link CompositeEntityCollection} + observed with {@link Entity#definitionChanged} and composited + with {@link CompositeEntityCollection} * @param propertyName - The name of the property to add. */ addProperty(propertyName: string): void; @@ -20124,13 +20124,13 @@ export class Entity { removeProperty(propertyName: string): void; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: Entity): void; /** * Computes the model matrix for the entity's transform at specified time. Returns undefined if orientation or position - * are undefined. + are undefined. * @param time - The time to retrieve model matrix for. * @param [result] - The object onto which to store the result. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position or orientation are undefined. @@ -20138,16 +20138,16 @@ export class Entity { computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4; /** * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles. - * If this feature is not supported, Entities with non-color materials but no `height` will - * instead be rendered as if height is 0. + If this feature is not supported, Entities with non-color materials but no `height` will + instead be rendered as if height is 0. * @param scene - The current scene. * @returns Whether or not the current scene supports materials for entities on terrain. */ static supportsMaterialsforEntitiesOnTerrain(scene: Scene): boolean; /** * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles. - * If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at - * the provided heights and using the `arcType` parameter instead of clamped to the ground. + If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at + the provided heights and using the `arcType` parameter instead of clamped to the ground. * @param scene - The current scene. * @returns Whether or not the current scene supports polylines on terrain or 3D TIles. */ @@ -20209,11 +20209,11 @@ export class EntityCluster { clusterPoints: boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed - * from a data source collection and added to another. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed + from a data source collection and added to another. +

*/ destroy(): void; } @@ -20223,13 +20223,13 @@ export namespace EntityCluster { * A event listener function used to style clusters. * @example * // The default cluster values. - * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) { - * cluster.label.show = true; - * cluster.label.text = entities.length.toLocaleString(); - * }); + dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) { + cluster.label.show = true; + cluster.label.text = entities.length.toLocaleString(); + }); * @param clusteredEntities - An array of the entities contained in the cluster. * @param cluster - An object containing billboard, label, and point properties. The values are the same as - * billboard, label and point entities, but must be the values of the ConstantProperty. + billboard, label and point entities, but must be the values of the ConstantProperty. */ type newClusterCallback = (clusteredEntities: Entity[], cluster: any) => void; } @@ -20242,19 +20242,19 @@ export class EntityCollection { constructor(owner?: DataSource | CompositeEntityCollection); /** * Prevents {@link EntityCollection#collectionChanged} events from being raised - * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which - * point a single event will be raised that covers all suspended operations. - * This allows for many items to be added and removed efficiently. - * This function can be safely called multiple times as long as there - * are corresponding calls to {@link EntityCollection#resumeEvents}. + until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which + point a single event will be raised that covers all suspended operations. + This allows for many items to be added and removed efficiently. + This function can be safely called multiple times as long as there + are corresponding calls to {@link EntityCollection#resumeEvents}. */ suspendEvents(): void; /** * Resumes raising {@link EntityCollection#collectionChanged} events immediately - * when an item is added or removed. Any modifications made while while events were suspended - * will be triggered as a single event when this function is called. - * This function is reference counted and can safely be called multiple times as long as there - * are corresponding calls to {@link EntityCollection#resumeEvents}. + when an item is added or removed. Any modifications made while while events were suspended + will be triggered as a single event when this function is called. + This function is reference counted and can safely be called multiple times as long as there + are corresponding calls to {@link EntityCollection#resumeEvents}. */ resumeEvents(): void; /** @@ -20267,7 +20267,7 @@ export class EntityCollection { static collectionChangedEventCallback(collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]): void; /** * Gets the event that is fired when entities are added or removed from the collection. - * The generated event is a {@link EntityCollection.collectionChangedEventCallback}. + The generated event is a {@link EntityCollection.collectionChangedEventCallback}. */ readonly collectionChanged: Event; /** @@ -20276,13 +20276,13 @@ export class EntityCollection { readonly id: string; /** * Gets the array of Entity instances in the collection. - * This array should not be modified directly. + This array should not be modified directly. */ readonly values: Entity[]; /** * Gets whether or not this entity collection should be - * displayed. When true, each entity is only displayed if - * its own show property is also true. + displayed. When true, each entity is only displayed if + its own show property is also true. */ show: boolean; /** @@ -20291,9 +20291,9 @@ export class EntityCollection { readonly owner: DataSource | CompositeEntityCollection; /** * Computes the maximum availability of the entities in the collection. - * If the collection contains a mix of infinitely available data and non-infinite data, - * it will return the interval pertaining to the non-infinite data only. If all - * data is infinite, an infinite interval will be returned. + If the collection contains a mix of infinitely available data and non-infinite data, + it will return the interval pertaining to the non-infinite data only. If all + data is infinite, an infinite interval will be returned. * @returns The availability of entities in the collection. */ computeAvailability(): TimeInterval; @@ -20365,18 +20365,88 @@ export class EntityView { boundingSphere: BoundingSphere; /** * Gets or sets a camera offset that will be used to - * initialize subsequent EntityViews. + initialize subsequent EntityViews. */ static defaultOffset3D: Cartesian3; /** * Should be called each animation frame to update the camera - * to the latest settings. + to the latest settings. * @param time - The current animation time. * @param [boundingSphere] - bounding sphere of the object. */ update(time: JulianDate, boundingSphere?: BoundingSphere): void; } +/** + * @property kml - The generated KML. + * @property externalFiles - An object dictionary of external files + */ +export type exportKmlResultKml = { + kml: string; + externalFiles: { + [key: string]: Blob; + }; +}; + +/** + * @property kmz - The generated kmz file. + */ +export type exportKmlResultKmz = { + kmz: Blob; +}; + +/** + * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries +will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For +example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at +options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties +that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using +the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported +as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary +color is used. Canvas objects are exported as PNG images. + * @example + * Cesium.exportKml({ + entities: entityCollection + }) + .then(function(result) { + // The XML string is in result.kml + + var externalFiles = result.externalFiles + for(var file in externalFiles) { + // file is the name of the file used in the KML document as the href + // externalFiles[file] is a blob with the contents of the file + } + }); + * @param options - An object with the following properties: + * @param options.entities - The EntityCollection to export as KML. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for the output file. + * @param [options.modelCallback] - A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. + * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML. + * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability. + * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML. + * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file. + * @returns A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true. + */ +export function exportKml(options: { + entities: EntityCollection; + ellipsoid?: Ellipsoid; + modelCallback?: exportKmlModelCallback; + time?: JulianDate; + defaultAvailability?: TimeInterval; + sampleDuration?: number; + kmz?: boolean; +}): Promise; + +/** + * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document. +It can also be used to add additional files to the externalFiles object, which is the list of files embedded in the exported KMZ, +or otherwise returned with the KML string when exporting. + * @param model - The ModelGraphics instance for an Entity. + * @param time - The time that any properties should use to get the value. + * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob. + */ +export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string; + export namespace GeoJsonDataSource { /** * Initialization options for the `load` method. @@ -20411,19 +20481,19 @@ export namespace GeoJsonDataSource { /** * A {@link DataSource} which processes both - * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data. - * {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they - * are present. +{@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data. +{@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they +are present. * @example * var viewer = new Cesium.Viewer('cesiumContainer'); - * viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', { - * stroke: Cesium.Color.HOTPINK, - * fill: Cesium.Color.PINK, - * strokeWidth: 3, - * markerSymbol: '?' - * })); +viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', { + stroke: Cesium.Color.HOTPINK, + fill: Cesium.Color.PINK, + strokeWidth: 3, + markerSymbol: '?' +})); * @param [name] - The name of this data source. If undefined, a name will be taken from - * the name of the GeoJSON file. + the name of the GeoJSON file. */ export class GeoJsonDataSource { constructor(name?: string); @@ -20440,8 +20510,8 @@ export class GeoJsonDataSource { static markerSize: number; /** * Gets or sets the default symbol of the map pin created for each point. - * This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character, - * or blank if no symbol is to be used. + This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character, + or blank if no symbol is to be used. */ static markerSymbol: string; /** @@ -20466,24 +20536,24 @@ export class GeoJsonDataSource { static clampToGround: boolean; /** * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate - * and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which - * supported the EPSG type can be added to this list as well, by specifying the complete EPSG name, - * for example 'EPSG:4326'. + and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which + supported the EPSG type can be added to this list as well, by specifying the complete EPSG name, + for example 'EPSG:4326'. */ static crsNames: any; /** * Gets an object that maps the href property of a crs link to a callback function - * which takes the crs properties object and returns a Promise that resolves - * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian. - * Items in this object take precedence over those defined in crsLinkHrefs, assuming - * the link has a type specified. + which takes the crs properties object and returns a Promise that resolves + to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian. + Items in this object take precedence over those defined in crsLinkHrefs, assuming + the link has a type specified. */ static crsLinkHrefs: any; /** * Gets an object that maps the type property of a crs link to a callback function - * which takes the crs properties object and returns a Promise that resolves - * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian. - * Items in crsLinkHrefs take precedence over this object. + which takes the crs properties object and returns a Promise that resolves + to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian. + Items in crsLinkHrefs take precedence over this object. */ static crsLinkTypes: any; /** @@ -20532,7 +20602,7 @@ export class GeoJsonDataSource { * @param [options] - An object with the following properties: * @param [options.sourceUri] - Overrides the url to use for resolving relative links. * @param [options.describe = GeoJsonDataSource.defaultDescribeProperty] - A function which returns a Property object (or just a string), - * which converts the properties into an html description. + which converts the properties into an html description. * @param [options.markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels. * @param [options.markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point. * @param [options.markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point. @@ -20557,9 +20627,9 @@ export class GeoJsonDataSource { }): Promise; /** * Updates the data source to the provided time. This function is optional and - * is not required to be implemented. It is provided for data sources which - * retrieve data based on the current animation time or scene state. - * If implemented, update will be called by {@link DataSourceDisplay} once a frame. + is not required to be implemented. It is provided for data sources which + retrieve data based on the current animation time or scene state. + If implemented, update will be called by {@link DataSourceDisplay} once a frame. * @param time - The simulation time. * @returns True if this data source is ready to be displayed at the provided time, false otherwise. */ @@ -20617,12 +20687,12 @@ export class GeometryUpdater { readonly outlineColorProperty: Property; /** * Gets the constant with of the geometry outline, in pixels. - * This value is only valid if isDynamic is false. + This value is only valid if isDynamic is false. */ readonly outlineWidth: number; /** * Gets the property specifying whether the geometry - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ readonly shadowsProperty: Property; /** @@ -20635,18 +20705,18 @@ export class GeometryUpdater { readonly classificationTypeProperty: Property; /** * Gets a value indicating if the geometry is time-varying. - * If true, all visualization is delegated to a DynamicGeometryUpdater - * returned by GeometryUpdater#createDynamicUpdater. + If true, all visualization is delegated to a DynamicGeometryUpdater + returned by GeometryUpdater#createDynamicUpdater. */ readonly isDynamic: boolean; /** * Gets a value indicating if the geometry is closed. - * This property is only valid for static geometry. + This property is only valid for static geometry. */ readonly isClosed: boolean; /** * Gets an event that is raised whenever the public properties - * of this updater change. + of this updater change. */ readonly geometryChanged: boolean; /** @@ -20695,10 +20765,10 @@ export class GeometryVisualizer { constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection); /** * Updates all of the primitives created by this visualizer to match their - * Entity counterpart at the given time. + Entity counterpart at the given time. * @param time - The time to update to. * @returns True if the visualizer successfully updated to the provided time, - * false if the visualizer is waiting for asynchronous primitives to be created. + false if the visualizer is waiting for asynchronous primitives to be created. */ update(time: JulianDate): boolean; /** @@ -20731,13 +20801,13 @@ export class GridMaterialProperty { }); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -20775,7 +20845,7 @@ export class GridMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -20826,13 +20896,13 @@ export class ImageMaterialProperty { }); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -20866,7 +20936,7 @@ export class ImageMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -20904,26 +20974,26 @@ export namespace KmlDataSource { /** * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML). - *

- * KML support in Cesium is incomplete, but a large amount of the standard, - * as well as Google's gx extension namespace, is supported. See Github issue - * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a - * detailed list of what is and isn't support. Cesium will also write information to the - * console when it encounters most unsupported features. - *

- *

- * Non visual feature data, such as atom:author and ExtendedData - * is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity} - * under the kml property. - *

+

+KML support in Cesium is incomplete, but a large amount of the standard, +as well as Google's gx extension namespace, is supported. See Github issue +{@link https://github.com/CesiumGS/cesium/issues/873|#873} for a +detailed list of what is and isn't support. Cesium will also write information to the +console when it encounters most unsupported features. +

+

+Non visual feature data, such as atom:author and ExtendedData +is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity} +under the kml property. +

* @example * var viewer = new Cesium.Viewer('cesiumContainer'); - * viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz', - * { - * camera: viewer.scene.camera, - * canvas: viewer.scene.canvas - * }) - * ); +viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz', + { + camera: viewer.scene.camera, + canvas: viewer.scene.canvas + }) +); * @param options - An object with the following properties: * @param options.camera - The camera that is used for viewRefreshModes and sending camera properties to network links. * @param options.canvas - The canvas that is used for sending viewer properties to network links. @@ -20946,13 +21016,13 @@ export class KmlDataSource { static load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise; /** * Gets or sets a human-readable name for this instance. - * This will be automatically be set to the KML document name on load. + This will be automatically be set to the KML document name on load. */ name: string; /** * Gets the clock settings defined by the loaded KML. This represents the total - * availability interval for all time-dynamic data. If the KML does not contain - * time-dynamic data, this value is undefined. + availability interval for all time-dynamic data. If the KML does not contain + time-dynamic data, this value is undefined. */ clock: DataSourceClock; /** @@ -21044,8 +21114,8 @@ export class KmlFeatureData { snippet: string; /** * Gets the extended data, parsed into a JSON object. - * Currently only the Data property is supported. - * SchemaData and custom data are ignored. + Currently only the Data property is supported. + SchemaData and custom data are ignored. */ extendedData: string; } @@ -21112,29 +21182,29 @@ export class KmlTour { playlist: any[]; /** * Event will be called when tour starts to play, - * before any playlist entry starts to play. + before any playlist entry starts to play. */ tourStart: Event; /** * Event will be called when all playlist entries are - * played, or tour playback being canceled. - * - * If tour playback was terminated, event callback will - * be called with terminated=true parameter. + played, or tour playback being canceled. + + If tour playback was terminated, event callback will + be called with terminated=true parameter. */ tourEnd: Event; /** * Event will be called when entry from playlist starts to play. - * - * Event callback will be called with curent entry as first parameter. + + Event callback will be called with curent entry as first parameter. */ entryStart: Event; /** * Event will be called when entry from playlist ends to play. - * - * Event callback will be called with following parameters: - * 1. entry - entry - * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop} + + Event callback will be called with following parameters: + 1. entry - entry + 2. terminated - true if playback was terminated by calling {@link KmlTour#stop} */ entryEnd: Event; /** @@ -21146,7 +21216,7 @@ export class KmlTour { * Play this tour. * @param viewer - viewer widget. * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo} - * options for FlyTo playlist entries. + options for FlyTo playlist entries. */ play(viewer: Viewer, cameraOptions?: any): void; /** @@ -21175,7 +21245,7 @@ export class KmlTourFlyTo { stop(): void; /** * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} - * depends on this.view type. + depends on this.view type. * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo} * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options */ @@ -21186,7 +21256,7 @@ export namespace KmlTourFlyTo { /** * A function that will be executed when the flight completes. * @param terminated - true if {@link KmlTourFlyTo#stop} was - * called before entry done playback. + called before entry done playback. */ type DoneCallback = (terminated: boolean) => void; } @@ -21211,7 +21281,7 @@ export namespace KmlTourWait { /** * A function which will be called when playback ends. * @param terminated - true if {@link KmlTourWait#stop} was - * called before entry done playback. + called before entry done playback. */ type DoneCallback = (terminated: boolean) => void; } @@ -21268,12 +21338,12 @@ export namespace LabelGraphics { /** * Describes a two dimensional label located at the position of the containing {@link Entity}. - *

- *

- *
- * Example labels - *
- *

+

+

+
+Example labels +
+

* @param [options] - Object describing initialization options */ export class LabelGraphics { @@ -21288,7 +21358,7 @@ export class LabelGraphics { show: Property | undefined; /** * Gets or sets the string Property specifying the text of the label. - * Explicit newlines '\n' are supported. + Explicit newlines '\n' are supported. */ text: Property | undefined; /** @@ -21301,14 +21371,14 @@ export class LabelGraphics { style: Property | undefined; /** * Gets or sets the numeric Property specifying the uniform scale to apply to the image. - * A scale greater than 1.0 enlarges the label while a scale less than 1.0 shrinks it. - *

- *

- *
- * From left to right in the above image, the scales are 0.5, 1.0, - * and 2.0. - *
- *

+ A scale greater than 1.0 enlarges the label while a scale less than 1.0 shrinks it. +

+

+
+ From left to right in the above image, the scales are 0.5, 1.0, + and 2.0. +
+

*/ scale: Property | undefined; /** @@ -21321,44 +21391,44 @@ export class LabelGraphics { backgroundColor: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical - * background padding in pixels. + background padding in pixels. */ backgroundPadding: Property | undefined; /** * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space - * from the origin of this label. This is commonly used to align multiple labels and labels at - * the same position, e.g., an image and text. The screen space origin is the top, left corner of the - * canvas; x increases from left to right, and y increases from top to bottom. - *

- *

- * - * - * - *
default
l.pixeloffset = new Cartesian2(25, 75);
- * The label's origin is indicated by the yellow point. - *
- *

+ from the origin of this label. This is commonly used to align multiple labels and labels at + the same position, e.g., an image and text. The screen space origin is the top, left corner of the + canvas; x increases from left to right, and y increases from top to bottom. +

+

+ + + +
default
l.pixeloffset = new Cartesian2(25, 75);
+ The label's origin is indicated by the yellow point. +
+

*/ pixelOffset: Property | undefined; /** * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates. - * Eye coordinates is a left-handed coordinate system, where x points towards the viewer's - * right, y points up, and z points into the screen. - *

- * An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to - * arrange a label above its corresponding 3D model. - *

- * Below, the label is positioned at the center of the Earth but an eye offset makes it always - * appear on top of the Earth regardless of the viewer's or Earth's orientation. - *

- *

- * - * - * - *
- * l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

- *
- *

+ Eye coordinates is a left-handed coordinate system, where x points towards the viewer's + right, y points up, and z points into the screen. +

+ An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to + arrange a label above its corresponding 3D model. +

+ Below, the label is positioned at the center of the Earth but an eye offset makes it always + appear on top of the Earth regardless of the viewer's or Earth's orientation. +

+

+ + + +
+ l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

+
+

*/ eyeOffset: Property | undefined; /** @@ -21387,27 +21457,27 @@ export class LabelGraphics { outlineWidth: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera. - * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the label's translucency remains clamped to the nearest bound. + A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's translucency remains clamped to the nearest bound. */ translucencyByDistance: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera. - * A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the label's pixel offset remains clamped to the nearest bound. + A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's pixel offset remains clamped to the nearest bound. */ pixelOffsetScaleByDistance: Property | undefined; /** * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera. - * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, - * scaleByDistance will be disabled. + A label's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, + scaleByDistance will be disabled. */ scaleByDistance: Property | undefined; /** @@ -21416,7 +21486,7 @@ export class LabelGraphics { distanceDisplayCondition: Property | undefined; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. - * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: Property | undefined; /** @@ -21427,7 +21497,7 @@ export class LabelGraphics { clone(result?: LabelGraphics): LabelGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: LabelGraphics): void; @@ -21435,7 +21505,7 @@ export class LabelGraphics { /** * A {@link Visualizer} which maps the {@link LabelGraphics} instance - * in {@link Entity#label} to a {@link Label}. +in {@link Entity#label} to a {@link Label}. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities. * @param entityCollection - The entityCollection to visualize. */ @@ -21443,7 +21513,7 @@ export class LabelVisualizer { constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); /** * Updates the primitives created by this visualizer to match their - * Entity counterpart at the given time. + Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ @@ -21461,19 +21531,19 @@ export class LabelVisualizer { /** * The interface for all {@link Property} objects that represent {@link Material} uniforms. - * This type defines an interface and cannot be instantiated directly. +This type defines an interface and cannot be instantiated directly. */ export class MaterialProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -21491,7 +21561,7 @@ export class MaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -21554,11 +21624,11 @@ export namespace ModelGraphics { /** * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL. - * The position and orientation of the model is determined by the containing {@link Entity}. - *

- * Cesium includes support for glTF geometry, materials, animations, and skinning. - * Cameras and lights are not currently supported. - *

+The position and orientation of the model is determined by the containing {@link Entity}. +

+Cesium includes support for glTF geometry, materials, animations, and skinning. +Cameras and lights are not currently supported. +

* @param [options] - Object describing initialization options */ export class ModelGraphics { @@ -21577,26 +21647,26 @@ export class ModelGraphics { uri: Property | undefined; /** * Gets or sets the numeric Property specifying a uniform linear scale - * for this model. Values greater than 1.0 increase the size of the model while - * values less than 1.0 decrease it. + for this model. Values greater than 1.0 increase the size of the model while + values less than 1.0 decrease it. */ scale: Property | undefined; /** * Gets or sets the numeric Property specifying the approximate minimum - * pixel size of the model regardless of zoom. This can be used to ensure that - * a model is visible even when the viewer zooms out. When 0.0, - * no minimum size is enforced. + pixel size of the model regardless of zoom. This can be used to ensure that + a model is visible even when the viewer zooms out. When 0.0, + no minimum size is enforced. */ minimumPixelSize: Property | undefined; /** * Gets or sets the numeric Property specifying the maximum scale - * size of a model. This property is used as an upper limit for - * {@link ModelGraphics#minimumPixelSize}. + size of a model. This property is used as an upper limit for + {@link ModelGraphics#minimumPixelSize}. */ maximumScale: Property | undefined; /** * Get or sets the boolean Property specifying whether textures - * may continue to stream in after the model is loaded. + may continue to stream in after the model is loaded. */ incrementallyLoadTextures: Property | undefined; /** @@ -21609,7 +21679,7 @@ export class ModelGraphics { clampAnimations: Property | undefined; /** * Get or sets the enum Property specifying whether the model - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -21634,8 +21704,8 @@ export class ModelGraphics { colorBlendMode: Property | undefined; /** * A numeric Property specifying the color strength when the colorBlendMode is MIX. - * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with - * any value in-between resulting in a mix of the two. + A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with + any value in-between resulting in a mix of the two. */ colorBlendAmount: Property | undefined; /** @@ -21652,13 +21722,13 @@ export class ModelGraphics { distanceDisplayCondition: Property | undefined; /** * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are - * names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. - * The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation. + names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. + The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation. */ nodeTransformations: PropertyBag; /** * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are - * composed as the name of the articulation, a single space, and the name of the stage. + composed as the name of the articulation, a single space, and the name of the stage. */ articulations: PropertyBag; /** @@ -21673,7 +21743,7 @@ export class ModelGraphics { clone(result?: ModelGraphics): ModelGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: ModelGraphics): void; @@ -21688,7 +21758,7 @@ export class ModelVisualizer { constructor(scene: Scene, entityCollection: EntityCollection); /** * Updates models created this visualizer to match their - * Entity counterpart at the given time. + Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ @@ -21719,13 +21789,13 @@ export class NodeTransformationProperty { }); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -21749,7 +21819,7 @@ export class NodeTransformationProperty { getValue(time: JulianDate, result?: TranslationRotationScale): TranslationRotationScale; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -21824,7 +21894,7 @@ export class PathGraphics { clone(result?: PathGraphics): PathGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PathGraphics): void; @@ -21839,7 +21909,7 @@ export class PathVisualizer { constructor(scene: Scene, entityCollection: EntityCollection); /** * Updates all of the primitives created by this visualizer to match their - * Entity counterpart at the given time. + Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ @@ -21857,7 +21927,7 @@ export class PathVisualizer { /** * A {@link GeometryUpdater} for planes. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -21949,7 +22019,7 @@ export class PlaneGraphics { outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the plane - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -21964,7 +22034,7 @@ export class PlaneGraphics { clone(result?: PlaneGraphics): PlaneGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PlaneGraphics): void; @@ -22034,15 +22104,15 @@ export class PointGraphics { outlineWidth: Property | undefined; /** * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance. - * If undefined, a constant size is used. + If undefined, a constant size is used. */ scaleByDistance: Property | undefined; /** * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera. - * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the points's translucency remains clamped to the nearest bound. + A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the points's translucency remains clamped to the nearest bound. */ translucencyByDistance: Property | undefined; /** @@ -22051,7 +22121,7 @@ export class PointGraphics { distanceDisplayCondition: Property | undefined; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. - * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: Property | undefined; /** @@ -22062,7 +22132,7 @@ export class PointGraphics { clone(result?: PointGraphics): PointGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PointGraphics): void; @@ -22077,7 +22147,7 @@ export class PointVisualizer { constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); /** * Updates the primitives created by this visualizer to match their - * Entity counterpart at the given time. + Entity counterpart at the given time. * @param time - The time to update to. * @returns This function always returns true. */ @@ -22095,7 +22165,7 @@ export class PointVisualizer { /** * A {@link GeometryUpdater} for polygons. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -22167,8 +22237,8 @@ export namespace PolygonGraphics { /** * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes. - * The polygon conforms to the curvature of the globe and can be placed on the surface or - * at altitude and can optionally be extruded into a volume. +The polygon conforms to the curvature of the globe and can be placed on the surface or +at altitude and can optionally be extruded into a volume. * @param [options] - Object describing initialization options */ export class PolygonGraphics { @@ -22195,8 +22265,8 @@ export class PolygonGraphics { heightReference: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the polygon extrusion. - * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude. - * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude. + If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude. + If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude. */ extrudedHeight: Property | undefined; /** @@ -22233,8 +22303,8 @@ export class PolygonGraphics { outlineWidth: Property | undefined; /** * Gets or sets the boolean specifying whether or not the the height of each position is used. - * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position. - * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}. + If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position. + If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}. */ perPositionHeight: Property | undefined; /** @@ -22251,7 +22321,7 @@ export class PolygonGraphics { arcType: Property | undefined; /** * Get or sets the enum Property specifying whether the polygon - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -22274,7 +22344,7 @@ export class PolygonGraphics { clone(result?: PolygonGraphics): PolygonGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PolygonGraphics): void; @@ -22288,13 +22358,13 @@ export class PolylineArrowMaterialProperty { constructor(color?: Property | Color); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -22316,7 +22386,7 @@ export class PolylineArrowMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -22340,13 +22410,13 @@ export class PolylineDashMaterialProperty { }); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -22380,7 +22450,7 @@ export class PolylineDashMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -22389,7 +22459,7 @@ export class PolylineDashMaterialProperty { /** * A {@link GeometryUpdater} for polylines. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -22433,7 +22503,7 @@ export class PolylineGeometryUpdater { readonly outlineColorProperty: Property; /** * Gets the property specifying whether the geometry - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ readonly shadowsProperty: Property; /** @@ -22446,18 +22516,18 @@ export class PolylineGeometryUpdater { readonly classificationTypeProperty: Property; /** * Gets a value indicating if the geometry is time-varying. - * If true, all visualization is delegated to the {@link DynamicGeometryUpdater} - * returned by GeometryUpdater#createDynamicUpdater. + If true, all visualization is delegated to the {@link DynamicGeometryUpdater} + returned by GeometryUpdater#createDynamicUpdater. */ readonly isDynamic: boolean; /** * Gets a value indicating if the geometry is closed. - * This property is only valid for static geometry. + This property is only valid for static geometry. */ readonly isClosed: boolean; /** * Gets an event that is raised whenever the public properties - * of this updater change. + of this updater change. */ readonly geometryChanged: boolean; /** @@ -22466,7 +22536,7 @@ export class PolylineGeometryUpdater { readonly arcType: ArcType; /** * Gets a value indicating if the geometry is clamped to the ground. - * Returns false if polylines on terrain is not supported. + Returns false if polylines on terrain is not supported. */ readonly clampToGround: boolean; /** @@ -22523,13 +22593,13 @@ export class PolylineGlowMaterialProperty { }); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -22559,7 +22629,7 @@ export class PolylineGlowMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -22600,8 +22670,8 @@ export namespace PolylineGraphics { /** * Describes a polyline. The first two positions define a line segment, - * and each additional position defines a line segment from the previous position. The segments - * can be linear connected points, great arcs, or clamped to terrain. +and each additional position defines a line segment from the previous position. The segments +can be linear connected points, great arcs, or clamped to terrain. * @param [options] - Object describing initialization options */ export class PolylineGraphics { @@ -22616,7 +22686,7 @@ export class PolylineGraphics { show: Property | undefined; /** * Gets or sets the Property specifying the array of {@link Cartesian3} - * positions that define the line strip. + positions that define the line strip. */ positions: Property | undefined; /** @@ -22633,10 +22703,10 @@ export class PolylineGraphics { material: MaterialProperty; /** * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test. - *

- * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, - * there may be artifacts. - *

+

+ Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, + there may be artifacts. +

*/ depthFailMaterial: MaterialProperty; /** @@ -22645,12 +22715,12 @@ export class PolylineGraphics { arcType: Property | undefined; /** * Gets or sets the boolean Property specifying whether the polyline - * should be clamped to the ground. + should be clamped to the ground. */ clampToGround: Property | undefined; /** * Get or sets the enum Property specifying whether the polyline - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -22673,7 +22743,7 @@ export class PolylineGraphics { clone(result?: PolylineGraphics): PolylineGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PolylineGraphics): void; @@ -22694,13 +22764,13 @@ export class PolylineOutlineMaterialProperty { }); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -22730,7 +22800,7 @@ export class PolylineOutlineMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -22748,10 +22818,10 @@ export class PolylineVisualizer { constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection); /** * Updates all of the primitives created by this visualizer to match their - * Entity counterpart at the given time. + Entity counterpart at the given time. * @param time - The time to update to. * @returns True if the visualizer successfully updated to the provided time, - * false if the visualizer is waiting for asynchronous primitives to be created. + false if the visualizer is waiting for asynchronous primitives to be created. */ update(time: JulianDate): boolean; /** @@ -22767,7 +22837,7 @@ export class PolylineVisualizer { /** * A {@link GeometryUpdater} for polyline volumes. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -22821,7 +22891,7 @@ export namespace PolylineVolumeGraphics { /** * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it. - * The resulting volume conforms to the curvature of the globe. +The resulting volume conforms to the curvature of the globe. * @param [options] - Object describing initialization options */ export class PolylineVolumeGraphics { @@ -22872,7 +22942,7 @@ export class PolylineVolumeGraphics { outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the volume - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -22887,7 +22957,7 @@ export class PolylineVolumeGraphics { clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: PolylineVolumeGraphics): void; @@ -22895,20 +22965,20 @@ export class PolylineVolumeGraphics { /** * The interface for all {@link Property} objects that define a world - * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}. - * This type defines an interface and cannot be instantiated directly. +location as a {@link Cartesian3} with an associated {@link ReferenceFrame}. +This type defines an interface and cannot be instantiated directly. */ export class PositionProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -22932,7 +23002,7 @@ export class PositionProperty { getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -22941,7 +23011,7 @@ export class PositionProperty { /** * A {@link Property} whose value is an array whose items are the computed value - * of other PositionProperty instances. +of other PositionProperty instances. * @param [value] - An array of Property instances. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. */ @@ -22949,13 +23019,13 @@ export class PositionPropertyArray { constructor(value?: Property[], referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. This property - * is considered constant if all property items in the array are constant. + is considered constant if all property items in the array are constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever setValue is called with data different - * than the current value or one of the properties in the array also changes. + The definition is changed whenever setValue is called with data different + than the current value or one of the properties in the array also changes. */ readonly definitionChanged: Event; /** @@ -22984,7 +23054,7 @@ export class PositionPropertyArray { setValue(value: Property[]): void; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -22993,19 +23063,19 @@ export class PositionPropertyArray { /** * The interface for all properties, which represent a value that can optionally vary over time. - * This type defines an interface and cannot be instantiated directly. +This type defines an interface and cannot be instantiated directly. */ export class Property { constructor(); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -23017,7 +23087,7 @@ export class Property { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23026,20 +23096,20 @@ export class Property { /** * A {@link Property} whose value is an array whose items are the computed value - * of other property instances. +of other property instances. * @param [value] - An array of Property instances. */ export class PropertyArray { constructor(value?: Property[]); /** * Gets a value indicating if this property is constant. This property - * is considered constant if all property items in the array are constant. + is considered constant if all property items in the array are constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever setValue is called with data different - * than the current value or one of the properties in the array also changes. + The definition is changed whenever setValue is called with data different + than the current value or one of the properties in the array also changes. */ readonly definitionChanged: Event; /** @@ -23056,7 +23126,7 @@ export class PropertyArray { setValue(value: Property[]): void; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23079,12 +23149,12 @@ export class PropertyBag implements DictionaryLike { propertyNames: any[]; /** * Gets a value indicating if this property is constant. This property - * is considered constant if all property items in this object are constant. + is considered constant if all property items in this object are constant. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the set of properties contained in this - * object changes, or one of the properties itself changes. + object changes, or one of the properties itself changes. */ readonly definitionChanged: Event; /** @@ -23107,23 +23177,23 @@ export class PropertyBag implements DictionaryLike { removeProperty(propertyName: string): void; /** * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall - * result will be an object, mapping property names to those values. + result will be an object, mapping property names to those values. * @param time - The time for which to retrieve the value. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. - * Note that any properties in result which are not part of this PropertyBag will be left as-is. + Note that any properties in result which are not part of this PropertyBag will be left as-is. * @returns The modified result parameter or a new instance if the result parameter was not supplied. */ getValue(time: JulianDate, result?: any): any; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property. */ merge(source: any, createPropertyCallback?: (...params: any[]) => any): void; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23132,7 +23202,7 @@ export class PropertyBag implements DictionaryLike { /** * A {@link GeometryUpdater} for rectangles. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -23198,8 +23268,8 @@ export namespace RectangleGraphics { /** * Describes graphics for a {@link Rectangle}. - * The rectangle conforms to the curvature of the globe and can be placed on the surface or - * at altitude and can optionally be extruded into a volume. +The rectangle conforms to the curvature of the globe and can be placed on the surface or +at altitude and can optionally be extruded into a volume. * @param [options] - Object describing initialization options */ export class RectangleGraphics { @@ -23226,7 +23296,7 @@ export class RectangleGraphics { heightReference: Property | undefined; /** * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion. - * Setting this property creates volume starting at height and ending at this altitude. + Setting this property creates volume starting at height and ending at this altitude. */ extrudedHeight: Property | undefined; /** @@ -23267,7 +23337,7 @@ export class RectangleGraphics { outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the rectangle - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -23290,7 +23360,7 @@ export class RectangleGraphics { clone(result?: RectangleGraphics): RectangleGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: RectangleGraphics): void; @@ -23300,35 +23370,35 @@ export class RectangleGraphics { * A {@link Property} which transparently links to another property on a provided object. * @example * var collection = new Cesium.EntityCollection(); - * - * //Create a new entity and assign a billboard scale. - * var object1 = new Cesium.Entity({id:'object1'}); - * object1.billboard = new Cesium.BillboardGraphics(); - * object1.billboard.scale = new Cesium.ConstantProperty(2.0); - * collection.add(object1); - * - * //Create a second entity and reference the scale from the first one. - * var object2 = new Cesium.Entity({id:'object2'}); - * object2.model = new Cesium.ModelGraphics(); - * object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']); - * collection.add(object2); - * - * //Create a third object, but use the fromString helper function. - * var object3 = new Cesium.Entity({id:'object3'}); - * object3.billboard = new Cesium.BillboardGraphics(); - * object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale'); - * collection.add(object3); - * - * //You can refer to an entity with a # or . in id and property names by escaping them. - * var object4 = new Cesium.Entity({id:'#object.4'}); - * object4.billboard = new Cesium.BillboardGraphics(); - * object4.billboard.scale = new Cesium.ConstantProperty(2.0); - * collection.add(object4); - * - * var object5 = new Cesium.Entity({id:'object5'}); - * object5.billboard = new Cesium.BillboardGraphics(); - * object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale'); - * collection.add(object5); + +//Create a new entity and assign a billboard scale. +var object1 = new Cesium.Entity({id:'object1'}); +object1.billboard = new Cesium.BillboardGraphics(); +object1.billboard.scale = new Cesium.ConstantProperty(2.0); +collection.add(object1); + +//Create a second entity and reference the scale from the first one. +var object2 = new Cesium.Entity({id:'object2'}); +object2.model = new Cesium.ModelGraphics(); +object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']); +collection.add(object2); + +//Create a third object, but use the fromString helper function. +var object3 = new Cesium.Entity({id:'object3'}); +object3.billboard = new Cesium.BillboardGraphics(); +object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale'); +collection.add(object3); + +//You can refer to an entity with a # or . in id and property names by escaping them. +var object4 = new Cesium.Entity({id:'#object.4'}); +object4.billboard = new Cesium.BillboardGraphics(); +object4.billboard.scale = new Cesium.ConstantProperty(2.0); +collection.add(object4); + +var object5 = new Cesium.Entity({id:'object5'}); +object5.billboard = new Cesium.BillboardGraphics(); +object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale'); +collection.add(object5); * @param targetCollection - The entity collection which will be used to resolve the reference. * @param targetId - The id of the entity which is being referenced. * @param targetPropertyNames - The names of the property on the target entity which we will use. @@ -23341,12 +23411,12 @@ export class ReferenceProperty { readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever the referenced property's definition is changed. + The definition is changed whenever the referenced property's definition is changed. */ readonly definitionChanged: Event; /** * Gets the reference frame that the position is defined in. - * This property is only valid if the referenced property is a {@link PositionProperty}. + This property is only valid if the referenced property is a {@link PositionProperty}. */ readonly referenceFrame: ReferenceFrame; /** @@ -23367,10 +23437,10 @@ export class ReferenceProperty { readonly resolvedProperty: Property | undefined; /** * Creates a new instance given the entity collection that will - * be used to resolve it and a string indicating the target entity id and property. - * The format of the string is "objectId#foo.bar", where # separates the id from - * property path and . separates sub-properties. If the reference identifier or - * or any sub-properties contains a # . or \ they must be escaped. + be used to resolve it and a string indicating the target entity id and property. + The format of the string is "objectId#foo.bar", where # separates the id from + property path and . separates sub-properties. If the reference identifier or + or any sub-properties contains a # . or \ they must be escaped. * @returns A new instance of ReferenceProperty. */ static fromString(targetCollection: EntityCollection, referenceString: string): ReferenceProperty; @@ -23383,7 +23453,7 @@ export class ReferenceProperty { getValue(time: JulianDate, result?: any): any; /** * Gets the value of the property at the provided time and in the provided reference frame. - * This method is only valid if the property being referenced is a {@link PositionProperty}. + This method is only valid if the property being referenced is a {@link PositionProperty}. * @param time - The time for which to retrieve the value. * @param referenceFrame - The desired referenceFrame of the result. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. @@ -23392,14 +23462,14 @@ export class ReferenceProperty { getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; /** * Gets the {@link Material} type at the provided time. - * This method is only valid if the property being referenced is a {@link MaterialProperty}. + This method is only valid if the property being referenced is a {@link MaterialProperty}. * @param time - The time for which to retrieve the type. * @returns The type of material. */ getType(time: JulianDate): string; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23449,23 +23519,23 @@ export namespace Rotation { /** * Represents a {@link Packable} number that always interpolates values - * towards the shortest angle of rotation. This object is never used directly - * but is instead passed to the constructor of {@link SampledProperty} - * in order to represent a two-dimensional angle of rotation. +towards the shortest angle of rotation. This object is never used directly +but is instead passed to the constructor of {@link SampledProperty} +in order to represent a two-dimensional angle of rotation. * @example * var time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00'); - * var time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00'); - * var time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00'); - * - * var property = new Cesium.SampledProperty(Cesium.Rotation); - * property.addSample(time1, 0); - * property.addSample(time3, Cesium.Math.toRadians(350)); - * - * //Getting the value at time2 will equal 355 degrees instead - * //of 175 degrees (which is what you get if you construct - * //a SampledProperty(Number) instead. Note, the actual - * //return value is in radians, not degrees. - * property.getValue(time2); +var time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00'); +var time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00'); + +var property = new Cesium.SampledProperty(Cesium.Rotation); +property.addSample(time1, 0); +property.addSample(time3, Cesium.Math.toRadians(350)); + +//Getting the value at time2 will equal 355 degrees instead +//of 175 degrees (which is what you get if you construct +//a SampledProperty(Number) instead. Note, the actual +//return value is in radians, not degrees. +property.getValue(time2); */ export interface Rotation { } @@ -23479,13 +23549,13 @@ export class SampledPositionProperty { constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -23506,22 +23576,22 @@ export class SampledPositionProperty { numberOfDerivatives: number; /** * Gets or sets the type of extrapolation to perform when a value - * is requested at a time after any available samples. + is requested at a time after any available samples. */ forwardExtrapolationType: ExtrapolationType; /** * Gets or sets the amount of time to extrapolate forward before - * the property becomes undefined. A value of 0 will extrapolate forever. + the property becomes undefined. A value of 0 will extrapolate forever. */ forwardExtrapolationDuration: number; /** * Gets or sets the type of extrapolation to perform when a value - * is requested at a time before any available samples. + is requested at a time before any available samples. */ backwardExtrapolationType: ExtrapolationType; /** * Gets or sets the amount of time to extrapolate backward - * before the property becomes undefined. A value of 0 will extrapolate forever. + before the property becomes undefined. A value of 0 will extrapolate forever. */ backwardExtrapolationDuration: number; /** @@ -23565,7 +23635,7 @@ export class SampledPositionProperty { addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void; /** * Adds samples as a single packed array where each new sample is represented as a date, - * followed by the packed representation of the corresponding value and derivatives. + followed by the packed representation of the corresponding value and derivatives. * @param packedSamples - The array of packed samples. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds. */ @@ -23583,7 +23653,7 @@ export class SampledPositionProperty { removeSamples(time: TimeInterval): void; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23592,37 +23662,37 @@ export class SampledPositionProperty { /** * A {@link Property} whose value is interpolated for a given time from the - * provided set of samples and specified interpolation algorithm and degree. +provided set of samples and specified interpolation algorithm and degree. * @example * //Create a linearly interpolated Cartesian2 - * var property = new Cesium.SampledProperty(Cesium.Cartesian2); - * - * //Populate it with data - * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0)); - * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7)); - * - * //Retrieve an interpolated value - * var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z')); +var property = new Cesium.SampledProperty(Cesium.Cartesian2); + +//Populate it with data +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0)); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7)); + +//Retrieve an interpolated value +var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z')); * @example * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation - * var property = new Cesium.SampledProperty(Number); - * property.setInterpolationOptions({ - * interpolationDegree : 3, - * interpolationAlgorithm : Cesium.HermitePolynomialApproximation - * }); - * - * //Populate it with data - * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0); - * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0); - * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0); - * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0); - * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0); - * - * //Samples can be added in any order. - * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2); - * - * //Retrieve an interpolated value - * var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z')); +var property = new Cesium.SampledProperty(Number); +property.setInterpolationOptions({ + interpolationDegree : 3, + interpolationAlgorithm : Cesium.HermitePolynomialApproximation +}); + +//Populate it with data +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0); + +//Samples can be added in any order. +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2); + +//Retrieve an interpolated value +var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z')); * @param type - The type of property. * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types. */ @@ -23630,13 +23700,13 @@ export class SampledProperty { constructor(type: number | Packable, derivativeTypes?: Packable[]); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -23657,22 +23727,22 @@ export class SampledProperty { interpolationAlgorithm: InterpolationAlgorithm; /** * Gets or sets the type of extrapolation to perform when a value - * is requested at a time after any available samples. + is requested at a time after any available samples. */ forwardExtrapolationType: ExtrapolationType; /** * Gets or sets the amount of time to extrapolate forward before - * the property becomes undefined. A value of 0 will extrapolate forever. + the property becomes undefined. A value of 0 will extrapolate forever. */ forwardExtrapolationDuration: number; /** * Gets or sets the type of extrapolation to perform when a value - * is requested at a time before any available samples. + is requested at a time before any available samples. */ backwardExtrapolationType: ExtrapolationType; /** * Gets or sets the amount of time to extrapolate backward - * before the property becomes undefined. A value of 0 will extrapolate forever. + before the property becomes undefined. A value of 0 will extrapolate forever. */ backwardExtrapolationDuration: number; /** @@ -23708,7 +23778,7 @@ export class SampledProperty { addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void; /** * Adds samples as a single packed array where each new sample is represented as a date, - * followed by the packed representation of the corresponding value and derivatives. + followed by the packed representation of the corresponding value and derivatives. * @param packedSamples - The array of packed samples. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds. */ @@ -23726,7 +23796,7 @@ export class SampledProperty { removeSamples(time: TimeInterval): void; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23752,13 +23822,13 @@ export class StripeMaterialProperty { }); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -23775,9 +23845,9 @@ export class StripeMaterialProperty { oddColor: Property | undefined; /** * Gets or sets the numeric Property specifying the point into the pattern - * to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning - * of the odd color, 2.0 being the even color again, and any multiple or fractional values - * being in between. + to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning + of the odd color, 2.0 being the even color again, and any multiple or fractional values + being in between. */ offset: Property | undefined; /** @@ -23799,7 +23869,7 @@ export class StripeMaterialProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23828,13 +23898,13 @@ export class TimeIntervalCollectionPositionProperty { constructor(referenceFrame?: ReferenceFrame); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is considered to have changed if a call to getValue would return - * a different result for the same time. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. */ readonly definitionChanged: Event; /** @@ -23862,7 +23932,7 @@ export class TimeIntervalCollectionPositionProperty { getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23871,47 +23941,47 @@ export class TimeIntervalCollectionPositionProperty { /** * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the - * data property of each {@link TimeInterval} represents the value at time. +data property of each {@link TimeInterval} represents the value at time. * @example * //Create a Cartesian2 interval property which contains data on August 1st, 2012 - * //and uses a different value every 6 hours. - * var composite = new Cesium.TimeIntervalCollectionProperty(); - * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ - * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z', - * isStartIncluded : true, - * isStopIncluded : false, - * data : new Cesium.Cartesian2(2.0, 3.4) - * })); - * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ - * iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z', - * isStartIncluded : true, - * isStopIncluded : false, - * data : new Cesium.Cartesian2(12.0, 2.7) - * })); - * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ - * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z', - * isStartIncluded : true, - * isStopIncluded : false, - * data : new Cesium.Cartesian2(5.0, 12.4) - * })); - * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ - * iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z', - * isStartIncluded : true, - * isStopIncluded : true, - * data : new Cesium.Cartesian2(85.0, 4.1) - * })); +//and uses a different value every 6 hours. +var composite = new Cesium.TimeIntervalCollectionProperty(); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z', + isStartIncluded : true, + isStopIncluded : false, + data : new Cesium.Cartesian2(2.0, 3.4) +})); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z', + isStartIncluded : true, + isStopIncluded : false, + data : new Cesium.Cartesian2(12.0, 2.7) +})); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z', + isStartIncluded : true, + isStopIncluded : false, + data : new Cesium.Cartesian2(5.0, 12.4) +})); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z', + isStartIncluded : true, + isStopIncluded : true, + data : new Cesium.Cartesian2(85.0, 4.1) +})); */ export class TimeIntervalCollectionProperty { constructor(); /** * Gets a value indicating if this property is constant. A property is considered - * constant if getValue always returns the same result for the current definition. + constant if getValue always returns the same result for the current definition. */ readonly isConstant: boolean; /** * Gets the event that is raised whenever the definition of this property changes. - * The definition is changed whenever setValue is called with data different - * than the current value. + The definition is changed whenever setValue is called with data different + than the current value. */ readonly definitionChanged: Event; /** @@ -23927,7 +23997,7 @@ export class TimeIntervalCollectionProperty { getValue(time: JulianDate, result?: any): any; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23936,15 +24006,15 @@ export class TimeIntervalCollectionProperty { /** * A {@link Property} which evaluates to a {@link Quaternion} rotation - * based on the velocity of the provided {@link PositionProperty}. +based on the velocity of the provided {@link PositionProperty}. * @example * //Create an entity with position and orientation. - * var position = new Cesium.SampledProperty(); - * position.addSamples(...); - * var entity = viewer.entities.add({ - * position : position, - * orientation : new Cesium.VelocityOrientationProperty(position) - * })); +var position = new Cesium.SampledProperty(); +position.addSamples(...); +var entity = viewer.entities.add({ + position : position, + orientation : new Cesium.VelocityOrientationProperty(position) +})); * @param [position] - The position property used to compute the orientation. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine which way is up. */ @@ -23975,7 +24045,7 @@ export class VelocityOrientationProperty { getValue(time?: JulianDate, result?: Quaternion): Quaternion; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -23984,18 +24054,18 @@ export class VelocityOrientationProperty { /** * A {@link Property} which evaluates to a {@link Cartesian3} vector - * based on the velocity of the provided {@link PositionProperty}. +based on the velocity of the provided {@link PositionProperty}. * @example * //Create an entity with a billboard rotated to match its velocity. - * var position = new Cesium.SampledProperty(); - * position.addSamples(...); - * var entity = viewer.entities.add({ - * position : position, - * billboard : { - * image : 'image.png', - * alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector - * } - * })); +var position = new Cesium.SampledProperty(); +position.addSamples(...); +var entity = viewer.entities.add({ + position : position, + billboard : { + image : 'image.png', + alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector + } +})); * @param [position] - The position property used to compute the velocity. * @param [normalize = true] - Whether to normalize the computed velocity vector. */ @@ -24015,7 +24085,7 @@ export class VelocityVectorProperty { position: Property | undefined; /** * Gets or sets whether the vector produced by this property - * will be normalized or not. + will be normalized or not. */ normalize: boolean; /** @@ -24027,7 +24097,7 @@ export class VelocityVectorProperty { getValue(time?: JulianDate, result?: Cartesian3): Cartesian3; /** * Compares this property to the provided property and returns - * true if they are equal, false otherwise. + true if they are equal, false otherwise. * @param [other] - The other property. * @returns true if left and right are equal, false otherwise. */ @@ -24036,10 +24106,10 @@ export class VelocityVectorProperty { /** * Defines the interface for visualizers. Visualizers are plug-ins to - * {@link DataSourceDisplay} that render data associated with - * {@link DataSource} instances. - * This object is an interface for documentation purposes and is not intended - * to be instantiated directly. +{@link DataSourceDisplay} that render data associated with +{@link DataSource} instances. +This object is an interface for documentation purposes and is not intended +to be instantiated directly. */ export class Visualizer { constructor(); @@ -24047,8 +24117,8 @@ export class Visualizer { * Updates the visualization to the provided time. * @param time - The time. * @returns True if the display was updated to the provided time, - * false if the visualizer is waiting for an asynchronous operation to - * complete before data can be updated. + false if the visualizer is waiting for an asynchronous operation to + complete before data can be updated. */ update(time: JulianDate): boolean; /** @@ -24064,7 +24134,7 @@ export class Visualizer { /** * A {@link GeometryUpdater} for walls. - * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. * @param entity - The entity containing the geometry to be visualized. * @param scene - The scene where visualization is taking place. */ @@ -24118,7 +24188,7 @@ export namespace WallGraphics { /** * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights. - * The wall conforms to the curvature of the globe and can be placed along the surface or at altitude. +The wall conforms to the curvature of the globe and can be placed along the surface or at altitude. * @param [options] - Object describing initialization options */ export class WallGraphics { @@ -24137,12 +24207,12 @@ export class WallGraphics { positions: Property | undefined; /** * Gets or sets the Property specifying an array of heights to be used for the bottom of the wall instead of the surface of the globe. - * If defined, the array must be the same length as {@link Wall#positions}. + If defined, the array must be the same length as {@link Wall#positions}. */ minimumHeights: Property | undefined; /** * Gets or sets the Property specifying an array of heights to be used for the top of the wall instead of the height of each position. - * If defined, the array must be the same length as {@link Wall#positions}. + If defined, the array must be the same length as {@link Wall#positions}. */ maximumHeights: Property | undefined; /** @@ -24171,7 +24241,7 @@ export class WallGraphics { outlineWidth: Property | undefined; /** * Get or sets the enum Property specifying whether the wall - * casts or receives shadows from light sources. + casts or receives shadows from light sources. */ shadows: Property | undefined; /** @@ -24186,82 +24256,12 @@ export class WallGraphics { clone(result?: WallGraphics): WallGraphics; /** * Assigns each unassigned property on this object to the value - * of the same property on the provided source object. + of the same property on the provided source object. * @param source - The object to be merged into this object. */ merge(source: WallGraphics): void; } -/** - * @property kml - The generated KML. - * @property externalFiles - An object dictionary of external files - */ -export type exportKmlResultKml = { - kml: string; - externalFiles: { - [key: string]: Blob; - }; -}; - -/** - * @property kmz - The generated kmz file. - */ -export type exportKmlResultKmz = { - kmz: Blob; -}; - -/** - * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries - * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For - * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at - * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties - * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using - * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported - * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary - * color is used. Canvas objects are exported as PNG images. - * @example - * Cesium.exportKml({ - * entities: entityCollection - * }) - * .then(function(result) { - * // The XML string is in result.kml - * - * var externalFiles = result.externalFiles - * for(var file in externalFiles) { - * // file is the name of the file used in the KML document as the href - * // externalFiles[file] is a blob with the contents of the file - * } - * }); - * @param options - An object with the following properties: - * @param options.entities - The EntityCollection to export as KML. - * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for the output file. - * @param [options.modelCallback] - A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. - * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML. - * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability. - * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML. - * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file. - * @returns A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true. - */ -export function exportKml(options: { - entities: EntityCollection; - ellipsoid?: Ellipsoid; - modelCallback?: exportKmlModelCallback; - time?: JulianDate; - defaultAvailability?: TimeInterval; - sampleDuration?: number; - kmz?: boolean; -}): Promise; - -/** - * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document. - * It can also be used to add additional files to the externalFiles object, which is the list of files embedded in the exported KMZ, - * or otherwise returned with the KML string when exporting. - * @param model - The ModelGraphics instance for an Entity. - * @param time - The time that any properties should use to get the value. - * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob. - */ -export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string; - /** * The data type of a pixel. */ @@ -24305,44 +24305,44 @@ export enum TextureMinificationFilter { LINEAR = WebGLConstants.LINEAR, /** * Selects the nearest mip level and applies nearest sampling within that level. - *

- * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. - *

+

+ Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. +

*/ NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST, /** * Selects the nearest mip level and applies linear sampling within that level. - *

- * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. - *

+

+ Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. +

*/ LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST, /** * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results. - *

- * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture. - *

- *

- * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. - *

+

+ This option provides a good balance of visual quality and speed when sampling from a mipmapped texture. +

+

+ Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. +

*/ NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR, /** * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results. - *

- * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture. - *

- *

- * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. - *

+

+ This option provides a good balance of visual quality and speed when sampling from a mipmapped texture. +

+

+ Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. +

*/ LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR } /** * An appearance defines the full GLSL vertex and fragment shaders and the - * render state used to draw a {@link Primitive}. All appearances implement - * this base Appearance interface. +render state used to draw a {@link Primitive}. All appearances implement +this base Appearance interface. * @param [options] - Object with the following properties: * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled. * @param [options.closed = false] - When true, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled. @@ -24362,7 +24362,7 @@ export class Appearance { }); /** * The material used to determine the fragment color. Unlike other {@link Appearance} - * properties, this is not read-only, so an appearance's material can change on the fly. + properties, this is not read-only, so an appearance's material can change on the fly. */ material: Material; /** @@ -24375,8 +24375,8 @@ export class Appearance { readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. The full fragment shader - * source is built procedurally taking into account the {@link Appearance#material}. - * Use {@link Appearance#getFragmentShaderSource} to get the full source. + source is built procedurally taking into account the {@link Appearance#material}. + Use {@link Appearance#getFragmentShaderSource} to get the full source. */ readonly fragmentShaderSource: string; /** @@ -24389,7 +24389,7 @@ export class Appearance { readonly closed: boolean; /** * Procedurally creates the full GLSL fragment shader source for this appearance - * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}. + taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; @@ -24400,8 +24400,8 @@ export class Appearance { isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, - * it can contain a subset of render state properties identical to the render state - * created in the context. + it can contain a subset of render state properties identical to the render state + created in the context. * @returns The render state. */ getRenderState(): any; @@ -24413,37 +24413,37 @@ export namespace ArcGisMapServerImageryProvider { * @property url - The URL of the ArcGIS MapServer service. * @property [token] - The ArcGIS token used to authenticate with the ArcGIS MapServer service. * @property [tileDiscardPolicy] - The policy that determines if a tile - * is invalid and should be discarded. If this value is not specified, a default - * {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a - * {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case, - * we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200), - * (80,110), and (160, 130). If all of these pixels are transparent, the discard check is - * disabled and no tiles are discarded. If any of them have a non-transparent color, any - * tile that has the same values in these pixel locations is discarded. The end result of - * these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure - * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this - * parameter. + is invalid and should be discarded. If this value is not specified, a default + {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a + {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case, + we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200), + (80,110), and (160, 130). If all of these pixels are transparent, the discard check is + disabled and no tiles are discarded. If any of them have a non-transparent color, any + tile that has the same values in these pixel locations is discarded. The end result of + these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure + that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this + parameter. * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached - * tiles are used if they are available. If false, any pre-cached tiles are ignored and the - * 'export' service is used. + tiles are used if they are available. If false, any pre-cached tiles are ignored and the + 'export' service is used. * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown. * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke - * the Identify service on the MapServer and return the features included in the response. If false, - * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) - * without communicating with the server. Set this property to false if you don't want this provider's features to - * be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object. + the Identify service on the MapServer and return the features included in the response. If false, + {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) + without communicating with the server. Set this property to false if you don't want this provider's features to + be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. This parameter is ignored when accessing - * a tiled layer. + a tiled layer. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles. - * This parameter is ignored when accessing a tiled server. + This parameter is ignored when accessing a tiled server. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified and used, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. * @property [credit] - A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server. * @property [tileWidth = 256] - The width of each tile in pixels. This parameter is ignored when accessing a tiled server. * @property [tileHeight = 256] - The height of each tile in pixels. This parameter is ignored when accessing a tiled server. * @property [maximumLevel] - The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing - * a tiled server. + a tiled server. */ type ConstructorOptions = { url: Resource | string; @@ -24464,38 +24464,38 @@ export namespace ArcGisMapServerImageryProvider { /** * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are - * used, if available. +used, if available. * @example * var esri = new Cesium.ArcGisMapServerImageryProvider({ - * url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer' - * }); + url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer' +}); * @param options - Object describing initialization options */ export class ArcGisMapServerImageryProvider { constructor(options: ArcGisMapServerImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -24504,7 +24504,7 @@ export class ArcGisMapServerImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -24521,9 +24521,9 @@ export class ArcGisMapServerImageryProvider { defaultMagnificationFilter: TextureMagnificationFilter; /** * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will - * invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false, - * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) - * without communicating with the server. + invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false, + {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) + without communicating with the server. */ enablePickFeatures: boolean; /** @@ -24540,45 +24540,45 @@ export class ArcGisMapServerImageryProvider { readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -24591,22 +24591,22 @@ export class ArcGisMapServerImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether this imagery provider is using pre-cached tiles from the - * ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function - * will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does - * not have pre-cached tiles. + ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function + will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does + not have pre-cached tiles. */ readonly usingPrecachedTiles: boolean; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -24623,29 +24623,29 @@ export class ArcGisMapServerImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * /** - * Asynchronously determines what features, if any, are located at a given longitude and latitude within - * a tile. This function should not be called before {@link ImageryProvider#ready} returns true. + Asynchronously determines what features, if any, are located at a given longitude and latitude within + a tile. This function should not be called before {@link ImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } @@ -24670,19 +24670,19 @@ export enum Axis { /** * A viewport-aligned image positioned in the 3D scene, that is created - * and rendered using a {@link BillboardCollection}. A billboard is created and its initial - * properties are set by calling {@link BillboardCollection#add}. - *

- *
- *
- * Example billboards - *
+and rendered using a {@link BillboardCollection}. A billboard is created and its initial +properties are set by calling {@link BillboardCollection#add}. +

+
+
+Example billboards +
*/ export class Billboard { constructor(); /** * Determines if this billboard will be shown. Use this to hide or show a billboard, instead - * of removing it and re-adding it to the collection. + of removing it and re-adding it to the collection. */ show: boolean; /** @@ -24695,159 +24695,159 @@ export class Billboard { heightReference: HeightReference; /** * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used - * to align multiple billboards and labels at the same position, e.g., an image and text. The - * screen space origin is the top, left corner of the canvas; x increases from - * left to right, and y increases from top to bottom. - *

- *
- * - * - * - *
default
b.pixeloffset = new Cartesian2(50, 25);
- * The billboard's origin is indicated by the yellow point. - *
+ to align multiple billboards and labels at the same position, e.g., an image and text. The + screen space origin is the top, left corner of the canvas; x increases from + left to right, and y increases from top to bottom. +

+
+ + + +
default
b.pixeloffset = new Cartesian2(50, 25);
+ The billboard's origin is indicated by the yellow point. +
*/ pixelOffset: Cartesian2; /** * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera. - * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined, - * scaleByDistance will be disabled. + A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined, + scaleByDistance will be disabled. * @example * // Example 1. - * // Set a billboard's scaleByDistance to scale by 1.5 when the - * // camera is 1500 meters from the billboard and disappear as - * // the camera distance approaches 8.0e6 meters. - * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0); + // Set a billboard's scaleByDistance to scale by 1.5 when the + // camera is 1500 meters from the billboard and disappear as + // the camera distance approaches 8.0e6 meters. + b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0); * @example * // Example 2. - * // disable scaling by distance - * b.scaleByDistance = undefined; + // disable scaling by distance + b.scaleByDistance = undefined; */ scaleByDistance: NearFarScalar; /** * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera. - * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined, - * translucencyByDistance will be disabled. + A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined, + translucencyByDistance will be disabled. * @example * // Example 1. - * // Set a billboard's translucency to 1.0 when the - * // camera is 1500 meters from the billboard and disappear as - * // the camera distance approaches 8.0e6 meters. - * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); + // Set a billboard's translucency to 1.0 when the + // camera is 1500 meters from the billboard and disappear as + // the camera distance approaches 8.0e6 meters. + b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); * @example * // Example 2. - * // disable translucency by distance - * b.translucencyByDistance = undefined; + // disable translucency by distance + b.translucencyByDistance = undefined; */ translucencyByDistance: NearFarScalar; /** * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera. - * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined, - * pixelOffsetScaleByDistance will be disabled. + A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined, + pixelOffsetScaleByDistance will be disabled. * @example * // Example 1. - * // Set a billboard's pixel offset scale to 0.0 when the - * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels - * // in the y direction the camera distance approaches 8.0e6 meters. - * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0); - * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0); + // Set a billboard's pixel offset scale to 0.0 when the + // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels + // in the y direction the camera distance approaches 8.0e6 meters. + b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0); + b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0); * @example * // Example 2. - * // disable pixel offset by distance - * b.pixelOffsetScaleByDistance = undefined; + // disable pixel offset by distance + b.pixelOffsetScaleByDistance = undefined; */ pixelOffsetScaleByDistance: NearFarScalar; /** * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed - * coordinate system, where x points towards the viewer's right, y points up, and - * z points into the screen. Eye coordinates use the same scale as world and model coordinates, - * which is typically meters. - *

- * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to - * arrange a billboard above its corresponding 3D model. - *

- * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always - * appear on top of the Earth regardless of the viewer's or Earth's orientation. - *

- *
- * - * - * - *
- * b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

- *
+ coordinate system, where x points towards the viewer's right, y points up, and + z points into the screen. Eye coordinates use the same scale as world and model coordinates, + which is typically meters. +

+ An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to + arrange a billboard above its corresponding 3D model. +

+ Below, the billboard is positioned at the center of the Earth but an eye offset makes it always + appear on top of the Earth regardless of the viewer's or Earth's orientation. +

+
+ + + +
+ b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

+
*/ eyeOffset: Cartesian3; /** * Gets or sets the horizontal origin of this billboard, which determines if the billboard is - * to the left, center, or right of its anchor position. - *

- *
- *
- *
+ to the left, center, or right of its anchor position. +

+
+
+
* @example * // Use a bottom, left origin - * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; - * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; + b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; + b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; */ horizontalOrigin: HorizontalOrigin; /** * Gets or sets the vertical origin of this billboard, which determines if the billboard is - * to the above, below, or at the center of its anchor position. - *

- *
- *
- *
+ to the above, below, or at the center of its anchor position. +

+
+
+
* @example * // Use a bottom, left origin - * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; - * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; + b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; + b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; */ verticalOrigin: VerticalOrigin; /** * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels. - * A scale of 1.0 does not change the size of the billboard; a scale greater than - * 1.0 enlarges the billboard; a positive scale less than 1.0 shrinks - * the billboard. - *

- *
- *
- * From left to right in the above image, the scales are 0.5, 1.0, - * and 2.0. - *
+ A scale of 1.0 does not change the size of the billboard; a scale greater than + 1.0 enlarges the billboard; a positive scale less than 1.0 shrinks + the billboard. +

+
+
+ From left to right in the above image, the scales are 0.5, 1.0, + and 2.0. +
*/ scale: number; /** * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First, - * the same white texture may be used by many different billboards, each with a different color, to create - * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below. - * An alpha of 0.0 makes the billboard transparent, and 1.0 makes the billboard opaque. - *

- *
- * - * - * - *
default
alpha : 0.5
- *
- *
- * The red, green, blue, and alpha values are indicated by value's red, green, - * blue, and alpha properties as shown in Example 1. These components range from 0.0 - * (no intensity) to 1.0 (full intensity). + the same white texture may be used by many different billboards, each with a different color, to create + colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below. + An alpha of 0.0 makes the billboard transparent, and 1.0 makes the billboard opaque. +

+
+ + + +
default
alpha : 0.5
+
+
+ The red, green, blue, and alpha values are indicated by value's red, green, + blue, and alpha properties as shown in Example 1. These components range from 0.0 + (no intensity) to 1.0 (full intensity). * @example * // Example 1. Assign yellow. - * b.color = Cesium.Color.YELLOW; + b.color = Cesium.Color.YELLOW; * @example * // Example 2. Make a billboard 50% translucent. - * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5); + b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5); */ color: Color; /** @@ -24856,20 +24856,20 @@ export class Billboard { rotation: number; /** * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards. - * The default is the zero vector, which means the billboard is aligned to the screen up vector. + The default is the zero vector, which means the billboard is aligned to the screen up vector. * @example * // Example 1. - * // Have the billboard up vector point north - * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z; + // Have the billboard up vector point north + billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z; * @example * // Example 2. - * // Have the billboard point east. - * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z; - * billboard.rotation = -Cesium.Math.PI_OVER_TWO; + // Have the billboard point east. + billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z; + billboard.rotation = -Cesium.Math.PI_OVER_TWO; * @example * // Example 3. - * // Reset the aligned axis - * billboard.alignedAxis = Cesium.Cartesian3.ZERO; + // Reset the aligned axis + billboard.alignedAxis = Cesium.Cartesian3.ZERO; */ alignedAxis: Cartesian3; /** @@ -24882,7 +24882,7 @@ export class Billboard { height: number; /** * Gets or sets if the billboard size is in meters or pixels. true to size the billboard in meters; - * otherwise, the size is in pixels. + otherwise, the size is in pixels. */ sizeInMeters: boolean; /** @@ -24891,7 +24891,7 @@ export class Billboard { distanceDisplayCondition: DistanceDisplayCondition; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. - * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: number; /** @@ -24900,72 +24900,72 @@ export class Billboard { id: any; /** *

- * Gets or sets the image to be used for this billboard. If a texture has already been created for the - * given image, the existing texture is used. - *

- *

- * This property can be set to a loaded Image, a URL which will be loaded as an Image automatically, - * a canvas, or another billboard's image property (from the same billboard collection). - *

+ Gets or sets the image to be used for this billboard. If a texture has already been created for the + given image, the existing texture is used. +

+

+ This property can be set to a loaded Image, a URL which will be loaded as an Image automatically, + a canvas, or another billboard's image property (from the same billboard collection). +

* @example * // load an image from a URL - * b.image = 'some/image/url.png'; - * - * // assuming b1 and b2 are billboards in the same billboard collection, - * // use the same image for both billboards. - * b2.image = b1.image; + b.image = 'some/image/url.png'; + + // assuming b1 and b2 are billboards in the same billboard collection, + // use the same image for both billboards. + b2.image = b1.image; */ image: string; /** * When true, this billboard is ready to render, i.e., the image - * has been downloaded and the WebGL resources are created. + has been downloaded and the WebGL resources are created. */ readonly ready: boolean; /** *

- * Sets the image to be used for this billboard. If a texture has already been created for the - * given id, the existing texture is used. - *

- *

- * This function is useful for dynamically creating textures that are shared across many billboards. - * Only the first billboard will actually call the function and create the texture, while subsequent - * billboards created with the same id will simply re-use the existing texture. - *

- *

- * To load an image from a URL, setting the {@link Billboard#image} property is more convenient. - *

+ Sets the image to be used for this billboard. If a texture has already been created for the + given id, the existing texture is used. +

+

+ This function is useful for dynamically creating textures that are shared across many billboards. + Only the first billboard will actually call the function and create the texture, while subsequent + billboards created with the same id will simply re-use the existing texture. +

+

+ To load an image from a URL, setting the {@link Billboard#image} property is more convenient. +

* @example * // create a billboard image dynamically - * function drawImage(id) { - * // create and draw an image using a canvas - * var canvas = document.createElement('canvas'); - * var context2D = canvas.getContext('2d'); - * // ... draw image - * return canvas; - * } - * // drawImage will be called to create the texture - * b.setImage('myImage', drawImage); - * - * // subsequent billboards created in the same collection using the same id will use the existing - * // texture, without the need to create the canvas or draw the image - * b2.setImage('myImage', drawImage); + function drawImage(id) { + // create and draw an image using a canvas + var canvas = document.createElement('canvas'); + var context2D = canvas.getContext('2d'); + // ... draw image + return canvas; + } + // drawImage will be called to create the texture + b.setImage('myImage', drawImage); + + // subsequent billboards created in the same collection using the same id will use the existing + // texture, without the need to create the canvas or draw the image + b2.setImage('myImage', drawImage); * @param id - The id of the image. This can be any string that uniquely identifies the image. * @param image - The image to load. This parameter - * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically, - * or a function which will be called to create the image if it hasn't been loaded already. + can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically, + or a function which will be called to create the image if it hasn't been loaded already. */ setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void; /** * Uses a sub-region of the image with the given id as the image for this billboard, - * measured in pixels from the bottom-left. + measured in pixels from the bottom-left. * @param id - The id of the image to use. * @param subRegion - The sub-region of the image. */ setImageSubRegion(id: string, subRegion: BoundingRectangle): void; /** * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets. - * The screen space origin is the top, left corner of the canvas; x increases from - * left to right, and y increases from top to bottom. + The screen space origin is the top, left corner of the canvas; x increases from + left to right, and y increases from top to bottom. * @example * console.log(b.computeScreenSpacePosition(scene).toString()); * @param scene - The scene. @@ -24975,7 +24975,7 @@ export class Billboard { computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; /** * Determines if this billboard equals another billboard. Billboards are equal if all their properties - * are equal. Billboards in different collections can be equal. + are equal. Billboards in different collections can be equal. * @param other - The billboard to compare for equality. * @returns true if the billboards are equal; otherwise, false. */ @@ -24992,34 +24992,34 @@ export namespace Billboard { /** * A renderable collection of billboards. Billboards are viewport-aligned - * images positioned in the 3D scene. - *

- *
- *
- * Example billboards - *
- *

- * Billboards are added and removed from the collection using {@link BillboardCollection#add} - * and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures - * for images with the same identifier. +images positioned in the 3D scene. +

+
+
+Example billboards +
+

+Billboards are added and removed from the collection using {@link BillboardCollection#add} +and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures +for images with the same identifier. * @example * // Create a billboard collection with two billboards - * var billboards = scene.primitives.add(new Cesium.BillboardCollection()); - * billboards.add({ - * position : new Cesium.Cartesian3(1.0, 2.0, 3.0), - * image : 'url/to/image' - * }); - * billboards.add({ - * position : new Cesium.Cartesian3(4.0, 5.0, 6.0), - * image : 'url/to/another/image' - * }); +var billboards = scene.primitives.add(new Cesium.BillboardCollection()); +billboards.add({ + position : new Cesium.Cartesian3(1.0, 2.0, 3.0), + image : 'url/to/image' +}); +billboards.add({ + position : new Cesium.Cartesian3(4.0, 5.0, 6.0), + image : 'url/to/another/image' +}); * @param [options] - Object with the following properties: * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default - * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent, - * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. +is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent, +setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. * @param [options.show = true] - Determines if the billboards in the collection will be shown. */ export class BillboardCollection { @@ -25036,90 +25036,90 @@ export class BillboardCollection { show: boolean; /** * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates. - * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates. - * Local reference frames can be used by providing a different transformation matrix, like that returned - * by {@link Transforms.eastNorthUpToFixedFrame}. + When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. * @example * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); - * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); - * billboards.add({ - * image : 'url/to/image', - * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center - * }); - * billboards.add({ - * image : 'url/to/image', - * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east - * }); - * billboards.add({ - * image : 'url/to/image', - * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north - * }); - * billboards.add({ - * image : 'url/to/image', - * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up - * }); + billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); + billboards.add({ + image : 'url/to/image', + position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center + }); + billboards.add({ + image : 'url/to/image', + position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east + }); + billboards.add({ + image : 'url/to/image', + position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north + }); + billboards.add({ + image : 'url/to/image', + position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up + }); */ modelMatrix: Matrix4; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the primitive. - *

+

+ Draws the bounding sphere for each draw command in the primitive. +

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the texture atlas for this BillboardCollection as a fullscreen quad. - *

+

+ Draws the texture atlas for this BillboardCollection as a fullscreen quad. +

*/ debugShowTextureAtlas: boolean; /** * The billboard blending option. The default is used for rendering both opaque and translucent billboards. - * However, if either all of the billboards are completely opaque or all are completely translucent, - * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve - * performance by up to 2x. + However, if either all of the billboards are completely opaque or all are completely translucent, + setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve + performance by up to 2x. */ blendOption: BlendOption; /** * Returns the number of billboards in this collection. This is commonly used with - * {@link BillboardCollection#get} to iterate over all the billboards - * in the collection. + {@link BillboardCollection#get} to iterate over all the billboards + in the collection. */ length: number; /** * Creates and adds a billboard with the specified initial properties to the collection. - * The added billboard is returned so it can be modified or removed from the collection later. + The added billboard is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a billboard, specifying all the default values. - * var b = billboards.add({ - * show : true, - * position : Cesium.Cartesian3.ZERO, - * pixelOffset : Cesium.Cartesian2.ZERO, - * eyeOffset : Cesium.Cartesian3.ZERO, - * heightReference : Cesium.HeightReference.NONE, - * horizontalOrigin : Cesium.HorizontalOrigin.CENTER, - * verticalOrigin : Cesium.VerticalOrigin.CENTER, - * scale : 1.0, - * image : 'url/to/image', - * imageSubRegion : undefined, - * color : Cesium.Color.WHITE, - * id : undefined, - * rotation : 0.0, - * alignedAxis : Cesium.Cartesian3.ZERO, - * width : undefined, - * height : undefined, - * scaleByDistance : undefined, - * translucencyByDistance : undefined, - * pixelOffsetScaleByDistance : undefined, - * sizeInMeters : false, - * distanceDisplayCondition : undefined - * }); + var b = billboards.add({ + show : true, + position : Cesium.Cartesian3.ZERO, + pixelOffset : Cesium.Cartesian2.ZERO, + eyeOffset : Cesium.Cartesian3.ZERO, + heightReference : Cesium.HeightReference.NONE, + horizontalOrigin : Cesium.HorizontalOrigin.CENTER, + verticalOrigin : Cesium.VerticalOrigin.CENTER, + scale : 1.0, + image : 'url/to/image', + imageSubRegion : undefined, + color : Cesium.Color.WHITE, + id : undefined, + rotation : 0.0, + alignedAxis : Cesium.Cartesian3.ZERO, + width : undefined, + height : undefined, + scaleByDistance : undefined, + translucencyByDistance : undefined, + pixelOffsetScaleByDistance : undefined, + sizeInMeters : false, + distanceDisplayCondition : undefined + }); * @example * // Example 2: Specify only the billboard's cartographic position. - * var b = billboards.add({ - * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) - * }); + var b = billboards.add({ + position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) + }); * @param [options] - A template describing the billboard's properties as shown in Example 1. * @returns The billboard that was added to the collection. */ @@ -25128,7 +25128,7 @@ export class BillboardCollection { * Removes a billboard from the collection. * @example * var b = billboards.add(...); - * billboards.remove(b); // Returns true + billboards.remove(b); // Returns true * @param billboard - The billboard to remove. * @returns true if the billboard was removed; false if the billboard was not found in the collection. */ @@ -25137,8 +25137,8 @@ export class BillboardCollection { * Removes all billboards from the collection. * @example * billboards.add(...); - * billboards.add(...); - * billboards.removeAll(); + billboards.add(...); + billboards.removeAll(); */ removeAll(): void; /** @@ -25149,45 +25149,45 @@ export class BillboardCollection { contains(billboard?: Billboard): boolean; /** * Returns the billboard in the collection at the specified index. Indices are zero-based - * and increase as billboards are added. Removing a billboard shifts all billboards after - * it to the left, changing their indices. This function is commonly used with - * {@link BillboardCollection#length} to iterate over all the billboards - * in the collection. + and increase as billboards are added. Removing a billboard shifts all billboards after + it to the left, changing their indices. This function is commonly used with + {@link BillboardCollection#length} to iterate over all the billboards + in the collection. * @example * // Toggle the show property of every billboard in the collection - * var len = billboards.length; - * for (var i = 0; i < len; ++i) { - * var b = billboards.get(i); - * b.show = !b.show; - * } + var len = billboards.length; + for (var i = 0; i < len; ++i) { + var b = billboards.get(i); + b.show = !b.show; + } * @param index - The zero-based index of the billboard. * @returns The billboard at the specified index. */ get(index: number): Billboard; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * billboards = billboards && billboards.destroy(); */ @@ -25199,18 +25199,18 @@ export namespace BingMapsImageryProvider { * Initialization options for the BingMapsImageryProvider constructor * @property url - The url of the Bing Maps server hosting the imagery. * @property key - The Bing Maps key for your application, which can be - * created at {@link https://www.bingmapsportal.com/}. + created at {@link https://www.bingmapsportal.com/}. * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'. - * By default, tiles are loaded using the same protocol as the page. + By default, tiles are loaded using the same protocol as the page. * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load. * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not - * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} - * for information on the supported cultures. + all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} + for information on the supported cultures. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. * @property [tileDiscardPolicy] - The policy that determines if a tile - * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy} - * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles. - * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter. + is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy} + will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles. + To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter. */ type ConstructorOptions = { url: Resource | string; @@ -25227,37 +25227,37 @@ export namespace BingMapsImageryProvider { * Provides tiled imagery using the Bing Maps Imagery REST API. * @example * var bing = new Cesium.BingMapsImageryProvider({ - * url : 'https://dev.virtualearth.net', - * key : 'get-yours-at-https://www.bingmapsportal.com/', - * mapStyle : Cesium.BingMapsStyle.AERIAL - * }); + url : 'https://dev.virtualearth.net', + key : 'get-yours-at-https://www.bingmapsportal.com/', + mapStyle : Cesium.BingMapsStyle.AERIAL +}); * @param options - Object describing initialization options */ export class BingMapsImageryProvider { constructor(options: BingMapsImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -25266,7 +25266,7 @@ export class BingMapsImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -25299,51 +25299,51 @@ export class BingMapsImageryProvider { readonly mapStyle: BingMapsStyle; /** * The culture to use when requesting Bing Maps imagery. Not - * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} - * for information on the supported cultures. + all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} + for information on the supported cultures. */ readonly culture: string; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link BingMapsImageryProvider#ready} returns true. + not be called before {@link BingMapsImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link BingMapsImageryProvider#ready} returns true. + not be called before {@link BingMapsImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link BingMapsImageryProvider#ready} returns true. + not be called before {@link BingMapsImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link BingMapsImageryProvider#ready} returns true. + not be called before {@link BingMapsImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link BingMapsImageryProvider#ready} returns true. + not be called before {@link BingMapsImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link BingMapsImageryProvider#ready} returns true. + not be called before {@link BingMapsImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link BingMapsImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -25356,15 +25356,15 @@ export class BingMapsImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage - * and texture upload time. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage + and texture upload time. */ readonly hasAlphaChannel: boolean; /** @@ -25377,34 +25377,34 @@ export class BingMapsImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link BingMapsImageryProvider#ready} returns true. + not be called before {@link BingMapsImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns - * undefined. + undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; /** * Converts a tiles (x, y, level) position into a quadkey used to request an image - * from a Bing Maps server. + from a Bing Maps server. * @param x - The tile's x coordinate. * @param y - The tile's y coordinate. * @param level - The tile's zoom level. @@ -25412,7 +25412,7 @@ export class BingMapsImageryProvider { static tileXYToQuadKey(x: number, y: number, level: number): void; /** * Converts a tile's quadkey used to request an image from a Bing Maps server into the - * (x, y, level) position. + (x, y, level) position. * @param quadkey - The tile's quad key */ static quadKeyToTileXY(quadkey: string): void; @@ -25486,14 +25486,14 @@ export enum BlendEquation { REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT, /** * Pixel values are given to the minimum function (min(source, destination)). - * - * This equation operates on each pixel color component. + + This equation operates on each pixel color component. */ MIN = WebGLConstants.MIN, /** * Pixel values are given to the maximum function (max(source, destination)). - * - * This equation operates on each pixel color component. + + This equation operates on each pixel color component. */ MAX = WebGLConstants.MAX } @@ -25564,31 +25564,13 @@ export enum BlendFunction { SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE } -/** - * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene. - */ -export enum BlendOption { - /** - * The billboards, points, or labels in the collection are completely opaque. - */ - OPAQUE = 0, - /** - * The billboards, points, or labels in the collection are completely translucent. - */ - TRANSLUCENT = 1, - /** - * The billboards, points, or labels in the collection are both opaque and translucent. - */ - OPAQUE_AND_TRANSLUCENT = 2 -} - /** * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the - * enabled flag to define the full blending state for combining source and - * destination fragments when rendering. - *

- * This is a helper when using custom render states with {@link Appearance#renderState}. - *

+enabled flag to define the full blending state for combining source and +destination fragments when rendering. +

+This is a helper when using custom render states with {@link Appearance#renderState}. +

*/ export namespace BlendingState { /** @@ -25609,9 +25591,27 @@ export namespace BlendingState { const ADDITIVE_BLEND: any; } +/** + * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene. + */ +export enum BlendOption { + /** + * The billboards, points, or labels in the collection are completely opaque. + */ + OPAQUE = 0, + /** + * The billboards, points, or labels in the collection are completely translucent. + */ + TRANSLUCENT = 1, + /** + * The billboards, points, or labels in the collection are both opaque and translucent. + */ + OPAQUE_AND_TRANSLUCENT = 2 +} + /** * A ParticleEmitter that emits particles within a box. - * Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box. +Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box. * @param dimensions - The width, height and depth dimensions of the box. */ export class BoxEmitter { @@ -25624,23 +25624,23 @@ export class BoxEmitter { /** * The camera is defined by a position, orientation, and view frustum. - *

- * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors. - *

- * The viewing frustum is defined by 6 planes. - * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components - * define the unit vector normal to the plane, and the w component is the distance of the - * plane from the origin/camera position. +

+The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors. +

+The viewing frustum is defined by 6 planes. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. * @example * // Create a camera looking down the negative z-axis, positioned at the origin, - * // with a field of view of 60 degrees, and 1:1 aspect ratio. - * var camera = new Cesium.Camera(scene); - * camera.position = new Cesium.Cartesian3(); - * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3()); - * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y); - * camera.frustum.fov = Cesium.Math.PI_OVER_THREE; - * camera.frustum.near = 1.0; - * camera.frustum.far = 2.0; +// with a field of view of 60 degrees, and 1:1 aspect ratio. +var camera = new Cesium.Camera(scene); +camera.position = new Cesium.Cartesian3(); +camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3()); +camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y); +camera.frustum.fov = Cesium.Math.PI_OVER_THREE; +camera.frustum.near = 1.0; +camera.frustum.far = 2.0; * @param scene - The scene. */ export class Camera { @@ -25667,22 +25667,22 @@ export class Camera { frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum; /** * The default amount to move the camera when an argument is not - * provided to the move methods. + provided to the move methods. */ defaultMoveAmount: number; /** * The default amount to rotate the camera when an argument is not - * provided to the look methods. + provided to the look methods. */ defaultLookAmount: number; /** * The default amount to rotate the camera when an argument is not - * provided to the rotate methods. + provided to the rotate methods. */ defaultRotateAmount: number; /** * The default amount to move the camera when an argument is not - * provided to the zoom methods. + provided to the zoom methods. */ defaultZoomAmount: number; /** @@ -25691,7 +25691,7 @@ export class Camera { constrainedAxis: Cartesian3; /** * The factor multiplied by the the map size used to determine where to clamp the camera position - * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable. + when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable. */ maximumZoomFactor: number; /** @@ -25704,8 +25704,8 @@ export class Camera { static DEFAULT_VIEW_RECTANGLE: Rectangle; /** * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle. - * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero - * will move it further away from the extent, and a value less than zero will move it close to the extent. + A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero + will move it further away from the extent, and a value less than zero will move it close to the extent. */ static DEFAULT_VIEW_FACTOR: number; /** @@ -25730,9 +25730,9 @@ export class Camera { readonly inverseViewMatrix: Matrix4; /** * Gets the {@link Cartographic} position of the camera, with longitude and latitude - * expressed in radians and height in meters. In 2D and Columbus View, it is possible - * for the returned longitude and latitude to be outside the range of valid longitudes - * and latitudes when the camera is outside the map. + expressed in radians and height in meters. In 2D and Columbus View, it is possible + for the returned longitude and latitude to be outside the range of valid longitudes + and latitudes when the camera is outside the map. */ readonly positionCartographic: Cartographic; /** @@ -25779,48 +25779,48 @@ export class Camera { * Sets the camera position, orientation and transform. * @example * // 1. Set position with a top-down view - * viewer.camera.setView({ - * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0) - * }); - * - * // 2 Set view with heading, pitch and roll - * viewer.camera.setView({ - * destination : cartesianPosition, - * orientation: { - * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) - * pitch : Cesium.Math.toRadians(-90), // default value (looking down) - * roll : 0.0 // default value - * } - * }); - * - * // 3. Change heading, pitch and roll with the camera position remaining the same. - * viewer.camera.setView({ - * orientation: { - * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) - * pitch : Cesium.Math.toRadians(-90), // default value (looking down) - * roll : 0.0 // default value - * } - * }); - * - * - * // 4. View rectangle with a top-down view - * viewer.camera.setView({ - * destination : Cesium.Rectangle.fromDegrees(west, south, east, north) - * }); - * - * // 5. Set position with an orientation using unit vectors. - * viewer.camera.setView({ - * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), - * orientation : { - * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734), - * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339) - * } - * }); + viewer.camera.setView({ + destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0) + }); + + // 2 Set view with heading, pitch and roll + viewer.camera.setView({ + destination : cartesianPosition, + orientation: { + heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) + pitch : Cesium.Math.toRadians(-90), // default value (looking down) + roll : 0.0 // default value + } + }); + + // 3. Change heading, pitch and roll with the camera position remaining the same. + viewer.camera.setView({ + orientation: { + heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) + pitch : Cesium.Math.toRadians(-90), // default value (looking down) + roll : 0.0 // default value + } + }); + + + // 4. View rectangle with a top-down view + viewer.camera.setView({ + destination : Cesium.Rectangle.fromDegrees(west, south, east, north) + }); + + // 5. Set position with an orientation using unit vectors. + viewer.camera.setView({ + destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), + orientation : { + direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734), + up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339) + } + }); * @param options - Object with the following properties: * @param [options.destination] - The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point - * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive - * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. + towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive + y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. * @param [options.endTransform] - Transform matrix representing the reference frame of the camera. * @param [options.convert] - Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to true. */ @@ -25832,8 +25832,8 @@ export class Camera { }): void; /** * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set - * the default view for the 3D scene. The home view for 2D and columbus view shows the - * entire map. + the default view for the 3D scene. The home view for 2D and columbus view shows the + entire map. * @param [duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. See {@link Camera#flyTo} */ flyHome(duration?: number): void; @@ -25887,14 +25887,14 @@ export class Camera { move(direction: Cartesian3, amount?: number): void; /** * Translates the camera's position by amount along the camera's view vector. - * When in 2D mode, this will zoom in the camera instead of translating the camera's position. + When in 2D mode, this will zoom in the camera instead of translating the camera's position. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveForward(amount?: number): void; /** * Translates the camera's position by amount along the opposite direction - * of the camera's view vector. - * When in 2D mode, this will zoom out the camera instead of translating the camera's position. + of the camera's view vector. + When in 2D mode, this will zoom out the camera instead of translating the camera's position. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveBackward(amount?: number): void; @@ -25905,7 +25905,7 @@ export class Camera { moveUp(amount?: number): void; /** * Translates the camera's position by amount along the opposite direction - * of the camera's up vector. + of the camera's up vector. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveDown(amount?: number): void; @@ -25916,31 +25916,31 @@ export class Camera { moveRight(amount?: number): void; /** * Translates the camera's position by amount along the opposite direction - * of the camera's right vector. + of the camera's right vector. * @param [amount] - The amount, in meters, to move. Defaults to defaultMoveAmount. */ moveLeft(amount?: number): void; /** * Rotates the camera around its up vector by amount, in radians, in the opposite direction - * of its right vector if not in 2D mode. + of its right vector if not in 2D mode. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ lookLeft(amount?: number): void; /** * Rotates the camera around its up vector by amount, in radians, in the direction - * of its right vector if not in 2D mode. + of its right vector if not in 2D mode. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ lookRight(amount?: number): void; /** * Rotates the camera around its right vector by amount, in radians, in the direction - * of its up vector if not in 2D mode. + of its up vector if not in 2D mode. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ lookUp(amount?: number): void; /** * Rotates the camera around its right vector by amount, in radians, in the opposite direction - * of its up vector if not in 2D mode. + of its up vector if not in 2D mode. * @param [amount] - The amount, in radians, to rotate by. Defaults to defaultLookAmount. */ lookDown(amount?: number): void; @@ -25962,7 +25962,7 @@ export class Camera { twistRight(amount?: number): void; /** * Rotates the camera around axis by angle. The distance - * of the camera's position to the center of the camera's reference frame remains the same. + of the camera's position to the center of the camera's reference frame remains the same. * @param axis - The axis to rotate around given in world coordinates. * @param [angle] - The angle, in radians, to rotate by. Defaults to defaultRotateAmount. */ @@ -25994,63 +25994,63 @@ export class Camera { zoomIn(amount?: number): void; /** * Zooms amount along the opposite direction of - * the camera's view vector. + the camera's view vector. * @param [amount] - The amount to move. Defaults to defaultZoomAmount. */ zoomOut(amount?: number): void; /** * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and - * Columbus view, this is the distance to the map. + Columbus view, this is the distance to the map. * @returns The magnitude of the position. */ getMagnitude(): number; /** * Sets the camera position and orientation using a target and offset. The target must be given in - * world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target. - * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset - * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix. - * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch - * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. - * - * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the - * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be - * determined from the offset, the heading will be north. + world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target. + If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset + is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. + + In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north. * @example * // 1. Using a cartesian offset - * var center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0); - * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0)); - * - * // 2. Using a HeadingPitchRange offset - * var center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0); - * var heading = Cesium.Math.toRadians(50.0); - * var pitch = Cesium.Math.toRadians(-20.0); - * var range = 5000.0; - * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range)); + var center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0); + viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0)); + + // 2. Using a HeadingPitchRange offset + var center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0); + var heading = Cesium.Math.toRadians(50.0); + var pitch = Cesium.Math.toRadians(-20.0); + var range = 5000.0; + viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range)); * @param target - The target position in world coordinates. * @param offset - The offset from the target in the local east-north-up reference frame centered at the target. */ lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void; /** * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range. - * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset - * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix. - * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch - * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. - * - * In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the - * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be - * determined from the offset, the heading will be north. + If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset + is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. + + In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the + target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north. * @example * // 1. Using a cartesian offset - * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0)); - * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0)); - * - * // 2. Using a HeadingPitchRange offset - * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0)); - * var heading = Cesium.Math.toRadians(50.0); - * var pitch = Cesium.Math.toRadians(-20.0); - * var range = 5000.0; - * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range)); + var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0)); + viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0)); + + // 2. Using a HeadingPitchRange offset + var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0)); + var heading = Cesium.Math.toRadians(50.0); + var pitch = Cesium.Math.toRadians(-20.0); + var range = 5000.0; + viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range)); * @param transform - The transformation matrix defining the reference frame. * @param [offset] - The offset from the target in a reference frame centered at the target. */ @@ -26066,20 +26066,20 @@ export class Camera { * Pick an ellipsoid or map. * @example * var canvas = viewer.scene.canvas; - * var center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0); - * var ellipsoid = viewer.scene.globe.ellipsoid; - * var result = viewer.camera.pickEllipsoid(center, ellipsoid); + var center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0); + var ellipsoid = viewer.scene.globe.ellipsoid; + var result = viewer.camera.pickEllipsoid(center, ellipsoid); * @param windowPosition - The x and y coordinates of a pixel. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to pick. * @param [result] - The object onto which to store the result. * @returns If the ellipsoid or map was picked, - * returns the point on the surface of the ellipsoid or map in world - * coordinates. If the ellipsoid or map was not picked, returns undefined. + returns the point on the surface of the ellipsoid or map in world + coordinates. If the ellipsoid or map was not picked, returns undefined. */ pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined; /** * Create a ray from the camera position through the pixel at windowPosition - * in world coordinates. + in world coordinates. * @param windowPosition - The x and y coordinates of a pixel. * @param [result] - The object onto which to store the result. * @returns Returns the {@link Cartesian3} position and direction of the ray. @@ -26101,50 +26101,50 @@ export class Camera { getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number; /** * Cancels the current camera flight and leaves the camera at its current location. - * If no flight is in progress, this this function does nothing. + If no flight is in progress, this this function does nothing. */ cancelFlight(): void; /** * Completes the current camera flight and moves the camera immediately to its final destination. - * If no flight is in progress, this this function does nothing. + If no flight is in progress, this this function does nothing. */ completeFlight(): void; /** * Flies the camera from its current position to a new position. * @example * // 1. Fly to a position with a top-down view - * viewer.camera.flyTo({ - * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0) - * }); - * - * // 2. Fly to a Rectangle with a top-down view - * viewer.camera.flyTo({ - * destination : Cesium.Rectangle.fromDegrees(west, south, east, north) - * }); - * - * // 3. Fly to a position with an orientation using unit vectors. - * viewer.camera.flyTo({ - * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), - * orientation : { - * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734), - * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339) - * } - * }); - * - * // 4. Fly to a position with an orientation using heading, pitch and roll. - * viewer.camera.flyTo({ - * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), - * orientation : { - * heading : Cesium.Math.toRadians(175.0), - * pitch : Cesium.Math.toRadians(-35.0), - * roll : 0.0 - * } - * }); + viewer.camera.flyTo({ + destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0) + }); + + // 2. Fly to a Rectangle with a top-down view + viewer.camera.flyTo({ + destination : Cesium.Rectangle.fromDegrees(west, south, east, north) + }); + + // 3. Fly to a position with an orientation using unit vectors. + viewer.camera.flyTo({ + destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), + orientation : { + direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734), + up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339) + } + }); + + // 4. Fly to a position with an orientation using heading, pitch and roll. + viewer.camera.flyTo({ + destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), + orientation : { + heading : Cesium.Math.toRadians(175.0), + pitch : Cesium.Math.toRadians(-35.0), + roll : 0.0 + } + }); * @param options - Object with the following properties: * @param options.destination - The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point - * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive - * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. + towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive + y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. * @param [options.duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. * @param [options.complete] - The function to execute when the flight is complete. * @param [options.cancel] - The function to execute if the flight is cancelled. @@ -26172,31 +26172,31 @@ export class Camera { }): void; /** * Sets the camera so that the current view contains the provided bounding sphere. - * - *

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. - * The heading and the pitch angles are defined in the local east-north-up reference frame. - * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch - * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is - * zero, a range will be computed such that the whole bounding sphere is visible.

- * - *

In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the - * target will be the range. The heading will be determined from the offset. If the heading cannot be - * determined from the offset, the heading will be north.

+ +

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. + The heading and the pitch angles are defined in the local east-north-up reference frame. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is + zero, a range will be computed such that the whole bounding sphere is visible.

+ +

In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the range. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north.

* @param boundingSphere - The bounding sphere to view, in world coordinates. * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target. */ viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void; /** * Flies the camera to a location where the current view contains the provided bounding sphere. - * - *

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. - * The heading and the pitch angles are defined in the local east-north-up reference frame. - * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch - * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is - * zero, a range will be computed such that the whole bounding sphere is visible.

- * - *

In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the - * target will be the range. The heading will be aligned to local north.

+ +

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. + The heading and the pitch angles are defined in the local east-north-up reference frame. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is + zero, a range will be computed such that the whole bounding sphere is visible.

+ +

In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the range. The heading will be aligned to local north.

* @param boundingSphere - The bounding sphere to view, in world coordinates. * @param [options] - Object with the following properties: * @param [options.duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. @@ -26231,14 +26231,14 @@ export class Camera { computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined; /** * Switches the frustum/projection to perspective. - * - * This function is a no-op in 2D which must always be orthographic. + + This function is a no-op in 2D which must always be orthographic. */ switchToPerspectiveFrustum(): void; /** * Switches the frustum/projection to orthographic. - * - * This function is a no-op in 2D which will always be orthographic. + + This function is a no-op in 2D which will always be orthographic. */ switchToOrthographicFrustum(): void; } @@ -26256,8 +26256,8 @@ export namespace Camera { /** * Aggregates input events. For example, suppose the following inputs are received between frames: - * left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into - * one event with a start and end position of the mouse. +left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into +one event with a start and end position of the mouse. * @param [canvas = document] - The element to handle events for. */ export class CameraEventAggregator { @@ -26325,18 +26325,18 @@ export class CameraEventAggregator { reset(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes mouse listeners held by this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * handler = handler && handler.destroy(); */ @@ -26371,10 +26371,10 @@ export enum CameraEventType { /** * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded; - * the content is loaded on-demand when needed based on the view. - *

- * Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}. - *

+the content is loaded on-demand when needed based on the view. +

+Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}. +

*/ export class Cesium3DTile { constructor(); @@ -26388,7 +26388,7 @@ export class Cesium3DTile { readonly computedTransform: Matrix4; /** * The error, in meters, introduced if this tile is rendered and its children are not. - * This is used to compute screen space error, i.e., the error measured in pixels. + This is used to compute screen space error, i.e., the error measured in pixels. */ readonly geometricError: number; /** @@ -26397,11 +26397,11 @@ export class Cesium3DTile { readonly children: Cesium3DTile[]; /** * This tile's parent or undefined if this tile is the root. - *

- * When a tile's content points to an external tileset JSON file, the external tileset's - * root tile's parent is not undefined; instead, the parent references - * the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged. - *

+

+ When a tile's content points to an external tileset JSON file, the external tileset's + root tile's parent is not undefined; instead, the parent references + the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged. +

*/ readonly parent: Cesium3DTile; /** @@ -26418,7 +26418,7 @@ export class Cesium3DTile { readonly tileset: Cesium3DTileset; /** * The tile's content. This represents the actual tile's payload, - * not the content's metadata in the tileset JSON file. + not the content's metadata in the tileset JSON file. */ readonly content: Cesium3DTileContent; /** @@ -26427,34 +26427,34 @@ export class Cesium3DTile { readonly boundingSphere: BoundingSphere; /** * Returns the extras property in the tileset JSON for this tile, which contains application specific metadata. - * Returns undefined if extras does not exist. + Returns undefined if extras does not exist. */ readonly extras: any; } /** * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from - * the original feature, e.g. glTF material or per-point color in the tile. - *

- * When REPLACE or MIX are used and the source color is a glTF material, the technique must assign the - * _3DTILESDIFFUSE semantic to the diffuse color parameter. Otherwise only HIGHLIGHT is supported. - *

- *

- * A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the - * tileset's color blend mode. - *

- *

- * "techniques": {
- *   "technique0": {
- *     "parameters": {
- *       "diffuse": {
- *         "semantic": "_3DTILESDIFFUSE",
- *         "type": 35666
- *       }
- *     }
- *   }
- * }
- * 
+the original feature, e.g. glTF material or per-point color in the tile. +

+When REPLACE or MIX are used and the source color is a glTF material, the technique must assign the +_3DTILESDIFFUSE semantic to the diffuse color parameter. Otherwise only HIGHLIGHT is supported. +

+

+A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the +tileset's color blend mode. +

+

+"techniques": {
+  "technique0": {
+    "parameters": {
+      "diffuse": {
+        "semantic": "_3DTILESDIFFUSE",
+        "type": 35666
+      }
+    }
+  }
+}
+
*/ export enum Cesium3DTileColorBlendMode { /** @@ -26473,13 +26473,13 @@ export enum Cesium3DTileColorBlendMode { /** * The content of a tile in a {@link Cesium3DTileset}. - *

- * Derived classes of this interface provide access to individual features in the tile. - * Access derived objects through {@link Cesium3DTile#content}. - *

- *

- * This type describes an interface and is not intended to be instantiated directly. - *

+

+Derived classes of this interface provide access to individual features in the tile. +Access derived objects through {@link Cesium3DTile#content}. +

+

+This type describes an interface and is not intended to be instantiated directly. +

*/ export class Cesium3DTileContent { constructor(); @@ -26489,10 +26489,10 @@ export class Cesium3DTileContent { readonly featuresLength: number; /** * Gets the number of points in the tile. - *

- * Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which - * equals the number of groups of points as distinguished by the BATCH_ID feature table semantic. - *

+

+ Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which + equals the number of groups of points as distinguished by the BATCH_ID feature table semantic. +

*/ readonly pointsLength: number; /** @@ -26513,7 +26513,7 @@ export class Cesium3DTileContent { readonly batchTableByteLength: number; /** * Gets the array of {@link Cesium3DTileContent} objects that represent the - * content a composite's inner tiles, which can also be composites. + content a composite's inner tiles, which can also be composites. */ readonly innerContents: any[]; /** @@ -26534,7 +26534,7 @@ export class Cesium3DTileContent { readonly url: string; /** * Determines if the tile's batch table has a property. If it does, each feature in - * the tile will have the property. + the tile will have the property. * @param batchId - The batchId for the feature. * @param name - The case-sensitive name of the property. * @returns true if the property exists; otherwise, false. @@ -26542,11 +26542,11 @@ export class Cesium3DTileContent { hasProperty(batchId: number, name: string): boolean; /** * Returns the {@link Cesium3DTileFeature} object for the feature with the - * given batchId. This object is used to get and modify the - * feature's properties. - *

- * Features in a tile are ordered by batchId, an index used to retrieve their metadata from the batch table. - *

+ given batchId. This object is used to get and modify the + feature's properties. +

+ Features in a tile are ordered by batchId, an index used to retrieve their metadata from the batch table. +

* @param batchId - The batchId for the feature. * @returns The corresponding {@link Cesium3DTileFeature} object. */ @@ -26555,46 +26555,46 @@ export class Cesium3DTileContent { /** * A feature of a {@link Cesium3DTileset}. - *

- * Provides access to a feature's properties stored in the tile's batch table, as well - * as the ability to show/hide a feature and change its highlight color via - * {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively. - *

- *

- * Modifications to a Cesium3DTileFeature object have the lifetime of the tile's - * content. If the tile's content is unloaded, e.g., due to it going out of view and needing - * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any - * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications. - *

- *

- * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature} - * or picking using {@link Scene#pick} and {@link Scene#pickPosition}. - *

+

+Provides access to a feature's properties stored in the tile's batch table, as well +as the ability to show/hide a feature and change its highlight color via +{@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively. +

+

+Modifications to a Cesium3DTileFeature object have the lifetime of the tile's +content. If the tile's content is unloaded, e.g., due to it going out of view and needing +to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any +modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications. +

+

+Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature} +or picking using {@link Scene#pick} and {@link Scene#pickPosition}. +

* @example * // On mouse over, display all the properties for a feature in the console log. - * handler.setInputAction(function(movement) { - * var feature = scene.pick(movement.endPosition); - * if (feature instanceof Cesium.Cesium3DTileFeature) { - * var propertyNames = feature.getPropertyNames(); - * var length = propertyNames.length; - * for (var i = 0; i < length; ++i) { - * var propertyName = propertyNames[i]; - * console.log(propertyName + ': ' + feature.getProperty(propertyName)); - * } - * } - * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); +handler.setInputAction(function(movement) { + var feature = scene.pick(movement.endPosition); + if (feature instanceof Cesium.Cesium3DTileFeature) { + var propertyNames = feature.getPropertyNames(); + var length = propertyNames.length; + for (var i = 0; i < length; ++i) { + var propertyName = propertyNames[i]; + console.log(propertyName + ': ' + feature.getProperty(propertyName)); + } + } +}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); */ export class Cesium3DTileFeature { constructor(); /** * Gets or sets if the feature will be shown. This is set for all features - * when a style's show is evaluated. + when a style's show is evaluated. */ show: boolean; /** * Gets or sets the highlight color multiplied with the feature's color. When - * this is white, the feature's color is not changed. This is set for all features - * when a style's color is evaluated. + this is white, the feature's color is not changed. This is set for all features + when a style's color is evaluated. */ color: Color; /** @@ -26603,53 +26603,53 @@ export class Cesium3DTileFeature { readonly tileset: Cesium3DTileset; /** * All objects returned by {@link Scene#pick} have a primitive property. This returns - * the tileset containing the feature. + the tileset containing the feature. */ readonly primitive: Cesium3DTileset; /** * Returns whether the feature contains this property. This includes properties from this feature's - * class and inherited classes when using a batch table hierarchy. + class and inherited classes when using a batch table hierarchy. * @param name - The case-sensitive name of the property. * @returns Whether the feature contains this property. */ hasProperty(name: string): boolean; /** * Returns an array of property names for the feature. This includes properties from this feature's - * class and inherited classes when using a batch table hierarchy. + class and inherited classes when using a batch table hierarchy. * @param [results] - An array into which to store the results. * @returns The names of the feature's properties. */ getPropertyNames(results?: string[]): string[]; /** * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's - * class and inherited classes when using a batch table hierarchy. + class and inherited classes when using a batch table hierarchy. * @example * // Display all the properties for a feature in the console log. - * var propertyNames = feature.getPropertyNames(); - * var length = propertyNames.length; - * for (var i = 0; i < length; ++i) { - * var propertyName = propertyNames[i]; - * console.log(propertyName + ': ' + feature.getProperty(propertyName)); - * } + var propertyNames = feature.getPropertyNames(); + var length = propertyNames.length; + for (var i = 0; i < length; ++i) { + var propertyName = propertyNames[i]; + console.log(propertyName + ': ' + feature.getProperty(propertyName)); + } * @param name - The case-sensitive name of the property. * @returns The value of the property or undefined if the property does not exist. */ getProperty(name: string): any; /** * Sets the value of the feature's property with the given name. - *

- * If a property with the given name doesn't exist, it is created. - *

+

+ If a property with the given name doesn't exist, it is created. +

* @example * var height = feature.getProperty('Height'); // e.g., the height of a building * @example * var name = 'clicked'; - * if (feature.getProperty(name)) { - * console.log('already clicked'); - * } else { - * feature.setProperty(name, true); - * console.log('first click'); - * } + if (feature.getProperty(name)) { + console.log('already clicked'); + } else { + feature.setProperty(name, true); + console.log('first click'); + } * @param name - The case-sensitive name of the property. * @param value - The value of the property that will be copied. */ @@ -26658,102 +26658,102 @@ export class Cesium3DTileFeature { /** * A point feature of a {@link Cesium3DTileset}. - *

- * Provides access to a feature's properties stored in the tile's batch table, as well - * as the ability to show/hide a feature and change its point properties - *

- *

- * Modifications to a Cesium3DTilePointFeature object have the lifetime of the tile's - * content. If the tile's content is unloaded, e.g., due to it going out of view and needing - * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any - * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications. - *

- *

- * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature} - * or picking using {@link Scene#pick} and {@link Scene#pickPosition}. - *

+

+Provides access to a feature's properties stored in the tile's batch table, as well +as the ability to show/hide a feature and change its point properties +

+

+Modifications to a Cesium3DTilePointFeature object have the lifetime of the tile's +content. If the tile's content is unloaded, e.g., due to it going out of view and needing +to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any +modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications. +

+

+Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature} +or picking using {@link Scene#pick} and {@link Scene#pickPosition}. +

* @example * // On mouse over, display all the properties for a feature in the console log. - * handler.setInputAction(function(movement) { - * var feature = scene.pick(movement.endPosition); - * if (feature instanceof Cesium.Cesium3DTilePointFeature) { - * var propertyNames = feature.getPropertyNames(); - * var length = propertyNames.length; - * for (var i = 0; i < length; ++i) { - * var propertyName = propertyNames[i]; - * console.log(propertyName + ': ' + feature.getProperty(propertyName)); - * } - * } - * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); +handler.setInputAction(function(movement) { + var feature = scene.pick(movement.endPosition); + if (feature instanceof Cesium.Cesium3DTilePointFeature) { + var propertyNames = feature.getPropertyNames(); + var length = propertyNames.length; + for (var i = 0; i < length; ++i) { + var propertyName = propertyNames[i]; + console.log(propertyName + ': ' + feature.getProperty(propertyName)); + } + } +}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); */ export class Cesium3DTilePointFeature { constructor(); /** * Gets or sets if the feature will be shown. This is set for all features - * when a style's show is evaluated. + when a style's show is evaluated. */ show: boolean; /** * Gets or sets the color of the point of this feature. - *

- * Only applied when image is undefined. - *

+

+ Only applied when image is undefined. +

*/ color: Color; /** * Gets or sets the point size of this feature. - *

- * Only applied when image is undefined. - *

+

+ Only applied when image is undefined. +

*/ pointSize: number; /** * Gets or sets the point outline color of this feature. - *

- * Only applied when image is undefined. - *

+

+ Only applied when image is undefined. +

*/ pointOutlineColor: Color; /** * Gets or sets the point outline width in pixels of this feature. - *

- * Only applied when image is undefined. - *

+

+ Only applied when image is undefined. +

*/ pointOutlineWidth: number; /** * Gets or sets the label color of this feature. - *

- * The color will be applied to the label if labelText is defined. - *

+

+ The color will be applied to the label if labelText is defined. +

*/ labelColor: Color; /** * Gets or sets the label outline color of this feature. - *

- * The outline color will be applied to the label if labelText is defined. - *

+

+ The outline color will be applied to the label if labelText is defined. +

*/ labelOutlineColor: Color; /** * Gets or sets the outline width in pixels of this feature. - *

- * The outline width will be applied to the point if labelText is defined. - *

+

+ The outline width will be applied to the point if labelText is defined. +

*/ labelOutlineWidth: number; /** * Gets or sets the font of this feature. - *

- * Only applied when the labelText is defined. - *

+

+ Only applied when the labelText is defined. +

*/ font: string; /** * Gets or sets the fill and outline style of this feature. - *

- * Only applied when labelText is defined. - *

+

+ Only applied when labelText is defined. +

*/ labelStyle: LabelStyle; /** @@ -26762,23 +26762,23 @@ export class Cesium3DTilePointFeature { labelText: string; /** * Gets or sets the background color of the text for this feature. - *

- * Only applied when labelText is defined. - *

+

+ Only applied when labelText is defined. +

*/ backgroundColor: Color; /** * Gets or sets the background padding of the text for this feature. - *

- * Only applied when labelText is defined. - *

+

+ Only applied when labelText is defined. +

*/ backgroundPadding: Cartesian2; /** * Gets or sets whether to display the background of the text for this feature. - *

- * Only applied when labelText is defined. - *

+

+ Only applied when labelText is defined. +

*/ backgroundEnabled: boolean; /** @@ -26799,16 +26799,16 @@ export class Cesium3DTilePointFeature { heightOffset: number; /** * Gets or sets whether the anchor line is displayed. - *

- * Only applied when heightOffset is defined. - *

+

+ Only applied when heightOffset is defined. +

*/ anchorLineEnabled: boolean; /** * Gets or sets the color for the anchor line. - *

- * Only applied when heightOffset is defined. - *

+

+ Only applied when heightOffset is defined. +

*/ anchorLineColor: Color; /** @@ -26821,22 +26821,22 @@ export class Cesium3DTilePointFeature { disableDepthTestDistance: number; /** * Gets or sets the horizontal origin of this point, which determines if the point is - * to the left, center, or right of its anchor position. + to the left, center, or right of its anchor position. */ horizontalOrigin: HorizontalOrigin; /** * Gets or sets the vertical origin of this point, which determines if the point is - * to the bottom, center, or top of its anchor position. + to the bottom, center, or top of its anchor position. */ verticalOrigin: VerticalOrigin; /** * Gets or sets the horizontal origin of this point's text, which determines if the point's text is - * to the left, center, or right of its anchor position. + to the left, center, or right of its anchor position. */ labelHorizontalOrigin: HorizontalOrigin; /** * Get or sets the vertical origin of this point's text, which determines if the point's text is - * to the bottom, center, top, or baseline of it's anchor point. + to the bottom, center, top, or baseline of it's anchor point. */ labelVerticalOrigin: VerticalOrigin; /** @@ -26845,777 +26845,87 @@ export class Cesium3DTilePointFeature { readonly tileset: Cesium3DTileset; /** * All objects returned by {@link Scene#pick} have a primitive property. This returns - * the tileset containing the feature. + the tileset containing the feature. */ readonly primitive: Cesium3DTileset; /** * Returns whether the feature contains this property. This includes properties from this feature's - * class and inherited classes when using a batch table hierarchy. + class and inherited classes when using a batch table hierarchy. * @param name - The case-sensitive name of the property. * @returns Whether the feature contains this property. */ hasProperty(name: string): boolean; /** * Returns an array of property names for the feature. This includes properties from this feature's - * class and inherited classes when using a batch table hierarchy. + class and inherited classes when using a batch table hierarchy. * @param [results] - An array into which to store the results. * @returns The names of the feature's properties. */ getPropertyNames(results?: string[]): string[]; /** * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's - * class and inherited classes when using a batch table hierarchy. + class and inherited classes when using a batch table hierarchy. * @example * // Display all the properties for a feature in the console log. - * var propertyNames = feature.getPropertyNames(); - * var length = propertyNames.length; - * for (var i = 0; i < length; ++i) { - * var propertyName = propertyNames[i]; - * console.log(propertyName + ': ' + feature.getProperty(propertyName)); - * } + var propertyNames = feature.getPropertyNames(); + var length = propertyNames.length; + for (var i = 0; i < length; ++i) { + var propertyName = propertyNames[i]; + console.log(propertyName + ': ' + feature.getProperty(propertyName)); + } * @param name - The case-sensitive name of the property. * @returns The value of the property or undefined if the property does not exist. */ getProperty(name: string): any; /** * Sets the value of the feature's property with the given name. - *

- * If a property with the given name doesn't exist, it is created. - *

+

+ If a property with the given name doesn't exist, it is created. +

* @example * var height = feature.getProperty('Height'); // e.g., the height of a building * @example * var name = 'clicked'; - * if (feature.getProperty(name)) { - * console.log('already clicked'); - * } else { - * feature.setProperty(name, true); - * console.log('first click'); - * } + if (feature.getProperty(name)) { + console.log('already clicked'); + } else { + feature.setProperty(name, true); + console.log('first click'); + } * @param name - The case-sensitive name of the property. * @param value - The value of the property that will be copied. */ setProperty(name: string, value: any): void; } -/** - * A style that is applied to a {@link Cesium3DTileset}. - *

- * Evaluates an expression defined using the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. - *

- * @example - * tileset.style = new Cesium.Cesium3DTileStyle({ - * color : { - * conditions : [ - * ['${Height} >= 100', 'color("purple", 0.5)'], - * ['${Height} >= 50', 'color("red")'], - * ['true', 'color("blue")'] - * ] - * }, - * show : '${Height} > 0', - * meta : { - * description : '"Building id ${id} has height ${Height}."' - * } - * }); - * @example - * tileset.style = new Cesium.Cesium3DTileStyle({ - * color : 'vec4(${Temperature})', - * pointSize : '${Temperature} * 2.0' - * }); - * @param [style] - The url of a style or an object defining a style. - */ -export class Cesium3DTileStyle { - constructor(style?: Resource | string | any); - /** - * Gets the object defining the style using the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. - */ - readonly style: any; - /** - * When true, the style is ready and its expressions can be evaluated. When - * a style is constructed with an object, as opposed to a url, this is true immediately. - */ - readonly ready: boolean; - /** - * Gets the promise that will be resolved when the the style is ready and its expressions can be evaluated. - */ - readonly readyPromise: Promise; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's show property. Alternatively a boolean, string, or object defining a show style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return or convert to a Boolean. - *

- *

- * This expression is applicable to all tile formats. - *

- * @example - * var style = new Cesium3DTileStyle({ - * show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)' - * }); - * style.show.evaluate(feature); // returns true or false depending on the feature's properties - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override show expression with a custom function - * style.show = { - * evaluate : function(feature) { - * return true; - * } - * }; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override show expression with a boolean - * style.show = true; - * }; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override show expression with a string - * style.show = '${Height} > 0'; - * }; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override show expression with a condition - * style.show = { - * conditions: [ - * ['${height} > 2', 'false'], - * ['true', 'true'] - * ]; - * }; - */ - show: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's color property. Alternatively a string or object defining a color style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Color. - *

- *

- * This expression is applicable to all tile formats. - *

- * @example - * var style = new Cesium3DTileStyle({ - * color : '(${Temperature} > 90) ? color("red") : color("white")' - * }); - * style.color.evaluateColor(feature, result); // returns a Cesium.Color object - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override color expression with a custom function - * style.color = { - * evaluateColor : function(feature, result) { - * return Cesium.Color.clone(Cesium.Color.WHITE, result); - * } - * }; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override color expression with a string - * style.color = 'color("blue")'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override color expression with a condition - * style.color = { - * conditions : [ - * ['${height} > 2', 'color("cyan")'], - * ['true', 'color("blue")'] - * ] - * }; - */ - color: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointSize property. Alternatively a string or object defining a point size style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Number. - *

- *

- * This expression is only applicable to point features in a Vector tile or a Point Cloud tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * pointSize : '(${Temperature} > 90) ? 2.0 : 1.0' - * }); - * style.pointSize.evaluate(feature); // returns a Number - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override pointSize expression with a custom function - * style.pointSize = { - * evaluate : function(feature) { - * return 1.0; - * } - * }; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override pointSize expression with a number - * style.pointSize = 1.0; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override pointSize expression with a string - * style.pointSize = '${height} / 10'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override pointSize expression with a condition - * style.pointSize = { - * conditions : [ - * ['${height} > 2', '1.0'], - * ['true', '2.0'] - * ] - * }; - */ - pointSize: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointOutlineColor property. Alternatively a string or object defining a color style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Color. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override pointOutlineColor expression with a string - * style.pointOutlineColor = 'color("blue")'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override pointOutlineColor expression with a condition - * style.pointOutlineColor = { - * conditions : [ - * ['${height} > 2', 'color("cyan")'], - * ['true', 'color("blue")'] - * ] - * }; - */ - pointOutlineColor: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointOutlineWidth property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Number. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override pointOutlineWidth expression with a string - * style.pointOutlineWidth = '5'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override pointOutlineWidth expression with a condition - * style.pointOutlineWidth = { - * conditions : [ - * ['${height} > 2', '5'], - * ['true', '0'] - * ] - * }; - */ - pointOutlineWidth: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelColor property. Alternatively a string or object defining a color style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Color. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelColor expression with a string - * style.labelColor = 'color("blue")'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelColor expression with a condition - * style.labelColor = { - * conditions : [ - * ['${height} > 2', 'color("cyan")'], - * ['true', 'color("blue")'] - * ] - * }; - */ - labelColor: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelOutlineColor property. Alternatively a string or object defining a color style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Color. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelOutlineColor expression with a string - * style.labelOutlineColor = 'color("blue")'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelOutlineColor expression with a condition - * style.labelOutlineColor = { - * conditions : [ - * ['${height} > 2', 'color("cyan")'], - * ['true', 'color("blue")'] - * ] - * }; - */ - labelOutlineColor: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelOutlineWidth property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Number. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelOutlineWidth expression with a string - * style.labelOutlineWidth = '5'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelOutlineWidth expression with a condition - * style.labelOutlineWidth = { - * conditions : [ - * ['${height} > 2', '5'], - * ['true', '0'] - * ] - * }; - */ - labelOutlineWidth: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's font property. Alternatively a string or object defining a string style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a String. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"' - * }); - * style.font.evaluate(feature); // returns a String - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override font expression with a custom function - * style.font = { - * evaluate : function(feature) { - * return '24px Helvetica'; - * } - * }; - */ - font: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's label style property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a LabelStyle. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL - * }); - * style.labelStyle.evaluate(feature); // returns a LabelStyle - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelStyle expression with a custom function - * style.labelStyle = { - * evaluate : function(feature) { - * return LabelStyle.FILL; - * } - * }; - */ - labelStyle: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelText property. Alternatively a string or object defining a string style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a String. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * labelText : '(${Temperature} > 90) ? ">90" : "<=90"' - * }); - * style.labelText.evaluate(feature); // returns a String - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelText expression with a custom function - * style.labelText = { - * evaluate : function(feature) { - * return 'Example label text'; - * } - * }; - */ - labelText: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundColor property. Alternatively a string or object defining a color style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Color. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override backgroundColor expression with a string - * style.backgroundColor = 'color("blue")'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override backgroundColor expression with a condition - * style.backgroundColor = { - * conditions : [ - * ['${height} > 2', 'color("cyan")'], - * ['true', 'color("blue")'] - * ] - * }; - */ - backgroundColor: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundPadding property. Alternatively a string or object defining a vec2 style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Cartesian2. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override backgroundPadding expression with a string - * style.backgroundPadding = 'vec2(5.0, 7.0)'; - * style.backgroundPadding.evaluate(feature); // returns a Cartesian2 - */ - backgroundPadding: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundEnabled property. Alternatively a string or object defining a boolean style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Boolean. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override backgroundEnabled expression with a string - * style.backgroundEnabled = 'true'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override backgroundEnabled expression with a condition - * style.backgroundEnabled = { - * conditions : [ - * ['${height} > 2', 'true'], - * ['true', 'false'] - * ] - * }; - */ - backgroundEnabled: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's scaleByDistance property. Alternatively a string or object defining a vec4 style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Cartesian4. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override scaleByDistance expression with a string - * style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)'; - * style.scaleByDistance.evaluate(feature); // returns a Cartesian4 - */ - scaleByDistance: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's translucencyByDistance property. Alternatively a string or object defining a vec4 style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Cartesian4. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override translucencyByDistance expression with a string - * style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)'; - * style.translucencyByDistance.evaluate(feature); // returns a Cartesian4 - */ - translucencyByDistance: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's distanceDisplayCondition property. Alternatively a string or object defining a vec2 style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Cartesian2. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override distanceDisplayCondition expression with a string - * style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)'; - * style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2 - */ - distanceDisplayCondition: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's heightOffset property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Number. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override heightOffset expression with a string - * style.heightOffset = '2.0'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override heightOffset expression with a condition - * style.heightOffset = { - * conditions : [ - * ['${height} > 2', '4.0'], - * ['true', '2.0'] - * ] - * }; - */ - heightOffset: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's anchorLineEnabled property. Alternatively a string or object defining a boolean style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Boolean. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override anchorLineEnabled expression with a string - * style.anchorLineEnabled = 'true'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override anchorLineEnabled expression with a condition - * style.anchorLineEnabled = { - * conditions : [ - * ['${height} > 2', 'true'], - * ['true', 'false'] - * ] - * }; - */ - anchorLineEnabled: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's anchorLineColor property. Alternatively a string or object defining a color style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Color. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override anchorLineColor expression with a string - * style.anchorLineColor = 'color("blue")'; - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override anchorLineColor expression with a condition - * style.anchorLineColor = { - * conditions : [ - * ['${height} > 2', 'color("cyan")'], - * ['true', 'color("blue")'] - * ] - * }; - */ - anchorLineColor: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's image property. Alternatively a string or object defining a string style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a String. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"' - * }); - * style.image.evaluate(feature); // returns a String - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override image expression with a custom function - * style.image = { - * evaluate : function(feature) { - * return '/url/to/image'; - * } - * }; - */ - image: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's disableDepthTestDistance property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a Number. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override disableDepthTestDistance expression with a string - * style.disableDepthTestDistance = '1000.0'; - * style.disableDepthTestDistance.evaluate(feature); // returns a Number - */ - disableDepthTestDistance: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's horizontalOrigin property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a HorizontalOrigin. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * horizontalOrigin : HorizontalOrigin.LEFT - * }); - * style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override horizontalOrigin expression with a custom function - * style.horizontalOrigin = { - * evaluate : function(feature) { - * return HorizontalOrigin.CENTER; - * } - * }; - */ - horizontalOrigin: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's verticalOrigin property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a VerticalOrigin. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * verticalOrigin : VerticalOrigin.TOP - * }); - * style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override verticalOrigin expression with a custom function - * style.verticalOrigin = { - * evaluate : function(feature) { - * return VerticalOrigin.CENTER; - * } - * }; - */ - verticalOrigin: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelHorizontalOrigin property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a HorizontalOrigin. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * labelHorizontalOrigin : HorizontalOrigin.LEFT - * }); - * style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelHorizontalOrigin expression with a custom function - * style.labelHorizontalOrigin = { - * evaluate : function(feature) { - * return HorizontalOrigin.CENTER; - * } - * }; - */ - labelHorizontalOrigin: StyleExpression; - /** - * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelVerticalOrigin property. Alternatively a string or object defining a number style can be used. - * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. - *

- * The expression must return a VerticalOrigin. - *

- *

- * This expression is only applicable to point features in a Vector tile. - *

- * @example - * var style = new Cesium3DTileStyle({ - * labelVerticalOrigin : VerticalOrigin.TOP - * }); - * style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin - * @example - * var style = new Cesium.Cesium3DTileStyle(); - * // Override labelVerticalOrigin expression with a custom function - * style.labelVerticalOrigin = { - * evaluate : function(feature) { - * return VerticalOrigin.CENTER; - * } - * }; - */ - labelVerticalOrigin: StyleExpression; - /** - * Gets or sets the object containing application-specific expression that can be explicitly - * evaluated, e.g., for display in a UI. - * @example - * var style = new Cesium3DTileStyle({ - * meta : { - * description : '"Building id ${id} has height ${Height}."' - * } - * }); - * style.meta.description.evaluate(feature); // returns a String with the substituted variables - */ - meta: StyleExpression; -} - /** * A {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles tileset}, - * used for streaming massive heterogeneous 3D geospatial datasets. +used for streaming massive heterogeneous 3D geospatial datasets. * @example * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({ - * url : 'http://localhost:8002/tilesets/Seattle/tileset.json' - * })); + url : 'http://localhost:8002/tilesets/Seattle/tileset.json' +})); * @example * // Common setting for the skipLevelOfDetail optimization - * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({ - * url : 'http://localhost:8002/tilesets/Seattle/tileset.json', - * skipLevelOfDetail : true, - * baseScreenSpaceError : 1024, - * skipScreenSpaceErrorFactor : 16, - * skipLevels : 1, - * immediatelyLoadDesiredLevelOfDetail : false, - * loadSiblings : false, - * cullWithChildrenBounds : true - * })); +var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({ + url : 'http://localhost:8002/tilesets/Seattle/tileset.json', + skipLevelOfDetail : true, + baseScreenSpaceError : 1024, + skipScreenSpaceErrorFactor : 16, + skipLevels : 1, + immediatelyLoadDesiredLevelOfDetail : false, + loadSiblings : false, + cullWithChildrenBounds : true +})); * @example * // Common settings for the dynamicScreenSpaceError optimization - * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({ - * url : 'http://localhost:8002/tilesets/Seattle/tileset.json', - * dynamicScreenSpaceError : true, - * dynamicScreenSpaceErrorDensity : 0.00278, - * dynamicScreenSpaceErrorFactor : 4.0, - * dynamicScreenSpaceErrorHeightFalloff : 0.25 - * })); +var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({ + url : 'http://localhost:8002/tilesets/Seattle/tileset.json', + dynamicScreenSpaceError : true, + dynamicScreenSpaceErrorDensity : 0.00278, + dynamicScreenSpaceErrorFactor : 4.0, + dynamicScreenSpaceErrorHeightFalloff : 0.25 +})); * @param options - Object with the following properties: * @param options.url - The url to a tileset JSON file. * @param [options.show = true] - Determines if the tileset will be shown. @@ -27655,6 +26965,7 @@ export class Cesium3DTileStyle { * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. * @param [options.specularEnvironmentMaps] - A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps. * @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled. + * @param [options.vectorClassificationOnly = false] - Indicates that only the tileset's vector tiles should be used for classification. * @param [options.debugHeatmapTilePropertyName] - The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value. * @param [options.debugFreezeFrame = false] - For debugging only. Determines if only the tiles from last frame should be used for rendering. * @param [options.debugColorizeTiles = false] - For debugging only. When true, assigns a random color to each tile. @@ -27707,6 +27018,7 @@ export class Cesium3DTileset { sphericalHarmonicCoefficients?: Cartesian3[]; specularEnvironmentMaps?: string; backFaceCulling?: boolean; + vectorClassificationOnly?: boolean; debugHeatmapTilePropertyName?: string; debugFreezeFrame?: boolean; debugColorizeTiles?: boolean; @@ -27745,68 +27057,68 @@ export class Cesium3DTileset { preloadFlightDestinations: boolean; /** * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further - * away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer - * tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance. - * The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking - * at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region. + away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer + tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance. + The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking + at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region. */ dynamicScreenSpaceError: boolean; /** * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the - * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all - * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded. + screen space error for tiles around the edge of the screen. Screen space error returns to normal once all + the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded. */ foveatedScreenSpaceError: boolean; /** * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone, - * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. + interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. */ foveatedInterpolationCallback: Cesium3DTileset.foveatedInterpolationCallback; /** * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control - * how long in seconds to wait after the camera stops moving before deferred tiles start loading in. - * This time delay prevents requesting tiles around the edges of the screen when the camera is moving. - * Setting this to 0.0 will immediately request all tiles in any given view. + how long in seconds to wait after the camera stops moving before deferred tiles start loading in. + This time delay prevents requesting tiles around the edges of the screen when the camera is moving. + Setting this to 0.0 will immediately request all tiles in any given view. */ foveatedTimeDelay: number; /** * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this - * value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion. - * The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically. - * This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles - * beyond a certain distance all roughly having an error of 1.0. - *

- * The dynamic error is in the range [0.0, 1.0) and is multiplied by dynamicScreenSpaceErrorFactor to produce the - * final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error. - *

- *

- * Increasing dynamicScreenSpaceErrorDensity has the effect of moving the error midpoint closer to the camera. - * It is analogous to moving fog closer to the camera. - *

+ value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion. + The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically. + This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles + beyond a certain distance all roughly having an error of 1.0. +

+ The dynamic error is in the range [0.0, 1.0) and is multiplied by dynamicScreenSpaceErrorFactor to produce the + final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error. +

+

+ Increasing dynamicScreenSpaceErrorDensity has the effect of moving the error midpoint closer to the camera. + It is analogous to moving fog closer to the camera. +

*/ dynamicScreenSpaceErrorDensity: number; /** * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles - * are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled. + are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled. */ dynamicScreenSpaceErrorFactor: number; /** * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the - * full computed density is applied, otherwise the density falls off. This has the effect of higher density at - * street level views. - *

- * Valid values are between 0.0 and 1.0. - *

+ full computed density is applied, otherwise the density falls off. This has the effect of higher density at + street level views. +

+ Valid values are between 0.0 and 1.0. +

*/ dynamicScreenSpaceErrorHeightFalloff: number; /** * Determines whether the tileset casts or receives shadows from light sources. - *

- * Enabling shadows has a performance impact. A tileset that casts shadows must be rendered twice, once from the camera and again from the light's point of view. - *

- *

- * Shadows are rendered only when {@link Viewer#shadows} is true. - *

+

+ Enabling shadows has a performance impact. A tileset that casts shadows must be rendered twice, once from the camera and again from the light's point of view. +

+

+ Shadows are rendered only when {@link Viewer#shadows} is true. +

*/ shadows: ShadowMode; /** @@ -27815,13 +27127,13 @@ export class Cesium3DTileset { show: boolean; /** * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from - * the original feature, e.g. glTF material or per-point color in the tile. + the original feature, e.g. glTF material or per-point color in the tile. */ colorBlendMode: Cesium3DTileColorBlendMode; /** * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is MIX. - * A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between - * resulting in a mix of the source color and feature color. + A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between + resulting in a mix of the source color and feature color. */ colorBlendAmount: number; /** @@ -27830,205 +27142,205 @@ export class Cesium3DTileset { pointCloudShading: PointCloudShading; /** * The event fired to indicate progress of loading new tiles. This event is fired when a new tile - * is requested, when a requested tile is finished downloading, and when a downloaded tile has been - * processed and is ready to render. - *

- * The number of pending tile requests, numberOfPendingRequests, and number of tiles - * processing, numberOfTilesProcessing are passed to the event listener. - *

- *

- * This event is fired at the end of the frame after the scene is rendered. - *

+ is requested, when a requested tile is finished downloading, and when a downloaded tile has been + processed and is ready to render. +

+ The number of pending tile requests, numberOfPendingRequests, and number of tiles + processing, numberOfTilesProcessing are passed to the event listener. +

+

+ This event is fired at the end of the frame after the scene is rendered. +

* @example * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) { - * if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) { - * console.log('Stopped loading'); - * return; - * } - * - * console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing); - * }); + if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) { + console.log('Stopped loading'); + return; + } + + console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing); + }); */ loadProgress: Event; /** * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset - * is completely loaded for this view. - *

- * This event is fired at the end of the frame after the scene is rendered. - *

+ is completely loaded for this view. +

+ This event is fired at the end of the frame after the scene is rendered. +

* @example * tileset.allTilesLoaded.addEventListener(function() { - * console.log('All tiles are loaded'); - * }); + console.log('All tiles are loaded'); + }); */ allTilesLoaded: Event; /** * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event - * is fired once when all tiles in the initial view are loaded. - *

- * This event is fired at the end of the frame after the scene is rendered. - *

+ is fired once when all tiles in the initial view are loaded. +

+ This event is fired at the end of the frame after the scene is rendered. +

* @example * tileset.initialTilesLoaded.addEventListener(function() { - * console.log('Initial tiles are loaded'); - * }); + console.log('Initial tiles are loaded'); + }); */ initialTilesLoaded: Event; /** * The event fired to indicate that a tile's content was loaded. - *

- * The loaded {@link Cesium3DTile} is passed to the event listener. - *

- *

- * This event is fired during the tileset traversal while the frame is being rendered - * so that updates to the tile take effect in the same frame. Do not create or modify - * Cesium entities or primitives during the event listener. - *

+

+ The loaded {@link Cesium3DTile} is passed to the event listener. +

+

+ This event is fired during the tileset traversal while the frame is being rendered + so that updates to the tile take effect in the same frame. Do not create or modify + Cesium entities or primitives during the event listener. +

* @example * tileset.tileLoad.addEventListener(function(tile) { - * console.log('A tile was loaded.'); - * }); + console.log('A tile was loaded.'); + }); */ tileLoad: Event; /** * The event fired to indicate that a tile's content was unloaded. - *

- * The unloaded {@link Cesium3DTile} is passed to the event listener. - *

- *

- * This event is fired immediately before the tile's content is unloaded while the frame is being - * rendered so that the event listener has access to the tile's content. Do not create - * or modify Cesium entities or primitives during the event listener. - *

+

+ The unloaded {@link Cesium3DTile} is passed to the event listener. +

+

+ This event is fired immediately before the tile's content is unloaded while the frame is being + rendered so that the event listener has access to the tile's content. Do not create + or modify Cesium entities or primitives during the event listener. +

* @example * tileset.tileUnload.addEventListener(function(tile) { - * console.log('A tile was unloaded from the cache.'); - * }); + console.log('A tile was unloaded from the cache.'); + }); */ tileUnload: Event; /** * The event fired to indicate that a tile's content failed to load. - *

- * If there are no event listeners, error messages will be logged to the console. - *

- *

- * The error object passed to the listener contains two properties: - *

    - *
  • url: the url of the failed tile.
  • - *
  • message: the error message.
  • - *
+

+ If there are no event listeners, error messages will be logged to the console. +

+

+ The error object passed to the listener contains two properties: +

    +
  • url: the url of the failed tile.
  • +
  • message: the error message.
  • +
* @example * tileset.tileFailed.addEventListener(function(error) { - * console.log('An error occurred loading tile: ' + error.url); - * console.log('Error: ' + error.message); - * }); + console.log('An error occurred loading tile: ' + error.url); + console.log('Error: ' + error.message); + }); */ tileFailed: Event; /** * This event fires once for each visible tile in a frame. This can be used to manually - * style a tileset. - *

- * The visible {@link Cesium3DTile} is passed to the event listener. - *

- *

- * This event is fired during the tileset traversal while the frame is being rendered - * so that updates to the tile take effect in the same frame. Do not create or modify - * Cesium entities or primitives during the event listener. - *

+ style a tileset. +

+ The visible {@link Cesium3DTile} is passed to the event listener. +

+

+ This event is fired during the tileset traversal while the frame is being rendered + so that updates to the tile take effect in the same frame. Do not create or modify + Cesium entities or primitives during the event listener. +

* @example * tileset.tileVisible.addEventListener(function(tile) { - * if (tile.content instanceof Cesium.Batched3DModel3DTileContent) { - * console.log('A Batched 3D Model tile is visible.'); - * } - * }); + if (tile.content instanceof Cesium.Batched3DModel3DTileContent) { + console.log('A Batched 3D Model tile is visible.'); + } + }); * @example * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible. - * tileset.style = new Cesium.Cesium3DTileStyle({ - * color : 'color("red")' - * }); - * tileset.tileVisible.addEventListener(function(tile) { - * var content = tile.content; - * var featuresLength = content.featuresLength; - * for (var i = 0; i < featuresLength; i+=2) { - * content.getFeature(i).color = Cesium.Color.fromRandom(); - * } - * }); + tileset.style = new Cesium.Cesium3DTileStyle({ + color : 'color("red")' + }); + tileset.tileVisible.addEventListener(function(tile) { + var content = tile.content; + var featuresLength = content.featuresLength; + for (var i = 0; i < featuresLength; i+=2) { + content.getFeature(i).color = Cesium.Color.fromRandom(); + } + }); */ tileVisible: Event; /** * Optimization option. Determines if level of detail skipping should be applied during the traversal. - *

- * The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require - * all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped - * entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when - * using this optimization. - *

+

+ The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require + all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped + entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when + using this optimization. +

*/ skipLevelOfDetail: boolean; /** * The screen space error that must be reached before skipping levels of detail. - *

- * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. - *

+

+ Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. +

*/ baseScreenSpaceError: number; /** * Multiplier defining the minimum screen space error to skip. - * For example, if a tile has screen space error of 100, no tiles will be loaded unless they - * are leaves or have a screen space error <= 100 / skipScreenSpaceErrorFactor. - *

- * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. - *

+ For example, if a tile has screen space error of 100, no tiles will be loaded unless they + are leaves or have a screen space error <= 100 / skipScreenSpaceErrorFactor. +

+ Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. +

*/ skipScreenSpaceErrorFactor: number; /** * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. - * For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2. - *

- * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. - *

+ For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2. +

+ Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. +

*/ skipLevels: number; /** * When true, only tiles that meet the maximum screen space error will ever be downloaded. - * Skipping factors are ignored and just the desired tiles are loaded. - *

- * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. - *

+ Skipping factors are ignored and just the desired tiles are loaded. +

+ Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. +

*/ immediatelyLoadDesiredLevelOfDetail: boolean; /** * Determines whether siblings of visible tiles are always downloaded during traversal. - * This may be useful for ensuring that tiles are already available when the viewer turns left/right. - *

- * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. - *

+ This may be useful for ensuring that tiles are already available when the viewer turns left/right. +

+ Only used when {@link Cesium3DTileset#skipLevelOfDetail} is true. +

*/ loadSiblings: boolean; /** * The light color when shading models. When undefined the scene's light color is used instead. - *

- * For example, disabling additional light sources by setting model.imageBasedLightingFactor = new Cartesian2(0.0, 0.0) will make the - * model much darker. Here, increasing the intensity of the light source will make the model brighter. - *

+

+ For example, disabling additional light sources by setting model.imageBasedLightingFactor = new Cartesian2(0.0, 0.0) will make the + model much darker. Here, increasing the intensity of the light source will make the model brighter. +

*/ lightColor: Cartesian3; /** * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map. - * This is used when {@link Cesium3DTileset#specularEnvironmentMaps} and {@link Cesium3DTileset#sphericalHarmonicCoefficients} are not defined. + This is used when {@link Cesium3DTileset#specularEnvironmentMaps} and {@link Cesium3DTileset#sphericalHarmonicCoefficients} are not defined. */ luminanceAtZenith: number; /** * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When undefined, a diffuse irradiance - * computed from the atmosphere color is used. - *

- * There are nine Cartesian3 coefficients. - * The order of the coefficients is: L00, L1-1, L10, L11, L2-2, L2-1, L20, L21, L22 - *

- * - * These values can be obtained by preprocessing the environment map using the cmgen tool of - * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be - * supplied to {@link Cesium3DTileset#specularEnvironmentMaps}. + computed from the atmosphere color is used. +

+ There are nine Cartesian3 coefficients. + The order of the coefficients is: L00, L1-1, L10, L11, L2-2, L2-1, L20, L21, L22 +

+ + These values can be obtained by preprocessing the environment map using the cmgen tool of + {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be + supplied to {@link Cesium3DTileset#specularEnvironmentMaps}. */ sphericalHarmonicCoefficients: Cartesian3[]; /** @@ -28037,92 +27349,96 @@ export class Cesium3DTileset { specularEnvironmentMaps: string; /** * Whether to cull back-facing geometry. When true, back face culling is determined - * by the glTF material's doubleSided property; when false, back face culling is disabled. + by the glTF material's doubleSided property; when false, back face culling is disabled. */ backFaceCulling: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * Determines if only the tiles from last frame should be used for rendering. This - * effectively "freezes" the tileset to the previous frame so it is possible to zoom - * out and see what was rendered. - *

+

+ Determines if only the tiles from last frame should be used for rendering. This + effectively "freezes" the tileset to the previous frame so it is possible to zoom + out and see what was rendered. +

*/ debugFreezeFrame: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, assigns a random color to each tile. This is useful for visualizing - * what features belong to what tiles, especially with additive refinement where features - * from parent tiles may be interleaved with features from child tiles. - *

+

+ When true, assigns a random color to each tile. This is useful for visualizing + what features belong to what tiles, especially with additive refinement where features + from parent tiles may be interleaved with features from child tiles. +

*/ debugColorizeTiles: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, renders each tile's content as a wireframe. - *

+

+ When true, renders each tile's content as a wireframe. +

*/ debugWireframe: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, renders the bounding volume for each visible tile. The bounding volume is - * white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the - * screen space error and are still refining to their descendants are yellow. - *

+

+ When true, renders the bounding volume for each visible tile. The bounding volume is + white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the + screen space error and are still refining to their descendants are yellow. +

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, renders the bounding volume for each visible tile's content. The bounding volume is - * blue if the tile has a content bounding volume; otherwise it is red. - *

+

+ When true, renders the bounding volume for each visible tile's content. The bounding volume is + blue if the tile has a content bounding volume; otherwise it is red. +

*/ debugShowContentBoundingVolume: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, renders the viewer request volume for each tile. - *

+

+ When true, renders the viewer request volume for each tile. +

*/ debugShowViewerRequestVolume: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, draws labels to indicate the geometric error of each tile. - *

+

+ When true, draws labels to indicate the geometric error of each tile. +

*/ debugShowGeometricError: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, draws labels to indicate the number of commands, points, triangles and features of each tile. - *

+

+ When true, draws labels to indicate the number of commands, points, triangles and features of each tile. +

*/ debugShowRenderingStatistics: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, draws labels to indicate the geometry and texture memory usage of each tile. - *

+

+ When true, draws labels to indicate the geometry and texture memory usage of each tile. +

*/ debugShowMemoryUsage: boolean; /** * This property is for debugging only; it is not optimized for production use. - *

- * When true, draws labels to indicate the url of each tile. - *

+

+ When true, draws labels to indicate the url of each tile. +

*/ debugShowUrl: boolean; + /** + * Function for examining vector lines as they are being streamed. + */ + examineVectorLinesFunction: (...params: any[]) => any; /** * Gets the tileset's asset object property, which contains metadata about the tileset. - *

- * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-asset|asset schema reference} - * in the 3D Tiles spec for the full set of properties. - *

+

+ See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-asset|asset schema reference} + in the 3D Tiles spec for the full set of properties. +

*/ readonly asset: any; /** @@ -28135,40 +27451,40 @@ export class Cesium3DTileset { clippingPlanes: ClippingPlaneCollection; /** * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties. - *

- * See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-properties|properties schema reference} - * in the 3D Tiles spec for the full set of properties. - *

+

+ See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-properties|properties schema reference} + in the 3D Tiles spec for the full set of properties. +

* @example * console.log('Maximum building height: ' + tileset.properties.height.maximum); - * console.log('Minimum building height: ' + tileset.properties.height.minimum); + console.log('Minimum building height: ' + tileset.properties.height.minimum); */ readonly properties: any; /** * When true, the tileset's root tile is loaded and the tileset is ready to render. - * This is set to true right before {@link Cesium3DTileset#readyPromise} is resolved. + This is set to true right before {@link Cesium3DTileset#readyPromise} is resolved. */ readonly ready: boolean; /** * Gets the promise that will be resolved when the tileset's root tile is loaded and the tileset is ready to render. - *

- * This promise is resolved at the end of the frame before the first frame the tileset is rendered in. - *

+

+ This promise is resolved at the end of the frame before the first frame the tileset is rendered in. +

* @example * tileset.readyPromise.then(function(tileset) { - * // tile.properties is not defined until readyPromise resolves. - * var properties = tileset.properties; - * if (Cesium.defined(properties)) { - * for (var name in properties) { - * console.log(properties[name]); - * } - * } - * }); + // tile.properties is not defined until readyPromise resolves. + var properties = tileset.properties; + if (Cesium.defined(properties)) { + for (var name in properties) { + console.log(properties[name]); + } + } + }); */ readonly readyPromise: Promise; /** * When true, all tiles that meet the screen space error this frame are loaded. The tileset is - * completely loaded for this view. + completely loaded for this view. */ readonly tilesLoaded: boolean; /** @@ -28181,66 +27497,66 @@ export class Cesium3DTileset { readonly basePath: string; /** * The style, defined using the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, - * applied to each feature in the tileset. - *

- * Assign undefined to remove the style, which will restore the visual - * appearance of the tileset to its default when no style was applied. - *

- *

- * The style is applied to a tile before the {@link Cesium3DTileset#tileVisible} - * event is raised, so code in tileVisible can manually set a feature's - * properties (e.g. color and show) after the style is applied. When - * a new style is assigned any manually set properties are overwritten. - *

+ {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, + applied to each feature in the tileset. +

+ Assign undefined to remove the style, which will restore the visual + appearance of the tileset to its default when no style was applied. +

+

+ The style is applied to a tile before the {@link Cesium3DTileset#tileVisible} + event is raised, so code in tileVisible can manually set a feature's + properties (e.g. color and show) after the style is applied. When + a new style is assigned any manually set properties are overwritten. +

* @example * tileset.style = new Cesium.Cesium3DTileStyle({ - * color : { - * conditions : [ - * ['${Height} >= 100', 'color("purple", 0.5)'], - * ['${Height} >= 50', 'color("red")'], - * ['true', 'color("blue")'] - * ] - * }, - * show : '${Height} > 0', - * meta : { - * description : '"Building id ${id} has height ${Height}."' - * } - * }); + color : { + conditions : [ + ['${Height} >= 100', 'color("purple", 0.5)'], + ['${Height} >= 50', 'color("red")'], + ['true', 'color("blue")'] + ] + }, + show : '${Height} > 0', + meta : { + description : '"Building id ${id} has height ${Height}."' + } + }); */ style: Cesium3DTileStyle | undefined; /** * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile - * refines to its descendants, and therefore plays a major role in balancing performance with visual quality. - *

- * A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a - * radius equal to the tile's geometric error were rendered at the tile's position. If this value exceeds - * maximumScreenSpaceError the tile refines to its descendants. - *

- *

- * Depending on the tileset, maximumScreenSpaceError may need to be tweaked to achieve the right balance. - * Higher values provide better performance but lower visual quality. - *

+ refines to its descendants, and therefore plays a major role in balancing performance with visual quality. +

+ A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a + radius equal to the tile's geometric error were rendered at the tile's position. If this value exceeds + maximumScreenSpaceError the tile refines to its descendants. +

+

+ Depending on the tileset, maximumScreenSpaceError may need to be tweaked to achieve the right balance. + Higher values provide better performance but lower visual quality. +

*/ maximumScreenSpaceError: number; /** * The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from - * geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also - * includes per-point metadata. - *

- * Tiles not in view are unloaded to enforce this. - *

- *

- * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame. - *

- *

- * If tiles sized more than maximumMemoryUsage are needed - * to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError}, - * for the current view, then the memory usage of the tiles loaded will exceed - * maximumMemoryUsage. For example, if the maximum is 256 MB, but - * 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When - * these tiles go out of view, they will be unloaded. - *

+ geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also + includes per-point metadata. +

+ Tiles not in view are unloaded to enforce this. +

+

+ If decreasing this value results in unloading tiles, the tiles are unloaded the next frame. +

+

+ If tiles sized more than maximumMemoryUsage are needed + to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError}, + for the current view, then the memory usage of the tiles loaded will exceed + maximumMemoryUsage. For example, if the maximum is 256 MB, but + 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When + these tiles go out of view, they will be unloaded. +

*/ maximumMemoryUsage: number; /** @@ -28251,26 +27567,26 @@ export class Cesium3DTileset { * The tileset's bounding sphere. * @example * var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ - * url : 'http://localhost:8002/tilesets/Seattle/tileset.json' - * })); - * - * tileset.readyPromise.then(function(tileset) { - * // Set the camera to view the newly added tileset - * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0)); - * }); + url : 'http://localhost:8002/tilesets/Seattle/tileset.json' + })); + + tileset.readyPromise.then(function(tileset) { + // Set the camera to view the newly added tileset + viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0)); + }); */ readonly boundingSphere: BoundingSphere; /** * A 4x4 transformation matrix that transforms the entire tileset. * @example * // Adjust a tileset's height from the globe's surface. - * var heightOffset = 20.0; - * var boundingSphere = tileset.boundingSphere; - * var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center); - * var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); - * var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset); - * var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); - * tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); + var heightOffset = 20.0; + var boundingSphere = tileset.boundingSphere; + var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center); + var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset); + var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); */ modelMatrix: Matrix4; /** @@ -28279,28 +27595,28 @@ export class Cesium3DTileset { readonly timeSinceLoad: number; /** * The total amount of GPU memory in bytes used by the tileset. This value is estimated from - * geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also - * includes per-point metadata. + geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also + includes per-point metadata. */ readonly totalMemoryUsageInBytes: number; /** * Determines whether terrain, 3D Tiles or both will be classified by this tileset. - *

- * This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data - * must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets. - *

- *

- * When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF: - *

    - *
  • POSITION and _BATCHID semantics are required.
  • - *
  • All indices with the same batch id must occupy contiguous sections of the index buffer.
  • - *
  • All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.
  • - *
  • The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.
  • - *
  • Only one node is supported.
  • - *
  • Only one mesh per node is supported.
  • - *
  • Only one primitive per mesh is supported.
  • - *
- *

+

+ This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data + must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets. +

+

+ When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF: +

    +
  • POSITION and _BATCHID semantics are required.
  • +
  • All indices with the same batch id must occupy contiguous sections of the index buffer.
  • +
  • All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.
  • +
  • The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.
  • +
  • Only one node is supported.
  • +
  • Only one mesh per node is supported.
  • +
  • Only one primitive per mesh is supported.
  • +
+

*/ readonly classificationType: ClassificationType; /** @@ -28309,45 +27625,49 @@ export class Cesium3DTileset { readonly ellipsoid: Ellipsoid; /** * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. - * Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. - * Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, essentially disabling the effect. + Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. + Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, essentially disabling the effect. */ foveatedConeSize: number; /** * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. - * The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. + The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. */ foveatedMinimumScreenSpaceErrorRelaxation: number; /** * Returns the extras property at the top-level of the tileset JSON, which contains application specific metadata. - * Returns undefined if extras does not exist. + Returns undefined if extras does not exist. */ readonly extras: any; /** * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final - * diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources. + diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources. */ imageBasedLightingFactor: Cartesian2; + /** + * Indicates that only the tileset's vector tiles should be used for classification. + */ + vectorClassificationOnly: boolean; /** * Provides a hook to override the method used to request the tileset json - * useful when fetching tilesets from remote servers + useful when fetching tilesets from remote servers * @param tilesetUrl - The url of the json file to be fetched * @returns A promise that resolves with the fetched json data */ static loadJson(tilesetUrl: Resource | string): Promise; /** * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all - * features to re-evaluate the style in the next frame each is visible. + features to re-evaluate the style in the next frame each is visible. */ makeStyleDirty(): void; /** * Unloads all tiles that weren't selected the previous frame. This can be used to - * explicitly manage the tile cache and reduce the total number of tiles loaded below - * {@link Cesium3DTileset#maximumMemoryUsage}. - *

- * Tile unloads occur at the next frame to keep all the WebGL delete calls - * within the render loop. - *

+ explicitly manage the tile cache and reduce the total number of tiles loaded below + {@link Cesium3DTileset#maximumMemoryUsage}. +

+ Tile unloads occur at the next frame to keep all the WebGL delete calls + within the render loop. +

*/ trimLoadedTiles(): void; /** @@ -28358,19 +27678,19 @@ export class Cesium3DTileset { hasExtension(extensionName: string): boolean; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * tileset = tileset && tileset.destroy(); */ @@ -28380,7 +27700,7 @@ export class Cesium3DTileset { export namespace Cesium3DTileset { /** * Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, - * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. + interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. * @param p - The start value to interpolate. * @param q - The end value to interpolate. * @param time - The time of interpolation generally in the range [0.0, 1.0]. @@ -28388,9 +27708,699 @@ export namespace Cesium3DTileset { type foveatedInterpolationCallback = (p: number, q: number, time: number) => number; } +/** + * A style that is applied to a {@link Cesium3DTileset}. +

+Evaluates an expression defined using the +{@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. +

+ * @example + * tileset.style = new Cesium.Cesium3DTileStyle({ + color : { + conditions : [ + ['${Height} >= 100', 'color("purple", 0.5)'], + ['${Height} >= 50', 'color("red")'], + ['true', 'color("blue")'] + ] + }, + show : '${Height} > 0', + meta : { + description : '"Building id ${id} has height ${Height}."' + } +}); + * @example + * tileset.style = new Cesium.Cesium3DTileStyle({ + color : 'vec4(${Temperature})', + pointSize : '${Temperature} * 2.0' +}); + * @param [style] - The url of a style or an object defining a style. + */ +export class Cesium3DTileStyle { + constructor(style?: Resource | string | any); + /** + * Gets the object defining the style using the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + */ + readonly style: any; + /** + * When true, the style is ready and its expressions can be evaluated. When + a style is constructed with an object, as opposed to a url, this is true immediately. + */ + readonly ready: boolean; + /** + * Gets the promise that will be resolved when the the style is ready and its expressions can be evaluated. + */ + readonly readyPromise: Promise; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's show property. Alternatively a boolean, string, or object defining a show style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return or convert to a Boolean. +

+

+ This expression is applicable to all tile formats. +

+ * @example + * var style = new Cesium3DTileStyle({ + show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)' + }); + style.show.evaluate(feature); // returns true or false depending on the feature's properties + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override show expression with a custom function + style.show = { + evaluate : function(feature) { + return true; + } + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override show expression with a boolean + style.show = true; + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override show expression with a string + style.show = '${Height} > 0'; + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override show expression with a condition + style.show = { + conditions: [ + ['${height} > 2', 'false'], + ['true', 'true'] + ]; + }; + */ + show: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's color property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Color. +

+

+ This expression is applicable to all tile formats. +

+ * @example + * var style = new Cesium3DTileStyle({ + color : '(${Temperature} > 90) ? color("red") : color("white")' + }); + style.color.evaluateColor(feature, result); // returns a Cesium.Color object + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override color expression with a custom function + style.color = { + evaluateColor : function(feature, result) { + return Cesium.Color.clone(Cesium.Color.WHITE, result); + } + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override color expression with a string + style.color = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override color expression with a condition + style.color = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + color: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointSize property. Alternatively a string or object defining a point size style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Number. +

+

+ This expression is only applicable to point features in a Vector tile or a Point Cloud tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + pointSize : '(${Temperature} > 90) ? 2.0 : 1.0' + }); + style.pointSize.evaluate(feature); // returns a Number + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointSize expression with a custom function + style.pointSize = { + evaluate : function(feature) { + return 1.0; + } + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointSize expression with a number + style.pointSize = 1.0; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointSize expression with a string + style.pointSize = '${height} / 10'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointSize expression with a condition + style.pointSize = { + conditions : [ + ['${height} > 2', '1.0'], + ['true', '2.0'] + ] + }; + */ + pointSize: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointOutlineColor property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Color. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointOutlineColor expression with a string + style.pointOutlineColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointOutlineColor expression with a condition + style.pointOutlineColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + pointOutlineColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's pointOutlineWidth property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Number. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointOutlineWidth expression with a string + style.pointOutlineWidth = '5'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointOutlineWidth expression with a condition + style.pointOutlineWidth = { + conditions : [ + ['${height} > 2', '5'], + ['true', '0'] + ] + }; + */ + pointOutlineWidth: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelColor property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Color. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelColor expression with a string + style.labelColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelColor expression with a condition + style.labelColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + labelColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelOutlineColor property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Color. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelOutlineColor expression with a string + style.labelOutlineColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelOutlineColor expression with a condition + style.labelOutlineColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + labelOutlineColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelOutlineWidth property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Number. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelOutlineWidth expression with a string + style.labelOutlineWidth = '5'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelOutlineWidth expression with a condition + style.labelOutlineWidth = { + conditions : [ + ['${height} > 2', '5'], + ['true', '0'] + ] + }; + */ + labelOutlineWidth: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's font property. Alternatively a string or object defining a string style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a String. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"' + }); + style.font.evaluate(feature); // returns a String + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override font expression with a custom function + style.font = { + evaluate : function(feature) { + return '24px Helvetica'; + } + }; + */ + font: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's label style property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a LabelStyle. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL + }); + style.labelStyle.evaluate(feature); // returns a LabelStyle + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelStyle expression with a custom function + style.labelStyle = { + evaluate : function(feature) { + return LabelStyle.FILL; + } + }; + */ + labelStyle: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelText property. Alternatively a string or object defining a string style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a String. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + labelText : '(${Temperature} > 90) ? ">90" : "<=90"' + }); + style.labelText.evaluate(feature); // returns a String + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelText expression with a custom function + style.labelText = { + evaluate : function(feature) { + return 'Example label text'; + } + }; + */ + labelText: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundColor property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Color. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundColor expression with a string + style.backgroundColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundColor expression with a condition + style.backgroundColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + backgroundColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundPadding property. Alternatively a string or object defining a vec2 style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Cartesian2. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundPadding expression with a string + style.backgroundPadding = 'vec2(5.0, 7.0)'; + style.backgroundPadding.evaluate(feature); // returns a Cartesian2 + */ + backgroundPadding: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's backgroundEnabled property. Alternatively a string or object defining a boolean style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Boolean. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundEnabled expression with a string + style.backgroundEnabled = 'true'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundEnabled expression with a condition + style.backgroundEnabled = { + conditions : [ + ['${height} > 2', 'true'], + ['true', 'false'] + ] + }; + */ + backgroundEnabled: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's scaleByDistance property. Alternatively a string or object defining a vec4 style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Cartesian4. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override scaleByDistance expression with a string + style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)'; + style.scaleByDistance.evaluate(feature); // returns a Cartesian4 + */ + scaleByDistance: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's translucencyByDistance property. Alternatively a string or object defining a vec4 style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Cartesian4. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override translucencyByDistance expression with a string + style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)'; + style.translucencyByDistance.evaluate(feature); // returns a Cartesian4 + */ + translucencyByDistance: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's distanceDisplayCondition property. Alternatively a string or object defining a vec2 style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Cartesian2. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override distanceDisplayCondition expression with a string + style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)'; + style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2 + */ + distanceDisplayCondition: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's heightOffset property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Number. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override heightOffset expression with a string + style.heightOffset = '2.0'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override heightOffset expression with a condition + style.heightOffset = { + conditions : [ + ['${height} > 2', '4.0'], + ['true', '2.0'] + ] + }; + */ + heightOffset: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's anchorLineEnabled property. Alternatively a string or object defining a boolean style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Boolean. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override anchorLineEnabled expression with a string + style.anchorLineEnabled = 'true'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override anchorLineEnabled expression with a condition + style.anchorLineEnabled = { + conditions : [ + ['${height} > 2', 'true'], + ['true', 'false'] + ] + }; + */ + anchorLineEnabled: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's anchorLineColor property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Color. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override anchorLineColor expression with a string + style.anchorLineColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override anchorLineColor expression with a condition + style.anchorLineColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + anchorLineColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's image property. Alternatively a string or object defining a string style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a String. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"' + }); + style.image.evaluate(feature); // returns a String + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override image expression with a custom function + style.image = { + evaluate : function(feature) { + return '/url/to/image'; + } + }; + */ + image: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's disableDepthTestDistance property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a Number. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override disableDepthTestDistance expression with a string + style.disableDepthTestDistance = '1000.0'; + style.disableDepthTestDistance.evaluate(feature); // returns a Number + */ + disableDepthTestDistance: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's horizontalOrigin property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a HorizontalOrigin. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + horizontalOrigin : HorizontalOrigin.LEFT + }); + style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override horizontalOrigin expression with a custom function + style.horizontalOrigin = { + evaluate : function(feature) { + return HorizontalOrigin.CENTER; + } + }; + */ + horizontalOrigin: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's verticalOrigin property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a VerticalOrigin. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + verticalOrigin : VerticalOrigin.TOP + }); + style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override verticalOrigin expression with a custom function + style.verticalOrigin = { + evaluate : function(feature) { + return VerticalOrigin.CENTER; + } + }; + */ + verticalOrigin: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelHorizontalOrigin property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a HorizontalOrigin. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + labelHorizontalOrigin : HorizontalOrigin.LEFT + }); + style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelHorizontalOrigin expression with a custom function + style.labelHorizontalOrigin = { + evaluate : function(feature) { + return HorizontalOrigin.CENTER; + } + }; + */ + labelHorizontalOrigin: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's labelVerticalOrigin property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. +

+ The expression must return a VerticalOrigin. +

+

+ This expression is only applicable to point features in a Vector tile. +

+ * @example + * var style = new Cesium3DTileStyle({ + labelVerticalOrigin : VerticalOrigin.TOP + }); + style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelVerticalOrigin expression with a custom function + style.labelVerticalOrigin = { + evaluate : function(feature) { + return VerticalOrigin.CENTER; + } + }; + */ + labelVerticalOrigin: StyleExpression; + /** + * Gets or sets the object containing application-specific expression that can be explicitly + evaluated, e.g., for display in a UI. + * @example + * var style = new Cesium3DTileStyle({ + meta : { + description : '"Building id ${id} has height ${Height}."' + } + }); + style.meta.description.evaluate(feature); // returns a String with the substituted variables + */ + meta: StyleExpression; +} + /** * A ParticleEmitter that emits particles from a circle. - * Particles will be positioned within a circle and have initial velocities going along the z vector. +Particles will be positioned within a circle and have initial velocities going along the z vector. * @param [radius = 1.0] - The radius of the circle in meters. */ export class CircleEmitter { @@ -28407,26 +28417,26 @@ export class CircleEmitter { /** * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted. - *

- * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including - * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, - * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix - * and match most of them and add a new geometry or appearance independently of each other. - * Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using - * ClassificationPrimitive directly. - * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead. - *

- *

- * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there - * will be rendering artifacts for some viewing angles. - *

- *

- * Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}. - *

- *

- * Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}, - * are also valid if they are extruded volumes; otherwise, they will not be rendered. - *

+

+A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including +{@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, +and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix +and match most of them and add a new geometry or appearance independently of each other. +Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using +ClassificationPrimitive directly. +For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead. +

+

+For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there +will be rendering artifacts for some viewing angles. +

+

+Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}. +

+

+Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}, +are also valid if they are extruded volumes; otherwise, they will not be rendered. +

* @param [options] - Object with the following properties: * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one. * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute. @@ -28440,7 +28450,7 @@ export class CircleEmitter { * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be true on - * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be false. + creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be false. */ export class ClassificationPrimitive { constructor(options?: { @@ -28459,21 +28469,21 @@ export class ClassificationPrimitive { }); /** * The geometry instance rendered with this primitive. This may - * be undefined if options.releaseGeometryInstances - * is true when the primitive is constructed. - *

- * Changing this property after the primitive is rendered has no effect. - *

- *

- * Because of the rendering technique used, all geometry instances must be the same color. - * If there is an instance with a differing color, a DeveloperError will be thrown - * on the first attempt to render. - *

+ be undefined if options.releaseGeometryInstances + is true when the primitive is constructed. +

+ Changing this property after the primitive is rendered has no effect. +

+

+ Because of the rendering technique used, all geometry instances must be the same color. + If there is an instance with a differing color, a DeveloperError will be thrown + on the first attempt to render. +

*/ readonly geometryInstances: any[] | GeometryInstance; /** * Determines if the primitive will be shown. This affects all geometry - * instances in the primitive. + instances in the primitive. */ show: boolean; /** @@ -28482,16 +28492,16 @@ export class ClassificationPrimitive { classificationType: ClassificationType; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the primitive. - *

+

+ Draws the bounding sphere for each draw command in the primitive. +

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the shadow volume for each geometry in the primitive. - *

+

+ Draws the shadow volume for each geometry in the primitive. +

*/ debugShowShadowVolume: boolean; /** @@ -28520,8 +28530,8 @@ export class ClassificationPrimitive { readonly compressVertices: boolean; /** * Determines if the primitive is complete and ready to render. If this property is - * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update} - * is called. + true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update} + is called. */ readonly ready: boolean; /** @@ -28536,40 +28546,40 @@ export class ClassificationPrimitive { static isSupported(scene: Scene): boolean; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. * @example * var attributes = primitive.getGeometryInstanceAttributes('an id'); - * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); - * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); * @param id - The id of the {@link GeometryInstance}. * @returns The typed array in the attribute's format or undefined if the is no instance with id. */ getGeometryInstanceAttributes(id: any): any; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

* @example * e = e && e.destroy(); */ @@ -28596,22 +28606,22 @@ export enum ClassificationType { /** * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}. - * Compatible with mathematics functions in {@link Plane} +Compatible with mathematics functions in {@link Plane} * @param normal - The plane's normal (normalized). * @param distance - The shortest distance from the origin to the plane. The sign of - * distance determines which side of the plane the origin - * is on. If distance is positive, the origin is in the half-space - * in the direction of the normal; if negative, the origin is in the half-space - * opposite to the normal; if zero, the plane passes through the origin. +distance determines which side of the plane the origin +is on. If distance is positive, the origin is in the half-space +in the direction of the normal; if negative, the origin is in the half-space +opposite to the normal; if zero, the plane passes through the origin. */ export class ClippingPlane { constructor(normal: Cartesian3, distance: number); /** * The shortest distance from the origin to the plane. The sign of - * distance determines which side of the plane the origin - * is on. If distance is positive, the origin is in the half-space - * in the direction of the normal; if negative, the origin is in the half-space - * opposite to the normal; if zero, the plane passes through the origin. + distance determines which side of the plane the origin + is on. If distance is positive, the origin is in the half-space + in the direction of the normal; if negative, the origin is in the half-space + opposite to the normal; if zero, the plane passes through the origin. */ distance: number; /** @@ -28636,34 +28646,34 @@ export class ClippingPlane { /** * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the - * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe. - *

- * In general the clipping planes' coordinates are relative to the object they're attached to, so a plane with distance set to 0 will clip - * through the center of the object. - *

- *

- * For 3D Tiles, the root tile's transform is used to position the clipping planes. If a transform is not defined, the root tile's {@link Cesium3DTile#boundingSphere} is used instead. - *

+outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe. +

+In general the clipping planes' coordinates are relative to the object they're attached to, so a plane with distance set to 0 will clip +through the center of the object. +

+

+For 3D Tiles, the root tile's transform is used to position the clipping planes. If a transform is not defined, the root tile's {@link Cesium3DTile#boundingSphere} is used instead. +

* @example * // This clipping plane's distance is positive, which means its normal - * // is facing the origin. This will clip everything that is behind - * // the plane, which is anything with y coordinate < -5. - * var clippingPlanes = new Cesium.ClippingPlaneCollection({ - * planes : [ - * new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0) - * ], - * }); - * // Create an entity and attach the ClippingPlaneCollection to the model. - * var entity = viewer.entities.add({ - * position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000), - * model : { - * uri : 'model.gltf', - * minimumPixelSize : 128, - * maximumScale : 20000, - * clippingPlanes : clippingPlanes - * } - * }); - * viewer.zoomTo(entity); +// is facing the origin. This will clip everything that is behind +// the plane, which is anything with y coordinate < -5. +var clippingPlanes = new Cesium.ClippingPlaneCollection({ + planes : [ + new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0) + ], +}); +// Create an entity and attach the ClippingPlaneCollection to the model. +var entity = viewer.entities.add({ + position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000), + model : { + uri : 'model.gltf', + minimumPixelSize : 128, + maximumScale : 20000, + clippingPlanes : clippingPlanes + } +}); +viewer.zoomTo(entity); * @param [options] - Object with the following properties: * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane. * @param [options.enabled = true] - Determines whether the clipping planes are active. @@ -28683,7 +28693,7 @@ export class ClippingPlaneCollection { }); /** * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes - * original coordinate system. + original coordinate system. */ modelMatrix: Matrix4; /** @@ -28696,24 +28706,24 @@ export class ClippingPlaneCollection { edgeWidth: number; /** * An event triggered when a new clipping plane is added to the collection. Event handlers - * are passed the new plane and the index at which it was added. + are passed the new plane and the index at which it was added. */ planeAdded: Event; /** * An event triggered when a new clipping plane is removed from the collection. Event handlers - * are passed the new plane and the index from which it was removed. + are passed the new plane and the index from which it was removed. */ planeRemoved: Event; /** * Returns the number of planes in this collection. This is commonly used with - * {@link ClippingPlaneCollection#get} to iterate over all the planes - * in the collection. + {@link ClippingPlaneCollection#get} to iterate over all the planes + in the collection. */ readonly length: number; /** * If true, a region will be clipped if it is on the outside of any plane in the - * collection. Otherwise, a region will only be clipped if it is on the - * outside of every plane. + collection. Otherwise, a region will only be clipped if it is on the + outside of every plane. */ unionClippingRegions: boolean; /** @@ -28722,17 +28732,17 @@ export class ClippingPlaneCollection { enabled: boolean; /** * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering - * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify - * how modify the clipping behavior of multiple planes. + on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify + how modify the clipping behavior of multiple planes. * @param plane - The ClippingPlane to add to the collection. */ add(plane: ClippingPlane): void; /** * Returns the plane in the collection at the specified index. Indices are zero-based - * and increase as planes are added. Removing a plane shifts all planes after - * it to the left, changing their indices. This function is commonly used with - * {@link ClippingPlaneCollection#length} to iterate over all the planes - * in the collection. + and increase as planes are added. Removing a plane shifts all planes after + it to the left, changing their indices. This function is commonly used with + {@link ClippingPlaneCollection#length} to iterate over all the planes + in the collection. * @param index - The zero-based index of the plane. * @returns The ClippingPlane at the specified index. */ @@ -28754,27 +28764,27 @@ export class ClippingPlaneCollection { removeAll(): void; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * build the resources for clipping planes. - *

- * Do not call this function directly. - *

+ build the resources for clipping planes. +

+ Do not call this function directly. +

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * clippingPlanes = clippingPlanes && clippingPlanes.destroy(); */ @@ -28783,10 +28793,10 @@ export class ClippingPlaneCollection { /** * Defines different modes for blending between a target color and a primitive's source color. - * - * HIGHLIGHT multiplies the source color by the target color - * REPLACE replaces the source color with the target color - * MIX blends the source color and target color together + +HIGHLIGHT multiplies the source color by the target color +REPLACE replaces the source color with the target color +MIX blends the source color and target color together */ export enum ColorBlendMode { HIGHLIGHT = 0, @@ -28796,22 +28806,22 @@ export enum ColorBlendMode { /** * An expression for a style applied to a {@link Cesium3DTileset}. - *

- * Evaluates a conditions expression defined using the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. - *

- *

- * Implements the {@link StyleExpression} interface. - *

+

+Evaluates a conditions expression defined using the +{@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. +

+

+Implements the {@link StyleExpression} interface. +

* @example * var expression = new Cesium.ConditionsExpression({ - * conditions : [ - * ['${Area} > 10, 'color("#FF0000")'], - * ['${id} !== "1"', 'color("#00FF00")'], - * ['true', 'color("#FFFFFF")'] - * ] - * }); - * expression.evaluateColor(feature, result); // returns a Cesium.Color object + conditions : [ + ['${Area} > 10, 'color("#FF0000")'], + ['${id} !== "1"', 'color("#00FF00")'], + ['true', 'color("#FFFFFF")'] + ] +}); +expression.evaluateColor(feature, result); // returns a Cesium.Color object * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language. * @param [defines] - Defines in the style. */ @@ -28823,13 +28833,13 @@ export class ConditionsExpression { readonly conditionsExpression: any; /** * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of - * the expression in the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} - * is of type Boolean, Number, or String, the corresponding JavaScript - * primitive type will be returned. If the result is a RegExp, a Javascript RegExp - * object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, - * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is - * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. + the expression in the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + is of type Boolean, Number, or String, the corresponding JavaScript + primitive type will be returned. If the result is a RegExp, a Javascript RegExp + object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, + a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is + a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. * @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object onto which to store the result. * @returns The result of evaluating the expression. @@ -28837,9 +28847,9 @@ export class ConditionsExpression { evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; /** * Evaluates the result of a Color expression, using the values defined by a feature. - *

- * This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object. - *

+

+ This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object. +

* @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object in which to store the result * @returns The modified result parameter or a new Color instance if one was not provided. @@ -28849,13 +28859,151 @@ export class ConditionsExpression { /** * A ParticleEmitter that emits particles within a cone. - * Particles will be positioned at the tip of the cone and have initial velocities going towards the base. +Particles will be positioned at the tip of the cone and have initial velocities going towards the base. * @param [angle = Cesium.Math.toRadians(30.0)] - The angle of the cone in radians. */ export class ConeEmitter { constructor(angle?: number); } +/** + * @property height - The height. + * @property color - The color at this height. + */ +export type createElevationBandMaterialEntry = { + height: number; + color: Color; +}; + +/** + * @property entries - A list of elevation entries. They will automatically be sorted from lowest to highest. If there is only one entry and extendsDownards and extendUpwards are both false, they will both be set to true. + * @property [extendDownwards = false] - If true, the band's minimum elevation color will extend infinitely downwards. + * @property [extendUpwards = false] - If true, the band's maximum elevation color will extend infinitely upwards. + */ +export type createElevationBandMaterialBand = { + entries: createElevationBandMaterialEntry[]; + extendDownwards?: boolean; + extendUpwards?: boolean; +}; + +/** + * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights. + +The shader does a binary search over all the heights to find out which colors are above and below a given height, and +interpolates between them for the final color. This material supports hundreds of entries relatively cheaply. + * @example + * scene.globe.material = Cesium.createElevationBandMaterial({ + scene : scene, + layers : [{ + entries : [{ + height : 4200.0, + color : new Cesium.Color(0.0, 0.0, 0.0, 1.0) + }, { + height : 8848.0, + color : new Cesium.Color(1.0, 1.0, 1.0, 1.0) + }], + extendDownwards : true, + extendUpwards : true, + }, { + entries : [{ + height : 7000.0, + color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) + }, { + height : 7100.0, + color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) + }] + }] +}); + * @param options - Object with the following properties: + * @param options.scene - The scene where the visualization is taking place. + * @param options.layers - A list of bands ordered from lowest to highest precedence. + * @returns A new {@link Material} instance. + */ +export function createElevationBandMaterial(options: { + scene: Scene; + layers: createElevationBandMaterialBand[]; +}): Material; + +/** + * Creates a {@link Cesium3DTileset} instance for the +{@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings} +tileset. + * @example + * // Create Cesium OSM Buildings with default styling +var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.scene.primitives.add(Cesium.createOsmBuildings()); + * @example + * // Create Cesium OSM Buildings with a custom style highlighting +// schools and hospitals. +viewer.scene.primitives.add(Cesium.createOsmBuildings({ + style: new Cesium.Cesium3DTileStyle({ + color: { + conditions: [ + ["${feature['building']} === 'hospital'", "color('#0000FF')"], + ["${feature['building']} === 'school'", "color('#00FF00')"], + [true, "color('#ffffff')"] + ] + } + }) +})); + * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor + may be specified here. In addition to those, the following properties are supported: + * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings + that do not have a color. This parameter is ignored if options.style is specified. + * @param [options.style] - The style to use with the tileset. If not + specified, a default style is used which gives each building or building part a + color inferred from its OpenStreetMap tags. If no color can be inferred, + options.defaultColor is used. + */ +export function createOsmBuildings(options?: { + defaultColor?: Color; + style?: Cesium3DTileStyle; +}): Cesium3DTileset; + +/** + * Creates a {@link Primitive} to visualize well-known vector vertex attributes: +normal, tangent, and bitangent. Normal +is red; tangent is green; and bitangent is blue. If an attribute is not +present, it is not drawn. + * @example + * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({ + geometry : instance.geometry, + length : 100000.0, + modelMatrix : instance.modelMatrix +})); + * @param options - Object with the following properties: + * @param options.geometry - The Geometry instance with the attribute. + * @param [options.length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates. + * @returns A new Primitive instance with geometry for the vectors. + */ +export function createTangentSpaceDebugPrimitive(options: { + geometry: Geometry; + length?: number; + modelMatrix?: Matrix4; +}): Primitive; + +/** + * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps. + * @example + * // Create Cesium World Terrain with default settings +var viewer = new Cesium.Viewer('cesiumContainer', { + imageryProvider : Cesium.createWorldImagery(); +}); + * @example + * // Create Cesium World Terrain with water and normals. +var viewer = new Cesium.Viewer('cesiumContainer', { + imageryProvider : Cesium.createWorldImagery({ + style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS + }) +}); + * @param [options] - Object with the following properties: + * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported. + */ +export function createWorldImagery(options?: { + style?: IonWorldImageryStyle; +}): IonImageryProvider; + /** * The credit display is responsible for displaying credits on screen. * @example @@ -28899,16 +29047,16 @@ export class CreditDisplay { endFrame(): void; /** * Destroys the resources held by this object. Destroying an object allows for deterministic - * release of resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. */ destroy(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

+

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; @@ -28938,18 +29086,18 @@ export enum CullFace { /** * Visualizes a vertex attribute by displaying it as a color for debugging. - *

- * Components for well-known unit-length vectors, i.e., normal, - * tangent, and bitangent, are scaled and biased - * from [-1.0, 1.0] to (-1.0, 1.0). - *

+

+Components for well-known unit-length vectors, i.e., normal, +tangent, and bitangent, are scaled and biased +from [-1.0, 1.0] to (-1.0, 1.0). +

* @example * var primitive = new Cesium.Primitive({ - * geometryInstances : // ... - * appearance : new Cesium.DebugAppearance({ - * attributeName : 'normal' - * }) - * }); + geometryInstances : // ... + appearance : new Cesium.DebugAppearance({ + attributeName : 'normal' + }) +}); * @param options - Object with the following properties: * @param options.attributeName - The name of the attribute to visualize. * @param [options.perInstanceAttribute = false] - Boolean that determines whether this attribute is a per-instance geometry attribute. @@ -28969,7 +29117,7 @@ export class DebugAppearance { }); /** * This property is part of the {@link Appearance} interface, but is not - * used by {@link DebugAppearance} since a fully custom fragment shader is used. + used by {@link DebugAppearance} since a fully custom fragment shader is used. */ material: Material; /** @@ -28982,8 +29130,8 @@ export class DebugAppearance { readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. The full fragment shader - * source is built procedurally taking into account the {@link DebugAppearance#material}. - * Use {@link DebugAppearance#getFragmentShaderSource} to get the full source. + source is built procedurally taking into account the {@link DebugAppearance#material}. + Use {@link DebugAppearance#getFragmentShaderSource} to get the full source. */ readonly fragmentShaderSource: string; /** @@ -29004,7 +29152,7 @@ export class DebugAppearance { readonly glslDatatype: string; /** * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just - * {@link DebugAppearance#fragmentShaderSource}. + {@link DebugAppearance#fragmentShaderSource}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; @@ -29015,8 +29163,8 @@ export class DebugAppearance { isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, - * it can contain a subset of render state properties identical to the render state - * created in the context. + it can contain a subset of render state properties identical to the render state + created in the context. * @returns The render state. */ getRenderState(): any; @@ -29026,9 +29174,9 @@ export class DebugAppearance { * Draws the outline of the camera's view frustum. * @example * primitives.add(new Cesium.DebugCameraPrimitive({ - * camera : camera, - * color : Cesium.Color.YELLOW - * })); + camera : camera, + color : Cesium.Color.YELLOW +})); * @param options - Object with the following properties: * @param options.camera - The camera. * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values. @@ -29056,21 +29204,21 @@ export class DebugCameraPrimitive { id: any; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

* @example * p = p && p.destroy(); */ @@ -29079,20 +29227,20 @@ export class DebugCameraPrimitive { /** * Draws the axes of a reference frame defined by a matrix that transforms to world - * coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is - * a primitives modelMatrix. - *

- * The X axis is red; Y is green; and Z is blue. - *

- *

- * This is for debugging only; it is not optimized for production use. - *

+coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is +a primitives modelMatrix. +

+The X axis is red; Y is green; and Z is blue. +

+

+This is for debugging only; it is not optimized for production use. +

* @example * primitives.add(new Cesium.DebugModelMatrixPrimitive({ - * modelMatrix : primitive.modelMatrix, // primitive to debug - * length : 100000.0, - * width : 10.0 - * })); + modelMatrix : primitive.modelMatrix, // primitive to debug + length : 100000.0, + width : 10.0 +})); * @param [options] - Object with the following properties: * @param [options.length = 10000000.0] - The length of the axes in meters. * @param [options.width = 2.0] - The width of the axes in pixels. @@ -29130,21 +29278,21 @@ export class DebugModelMatrixPrimitive { id: any; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

* @example * p = p && p.destroy(); */ @@ -29218,8 +29366,8 @@ export class DirectionalLight { /** * A policy for discarding tile images that contain no data (and so aren't actually images). - * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is - * expected to be used in place of any empty tile images by the image loading code. +This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is +expected to be used in place of any empty tile images by the image loading code. */ export class DiscardEmptyTileImagePolicy { constructor(); @@ -29242,14 +29390,14 @@ export class DiscardEmptyTileImagePolicy { /** * A policy for discarding tile images that match a known image containing a - * "missing" image. +"missing" image. * @param options - Object with the following properties: * @param options.missingImageUrl - The URL of the known missing image. * @param options.pixelsToCheck - An array of {@link Cartesian2} pixel positions to - * compare against the missing image. + compare against the missing image. * @param [options.disableCheckIfAllPixelsAreTransparent = false] - If true, the discard check will be disabled - * if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the - * discard check will proceed no matter the values of the pixelsToCheck. + if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the + discard check will proceed no matter the values of the pixelsToCheck. */ export class DiscardMissingTileImagePolicy { constructor(options: { @@ -29272,22 +29420,22 @@ export class DiscardMissingTileImagePolicy { /** * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry} - * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance} - * with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires - * fewer vertex attributes since the fragment shader can procedurally compute normal, - * tangent, and bitangent. +and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance} +with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires +fewer vertex attributes since the fragment shader can procedurally compute normal, +tangent, and bitangent. * @example * var primitive = new Cesium.Primitive({ - * geometryInstances : new Cesium.GeometryInstance({ - * geometry : new Cesium.PolygonGeometry({ - * vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, - * // ... - * }) - * }), - * appearance : new Cesium.EllipsoidSurfaceAppearance({ - * material : Cesium.Material.fromType('Stripe') - * }) - * }); + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.PolygonGeometry({ + vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, + // ... + }) + }), + appearance : new Cesium.EllipsoidSurfaceAppearance({ + material : Cesium.Material.fromType('Stripe') + }) +}); * @param [options] - Object with the following properties: * @param [options.flat = false] - When true, flat shading is used in the fragment shader, which means lighting is not taking into account. * @param [options.faceForward = options.aboveGround] - When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. @@ -29311,7 +29459,7 @@ export class EllipsoidSurfaceAppearance { }); /** * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance} - * properties, this is not read-only, so an appearance's material can change on the fly. + properties, this is not read-only, so an appearance's material can change on the fly. */ material: Material; /** @@ -29324,60 +29472,60 @@ export class EllipsoidSurfaceAppearance { readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. The full fragment shader - * source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material}, - * {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}. - * Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source. + source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material}, + {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}. + Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. - *

- * The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance} - * instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent} - * and {@link EllipsoidSurfaceAppearance#aboveGround}. - *

+

+ The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance} + instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent} + and {@link EllipsoidSurfaceAppearance#aboveGround}. +

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so - * {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled. - * If the viewer enters the geometry, it will not be visible. + {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled. + If the viewer enters the geometry, it will not be visible. */ readonly closed: boolean; /** * The {@link VertexFormat} that this appearance instance is compatible with. - * A geometry can have more vertex attributes and still be compatible - at a - * potential performance cost - but it can't have less. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * When true, flat shading is used in the fragment shader, - * which means lighting is not taking into account. + which means lighting is not taking into account. */ readonly flat: boolean; /** * When true, the fragment shader flips the surface normal - * as needed to ensure that the normal faces the viewer to avoid - * dark spots. This is useful when both sides of a geometry should be - * shaded like {@link WallGeometry}. + as needed to ensure that the normal faces the viewer to avoid + dark spots. This is useful when both sides of a geometry should be + shaded like {@link WallGeometry}. */ readonly faceForward: boolean; /** * When true, the geometry is expected to be on the ellipsoid's - * surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} - * has backface culling enabled. + surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} + has backface culling enabled. */ readonly aboveGround: boolean; /** * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances - * are compatible with, which requires only position and st - * attributes. Other attributes are procedurally computed in the fragment shader. + are compatible with, which requires only position and st + attributes. Other attributes are procedurally computed in the fragment shader. */ static readonly VERTEX_FORMAT: VertexFormat; /** * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance}, - * this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat}, - * and {@link EllipsoidSurfaceAppearance#faceForward}. + this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat}, + and {@link EllipsoidSurfaceAppearance#faceForward}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; @@ -29388,8 +29536,8 @@ export class EllipsoidSurfaceAppearance { isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, - * it can contain a subset of render state properties identical to the render state - * created in the context. + it can contain a subset of render state properties identical to the render state + created in the context. * @returns The render state. */ getRenderState(): any; @@ -29397,19 +29545,19 @@ export class EllipsoidSurfaceAppearance { /** * An expression for a style applied to a {@link Cesium3DTileset}. - *

- * Evaluates an expression defined using the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. - *

- *

- * Implements the {@link StyleExpression} interface. - *

+

+Evaluates an expression defined using the +{@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. +

+

+Implements the {@link StyleExpression} interface. +

* @example * var expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'); - * expression.evaluate(feature); // returns true or false depending on the feature's properties +expression.evaluate(feature); // returns true or false depending on the feature's properties * @example * var expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")'); - * expression.evaluateColor(feature, result); // returns a Cesium.Color object +expression.evaluateColor(feature, result); // returns a Cesium.Color object * @param [expression] - The expression defined using the 3D Tiles Styling language. * @param [defines] - Defines in the style. */ @@ -29421,13 +29569,13 @@ export class Expression { readonly expression: string; /** * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of - * the expression in the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} - * is of type Boolean, Number, or String, the corresponding JavaScript - * primitive type will be returned. If the result is a RegExp, a Javascript RegExp - * object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, - * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is - * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. + the expression in the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + is of type Boolean, Number, or String, the corresponding JavaScript + primitive type will be returned. If the result is a RegExp, a Javascript RegExp + object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, + a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is + a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. * @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object onto which to store the result. * @returns The result of evaluating the expression. @@ -29435,9 +29583,9 @@ export class Expression { evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; /** * Evaluates the result of a Color expression, optionally using the provided feature's properties. - *

- * This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object. - *

+

+ This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object. +

* @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object in which to store the result * @returns The modified result parameter or a new Color instance if one was not provided. @@ -29447,7 +29595,7 @@ export class Expression { /** * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional - * performance improvements by rendering less geometry and dispatching less terrain requests. +performance improvements by rendering less geometry and dispatching less terrain requests. */ export class Fog { constructor(); @@ -29457,44 +29605,44 @@ export class Fog { enabled: boolean; /** * A scalar that determines the density of the fog. Terrain that is in full fog are culled. - * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero. - * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of - * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled. - * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered. + The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero. + The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of + 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled. + Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered. */ density: number; /** * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce - * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased - * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably - * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon. + the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased + for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably + lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon. */ screenSpaceErrorFactor: number; /** * The minimum brightness of the fog color from lighting. A value of 0.0 can cause the fog to be completely black. A value of 1.0 will not affect - * the brightness at all. + the brightness at all. */ minimumBrightness: number; } /** * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is - * lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised. - * To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene} - * instead of constructing an instance explicitly. +lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised. +To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene} +instead of constructing an instance explicitly. * @param [options] - Object with the following properties: * @param options.scene - The Scene instance for which to monitor performance. * @param [options.samplingWindow = 5.0] - The length of the sliding window over which to compute the average frame rate, in seconds. * @param [options.quietPeriod = 2.0] - The length of time to wait at startup and each time the page becomes visible (i.e. when the user - * switches back to the tab) before starting to measure performance, in seconds. + switches back to the tab) before starting to measure performance, in seconds. * @param [options.warmupPeriod = 5.0] - The length of the warmup period, in seconds. During the warmup period, a separate - * (usually lower) frame rate is required. + (usually lower) frame rate is required. * @param [options.minimumFrameRateDuringWarmup = 4] - The minimum frames-per-second that are required for acceptable performance during - * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the - * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. + the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the + lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. * @param [options.minimumFrameRateAfterWarmup = 8] - The minimum frames-per-second that are required for acceptable performance after - * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the - * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. + the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the + lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. */ export class FrameRateMonitor { constructor(options?: { @@ -29511,35 +29659,35 @@ export class FrameRateMonitor { samplingWindow: number; /** * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user - * switches back to the tab) before starting to measure performance, in seconds. + switches back to the tab) before starting to measure performance, in seconds. */ quietPeriod: number; /** * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate - * (usually lower) frame rate is required. + (usually lower) frame rate is required. */ warmupPeriod: number; /** * Gets or sets the minimum frames-per-second that are required for acceptable performance during - * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the - * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. + the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the + lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. */ minimumFrameRateDuringWarmup: number; /** * Gets or sets the minimum frames-per-second that are required for acceptable performance after - * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the - * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. + the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the + lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. */ minimumFrameRateAfterWarmup: number; /** * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene} - * needs to create a new frame rate monitor, and for any settings that are not passed to the - * {@link FrameRateMonitor} constructor. + needs to create a new frame rate monitor, and for any settings that are not passed to the + {@link FrameRateMonitor} constructor. */ static defaultSettings: any; /** * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have - * a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}. + a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}. * @param scene - The scene for which to get the {@link FrameRateMonitor}. * @returns The scene's {@link FrameRateMonitor}. */ @@ -29550,45 +29698,45 @@ export class FrameRateMonitor { scene: Scene; /** * Gets the event that is raised when a low frame rate is detected. The function will be passed - * the {@link Scene} instance as its first parameter and the average number of frames per second - * over the sampling window as its second parameter. + the {@link Scene} instance as its first parameter and the average number of frames per second + over the sampling window as its second parameter. */ lowFrameRate: Event; /** * Gets the event that is raised when the frame rate returns to a normal level after having been low. - * The function will be passed the {@link Scene} instance as its first parameter and the average - * number of frames per second over the sampling window as its second parameter. + The function will be passed the {@link Scene} instance as its first parameter and the average + number of frames per second over the sampling window as its second parameter. */ nominalFrameRate: Event; /** * Gets the most recently computed average frames-per-second over the last samplingWindow. - * This property may be undefined if the frame rate has not been computed. + This property may be undefined if the frame rate has not been computed. */ lastFramesPerSecond: number; /** * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause} - * must be called once for each time this function is called. + must be called once for each time this function is called. */ pause(): void; /** * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called - * multiple times, this function must be called the same number of times in order to - * actually resume monitoring. + multiple times, this function must be called the same number of times in order to + actually resume monitoring. */ unpause(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Unsubscribes this instance from all events it is listening to. - * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. */ destroy(): void; } @@ -29596,13 +29744,13 @@ export class FrameRateMonitor { /** * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server. * @param type - The type of response to expect from a GetFeatureInfo request. Valid - * values are 'json', 'xml', 'html', or 'text'. + values are 'json', 'xml', 'html', or 'text'. * @param [format] - The info format to request from the WMS server. This is usually a - * MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json' - * using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'. + MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json' + using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'. * @param [callback] - A function to invoke with the GetFeatureInfo response from the WMS server - * in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified, - * a default function for the type of response is used. + in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified, + a default function for the type of response is used. */ export class GetFeatureInfoFormat { constructor(type: string, format?: string, callback?: (...params: any[]) => any); @@ -29610,9 +29758,9 @@ export class GetFeatureInfoFormat { /** * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider}) - * and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}. +and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}. * @param [ellipsoid = Ellipsoid.WGS84] - Determines the size and shape of the - * globe. +globe. */ export class Globe { constructor(ellipsoid?: Ellipsoid); @@ -29622,44 +29770,44 @@ export class Globe { show: boolean; /** * The maximum screen-space error used to drive level-of-detail refinement. Higher - * values will provide better performance but lower visual quality. + values will provide better performance but lower visual quality. */ maximumScreenSpaceError: number; /** * The size of the terrain tile cache, expressed as a number of tiles. Any additional - * tiles beyond this number will be freed, as long as they aren't needed for rendering - * this frame. A larger number will consume more memory but will show detail faster - * when, for example, zooming out and then back in. + tiles beyond this number will be freed, as long as they aren't needed for rendering + this frame. A larger number will consume more memory but will show detail faster + when, for example, zooming out and then back in. */ tileCacheSize: number; /** * Gets or sets the number of loading descendant tiles that is considered "too many". - * If a tile has too many loading descendants, that tile will be loaded and rendered before any of - * its descendants are loaded and rendered. This means more feedback for the user that something - * is happening at the cost of a longer overall load time. Setting this to 0 will cause each - * tile level to be loaded successively, significantly increasing load time. Setting it to a large - * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make - * detail appear all at once after a long wait. + If a tile has too many loading descendants, that tile will be loaded and rendered before any of + its descendants are loaded and rendered. This means more feedback for the user that something + is happening at the cost of a longer overall load time. Setting this to 0 will cause each + tile level to be loaded successively, significantly increasing load time. Setting it to a large + number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make + detail appear all at once after a long wait. */ loadingDescendantLimit: number; /** * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded. - * Setting this to true optimizes the zoom-out experience and provides more detail in - * newly-exposed areas when panning. The down side is that it requires loading more tiles. + Setting this to true optimizes the zoom-out experience and provides more detail in + newly-exposed areas when panning. The down side is that it requires loading more tiles. */ preloadAncestors: boolean; /** * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded. - * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even - * if they are culled. Setting this to true may provide a better panning experience at the - * cost of loading more tiles. + Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even + if they are culled. Setting this to true may provide a better panning experience at the + cost of loading more tiles. */ preloadSiblings: boolean; /** * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not - * highlighted at all. The alpha value is used to alpha blend with the tile's - * actual color. Because terrain fill tiles do not represent the actual terrain surface, - * it may be useful in some applications to indicate visually that they are not to be trusted. + highlighted at all. The alpha value is used to alpha blend with the tile's + actual color. Because terrain fill tiles do not represent the actual terrain surface, + it may be useful in some applications to indicate visually that they are not to be trusted. */ fillHighlightColor: Color; /** @@ -29668,13 +29816,13 @@ export class Globe { enableLighting: boolean; /** * Enable dynamic lighting effects on atmosphere and fog. This only takes effect - * when enableLighting is true. + when enableLighting is true. */ dynamicAtmosphereLighting: boolean; /** * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's - * light direction. This only takes effect when enableLighting and - * dynamicAtmosphereLighting are true. + light direction. This only takes effect when enableLighting and + dynamicAtmosphereLighting are true. */ dynamicAtmosphereLightingFromSun: boolean; /** @@ -29683,64 +29831,64 @@ export class Globe { showGroundAtmosphere: boolean; /** * The distance where everything becomes lit. This only takes effect - * when enableLighting or showGroundAtmosphere is true. + when enableLighting or showGroundAtmosphere is true. */ lightingFadeOutDistance: number; /** * The distance where lighting resumes. This only takes effect - * when enableLighting or showGroundAtmosphere is true. + when enableLighting or showGroundAtmosphere is true. */ lightingFadeInDistance: number; /** * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere. - * This only takes effect when showGroundAtmosphere, enableLighting, and - * dynamicAtmosphereLighting are true. + This only takes effect when showGroundAtmosphere, enableLighting, and + dynamicAtmosphereLighting are true. */ nightFadeOutDistance: number; /** * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere. - * This only takes effect when showGroundAtmosphere, enableLighting, and - * dynamicAtmosphereLighting are true. + This only takes effect when showGroundAtmosphere, enableLighting, and + dynamicAtmosphereLighting are true. */ nightFadeInDistance: number; /** * True if an animated wave effect should be shown in areas of the globe - * covered by water; otherwise, false. This property is ignored if the - * terrainProvider does not provide a water mask. + covered by water; otherwise, false. This property is ignored if the + terrainProvider does not provide a water mask. */ showWaterEffect: boolean; /** * True if primitives such as billboards, polylines, labels, etc. should be depth-tested - * against the terrain surface, or false if such primitives should always be drawn on top - * of terrain unless they're on the opposite side of the globe. The disadvantage of depth - * testing primitives against terrain is that slight numerical noise or terrain level-of-detail - * switched can sometimes make a primitive that should be on the surface disappear underneath it. + against the terrain surface, or false if such primitives should always be drawn on top + of terrain unless they're on the opposite side of the globe. The disadvantage of depth + testing primitives against terrain is that slight numerical noise or terrain level-of-detail + switched can sometimes make a primitive that should be on the surface disappear underneath it. */ depthTestAgainstTerrain: boolean; /** * Determines whether the globe casts or receives shadows from light sources. Setting the globe - * to cast shadows may impact performance since the terrain is rendered again from the light's perspective. - * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows. + to cast shadows may impact performance since the terrain is rendered again from the light's perspective. + Currently only terrain that is in view casts shadows. By default the globe does not cast shadows. */ shadows: ShadowMode; /** * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). - * A hue shift of 1.0 indicates a complete rotation of the hues available. + A hue shift of 1.0 indicates a complete rotation of the hues available. */ atmosphereHueShift: number; /** * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). - * A saturation shift of -1.0 is monochrome. + A saturation shift of -1.0 is monochrome. */ atmosphereSaturationShift: number; /** * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). - * A brightness shift of -1.0 is complete darkness, which will let space show through. + A brightness shift of -1.0 is complete darkness, which will let space show through. */ atmosphereBrightnessShift: number; /** * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles. - * Skirts are always hidden when the camera is underground or translucency is enabled. + Skirts are always hidden when the camera is underground or translucency is enabled. */ showSkirts: boolean; /** @@ -29761,7 +29909,7 @@ export class Globe { readonly imageryLayersUpdatedEvent: Event; /** * Returns true when the tile load queue is empty, false otherwise. When the load queue is empty, - * all terrain and imagery for the current view have been loaded. + all terrain and imagery for the current view have been loaded. */ readonly tilesLoaded: boolean; /** @@ -29774,12 +29922,12 @@ export class Globe { clippingPlanes: ClippingPlaneCollection; /** * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area. - * Defaults to the maximum extent of cartographic coordinates. + Defaults to the maximum extent of cartographic coordinates. */ cartographicLimitRectangle: Rectangle; /** * The normal map to use for rendering waves in the ocean. Setting this property will - * only have an effect if the configured terrain provider includes a water mask. + only have an effect if the configured terrain provider includes a water mask. */ oceanNormalMapUrl: string; /** @@ -29792,31 +29940,31 @@ export class Globe { readonly terrainProviderChanged: Event; /** * Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty, - * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue. + all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue. */ tileLoadProgressEvent: Event; /** * Gets or sets the material appearance of the Globe. This can be one of several built-in {@link Material} objects or a custom material, scripted with - * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. + {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. */ material: Material; /** * The color to render the back side of the globe when the camera is underground or the globe is translucent, - * blended with the globe color based on the camera's distance. - *

- * To disable underground coloring, set undergroundColor to undefined. + blended with the globe color based on the camera's distance. +

+ To disable underground coloring, set undergroundColor to undefined. */ undergroundColor: Color; /** * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color. - * The alpha will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined, - * the underground color will not be blended with the globe color. - *

- * When the camera is above the ellipsoid the distance is computed from the nearest - * point on the ellipsoid instead of the camera's position. + The alpha will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the alpha remains clamped to the nearest bound. If undefined, + the underground color will not be blended with the globe color. +

+ When the camera is above the ellipsoid the distance is computed from the nearest + point on the ellipsoid instead of the camera's position. */ undergroundColorAlphaByDistance: NearFarScalar; /** @@ -29827,8 +29975,8 @@ export class Globe { * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates. * @example * // find intersection of ray through a pixel and the globe - * var ray = viewer.camera.getPickRay(windowCoordinates); - * var intersection = globe.pick(ray, scene); + var ray = viewer.camera.getPickRay(windowCoordinates); + var intersection = globe.pick(ray, scene); * @param ray - The ray to test for intersection. * @param scene - The scene. * @param [result] - The object onto which to store the result. @@ -29843,19 +29991,19 @@ export class Globe { getHeight(cartographic: Cartographic): number | undefined; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * globe = globe && globe.destroy(); */ @@ -29869,84 +30017,84 @@ export class GlobeTranslucency { constructor(); /** * When true, the globe is rendered as a translucent surface. - *

- * The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers}, - * and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by - * {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and - * {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces. - * When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry - * is considered front facing. - *

- * Translucency is disabled by default. +

+ The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers}, + and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by + {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and + {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces. + When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry + is considered front facing. +

+ Translucency is disabled by default. */ enabled: boolean; /** * A constant translucency to apply to front faces of the globe. - *

- * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. +

+ {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. * @example * // Set front face translucency to 0.5. - * globe.translucency.frontFaceAlpha = 0.5; - * globe.translucency.enabled = true; + globe.translucency.frontFaceAlpha = 0.5; + globe.translucency.enabled = true; */ frontFaceAlpha: number; /** * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera. - * The translucency will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, - * frontFaceAlphaByDistance will be disabled. - *

- * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. + The translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, + frontFaceAlphaByDistance will be disabled. +

+ {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. * @example * // Example 1. - * // Set front face translucency to 0.5 when the - * // camera is 1500 meters from the surface and 1.0 - * // as the camera distance approaches 8.0e6 meters. - * globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0); - * globe.translucency.enabled = true; + // Set front face translucency to 0.5 when the + // camera is 1500 meters from the surface and 1.0 + // as the camera distance approaches 8.0e6 meters. + globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0); + globe.translucency.enabled = true; * @example * // Example 2. - * // Disable front face translucency by distance - * globe.translucency.frontFaceAlphaByDistance = undefined; + // Disable front face translucency by distance + globe.translucency.frontFaceAlphaByDistance = undefined; */ frontFaceAlphaByDistance: NearFarScalar; /** * A constant translucency to apply to back faces of the globe. - *

- * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. +

+ {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. * @example * // Set back face translucency to 0.5. - * globe.translucency.backFaceAlpha = 0.5; - * globe.translucency.enabled = true; + globe.translucency.backFaceAlpha = 0.5; + globe.translucency.enabled = true; */ backFaceAlpha: number; /** * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera. - * The translucency will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, - * backFaceAlphaByDistance will be disabled. - *

- * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. + The translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, + backFaceAlphaByDistance will be disabled. +

+ {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. * @example * // Example 1. - * // Set back face translucency to 0.5 when the - * // camera is 1500 meters from the surface and 1.0 - * // as the camera distance approaches 8.0e6 meters. - * globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0); - * globe.translucency.enabled = true; + // Set back face translucency to 0.5 when the + // camera is 1500 meters from the surface and 1.0 + // as the camera distance approaches 8.0e6 meters. + globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0); + globe.translucency.enabled = true; * @example * // Example 2. - * // Disable back face translucency by distance - * globe.translucency.backFaceAlphaByDistance = undefined; + // Disable back face translucency by distance + globe.translucency.backFaceAlphaByDistance = undefined; */ backFaceAlphaByDistance: NearFarScalar; /** * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area. - * Defaults to the maximum extent of cartographic coordinates. + Defaults to the maximum extent of cartographic coordinates. */ rectangle: Rectangle; } @@ -29958,8 +30106,8 @@ export namespace GoogleEarthEnterpriseImageryProvider { * @property metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. * @property [tileDiscardPolicy] - The policy that determines if a tile - * is invalid and should be discarded. If this value is not specified, a default - * is to discard tiles that fail to download. + is invalid and should be discarded. If this value is not specified, a default + is to discard tiles that fail to download. * @property [credit] - A credit for the data source, which is displayed on the canvas. */ type ConstructorOptions = { @@ -29973,41 +30121,41 @@ export namespace GoogleEarthEnterpriseImageryProvider { /** * Provides tiled imagery using the Google Earth Enterprise REST API. - * - * Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise, - * {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API. + +Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise, + {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API. * @example * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d'); - * var gee = new Cesium.GoogleEarthEnterpriseImageryProvider({ - * metadata : geeMetadata - * }); +var gee = new Cesium.GoogleEarthEnterpriseImageryProvider({ + metadata : geeMetadata +}); * @param options - Object describing initialization options */ export class GoogleEarthEnterpriseImageryProvider { constructor(options: GoogleEarthEnterpriseImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -30016,7 +30164,7 @@ export class GoogleEarthEnterpriseImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -30041,45 +30189,45 @@ export class GoogleEarthEnterpriseImageryProvider { readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -30092,15 +30240,15 @@ export class GoogleEarthEnterpriseImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage - * and texture upload time. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage + and texture upload time. */ readonly hasAlphaChannel: boolean; /** @@ -30113,29 +30261,29 @@ export class GoogleEarthEnterpriseImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns - * undefined. + undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } @@ -30145,29 +30293,29 @@ export namespace GoogleEarthEnterpriseMapsProvider { * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor * @property url - The url of the Google Earth server hosting the imagery. * @property channel - The channel (id) to be used when requesting data from the server. - * The channel number can be found by looking at the json file located at: - * earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may - * differ depending on your Google Earth Enterprise server configuration. Look for the "id" that - * is associated with a "ImageryMaps" requestType. There may be more than one id available. - * Example: - * { - * layers: [ - * { - * id: 1002, - * requestType: "ImageryMaps" - * }, - * { - * id: 1007, - * requestType: "VectorMapsRaster" - * } - * ] - * } + The channel number can be found by looking at the json file located at: + earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may + differ depending on your Google Earth Enterprise server configuration. Look for the "id" that + is associated with a "ImageryMaps" requestType. There may be more than one id available. + Example: + { + layers: [ + { + id: 1002, + requestType: "ImageryMaps" + }, + { + id: 1007, + requestType: "VectorMapsRaster" + } + ] + } * @property [path = "/default_map"] - The path of the Google Earth server hosting the imagery. * @property [maximumLevel] - The maximum level-of-detail supported by the Google Earth - * Enterprise server, or undefined if there is no limit. + Enterprise server, or undefined if there is no limit. * @property [tileDiscardPolicy] - The policy that determines if a tile - * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass - * a {@link NeverTileDiscardPolicy} for this parameter. + is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass + a {@link NeverTileDiscardPolicy} for this parameter. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. */ type ConstructorOptions = { @@ -30182,50 +30330,50 @@ export namespace GoogleEarthEnterpriseMapsProvider { /** * Provides tiled imagery using the Google Earth Imagery API. - * - * Notes: This imagery provider does not work with the public Google Earth servers. It works with the - * Google Earth Enterprise Server. - * - * By default the Google Earth Enterprise server does not set the - * {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either - * use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf - * and add the 'Header set Access-Control-Allow-Origin "*"' option to the '<Directory />' and - * '<Directory "/opt/google/gehttpd/htdocs">' directives. - * - * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it - * is necessary to use {@link GoogleEarthEnterpriseImageryProvider} + +Notes: This imagery provider does not work with the public Google Earth servers. It works with the + Google Earth Enterprise Server. + + By default the Google Earth Enterprise server does not set the + {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either + use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf + and add the 'Header set Access-Control-Allow-Origin "*"' option to the '<Directory />' and + '<Directory "/opt/google/gehttpd/htdocs">' directives. + + This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it + is necessary to use {@link GoogleEarthEnterpriseImageryProvider} * @example * var google = new Cesium.GoogleEarthEnterpriseMapsProvider({ - * url : 'https://earth.localdomain', - * channel : 1008 - * }); + url : 'https://earth.localdomain', + channel : 1008 +}); * @param options - Object describing initialization options */ export class GoogleEarthEnterpriseMapsProvider { constructor(options: GoogleEarthEnterpriseMapsProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -30234,7 +30382,7 @@ export class GoogleEarthEnterpriseMapsProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -30267,55 +30415,55 @@ export class GoogleEarthEnterpriseMapsProvider { readonly channel: number; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the version of the data used by this provider. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly version: number; /** * Gets the type of data that is being requested from the provider. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly requestType: string; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -30328,15 +30476,15 @@ export class GoogleEarthEnterpriseMapsProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -30349,29 +30497,29 @@ export class GoogleEarthEnterpriseMapsProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns - * undefined. + undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; /** @@ -30385,8 +30533,8 @@ export namespace GridImageryProvider { * Initialization options for the GridImageryProvider constructor * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. * @property [cells = 8] - The number of grids cells. * @property [color = Color(1.0, 1.0, 1.0, 0.4)] - The color to draw grid lines. * @property [glowColor = Color(0.0, 1.0, 0.0, 0.05)] - The color to draw glow for grid lines. @@ -30412,34 +30560,34 @@ export namespace GridImageryProvider { /** * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow. - * May be useful for custom rendering effects or debugging terrain. +May be useful for custom rendering effects or debugging terrain. * @param options - Object describing initialization options */ export class GridImageryProvider { constructor(options: GridImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -30448,7 +30596,7 @@ export class GridImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -30469,45 +30617,45 @@ export class GridImageryProvider { readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link GridImageryProvider#ready} returns true. + not be called before {@link GridImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link GridImageryProvider#ready} returns true. + not be called before {@link GridImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link GridImageryProvider#ready} returns true. + not be called before {@link GridImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link GridImageryProvider#ready} returns true. + not be called before {@link GridImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link GridImageryProvider#ready} returns true. + not be called before {@link GridImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link GridImageryProvider#ready} returns true. + not be called before {@link GridImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link GridImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link GridImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -30520,15 +30668,15 @@ export class GridImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -30549,82 +30697,82 @@ export class GridImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link GridImageryProvider#ready} returns true. + not be called before {@link GridImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns - * undefined. + undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } /** * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}. - *

- * Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}. - *

+

+Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}. +

* @example * // 1. Draw a polyline on terrain with a basic color material - * - * var instance = new Cesium.GeometryInstance({ - * geometry : new Cesium.GroundPolylineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * -112.1340164450331, 36.05494287836128, - * -112.08821010582645, 36.097804071380715 - * ]), - * width : 4.0 - * }), - * id : 'object returned when this instance is picked and to get/set per-instance attributes' - * }); - * - * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({ - * geometryInstances : instance, - * appearance : new Cesium.PolylineMaterialAppearance() - * })); - * - * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition. - * // Distance display conditions for polylines on terrain are based on an approximate terrain height - * // instead of true terrain height. - * - * var instance = new Cesium.GeometryInstance({ - * geometry : new Cesium.GroundPolylineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * -112.1340164450331, 36.05494287836128, - * -112.08821010582645, 36.097804071380715, - * -112.13296079730024, 36.168769146801104 - * ]), - * loop : true, - * width : 4.0 - * }), - * attributes : { - * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)), - * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000) - * }, - * id : 'object returned when this instance is picked and to get/set per-instance attributes' - * }); - * - * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({ - * geometryInstances : instance, - * appearance : new Cesium.PolylineColorAppearance() - * })); + +var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.GroundPolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -112.1340164450331, 36.05494287836128, + -112.08821010582645, 36.097804071380715 + ]), + width : 4.0 + }), + id : 'object returned when this instance is picked and to get/set per-instance attributes' +}); + +scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({ + geometryInstances : instance, + appearance : new Cesium.PolylineMaterialAppearance() +})); + +// 2. Draw a looped polyline on terrain with per-instance color and a distance display condition. +// Distance display conditions for polylines on terrain are based on an approximate terrain height +// instead of true terrain height. + +var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.GroundPolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -112.1340164450331, 36.05494287836128, + -112.08821010582645, 36.097804071380715, + -112.13296079730024, 36.168769146801104 + ]), + loop : true, + width : 4.0 + }), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)), + distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000) + }, + id : 'object returned when this instance is picked and to get/set per-instance attributes' +}); + +scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({ + geometryInstances : instance, + appearance : new Cesium.PolylineColorAppearance() +})); * @param [options] - Object with the following properties: * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}. @@ -30652,23 +30800,23 @@ export class GroundPolylinePrimitive { }); /** * The geometry instances rendered with this primitive. This may - * be undefined if options.releaseGeometryInstances - * is true when the primitive is constructed. - *

- * Changing this property after the primitive is rendered has no effect. - *

+ be undefined if options.releaseGeometryInstances + is true when the primitive is constructed. +

+ Changing this property after the primitive is rendered has no effect. +

*/ readonly geometryInstances: any[] | GeometryInstance; /** * The {@link Appearance} used to shade this primitive. Each geometry - * instance is shaded with the same appearance. Some appearances, like - * {@link PolylineColorAppearance} allow giving each instance unique - * properties. + instance is shaded with the same appearance. Some appearances, like + {@link PolylineColorAppearance} allow giving each instance unique + properties. */ appearance: Appearance; /** * Determines if the primitive will be shown. This affects all geometry - * instances in the primitive. + instances in the primitive. */ show: boolean; /** @@ -30677,9 +30825,9 @@ export class GroundPolylinePrimitive { classificationType: ClassificationType; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the primitive. - *

+

+ Draws the bounding sphere for each draw command in the primitive. +

*/ debugShowBoundingVolume: boolean; /** @@ -30700,8 +30848,8 @@ export class GroundPolylinePrimitive { readonly asynchronous: boolean; /** * Determines if the primitive is complete and ready to render. If this property is - * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update} - * is called. + true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update} + is called. */ readonly ready: boolean; /** @@ -30710,60 +30858,60 @@ export class GroundPolylinePrimitive { readonly readyPromise: Promise; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * If true, draws the shadow volume for each geometry in the primitive. - *

+

+ If true, draws the shadow volume for each geometry in the primitive. +

*/ readonly debugShowShadowVolume: boolean; /** * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the - * GroundPolylinePrimitive synchronously. + GroundPolylinePrimitive synchronously. * @returns A promise that will resolve once the terrain heights have been loaded. */ static initializeTerrainHeights(): Promise; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. * @example * var attributes = primitive.getGeometryInstanceAttributes('an id'); - * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); - * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); * @param id - The id of the {@link GeometryInstance}. * @returns The typed array in the attribute's format or undefined if the is no instance with id. */ getGeometryInstanceAttributes(id: any): any; /** * Checks if the given Scene supports GroundPolylinePrimitives. - * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension. + GroundPolylinePrimitives require support for the WEBGL_depth_texture extension. * @param scene - The current scene. * @returns Whether or not the current scene supports GroundPolylinePrimitives. */ static isSupported(scene: Scene): boolean; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

* @example * e = e && e.destroy(); */ @@ -30772,67 +30920,67 @@ export class GroundPolylinePrimitive { /** * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}. - *

- * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including - * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, - * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix - * and match most of them and add a new geometry or appearance independently of each other. - *

- *

- * Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors - * or materials besides PerInstanceColorAppearance. - *

- *

- * Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping - * textures to terrain - for that use case, use {@link SingleTileImageryProvider}. - *

- *

- * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there - * will be rendering artifacts for some viewing angles. - *

- *

- * Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}. - *

+

+A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including +{@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, +and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix +and match most of them and add a new geometry or appearance independently of each other. +

+

+Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors +or materials besides PerInstanceColorAppearance. +

+

+Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping +textures to terrain - for that use case, use {@link SingleTileImageryProvider}. +

+

+For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there +will be rendering artifacts for some viewing angles. +

+

+Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}. +

* @example * // Example 1: Create primitive with a single instance - * var rectangleInstance = new Cesium.GeometryInstance({ - * geometry : new Cesium.RectangleGeometry({ - * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) - * }), - * id : 'rectangle', - * attributes : { - * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) - * } - * }); - * scene.primitives.add(new Cesium.GroundPrimitive({ - * geometryInstances : rectangleInstance - * })); - * - * // Example 2: Batch instances - * var color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color. - * var rectangleInstance = new Cesium.GeometryInstance({ - * geometry : new Cesium.RectangleGeometry({ - * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) - * }), - * id : 'rectangle', - * attributes : { - * color : color - * } - * }); - * var ellipseInstance = new Cesium.GeometryInstance({ - * geometry : new Cesium.EllipseGeometry({ - * center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0), - * semiMinorAxis : 300000.0, - * semiMajorAxis : 400000.0 - * }), - * id : 'ellipse', - * attributes : { - * color : color - * } - * }); - * scene.primitives.add(new Cesium.GroundPrimitive({ - * geometryInstances : [rectangleInstance, ellipseInstance] - * })); +var rectangleInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) + }), + id : 'rectangle', + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) + } +}); +scene.primitives.add(new Cesium.GroundPrimitive({ + geometryInstances : rectangleInstance +})); + +// Example 2: Batch instances +var color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color. +var rectangleInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) + }), + id : 'rectangle', + attributes : { + color : color + } +}); +var ellipseInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.EllipseGeometry({ + center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0), + semiMinorAxis : 300000.0, + semiMajorAxis : 400000.0 + }), + id : 'ellipse', + attributes : { + color : color + } +}); +scene.primitives.add(new Cesium.GroundPrimitive({ + geometryInstances : [rectangleInstance, ellipseInstance] +})); * @param [options] - Object with the following properties: * @param [options.geometryInstances] - The geometry instances to render. * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute. @@ -30846,7 +30994,7 @@ export class GroundPolylinePrimitive { * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be true on - * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be false. + creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be false. */ export class GroundPrimitive { constructor(options?: { @@ -30865,23 +31013,23 @@ export class GroundPrimitive { }); /** * The {@link Appearance} used to shade this primitive. Each geometry - * instance is shaded with the same appearance. Some appearances, like - * {@link PerInstanceColorAppearance} allow giving each instance unique - * properties. + instance is shaded with the same appearance. Some appearances, like + {@link PerInstanceColorAppearance} allow giving each instance unique + properties. */ appearance: Appearance; /** * The geometry instances rendered with this primitive. This may - * be undefined if options.releaseGeometryInstances - * is true when the primitive is constructed. - *

- * Changing this property after the primitive is rendered has no effect. - *

+ be undefined if options.releaseGeometryInstances + is true when the primitive is constructed. +

+ Changing this property after the primitive is rendered has no effect. +

*/ readonly geometryInstances: any[] | GeometryInstance; /** * Determines if the primitive will be shown. This affects all geometry - * instances in the primitive. + instances in the primitive. */ show: boolean; /** @@ -30890,16 +31038,16 @@ export class GroundPrimitive { classificationType: ClassificationType; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the primitive. - *

+

+ Draws the bounding sphere for each draw command in the primitive. +

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the shadow volume for each geometry in the primitive. - *

+

+ Draws the shadow volume for each geometry in the primitive. +

*/ debugShowShadowVolume: boolean; /** @@ -30928,8 +31076,8 @@ export class GroundPrimitive { readonly compressVertices: boolean; /** * Determines if the primitive is complete and ready to render. If this property is - * true, the primitive will be rendered the next time that {@link GroundPrimitive#update} - * is called. + true, the primitive will be rendered the next time that {@link GroundPrimitive#update} + is called. */ readonly ready: boolean; /** @@ -30944,53 +31092,53 @@ export class GroundPrimitive { static isSupported(scene: Scene): boolean; /** * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the - * GroundPrimitive synchronously. + GroundPrimitive synchronously. * @returns A promise that will resolve once the terrain heights have been loaded. */ static initializeTerrainHeights(): Promise; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. * @example * var attributes = primitive.getGeometryInstanceAttributes('an id'); - * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); - * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); * @param id - The id of the {@link GeometryInstance}. * @returns The typed array in the attribute's format or undefined if the is no instance with id. */ getGeometryInstanceAttributes(id: any): any; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

* @example * e = e && e.destroy(); */ destroy(): void; /** * Checks if the given Scene supports materials on GroundPrimitives. - * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension. + Materials on GroundPrimitives require support for the WEBGL_depth_texture extension. * @param scene - The current scene. * @returns Whether or not the current scene supports materials on GroundPrimitives. */ @@ -31017,13 +31165,13 @@ export enum HeightReference { /** * The horizontal location of an origin relative to an object, e.g., a {@link Billboard} - * or {@link Label}. For example, setting the horizontal origin to LEFT - * or RIGHT will display a billboard to the left or right (in screen space) - * of the anchor position. - *

- *
- *
- *
+or {@link Label}. For example, setting the horizontal origin to LEFT +or RIGHT will display a billboard to the left or right (in screen space) +of the anchor position. +

+
+
+
*/ export enum HorizontalOrigin { /** @@ -31042,85 +31190,85 @@ export enum HorizontalOrigin { /** * An imagery layer that displays tiled image data from a single imagery provider - * on a {@link Globe}. +on a {@link Globe}. * @param imageryProvider - The imagery provider to use. * @param [options] - Object with the following properties: * @param [options.rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle - * can limit the visible portion of the imagery provider. + can limit the visible portion of the imagery provider. * @param [options.alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0. - * This can either be a simple number or a function with the signature - * function(frameState, layer, x, y, level). The function is passed the - * current frame state, this layer, and the x, y, and level coordinates of the - * imagery tile for which the alpha is required, and it is expected to return - * the alpha value to use for the tile. + This can either be a simple number or a function with the signature + function(frameState, layer, x, y, level). The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the alpha is required, and it is expected to return + the alpha value to use for the tile. * @param [options.nightAlpha = 1.0] - The alpha blending value of this layer on the night side of the globe, from 0.0 to 1.0. - * This can either be a simple number or a function with the signature - * function(frameState, layer, x, y, level). The function is passed the - * current frame state, this layer, and the x, y, and level coordinates of the - * imagery tile for which the alpha is required, and it is expected to return - * the alpha value to use for the tile. This only takes effect when enableLighting is true. + This can either be a simple number or a function with the signature + function(frameState, layer, x, y, level). The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the alpha is required, and it is expected to return + the alpha value to use for the tile. This only takes effect when enableLighting is true. * @param [options.dayAlpha = 1.0] - The alpha blending value of this layer on the day side of the globe, from 0.0 to 1.0. - * This can either be a simple number or a function with the signature - * function(frameState, layer, x, y, level). The function is passed the - * current frame state, this layer, and the x, y, and level coordinates of the - * imagery tile for which the alpha is required, and it is expected to return - * the alpha value to use for the tile. This only takes effect when enableLighting is true. + This can either be a simple number or a function with the signature + function(frameState, layer, x, y, level). The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the alpha is required, and it is expected to return + the alpha value to use for the tile. This only takes effect when enableLighting is true. * @param [options.brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery - * color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter. - * This can either be a simple number or a function with the signature - * function(frameState, layer, x, y, level). The function is passed the - * current frame state, this layer, and the x, y, and level coordinates of the - * imagery tile for which the brightness is required, and it is expected to return - * the brightness value to use for the tile. The function is executed for every - * frame and for every tile, so it must be fast. + color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter. + This can either be a simple number or a function with the signature + function(frameState, layer, x, y, level). The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the brightness is required, and it is expected to return + the brightness value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. * @param [options.contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color. - * Less than 1.0 reduces the contrast while greater than 1.0 increases it. - * This can either be a simple number or a function with the signature - * function(frameState, layer, x, y, level). The function is passed the - * current frame state, this layer, and the x, y, and level coordinates of the - * imagery tile for which the contrast is required, and it is expected to return - * the contrast value to use for the tile. The function is executed for every - * frame and for every tile, so it must be fast. + Less than 1.0 reduces the contrast while greater than 1.0 increases it. + This can either be a simple number or a function with the signature + function(frameState, layer, x, y, level). The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the contrast is required, and it is expected to return + the contrast value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. * @param [options.hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color. - * This can either be a simple number or a function with the signature - * function(frameState, layer, x, y, level). The function is passed the - * current frame state, this layer, and the x, y, and level coordinates - * of the imagery tile for which the hue is required, and it is expected to return - * the contrast value to use for the tile. The function is executed for every - * frame and for every tile, so it must be fast. + This can either be a simple number or a function with the signature + function(frameState, layer, x, y, level). The function is passed the + current frame state, this layer, and the x, y, and level coordinates + of the imagery tile for which the hue is required, and it is expected to return + the contrast value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. * @param [options.saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color. - * Less than 1.0 reduces the saturation while greater than 1.0 increases it. - * This can either be a simple number or a function with the signature - * function(frameState, layer, x, y, level). The function is passed the - * current frame state, this layer, and the x, y, and level coordinates - * of the imagery tile for which the saturation is required, and it is expected to return - * the contrast value to use for the tile. The function is executed for every - * frame and for every tile, so it must be fast. + Less than 1.0 reduces the saturation while greater than 1.0 increases it. + This can either be a simple number or a function with the signature + function(frameState, layer, x, y, level). The function is passed the + current frame state, this layer, and the x, y, and level coordinates + of the imagery tile for which the saturation is required, and it is expected to return + the contrast value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. * @param [options.gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color. - * This can either be a simple number or a function with the signature - * function(frameState, layer, x, y, level). The function is passed the - * current frame state, this layer, and the x, y, and level coordinates of the - * imagery tile for which the gamma is required, and it is expected to return - * the gamma value to use for the tile. The function is executed for every - * frame and for every tile, so it must be fast. + This can either be a simple number or a function with the signature + function(frameState, layer, x, y, level). The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the gamma is required, and it is expected to return + the gamma value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. * @param [options.splitDirection = ImagerySplitDirection.NONE] - The {@link ImagerySplitDirection} split to apply to this layer. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The - * texture minification filter to apply to this layer. Possible values - * are TextureMinificationFilter.LINEAR and - * TextureMinificationFilter.NEAREST. + texture minification filter to apply to this layer. Possible values + are TextureMinificationFilter.LINEAR and + TextureMinificationFilter.NEAREST. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The - * texture minification filter to apply to this layer. Possible values - * are TextureMagnificationFilter.LINEAR and - * TextureMagnificationFilter.NEAREST. + texture minification filter to apply to this layer. Possible values + are TextureMagnificationFilter.LINEAR and + TextureMagnificationFilter.NEAREST. * @param [options.show = true] - True if the layer is shown; otherwise, false. * @param [options.maximumAnisotropy = maximum supported] - The maximum anisotropy level to use - * for texture filtering. If this parameter is not specified, the maximum anisotropy supported - * by the WebGL stack will be used. Larger values make the imagery look better in horizon - * views. + for texture filtering. If this parameter is not specified, the maximum anisotropy supported + by the WebGL stack will be used. Larger values make the imagery look better in horizon + views. * @param [options.minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer, - * or undefined to show it at all levels. Level zero is the least-detailed level. + or undefined to show it at all levels. Level zero is the least-detailed level. * @param [options.maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer, - * or undefined to show it at all levels. Level zero is the least-detailed level. + or undefined to show it at all levels. Level zero is the least-detailed level. * @param [options.cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer. * @param [options.colorToAlpha] - Color to be used as alpha. * @param [options.colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha. @@ -31149,27 +31297,27 @@ export class ImageryLayer { }); /** * The alpha blending value of this layer, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ alpha: number; /** * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is true. + 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is true. */ nightAlpha: number; /** * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is true. + 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is true. */ dayAlpha: number; /** * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ brightness: number; /** * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ contrast: number; /** @@ -31178,7 +31326,7 @@ export class ImageryLayer { hue: number; /** * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ saturation: number; /** @@ -31191,20 +31339,20 @@ export class ImageryLayer { splitDirection: ImagerySplitDirection; /** * The {@link TextureMinificationFilter} to apply to this layer. - * Possible values are {@link TextureMinificationFilter.LINEAR} (the default) - * and {@link TextureMinificationFilter.NEAREST}. - * - * To take effect, this property must be set immediately after adding the imagery layer. - * Once a texture is loaded it won't be possible to change the texture filter used. + Possible values are {@link TextureMinificationFilter.LINEAR} (the default) + and {@link TextureMinificationFilter.NEAREST}. + + To take effect, this property must be set immediately after adding the imagery layer. + Once a texture is loaded it won't be possible to change the texture filter used. */ minificationFilter: TextureMinificationFilter; /** * The {@link TextureMagnificationFilter} to apply to this layer. - * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default) - * and {@link TextureMagnificationFilter.NEAREST}. - * - * To take effect, this property must be set immediately after adding the imagery layer. - * Once a texture is loaded it won't be possible to change the texture filter used. + Possible values are {@link TextureMagnificationFilter.LINEAR} (the default) + and {@link TextureMagnificationFilter.NEAREST}. + + To take effect, this property must be set immediately after adding the imagery layer. + Once a texture is loaded it won't be possible to change the texture filter used. */ magnificationFilter: TextureMagnificationFilter; /** @@ -31229,92 +31377,92 @@ export class ImageryLayer { readonly imageryProvider: ImageryProvider; /** * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the - * {@link ImageryProvider}, only a portion of the imagery provider is shown. + {@link ImageryProvider}, only a portion of the imagery provider is shown. */ readonly rectangle: Rectangle; /** * This value is used as the default brightness for the imagery layer if one is not provided during construction - * or by the imagery provider. This value does not modify the brightness of the imagery. + or by the imagery provider. This value does not modify the brightness of the imagery. */ static DEFAULT_BRIGHTNESS: number; /** * This value is used as the default contrast for the imagery layer if one is not provided during construction - * or by the imagery provider. This value does not modify the contrast of the imagery. + or by the imagery provider. This value does not modify the contrast of the imagery. */ static DEFAULT_CONTRAST: number; /** * This value is used as the default hue for the imagery layer if one is not provided during construction - * or by the imagery provider. This value does not modify the hue of the imagery. + or by the imagery provider. This value does not modify the hue of the imagery. */ static DEFAULT_HUE: number; /** * This value is used as the default saturation for the imagery layer if one is not provided during construction - * or by the imagery provider. This value does not modify the saturation of the imagery. + or by the imagery provider. This value does not modify the saturation of the imagery. */ static DEFAULT_SATURATION: number; /** * This value is used as the default gamma for the imagery layer if one is not provided during construction - * or by the imagery provider. This value does not modify the gamma of the imagery. + or by the imagery provider. This value does not modify the gamma of the imagery. */ static DEFAULT_GAMMA: number; /** * This value is used as the default split for the imagery layer if one is not provided during construction - * or by the imagery provider. + or by the imagery provider. */ static DEFAULT_SPLIT: ImagerySplitDirection; /** * This value is used as the default texture minification filter for the imagery layer if one is not provided - * during construction or by the imagery provider. + during construction or by the imagery provider. */ static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter; /** * This value is used as the default texture magnification filter for the imagery layer if one is not provided - * during construction or by the imagery provider. + during construction or by the imagery provider. */ static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter; /** * This value is used as the default threshold for color-to-alpha if one is not provided - * during construction or by the imagery provider. + during construction or by the imagery provider. */ static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number; /** * Gets a value indicating whether this layer is the base layer in the - * {@link ImageryLayerCollection}. The base layer is the one that underlies all - * others. It is special in that it is treated as if it has global rectangle, even if - * it actually does not, by stretching the texels at the edges over the entire - * globe. + {@link ImageryLayerCollection}. The base layer is the one that underlies all + others. It is special in that it is treated as if it has global rectangle, even if + it actually does not, by stretching the texels at the edges over the entire + globe. * @returns true if this is the base layer; otherwise, false. */ isBaseLayer(): boolean; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * imageryLayer = imageryLayer && imageryLayer.destroy(); */ destroy(): void; /** * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle, - * producing the overall bounds of imagery that can be produced by this layer. + producing the overall bounds of imagery that can be produced by this layer. * @example * // Zoom to an imagery layer. - * imageryLayer.getViewableRectangle().then(function (rectangle) { - * return camera.flyTo({ - * destination: rectangle - * }); - * }); + imageryLayer.getViewableRectangle().then(function (rectangle) { + return camera.flyTo({ + destination: rectangle + }); + }); * @returns A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer. */ getViewableRectangle(): Promise; @@ -31327,24 +31475,24 @@ export class ImageryLayerCollection { constructor(); /** * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that - * was added and the index at which it was added. + was added and the index at which it was added. */ layerAdded: Event; /** * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that - * was removed and the index from which it was removed. + was removed and the index from which it was removed. */ layerRemoved: Event; /** * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that - * was moved, its new index after the move, and its old index prior to the move. + was moved, its new index after the move, and its old index prior to the move. */ layerMoved: Event; /** * An event that is raised when a layer is shown or hidden by setting the - * {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer, - * the index of the layer in the collection, and a flag that is true if the layer is now - * shown or false if it is now hidden. + {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer, + the index of the layer in the collection, and a flag that is true if the layer is now + shown or false if it is now hidden. */ layerShownOrHidden: Event; /** @@ -31355,14 +31503,14 @@ export class ImageryLayerCollection { * Adds a layer to the collection. * @param layer - the layer to add. * @param [index] - the index to add the layer at. If omitted, the layer will - * be added on top of all existing layers. + be added on top of all existing layers. */ add(layer: ImageryLayer, index?: number): void; /** * Creates a new layer using the given ImageryProvider and adds it to the collection. * @param imageryProvider - the imagery provider to create a new layer for. * @param [index] - the index to add the layer at. If omitted, the layer will - * added on top of all existing layers. + added on top of all existing layers. * @returns The newly created layer. */ addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer; @@ -31371,7 +31519,7 @@ export class ImageryLayerCollection { * @param layer - The layer to remove. * @param [destroy = true] - whether to destroy the layers in addition to removing them. * @returns true if the layer was in the collection and was removed, - * false if the layer was not in the collection. + false if the layer was not in the collection. */ remove(layer: ImageryLayer, destroy?: boolean): boolean; /** @@ -31419,47 +31567,47 @@ export class ImageryLayerCollection { lowerToBottom(layer: ImageryLayer): void; /** * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery - * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected - * by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}. + layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected + by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}. * @example * var pickRay = viewer.camera.getPickRay(windowPosition); - * var featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene); - * if (!Cesium.defined(featuresPromise)) { - * console.log('No features picked.'); - * } else { - * Cesium.when(featuresPromise, function(features) { - * // This function is called asynchronously when the list if picked features is available. - * console.log('Number of features: ' + features.length); - * if (features.length > 0) { - * console.log('First feature name: ' + features[0].name); - * } - * }); - * } + var featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene); + if (!Cesium.defined(featuresPromise)) { + console.log('No features picked.'); + } else { + Cesium.when(featuresPromise, function(features) { + // This function is called asynchronously when the list if picked features is available. + console.log('Number of features: ' + features.length); + if (features.length > 0) { + console.log('First feature name: ' + features[0].name); + } + }); + } * @param ray - The ray to test for intersection. * @param scene - The scene. * @returns A promise that resolves to an array of features intersected by the pick ray. - * If it can be quickly determined that no features are intersected (for example, - * because no active imagery providers support {@link ImageryProvider#pickFeatures} - * or because the pick ray does not intersect the surface), this function will - * return undefined. + If it can be quickly determined that no features are intersected (for example, + because no active imagery providers support {@link ImageryProvider#pickFeatures} + or because the pick ray does not intersect the surface), this function will + return undefined. */ pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise | undefined; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this - * object allows for deterministic release of WebGL resources, instead of relying on the garbage - * collector. - *

- * Once this object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + object allows for deterministic release of WebGL resources, instead of relying on the garbage + collector. +

+ Once this object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * layerCollection = layerCollection && layerCollection.destroy(); */ @@ -31477,7 +31625,7 @@ export class ImageryLayerFeatureInfo { name: string | undefined; /** * Gets or sets an HTML description of the feature. The HTML is not trusted and should - * be sanitized before display to the user. + be sanitized before display to the user. */ description: string | undefined; /** @@ -31486,7 +31634,7 @@ export class ImageryLayerFeatureInfo { position: Cartographic | undefined; /** * Gets or sets the raw data describing the feature. The raw data may be in any - * number of formats, such as GeoJSON, KML, etc. + number of formats, such as GeoJSON, KML, etc. */ data: any | undefined; /** @@ -31495,9 +31643,9 @@ export class ImageryLayerFeatureInfo { imageryLayer: any | undefined; /** * Configures the name of this feature by selecting an appropriate property. The name will be obtained from - * one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title', - * 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If - * the name cannot be obtained from any of these sources, the existing name will be left unchanged. + one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title', + 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If + the name cannot be obtained from any of these sources, the existing name will be left unchanged. * @param properties - An object literal containing the properties of the feature. */ configureNameFromProperties(properties: any): void; @@ -31510,33 +31658,33 @@ export class ImageryLayerFeatureInfo { /** * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an - * interface and is not intended to be instantiated directly. +interface and is not intended to be instantiated directly. */ export class ImageryProvider { constructor(); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -31545,7 +31693,7 @@ export class ImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -31570,55 +31718,55 @@ export class ImageryProvider { readonly readyPromise: Promise; /** * Gets the rectangle, in radians, of the imagery provided by the instance. This function should - * not be called before {@link ImageryProvider#ready} returns true. + not be called before {@link ImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link ImageryProvider#ready} returns true. + not be called before {@link ImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link ImageryProvider#ready} returns true. + not be called before {@link ImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link ImageryProvider#ready} returns true. + not be called before {@link ImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link ImageryProvider#ready} returns true. Generally, - * a minimum level should only be used when the rectangle of the imagery is small - * enough that the number of tiles at the minimum level is small. An imagery - * provider with more than a few tiles at the minimum level will lead to - * rendering problems. + not be called before {@link ImageryProvider#ready} returns true. Generally, + a minimum level should only be used when the rectangle of the imagery is small + enough that the number of tiles at the minimum level is small. An imagery + provider with more than a few tiles at the minimum level will lead to + rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. This function should - * not be called before {@link ImageryProvider#ready} returns true. + not be called before {@link ImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link ImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link ImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should - * not be called before {@link ImageryProvider#ready} returns true. + the source of the imagery. This function should + not be called before {@link ImageryProvider#ready} returns true. */ readonly credit: Credit; /** @@ -31627,10 +31775,10 @@ export class ImageryProvider { readonly proxy: Proxy; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -31643,42 +31791,42 @@ export class ImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link ImageryProvider#ready} returns true. + not be called before {@link ImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within - * a tile. This function should not be called before {@link ImageryProvider#ready} returns true. - * This function is optional, so it may not exist on all ImageryProviders. + a tile. This function should not be called before {@link ImageryProvider#ready} returns true. + This function is optional, so it may not exist on all ImageryProviders. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; /** * Loads an image from a given URL. If the server referenced by the URL already has - * too many requests pending, this function will instead return undefined, indicating - * that the request should be retried later. + too many requests pending, this function will instead return undefined, indicating + that the request should be retried later. * @param imageryProvider - The imagery provider for the URL. * @param url - The URL of the image. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ static loadImage(imageryProvider: ImageryProvider, url: Resource | string): Promise | undefined; } @@ -31725,27 +31873,27 @@ export class IonImageryProvider { constructor(options: IonImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -31754,7 +31902,7 @@ export class IonImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -31779,63 +31927,63 @@ export class IonImageryProvider { readonly readyPromise: Promise; /** * Gets the rectangle, in radians, of the imagery provided by the instance. This function should - * not be called before {@link IonImageryProvider#ready} returns true. + not be called before {@link IonImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link IonImageryProvider#ready} returns true. + not be called before {@link IonImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link IonImageryProvider#ready} returns true. + not be called before {@link IonImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link IonImageryProvider#ready} returns true. + not be called before {@link IonImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link IonImageryProvider#ready} returns true. Generally, - * a minimum level should only be used when the rectangle of the imagery is small - * enough that the number of tiles at the minimum level is small. An imagery - * provider with more than a few tiles at the minimum level will lead to - * rendering problems. + not be called before {@link IonImageryProvider#ready} returns true. Generally, + a minimum level should only be used when the rectangle of the imagery is small + enough that the number of tiles at the minimum level is small. An imagery + provider with more than a few tiles at the minimum level will lead to + rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. This function should - * not be called before {@link IonImageryProvider#ready} returns true. + not be called before {@link IonImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link IonImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link IonImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should - * not be called before {@link IonImageryProvider#ready} returns true. + the source of the imagery. This function should + not be called before {@link IonImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -31852,30 +32000,30 @@ export class IonImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link IonImageryProvider#ready} returns true. + not be called before {@link IonImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within - * a tile. This function should not be called before {@link IonImageryProvider#ready} returns true. - * This function is optional, so it may not exist on all ImageryProviders. + a tile. This function should not be called before {@link IonImageryProvider#ready} returns true. + This function is optional, so it may not exist on all ImageryProviders. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } @@ -31900,13 +32048,13 @@ export enum IonWorldImageryStyle { /** * A Label draws viewport-aligned text positioned in the 3D scene. This constructor - * should not be used directly, instead create labels by calling {@link LabelCollection#add}. +should not be used directly, instead create labels by calling {@link LabelCollection#add}. */ export class Label { constructor(); /** * Determines if this label will be shown. Use this to hide or show a label, instead - * of removing it and re-adding it to the collection. + of removing it and re-adding it to the collection. */ show: boolean; /** @@ -31947,7 +32095,7 @@ export class Label { backgroundColor: Color; /** * Gets or sets the background padding, in pixels, of this label. The x value - * controls horizontal padding, and the y value controls vertical padding. + controls horizontal padding, and the y value controls vertical padding. */ backgroundPadding: Cartesian2; /** @@ -31956,143 +32104,143 @@ export class Label { style: LabelStyle; /** * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used - * to align multiple labels and billboards at the same position, e.g., an image and text. The - * screen space origin is the top, left corner of the canvas; x increases from - * left to right, and y increases from top to bottom. - *

- *
- * - * - * - *
default
l.pixeloffset = new Cartesian2(25, 75);
- * The label's origin is indicated by the yellow point. - *
+ to align multiple labels and billboards at the same position, e.g., an image and text. The + screen space origin is the top, left corner of the canvas; x increases from + left to right, and y increases from top to bottom. +

+
+ + + +
default
l.pixeloffset = new Cartesian2(25, 75);
+ The label's origin is indicated by the yellow point. +
*/ pixelOffset: Cartesian2; /** * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera. - * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined, - * translucencyByDistance will be disabled. + A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined, + translucencyByDistance will be disabled. * @example * // Example 1. - * // Set a label's translucencyByDistance to 1.0 when the - * // camera is 1500 meters from the label and disappear as - * // the camera distance approaches 8.0e6 meters. - * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); + // Set a label's translucencyByDistance to 1.0 when the + // camera is 1500 meters from the label and disappear as + // the camera distance approaches 8.0e6 meters. + text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); * @example * // Example 2. - * // disable translucency by distance - * text.translucencyByDistance = undefined; + // disable translucency by distance + text.translucencyByDistance = undefined; */ translucencyByDistance: NearFarScalar; /** * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera. - * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined, - * pixelOffsetScaleByDistance will be disabled. + A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined, + pixelOffsetScaleByDistance will be disabled. * @example * // Example 1. - * // Set a label's pixel offset scale to 0.0 when the - * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels - * // in the y direction the camera distance approaches 8.0e6 meters. - * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0); - * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0); + // Set a label's pixel offset scale to 0.0 when the + // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels + // in the y direction the camera distance approaches 8.0e6 meters. + text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0); + text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0); * @example * // Example 2. - * // disable pixel offset by distance - * text.pixelOffsetScaleByDistance = undefined; + // disable pixel offset by distance + text.pixelOffsetScaleByDistance = undefined; */ pixelOffsetScaleByDistance: NearFarScalar; /** * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera. - * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, - * scaleByDistance will be disabled. + A label's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, + scaleByDistance will be disabled. * @example * // Example 1. - * // Set a label's scaleByDistance to scale by 1.5 when the - * // camera is 1500 meters from the label and disappear as - * // the camera distance approaches 8.0e6 meters. - * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0); + // Set a label's scaleByDistance to scale by 1.5 when the + // camera is 1500 meters from the label and disappear as + // the camera distance approaches 8.0e6 meters. + label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0); * @example * // Example 2. - * // disable scaling by distance - * label.scaleByDistance = undefined; + // disable scaling by distance + label.scaleByDistance = undefined; */ scaleByDistance: NearFarScalar; /** * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed - * coordinate system, where x points towards the viewer's right, y points up, and - * z points into the screen. Eye coordinates use the same scale as world and model coordinates, - * which is typically meters. - *

- * An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to - * arrange a label above its corresponding 3D model. - *

- * Below, the label is positioned at the center of the Earth but an eye offset makes it always - * appear on top of the Earth regardless of the viewer's or Earth's orientation. - *

- *
- * - * - * - *
- * l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

- *
+ coordinate system, where x points towards the viewer's right, y points up, and + z points into the screen. Eye coordinates use the same scale as world and model coordinates, + which is typically meters. +

+ An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to + arrange a label above its corresponding 3D model. +

+ Below, the label is positioned at the center of the Earth but an eye offset makes it always + appear on top of the Earth regardless of the viewer's or Earth's orientation. +

+
+ + + +
+ l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);

+
*/ eyeOffset: Cartesian3; /** * Gets or sets the horizontal origin of this label, which determines if the label is drawn - * to the left, center, or right of its anchor position. - *

- *
- *
- *
+ to the left, center, or right of its anchor position. +

+
+
+
* @example * // Use a top, right origin - * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT; - * l.verticalOrigin = Cesium.VerticalOrigin.TOP; + l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT; + l.verticalOrigin = Cesium.VerticalOrigin.TOP; */ horizontalOrigin: HorizontalOrigin; /** * Gets or sets the vertical origin of this label, which determines if the label is - * to the above, below, or at the center of its anchor position. - *

- *
- *
- *
+ to the above, below, or at the center of its anchor position. +

+
+
+
* @example * // Use a top, right origin - * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT; - * l.verticalOrigin = Cesium.VerticalOrigin.TOP; + l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT; + l.verticalOrigin = Cesium.VerticalOrigin.TOP; */ verticalOrigin: VerticalOrigin; /** * Gets or sets the uniform scale that is multiplied with the label's size in pixels. - * A scale of 1.0 does not change the size of the label; a scale greater than - * 1.0 enlarges the label; a positive scale less than 1.0 shrinks - * the label. - *

- * Applying a large scale value may pixelate the label. To make text larger without pixelation, - * use a larger font size when calling {@link Label#font} instead. - *

- *
- *
- * From left to right in the above image, the scales are 0.5, 1.0, - * and 2.0. - *
+ A scale of 1.0 does not change the size of the label; a scale greater than + 1.0 enlarges the label; a positive scale less than 1.0 shrinks + the label. +

+ Applying a large scale value may pixelate the label. To make text larger without pixelation, + use a larger font size when calling {@link Label#font} instead. +

+
+
+ From left to right in the above image, the scales are 0.5, 1.0, + and 2.0. +
*/ scale: number; /** * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size - * of the desired font compared to the generated glyph size. + of the desired font compared to the generated glyph size. */ totalScale: number; /** @@ -32101,7 +32249,7 @@ export class Label { distanceDisplayCondition: DistanceDisplayCondition; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. - * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: number; /** @@ -32110,8 +32258,8 @@ export class Label { id: any; /** * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets. - * The screen space origin is the top, left corner of the canvas; x increases from - * left to right, and y increases from top to bottom. + The screen space origin is the top, left corner of the canvas; x increases from + left to right, and y increases from top to bottom. * @example * console.log(l.computeScreenSpacePosition(scene).toString()); * @param scene - The scene the label is in. @@ -32121,16 +32269,16 @@ export class Label { computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; /** * Determines if this label equals another label. Labels are equal if all their properties - * are equal. Labels in different collections can be equal. + are equal. Labels in different collections can be equal. * @param other - The label to compare for equality. * @returns true if the labels are equal; otherwise, false. */ equals(other: Label): boolean; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; @@ -32138,58 +32286,58 @@ export class Label { * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages * @example * // Example 1. - * // Set a label's rightToLeft before init - * Cesium.Label.enableRightToLeftDetection = true; - * var myLabelEntity = viewer.entities.add({ - * label: { - * id: 'my label', - * text: 'זה טקסט בעברית \n ועכשיו יורדים שורה', - * } - * }); + // Set a label's rightToLeft before init + Cesium.Label.enableRightToLeftDetection = true; + var myLabelEntity = viewer.entities.add({ + label: { + id: 'my label', + text: 'זה טקסט בעברית \n ועכשיו יורדים שורה', + } + }); * @example * // Example 2. - * var myLabelEntity = viewer.entities.add({ - * label: { - * id: 'my label', - * text: 'English text' - * } - * }); - * // Set a label's rightToLeft after init - * Cesium.Label.enableRightToLeftDetection = true; - * myLabelEntity.text = 'טקסט חדש'; + var myLabelEntity = viewer.entities.add({ + label: { + id: 'my label', + text: 'English text' + } + }); + // Set a label's rightToLeft after init + Cesium.Label.enableRightToLeftDetection = true; + myLabelEntity.text = 'טקסט חדש'; */ static enableRightToLeftDetection: boolean; } /** * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene. - * Each label can have a different font, color, scale, etc. - *

- *
- *
- * Example labels - *
- *

- * Labels are added and removed from the collection using {@link LabelCollection#add} - * and {@link LabelCollection#remove}. +Each label can have a different font, color, scale, etc. +

+
+
+Example labels +
+

+Labels are added and removed from the collection using {@link LabelCollection#add} +and {@link LabelCollection#remove}. * @example * // Create a label collection with two labels - * var labels = scene.primitives.add(new Cesium.LabelCollection()); - * labels.add({ - * position : new Cesium.Cartesian3(1.0, 2.0, 3.0), - * text : 'A label' - * }); - * labels.add({ - * position : new Cesium.Cartesian3(4.0, 5.0, 6.0), - * text : 'Another label' - * }); +var labels = scene.primitives.add(new Cesium.LabelCollection()); +labels.add({ + position : new Cesium.Cartesian3(1.0, 2.0, 3.0), + text : 'A label' +}); +labels.add({ + position : new Cesium.Cartesian3(4.0, 5.0, 6.0), + text : 'Another label' +}); * @param [options] - Object with the following properties: * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default - * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent, - * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. +is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent, +setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. * @param [options.show = true] - Determines if the labels in the collection will be shown. */ export class LabelCollection { @@ -32206,85 +32354,85 @@ export class LabelCollection { show: boolean; /** * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates. - * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates. - * Local reference frames can be used by providing a different transformation matrix, like that returned - * by {@link Transforms.eastNorthUpToFixedFrame}. + When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. * @example * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); - * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); - * labels.add({ - * position : new Cesium.Cartesian3(0.0, 0.0, 0.0), - * text : 'Center' - * }); - * labels.add({ - * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0), - * text : 'East' - * }); - * labels.add({ - * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0), - * text : 'North' - * }); - * labels.add({ - * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0), - * text : 'Up' - * }); + labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); + labels.add({ + position : new Cesium.Cartesian3(0.0, 0.0, 0.0), + text : 'Center' + }); + labels.add({ + position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0), + text : 'East' + }); + labels.add({ + position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0), + text : 'North' + }); + labels.add({ + position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0), + text : 'Up' + }); */ modelMatrix: Matrix4; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the primitive. - *

+

+ Draws the bounding sphere for each draw command in the primitive. +

*/ debugShowBoundingVolume: boolean; /** * The label blending option. The default is used for rendering both opaque and translucent labels. - * However, if either all of the labels are completely opaque or all are completely translucent, - * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve - * performance by up to 2x. + However, if either all of the labels are completely opaque or all are completely translucent, + setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve + performance by up to 2x. */ blendOption: BlendOption; /** * Returns the number of labels in this collection. This is commonly used with - * {@link LabelCollection#get} to iterate over all the labels - * in the collection. + {@link LabelCollection#get} to iterate over all the labels + in the collection. */ length: number; /** * Creates and adds a label with the specified initial properties to the collection. - * The added label is returned so it can be modified or removed from the collection later. + The added label is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a label, specifying all the default values. - * var l = labels.add({ - * show : true, - * position : Cesium.Cartesian3.ZERO, - * text : '', - * font : '30px sans-serif', - * fillColor : Cesium.Color.WHITE, - * outlineColor : Cesium.Color.BLACK, - * outlineWidth : 1.0, - * showBackground : false, - * backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8), - * backgroundPadding : new Cesium.Cartesian2(7, 5), - * style : Cesium.LabelStyle.FILL, - * pixelOffset : Cesium.Cartesian2.ZERO, - * eyeOffset : Cesium.Cartesian3.ZERO, - * horizontalOrigin : Cesium.HorizontalOrigin.LEFT, - * verticalOrigin : Cesium.VerticalOrigin.BASELINE, - * scale : 1.0, - * translucencyByDistance : undefined, - * pixelOffsetScaleByDistance : undefined, - * heightReference : HeightReference.NONE, - * distanceDisplayCondition : undefined - * }); + var l = labels.add({ + show : true, + position : Cesium.Cartesian3.ZERO, + text : '', + font : '30px sans-serif', + fillColor : Cesium.Color.WHITE, + outlineColor : Cesium.Color.BLACK, + outlineWidth : 1.0, + showBackground : false, + backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8), + backgroundPadding : new Cesium.Cartesian2(7, 5), + style : Cesium.LabelStyle.FILL, + pixelOffset : Cesium.Cartesian2.ZERO, + eyeOffset : Cesium.Cartesian3.ZERO, + horizontalOrigin : Cesium.HorizontalOrigin.LEFT, + verticalOrigin : Cesium.VerticalOrigin.BASELINE, + scale : 1.0, + translucencyByDistance : undefined, + pixelOffsetScaleByDistance : undefined, + heightReference : HeightReference.NONE, + distanceDisplayCondition : undefined + }); * @example * // Example 2: Specify only the label's cartographic position, - * // text, and font. - * var l = labels.add({ - * position : Cesium.Cartesian3.fromRadians(longitude, latitude, height), - * text : 'Hello World', - * font : '24px Helvetica', - * }); + // text, and font. + var l = labels.add({ + position : Cesium.Cartesian3.fromRadians(longitude, latitude, height), + text : 'Hello World', + font : '24px Helvetica', + }); * @param [options] - A template describing the label's properties as shown in Example 1. * @returns The label that was added to the collection. */ @@ -32293,7 +32441,7 @@ export class LabelCollection { * Removes a label from the collection. Once removed, a label is no longer usable. * @example * var l = labels.add(...); - * labels.remove(l); // Returns true + labels.remove(l); // Returns true * @param label - The label to remove. * @returns true if the label was removed; false if the label was not found in the collection. */ @@ -32302,8 +32450,8 @@ export class LabelCollection { * Removes all labels from the collection. * @example * labels.add(...); - * labels.add(...); - * labels.removeAll(); + labels.add(...); + labels.removeAll(); */ removeAll(): void; /** @@ -32314,36 +32462,36 @@ export class LabelCollection { contains(label: Label): boolean; /** * Returns the label in the collection at the specified index. Indices are zero-based - * and increase as labels are added. Removing a label shifts all labels after - * it to the left, changing their indices. This function is commonly used with - * {@link LabelCollection#length} to iterate over all the labels - * in the collection. + and increase as labels are added. Removing a label shifts all labels after + it to the left, changing their indices. This function is commonly used with + {@link LabelCollection#length} to iterate over all the labels + in the collection. * @example * // Toggle the show property of every label in the collection - * var len = labels.length; - * for (var i = 0; i < len; ++i) { - * var l = billboards.get(i); - * l.show = !l.show; - * } + var len = labels.length; + for (var i = 0; i < len; ++i) { + var l = billboards.get(i); + l.show = !l.show; + } * @param index - The zero-based index of the billboard. * @returns The label at the specified index. */ get(index: number): Label; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * labels = labels && labels.destroy(); */ @@ -32383,20 +32531,6 @@ export class Light { intensity: number; } -/** - * Describes how the map will operate in 2D. - */ -export enum MapMode2D { - /** - * The 2D map can be rotated about the z axis. - */ - ROTATE = 0, - /** - * The 2D map can be scrolled infinitely in the horizontal direction. - */ - INFINITE_SCROLL = 1 -} - export namespace MapboxImageryProvider { /** * Initialization options for the MapboxImageryProvider constructor @@ -32406,8 +32540,8 @@ export namespace MapboxImageryProvider { * @property [format = 'png'] - The format of the image request. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying - * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely - * to result in rendering problems. + this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely + to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [credit] - A credit for the data source, which is displayed on the canvas. @@ -32429,37 +32563,37 @@ export namespace MapboxImageryProvider { * Provides tiled imagery hosted by Mapbox. * @example * // Mapbox tile provider - * var mapbox = new Cesium.MapboxImageryProvider({ - * mapId: 'mapbox.streets', - * accessToken: 'thisIsMyAccessToken' - * }); +var mapbox = new Cesium.MapboxImageryProvider({ + mapId: 'mapbox.streets', + accessToken: 'thisIsMyAccessToken' +}); * @param options - Object describing initialization options */ export class MapboxImageryProvider { constructor(options: MapboxImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -32468,7 +32602,7 @@ export class MapboxImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -32497,55 +32631,55 @@ export class MapboxImageryProvider { readonly readyPromise: Promise; /** * Gets the rectangle, in radians, of the imagery provided by the instance. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. + not be called before {@link MapboxImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. + not be called before {@link MapboxImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. + not be called before {@link MapboxImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. + not be called before {@link MapboxImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. Generally, - * a minimum level should only be used when the rectangle of the imagery is small - * enough that the number of tiles at the minimum level is small. An imagery - * provider with more than a few tiles at the minimum level will lead to - * rendering problems. + not be called before {@link MapboxImageryProvider#ready} returns true. Generally, + a minimum level should only be used when the rectangle of the imagery is small + enough that the number of tiles at the minimum level is small. An imagery + provider with more than a few tiles at the minimum level will lead to + rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. + not be called before {@link MapboxImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. + the source of the imagery. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. */ readonly credit: Credit; /** @@ -32554,10 +32688,10 @@ export class MapboxImageryProvider { readonly proxy: Proxy; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -32570,30 +32704,30 @@ export class MapboxImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link MapboxImageryProvider#ready} returns true. + not be called before {@link MapboxImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within - * a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true. - * This function is optional, so it may not exist on all ImageryProviders. + a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true. + This function is optional, so it may not exist on all ImageryProviders. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } @@ -32609,8 +32743,8 @@ export namespace MapboxStyleImageryProvider { * @property [scaleFactor] - Determines if tiles are rendered at a @2x scale factor. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying - * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely - * to result in rendering problems. + this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely + to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [credit] - A credit for the data source, which is displayed on the canvas. @@ -32634,37 +32768,37 @@ export namespace MapboxStyleImageryProvider { * Provides tiled imagery hosted by Mapbox. * @example * // Mapbox style provider - * var mapbox = new Cesium.MapboxStyleImageryProvider({ - * styleId: 'streets-v11', - * accessToken: 'thisIsMyAccessToken' - * }); +var mapbox = new Cesium.MapboxStyleImageryProvider({ + styleId: 'streets-v11', + accessToken: 'thisIsMyAccessToken' +}); * @param options - Object describing initialization options */ export class MapboxStyleImageryProvider { constructor(options: MapboxStyleImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -32673,7 +32807,7 @@ export class MapboxStyleImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -32702,55 +32836,55 @@ export class MapboxStyleImageryProvider { readonly readyPromise: Promise; /** * Gets the rectangle, in radians, of the imagery provided by the instance. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. + not be called before {@link MapboxStyleImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. + not be called before {@link MapboxStyleImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. + not be called before {@link MapboxStyleImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. + not be called before {@link MapboxStyleImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally, - * a minimum level should only be used when the rectangle of the imagery is small - * enough that the number of tiles at the minimum level is small. An imagery - * provider with more than a few tiles at the minimum level will lead to - * rendering problems. + not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally, + a minimum level should only be used when the rectangle of the imagery is small + enough that the number of tiles at the minimum level is small. An imagery + provider with more than a few tiles at the minimum level will lead to + rendering problems. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by the provider. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. + not be called before {@link MapboxStyleImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. + the source of the imagery. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. */ readonly credit: Credit; /** @@ -32759,10 +32893,10 @@ export class MapboxStyleImageryProvider { readonly proxy: Proxy; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -32775,242 +32909,256 @@ export class MapboxStyleImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link MapboxStyleImageryProvider#ready} returns true. + not be called before {@link MapboxStyleImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within - * a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true. - * This function is optional, so it may not exist on all ImageryProviders. + a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true. + This function is optional, so it may not exist on all ImageryProviders. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } +/** + * Describes how the map will operate in 2D. + */ +export enum MapMode2D { + /** + * The 2D map can be rotated about the z axis. + */ + ROTATE = 0, + /** + * The 2D map can be scrolled infinitely in the horizontal direction. + */ + INFINITE_SCROLL = 1 +} + /** * A Material defines surface appearance through a combination of diffuse, specular, - * normal, emission, and alpha components. These values are specified using a - * JSON schema called Fabric which gets parsed and assembled into glsl shader code - * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page} - * for more details on Fabric. - *

- * - * - * Base material types and their uniforms: - *
- *
    - *
  • Color
  • - *
      - *
    • color: rgba color object.
    • - *
    - *
  • Image
  • - *
      - *
    • image: path to image.
    • - *
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • - *
    - *
  • DiffuseMap
  • - *
      - *
    • image: path to image.
    • - *
    • channels: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.
    • - *
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • - *
    - *
  • AlphaMap
  • - *
      - *
    • image: path to image.
    • - *
    • channel: One character string containing r, g, b, or a for selecting the desired image channel.
    • - *
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • - *
    - *
  • SpecularMap
  • - *
      - *
    • image: path to image.
    • - *
    • channel: One character string containing r, g, b, or a for selecting the desired image channel.
    • - *
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • - *
    - *
  • EmissionMap
  • - *
      - *
    • image: path to image.
    • - *
    • channels: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.
    • - *
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • - *
    - *
  • BumpMap
  • - *
      - *
    • image: path to image.
    • - *
    • channel: One character string containing r, g, b, or a for selecting the desired image channel.
    • - *
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • - *
    • strength: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.
    • - *
    - *
  • NormalMap
  • - *
      - *
    • image: path to image.
    • - *
    • channels: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.
    • - *
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • - *
    • strength: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.
    • - *
    - *
  • Grid
  • - *
      - *
    • color: rgba color object for the whole material.
    • - *
    • cellAlpha: Alpha value for the cells between grid lines. This will be combined with color.alpha.
    • - *
    • lineCount: Object with x and y values specifying the number of columns and rows respectively.
    • - *
    • lineThickness: Object with x and y values specifying the thickness of grid lines (in pixels where available).
    • - *
    • lineOffset: Object with x and y values specifying the offset of grid lines (range is 0 to 1).
    • - *
    - *
  • Stripe
  • - *
      - *
    • horizontal: Boolean that determines if the stripes are horizontal or vertical.
    • - *
    • evenColor: rgba color object for the stripe's first color.
    • - *
    • oddColor: rgba color object for the stripe's second color.
    • - *
    • offset: Number that controls at which point into the pattern to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning of the odd color, 2.0 being the even color again, and any multiple or fractional values being in between.
    • - *
    • repeat: Number that controls the total number of stripes, half light and half dark.
    • - *
    - *
  • Checkerboard
  • - *
      - *
    • lightColor: rgba color object for the checkerboard's light alternating color.
    • - *
    • darkColor: rgba color object for the checkerboard's dark alternating color.
    • - *
    • repeat: Object with x and y values specifying the number of columns and rows respectively.
    • - *
    - *
  • Dot
  • - *
      - *
    • lightColor: rgba color object for the dot color.
    • - *
    • darkColor: rgba color object for the background color.
    • - *
    • repeat: Object with x and y values specifying the number of columns and rows of dots respectively.
    • - *
    - *
  • Water
  • - *
      - *
    • baseWaterColor: rgba color object base color of the water.
    • - *
    • blendColor: rgba color object used when blending from water to non-water areas.
    • - *
    • specularMap: Single channel texture used to indicate areas of water.
    • - *
    • normalMap: Normal map for water normal perturbation.
    • - *
    • frequency: Number that controls the number of waves.
    • - *
    • normalMap: Normal map for water normal perturbation.
    • - *
    • animationSpeed: Number that controls the animations speed of the water.
    • - *
    • amplitude: Number that controls the amplitude of water waves.
    • - *
    • specularIntensity: Number that controls the intensity of specular reflections.
    • - *
    - *
  • RimLighting
  • - *
      - *
    • color: diffuse color and alpha.
    • - *
    • rimColor: diffuse color and alpha of the rim.
    • - *
    • width: Number that determines the rim's width.
    • - *
    - *
  • Fade
  • - *
      - *
    • fadeInColor: diffuse color and alpha at time
    • - *
    • fadeOutColor: diffuse color and alpha at maximumDistance from time
    • - *
    • maximumDistance: Number between 0.0 and 1.0 where the fadeInColor becomes the fadeOutColor. A value of 0.0 gives the entire material a color of fadeOutColor and a value of 1.0 gives the the entire material a color of fadeInColor
    • - *
    • repeat: true if the fade should wrap around the texture coodinates.
    • - *
    • fadeDirection: Object with x and y values specifying if the fade should be in the x and y directions.
    • - *
    • time: Object with x and y values between 0.0 and 1.0 of the fadeInColor position
    • - *
    - *
  • PolylineArrow
  • - *
      - *
    • color: diffuse color and alpha.
    • - *
    - *
  • PolylineDash
  • - *
      - *
    • color: color for the line.
    • - *
    • gapColor: color for the gaps in the line.
    • - *
    • dashLength: Dash length in pixels.
    • - *
    • dashPattern: The 16 bit stipple pattern for the line..
    • - *
    - *
  • PolylineGlow
  • - *
      - *
    • color: color and maximum alpha for the glow on the line.
    • - *
    • glowPower: strength of the glow, as a percentage of the total line width (less than 1.0).
    • - *
    • taperPower: strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.
    • - *
    - *
  • PolylineOutline
  • - *
      - *
    • color: diffuse color and alpha for the interior of the line.
    • - *
    • outlineColor: diffuse color and alpha for the outline.
    • - *
    • outlineWidth: width of the outline in pixels.
    • - *
    - *
  • ElevationContour
  • - *
      - *
    • color: color and alpha for the contour line.
    • - *
    • spacing: spacing for contour lines in meters.
    • - *
    • width: Number specifying the width of the grid lines in pixels.
    • - *
    - *
  • ElevationRamp
  • - *
      - *
    • image: color ramp image to use for coloring the terrain.
    • - *
    • minimumHeight: minimum height for the ramp.
    • - *
    • maximumHeight: maximum height for the ramp.
    • - *
    - *
  • SlopeRamp
  • - *
      - *
    • image: color ramp image to use for coloring the terrain by slope.
    • - *
    - *
  • AspectRamp
  • - *
      - *
    • image: color ramp image to use for color the terrain by aspect.
    • - *
    - *
  • ElevationBand
  • - *
      - *
    • heights: image of heights sorted from lowest to highest.
    • - *
    • colors: image of colors at the corresponding heights.
    • - *
    - *
- * - *
+normal, emission, and alpha components. These values are specified using a +JSON schema called Fabric which gets parsed and assembled into glsl shader code +behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page} +for more details on Fabric. +

+ + +Base material types and their uniforms: +
+
    +
  • Color
  • +
      +
    • color: rgba color object.
    • +
    +
  • Image
  • +
      +
    • image: path to image.
    • +
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • +
    +
  • DiffuseMap
  • +
      +
    • image: path to image.
    • +
    • channels: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.
    • +
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • +
    +
  • AlphaMap
  • +
      +
    • image: path to image.
    • +
    • channel: One character string containing r, g, b, or a for selecting the desired image channel.
    • +
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • +
    +
  • SpecularMap
  • +
      +
    • image: path to image.
    • +
    • channel: One character string containing r, g, b, or a for selecting the desired image channel.
    • +
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • +
    +
  • EmissionMap
  • +
      +
    • image: path to image.
    • +
    • channels: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.
    • +
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • +
    +
  • BumpMap
  • +
      +
    • image: path to image.
    • +
    • channel: One character string containing r, g, b, or a for selecting the desired image channel.
    • +
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • +
    • strength: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.
    • +
    +
  • NormalMap
  • +
      +
    • image: path to image.
    • +
    • channels: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.
    • +
    • repeat: Object with x and y values specifying the number of times to repeat the image.
    • +
    • strength: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.
    • +
    +
  • Grid
  • +
      +
    • color: rgba color object for the whole material.
    • +
    • cellAlpha: Alpha value for the cells between grid lines. This will be combined with color.alpha.
    • +
    • lineCount: Object with x and y values specifying the number of columns and rows respectively.
    • +
    • lineThickness: Object with x and y values specifying the thickness of grid lines (in pixels where available).
    • +
    • lineOffset: Object with x and y values specifying the offset of grid lines (range is 0 to 1).
    • +
    +
  • Stripe
  • +
      +
    • horizontal: Boolean that determines if the stripes are horizontal or vertical.
    • +
    • evenColor: rgba color object for the stripe's first color.
    • +
    • oddColor: rgba color object for the stripe's second color.
    • +
    • offset: Number that controls at which point into the pattern to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning of the odd color, 2.0 being the even color again, and any multiple or fractional values being in between.
    • +
    • repeat: Number that controls the total number of stripes, half light and half dark.
    • +
    +
  • Checkerboard
  • +
      +
    • lightColor: rgba color object for the checkerboard's light alternating color.
    • +
    • darkColor: rgba color object for the checkerboard's dark alternating color.
    • +
    • repeat: Object with x and y values specifying the number of columns and rows respectively.
    • +
    +
  • Dot
  • +
      +
    • lightColor: rgba color object for the dot color.
    • +
    • darkColor: rgba color object for the background color.
    • +
    • repeat: Object with x and y values specifying the number of columns and rows of dots respectively.
    • +
    +
  • Water
  • +
      +
    • baseWaterColor: rgba color object base color of the water.
    • +
    • blendColor: rgba color object used when blending from water to non-water areas.
    • +
    • specularMap: Single channel texture used to indicate areas of water.
    • +
    • normalMap: Normal map for water normal perturbation.
    • +
    • frequency: Number that controls the number of waves.
    • +
    • normalMap: Normal map for water normal perturbation.
    • +
    • animationSpeed: Number that controls the animations speed of the water.
    • +
    • amplitude: Number that controls the amplitude of water waves.
    • +
    • specularIntensity: Number that controls the intensity of specular reflections.
    • +
    +
  • RimLighting
  • +
      +
    • color: diffuse color and alpha.
    • +
    • rimColor: diffuse color and alpha of the rim.
    • +
    • width: Number that determines the rim's width.
    • +
    +
  • Fade
  • +
      +
    • fadeInColor: diffuse color and alpha at time
    • +
    • fadeOutColor: diffuse color and alpha at maximumDistance from time
    • +
    • maximumDistance: Number between 0.0 and 1.0 where the fadeInColor becomes the fadeOutColor. A value of 0.0 gives the entire material a color of fadeOutColor and a value of 1.0 gives the the entire material a color of fadeInColor
    • +
    • repeat: true if the fade should wrap around the texture coodinates.
    • +
    • fadeDirection: Object with x and y values specifying if the fade should be in the x and y directions.
    • +
    • time: Object with x and y values between 0.0 and 1.0 of the fadeInColor position
    • +
    +
  • PolylineArrow
  • +
      +
    • color: diffuse color and alpha.
    • +
    +
  • PolylineDash
  • +
      +
    • color: color for the line.
    • +
    • gapColor: color for the gaps in the line.
    • +
    • dashLength: Dash length in pixels.
    • +
    • dashPattern: The 16 bit stipple pattern for the line..
    • +
    +
  • PolylineGlow
  • +
      +
    • color: color and maximum alpha for the glow on the line.
    • +
    • glowPower: strength of the glow, as a percentage of the total line width (less than 1.0).
    • +
    • taperPower: strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.
    • +
    +
  • PolylineOutline
  • +
      +
    • color: diffuse color and alpha for the interior of the line.
    • +
    • outlineColor: diffuse color and alpha for the outline.
    • +
    • outlineWidth: width of the outline in pixels.
    • +
    +
  • ElevationContour
  • +
      +
    • color: color and alpha for the contour line.
    • +
    • spacing: spacing for contour lines in meters.
    • +
    • width: Number specifying the width of the grid lines in pixels.
    • +
    +
  • ElevationRamp
  • +
      +
    • image: color ramp image to use for coloring the terrain.
    • +
    • minimumHeight: minimum height for the ramp.
    • +
    • maximumHeight: maximum height for the ramp.
    • +
    +
  • SlopeRamp
  • +
      +
    • image: color ramp image to use for coloring the terrain by slope.
    • +
    +
  • AspectRamp
  • +
      +
    • image: color ramp image to use for color the terrain by aspect.
    • +
    +
  • ElevationBand
  • +
      +
    • heights: image of heights sorted from lowest to highest.
    • +
    • colors: image of colors at the corresponding heights.
    • +
    +
+ +
* @example * // Create a color material with fromType: - * polygon.material = Cesium.Material.fromType('Color'); - * polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); - * - * // Create the default material: - * polygon.material = new Cesium.Material(); - * - * // Create a color material with full Fabric notation: - * polygon.material = new Cesium.Material({ - * fabric : { - * type : 'Color', - * uniforms : { - * color : new Cesium.Color(1.0, 1.0, 0.0, 1.0) - * } - * } - * }); +polygon.material = Cesium.Material.fromType('Color'); +polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); + +// Create the default material: +polygon.material = new Cesium.Material(); + +// Create a color material with full Fabric notation: +polygon.material = new Cesium.Material({ + fabric : { + type : 'Color', + uniforms : { + color : new Cesium.Color(1.0, 1.0, 0.0, 1.0) + } + } +}); * @param [options] - Object with the following properties: * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials. * @param [options.translucent = true] - When true or a function that returns true, the geometry - * with this material is expected to appear translucent. + with this material is expected to appear translucent. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures. * @param options.fabric - The fabric JSON used to generate the material. @@ -33041,17 +33189,17 @@ export class Material { uniforms: any; /** * When true or a function that returns true, - * the geometry is expected to appear translucent. + the geometry is expected to appear translucent. */ translucent: boolean | ((...params: any[]) => any); /** * Creates a new material using an existing material type. - *

- * Shorthand for: new Material({fabric : {type : type}}); +

+ Shorthand for: new Material({fabric : {type : type}}); * @example * var material = Cesium.Material.fromType('Color', { - * color : new Cesium.Color(1.0, 0.0, 0.0, 1.0) - * }); + color : new Cesium.Color(1.0, 0.0, 0.0, 1.0) + }); * @param type - The base material type. * @param [uniforms] - Overrides for the default uniforms. * @returns New material object. @@ -33064,19 +33212,19 @@ export class Material { isTranslucent(): boolean; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * material = material && material.destroy(); */ @@ -33189,21 +33337,21 @@ export class Material { /** * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example) - * that supports shading with materials. +that supports shading with materials. * @example * var primitive = new Cesium.Primitive({ - * geometryInstances : new Cesium.GeometryInstance({ - * geometry : new Cesium.WallGeometry({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.WallGeometry({ * materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat, - * // ... - * }) - * }), - * appearance : new Cesium.MaterialAppearance({ - * material : Cesium.Material.fromType('Color'), - * faceForward : true - * }) - * - * }); + // ... + }) + }), + appearance : new Cesium.MaterialAppearance({ + material : Cesium.Material.fromType('Color'), + faceForward : true + }) + +}); * @param [options] - Object with the following properties: * @param [options.flat = false] - When true, flat shading is used in the fragment shader, which means lighting is not taking into account. * @param [options.faceForward = !options.closed] - When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. @@ -33229,7 +33377,7 @@ export class MaterialAppearance { }); /** * The material used to determine the fragment color. Unlike other {@link MaterialAppearance} - * properties, this is not read-only, so an appearance's material can change on the fly. + properties, this is not read-only, so an appearance's material can change on the fly. */ material: Material; /** @@ -33242,53 +33390,53 @@ export class MaterialAppearance { readonly vertexShaderSource: string; /** * The GLSL source code for the fragment shader. The full fragment shader - * source is built procedurally taking into account {@link MaterialAppearance#material}, - * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}. - * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source. + source is built procedurally taking into account {@link MaterialAppearance#material}, + {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}. + Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source. */ readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. - *

- * The render state can be explicitly defined when constructing a {@link MaterialAppearance} - * instance, or it is set implicitly via {@link MaterialAppearance#translucent} - * and {@link MaterialAppearance#closed}. - *

+

+ The render state can be explicitly defined when constructing a {@link MaterialAppearance} + instance, or it is set implicitly via {@link MaterialAppearance#translucent} + and {@link MaterialAppearance#closed}. +

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so - * {@link MaterialAppearance#renderState} has backface culling enabled. - * If the viewer enters the geometry, it will not be visible. + {@link MaterialAppearance#renderState} has backface culling enabled. + If the viewer enters the geometry, it will not be visible. */ readonly closed: boolean; /** * The type of materials supported by this instance. This impacts the required - * {@link VertexFormat} and the complexity of the vertex and fragment shaders. + {@link VertexFormat} and the complexity of the vertex and fragment shaders. */ readonly materialSupport: MaterialAppearance.MaterialSupportType; /** * The {@link VertexFormat} that this appearance instance is compatible with. - * A geometry can have more vertex attributes and still be compatible - at a - * potential performance cost - but it can't have less. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * When true, flat shading is used in the fragment shader, - * which means lighting is not taking into account. + which means lighting is not taking into account. */ readonly flat: boolean; /** * When true, the fragment shader flips the surface normal - * as needed to ensure that the normal faces the viewer to avoid - * dark spots. This is useful when both sides of a geometry should be - * shaded like {@link WallGeometry}. + as needed to ensure that the normal faces the viewer to avoid + dark spots. This is useful when both sides of a geometry should be + shaded like {@link WallGeometry}. */ readonly faceForward: boolean; /** * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance}, - * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material}, - * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}. + this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material}, + {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; @@ -33299,8 +33447,8 @@ export class MaterialAppearance { isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, - * it can contain a subset of render state properties identical to the render state - * created in the context. + it can contain a subset of render state properties identical to the render state + created in the context. * @returns The render state. */ getRenderState(): any; @@ -33314,26 +33462,26 @@ export namespace MaterialAppearance { }; /** * Determines the type of {@link Material} that is supported by a - * {@link MaterialAppearance} instance. This is a trade-off between - * flexibility (a wide array of materials) and memory/performance - * (required vertex format and GLSL shader complexity. + {@link MaterialAppearance} instance. This is a trade-off between + flexibility (a wide array of materials) and memory/performance + (required vertex format and GLSL shader complexity. */ namespace MaterialSupport { /** * Only basic materials, which require just position and - * normal vertex attributes, are supported. + normal vertex attributes, are supported. */ const BASIC: MaterialAppearance.MaterialSupportType; /** * Materials with textures, which require position, - * normal, and st vertex attributes, - * are supported. The vast majority of materials fall into this category. + normal, and st vertex attributes, + are supported. The vast majority of materials fall into this category. */ const TEXTURED: MaterialAppearance.MaterialSupportType; /** * All materials, including those that work in tangent space, are supported. - * This requires position, normal, st, - * tangent, and bitangent vertex attributes. + This requires position, normal, st, + tangent, and bitangent vertex attributes. */ const ALL: MaterialAppearance.MaterialSupportType; } @@ -33341,49 +33489,49 @@ export namespace MaterialAppearance { /** * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL. - *

- * Cesium includes support for geometry and materials, glTF animations, and glTF skinning. - * In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable - * with {@link Model#getNode}. glTF cameras and lights are not currently supported. - *

- *

- * An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be - * created at runtime and passed to this constructor function. In either case, the - * {@link Model#readyPromise} is resolved when the model is ready to render, i.e., - * when the external binary, image, and shader files are downloaded and the WebGL - * resources are created. - *

- *

- * Cesium supports glTF assets with the following extensions: - *

    - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)} - *
  • - * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations} - *
  • - * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression} - *
  • - * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness} - *
  • - * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform} - *
  • - *
- *

- *

- * For high-precision rendering, Cesium supports the {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} extension, which introduces the - * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated - * relative to a local origin. - *

+

+Cesium includes support for geometry and materials, glTF animations, and glTF skinning. +In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable +with {@link Model#getNode}. glTF cameras and lights are not currently supported. +

+

+An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be +created at runtime and passed to this constructor function. In either case, the +{@link Model#readyPromise} is resolved when the model is ready to render, i.e., +when the external binary, image, and shader files are downloaded and the WebGL +resources are created. +

+

+Cesium supports glTF assets with the following extensions: +

    +
  • +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)} +
  • +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)} +
  • +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)} +
  • +{@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations} +
  • +{@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)} +
  • +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression} +
  • +{@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness} +
  • +{@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit} +
  • +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl} +
  • +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform} +
  • +
+

+

+For high-precision rendering, Cesium supports the {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} extension, which introduces the +CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated +relative to a local origin. +

* @param [options] - Object with the following properties: * @param [options.gltf] - A glTF JSON object, or a binary glTF buffer. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to. @@ -33467,30 +33615,30 @@ export class Model { silhouetteSize: number; /** * The 4x4 transformation matrix that transforms the model from model to world coordinates. - * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates. - * Local reference frames can be used by providing a different transformation matrix, like that returned - * by {@link Transforms.eastNorthUpToFixedFrame}. + When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. * @example * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); - * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); + m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); */ modelMatrix: Matrix4; /** * A uniform scale applied to this model before the {@link Model#modelMatrix}. - * Values greater than 1.0 increase the size of the model; values - * less than 1.0 decrease. + Values greater than 1.0 increase the size of the model; values + less than 1.0 decrease. */ scale: number; /** * The approximate minimum pixel size of the model regardless of zoom. - * This can be used to ensure that a model is visible even when the viewer - * zooms out. When 0.0, no minimum size is enforced. + This can be used to ensure that a model is visible even when the viewer + zooms out. When 0.0, no minimum size is enforced. */ minimumPixelSize: number; /** * The maximum scale size for a model. This can be used to give - * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model - * is never an unreasonable scale. + an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model + is never an unreasonable scale. */ maximumScale: number; /** @@ -33523,79 +33671,79 @@ export class Model { colorBlendMode: ColorBlendMode; /** * Value used to determine the color strength when the colorBlendMode is MIX. - * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with - * any value in-between resulting in a mix of the two. + A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with + any value in-between resulting in a mix of the two. */ colorBlendAmount: number; /** * Whether to cull back-facing geometry. When true, back face culling is - * determined by the material's doubleSided property; when false, back face - * culling is disabled. Back faces are not culled if {@link Model#color} is - * translucent or {@link Model#silhouetteSize} is greater than 0.0. + determined by the material's doubleSided property; when false, back face + culling is disabled. Back faces are not culled if {@link Model#color} is + translucent or {@link Model#silhouetteSize} is greater than 0.0. */ backFaceCulling: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds - * to one draw command. A glTF mesh has an array of primitives, often of length one. - *

+

+ Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds + to one draw command. A glTF mesh has an array of primitives, often of length one. +

*/ debugShowBoundingVolume: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the model in wireframe. - *

+

+ Draws the model in wireframe. +

*/ debugWireframe: boolean; /** * The object for the glTF JSON, including properties with default values omitted - * from the JSON provided to this model. + from the JSON provided to this model. */ readonly gltf: any; /** * The base path that paths in the glTF JSON are relative to. The base - * path is the same path as the path containing the .gltf file - * minus the .gltf file, when binary, image, and shader files are - * in the same directory as the .gltf. When this is '', - * the app's base path is used. + path is the same path as the path containing the .gltf file + minus the .gltf file, when binary, image, and shader files are + in the same directory as the .gltf. When this is '', + the app's base path is used. */ readonly basePath: string; /** * The model's bounding sphere in its local coordinate system. This does not take into - * account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}. + account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}. * @example * // Center in WGS84 coordinates - * var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3()); + var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3()); */ readonly boundingSphere: BoundingSphere; /** * When true, this model is ready to render, i.e., the external binary, image, - * and shader files were downloaded and the WebGL resources were created. This is set to - * true right before {@link Model#readyPromise} is resolved. + and shader files were downloaded and the WebGL resources were created. This is set to + true right before {@link Model#readyPromise} is resolved. */ readonly ready: boolean; /** * Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary, image, - * and shader files were downloaded and the WebGL resources were created. - *

- * This promise is resolved at the end of the frame before the first frame the model is rendered in. - *

+ and shader files were downloaded and the WebGL resources were created. +

+ This promise is resolved at the end of the frame before the first frame the model is rendered in. +

* @example * // Play all animations at half-speed when the model is ready to render - * Cesium.when(model.readyPromise).then(function(model) { - * model.activeAnimations.addAll({ - * multiplier : 0.5 - * }); - * }).otherwise(function(error){ - * window.alert(error); - * }); + Cesium.when(model.readyPromise).then(function(model) { + model.activeAnimations.addAll({ + multiplier : 0.5 + }); + }).otherwise(function(error){ + window.alert(error); + }); */ readonly readyPromise: Promise; /** * Determines if model WebGL resource creation will be spread out over several frames or - * block until completion once all glTF files are loaded. + block until completion once all glTF files are loaded. */ readonly asynchronous: boolean; /** @@ -33620,33 +33768,33 @@ export class Model { clippingPlanes: ClippingPlaneCollection; /** * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final - * diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources. + diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources. */ imageBasedLightingFactor: Cartesian2; /** * The light color when shading the model. When undefined the scene's light color is used instead. - *

- * For example, disabling additional light sources by setting model.imageBasedLightingFactor = new Cesium.Cartesian2(0.0, 0.0) will make the - * model much darker. Here, increasing the intensity of the light source will make the model brighter. - *

+

+ For example, disabling additional light sources by setting model.imageBasedLightingFactor = new Cesium.Cartesian2(0.0, 0.0) will make the + model much darker. Here, increasing the intensity of the light source will make the model brighter. +

*/ lightColor: Cartesian3; /** * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map. - * This is used when {@link Model#specularEnvironmentMaps} and {@link Model#sphericalHarmonicCoefficients} are not defined. + This is used when {@link Model#specularEnvironmentMaps} and {@link Model#sphericalHarmonicCoefficients} are not defined. */ luminanceAtZenith: number; /** * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When undefined, a diffuse irradiance - * computed from the atmosphere color is used. - *

- * There are nine Cartesian3 coefficients. - * The order of the coefficients is: L00, L1-1, L10, L11, L2-2, L2-1, L20, L21, L22 - *

- * - * These values can be obtained by preprocessing the environment map using the cmgen tool of - * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be - * supplied to {@link Model#specularEnvironmentMaps}. + computed from the atmosphere color is used. +

+ There are nine Cartesian3 coefficients. + The order of the coefficients is: L00, L1-1, L10, L11, L2-2, L2-1, L20, L21, L22 +

+ + These values can be obtained by preprocessing the environment map using the cmgen tool of + {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be + supplied to {@link Model#specularEnvironmentMaps}. */ sphericalHarmonicCoefficients: Cartesian3[]; /** @@ -33665,69 +33813,69 @@ export class Model { static silhouetteSupported(scene: Scene): boolean; /** *

- * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image, - * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved. - *

- *

- * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension. - *

- *

- * Cesium supports glTF assets with the following extensions: - *

    - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)} - *
  • - * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations} - *
  • - * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression} - *
  • - * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness} - *
  • - * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl} - *
  • - * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform} - *
  • - *
- *

- *

- * For high-precision rendering, Cesium supports the {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} extension, which introduces the - * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated - * relative to a local origin. - *

+ Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image, + and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved. +

+

+ The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension. +

+

+ Cesium supports glTF assets with the following extensions: +

    +
  • + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)} +
  • + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)} +
  • + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)} +
  • + {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations} +
  • + {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)} +
  • + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression} +
  • + {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness} +
  • + {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit} +
  • + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl} +
  • + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform} +
  • +
+

+

+ For high-precision rendering, Cesium supports the {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} extension, which introduces the + CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated + relative to a local origin. +

* @example * // Example 1. Create a model from a glTF asset - * var model = scene.primitives.add(Cesium.Model.fromGltf({ - * url : './duck/duck.gltf' - * })); + var model = scene.primitives.add(Cesium.Model.fromGltf({ + url : './duck/duck.gltf' + })); * @example * // Example 2. Create model and provide all properties and events - * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); - * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); - * - * var model = scene.primitives.add(Cesium.Model.fromGltf({ - * url : './duck/duck.gltf', - * show : true, // default - * modelMatrix : modelMatrix, - * scale : 2.0, // double size - * minimumPixelSize : 128, // never smaller than 128 pixels - * maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize) - * allowPicking : false, // not pickable - * debugShowBoundingVolume : false, // default - * debugWireframe : false - * })); - * - * model.readyPromise.then(function(model) { - * // Play all animations when the model is ready to render - * model.activeAnimations.addAll(); - * }); + var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); + var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); + + var model = scene.primitives.add(Cesium.Model.fromGltf({ + url : './duck/duck.gltf', + show : true, // default + modelMatrix : modelMatrix, + scale : 2.0, // double size + minimumPixelSize : 128, // never smaller than 128 pixels + maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize) + allowPicking : false, // not pickable + debugShowBoundingVolume : false, // default + debugWireframe : false + })); + + model.readyPromise.then(function(model) { + // Play all animations when the model is ready to render + model.activeAnimations.addAll(); + }); * @param options - Object with the following properties: * @param options.url - The url to the .gltf file. * @param [options.basePath] - The base path that paths in the glTF JSON are relative to. @@ -33789,11 +33937,11 @@ export class Model { }): Model; /** * Returns the glTF node with the given name property. This is used to - * modify a node's transform for animation outside of glTF animations. + modify a node's transform for animation outside of glTF animations. * @example * // Apply non-uniform scale to node LOD3sp - * var node = model.getNode('LOD3sp'); - * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix); + var node = model.getNode('LOD3sp'); + node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix); * @param name - The glTF name of the node. * @returns The node or undefined if no node with name exists. */ @@ -33812,40 +33960,40 @@ export class Model { getMaterial(name: string): ModelMaterial; /** * Sets the current value of an articulation stage. After setting one or multiple stage values, call - * Model.applyArticulations() to cause the node matrices to be recalculated. + Model.applyArticulations() to cause the node matrices to be recalculated. * @param articulationStageKey - The name of the articulation, a space, and the name of the stage. * @param value - The numeric value of this stage of the articulation. */ setArticulationStage(articulationStageKey: string, value: number): void; /** * Applies any modified articulation stages to the matrix of each node that participates - * in any articulation. Note that this will overwrite any nodeTransformations on participating nodes. + in any articulation. Note that this will overwrite any nodeTransformations on participating nodes. */ applyArticulations(): void; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * model = model && model.destroy(); */ @@ -33854,58 +34002,58 @@ export class Model { /** * An active glTF animation. A glTF asset can contain animations. An active animation - * is an animation that is currently playing or scheduled to be played because it was - * added to a model's {@link ModelAnimationCollection}. An active animation is an - * instance of an animation; for example, there can be multiple active animations - * for the same glTF animation, each with a different start time. - *

- * Create this by calling {@link ModelAnimationCollection#add}. - *

+is an animation that is currently playing or scheduled to be played because it was +added to a model's {@link ModelAnimationCollection}. An active animation is an +instance of an animation; for example, there can be multiple active animations +for the same glTF animation, each with a different start time. +

+Create this by calling {@link ModelAnimationCollection#add}. +

*/ export class ModelAnimation { constructor(); /** * When true, the animation is removed after it stops playing. - * This is slightly more efficient that not removing it, but if, for example, - * time is reversed, the animation is not played again. + This is slightly more efficient that not removing it, but if, for example, + time is reversed, the animation is not played again. */ removeOnStop: boolean; /** * The event fired when this animation is started. This can be used, for - * example, to play a sound or start a particle system, when the animation starts. - *

- * This event is fired at the end of the frame after the scene is rendered. - *

+ example, to play a sound or start a particle system, when the animation starts. +

+ This event is fired at the end of the frame after the scene is rendered. +

* @example * animation.start.addEventListener(function(model, animation) { - * console.log('Animation started: ' + animation.name); - * }); + console.log('Animation started: ' + animation.name); + }); */ start: Event; /** * The event fired when on each frame when this animation is updated. The - * current time of the animation, relative to the glTF animation time span, is - * passed to the event, which allows, for example, starting new animations at a - * specific time relative to a playing animation. - *

- * This event is fired at the end of the frame after the scene is rendered. - *

+ current time of the animation, relative to the glTF animation time span, is + passed to the event, which allows, for example, starting new animations at a + specific time relative to a playing animation. +

+ This event is fired at the end of the frame after the scene is rendered. +

* @example * animation.update.addEventListener(function(model, animation, time) { - * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time); - * }); + console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time); + }); */ update: Event; /** * The event fired when this animation is stopped. This can be used, for - * example, to play a sound or start a particle system, when the animation stops. - *

- * This event is fired at the end of the frame after the scene is rendered. - *

+ example, to play a sound or start a particle system, when the animation stops. +

+ This event is fired at the end of the frame after the scene is rendered. +

* @example * animation.stop.addEventListener(function(model, animation) { - * console.log('Animation stopped: ' + animation.name); - * }); + console.log('Animation stopped: ' + animation.name); + }); */ stop: Event; /** @@ -33914,7 +34062,7 @@ export class ModelAnimation { readonly name: string; /** * The scene time to start playing this animation. When this is undefined, - * the animation starts at the next frame. + the animation starts at the next frame. */ readonly startTime: JulianDate; /** @@ -33923,16 +34071,16 @@ export class ModelAnimation { readonly delay: number; /** * The scene time to stop playing this animation. When this is undefined, - * the animation is played for its full duration and perhaps repeated depending on - * {@link ModelAnimation#loop}. + the animation is played for its full duration and perhaps repeated depending on + {@link ModelAnimation#loop}. */ readonly stopTime: JulianDate; /** * Values greater than 1.0 increase the speed that the animation is played relative - * to the scene clock speed; values less than 1.0 decrease the speed. A value of - * 1.0 plays the animation at the speed in the glTF animation mapped to the scene - * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation - * will play in one second even if multiplier is 1.0. + to the scene clock speed; values less than 1.0 decrease the speed. A value of + 1.0 plays the animation at the speed in the glTF animation mapped to the scene + clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation + will play in one second even if multiplier is 1.0. */ readonly multiplier: number; /** @@ -33952,20 +34100,20 @@ export class ModelAnimationCollection { constructor(); /** * The event fired when an animation is added to the collection. This can be used, for - * example, to keep a UI in sync. + example, to keep a UI in sync. * @example * model.activeAnimations.animationAdded.addEventListener(function(model, animation) { - * console.log('Animation added: ' + animation.name); - * }); + console.log('Animation added: ' + animation.name); + }); */ animationAdded: Event; /** * The event fired when an animation is removed from the collection. This can be used, for - * example, to keep a UI in sync. + example, to keep a UI in sync. * @example * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) { - * console.log('Animation removed: ' + animation.name); - * }); + console.log('Animation removed: ' + animation.name); + }); */ animationRemoved: Event; /** @@ -33974,43 +34122,43 @@ export class ModelAnimationCollection { readonly length: number; /** * Creates and adds an animation with the specified initial properties to the collection. - *

- * This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync. - *

+

+ This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync. +

* @example * // Example 1. Add an animation by name - * model.activeAnimations.add({ - * name : 'animation name' - * }); - * - * // Example 2. Add an animation by index - * model.activeAnimations.add({ - * index : 0 - * }); + model.activeAnimations.add({ + name : 'animation name' + }); + + // Example 2. Add an animation by index + model.activeAnimations.add({ + index : 0 + }); * @example * // Example 3. Add an animation and provide all properties and events - * var startTime = Cesium.JulianDate.now(); - * - * var animation = model.activeAnimations.add({ - * name : 'another animation name', - * startTime : startTime, - * delay : 0.0, // Play at startTime (default) - * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()), - * removeOnStop : false, // Do not remove when animation stops (default) - * multiplier : 2.0, // Play at double speed - * reverse : true, // Play in reverse - * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation - * }); - * - * animation.start.addEventListener(function(model, animation) { - * console.log('Animation started: ' + animation.name); - * }); - * animation.update.addEventListener(function(model, animation, time) { - * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time); - * }); - * animation.stop.addEventListener(function(model, animation) { - * console.log('Animation stopped: ' + animation.name); - * }); + var startTime = Cesium.JulianDate.now(); + + var animation = model.activeAnimations.add({ + name : 'another animation name', + startTime : startTime, + delay : 0.0, // Play at startTime (default) + stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()), + removeOnStop : false, // Do not remove when animation stops (default) + multiplier : 2.0, // Play at double speed + reverse : true, // Play in reverse + loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation + }); + + animation.start.addEventListener(function(model, animation) { + console.log('Animation started: ' + animation.name); + }); + animation.update.addEventListener(function(model, animation, time) { + console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time); + }); + animation.stop.addEventListener(function(model, animation) { + console.log('Animation stopped: ' + animation.name); + }); * @param options - Object with the following properties: * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if options.index is undefined. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if options.name is undefined. @@ -34036,15 +34184,15 @@ export class ModelAnimationCollection { }): ModelAnimation; /** * Creates and adds an animation with the specified initial properties to the collection - * for each animation in the model. - *

- * This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync. - *

+ for each animation in the model. +

+ This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync. +

* @example * model.activeAnimations.addAll({ - * multiplier : 0.5, // Play at half-speed - * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations - * }); + multiplier : 0.5, // Play at half-speed + loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations + }); * @param [options] - Object with the following properties: * @param [options.startTime] - The scene time to start playing the animations. When this is undefined, the animations starts at the next frame. * @param [options.delay = 0.0] - The delay, in seconds, from startTime to start playing. @@ -34066,28 +34214,28 @@ export class ModelAnimationCollection { }): ModelAnimation[]; /** * Removes an animation from the collection. - *

- * This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync. - *

- *

- * An animation can also be implicitly removed from the collection by setting {@link ModelAnimation#removeOnStop} to - * true. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed. - *

+

+ This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync. +

+

+ An animation can also be implicitly removed from the collection by setting {@link ModelAnimation#removeOnStop} to + true. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed. +

* @example * var a = model.activeAnimations.add({ - * name : 'animation name' - * }); - * model.activeAnimations.remove(a); // Returns true + name : 'animation name' + }); + model.activeAnimations.remove(a); // Returns true * @param animation - The animation to remove. * @returns true if the animation was removed; false if the animation was not found in the collection. */ remove(animation: ModelAnimation): boolean; /** * Removes all animations from the collection. - *

- * This raises the {@link ModelAnimationCollection#animationRemoved} event for each - * animation so, for example, a UI can stay in sync. - *

+

+ This raises the {@link ModelAnimationCollection#animationRemoved} event for each + animation so, for example, a UI can stay in sync. +

*/ removeAll(): void; /** @@ -34098,16 +34246,16 @@ export class ModelAnimationCollection { contains(animation: ModelAnimation): boolean; /** * Returns the animation in the collection at the specified index. Indices are zero-based - * and increase as animations are added. Removing an animation shifts all animations after - * it to the left, changing their indices. This function is commonly used to iterate over - * all the animations in the collection. + and increase as animations are added. Removing an animation shifts all animations after + it to the left, changing their indices. This function is commonly used to iterate over + all the animations in the collection. * @example * // Output the names of all the animations in the collection. - * var animations = model.activeAnimations; - * var length = animations.length; - * for (var i = 0; i < length; ++i) { - * console.log(animations.get(i).name); - * } + var animations = model.activeAnimations; + var length = animations.length; + for (var i = 0; i < length; ++i) { + console.log(animations.get(i).name); + } * @param index - The zero-based index of the animation. * @returns The animation at the specified index. */ @@ -34134,12 +34282,12 @@ export enum ModelAnimationLoop { /** * A model's material with modifiable parameters. A glTF material - * contains parameters defined by the material's technique with values - * defined by the technique and potentially overridden by the material. - * This class allows changing these values at runtime. - *

- * Use {@link Model#getMaterial} to create an instance. - *

+contains parameters defined by the material's technique with values +defined by the technique and potentially overridden by the material. +This class allows changing these values at runtime. +

+Use {@link Model#getMaterial} to create an instance. +

*/ export class ModelMaterial { constructor(); @@ -34153,19 +34301,19 @@ export class ModelMaterial { readonly id: string; /** * Assigns a value to a material parameter. The type for value - * depends on the glTF type of the parameter. It will be a floating-point - * number, Cartesian, or matrix. + depends on the glTF type of the parameter. It will be a floating-point + number, Cartesian, or matrix. * @example * material.setValue('diffuse', new Cesium.Cartesian4(1.0, 0.0, 0.0, 1.0)); // vec4 - * material.setValue('shininess', 256.0); // scalar + material.setValue('shininess', 256.0); // scalar * @param name - The name of the parameter. * @param [value] - The value to assign to the parameter. */ setValue(name: string, value?: any): void; /** * Returns the value of the parameter with the given name. The type of the - * returned object depends on the glTF type of the parameter. It will be a floating-point - * number, Cartesian, or matrix. + returned object depends on the glTF type of the parameter. It will be a floating-point + number, Cartesian, or matrix. * @param name - The name of the parameter. * @returns The value of the parameter or undefined if the parameter does not exist. */ @@ -34174,9 +34322,9 @@ export class ModelMaterial { /** * A model's mesh and its materials. - *

- * Use {@link Model#getMesh} to create an instance. - *

+

+Use {@link Model#getMesh} to create an instance. +

*/ export class ModelMesh { constructor(); @@ -34190,22 +34338,22 @@ export class ModelMesh { readonly id: string; /** * An array of {@link ModelMaterial} instances indexed by the mesh's - * primitive indices. + primitive indices. */ readonly materials: ModelMaterial[]; } /** * A model node with a transform for user-defined animations. A glTF asset can - * contain animations that target a node's transform. This class allows - * changing a node's transform externally so animation can be driven by another - * source, not just an animation in the glTF asset. - *

- * Use {@link Model#getNode} to create an instance. - *

+contain animations that target a node's transform. This class allows +changing a node's transform externally so animation can be driven by another +source, not just an animation in the glTF asset. +

+Use {@link Model#getNode} to create an instance. +

* @example * var node = model.getNode('LOD3sp'); - * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix); +node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix); */ export class ModelNode { constructor(); @@ -34223,16 +34371,16 @@ export class ModelNode { show: boolean; /** * The node's 4x4 matrix transform from its local coordinates to - * its parent's. - *

- * For changes to take effect, this property must be assigned to; - * setting individual elements of the matrix will not work. - *

+ its parent's. +

+ For changes to take effect, this property must be assigned to; + setting individual elements of the matrix will not work. +

*/ matrix: Matrix4; /** * Gets the node's original 4x4 matrix transform from its local coordinates to - * its parent's, without any node transformations or articulations applied. + its parent's, without any node transformations or articulations applied. */ originalMatrix: Matrix4; } @@ -34272,19 +34420,19 @@ export class Moon { readonly ellipsoid: Ellipsoid; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * moon = moon && moon.destroy(); */ @@ -34333,13 +34481,13 @@ export namespace OpenStreetMapImageryProvider { /** * An imagery provider that provides tiled imagery hosted by OpenStreetMap - * or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run - * servers, so you must conform to their - * {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}. +or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run +servers, so you must conform to their +{@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}. * @example * var osm = new Cesium.OpenStreetMapImageryProvider({ - * url : 'https://a.tile.openstreetmap.org/' - * }); + url : 'https://a.tile.openstreetmap.org/' +}); * @param options - Object describing initialization options */ export class OpenStreetMapImageryProvider extends UrlTemplateImageryProvider { @@ -34456,11 +34604,11 @@ export class ParticleBurst { /** *

- * An object that initializes a {@link Particle} from a {@link ParticleSystem}. - *

- *

- * This type describes an interface and is not intended to be instantiated directly. - *

+An object that initializes a {@link Particle} from a {@link ParticleSystem}. +

+

+This type describes an interface and is not intended to be instantiated directly. +

*/ export class ParticleEmitter { constructor(); @@ -34633,19 +34781,19 @@ export class ParticleSystem { isComplete: boolean; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. */ destroy(): void; } @@ -34653,14 +34801,14 @@ export class ParticleSystem { export namespace ParticleSystem { /** * A function used to modify attributes of the particle at each time step. This can include force modifications, - * color, sizing, etc. + color, sizing, etc. * @example * function applyGravity(particle, dt) { - * var position = particle.position; - * var gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3()); - * Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector); - * particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity); - * } + var position = particle.position; + var gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3()); + Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector); + particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity); + } * @param particle - The particle being updated. * @param dt - The time in seconds since the last update. */ @@ -34669,51 +34817,51 @@ export namespace ParticleSystem { /** * An appearance for {@link GeometryInstance} instances with color attributes. - * This allows several geometry instances, each with a different color, to - * be drawn with the same {@link Primitive} as shown in the second example below. +This allows several geometry instances, each with a different color, to +be drawn with the same {@link Primitive} as shown in the second example below. * @example * // A solid white line segment - * var primitive = new Cesium.Primitive({ - * geometryInstances : new Cesium.GeometryInstance({ - * geometry : new Cesium.SimplePolylineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * 0.0, 0.0, - * 5.0, 0.0 - * ]) - * }), - * attributes : { - * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0)) - * } - * }), - * appearance : new Cesium.PerInstanceColorAppearance({ - * flat : true, - * translucent : false - * }) - * }); - * - * // Two rectangles in a primitive, each with a different color - * var instance = new Cesium.GeometryInstance({ - * geometry : new Cesium.RectangleGeometry({ - * rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0) - * }), - * attributes : { - * color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5) - * } - * }); - * - * var anotherInstance = new Cesium.GeometryInstance({ - * geometry : new Cesium.RectangleGeometry({ - * rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0) - * }), - * attributes : { - * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5) - * } - * }); - * - * var rectanglePrimitive = new Cesium.Primitive({ - * geometryInstances : [instance, anotherInstance], - * appearance : new Cesium.PerInstanceColorAppearance() - * }); +var primitive = new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.SimplePolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0 + ]) + }), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0)) + } + }), + appearance : new Cesium.PerInstanceColorAppearance({ + flat : true, + translucent : false + }) +}); + +// Two rectangles in a primitive, each with a different color +var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0) + }), + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5) + } +}); + +var anotherInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0) + }), + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5) + } +}); + +var rectanglePrimitive = new Cesium.Primitive({ + geometryInstances : [instance, anotherInstance], + appearance : new Cesium.PerInstanceColorAppearance() +}); * @param [options] - Object with the following properties: * @param [options.flat = false] - When true, flat shading is used in the fragment shader, which means lighting is not taking into account. * @param [options.faceForward = !options.closed] - When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. @@ -34735,12 +34883,12 @@ export class PerInstanceColorAppearance { }); /** * This property is part of the {@link Appearance} interface, but is not - * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used. + used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used. */ material: Material; /** * When true, the geometry is expected to appear translucent so - * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled. + {@link PerInstanceColorAppearance#renderState} has alpha blending enabled. */ translucent: boolean; /** @@ -34753,53 +34901,53 @@ export class PerInstanceColorAppearance { readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. - *

- * The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance} - * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent} - * and {@link PerInstanceColorAppearance#closed}. - *

+

+ The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance} + instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent} + and {@link PerInstanceColorAppearance#closed}. +

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so - * {@link PerInstanceColorAppearance#renderState} has backface culling enabled. - * If the viewer enters the geometry, it will not be visible. + {@link PerInstanceColorAppearance#renderState} has backface culling enabled. + If the viewer enters the geometry, it will not be visible. */ readonly closed: boolean; /** * The {@link VertexFormat} that this appearance instance is compatible with. - * A geometry can have more vertex attributes and still be compatible - at a - * potential performance cost - but it can't have less. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * When true, flat shading is used in the fragment shader, - * which means lighting is not taking into account. + which means lighting is not taking into account. */ readonly flat: boolean; /** * When true, the fragment shader flips the surface normal - * as needed to ensure that the normal faces the viewer to avoid - * dark spots. This is useful when both sides of a geometry should be - * shaded like {@link WallGeometry}. + as needed to ensure that the normal faces the viewer to avoid + dark spots. This is useful when both sides of a geometry should be + shaded like {@link WallGeometry}. */ readonly faceForward: boolean; /** * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances - * are compatible with. This requires only position and normal - * attributes. + are compatible with. This requires only position and normal + attributes. */ static readonly VERTEX_FORMAT: VertexFormat; /** * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances - * are compatible with when {@link PerInstanceColorAppearance#flat} is true. - * This requires only a position attribute. + are compatible with when {@link PerInstanceColorAppearance#flat} is true. + This requires only a position attribute. */ static readonly FLAT_VERTEX_FORMAT: VertexFormat; /** * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance}, - * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat}, - * and {@link PerInstanceColorAppearance#faceForward}. + this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat}, + and {@link PerInstanceColorAppearance#faceForward}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; @@ -34810,8 +34958,8 @@ export class PerInstanceColorAppearance { isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, - * it can contain a subset of render state properties identical to the render state - * created in the context. + it can contain a subset of render state properties identical to the render state + created in the context. * @returns The render state. */ getRenderState(): any; @@ -34819,7 +34967,7 @@ export class PerInstanceColorAppearance { /** * Options for performing point attenuation based on geometric error when rendering - * point clouds using 3D Tiles. +point clouds using 3D Tiles. * @param [options] - Object with the following properties: * @param [options.attenuation = false] - Perform point attenuation based on geometric error. * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error. @@ -34857,14 +35005,14 @@ export class PointCloudShading { maximumAttenuation: number; /** * Average base resolution for the dataset in meters. - * Used in place of geometric error when geometric error is 0. - * If undefined, an approximation will be computed for each tile that has geometric error of 0. + Used in place of geometric error when geometric error is 0. + If undefined, an approximation will be computed for each tile that has geometric error of 0. */ baseResolution: number; /** * Use eye dome lighting when drawing with point attenuation - * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0, - * otherwise eye dome lighting is ignored. + Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0, + otherwise eye dome lighting is ignored. */ eyeDomeLighting: boolean; /** @@ -34877,7 +35025,7 @@ export class PointCloudShading { eyeDomeLightingRadius: number; /** * Determines whether back-facing points are hidden. - * This option works only if data has normals included. + This option works only if data has normals included. */ backFaceCulling: boolean; /** @@ -34894,14 +35042,14 @@ export class PointCloudShading { /** * A graphical point positioned in the 3D scene, that is created - * and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial - * properties are set by calling {@link PointPrimitiveCollection#add}. +and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial +properties are set by calling {@link PointPrimitiveCollection#add}. */ export class PointPrimitive { constructor(); /** * Determines if this point will be shown. Use this to hide or show a point, instead - * of removing it and re-adding it to the collection. + of removing it and re-adding it to the collection. */ show: boolean; /** @@ -34910,41 +35058,41 @@ export class PointPrimitive { position: Cartesian3; /** * Gets or sets near and far scaling properties of a point based on the point's distance from the camera. - * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale - * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined, - * scaleByDistance will be disabled. + A point's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the point's scale remains clamped to the nearest bound. This scale + multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined, + scaleByDistance will be disabled. * @example * // Example 1. - * // Set a pointPrimitive's scaleByDistance to scale to 15 when the - * // camera is 1500 meters from the pointPrimitive and disappear as - * // the camera distance approaches 8.0e6 meters. - * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0); + // Set a pointPrimitive's scaleByDistance to scale to 15 when the + // camera is 1500 meters from the pointPrimitive and disappear as + // the camera distance approaches 8.0e6 meters. + p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0); * @example * // Example 2. - * // disable scaling by distance - * p.scaleByDistance = undefined; + // disable scaling by distance + p.scaleByDistance = undefined; */ scaleByDistance: NearFarScalar; /** * Gets or sets near and far translucency properties of a point based on the point's distance from the camera. - * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and - * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds - * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. - * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined, - * translucencyByDistance will be disabled. + A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined, + translucencyByDistance will be disabled. * @example * // Example 1. - * // Set a point's translucency to 1.0 when the - * // camera is 1500 meters from the point and disappear as - * // the camera distance approaches 8.0e6 meters. - * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); + // Set a point's translucency to 1.0 when the + // camera is 1500 meters from the point and disappear as + // the camera distance approaches 8.0e6 meters. + p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); * @example * // Example 2. - * // disable translucency by distance - * p.translucencyByDistance = undefined; + // disable translucency by distance + p.translucencyByDistance = undefined; */ translucencyByDistance: NearFarScalar; /** @@ -34953,15 +35101,15 @@ export class PointPrimitive { pixelSize: number; /** * Gets or sets the inner color of the point. - * The red, green, blue, and alpha values are indicated by value's red, green, - * blue, and alpha properties as shown in Example 1. These components range from 0.0 - * (no intensity) to 1.0 (full intensity). + The red, green, blue, and alpha values are indicated by value's red, green, + blue, and alpha properties as shown in Example 1. These components range from 0.0 + (no intensity) to 1.0 (full intensity). * @example * // Example 1. Assign yellow. - * p.color = Cesium.Color.YELLOW; + p.color = Cesium.Color.YELLOW; * @example * // Example 2. Make a pointPrimitive 50% translucent. - * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5); + p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5); */ color: Color; /** @@ -34970,7 +35118,7 @@ export class PointPrimitive { outlineColor: Color; /** * Gets or sets the outline width in pixels. This width adds to pixelSize, - * increasing the total size of the point. + increasing the total size of the point. */ outlineWidth: number; /** @@ -34979,7 +35127,7 @@ export class PointPrimitive { distanceDisplayCondition: DistanceDisplayCondition; /** * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. - * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. */ disableDepthTestDistance: number; /** @@ -34988,8 +35136,8 @@ export class PointPrimitive { id: any; /** * Computes the screen-space position of the point's origin. - * The screen space origin is the top, left corner of the canvas; x increases from - * left to right, and y increases from top to bottom. + The screen space origin is the top, left corner of the canvas; x increases from + left to right, and y increases from top to bottom. * @example * console.log(p.computeScreenSpacePosition(scene).toString()); * @param scene - The scene. @@ -34999,7 +35147,7 @@ export class PointPrimitive { computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; /** * Determines if this point equals another point. Points are equal if all their properties - * are equal. Points in different collections can be equal. + are equal. Points in different collections can be equal. * @param other - The point to compare for equality. * @returns true if the points are equal; otherwise, false. */ @@ -35008,26 +35156,26 @@ export class PointPrimitive { /** * A renderable collection of points. - *

- * Points are added and removed from the collection using {@link PointPrimitiveCollection#add} - * and {@link PointPrimitiveCollection#remove}. +

+Points are added and removed from the collection using {@link PointPrimitiveCollection#add} +and {@link PointPrimitiveCollection#remove}. * @example * // Create a pointPrimitive collection with two points - * var points = scene.primitives.add(new Cesium.PointPrimitiveCollection()); - * points.add({ - * position : new Cesium.Cartesian3(1.0, 2.0, 3.0), - * color : Cesium.Color.YELLOW - * }); - * points.add({ - * position : new Cesium.Cartesian3(4.0, 5.0, 6.0), - * color : Cesium.Color.CYAN - * }); +var points = scene.primitives.add(new Cesium.PointPrimitiveCollection()); +points.add({ + position : new Cesium.Cartesian3(1.0, 2.0, 3.0), + color : Cesium.Color.YELLOW +}); +points.add({ + position : new Cesium.Cartesian3(4.0, 5.0, 6.0), + color : Cesium.Color.CYAN +}); * @param [options] - Object with the following properties: * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default - * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent, - * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. +is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent, +setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. * @param [options.show = true] - Determines if the primitives in the collection will be shown. */ export class PointPrimitiveCollection { @@ -35043,69 +35191,69 @@ export class PointPrimitiveCollection { show: boolean; /** * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates. - * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates. - * Local reference frames can be used by providing a different transformation matrix, like that returned - * by {@link Transforms.eastNorthUpToFixedFrame}. + When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. * @example * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); - * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); - * pointPrimitives.add({ - * color : Cesium.Color.ORANGE, - * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center - * }); - * pointPrimitives.add({ - * color : Cesium.Color.YELLOW, - * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east - * }); - * pointPrimitives.add({ - * color : Cesium.Color.GREEN, - * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north - * }); - * pointPrimitives.add({ - * color : Cesium.Color.CYAN, - * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up - * }); + pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); + pointPrimitives.add({ + color : Cesium.Color.ORANGE, + position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center + }); + pointPrimitives.add({ + color : Cesium.Color.YELLOW, + position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east + }); + pointPrimitives.add({ + color : Cesium.Color.GREEN, + position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north + }); + pointPrimitives.add({ + color : Cesium.Color.CYAN, + position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up + }); */ modelMatrix: Matrix4; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the primitive. - *

+

+ Draws the bounding sphere for each draw command in the primitive. +

*/ debugShowBoundingVolume: boolean; /** * The point blending option. The default is used for rendering both opaque and translucent points. - * However, if either all of the points are completely opaque or all are completely translucent, - * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve - * performance by up to 2x. + However, if either all of the points are completely opaque or all are completely translucent, + setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve + performance by up to 2x. */ blendOption: BlendOption; /** * Returns the number of points in this collection. This is commonly used with - * {@link PointPrimitiveCollection#get} to iterate over all the points - * in the collection. + {@link PointPrimitiveCollection#get} to iterate over all the points + in the collection. */ length: number; /** * Creates and adds a point with the specified initial properties to the collection. - * The added point is returned so it can be modified or removed from the collection later. + The added point is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a point, specifying all the default values. - * var p = pointPrimitives.add({ - * show : true, - * position : Cesium.Cartesian3.ZERO, - * pixelSize : 10.0, - * color : Cesium.Color.WHITE, - * outlineColor : Cesium.Color.TRANSPARENT, - * outlineWidth : 0.0, - * id : undefined - * }); + var p = pointPrimitives.add({ + show : true, + position : Cesium.Cartesian3.ZERO, + pixelSize : 10.0, + color : Cesium.Color.WHITE, + outlineColor : Cesium.Color.TRANSPARENT, + outlineWidth : 0.0, + id : undefined + }); * @example * // Example 2: Specify only the point's cartographic position. - * var p = pointPrimitives.add({ - * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) - * }); + var p = pointPrimitives.add({ + position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) + }); * @param [options] - A template describing the point's properties as shown in Example 1. * @returns The point that was added to the collection. */ @@ -35114,7 +35262,7 @@ export class PointPrimitiveCollection { * Removes a point from the collection. * @example * var p = pointPrimitives.add(...); - * pointPrimitives.remove(p); // Returns true + pointPrimitives.remove(p); // Returns true * @param pointPrimitive - The point to remove. * @returns true if the point was removed; false if the point was not found in the collection. */ @@ -35123,8 +35271,8 @@ export class PointPrimitiveCollection { * Removes all points from the collection. * @example * pointPrimitives.add(...); - * pointPrimitives.add(...); - * pointPrimitives.removeAll(); + pointPrimitives.add(...); + pointPrimitives.removeAll(); */ removeAll(): void; /** @@ -35135,36 +35283,36 @@ export class PointPrimitiveCollection { contains(pointPrimitive?: PointPrimitive): boolean; /** * Returns the point in the collection at the specified index. Indices are zero-based - * and increase as points are added. Removing a point shifts all points after - * it to the left, changing their indices. This function is commonly used with - * {@link PointPrimitiveCollection#length} to iterate over all the points - * in the collection. + and increase as points are added. Removing a point shifts all points after + it to the left, changing their indices. This function is commonly used with + {@link PointPrimitiveCollection#length} to iterate over all the points + in the collection. * @example * // Toggle the show property of every point in the collection - * var len = pointPrimitives.length; - * for (var i = 0; i < len; ++i) { - * var p = pointPrimitives.get(i); - * p.show = !p.show; - * } + var len = pointPrimitives.length; + for (var i = 0; i < len; ++i) { + var p = pointPrimitives.get(i); + p.show = !p.show; + } * @param index - The zero-based index of the point. * @returns The point at the specified index. */ get(index: number): PointPrimitive; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * pointPrimitives = pointPrimitives && pointPrimitives.destroy(); */ @@ -35195,22 +35343,22 @@ export class Polyline { }, polylineCollection: PolylineCollection); /** * Determines if this polyline will be shown. Use this to hide or show a polyline, instead - * of removing it and re-adding it to the collection. + of removing it and re-adding it to the collection. */ show: boolean; /** * Gets or sets the positions of the polyline. * @example * polyline.positions = Cesium.Cartesian3.fromDegreesArray([ - * 0.0, 0.0, - * 10.0, 0.0, - * 0.0, 20.0 - * ]); + 0.0, 0.0, + 10.0, 0.0, + 0.0, 20.0 + ]); */ positions: Cartesian3[]; /** * Gets or sets the surface appearance of the polyline. This can be one of several built-in {@link Material} objects or a custom material, scripted with - * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. + {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. */ material: Material; /** @@ -35233,34 +35381,34 @@ export class Polyline { /** * A renderable collection of polylines. - *

- *
- *
- * Example polylines - *
- *

- * Polylines are added and removed from the collection using {@link PolylineCollection#add} - * and {@link PolylineCollection#remove}. +

+
+
+Example polylines +
+

+Polylines are added and removed from the collection using {@link PolylineCollection#add} +and {@link PolylineCollection#remove}. * @example * // Create a polyline collection with two polylines - * var polylines = new Cesium.PolylineCollection(); - * polylines.add({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * -75.10, 39.57, - * -77.02, 38.53, - * -80.50, 35.14, - * -80.12, 25.46]), - * width : 2 - * }); - * - * polylines.add({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * -73.10, 37.57, - * -75.02, 36.53, - * -78.50, 33.14, - * -78.12, 23.46]), - * width : 4 - * }); +var polylines = new Cesium.PolylineCollection(); +polylines.add({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -75.10, 39.57, + -77.02, 38.53, + -80.50, 35.14, + -80.12, 25.46]), + width : 2 +}); + +polylines.add({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -73.10, 37.57, + -75.02, 36.53, + -78.50, 33.14, + -78.12, 23.46]), + width : 4 +}); * @param [options] - Object with the following properties: * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. @@ -35278,36 +35426,36 @@ export class PolylineCollection { show: boolean; /** * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates. - * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates. - * Local reference frames can be used by providing a different transformation matrix, like that returned - * by {@link Transforms.eastNorthUpToFixedFrame}. + When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. */ modelMatrix: Matrix4; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the primitive. - *

+

+ Draws the bounding sphere for each draw command in the primitive. +

*/ debugShowBoundingVolume: boolean; /** * Returns the number of polylines in this collection. This is commonly used with - * {@link PolylineCollection#get} to iterate over all the polylines - * in the collection. + {@link PolylineCollection#get} to iterate over all the polylines + in the collection. */ length: number; /** * Creates and adds a polyline with the specified initial properties to the collection. - * The added polyline is returned so it can be modified or removed from the collection later. + The added polyline is returned so it can be modified or removed from the collection later. * @example * // Example 1: Add a polyline, specifying all the default values. - * var p = polylines.add({ - * show : true, - * positions : ellipsoid.cartographicArrayToCartesianArray([ + var p = polylines.add({ + show : true, + positions : ellipsoid.cartographicArrayToCartesianArray([ * Cesium.Cartographic.fromDegrees(-75.10, 39.57), * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]), - * width : 1 - * }); + width : 1 + }); * @param [options] - A template describing the polyline's properties as shown in Example 1. * @returns The polyline that was added to the collection. */ @@ -35316,7 +35464,7 @@ export class PolylineCollection { * Removes a polyline from the collection. * @example * var p = polylines.add(...); - * polylines.remove(p); // Returns true + polylines.remove(p); // Returns true * @param polyline - The polyline to remove. * @returns true if the polyline was removed; false if the polyline was not found in the collection. */ @@ -35325,8 +35473,8 @@ export class PolylineCollection { * Removes all polylines from the collection. * @example * polylines.add(...); - * polylines.add(...); - * polylines.removeAll(); + polylines.add(...); + polylines.removeAll(); */ removeAll(): void; /** @@ -35337,45 +35485,45 @@ export class PolylineCollection { contains(polyline: Polyline): boolean; /** * Returns the polyline in the collection at the specified index. Indices are zero-based - * and increase as polylines are added. Removing a polyline shifts all polylines after - * it to the left, changing their indices. This function is commonly used with - * {@link PolylineCollection#length} to iterate over all the polylines - * in the collection. + and increase as polylines are added. Removing a polyline shifts all polylines after + it to the left, changing their indices. This function is commonly used with + {@link PolylineCollection#length} to iterate over all the polylines + in the collection. * @example * // Toggle the show property of every polyline in the collection - * var len = polylines.length; - * for (var i = 0; i < len; ++i) { - * var p = polylines.get(i); - * p.show = !p.show; - * } + var len = polylines.length; + for (var i = 0; i < len; ++i) { + var p = polylines.get(i); + p.show = !p.show; + } * @param index - The zero-based index of the polyline. * @returns The polyline at the specified index. */ get(index: number): Polyline; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * polylines = polylines && polylines.destroy(); */ @@ -35384,29 +35532,29 @@ export class PolylineCollection { /** * An appearance for {@link GeometryInstance} instances with color attributes and - * {@link PolylineGeometry} or {@link GroundPolylineGeometry}. - * This allows several geometry instances, each with a different color, to - * be drawn with the same {@link Primitive}. +{@link PolylineGeometry} or {@link GroundPolylineGeometry}. +This allows several geometry instances, each with a different color, to +be drawn with the same {@link Primitive}. * @example * // A solid white line segment - * var primitive = new Cesium.Primitive({ - * geometryInstances : new Cesium.GeometryInstance({ - * geometry : new Cesium.PolylineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * 0.0, 0.0, - * 5.0, 0.0 - * ]), - * width : 10.0, - * vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT - * }), - * attributes : { - * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0)) - * } - * }), - * appearance : new Cesium.PolylineColorAppearance({ - * translucent : false - * }) - * }); +var primitive = new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.PolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0 + ]), + width : 10.0, + vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT + }), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0)) + } + }), + appearance : new Cesium.PolylineColorAppearance({ + translucent : false + }) +}); * @param [options] - Object with the following properties: * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. @@ -35422,12 +35570,12 @@ export class PolylineColorAppearance { }); /** * This property is part of the {@link Appearance} interface, but is not - * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used. + used by {@link PolylineColorAppearance} since a fully custom fragment shader is used. */ material: Material; /** * When true, the geometry is expected to appear translucent so - * {@link PolylineColorAppearance#renderState} has alpha blending enabled. + {@link PolylineColorAppearance#renderState} has alpha blending enabled. */ translucent: boolean; /** @@ -35440,27 +35588,27 @@ export class PolylineColorAppearance { readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. - *

- * The render state can be explicitly defined when constructing a {@link PolylineColorAppearance} - * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}. - *

+

+ The render state can be explicitly defined when constructing a {@link PolylineColorAppearance} + instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}. +

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so - * {@link PolylineColorAppearance#renderState} has backface culling enabled. - * This is always false for PolylineColorAppearance. + {@link PolylineColorAppearance#renderState} has backface culling enabled. + This is always false for PolylineColorAppearance. */ readonly closed: boolean; /** * The {@link VertexFormat} that this appearance instance is compatible with. - * A geometry can have more vertex attributes and still be compatible - at a - * potential performance cost - but it can't have less. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances - * are compatible with. This requires only a position attribute. + are compatible with. This requires only a position attribute. */ static readonly VERTEX_FORMAT: VertexFormat; /** @@ -35475,8 +35623,8 @@ export class PolylineColorAppearance { isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, - * it can contain a subset of render state properties identical to the render state - * created in the context. + it can contain a subset of render state properties identical to the render state + created in the context. * @returns The render state. */ getRenderState(): any; @@ -35486,20 +35634,20 @@ export class PolylineColorAppearance { * An appearance for {@link PolylineGeometry} that supports shading with materials. * @example * var primitive = new Cesium.Primitive({ - * geometryInstances : new Cesium.GeometryInstance({ - * geometry : new Cesium.PolylineGeometry({ - * positions : Cesium.Cartesian3.fromDegreesArray([ - * 0.0, 0.0, - * 5.0, 0.0 - * ]), - * width : 10.0, - * vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT - * }) - * }), - * appearance : new Cesium.PolylineMaterialAppearance({ - * material : Cesium.Material.fromType('Color') - * }) - * }); + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.PolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0 + ]), + width : 10.0, + vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT + }) + }), + appearance : new Cesium.PolylineMaterialAppearance({ + material : Cesium.Material.fromType('Color') + }) +}); * @param [options] - Object with the following properties: * @param [options.translucent = true] - When true, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled. * @param [options.material = Material.ColorType] - The material used to determine the fragment color. @@ -35517,12 +35665,12 @@ export class PolylineMaterialAppearance { }); /** * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance} - * properties, this is not read-only, so an appearance's material can change on the fly. + properties, this is not read-only, so an appearance's material can change on the fly. */ material: Material; /** * When true, the geometry is expected to appear translucent so - * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled. + {@link PolylineMaterialAppearance#renderState} has alpha blending enabled. */ translucent: boolean; /** @@ -35535,33 +35683,33 @@ export class PolylineMaterialAppearance { readonly fragmentShaderSource: string; /** * The WebGL fixed-function state to use when rendering the geometry. - *

- * The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance} - * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent} - * and {@link PolylineMaterialAppearance#closed}. - *

+

+ The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance} + instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent} + and {@link PolylineMaterialAppearance#closed}. +

*/ readonly renderState: any; /** * When true, the geometry is expected to be closed so - * {@link PolylineMaterialAppearance#renderState} has backface culling enabled. - * This is always false for PolylineMaterialAppearance. + {@link PolylineMaterialAppearance#renderState} has backface culling enabled. + This is always false for PolylineMaterialAppearance. */ readonly closed: boolean; /** * The {@link VertexFormat} that this appearance instance is compatible with. - * A geometry can have more vertex attributes and still be compatible - at a - * potential performance cost - but it can't have less. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. */ readonly vertexFormat: VertexFormat; /** * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances - * are compatible with. This requires position and st attributes. + are compatible with. This requires position and st attributes. */ static readonly VERTEX_FORMAT: VertexFormat; /** * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance}, - * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}. + this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}. * @returns The full GLSL fragment shader source. */ getFragmentShaderSource(): string; @@ -35572,8 +35720,8 @@ export class PolylineMaterialAppearance { isTranslucent(): boolean; /** * Creates a render state. This is not the final render state instance; instead, - * it can contain a subset of render state properties identical to the render state - * created in the context. + it can contain a subset of render state properties identical to the render state + created in the context. * @returns The render state. */ getRenderState(): any; @@ -35583,49 +35731,49 @@ export class PolylineMaterialAppearance { * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage. * @example * // Simple stage to change the color - * var fs = - * 'uniform sampler2D colorTexture;\n' + - * 'varying vec2 v_textureCoordinates;\n' + - * 'uniform float scale;\n' + - * 'uniform vec3 offset;\n' + - * 'void main() {\n' + - * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' + - * ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' + - * '}\n'; - * scene.postProcessStages.add(new Cesium.PostProcessStage({ - * fragmentShader : fs, - * uniforms : { - * scale : 1.1, - * offset : function() { - * return new Cesium.Cartesian3(0.1, 0.2, 0.3); - * } - * } - * })); +var fs = + 'uniform sampler2D colorTexture;\n' + + 'varying vec2 v_textureCoordinates;\n' + + 'uniform float scale;\n' + + 'uniform vec3 offset;\n' + + 'void main() {\n' + + ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' + + ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' + + '}\n'; +scene.postProcessStages.add(new Cesium.PostProcessStage({ + fragmentShader : fs, + uniforms : { + scale : 1.1, + offset : function() { + return new Cesium.Cartesian3(0.1, 0.2, 0.3); + } + } +})); * @example * // Simple stage to change the color of what is selected. - * // If czm_selected returns true, the current fragment belongs to geometry in the selected array. - * var fs = - * 'uniform sampler2D colorTexture;\n' + - * 'varying vec2 v_textureCoordinates;\n' + - * 'uniform vec4 highlight;\n' + - * 'void main() {\n' + - * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' + - * ' if (czm_selected()) {\n' + - * ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' + - * ' gl_FragColor = vec4(highlighted, 1.0);\n' + - * ' } else { \n' + - * ' gl_FragColor = color;\n' + - * ' }\n' + - * '}\n'; - * var stage = scene.postProcessStages.add(new Cesium.PostProcessStage({ - * fragmentShader : fs, - * uniforms : { - * highlight : function() { - * return new Cesium.Color(1.0, 0.0, 0.0, 0.5); - * } - * } - * })); - * stage.selected = [cesium3DTileFeature]; +// If czm_selected returns true, the current fragment belongs to geometry in the selected array. +var fs = + 'uniform sampler2D colorTexture;\n' + + 'varying vec2 v_textureCoordinates;\n' + + 'uniform vec4 highlight;\n' + + 'void main() {\n' + + ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' + + ' if (czm_selected()) {\n' + + ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' + + ' gl_FragColor = vec4(highlighted, 1.0);\n' + + ' } else { \n' + + ' gl_FragColor = color;\n' + + ' }\n' + + '}\n'; +var stage = scene.postProcessStages.add(new Cesium.PostProcessStage({ + fragmentShader : fs, + uniforms : { + highlight : function() { + return new Cesium.Color(1.0, 0.0, 0.0, 0.5); + } + } +})); +stage.selected = [cesium3DTileFeature]; * @param options - An object with the following properties: * @param options.fragmentShader - The fragment shader to use. The default sampler2D uniforms are colorTexture and depthTexture. The color texture is the output of rendering the scene or the previous stage. The depth texture is the output from rendering the scene. The shader should contain one or both uniforms. There is also a vec2 varying named v_textureCoordinates that can be used to sample the textures. * @param [options.uniforms] - An object whose properties will be used to set the shaders uniforms. The properties can be constant values or a function. A constant value can also be a URI, data URI, or HTML element to use as a texture. @@ -35657,8 +35805,8 @@ export class PostProcessStage { enabled: boolean; /** * Determines if this post-process stage is ready to be executed. A stage is only executed when both ready - * and {@link PostProcessStage#enabled} are true. A stage will not be ready while it is waiting on textures - * to load. + and {@link PostProcessStage#enabled} are true. A stage will not be ready while it is waiting on textures + to load. */ readonly ready: boolean; /** @@ -35667,29 +35815,29 @@ export class PostProcessStage { readonly name: string; /** * The fragment shader to use when execute this post-process stage. - *

- * The shader must contain a sampler uniform declaration for colorTexture, depthTexture, - * or both. - *

- *

- * The shader must contain a vec2 varying declaration for v_textureCoordinates for sampling - * the texture uniforms. - *

+

+ The shader must contain a sampler uniform declaration for colorTexture, depthTexture, + or both. +

+

+ The shader must contain a vec2 varying declaration for v_textureCoordinates for sampling + the texture uniforms. +

*/ readonly fragmentShader: string; /** * An object whose properties are used to set the uniforms of the fragment shader. - *

- * The object property values can be either a constant or a function. The function will be called - * each frame before the post-process stage is executed. - *

- *

- * A constant value can also be a URI to an image, a data URI, or an HTML element that can be used as a texture, such as HTMLImageElement or HTMLCanvasElement. - *

- *

- * If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be - * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name. - *

+

+ The object property values can be either a constant or a function. The function will be called + each frame before the post-process stage is executed. +

+

+ A constant value can also be a URI to an image, a data URI, or an HTML element that can be used as a texture, such as HTMLImageElement or HTMLCanvasElement. +

+

+ If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be + the name of another stage in a composite. This will set the uniform to the output texture the stage with that name. +

*/ readonly uniforms: any; /** @@ -35722,52 +35870,52 @@ export class PostProcessStage { readonly scissorRectangle: BoundingRectangle; /** * The features selected for applying the post-process. - *

- * In the fragment shader, use czm_selected to determine whether or not to apply the post-process - * stage to that fragment. For example: - * - * if (czm_selected(v_textureCoordinates)) { - * // apply post-process stage - * } else { - * gl_FragColor = texture2D(colorTexture, v_textureCordinates); - * } - * - *

+

+ In the fragment shader, use czm_selected to determine whether or not to apply the post-process + stage to that fragment. For example: + + if (czm_selected(v_textureCoordinates)) { + // apply post-process stage + } else { + gl_FragColor = texture2D(colorTexture, v_textureCordinates); + } + +

*/ selected: any[]; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

*/ destroy(): void; } /** * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s. - *

- * The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered - * to by the previous stage in the collection. - *

- *

- * If the ambient occlusion or bloom stages are enabled, they will execute before all other stages. - *

- *

- * If the FXAA stage is enabled, it will execute after all other stages. - *

+

+The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered +to by the previous stage in the collection. +

+

+If the ambient occlusion or bloom stages are enabled, they will execute before all other stages. +

+

+If the FXAA stage is enabled, it will execute after all other stages. +

*/ export class PostProcessStageCollection { constructor(); @@ -35777,73 +35925,73 @@ export class PostProcessStageCollection { readonly ready: boolean; /** * A post-process stage for Fast Approximate Anti-aliasing. - *

- * When enabled, this stage will execute after all others. - *

+

+ When enabled, this stage will execute after all others. +

*/ readonly fxaa: PostProcessStage; /** * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture. - *

- * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the - * surface receives light and regardless of the light's position. - *

- *

- * The uniforms have the following properties: intensity, bias, lengthCap, - * stepSize, frustumLength, ambientOcclusionOnly, - * delta, sigma, and blurStepSize. - *

- *
    - *
  • intensity is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is 3.0.
  • - * - *
  • bias is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value, - * sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is 0.1.
  • - * - *
  • lengthCap is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value, - * sampling stops in the current direction. The default value is 0.26.
  • - * - *
  • stepSize is a scalar value indicating the distance to the next texel sample in the current direction. The default value is 1.95.
  • - * - *
  • frustumLength is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment. - * The default value is 1000.0.
  • - * - *
  • ambientOcclusionOnly is a boolean value. When true, only the shadows generated are written to the output. When false, the input texture is modulated - * with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is false.
  • - *
- *

- * delta, sigma, and blurStepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}. - * The blur is applied to the shadows generated from the image to make them smoother. - *

- *

- * When enabled, this stage will execute before all others. - *

+

+ Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the + surface receives light and regardless of the light's position. +

+

+ The uniforms have the following properties: intensity, bias, lengthCap, + stepSize, frustumLength, ambientOcclusionOnly, + delta, sigma, and blurStepSize. +

+
    +
  • intensity is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is 3.0.
  • + +
  • bias is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value, + sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is 0.1.
  • + +
  • lengthCap is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value, + sampling stops in the current direction. The default value is 0.26.
  • + +
  • stepSize is a scalar value indicating the distance to the next texel sample in the current direction. The default value is 1.95.
  • + +
  • frustumLength is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment. + The default value is 1000.0.
  • + +
  • ambientOcclusionOnly is a boolean value. When true, only the shadows generated are written to the output. When false, the input texture is modulated + with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is false.
  • +
+

+ delta, sigma, and blurStepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}. + The blur is applied to the shadows generated from the image to make them smoother. +

+

+ When enabled, this stage will execute before all others. +

*/ readonly ambientOcclusion: PostProcessStageComposite; /** * A post-process stage for a bloom effect. - *

- * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker. - *

- *

- * This stage has the following uniforms: contrast, brightness, glowOnly, - * delta, sigma, and stepSize. - *

- *
    - *
  • contrast is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is 128.0.
  • - * - *
  • brightness is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is - * added to the brightness. The default value is -0.3.
  • - * - *
  • glowOnly is a boolean value. When true, only the glow effect will be shown. When false, the glow will be added to the input texture. - * The default value is false. This is a debug option for viewing the effects when changing the other uniform values.
  • - *
- *

- * delta, sigma, and stepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}. - * The blur is applied to the shadows generated from the image to make them smoother. - *

- *

- * When enabled, this stage will execute before all others. - *

+

+ A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker. +

+

+ This stage has the following uniforms: contrast, brightness, glowOnly, + delta, sigma, and stepSize. +

+
    +
  • contrast is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is 128.0.
  • + +
  • brightness is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is + added to the brightness. The default value is -0.3.
  • + +
  • glowOnly is a boolean value. When true, only the glow effect will be shown. When false, the glow will be added to the input texture. + The default value is false. This is a debug option for viewing the effects when changing the other uniform values.
  • +
+

+ delta, sigma, and stepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}. + The blur is applied to the shadows generated from the image to make them smoother. +

+

+ When enabled, this stage will execute before all others. +

*/ readonly bloom: PostProcessStageComposite; /** @@ -35880,77 +36028,77 @@ export class PostProcessStageCollection { removeAll(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

*/ destroy(): void; } /** * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically. - *

- * All stages are executed in the order of the array. The input texture changes based on the value of inputPreviousStageTexture. - * If inputPreviousStageTexture is true, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. - * If inputPreviousStageTexture is false, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene - * or the output texture of the previous stage. - *

+

+All stages are executed in the order of the array. The input texture changes based on the value of inputPreviousStageTexture. +If inputPreviousStageTexture is true, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. +If inputPreviousStageTexture is false, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene +or the output texture of the previous stage. +

* @example * // Example 1: separable blur filter - * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage. - * // The input to blurYDirection is the texture rendered to by blurXDirection. - * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ - * stages : [blurXDirection, blurYDirection] - * })); +// The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage. +// The input to blurYDirection is the texture rendered to by blurXDirection. +scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ + stages : [blurXDirection, blurYDirection] +})); * @example * // Example 2: referencing the output of another post-process stage - * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ - * inputPreviousStageTexture : false, - * stages : [ - * // The same as Example 1. - * new Cesium.PostProcessStageComposite({ - * inputPreviousStageTexture : true - * stages : [blurXDirection, blurYDirection], - * name : 'blur' - * }), - * // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false - * new Cesium.PostProcessStage({ - * fragmentShader : compositeShader, - * uniforms : { - * blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to). - * } - * }) - * ] - * }); +scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ + inputPreviousStageTexture : false, + stages : [ + // The same as Example 1. + new Cesium.PostProcessStageComposite({ + inputPreviousStageTexture : true + stages : [blurXDirection, blurYDirection], + name : 'blur' + }), + // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false + new Cesium.PostProcessStage({ + fragmentShader : compositeShader, + uniforms : { + blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to). + } + }) + ] +}); * @example * // Example 3: create a uniform alias - * var uniforms = {}; - * Cesium.defineProperties(uniforms, { - * filterSize : { - * get : function() { - * return blurXDirection.uniforms.filterSize; - * }, - * set : function(value) { - * blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value; - * } - * } - * }); - * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ - * stages : [blurXDirection, blurYDirection], - * uniforms : uniforms - * })); +var uniforms = {}; +Cesium.defineProperties(uniforms, { + filterSize : { + get : function() { + return blurXDirection.uniforms.filterSize; + }, + set : function(value) { + blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value; + } + } +}); +scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ + stages : [blurXDirection, blurYDirection], + uniforms : uniforms +})); * @param options - An object with the following properties: * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order. * @param [options.inputPreviousStageTexture = true] - Whether to execute each post-process stage where the input to one stage is the output of the previous. Otherwise, the input to each contained stage is the output of the stage that executed before the composite. @@ -35982,9 +36130,9 @@ export class PostProcessStageComposite { uniforms: any; /** * All post-process stages are executed in the order of the array. The input texture changes based on the value of inputPreviousStageTexture. - * If inputPreviousStageTexture is true, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. - * If inputPreviousStageTexture is false, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene - * or the output texture of the previous stage. + If inputPreviousStageTexture is true, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. + If inputPreviousStageTexture is false, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene + or the output texture of the previous stage. */ readonly inputPreviousStageTexture: boolean; /** @@ -36003,21 +36151,21 @@ export class PostProcessStageComposite { get(index: number): PostProcessStage | PostProcessStageComposite; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

*/ destroy(): void; } @@ -36028,131 +36176,131 @@ export class PostProcessStageComposite { export namespace PostProcessStageLibrary { /** * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage. - *

- * This stage has the following uniforms: delta, sigma, and stepSize. - *

- *

- * delta and sigma are used to compute the weights of a Gaussian filter. The equation is exp((-0.5 * delta * delta) / (sigma * sigma)). - * The default value for delta is 1.0. The default value for sigma is 2.0. - * stepSize is the distance to the next texel. The default is 1.0. - *

+

+ This stage has the following uniforms: delta, sigma, and stepSize. +

+

+ delta and sigma are used to compute the weights of a Gaussian filter. The equation is exp((-0.5 * delta * delta) / (sigma * sigma)). + The default value for delta is 1.0. The default value for sigma is 2.0. + stepSize is the distance to the next texel. The default is 1.0. +

* @returns A post-process stage that applies a Gaussian blur to the input texture. */ function createBlurStage(): PostProcessStageComposite; /** * Creates a post-process stage that applies a depth of field effect. - *

- * Depth of field simulates camera focus. Objects in the scene that are in focus - * will be clear whereas objects not in focus will be blurred. - *

- *

- * This stage has the following uniforms: focalDistance, delta, sigma, and stepSize. - *

- *

- * focalDistance is the distance in meters from the camera to set the camera focus. - *

- *

- * delta, sigma, and stepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}. - * The blur is applied to the areas out of focus. - *

+

+ Depth of field simulates camera focus. Objects in the scene that are in focus + will be clear whereas objects not in focus will be blurred. +

+

+ This stage has the following uniforms: focalDistance, delta, sigma, and stepSize. +

+

+ focalDistance is the distance in meters from the camera to set the camera focus. +

+

+ delta, sigma, and stepSize are the same properties as {@link PostProcessStageLibrary#createBlurStage}. + The blur is applied to the areas out of focus. +

* @returns A post-process stage that applies a depth of field effect. */ function createDepthOfFieldStage(): PostProcessStageComposite; /** * Whether or not a depth of field stage is supported. - *

- * This stage requires the WEBGL_depth_texture extension. - *

+

+ This stage requires the WEBGL_depth_texture extension. +

* @param scene - The scene. * @returns Whether this post process stage is supported. */ function isDepthOfFieldSupported(scene: Scene): boolean; /** * Creates a post-process stage that detects edges. - *

- * Writes the color to the output texture with alpha set to 1.0 when it is on an edge. - *

- *

- * This stage has the following uniforms: color and length - *

- *
    - *
  • color is the color of the highlighted edge. The default is {@link Color#BLACK}.
  • - *
  • length is the length of the edges in pixels. The default is 0.5.
  • - *
- *

- * This stage is not supported in 2D. - *

+

+ Writes the color to the output texture with alpha set to 1.0 when it is on an edge. +

+

+ This stage has the following uniforms: color and length +

+
    +
  • color is the color of the highlighted edge. The default is {@link Color#BLACK}.
  • +
  • length is the length of the edges in pixels. The default is 0.5.
  • +
+

+ This stage is not supported in 2D. +

* @example * // multiple silhouette effects - * var yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage(); - * yellowEdge.uniforms.color = Cesium.Color.YELLOW; - * yellowEdge.selected = [feature0]; - * - * var greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage(); - * greenEdge.uniforms.color = Cesium.Color.LIME; - * greenEdge.selected = [feature1]; - * - * // draw edges around feature0 and feature1 - * postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]); + var yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage(); + yellowEdge.uniforms.color = Cesium.Color.YELLOW; + yellowEdge.selected = [feature0]; + + var greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage(); + greenEdge.uniforms.color = Cesium.Color.LIME; + greenEdge.selected = [feature1]; + + // draw edges around feature0 and feature1 + postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]); * @returns A post-process stage that applies an edge detection effect. */ function createEdgeDetectionStage(): PostProcessStageComposite; /** * Whether or not an edge detection stage is supported. - *

- * This stage requires the WEBGL_depth_texture extension. - *

+

+ This stage requires the WEBGL_depth_texture extension. +

* @param scene - The scene. * @returns Whether this post process stage is supported. */ function isEdgeDetectionSupported(scene: Scene): boolean; /** * Creates a post-process stage that applies a silhouette effect. - *

- * A silhouette effect composites the color from the edge detection pass with input color texture. - *

- *

- * This stage has the following uniforms when edgeDetectionStages is undefined: color and length - *

- *

- * color is the color of the highlighted edge. The default is {@link Color#BLACK}. - * length is the length of the edges in pixels. The default is 0.5. - *

+

+ A silhouette effect composites the color from the edge detection pass with input color texture. +

+

+ This stage has the following uniforms when edgeDetectionStages is undefined: color and length +

+

+ color is the color of the highlighted edge. The default is {@link Color#BLACK}. + length is the length of the edges in pixels. The default is 0.5. +

* @param [edgeDetectionStages] - An array of edge detection post process stages. * @returns A post-process stage that applies a silhouette effect. */ function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite; /** * Whether or not a silhouette stage is supported. - *

- * This stage requires the WEBGL_depth_texture extension. - *

+

+ This stage requires the WEBGL_depth_texture extension. +

* @param scene - The scene. * @returns Whether this post process stage is supported. */ function isSilhouetteSupported(scene: Scene): boolean; /** * Whether or not an ambient occlusion stage is supported. - *

- * This stage requires the WEBGL_depth_texture extension. - *

+

+ This stage requires the WEBGL_depth_texture extension. +

* @param scene - The scene. * @returns Whether this post process stage is supported. */ function isAmbientOcclusionSupported(scene: Scene): boolean; /** * Creates a post-process stage that renders the input texture with black and white gradations. - *

- * This stage has one uniform value, gradations, which scales the luminance of each pixel. - *

+

+ This stage has one uniform value, gradations, which scales the luminance of each pixel. +

* @returns A post-process stage that renders the input texture with black and white gradations. */ function createBlackAndWhiteStage(): PostProcessStage; /** * Creates a post-process stage that saturates the input texture. - *

- * This stage has one uniform value, brightness, which scales the saturation of each pixel. - *

+

+ This stage has one uniform value, brightness, which scales the saturation of each pixel. +

* @returns A post-process stage that saturates the input texture. */ function createBrightnessStage(): PostProcessStage; @@ -36163,20 +36311,20 @@ export namespace PostProcessStageLibrary { function createNightVisionStage(): PostProcessStage; /** * Creates a post-process stage that applies an effect simulating light flaring a camera lens. - *

- * This stage has the following uniforms: dirtTexture, starTexture, intensity, distortion, ghostDispersal, - * haloWidth, dirtAmount, and earthRadius. - *

    - *
  • dirtTexture is a texture sampled to simulate dirt on the lens.
  • - *
  • starTexture is the texture sampled for the star pattern of the flare.
  • - *
  • intensity is a scalar multiplied by the result of the lens flare. The default value is 2.0.
  • - *
  • distortion is a scalar value that affects the chromatic effect distortion. The default value is 10.0.
  • - *
  • ghostDispersal is a scalar indicating how far the halo effect is from the center of the texture. The default value is 0.4.
  • - *
  • haloWidth is a scalar representing the width of the halo from the ghost dispersal. The default value is 0.4.
  • - *
  • dirtAmount is a scalar representing the amount of dirt on the lens. The default value is 0.4.
  • - *
  • earthRadius is the maximum radius of the earth. The default value is Ellipsoid.WGS84.maximumRadius.
  • - *
- *

+

+ This stage has the following uniforms: dirtTexture, starTexture, intensity, distortion, ghostDispersal, + haloWidth, dirtAmount, and earthRadius. +

    +
  • dirtTexture is a texture sampled to simulate dirt on the lens.
  • +
  • starTexture is the texture sampled for the star pattern of the flare.
  • +
  • intensity is a scalar multiplied by the result of the lens flare. The default value is 2.0.
  • +
  • distortion is a scalar value that affects the chromatic effect distortion. The default value is 10.0.
  • +
  • ghostDispersal is a scalar indicating how far the halo effect is from the center of the texture. The default value is 0.4.
  • +
  • haloWidth is a scalar representing the width of the halo from the ghost dispersal. The default value is 0.4.
  • +
  • dirtAmount is a scalar representing the amount of dirt on the lens. The default value is 0.4.
  • +
  • earthRadius is the maximum radius of the earth. The default value is Ellipsoid.WGS84.maximumRadius.
  • +
+

* @returns A post-process stage for applying a lens flare effect. */ function createLensFlareStage(): PostProcessStage; @@ -36198,87 +36346,87 @@ export enum PostProcessStageSampleMode { /** * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance} - * as shown in example 1 below, or from an array of instances, even if the geometry is from different - * geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2. - *

- * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including - * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, - * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix - * and match most of them and add a new geometry or appearance independently of each other. - *

- *

- * Combining multiple instances into one primitive is called batching, and significantly improves performance for static data. - * Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using - * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color. - *

- *

- * {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples - * show geometry that will be created on a web worker by using the descriptions of the geometry. The third example - * shows how to create the geometry on the main thread by explicitly calling the createGeometry method. - *

+as shown in example 1 below, or from an array of instances, even if the geometry is from different +geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2. +

+A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including +{@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, +and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix +and match most of them and add a new geometry or appearance independently of each other. +

+

+Combining multiple instances into one primitive is called batching, and significantly improves performance for static data. +Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using +per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color. +

+

+{@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples +show geometry that will be created on a web worker by using the descriptions of the geometry. The third example +shows how to create the geometry on the main thread by explicitly calling the createGeometry method. +

* @example * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern - * var instance = new Cesium.GeometryInstance({ - * geometry : new Cesium.EllipseGeometry({ - * center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0), - * semiMinorAxis : 500000.0, - * semiMajorAxis : 1000000.0, - * rotation : Cesium.Math.PI_OVER_FOUR, - * vertexFormat : Cesium.VertexFormat.POSITION_AND_ST - * }), - * id : 'object returned when this instance is picked and to get/set per-instance attributes' - * }); - * scene.primitives.add(new Cesium.Primitive({ - * geometryInstances : instance, - * appearance : new Cesium.EllipsoidSurfaceAppearance({ - * material : Cesium.Material.fromType('Checkerboard') - * }) - * })); +var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.EllipseGeometry({ + center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0), + semiMinorAxis : 500000.0, + semiMajorAxis : 1000000.0, + rotation : Cesium.Math.PI_OVER_FOUR, + vertexFormat : Cesium.VertexFormat.POSITION_AND_ST + }), + id : 'object returned when this instance is picked and to get/set per-instance attributes' +}); +scene.primitives.add(new Cesium.Primitive({ + geometryInstances : instance, + appearance : new Cesium.EllipsoidSurfaceAppearance({ + material : Cesium.Material.fromType('Checkerboard') + }) +})); * @example * // 2. Draw different instances each with a unique color - * var rectangleInstance = new Cesium.GeometryInstance({ - * geometry : new Cesium.RectangleGeometry({ - * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0), - * vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT - * }), - * id : 'rectangle', - * attributes : { - * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) - * } - * }); - * var ellipsoidInstance = new Cesium.GeometryInstance({ - * geometry : new Cesium.EllipsoidGeometry({ - * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0), - * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL - * }), - * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( - * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()), - * id : 'ellipsoid', - * attributes : { - * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) - * } - * }); - * scene.primitives.add(new Cesium.Primitive({ - * geometryInstances : [rectangleInstance, ellipsoidInstance], - * appearance : new Cesium.PerInstanceColorAppearance() - * })); +var rectangleInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0), + vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT + }), + id : 'rectangle', + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) + } +}); +var ellipsoidInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.EllipsoidGeometry({ + radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0), + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()), + id : 'ellipsoid', + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) + } +}); +scene.primitives.add(new Cesium.Primitive({ + geometryInstances : [rectangleInstance, ellipsoidInstance], + appearance : new Cesium.PerInstanceColorAppearance() +})); * @example * // 3. Create the geometry on the main thread. - * scene.primitives.add(new Cesium.Primitive({ - * geometryInstances : new Cesium.GeometryInstance({ - * geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({ - * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0), - * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL - * })), - * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( - * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()), - * id : 'ellipsoid', - * attributes : { - * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) - * } - * }), - * appearance : new Cesium.PerInstanceColorAppearance() - * })); +scene.primitives.add(new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({ + radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0), + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL + })), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()), + id : 'ellipsoid', + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) + } + }), + appearance : new Cesium.PerInstanceColorAppearance() +})); * @param [options] - Object with the following properties: * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render. * @param [options.appearance] - The appearance used to render the primitive. @@ -36314,67 +36462,67 @@ export class Primitive { }); /** * The geometry instances rendered with this primitive. This may - * be undefined if options.releaseGeometryInstances - * is true when the primitive is constructed. - *

- * Changing this property after the primitive is rendered has no effect. - *

+ be undefined if options.releaseGeometryInstances + is true when the primitive is constructed. +

+ Changing this property after the primitive is rendered has no effect. +

*/ readonly geometryInstances: GeometryInstance[] | GeometryInstance; /** * The {@link Appearance} used to shade this primitive. Each geometry - * instance is shaded with the same appearance. Some appearances, like - * {@link PerInstanceColorAppearance} allow giving each instance unique - * properties. + instance is shaded with the same appearance. Some appearances, like + {@link PerInstanceColorAppearance} allow giving each instance unique + properties. */ appearance: Appearance; /** * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry - * instance is shaded with the same appearance. Some appearances, like - * {@link PerInstanceColorAppearance} allow giving each instance unique - * properties. - * - *

- * When using an appearance that requires a color attribute, like PerInstanceColorAppearance, - * add a depthFailColor per-instance attribute instead. - *

- * - *

- * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, - * there may be artifacts. - *

+ instance is shaded with the same appearance. Some appearances, like + {@link PerInstanceColorAppearance} allow giving each instance unique + properties. + +

+ When using an appearance that requires a color attribute, like PerInstanceColorAppearance, + add a depthFailColor per-instance attribute instead. +

+ +

+ Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, + there may be artifacts. +

*/ depthFailAppearance: Appearance; /** * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates. - * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates. - * Local reference frames can be used by providing a different transformation matrix, like that returned - * by {@link Transforms.eastNorthUpToFixedFrame}. - * - *

- * This property is only supported in 3D mode. - *

+ When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. + +

+ This property is only supported in 3D mode. +

* @example * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); - * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); + p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); */ modelMatrix: Matrix4; /** * Determines if the primitive will be shown. This affects all geometry - * instances in the primitive. + instances in the primitive. */ show: boolean; /** * When true, the renderer frustum culls and horizon culls the primitive's commands - * based on their bounding volume. Set this to false for a small performance gain - * if you are manually culling the primitive. + based on their bounding volume. Set this to false for a small performance gain + if you are manually culling the primitive. */ cull: boolean; /** * This property is for debugging only; it is not for production use nor is it optimized. - *

- * Draws the bounding sphere for each draw command in the primitive. - *

+

+ Draws the bounding sphere for each draw command in the primitive. +

*/ debugShowBoundingVolume: boolean; /** @@ -36407,8 +36555,8 @@ export class Primitive { readonly compressVertices: boolean; /** * Determines if the primitive is complete and ready to render. If this property is - * true, the primitive will be rendered the next time that {@link Primitive#update} - * is called. + true, the primitive will be rendered the next time that {@link Primitive#update} + is called. */ readonly ready: boolean; /** @@ -36417,42 +36565,42 @@ export class Primitive { readonly readyPromise: Promise; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. * @example * var attributes = primitive.getGeometryInstanceAttributes('an id'); - * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); - * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); - * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0); - * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); + attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0); + attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY); * @param id - The id of the {@link GeometryInstance}. * @returns The typed array in the attribute's format or undefined if the is no instance with id. */ getGeometryInstanceAttributes(id: any): any; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. - *

+

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. +

* @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. - *

+ release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. +

* @example * e = e && e.destroy(); */ @@ -36461,17 +36609,17 @@ export class Primitive { /** * A collection of primitives. This is most often used with {@link Scene#primitives}, - * but PrimitiveCollection is also a primitive itself so collections can - * be added to collections forming a hierarchy. +but PrimitiveCollection is also a primitive itself so collections can +be added to collections forming a hierarchy. * @example * var billboards = new Cesium.BillboardCollection(); - * var labels = new Cesium.LabelCollection(); - * - * var collection = new Cesium.PrimitiveCollection(); - * collection.add(billboards); - * - * scene.primitives.add(collection); // Add collection - * scene.primitives.add(labels); // Add regular primitive +var labels = new Cesium.LabelCollection(); + +var collection = new Cesium.PrimitiveCollection(); +collection.add(billboards); + +scene.primitives.add(collection); // Add collection +scene.primitives.add(labels); // Add regular primitive * @param [options] - Object with the following properties: * @param [options.show = true] - Determines if the primitives in the collection will be shown. * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed. @@ -36487,22 +36635,22 @@ export class PrimitiveCollection { show: boolean; /** * Determines if primitives in the collection are destroyed when they are removed by - * {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly - * by {@link PrimitiveCollection#removeAll}. + {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly + by {@link PrimitiveCollection#removeAll}. * @example * // Example 1. Primitives are destroyed by default. - * var primitives = new Cesium.PrimitiveCollection(); - * var labels = primitives.add(new Cesium.LabelCollection()); - * primitives = primitives.destroy(); - * var b = labels.isDestroyed(); // true + var primitives = new Cesium.PrimitiveCollection(); + var labels = primitives.add(new Cesium.LabelCollection()); + primitives = primitives.destroy(); + var b = labels.isDestroyed(); // true * @example * // Example 2. Do not destroy primitives in a collection. - * var primitives = new Cesium.PrimitiveCollection(); - * primitives.destroyPrimitives = false; - * var labels = primitives.add(new Cesium.LabelCollection()); - * primitives = primitives.destroy(); - * var b = labels.isDestroyed(); // false - * labels = labels.destroy(); // explicitly destroy + var primitives = new Cesium.PrimitiveCollection(); + primitives.destroyPrimitives = false; + var labels = primitives.add(new Cesium.LabelCollection()); + primitives = primitives.destroy(); + var b = labels.isDestroyed(); // false + labels = labels.destroy(); // explicitly destroy */ destroyPrimitives: boolean; /** @@ -36522,7 +36670,7 @@ export class PrimitiveCollection { * Removes a primitive from the collection. * @example * var billboards = scene.primitives.add(new Cesium.BillboardCollection()); - * scene.primitives.remove(billboards); // Returns true + scene.primitives.remove(billboards); // Returns true * @param [primitive] - The primitive to remove. * @returns true if the primitive was removed; false if the primitive is undefined or was not found in the collection. */ @@ -36539,25 +36687,25 @@ export class PrimitiveCollection { contains(primitive?: any): boolean; /** * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn - * on the globe surface, this visually moves the primitive up one. + on the globe surface, this visually moves the primitive up one. * @param [primitive] - The primitive to raise. */ raise(primitive?: any): void; /** * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn - * on the globe surface, this visually moves the primitive to the top. + on the globe surface, this visually moves the primitive to the top. * @param [primitive] - The primitive to raise the top. */ raiseToTop(primitive?: any): void; /** * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn - * on the globe surface, this visually moves the primitive down one. + on the globe surface, this visually moves the primitive down one. * @param [primitive] - The primitive to lower. */ lower(primitive?: any): void; /** * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn - * on the globe surface, this visually moves the primitive to the bottom. + on the globe surface, this visually moves the primitive to the bottom. * @param [primitive] - The primitive to lower to the bottom. */ lowerToBottom(primitive?: any): void; @@ -36565,35 +36713,35 @@ export class PrimitiveCollection { * Returns the primitive in the collection at the specified index. * @example * // Toggle the show property of every primitive in the collection. - * var primitives = scene.primitives; - * var length = primitives.length; - * for (var i = 0; i < length; ++i) { - * var p = primitives.get(i); - * p.show = !p.show; - * } + var primitives = scene.primitives; + var length = primitives.length; + for (var i = 0; i < length; ++i) { + var p = primitives.get(i); + p.show = !p.show; + } * @param index - The zero-based index of the primitive to return. * @returns The primitive at the index. */ get(index: number): any; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this - * collection allows for deterministic release of WebGL resources, instead of relying on the garbage - * collector to destroy this collection. - *

- * Since destroying a collection destroys all the contained primitives, only destroy a collection - * when you are sure no other code is still using any of the contained primitives. - *

- * Once this collection is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + collection allows for deterministic release of WebGL resources, instead of relying on the garbage + collector to destroy this collection. +

+ Since destroying a collection destroys all the contained primitives, only destroy a collection + when you are sure no other code is still using any of the contained primitives. +

+ Once this collection is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * primitives = primitives && primitives.destroy(); */ @@ -36602,52 +36750,52 @@ export class PrimitiveCollection { /** * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally, - * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}. - *

- * contextOptions parameter details: - *

- *

- * The default values are: - * - * { - * webgl : { - * alpha : false, - * depth : true, - * stencil : false, - * antialias : true, - * powerPreference: 'high-performance', - * premultipliedAlpha : true, - * preserveDrawingBuffer : false, - * failIfMajorPerformanceCaveat : false - * }, - * allowTextureFilterAnisotropic : true - * } - * - *

- *

- * The webgl property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes} - * object used to create the WebGL context. - *

- *

- * webgl.alpha defaults to false, which can improve performance compared to the standard WebGL default - * of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set - * webgl.alpha to true. - *

- *

- * The other webgl properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}. - *

- *

- * allowTextureFilterAnisotropic defaults to true, which enables anisotropic texture filtering when the - * WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views. - *

+a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}. +

+contextOptions parameter details: +

+

+The default values are: + +{ + webgl : { + alpha : false, + depth : true, + stencil : false, + antialias : true, + powerPreference: 'high-performance', + premultipliedAlpha : true, + preserveDrawingBuffer : false, + failIfMajorPerformanceCaveat : false + }, + allowTextureFilterAnisotropic : true +} + +

+

+The webgl property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes} +object used to create the WebGL context. +

+

+webgl.alpha defaults to false, which can improve performance compared to the standard WebGL default +of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set +webgl.alpha to true. +

+

+The other webgl properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}. +

+

+allowTextureFilterAnisotropic defaults to true, which enables anisotropic texture filtering when the +WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views. +

* @example * // Create scene without anisotropic texture filtering - * var scene = new Cesium.Scene({ - * canvas : canvas, - * contextOptions : { - * allowTextureFilterAnisotropic : false - * } - * }); +var scene = new Cesium.Scene({ + canvas : canvas, + contextOptions : { + allowTextureFilterAnisotropic : false + } +}); * @param [options] - Object with the following properties: * @param options.canvas - The HTML canvas element to create the scene for. * @param [options.contextOptions] - Context and WebGL creation properties. See details above. @@ -36679,14 +36827,14 @@ export class Scene { }); /** * Exceptions occurring in render are always caught in order to raise the - * renderError event. If this property is true, the error is rethrown - * after the event is raised. If this property is false, the render function - * returns normally after raising the event. + renderError event. If this property is true, the error is rethrown + after the event is raised. If this property is false, the render function + returns normally after raising the event. */ rethrowRenderErrors: boolean; /** * Determines whether or not to instantly complete the - * scene transition animation on user input. + scene transition animation on user input. */ completeMorphOnUserInput: boolean; /** @@ -36723,103 +36871,103 @@ export class Scene { backgroundColor: Color; /** * The current morph transition time between 2D/Columbus View and 3D, - * with 0.0 being 2D or Columbus View and 1.0 being 3D. + with 0.0 being 2D or Columbus View and 1.0 being 3D. */ morphTime: number; /** * The far-to-near ratio of the multi-frustum when using a normal depth buffer. - *

- * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used - * when {@link Scene#logarithmicDepthBuffer} is false. When logarithmicDepthBuffer is - * true, use {@link Scene#logarithmicDepthFarToNearRatio}. - *

+

+ This value is used to create the near and far values for each frustum of the multi-frustum. It is only used + when {@link Scene#logarithmicDepthBuffer} is false. When logarithmicDepthBuffer is + true, use {@link Scene#logarithmicDepthFarToNearRatio}. +

*/ farToNearRatio: number; /** * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer. - *

- * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used - * when {@link Scene#logarithmicDepthBuffer} is true. When logarithmicDepthBuffer is - * false, use {@link Scene#farToNearRatio}. - *

+

+ This value is used to create the near and far values for each frustum of the multi-frustum. It is only used + when {@link Scene#logarithmicDepthBuffer} is true. When logarithmicDepthBuffer is + false, use {@link Scene#farToNearRatio}. +

*/ logarithmicDepthFarToNearRatio: number; /** * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close - * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the - * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface. + to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the + other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface. */ nearToFarDistance2D: number; /** * This property is for debugging only; it is not for production use. - *

- * A function that determines what commands are executed. As shown in the examples below, - * the function receives the command's owner as an argument, and returns a boolean indicating if the - * command should be executed. - *

- *

- * The default is undefined, indicating that all commands are executed. - *

+

+ A function that determines what commands are executed. As shown in the examples below, + the function receives the command's owner as an argument, and returns a boolean indicating if the + command should be executed. +

+

+ The default is undefined, indicating that all commands are executed. +

* @example * // Do not execute any commands. - * scene.debugCommandFilter = function(command) { - * return false; - * }; - * - * // Execute only the billboard's commands. That is, only draw the billboard. - * var billboards = new Cesium.BillboardCollection(); - * scene.debugCommandFilter = function(command) { - * return command.owner === billboards; - * }; + scene.debugCommandFilter = function(command) { + return false; + }; + + // Execute only the billboard's commands. That is, only draw the billboard. + var billboards = new Cesium.BillboardCollection(); + scene.debugCommandFilter = function(command) { + return command.owner === billboards; + }; */ debugCommandFilter: (...params: any[]) => any; /** * This property is for debugging only; it is not for production use. - *

- * When true, commands are randomly shaded. This is useful - * for performance analysis to see what parts of a scene or model are - * command-dense and could benefit from batching. - *

+

+ When true, commands are randomly shaded. This is useful + for performance analysis to see what parts of a scene or model are + command-dense and could benefit from batching. +

*/ debugShowCommands: boolean; /** * This property is for debugging only; it is not for production use. - *

- * When true, commands are shaded based on the frustums they - * overlap. Commands in the closest frustum are tinted red, commands in - * the next closest are green, and commands in the farthest frustum are - * blue. If a command overlaps more than one frustum, the color components - * are combined, e.g., a command overlapping the first two frustums is tinted - * yellow. - *

+

+ When true, commands are shaded based on the frustums they + overlap. Commands in the closest frustum are tinted red, commands in + the next closest are green, and commands in the farthest frustum are + blue. If a command overlaps more than one frustum, the color components + are combined, e.g., a command overlapping the first two frustums is tinted + yellow. +

*/ debugShowFrustums: boolean; /** * This property is for debugging only; it is not for production use. - *

- * Displays frames per second and time between frames. - *

+

+ Displays frames per second and time between frames. +

*/ debugShowFramesPerSecond: boolean; /** * This property is for debugging only; it is not for production use. - *

- * Displays depth information for the indicated frustum. - *

+

+ Displays depth information for the indicated frustum. +

*/ debugShowGlobeDepth: boolean; /** * This property is for debugging only; it is not for production use. - *

- * Indicates which frustum will have depth information displayed. - *

+

+ Indicates which frustum will have depth information displayed. +

*/ debugShowDepthFrustum: number; /** * This property is for debugging only; it is not for production use. - *

- * When true, draws outlines to show the boundaries of the camera frustums - *

+

+ When true, draws outlines to show the boundaries of the camera frustums +

*/ debugShowFrustumPlanes: boolean; /** @@ -36828,28 +36976,28 @@ export class Scene { useDepthPicking: boolean; /** * When true, enables picking translucent geometry using the depth buffer. Note that {@link Scene#useDepthPicking} must also be true for enabling this to work. - * - *

- * Render must be called between picks. - *
There is a decrease in performance when enabled. There are extra draw calls to write depth for - * translucent geometry. - *

+ +

+ Render must be called between picks. +
There is a decrease in performance when enabled. There are extra draw calls to write depth for + translucent geometry. +

* @example * // picking the position of a translucent primitive - * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { - * var pickedFeature = viewer.scene.pick(movement.position); - * if (!Cesium.defined(pickedFeature)) { - * // nothing picked - * return; - * } - * viewer.scene.render(); - * var worldPosition = viewer.scene.pickPosition(movement.position); - * }, Cesium.ScreenSpaceEventType.LEFT_CLICK); + viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { + var pickedFeature = viewer.scene.pick(movement.position); + if (!Cesium.defined(pickedFeature)) { + // nothing picked + return; + } + viewer.scene.render(); + var worldPosition = viewer.scene.pickPosition(movement.position); + }, Cesium.ScreenSpaceEventType.LEFT_CLICK); */ pickTranslucentDepth: boolean; /** * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional - * performance improvements by rendering less geometry and dispatching less terrain requests. + performance improvements by rendering less geometry and dispatching less terrain requests. */ fog: Fog; /** @@ -36858,13 +37006,13 @@ export class Scene { shadowMap: ShadowMap; /** * When false, 3D Tiles will render normally. When true, classified 3D Tile geometry will render normally and - * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}. + unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}. */ invertClassification: boolean; /** * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is true. - *

When the color's alpha is less than 1.0, the unclassified portions of the 3D Tiles will not blend correctly with the classified positions of the 3D Tiles.

- *

Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.

+

When the color's alpha is less than 1.0, the unclassified portions of the 3D Tiles will not blend correctly with the classified positions of the 3D Tiles.

+

Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.

*/ invertClassificationColor: Color; /** @@ -36881,18 +37029,18 @@ export class Scene { postProcessStages: PostProcessStageCollection; /** * When true, rendering a frame will only occur when needed as determined by changes within the scene. - * Enabling improves performance of the application, but requires using {@link Scene#requestRender} - * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes - * to the scene in other parts of the API. + Enabling improves performance of the application, but requires using {@link Scene#requestRender} + to render a new frame explicitly in this mode. This will be necessary in many cases after making changes + to the scene in other parts of the API. */ requestRenderMode: boolean; /** * If {@link Scene#requestRenderMode} is true, this value defines the maximum change in - * simulation time allowed before a render is requested. Lower values increase the number of frames rendered - * and higher values decrease the number of frames rendered. If undefined, changes to - * the simulation time will never request a render. - * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates, - * and animations. + simulation time allowed before a render is requested. Lower values increase the number of frames rendered + and higher values decrease the number of frames rendered. If undefined, changes to + the simulation time will never request a render. + This value impacts the rate of rendering for changes in the scene like lighting, entity property updates, + and animations. */ maximumRenderTimeChange: number; /** @@ -36985,48 +37133,48 @@ export class Scene { readonly terrainProviderChanged: Event; /** * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event - * receive the Scene instance as the first parameter and the current time as the second parameter. + receive the Scene instance as the first parameter and the current time as the second parameter. */ readonly preUpdate: Event; /** * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered. - * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second - * parameter. + Subscribers to the event receive the Scene instance as the first parameter and the current time as the second + parameter. */ readonly postUpdate: Event; /** * Gets the event that will be raised when an error is thrown inside the render function. - * The Scene instance and the thrown error are the only two parameters passed to the event handler. - * By default, errors are not rethrown after this event is raised, but that can be changed by setting - * the rethrowRenderErrors property. + The Scene instance and the thrown error are the only two parameters passed to the event handler. + By default, errors are not rethrown after this event is raised, but that can be changed by setting + the rethrowRenderErrors property. */ readonly renderError: Event; /** * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered. - * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second - * parameter. + Subscribers to the event receive the Scene instance as the first parameter and the current time as the second + parameter. */ readonly preRender: Event; /** * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event - * receive the Scene instance as the first parameter and the current time as the second parameter. + receive the Scene instance as the first parameter and the current time as the second parameter. */ readonly postRender: Event; /** * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been - * rendered. + rendered. */ readonly lastRenderTime: JulianDate; /** * This property is for debugging only; it is not for production use. - *

- * When {@link Scene.debugShowFrustums} is true, this contains - * properties with statistics about the number of command execute per frustum. - * totalCommands is the total number of commands executed, ignoring - * overlap. commandsInFrustums is an array with the number of times - * commands are executed redundantly, e.g., how many commands overlap two or - * three frustums. - *

+

+ When {@link Scene.debugShowFrustums} is true, this contains + properties with statistics about the number of command execute per frustum. + totalCommands is the total number of commands executed, ignoring + overlap. commandsInFrustums is an array with the number of times + commands are executed redundantly, e.g., how many commands overlap two or + three frustums. +

*/ readonly debugFrustumStatistics: any; /** @@ -37035,8 +37183,8 @@ export class Scene { readonly scene3DOnly: boolean; /** * Gets whether or not the scene has order independent translucency enabled. - * Note that this only reflects the original construction option, and there are - * other factors that could prevent OIT from functioning on a given system configuration. + Note that this only reflects the original construction option, and there are + other factors that could prevent OIT from functioning on a given system configuration. */ readonly orderIndependentTranslucency: boolean; /** @@ -37053,7 +37201,7 @@ export class Scene { readonly terrainExaggeration: number; /** * When true, splits the scene into two viewports with steroscopic views for the left and right eyes. - * Used for cardboard and WebVR. + Used for cardboard and WebVR. */ useWebVR: boolean; /** @@ -37066,14 +37214,14 @@ export class Scene { imagerySplitPosition: number; /** * The distance from the camera at which to disable the depth test of billboards, labels and points - * to, for example, prevent clipping against terrain. When set to zero, the depth test should always - * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance - * property of a billboard, label or point will override this value. + to, for example, prevent clipping against terrain. When set to zero, the depth test should always + be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance + property of a billboard, label or point will override this value. */ minimumDisableDepthTestDistance: number; /** * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum, - * increasing performance. This property relies on fragmentDepth being supported. + increasing performance. This property relies on fragmentDepth being supported. */ logarithmicDepthBuffer: boolean; /** @@ -37100,30 +37248,30 @@ export class Scene { getCompressedTextureFormatSupported(format: string): boolean; /** * Update and render the scene. It is usually not necessary to call this function - * directly because {@link CesiumWidget} or {@link Viewer} do it automatically. + directly because {@link CesiumWidget} or {@link Viewer} do it automatically. * @param [time] - The simulation time at which to render. */ render(time?: JulianDate): void; /** * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to true. - * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}. + The render rate will not exceed the {@link CesiumWidget#targetFrameRate}. */ requestRender(): void; /** * Returns an object with a `primitive` property that contains the first (top) primitive in the scene - * at a particular window coordinate or undefined if nothing is at the location. Other properties may - * potentially be set depending on the type of primitive and may be used to further identify the picked object. - *

- * When a feature of a 3D Tiles tileset is picked, pick returns a {@link Cesium3DTileFeature} object. - *

+ at a particular window coordinate or undefined if nothing is at the location. Other properties may + potentially be set depending on the type of primitive and may be used to further identify the picked object. +

+ When a feature of a 3D Tiles tileset is picked, pick returns a {@link Cesium3DTileFeature} object. +

* @example * // On mouse over, color the feature yellow. - * handler.setInputAction(function(movement) { - * var feature = scene.pick(movement.endPosition); - * if (feature instanceof Cesium.Cesium3DTileFeature) { - * feature.color = Cesium.Color.YELLOW; - * } - * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + handler.setInputAction(function(movement) { + var feature = scene.pick(movement.endPosition); + if (feature instanceof Cesium.Cesium3DTileFeature) { + feature.color = Cesium.Color.YELLOW; + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param windowPosition - Window coordinates to perform picking on. * @param [width = 3] - Width of the pick rectangle. * @param [height = 3] - Height of the pick rectangle. @@ -37132,15 +37280,15 @@ export class Scene { pick(windowPosition: Cartesian2, width?: number, height?: number): any; /** * Returns the cartesian position reconstructed from the depth buffer and window position. - *

- * The position reconstructed from the depth buffer in 2D may be slightly different from those - * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution - * of depth values of perspective and orthographic projection. - *

- *

- * Set {@link Scene#pickTranslucentDepth} to true to include the depth of - * translucent primitives; otherwise, this essentially picks through translucent primitives. - *

+

+ The position reconstructed from the depth buffer in 2D may be slightly different from those + reconstructed in 3D and Columbus view. This is caused by the difference in the distribution + of depth values of perspective and orthographic projection. +

+

+ Set {@link Scene#pickTranslucentDepth} to true to include the depth of + translucent primitives; otherwise, this essentially picks through translucent primitives. +

* @param windowPosition - Window coordinates to perform picking on. * @param [result] - The object on which to restore the result. * @returns The cartesian position. @@ -37148,9 +37296,9 @@ export class Scene { pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3; /** * Returns a list of objects, each containing a `primitive` property, for all primitives at - * a particular window coordinate position. Other properties may also be set depending on the - * type of primitive and may be used to further identify the picked object. The primitives in - * the list are ordered by their visual order in the scene (front to back). + a particular window coordinate position. Other properties may also be set depending on the + type of primitive and may be used to further identify the picked object. The primitives in + the list are ordered by their visual order in the scene (front to back). * @example * var pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0)); * @param windowPosition - Window coordinates to perform picking on. @@ -37162,16 +37310,16 @@ export class Scene { drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[]; /** * Returns the height of scene geometry at the given cartographic position or undefined if there was no - * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to - * the globe, 3D Tiles, or primitives in the scene. - *

- * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height - * from all other primitives regardless of their visibility. - *

+ scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to + the globe, 3D Tiles, or primitives in the scene. +

+ This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height + from all other primitives regardless of their visibility. +

* @example * var position = new Cesium.Cartographic(-1.31968, 0.698874); - * var height = viewer.scene.sampleHeight(position); - * console.log(height); + var height = viewer.scene.sampleHeight(position); + console.log(height); * @param position - The cartographic position to sample height from. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from. * @param [width = 0.1] - Width of the intersection volume in meters. @@ -37180,16 +37328,16 @@ export class Scene { sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number; /** * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the - * clamped position or undefined if there was no scene geometry to clamp to. May be used to clamp - * objects to the globe, 3D Tiles, or primitives in the scene. - *

- * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to - * all other primitives regardless of their visibility. - *

+ clamped position or undefined if there was no scene geometry to clamp to. May be used to clamp + objects to the globe, 3D Tiles, or primitives in the scene. +

+ This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to + all other primitives regardless of their visibility. +

* @example * // Clamp an entity to the underlying scene geometry - * var position = entity.position.getValue(Cesium.JulianDate.now()); - * entity.position = viewer.scene.clampToHeight(position); + var position = entity.position.getValue(Cesium.JulianDate.now()); + entity.position = viewer.scene.clampToHeight(position); * @param cartesian - The cartesian position. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to. * @param [width = 0.1] - Width of the intersection volume in meters. @@ -37199,20 +37347,20 @@ export class Scene { clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3; /** * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions - * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored. - * Returns a promise that is resolved when the query completes. Each point height is modified in place. - * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs, - * the height is set to undefined. + using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored. + Returns a promise that is resolved when the query completes. Each point height is modified in place. + If a height cannot be determined because no geometry can be sampled at that location, or another error occurs, + the height is set to undefined. * @example * var positions = [ - * new Cesium.Cartographic(-1.31968, 0.69887), - * new Cesium.Cartographic(-1.10489, 0.83923) - * ]; - * var promise = viewer.scene.sampleHeightMostDetailed(positions); - * promise.then(function(updatedPosition) { - * // positions[0].height and positions[1].height have been updated. - * // updatedPositions is just a reference to positions. - * } + new Cesium.Cartographic(-1.31968, 0.69887), + new Cesium.Cartographic(-1.10489, 0.83923) + ]; + var promise = viewer.scene.sampleHeightMostDetailed(positions); + promise.then(function(updatedPosition) { + // positions[0].height and positions[1].height have been updated. + // updatedPositions is just a reference to positions. + } * @param positions - The cartographic positions to update with sampled heights. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from. * @param [width = 0.1] - Width of the intersection volume in meters. @@ -37221,19 +37369,19 @@ export class Scene { sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise; /** * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions - * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when - * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry - * can be sampled at that location, or another error occurs, the element in the array is set to undefined. + using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when + the query completes. Each position is modified in place. If a position cannot be clamped because no geometry + can be sampled at that location, or another error occurs, the element in the array is set to undefined. * @example * var cartesians = [ - * entities[0].position.getValue(Cesium.JulianDate.now()), - * entities[1].position.getValue(Cesium.JulianDate.now()) - * ]; - * var promise = viewer.scene.clampToHeightMostDetailed(cartesians); - * promise.then(function(updatedCartesians) { - * entities[0].position = updatedCartesians[0]; - * entities[1].position = updatedCartesians[1]; - * } + entities[0].position.getValue(Cesium.JulianDate.now()), + entities[1].position.getValue(Cesium.JulianDate.now()) + ]; + var promise = viewer.scene.clampToHeightMostDetailed(cartesians); + promise.then(function(updatedCartesians) { + entities[0].position = updatedCartesians[0]; + entities[1].position = updatedCartesians[1]; + } * @param cartesians - The cartesian positions to update with clamped positions. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to. * @param [width = 0.1] - Width of the intersection volume in meters. @@ -37242,16 +37390,16 @@ export class Scene { clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise; /** * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an - * HTML element at the same screen position as an object in the scene. + HTML element at the same screen position as an object in the scene. * @example * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves. - * var scene = widget.scene; - * var ellipsoid = scene.globe.ellipsoid; - * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); - * handler.setInputAction(function(movement) { - * console.log(scene.cartesianToCanvasCoordinates(position)); - * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + var scene = widget.scene; + var ellipsoid = scene.globe.ellipsoid; + var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); + handler.setInputAction(function(movement) { + console.log(scene.cartesianToCanvasCoordinates(position)); + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param position - The position in cartesian coordinates. * @param [result] - An optional object to return the input position transformed to canvas coordinates. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be undefined if the input position is near the center of the ellipsoid. @@ -37278,19 +37426,19 @@ export class Scene { morphTo3D(duration?: number): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * scene = scene && scene.destroy(); */ @@ -37307,7 +37455,7 @@ export enum SceneMode { MORPHING = 0, /** * Columbus View mode. A 2.5D perspective view where the map is laid out - * flat and objects with non-zero height are drawn above it. + flat and objects with non-zero height are drawn above it. */ COLUMBUS_VIEW = 1, /** @@ -37326,16 +37474,16 @@ export enum SceneMode { export namespace SceneTransforms { /** * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an - * HTML element at the same screen position as an object in the scene. + HTML element at the same screen position as an object in the scene. * @example * // Output the window position of longitude/latitude (0, 0) every time the mouse moves. - * var scene = widget.scene; - * var ellipsoid = scene.globe.ellipsoid; - * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); - * handler.setInputAction(function(movement) { - * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position)); - * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + var scene = widget.scene; + var ellipsoid = scene.globe.ellipsoid; + var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); + handler.setInputAction(function(movement) { + console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position)); + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param scene - The scene. * @param position - The position in WGS84 (world) coordinates. * @param [result] - An optional object to return the input position transformed to window coordinates. @@ -37344,16 +37492,16 @@ export namespace SceneTransforms { function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2; /** * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different - * results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays. + results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays. * @example * // Output the window position of longitude/latitude (0, 0) every time the mouse moves. - * var scene = widget.scene; - * var ellipsoid = scene.globe.ellipsoid; - * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); - * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); - * handler.setInputAction(function(movement) { - * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position)); - * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + var scene = widget.scene; + var ellipsoid = scene.globe.ellipsoid; + var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); + handler.setInputAction(function(movement) { + console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position)); + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); * @param scene - The scene. * @param position - The position in WGS84 (world) coordinates. * @param [result] - An optional object to return the input position transformed to window coordinates. @@ -37370,18 +37518,18 @@ export class ScreenSpaceCameraController { constructor(scene: Scene); /** * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom, - * enableRotate, enableTilt, and enableLook. If false, all inputs are disabled. - * - * NOTE: This setting is for temporary use cases, such as camera flights and - * drag-selection of regions (see Picking demo). It is typically set to false at the - * start of such events, and set true on completion. To keep inputs disabled - * past the end of camera flights, you must use the other booleans (enableTranslate, - * enableZoom, enableRotate, enableTilt, and enableLook). + enableRotate, enableTilt, and enableLook. If false, all inputs are disabled. + + NOTE: This setting is for temporary use cases, such as camera flights and + drag-selection of regions (see Picking demo). It is typically set to false at the + start of such events, and set true on completion. To keep inputs disabled + past the end of camera flights, you must use the other booleans (enableTranslate, + enableZoom, enableRotate, enableTilt, and enableLook). */ enableInputs: boolean; /** * If true, allows the user to pan around the map. If false, the camera stays locked at the current position. - * This flag only applies in 2D and Columbus view modes. + This flag only applies in 2D and Columbus view modes. */ enableTranslate: boolean; /** @@ -37390,41 +37538,41 @@ export class ScreenSpaceCameraController { enableZoom: boolean; /** * If true, allows the user to rotate the world which translates the user's position. - * This flag only applies in 2D and 3D. + This flag only applies in 2D and 3D. */ enableRotate: boolean; /** * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading. - * This flag only applies in 3D and Columbus view. + This flag only applies in 3D and Columbus view. */ enableTilt: boolean; /** * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating - * or rotating. This flag only applies in 3D and Columbus view modes. + or rotating. This flag only applies in 3D and Columbus view modes. */ enableLook: boolean; /** * A parameter in the range [0, 1) used to determine how long - * the camera will continue to spin because of inertia. - * With value of zero, the camera will have no inertia. + the camera will continue to spin because of inertia. + With value of zero, the camera will have no inertia. */ inertiaSpin: number; /** * A parameter in the range [0, 1) used to determine how long - * the camera will continue to translate because of inertia. - * With value of zero, the camera will have no inertia. + the camera will continue to translate because of inertia. + With value of zero, the camera will have no inertia. */ inertiaTranslate: number; /** * A parameter in the range [0, 1) used to determine how long - * the camera will continue to zoom because of inertia. - * With value of zero, the camera will have no inertia. + the camera will continue to zoom because of inertia. + With value of zero, the camera will have no inertia. */ inertiaZoom: number; /** * A parameter in the range [0, 1) used to limit the range - * of various user inputs to a percentage of the window width/height per animation frame. - * This helps keep the camera under control in low-frame-rate situations. + of various user inputs to a percentage of the window width/height per animation frame. + This helps keep the camera under control in low-frame-rate situations. */ maximumMovementRatio: number; /** @@ -37441,47 +37589,47 @@ export class ScreenSpaceCameraController { maximumZoomDistance: number; /** * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes. - *

- * The type came be a {@link CameraEventType}, undefined, an object with eventType - * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, - * or an array of any of the preceding. - *

+

+ The type came be a {@link CameraEventType}, undefined, an object with eventType + and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, + or an array of any of the preceding. +

*/ translateEventTypes: CameraEventType | any[] | undefined; /** * The input that allows the user to zoom in/out. - *

- * The type came be a {@link CameraEventType}, undefined, an object with eventType - * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, - * or an array of any of the preceding. - *

+

+ The type came be a {@link CameraEventType}, undefined, an object with eventType + and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, + or an array of any of the preceding. +

*/ zoomEventTypes: CameraEventType | any[] | undefined; /** * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes. - *

- * The type came be a {@link CameraEventType}, undefined, an object with eventType - * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, - * or an array of any of the preceding. - *

+

+ The type came be a {@link CameraEventType}, undefined, an object with eventType + and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, + or an array of any of the preceding. +

*/ rotateEventTypes: CameraEventType | any[] | undefined; /** * The input that allows the user to tilt in 3D and Columbus view or twist in 2D. - *

- * The type came be a {@link CameraEventType}, undefined, an object with eventType - * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, - * or an array of any of the preceding. - *

+

+ The type came be a {@link CameraEventType}, undefined, an object with eventType + and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, + or an array of any of the preceding. +

*/ tiltEventTypes: CameraEventType | any[] | undefined; /** * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes. - *

- * The type came be a {@link CameraEventType}, undefined, an object with eventType - * and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, - * or an array of any of the preceding. - *

+

+ The type came be a {@link CameraEventType}, undefined, an object with eventType + and modifier properties with types CameraEventType and {@link KeyboardEventModifier}, + or an array of any of the preceding. +

*/ lookEventTypes: CameraEventType | any[] | undefined; /** @@ -37494,7 +37642,7 @@ export class ScreenSpaceCameraController { minimumCollisionTerrainHeight: number; /** * The minimum height the camera must be before switching from rotating a track ball to - * free look when clicks originate on the sky or in space. + free look when clicks originate on the sky or in space. */ minimumTrackBallHeight: number; /** @@ -37503,18 +37651,18 @@ export class ScreenSpaceCameraController { enableCollisionDetection: boolean; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Removes mouse listeners held by this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * controller = controller && controller.destroy(); */ @@ -37523,11 +37671,11 @@ export class ScreenSpaceCameraController { /** * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly. - * - *

- * The normalOffset bias pushes the shadows forward slightly, and may be disabled - * for applications that require ultra precise shadows. - *

+ +

+The normalOffset bias pushes the shadows forward slightly, and may be disabled +for applications that require ultra precise shadows. +

* @param options - An object containing the following properties: * @param options.lightCamera - A camera representing the light source. * @param [options.enabled = true] - Whether the shadow map is enabled. @@ -37583,7 +37731,7 @@ export class ShadowMap { /** * Specifies whether the object casts or receives shadows from light sources when - * shadows are enabled. +shadows are enabled. */ export enum ShadowMode { /** @@ -37622,34 +37770,34 @@ export namespace SingleTileImageryProvider { /** * Provides a single, top-level imagery tile. The single image is assumed to use a - * {@link GeographicTilingScheme}. +{@link GeographicTilingScheme}. * @param options - Object describing initialization options */ export class SingleTileImageryProvider { constructor(options: SingleTileImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -37658,7 +37806,7 @@ export class SingleTileImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -37683,45 +37831,45 @@ export class SingleTileImageryProvider { readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link SingleTileImageryProvider#ready} returns true. + not be called before {@link SingleTileImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link SingleTileImageryProvider#ready} returns true. + not be called before {@link SingleTileImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link SingleTileImageryProvider#ready} returns true. + not be called before {@link SingleTileImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link SingleTileImageryProvider#ready} returns true. + not be called before {@link SingleTileImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link SingleTileImageryProvider#ready} returns true. + not be called before {@link SingleTileImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link SingleTileImageryProvider#ready} returns true. + not be called before {@link SingleTileImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link SingleTileImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -37734,15 +37882,15 @@ export class SingleTileImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -37755,40 +37903,40 @@ export class SingleTileImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link SingleTileImageryProvider#ready} returns true. + not be called before {@link SingleTileImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns - * undefined. + undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } /** * An atmosphere drawn around the limb of the provided ellipsoid. Based on - * {@link https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter16.html|Accurate Atmospheric Scattering} - * in GPU Gems 2. - *

- * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view. - *

+{@link https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter16.html|Accurate Atmospheric Scattering} +in GPU Gems 2. +

+This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view. +

* @example * scene.skyAtmosphere = new Cesium.SkyAtmosphere(); * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around. @@ -37801,22 +37949,22 @@ export class SkyAtmosphere { show: boolean; /** * Compute atmosphere per-fragment instead of per-vertex. - * This produces better looking atmosphere with a slight performance penalty. + This produces better looking atmosphere with a slight performance penalty. */ perFragmentAtmosphere: boolean; /** * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). - * A hue shift of 1.0 indicates a complete rotation of the hues available. + A hue shift of 1.0 indicates a complete rotation of the hues available. */ hueShift: number; /** * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). - * A saturation shift of -1.0 is monochrome. + A saturation shift of -1.0 is monochrome. */ saturationShift: number; /** * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). - * A brightness shift of -1.0 is complete darkness, which will let space show through. + A brightness shift of -1.0 is complete darkness, which will let space show through. */ brightnessShift: number; /** @@ -37825,19 +37973,19 @@ export class SkyAtmosphere { readonly ellipsoid: Ellipsoid; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy(); */ @@ -37846,21 +37994,21 @@ export class SkyAtmosphere { /** * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes. - *

- * This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of - * the sky box must not exceed {@link Scene#maximumCubeMapSize}. - *

+

+This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of +the sky box must not exceed {@link Scene#maximumCubeMapSize}. +

* @example * scene.skyBox = new Cesium.SkyBox({ - * sources : { - * positiveX : 'skybox_px.png', - * negativeX : 'skybox_nx.png', - * positiveY : 'skybox_py.png', - * negativeY : 'skybox_ny.png', - * positiveZ : 'skybox_pz.png', - * negativeZ : 'skybox_nz.png' - * } - * }); + sources : { + positiveX : 'skybox_px.png', + negativeX : 'skybox_nx.png', + positiveY : 'skybox_py.png', + negativeY : 'skybox_ny.png', + positiveZ : 'skybox_pz.png', + negativeZ : 'skybox_nz.png' + } +}); * @param options - Object with the following properties: * @param [options.sources] - The source URL or Image object for each of the six cube map faces. See the example below. * @param [options.show = true] - Determines if this primitive will be shown. @@ -37872,9 +38020,9 @@ export class SkyBox { }); /** * The sources used to create the cube map faces: an object - * with positiveX, negativeX, positiveY, - * negativeY, positiveZ, and negativeZ properties. - * These can be either URLs or Image objects. + with positiveX, negativeX, positiveY, + negativeY, positiveZ, and negativeZ properties. + These can be either URLs or Image objects. */ sources: any; /** @@ -37883,28 +38031,28 @@ export class SkyBox { show: boolean; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * skyBox = skyBox && skyBox.destroy(); */ @@ -37913,7 +38061,7 @@ export class SkyBox { /** * A ParticleEmitter that emits particles within a sphere. - * Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere. +Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere. * @param [radius = 1.0] - The radius of the sphere in meters. */ export class SphereEmitter { @@ -38002,25 +38150,25 @@ export enum StencilOperation { /** * An expression for a style applied to a {@link Cesium3DTileset}. - *

- * Derived classes of this interface evaluate expressions in the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. - *

- *

- * This type describes an interface and is not intended to be instantiated directly. - *

+

+Derived classes of this interface evaluate expressions in the +{@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. +

+

+This type describes an interface and is not intended to be instantiated directly. +

*/ export class StyleExpression { constructor(); /** * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of - * the expression in the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} - * is of type Boolean, Number, or String, the corresponding JavaScript - * primitive type will be returned. If the result is a RegExp, a Javascript RegExp - * object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, - * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is - * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. + the expression in the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + is of type Boolean, Number, or String, the corresponding JavaScript + primitive type will be returned. If the result is a RegExp, a Javascript RegExp + object will be returned. If the result is a Cartesian2, Cartesian3, or Cartesian4, + a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the result argument is + a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. * @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object onto which to store the result. * @returns The result of evaluating the expression. @@ -38028,9 +38176,9 @@ export class StyleExpression { evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; /** * Evaluates the result of a Color expression, optionally using the provided feature's properties. - *

- * This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object. - *

+

+ This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object. +

* @param feature - The feature whose properties may be used as variables in the expression. * @param [result] - The object in which to store the result. * @returns The modified result parameter or a new Color instance if one was not provided. @@ -38040,7 +38188,7 @@ export class StyleExpression { /** * Draws a sun billboard. - *

This is only supported in 3D and Columbus view.

+

This is only supported in 3D and Columbus view.

* @example * scene.sun = new Cesium.Sun(); */ @@ -38052,29 +38200,29 @@ export class Sun { show: boolean; /** * Gets or sets a number that controls how "bright" the Sun's lens flare appears - * to be. Zero shows just the Sun's disc without any flare. - * Use larger values for a more pronounced flare around the Sun. + to be. Zero shows just the Sun's disc without any flare. + Use larger values for a more pronounced flare around the Sun. */ glowFactor: number; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * sun = sun && sun.destroy(); - * - * + + */ destroy(): void; } @@ -38105,8 +38253,8 @@ export namespace TileCoordinatesImageryProvider { * Initialization options for the TileCoordinatesImageryProvider constructor * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. * @property [color = Color.YELLOW] - The color to draw the tile box and label. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes. @@ -38122,35 +38270,35 @@ export namespace TileCoordinatesImageryProvider { /** * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws - * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for - * debugging terrain and imagery rendering problems. +a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for +debugging terrain and imagery rendering problems. * @param [options] - Object describing initialization options */ export class TileCoordinatesImageryProvider { constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -38159,7 +38307,7 @@ export class TileCoordinatesImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -38180,45 +38328,45 @@ export class TileCoordinatesImageryProvider { readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -38231,15 +38379,15 @@ export class TileCoordinatesImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage - * and texture upload time. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage + and texture upload time. */ readonly hasAlphaChannel: boolean; /** @@ -38252,36 +38400,36 @@ export class TileCoordinatesImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns - * undefined. + undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } /** * A policy for discarding tile images according to some criteria. This type describes an - * interface and is not intended to be instantiated directly. +interface and is not intended to be instantiated directly. */ export class TileDiscardPolicy { constructor(); @@ -38305,20 +38453,20 @@ export namespace TileMapServiceImageryProvider { * @property [fileExtension = 'png'] - The file extension for images on the server. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying - * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely - * to result in rendering problems. + this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely + to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [tilingScheme] - The tiling scheme specifying how the ellipsoidal - * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} - * is used. + surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} + is used. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. * @property [tileWidth = 256] - Pixel width of image tiles. * @property [tileHeight = 256] - Pixel height of image tiles. * @property [flipXY] - Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml. - * Specifying this option will do the same, allowing for loading of these incorrect tilesets. + Specifying this option will do the same, allowing for loading of these incorrect tilesets. */ type ConstructorOptions = { url?: Resource | string | Promise | Promise; @@ -38337,18 +38485,18 @@ export namespace TileMapServiceImageryProvider { /** * An imagery provider that provides tiled imagery as generated by - * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc. +{@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc. * @example * var tms = new Cesium.TileMapServiceImageryProvider({ - * url : '../images/cesium_maptiler/Cesium_Logo_Color', - * fileExtension: 'png', - * maximumLevel: 4, - * rectangle: new Cesium.Rectangle( - * Cesium.Math.toRadians(-120.0), - * Cesium.Math.toRadians(20.0), - * Cesium.Math.toRadians(-60.0), - * Cesium.Math.toRadians(40.0)) - * }); + url : '../images/cesium_maptiler/Cesium_Logo_Color', + fileExtension: 'png', + maximumLevel: 4, + rectangle: new Cesium.Rectangle( + Cesium.Math.toRadians(-120.0), + Cesium.Math.toRadians(20.0), + Cesium.Math.toRadians(-60.0), + Cesium.Math.toRadians(40.0)) +}); * @param options - Object describing initialization options */ export class TileMapServiceImageryProvider extends UrlTemplateImageryProvider { @@ -38389,12 +38537,12 @@ export class TimeDynamicImagery { * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if the tile is not in the cache. + undefined if the tile is not in the cache. */ getFromCache(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will - * just add the tile to a list to preload when we approach the next interval. + just add the tile to a list to preload when we approach the next interval. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. @@ -38405,11 +38553,11 @@ export class TimeDynamicImagery { /** * Provides playback of time-dynamic point cloud data. - *

- * Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed. - * If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently - * small or the clock is sufficiently slow then no frames will be skipped. - *

+

+Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed. +If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently +small or the clock is sufficiently slow then no frames will be skipped. +

* @param options - Object with the following properties: * @param options.clock - A {@link Clock} instance that is used when determining the value for the time dimension. * @param options.intervals - A {@link TimeIntervalCollection} with its data property being an object containing a uri to a 3D Tiles Point Cloud tile and an optional transform. @@ -38443,22 +38591,22 @@ export class TimeDynamicPointCloud { modelMatrix: Matrix4; /** * Determines whether the point cloud casts or receives shadows from light sources. - *

- * Enabling shadows has a performance impact. A point cloud that casts shadows must be rendered twice, once from the camera and again from the light's point of view. - *

- *

- * Shadows are rendered only when {@link Viewer#shadows} is true. - *

+

+ Enabling shadows has a performance impact. A point cloud that casts shadows must be rendered twice, once from the camera and again from the light's point of view. +

+

+ Shadows are rendered only when {@link Viewer#shadows} is true. +

*/ shadows: ShadowMode; /** * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames. - *

- * Frames that are not being loaded or rendered are unloaded to enforce this. - *

- *

- * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame. - *

+

+ Frames that are not being loaded or rendered are unloaded to enforce this. +

+

+ If decreasing this value results in unloading tiles, the tiles are unloaded the next frame. +

*/ maximumMemoryUsage: number; /** @@ -38467,53 +38615,53 @@ export class TimeDynamicPointCloud { shading: PointCloudShading; /** * The style, defined using the - * {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, - * applied to each point in the point cloud. - *

- * Assign undefined to remove the style, which will restore the visual - * appearance of the point cloud to its default when no style was applied. - *

+ {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, + applied to each point in the point cloud. +

+ Assign undefined to remove the style, which will restore the visual + appearance of the point cloud to its default when no style was applied. +

* @example * pointCloud.style = new Cesium.Cesium3DTileStyle({ - * color : { - * conditions : [ - * ['${Classification} === 0', 'color("purple", 0.5)'], - * ['${Classification} === 1', 'color("red")'], - * ['true', '${COLOR}'] - * ] - * }, - * show : '${Classification} !== 2' - * }); + color : { + conditions : [ + ['${Classification} === 0', 'color("purple", 0.5)'], + ['${Classification} === 1', 'color("red")'], + ['true', '${COLOR}'] + ] + }, + show : '${Classification} !== 2' + }); */ style: Cesium3DTileStyle; /** * The event fired to indicate that a frame failed to load. A frame may fail to load if the - * request for its uri fails or processing fails due to invalid content. - *

- * If there are no event listeners, error messages will be logged to the console. - *

- *

- * The error object passed to the listener contains two properties: - *

    - *
  • uri: the uri of the failed frame.
  • - *
  • message: the error message.
  • - *
+ request for its uri fails or processing fails due to invalid content. +

+ If there are no event listeners, error messages will be logged to the console. +

+

+ The error object passed to the listener contains two properties: +

    +
  • uri: the uri of the failed frame.
  • +
  • message: the error message.
  • +
* @example * pointCloud.frameFailed.addEventListener(function(error) { - * console.log('An error occurred loading frame: ' + error.uri); - * console.log('Error: ' + error.message); - * }); + console.log('An error occurred loading frame: ' + error.uri); + console.log('Error: ' + error.message); + }); */ frameFailed: Event; /** * The event fired to indicate that a new frame was rendered. - *

- * The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener. - *

+

+ The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener. +

* @example * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) { - * viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere); - * }); + viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere); + }); */ frameChanged: Event; /** @@ -38534,24 +38682,24 @@ export class TimeDynamicPointCloud { readonly readyPromise: Promise; /** * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all - * points to re-evaluate the style in the next frame. + points to re-evaluate the style in the next frame. */ makeStyleDirty(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns true if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * pointCloud = pointCloud && pointCloud.destroy(); */ @@ -38563,85 +38711,85 @@ export namespace UrlTemplateImageryProvider { * Initialization options for the UrlTemplateImageryProvider constructor * @property [options] - Object with the following properties: * @property url - The URL template to use to request tiles. It has the following keywords: - *
    - *
  • {z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.
  • - *
  • {x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.
  • - *
  • {y}: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.
  • - *
  • {s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.
  • - *
  • {reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.
  • - *
  • {reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.
  • - *
  • {reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.
  • - *
  • {westDegrees}: The Western edge of the tile in geodetic degrees.
  • - *
  • {southDegrees}: The Southern edge of the tile in geodetic degrees.
  • - *
  • {eastDegrees}: The Eastern edge of the tile in geodetic degrees.
  • - *
  • {northDegrees}: The Northern edge of the tile in geodetic degrees.
  • - *
  • {westProjected}: The Western edge of the tile in projected coordinates of the tiling scheme.
  • - *
  • {southProjected}: The Southern edge of the tile in projected coordinates of the tiling scheme.
  • - *
  • {eastProjected}: The Eastern edge of the tile in projected coordinates of the tiling scheme.
  • - *
  • {northProjected}: The Northern edge of the tile in projected coordinates of the tiling scheme.
  • - *
  • {width}: The width of each tile in pixels.
  • - *
  • {height}: The height of each tile in pixels.
  • - *
+
    +
  • {z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.
  • +
  • {x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.
  • +
  • {y}: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.
  • +
  • {s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.
  • +
  • {reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.
  • +
  • {reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.
  • +
  • {reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.
  • +
  • {westDegrees}: The Western edge of the tile in geodetic degrees.
  • +
  • {southDegrees}: The Southern edge of the tile in geodetic degrees.
  • +
  • {eastDegrees}: The Eastern edge of the tile in geodetic degrees.
  • +
  • {northDegrees}: The Northern edge of the tile in geodetic degrees.
  • +
  • {westProjected}: The Western edge of the tile in projected coordinates of the tiling scheme.
  • +
  • {southProjected}: The Southern edge of the tile in projected coordinates of the tiling scheme.
  • +
  • {eastProjected}: The Eastern edge of the tile in projected coordinates of the tiling scheme.
  • +
  • {northProjected}: The Northern edge of the tile in projected coordinates of the tiling scheme.
  • +
  • {width}: The width of each tile in pixels.
  • +
  • {height}: The height of each tile in pixels.
  • +
* @property [pickFeaturesUrl] - The URL template to use to pick features. If this property is not specified, - * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no - * features picked. The URL template supports all of the keywords supported by the url - * parameter, plus the following: - *
    - *
  • {i}: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.
  • - *
  • {j}: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.
  • - *
  • {reverseI}: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.
  • - *
  • {reverseJ}: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.
  • - *
  • {longitudeDegrees}: The longitude of the picked position in degrees.
  • - *
  • {latitudeDegrees}: The latitude of the picked position in degrees.
  • - *
  • {longitudeProjected}: The longitude of the picked position in the projected coordinates of the tiling scheme.
  • - *
  • {latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.
  • - *
  • {format}: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.
  • - *
+ {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no + features picked. The URL template supports all of the keywords supported by the url + parameter, plus the following: +
    +
  • {i}: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.
  • +
  • {j}: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.
  • +
  • {reverseI}: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.
  • +
  • {reverseJ}: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.
  • +
  • {longitudeDegrees}: The longitude of the picked position in degrees.
  • +
  • {latitudeDegrees}: The latitude of the picked position in degrees.
  • +
  • {longitudeProjected}: The longitude of the picked position in the projected coordinates of the tiling scheme.
  • +
  • {latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.
  • +
  • {format}: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.
  • +
* @property [urlSchemeZeroPadding] - Gets the URL scheme zero padding for each tile coordinate. The format is '000' where - * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting: - * urlSchemeZeroPadding : { '{x}' : '0000'} - * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. - * It the passed object has the following keywords: - *
    - *
  • {z}: The zero padding for the level of the tile in the tiling scheme.
  • - *
  • {x}: The zero padding for the tile X coordinate in the tiling scheme.
  • - *
  • {y}: The zero padding for the the tile Y coordinate in the tiling scheme.
  • - *
  • {reverseX}: The zero padding for the tile reverseX coordinate in the tiling scheme.
  • - *
  • {reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme.
  • - *
  • {reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
  • - *
+ each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting: + urlSchemeZeroPadding : { '{x}' : '0000'} + will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. + It the passed object has the following keywords: +
    +
  • {z}: The zero padding for the level of the tile in the tiling scheme.
  • +
  • {x}: The zero padding for the tile X coordinate in the tiling scheme.
  • +
  • {y}: The zero padding for the the tile Y coordinate in the tiling scheme.
  • +
  • {reverseX}: The zero padding for the tile reverseX coordinate in the tiling scheme.
  • +
  • {reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme.
  • +
  • {reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
  • +
* @property [subdomains = 'abc'] - The subdomains to use for the {s} placeholder in the URL template. - * If this parameter is a single string, each character in the string is a subdomain. If it is - * an array, each element in the array is a subdomain. + If this parameter is a single string, each character in the string is a subdomain. If it is + an array, each element in the array is a subdomain. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying - * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely - * to result in rendering problems. + this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely + to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. * @property [tilingScheme = WebMercatorTilingScheme] - The tiling scheme specifying how the ellipsoidal - * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} - * is used. + surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} + is used. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. * @property [tileWidth = 256] - Pixel width of image tiles. * @property [tileHeight = 256] - Pixel height of image tiles. * @property [hasAlphaChannel = true] - true if the images provided by this imagery provider - * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if - * present, will be ignored. If this property is true, any images without an alpha channel will - * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are potentially reduced. + include an alpha channel; otherwise, false. If this property is false, an alpha channel, if + present, will be ignored. If this property is true, any images without an alpha channel will + be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are potentially reduced. * @property [getFeatureInfoFormats] - The formats in which to get feature information at a - * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this - * parameter is not specified, feature picking is disabled. + specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this + parameter is not specified, feature picking is disabled. * @property [enablePickFeatures = true] - If true, {@link UrlTemplateImageryProvider#pickFeatures} will - * request the pickFeaturesUrl and attempt to interpret the features included in the response. If false, - * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable - * features) without communicating with the server. Set this property to false if you know your data - * source does not support picking features or if you don't want this provider's features to be pickable. Note - * that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures} - * property. + request the pickFeaturesUrl and attempt to interpret the features included in the response. If false, + {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable + features) without communicating with the server. Set this property to false if you know your data + source does not support picking features or if you don't want this provider's features to be pickable. Note + that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures} + property. * @property [customTags] - Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values. */ type ConstructorOptions = { @@ -38669,63 +38817,63 @@ export namespace UrlTemplateImageryProvider { * Provides imagery by requesting tiles using a specified URL template. * @example * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project - * var tms = new Cesium.UrlTemplateImageryProvider({ - * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg', - * credit : '© Analytical Graphics, Inc.', - * tilingScheme : new Cesium.GeographicTilingScheme(), - * maximumLevel : 5 - * }); - * // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme. - * var positron = new Cesium.UrlTemplateImageryProvider({ - * url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', - * credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.' - * }); - * // Access a Web Map Service (WMS) server. - * var wms = new Cesium.UrlTemplateImageryProvider({ - * url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' + - * 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' + - * 'styles=&service=WMS&version=1.1.1&request=GetMap&' + - * 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' + - * 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' + - * 'width=256&height=256', - * rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013) - * }); - * // Using custom tags in your template url. - * var custom = new Cesium.UrlTemplateImageryProvider({ - * url : 'https://yoururl/{Time}/{z}/{y}/{x}.png', - * customTags : { - * Time: function(imageryProvider, x, y, level) { - * return '20171231' - * } - * } - * }); +var tms = new Cesium.UrlTemplateImageryProvider({ + url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg', + credit : '© Analytical Graphics, Inc.', + tilingScheme : new Cesium.GeographicTilingScheme(), + maximumLevel : 5 +}); +// Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme. +var positron = new Cesium.UrlTemplateImageryProvider({ + url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', + credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.' +}); +// Access a Web Map Service (WMS) server. +var wms = new Cesium.UrlTemplateImageryProvider({ + url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' + + 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' + + 'styles=&service=WMS&version=1.1.1&request=GetMap&' + + 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' + + 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' + + 'width=256&height=256', + rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013) +}); +// Using custom tags in your template url. +var custom = new Cesium.UrlTemplateImageryProvider({ + url : 'https://yoururl/{Time}/{z}/{y}/{x}.png', + customTags : { + Time: function(imageryProvider, x, y, level) { + return '20171231' + } + } +}); * @param options - Object describing initialization options */ export class UrlTemplateImageryProvider { constructor(options: UrlTemplateImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -38734,7 +38882,7 @@ export class UrlTemplateImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -38751,67 +38899,67 @@ export class UrlTemplateImageryProvider { defaultMagnificationFilter: TextureMagnificationFilter; /** * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will - * request the options.pickFeaturesUrl and attempt to interpret the features included in the response. If false, - * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable - * features) without communicating with the server. Set this property to false if you know your data - * source does not support picking features or if you don't want this provider's features to be pickable. + request the options.pickFeaturesUrl and attempt to interpret the features included in the response. If false, + {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable + features) without communicating with the server. Set this property to false if you know your data + source does not support picking features or if you don't want this provider's features to be pickable. */ enablePickFeatures: boolean; /** * Gets the URL template to use to request tiles. It has the following keywords: - *
    - *
  • {z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.
  • - *
  • {x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.
  • - *
  • {y}: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.
  • - *
  • {s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.
  • - *
  • {reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.
  • - *
  • {reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.
  • - *
  • {reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.
  • - *
  • {westDegrees}: The Western edge of the tile in geodetic degrees.
  • - *
  • {southDegrees}: The Southern edge of the tile in geodetic degrees.
  • - *
  • {eastDegrees}: The Eastern edge of the tile in geodetic degrees.
  • - *
  • {northDegrees}: The Northern edge of the tile in geodetic degrees.
  • - *
  • {westProjected}: The Western edge of the tile in projected coordinates of the tiling scheme.
  • - *
  • {southProjected}: The Southern edge of the tile in projected coordinates of the tiling scheme.
  • - *
  • {eastProjected}: The Eastern edge of the tile in projected coordinates of the tiling scheme.
  • - *
  • {northProjected}: The Northern edge of the tile in projected coordinates of the tiling scheme.
  • - *
  • {width}: The width of each tile in pixels.
  • - *
  • {height}: The height of each tile in pixels.
  • - *
+
    +
  • {z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.
  • +
  • {x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.
  • +
  • {y}: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.
  • +
  • {s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.
  • +
  • {reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.
  • +
  • {reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.
  • +
  • {reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.
  • +
  • {westDegrees}: The Western edge of the tile in geodetic degrees.
  • +
  • {southDegrees}: The Southern edge of the tile in geodetic degrees.
  • +
  • {eastDegrees}: The Eastern edge of the tile in geodetic degrees.
  • +
  • {northDegrees}: The Northern edge of the tile in geodetic degrees.
  • +
  • {westProjected}: The Western edge of the tile in projected coordinates of the tiling scheme.
  • +
  • {southProjected}: The Southern edge of the tile in projected coordinates of the tiling scheme.
  • +
  • {eastProjected}: The Eastern edge of the tile in projected coordinates of the tiling scheme.
  • +
  • {northProjected}: The Northern edge of the tile in projected coordinates of the tiling scheme.
  • +
  • {width}: The width of each tile in pixels.
  • +
  • {height}: The height of each tile in pixels.
  • +
*/ readonly url: string; /** * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on - * the left with zeros to match the width of the passed string of zeros. e.g. Setting: - * urlSchemeZeroPadding : { '{x}' : '0000'} - * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. - * It has the following keywords: - *
    - *
  • {z}: The zero padding for the level of the tile in the tiling scheme.
  • - *
  • {x}: The zero padding for the tile X coordinate in the tiling scheme.
  • - *
  • {y}: The zero padding for the the tile Y coordinate in the tiling scheme.
  • - *
  • {reverseX}: The zero padding for the tile reverseX coordinate in the tiling scheme.
  • - *
  • {reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme.
  • - *
  • {reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
  • - *
+ the left with zeros to match the width of the passed string of zeros. e.g. Setting: + urlSchemeZeroPadding : { '{x}' : '0000'} + will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. + It has the following keywords: +
    +
  • {z}: The zero padding for the level of the tile in the tiling scheme.
  • +
  • {x}: The zero padding for the tile X coordinate in the tiling scheme.
  • +
  • {y}: The zero padding for the the tile Y coordinate in the tiling scheme.
  • +
  • {reverseX}: The zero padding for the tile reverseX coordinate in the tiling scheme.
  • +
  • {reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme.
  • +
  • {reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
  • +
*/ readonly urlSchemeZeroPadding: any; /** * Gets the URL template to use to use to pick features. If this property is not specified, - * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no - * features picked. The URL template supports all of the keywords supported by the - * {@link UrlTemplateImageryProvider#url} property, plus the following: - *
    - *
  • {i}: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.
  • - *
  • {j}: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.
  • - *
  • {reverseI}: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.
  • - *
  • {reverseJ}: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.
  • - *
  • {longitudeDegrees}: The longitude of the picked position in degrees.
  • - *
  • {latitudeDegrees}: The latitude of the picked position in degrees.
  • - *
  • {longitudeProjected}: The longitude of the picked position in the projected coordinates of the tiling scheme.
  • - *
  • {latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.
  • - *
  • {format}: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.
  • - *
+ {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no + features picked. The URL template supports all of the keywords supported by the + {@link UrlTemplateImageryProvider#url} property, plus the following: +
    +
  • {i}: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.
  • +
  • {j}: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.
  • +
  • {reverseI}: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.
  • +
  • {reverseJ}: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.
  • +
  • {longitudeDegrees}: The longitude of the picked position in degrees.
  • +
  • {latitudeDegrees}: The latitude of the picked position in degrees.
  • +
  • {longitudeProjected}: The longitude of the picked position in the projected coordinates of the tiling scheme.
  • +
  • {latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.
  • +
  • {format}: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.
  • +
*/ readonly pickFeaturesUrl: string; /** @@ -38820,45 +38968,45 @@ export class UrlTemplateImageryProvider { readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link UrlTemplateImageryProvider#ready} returns true. + not be called before {@link UrlTemplateImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link UrlTemplateImageryProvider#ready} returns true. + not be called before {@link UrlTemplateImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit. - * This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true. + This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link UrlTemplateImageryProvider#ready} returns true. + not be called before {@link UrlTemplateImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link UrlTemplateImageryProvider#ready} returns true. + not be called before {@link UrlTemplateImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link UrlTemplateImageryProvider#ready} returns true. + not be called before {@link UrlTemplateImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link UrlTemplateImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link UrlTemplateImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -38871,21 +39019,21 @@ export class UrlTemplateImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. This function should - * not be called before {@link ImageryProvider#ready} returns true. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. This function should + not be called before {@link ImageryProvider#ready} returns true. */ readonly hasAlphaChannel: boolean; /** * Reinitializes this instance. Reinitializing an instance already in use is supported, but it is not - * recommended because existing tiles provided by the imagery provider will not be updated. + recommended because existing tiles provided by the imagery provider will not be updated. * @param options - Any of the options that may be passed to the {@link UrlTemplateImageryProvider} constructor. */ reinitialize(options: Promise | any): void; @@ -38899,42 +39047,42 @@ export class UrlTemplateImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link UrlTemplateImageryProvider#ready} returns true. + not be called before {@link UrlTemplateImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within - * a tile. This function should not be called before {@link ImageryProvider#ready} returns true. + a tile. This function should not be called before {@link ImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } /** * The vertical location of an origin relative to an object, e.g., a {@link Billboard} - * or {@link Label}. For example, setting the vertical origin to TOP - * or BOTTOM will display a billboard above or below (in screen space) - * the anchor position. - *

- *
- *
- *
+or {@link Label}. For example, setting the vertical origin to TOP +or BOTTOM will display a billboard above or below (in screen space) +the anchor position. +

+
+
+
*/ export enum VerticalOrigin { /** @@ -38959,7 +39107,7 @@ export enum VerticalOrigin { * A viewport aligned quad. * @example * var viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40)); - * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0); +viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0); * @param [rectangle] - The {@link BoundingRectangle} defining the quad's position within the viewport. * @param [material] - The {@link Material} defining the surface appearance of the viewport quad. */ @@ -38977,42 +39125,42 @@ export class ViewportQuad { rectangle: BoundingRectangle; /** * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with - * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. - *

- * The default material is Material.ColorType. - *

+ {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. +

+ The default material is Material.ColorType. +

* @example * // 1. Change the color of the default material to yellow - * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); - * - * // 2. Change material to horizontal stripes - * viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType); + viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); + + // 2. Change material to horizontal stripes + viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType); */ material: Material; /** * Called when {@link Viewer} or {@link CesiumWidget} render the scene to - * get the draw commands needed to render this primitive. - *

- * Do not call this function directly. This is documented just to - * list the exceptions that may be propagated when the scene is rendered: - *

+ get the draw commands needed to render this primitive. +

+ Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: +

*/ update(): void; /** * Returns true if this object was destroyed; otherwise, false. - *

- * If this object was destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. +

+ If this object was destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. * @returns True if this object was destroyed; otherwise, false. */ isDestroyed(): boolean; /** * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic - * release of WebGL resources, instead of relying on the garbage collector to destroy this object. - *

- * Once an object is destroyed, it should not be used; calling any function other than - * isDestroyed will result in a {@link DeveloperError} exception. Therefore, - * assign the return value (undefined) to the object as done in the example. + release of WebGL resources, instead of relying on the garbage collector to destroy this object. +

+ Once an object is destroyed, it should not be used; calling any function other than + isDestroyed will result in a {@link DeveloperError} exception. Therefore, + assign the return value (undefined) to the object as done in the example. * @example * quad = quad && quad.destroy(); */ @@ -39027,31 +39175,31 @@ export namespace WebMapServiceImageryProvider { * @property [parameters = WebMapServiceImageryProvider.DefaultParameters] - Additional parameters to pass to the WMS server in the GetMap URL. * @property [getFeatureInfoParameters = WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] - Additional parameters to pass to the WMS server in the GetFeatureInfo URL. * @property [enablePickFeatures = true] - If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke - * the GetFeatureInfo operation on the WMS server and return the features included in the response. If false, - * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) - * without communicating with the server. Set this property to false if you know your WMS server does not support - * GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically - * overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property. + the GetFeatureInfo operation on the WMS server and return the features included in the response. If false, + {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) + without communicating with the server. Set this property to false if you know your WMS server does not support + GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically + overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property. * @property [getFeatureInfoFormats = WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats - * in which to try WMS GetFeatureInfo requests. + in which to try WMS GetFeatureInfo requests. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, - * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither - * parameter is specified, the WGS84 ellipsoid is used. + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. * @property [tileWidth = 256] - The width of each tile in pixels. * @property [tileHeight = 256] - The height of each tile in pixels. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when - * specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is - * likely to result in rendering problems. + specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is + likely to result in rendering problems. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. - * If not specified, there is no limit. + If not specified, there is no limit. * @property [crs] - CRS specification, for use with WMS specification >= 1.3.0. * @property [srs] - SRS specification, for use with WMS specification 1.1.0 or 1.1.1 * @property [credit] - A credit for the data source, which is displayed on the canvas. * @property [subdomains = 'abc'] - The subdomains to use for the {s} placeholder in the URL template. - * If this parameter is a single string, each character in the string is a subdomain. If it is - * an array, each element in the array is a subdomain. + If this parameter is a single string, each character in the string is a subdomain. If it is + an array, each element in the array is a subdomain. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified. * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. */ @@ -39082,39 +39230,39 @@ export namespace WebMapServiceImageryProvider { * Provides tiled imagery hosted by a Web Map Service (WMS) server. * @example * var provider = new Cesium.WebMapServiceImageryProvider({ - * url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer', - * layers : '0', - * proxy: new Cesium.DefaultProxy('/proxy/') - * }); - * - * viewer.imageryLayers.addImageryProvider(provider); + url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer', + layers : '0', + proxy: new Cesium.DefaultProxy('/proxy/') +}); + +viewer.imageryLayers.addImageryProvider(provider); * @param options - Object describing initialization options */ export class WebMapServiceImageryProvider { constructor(options: WebMapServiceImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -39123,7 +39271,7 @@ export class WebMapServiceImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -39152,45 +39300,45 @@ export class WebMapServiceImageryProvider { readonly layers: string; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link WebMapServiceImageryProvider#ready} returns true. + not be called before {@link WebMapServiceImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link WebMapServiceImageryProvider#ready} returns true. + not be called before {@link WebMapServiceImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link WebMapServiceImageryProvider#ready} returns true. + not be called before {@link WebMapServiceImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link WebMapServiceImageryProvider#ready} returns true. + not be called before {@link WebMapServiceImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link WebMapServiceImageryProvider#ready} returns true. + not be called before {@link WebMapServiceImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link WebMapServiceImageryProvider#ready} returns true. + not be called before {@link WebMapServiceImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link WebMapServiceImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -39203,23 +39351,23 @@ export class WebMapServiceImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will - * invoke the GetFeatureInfo service on the WMS server and attempt to interpret the features included in the response. If false, - * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable - * features) without communicating with the server. Set this property to false if you know your data - * source does not support picking features or if you don't want this provider's features to be pickable. + invoke the GetFeatureInfo service on the WMS server and attempt to interpret the features included in the response. If false, + {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable + features) without communicating with the server. Set this property to false if you know your data + source does not support picking features or if you don't want this provider's features to be pickable. */ enablePickFeatures: boolean; /** @@ -39228,8 +39376,8 @@ export class WebMapServiceImageryProvider { clock: Clock; /** * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each - * TimeInterval is an object containing the keys and values of the properties that are used during - * tile requests. + TimeInterval is an object containing the keys and values of the properties that are used during + tile requests. */ times: TimeIntervalCollection; /** @@ -39242,44 +39390,44 @@ export class WebMapServiceImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link WebMapServiceImageryProvider#ready} returns true. + not be called before {@link WebMapServiceImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Asynchronously determines what features, if any, are located at a given longitude and latitude within - * a tile. This function should not be called before {@link ImageryProvider#ready} returns true. + a tile. This function should not be called before {@link ImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; /** * The default parameters to include in the WMS URL to obtain images. The values are as follows: - * service=WMS - * version=1.1.1 - * request=GetMap - * styles= - * format=image/jpeg + service=WMS + version=1.1.1 + request=GetMap + styles= + format=image/jpeg */ static readonly DefaultParameters: any; /** * The default parameters to include in the WMS URL to get feature information. The values are as follows: - * service=WMS - * version=1.1.1 - * request=GetFeatureInfo + service=WMS + version=1.1.1 + request=GetFeatureInfo */ static readonly GetFeatureInfoDefaultParameters: any; } @@ -39305,8 +39453,8 @@ export namespace WebMapTileServiceImageryProvider { * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. * @property [credit] - A credit for the data source, which is displayed on the canvas. * @property [subdomains = 'abc'] - The subdomains to use for the {s} placeholder in the URL template. - * If this parameter is a single string, each character in the string is a subdomain. If it is - * an array, each element in the array is a subdomain. + If this parameter is a single string, each character in the string is a subdomain. If it is + an array, each element in the array is a subdomain. */ type ConstructorOptions = { url: Resource | string; @@ -39332,81 +39480,81 @@ export namespace WebMapTileServiceImageryProvider { /** * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers. - * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding. +This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding. * @example * // Example 1. USGS shaded relief tiles (KVP) - * var shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({ - * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS', - * layer : 'USGSShadedReliefOnly', - * style : 'default', - * format : 'image/jpeg', - * tileMatrixSetID : 'default028mm', - * // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...], - * maximumLevel: 19, - * credit : new Cesium.Credit('U. S. Geological Survey') - * }); - * viewer.imageryLayers.addImageryProvider(shadedRelief1); +var shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({ + url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS', + layer : 'USGSShadedReliefOnly', + style : 'default', + format : 'image/jpeg', + tileMatrixSetID : 'default028mm', + // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...], + maximumLevel: 19, + credit : new Cesium.Credit('U. S. Geological Survey') +}); +viewer.imageryLayers.addImageryProvider(shadedRelief1); * @example * // Example 2. USGS shaded relief tiles (RESTful) - * var shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({ - * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg', - * layer : 'USGSShadedReliefOnly', - * style : 'default', - * format : 'image/jpeg', - * tileMatrixSetID : 'default028mm', - * maximumLevel: 19, - * credit : new Cesium.Credit('U. S. Geological Survey') - * }); - * viewer.imageryLayers.addImageryProvider(shadedRelief2); +var shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({ + url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg', + layer : 'USGSShadedReliefOnly', + style : 'default', + format : 'image/jpeg', + tileMatrixSetID : 'default028mm', + maximumLevel: 19, + credit : new Cesium.Credit('U. S. Geological Survey') +}); +viewer.imageryLayers.addImageryProvider(shadedRelief2); * @example * // Example 3. NASA time dynamic weather data (RESTful) - * var times = Cesium.TimeIntervalCollection.fromIso8601({ - * iso8601: '2015-07-30/2017-06-16/P1D', - * dataCallback: function dataCallback(interval, index) { - * return { - * Time: Cesium.JulianDate.toIso8601(interval.start) - * }; - * } - * }); - * var weather = new Cesium.WebMapTileServiceImageryProvider({ - * url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png', - * layer : 'AMSR2_Snow_Water_Equivalent', - * style : 'default', - * tileMatrixSetID : '2km', - * maximumLevel : 5, - * format : 'image/png', - * clock: clock, - * times: times, - * credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS') - * }); - * viewer.imageryLayers.addImageryProvider(weather); +var times = Cesium.TimeIntervalCollection.fromIso8601({ + iso8601: '2015-07-30/2017-06-16/P1D', + dataCallback: function dataCallback(interval, index) { + return { + Time: Cesium.JulianDate.toIso8601(interval.start) + }; + } +}); +var weather = new Cesium.WebMapTileServiceImageryProvider({ + url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png', + layer : 'AMSR2_Snow_Water_Equivalent', + style : 'default', + tileMatrixSetID : '2km', + maximumLevel : 5, + format : 'image/png', + clock: clock, + times: times, + credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS') +}); +viewer.imageryLayers.addImageryProvider(weather); * @param options - Object describing initialization options */ export class WebMapTileServiceImageryProvider { constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions); /** * The default alpha blending value of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultAlpha: number | undefined; /** * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultNightAlpha: number | undefined; /** * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and - * 1.0 representing fully opaque. + 1.0 representing fully opaque. */ defaultDayAlpha: number | undefined; /** * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 - * makes the imagery darker while greater than 1.0 makes it brighter. + makes the imagery darker while greater than 1.0 makes it brighter. */ defaultBrightness: number | undefined; /** * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces - * the contrast while greater than 1.0 increases it. + the contrast while greater than 1.0 increases it. */ defaultContrast: number | undefined; /** @@ -39415,7 +39563,7 @@ export class WebMapTileServiceImageryProvider { defaultHue: number | undefined; /** * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the - * saturation while greater than 1.0 increases it. + saturation while greater than 1.0 increases it. */ defaultSaturation: number | undefined; /** @@ -39440,45 +39588,45 @@ export class WebMapTileServiceImageryProvider { readonly proxy: Proxy; /** * Gets the width of each tile, in pixels. This function should - * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. */ readonly tileWidth: number; /** * Gets the height of each tile, in pixels. This function should - * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. */ readonly tileHeight: number; /** * Gets the maximum level-of-detail that can be requested. This function should - * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. */ readonly maximumLevel: number | undefined; /** * Gets the minimum level-of-detail that can be requested. This function should - * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. */ readonly minimumLevel: number; /** * Gets the tiling scheme used by this provider. This function should - * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. */ readonly tilingScheme: TilingScheme; /** * Gets the rectangle, in radians, of the imagery provided by this instance. This function should - * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. */ readonly rectangle: Rectangle; /** * Gets the tile discard policy. If not undefined, the discard policy is responsible - * for filtering out "missing" tiles via its shouldDiscardImage function. If this function - * returns undefined, no tiles are filtered. This function should - * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. */ readonly tileDiscardPolicy: TileDiscardPolicy; /** * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing - * to the event, you will be notified of the error and can potentially recover from it. Event listeners - * are passed an instance of {@link TileProviderError}. + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. */ readonly errorEvent: Event; /** @@ -39495,15 +39643,15 @@ export class WebMapTileServiceImageryProvider { readonly readyPromise: Promise; /** * Gets the credit to display when this imagery provider is active. Typically this is used to credit - * the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. */ readonly credit: Credit; /** * Gets a value indicating whether or not the images provided by this imagery provider - * include an alpha channel. If this property is false, an alpha channel, if present, will - * be ignored. If this property is true, any images without an alpha channel will be treated - * as if their alpha is 1.0 everywhere. When this property is false, memory usage - * and texture upload time are reduced. + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. */ readonly hasAlphaChannel: boolean; /** @@ -39512,8 +39660,8 @@ export class WebMapTileServiceImageryProvider { clock: Clock; /** * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each - * TimeInterval is an object containing the keys and values of the properties that are used during - * tile requests. + TimeInterval is an object containing the keys and values of the properties that are used during + tile requests. */ times: TimeIntervalCollection; /** @@ -39530,206 +39678,68 @@ export class WebMapTileServiceImageryProvider { getTileCredits(x: number, y: number, level: number): Credit[]; /** * Requests the image for a given tile. This function should - * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param [request] - The request object. Intended for internal use only. * @returns A promise for the image that will resolve when the image is available, or - * undefined if there are too many active requests to the server, and the request - * should be retried later. The resolved image may be either an - * Image or a Canvas DOM object. + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. */ requestImage(x: number, y: number, level: number, request?: Request): Promise | undefined; /** * Picking features is not currently supported by this imagery provider, so this function simply returns - * undefined. + undefined. * @param x - The tile X coordinate. * @param y - The tile Y coordinate. * @param level - The tile level. * @param longitude - The longitude at which to pick features. * @param latitude - The latitude at which to pick features. * @returns A promise for the picked features that will resolve when the asynchronous - * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} - * instances. The array may be empty if no features are found at the given location. - * It may also be undefined if picking is not supported. + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. */ pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise | undefined; } -/** - * @property height - The height. - * @property color - The color at this height. - */ -export type createElevationBandMaterialEntry = { - height: number; - color: Color; -}; - -/** - * @property entries - A list of elevation entries. They will automatically be sorted from lowest to highest. If there is only one entry and extendsDownards and extendUpwards are both false, they will both be set to true. - * @property [extendDownwards = false] - If true, the band's minimum elevation color will extend infinitely downwards. - * @property [extendUpwards = false] - If true, the band's maximum elevation color will extend infinitely upwards. - */ -export type createElevationBandMaterialBand = { - entries: createElevationBandMaterialEntry[]; - extendDownwards?: boolean; - extendUpwards?: boolean; -}; - -/** - * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights. - * - * The shader does a binary search over all the heights to find out which colors are above and below a given height, and - * interpolates between them for the final color. This material supports hundreds of entries relatively cheaply. - * @example - * scene.globe.material = Cesium.createElevationBandMaterial({ - * scene : scene, - * layers : [{ - * entries : [{ - * height : 4200.0, - * color : new Cesium.Color(0.0, 0.0, 0.0, 1.0) - * }, { - * height : 8848.0, - * color : new Cesium.Color(1.0, 1.0, 1.0, 1.0) - * }], - * extendDownwards : true, - * extendUpwards : true, - * }, { - * entries : [{ - * height : 7000.0, - * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) - * }, { - * height : 7100.0, - * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) - * }] - * }] - * }); - * @param options - Object with the following properties: - * @param options.scene - The scene where the visualization is taking place. - * @param options.layers - A list of bands ordered from lowest to highest precedence. - * @returns A new {@link Material} instance. - */ -export function createElevationBandMaterial(options: { - scene: Scene; - layers: createElevationBandMaterialBand[]; -}): Material; - -/** - * Creates a {@link Cesium3DTileset} instance for the - * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings} - * tileset. - * @example - * // Create Cesium OSM Buildings with default styling - * var viewer = new Cesium.Viewer('cesiumContainer'); - * viewer.scene.primitives.add(Cesium.createOsmBuildings()); - * @example - * // Create Cesium OSM Buildings with a custom style highlighting - * // schools and hospitals. - * viewer.scene.primitives.add(Cesium.createOsmBuildings({ - * style: new Cesium.Cesium3DTileStyle({ - * color: { - * conditions: [ - * ["${feature['building']} === 'hospital'", "color('#0000FF')"], - * ["${feature['building']} === 'school'", "color('#00FF00')"], - * [true, "color('#ffffff')"] - * ] - * } - * }) - * })); - * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor - * may be specified here. In addition to those, the following properties are supported: - * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings - * that do not have a color. This parameter is ignored if options.style is specified. - * @param [options.style] - The style to use with the tileset. If not - * specified, a default style is used which gives each building or building part a - * color inferred from its OpenStreetMap tags. If no color can be inferred, - * options.defaultColor is used. - */ -export function createOsmBuildings(options?: { - defaultColor?: Color; - style?: Cesium3DTileStyle; -}): Cesium3DTileset; - -/** - * Creates a {@link Primitive} to visualize well-known vector vertex attributes: - * normal, tangent, and bitangent. Normal - * is red; tangent is green; and bitangent is blue. If an attribute is not - * present, it is not drawn. - * @example - * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({ - * geometry : instance.geometry, - * length : 100000.0, - * modelMatrix : instance.modelMatrix - * })); - * @param options - Object with the following properties: - * @param options.geometry - The Geometry instance with the attribute. - * @param [options.length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction. - * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates. - * @returns A new Primitive instance with geometry for the vectors. - */ -export function createTangentSpaceDebugPrimitive(options: { - geometry: Geometry; - length?: number; - modelMatrix?: Matrix4; -}): Primitive; - -/** - * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps. - * @example - * // Create Cesium World Terrain with default settings - * var viewer = new Cesium.Viewer('cesiumContainer', { - * imageryProvider : Cesium.createWorldImagery(); - * }); - * @example - * // Create Cesium World Terrain with water and normals. - * var viewer = new Cesium.Viewer('cesiumContainer', { - * imageryProvider : Cesium.createWorldImagery({ - * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS - * }) - * }); - * @param [options] - Object with the following properties: - * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported. - */ -export function createWorldImagery(options?: { - style?: IonWorldImageryStyle; -}): IonImageryProvider; - /** * - * - *
Animation widget - *
- *

- * The Animation widget provides buttons for play, pause, and reverse, along with the - * current time and date, surrounded by a "shuttle ring" for controlling the speed of animation. - *

- * The "shuttle ring" concept is borrowed from video editing, where typically a - * "jog wheel" can be rotated to move past individual animation frames very slowly, and - * a surrounding shuttle ring can be twisted to control direction and speed of fast playback. - * Cesium typically treats time as continuous (not broken into pre-defined animation frames), - * so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and - * very slow playback. Click and drag the shuttle ring pointer itself (shown above in green), - * or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction. - *

- * The Animation widget also provides a "realtime" button (in the upper-left) that keeps - * animation time in sync with the end user's system clock, typically displaying - * "today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or - * {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime. + +
Animation widget + +

+The Animation widget provides buttons for play, pause, and reverse, along with the +current time and date, surrounded by a "shuttle ring" for controlling the speed of animation. +

+The "shuttle ring" concept is borrowed from video editing, where typically a +"jog wheel" can be rotated to move past individual animation frames very slowly, and +a surrounding shuttle ring can be twisted to control direction and speed of fast playback. +Cesium typically treats time as continuous (not broken into pre-defined animation frames), +so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and +very slow playback. Click and drag the shuttle ring pointer itself (shown above in green), +or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction. +

+The Animation widget also provides a "realtime" button (in the upper-left) that keeps +animation time in sync with the end user's system clock, typically displaying +"today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or +{@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime. * @example * // In HTML head, include a link to Animation.css stylesheet, - * // and in the body, include:
- * - * var clock = new Cesium.Clock(); - * var clockViewModel = new Cesium.ClockViewModel(clock); - * var viewModel = new Cesium.AnimationViewModel(clockViewModel); - * var widget = new Cesium.Animation('animationContainer', viewModel); - * - * function tick() { - * clock.tick(); - * Cesium.requestAnimationFrame(tick); - * } - * Cesium.requestAnimationFrame(tick); +// and in the body, include:
+ +var clock = new Cesium.Clock(); +var clockViewModel = new Cesium.ClockViewModel(clock); +var viewModel = new Cesium.AnimationViewModel(clockViewModel); +var widget = new Cesium.Animation('animationContainer', viewModel); + +function tick() { + clock.tick(); + Cesium.requestAnimationFrame(tick); +} +Cesium.requestAnimationFrame(tick); * @param container - The DOM element or ID that will contain the widget. * @param viewModel - The view model used by this widget. */ @@ -39749,20 +39759,20 @@ export class Animation { isDestroyed(): boolean; /** * Destroys the animation widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; /** * Resizes the widget to match the container size. - * This function should be called whenever the container size is changed. + This function should be called whenever the container size is changed. */ resize(): void; /** * Updates the widget to reflect any modified CSS rules for theming. * @example * //Switch to the cesium-lighter theme. - * document.body.className = 'cesium-lighter'; - * animation.applyThemeChanges(); + document.body.className = 'cesium-lighter'; + animation.applyThemeChanges(); */ applyThemeChanges(): void; } @@ -39779,8 +39789,8 @@ export class AnimationViewModel { shuttleRingDragging: boolean; /** * Gets or sets whether dragging the shuttle ring should cause the multiplier - * to snap to the defined tick values rather than interpolating between them. - * This property is observable. + to snap to the defined tick values rather than interpolating between them. + This property is observable. */ snapToTicks: boolean; /** @@ -39818,10 +39828,10 @@ export class AnimationViewModel { getShuttleRingTicks(): number[]; /** * Sets the array of positive known clock multipliers to associate with the shuttle ring. - * These values will have negative equivalents created for them and sets both the minimum - * and maximum range of values for the shuttle ring as well as the values that are snapped - * to when a single click is made. The values need not be in order, as they will be sorted - * automatically, and duplicate values will be removed. + These values will have negative equivalents created for them and sets both the minimum + and maximum range of values for the shuttle ring as well as the values that are snapped + to when a single click is made. The values need not be in order, as they will be sorted + automatically, and duplicate values will be removed. * @param positiveTicks - The list of known positive clock multipliers to associate with the shuttle ring. */ setShuttleRingTicks(positiveTicks: number[]): void; @@ -39880,66 +39890,66 @@ export namespace AnimationViewModel { /** * - * - *
BaseLayerPicker with its drop-panel open. - *
- *

- * The BaseLayerPicker is a single button widget that displays a panel of available imagery and - * terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted - * as the base layer of the imagery collection; removing the existing base. When terrain is selected, - * it replaces the current terrain provider. Each item in the available providers list contains a name, - * a representative icon, and a tooltip to display more information when hovered. The list is initially - * empty, and must be configured before use, as illustrated in the below example. + +
BaseLayerPicker with its drop-panel open. + +

+The BaseLayerPicker is a single button widget that displays a panel of available imagery and +terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted +as the base layer of the imagery collection; removing the existing base. When terrain is selected, +it replaces the current terrain provider. Each item in the available providers list contains a name, +a representative icon, and a tooltip to display more information when hovered. The list is initially +empty, and must be configured before use, as illustrated in the below example. * @example * // In HTML head, include a link to the BaseLayerPicker.css stylesheet, - * // and in the body, include:
- * - * //Create the list of available providers we would like the user to select from. - * //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image. - * var imageryViewModels = []; - * imageryViewModels.push(new Cesium.ProviderViewModel({ - * name : 'Open\u00adStreet\u00adMap', - * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'), - * tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \ - * map of the world.\nhttp://www.openstreetmap.org', - * creationFunction : function() { - * return new Cesium.OpenStreetMapImageryProvider({ - * url : 'https://a.tile.openstreetmap.org/' - * }); - * } - * })); - * - * imageryViewModels.push(new Cesium.ProviderViewModel({ - * name : 'Earth at Night', - * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'), - * tooltip : 'The lights of cities and villages trace the outlines of civilization \ - * in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.', - * creationFunction : function() { - * return new Cesium.IonImageryProvider({ assetId: 3812 }); - * } - * })); - * - * imageryViewModels.push(new Cesium.ProviderViewModel({ - * name : 'Natural Earth\u00a0II', - * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'), - * tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/', - * creationFunction : function() { - * return new Cesium.TileMapServiceImageryProvider({ - * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') - * }); - * } - * })); - * - * //Create a CesiumWidget without imagery, if you haven't already done so. - * var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false }); - * - * //Finally, create the baseLayerPicker widget using our view models. - * var layers = cesiumWidget.imageryLayers; - * var baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', { - * globe : cesiumWidget.scene.globe, - * imageryProviderViewModels : imageryViewModels - * }); +// and in the body, include:
+ +//Create the list of available providers we would like the user to select from. +//This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image. +var imageryViewModels = []; +imageryViewModels.push(new Cesium.ProviderViewModel({ + name : 'Open\u00adStreet\u00adMap', + iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'), + tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \ +map of the world.\nhttp://www.openstreetmap.org', + creationFunction : function() { + return new Cesium.OpenStreetMapImageryProvider({ + url : 'https://a.tile.openstreetmap.org/' + }); + } + })); + + imageryViewModels.push(new Cesium.ProviderViewModel({ + name : 'Earth at Night', + iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'), + tooltip : 'The lights of cities and villages trace the outlines of civilization \ +in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.', + creationFunction : function() { + return new Cesium.IonImageryProvider({ assetId: 3812 }); + } + })); + + imageryViewModels.push(new Cesium.ProviderViewModel({ + name : 'Natural Earth\u00a0II', + iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'), + tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/', + creationFunction : function() { + return new Cesium.TileMapServiceImageryProvider({ + url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + }); + } + })); + +//Create a CesiumWidget without imagery, if you haven't already done so. +var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false }); + +//Finally, create the baseLayerPicker widget using our view models. +var layers = cesiumWidget.imageryLayers; +var baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', { + globe : cesiumWidget.scene.globe, + imageryProviderViewModels : imageryViewModels +}); * @param container - The parent HTML container node or ID for this widget. * @param options - Object with the following properties: * @param options.globe - The Globe to use. @@ -39970,7 +39980,7 @@ export class BaseLayerPicker { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -39994,12 +40004,12 @@ export class BaseLayerPickerViewModel { }); /** * Gets or sets an array of ProviderViewModel instances available for imagery selection. - * This property is observable. + This property is observable. */ imageryProviderViewModels: ProviderViewModel[]; /** * Gets or sets an array of ProviderViewModel instances available for terrain selection. - * This property is observable. + This property is observable. */ terrainProviderViewModels: ProviderViewModel[]; /** @@ -40040,7 +40050,7 @@ export class BaseLayerPickerViewModel { * @param options.iconUrl - An icon representing the layer. * @param [options.category] - A category for the layer. * @param options.creationFunction - A function or Command - * that creates one or more providers which will be added to the globe when this item is selected. + that creates one or more providers which will be added to the globe when this item is selected. */ export class ProviderViewModel { constructor(options: { @@ -40064,7 +40074,7 @@ export class ProviderViewModel { iconUrl: string; /** * Gets the Command that creates one or more providers which will be added to - * the globe when this item is selected. + the globe when this item is selected. */ readonly creationCommand: Command; /** @@ -40101,7 +40111,7 @@ export class Cesium3DTilesInspector { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -40231,8 +40241,8 @@ export class Cesium3DTilesInspectorViewModel { dynamicScreenSpaceErrorDensity: number; /** * Gets or sets the dynamic screen space error density slider value. - * This allows the slider to be exponential because values tend to be closer to 0 than 1. - * This property is observable. + This allows the slider to be exponential because values tend to be closer to 0 than 1. + This property is observable. */ dynamicScreenSpaceErrorDensitySliderValue: number; /** @@ -40273,7 +40283,7 @@ export class Cesium3DTilesInspectorViewModel { pickActive: boolean; /** * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal. - * This property is observable. + This property is observable. */ skipLevelOfDetail: boolean; /** @@ -40290,12 +40300,12 @@ export class Cesium3DTilesInspectorViewModel { skipLevels: number; /** * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded. - * This property is observable. + This property is observable. */ immediatelyLoadDesiredLevelOfDetail: boolean; /** * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal. - * This property is observable + This property is observable */ loadSiblings: boolean; /** @@ -40388,7 +40398,7 @@ export class Cesium3DTilesInspectorViewModel { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; /** @@ -40421,7 +40431,7 @@ export class CesiumInspector { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -40635,7 +40645,7 @@ export class CesiumInspectorViewModel { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -40644,29 +40654,29 @@ export class CesiumInspectorViewModel { * A widget containing a Cesium scene. * @example * // For each example, include a link to CesiumWidget.css stylesheet in HTML head, - * // and in the body, include:
- * - * //Widget with no terrain and default Bing Maps imagery provider. - * var widget = new Cesium.CesiumWidget('cesiumContainer'); - * - * //Widget with ion imagery and Cesium World Terrain. - * var widget = new Cesium.CesiumWidget('cesiumContainer', { - * imageryProvider : Cesium.createWorldImagery(), - * terrainProvider : Cesium.createWorldTerrain(), - * skyBox : new Cesium.SkyBox({ - * sources : { - * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg', - * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg', - * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg', - * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg', - * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg', - * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg' - * } - * }), - * // Show Columbus View map with Web Mercator projection - * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, - * mapProjection : new Cesium.WebMercatorProjection() - * }); +// and in the body, include:
+ +//Widget with no terrain and default Bing Maps imagery provider. +var widget = new Cesium.CesiumWidget('cesiumContainer'); + +//Widget with ion imagery and Cesium World Terrain. +var widget = new Cesium.CesiumWidget('cesiumContainer', { + imageryProvider : Cesium.createWorldImagery(), + terrainProvider : Cesium.createWorldTerrain(), + skyBox : new Cesium.SkyBox({ + sources : { + positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg', + negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg', + positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg', + negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg', + positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg', + negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg' + } + }), + // Show Columbus View map with Web Mercator projection + sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, + mapProjection : new Cesium.WebMercatorProjection() +}); * @param container - The DOM element or ID that will contain the widget. * @param [options] - Object with the following properties: * @param [options.clock = new Clock()] - The clock to use to control current time. @@ -40685,7 +40695,7 @@ export class CesiumInspectorViewModel { * @param [options.showRenderLoopErrors = true] - If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs. * @param [options.contextOptions] - Context and WebGL creation properties corresponding to options passed to {@link Scene}. * @param [options.creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added - * to the bottom of the widget itself. + to the bottom of the widget itself. * @param [options.creditViewport] - The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. * @param [options.terrainExaggeration = 1.0] - A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid. * @param [options.shadows = false] - Determines if shadows are cast by light sources. @@ -40762,46 +40772,46 @@ export class CesiumWidget { readonly screenSpaceEventHandler: ScreenSpaceEventHandler; /** * Gets or sets the target frame rate of the widget when useDefaultRenderLoop - * is true. If undefined, the browser's {@link requestAnimationFrame} implementation - * determines the frame rate. If defined, this value must be greater than 0. A value higher - * than the underlying requestAnimationFrame implementation will have no effect. + is true. If undefined, the browser's {@link requestAnimationFrame} implementation + determines the frame rate. If defined, this value must be greater than 0. A value higher + than the underlying requestAnimationFrame implementation will have no effect. */ targetFrameRate: number; /** * Gets or sets whether or not this widget should control the render loop. - * If set to true the widget will use {@link requestAnimationFrame} to - * perform rendering and resizing of the widget, as well as drive the - * simulation clock. If set to false, you must manually call the - * resize, render methods as part of a custom - * render loop. If an error occurs during rendering, {@link Scene}'s - * renderError event will be raised and this property - * will be set to false. It must be set back to true to continue rendering - * after the error. + If set to true the widget will use {@link requestAnimationFrame} to + perform rendering and resizing of the widget, as well as drive the + simulation clock. If set to false, you must manually call the + resize, render methods as part of a custom + render loop. If an error occurs during rendering, {@link Scene}'s + renderError event will be raised and this property + will be set to false. It must be set back to true to continue rendering + after the error. */ useDefaultRenderLoop: boolean; /** * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve - * performance on less powerful devices while values greater than 1.0 will render at a higher - * resolution and then scale down, resulting in improved visual fidelity. - * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5 - * will cause the scene to be rendered at 320x240 and then scaled up while setting - * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down. + performance on less powerful devices while values greater than 1.0 will render at a higher + resolution and then scale down, resulting in improved visual fidelity. + For example, if the widget is laid out at a size of 640x480, setting this value to 0.5 + will cause the scene to be rendered at 320x240 and then scaled up while setting + it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down. */ resolutionScale: number; /** * Boolean flag indicating if the browser's recommended resolution is used. - * If true, the browser's device pixel ratio is ignored and 1.0 is used instead, - * effectively rendering based on CSS pixels instead of device pixels. This can improve - * performance on less powerful devices that have high pixel density. When false, rendering - * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether - * this flag is true or false. + If true, the browser's device pixel ratio is ignored and 1.0 is used instead, + effectively rendering based on CSS pixels instead of device pixels. This can improve + performance on less powerful devices that have high pixel density. When false, rendering + will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether + this flag is true or false. */ useBrowserRecommendedResolution: boolean; /** * Show an error panel to the user containing a title and a longer error message, - * which can be dismissed using an OK button. This panel is displayed automatically - * when a render loop error occurs, if showRenderLoopErrors was not false when the - * widget was constructed. + which can be dismissed using an OK button. This panel is displayed automatically + when a render loop error occurs, if showRenderLoopErrors was not false when the + widget was constructed. * @param title - The title to be displayed on the error panel. This string is interpreted as text. * @param [message] - A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML. * @param [error] - The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text. @@ -40813,18 +40823,18 @@ export class CesiumWidget { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; /** * Updates the canvas size, camera aspect ratio, and viewport size. - * This function is called automatically as needed unless - * useDefaultRenderLoop is set to false. + This function is called automatically as needed unless + useDefaultRenderLoop is set to false. */ resize(): void; /** * Renders the scene. This function is called automatically - * unless useDefaultRenderLoop is set to false; + unless useDefaultRenderLoop is set to false; */ render(): void; } @@ -40837,55 +40847,55 @@ export class ClockViewModel { constructor(clock?: Clock); /** * Gets the current system time. - * This property is observable. + This property is observable. */ systemTime: JulianDate; /** * Gets or sets the start time of the clock. - * See {@link Clock#startTime}. - * This property is observable. + See {@link Clock#startTime}. + This property is observable. */ startTime: JulianDate; /** * Gets or sets the stop time of the clock. - * See {@link Clock#stopTime}. - * This property is observable. + See {@link Clock#stopTime}. + This property is observable. */ stopTime: JulianDate; /** * Gets or sets the current time. - * See {@link Clock#currentTime}. - * This property is observable. + See {@link Clock#currentTime}. + This property is observable. */ currentTime: JulianDate; /** * Gets or sets the clock multiplier. - * See {@link Clock#multiplier}. - * This property is observable. + See {@link Clock#multiplier}. + This property is observable. */ multiplier: number; /** * Gets or sets the clock step setting. - * See {@link Clock#clockStep}. - * This property is observable. + See {@link Clock#clockStep}. + This property is observable. */ clockStep: ClockStep; /** * Gets or sets the clock range setting. - * See {@link Clock#clockRange}. - * This property is observable. + See {@link Clock#clockRange}. + This property is observable. */ clockRange: ClockRange; /** * Gets or sets whether the clock can animate. - * See {@link Clock#canAnimate}. - * This property is observable. + See {@link Clock#canAnimate}. + This property is observable. */ canAnimate: boolean; /** * Gets or sets whether the clock should animate. - * See {@link Clock#shouldAnimate}. - * This property is observable. + See {@link Clock#shouldAnimate}. + This property is observable. */ shouldAnimate: boolean; /** @@ -40894,8 +40904,8 @@ export class ClockViewModel { clock: Clock; /** * Updates the view model with the contents of the underlying clock. - * Can be called to force an update of the viewModel if the underlying - * clock has changed and Clock.tick has not yet been called. + Can be called to force an update of the viewModel if the underlying + clock has changed and Clock.tick has not yet been called. */ synchronize(): void; /** @@ -40904,18 +40914,18 @@ export class ClockViewModel { isDestroyed(): boolean; /** * Destroys the view model. Should be called to - * properly clean up the view model when it is no longer needed. + properly clean up the view model when it is no longer needed. */ destroy(): void; } /** * A Command is a function with an extra canExecute observable property to determine - * whether the command can be executed. When executed, a Command function will check the - * value of canExecute and throw if false. - * - * This type describes an interface and is not intended to be instantiated directly. - * See {@link createCommand} to create a command from a function. +whether the command can be executed. When executed, a Command function will check the +value of canExecute and throw if false. + +This type describes an interface and is not intended to be instantiated directly. +See {@link createCommand} to create a command from a function. */ export class Command { constructor(); @@ -40925,18 +40935,30 @@ export class Command { canExecute: boolean; /** * Gets an event which is raised before the command executes, the event - * is raised with an object containing two properties: a cancel property, - * which if set to false by the listener will prevent the command from being executed, and - * an args property, which is the array of arguments being passed to the command. + is raised with an object containing two properties: a cancel property, + which if set to false by the listener will prevent the command from being executed, and + an args property, which is the array of arguments being passed to the command. */ beforeExecute: Event; /** * Gets an event which is raised after the command executes, the event - * is raised with the return value of the command as its only parameter. + is raised with the return value of the command as its only parameter. */ afterExecute: Event; } +/** + * Create a Command from a given function, for use with ViewModels. + +A Command is a function with an extra canExecute observable property to determine +whether the command can be executed. When executed, a Command function will check the +value of canExecute and throw if false. It also provides events for when +a command has been or is about to be executed. + * @param func - The function to execute. + * @param [canExecute = true] - A boolean indicating whether the function can currently be executed. + */ +export function createCommand(func: (...params: any[]) => any, canExecute?: boolean): void; + /** * A single button widget for toggling fullscreen mode. * @param container - The DOM element or ID that will contain the widget. @@ -40958,7 +40980,7 @@ export class FullscreenButton { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -40984,7 +41006,7 @@ export class FullscreenButtonViewModel { tooltip: string; /** * Gets or sets the HTML element to place into fullscreen mode when the - * corresponding button is pressed. + corresponding button is pressed. */ fullscreenElement: Element; /** @@ -40997,14 +41019,14 @@ export class FullscreenButtonViewModel { isDestroyed(): boolean; /** * Destroys the view model. Should be called to - * properly clean up the view model when it is no longer needed. + properly clean up the view model when it is no longer needed. */ destroy(): void; } /** * A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is - * performed using {@link https://cesium.com/cesium-ion/|Cesium ion}. +performed using {@link https://cesium.com/cesium-ion/|Cesium ion}. * @param options - Object with the following properties: * @param options.container - The DOM element or ID that will contain the widget. * @param options.scene - The Scene instance to use. @@ -41040,7 +41062,7 @@ export class Geocoder { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -41059,8 +41081,8 @@ export namespace Geocoder { * @param options - Object with the following properties: * @param options.scene - The Scene instance to use. * @param [options.geocoderServices] - Geocoder services to use for geocoding queries. - * If more than one are supplied, suggestions will be gathered for the geocoders that support it, - * and if no suggestion is selected the result from the first geocoder service wil be used. + If more than one are supplied, suggestions will be gathered for the geocoders that support it, + and if no suggestion is selected the result from the first geocoder service wil be used. * @param [options.flightDuration] - The duration of the camera flight to an entered location, in seconds. * @param [options.destinationFound = GeocoderViewModel.flyToDestination] - A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. */ @@ -41089,13 +41111,13 @@ export class GeocoderViewModel { isSearchInProgress: boolean; /** * Gets or sets the text to search for. The text can be an address, or longitude, latitude, - * and optional height, where longitude and latitude are in degrees and height is in meters. + and optional height, where longitude and latitude are in degrees and height is in meters. */ searchText: string; /** * Gets or sets the the duration of the camera flight in seconds. - * A value of zero causes the camera to instantly switch to the geocoding location. - * The duration will be computed based on the distance when undefined. + A value of zero causes the camera to instantly switch to the geocoding location. + The duration will be computed based on the distance when undefined. */ flightDuration: number | undefined; /** @@ -41120,7 +41142,7 @@ export class GeocoderViewModel { suggestions: object[]; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; /** @@ -41151,7 +41173,7 @@ export class HomeButton { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -41177,8 +41199,8 @@ export class HomeButtonViewModel { command: Command; /** * Gets or sets the the duration of the camera flight in seconds. - * A value of zero causes the camera to instantly switch to home view. - * The duration will be computed based on the distance when undefined. + A value of zero causes the camera to instantly switch to home view. + The duration will be computed based on the distance when undefined. */ duration: number | undefined; } @@ -41207,7 +41229,7 @@ export class InfoBox { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -41262,14 +41284,14 @@ export class InfoBoxViewModel { /** *

The NavigationHelpButton is a single button widget for displaying instructions for - * navigating the globe with the mouse.


+navigating the globe with the mouse.


* @example * // In HTML head, include a link to the NavigationHelpButton.css stylesheet, - * // and in the body, include: - * - * var navigationHelpButton = new Cesium.NavigationHelpButton({ - * container : 'navigationHelpButtonContainer' - * }); +// and in the body, include: + +var navigationHelpButton = new Cesium.NavigationHelpButton({ + container : 'navigationHelpButtonContainer' +}); * @param options - Object with the following properties: * @param options.container - The DOM element or ID that will contain the widget. * @param [options.instructionsInitiallyVisible = false] - True if the navigation instructions should initially be visible; otherwise, false. @@ -41293,7 +41315,7 @@ export class NavigationHelpButton { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -41331,8 +41353,8 @@ export class NavigationHelpButtonViewModel { * @param options.container - The DOM element or ID that will contain the widget. * @param options.scene - The {@link Scene} for which to monitor performance. * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The - * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure - * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. + message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure + it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. */ export class PerformanceWatchdog { constructor(options?: { @@ -41354,7 +41376,7 @@ export class PerformanceWatchdog { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -41364,8 +41386,8 @@ export class PerformanceWatchdog { * @param [options] - Object with the following properties: * @param options.scene - The Scene instance for which to monitor performance. * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The - * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure - * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. + message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure + it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. */ export class PerformanceWatchdogViewModel { constructor(options?: { @@ -41378,7 +41400,7 @@ export class PerformanceWatchdogViewModel { lowFrameRateMessage: string; /** * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user. If it has - * been dismissed, the message will not be redisplayed, no matter the frame rate. + been dismissed, the message will not be redisplayed, no matter the frame rate. */ lowFrameRateMessageDismissed: boolean; /** @@ -41391,7 +41413,7 @@ export class PerformanceWatchdogViewModel { scene: Scene; /** * Gets a command that dismisses the low frame rate message. Once it is dismissed, the message - * will not be redisplayed. + will not be redisplayed. */ dismissMessage: Command; } @@ -41400,10 +41422,10 @@ export class PerformanceWatchdogViewModel { * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections. * @example * // In HTML head, include a link to the ProjectionPicker.css stylesheet, - * // and in the body, include:
- * // Note: This code assumes you already have a Scene instance. - * - * var projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene); +// and in the body, include:
+// Note: This code assumes you already have a Scene instance. + +var projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene); * @param container - The DOM element or ID that will contain the widget. * @param scene - The Scene instance to use. */ @@ -41423,7 +41445,7 @@ export class ProjectionPicker { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -41486,16 +41508,16 @@ export class ProjectionPickerViewModel { /** * - *

The SceneModePicker is a single button widget for switching between scene modes; - * shown to the left in its expanded state. Programatic switching of scene modes will - * be automatically reflected in the widget as long as the specified Scene - * is used to perform the change.


+

The SceneModePicker is a single button widget for switching between scene modes; +shown to the left in its expanded state. Programatic switching of scene modes will +be automatically reflected in the widget as long as the specified Scene +is used to perform the change.


* @example * // In HTML head, include a link to the SceneModePicker.css stylesheet, - * // and in the body, include:
- * // Note: This code assumes you already have a Scene instance. - * - * var sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene); +// and in the body, include:
+// Note: This code assumes you already have a Scene instance. + +var sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene); * @param container - The DOM element or ID that will contain the widget. * @param scene - The Scene instance to use. * @param [duration = 2.0] - The time, in seconds, it takes for the scene to transition. @@ -41516,7 +41538,7 @@ export class SceneModePicker { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -41558,7 +41580,7 @@ export class SceneModePickerViewModel { scene: Scene; /** * Gets or sets the the duration of scene mode transition animations in seconds. - * A value of zero causes the scene to instantly change modes. + A value of zero causes the scene to instantly change modes. */ duration: number; /** @@ -41608,7 +41630,7 @@ export class SelectionIndicator { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; } @@ -41631,20 +41653,20 @@ export class SelectionIndicatorViewModel { showSelection: boolean; /** * Gets the visibility of the position indicator. This can be false even if an - * object is selected, when the selected object has no position. + object is selected, when the selected object has no position. */ isVisible: boolean; /** * Gets or sets the function for converting the world position of the object to the screen space position. * @example * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) { - * return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result); - * }; + return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result); + }; */ computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition; /** * Updates the view of the selection indicator to match the position and content properties of the view model. - * This function should be called as part of the render loop. + This function should be called as part of the render loop. */ update(): void; /** @@ -41680,27 +41702,27 @@ export namespace SelectionIndicatorViewModel { /** * A Knockout binding handler that creates a DOM element for a single SVG path. - * This binding handler will be registered as cesiumSvgPath. - * - *

- * The parameter to this binding is an object with the following properties: - *

- * - *
    - *
  • path: The SVG path as a string.
  • - *
  • width: The width of the SVG path with no transformations applied.
  • - *
  • height: The height of the SVG path with no transformations applied.
  • - *
  • css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.
  • - *
+This binding handler will be registered as cesiumSvgPath. + +

+The parameter to this binding is an object with the following properties: +

+ +
    +
  • path: The SVG path as a string.
  • +
  • width: The width of the SVG path with no transformations applied.
  • +
  • height: The height of the SVG path with no transformations applied.
  • +
  • css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.
  • +
* @example * // Create an SVG as a child of a div - *
- * - * // parameters can be observable from the view model - *
- * - * // or the whole object can be observable from the view model - *
+
+ +// parameters can be observable from the view model +
+ +// or the whole object can be observable from the view model +
*/ export namespace SvgPathBindingHandler { function register(): void; @@ -41723,7 +41745,7 @@ export class Timeline { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; /** @@ -41764,72 +41786,6 @@ export class ToggleButtonViewModel { command: Command; } -/** - * A single button widget for toggling vr mode. - * @param container - The DOM element or ID that will contain the widget. - * @param scene - The scene. - * @param [vrElement = document.body] - The element or id to be placed into vr mode. - */ -export class VRButton { - constructor(container: Element | string, scene: Scene, vrElement?: Element | string); - /** - * Gets the parent container. - */ - container: Element; - /** - * Gets the view model. - */ - viewModel: VRButtonViewModel; - /** - * @returns true if the object has been destroyed, false otherwise. - */ - isDestroyed(): boolean; - /** - * Destroys the widget. Should be called if permanently - * removing the widget from layout. - */ - destroy(): void; -} - -/** - * The view model for {@link VRButton}. - * @param scene - The scene. - * @param [vrElement = document.body] - The element or id to be placed into VR mode. - */ -export class VRButtonViewModel { - constructor(scene: Scene, vrElement?: Element | string); - /** - * Gets whether or not VR mode is active. - */ - isVRMode: boolean; - /** - * Gets or sets whether or not VR functionality should be enabled. - */ - isVREnabled: boolean; - /** - * Gets the tooltip. This property is observable. - */ - tooltip: string; - /** - * Gets or sets the HTML element to place into VR mode when the - * corresponding button is pressed. - */ - vrElement: Element; - /** - * Gets the Command to toggle VR mode. - */ - command: Command; - /** - * @returns true if the object has been destroyed, false otherwise. - */ - isDestroyed(): boolean; - /** - * Destroys the view model. Should be called to - * properly clean up the view model when it is no longer needed. - */ - destroy(): void; -} - export namespace Viewer { /** * Initialization options for the Viewer constructor @@ -41870,7 +41826,7 @@ export namespace Viewer { * @property [creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself. * @property [creditViewport] - The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. * @property [dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided, - * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed. + the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed. * @property [terrainExaggeration = 1.0] - A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid. * @property [shadows = false] - Determines if shadows are cast by light sources. * @property [terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources. @@ -41935,42 +41891,42 @@ export namespace Viewer { /** * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package. - * The widget can always be extended by using mixins, which add functionality useful for a variety of applications. +The widget can always be extended by using mixins, which add functionality useful for a variety of applications. * @example * //Initialize the viewer widget with several custom options and mixins. - * var viewer = new Cesium.Viewer('cesiumContainer', { - * //Start in Columbus Viewer - * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, - * //Use Cesium World Terrain - * terrainProvider : Cesium.createWorldTerrain(), - * //Hide the base layer picker - * baseLayerPicker : false, - * //Use OpenStreetMaps - * imageryProvider : new Cesium.OpenStreetMapImageryProvider({ - * url : 'https://a.tile.openstreetmap.org/' - * }), - * skyBox : new Cesium.SkyBox({ - * sources : { - * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg', - * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg', - * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg', - * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg', - * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg', - * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg' - * } - * }), - * // Show Columbus View map with Web Mercator projection - * mapProjection : new Cesium.WebMercatorProjection() - * }); - * - * //Add basic drag and drop functionality - * viewer.extend(Cesium.viewerDragDropMixin); - * - * //Show a pop-up alert if we encounter an error when processing a dropped file - * viewer.dropError.addEventListener(function(dropHandler, name, error) { - * console.log(error); - * window.alert(error); - * }); +var viewer = new Cesium.Viewer('cesiumContainer', { + //Start in Columbus Viewer + sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, + //Use Cesium World Terrain + terrainProvider : Cesium.createWorldTerrain(), + //Hide the base layer picker + baseLayerPicker : false, + //Use OpenStreetMaps + imageryProvider : new Cesium.OpenStreetMapImageryProvider({ + url : 'https://a.tile.openstreetmap.org/' + }), + skyBox : new Cesium.SkyBox({ + sources : { + positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg', + negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg', + positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg', + negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg', + positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg', + negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg' + } + }), + // Show Columbus View map with Web Mercator projection + mapProjection : new Cesium.WebMercatorProjection() +}); + +//Add basic drag and drop functionality +viewer.extend(Cesium.viewerDragDropMixin); + +//Show a pop-up alert if we encounter an error when processing a dropped file +viewer.dropError.addEventListener(function(dropHandler, name, error) { + console.log(error); + window.alert(error); +}); * @param container - The DOM element or ID that will contain the widget. * @param [options] - Object describing initialization options */ @@ -41982,7 +41938,7 @@ export class Viewer { readonly container: Element; /** * Gets the DOM element for the area at the bottom of the window containing the - * {@link CreditDisplay} and potentially other things. + {@link CreditDisplay} and potentially other things. */ readonly bottomContainer: Element; /** @@ -42043,7 +41999,7 @@ export class Viewer { readonly dataSourceDisplay: DataSourceDisplay; /** * Gets the collection of entities not tied to a particular data source. - * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}. + This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}. */ readonly entities: EntityCollection; /** @@ -42100,46 +42056,46 @@ export class Viewer { readonly screenSpaceEventHandler: ScreenSpaceEventHandler; /** * Gets or sets the target frame rate of the widget when useDefaultRenderLoop - * is true. If undefined, the browser's {@link requestAnimationFrame} implementation - * determines the frame rate. If defined, this value must be greater than 0. A value higher - * than the underlying requestAnimationFrame implementation will have no effect. + is true. If undefined, the browser's {@link requestAnimationFrame} implementation + determines the frame rate. If defined, this value must be greater than 0. A value higher + than the underlying requestAnimationFrame implementation will have no effect. */ targetFrameRate: number; /** * Gets or sets whether or not this widget should control the render loop. - * If set to true the widget will use {@link requestAnimationFrame} to - * perform rendering and resizing of the widget, as well as drive the - * simulation clock. If set to false, you must manually call the - * resize, render methods - * as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s - * renderError event will be raised and this property - * will be set to false. It must be set back to true to continue rendering - * after the error. + If set to true the widget will use {@link requestAnimationFrame} to + perform rendering and resizing of the widget, as well as drive the + simulation clock. If set to false, you must manually call the + resize, render methods + as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s + renderError event will be raised and this property + will be set to false. It must be set back to true to continue rendering + after the error. */ useDefaultRenderLoop: boolean; /** * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve - * performance on less powerful devices while values greater than 1.0 will render at a higher - * resolution and then scale down, resulting in improved visual fidelity. - * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5 - * will cause the scene to be rendered at 320x240 and then scaled up while setting - * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down. + performance on less powerful devices while values greater than 1.0 will render at a higher + resolution and then scale down, resulting in improved visual fidelity. + For example, if the widget is laid out at a size of 640x480, setting this value to 0.5 + will cause the scene to be rendered at 320x240 and then scaled up while setting + it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down. */ resolutionScale: number; /** * Boolean flag indicating if the browser's recommended resolution is used. - * If true, the browser's device pixel ratio is ignored and 1.0 is used instead, - * effectively rendering based on CSS pixels instead of device pixels. This can improve - * performance on less powerful devices that have high pixel density. When false, rendering - * will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether - * this flag is true or false. + If true, the browser's device pixel ratio is ignored and 1.0 is used instead, + effectively rendering based on CSS pixels instead of device pixels. This can improve + performance on less powerful devices that have high pixel density. When false, rendering + will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether + this flag is true or false. */ useBrowserRecommendedResolution: boolean; /** * Gets or sets whether or not data sources can temporarily pause - * animation in order to avoid showing an incomplete picture to the user. - * For example, if asynchronous primitives are being processed in the - * background, the clock will not advance until the geometry is ready. + animation in order to avoid showing an incomplete picture to the user. + For example, if asynchronous primitives are being processed in the + background, the clock will not advance until the geometry is ready. */ allowDataSourcesToSuspendAnimation: boolean; /** @@ -42148,10 +42104,10 @@ export class Viewer { trackedEntity: Entity | undefined; /** * Gets or sets the object instance for which to display a selection indicator. - * - * If a user interactively picks a Cesium3DTilesFeature instance, then this property - * will contain a transient Entity instance with a property named "feature" that is - * the instance that was picked. + + If a user interactively picks a Cesium3DTilesFeature instance, then this property + will contain a transient Entity instance with a property named "feature" that is + the instance that was picked. */ selectedEntity: Entity | undefined; /** @@ -42168,26 +42124,26 @@ export class Viewer { clockTrackedDataSource: DataSource; /** * Extends the base viewer functionality with the provided mixin. - * A mixin may add additional properties, functions, or other behavior - * to the provided viewer instance. + A mixin may add additional properties, functions, or other behavior + to the provided viewer instance. * @param mixin - The Viewer mixin to add to this instance. * @param [options] - The options object to be passed to the mixin function. */ extend(mixin: Viewer.ViewerMixin, options?: any): void; /** * Resizes the widget to match the container size. - * This function is called automatically as needed unless - * useDefaultRenderLoop is set to false. + This function is called automatically as needed unless + useDefaultRenderLoop is set to false. */ resize(): void; /** * This forces the widget to re-think its layout, including - * widget sizes and credit placement. + widget sizes and credit placement. */ forceResize(): void; /** * Renders the scene. This function is called automatically - * unless useDefaultRenderLoop is set to false; + unless useDefaultRenderLoop is set to false; */ render(): void; /** @@ -42196,23 +42152,23 @@ export class Viewer { isDestroyed(): boolean; /** * Destroys the widget. Should be called if permanently - * removing the widget from layout. + removing the widget from layout. */ destroy(): void; /** * Asynchronously sets the camera to view the provided entity, entities, or data source. - * If the data source is still in the process of loading or the visualization is otherwise still loading, - * this method waits for the data to be ready before performing the zoom. - * - *

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. - * The heading and the pitch angles are defined in the local east-north-up reference frame. - * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch - * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is - * zero, a range will be computed such that the whole bounding sphere is visible.

- * - *

In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the - * target will be the range. The heading will be determined from the offset. If the heading cannot be - * determined from the offset, the heading will be north.

+ If the data source is still in the process of loading or the visualization is otherwise still loading, + this method waits for the data to be ready before performing the zoom. + +

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. + The heading and the pitch angles are defined in the local east-north-up reference frame. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is + zero, a range will be computed such that the whole bounding sphere is visible.

+ +

In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the range. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north.

* @param target - The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types. * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame. * @returns A Promise that resolves to true if the zoom was successful or false if the target is not currently visualized in the scene or the zoom was cancelled. @@ -42220,18 +42176,18 @@ export class Viewer { zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise, offset?: HeadingPitchRange): Promise; /** * Flies the camera to the provided entity, entities, or data source. - * If the data source is still in the process of loading or the visualization is otherwise still loading, - * this method waits for the data to be ready before performing the flight. - * - *

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. - * The heading and the pitch angles are defined in the local east-north-up reference frame. - * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch - * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is - * zero, a range will be computed such that the whole bounding sphere is visible.

- * - *

In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the - * target will be the range. The heading will be determined from the offset. If the heading cannot be - * determined from the offset, the heading will be north.

+ If the data source is still in the process of loading or the visualization is otherwise still loading, + this method waits for the data to be ready before performing the flight. + +

The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. + The heading and the pitch angles are defined in the local east-north-up reference frame. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is + zero, a range will be computed such that the whole bounding sphere is visible.

+ +

In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the range. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north.

* @param target - The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types. * @param [options] - Object with the following properties: * @param [options.duration = 3.0] - The duration of the flight in seconds. @@ -42248,37 +42204,37 @@ export class Viewer { /** * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget. - * Rather than being called directly, this function is normally passed as - * a parameter to {@link Viewer#extend}, as shown in the example below. +Rather than being called directly, this function is normally passed as +a parameter to {@link Viewer#extend}, as shown in the example below. * @example * var viewer = new Cesium.Viewer('cesiumContainer'); - * viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin); +viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin); * @param viewer - The viewer instance. */ export function viewerCesium3DTilesInspectorMixin(viewer: Viewer): void; /** * A mixin which adds the CesiumInspector widget to the Viewer widget. - * Rather than being called directly, this function is normally passed as - * a parameter to {@link Viewer#extend}, as shown in the example below. +Rather than being called directly, this function is normally passed as +a parameter to {@link Viewer#extend}, as shown in the example below. * @example * var viewer = new Cesium.Viewer('cesiumContainer'); - * viewer.extend(Cesium.viewerCesiumInspectorMixin); +viewer.extend(Cesium.viewerCesiumInspectorMixin); * @param viewer - The viewer instance. */ export function viewerCesiumInspectorMixin(viewer: Viewer): void; /** * A mixin which adds default drag and drop support for CZML files to the Viewer widget. - * Rather than being called directly, this function is normally passed as - * a parameter to {@link Viewer#extend}, as shown in the example below. +Rather than being called directly, this function is normally passed as +a parameter to {@link Viewer#extend}, as shown in the example below. * @example * // Add basic drag and drop support and pop up an alert window on error. - * var viewer = new Cesium.Viewer('cesiumContainer'); - * viewer.extend(Cesium.viewerDragDropMixin); - * viewer.dropError.addEventListener(function(viewerArg, source, error) { - * window.alert('Error processing ' + source + ':' + error); - * }); +var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.extend(Cesium.viewerDragDropMixin); +viewer.dropError.addEventListener(function(viewerArg, source, error) { + window.alert('Error processing ' + source + ':' + error); +}); * @param viewer - The viewer instance. * @param [options] - Object with the following properties: * @param [options.dropTarget = viewer.container] - The DOM element which will serve as the drop target. @@ -42297,34 +42253,88 @@ export function viewerDragDropMixin(viewer: Viewer, options?: { /** * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget. - * Rather than being called directly, this function is normally passed as - * a parameter to {@link Viewer#extend}, as shown in the example below. +Rather than being called directly, this function is normally passed as +a parameter to {@link Viewer#extend}, as shown in the example below. * @example * var viewer = new Cesium.Viewer('cesiumContainer'); - * viewer.extend(Cesium.viewerPerformanceWatchdogMixin, { - * lowFrameRateMessage : 'Why is this going so slowly?' - * }); +viewer.extend(Cesium.viewerPerformanceWatchdogMixin, { + lowFrameRateMessage : 'Why is this going so slowly?' +}); * @param viewer - The viewer instance. * @param [options] - An object with properties. * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The - * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure - * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. + message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure + it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. */ export function viewerPerformanceWatchdogMixin(viewer: Viewer, options?: { lowFrameRateMessage?: string; }): void; /** - * Create a Command from a given function, for use with ViewModels. - * - * A Command is a function with an extra canExecute observable property to determine - * whether the command can be executed. When executed, a Command function will check the - * value of canExecute and throw if false. It also provides events for when - * a command has been or is about to be executed. - * @param func - The function to execute. - * @param [canExecute = true] - A boolean indicating whether the function can currently be executed. + * A single button widget for toggling vr mode. + * @param container - The DOM element or ID that will contain the widget. + * @param scene - The scene. + * @param [vrElement = document.body] - The element or id to be placed into vr mode. */ -export function createCommand(func: (...params: any[]) => any, canExecute?: boolean): void; +export class VRButton { + constructor(container: Element | string, scene: Scene, vrElement?: Element | string); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: VRButtonViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link VRButton}. + * @param scene - The scene. + * @param [vrElement = document.body] - The element or id to be placed into VR mode. + */ +export class VRButtonViewModel { + constructor(scene: Scene, vrElement?: Element | string); + /** + * Gets whether or not VR mode is active. + */ + isVRMode: boolean; + /** + * Gets or sets whether or not VR functionality should be enabled. + */ + isVREnabled: boolean; + /** + * Gets the tooltip. This property is observable. + */ + tooltip: string; + /** + * Gets or sets the HTML element to place into VR mode when the + corresponding button is pressed. + */ + vrElement: Element; + /** + * Gets the Command to toggle VR mode. + */ + command: Command; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the view model. Should be called to + properly clean up the view model when it is no longer needed. + */ + destroy(): void; +} @@ -42335,11 +42345,15 @@ declare module "cesium/Source/Core/ArcGISTiledElevationTerrainProvider" { import declare module "cesium/Source/Core/ArcType" { import { ArcType } from 'cesium'; export default ArcType; } declare module "cesium/Source/Core/AssociativeArray" { import { AssociativeArray } from 'cesium'; export default AssociativeArray; } declare module "cesium/Source/Core/AxisAlignedBoundingBox" { import { AxisAlignedBoundingBox } from 'cesium'; export default AxisAlignedBoundingBox; } +declare module "cesium/Source/Core/barycentricCoordinates" { import { barycentricCoordinates } from 'cesium'; export default barycentricCoordinates; } +declare module "cesium/Source/Core/binarySearch" { import { binarySearch } from 'cesium'; export default binarySearch; } declare module "cesium/Source/Core/BingMapsGeocoderService" { import { BingMapsGeocoderService } from 'cesium'; export default BingMapsGeocoderService; } declare module "cesium/Source/Core/BoundingRectangle" { import { BoundingRectangle } from 'cesium'; export default BoundingRectangle; } declare module "cesium/Source/Core/BoundingSphere" { import { BoundingSphere } from 'cesium'; export default BoundingSphere; } declare module "cesium/Source/Core/BoxGeometry" { import { BoxGeometry } from 'cesium'; export default BoxGeometry; } declare module "cesium/Source/Core/BoxOutlineGeometry" { import { BoxOutlineGeometry } from 'cesium'; export default BoxOutlineGeometry; } +declare module "cesium/Source/Core/buildModuleUrl" { import { buildModuleUrl } from 'cesium'; export default buildModuleUrl; } +declare module "cesium/Source/Core/cancelAnimationFrame" { import { cancelAnimationFrame } from 'cesium'; export default cancelAnimationFrame; } declare module "cesium/Source/Core/Cartesian2" { import { Cartesian2 } from 'cesium'; export default Cartesian2; } declare module "cesium/Source/Core/Cartesian3" { import { Cartesian3 } from 'cesium'; export default Cartesian3; } declare module "cesium/Source/Core/Cartesian4" { import { Cartesian4 } from 'cesium'; export default Cartesian4; } @@ -42352,8 +42366,10 @@ declare module "cesium/Source/Core/CircleOutlineGeometry" { import { CircleOutli declare module "cesium/Source/Core/Clock" { import { Clock } from 'cesium'; export default Clock; } declare module "cesium/Source/Core/ClockRange" { import { ClockRange } from 'cesium'; export default ClockRange; } declare module "cesium/Source/Core/ClockStep" { import { ClockStep } from 'cesium'; export default ClockStep; } +declare module "cesium/Source/Core/clone" { import { clone } from 'cesium'; export default clone; } declare module "cesium/Source/Core/Color" { import { Color } from 'cesium'; export default Color; } declare module "cesium/Source/Core/ColorGeometryInstanceAttribute" { import { ColorGeometryInstanceAttribute } from 'cesium'; export default ColorGeometryInstanceAttribute; } +declare module "cesium/Source/Core/combine" { import { combine } from 'cesium'; export default combine; } declare module "cesium/Source/Core/ComponentDatatype" { import { ComponentDatatype } from 'cesium'; export default ComponentDatatype; } declare module "cesium/Source/Core/CompressedTextureBuffer" { import { CompressedTextureBuffer } from 'cesium'; export default CompressedTextureBuffer; } declare module "cesium/Source/Core/CoplanarPolygonGeometry" { import { CoplanarPolygonGeometry } from 'cesium'; export default CoplanarPolygonGeometry; } @@ -42361,12 +42377,17 @@ declare module "cesium/Source/Core/CoplanarPolygonOutlineGeometry" { import { Co declare module "cesium/Source/Core/CornerType" { import { CornerType } from 'cesium'; export default CornerType; } declare module "cesium/Source/Core/CorridorGeometry" { import { CorridorGeometry } from 'cesium'; export default CorridorGeometry; } declare module "cesium/Source/Core/CorridorOutlineGeometry" { import { CorridorOutlineGeometry } from 'cesium'; export default CorridorOutlineGeometry; } +declare module "cesium/Source/Core/createGuid" { import { createGuid } from 'cesium'; export default createGuid; } +declare module "cesium/Source/Core/createWorldTerrain" { import { createWorldTerrain } from 'cesium'; export default createWorldTerrain; } declare module "cesium/Source/Core/Credit" { import { Credit } from 'cesium'; export default Credit; } declare module "cesium/Source/Core/CubicRealPolynomial" { import { CubicRealPolynomial } from 'cesium'; export default CubicRealPolynomial; } declare module "cesium/Source/Core/CullingVolume" { import { CullingVolume } from 'cesium'; export default CullingVolume; } declare module "cesium/Source/Core/CylinderGeometry" { import { CylinderGeometry } from 'cesium'; export default CylinderGeometry; } declare module "cesium/Source/Core/CylinderOutlineGeometry" { import { CylinderOutlineGeometry } from 'cesium'; export default CylinderOutlineGeometry; } declare module "cesium/Source/Core/DefaultProxy" { import { DefaultProxy } from 'cesium'; export default DefaultProxy; } +declare module "cesium/Source/Core/defaultValue" { import { defaultValue } from 'cesium'; export default defaultValue; } +declare module "cesium/Source/Core/defined" { import { defined } from 'cesium'; export default defined; } +declare module "cesium/Source/Core/destroyObject" { import { destroyObject } from 'cesium'; export default destroyObject; } declare module "cesium/Source/Core/DeveloperError" { import { DeveloperError } from 'cesium'; export default DeveloperError; } declare module "cesium/Source/Core/DistanceDisplayCondition" { import { DistanceDisplayCondition } from 'cesium'; export default DistanceDisplayCondition; } declare module "cesium/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute" { import { DistanceDisplayConditionGeometryInstanceAttribute } from 'cesium'; export default DistanceDisplayConditionGeometryInstanceAttribute; } @@ -42384,11 +42405,12 @@ declare module "cesium/Source/Core/Event" { import { Event } from 'cesium'; expo declare module "cesium/Source/Core/EventHelper" { import { EventHelper } from 'cesium'; export default EventHelper; } declare module "cesium/Source/Core/ExtrapolationType" { import { ExtrapolationType } from 'cesium'; export default ExtrapolationType; } declare module "cesium/Source/Core/FeatureDetection" { import { FeatureDetection } from 'cesium'; export default FeatureDetection; } +declare module "cesium/Source/Core/formatError" { import { formatError } from 'cesium'; export default formatError; } declare module "cesium/Source/Core/FrustumGeometry" { import { FrustumGeometry } from 'cesium'; export default FrustumGeometry; } declare module "cesium/Source/Core/FrustumOutlineGeometry" { import { FrustumOutlineGeometry } from 'cesium'; export default FrustumOutlineGeometry; } declare module "cesium/Source/Core/Fullscreen" { import { Fullscreen } from 'cesium'; export default Fullscreen; } -declare module "cesium/Source/Core/GeocodeType" { import { GeocodeType } from 'cesium'; export default GeocodeType; } declare module "cesium/Source/Core/GeocoderService" { import { GeocoderService } from 'cesium'; export default GeocoderService; } +declare module "cesium/Source/Core/GeocodeType" { import { GeocodeType } from 'cesium'; export default GeocodeType; } declare module "cesium/Source/Core/GeographicProjection" { import { GeographicProjection } from 'cesium'; export default GeographicProjection; } declare module "cesium/Source/Core/GeographicTilingScheme" { import { GeographicTilingScheme } from 'cesium'; export default GeographicTilingScheme; } declare module "cesium/Source/Core/Geometry" { import { Geometry } from 'cesium'; export default Geometry; } @@ -42398,6 +42420,12 @@ declare module "cesium/Source/Core/GeometryFactory" { import { GeometryFactory } declare module "cesium/Source/Core/GeometryInstance" { import { GeometryInstance } from 'cesium'; export default GeometryInstance; } declare module "cesium/Source/Core/GeometryInstanceAttribute" { import { GeometryInstanceAttribute } from 'cesium'; export default GeometryInstanceAttribute; } declare module "cesium/Source/Core/GeometryPipeline" { import { GeometryPipeline } from 'cesium'; export default GeometryPipeline; } +declare module "cesium/Source/Core/getAbsoluteUri" { import { getAbsoluteUri } from 'cesium'; export default getAbsoluteUri; } +declare module "cesium/Source/Core/getBaseUri" { import { getBaseUri } from 'cesium'; export default getBaseUri; } +declare module "cesium/Source/Core/getExtensionFromUri" { import { getExtensionFromUri } from 'cesium'; export default getExtensionFromUri; } +declare module "cesium/Source/Core/getFilenameFromUri" { import { getFilenameFromUri } from 'cesium'; export default getFilenameFromUri; } +declare module "cesium/Source/Core/getImagePixels" { import { getImagePixels } from 'cesium'; export default getImagePixels; } +declare module "cesium/Source/Core/getTimestamp" { import { getTimestamp } from 'cesium'; export default getTimestamp; } declare module "cesium/Source/Core/GoogleEarthEnterpriseMetadata" { import { GoogleEarthEnterpriseMetadata } from 'cesium'; export default GoogleEarthEnterpriseMetadata; } declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainData" { import { GoogleEarthEnterpriseTerrainData } from 'cesium'; export default GoogleEarthEnterpriseTerrainData; } declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainProvider" { import { GoogleEarthEnterpriseTerrainProvider } from 'cesium'; export default GoogleEarthEnterpriseTerrainProvider; } @@ -42412,12 +42440,13 @@ declare module "cesium/Source/Core/HermiteSpline" { import { HermiteSpline } fro declare module "cesium/Source/Core/IndexDatatype" { import { IndexDatatype } from 'cesium'; export default IndexDatatype; } declare module "cesium/Source/Core/InterpolationAlgorithm" { import { InterpolationAlgorithm } from 'cesium'; export default InterpolationAlgorithm; } declare module "cesium/Source/Core/Intersect" { import { Intersect } from 'cesium'; export default Intersect; } -declare module "cesium/Source/Core/IntersectionTests" { import { IntersectionTests } from 'cesium'; export default IntersectionTests; } declare module "cesium/Source/Core/Intersections2D" { import { Intersections2D } from 'cesium'; export default Intersections2D; } +declare module "cesium/Source/Core/IntersectionTests" { import { IntersectionTests } from 'cesium'; export default IntersectionTests; } declare module "cesium/Source/Core/Interval" { import { Interval } from 'cesium'; export default Interval; } declare module "cesium/Source/Core/Ion" { import { Ion } from 'cesium'; export default Ion; } declare module "cesium/Source/Core/IonGeocoderService" { import { IonGeocoderService } from 'cesium'; export default IonGeocoderService; } declare module "cesium/Source/Core/IonResource" { import { IonResource } from 'cesium'; export default IonResource; } +declare module "cesium/Source/Core/isLeapYear" { import { isLeapYear } from 'cesium'; export default isLeapYear; } declare module "cesium/Source/Core/Iso8601" { import { Iso8601 } from 'cesium'; export default Iso8601; } declare module "cesium/Source/Core/JulianDate" { import { JulianDate } from 'cesium'; export default JulianDate; } declare module "cesium/Source/Core/KeyboardEventModifier" { import { KeyboardEventModifier } from 'cesium'; export default KeyboardEventModifier; } @@ -42425,12 +42454,16 @@ declare module "cesium/Source/Core/LagrangePolynomialApproximation" { import { L declare module "cesium/Source/Core/LeapSecond" { import { LeapSecond } from 'cesium'; export default LeapSecond; } declare module "cesium/Source/Core/LinearApproximation" { import { LinearApproximation } from 'cesium'; export default LinearApproximation; } declare module "cesium/Source/Core/LinearSpline" { import { LinearSpline } from 'cesium'; export default LinearSpline; } +declare module "cesium/Source/Core/loadCRN" { import { loadCRN } from 'cesium'; export default loadCRN; } +declare module "cesium/Source/Core/loadKTX" { import { loadKTX } from 'cesium'; export default loadKTX; } declare module "cesium/Source/Core/MapProjection" { import { MapProjection } from 'cesium'; export default MapProjection; } declare module "cesium/Source/Core/Math" { import { Math } from 'cesium'; export default Math; } declare module "cesium/Source/Core/Matrix2" { import { Matrix2 } from 'cesium'; export default Matrix2; } declare module "cesium/Source/Core/Matrix3" { import { Matrix3 } from 'cesium'; export default Matrix3; } declare module "cesium/Source/Core/Matrix4" { import { Matrix4 } from 'cesium'; export default Matrix4; } +declare module "cesium/Source/Core/mergeSort" { import { mergeSort } from 'cesium'; export default mergeSort; } declare module "cesium/Source/Core/NearFarScalar" { import { NearFarScalar } from 'cesium'; export default NearFarScalar; } +declare module "cesium/Source/Core/objectToQuery" { import { objectToQuery } from 'cesium'; export default objectToQuery; } declare module "cesium/Source/Core/Occluder" { import { Occluder } from 'cesium'; export default Occluder; } declare module "cesium/Source/Core/OpenCageGeocoderService" { import { OpenCageGeocoderService } from 'cesium'; export default OpenCageGeocoderService; } declare module "cesium/Source/Core/OrientedBoundingBox" { import { OrientedBoundingBox } from 'cesium'; export default OrientedBoundingBox; } @@ -42446,6 +42479,7 @@ declare module "cesium/Source/Core/PixelFormat" { import { PixelFormat } from 'c declare module "cesium/Source/Core/Plane" { import { Plane } from 'cesium'; export default Plane; } declare module "cesium/Source/Core/PlaneGeometry" { import { PlaneGeometry } from 'cesium'; export default PlaneGeometry; } declare module "cesium/Source/Core/PlaneOutlineGeometry" { import { PlaneOutlineGeometry } from 'cesium'; export default PlaneOutlineGeometry; } +declare module "cesium/Source/Core/pointInsideTriangle" { import { pointInsideTriangle } from 'cesium'; export default pointInsideTriangle; } declare module "cesium/Source/Core/PolygonGeometry" { import { PolygonGeometry } from 'cesium'; export default PolygonGeometry; } declare module "cesium/Source/Core/PolygonHierarchy" { import { PolygonHierarchy } from 'cesium'; export default PolygonHierarchy; } declare module "cesium/Source/Core/PolygonOutlineGeometry" { import { PolygonOutlineGeometry } from 'cesium'; export default PolygonOutlineGeometry; } @@ -42459,6 +42493,7 @@ declare module "cesium/Source/Core/QuantizedMeshTerrainData" { import { Quantize declare module "cesium/Source/Core/QuarticRealPolynomial" { import { QuarticRealPolynomial } from 'cesium'; export default QuarticRealPolynomial; } declare module "cesium/Source/Core/Quaternion" { import { Quaternion } from 'cesium'; export default Quaternion; } declare module "cesium/Source/Core/QuaternionSpline" { import { QuaternionSpline } from 'cesium'; export default QuaternionSpline; } +declare module "cesium/Source/Core/queryToObject" { import { queryToObject } from 'cesium'; export default queryToObject; } declare module "cesium/Source/Core/Queue" { import { Queue } from 'cesium'; export default Queue; } declare module "cesium/Source/Core/Ray" { import { Ray } from 'cesium'; export default Ray; } declare module "cesium/Source/Core/Rectangle" { import { Rectangle } from 'cesium'; export default Rectangle; } @@ -42466,12 +42501,15 @@ declare module "cesium/Source/Core/RectangleGeometry" { import { RectangleGeomet declare module "cesium/Source/Core/RectangleOutlineGeometry" { import { RectangleOutlineGeometry } from 'cesium'; export default RectangleOutlineGeometry; } declare module "cesium/Source/Core/ReferenceFrame" { import { ReferenceFrame } from 'cesium'; export default ReferenceFrame; } declare module "cesium/Source/Core/Request" { import { Request } from 'cesium'; export default Request; } +declare module "cesium/Source/Core/requestAnimationFrame" { import { requestAnimationFrame } from 'cesium'; export default requestAnimationFrame; } declare module "cesium/Source/Core/RequestErrorEvent" { import { RequestErrorEvent } from 'cesium'; export default RequestErrorEvent; } declare module "cesium/Source/Core/RequestScheduler" { import { RequestScheduler } from 'cesium'; export default RequestScheduler; } declare module "cesium/Source/Core/RequestState" { import { RequestState } from 'cesium'; export default RequestState; } declare module "cesium/Source/Core/RequestType" { import { RequestType } from 'cesium'; export default RequestType; } declare module "cesium/Source/Core/Resource" { import { Resource } from 'cesium'; export default Resource; } declare module "cesium/Source/Core/RuntimeError" { import { RuntimeError } from 'cesium'; export default RuntimeError; } +declare module "cesium/Source/Core/sampleTerrain" { import { sampleTerrain } from 'cesium'; export default sampleTerrain; } +declare module "cesium/Source/Core/sampleTerrainMostDetailed" { import { sampleTerrainMostDetailed } from 'cesium'; export default sampleTerrainMostDetailed; } declare module "cesium/Source/Core/ScreenSpaceEventHandler" { import { ScreenSpaceEventHandler } from 'cesium'; export default ScreenSpaceEventHandler; } declare module "cesium/Source/Core/ScreenSpaceEventType" { import { ScreenSpaceEventType } from 'cesium'; export default ScreenSpaceEventType; } declare module "cesium/Source/Core/ShowGeometryInstanceAttribute" { import { ShowGeometryInstanceAttribute } from 'cesium'; export default ShowGeometryInstanceAttribute; } @@ -42481,6 +42519,7 @@ declare module "cesium/Source/Core/SphereGeometry" { import { SphereGeometry } f declare module "cesium/Source/Core/SphereOutlineGeometry" { import { SphereOutlineGeometry } from 'cesium'; export default SphereOutlineGeometry; } declare module "cesium/Source/Core/Spherical" { import { Spherical } from 'cesium'; export default Spherical; } declare module "cesium/Source/Core/Spline" { import { Spline } from 'cesium'; export default Spline; } +declare module "cesium/Source/Core/subdivideArray" { import { subdivideArray } from 'cesium'; export default subdivideArray; } declare module "cesium/Source/Core/TaskProcessor" { import { TaskProcessor } from 'cesium'; export default TaskProcessor; } declare module "cesium/Source/Core/TerrainData" { import { TerrainData } from 'cesium'; export default TerrainData; } declare module "cesium/Source/Core/TerrainProvider" { import { TerrainProvider } from 'cesium'; export default TerrainProvider; } @@ -42494,10 +42533,10 @@ declare module "cesium/Source/Core/Transforms" { import { Transforms } from 'ces declare module "cesium/Source/Core/TranslationRotationScale" { import { TranslationRotationScale } from 'cesium'; export default TranslationRotationScale; } declare module "cesium/Source/Core/TridiagonalSystemSolver" { import { TridiagonalSystemSolver } from 'cesium'; export default TridiagonalSystemSolver; } declare module "cesium/Source/Core/TrustedServers" { import { TrustedServers } from 'cesium'; export default TrustedServers; } -declare module "cesium/Source/Core/VRTheWorldTerrainProvider" { import { VRTheWorldTerrainProvider } from 'cesium'; export default VRTheWorldTerrainProvider; } declare module "cesium/Source/Core/VertexFormat" { import { VertexFormat } from 'cesium'; export default VertexFormat; } declare module "cesium/Source/Core/VideoSynchronizer" { import { VideoSynchronizer } from 'cesium'; export default VideoSynchronizer; } declare module "cesium/Source/Core/Visibility" { import { Visibility } from 'cesium'; export default Visibility; } +declare module "cesium/Source/Core/VRTheWorldTerrainProvider" { import { VRTheWorldTerrainProvider } from 'cesium'; export default VRTheWorldTerrainProvider; } declare module "cesium/Source/Core/WallGeometry" { import { WallGeometry } from 'cesium'; export default WallGeometry; } declare module "cesium/Source/Core/WallOutlineGeometry" { import { WallOutlineGeometry } from 'cesium'; export default WallOutlineGeometry; } declare module "cesium/Source/Core/WebGLConstants" { import { WebGLConstants } from 'cesium'; export default WebGLConstants; } @@ -42505,35 +42544,6 @@ declare module "cesium/Source/Core/WebMercatorProjection" { import { WebMercator declare module "cesium/Source/Core/WebMercatorTilingScheme" { import { WebMercatorTilingScheme } from 'cesium'; export default WebMercatorTilingScheme; } declare module "cesium/Source/Core/WeightSpline" { import { WeightSpline } from 'cesium'; export default WeightSpline; } declare module "cesium/Source/Core/WindingOrder" { import { WindingOrder } from 'cesium'; export default WindingOrder; } -declare module "cesium/Source/Core/barycentricCoordinates" { import { barycentricCoordinates } from 'cesium'; export default barycentricCoordinates; } -declare module "cesium/Source/Core/binarySearch" { import { binarySearch } from 'cesium'; export default binarySearch; } -declare module "cesium/Source/Core/buildModuleUrl" { import { buildModuleUrl } from 'cesium'; export default buildModuleUrl; } -declare module "cesium/Source/Core/cancelAnimationFrame" { import { cancelAnimationFrame } from 'cesium'; export default cancelAnimationFrame; } -declare module "cesium/Source/Core/clone" { import { clone } from 'cesium'; export default clone; } -declare module "cesium/Source/Core/combine" { import { combine } from 'cesium'; export default combine; } -declare module "cesium/Source/Core/createGuid" { import { createGuid } from 'cesium'; export default createGuid; } -declare module "cesium/Source/Core/createWorldTerrain" { import { createWorldTerrain } from 'cesium'; export default createWorldTerrain; } -declare module "cesium/Source/Core/defaultValue" { import { defaultValue } from 'cesium'; export default defaultValue; } -declare module "cesium/Source/Core/defined" { import { defined } from 'cesium'; export default defined; } -declare module "cesium/Source/Core/destroyObject" { import { destroyObject } from 'cesium'; export default destroyObject; } -declare module "cesium/Source/Core/formatError" { import { formatError } from 'cesium'; export default formatError; } -declare module "cesium/Source/Core/getAbsoluteUri" { import { getAbsoluteUri } from 'cesium'; export default getAbsoluteUri; } -declare module "cesium/Source/Core/getBaseUri" { import { getBaseUri } from 'cesium'; export default getBaseUri; } -declare module "cesium/Source/Core/getExtensionFromUri" { import { getExtensionFromUri } from 'cesium'; export default getExtensionFromUri; } -declare module "cesium/Source/Core/getFilenameFromUri" { import { getFilenameFromUri } from 'cesium'; export default getFilenameFromUri; } -declare module "cesium/Source/Core/getImagePixels" { import { getImagePixels } from 'cesium'; export default getImagePixels; } -declare module "cesium/Source/Core/getTimestamp" { import { getTimestamp } from 'cesium'; export default getTimestamp; } -declare module "cesium/Source/Core/isLeapYear" { import { isLeapYear } from 'cesium'; export default isLeapYear; } -declare module "cesium/Source/Core/loadCRN" { import { loadCRN } from 'cesium'; export default loadCRN; } -declare module "cesium/Source/Core/loadKTX" { import { loadKTX } from 'cesium'; export default loadKTX; } -declare module "cesium/Source/Core/mergeSort" { import { mergeSort } from 'cesium'; export default mergeSort; } -declare module "cesium/Source/Core/objectToQuery" { import { objectToQuery } from 'cesium'; export default objectToQuery; } -declare module "cesium/Source/Core/pointInsideTriangle" { import { pointInsideTriangle } from 'cesium'; export default pointInsideTriangle; } -declare module "cesium/Source/Core/queryToObject" { import { queryToObject } from 'cesium'; export default queryToObject; } -declare module "cesium/Source/Core/requestAnimationFrame" { import { requestAnimationFrame } from 'cesium'; export default requestAnimationFrame; } -declare module "cesium/Source/Core/sampleTerrain" { import { sampleTerrain } from 'cesium'; export default sampleTerrain; } -declare module "cesium/Source/Core/sampleTerrainMostDetailed" { import { sampleTerrainMostDetailed } from 'cesium'; export default sampleTerrainMostDetailed; } -declare module "cesium/Source/Core/subdivideArray" { import { subdivideArray } from 'cesium'; export default subdivideArray; } declare module "cesium/Source/Core/writeTextToCanvas" { import { writeTextToCanvas } from 'cesium'; export default writeTextToCanvas; } declare module "cesium/Source/DataSources/BillboardGraphics" { import { BillboardGraphics } from 'cesium'; export default BillboardGraphics; } declare module "cesium/Source/DataSources/BillboardVisualizer" { import { BillboardVisualizer } from 'cesium'; export default BillboardVisualizer; } @@ -42568,6 +42578,7 @@ declare module "cesium/Source/DataSources/Entity" { import { Entity } from 'cesi declare module "cesium/Source/DataSources/EntityCluster" { import { EntityCluster } from 'cesium'; export default EntityCluster; } declare module "cesium/Source/DataSources/EntityCollection" { import { EntityCollection } from 'cesium'; export default EntityCollection; } declare module "cesium/Source/DataSources/EntityView" { import { EntityView } from 'cesium'; export default EntityView; } +declare module "cesium/Source/DataSources/exportKml" { import { exportKml } from 'cesium'; export default exportKml; } declare module "cesium/Source/DataSources/GeoJsonDataSource" { import { GeoJsonDataSource } from 'cesium'; export default GeoJsonDataSource; } declare module "cesium/Source/DataSources/GeometryUpdater" { import { GeometryUpdater } from 'cesium'; export default GeometryUpdater; } declare module "cesium/Source/DataSources/GeometryVisualizer" { import { GeometryVisualizer } from 'cesium'; export default GeometryVisualizer; } @@ -42623,7 +42634,6 @@ declare module "cesium/Source/DataSources/VelocityVectorProperty" { import { Vel declare module "cesium/Source/DataSources/Visualizer" { import { Visualizer } from 'cesium'; export default Visualizer; } declare module "cesium/Source/DataSources/WallGeometryUpdater" { import { WallGeometryUpdater } from 'cesium'; export default WallGeometryUpdater; } declare module "cesium/Source/DataSources/WallGraphics" { import { WallGraphics } from 'cesium'; export default WallGraphics; } -declare module "cesium/Source/DataSources/exportKml" { import { exportKml } from 'cesium'; export default exportKml; } declare module "cesium/Source/Renderer/PixelDatatype" { import { PixelDatatype } from 'cesium'; export default PixelDatatype; } declare module "cesium/Source/Renderer/TextureMagnificationFilter" { import { TextureMagnificationFilter } from 'cesium'; export default TextureMagnificationFilter; } declare module "cesium/Source/Renderer/TextureMinificationFilter" { import { TextureMinificationFilter } from 'cesium'; export default TextureMinificationFilter; } @@ -42636,8 +42646,8 @@ declare module "cesium/Source/Scene/BingMapsImageryProvider" { import { BingMaps declare module "cesium/Source/Scene/BingMapsStyle" { import { BingMapsStyle } from 'cesium'; export default BingMapsStyle; } declare module "cesium/Source/Scene/BlendEquation" { import { BlendEquation } from 'cesium'; export default BlendEquation; } declare module "cesium/Source/Scene/BlendFunction" { import { BlendFunction } from 'cesium'; export default BlendFunction; } -declare module "cesium/Source/Scene/BlendOption" { import { BlendOption } from 'cesium'; export default BlendOption; } declare module "cesium/Source/Scene/BlendingState" { import { BlendingState } from 'cesium'; export default BlendingState; } +declare module "cesium/Source/Scene/BlendOption" { import { BlendOption } from 'cesium'; export default BlendOption; } declare module "cesium/Source/Scene/BoxEmitter" { import { BoxEmitter } from 'cesium'; export default BoxEmitter; } declare module "cesium/Source/Scene/Camera" { import { Camera } from 'cesium'; export default Camera; } declare module "cesium/Source/Scene/CameraEventAggregator" { import { CameraEventAggregator } from 'cesium'; export default CameraEventAggregator; } @@ -42647,8 +42657,8 @@ declare module "cesium/Source/Scene/Cesium3DTileColorBlendMode" { import { Cesiu declare module "cesium/Source/Scene/Cesium3DTileContent" { import { Cesium3DTileContent } from 'cesium'; export default Cesium3DTileContent; } declare module "cesium/Source/Scene/Cesium3DTileFeature" { import { Cesium3DTileFeature } from 'cesium'; export default Cesium3DTileFeature; } declare module "cesium/Source/Scene/Cesium3DTilePointFeature" { import { Cesium3DTilePointFeature } from 'cesium'; export default Cesium3DTilePointFeature; } -declare module "cesium/Source/Scene/Cesium3DTileStyle" { import { Cesium3DTileStyle } from 'cesium'; export default Cesium3DTileStyle; } declare module "cesium/Source/Scene/Cesium3DTileset" { import { Cesium3DTileset } from 'cesium'; export default Cesium3DTileset; } +declare module "cesium/Source/Scene/Cesium3DTileStyle" { import { Cesium3DTileStyle } from 'cesium'; export default Cesium3DTileStyle; } declare module "cesium/Source/Scene/CircleEmitter" { import { CircleEmitter } from 'cesium'; export default CircleEmitter; } declare module "cesium/Source/Scene/ClassificationPrimitive" { import { ClassificationPrimitive } from 'cesium'; export default ClassificationPrimitive; } declare module "cesium/Source/Scene/ClassificationType" { import { ClassificationType } from 'cesium'; export default ClassificationType; } @@ -42657,6 +42667,10 @@ declare module "cesium/Source/Scene/ClippingPlaneCollection" { import { Clipping declare module "cesium/Source/Scene/ColorBlendMode" { import { ColorBlendMode } from 'cesium'; export default ColorBlendMode; } declare module "cesium/Source/Scene/ConditionsExpression" { import { ConditionsExpression } from 'cesium'; export default ConditionsExpression; } declare module "cesium/Source/Scene/ConeEmitter" { import { ConeEmitter } from 'cesium'; export default ConeEmitter; } +declare module "cesium/Source/Scene/createElevationBandMaterial" { import { createElevationBandMaterial } from 'cesium'; export default createElevationBandMaterial; } +declare module "cesium/Source/Scene/createOsmBuildings" { import { createOsmBuildings } from 'cesium'; export default createOsmBuildings; } +declare module "cesium/Source/Scene/createTangentSpaceDebugPrimitive" { import { createTangentSpaceDebugPrimitive } from 'cesium'; export default createTangentSpaceDebugPrimitive; } +declare module "cesium/Source/Scene/createWorldImagery" { import { createWorldImagery } from 'cesium'; export default createWorldImagery; } declare module "cesium/Source/Scene/CreditDisplay" { import { CreditDisplay } from 'cesium'; export default CreditDisplay; } declare module "cesium/Source/Scene/CullFace" { import { CullFace } from 'cesium'; export default CullFace; } declare module "cesium/Source/Scene/DebugAppearance" { import { DebugAppearance } from 'cesium'; export default DebugAppearance; } @@ -42691,9 +42705,9 @@ declare module "cesium/Source/Scene/Label" { import { Label } from 'cesium'; exp declare module "cesium/Source/Scene/LabelCollection" { import { LabelCollection } from 'cesium'; export default LabelCollection; } declare module "cesium/Source/Scene/LabelStyle" { import { LabelStyle } from 'cesium'; export default LabelStyle; } declare module "cesium/Source/Scene/Light" { import { Light } from 'cesium'; export default Light; } -declare module "cesium/Source/Scene/MapMode2D" { import { MapMode2D } from 'cesium'; export default MapMode2D; } declare module "cesium/Source/Scene/MapboxImageryProvider" { import { MapboxImageryProvider } from 'cesium'; export default MapboxImageryProvider; } declare module "cesium/Source/Scene/MapboxStyleImageryProvider" { import { MapboxStyleImageryProvider } from 'cesium'; export default MapboxStyleImageryProvider; } +declare module "cesium/Source/Scene/MapMode2D" { import { MapMode2D } from 'cesium'; export default MapMode2D; } declare module "cesium/Source/Scene/Material" { import { Material } from 'cesium'; export default Material; } declare module "cesium/Source/Scene/MaterialAppearance" { import { MaterialAppearance } from 'cesium'; export default MaterialAppearance; } declare module "cesium/Source/Scene/Model" { import { Model } from 'cesium'; export default Model; } @@ -42750,15 +42764,11 @@ declare module "cesium/Source/Scene/VerticalOrigin" { import { VerticalOrigin } declare module "cesium/Source/Scene/ViewportQuad" { import { ViewportQuad } from 'cesium'; export default ViewportQuad; } declare module "cesium/Source/Scene/WebMapServiceImageryProvider" { import { WebMapServiceImageryProvider } from 'cesium'; export default WebMapServiceImageryProvider; } declare module "cesium/Source/Scene/WebMapTileServiceImageryProvider" { import { WebMapTileServiceImageryProvider } from 'cesium'; export default WebMapTileServiceImageryProvider; } -declare module "cesium/Source/Scene/createElevationBandMaterial" { import { createElevationBandMaterial } from 'cesium'; export default createElevationBandMaterial; } -declare module "cesium/Source/Scene/createOsmBuildings" { import { createOsmBuildings } from 'cesium'; export default createOsmBuildings; } -declare module "cesium/Source/Scene/createTangentSpaceDebugPrimitive" { import { createTangentSpaceDebugPrimitive } from 'cesium'; export default createTangentSpaceDebugPrimitive; } -declare module "cesium/Source/Scene/createWorldImagery" { import { createWorldImagery } from 'cesium'; export default createWorldImagery; } declare module "cesium/Source/Widgets/ClockViewModel" { import { ClockViewModel } from 'cesium'; export default ClockViewModel; } declare module "cesium/Source/Widgets/Command" { import { Command } from 'cesium'; export default Command; } +declare module "cesium/Source/Widgets/createCommand" { import { createCommand } from 'cesium'; export default createCommand; } declare module "cesium/Source/Widgets/SvgPathBindingHandler" { import { SvgPathBindingHandler } from 'cesium'; export default SvgPathBindingHandler; } declare module "cesium/Source/Widgets/ToggleButtonViewModel" { import { ToggleButtonViewModel } from 'cesium'; export default ToggleButtonViewModel; } -declare module "cesium/Source/Widgets/createCommand" { import { createCommand } from 'cesium'; export default createCommand; } declare module "cesium/Source/Widgets/Animation/Animation" { import { Animation } from 'cesium'; export default Animation; } declare module "cesium/Source/Widgets/Animation/AnimationViewModel" { import { AnimationViewModel } from 'cesium'; export default AnimationViewModel; } declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPicker" { import { BaseLayerPicker } from 'cesium'; export default BaseLayerPicker; } @@ -42788,10 +42798,10 @@ declare module "cesium/Source/Widgets/SceneModePicker/SceneModePickerViewModel" declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicator" { import { SelectionIndicator } from 'cesium'; export default SelectionIndicator; } declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel" { import { SelectionIndicatorViewModel } from 'cesium'; export default SelectionIndicatorViewModel; } declare module "cesium/Source/Widgets/Timeline/Timeline" { import { Timeline } from 'cesium'; export default Timeline; } -declare module "cesium/Source/Widgets/VRButton/VRButton" { import { VRButton } from 'cesium'; export default VRButton; } -declare module "cesium/Source/Widgets/VRButton/VRButtonViewModel" { import { VRButtonViewModel } from 'cesium'; export default VRButtonViewModel; } declare module "cesium/Source/Widgets/Viewer/Viewer" { import { Viewer } from 'cesium'; export default Viewer; } declare module "cesium/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin" { import { viewerCesium3DTilesInspectorMixin } from 'cesium'; export default viewerCesium3DTilesInspectorMixin; } declare module "cesium/Source/Widgets/Viewer/viewerCesiumInspectorMixin" { import { viewerCesiumInspectorMixin } from 'cesium'; export default viewerCesiumInspectorMixin; } declare module "cesium/Source/Widgets/Viewer/viewerDragDropMixin" { import { viewerDragDropMixin } from 'cesium'; export default viewerDragDropMixin; } declare module "cesium/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin" { import { viewerPerformanceWatchdogMixin } from 'cesium'; export default viewerPerformanceWatchdogMixin; } +declare module "cesium/Source/Widgets/VRButton/VRButton" { import { VRButton } from 'cesium'; export default VRButton; } +declare module "cesium/Source/Widgets/VRButton/VRButtonViewModel" { import { VRButtonViewModel } from 'cesium'; export default VRButtonViewModel; } diff --git a/public/Cesium/Cesium.js b/public/Cesium/Cesium.js index 1e612c1..61f446b 100644 --- a/public/Cesium/Cesium.js +++ b/public/Cesium/Cesium.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Cesium={})}(this,function(exports){"use strict";function defined(e){return null!=e}function DeveloperError(e){var t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}defined(Object.create)&&(DeveloperError.prototype=Object.create(Error.prototype),DeveloperError.prototype.constructor=DeveloperError),DeveloperError.prototype.toString=function(){var e=this.name+": "+this.message;return defined(this.stack)&&(e+="\n"+this.stack.toString()),e},DeveloperError.throwInstantiationError=function(){throw new DeveloperError("This function defines an interface and should not be called directly.")};var Check={};function getUndefinedErrorMessage(e){return e+" is required, actual value was undefined"}function getFailedTypeErrorMessage(e,t,i){return"Expected "+i+" to be typeof "+t+", actual typeof was "+e}function defaultValue(e,t){return null!=e?e:t}function MersenneTwister(e){null==e&&(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,this.init_genrand(e)}Check.typeOf={},Check.defined=function(e,t){if(!defined(t))throw new DeveloperError(getUndefinedErrorMessage(e))},Check.typeOf.func=function(e,t){if("function"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"function",e))},Check.typeOf.string=function(e,t){if("string"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"string",e))},Check.typeOf.number=function(e,t){if("number"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"number",e))},Check.typeOf.number.lessThan=function(e,t,i){if(Check.typeOf.number(e,t),i<=t)throw new DeveloperError("Expected "+e+" to be less than "+i+", actual value was "+t)},Check.typeOf.number.lessThanOrEquals=function(e,t,i){if(Check.typeOf.number(e,t),i>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},MersenneTwister.prototype.genrand_int32=function(){var e,t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_genrand(5489),t=0;t>>1^i[1&e];for(;t>>1^i[1&e];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^i[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},MersenneTwister.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var CesiumMath={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};CesiumMath.sign=defaultValue(Math.sign,function(e){return 0===(e=+e)||e!=e?e:0=Math.PI?e-t:e},CesiumMath.clampToLatitudeRange=function(e){return CesiumMath.clamp(e,-1*CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO)},CesiumMath.negativePiToPi=function(e){return e>=-CesiumMath.PI&&e<=CesiumMath.PI?e:CesiumMath.zeroToTwoPi(e+CesiumMath.PI)-CesiumMath.PI},CesiumMath.zeroToTwoPi=function(e){if(0<=e&&e<=CesiumMath.TWO_PI)return e;var t=CesiumMath.mod(e,CesiumMath.TWO_PI);return Math.abs(t)CesiumMath.EPSILON14?CesiumMath.TWO_PI:t},CesiumMath.mod=function(e,t){return CesiumMath.sign(e)===CesiumMath.sign(t)&&Math.abs(e)>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},CesiumMath.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e=((e|=e>>32)>>>0)-(e>>>1)},CesiumMath.clamp=function(e,t,i){return eMath.abs(e)?CesiumMath.PI_OVER_TWO-i:i,i=e<0?CesiumMath.PI-i:i,i=t<0?-i:i},Cartesian3.fromSpherical=function(e,t){defined(t)||(t=new Cartesian3);var i=e.clock,r=e.cone,n=defaultValue(e.magnitude,1),e=n*Math.sin(r);return t.x=e*Math.cos(i),t.y=e*Math.sin(i),t.z=n*Math.cos(r),t},Cartesian3.fromElements=function(e,t,i,r){return defined(r)?(r.x=e,r.y=t,r.z=i,r):new Cartesian3(e,t,i)},Cartesian3.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Cartesian3(e.x,e.y,e.z)},Cartesian3.fromCartesian4=Cartesian3.clone,Cartesian3.packedLength=3,Cartesian3.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i]=e.z,t},Cartesian3.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Cartesian3:i).x=e[t++],i.y=e[t++],i.z=e[t],i},Cartesian3.packArray=function(e,t){var i=e.length,r=3*i;if(defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;nCesiumMath.EPSILON12);return defined(n)?(n.x=a*y,n.y=o*C,n.z=s*v,n):new Cartesian3(a*y,o*C,s*v)}function Cartographic(e,t,i){this.longitude=defaultValue(e,0),this.latitude=defaultValue(t,0),this.height=defaultValue(i,0)}Cartographic.fromRadians=function(e,t,i,r){return i=defaultValue(i,0),defined(r)?(r.longitude=e,r.latitude=t,r.height=i,r):new Cartographic(e,t,i)},Cartographic.fromDegrees=function(e,t,i,r){return e=CesiumMath.toRadians(e),t=CesiumMath.toRadians(t),Cartographic.fromRadians(e,t,i,r)};var cartesianToCartographicN$1=new Cartesian3,cartesianToCartographicP$1=new Cartesian3,cartesianToCartographicH$1=new Cartesian3,wgs84OneOverRadii=new Cartesian3(1/6378137,1/6378137,1/6356752.314245179),wgs84OneOverRadiiSquared=new Cartesian3(1/40680631590769,1/40680631590769,1/40408299984661.445),wgs84CenterToleranceSquared=CesiumMath.EPSILON1;function initialize$8(e,t,i,r){t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,0),e._radii=new Cartesian3(t,i,r),e._radiiSquared=new Cartesian3(t*t,i*i,r*r),e._radiiToTheFourth=new Cartesian3(t*t*t*t,i*i*i*i,r*r*r*r),e._oneOverRadii=new Cartesian3(0===t?0:1/t,0===i?0:1/i,0===r?0:1/r),e._oneOverRadiiSquared=new Cartesian3(0===t?0:1/(t*t),0===i?0:1/(i*i),0===r?0:1/(r*r)),e._minimumRadius=Math.min(t,i,r),e._maximumRadius=Math.max(t,i,r),e._centerToleranceSquared=CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ellipsoid(e,t,i){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,initialize$8(this,e,t,i)}Cartographic.fromCartesian=function(e,t,i){var r=defined(t)?t.oneOverRadii:wgs84OneOverRadii,n=defined(t)?t.oneOverRadiiSquared:wgs84OneOverRadiiSquared,r=scaleToGeodeticSurface(e,r,n,defined(t)?t._centerToleranceSquared:wgs84CenterToleranceSquared,cartesianToCartographicP$1);if(defined(r)){t=Cartesian3.multiplyComponents(r,n,cartesianToCartographicN$1),t=Cartesian3.normalize(t,t),n=Cartesian3.subtract(e,r,cartesianToCartographicH$1),r=Math.atan2(t.y,t.x),t=Math.asin(t.z),n=CesiumMath.sign(Cartesian3.dot(n,e))*Cartesian3.magnitude(n);return defined(i)?(i.longitude=r,i.latitude=t,i.height=n,i):new Cartographic(r,t,n)}},Cartographic.toCartesian=function(e,t,i){return Cartesian3.fromRadians(e.longitude,e.latitude,e.height,t,i)},Cartographic.clone=function(e,t){if(defined(e))return defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Cartographic(e.longitude,e.latitude,e.height)},Cartographic.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},Cartographic.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},Cartographic.ZERO=Object.freeze(new Cartographic(0,0,0)),Cartographic.prototype.clone=function(e){return Cartographic.clone(this,e)},Cartographic.prototype.equals=function(e){return Cartographic.equals(this,e)},Cartographic.prototype.equalsEpsilon=function(e,t){return Cartographic.equalsEpsilon(this,e,t)},Cartographic.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(Ellipsoid.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}}}),Ellipsoid.clone=function(e,t){if(defined(e)){var i=e._radii;return defined(t)?(Cartesian3.clone(i,t._radii),Cartesian3.clone(e._radiiSquared,t._radiiSquared),Cartesian3.clone(e._radiiToTheFourth,t._radiiToTheFourth),Cartesian3.clone(e._oneOverRadii,t._oneOverRadii),Cartesian3.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ellipsoid(i.x,i.y,i.z)}},Ellipsoid.fromCartesian3=function(e,t){return defined(t)||(t=new Ellipsoid),defined(e)&&initialize$8(t,e.x,e.y,e.z),t},Ellipsoid.WGS84=Object.freeze(new Ellipsoid(6378137,6378137,6356752.314245179)),Ellipsoid.UNIT_SPHERE=Object.freeze(new Ellipsoid(1,1,1)),Ellipsoid.MOON=Object.freeze(new Ellipsoid(CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS)),Ellipsoid.prototype.clone=function(e){return Ellipsoid.clone(this,e)},Ellipsoid.packedLength=Cartesian3.packedLength,Ellipsoid.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._radii,t,i),t},Ellipsoid.unpack=function(e,t,i){t=defaultValue(t,0);t=Cartesian3.unpack(e,t);return Ellipsoid.fromCartesian3(t,i)},Ellipsoid.prototype.geocentricSurfaceNormal=Cartesian3.normalize,Ellipsoid.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,r=e.latitude,n=Math.cos(r),e=n*Math.cos(i),i=n*Math.sin(i),r=Math.sin(r);return(t=!defined(t)?new Cartesian3:t).x=e,t.y=i,t.z=r,Cartesian3.normalize(t,t)},Ellipsoid.prototype.geodeticSurfaceNormal=function(e,t){if(!Cartesian3.equalsEpsilon(e,Cartesian3.ZERO,CesiumMath.EPSILON14))return defined(t)||(t=new Cartesian3),t=Cartesian3.multiplyComponents(e,this._oneOverRadiiSquared,t),Cartesian3.normalize(t,t)};var cartographicToCartesianNormal=new Cartesian3,cartographicToCartesianK=new Cartesian3;Ellipsoid.prototype.cartographicToCartesian=function(e,t){var i=cartographicToCartesianNormal,r=cartographicToCartesianK;this.geodeticSurfaceNormalCartographic(e,i),Cartesian3.multiplyComponents(this._radiiSquared,i,r);var n=Math.sqrt(Cartesian3.dot(i,r));return Cartesian3.divideByScalar(r,n,r),Cartesian3.multiplyByScalar(i,e.height,i),defined(t)||(t=new Cartesian3),Cartesian3.add(r,i,t)},Ellipsoid.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;defined(t)?t.length=i:t=new Array(i);for(var r=0;r=this._radii.z-t))return i};var abscissas=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],weights=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function gaussLegendreQuadrature(e,t,i){for(var r=.5*(t+e),n=.5*(t-e),a=0,o=0;o<5;o++){var s=n*abscissas[o];a+=weights[o]*(i(r+s)+i(r-s))}return a*=n}function GeographicProjection(e){this._ellipsoid=defaultValue(e,Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Ellipsoid.prototype.surfaceArea=function(e){for(var t=e.west,n=e.east,i=e.south,r=e.north;ni&&(l=(i=(i=(e[Matrix3.getElementIndex(u,u)]-e[Matrix3.getElementIndex(c,c)])/2/e[Matrix3.getElementIndex(u,c)])<0?-1/(-i+Math.sqrt(1+i*i)):1/(i+Math.sqrt(1+i*i)))*(s=1/Math.sqrt(1+i*i))),(t=Matrix3.clone(Matrix3.IDENTITY,t))[Matrix3.getElementIndex(c,c)]=t[Matrix3.getElementIndex(u,u)]=s,t[Matrix3.getElementIndex(u,c)]=l,t[Matrix3.getElementIndex(c,u)]=-l,t}var jMatrix=new Matrix3,jMatrixTranspose=new Matrix3;Matrix3.computeEigenDecomposition=function(e,t){for(var i=CesiumMath.EPSILON20,r=0,n=0,a=(t=!defined(t)?{}:t).unitary=Matrix3.clone(Matrix3.IDENTITY,t.unitary),o=t.diagonal=Matrix3.clone(e,t.diagonal),s=i*computeFrobeniusNorm(o);n<10&&offDiagonalFrobeniusNorm(o)>s;)shurDecomposition(o,jMatrix),Matrix3.transpose(jMatrix,jMatrixTranspose),Matrix3.multiply(o,jMatrix,o),Matrix3.multiply(jMatrixTranspose,o,o),Matrix3.multiply(a,jMatrix,a),2<++r&&(++n,r=0);return t},Matrix3.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},Matrix3.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],a=e[4],o=e[7],s=e[2],l=e[5],e=e[8];return t*(a*e-l*o)+n*(l*r-i*e)+s*(i*o-a*r)},Matrix3.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],e=Matrix3.determinant(e);t[0]=o*u-c*s,t[1]=c*n-r*u,t[2]=r*s-o*n,t[3]=l*s-a*u,t[4]=i*u-l*n,t[5]=a*n-i*s,t[6]=a*c-l*o,t[7]=l*r-i*c,t[8]=i*o-a*r;e=1/e;return Matrix3.multiplyByScalar(t,e,t)};var scratchTransposeMatrix$1=new Matrix3;function Cartesian4(e,t,i,r){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.z=defaultValue(i,0),this.w=defaultValue(r,0)}Matrix3.inverseTranspose=function(e,t){return Matrix3.inverse(Matrix3.transpose(e,scratchTransposeMatrix$1),t)},Matrix3.equals=function(e,t){return e===t||defined(e)&&defined(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]},Matrix3.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},Matrix3.IDENTITY=Object.freeze(new Matrix3(1,0,0,0,1,0,0,0,1)),Matrix3.ZERO=Object.freeze(new Matrix3(0,0,0,0,0,0,0,0,0)),Matrix3.COLUMN0ROW0=0,Matrix3.COLUMN0ROW1=1,Matrix3.COLUMN0ROW2=2,Matrix3.COLUMN1ROW0=3,Matrix3.COLUMN1ROW1=4,Matrix3.COLUMN1ROW2=5,Matrix3.COLUMN2ROW0=6,Matrix3.COLUMN2ROW1=7,Matrix3.COLUMN2ROW2=8,Object.defineProperties(Matrix3.prototype,{length:{get:function(){return Matrix3.packedLength}}}),Matrix3.prototype.clone=function(e){return Matrix3.clone(this,e)},Matrix3.prototype.equals=function(e){return Matrix3.equals(this,e)},Matrix3.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},Matrix3.prototype.equalsEpsilon=function(e,t){return Matrix3.equalsEpsilon(this,e,t)},Matrix3.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},Cartesian4.fromElements=function(e,t,i,r,n){return defined(n)?(n.x=e,n.y=t,n.z=i,n.w=r,n):new Cartesian4(e,t,i,r)},Cartesian4.fromColor=function(e,t){return defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Cartesian4(e.red,e.green,e.blue,e.alpha)},Cartesian4.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Cartesian4(e.x,e.y,e.z,e.w)},Cartesian4.packedLength=4,Cartesian4.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},Cartesian4.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Cartesian4:i).x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},Cartesian4.packArray=function(e,t){var i=e.length,r=4*i;if(defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;nCesiumMath.PI&&(r-=CesiumMath.TWO_PI),i>CesiumMath.PI&&(i-=CesiumMath.TWO_PI)),defined(t)?(t.west=i,t.south=o,t.east=r,t.north=s,t):new Rectangle(i,o,r,s)},Rectangle.fromCartesianArray=function(e,t,i){t=defaultValue(t,Ellipsoid.WGS84);for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,c=0,u=e.length;cCesiumMath.PI&&(n-=CesiumMath.TWO_PI),r>CesiumMath.PI&&(r-=CesiumMath.TWO_PI)),defined(i)?(i.west=r,i.south=s,i.east=n,i.north=l,i):new Rectangle(r,s,n,l)},Rectangle.clone=function(e,t){if(defined(e))return defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Rectangle(e.west,e.south,e.east,e.north)},Rectangle.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.west-t.west)<=i&&Math.abs(e.south-t.south)<=i&&Math.abs(e.east-t.east)<=i&&Math.abs(e.north-t.north)<=i},Rectangle.prototype.clone=function(e){return Rectangle.clone(this,e)},Rectangle.prototype.equals=function(e){return Rectangle.equals(this,e)},Rectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Rectangle.prototype.equalsEpsilon=function(e,t){return Rectangle.equalsEpsilon(this,e,t)},Rectangle.validate=function(e){},Rectangle.southwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Cartographic(e.west,e.south)},Rectangle.northwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Cartographic(e.west,e.north)},Rectangle.northeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Cartographic(e.east,e.north)},Rectangle.southeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Cartographic(e.east,e.south)},Rectangle.center=function(e,t){var i=e.east,r=e.west;i=e.south&&r<=e.north};var subsampleLlaScratch=new Cartographic;function BoundingSphere(e,t){this.center=Cartesian3.clone(defaultValue(e,Cartesian3.ZERO)),this.radius=defaultValue(t,0)}Rectangle.subsample=function(e,t,i,r){t=defaultValue(t,Ellipsoid.WGS84),i=defaultValue(i,0),defined(r)||(r=[]);var n=0,a=e.north,o=e.south,s=e.east,l=e.west,c=subsampleLlaScratch;c.height=i,c.longitude=l,c.latitude=a,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.longitude=s,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.latitude=o,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.longitude=l,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.latitude=a<0?a:0o.x&&Cartesian3.clone(i,o),hs.y&&Cartesian3.clone(i,s),pl.z&&Cartesian3.clone(i,l)}var m=Cartesian3.magnitudeSquared(Cartesian3.subtract(o,r,fromPointsScratch)),f=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,n,fromPointsScratch)),g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=r,y=o,m=m;ml.x&&Cartesian3.clone(n,l),mc.y&&Cartesian3.clone(n,c),fu.z&&Cartesian3.clone(n,u)}var g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,o,fromPointsScratch)),y=Cartesian3.magnitudeSquared(Cartesian3.subtract(u,s,fromPointsScratch)),C=a,v=l,g=g;g<_&&(g=_,C=o,v=c),gs.x&&Cartesian3.clone(r,s),pl.y&&Cartesian3.clone(r,l),mc.z&&Cartesian3.clone(r,c)}var f=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,n,fromPointsScratch)),g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,o,fromPointsScratch)),y=n,C=s,f=f;fi.radius&&(i.radius=t),i},BoundingSphere.intersectPlane=function(e,t){var i=e.center,r=e.radius,e=t.normal,t=Cartesian3.dot(e,i)+t.distance;return t<-r?Intersect$1.OUTSIDE:t>>0,o=Math.max(0,Math.min(p,a)),s=[],l=a-o+1,c=[],u=defer();if(o)for(r=u.progress,i=function(e){c.push(e),--l||(t=i=noop,u.reject(c))},t=function(e){s.push(e),--o||(t=i=noop,u.resolve(s))},n=0;n>>0,a=[],o=defer();if(n)for(i=function(e,t){when(e,s).then(function(e){a[t]=e,--n||o.resolve(a)},o.reject)},r=0;r>>0,a=arguments;if(a.length<=1)for(;;){if(i in r){t=r[i++];break}if(++i>=n)throw new TypeError}else t=a[1];for(;in&&(t=i[n],this._length=n),t},Heap.prototype.pop=function(e){if(e=defaultValue(e,0),0!==this._length){var t=this._array,i=t[e];return swap$3(t,e,--this._length),this.heapify(e),t[this._length]=void 0,i}};var statistics={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},priorityHeapLength=20,requestHeap=new Heap({comparator:sortRequests});requestHeap.maximumLength=priorityHeapLength,requestHeap.reserve(priorityHeapLength);var activeRequests=[],numberOfActiveRequestsByServer={},pageUri="undefined"!=typeof document?new URI(document.location.href):new URI,requestCompletedEvent=new Event;function RequestScheduler(){}function updatePriority(e){defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function serverHasOpenSlots(e){var t=defaultValue(RequestScheduler.requestsByServer[e],RequestScheduler.maximumRequestsPerServer);return numberOfActiveRequestsByServer[e]e;)cancelRequest(requestHeap.pop());priorityHeapLength=e,requestHeap.maximumLength=e,requestHeap.reserve(e)}}}),RequestScheduler.update=function(){for(var e,t=0,i=activeRequests.length,r=0;r=RequestScheduler.maximumRequests)){updatePriority(e);var t=requestHeap.insert(e);if(defined(t)){if(t===e)return;cancelRequest(t)}return issueRequest(e)}}},RequestScheduler.clearForSpecs=function(){for(;0=this.retryAttempts)return when(!1);var i=this;return when(t(this,e)).then(function(e){return++i._retryCount,e})},Resource.prototype.clone=function(e){return(e=!defined(e)?new Resource({url:this._url}):e)._url=this._url,e._queryParameters=clone$1(this._queryParameters),e._templateValues=clone$1(this._templateValues),e.headers=clone$1(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Resource.prototype.getBaseUri=function(e){return getBaseUri(this.getUrlComponent(e),e)},Resource.prototype.appendForwardSlash=function(){this._url=appendForwardSlash(this._url)},Resource.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Resource.fetchArrayBuffer=function(e){return new Resource(e).fetchArrayBuffer()},Resource.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Resource.fetchBlob=function(e){return new Resource(e).fetchBlob()},Resource.prototype.fetchImage=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.preferImageBitmap,!1),i=defaultValue(e.preferBlob,!1),r=defaultValue(e.flipY,!1);if(checkAndResetRequest(this.request),!xhrBlobSupported||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!i)return fetchImage({resource:this,flipY:r,preferImageBitmap:t});var n,a,o,s=this.fetchBlob();return defined(s)?Resource.supportsImageBitmapOptions().then(function(e){return n=e&&t,s}).then(function(e){if(defined(e)){if(o=e,n)return Resource.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1});e=window.URL.createObjectURL(e);return fetchImage({resource:a=new Resource({url:e}),flipY:r,preferImageBitmap:!1})}}).then(function(e){if(defined(e))return e.blob=o,n||window.URL.revokeObjectURL(a.url),e}).otherwise(function(e){return defined(a)&&window.URL.revokeObjectURL(a.url),e.blob=o,when.reject(e)}):void 0},Resource.fetchImage=function(e){return new Resource(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Resource.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Resource.fetchText=function(e){return new Resource(e).fetchText()},Resource.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(defined(e))return e.then(function(e){if(defined(e))return JSON.parse(e)})},Resource.fetchJson=function(e){return new Resource(e).fetchJson()},Resource.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Resource.fetchXML=function(e){return new Resource(e).fetchXML()},Resource.prototype.fetchJsonp=function(e){var t;for(e=defaultValue(e,"callback"),checkAndResetRequest(this.request);t="loadJsonp"+Math.random().toString().substring(2,8),defined(window[t]););return fetchJsonp(this,e,t)},Resource.fetchJsonp=function(e){return new Resource(e).fetchJsonp(e.callbackParameterName)},Resource.prototype._makeRequest=function(s){var l=this;checkAndResetRequest(l.request);var c=l.request;c.url=l.url,c.requestFunction=function(){var e=s.responseType,t=combine$2(s.headers,l.headers),i=s.overrideMimeType,r=s.method,n=s.data,a=when.defer(),o=Resource._Implementations.loadWithXhr(l.url,e,r,n,t,a,i);return defined(o)&&defined(o.abort)&&(c.cancelFunction=function(){o.abort()}),a.promise};var e=RequestScheduler.request(c);if(defined(e))return e.then(function(e){return c.cancelFunction=void 0,e}).otherwise(function(t){return c.cancelFunction=void 0,c.state!==RequestState$1.FAILED?when.reject(t):l.retryOnError(t).then(function(e){return e?(c.state=RequestState$1.UNISSUED,c.deferred=void 0,l.fetch(s)):when.reject(t)})})};var dataUriRegex$1=/^data:(.*?)(;base64)?,(.*)$/;function decodeDataUriText(e,t){t=decodeURIComponent(t);return e?atob(t):t}function decodeDataUriArrayBuffer(e,t){for(var i=decodeDataUriText(e,t),t=new ArrayBuffer(i.length),r=new Uint8Array(t),n=0;n/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _toConsumableArray$1(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t/i,i))b(o,e);else{Q&&(i=stringReplace(i,L," "),i=stringReplace(i,F," "));var c=e.nodeName.toLowerCase();if(M(c,l,i))try{s?e.setAttributeNS(s,o,i):e.setAttribute(o,i),arrayPop(u.removed)}catch(e){}}}w("afterSanitizeAttributes",e,null)}}function R(e){var t,i=P(e);for(w("beforeSanitizeShadowDOM",e,null);t=i.nextNode();)w("uponSanitizeShadowNode",t,null),D(t)||(t.content instanceof d&&R(t.content),I(t));w("afterSanitizeShadowDOM",e,null)}var O,L=MUSTACHE_EXPR,F=ERB_EXPR,N=DATA_ATTR,B=ARIA_ATTR,V=IS_SCRIPT_OR_DATA,k=ATTR_WHITESPACE,z=IS_ALLOWED_URI,$=null,U=addToSet({},[].concat(_toConsumableArray$1(html),_toConsumableArray$1(svg),_toConsumableArray$1(svgFilters),_toConsumableArray$1(mathMl),_toConsumableArray$1(text))),G=null,H=addToSet({},[].concat(_toConsumableArray$1(html$1),_toConsumableArray$1(svg$1),_toConsumableArray$1(mathMl$1),_toConsumableArray$1(xml))),W=null,q=null,j=!0,Y=!0,X=!1,Q=!1,J=!1,Z=!1,K=!1,ee=!1,te=!1,ie=!0,re=!1,ne=!0,ae=!0,oe=!1,se=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),le=null,ce=addToSet({},["audio","video","img","source","image","track"]),ue=null,de=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),he=null,pe=a.createElement("form");return u.sanitize=function(e,t){var i,r,n=void 0,a=void 0,o=void 0;if("string"!=typeof(e=e||"\x3c!--\x3e")&&!A(e)){if("function"!=typeof e.toString)throw typeErrorCreate("toString is not a function");if("string"!=typeof(e=e.toString()))throw typeErrorCreate("dirty is not a string, aborting")}if(!u.isSupported){if("object"===_typeof(l.toStaticHTML)||"function"==typeof l.toStaticHTML){if("string"==typeof e)return l.toStaticHTML(e);if(A(e))return l.toStaticHTML(e.outerHTML)}return e}if(Z||T(t),u.removed=[],"string"==typeof e&&(oe=!1),!oe)if(e instanceof h)1===(i=(n=E("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!ee&&!Q&&!J&&-1===e.indexOf("<"))return m&&re?m.createHTML(e):e;if(!(n=E(e)))return ee?null:f}n&&K&&x(n.firstChild);for(var s=P(oe?e:n);r=s.nextNode();)3===r.nodeType&&r===a||D(r)||(r.content instanceof d&&R(r.content),I(r),a=r);if(a=null,oe)return e;if(ee){if(te)for(o=y.call(n.ownerDocument);n.firstChild;)o.appendChild(n.firstChild);else o=n;return o=ie?C.call(c,o,!0):o}e=J?n.outerHTML:n.innerHTML;return Q&&(e=stringReplace(e,L," "),e=stringReplace(e,F," ")),m&&re?m.createHTML(e):e},u.setConfig=function(e){T(e),Z=!0},u.clearConfig=function(){he=null,Z=!1},u.isValidAttribute=function(e,t,i){he||T({});e=stringToLowerCase(e),t=stringToLowerCase(t);return M(e,t,i)},u.addHook=function(e,t){"function"==typeof t&&(S[e]=S[e]||[],arrayPush(S[e],t))},u.removeHook=function(e){S[e]&&arrayPop(S[e])},u.removeHooks=function(e){S[e]&&(S[e]=[])},u.removeAllHooks=function(){S={}},u}var purify=createDOMPurify(),nextCreditId=0,creditToId={};function Credit(e,t){var i,r=e;defined(creditToId[r])?i=creditToId[r]:(i=nextCreditId++,creditToId[r]=i),t=defaultValue(t,!1),this._id=i,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Credit.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen}},element:{get:function(){if(!defined(this._element)){var e=purify.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;for(var i=t.querySelectorAll("a"),r=0;r-t?((i=scratchCameraPositionInScaledSpaceShrunk).x=this._cameraPosition.x/(r.radii.x+t),i.y=this._cameraPosition.y/(r.radii.y+t),i.z=this._cameraPosition.z/(r.radii.z+t),i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared);return isScaledSpacePointVisible(e,i,t)},EllipsoidalOccluder.prototype.computeHorizonCullingPoint=function(e,t,i){return computeHorizonCullingPointFromPositions(this._ellipsoid,e,t,i)};var scratchEllipsoidShrunk=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,i,r){return computeHorizonCullingPointFromPositions(getPossiblyShrunkEllipsoid(this._ellipsoid,i,scratchEllipsoidShrunk),e,t,r)},EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices=function(e,t,i,r,n){return computeHorizonCullingPointFromVertices(this._ellipsoid,e,t,i,r,n)},EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,i,r,n,a){return computeHorizonCullingPointFromVertices(getPossiblyShrunkEllipsoid(this._ellipsoid,n,scratchEllipsoidShrunk),e,t,i,r,a)};var subsampleScratch=[];EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle=function(e,t,i){var r=Rectangle.subsample(e,t,0,subsampleScratch),e=BoundingSphere.fromPoints(r);if(!(Cartesian3.magnitude(e.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(e.center,r,i)};var scratchEllipsoidShrunkRadii=new Cartesian3;function getPossiblyShrunkEllipsoid(e,t,i){return defined(t)&&t<0&&e.minimumRadius>-t&&(t=Cartesian3.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,scratchEllipsoidShrunkRadii),e=Ellipsoid.fromCartesian3(t,i)),e}function computeHorizonCullingPointFromPositions(e,t,i,r){defined(r)||(r=new Cartesian3);for(var n=computeScaledSpaceDirectionToPoint(e,t),a=0,o=0,s=i.length;oi)}var scaledSpaceScratch=new Cartesian3,directionScratch=new Cartesian3;function computeMagnitude(e,t,i){var r=e.transformPositionToScaledSpace(t,scaledSpaceScratch),e=Cartesian3.magnitudeSquared(r),t=Math.sqrt(e),r=Cartesian3.divideByScalar(r,t,directionScratch),e=Math.max(1,e),t=1/(t=Math.max(1,t));return 1/(Cartesian3.dot(r,i)*t-Cartesian3.magnitude(Cartesian3.cross(r,i,r))*(Math.sqrt(e-1)*t))}function magnitudeToPoint(e,t,i){if(!(t<=0||t===1/0||t!=t))return Cartesian3.multiplyByScalar(e,t,i)}var directionToPointScratch=new Cartesian3;function computeScaledSpaceDirectionToPoint(e,t){return Cartesian3.equals(t,Cartesian3.ZERO)?t:(e.transformPositionToScaledSpace(t,directionToPointScratch),Cartesian3.normalize(directionToPointScratch,directionToPointScratch))}var QuadraticRealPolynomial={};function addWithCancellationCheck$1(e,t,i){var r=e+t;return CesiumMath.sign(e)!==CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))=o[0]&&l[1]<=o[1]?[o[0],l[0],l[1],o[1]]:o[0]>=l[0]&&o[1]<=l[1]?[l[0],o[0],o[1],l[1]]:l[0]>o[0]&&l[0]=f[0]&&m[1]<=f[1]?[f[0],m[0],m[1],f[1]]:f[0]>=m[0]&&f[1]<=m[1]?[m[0],f[0],f[1],m[1]]:m[0]>f[0]&&m[0]Cartesian3.distance(e,t)))return defined(o)||(o=new Cartesian3),Cartesian3.multiplyByScalar(s.direction,a,o),Cartesian3.add(s.origin,o,o)};var raySphereRoots={root0:0,root1:0};function raySphere(e,t,i){defined(i)||(i=new Interval);var r=e.origin,n=e.direction,e=t.center,t=t.radius*t.radius,e=Cartesian3.subtract(r,e,scratchPVec),t=solveQuadratic(Cartesian3.dot(n,n),2*Cartesian3.dot(n,e),Cartesian3.magnitudeSquared(e)-t,raySphereRoots);if(defined(t))return i.start=t.root0,i.stop=t.root1,i}IntersectionTests.raySphere=function(e,t,i){if(defined(i=raySphere(e,t,i))&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var scratchLineSegmentRay=new Ray;IntersectionTests.lineSegmentSphere=function(e,t,i,r){var n=scratchLineSegmentRay;Cartesian3.clone(e,n.origin);t=Cartesian3.subtract(t,e,n.direction),e=Cartesian3.magnitude(t);if(Cartesian3.normalize(t,t),!(!defined(r=raySphere(n,i,r))||r.stop<0||r.start>e))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,e),r};var scratchQ=new Cartesian3,scratchW$1=new Cartesian3;function addWithCancellationCheck(e,t,i){var r=e+t;return CesiumMath.sign(e)!==CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))=t?"":Array(1+t-e.length>>>0).join(i),r?e+i:i+e}function v(e,t,i,r,n,a){var o=r-e.length;return e=0>>0;return e=(i=i&&s&&{2:"0b",8:"0",16:"0x"}[t]||"")+C(s.toString(t),a||0,"0",!1),v(e,i,r,n,o)}function T(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),v(e,"",t,i,n,a)}var x=arguments,b=0,e=x[b++];return e.replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,function(e,t,i,r,n,a,o){var s,l,c,u,d;if("%%"==e)return"%";for(var h=!1,p="",m=!1,f=!1,g=" ",_=i.length,y=0;i&&y<_;y++)switch(i.charAt(y)){case" ":p=" ";break;case"+":p="+";break;case"-":h=!0;break;case"'":g=i.charAt(y+1);break;case"0":m=!0;break;case"#":f=!0}if((r=r?"*"==r?+x[b++]:"*"==r.charAt(0)?+x[r.slice(1,-1)]:+r:0)<0&&(r=-r,h=!0),!isFinite(r))throw new Error("sprintf: (minimum-)width must be finite");switch(a=a?"*"==a?+x[b++]:"*"==a.charAt(0)?+x[a.slice(1,-1)]:+a:-1<"fFeE".indexOf(o)?6:"d"==o?0:void 0,d=t?x[t.slice(0,-1)]:x[b++],o){case"s":return T(String(d),h,r,a,m,g);case"c":return T(String.fromCharCode(+d),h,r,a,m);case"b":return S(d,2,f,h,r,a,m);case"o":return S(d,8,f,h,r,a,m);case"x":return S(d,16,f,h,r,a,m);case"X":return S(d,16,f,h,r,a,m).toUpperCase();case"u":return S(d,10,f,h,r,a,m);case"i":case"d":return s=+d||0,d=(l=(s=Math.round(s-s%1))<0?"-":p)+C(String(Math.abs(s)),a,"0",!1),v(d,l,h,r,m);case"e":case"E":case"f":case"F":case"g":case"G":return l=(s=+d)<0?"-":p,c=["toExponential","toFixed","toPrecision"]["efg".indexOf(o.toLowerCase())],u=["toString","toUpperCase"]["eEfFgG".indexOf(o)%2],d=l+Math.abs(s)[c](a),v(d,l,h,r,m)[u]();default:return e}})}function GregorianDate(e,t,i,r,n,a,o,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=a,this.millisecond=o,this.isLeapSecond=s}function isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}function LeapSecond(e,t){this.julianDate=e,this.offset=t}Plane.transform=function(e,t,i){var r=e.normal,e=e.distance,t=Matrix4.inverseTranspose(t,scratchInverseTranspose),e=Cartesian4.fromElements(r.x,r.y,r.z,e,scratchPlaneCartesian4),e=Matrix4.multiplyByVector(t,e,e),t=Cartesian3.fromCartesian4(e,scratchTransformNormal);return e=Cartesian4.divideByScalar(e,Cartesian3.magnitude(t),e),Plane.fromCartesian4(e,i)},Plane.clone=function(e,t){return defined(t)?(Cartesian3.clone(e.normal,t.normal),t.distance=e.distance,t):new Plane(e.normal,e.distance)},Plane.equals=function(e,t){return e.distance===t.distance&&Cartesian3.equals(e.normal,t.normal)},Plane.ORIGIN_XY_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_Z,0)),Plane.ORIGIN_YZ_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_X,0)),Plane.ORIGIN_ZX_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_Y,0));var TimeConstants={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:2400000.5},TimeConstants$1=Object.freeze(TimeConstants),TimeStandard={UTC:0,TAI:1},TimeStandard$1=Object.freeze(TimeStandard),gregorianDateScratch=new GregorianDate,daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31],daysInLeapFeburary=29;function compareLeapSecondDates$1(e,t){return JulianDate.compare(e.julianDate,t.julianDate)}var binarySearchScratchLeapSecond=new LeapSecond;function convertUtcToTai(e){binarySearchScratchLeapSecond.julianDate=e;var t=JulianDate.leapSeconds,i=binarySearch(t,binarySearchScratchLeapSecond,compareLeapSecondDates$1),r=t[i=(i=i<0?~i:i)>=t.length?t.length-1:i].offset;0=i.length)return JulianDate.addSeconds(e,-i[r-1].offset,t);var n=JulianDate.secondsDifference(i[r].julianDate,e);return 0===n?JulianDate.addSeconds(e,-i[r].offset,t):n<=1?void 0:JulianDate.addSeconds(e,-i[--r].offset,t)}function setComponents(e,t,i){var r=t/TimeConstants$1.SECONDS_PER_DAY|0;return e+=r,(t-=TimeConstants$1.SECONDS_PER_DAY*r)<0&&(e--,t+=TimeConstants$1.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function computeJulianDateComponents(e,t,i,r,n,a,o){var s=(t-14)/12|0,e=e+4800+s,i=(1461*e/4|0)+(367*(t-2-12*s)/12|0)-(3*((e+100)/100|0)/4|0)+i-32075;(r-=12)<0&&(r+=24);o=a+(r*TimeConstants$1.SECONDS_PER_HOUR+n*TimeConstants$1.SECONDS_PER_MINUTE+o*TimeConstants$1.SECONDS_PER_MILLISECOND);return 43200<=o&&--i,[i,o]}var matchCalendarYear=/^(\d{4})$/,matchCalendarMonth=/^(\d{4})-(\d{2})$/,matchOrdinalDate=/^(\d{4})-?(\d{3})$/,matchWeekDate=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,matchCalendarDate=/^(\d{4})-?(\d{2})-?(\d{2})$/,utcOffset=/([Z+\-])?(\d{2})?:?(\d{2})?$/,matchHours=/^(\d{2})(\.\d+)?/.source+utcOffset.source,matchHoursMinutes=/^(\d{2}):?(\d{2})(\.\d+)?/.source+utcOffset.source,matchHoursMinutesSeconds=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+utcOffset.source;function JulianDate(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,TimeStandard$1.UTC);var r=0|e;setComponents(r,t+=(e-r)*TimeConstants$1.SECONDS_PER_DAY,this),i===TimeStandard$1.UTC&&convertUtcToTai(this)}JulianDate.fromGregorianDate=function(e,t){e=computeJulianDateComponents(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return defined(t)?(setComponents(e[0],e[1],t),convertUtcToTai(t),t):new JulianDate(e[0],e[1],TimeStandard$1.UTC)},JulianDate.fromDate=function(e,t){e=computeJulianDateComponents(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return defined(t)?(setComponents(e[0],e[1],t),convertUtcToTai(t),t):new JulianDate(e[0],e[1],TimeStandard$1.UTC)},JulianDate.fromIso8601=function(e,t){var i,r,n,a,o,s=(e=e.replace(",",".")).split("T"),l=1,c=1,u=0,d=0,h=0,p=0,m=s[0],e=s[1];if(null!==(s=m.match(matchCalendarDate))?(n=+s[1],l=+s[2],c=+s[3]):null!==(s=m.match(matchCalendarMonth))?(n=+s[1],l=+s[2]):null!==(s=m.match(matchCalendarYear))?n=+s[1]:(null!==(s=m.match(matchOrdinalDate))?(n=+s[1],a=+s[2],r=isLeapYear(n)):null!==(s=m.match(matchWeekDate))&&(n=+s[1],a=7*+s[2]+(+s[3]||0)-new Date(Date.UTC(n,0,4)).getUTCDay()-3),(i=new Date(Date.UTC(n,0,1))).setUTCDate(a),l=i.getUTCMonth()+1,c=i.getUTCDate()),r=isLeapYear(n),defined(e)){null!==(s=e.match(matchHoursMinutesSeconds))?(u=+s[1],d=+s[2],h=+s[3],p=1e3*+(s[4]||0),o=5):null!==(s=e.match(matchHoursMinutes))?(u=+s[1],d=+s[2],h=60*+(s[3]||0),o=4):null!==(s=e.match(matchHours))&&(u=+s[1],d=60*+(s[2]||0),o=3);var f=s[o],g=+s[o+1],_=+(s[o+2]||0);switch(f){case"+":u-=g,d-=_;break;case"-":u+=g,d+=_;break;case"Z":break;default:d+=new Date(Date.UTC(n,l-1,c,u,d)).getTimezoneOffset()}}f=60===h;for(f&&h--;60<=d;)d-=60,u++;for(;24<=u;)u-=24,c++;for(i=r&&2===l?daysInLeapFeburary:daysInMonth[l-1];it.length-1)return o.xPoleWander=0,o.yPoleWander=0,o.xPoleOffset=0,o.yPoleOffset=0,o.ut1MinusUtc=0,o;var l=t[n],c=t[a];if(l.equals(c)||r.equals(l))return fillResultFromIndex(e,i,n,s,o),o;if(r.equals(c))return fillResultFromIndex(e,i,a,s,o),o;var u=JulianDate.secondsDifference(r,l)/JulianDate.secondsDifference(c,l),d=n*s,t=a*s,l=i[d+e._ut1MinusUtcSecondsColumn],n=i[t+e._ut1MinusUtcSecondsColumn],a=n-l;return!(.5=this._totalSamples&&(r=this._totalSamples-1);for(var t=t/this._samplesPerXysFile|0,n=r/this._samplesPerXysFile|0,a=[],o=t;o<=n;++o)a.push(requestXysChunk(this,o));return when.all(a)},Iau2006XysData.prototype.computeXysRadians=function(e,t,i){var r=getDaysSinceEpoch(this,e,t);if(!(r<0)){e=r/this._stepSizeDays|0;if(!(e>=this._totalSamples)){var n=this._interpolationOrder,a=e-(n/2|0),t=(a=a<0?0:a)+n;t>=this._totalSamples&&(a=(t=this._totalSamples-1)-n)<0&&(a=0);var e=!1,o=this._samples;if(defined(o[3*a])||(requestXysChunk(this,a/this._samplesPerXysFile|0),e=!0),defined(o[3*t])||(requestXysChunk(this,t/this._samplesPerXysFile|0),e=!0),!e){defined(i)?(i.x=0,i.y=0,i.s=0):i=new Iau2006XysSample(0,0,0);for(var s,l=r-a*this._stepSizeDays,c=this._work,u=this._denominators,d=this._coef,h=this._xTable,p=0;p<=n;++p)c[p]=l-h[p];for(p=0;p<=n;++p){for(d[p]=1,s=0;s<=n;++s)s!==p&&(d[p]*=c[s]);d[p]*=u[p];var m=3*(a+p);i.x+=d[p]*o[m++],i.y+=d[p]*o[m++],i.s+=d[p]*o[m]}return i}}}};var _names={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Fullscreen={},theNavigator,isChromeResult,chromeVersionResult,isSafariResult,safariVersionResult,isWebkitResult,webkitVersionResult,isInternetExplorerResult,internetExplorerVersionResult,isEdgeResult,edgeVersionResult,isFirefoxResult,firefoxVersionResult,isWindowsResult,hasPointerEvents,imageRenderingValueResult,supportsImageRenderingPixelatedResult;function extractVersion(e){for(var t=e.split("."),i=0,r=t.length;is&&(o+=(l=r.x-s)*l),r.y<-t?o+=(l=r.y+t)*l:r.y>t&&(o+=(l=r.y-t)*l),r.z<-e?o+=(l=r.z+e)*l:r.z>e&&(o+=(l=r.z-e)*l),o};var scratchCorner=new Cartesian3,scratchToCenter$1=new Cartesian3;OrientedBoundingBox.computePlaneDistances=function(e,t,i,r){defined(r)||(r=new Interval);var n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=e.center,s=e.halfAxes,l=Matrix3.getColumn(s,0,scratchCartesianU),c=Matrix3.getColumn(s,1,scratchCartesianV),u=Matrix3.getColumn(s,2,scratchCartesianW),d=Cartesian3.add(l,c,scratchCorner);Cartesian3.add(d,u,d),Cartesian3.add(d,o,d);e=Cartesian3.subtract(d,t,scratchToCenter$1),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a);return Cartesian3.add(o,l,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.add(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.add(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.add(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),r.start=n,r.stop=a,r};var scratchBoundingSphere$3=new BoundingSphere;OrientedBoundingBox.isOccluded=function(e,t){e=BoundingSphere.fromOrientedBoundingBox(e,scratchBoundingSphere$3);return!t.isBoundingSphereVisible(e)},OrientedBoundingBox.prototype.intersectPlane=function(e){return OrientedBoundingBox.intersectPlane(this,e)},OrientedBoundingBox.prototype.distanceSquaredTo=function(e){return OrientedBoundingBox.distanceSquaredTo(this,e)},OrientedBoundingBox.prototype.computePlaneDistances=function(e,t,i){return OrientedBoundingBox.computePlaneDistances(this,e,t,i)},OrientedBoundingBox.prototype.isOccluded=function(e){return OrientedBoundingBox.isOccluded(this,e)},OrientedBoundingBox.equals=function(e,t){return e===t||defined(e)&&defined(t)&&Cartesian3.equals(e.center,t.center)&&Matrix3.equals(e.halfAxes,t.halfAxes)},OrientedBoundingBox.prototype.clone=function(e){return OrientedBoundingBox.clone(this,e)},OrientedBoundingBox.prototype.equals=function(e){return OrientedBoundingBox.equals(this,e)};var RIGHT_SHIFT=1/256,LEFT_SHIFT=256,AttributeCompression={octEncodeInRange:function(e,t,i){var r;return i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0&&(r=i.x,e=i.y,i.x=(1-Math.abs(e))*CesiumMath.signNotZero(r),i.y=(1-Math.abs(r))*CesiumMath.signNotZero(e)),i.x=CesiumMath.toSNorm(i.x,t),i.y=CesiumMath.toSNorm(i.y,t),i},octEncode:function(e,t){return AttributeCompression.octEncodeInRange(e,255,t)}},octEncodeScratch=new Cartesian2,uint8ForceArray=new Uint8Array(1);function forceUint8(e){return uint8ForceArray[0]=e,uint8ForceArray[0]}AttributeCompression.octEncodeToCartesian4=function(e,t){return AttributeCompression.octEncodeInRange(e,65535,octEncodeScratch),t.x=forceUint8(octEncodeScratch.x*RIGHT_SHIFT),t.y=forceUint8(octEncodeScratch.x),t.z=forceUint8(octEncodeScratch.y*RIGHT_SHIFT),t.w=forceUint8(octEncodeScratch.y),t},AttributeCompression.octDecodeInRange=function(e,t,i,r){return r.x=CesiumMath.fromSNorm(e,i),r.y=CesiumMath.fromSNorm(t,i),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0&&(i=r.x,r.x=(1-Math.abs(r.y))*CesiumMath.signNotZero(i),r.y=(1-Math.abs(i))*CesiumMath.signNotZero(r.y)),Cartesian3.normalize(r,r)},AttributeCompression.octDecode=function(e,t,i){return AttributeCompression.octDecodeInRange(e,t,255,i)},AttributeCompression.octDecodeFromCartesian4=function(e,t){var i=e.x,r=e.y,n=e.z,e=e.w,r=i*LEFT_SHIFT+r,e=n*LEFT_SHIFT+e;return AttributeCompression.octDecodeInRange(r,e,65535,t)},AttributeCompression.octPackFloat=function(e){return 256*e.x+e.y};var scratchEncodeCart2=new Cartesian2;function zigZagDecode(e){return e>>1^-(1&e)}AttributeCompression.octEncodeFloat=function(e){return AttributeCompression.octEncode(e,scratchEncodeCart2),AttributeCompression.octPackFloat(scratchEncodeCart2)},AttributeCompression.octDecodeFloat=function(e,t){var i=e/256,e=Math.floor(i),i=256*(i-e);return AttributeCompression.octDecode(e,i,t)},AttributeCompression.octPack=function(e,t,i,r){e=AttributeCompression.octEncodeFloat(e),t=AttributeCompression.octEncodeFloat(t),i=AttributeCompression.octEncode(i,scratchEncodeCart2);return r.x=65536*i.x+e,r.y=65536*i.y+t,r},AttributeCompression.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),o=65536*(n-a),n=e.y/65536,e=Math.floor(n),n=65536*(n-e);AttributeCompression.octDecodeFloat(o,t),AttributeCompression.octDecodeFloat(n,i),AttributeCompression.octDecode(a,e,r)},AttributeCompression.compressTextureCoordinates=function(e){return 4096*(4095*e.x|0)+(4095*e.y|0)},AttributeCompression.decompressTextureCoordinates=function(e,t){var i=e/4096,i=Math.floor(i);return t.x=i/4095,t.y=(e-4096*i)/4095,t},AttributeCompression.zigZagDeltaDecode=function(e,t,i){for(var r=e.length,n=0,a=0,o=0,s=0;sWebMercatorProjection.MaximumLatitude?e=WebMercatorProjection.MaximumLatitude:e<-WebMercatorProjection.MaximumLatitude&&(e=-WebMercatorProjection.MaximumLatitude);e=Math.sin(e);return.5*Math.log((1+e)/(1-e))},WebMercatorProjection.MaximumLatitude=WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI),WebMercatorProjection.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,i=WebMercatorProjection.geodeticLatitudeToMercatorAngle(e.latitude)*i,e=e.height;return defined(t)?(t.x=r,t.y=i,t.z=e,t):new Cartesian3(r,i,e)},WebMercatorProjection.prototype.unproject=function(e,t){var i=this._oneOverSemimajorAxis,r=e.x*i,i=WebMercatorProjection.mercatorAngleToGeodeticLatitude(e.y*i),e=e.z;return defined(t)?(t.longitude=r,t.latitude=i,t.height=e,t):new Cartographic(r,i,e)};var HeightmapTessellator={};HeightmapTessellator.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var cartesian3Scratch$2=new Cartesian3,matrix4Scratch=new Matrix4,minimumScratch=new Cartesian3,maximumScratch=new Cartesian3;function returnTrue(){return!0}function destroyObject(e,t){function i(){}for(var r in e)"function"==typeof e[r]&&(e[r]=i);e.isDestroyed=returnTrue}function canTransferArrayBuffer(){if(!defined(TaskProcessor._canTransferArrayBuffer)){var t=new Worker(getWorkerUrl("Workers/transferTypedArrayTest.js"));t.postMessage=defaultValue(t.webkitPostMessage,t.postMessage);var e=new Int8Array([99]);try{t.postMessage({array:e},[e.buffer])}catch(e){return TaskProcessor._canTransferArrayBuffer=!1,TaskProcessor._canTransferArrayBuffer}var i=when.defer();t.onmessage=function(e){e=e.data.array,e=defined(e)&&99===e[0];i.resolve(e),t.terminate(),TaskProcessor._canTransferArrayBuffer=e},TaskProcessor._canTransferArrayBuffer=i.promise}return TaskProcessor._canTransferArrayBuffer}HeightmapTessellator.computeVertices=function(e){var t,i,r,n=Math.cos,a=Math.sin,o=Math.sqrt,s=Math.atan,l=Math.exp,c=CesiumMath.PI_OVER_TWO,u=CesiumMath.toRadians,d=e.heightmap,h=e.width,p=e.height,m=e.skirtHeight,f=defaultValue(e.isGeographic,!0),g=defaultValue(e.ellipsoid,Ellipsoid.WGS84),_=1/g.maximumRadius,y=e.nativeRectangle,C=e.rectangle,v=defined(C)?(t=C.west,i=C.south,r=C.east,C.north):f?(t=u(y.west),i=u(y.south),r=u(y.east),u(y.north)):(t=y.west*_,i=c-2*s(l(-y.south*_)),r=y.east*_,c-2*s(l(-y.north*_))),S=defined(T=e.relativeToCenter),T=S?T:Cartesian3.ZERO,x=defaultValue(e.exaggeration,1),b=defaultValue(e.includeWebMercatorT,!1),E=defaultValue(e.structure,HeightmapTessellator.DEFAULT_STRUCTURE),P=defaultValue(E.heightScale,HeightmapTessellator.DEFAULT_STRUCTURE.heightScale),A=defaultValue(E.heightOffset,HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset),w=defaultValue(E.elementsPerHeight,HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight),D=defaultValue(E.stride,HeightmapTessellator.DEFAULT_STRUCTURE.stride),M=defaultValue(E.elementMultiplier,HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier),I=defaultValue(E.isBigEndian,HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian),R=Rectangle.computeWidth(y),O=Rectangle.computeHeight(y),L=R/(h-1),F=O/(p-1);f||(R*=_,O*=_);var N,B,e=g.radiiSquared,V=e.x,k=e.y,z=e.z,$=65536,U=-65536,E=Transforms.eastNorthUpToFixedFrame(T,g),G=Matrix4.inverseTransformation(E,matrix4Scratch);b&&(N=WebMercatorProjection.geodeticLatitudeToMercatorAngle(i),B=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(v)-N));var H=minimumScratch;H.x=Number.POSITIVE_INFINITY,H.y=Number.POSITIVE_INFINITY,H.z=Number.POSITIVE_INFINITY;var W=maximumScratch;W.x=Number.NEGATIVE_INFINITY,W.y=Number.NEGATIVE_INFINITY,W.z=Number.NEGATIVE_INFINITY;var q=Number.POSITIVE_INFINITY,j=h*p,Y=j+(0=this._maximumActiveTasks)){++this._activeTasks;var a=this;return when(canTransferArrayBuffer(),function(e){defined(n)?e||(n.length=0):n=emptyTransferableObjectArray;var t=a._nextID++,i=when.defer();return a._deferreds[t]=i,a._worker.postMessage({id:t,parameters:r,canTransferArrayBuffer:e},n),i.promise})}},TaskProcessor.prototype.initWebAssemblyModule=function(e){defined(this._worker)||(this._worker=createWorker(this));var n=when.defer(),a=this,o=this._worker;return getWebAssemblyLoaderConfig(this,e).then(function(r){return when(canTransferArrayBuffer(),function(e){var t,i=r.wasmBinary;defined(i)&&e&&(t=[i]),o.onmessage=function(e){o.onmessage=function(e){completeTask(a,e.data)},n.resolve(e.data)},o.postMessage({webAssemblyConfig:r},t)})}),n},TaskProcessor.prototype.isDestroyed=function(){return!1},TaskProcessor.prototype.destroy=function(){return defined(this._worker)&&this._worker.terminate(),destroyObject(this)},TaskProcessor.taskCompletedEvent=taskCompletedEvent,TaskProcessor._defaultWorkerModulePrefix="Workers/",TaskProcessor._workerModulePrefix=TaskProcessor._defaultWorkerModulePrefix,TaskProcessor._canTransferArrayBuffer=void 0,Object.defineProperties(TerrainData.prototype,{credits:{get:DeveloperError.throwInstantiationError},waterMask:{get:DeveloperError.throwInstantiationError}}),TerrainData.prototype.interpolateHeight=DeveloperError.throwInstantiationError,TerrainData.prototype.isChildAvailable=DeveloperError.throwInstantiationError,TerrainData.prototype.createMesh=DeveloperError.throwInstantiationError,TerrainData.prototype.upsample=DeveloperError.throwInstantiationError,TerrainData.prototype.wasCreatedByUpsampling=DeveloperError.throwInstantiationError,TerrainData.maximumAsynchronousTasks=5;var IndexDatatype={UNSIGNED_BYTE:WebGLConstants$1.UNSIGNED_BYTE,UNSIGNED_SHORT:WebGLConstants$1.UNSIGNED_SHORT,UNSIGNED_INT:WebGLConstants$1.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case IndexDatatype.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case IndexDatatype.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case IndexDatatype.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},fromSizeInBytes:function(e){switch(e){case 2:return IndexDatatype.UNSIGNED_SHORT;case 4:return IndexDatatype.UNSIGNED_INT;case 1:return IndexDatatype.UNSIGNED_BYTE}},validate:function(e){return defined(e)&&(e===IndexDatatype.UNSIGNED_BYTE||e===IndexDatatype.UNSIGNED_SHORT||e===IndexDatatype.UNSIGNED_INT)},createTypedArray:function(e,t){return new(e>=CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(t)},createTypedArrayFromArrayBuffer:function(e,t,i,r){return new(e>=CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(t,i,r)}},IndexDatatype$1=Object.freeze(IndexDatatype);function TerrainProvider(){DeveloperError.throwInstantiationError()}Object.defineProperties(TerrainProvider.prototype,{errorEvent:{get:DeveloperError.throwInstantiationError},credit:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},ready:{get:DeveloperError.throwInstantiationError},readyPromise:{get:DeveloperError.throwInstantiationError},hasWaterMask:{get:DeveloperError.throwInstantiationError},hasVertexNormals:{get:DeveloperError.throwInstantiationError},availability:{get:DeveloperError.throwInstantiationError}});var regularGridIndicesCache=[];TerrainProvider.getRegularGridIndices=function(e,t){var i=regularGridIndicesCache[e];defined(i)||(regularGridIndicesCache[e]=i=[]);var r=i[t];return defined(r)||addRegularGridIndices(e,t,r=e*tu.highestEncodedHeight?u.highestEncodedHeight:A)}return new HeightmapTerrainData({buffer:h,width:l,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},HeightmapTerrainData.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function rectangleContainsPosition(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function findMaxLevelFromNode(e,t,i){for(var r=0,n=!1;!n;){var a=t._nw&&rectangleContainsPosition(t._nw.extent,i),o=t._ne&&rectangleContainsPosition(t._ne.extent,i),s=t._sw&&rectangleContainsPosition(t._sw.extent,i),l=t._se&&rectangleContainsPosition(t._se.extent,i);if(1r;--u){var d=c[u];rectangleContainsPosition(d,i)&&(r=d.level)}t=t.parent}return r}function updateCoverageWithNode(e,t,i){if(t){var r=!1;for(a=0;at.east&&i.push(new Rectangle(t.east,n.south,n.east,n.north)),n.southt.north&&i.push(new Rectangle(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):i.push(n)}return i}function formatError(e){var t=e.name,i=e.message,i=defined(t)&&defined(i)?t+": "+i:e.toString(),e=e.stack;return defined(e)&&(i+="\n"+e),i}function TileProviderError(e,t,i,r,n,a,o){this.provider=e,this.message=t,this.x=i,this.y=r,this.level=n,this.timesRetried=defaultValue(a,0),this.retry=!1,this.error=o}function WebMercatorTilingScheme(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._numberOfLevelZeroTilesX=defaultValue(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=defaultValue(e.numberOfLevelZeroTilesY,1),this._projection=new WebMercatorProjection(this._ellipsoid),defined(e.rectangleSouthwestInMeters)&&defined(e.rectangleNortheastInMeters)?(this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters):(t=this._ellipsoid.maximumRadius*Math.PI,this._rectangleSouthwestInMeters=new Cartesian2(-t,-t),this._rectangleNortheastInMeters=new Cartesian2(t,t));var e=this._projection.unproject(this._rectangleSouthwestInMeters),t=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Rectangle(e.longitude,e.latitude,t.longitude,t.latitude)}TileAvailability.prototype.isTileAvailable=function(e,t,i){i=this._tilingScheme.tileXYToRectangle(t,i,e,rectangleScratch$6);return Rectangle.center(i,cartographicScratch$4),this.computeMaximumLevelAtPosition(cartographicScratch$4)>=e},TileAvailability.prototype.computeChildMaskForTile=function(e,t,i){var r=e+1;if(r>=this._maximumLevel)return 0;e=0;return e|=this.isTileAvailable(r,2*t,2*i+1)?1:0,e|=this.isTileAvailable(r,2*t+1,2*i+1)?2:0,e|=this.isTileAvailable(r,2*t,2*i)?4:0,e|=this.isTileAvailable(r,2*t+1,2*i)?8:0},Object.defineProperties(QuadtreeNode.prototype,{nw:{get:function(){return this._nw||(this._nw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),TileProviderError.handleError=function(e,t,i,r,n,a,o,s,l){var c=e;return defined(e)?(c.provider=t,c.message=r,c.x=n,c.y=a,c.level=o,c.retry=!1,c.error=l,++c.timesRetried):c=new TileProviderError(t,r,n,a,o,0,l),0e._lodCount)&&(!!a.isTileAvailable(t,i,r)||!n.isTileAvailable(t,i,r)&&void 0)}}function findRange(e,t,i,r){for(var n=t-1,a=i-1,o=r[e.y*t+e.x],s=[],l={startX:e.x,startY:e.y,endX:0,endY:0},c=new Cartesian2(e.x+1,e.y+1),u=!1,d=!1;!u||!d;){var h=c.x,p=d?c.y+1:c.y;if(!u){for(var m=e.y;m>>0,i=defaultValue(i,0),a=i<0?Math.max(n+i,0):Math.min(i,n),r=defaultValue(r,n),o=r<0?Math.max(n+r,0):Math.min(r,n);ai.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),e>i.height?i.height=e:e<0&&(i.height-=e,i.y=t.y),i},BoundingRectangle.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,a=t.y;return i>n+t.width||i+e.widtha+t.height?Intersect$1.OUTSIDE:Intersect$1.INTERSECTING},BoundingRectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},BoundingRectangle.prototype.clone=function(e){return BoundingRectangle.clone(this,e)},BoundingRectangle.prototype.intersect=function(e){return BoundingRectangle.intersect(this,e)},BoundingRectangle.prototype.equals=function(e){return BoundingRectangle.equals(this,e)};var GeometryType={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},GeometryType$1=Object.freeze(GeometryType);function Matrix2(e,t,i,r){this[0]=defaultValue(e,0),this[1]=defaultValue(i,0),this[2]=defaultValue(t,0),this[3]=defaultValue(r,0)}Matrix2.packedLength=4,Matrix2.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},Matrix2.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Matrix2:i)[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},Matrix2.clone=function(e,t){if(defined(e))return defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Matrix2(e[0],e[2],e[1],e[3])},Matrix2.fromArray=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Matrix2:i)[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},Matrix2.fromColumnMajorArray=function(e,t){return Matrix2.clone(e,t)},Matrix2.fromRowMajorArray=function(e,t){return defined(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Matrix2(e[0],e[1],e[2],e[3])},Matrix2.fromScale=function(e,t){return defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Matrix2(e.x,0,0,e.y)},Matrix2.fromUniformScale=function(e,t){return defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Matrix2(e,0,0,e)},Matrix2.fromRotation=function(e,t){var i=Math.cos(e),e=Math.sin(e);return defined(t)?(t[0]=i,t[1]=e,t[2]=-e,t[3]=i,t):new Matrix2(i,-e,e,i)},Matrix2.toArray=function(e,t){return defined(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]]},Matrix2.getElementIndex=function(e,t){return 2*e+t},Matrix2.getColumn=function(e,t,i){var r=2*t,t=e[r],r=e[1+r];return i.x=t,i.y=r,i},Matrix2.setColumn=function(e,t,i,r){t*=2;return(r=Matrix2.clone(e,r))[t]=i.x,r[1+t]=i.y,r},Matrix2.getRow=function(e,t,i){var r=e[t],t=e[t+2];return i.x=r,i.y=t,i},Matrix2.setRow=function(e,t,i,r){return(r=Matrix2.clone(e,r))[t]=i.x,r[t+2]=i.y,r};var scratchColumn=new Cartesian2;Matrix2.getScale=function(e,t){return t.x=Cartesian2.magnitude(Cartesian2.fromElements(e[0],e[1],scratchColumn)),t.y=Cartesian2.magnitude(Cartesian2.fromElements(e[2],e[3],scratchColumn)),t};var scratchScale$4=new Cartesian2;Matrix2.getMaximumScale=function(e){return Matrix2.getScale(e,scratchScale$4),Cartesian2.maximumComponent(scratchScale$4)},Matrix2.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],t=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=a,i[2]=n,i[3]=t,i},Matrix2.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},Matrix2.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},Matrix2.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,t=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=t,i},Matrix2.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},Matrix2.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},Matrix2.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},Matrix2.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],e=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=e,t},Matrix2.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},Matrix2.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},Matrix2.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},Matrix2.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},Matrix2.IDENTITY=Object.freeze(new Matrix2(1,0,0,1)),Matrix2.ZERO=Object.freeze(new Matrix2(0,0,0,0)),Matrix2.COLUMN0ROW0=0,Matrix2.COLUMN0ROW1=1,Matrix2.COLUMN1ROW0=2,Matrix2.COLUMN1ROW1=3,Object.defineProperties(Matrix2.prototype,{length:{get:function(){return Matrix2.packedLength}}}),Matrix2.prototype.clone=function(e){return Matrix2.clone(this,e)},Matrix2.prototype.equals=function(e){return Matrix2.equals(this,e)},Matrix2.prototype.equalsEpsilon=function(e,t){return Matrix2.equalsEpsilon(this,e,t)},Matrix2.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"};var PrimitiveType={POINTS:WebGLConstants$1.POINTS,LINES:WebGLConstants$1.LINES,LINE_LOOP:WebGLConstants$1.LINE_LOOP,LINE_STRIP:WebGLConstants$1.LINE_STRIP,TRIANGLES:WebGLConstants$1.TRIANGLES,TRIANGLE_STRIP:WebGLConstants$1.TRIANGLE_STRIP,TRIANGLE_FAN:WebGLConstants$1.TRIANGLE_FAN,validate:function(e){return e===PrimitiveType.POINTS||e===PrimitiveType.LINES||e===PrimitiveType.LINE_LOOP||e===PrimitiveType.LINE_STRIP||e===PrimitiveType.TRIANGLES||e===PrimitiveType.TRIANGLE_STRIP||e===PrimitiveType.TRIANGLE_FAN}},PrimitiveType$1=Object.freeze(PrimitiveType);function Geometry(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=defaultValue(e.primitiveType,PrimitiveType$1.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=defaultValue(e.geometryType,GeometryType$1.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}Geometry.computeNumberOfVertices=function(e){var t,i,r=-1;for(t in e.attributes)e.attributes.hasOwnProperty(t)&&defined(e.attributes[t])&&defined(e.attributes[t].values)&&(r=(i=e.attributes[t]).values.length/i.componentsPerAttribute);return r};var rectangleCenterScratch$3=new Cartographic,enuCenterScratch=new Cartesian3,fixedFrameToEnuScratch=new Matrix4,boundingRectanglePointsCartographicScratch=[new Cartographic,new Cartographic,new Cartographic],boundingRectanglePointsEnuScratch=[new Cartesian2,new Cartesian2,new Cartesian2],points2DScratch$2=[new Cartesian2,new Cartesian2,new Cartesian2],pointEnuScratch=new Cartesian3,enuRotationScratch=new Quaternion,enuRotationMatrixScratch=new Matrix4,rotation2DScratch$1=new Matrix2;function GeometryAttribute(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=defaultValue(e.normalize,!1),this.values=e.values}function GeometryAttributes(e){e=defaultValue(e,defaultValue.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}Geometry._textureCoordinateRotationPoints=function(e,t,i,r){var n=Rectangle.center(r,rectangleCenterScratch$3),a=Cartographic.toCartesian(n,i,enuCenterScratch),n=Transforms.eastNorthUpToFixedFrame(a,i,fixedFrameToEnuScratch),o=Matrix4.inverse(n,fixedFrameToEnuScratch),s=boundingRectanglePointsEnuScratch,l=boundingRectanglePointsCartographicScratch;l[0].longitude=r.west,l[0].latitude=r.south,l[1].longitude=r.west,l[1].latitude=r.north,l[2].longitude=r.east,l[2].latitude=r.south;for(var c=pointEnuScratch,u=0;u<3;u++)Cartographic.toCartesian(l[u],i,c),c=Matrix4.multiplyByPointAsVector(o,c,c),s[u].x=c.x,s[u].y=c.y;var a=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,-t,enuRotationScratch),d=Matrix3.fromQuaternion(a,enuRotationMatrixScratch),h=e.length,p=Number.POSITIVE_INFINITY,m=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,g=Number.NEGATIVE_INFINITY;for(u=0;u=r[t=defaultValue(t,0)]){if(t+1=r[t-1])return t-1;if(e>r[t])for(i=t;i=r[i]&&e=r[i]&&e>10),56320+(1023&a)))}return t},"undefined"!=typeof TextDecoder?getStringFromTypedArray.decode=getStringFromTypedArray.decodeWithTextDecoder:getStringFromTypedArray.decode=getStringFromTypedArray.decodeWithFromCharCode;var Intersections2D={};function QuantizedMeshTerrainData(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;var t=this._quantizedVertices.length/3,i=this._uValues=this._quantizedVertices.subarray(0,t),r=this._vValues=this._quantizedVertices.subarray(t,2*t);function n(e,t){return r[e]-r[t]}function a(e,t){return i[e]-i[t]}this._heightValues=this._quantizedVertices.subarray(2*t,3*t),this._westIndices=sortIndicesIfNecessary(e.westIndices,n,t),this._southIndices=sortIndicesIfNecessary(e.southIndices,a,t),this._eastIndices=sortIndicesIfNecessary(e.eastIndices,n,t),this._northIndices=sortIndicesIfNecessary(e.northIndices,a,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=defaultValue(e.childTileMask,15),this._createdByUpsampling=defaultValue(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Intersections2D.clipTriangleAtAxisAlignedThreshold=function(e,t,i,r,n,a){var o,s;defined(a)?a.length=0:a=[];var l,c,u,d,h,p,m=t?(o=ithis._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(i,e,t))return!0;if(!this._hasMetadata)return!1;for(var r=this._layers,n=r.length,a=0;athis._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var r=this._layers,n=r.length,a=0;ar&&(s[t[u]]=c,++c);return(c-r+1)/(n/3)}};Tipsify.tipsify=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).indices,i=e.maximumIndex,r=defaultValue(e.cacheSize,24);function n(e,t,i,r,n,a,o){for(var s,l=-1,c=-1,u=0;ur&&(d.timeStamp=p,++p),++b}h=n(0,r,f,l,p,g,a)}return y};var GeometryPipeline={};function addTriangle(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function trianglesToLines(e){for(var t=e.length,i=t/3*6,r=IndexDatatype$1.createTypedArray(t,i),n=0,a=0;an&&(n=i[a]);e.indices=Tipsify.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},GeometryPipeline.fitToUnsignedShortIndices=function(e){var t=[],i=Geometry.computeNumberOfVertices(e);if(defined(e.indices)&&i>=CesiumMath.SIXTY_FOUR_KILOBYTES){var r,n=[],a=[],o=0,s=copyAttributesDescriptions(e.attributes),l=e.indices,c=l.length;e.primitiveType===PrimitiveType$1.TRIANGLES?r=3:e.primitiveType===PrimitiveType$1.LINES?r=2:e.primitiveType===PrimitiveType$1.POINTS&&(r=1);for(var u=0;u=CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new Geometry({attributes:s,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],a=[],o=0,s=copyAttributesDescriptions(e.attributes))}0!==a.length&&t.push(new Geometry({attributes:s,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var scratchProjectTo2DCartesian3=new Cartesian3,scratchProjectTo2DCartographic=new Cartographic;GeometryPipeline.projectTo2D=function(e,t,i,r,n){for(var a=e.attributes[t],o=(n=defined(n)?n:new GeographicProjection).ellipsoid,s=a.values,l=new Float64Array(s.length),c=0,u=0;uCesiumMath.EPSILON6?1:0},p0Scratch=new Cartesian3,p1Scratch$2=new Cartesian3,p2Scratch$2=new Cartesian3,barycentricScratch=new Cartesian3;function computeTriangleAttributes(e,t,i,r,n,a,o,s,l,c,u,d,h,p,m,f){if(defined(a)||defined(o)||defined(s)||defined(l)||defined(c)||0!==p){var g,_=barycentricCoordinates(r,Cartesian3.fromArray(n,3*e,p0Scratch),Cartesian3.fromArray(n,3*t,p1Scratch$2),Cartesian3.fromArray(n,3*i,p2Scratch$2),barycentricScratch);if(defined(a)&&interpolateAndPackCartesian3(e,t,i,_,a,d.normal.values,f,!0),defined(c)&&(n=Cartesian3.fromArray(c,3*e,p0Scratch),a=Cartesian3.fromArray(c,3*t,p1Scratch$2),c=Cartesian3.fromArray(c,3*i,p2Scratch$2),Cartesian3.multiplyByScalar(n,_.x,n),Cartesian3.multiplyByScalar(a,_.y,a),Cartesian3.multiplyByScalar(c,_.z,c),Cartesian3.equals(n,Cartesian3.ZERO)&&Cartesian3.equals(a,Cartesian3.ZERO)&&Cartesian3.equals(c,Cartesian3.ZERO)?((g=p0Scratch).x=0,g.y=0,g.z=0):(g=Cartesian3.add(n,a,n),Cartesian3.add(g,c,g),Cartesian3.normalize(g,g)),Cartesian3.pack(g,d.extrudeDirection.values,3*f)),defined(u)&&interpolateAndPackBoolean(e,t,i,_,u,d.applyOffset.values,f),defined(o)&&interpolateAndPackCartesian3(e,t,i,_,o,d.tangent.values,f,!0),defined(s)&&interpolateAndPackCartesian3(e,t,i,_,s,d.bitangent.values,f,!0),defined(l)&&interpolateAndPackCartesian2(e,t,i,_,l,d.st.values,f),0CesiumMath.PI&&(o.north=0CesiumMath.EPSILON8?(o=calculateInverseM(calculateM(n,r,e.latitude)+i*Math.cos(t),n,r),l=calculateSigma(n,e.latitude),s=calculateSigma(n,o),l=Math.tan(t)*(s-l),CesiumMath.negativePiToPi(e.longitude+l)):(o=e.latitude,l=i/(0===n?r*Math.cos(e.latitude):(n=Math.sin(e.latitude),r*Math.cos(e.latitude)/Math.sqrt(1-c*n*n))),080*i){for(var h=r=e[0],p=n=e[1],m=i;ma.x?n.x>o.x?n:o:a.x>o.x?a:o).x,u=(n.y>a.y?n.y>o.y?n:o:a.y>o.y?a:o).y,d=zOrder(s,l,t,i,r),h=zOrder(c,u,t,i,r),p=e.prevZ,m=e.nextZ;p&&p.z>=d&&m&&m.z<=h;){if(p!==e.prev&&p!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return;if(p=p.prevZ,m!==e.prev&&m!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,m.x,m.y)&&0<=area(m.prev,m,m.next))return;m=m.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return;p=p.prevZ}for(;m&&m.z<=h;){if(m!==e.prev&&m!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,m.x,m.y)&&0<=area(m.prev,m,m.next))return;m=m.nextZ}return 1}}function cureLocalIntersections(e,t,i){var r=e;do{var n=r.prev,a=r.next.next}while(!equals(n,a)&&intersects$1(n,r,r.next,a)&&locallyInside(n,a)&&locallyInside(a,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(a.i/i),removeNode(r),removeNode(r.next),r=e=a),(r=r.next)!==e);return filterPoints(r)}function splitEarcut(e,t,i,r,n,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&isValidDiagonal(o,s)){var l=splitPolygon(o,s),o=filterPoints(o,o.next),l=filterPoints(l,l.next);return earcutLinked(o,t,i,r,n,a),void earcutLinked(l,t,i,r,n,a)}s=s.next}}while((o=o.next)!==e)}function eliminateHoles(e,t,i,r){for(var n,a=[],o=0,s=t.length;o=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&o=r.x&&r.x>=u&&n!==r.x&&pointInTriangle(ai.x||r.x===i.x&§orContainsSector(i,r)))&&(i=r,h=l)),r=r.next,r!==c;);return i}function sectorContainsSector(e,t){return area(e.prev,e,t.prev)<0&&area(t.next,e,e.next)<0}function indexCurve(e,t,i,r){for(var n=e;null===n.z&&(n.z=zOrder(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next,n!==e;);n.prevZ.nextZ=null,n.prevZ=null,sortLinked(n)}function sortLinked(e){var t,i,r,n,a,o,s,l,c=1;do{for(i=e,a=e=null,o=0;i;){for(o++,r=i,t=s=0;t=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function sign(e){return 0a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next,i!==e;);return r}function splitPolygon(e,t){var i=new Node$2(e.i,e.x,e.y),r=new Node$2(t.i,t.x,t.y),n=e.next,a=t.prev;return(e.next=t).prev=e,(i.next=n).prev=i,(r.next=i).prev=r,(a.next=r).prev=a,r}function insertNode(e,t,i,r){i=new Node$2(e,t,i);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function removeNode(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 Node$2(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(e,t,i,r){for(var n=0,a=t,o=i-r;ae.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},Queue.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},Queue.prototype.contains=function(e){return-1!==this._array.indexOf(e)},Queue.prototype.clear=function(){this._array.length=this._offset=this._length=0},Queue.prototype.sort=function(e){0CesiumMath.EPSILON12);n=T*(t*t-i*i)/(i*i),r=n*(256+n*(n*(74-47*n)-128))/1024,t=b*b,r=i*(1+n*(4096+n*(n*(320-175*n)-768))/16384)*(S-r*C*(b+r*(v*(2*t-1)-r*b*(4*C*C-3)*(4*t-3)/6)/4)),t=Math.atan2(c*_,d-p*g),o=Math.atan2(o*_,d*g-p);e._distance=r,e._startHeading=t,e._endHeading=o,e._uSquared=n}var scratchCart1=new Cartesian3,scratchCart2$1=new Cartesian3;function computeProperties(e,t,i,r){Cartesian3.normalize(r.cartographicToCartesian(t,scratchCart2$1),scratchCart1),Cartesian3.normalize(r.cartographicToCartesian(i,scratchCart2$1),scratchCart2$1),vincentyInverseFormula(e,r.maximumRadius,r.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude),e._start=Cartographic.clone(t,e._start),e._end=Cartographic.clone(i,e._end),e._start.height=0,e._end.height=0,setConstants(e)}function EllipsoidGeodesic(e,t,i){i=defaultValue(i,Ellipsoid.WGS84);this._ellipsoid=i,this._start=new Cartographic,this._end=new Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,defined(e)&&defined(t)&&computeProperties(this,e,t,i)}Object.defineProperties(EllipsoidGeodesic.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}}}),EllipsoidGeodesic.prototype.setEndPoints=function(e,t){computeProperties(this,e,t,this._ellipsoid)},EllipsoidGeodesic.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance=function(e,t){var i=this._constants,r=i.distanceRatio+e/i.b,n=Math.cos(2*r),a=Math.cos(4*r),o=Math.cos(6*r),s=Math.sin(2*r),l=Math.sin(4*r),c=Math.sin(6*r),u=Math.sin(8*r),d=r*r,h=r*d,p=i.u8Over256,m=i.u2Over4,f=i.u6Over64,e=i.u4Over16,d=2*h*p*n/3+r*(1-m+7*e/4-15*f/4+579*p/64-(e-15*f/4+187*p/16)*n-(5*f/4-115*p/16)*a-29*p*o/16)+(m/2-e+71*f/32-85*p/16)*s+(5*e/16-5*f/4+383*p/96)*l-d*((f-11*p/2)*s+5*p*l/2)+(29*f/96-29*p/16)*c+539*p*u/1536,s=Math.asin(Math.sin(d)*i.cosineAlpha),l=Math.atan(i.a/i.b*Math.tan(s));d-=i.sigma;f=Math.cos(2*i.sigma+d),c=Math.sin(d),p=Math.cos(d),u=i.cosineU*p,s=i.sineU*c,f=Math.atan2(c*i.sineHeading,u-s*i.cosineHeading)-computeDeltaLambda(i.f,i.sineAlpha,i.cosineSquaredAlpha,d,c,p,f);return defined(t)?(t.longitude=this._start.longitude+f,t.latitude=l,t.height=0,t):new Cartographic(this._start.longitude+f,l,0)};var PolylinePipeline={numberOfPoints:function(e,t,i){t=Cartesian3.distance(e,t);return Math.ceil(t/i)},numberOfPointsRhumbLine:function(e,t,i){t=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(t/(i*i))))}},cartoScratch$2=new Cartographic;PolylinePipeline.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;n>2],r=(3&s)<<4,o=1;break;case 1:n[a++]=l[r|s>>4],r=(15&s)<<2,o=2;break;case 2:n[a++]=l[r|s>>6],n[a++]=l[63&s],o=0}}return o&&(n[a++]=l[r],n[a]=61,1===o&&(n[a+1]=61)),String.fromCharCode.apply(String,n)};var u="invalid encoding";i.decode=function(e,t,i){for(var r,n=i,a=0,o=0;o>4,r=s,a=2;break;case 2:t[i++]=(15&r)<<4|(60&s)>>2,r=s,a=3;break;case 3:t[i++]=(3&r)<<6|s,a=0}}if(1===a)throw Error(u);return i-n},i.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},{}],3:[function(e,t,i){function r(){this._listeners={}}(t.exports=r).prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},r.prototype.off=function(e,t){if(e===undefined$1)this._listeners={};else if(t===undefined$1)this._listeners[e]=[];else for(var i=this._listeners[e],r=0;r>>1,a=null,o=r;return function(e){if(e<1||n>10),a[o++]=56320+(1023&r)):a[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],8191>6|192:(55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(o+1)))?(r=65536+((1023&r)<<10)+(1023&n),++o,t[i++]=r>>18|240,t[i++]=r>>12&63|128):t[i++]=r>>12|224,t[i++]=r>>6&63|128),t[i++]=63&r|128);return i-a}},{}],7:[function(e,t,i){var r=i;function n(){r.Reader._configure(r.BufferReader),r.util._configure()}r.build="minimal",r.roots={},r.Writer=e(14),r.BufferWriter=e(15),r.Reader=e(8),r.BufferReader=e(9),r.util=e(13),r.rpc=e(10),r.configure=n,r.Writer._configure(r.BufferWriter),n()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,i){t.exports=l;var r,n=e(13),a=n.LongBits,o=n.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")};function d(){var e=new a(0,0),t=0;if(!(4=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,4>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new a(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}l.create=n.Buffer?function(e){return(l.create=function(e){return n.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u,l.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)};var m,f,g="undefined"!=typeof Float32Array?(m=new Float32Array(1),f=new Uint8Array(m.buffer),m[0]=-0,f[3]?function(e,t){return f[0]=e[t],f[1]=e[t+1],f[2]=e[t+2],f[3]=e[t+3],m[0]}:function(e,t){return f[0]=e[t+3],f[1]=e[t+2],f[2]=e[t+1],f[3]=e[t],m[0]}):function(e,t){var i=h(e,t+4),e=2*(i>>31)+1,t=i>>>23&255,i=8388607&i;return 255==t?i?NaN:1/0*e:0==t?1401298464324817e-60*e*i:e*Math.pow(2,t-150)*(8388608+i)};l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=g(this.buf,this.pos);return this.pos+=4,e};var _,y,C="undefined"!=typeof Float64Array?(_=new Float64Array(1),y=new Uint8Array(_.buffer),_[0]=-0,y[7]?function(e,t){return y[0]=e[t],y[1]=e[t+1],y[2]=e[t+2],y[3]=e[t+3],y[4]=e[t+4],y[5]=e[t+5],y[6]=e[t+6],y[7]=e[t+7],_[0]}:function(e,t){return y[0]=e[t+7],y[1]=e[t+6],y[2]=e[t+5],y[3]=e[t+4],y[4]=e[t+3],y[5]=e[t+2],y[6]=e[t+1],y[7]=e[t],_[0]}):function(e,t){var i=h(e,t+4),r=h(e,t+8),e=2*(r>>31)+1,t=r>>>20&2047,i=4294967296*(1048575&r)+i;return 2047==t?i?NaN:1/0*e:0==t?5e-324*e*i:e*Math.pow(2,t-1075)*(i+4503599627370496)};l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=C(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw s(this,e);return this.pos+=e,t===i?new this.buf.constructor(0):this._slice.call(this.buf,t,i)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e;var t=n.Long?"toLong":"toNumber";n.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,i){t.exports=n;var r=e(8);(n.prototype=Object.create(r.prototype)).constructor=n;e=e(13);function n(e){r.call(this,e)}e.Buffer&&(n.prototype._slice=e.Buffer.prototype.slice),n.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{13:13,8:8}],10:[function(e,t,i){i.Service=e(11)},{11:11}],11:[function(e,t,i){t.exports=r;var s=e(13);function r(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");s.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}((r.prototype=Object.create(s.EventEmitter.prototype)).constructor=r).prototype.rpcCall=function e(i,t,r,n,a){if(!n)throw TypeError("request must be specified");var o=this;if(!a)return s.asPromise(e,o,i,t,r,n);if(!o.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),undefined$1;try{return o.rpcImpl(i,t[o.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,t){if(e)return o.emit("error",e,i),a(e);if(null===t)return o.end(!0),undefined$1;if(!(t instanceof r))try{t=r[o.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return o.emit("error",e,i),a(e)}return o.emit("data",t,i),a(null,t)})}catch(e){return o.emit("error",e,i),setTimeout(function(){a(e)},0),undefined$1}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{13:13}],12:[function(e,t,i){t.exports=n;var r=e(13);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=n.zero=new n(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return a;var t=e<0,i=(e=t?-e:e)>>>0,e=(e-i)/4294967296>>>0;return t&&(e=~e>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++e&&(e=0))),new n(i,e)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(r.isString(e)){if(!r.Long)return n.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):a},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,e=~this.hi>>>0;return-(t+4294967296*(e=!t?e+1>>>0:e))}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var o=String.prototype.charCodeAt;n.fromHash=function(e){return"\0\0\0\0\0\0\0\0"===e?a:new n((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0==i?0==t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},{13:13}],13:[function(e,t,i){var r=i;function n(e,t,i){for(var r=Object.keys(t),n=0;n>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;127>>7;t[i++]=e.lo}function f(e,t,i){t[i++]=255&e,t[i++]=e>>>8&255,t[i++]=e>>>16&255,t[i]=e>>>24}d.create=n.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d},d.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(d.alloc=n.pool(d.alloc,n.Array.prototype.subarray)),d.prototype.push=function(e,t,i){return this.tail=this.tail.next=new l(e,t,i),this.len+=t,this},(p.prototype=Object.create(l.prototype)).fn=function(e,t,i){for(;127>>=7;t[i]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((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(m,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.int64=d.prototype.uint64=function(e){e=a.from(e);return this.push(m,e.length(),e)},d.prototype.sint64=function(e){e=a.from(e).zzEncode();return this.push(m,e.length(),e)},d.prototype.bool=function(e){return this.push(h,1,e?1:0)},d.prototype.sfixed32=d.prototype.fixed32=function(e){return this.push(f,4,e>>>0)},d.prototype.sfixed64=d.prototype.fixed64=function(e){e=a.from(e);return this.push(f,4,e.lo).push(f,4,e.hi)};var g,_,y="undefined"!=typeof Float32Array?(g=new Float32Array(1),_=new Uint8Array(g.buffer),g[0]=-0,_[3]?function(e,t,i){g[0]=e,t[i++]=_[0],t[i++]=_[1],t[i++]=_[2],t[i]=_[3]}:function(e,t,i){g[0]=e,t[i++]=_[3],t[i++]=_[2],t[i++]=_[1],t[i]=_[0]}):function(e,t,i){var r=e<0?1:0;0===(e=r?-e:e)?f(0<1/e?0:2147483648,t,i):isNaN(e)?f(2147483647,t,i):f(34028234663852886e22>>0:e<11754943508222875e-54?(r<<31|Math.round(e/1401298464324817e-60))>>>0:(r<<31|(r=Math.floor(Math.log(e)/Math.LN2))+127<<23|8388607&Math.round(e*Math.pow(2,-r)*8388608))>>>0,t,i)};d.prototype.float=function(e){return this.push(y,4,e)};var C,v,S="undefined"!=typeof Float64Array?(C=new Float64Array(1),v=new Uint8Array(C.buffer),C[0]=-0,v[7]?function(e,t,i){C[0]=e,t[i++]=v[0],t[i++]=v[1],t[i++]=v[2],t[i++]=v[3],t[i++]=v[4],t[i++]=v[5],t[i++]=v[6],t[i]=v[7]}:function(e,t,i){C[0]=e,t[i++]=v[7],t[i++]=v[6],t[i++]=v[5],t[i++]=v[4],t[i++]=v[3],t[i++]=v[2],t[i++]=v[1],t[i]=v[0]}):function(e,t,i){var r,n,a=e<0?1:0;0===(e=a?-e:e)?(f(0,t,i),f(0<1/e?0:2147483648,t,i+4)):isNaN(e)?(f(4294967295,t,i),f(2147483647,t,i+4)):17976931348623157e292>>0,t,i+4)):e<22250738585072014e-324?(f((r=e/5e-324)>>>0,t,i),f((a<<31|r/4294967296)>>>0,t,i+4)):(1024===(n=Math.floor(Math.log(e)/Math.LN2))&&(n=1023),f(4503599627370496*(r=e*Math.pow(2,-n))>>>0,t,i),f((a<<31|n+1023<<20|1048576*r&1048575)>>>0,t,i+4))};d.prototype.double=function(e){return this.push(S,8,e)};var T=n.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var r=0;r>>0;return i?(n.isString(e)&&(t=d.alloc(i=o.length(e)),o.decode(e,t,0),e=t),this.uint32(i).push(T,i,e)):this.push(h,1,0)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t).push(s.write,t,e):this.push(h,1,0)},d.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,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 l(c,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},d._configure=function(e){r=e}},{13:13}],15:[function(e,t,i){t.exports=o;var r=e(14);(o.prototype=Object.create(r.prototype)).constructor=o;var n=e(13),a=n.Buffer;function o(){r.call(this)}o.alloc=function(e){return(o.alloc=n._Buffer_allocUnsafe)(e)};var s=a&&a.prototype instanceof Uint8Array&&"set"===a.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this.push(s,t,e),this},o.prototype.string=function(e){var t=a.byteLength(e);return this.uint32(t),t&&this.push(l,t,e),this}},{13:13,14:14}]},dKb={},eKb=[7],global.protobuf=function e(t){var i=dKb[t];return i||cKb[t][0].call(i=dKb[t]={exports:{}},e,i,i.exports),i.exports}(eKb[0])}(tmp$6);var protobuf=tmp$6.protobuf;function isBitSet(e,t){return 0!=(e&t)}var childrenBitmasks=[1,2,4,8],anyChildBitmask=15,cacheFlagBitmask=16,imageBitmask=64,terrainBitmask=128;function GoogleEarthEnterpriseTileInformation(e,t,i,r,n,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=i,this.terrainVersion=r,this.imageryProvider=n,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}function stringToBuffer(e){for(var t=e.length,i=new ArrayBuffer(t),r=new Uint8Array(i),n=0;nmF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;ÁěðMª>}æÎI‰Ææx\fa1-¤O¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©­S+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ï1²&/çÃu-6,rt°#G·ÓÑ&…7râ\0ŒDÏÚ3-Þ`†i#i*|ÍKQ\r•T9w.)ê¦P¢joP™\\>TûïP[\vE‰m(w7ێJfJo™ åpâ¹q~\fmI-zþrÇòY0»]såÉ êxì ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1’;µoÜl\r’ˆўÛ?âéÚ_ԄâFaZÞUϤ\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÐKW>\'\'Ç`Û;íšSD>?’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj å*x°Öprª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldIœ\'­xtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Á\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)…{II¥wy¾IV.6ç\v:»Ob{ÒM1•/½8{¨O!áìFpv•})"xˆ\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-È܈F|Š["');function GoogleEarthEnterpriseMetadata(e){var t=e;"string"==typeof t||t instanceof Resource||(t=e.url);t=Resource.createIfNeeded(t);t.appendForwardSlash(),this._resource=t,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=CesiumMath.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};var i=this;this._readyPromise=requestDbRoot(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).otherwise(function(e){var t="An error occurred while accessing "+getMetadataResource(i,"",1).url+".";return when.reject(new RuntimeError(t))})}Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}}}),GoogleEarthEnterpriseMetadata.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;0<=n;--n){var a=1<CesiumMath.PI_OVER_TWO&&(s=!0,o=Cartesian3.subtract(a,i,normalEndpointScratch),c=l.cartesianToCartographic(o,endPosCartographicScratch)),c.height=0;c=e.project(c,n);return(n=Cartesian3.subtract(c,r,n)).z=0,n=Cartesian3.normalize(n,n),s&&Cartesian3.negate(n,n),n}var adjustHeightNormalScratch=new Cartesian3,adjustHeightOffsetScratch=new Cartesian3;function adjustHeights(e,t,i,r,n,a){var o=Cartesian3.subtract(t,e,adjustHeightNormalScratch);Cartesian3.normalize(o,o);i-=WALL_INITIAL_MIN_HEIGHT,i=Cartesian3.multiplyByScalar(o,i,adjustHeightOffsetScratch);Cartesian3.add(e,i,n);r-=WALL_INITIAL_MAX_HEIGHT,i=Cartesian3.multiplyByScalar(o,r,adjustHeightOffsetScratch);Cartesian3.add(t,i,a)}var nudgeDirectionScratch=new Cartesian3;function nudgeXZ(e,t){var i=Plane.getPointDistance(XZ_PLANE,e),r=Plane.getPointDistance(XZ_PLANE,t),n=nudgeDirectionScratch;CesiumMath.equalsEpsilon(i,0,CesiumMath.EPSILON2)?(n=direction(t,e,n),Cartesian3.multiplyByScalar(n,CesiumMath.EPSILON2,n),Cartesian3.add(e,n,e)):CesiumMath.equalsEpsilon(r,0,CesiumMath.EPSILON2)&&(n=direction(e,t,n),Cartesian3.multiplyByScalar(n,CesiumMath.EPSILON2,n),Cartesian3.add(t,n,t))}function nudgeCartographic(e,t){var i=Math.abs(e.longitude),r=Math.abs(t.longitude);if(CesiumMath.equalsEpsilon(i,CesiumMath.PI,CesiumMath.EPSILON11)){var n=CesiumMath.sign(t.longitude);return e.longitude=n*(i-CesiumMath.EPSILON11),1}if(CesiumMath.equalsEpsilon(r,CesiumMath.PI,CesiumMath.EPSILON11)){e=CesiumMath.sign(e.longitude);return t.longitude=e*(r-CesiumMath.EPSILON11),2}return 0}var startCartographicScratch$1=new Cartographic,endCartographicScratch$1=new Cartographic,segmentStartTopScratch=new Cartesian3,segmentEndTopScratch=new Cartesian3,segmentStartBottomScratch=new Cartesian3,segmentEndBottomScratch=new Cartesian3,segmentStartNormalScratch=new Cartesian3,segmentEndNormalScratch=new Cartesian3,getHeightCartographics=[startCartographicScratch$1,endCartographicScratch$1],getHeightRectangleScratch=new Rectangle,adjustHeightStartTopScratch=new Cartesian3,adjustHeightEndTopScratch=new Cartesian3,adjustHeightStartBottomScratch=new Cartesian3,adjustHeightEndBottomScratch=new Cartesian3,segmentStart2DScratch=new Cartesian3,segmentEnd2DScratch=new Cartesian3,segmentStartNormal2DScratch=new Cartesian3,segmentEndNormal2DScratch=new Cartesian3,offsetScratch$b=new Cartesian3,startUpScratch=new Cartesian3,endUpScratch=new Cartesian3,rightScratch=new Cartesian3,startPlaneNormalScratch=new Cartesian3,endPlaneNormalScratch=new Cartesian3,encodeScratch$1=new EncodedCartesian3,encodeScratch2D=new EncodedCartesian3,forwardOffset2DScratch=new Cartesian3,right2DScratch=new Cartesian3,normalNudgeScratch=new Cartesian3,scratchBoundingSpheres=[new BoundingSphere,new BoundingSphere],REFERENCE_INDICES=[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],REFERENCE_INDICES_LENGTH=REFERENCE_INDICES.length;function generateGeometryAttributes(e,t,i,r,n,a,o){var s,l,c,u,d=t._ellipsoid,h=i.length/3-1,p=8*h,m=4*p,f=36*h,g=new(65535MITER_BREAK_SMALL?(W=projectNormal(t,E,J,j,segmentStartNormal2DScratch),q=projectNormal(t,P,$,Y,segmentEndNormal2DScratch)):1===Se?(q=projectNormal(t,P,$,Y,segmentEndNormal2DScratch),W.x=0,W.y=CesiumMath.sign(E.longitude-Math.abs(P.longitude)),W.z=0):(W=projectNormal(t,E,J,j,segmentStartNormal2DScratch),q.x=0,q.y=CesiumMath.sign(E.longitude-P.longitude),q.z=0));var Z,K,ee,te=Cartesian3.distance(Q,z),ie=EncodedCartesian3.fromCartesian(X,encodeScratch$1),re=Cartesian3.subtract(k,X,offsetScratch$b),ne=Cartesian3.normalize(re,rightScratch),ae=Cartesian3.subtract(Q,X,startUpScratch),ae=Cartesian3.normalize(ae,ae),oe=Cartesian3.cross(ne,ae,rightScratch),oe=Cartesian3.normalize(oe,oe),se=Cartesian3.cross(ae,J,startPlaneNormalScratch),se=Cartesian3.normalize(se,se),le=Cartesian3.subtract(z,k,endUpScratch),le=Cartesian3.normalize(le,le),ce=Cartesian3.cross($,le,endPlaneNormalScratch),ce=Cartesian3.normalize(ce,ce),ue=te/I,de=U/I,he=0,pe=0,me=0;for(o&&(he=Cartesian3.distance(j,Y),Z=EncodedCartesian3.fromCartesian(j,encodeScratch2D),K=Cartesian3.subtract(Y,j,forwardOffset2DScratch),Te=(ee=Cartesian3.normalize(K,right2DScratch)).x,ee.x=ee.y,ee.y=-Te,pe=he/b,me=G/b),D=0;D<8;D++){var fe=B+4*D,ge=F+2*D,_e=fe+3,ye=D<4?1:-1,Ce=2===D||3===D||6===D||7===D?1:-1;Cartesian3.pack(ie.high,y,fe),y[_e]=re.x,Cartesian3.pack(ie.low,C,fe),C[_e]=re.y,Cartesian3.pack(se,v,fe),v[_e]=re.z,Cartesian3.pack(ce,S,fe),S[_e]=ue*ye,Cartesian3.pack(oe,T,fe);var ve=de*Ce;0===ve&&Ce<0&&(ve=9),T[_e]=ve,o&&(s[fe]=Z.high.x,s[fe+1]=Z.high.y,s[fe+2]=Z.low.x,s[fe+3]=Z.low.y,c[fe]=-W.y,c[fe+1]=W.x,c[fe+2]=q.y,c[fe+3]=-q.x,l[fe]=K.x,l[fe+1]=K.y,l[fe+2]=ee.x,l[fe+3]=ee.y,u[ge]=pe*ye,0===(ve=me*Ce)&&Ce<0&&(ve=9),u[ge+1]=ve)}var Se=adjustHeightStartBottomScratch,ne=adjustHeightEndBottomScratch,ae=adjustHeightStartTopScratch,J=adjustHeightEndTopScratch,le=Rectangle.fromCartographicArray(getHeightCartographics,getHeightRectangleScratch),Te=ApproximateTerrainHeights.getMinimumMaximumHeights(le,d),le=Te.minimumTerrainHeight,Te=Te.maximumTerrainHeight;H+=le,H+=Te,adjustHeights(X,Q,le,Te,Se,ae),adjustHeights(k,z,le,Te,ne,J);Te=Cartesian3.multiplyByScalar(oe,CesiumMath.EPSILON5,normalNudgeScratch);Cartesian3.add(Se,Te,Se),Cartesian3.add(ne,Te,ne),Cartesian3.add(ae,Te,ae),Cartesian3.add(J,Te,J),nudgeXZ(Se,ne),nudgeXZ(ae,J),Cartesian3.pack(Se,_,N),Cartesian3.pack(ne,_,N+3),Cartesian3.pack(J,_,N+6),Cartesian3.pack(ae,_,N+9),Te=Cartesian3.multiplyByScalar(oe,-2*CesiumMath.EPSILON5,normalNudgeScratch),Cartesian3.add(Se,Te,Se),Cartesian3.add(ne,Te,ne),Cartesian3.add(ae,Te,ae),Cartesian3.add(J,Te,J),nudgeXZ(Se,ne),nudgeXZ(ae,J),Cartesian3.pack(Se,_,N+12),Cartesian3.pack(ne,_,N+15),Cartesian3.pack(J,_,N+18),Cartesian3.pack(ae,_,N+21),L+=2,R+=3,F+=16,N+=24,B+=32,U+=te,G+=he}var xe=R=0;for(O=0;O 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.',!0)),defaultTokenCredit},Object.defineProperties(PeliasGeocoderService.prototype,{url:{get:function(){return this._url}}}),PeliasGeocoderService.prototype.geocode=function(e,t){return this._url.getDerivedResource({url:t===GeocodeType$1.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(e){return e.features.map(function(e){var t,i=e.bbox;return t=defined(i)?Rectangle.fromDegrees(i[0],i[1],i[2],i[3]):(i=e.geometry.coordinates[0],t=e.geometry.coordinates[1],Cartesian3.fromDegrees(i,t)),{displayName:e.properties.label,destination:t}})})},IonGeocoderService.prototype.geocode=function(e,t){return this._pelias.geocode(e,t)},defined(Object.create)&&(IonResource.prototype=Object.create(Resource.prototype),IonResource.prototype.constructor=IonResource),IonResource.fromAssetId=function(e,t){var i=IonResource._createEndpointResource(e,t);return i.fetchJson().then(function(e){return new IonResource(e,i)})},Object.defineProperties(IonResource.prototype,{credits:{get:function(){return defined(this._ionRoot)?this._ionRoot.credits:(defined(this._credits)||(this._credits=IonResource.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource)),this._credits)}}}),IonResource.getCreditsFromEndpoint=function(e,t){e=e.attributions.map(Credit.getIonCredit),t=Ion.getDefaultTokenCredit(t.queryParameters.access_token);return defined(t)&&e.push(Credit.clone(t)),e},IonResource.prototype.clone=function(e){var t=defaultValue(this._ionRoot,this);return defined(e)||(e=new IonResource(t._ionEndpoint,t._ionEndpointResource)),(e=Resource.prototype.clone.call(this,e))._ionRoot=t,e._isExternal=this._isExternal,e},IonResource.prototype.fetchImage=function(e){var t;return this._isExternal||(t=e,e={preferBlob:!0},defined(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)),Resource.prototype.fetchImage.call(this,e)},IonResource.prototype._makeRequest=function(e){return this._isExternal||new URI(this.url).authority!==this._ionEndpointDomain||(defined(e.headers)||(e.headers={}),e.headers.Authorization="Bearer "+this._ionEndpoint.accessToken),Resource.prototype._makeRequest.call(this,e)},IonResource._createEndpointResource=function(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=defaultValue(t.server,Ion.defaultServer),t=defaultValue(t.accessToken,Ion.defaultAccessToken),i=Resource.createIfNeeded(i),e={url:"v1/assets/"+e+"/endpoint"};return defined(t)&&(e.queryParameters={access_token:t}),i.getDerivedResource(e)},Object.defineProperties(TimeInterval.prototype,{isEmpty:{get:function(){var e=JulianDate.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var scratchInterval={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};TimeInterval.fromIso8601=function(e,t){var i=e.iso8601.split("/");if(2!==i.length)throw new DeveloperError("options.iso8601 is an invalid ISO 8601 interval.");var r=JulianDate.fromIso8601(i[0]),n=JulianDate.fromIso8601(i[1]),a=defaultValue(e.isStartIncluded,!0),i=defaultValue(e.isStopIncluded,!0),e=e.data;return defined(t)?(t.start=r,t.stop=n,t.isStartIncluded=a,t.isStopIncluded=i,t.data=e,t):(scratchInterval.start=r,scratchInterval.stop=n,scratchInterval.isStartIncluded=a,scratchInterval.isStopIncluded=i,scratchInterval.data=e,new TimeInterval(scratchInterval))},TimeInterval.toIso8601=function(e,t){return JulianDate.toIso8601(e.start,t)+"/"+JulianDate.toIso8601(e.stop,t)},TimeInterval.clone=function(e,t){if(defined(e))return defined(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new TimeInterval(e)},TimeInterval.equals=function(e,t,i){return e===t||defined(e)&&defined(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&JulianDate.equals(e.start,t.start)&&JulianDate.equals(e.stop,t.stop)&&(e.data===t.data||defined(i)&&i(e.data,t.data)))},TimeInterval.equalsEpsilon=function(e,t,i,r){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&JulianDate.equalsEpsilon(e.start,t.start,i)&&JulianDate.equalsEpsilon(e.stop,t.stop,i)&&(e.data===t.data||defined(r)&&r(e.data,t.data)))},TimeInterval.intersect=function(e,t,i,r){if(!defined(t))return TimeInterval.clone(TimeInterval.EMPTY,i);var n=e.start,a=e.stop,o=t.start,s=t.stop,l=JulianDate.greaterThanOrEquals(o,n)&&JulianDate.greaterThanOrEquals(a,o),c=!l&&JulianDate.lessThanOrEquals(o,n)&&JulianDate.lessThanOrEquals(n,s);if(!l&&!c)return TimeInterval.clone(TimeInterval.EMPTY,i);var u=e.isStartIncluded,d=e.isStopIncluded,h=t.isStartIncluded,p=t.isStopIncluded,m=JulianDate.lessThan(a,s);return(i=!defined(i)?new TimeInterval:i).start=l?o:n,i.isStartIncluded=u&&h||!JulianDate.equals(o,n)&&(l&&h||c&&u),i.stop=m?a:s,i.isStopIncluded=m?d:d&&p||!JulianDate.equals(s,a)&&p,i.data=defined(r)?r(e.data,t.data):e.data,i},TimeInterval.contains=function(e,t){if(e.isEmpty)return!1;var i=JulianDate.compare(e.start,t);if(0===i)return e.isStartIncluded;t=JulianDate.compare(t,e.stop);return 0===t?e.isStopIncluded:i<0&&t<0},TimeInterval.prototype.clone=function(e){return TimeInterval.clone(this,e)},TimeInterval.prototype.equals=function(e,t){return TimeInterval.equals(this,e,t)},TimeInterval.prototype.equalsEpsilon=function(e,t,i){return TimeInterval.equalsEpsilon(this,e,t,i)},TimeInterval.prototype.toString=function(){return TimeInterval.toIso8601(this)},TimeInterval.EMPTY=Object.freeze(new TimeInterval({start:new JulianDate,stop:new JulianDate,isStartIncluded:!1,isStopIncluded:!1}));var MINIMUM_VALUE=Object.freeze(JulianDate.fromIso8601("0000-01-01T00:00:00Z")),MAXIMUM_VALUE=Object.freeze(JulianDate.fromIso8601("9999-12-31T24:00:00Z")),MAXIMUM_INTERVAL=Object.freeze(new TimeInterval({start:MINIMUM_VALUE,stop:MAXIMUM_VALUE})),Iso8601={MINIMUM_VALUE:MINIMUM_VALUE,MAXIMUM_VALUE:MAXIMUM_VALUE,MAXIMUM_INTERVAL:MAXIMUM_INTERVAL},KeyboardEventModifier={SHIFT:0,CTRL:1,ALT:2},KeyboardEventModifier$1=Object.freeze(KeyboardEventModifier),LagrangePolynomialApproximation={type:"Lagrange",getRequiredDataPoints:function(e){return Math.max(e+1,2)},interpolateOrderZero:function(e,t,i,r,n){defined(n)||(n=new Array(r));for(var a=t.length,o=0;ot.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}}),ManagedArray.prototype.get=function(e){return this._array[e]},ManagedArray.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t},ManagedArray.prototype.peek=function(){return this._array[this._length-1]},ManagedArray.prototype.push=function(e){var t=this.length++;this._array[t]=e},ManagedArray.prototype.pop=function(){if(0!==this._length){var e=this._array[this._length-1];return--this.length,e}},ManagedArray.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)},ManagedArray.prototype.resize=function(e){this.length=e},ManagedArray.prototype.trim=function(e){e=defaultValue(e,this._length),this._array.length=e},Object.defineProperties(MapProjection.prototype,{ellipsoid:{get:DeveloperError.throwInstantiationError}}),MapProjection.prototype.project=DeveloperError.throwInstantiationError,MapProjection.prototype.unproject=DeveloperError.throwInstantiationError,NearFarScalar.clone=function(e,t){if(defined(e))return defined(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new NearFarScalar(e.near,e.nearValue,e.far,e.farValue)},NearFarScalar.packedLength=4,NearFarScalar.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.near,t[i++]=e.nearValue,t[i++]=e.far,t[i]=e.farValue,t},NearFarScalar.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new NearFarScalar:i).near=e[t++],i.nearValue=e[t++],i.far=e[t++],i.farValue=e[t],i},NearFarScalar.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},NearFarScalar.prototype.clone=function(e){return NearFarScalar.clone(this,e)},NearFarScalar.prototype.equals=function(e){return NearFarScalar.equals(this,e)};var Visibility={NONE:-1,PARTIAL:0,FULL:1},Visibility$1=Object.freeze(Visibility);function Occluder(e,t){this._occluderPosition=Cartesian3.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 scratchCartesian3$6=new Cartesian3;Object.defineProperties(Occluder.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=Cartesian3.clone(e,this._cameraPosition);var t,i,r,n=Cartesian3.subtract(this._occluderPosition,e,scratchCartesian3$6),a=Cartesian3.magnitudeSquared(n),o=this._occluderRadius*this._occluderRadius;oCartesian3.magnitudeSquared(t)}return!1};var occludeePositionScratch=new Cartesian3;Occluder.prototype.isBoundingSphereVisible=function(e){var t=Cartesian3.clone(e.center,occludeePositionScratch),i=e.radius;if(this._horizonDistance===Number.MAX_VALUE)return!1;var r=Cartesian3.subtract(t,this._occluderPosition,tempVecScratch),e=this._occluderRadius-i,e=Cartesian3.magnitudeSquared(r)-e*e;if(iCartesian3.magnitudeSquared(r));if(0t*r?!0:t<(e=Math.sqrt(e)+this._horizonDistance)*e+i}return!0};var tempScratch=new Cartesian3;Occluder.prototype.computeVisibility=function(e){var t=Cartesian3.clone(e.center),i=e.radius;if(i>this._occluderRadius)return Visibility$1.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var r=Cartesian3.subtract(t,this._occluderPosition,tempScratch),n=this._occluderRadius-i,a=Cartesian3.magnitudeSquared(r);if(0<(n=a-n*n)){n=Math.sqrt(n)+this._horizonDistance,r=Cartesian3.subtract(t,this._cameraPosition,r),e=Cartesian3.magnitudeSquared(r);return n*n+i*i-i?Visibility$1.PARTIAL:Visibility$1.FULL)}}return Visibility$1.NONE};var occludeePointScratch=new Cartesian3;Occluder.computeOccludeePoint=function(e,t,i){var r=Cartesian3.clone(t),n=Cartesian3.clone(e.center),t=e.radius,a=i.length,o=Cartesian3.normalize(Cartesian3.subtract(r,n,occludeePointScratch),occludeePointScratch),s=-Cartesian3.dot(o,n),l=Occluder._anyRotationVector(n,o,s),c=Occluder._horizonToPlaneNormalDotProduct(e,o,s,l,i[0]);if(c){for(var u,d=1;dr.y?0:1;(0===n&&r.z>r.x||1===n&&r.z>r.y)&&(n=2);var a=new Cartesian3,n=0===n?(r.x=e.x,r.y=e.y+1,r.z=e.z+1,Cartesian3.UNIT_X):1===n?(r.x=e.x+1,r.y=e.y,r.z=e.z+1,Cartesian3.UNIT_Y):(r.x=e.x+1,r.y=e.y+1,r.z=e.z,Cartesian3.UNIT_Z),t=(Cartesian3.dot(t,r)+i)/-Cartesian3.dot(t,n);return Cartesian3.normalize(Cartesian3.subtract(Cartesian3.add(r,Cartesian3.multiplyByScalar(n,t,a),r),e,r),r)};var posDirectionScratch=new Cartesian3;Occluder._rotationVector=function(e,t,i,r,n){e=Cartesian3.subtract(r,e,posDirectionScratch),e=Cartesian3.normalize(e,e);if(Cartesian3.dot(t,e)<.9999999847691291){e=Cartesian3.cross(t,e,e);if(Cartesian3.magnitude(e)>CesiumMath.EPSILON13)return Cartesian3.normalize(e,new Cartesian3)}return n};var posScratch1=new Cartesian3,occluerPosScratch=new Cartesian3,posScratch2=new Cartesian3,horizonPlanePosScratch=new Cartesian3;function OffsetGeometryInstanceAttribute(e,t,i){e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,0),this.value=new Float32Array([e,t,i])}function OpenCageGeocoderService(e,t,i){(e=Resource.createIfNeeded(e)).appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=defaultValue(i,{})}Occluder._horizonToPlaneNormalDotProduct=function(e,t,i,r,n){var a=Cartesian3.clone(n,posScratch1),o=Cartesian3.clone(e.center,occluerPosScratch),s=e.radius,l=Cartesian3.subtract(o,a,posScratch2),n=Cartesian3.magnitudeSquared(l),e=s*s;if(n"+t,document.body.appendChild(u),n.leading=1.2*o;var d=getCSSValue$1(u,"height");if(2*o<=(d=d.replace("px",""))&&(n.leading=d/2|0),document.body.removeChild(u),c)n.ascent=0,n.descent=0,n.bounds={minx:0,maxx:n.width,miny:0,maxy:0},n.height=0;else{u=document.createElement("canvas");u.width=n.width+100,u.height=3*o,u.style.opacity=1,u.style.fontFamily=a,u.style.fontSize=o,u.style.fontStyle=s,u.style.fontWeight=l;c=u.getContext("2d");c.font=s+" "+l+" "+o+"px "+a;o=u.width,a=u.height,u=a/2;c.fillStyle="white",c.fillRect(-1,-1,o+2,a+2),i&&(c.strokeStyle="black",c.lineWidth=e.lineWidth,c.strokeText(t,50,u)),r&&(c.fillStyle="black",c.fillText(t,50,u));for(var h=c.getImageData(0,0,o,a).data,p=0,m=4*o,f=h.length;++pt.height?a=r*(t.height/t.width):t.widthidlCross.eastOverIDL-idlCross.westOverIDL&&(n.west=idlCross.westOverIDL,n.east=idlCross.eastOverIDL,n.east>CesiumMath.PI&&(n.east=n.east-CesiumMath.TWO_PI),n.west>CesiumMath.PI&&(n.west=n.west-CesiumMath.TWO_PI)),n}var interpolatedCartographicScratch=new Cartographic;function interpolateAndGrowRectangle(e,t,i,r){for(var n=e.surfaceDistance,a=Math.ceil(n*t),o=0=e.minX&&t.maxY>=e.minY}function createNode(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(e,t,i,r,n){for(var a,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=r||(quickselect$1(e,a=t+Math.ceil((i-t)/r/2)*r,t,i,n),o.push(t,a,a,i))}function RectangleCollisionChecker(){this._tree=new RBush}function RectangleWithId(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}function idCompare(e,t){return e.id===t.id}PolylineVolumeOutlineGeometry.createGeometry=function(e){var t=arrayRemoveDuplicates(e._positions,Cartesian3.equalsEpsilon),i=e._shape,i=PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i);if(!(t.length<2||i.length<3)){PolygonPipeline.computeWindingOrder2D(i)===WindingOrder$1.CLOCKWISE&&i.reverse();var r=BoundingRectangle.fromPoints(i,brScratch);return computeAttributes(PolylineVolumeGeometryLibrary.computePositions(t,i,r,e,!1),i)}},Proxy.prototype.getURL=DeveloperError.throwInstantiationError,Object.defineProperties(QuaternionSpline.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),QuaternionSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,QuaternionSpline.prototype.wrapTime=Spline.prototype.wrapTime,QuaternionSpline.prototype.clampTime=Spline.prototype.clampTime,QuaternionSpline.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},RBush.prototype.all=function(){return this._all(this.data,[])},RBush.prototype.search=function(e){var t=this.data,i=[];if(!intersects(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var a=0;athis._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},RBush.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);r=this._chooseSplitIndex(i,n,r),r=createNode(i.children.splice(r,i.children.length-r));r.height=i.height,r.leaf=i.leaf,calcBBox(i,this.toBBox),calcBBox(r,this.toBBox),t?e[t-1].children.push(r):this._splitRoot(i,r)},RBush.prototype._splitRoot=function(e,t){this.data=createNode([e,t]),this.data.height=e.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},RBush.prototype._chooseSplitIndex=function(e,t,i){for(var r,n=1/0,a=1/0,o=t;o<=i-t;o++){var s=distBBox(e,0,o,this.toBBox),l=distBBox(e,o,i,this.toBBox),c=intersectionArea(s,l),l=bboxArea(s)+bboxArea(l);cScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds}function checkPixelTolerance(e,t,i){var r=e.x-t.x,t=e.y-t.y;return Math.sqrt(r*r+t*t)keplerEqConvergence;++a)r=(n=r)-(n-t*Math.sin(n)-e)/(1-t*Math.cos(n));return n=r+i*CesiumMath.TWO_PI}function eccentricAnomalyToTrueAnomaly(e,t){var i=Math.floor(e/CesiumMath.TWO_PI);e-=i*CesiumMath.TWO_PI;var r=Math.cos(e)-t,t=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(t,r),r=CesiumMath.zeroToTwoPi(r);return e<0&&(r-=CesiumMath.TWO_PI),r+=i*CesiumMath.TWO_PI}function perifocalToCartesianMatrix(e,t,i,r){var n=Math.cos(e),a=Math.sin(e),o=Math.cos(t),e=Math.sin(t),t=Math.cos(i),i=Math.sin(i);return defined(r)?(r[0]=t*n-i*a*o,r[1]=i*n+t*a*o,r[2]=a*e,r[3]=-t*a-i*n*o,r[4]=-i*a+t*n*o,r[5]=n*e,r[6]=i*e,r[7]=-t*e,r[8]=o):r=new Matrix3(t*n-i*a*o,-t*a-i*n*o,i*e,i*n+t*a*o,-i*a+t*n*o,-t*e,a*e,n*e,o),r}var semiMajorAxis0=1.0000010178*MetersPerAstronomicalUnit,meanLongitude0=100.46645683*RadiansPerDegree,meanLongitude1=1295977422.83429*RadiansPerArcSecond,p1u=16002,p2u=21863,p3u=32004,p4u=10931,p5u=14529,p6u=16368,p7u=15318,p8u=32794,Ca1=64e-7*MetersPerAstronomicalUnit,Ca2=-152e-7*MetersPerAstronomicalUnit,Ca3=62e-7*MetersPerAstronomicalUnit,Ca4=-8e-7*MetersPerAstronomicalUnit,Ca5=32e-7*MetersPerAstronomicalUnit,Ca6=-41e-7*MetersPerAstronomicalUnit,Ca7=19e-7*MetersPerAstronomicalUnit,Ca8=-11e-7*MetersPerAstronomicalUnit,Sa1=1e-7*-150*MetersPerAstronomicalUnit,Sa2=-46e-7*MetersPerAstronomicalUnit,Sa3=68*1e-7*MetersPerAstronomicalUnit,Sa4=54e-7*MetersPerAstronomicalUnit,Sa5=14e-7*MetersPerAstronomicalUnit,Sa6=24e-7*MetersPerAstronomicalUnit,Sa7=-28e-7*MetersPerAstronomicalUnit,Sa8=22e-7*MetersPerAstronomicalUnit,q1u=10,q2u=16002,q3u=21863,q4u=10931,q5u=1473,q6u=32004,q7u=4387,q8u=73,Cl1=-325e-7,Cl2=-322e-7,Cl3=1e-7*-79,Cl4=232*1e-7,Cl5=1e-7*-52,Cl6=97e-7,Cl7=55e-7,Cl8=-41e-7,Sl1=-105e-7,Sl2=-137e-7,Sl3=258e-7,Sl4=35e-7,Sl5=1e-7*-116,Sl6=-88e-7,Sl7=-112e-7,Sl8=-8e-6,scratchDate$1=new JulianDate(0,0,TimeStandard$1.TAI);function computeSimonEarthMoonBarycenter(e,t){taiToTdb(e,scratchDate$1);var i=(scratchDate$1.dayNumber-epoch.dayNumber+(scratchDate$1.secondsOfDay-epoch.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY)/(10*TimeConstants$1.DAYS_PER_JULIAN_CENTURY),r=.3595362*i,e=semiMajorAxis0+Ca1*Math.cos(p1u*r)+Sa1*Math.sin(p1u*r)+Ca2*Math.cos(p2u*r)+Sa2*Math.sin(p2u*r)+Ca3*Math.cos(p3u*r)+Sa3*Math.sin(p3u*r)+Ca4*Math.cos(p4u*r)+Sa4*Math.sin(p4u*r)+Ca5*Math.cos(p5u*r)+Sa5*Math.sin(p5u*r)+Ca6*Math.cos(p6u*r)+Sa6*Math.sin(p6u*r)+Ca7*Math.cos(p7u*r)+Sa7*Math.sin(p7u*r)+Ca8*Math.cos(p8u*r)+Sa8*Math.sin(p8u*r),r=meanLongitude0+meanLongitude1*i+Cl1*Math.cos(q1u*r)+Sl1*Math.sin(q1u*r)+Cl2*Math.cos(q2u*r)+Sl2*Math.sin(q2u*r)+Cl3*Math.cos(q3u*r)+Sl3*Math.sin(q3u*r)+Cl4*Math.cos(q4u*r)+Sl4*Math.sin(q4u*r)+Cl5*Math.cos(q5u*r)+Sl5*Math.sin(q5u*r)+Cl6*Math.cos(q6u*r)+Sl6*Math.sin(q6u*r)+Cl7*Math.cos(q7u*r)+Sl7*Math.sin(q7u*r)+Cl8*Math.cos(q8u*r)+Sl8*Math.sin(q8u*r);return elementsToCartesian(e,.0167086342-.0004203654*i,469.97289*RadiansPerArcSecond*i,102.93734808*RadiansPerDegree+11612.3529*RadiansPerArcSecond*i,174.87317577*RadiansPerDegree-8679.27034*RadiansPerArcSecond*i,r,t)}function computeSimonMoon(e,t){taiToTdb(e,scratchDate$1);var i=(scratchDate$1.dayNumber-epoch.dayNumber+(scratchDate$1.secondsOfDay-epoch.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY)/TimeConstants$1.DAYS_PER_JULIAN_CENTURY,r=i*i,n=r*i,a=n*i,o=383397.7725+.004*i,s=.055545526-16e-9*i,l=5.15668983*RadiansPerDegree,c=-8e-5*i+.02966*r-42e-6*n-13e-8*a,u=83.35324312*RadiansPerDegree,d=14643420.2669*i-38.2702*r-.045047*n+21301e-8*a,h=125.04455501*RadiansPerDegree,p=-6967919.3631*i+6.3602*r+.007625*n-3586e-8*a,m=218.31664563*RadiansPerDegree,f=1732559343.4847*i-6.391*r+.006588*n-3169e-8*a,g=297.85019547*RadiansPerDegree+RadiansPerArcSecond*(1602961601.209*i-6.3706*r+.006593*n-3169e-8*a),_=134.96340251*RadiansPerDegree+RadiansPerArcSecond*(1717915923.2178*i+31.8792*r+.051635*n-2447e-7*a),y=357.52910918*RadiansPerDegree+RadiansPerArcSecond*(129596581.0481*i-.5532*r+136e-6*n-1149e-8*a),C=310.17137918*RadiansPerDegree-RadiansPerArcSecond*(6967051.436*i+6.2068*r+.007618*n-3219e-8*a),v=2*g,S=4*g,T=6*g,x=2*_,b=3*_,e=4*_,a=2*(93.27209062*RadiansPerDegree+RadiansPerArcSecond*(1739527262.8478*i-12.7512*r-.001037*n+417e-8*a));o+=3400.4*Math.cos(v)-635.6*Math.cos(v-_)-235.6*Math.cos(_)+218.1*Math.cos(v-y)+181*Math.cos(v+_),s+=.014216*Math.cos(v-_)+.008551*Math.cos(v-x)-.001383*Math.cos(_)+.001356*Math.cos(v+_)-.001147*Math.cos(S-b)-914e-6*Math.cos(S-x)+869e-6*Math.cos(v-y-_)-627e-6*Math.cos(v)-394e-6*Math.cos(S-e)+282e-6*Math.cos(v-y-x)-279e-6*Math.cos(g-_)-236e-6*Math.cos(x)+231e-6*Math.cos(S)+229e-6*Math.cos(T-e)-201e-6*Math.cos(x-a),c+=486.26*Math.cos(v-a)-40.13*Math.cos(v)+37.51*Math.cos(a)+25.73*Math.cos(x-a)+19.97*Math.cos(v-y-a),d+=-55609*Math.sin(v-_)-34711*Math.sin(v-x)-9792*Math.sin(_)+9385*Math.sin(S-b)+7505*Math.sin(S-x)+5318*Math.sin(v+_)+3484*Math.sin(S-e)-3417*Math.sin(v-y-_)-2530*Math.sin(T-e)-2376*Math.sin(v)-2075*Math.sin(v-b)-1883*Math.sin(x)-1736*Math.sin(T-5*_)+1626*Math.sin(y)-1370*Math.sin(T-b),p+=-5392*Math.sin(v-a)-540*Math.sin(y)-441*Math.sin(v)+423*Math.sin(a)-288*Math.sin(x-a),f+=-3332.9*Math.sin(v)+1197.4*Math.sin(v-_)-662.5*Math.sin(y)+396.3*Math.sin(_)-218*Math.sin(v-y);x=2*C,_=3*C;c+=46.997*Math.cos(C)*i-.614*Math.cos(v-a+C)*i+.614*Math.cos(v-a-C)*i-.0297*Math.cos(x)*r-.0335*Math.cos(C)*r+.0012*Math.cos(v-a+x)*r-16e-5*Math.cos(C)*n+4e-5*Math.cos(_)*n+4e-5*Math.cos(x)*n;y=2.116*Math.sin(C)*i-.111*Math.sin(v-a-C)*i-.0015*Math.sin(C)*r;return d+=y,f+=y,p+=-520.77*Math.sin(C)*i+13.66*Math.sin(v-a+C)*i+1.12*Math.sin(v-C)*i-1.06*Math.sin(a-C)*i+.66*Math.sin(x)*r+.371*Math.sin(C)*r-.035*Math.sin(v-a+x)*r-.015*Math.sin(v-a+C)*r+.0014*Math.sin(C)*n-.0011*Math.sin(_)*n-9e-4*Math.sin(x)*n,elementsToCartesian(o*=MetersPerKilometer,s,l+c*RadiansPerArcSecond,u+d*RadiansPerArcSecond,h+p*RadiansPerArcSecond,m+f*RadiansPerArcSecond,t)}var moonEarthMassRatio=.012300034,factor=moonEarthMassRatio/(moonEarthMassRatio+1)*-1;function computeSimonEarth(e,t){return t=computeSimonMoon(e,t),Cartesian3.multiplyByScalar(t,factor,t)}var axesTransformation=new Matrix3(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),translation=new Cartesian3;function interpolateColors(e,t,i,r,n,a,o){var s=PolylinePipeline.numberOfPoints(e,t,n),l=i.red,c=i.green,u=i.blue,d=i.alpha,h=r.red,e=r.green,t=r.blue,n=r.alpha;if(Color.equals(i,r)){for(y=0;ymonthLengths[s]||13<=s;)o>monthLengths[s]&&(o-=monthLengths[s],++s),13<=s&&(--s,l+=Math.floor(s/12),s%=12,++s),monthLengths[2]=isLeapYear(l)?29:28;return scratchGregorianDate.millisecond=r,scratchGregorianDate.second=n,scratchGregorianDate.minute=a,scratchGregorianDate.hour=e,scratchGregorianDate.day=o,scratchGregorianDate.month=s,scratchGregorianDate.year=l,JulianDate.fromGregorianDate(scratchGregorianDate,i)}var scratchJulianDate$2=new JulianDate,durationRegex=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function parseDuration(e,t){if(defined(e)&&0!==e.length){if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,"P"===e[t.millisecond=0]){var i=e.match(durationRegex);if(!defined(i))return;defined(i[1])&&(t.year=Number(i[1].replace(",","."))),defined(i[2])&&(t.month=Number(i[2].replace(",","."))),defined(i[3])&&(t.day=7*Number(i[3].replace(",","."))),defined(i[4])&&(t.day+=Number(i[4].replace(",","."))),defined(i[5])&&(t.hour=Number(i[5].replace(",","."))),defined(i[6])&&(t.minute=Number(i[6].replace(",","."))),defined(i[7])&&(i=Number(i[7].replace(",",".")),t.second=Math.floor(i),t.millisecond=i%1*1e3)}else"Z"!==e[e.length-1]&&(e+="Z"),JulianDate.toGregorianDate(JulianDate.fromIso8601(e,scratchJulianDate$2),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}}var scratchDuration=new GregorianDate;TimeIntervalCollection.fromIso8601=function(e,t){var i=e.iso8601.split("/"),r=JulianDate.fromIso8601(i[0]),n=JulianDate.fromIso8601(i[1]),a=[];if(parseDuration(i[2],scratchDuration)){var o=JulianDate.clone(r);for(a.push(o);JulianDate.compare(o,n)<0;){o=addToDate(o,scratchDuration);JulianDate.compare(n,o)<=0&&JulianDate.clone(n,o),a.push(o)}}else a.push(r,n);return TimeIntervalCollection.fromJulianDateArray({julianDates:a,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},TimeIntervalCollection.fromIso8601DateArray=function(e,t){return TimeIntervalCollection.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(e){return JulianDate.fromIso8601(e)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},TimeIntervalCollection.fromIso8601DurationArray=function(e,t){for(var i,r,n=e.epoch,a=e.iso8601Durations,o=defaultValue(e.relativeToPrevious,!1),s=[],l=a.length,c=0;cr&&(this._seeking=!0,n.currentTime=e)))};var WallGeometryLibrary={};function latLonEquals(e,t){return CesiumMath.equalsEpsilon(e.latitude,t.latitude,CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(e.longitude,t.longitude,CesiumMath.EPSILON10)}var scratchCartographic1=new Cartographic,scratchCartographic2=new Cartographic;function removeDuplicates$1(e,t,i,r){var n=(t=arrayRemoveDuplicates(t,Cartesian3.equalsEpsilon)).length;if(!(n<2)){var a=defined(r),o=defined(i),s=new Array(n),l=new Array(n),c=new Array(n),u=t[0];s[0]=u;var d=e.cartesianToCartographic(u,scratchCartographic1);o&&(d.height=i[0]),l[0]=d.height,c[0]=a?r[0]:0;for(var h=l[0]===c[0],p=1,m=1;m>n,b=h>>n,E=PixelFormat$1.isCompressedFormat(c)?PixelFormat$1.compressedTextureSizeInBytes(c,x,b):PixelFormat$1.textureSizeInBytes(c,o,x,b),P=new Uint8Array(_.buffer,C,E);S[faceOrder[T]]=new CompressedTextureBuffer(c,x,b,P),C+=E}C+=3-(C+3)%4+4}var A=v;if(1===f)for(n=0;n=CesiumMath.SIXTY_FOUR_KILOBYTES&&a.elementIndexUint?Buffer$1.createIndexBuffer({context:a,typedArray:new Uint32Array(h),usage:s,indexDatatype:IndexDatatype$1.UNSIGNED_INT}):Buffer$1.createIndexBuffer({context:a,typedArray:new Uint16Array(h),usage:s,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT}):n})},Object.defineProperties(VertexArray.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),VertexArray.prototype.getAttribute=function(e){return this._attributes[e]},VertexArray.prototype._bind=function(){defined(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&setVertexAttribDivisor(this),this._hasConstantAttributes&&setConstantAttributes(this,this._gl)):bind(this._gl,this._attributes,this._indexBuffer)},VertexArray.prototype._unBind=function(){if(defined(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,i=0;iShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS}ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes=function(e,t,i,r){var n=latLongToSpherical(e.south,e.west,i,sphericalScratch),a=n.x,o=n.y,s=latLongToSpherical(e.north,e.east,i,sphericalScratch),n=s.x,i=s.y,s=0;i>>StencilConstants$1.SKIP_LOD_BIT_SHIFT}function getTranslucentRenderState$2(e){e=clone$1(e,!0);return e.cull.enabled=!1,e.depthTest.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND,RenderState.fromCache(e)}function getOpaqueRenderState(e){e=clone$1(e,!0);return e.stencilTest=StencilConstants$1.setCesium3DTileBit(),e.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK,RenderState.fromCache(e)}function createTexture$2(e,t,i){e=e._textureDimensions;return new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{width:e.x,height:e.y,arrayBufferView:i},flipY:!1,sampler:Sampler.NEAREST})}function createPickTexture(e,t){var i=e.featuresLength;if(!defined(e._pickTexture)&&0r&&e.inverseBindMatrices--}),ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){defined(e.input)&&e.input>r&&e.input--,defined(e.output)&&e.output>r&&e.output--})})},Remove.buffer=function(e,t){e.buffers.splice(t,1),ForEach.bufferView(e,function(e){defined(e.buffer)&&e.buffer>t&&e.buffer--})},Remove.bufferView=function(e,i){e.bufferViews.splice(i,1),ForEach.accessor(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--}),ForEach.shader(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--}),ForEach.image(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--,ForEach.compressedImage(e,function(e){var t=e.bufferView;defined(t)&&ii&&e.extensions.KHR_draco_mesh_compression.bufferView--})})},Remove.mesh=function(e,t){e.meshes.splice(t,1),ForEach.node(e,function(e){defined(e.mesh)&&(e.mesh>t?e.mesh--:e.mesh===t&&delete e.mesh)})},Remove.node=function(e,t){e.nodes.splice(t,1),ForEach.skin(e,function(e){defined(e.skeleton)&&e.skeleton>t&&e.skeleton--,e.joints=e.joints.map(function(e){return tt&&e.target.node--})}),ForEach.technique(e,function(e){ForEach.techniqueUniform(e,function(e){defined(e.node)&&e.node>t&&e.node--})}),ForEach.node(e,function(e){defined(e.children)&&(e.children=e.children.filter(function(e){return e!==t}).map(function(e){return tt&&e.material--})})},getListOfElementsIdsInUse.accessor=function(e){var t={};return ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){ForEach.meshPrimitiveAttribute(e,function(e){t[e]=!0}),ForEach.meshPrimitiveTarget(e,function(e){ForEach.meshPrimitiveTargetAttribute(e,function(e){t[e]=!0})});e=e.indices;defined(e)&&(t[e]=!0)})}),ForEach.skin(e,function(e){defined(e.inverseBindMatrices)&&(t[e.inverseBindMatrices]=!0)}),ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){defined(e.input)&&(t[e.input]=!0),defined(e.output)&&(t[e.output]=!0)})}),t},getListOfElementsIdsInUse.buffer=function(e){var t={};return ForEach.bufferView(e,function(e){defined(e.buffer)&&(t[e.buffer]=!0)}),t},getListOfElementsIdsInUse.bufferView=function(e){var t={};return ForEach.accessor(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)}),ForEach.shader(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)}),ForEach.image(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0),ForEach.compressedImage(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)})}),hasExtension(e,"KHR_draco_mesh_compression")&&ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.extensions)&&defined(e.extensions.KHR_draco_mesh_compression)&&(t[e.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),t},getListOfElementsIdsInUse.mesh=function(i){var r={};return ForEach.node(i,function(e){var t;!defined(e.mesh&&defined(i.meshes))||defined(t=i.meshes[e.mesh])&&defined(t.primitives)&&0r&&e.hasOwnProperty(i)&&(r=t);return r}function u3d(e){return o3d[e]||0}function v3d(e,t,i){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:i}}function w3d(e){return 48<=e&&e<=57}function x3d(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||128<=e&&!o3d[String.fromCharCode(e)]}function z3d(r){for(var e,l=0,t=r.charAt,i=r.charCodeAt,n=function(e){return t.call(r,e)},a=function(e){return i.call(r,e)},o=r.length,s=function(){for(var e=a(l);32===e||9===e;)e=a(++l)},c=function(){var e,t,i=d();return s(),63!==a(l)?i:(l++,(e=c())||l3d("Expected expression",l),s(),58===a(l)?(l++,(t=c())||l3d("Expected expression",l),{type:"ConditionalExpression",test:i,consequent:e,alternate:t}):void l3d("Expected :",l))},u=function(){s();for(var e=r.substr(l,r3d),t=e.length;0":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},q3d=p3d(n3d),r3d=p3d(o3d),s3d={true:!0,false:!1,null:null},z3d.version="0.3.1",z3d.toString=function(){return"JavaScript Expression Parser (JSEP) v"+z3d.version},z3d.addUnaryOp=function(e){return q3d=Math.max(e.length,q3d),n3d[e]=!0,this},z3d.addBinaryOp=function(e,t){return r3d=Math.max(e.length,r3d),o3d[e]=t,this},z3d.addLiteral=function(e,t){return s3d[e]=t,this},z3d.removeUnaryOp=function(e){return delete n3d[e],e.length===q3d&&(q3d=p3d(n3d)),this},z3d.removeAllUnaryOps=function(){return n3d={},q3d=0,this},z3d.removeBinaryOp=function(e){return delete o3d[e],e.length===r3d&&(r3d=p3d(o3d)),this},z3d.removeAllBinaryOps=function(){return o3d={},r3d=0,this},z3d.removeLiteral=function(e){return delete s3d[e],this},z3d.removeAllLiterals=function(){return s3d={},this},Q2d.jsep=z3d;var jsep=tmp$5.jsep,ExpressionNodeType={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},ExpressionNodeType$1=Object.freeze(ExpressionNodeType);function Expression(e,t){var i;e=replaceVariables(removeBackslashes(e=replaceDefines(this._expression=e,t))),jsep.addBinaryOp("=~",0),jsep.addBinaryOp("!~",0);try{i=jsep(e)}catch(e){throw new RuntimeError(e)}this._runtimeAst=createRuntimeAst(this,i)}Object.defineProperties(Expression.prototype,{expression:{get:function(){return this._expression}}});var scratchStorage={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new Cartesian2],cartesian3Array:[new Cartesian3],cartesian4Array:[new Cartesian4],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);var e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new Cartesian2),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new Cartesian3),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new Cartesian4),this.cartesian4Array[this.cartesian4Index++]}};Expression.prototype.evaluate=function(e,t){scratchStorage.reset();e=this._runtimeAst.evaluate(e);return t instanceof Color&&e instanceof Cartesian4?Color.fromCartesian4(e,t):e instanceof Cartesian2||e instanceof Cartesian3||e instanceof Cartesian4?e.clone(t):e},Expression.prototype.evaluateColor=function(e,t){scratchStorage.reset();e=this._runtimeAst.evaluate(e);return Color.fromCartesian4(e,t)},Expression.prototype.getShaderFunction=function(e,t,i,r){return r+" "+e+"() \n{ \n return "+this.getShaderExpression(t,i)+"; \n} \n"},Expression.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};var unaryOperators=["!","-","+"],binaryOperators=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],variableRegex=/\${(.*?)}/g,backslashRegex=/\\/g,backslashReplacement="@#%",replacementRegex=/@#%/g,scratchColor$k=new Color,unaryFunctions={abs:getEvaluateUnaryComponentwise(Math.abs),sqrt:getEvaluateUnaryComponentwise(Math.sqrt),cos:getEvaluateUnaryComponentwise(Math.cos),sin:getEvaluateUnaryComponentwise(Math.sin),tan:getEvaluateUnaryComponentwise(Math.tan),acos:getEvaluateUnaryComponentwise(Math.acos),asin:getEvaluateUnaryComponentwise(Math.asin),atan:getEvaluateUnaryComponentwise(Math.atan),radians:getEvaluateUnaryComponentwise(CesiumMath.toRadians),degrees:getEvaluateUnaryComponentwise(CesiumMath.toDegrees),sign:getEvaluateUnaryComponentwise(CesiumMath.sign),floor:getEvaluateUnaryComponentwise(Math.floor),ceil:getEvaluateUnaryComponentwise(Math.ceil),round:getEvaluateUnaryComponentwise(Math.round),exp:getEvaluateUnaryComponentwise(Math.exp),exp2:getEvaluateUnaryComponentwise(exp2),log:getEvaluateUnaryComponentwise(Math.log),log2:getEvaluateUnaryComponentwise(log2),fract:getEvaluateUnaryComponentwise(fract),length:length$1,normalize:normalize},binaryFunctions={atan2:getEvaluateBinaryComponentwise(Math.atan2,!1),pow:getEvaluateBinaryComponentwise(Math.pow,!1),min:getEvaluateBinaryComponentwise(Math.min,!0),max:getEvaluateBinaryComponentwise(Math.max,!0),distance:distance,dot:dot,cross:cross},ternaryFunctions={clamp:getEvaluateTernaryComponentwise(CesiumMath.clamp,!0),mix:getEvaluateTernaryComponentwise(CesiumMath.lerp,!0)};function fract(e){return e-Math.floor(e)}function exp2(e){return Math.pow(2,e)}function log2(e){return CesiumMath.log2(e)}function getEvaluateUnaryComponentwise(i){return function(e,t){if("number"==typeof t)return i(t);if(t instanceof Cartesian2)return Cartesian2.fromElements(i(t.x),i(t.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(i(t.x),i(t.y),i(t.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(i(t.x),i(t.y),i(t.z),i(t.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}}function getEvaluateBinaryComponentwise(r,n){return function(e,t,i){if(n&&"number"==typeof i){if("number"==typeof t)return r(t,i);if(t instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i),r(t.y,i),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i),r(t.y,i),r(t.z,i),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(r(t.x,i),r(t.y,i),r(t.z,i),r(t.w,i),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i)return r(t,i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i.x),r(t.y,i.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i.x),r(t.y,i.y),r(t.z,i.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(r(t.x,i.x),r(t.y,i.y),r(t.z,i.z),r(t.w,i.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}}function getEvaluateTernaryComponentwise(n,a){return function(e,t,i,r){if(a&&"number"==typeof r){if("number"==typeof t&&"number"==typeof i)return n(t,i,r);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),n(t.z,i.z,r),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),n(t.z,i.z,r),n(t.w,i.w,r),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i&&"number"==typeof r)return n(t,i,r);if(t instanceof Cartesian2&&i instanceof Cartesian2&&r instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3&&r instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),n(t.z,i.z,r.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4&&r instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),n(t.z,i.z,r.z),n(t.w,i.w,r.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+", "+i+", and "+r+".")}}function length$1(e,t){if("number"==typeof t)return Math.abs(t);if(t instanceof Cartesian2)return Cartesian2.magnitude(t);if(t instanceof Cartesian3)return Cartesian3.magnitude(t);if(t instanceof Cartesian4)return Cartesian4.magnitude(t);throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function normalize(e,t){if("number"==typeof t)return 1;if(t instanceof Cartesian2)return Cartesian2.normalize(t,scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.normalize(t,scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.normalize(t,scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function distance(e,t,i){if("number"==typeof t&&"number"==typeof i)return Math.abs(t-i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.distance(t,i);if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.distance(t,i);if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.distance(t,i);throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function dot(e,t,i){if("number"==typeof t&&"number"==typeof i)return t*i;if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.dot(t,i);if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.dot(t,i);if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.dot(t,i);throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function cross(e,t,i){if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.cross(t,i,scratchStorage.getCartesian3());throw new RuntimeError('Function "'+e+'" requires vec3 arguments. Arguments are '+t+" and "+i+".")}function Node$1(e,t,i,r,n){this._type=e,this._value=t,this._left=i,this._right=r,this._test=n,this.evaluate=void 0,setEvaluateFunction(this)}function replaceDefines(e,t){if(!defined(t))return e;for(var i in t){var r;t.hasOwnProperty(i)&&(r=new RegExp("\\$\\{"+i+"\\}","g"),defined(i="("+t[i]+")")&&(e=e.replace(r,i)))}return e}function removeBackslashes(e){return e.replace(backslashRegex,backslashReplacement)}function replaceBackslashes(e){return e.replace(replacementRegex,"\\")}function replaceVariables(e){for(var t=e,i="",r=t.indexOf("${");0<=r;){var n,a=t.indexOf("'"),o=t.indexOf('"');if(0<=a&&a=ExpressionNodeType$1.LITERAL_NULL}function isVariable(e){return"czm_"===e.substr(0,4)}function getPropertyName(e){return e.substr(4)}function createRuntimeAst(e,t){if("Literal"===t.type)o=parseLiteral(t);else if("CallExpression"===t.type)o=parseCall(e,t);else if("Identifier"===t.type)o=parseKeywordsAndVariables(t);else if("UnaryExpression"===t.type){var i=t.operator,r=createRuntimeAst(e,t.argument);if(!(-1"===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:defined(binaryFunctions[e._value])&&(e.evaluate=getEvaluateBinaryFunction(e._value)):e._type===ExpressionNodeType$1.TERNARY?e.evaluate=getEvaluateTernaryFunction(e._value):e._type===ExpressionNodeType$1.MEMBER?"brackets"===e._value?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===ExpressionNodeType$1.ARRAY?e.evaluate=e._evaluateArray:e._type===ExpressionNodeType$1.VARIABLE?e.evaluate=e._evaluateVariable:e._type===ExpressionNodeType$1.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===ExpressionNodeType$1.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===ExpressionNodeType$1.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===ExpressionNodeType$1.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===ExpressionNodeType$1.REGEX?e.evaluate=e._evaluateRegExp:e._type===ExpressionNodeType$1.BUILTIN_VARIABLE?"tiles3d_tileset_time"===e._value&&(e.evaluate=evaluateTilesetTime):e.evaluate=e._evaluateLiteral}function evaluateTilesetTime(e){return defined(e)?e.content.tileset.timeSinceLoad:0}function getEvaluateUnaryFunction(t){var i=unaryFunctions[t];return function(e){e=this._left.evaluate(e);return i(t,e)}}function getEvaluateBinaryFunction(i){var r=binaryFunctions[i];return function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return r(i,t,e)}}function getEvaluateTernaryFunction(r){var n=ternaryFunctions[r];return function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e),e=this._test.evaluate(e);return n(r,t,i,e)}}function getFeatureProperty(e,t){if(defined(e))return e.getProperty(t)}function checkFeature(e){return"feature"===e._value}function convertHSLToRGB(e){for(var t=e._left,i=t.length,r=0;r" requires number arguments. Arguments are '+t+" and "+e+".");return e=" requires number arguments. Arguments are '+t+" and "+e+".");return e<=t},Node$1.prototype._evaluateOr=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "||" requires boolean arguments. First argument is '+t+".");if(t)return!0;e=this._right.evaluate(e);if("boolean"!=typeof e)throw new RuntimeError('Operator "||" requires boolean arguments. Second argument is '+e+".");return t||e},Node$1.prototype._evaluateAnd=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "&&" requires boolean arguments. First argument is '+t+".");if(!t)return!1;e=this._right.evaluate(e);if("boolean"!=typeof e)throw new RuntimeError('Operator "&&" requires boolean arguments. Second argument is '+e+".");return t&&e},Node$1.prototype._evaluatePlus=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.add(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.add(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.add(t,e,scratchStorage.getCartesian4());if("string"==typeof t||"string"==typeof e)return t+e;if("number"==typeof t&&"number"==typeof e)return t+e;throw new RuntimeError('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateMinus=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.subtract(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.subtract(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.subtract(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t-e;throw new RuntimeError('Operator "-" requires vector or number arguments of matching types. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateTimes=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.multiplyComponents(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian2&&"number"==typeof t)return Cartesian2.multiplyByScalar(e,t,scratchStorage.getCartesian2());if(t instanceof Cartesian2&&"number"==typeof e)return Cartesian2.multiplyByScalar(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.multiplyComponents(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian3&&"number"==typeof t)return Cartesian3.multiplyByScalar(e,t,scratchStorage.getCartesian3());if(t instanceof Cartesian3&&"number"==typeof e)return Cartesian3.multiplyByScalar(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.multiplyComponents(t,e,scratchStorage.getCartesian4());if(e instanceof Cartesian4&&"number"==typeof t)return Cartesian4.multiplyByScalar(e,t,scratchStorage.getCartesian4());if(t instanceof Cartesian4&&"number"==typeof e)return Cartesian4.multiplyByScalar(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t*e;throw new RuntimeError('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateDivide=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.divideComponents(t,e,scratchStorage.getCartesian2());if(t instanceof Cartesian2&&"number"==typeof e)return Cartesian2.divideByScalar(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.divideComponents(t,e,scratchStorage.getCartesian3());if(t instanceof Cartesian3&&"number"==typeof e)return Cartesian3.divideByScalar(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.divideComponents(t,e,scratchStorage.getCartesian4());if(t instanceof Cartesian4&&"number"==typeof e)return Cartesian4.divideByScalar(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t/e;throw new RuntimeError('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateMod=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.fromElements(t.x%e.x,t.y%e.y,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.fromElements(t.x%e.x,t.y%e.y,t.z%e.z,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.fromElements(t.x%e.x,t.y%e.y,t.z%e.z,t.w%e.w,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t%e;throw new RuntimeError('Operator "%" requires vector or number arguments of matching types. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateEqualsStrict=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return e instanceof Cartesian2&&t instanceof Cartesian2||e instanceof Cartesian3&&t instanceof Cartesian3||e instanceof Cartesian4&&t instanceof Cartesian4?t.equals(e):t===e},Node$1.prototype._evaluateNotEqualsStrict=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return e instanceof Cartesian2&&t instanceof Cartesian2||e instanceof Cartesian3&&t instanceof Cartesian3||e instanceof Cartesian4&&t instanceof Cartesian4?!t.equals(e):t!==e},Node$1.prototype._evaluateConditional=function(e){var t=this._test.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError("Conditional argument of conditional expression must be a boolean. Argument is "+t+".");return(t?this._left:this._right).evaluate(e)},Node$1.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))},Node$1.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))},Node$1.prototype._evaluateIsExactClass=function(e){return!!defined(e)&&e.isExactClass(this._left.evaluate(e))},Node$1.prototype._evaluateIsClass=function(e){return!!defined(e)&&e.isClass(this._left.evaluate(e))},Node$1.prototype._evaluateGetExactClassName=function(e){if(defined(e))return e.getExactClassName()},Node$1.prototype._evaluateBooleanConversion=function(e){return Boolean(this._left.evaluate(e))},Node$1.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))},Node$1.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))},Node$1.prototype._evaluateRegExp=function(e){var t,i=this._value.evaluate(e),r="";defined(this._left)&&(r=this._left.evaluate(e));try{t=new RegExp(i,r)}catch(e){throw new RuntimeError(e)}return t},Node$1.prototype._evaluateRegExpTest=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof e))throw new RuntimeError("RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+e+".");return t.test(e)},Node$1.prototype._evaluateRegExpMatch=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof e)return t.test(e);if(e instanceof RegExp&&"string"==typeof t)return e.test(t);throw new RuntimeError('Operator "=~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateRegExpNotMatch=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof e)return!t.test(e);if(e instanceof RegExp&&"string"==typeof t)return!e.test(t);throw new RuntimeError('Operator "!~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateRegExpExec=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof e))throw new RuntimeError("RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+e+".");e=t.exec(e);return defined(e)?e[1]:null},Node$1.prototype._evaluateToString=function(e){e=this._left.evaluate(e);if(e instanceof RegExp||e instanceof Cartesian2||e instanceof Cartesian3||e instanceof Cartesian4)return String(e);throw new RuntimeError('Unexpected function call "'+this._value+'".')};var nullSentinel="czm_infinity";function Vector3DTilePrimitive(e){e=defaultValue(e,defaultValue.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=defaultValue(e.center,Cartesian3.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=Color.clone(Color.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=defaultValue(e.classificationType,ClassificationType$1.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={};for(var t=this._batchIds.length,i=0;i 0.0 && clipDistance < clippingPlanesEdgeWidth) \n { \n gl_FragColor = clippingPlanesEdgeColor;\n } \n"}DracoLoader._maxDecodingConcurrency=Math.max(FeatureDetection.hardwareConcurrency-1,1),DracoLoader._decoderTaskProcessor=void 0,DracoLoader._taskProcessorReady=!1,DracoLoader._getDecoderTaskProcessor=function(){var e;return defined(DracoLoader._decoderTaskProcessor)||((e=new TaskProcessor("decodeDraco",DracoLoader._maxDecodingConcurrency)).initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_wasm_wrapper.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm",fallbackModulePath:"ThirdParty/Workers/draco_decoder.js"}).then(function(){DracoLoader._taskProcessorReady=!0}),DracoLoader._decoderTaskProcessor=e),DracoLoader._decoderTaskProcessor},DracoLoader.hasExtension=function(e){return defined(e.extensionsRequired.KHR_draco_mesh_compression)||defined(e.extensionsUsed.KHR_draco_mesh_compression)},DracoLoader._decodedModelResourceCache=void 0,DracoLoader.parse=function(e,t){if(DracoLoader.hasExtension(e)){var a=e._loadResources,i=e.cacheKey;if(defined(i)){defined(DracoLoader._decodedModelResourceCache)||(defined(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),DracoLoader._decodedModelResourceCache=t.cache.modelDecodingCache);i=DracoLoader._decodedModelResourceCache[i];if(defined(i))return i.count++,void(a.pendingDecodingCache=!0)}var o=e._dequantizeInShader,s=e.gltf;ForEach.mesh(s,function(e,n){ForEach.meshPrimitive(e,function(e,t){var i,r;!defined(e.extensions)||defined(i=e.extensions.KHR_draco_mesh_compression)&&(r=s.bufferViews[i.bufferView],e=arraySlice(s.buffers[r.buffer].extras._pipeline.source,r.byteOffset,r.byteOffset+r.byteLength),a.primitivesToDecode.enqueue({mesh:n,primitive:t,array:e,bufferView:r,compressedAttributes:i.attributes,dequantizeInShader:o}))})})}},DracoLoader.decodeModel=function(e,t){if(!DracoLoader.hasExtension(e))return when.resolve();var i=e._loadResources,r=e.cacheKey;if(defined(r)&&defined(DracoLoader._decodedModelResourceCache)){var n=DracoLoader._decodedModelResourceCache[r];if(defined(n)&&i.pendingDecodingCache)return when(n.ready,function(){e._decodedData=n.data,i.pendingDecodingCache=!1});DracoLoader._decodedModelResourceCache[r]={ready:!1,count:1,data:void 0}}if(0===i.primitivesToDecode.length)return when.resolve();for(var a=DracoLoader._getDecoderTaskProcessor(),o=[],s=scheduleDecodingTask(a,e,i);defined(s);)o.push(s),s=scheduleDecodingTask(a,e,i);return when.all(o)},DracoLoader.decodePointCloud=function(e){var t=DracoLoader._getDecoderTaskProcessor();if(DracoLoader._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},DracoLoader.cacheDataForModel=function(e){var t=e.cacheKey;defined(t)&&defined(DracoLoader._decodedModelResourceCache)&&(defined(t=DracoLoader._decodedModelResourceCache[t])&&(t.ready=!0,t.data=e._decodedData))},DracoLoader.destroyCachedDataForModel=function(e){var t=e.cacheKey;defined(t)&&defined(DracoLoader._decodedModelResourceCache)&&(defined(e=DracoLoader._decodedModelResourceCache[t])&&0==--e.count&&delete DracoLoader._decodedModelResourceCache[t])};var textureResolutionScratch=new Cartesian2;function getClippingFunction(e,t){var i=e.unionClippingRegions,r=e.length,n=ClippingPlaneCollection.useFloatTexture(t),e=ClippingPlaneCollection.getTextureResolution(e,t,textureResolutionScratch),t=e.x,e=e.y,e=(n?getClippingPlaneFloat:getClippingPlaneUint8)(t,e);return e+="\n",e+=(i?clippingFunctionUnion:clippingFunctionIntersect)(r)}function clippingFunctionUnion(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount;\n float pixelWidth = czm_metersPerPixel(position);\n bool breakAndDiscard = false;\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n if (amount <= 0.0)\n {\n breakAndDiscard = true;\n break;\n }\n }\n if (breakAndDiscard) {\n discard;\n }\n return clipAmount;\n}\n"}function clippingFunctionIntersect(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n bool clipped = true;\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount = 0.0;\n float pixelWidth = czm_metersPerPixel(position);\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = max(amount, clipAmount);\n clipped = clipped && (amount <= 0.0);\n }\n if (clipped)\n {\n discard;\n }\n return clipAmount;\n}\n"}function getClippingPlaneFloat(e,t){var i=1/t,t=1/e+"";-1===t.indexOf(".")&&(t+=".0");i+="";return-1===i.indexOf(".")&&(i+=".0"),"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int pixY = clippingPlaneNumber / "+e+";\n int pixX = clippingPlaneNumber - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+t+";\n float v = (float(pixY) + 0.5) * "+i+";\n vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n return czm_transformPlane(plane, transform);\n}\n"}function getClippingPlaneUint8(e,t){var i=1/t,t=1/e+"";-1===t.indexOf(".")&&(t+=".0");i+="";return-1===i.indexOf(".")&&(i+=".0"),"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n int pixY = clippingPlaneStartIndex / "+e+";\n int pixX = clippingPlaneStartIndex - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+t+";\n float v = (float(pixY) + 0.5) * "+i+";\n vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n vec4 plane;\n plane.xyz = czm_octDecode(oct, 65535.0);\n plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + "+t+", v)));\n return czm_transformPlane(plane, transform);\n}\n"}var JobType={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},JobType$1=Object.freeze(JobType);function ModelAnimationCache(){}var dataUriRegex=/^data\:/i;function getAccessorKey(e,t){var i=e.gltf,r=i.buffers,i=i.bufferViews[t.bufferView],r=r[i.buffer],i=i.byteOffset+t.byteOffset,t=t.count*numberOfComponentsForType(t.type),r=dataUriRegex.test(r.uri)?"":r.uri;return e.cacheKey+"//"+r+"/"+i+"/"+t}var cachedAnimationParameters={};ModelAnimationCache.getAnimationParameterValues=function(e,t){var i=getAccessorKey(e,t);if(!defined(h=cachedAnimationParameters[i])){for(var r=e.gltf,n=r.buffers,a=r.bufferViews[t.bufferView],o=n[a.buffer].extras._pipeline.source,s=t.componentType,l=t.type,c=numberOfComponentsForType(l),u=t.count,d=getAccessorByteStride(r,t),h=new Array(u),t=defaultValue(t.byteOffset,0),p=a.byteOffset+t,m=0;m=r[i+1]?r[i+1]:r[i];return this._spline.evaluate(i,t)},Object.defineProperties(SteppedSpline.prototype,{times:{get:function(){return this._spline.times}}}),SteppedSpline.prototype.wrapTime=function(e){return this._spline.wrapTime(e)},SteppedSpline.prototype.clampTime=function(e){return this._spline.clampTime(e)},ModelAnimationCache.getAnimationSpline=function(e,t,i,r,n,a,o,s){t=getAnimationSplineKey(e,t,r),r=cachedAnimationSplines[t];return defined(r)||(s=s,1===(a=a).length&&1===s.length?r=new ConstantSpline(s[0]):"LINEAR"!==n.interpolation&&"STEP"!==n.interpolation||("translation"===o||"scale"===o?r=new LinearSpline({times:a,points:s}):"rotation"===o?r=new QuaternionSpline({times:a,points:s}):"weights"===o&&(r=new WeightSpline({times:a,weights:s})),defined(r)&&"STEP"===n.interpolation&&(r=new SteppedSpline(r))),defined(e.cacheKey)&&(cachedAnimationSplines[t]=r)),r};var cachedSkinInverseBindMatrices={};ModelAnimationCache.getSkinInverseBindMatrices=function(e,t){var i=getAccessorKey(e,t);if(!defined(d=cachedSkinInverseBindMatrices[i])){var r=e.gltf,n=r.buffers,e=r.bufferViews[t.bufferView],a=n[e.buffer].extras._pipeline.source,o=t.componentType,n=t.type,s=t.count,l=getAccessorByteStride(r,t),c=e.byteOffset+t.byteOffset,u=numberOfComponentsForType(n),d=new Array(s);if(o===WebGLConstants$1.FLOAT&&n===AttributeType$1.MAT4)for(var h=0;h>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function matchAndStoreCoordinates(e,t,i,r,n,a,o){var s=o?1:0,l=n?1:0,c=computeOrderMask(e,t,s,l,0);if(0===c)return t;var u=n?1:0,d=a?1:0,h=computeOrderMask(e,i,0,u,d);if(0===h)return i;var p=o?1:0,n=a?1:0,o=computeOrderMask(e,r,p,0,n);if(0===o)return r;var m,f,g,a=c&h&o;if(1&a)m=0,f=1,g=2;else if(2&a)m=0,g=1,f=2;else if(4&a)f=0,m=1,g=2;else if(8&a)f=0,g=1,m=2;else if(16&a)g=0,m=1,f=2;else{if(!(32&a)){c=popcount0to63(c),h=popcount0to63(h),o=popcount0to63(o);return c>=1,o.push(createTexture$1(n));r=new Texture({context:t,source:{arrayBufferView:a,mipLevels:o},width:r,height:1,pixelFormat:PixelFormat$1.LUMINANCE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})});return i.outlineTexture=r},ComputeCommand.prototype.execute=function(e){e.execute(this)};var OctahedralProjectionAtlasFS="varying vec2 v_textureCoordinates;\nuniform float originalSize;\nuniform sampler2D texture0;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\nvoid main()\n{\nvec2 uv = v_textureCoordinates;\nvec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\nvec2 pixel = 1.0 / textureSize;\nfloat mipLevel = 0.0;\nif (uv.x - pixel.x > (textureSize.y / textureSize.x))\n{\nmipLevel = 1.0;\nif (uv.y - pixel.y > yMipLevel1)\n{\nmipLevel = 2.0;\nif (uv.y - pixel.y * 3.0 > yMipLevel2)\n{\nmipLevel = 3.0;\nif (uv.y - pixel.y * 5.0 > yMipLevel3)\n{\nmipLevel = 4.0;\nif (uv.y - pixel.y * 7.0 > yMipLevel4)\n{\nmipLevel = 5.0;\n}\n}\n}\n}\n}\nif (mipLevel > 0.0)\n{\nfloat scale = pow(2.0, mipLevel);\nuv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\nuv.x *= ((textureSize.x - 2.0) / textureSize.y);\nuv.x -= 1.0 + pixel.x;\nuv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\nuv *= scale;\n}\nelse\n{\nuv.x *= (textureSize.x / textureSize.y);\n}\nif(mipLevel == 0.0)\n{\ngl_FragColor = texture2D(texture0, uv);\n}\nelse if(mipLevel == 1.0)\n{\ngl_FragColor = texture2D(texture1, uv);\n}\nelse if(mipLevel == 2.0)\n{\ngl_FragColor = texture2D(texture2, uv);\n}\nelse if(mipLevel == 3.0)\n{\ngl_FragColor = texture2D(texture3, uv);\n}\nelse if(mipLevel == 4.0)\n{\ngl_FragColor = texture2D(texture4, uv);\n}\nelse if(mipLevel == 5.0)\n{\ngl_FragColor = texture2D(texture5, uv);\n}\nelse\n{\ngl_FragColor = vec4(0.0);\n}\n}\n",OctahedralProjectionFS="varying vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\nvoid main()\n{\nvec4 rgbm = textureCube(cubeMap, v_cubeMapCoordinates);\nfloat m = rgbm.a * 16.0;\nvec3 r = rgbm.rgb * m;\ngl_FragColor = vec4(r * r, 1.0);\n}\n",OctahedralProjectionVS="attribute vec4 position;\nattribute vec3 cubeMapCoordinates;\nvarying vec3 v_cubeMapCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_cubeMapCoordinates = cubeMapCoordinates;\n}\n";function OctahedralProjectedCubeMap(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._readyPromise=when.defer()}Object.defineProperties(OctahedralProjectedCubeMap.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),OctahedralProjectedCubeMap.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};for(var v1=new Cartesian3(1,0,0),v2=new Cartesian3(0,0,1),v3=new Cartesian3(-1,0,0),v4=new Cartesian3(0,0,-1),v5=new Cartesian3(0,1,0),v6=new Cartesian3(0,-1,0),cubeMapCoordinates=[v5,v3,v2,v6,v1,v5,v4,v5,v5],length=cubeMapCoordinates.length,flatCubeMapCoordinates=new Float32Array(3*length),offset=0,i$3=0;i$3D||T.center.y-T.radiusD||T.center.y-T.radius=o.clientWidth?m=!0:(positionCC=(h.x>.5*o.clientWidth?(s.width=h.x,p.frustum.right=l.x-t,positionCC=worldToClip(a,i,p,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord0),s.x+=h.x,p.position.x=-p.position.x,e=p.frustum.right,p.frustum.right=-p.frustum.left,p.frustum.left=-e):(s.x+=h.x,s.width-=h.x,p.frustum.left=-l.x-t,positionCC=worldToClip(a,i,p,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord0),s.x=s.x-s.width,p.position.x=-p.position.x,t=p.frustum.left,p.frustum.left=-p.frustum.right,p.frustum.right=-t),worldToClip(a,i,p,positionCC)),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord1),Cartesian3.clone(c,p.position),p.frustum=u.clone(),((r=Cartesian2.clone(scratchWindowCoord0,r)).x<0||r.x>o.clientWidth)&&(r.x=scratchWindowCoord1.x))),n.mode!==SceneMode$1.SCENE2D||m){if((positionCC=worldToClip(a,i,p,positionCC)).z<0&&!(p.frustum instanceof OrthographicFrustum)&&!(p.frustum instanceof OrthographicOffCenterFrustum))return;r=SceneTransforms.clipToGLWindowCoordinates(s,positionCC,r)}return r.y=o.clientHeight-r.y,r}},SceneTransforms.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(defined(i=SceneTransforms.wgs84ToWindowCoordinates(e,t,i)))return SceneTransforms.transformWindowToDrawingBuffer(e,i,i)};var projectedPosition=new Cartesian3,positionInCartographic=new Cartographic;SceneTransforms.computeActualWgs84Position=function(e,t,i){var r=e.mode;if(r===SceneMode$1.SCENE3D)return Cartesian3.clone(t,i);var n=e.mapProjection,a=n.ellipsoid.cartesianToCartographic(t,positionInCartographic);if(defined(a)){if(n.project(a,projectedPosition),r===SceneMode$1.COLUMBUS_VIEW)return Cartesian3.fromElements(projectedPosition.z,projectedPosition.x,projectedPosition.y,i);if(r===SceneMode$1.SCENE2D)return Cartesian3.fromElements(0,projectedPosition.x,projectedPosition.y,i);e=e.morphTime;return Cartesian3.fromElements(CesiumMath.lerp(projectedPosition.z,t.x,e),CesiumMath.lerp(projectedPosition.x,t.y,e),CesiumMath.lerp(projectedPosition.y,t.z,e),i)}};var positionNDC=new Cartesian3,positionWC=new Cartesian3,viewportTransform=new Matrix4;SceneTransforms.clipToGLWindowCoordinates=function(e,t,i){return Cartesian3.divideByScalar(t,t.w,positionNDC),Matrix4.computeViewportTransformation(e,0,1,viewportTransform),Matrix4.multiplyByPoint(viewportTransform,positionNDC,positionWC),Cartesian2.fromCartesian3(positionWC,i)},SceneTransforms.transformWindowToDrawingBuffer=function(e,t,i){var r=e.canvas,n=e.drawingBufferWidth/r.clientWidth,r=e.drawingBufferHeight/r.clientHeight;return Cartesian2.fromElements(t.x*n,t.y*r,i)};var scratchNDC=new Cartesian4,scratchWorldCoords=new Cartesian4;function Billboard(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucencyByDistance,r=e.pixelOffsetScaleByDistance,n=e.scaleByDistance,a=e.distanceDisplayCondition;defined(i)&&(i=NearFarScalar.clone(i)),defined(r)&&(r=NearFarScalar.clone(r)),defined(n)&&(n=NearFarScalar.clone(n)),defined(a)&&(a=DistanceDisplayCondition.clone(a)),this._show=defaultValue(e.show,!0),this._position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this._actualPosition=Cartesian3.clone(this._position),this._pixelOffset=Cartesian2.clone(defaultValue(e.pixelOffset,Cartesian2.ZERO)),this._translate=new Cartesian2(0,0),this._eyeOffset=Cartesian3.clone(defaultValue(e.eyeOffset,Cartesian3.ZERO)),this._heightReference=defaultValue(e.heightReference,HeightReference$1.NONE),this._verticalOrigin=defaultValue(e.verticalOrigin,VerticalOrigin$1.CENTER),this._horizontalOrigin=defaultValue(e.horizontalOrigin,HorizontalOrigin$1.CENTER),this._scale=defaultValue(e.scale,1),this._color=Color.clone(defaultValue(e.color,Color.WHITE)),this._rotation=defaultValue(e.rotation,0),this._alignedAxis=Cartesian3.clone(defaultValue(e.alignedAxis,Cartesian3.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=n,this._translucencyByDistance=i,this._pixelOffsetScaleByDistance=r,this._sizeInMeters=defaultValue(e.sizeInMeters,!1),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=defaultValue(e.collection,t),this._pickId=void 0,this._pickPrimitive=defaultValue(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;a=e.image,t=e.imageId;defined(a)&&(defined(t)||(t="string"==typeof a?a:defined(a.src)?a.src:createGuid()),this._imageId=t,this._image=a),defined(e.imageSubRegion)&&(this._imageId=t,this._imageSubRegion=e.imageSubRegion),defined(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=SceneMode$1.SCENE3D,this._clusterShow=!0,this._outlineColor=Color.clone(defaultValue(e.outlineColor,Color.BLACK)),this._outlineWidth=defaultValue(e.outlineWidth,0),this._updateClamping()}SceneTransforms.drawingBufferToWgs84Coordinates=function(e,t,i,r){var n=e.context.uniformState,a=n.currentFrustum,o=a.x,s=a.y;e.frameState.useLogDepth&&(l=i*n.log2FarDepthFromNearPlusOne,i=s*(1-o/(Math.pow(2,l)-1+o))/(s-o));var a=e.view.passState.viewport,l=Cartesian4.clone(Cartesian4.UNIT_W,scratchNDC);l.x=(t.x-a.x)/a.width*2-1,l.y=(t.y-a.y)/a.height*2-1,l.z=2*i-1,l.w=1;var c,i=e.camera.frustum;return defined(i.fovy)?(e=1/(c=Matrix4.multiplyByVector(n.inverseViewProjection,l,scratchWorldCoords)).w,Cartesian3.multiplyByScalar(c,e,c)):(defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),(c=scratchWorldCoords).x=.5*(l.x*(i.right-i.left)+i.left+i.right),c.y=.5*(l.y*(i.top-i.bottom)+i.bottom+i.top),c.z=.5*(l.z*(o-s)-o-s),c.w=1,c=Matrix4.multiplyByVector(n.inverseView,c,c)),Cartesian3.fromCartesian4(c,r)};var SHOW_INDEX$5=Billboard.SHOW_INDEX=0,POSITION_INDEX$5=Billboard.POSITION_INDEX=1,PIXEL_OFFSET_INDEX$1=Billboard.PIXEL_OFFSET_INDEX=2,EYE_OFFSET_INDEX$1=Billboard.EYE_OFFSET_INDEX=3,HORIZONTAL_ORIGIN_INDEX$1=Billboard.HORIZONTAL_ORIGIN_INDEX=4,VERTICAL_ORIGIN_INDEX$1=Billboard.VERTICAL_ORIGIN_INDEX=5,SCALE_INDEX$1=Billboard.SCALE_INDEX=6,IMAGE_INDEX_INDEX$1=Billboard.IMAGE_INDEX_INDEX=7,COLOR_INDEX$3=Billboard.COLOR_INDEX=8,ROTATION_INDEX$1=Billboard.ROTATION_INDEX=9,ALIGNED_AXIS_INDEX$1=Billboard.ALIGNED_AXIS_INDEX=10,SCALE_BY_DISTANCE_INDEX$3=Billboard.SCALE_BY_DISTANCE_INDEX=11,TRANSLUCENCY_BY_DISTANCE_INDEX$3=Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX=12,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX$1=Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,DISTANCE_DISPLAY_CONDITION$2=Billboard.DISTANCE_DISPLAY_CONDITION=14,DISABLE_DEPTH_DISTANCE$1=Billboard.DISABLE_DEPTH_DISTANCE=15;Billboard.TEXTURE_COORDINATE_BOUNDS=16;var SDF_INDEX$1=Billboard.SDF_INDEX=17;function makeDirty$2(e,t){var i=e._billboardCollection;defined(i)&&(i._updateBillboard(e,t),e._dirty=!0)}Billboard.NUMBER_OF_PROPERTIES=18,Object.defineProperties(Billboard.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,makeDirty$2(this,SHOW_INDEX$5))}},position:{get:function(){return this._position},set:function(e){var t=this._position;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),Cartesian3.clone(e,this._actualPosition),this._updateClamping(),makeDirty$2(this,POSITION_INDEX$5))}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),makeDirty$2(this,POSITION_INDEX$5))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var t=this._pixelOffset;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),makeDirty$2(this,PIXEL_OFFSET_INDEX$1))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;NearFarScalar.equals(t,e)||(this._scaleByDistance=NearFarScalar.clone(e,t),makeDirty$2(this,SCALE_BY_DISTANCE_INDEX$3))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;NearFarScalar.equals(t,e)||(this._translucencyByDistance=NearFarScalar.clone(e,t),makeDirty$2(this,TRANSLUCENCY_BY_DISTANCE_INDEX$3))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;NearFarScalar.equals(t,e)||(this._pixelOffsetScaleByDistance=NearFarScalar.clone(e,t),makeDirty$2(this,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX$1))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),makeDirty$2(this,EYE_OFFSET_INDEX$1))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,makeDirty$2(this,HORIZONTAL_ORIGIN_INDEX$1))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,makeDirty$2(this,VERTICAL_ORIGIN_INDEX$1))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,makeDirty$2(this,SCALE_INDEX$1))}},color:{get:function(){return this._color},set:function(e){var t=this._color;Color.equals(t,e)||(Color.clone(e,t),makeDirty$2(this,COLOR_INDEX$3))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,makeDirty$2(this,ROTATION_INDEX$1))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),makeDirty$2(this,ALIGNED_AXIS_INDEX$1))}},width:{get:function(){return defaultValue(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,makeDirty$2(this,IMAGE_INDEX_INDEX$1))}},height:{get:function(){return defaultValue(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,makeDirty$2(this,IMAGE_INDEX_INDEX$1))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,makeDirty$2(this,COLOR_INDEX$3))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){DistanceDisplayCondition.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition),makeDirty$2(this,DISTANCE_DISPLAY_CONDITION$2))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,makeDirty$2(this,DISABLE_DEPTH_DISTANCE$1))}},id:{get:function(){return this._id},set:function(e){this._id=e,defined(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,defined(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){defined(e)?"string"==typeof e?this.setImage(e,e):e instanceof Resource?this.setImage(e.url,e):defined(e.src)?this.setImage(e.src,e):this.setImage(createGuid(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,makeDirty$2(this,IMAGE_INDEX_INDEX$1))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Cartesian3.clone(e,this._actualClampedPosition),makeDirty$2(this,POSITION_INDEX$5)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,makeDirty$2(this,SHOW_INDEX$5))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;Color.equals(t,e)||(Color.clone(e,t),makeDirty$2(this,SDF_INDEX$1))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,makeDirty$2(this,SDF_INDEX$1))}}}),Billboard.prototype.getPickId=function(e){return defined(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},Billboard.prototype._updateClamping=function(){Billboard._updateClamping(this._billboardCollection,this)};var scratchCartographic$b=new Cartographic,scratchPosition$4=new Cartesian3;Billboard._updateClamping=function(e,i){var r,t,n,a,o=e._scene;function s(e){var t;i._heightReference===HeightReference$1.RELATIVE_TO_GROUND&&(i._mode===SceneMode$1.SCENE3D?((t=r.cartesianToCartographic(e,scratchCartographic$b)).height+=n.height,r.cartographicToCartesian(t,e)):e.x+=n.height),i._clampedPosition=Cartesian3.clone(e,i._clampedPosition)}defined(o)&&defined(o.globe)&&(a=o.globe,r=a.ellipsoid,t=a._surface,o=(e=o.frameState.mode)!==i._mode,i._mode=e,(i._heightReference===HeightReference$1.NONE||o)&&defined(i._removeCallbackFunc)&&(i._removeCallbackFunc(),i._removeCallbackFunc=void 0,i._clampedPosition=void 0),i._heightReference!==HeightReference$1.NONE&&defined(i._position)&&(defined(n=r.cartesianToCartographic(i._position))?(defined(i._removeCallbackFunc)&&i._removeCallbackFunc(),i._removeCallbackFunc=t.updateHeight(n,s),Cartographic.clone(n,scratchCartographic$b),defined(a=a.getHeight(n))&&(scratchCartographic$b.height=a),r.cartographicToCartesian(scratchCartographic$b,scratchPosition$4),s(scratchPosition$4)):i._actualClampedPosition=void 0))},Billboard.prototype._loadImage=function(){var e,i,r=this._billboardCollection._textureAtlas,n=this._imageId,a=this._image,o=this._imageSubRegion;defined(a)&&(e=r.addImage(n,a)),defined(o)&&(e=r.addSubRegion(n,o)),defined(this._imageIndexPromise=e)&&(i=this,e.then(function(e){var t;i._imageId===n&&i._image===a&&BoundingRectangle.equals(i._imageSubRegion,o)&&(t=r.textureCoordinates[e],i._imageWidth=r.texture.width*t.width,i._imageHeight=r.texture.height*t.height,i._imageIndex=e,i._ready=!0,i._image=void 0,i._imageIndexPromise=void 0,makeDirty$2(i,IMAGE_INDEX_INDEX$1))}).otherwise(function(e){console.error("Error loading image for billboard: "+e),i._imageIndexPromise=void 0}))},Billboard.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,defined(this._billboardCollection._textureAtlas)&&this._loadImage())},Billboard.prototype.setImageSubRegion=function(e,t){this._imageId===e&&BoundingRectangle.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=BoundingRectangle.clone(t),defined(this._billboardCollection._textureAtlas)&&this._loadImage())},Billboard.prototype._setTranslate=function(e){var t=this._translate;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),makeDirty$2(this,PIXEL_OFFSET_INDEX$1))},Billboard.prototype._getActualPosition=function(){return defined(this._clampedPosition)?this._clampedPosition:this._actualPosition},Billboard.prototype._setActualPosition=function(e){defined(this._clampedPosition)||Cartesian3.clone(e,this._actualPosition),makeDirty$2(this,POSITION_INDEX$5)};var tempCartesian3$1=new Cartesian4;Billboard._computeActualPosition=function(e,t,i,r){return defined(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===SceneMode$1.SCENE3D?t:(Matrix4.multiplyByPoint(r,t,tempCartesian3$1),SceneTransforms.computeActualWgs84Position(i,tempCartesian3$1))};var scratchCartesian3$4=new Cartesian3;Billboard._computeScreenSpacePosition=function(e,t,i,r,n,a){t=Matrix4.multiplyByPoint(e,t,scratchCartesian3$4),a=SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(n,t,i,a);if(defined(a))return Cartesian2.add(a,r,a),a};var scratchPixelOffset=new Cartesian2(0,0);Billboard.prototype.computeScreenSpacePosition=function(e,t){var i=this._billboardCollection;defined(t)||(t=new Cartesian2),Cartesian2.clone(this._pixelOffset,scratchPixelOffset),Cartesian2.add(scratchPixelOffset,this._translate,scratchPixelOffset);var r,n=i.modelMatrix,a=this._position;return defined(this._clampedPosition)&&(a=this._clampedPosition,e.mode!==SceneMode$1.SCENE3D&&(i=(r=e.mapProjection).ellipsoid,r=r.unproject(a,scratchCartographic$b),a=i.cartographicToCartesian(r,scratchCartesian3$4),n=Matrix4.IDENTITY)),Billboard._computeScreenSpacePosition(n,a,this._eyeOffset,scratchPixelOffset,e,t)},Billboard.getScreenSpaceBoundingBox=function(e,t,i){var r=e.width,n=e.height,a=e.scale;r*=a,n*=a;a=t.x;e.horizontalOrigin===HorizontalOrigin$1.RIGHT?a-=r:e.horizontalOrigin===HorizontalOrigin$1.CENTER&&(a-=.5*r);t=t.y;return e.verticalOrigin===VerticalOrigin$1.BOTTOM||e.verticalOrigin===VerticalOrigin$1.BASELINE?t-=n:e.verticalOrigin===VerticalOrigin$1.CENTER&&(t-=.5*n),(i=!defined(i)?new BoundingRectangle:i).x=a,i.y=t,i.width=r,i.height=n,i},Billboard.prototype.equals=function(e){return this===e||defined(e)&&this._id===e._id&&Cartesian3.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&&BoundingRectangle.equals(this._imageSubRegion,e._imageSubRegion)&&Color.equals(this._color,e._color)&&Cartesian2.equals(this._pixelOffset,e._pixelOffset)&&Cartesian2.equals(this._translate,e._translate)&&Cartesian3.equals(this._eyeOffset,e._eyeOffset)&&NearFarScalar.equals(this._scaleByDistance,e._scaleByDistance)&&NearFarScalar.equals(this._translucencyByDistance,e._translucencyByDistance)&&NearFarScalar.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&DistanceDisplayCondition.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},Billboard.prototype._destroy=function(){defined(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),defined(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var BlendOption={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},BlendOption$1=Object.freeze(BlendOption),SDFSettings={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},SDFSettings$1=Object.freeze(SDFSettings);function TextureAtlasNode(e,t,i,r,n){this.bottomLeft=defaultValue(e,Cartesian2.ZERO),this.topRight=defaultValue(t,Cartesian2.ZERO),this.childNode1=i,this.childNode2=r,this.imageIndex=n}var defaultInitialSize=new Cartesian2(16,16);function TextureAtlas(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.borderWidthInPixels,1),i=defaultValue(e.initialSize,defaultInitialSize);this._context=e.context,this._pixelFormat=defaultValue(e.pixelFormat,PixelFormat$1.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=createGuid(),this._idHash={},this._initialSize=i,this._root=void 0}function resizeAtlas(e,t){var i=e._context,r=e.numberOfImages,n=e._borderWidthInPixels;if(0]/,n=[],a="",o=textTypes.LTR,s="",l=e.length,c=0;c";case">":return"<"}}Object.defineProperties(Label.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;ic+1?o[c+1].Type===textTypes.RTL?(l=d+l,s=0):(l=spliceWord(l,s,u.Word),s+=u.Word.length):l=spliceWord(l,0,d)):u.Type===textTypes.RTL?l=spliceWord(l,s,d):u.Type===textTypes.LTR?s=(l+=u.Word).length:u.Type!==textTypes.WEAK&&u.Type!==textTypes.BRACKETS||(0c+1?o[c+1].Type===textTypes.RTL?l=spliceWord(l,s,d):s=(l+=u.Word).length:l+=u.Word:s=(l+=u.Word).length)}i+=l,r=e.length-1)return e.length;for(var i,r,n,a,o,s,l=F(L(e,t)),c=[],u=t+1;uCesiumMath.SIXTY_FOUR_KILOBYTES&&(h._locatorBuckets.push({locator:a,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,a.count=o,a=new VertexArrayBucketLocator(r=o=0,0,this),i[++n]=[a]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,o+=6,r+=6,l+=4;h._locatorBuckets.push({locator:a,count:g}),l+4>CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),l=0,a.count=o,a=new VertexArrayBucketLocator(o=r=0,0,this),i[++n]=[a])}h._clean()}return a.count=o,r},PolylineBucket.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;ns&&(o=new Float32Array(o.buffer,0,s));for(var l,r=this.getSegments(t,r),c=r.positions,u=r.lengths,d=0,h=0,p=0,m=c.length,f=0;fi._depth+e.skipLevels)}function sortChildrenByDistanceToCamera(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function updateAndPushChildren(e,t,i,r){for(var n=t.refine===Cesium3DTileRefine$1.REPLACE,a=t.children,o=a.length,s=0;si:t._screenSpaceError>i))}function canTraverse(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:t._screenSpaceError>e._maximumScreenSpaceError)}function executeTraversal(e,t,i,r,n){var a=traversal.stack;for(a.push(t);0e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;var r=t.parent,n=e._maximumScreenSpaceError,e=t._screenSpaceErrorProgressiveResolution<=n,n=defined(r)&&r._screenSpaceErrorProgressiveResolution>n;return i=e&&n?t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0:i}function getPriorityReverseScreenSpaceError(e,t){var i=t.parent,t=(defined(i)&&(!e._skipLevelOfDetail||0===t._screenSpaceError||i.hasTilesetContent)?i:t)._screenSpaceError;return e.root._screenSpaceError-t}function updateExpireDate(e){var t;defined(e.expireDuration)&&(t=JulianDate.now(scratchJulianDate$1),JulianDate.addSeconds(t,e.expireDuration,t),defined(e.expireDate)?JulianDate.lessThan(e.expireDate,t)&&JulianDate.clone(t,e.expireDate):e.expireDate=JulianDate.clone(t))}function getContentFailedFunction(t,i){return function(e){t._contentState===Cesium3DTileContentState$1.PROCESSING?--i.statistics.numberOfTilesProcessing:--i.statistics.numberOfPendingRequests,t._contentState=Cesium3DTileContentState$1.FAILED,t._contentReadyPromise.reject(e),t._contentReadyToProcessPromise.reject(e)}}function createPriorityFunction(e){return function(){return e._priority}}Cesium3DTile.prototype.getScreenSpaceError=function(e,t,i){var r=this._tileset,n=defaultValue(i,1),a=defined(this.parent)?this.parent.geometricError:r._geometricError,o=t?a:this.geometricError;if(0===o)return 0;var s,l=e.camera,i=l.frustum,t=e.context,a=t.drawingBufferWidth,n=t.drawingBufferHeight*n;return e.mode===SceneMode$1.SCENE2D||i instanceof OrthographicFrustum?(defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),s=o/(Math.max(i.top-i.bottom,i.right-i.left)/Math.max(a,n))):(s=o*n/((n=Math.max(this._distanceToCamera,CesiumMath.EPSILON7))*l.frustum.sseDenominator),r.dynamicScreenSpaceError&&(l=r._dynamicScreenSpaceErrorComputedDensity,r=r.dynamicScreenSpaceErrorFactor,s-=CesiumMath.fog(n,l)*r)),s/=e.pixelRatio},Cesium3DTile.prototype.updateVisibility=function(e){var t=this.parent,i=this._tileset,r=defined(t)?t.computedTransform:i.modelMatrix,t=defined(t)?t._visibilityPlaneMask:CullingVolume.MASK_INDETERMINATE;this.updateTransform(r),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,i.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,t),this._visible=this._visibilityPlaneMask!==CullingVolume.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=getPriorityReverseScreenSpaceError(i,this),this._priorityProgressiveResolution=isPriorityProgressiveResolution(i,this),this.priorityDeferred=isPriorityDeferred(this,e)},Cesium3DTile.prototype.updateExpiration=function(){var e;defined(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&(e=JulianDate.now(scratchJulianDate$1),JulianDate.lessThan(this.expireDate,e)&&(this._contentState=Cesium3DTileContentState$1.EXPIRED,this._expiredContent=this._content))},Cesium3DTile.prototype.requestContent=function(){var n=this,a=this._tileset;if(this.hasEmptyContent)return!1;var e=this._contentResource.clone(),o=this.contentExpired;o&&e.setQueryParameters({expired:this.expireDate.toString()});var t=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.TILES3D,priorityFunction:createPriorityFunction(this),serverKey:this._serverKey});this._request=t,e.request=t;e=e.fetchArrayBuffer();if(!defined(e))return!1;var i=this._contentState;this._contentState=Cesium3DTileContentState$1.LOADING,this._contentReadyToProcessPromise=when.defer(),this._contentReadyPromise=when.defer();var s=getContentFailedFunction(this,a);return e.then(function(e){if(!n.isDestroyed()){var t,i=getMagic(new Uint8Array(e)),r=Cesium3DTileContentFactory[i];return a._disableSkipLevelOfDetail=a._disableSkipLevelOfDetail||"vctr"===i||"geom"===i,defined(r)?t=r(a,n,n._contentResource,e,0):(t=Cesium3DTileContentFactory.json(a,n,n._contentResource,e,0),n.hasTilesetContent=!0),o&&(n.expireDate=void 0),n._content=t,n._contentState=Cesium3DTileContentState$1.PROCESSING,n._contentReadyToProcessPromise.resolve(t),t.readyPromise.then(function(e){n.isDestroyed()?s():(updateExpireDate(n),n._selectedFrame=0,n.lastStyleTime=0,JulianDate.now(n._loadTimestamp),n._contentState=Cesium3DTileContentState$1.READY,n._contentReadyPromise.resolve(e))})}s()}).otherwise(function(e){return t.state===RequestState$1.CANCELLED?(n._contentState=i,--a.statistics.numberOfPendingRequests,void++a.statistics.numberOfAttemptedRequests):void s(e)}),!0},Cesium3DTile.prototype.unloadContent=function(){this.hasEmptyContent||this.hasTilesetContent||(this._content=this._content&&this._content.destroy(),this._contentState=Cesium3DTileContentState$1.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.lastStyleTime=0,this.clippingPlanesDirty=0===this._clippingPlanesState,this._clippingPlanesState=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 scratchProjectedBoundingSphere=new BoundingSphere;function getBoundingVolume(e,t){var i;return t.mode===SceneMode$1.SCENE3D||defined(e._boundingVolume2D)||(i=e._boundingVolume.boundingSphere,i=BoundingSphere.projectTo2D(i,t.mapProjection,scratchProjectedBoundingSphere),e._boundingVolume2D=new TileBoundingSphere(i.center,i.radius)),t.mode!==SceneMode$1.SCENE3D?e._boundingVolume2D:e._boundingVolume}function getContentBoundingVolume(e,t){var i;return t.mode===SceneMode$1.SCENE3D||defined(e._contentBoundingVolume2D)||(i=e._contentBoundingVolume.boundingSphere,i=BoundingSphere.projectTo2D(i,t.mapProjection,scratchProjectedBoundingSphere),e._contentBoundingVolume2D=new TileBoundingSphere(i.center,i.radius)),t.mode!==SceneMode$1.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Cesium3DTile.prototype.visibility=function(e,t){var i=e.cullingVolume,r=getBoundingVolume(this,e),n=this._tileset,e=n.clippingPlanes;if(defined(e)&&e.enabled){n=e.computeIntersectionWithBoundingVolume(r,n.clippingPlanesOriginMatrix);if(this._isClipped=n!==Intersect$1.INSIDE,n===Intersect$1.OUTSIDE)return CullingVolume.MASK_OUTSIDE}return i.computeVisibilityWithPlaneMask(r,t)},Cesium3DTile.prototype.contentVisibility=function(e){if(!defined(this._contentBoundingVolume))return Intersect$1.INSIDE;if(this._visibilityPlaneMask===CullingVolume.MASK_INSIDE)return Intersect$1.INSIDE;var t=e.cullingVolume,i=getContentBoundingVolume(this,e),r=this._tileset,e=r.clippingPlanes;if(defined(e)&&e.enabled){r=e.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=r!==Intersect$1.INSIDE,r===Intersect$1.OUTSIDE)return Intersect$1.OUTSIDE}return t.computeVisibility(i)},Cesium3DTile.prototype.distanceToTile=function(e){return getBoundingVolume(this,e).distanceToCamera(e)};var scratchToTileCenter=new Cartesian3;Cesium3DTile.prototype.distanceToTileCenter=function(e){var t=getBoundingVolume(this,e).boundingVolume,t=Cartesian3.subtract(t.center,e.camera.positionWC,scratchToTileCenter);return Cartesian3.dot(e.camera.directionWC,t)},Cesium3DTile.prototype.insideViewerRequestVolume=function(e){var t=this._viewerRequestVolume;return!defined(t)||0===t.distanceToCamera(e)};var scratchMatrix$2=new Matrix3,scratchScale$2=new Cartesian3,scratchHalfAxes=new Matrix3,scratchCenter$3=new Cartesian3,scratchRectangle$5=new Rectangle,scratchOrientedBoundingBox=new OrientedBoundingBox,scratchTransform=new Matrix4;function createBox(e,t,i){var r=Cartesian3.fromElements(e[0],e[1],e[2],scratchCenter$3),e=Matrix3.fromArray(e,3,scratchHalfAxes),r=Matrix4.multiplyByPoint(t,r,r),t=Matrix4.getMatrix3(t,scratchMatrix$2),e=Matrix3.multiply(t,e,e);return defined(i)?(i.update(r,e),i):new TileOrientedBoundingBox(r,e)}function createBoxFromTransformedRegion(e,t,i,r){var n=Rectangle.unpack(e,0,scratchRectangle$5),a=e[4],e=e[5],a=OrientedBoundingBox.fromRectangle(n,a,e,Ellipsoid.WGS84,scratchOrientedBoundingBox),e=a.center,a=a.halfAxes;t=Matrix4.multiplyTransformation(t,Matrix4.inverseTransformation(i,scratchTransform),scratchTransform);e=Matrix4.multiplyByPoint(t,e,e),t=Matrix4.getMatrix3(t,scratchMatrix$2),a=Matrix3.multiply(t,a,a);return defined(r)&&r instanceof TileOrientedBoundingBox?(r.update(e,a),r):new TileOrientedBoundingBox(e,a)}function createRegion(e,t,i,r){return Matrix4.equalsEpsilon(t,i,CesiumMath.EPSILON8)?defined(r)?r:new TileBoundingRegion({rectangle:Rectangle.unpack(e,0,scratchRectangle$5),minimumHeight:e[4],maximumHeight:e[5]}):createBoxFromTransformedRegion(e,t,i,r)}function createSphere(e,t,i){var r=Cartesian3.fromElements(e[0],e[1],e[2],scratchCenter$3),e=e[3],r=Matrix4.multiplyByPoint(t,r,r),t=Matrix4.getScale(t,scratchScale$2);return e*=Cartesian3.maximumComponent(t),defined(i)?(i.update(r,e),i):new TileBoundingSphere(r,e)}function applyDebugSettings$1(e,t,i,r){var n,a,o;r.isRender&&(o=defined(e._header.content)&&defined(e._header.content.boundingVolume),n=e.hasEmptyContent||e.hasTilesetContent,(a=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o)?(r=e._finalResolution?n?Color.DARKGRAY:Color.WHITE:Color.YELLOW,defined(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(r)),e._debugBoundingVolume.update(i),(n=e._debugBoundingVolume.getGeometryInstanceAttributes("outline")).color=ColorGeometryInstanceAttribute.toValue(r,n.color)):!a&&defined(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy()),t.debugShowContentBoundingVolume&&o?(defined(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(Color.BLUE)),e._debugContentBoundingVolume.update(i)):!t.debugShowContentBoundingVolume&&defined(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&defined(e._viewerRequestVolume)?(defined(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(Color.YELLOW)),e._debugViewerRequestVolume.update(i)):!t.debugShowViewerRequestVolume&&defined(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy()),a=t.debugColorizeTiles&&!e._debugColorizeTiles||defined(t._heatmap.tilePropertyName),o=!t.debugColorizeTiles&&e._debugColorizeTiles,a?(t._heatmap.colorize(e,i),e._debugColorizeTiles=!0,e.color=e._debugColor):o&&(e._debugColorizeTiles=!1,e.color=Color.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),o&&t.makeStyleDirty())}function updateContent(e,t,i){var r=e._content,n=e._expiredContent;if(defined(n)){if(!e.contentReady)return void n.update(t,i);e._expiredContent.destroy(),e._expiredContent=void 0}r.update(t,i)}function updateClippingPlanes(e,t){var i=t.clippingPlanes,t=0;(t=defined(i)&&e._isClipped&&i.enabled?i.clippingPlanesState:t)!==e._clippingPlanesState&&(e._clippingPlanesState=t,e.clippingPlanesDirty=!0)}Cesium3DTile.prototype.createBoundingVolume=function(e,t,i){if(!defined(e))throw new RuntimeError("boundingVolume must be defined");if(defined(e.box))return createBox(e.box,t,i);if(defined(e.region))return createRegion(e.region,t,this._initialTransform,i);if(defined(e.sphere))return createSphere(e.sphere,t,i);throw new RuntimeError("boundingVolume must contain a sphere, region, or box")},Cesium3DTile.prototype.updateTransform=function(e){e=defaultValue(e,Matrix4.IDENTITY);var t=Matrix4.multiply(e,this.transform,scratchTransform);Matrix4.equals(t,this.computedTransform)||(Matrix4.clone(t,this.computedTransform),e=this._header,t=this._header.content,this._boundingVolume=this.createBoundingVolume(e.boundingVolume,this.computedTransform,this._boundingVolume),defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(e.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())},Cesium3DTile.prototype.updateGeometricErrorScale=function(){var e=Matrix4.getScale(this.computedTransform,scratchScale$2),e=Cartesian3.maximumComponent(e);this.geometricError=this._geometricError*e},Cesium3DTile.prototype.update=function(e,t,i){var r=t.commandList.length;updateClippingPlanes(this,e),applyDebugSettings$1(this,e,t,i),updateContent(this,e,t),this._commandsLength=t.commandList.length-r,this.clippingPlanesDirty=!1};var scratchCommandList$1=[];function isolateDigits(e,t,i){t=e*Math.pow(10,t);return parseInt(t)*Math.pow(10,i)}function priorityNormalizeAndClamp(e,t,i){return Math.max(CesiumMath.normalize(e,t,i)-CesiumMath.EPSILON7,0)}Cesium3DTile.prototype.process=function(e,t){var i=t.commandList;t.commandList=scratchCommandList$1,this._content.update(e,t),scratchCommandList$1.length=0,t.commandList=i},Cesium3DTile.prototype.updatePriority=function(){var e=this.tileset,t=e.preferLeaves,i=e._minimumPriority,r=e._maximumPriority,n=Math.pow(10,8),a=Math.pow(10,9),o=Math.pow(10,10),s=priorityNormalizeAndClamp(this._depth,i.depth,r.depth),s=t?1-s:s,t=isolateDigits(!e._skipLevelOfDetail&&this.refine===Cesium3DTileRefine$1.REPLACE?priorityNormalizeAndClamp(this._priorityHolder._distanceToCamera,i.distance,r.distance):priorityNormalizeAndClamp(this._priorityReverseScreenSpaceError,i.reverseScreenSpaceError,r.reverseScreenSpaceError),4,0),n=this._priorityProgressiveResolution?0:n,r=isolateDigits(priorityNormalizeAndClamp(this._priorityHolder._foveatedFactor,i.foveatedFactor,r.foveatedFactor),4,4),a=this.priorityDeferred?a:0,o=e._pass===Cesium3DTilePass$1.PRELOAD_FLIGHT?0:o;this._priority=s+t+n+r+a+o},Cesium3DTile.prototype.isDestroyed=function(){return!1},Cesium3DTile.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(),destroyObject(this)};var Cesium3DTileOptimizations={},scratchAxis$1=new Cartesian3;function Cesium3DTilesetCache(){this._list=new DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}function Cesium3DTilesetHeatmap(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 getHeatmapValue(e,t){e="_loadTimestamp"===t?JulianDate.toDate(e).getTime():e;return e}function getHeatmapValueAndUpdateMinimumMaximum(e,t){var i=e.tilePropertyName;if(defined(i)){i=getHeatmapValue(t[i],i);return defined(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}Cesium3DTileOptimizations.checkChildrenWithinParent=function(e){var t=e.children,i=t.length,r=e.boundingVolume;if(r instanceof TileOrientedBoundingBox||r instanceof TileBoundingRegion){var n=r._orientedBoundingBox;e._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.USE_OPTIMIZATION;for(var a=0;an||i);){var s=o.item,o=o.next;this.unloadTile(e,s,t)}},Cesium3DTilesetCache.prototype.trim=function(){this._trimTiles=!0},Cesium3DTilesetHeatmap.prototype.setReferenceMinimumMaximum=function(e,t,i){this._referenceMinimum[i]=getHeatmapValue(e,i),this._referenceMaximum[i]=getHeatmapValue(t,i)};var heatmapColors=[new Color(.1,.1,.1,1),new Color(.153,.278,.878,1),new Color(.827,.231,.49,1),new Color(.827,.188,.22,1),new Color(1,.592,.259,1),new Color(1,.843,0,1)];function Cesium3DTilesetStatistics(){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.batchTableByteLength=0}function updatePointAndFeatureCounts(e,t,i,r){var n=t.innerContents,a=t.pointsLength,o=t.trianglesLength,s=t.featuresLength,l=t.geometryByteLength,c=t.texturesByteLength,t=t.batchTableByteLength;if(r?(e.numberOfFeaturesLoaded+=i?-s:s,e.numberOfPointsLoaded+=i?-a:a,e.geometryByteLength+=i?-l:l,e.texturesByteLength+=i?-c:c,e.batchTableByteLength+=i?-t:t):(e.numberOfFeaturesSelected+=i?-s:s,e.numberOfPointsSelected+=i?-a:a,e.numberOfTrianglesSelected+=i?-o:o),defined(n))for(var u=n.length,d=0;dApproximateTerrainHeights._defaultMinTerrainHeight&&(l._initialClippingPlanesOriginMatrix=Transforms.eastNorthUpToFixedFrame(i)),l._clippingPlanesOriginMatrix=Matrix4.clone(l._initialClippingPlanesOriginMatrix),l._readyPromise.resolve(l)}).otherwise(function(e){l._readyPromise.reject(e)})}Cesium3DTilesetHeatmap.prototype.colorize=function(e,t){var i,r,n;defined(this.tilePropertyName)&&e.contentAvailable&&e._selectedFrame===t.frameNumber&&(r=getHeatmapValueAndUpdateMinimumMaximum(this,e),n=this._previousMinimum,i=this._previousMaximum,n!==Number.MAX_VALUE&&i!==-Number.MAX_VALUE&&(t=i-n+CesiumMath.EPSILON7,i=CesiumMath.clamp(r-n,0,t)/t*(heatmapColors.length-1),r=Math.floor(i),n=Math.ceil(i),t=i-r,i=heatmapColors[r],r=heatmapColors[n],(n=Color.clone(Color.WHITE)).red=CesiumMath.lerp(i.red,r.red,t),n.green=CesiumMath.lerp(i.green,r.green,t),n.blue=CesiumMath.lerp(i.blue,r.blue,t),e._debugColor=n))},Cesium3DTilesetHeatmap.prototype.resetMinimumMaximum=function(){var e,t,i=this.tilePropertyName;defined(i)&&(e=this._referenceMinimum[i],t=this._referenceMaximum[i],i=defined(e)&&defined(t),this._previousMinimum=i?e:this._minimum,this._previousMaximum=i?t:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE)},Cesium3DTilesetStatistics.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},Cesium3DTilesetStatistics.prototype.incrementSelectionCounts=function(e){updatePointAndFeatureCounts(this,e,!1,!1)},Cesium3DTilesetStatistics.prototype.incrementLoadCounts=function(e){updatePointAndFeatureCounts(this,e,!1,!0)},Cesium3DTilesetStatistics.prototype.decrementLoadCounts=function(e){updatePointAndFeatureCounts(this,e,!0,!0)},Cesium3DTilesetStatistics.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.batchTableByteLength=e.batchTableByteLength},Object.defineProperties(Cesium3DTileStyleEngine.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}}),Cesium3DTileStyleEngine.prototype.makeDirty=function(){this._styleDirty=!0},Cesium3DTileStyleEngine.prototype.resetDirty=function(){this._styleDirty=!1},Cesium3DTileStyleEngine.prototype.applyStyle=function(e){if(e.ready&&(!defined(this._style)||this._style.ready)){var t=this._styleDirty;t&&++this._lastStyleTime;for(var i=this._lastStyleTime,r=e._statistics,n=t?e._selectedTiles:e._selectedTilesToStyle,a=n.length,o=0;or.minimumRadius?(s=Cartographic.fromCartesian(t,r,scratchCartographic$8),p=Cartesian3.normalize(c.positionWC,scratchPositionNormal$2),n=c.directionWC,a=c.positionCartographic.height,h=0,o=2*s.height):(s=Matrix4.multiplyByPoint(i,c.positionWC,scratchPosition$2),p=Cartesian3.UNIT_Z,n=Matrix4.multiplyByPointAsVector(i,c.directionWC,scratchDirection$1),n=Cartesian3.normalize(n,n),a=s.z,d instanceof TileOrientedBoundingBox?(u=u._header.boundingVolume.box[11],h=t.z-u,o=t.z+u):d instanceof TileBoundingSphere&&(l=l.radius,h=t.z-l,o=t.z+l)));var h=h+(o-h)*e.dynamicScreenSpaceErrorHeightFalloff,h=CesiumMath.clamp((a-h)/(o-h),0,1),p=1-Math.abs(Cartesian3.dot(n,p));p*=1-h;h=e.dynamicScreenSpaceErrorDensity;h*=p,e._dynamicScreenSpaceErrorComputedDensity=h}function requestContent(e,t){var i,r;t.hasEmptyContent||(i=e._statistics,r=t.contentExpired,t.requestContent()?(r&&(t.hasTilesetContent?destroySubtree(e,t):(i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady)),++i.numberOfPendingRequests,e._requestedTilesInFlight.push(t),t.contentReadyToProcessPromise.then(addToProcessingQueue(e,t)),t.contentReadyPromise.then(handleTileSuccess(e,t)).otherwise(handleTileFailure(e,t))):++i.numberOfAttemptedRequests)}function sortRequestByPriority(e,t){return e._priority-t._priority}function cancelOutOfViewRequests(e,t){for(var i=e._requestedTilesInFlight,r=0,n=i.length,a=0;au&&swapItem(e,t,r,n);du;)h--}t[2*r+a]===u?swapItem(e,t,r,h):swapItem(e,t,++h,n),h<=i&&(r=h+1),i<=h&&(n=h-1)}}function swapItem(e,t,i,r){swap$1(e,i,r),swap$1(t,2*i,2*r),swap$1(t,2*i+1,2*r+1)}function swap$1(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function within(e,t,i,r,n,a){for(var o=[0,e.length-1,0],s=[],l=n*n;o.length;){var c=o.pop(),u=o.pop(),d=o.pop();if(u-d<=a)for(var h=d;h<=u;h++)sqDist(t[2*h],t[2*h+1],i,r)<=l&&s.push(e[h]);else{var p=Math.floor((d+u)/2),m=t[2*p],f=t[2*p+1];sqDist(m,f,i,r)<=l&&s.push(e[p]);var g=(c+1)%2;(0===c?i-n<=m:r-n<=f)&&(o.push(d),o.push(p-1),o.push(g)),(0===c?m<=i+n:f<=r+n)&&(o.push(p+1),o.push(u),o.push(g))}}return s}function sqDist(e,t,i,r){i=e-i,r=t-r;return i*i+r*r}function EntityCluster(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._enabled=defaultValue(e.enabled,!1),this._pixelRange=defaultValue(e.pixelRange,80),this._minimumClusterSize=defaultValue(e.minimumClusterSize,2),this._clusterBillboards=defaultValue(e.clusterBillboards,!0),this._clusterLabels=defaultValue(e.clusterLabels,!0),this._clusterPoints=defaultValue(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 Event,this.show=defaultValue(e.show,!0)}function getX(e){return e.coord.x}function getY(e){return e.coord.y}function expandBoundingBox(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}PointPrimitiveCollection.prototype.update=function(e){if(removePointPrimitives(this),this.show){this._maxTotalPointSize=ContextLimits.maximumAliasedPointSize,updateMode(this,e);var t=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,n=this._propertiesChanged,a=this._createVertexArray,o=e.context,s=e.passes,l=s.pick;if(a||!l&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var c=0;cs)return;if(this._backwardExtrapolationType===ExtrapolationType$1.HOLD)return n.unpack(a,0,t)}if(r<=l){var l,c=i[l=r-1];if(s=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ExtrapolationType$1.NONE||0!==s&&JulianDate.secondsDifference(e,c)>s)return;if(this._forwardExtrapolationType===ExtrapolationType$1.HOLD)return l=r-1,n.unpack(a,l*n.packedLength,t)}var u=this._xTable,d=this._yTable,h=this._interpolationAlgorithm,o=this._packedInterpolationLength,c=this._inputOrder;this._updateTableLength&&(this._updateTableLength=!1,(p=Math.min(h.getRequiredDataPoints(this._interpolationDegree,c),r))!==this._numberOfPoints&&(this._numberOfPoints=p,u.length=p,d.length=p*o));s=this._numberOfPoints-1;if(s<1)return;var p,m=0,f=r-1;1+s<=f-m+1&&(m=p=f<(r=(p=(p=l-(s/2|0)-1). version format.");i=t._documentPacket;defined(e.name)&&(i.name=e.name);t=e.clock;defined(t)&&(defined(e=i.clock)?(e.interval=defaultValue(t.interval,e.interval),e.currentTime=defaultValue(t.currentTime,e.currentTime),e.range=defaultValue(t.range,e.range),e.step=defaultValue(t.step,e.step),e.multiplier=defaultValue(t.multiplier,e.multiplier)):i.clock={interval:t.interval,currentTime:t.currentTime,range:t.range,step:t.step,multiplier:t.multiplier})}function processEllipse(e,t,i,r){var n,a=t.ellipse;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.ellipse)||(e.ellipse=t=new EllipseGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Number,t,"semiMajorAxis",a.semiMajorAxis,n,r,i),processPacketData(Number,t,"semiMinorAxis",a.semiMinorAxis,n,r,i),processPacketData(Number,t,"height",a.height,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Number,t,"extrudedHeight",a.extrudedHeight,n,r,i),processPacketData(HeightReference$1,t,"extrudedHeightReference",a.extrudedHeightReference,n,r,i),processPacketData(Rotation,t,"rotation",a.rotation,n,r,i),processPacketData(Rotation,t,"stRotation",a.stRotation,n,r,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Number,t,"numberOfVerticalLines",a.numberOfVerticalLines,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(ClassificationType$1,t,"classificationType",a.classificationType,n,r,i),processPacketData(Number,t,"zIndex",a.zIndex,n,r,i))}function processEllipsoid(e,t,i,r){var n,a=t.ellipsoid;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.ellipsoid)||(e.ellipsoid=t=new EllipsoidGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Cartesian3,t,"radii",a.radii,n,r,i),processPacketData(Cartesian3,t,"innerRadii",a.innerRadii,n,r,i),processPacketData(Number,t,"minimumClock",a.minimumClock,n,r,i),processPacketData(Number,t,"maximumClock",a.maximumClock,n,r,i),processPacketData(Number,t,"minimumCone",a.minimumCone,n,r,i),processPacketData(Number,t,"maximumCone",a.maximumCone,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Number,t,"stackPartitions",a.stackPartitions,n,r,i),processPacketData(Number,t,"slicePartitions",a.slicePartitions,n,r,i),processPacketData(Number,t,"subdivisions",a.subdivisions,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i))}function processLabel(e,t,i,r){var n,a=t.label;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.label)||(e.label=t=new LabelGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(String,t,"text",a.text,n,r,i),processPacketData(String,t,"font",a.font,n,r,i),processPacketData(LabelStyle$1,t,"style",a.style,n,r,i),processPacketData(Number,t,"scale",a.scale,n,r,i),processPacketData(Boolean,t,"showBackground",a.showBackground,n,r,i),processPacketData(Color,t,"backgroundColor",a.backgroundColor,n,r,i),processPacketData(Cartesian2,t,"backgroundPadding",a.backgroundPadding,n,r,i),processPacketData(Cartesian2,t,"pixelOffset",a.pixelOffset,n,r,i),processPacketData(Cartesian3,t,"eyeOffset",a.eyeOffset,n,r,i),processPacketData(HorizontalOrigin$1,t,"horizontalOrigin",a.horizontalOrigin,n,r,i),processPacketData(VerticalOrigin$1,t,"verticalOrigin",a.verticalOrigin,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Color,t,"fillColor",a.fillColor,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(NearFarScalar,t,"translucencyByDistance",a.translucencyByDistance,n,r,i),processPacketData(NearFarScalar,t,"pixelOffsetScaleByDistance",a.pixelOffsetScaleByDistance,n,r,i),processPacketData(NearFarScalar,t,"scaleByDistance",a.scaleByDistance,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(Number,t,"disableDepthTestDistance",a.disableDepthTestDistance,n,r,i))}function processModel(e,t,i,r){t=t.model;if(defined(t)){var n,a,o=intervalFromString(t.interval),s=e.model;defined(s)||(e.model=s=new ModelGraphics),processPacketData(Boolean,s,"show",t.show,o,r,i),processPacketData(URI,s,"uri",t.gltf,o,r,i),processPacketData(Number,s,"scale",t.scale,o,r,i),processPacketData(Number,s,"minimumPixelSize",t.minimumPixelSize,o,r,i),processPacketData(Number,s,"maximumScale",t.maximumScale,o,r,i),processPacketData(Boolean,s,"incrementallyLoadTextures",t.incrementallyLoadTextures,o,r,i),processPacketData(Boolean,s,"runAnimations",t.runAnimations,o,r,i),processPacketData(Boolean,s,"clampAnimations",t.clampAnimations,o,r,i),processPacketData(ShadowMode$1,s,"shadows",t.shadows,o,r,i),processPacketData(HeightReference$1,s,"heightReference",t.heightReference,o,r,i),processPacketData(Color,s,"silhouetteColor",t.silhouetteColor,o,r,i),processPacketData(Number,s,"silhouetteSize",t.silhouetteSize,o,r,i),processPacketData(Color,s,"color",t.color,o,r,i),processPacketData(ColorBlendMode$1,s,"colorBlendMode",t.colorBlendMode,o,r,i),processPacketData(Number,s,"colorBlendAmount",t.colorBlendAmount,o,r,i),processPacketData(DistanceDisplayCondition,s,"distanceDisplayCondition",t.distanceDisplayCondition,o,r,i);var l=t.nodeTransformations;if(defined(l))if(Array.isArray(l))for(n=0,a=l.length;nnorthUpAxisFactor*o.maximumRadius?(c=updateTransformCartesian3Scratch2,Cartesian3.normalize(v,c),Cartesian3.negate(c,c),d=Cartesian3.clone(Cartesian3.UNIT_Z,updateTransformCartesian3Scratch3),u=Cartesian3.cross(d,c,updateTransformCartesian3Scratch1),Cartesian3.magnitude(u)>CesiumMath.EPSILON7&&(Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),d=Cartesian3.cross(c,u,updateTransformCartesian3Scratch3),Cartesian3.normalize(d,d),s=!0)):Cartesian3.equalsEpsilon(v,h,CesiumMath.EPSILON7)||(d=updateTransformCartesian3Scratch2,Cartesian3.normalize(n,d),Cartesian3.normalize(a,a),u=Cartesian3.cross(d,a,updateTransformCartesian3Scratch3),l&&(u=Cartesian3.multiplyByScalar(u,-1,u)),Cartesian3.equalsEpsilon(u,Cartesian3.ZERO,CesiumMath.EPSILON7)||(c=Cartesian3.cross(u,d,updateTransformCartesian3Scratch1),Matrix3.multiplyByVector(y,c,c),Matrix3.multiplyByVector(y,u,u),Matrix3.multiplyByVector(y,d,d),Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),Cartesian3.normalize(d,d),s=!0)))),defined(e.boundingSphere)&&(v=e.boundingSphere.center),r&&(f=Cartesian3.clone(t.position,updateTransformCartesian3Scratch4),g=Cartesian3.clone(t.direction,updateTransformCartesian3Scratch5),_=Cartesian3.clone(t.up,updateTransformCartesian3Scratch6)),y=updateTransformMatrix4Scratch,s?(y[0]=c.x,y[1]=c.y,y[2]=c.z,y[3]=0,y[4]=u.x,y[5]=u.y,y[6]=u.z,y[7]=0,y[8]=d.x,y[9]=d.y,y[10]=d.z,y[11]=0,y[12]=v.x,y[13]=v.y,y[14]=v.z,y[15]=0):Transforms.eastNorthUpToFixedFrame(v,o,y),t._setTransform(y),r&&(Cartesian3.clone(f,t.position),Cartesian3.clone(g,t.direction),Cartesian3.clone(_,t.up),Cartesian3.cross(g,_,t.right))),i&&(e=C===SceneMode$1.SCENE2D||Cartesian3.equals(e._offset3D,Cartesian3.ZERO)?void 0:e._offset3D,t.lookAtTransform(t.transform,e))}function EntityView(e,t,i){this.entity=e,this.scene=t,this.ellipsoid=defaultValue(i,Ellipsoid.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new Cartesian3,this._defaultOffset3D=void 0,this._offset3D=new Cartesian3}Object.defineProperties(EntityView,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=Cartesian3.clone(e,new Cartesian3)}}}),EntityView.defaultOffset3D=new Cartesian3(-14e3,3500,3500);var scratchHeadingPitchRange=new HeadingPitchRange,scratchCartesian$2=new Cartesian3;EntityView.prototype.update=function(e,t){var i,r,n,a,o,s,l,c,u=this.scene,d=this.ellipsoid,h=u.mode;h===SceneMode$1.MORPHING||defined(r=(i=this.entity).position)&&(c=i!==this._lastEntity,n=h!==this._mode,a=u.camera,o=c||n,s=!0,c?!(u=defined(l=i.viewFrom))&&defined(t)?(scratchHeadingPitchRange.pitch=-CesiumMath.PI_OVER_FOUR,scratchHeadingPitchRange.range=0,defined(c=r.getValue(e,scratchCartesian$2))&&(c=2-1/Math.max(1,Cartesian3.magnitude(c)/d.maximumRadius),scratchHeadingPitchRange.pitch*=c),a.viewBoundingSphere(t,scratchHeadingPitchRange),this.boundingSphere=t,s=o=!1):u&&defined(l.getValue(e,this._offset3D))||Cartesian3.clone(EntityView._defaultOffset3D,this._offset3D):n||this._mode===SceneMode$1.SCENE2D||Cartesian3.clone(a.position,this._offset3D),this._lastEntity=i,this._mode=h,updateTransform(this,a,o,s,r,e,d))};var tmp$4={},bIg,cIg;bIg=tmp$4,cIg=function(e){function t(e){return e}function m(e){var t,n=h(e.transform),a=1/0,o=a,s=-a,l=-a;function i(e){(e=n(e))[0]s&&(s=e[0]),e[1]l&&(l=e[1])}function r(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(r);break;case"Point":i(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(i)}}for(t in e.arcs.forEach(function(e){for(var t,i=-1,r=e.length;++is&&(s=t[0]),t[1]l&&(l=t[1])}),e.objects)r(e.objects[t]);return[a,o,s,l]}function a(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return i(t,e)})}:i(t,e)}var h=function(e){if(null==e)return t;var a,o,s=e.scale[0],l=e.scale[1],c=e.translate[0],u=e.translate[1];return function(e,t){t||(a=o=0);var i=2,r=e.length,n=new Array(r);for(n[0]=(a+=e[0])*s+c,n[1]=(o+=e[1])*l+u;io&&(n=i[0],i[0]=i[a],i[a]=n,o=r);return i})}}function g(e,t){for(var i=0,r=e.length;i>>1;e[n]=n)throw new Error("full hashset");i=l[t=t+1&c]}return l[t]=e,!0},has:function(e){for(var t=a(e)&c,i=l[t],r=0;i!=s;){if(o(i,e))return!0;if(++r>=n)break;i=l[t=t+1&c]}return!1},values:function(){for(var e=[],t=0,i=l.length;t=a)throw new Error("full hashmap");r=c[i=i+1&d]}return c[i]=e,u[i]=t},maybeSet:function(e,t){for(var i=o(e)&d,r=c[i],n=0;r!=l;){if(s(r,e))return u[i];if(++n>=a)throw new Error("full hashmap");r=c[i=i+1&d]}return c[i]=e,u[i]=t},get:function(e,t){for(var i=o(e)&d,r=c[i],n=0;r!=l;){if(s(r,e))return u[i];if(++n>=a)break;r=c[i=i+1&d]}return t},keys:function(){for(var e=[],t=0,i=c.length;t>7^l[2]^l[3])}function v(e){for(var n=e.coordinates,t=e.lines,i=e.rings,r=function(){for(var e=P(1.4*n.length,S,T,Int32Array,-1,Int32Array),t=new Int32Array(n.length),i=0,r=n.length;i>1);t=r}}function F(e,t){return e[1][2]-t[1][2]}function N(e){return[e[0],e[1],0]}function B(e,t){return t-e}var s=Math.PI,V=2*s,k=s/4,z=s/180,$=Math.abs,U=Math.atan2,G=Math.cos,H=Math.sin;function W(e,t){for(var i=0,r=e.length,n=0,a=(c=e[t?i++:r-1])[0]*z,o=c[1]*z/2+k,s=G(o),l=H(o);i>1)-1,r=o[i];if(0<=F(e,r))break;o[r._=t]=r,o[e._=t=i]=e}}function n(e,t){for(;;){var i=t+1<<1,r=i-1,n=t,a=o[n];if(r=o&&(a[r++]=[t[0],t[1]]);return a.length=r,a});return{type:"Topology",transform:e.transform,bbox:e.bbox,objects:e.objects,arcs:t}},e.sphericalRingArea=function(e,t){return e=W(e,!0),t&&(e*=-1),2*(e<0?V+e:e)},e.sphericalTriangleArea=function(e){return 2*$(W(e,!1))},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?cIg(exports):cIg(bIg.topojson=bIg.topojson||{});var topojson=tmp$4.topojson;function defaultCrsFunction(e){return Cartesian3.fromDegrees(e[0],e[1],e[2])}var crsNames={"urn:ogc:def:crs:OGC:1.3:CRS84":defaultCrsFunction,"EPSG:4326":defaultCrsFunction,"urn:ogc:def:crs:EPSG::4326":defaultCrsFunction},crsLinkHrefs={},crsLinkTypes={},defaultMarkerSize=48,defaultMarkerSymbol,defaultMarkerColor=Color.ROYALBLUE,defaultStroke=Color.YELLOW,defaultStrokeWidth=2,defaultFill=Color.fromBytes(255,255,0,100),defaultClampToGround=!1,sizes={small:24,medium:48,large:64},simpleStyleIdentifiers=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function defaultDescribe(e,t){var i,r,n="";for(i in e)!e.hasOwnProperty(i)||i===t||-1!==simpleStyleIdentifiers.indexOf(i)||defined(r=e[i])&&(n+="object"==typeof r?""+i+""+defaultDescribe(r)+"":""+i+""+r+"");return n=0'+n+"":n}function createDescriptionCallback(i,r,n){var a;return function(e,t){return a=!defined(a)?i(r,n):a}}function defaultDescribeProperty(e,t){return new CallbackProperty(createDescriptionCallback(defaultDescribe,e,t),!0)}function createObject(e,t,i){var r=e.id;if(defined(r)&&"Feature"===e.type){for(var n=2,a=r;defined(t.getById(a));)a=r+"_"+n,n++;r=a}else r=createGuid();var o=t.getOrCreateEntity(r),s=e.properties;if(defined(s)){var l,e=(o.properties=s).title;if(defined(e))o.name=e,l="title";else{var c,u=Number.MAX_VALUE;for(c in s)if(s.hasOwnProperty(c)&&s[c]){var d=c.toLowerCase();if(1t&&(r=null==i?(i="…",3):i.length,e=e.substring(0,t-r)+i),e}function W$g(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i",this.getInnerHtml(),""].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e,t=this.getAttrs(),i=[];for(e in t)t.hasOwnProperty(e)&&i.push(e+'="'+t[e]+'"');return i.join(" ")},e}(),c_g=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new $$g({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},i=this.createCssClass(e);return i&&(t.class=i),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length=o)return(s.host.length==t?s.host.substr(0,t-c)+n:a(e,o)).substr(0,o+i);var c="";s.path&&(c+="/"+s.path);s.query&&(c+="?"+s.query);if(c){if(o<=(e+c).length){if((e+c).length==t)return(e+c).substr(0,t);var u=o-e.length;return(e+a(c,u)).substr(0,o+i)}e+=c}if(s.fragment){u="#"+s.fragment;if(o<=(e+u).length){if((e+u).length==t)return(e+u).substr(0,t);c=o-e.length;return(e+a(u,c)).substr(0,o+i)}e+=u}if(s.scheme&&s.host){s=s.scheme+"://";if((e+s).length"!==e&&n_g.test(e)?u=3:m()}(p);break;case 3:!function(e){p_g.test(e)?(h=new N_g(g_g({},h,{name:_()})),u=4):"<"===e?f():"/"===e?(h=new N_g(g_g({},h,{name:_()})),u=12):">"===e?(h=new N_g(g_g({},h,{name:_()})),g()):n_g.test(e)||o_g.test(e)||":"===e||m()}(p);break;case 4:!function(e){p_g.test(e)||("/"===e?u=12:">"===e?g():"<"===e?f():"="===e||q_g.test(e)||r_g.test(e)?m():u=5)}(p);break;case 5:!function(e){p_g.test(e)?u=6:"/"===e?u=12:"="===e?u=7:">"===e?g():"<"===e?f():q_g.test(e)&&m()}(p);break;case 6:!function(e){p_g.test(e)||("/"===e?u=12:"="===e?u=7:">"===e?g():"<"===e?f():q_g.test(e)?m():u=5)}(p);break;case 7:!function(e){p_g.test(e)||('"'===e?u=8:"'"===e?u=9:/[>=`]/.test(e)?m():"<"===e?f():u=10)}(p);break;case 8:!function(e){'"'===e&&(u=11)}(p);break;case 9:!function(e){"'"===e&&(u=11)}(p);break;case 10:!function(e){p_g.test(e)?u=4:">"===e?g():"<"===e&&f()}(p);break;case 11:!function(e){p_g.test(e)?u=4:"/"===e?u=12:">"===e?g():"<"===e?f():(u=4,l--)}(p);break;case 12:!function(e){">"===e?(h=new N_g(g_g({},h,{isClosing:!0})),g()):u=4}(p);break;case 13:"--"===t.substr(l,2)?(l+=2,h=new N_g(g_g({},h,{type:"comment"})),u=14):"DOCTYPE"===t.substr(l,7).toUpperCase()?(l+=7,h=new N_g(g_g({},h,{type:"doctype"})),u=20):m();break;case 14:!function(e){"-"===e?u=15:">"===e?m():u=16}(p);break;case 15:!function(e){"-"===e?u=18:">"===e?m():u=16}(p);break;case 16:!function(e){"-"===e&&(u=17)}(p);break;case 17:!function(e){u="-"===e?18:16}(p);break;case 18:!function(e){">"===e?g():"!"===e?u=19:"-"===e||(u=16)}(p);break;case 19:!function(e){"-"===e?u=17:">"===e?g():u=16}(p);break;case 20:!function(e){">"===e?g():"<"===e&&f()}(p);break;default:Z$g(u)}l++}dn?t:t+1,e.splice(n,1)))}return e},i.prototype.removeUnwantedMatches=function(e){return this.hashtag||X$g(e,function(e){return"hashtag"===e.getType()}),this.email||X$g(e,function(e){return"email"===e.getType()}),this.phone||X$g(e,function(e){return"phone"===e.getType()}),this.mention||X$g(e,function(e){return"mention"===e.getType()}),this.urls.schemeMatches||X$g(e,function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()}),this.urls.wwwMatches||X$g(e,function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()}),this.urls.tldMatches||X$g(e,function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()}),e},i.prototype.parseText=function(e,t){t=(t=void 0===t?0:t)||0;for(var i=this.getMatchers(),r=[],n=0,a=i.length;n>>8^t[255&(r^e[i])]},n.get=function(){return~r}}function P(e,t){var i=new ArrayBuffer(e),e=new Uint8Array(i);return t&&e.set(t,0),{buffer:i,array:e,view:new DataView(i)}}function i(){}function r(r){var n,a=this;a.size=0,a.init=function(e,t){var i=new Blob([r],{type:l});(n=new u(i)).init(function(){a.size=n.size,e()},t)},a.readUint8Array=function(e,t,i,r){n.readUint8Array(e,t,i,r)}}function c(c){var u,i=this;i.size=0,i.init=function(e){for(var t=c.length;"="==c.charAt(t-1);)t--;u=c.indexOf(",")+1,i.size=Math.floor(.75*(t-u)),e()},i.readUint8Array=function(e,t,i){for(var r=P(t),n=4*Math.floor(e/3),a=4*Math.ceil((e+t)/3),o=window.atob(c.substring(n+u,a+u)),s=e-3*Math.floor(n/4),l=s;l>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(e){}}(e.lastModDateRaw),1!=(1&e.bitFlag)?(!r&&8==(8&e.bitFlag)||(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295!==e.compressedSize&&4294967295!==e.uncompressedSize?(e.filenameLength=t.view.getUint16(i+22,!0),e.extraFieldLength=t.view.getUint16(i+24,!0)):n(s)):n(o)}function v(T,c){function u(){}return u.prototype.getData=function(m,r,f,g){var _,y=this;function n(e,t){_&&_.terminate(),_=null,e&&e(t)}function C(e,t){var i;g&&(i=t,(t=P(4)).view.setUint32(0,i),y.crc32!=t.view.getUint32(0))?v():m.getData(function(e){n(r,e)})}function v(){n(c,t)}function S(){n(c,"Error while writing file data.")}T.readUint8Array(y.offset,30,function(e){var p,e=P(e.length,e);1347093252==e.view.getUint32(0)?(M(y,e,4,!1,c),p=y.offset+30+y.filenameLength+y.extraFieldLength,m.init(function(){function e(e,t){o&&!e&&h.append(t)}function t(e){s(e,h.get())}var i,r,n,a,o,s,l,c,u,d,h;0===y.compressionMethod?D(T,m,p,y.compressedSize,g,C,f,v,S):(i=T,r=m,n=p,a=y.compressedSize,o=g,s=C,l=f,c=v,u=S,h=new E,x.zip.useWebWorkers?A(d=new Worker(x.zip.workerScriptsPath+b),i,r,n,a,e,l,t,c,u):w(new x.zip.Inflater,i,r,n,a,e,l,t,c,u),_=d)},S)):c(d)},v)},{getEntries:function(l){T.size<22?c(d):function t(i,r){T.readUint8Array(T.size-i,i,function(e){1347093766!=(e=P(e.length,e).view).getUint32(0)?t(i+1,r):r(e)},function(){c(n)})}(22,function(e){var t=e.getUint32(16,!0),s=e.getUint16(8,!0);T.readUint8Array(t,T.size-t,function(e){for(var t,i,r=0,n=[],a=P(e.length,e),o=0;o>>1^3988292384:t>>>=1;i[r]=t}return i}(),(r.prototype=new i).constructor=r,(c.prototype=new i).constructor=c,(u.prototype=new i).constructor=u,h.prototype.getData=function(e){e(this.data)},(p.prototype=new h).constructor=p,(m.prototype=new h).constructor=m,(f.prototype=new h).constructor=f,x.zip={Reader:i,Writer:h,BlobReader:u,Data64URIReader:c,TextReader:r,BlobWriter:f,Data64URIWriter:m,TextWriter:p,createReader:function(e,t,i){e.init(function(){t(v(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(O(e,i,r))},i)},useWebWorkers:!0},Object.defineProperties(x.zip,{workerScriptsPath:{get:function(){return e=void 0===e?buildModuleUrl("ThirdParty/Workers/"):e}}})}(tmp$2);var zip=tmp$2.zip;function KmlLookAt(e,t){this.position=e,this.headingPitchRange=t}function KmlTour(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new Event,this.tourEnd=new Event,this.entryStart=new Event,this.entryEnd=new Event,this._activeEntries=[]}function cancelAllEntries(e){for(var t=e.pop();void 0!==t;t=e.pop())t.stop()}function playEntry(e,t,i){var r,n,a=this.playlist[this.playlistIndex];a?(r=playNext.bind(this,e,t,i),this._activeEntries.push(a),this.entryStart.raiseEvent(a),a.blocking?a.play(r,e.scene.camera,t):(n=this,a.play(function(){n.entryEnd.raiseEvent(a);var e=n._activeEntries.indexOf(a);0<=e&&n._activeEntries.splice(e,1)}),r(e,t,i))):defined(i)&&i(!1)}function playNext(e,t,i,r){var n=this.playlist[this.playlistIndex];this.entryEnd.raiseEvent(n,r),r?i(r):(0<=(n=this._activeEntries.indexOf(n))&&this._activeEntries.splice(n,1),this.playlistIndex++,playEntry.call(this,e,t,i))}function KmlTourFlyTo(e,t,i){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=i,this.flyToMode=t}function KmlTourWait(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}KmlTour.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},KmlTour.prototype.play=function(e,t){this.tourStart.raiseEvent();var i=this;playEntry.call(this,e,t,function(e){i.playlistIndex=0,e||cancelAllEntries(i._activeEntries),i.tourEnd.raiseEvent(e)})},KmlTour.prototype.stop=function(){cancelAllEntries(this._activeEntries)},KmlTourFlyTo.prototype.play=function(t,e,i){var r;this.activeCamera=e,defined(t)&&null!==t&&((r=this).activeCallback=function(e){delete r.activeCallback,delete r.activeCamera,t(!defined(e)&&e)});var n=this.getCameraOptions(i);this.view.headingPitchRoll?e.flyTo(n):this.view.headingPitchRange&&(i=new BoundingSphere(this.view.position),e.flyToBoundingSphere(i,n))},KmlTourFlyTo.prototype.stop=function(){defined(this.activeCamera)&&this.activeCamera.cancelFlight(),defined(this.activeCallback)&&this.activeCallback(!0)},KmlTourFlyTo.prototype.getCameraOptions=function(e){var t={duration:this.duration};return defined(this.activeCallback)&&(t.complete=this.activeCallback),"smooth"===this.flyToMode&&(t.easingFunction=EasingFunction$1.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),t=defined(e)?combine$2(t,e):t},KmlTourWait.prototype.play=function(e){var t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},1e3*this.duration)},KmlTourWait.prototype.stop=function(){clearTimeout(this.timeout),defined(this.activeCallback)&&this.activeCallback(!0)};var MimeTypes={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){e=getExtensionFromUri(e=e.toLowerCase());return MimeTypes[e]}},parser;"undefined"!=typeof DOMParser&&(parser=new DOMParser);var autolinker=new Autolinker({stripPrefix:!1,email:!1,replaceFn:function(e){if(!e.protocolUrlMatch)return!1}}),BILLBOARD_SIZE$1=32,BILLBOARD_NEAR_DISTANCE=2414016,BILLBOARD_NEAR_RATIO=1,BILLBOARD_FAR_DISTANCE=16093e3,BILLBOARD_FAR_RATIO=.1,kmlNamespaces=[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"],gxNamespaces=["http://www.google.com/kml/ext/2.2"],atomNamespaces=["http://www.w3.org/2005/Atom"],namespaces={kml:kmlNamespaces,gx:gxNamespaces,atom:atomNamespaces,kmlgx:kmlNamespaces.concat(gxNamespaces)},featureTypes={Document:processDocument,Folder:processFolder,Placemark:processPlacemark,NetworkLink:processNetworkLink,GroundOverlay:processGroundOverlay,PhotoOverlay:processUnsupportedFeature,ScreenOverlay:processUnsupportedFeature,Tour:processTour};function DeferredLoading(e){this._dataSource=e,this._deferred=when.defer(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}function isZipFile(e){var e=e.slice(0,Math.min(4,e.size)),t=when.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(1347093252===new DataView(i.result).getUint32(0,!1))}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsArrayBuffer(e),t.promise}function readBlobAsText(e){var t=when.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function insertNamespaces(e){var t,i,r,n,a={xsi:"http://www.w3.org/2001/XMLSchema-instance"};for(n in a)a.hasOwnProperty(n)&&(r="xmlns:"+n+"=",RegExp("[< ]"+n+":").test(e)&&-1===e.indexOf(r)&&(defined(t)||(t=e.substr(0,e.indexOf("",r);-1!==r&&rthis._started+this._timeThreshold))return void this._giveUpTime();r=this._nextNode()}this._pop()&&e&&this._process(!0)};var colorOptions={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function parseColorString(e,t){if(defined(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,e=parseInt(e.substring(6,8),16)/255;return t?(0:clampToSeaFloor is currently not supported, using :clampToGround."),HeightReference$1.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(oneTimeWarning("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),HeightReference$1.RELATIVE_TO_GROUND):(defined(e)?oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown :"+e+", using :CLAMP_TO_GROUND."):oneTimeWarning("kml-gx:altitudeMode-unknown","KML - Unknown :"+t+", using :CLAMP_TO_GROUND."),HeightReference$1.CLAMP_TO_GROUND)}function createPositionPropertyFromAltitudeMode(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((defined(t)&&"clampToGround"!==t||defined(i)&&"clampToSeaFloor"!==i)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+defaultValue(t,i)),new ScaledPositionProperty(e))}function createPositionPropertyArrayFromAltitudeMode(e,t,i,r){if(defined(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(defined(t)&&"clampToGround"!==t||defined(i)&&"clampToSeaFloor"!==i)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+defaultValue(t,i));for(var n=e.length,a=0;a',y=0;y"+defaultValue((p=l[a=o[y]]).displayName,a)+""+defaultValue(p.value,"")+"";d+=""}if(defined(d)){d=autolinker.link(d),scratchDiv.innerHTML=d;for(var _=scratchDiv.querySelectorAll("a"),y=0;y<_.length;y++)_[y].setAttribute("target","_blank");defined(r)&&1",scratchDiv.innerHTML="",t.description=n}}function processFeature(e,t,i){var r=i.entityCollection,n=i.parentEntity,a=i.sourceResource,o=i.uriResolver,s=createEntity(t,r,i.context),l=s.kml,r=computeFinalStyle(e,t,i.styleCollection,a,o),i=queryStringValue(t,"name",namespaces.kml);s.name=i,s.parent=n;i=processTimeSpan(t);defined(i)||(i=processTimeStamp(t)),s.availability=i,mergeAvailabilityWithParent(s);i=queryBooleanValue(t,"visibility",namespaces.kml);s.show=function e(t){return!t||t.show&&e(t.parent)}(n)&&defaultValue(i,!0);n=queryFirstNode(t,"author",namespaces.atom),i=l.author;i.name=queryStringValue(n,"name",namespaces.atom),i.uri=queryStringValue(n,"uri",namespaces.atom),i.email=queryStringValue(n,"email",namespaces.atom);i=queryFirstNode(t,"link",namespaces.atom),n=l.link;n.href=queryStringAttribute(i,"href"),n.hreflang=queryStringAttribute(i,"hreflang"),n.rel=queryStringAttribute(i,"rel"),n.type=queryStringAttribute(i,"type"),n.title=queryStringAttribute(i,"title"),n.length=queryStringAttribute(i,"length"),l.address=queryStringValue(t,"address",namespaces.kml),l.phoneNumber=queryStringValue(t,"phoneNumber",namespaces.kml),l.snippet=queryStringValue(t,"Snippet",namespaces.kml),processExtendedData(t,s),processDescription(t,s,r,o,a);e=e._ellipsoid;return processLookAt(t,s,e),processCamera(t,s,e),defined(queryFirstNode(t,"Region",namespaces.kml))&&oneTimeWarning("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:r}}function processDocument(e,t,i,r){r.addNodes(t.childNodes,i),r.process()}function processFolder(e,t,i,r){var n=processFeature(e,t,i),i=clone$1(i);i.parentEntity=n.entity,processDocument(e,t,i,r)}function processPlacemark(e,t,i,r){for(var n=processFeature(e,t,i),a=n.entity,o=n.styleEntity,s=!1,l=t.childNodes,c=0,u=l.length;cCesiumMath.PI_OVER_TWO?CesiumMath.PI_OVER_TWO:e}function s(e){return e>CesiumMath.PI?e-CesiumMath.TWO_PI:e<-CesiumMath.PI?e+CesiumMath.TWO_PI:e}var l,c,u,d,h=objectToQuery(e.queryParameters);h=h.replace(/%5B/g,"[").replace(/%5D/g,"]"),h=defined(t)&&t._mode!==SceneMode$1.MORPHING?(n=defaultValue(n,zeroRectangle),defined(i)&&(scratchCartesian2$2.x=.5*i.clientWidth,scratchCartesian2$2.y=.5*i.clientHeight,l=t.pickEllipsoid(scratchCartesian2$2,a,scratchCartesian3$3)),defined(l)?d=a.cartesianToCartographic(l,scratchCartographic$6):(d=Rectangle.center(n,scratchCartographic$6),l=a.cartographicToCartesian(d)),defined(r)&&!CesiumMath.equalsEpsilon(r,1,CesiumMath.EPSILON9)&&(c=n.width*r*.5,u=n.height*r*.5,n=new Rectangle(s(d.longitude-c),o(d.latitude-u),s(d.longitude+c),o(d.latitude+u))),h=(h=(h=(h=h.replace("[bboxWest]",CesiumMath.toDegrees(n.west).toString())).replace("[bboxSouth]",CesiumMath.toDegrees(n.south).toString())).replace("[bboxEast]",CesiumMath.toDegrees(n.east).toString())).replace("[bboxNorth]",CesiumMath.toDegrees(n.north).toString()),u=CesiumMath.toDegrees(d.longitude).toString(),n=CesiumMath.toDegrees(d.latitude).toString(),h=(h=(h=(h=(h=(h=(h=(h=h.replace("[lookatLon]",u)).replace("[lookatLat]",n)).replace("[lookatTilt]",CesiumMath.toDegrees(t.pitch).toString())).replace("[lookatHeading]",CesiumMath.toDegrees(t.heading).toString())).replace("[lookatRange]",Cartesian3.distance(t.positionWC,l))).replace("[lookatTerrainLon]",u)).replace("[lookatTerrainLat]",n)).replace("[lookatTerrainAlt]",d.height.toString()),a.cartesianToCartographic(t.positionWC,scratchCartographic$6),h=(h=(h=h.replace("[cameraLon]",CesiumMath.toDegrees(scratchCartographic$6.longitude).toString())).replace("[cameraLat]",CesiumMath.toDegrees(scratchCartographic$6.latitude).toString())).replace("[cameraAlt]",CesiumMath.toDegrees(scratchCartographic$6.height).toString()),d=n="",defined(t=(a=t.frustum).aspectRatio)&&(a=CesiumMath.toDegrees(a.fov),1t.time&&(r=!0):t.refreshMode===RefreshMode.EXPIRE?JulianDate.greaterThan(a,t.time)&&(r=!0):t.refreshMode===RefreshMode.STOP&&(s&&(t.needsUpdate=!0,t.cameraUpdateTime=a),t.needsUpdate&&JulianDate.secondsDifference(a,t.cameraUpdateTime)>=t.time&&(r=!0)),r&&(function e(t){for(var i=t._children,r=i.length,n=0;nt.width?2*Math.tan(.5*r)/t.height:2*Math.tan(.5*r)/t.width:1/Math.max(t.width,t.height);this._geometricToleranceOverMeter=t*e.maximumScreenSpaceError,Color.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};var cameraPositionMC=new Cartesian3;function cleanEncodedCameraPositionMC(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,Matrix4.multiplyByPoint(e.inverseModel,e._cameraPosition,cameraPositionMC),EncodedCartesian3.fromCartesian(cameraPositionMC,e._encodedCameraPositionMC))}var view2Dto3DPScratch=new Cartesian3,view2Dto3DRScratch=new Cartesian3,view2Dto3DUScratch=new Cartesian3,view2Dto3DDScratch=new Cartesian3,view2Dto3DCartographicScratch=new Cartographic,view2Dto3DCartesian3Scratch=new Cartesian3,view2Dto3DMatrix4Scratch=new Matrix4;function view2Dto3D(e,t,i,r,n,a,o,s){var l=view2Dto3DPScratch;l.x=e.y,l.y=e.z,l.z=e.x;e=view2Dto3DRScratch;e.x=i.y,e.y=i.z,e.z=i.x;i=view2Dto3DUScratch;i.x=r.y,i.y=r.z,i.z=r.x;r=view2Dto3DDScratch;r.x=t.y,r.y=t.z,r.z=t.x,a===SceneMode$1.SCENE2D&&(l.z=.5*n);l=o.unproject(l,view2Dto3DCartographicScratch);l.longitude=CesiumMath.clamp(l.longitude,-Math.PI,Math.PI),l.latitude=CesiumMath.clamp(l.latitude,-CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO);o=o.ellipsoid,l=o.cartographicToCartesian(l,view2Dto3DCartesian3Scratch),o=Transforms.eastNorthUpToFixedFrame(l,o,view2Dto3DMatrix4Scratch);return Matrix4.multiplyByPointAsVector(o,e,e),Matrix4.multiplyByPointAsVector(o,i,i),Matrix4.multiplyByPointAsVector(o,r,r),(s=!defined(s)?new Matrix4:s)[0]=e.x,s[1]=i.x,s[2]=-r.x,s[3]=0,s[4]=e.y,s[5]=i.y,s[6]=-r.y,s[7]=0,s[8]=e.z,s[9]=i.z,s[10]=-r.z,s[11]=0,s[12]=-Cartesian3.dot(e,l),s[13]=-Cartesian3.dot(i,l),s[14]=Cartesian3.dot(r,l),s[15]=1,s}function updateView3D(e){e._view3DDirty&&(e._mode===SceneMode$1.SCENE3D?Matrix4.clone(e._view,e._view3D):view2Dto3D(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),Matrix4.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function updateInverseView3D(e){e._inverseView3DDirty&&(Matrix4.inverseTransformation(e.view3D,e._inverseView3D),Matrix4.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}function errorToString(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function createErrorMessage(e,t,i,r){for(var n=errorToString(e,r)+": "+t.name+"(",a=0;a"+i+""+e(r)+"":""+i+""+r+"");return n+=""}(e)},Object.defineProperties(ImageryProvider.prototype,{ready:{get:DeveloperError.throwInstantiationError},readyPromise:{get:DeveloperError.throwInstantiationError},rectangle:{get:DeveloperError.throwInstantiationError},tileWidth:{get:DeveloperError.throwInstantiationError},tileHeight:{get:DeveloperError.throwInstantiationError},maximumLevel:{get:DeveloperError.throwInstantiationError},minimumLevel:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},tileDiscardPolicy:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError},credit:{get:DeveloperError.throwInstantiationError},proxy:{get:DeveloperError.throwInstantiationError},hasAlphaChannel:{get:DeveloperError.throwInstantiationError}}),ImageryProvider.prototype.getTileCredits=function(e,t,i){DeveloperError.throwInstantiationError()},ImageryProvider.prototype.requestImage=function(e,t,i,r){DeveloperError.throwInstantiationError()},ImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){DeveloperError.throwInstantiationError()};var ktxRegex=/\.ktx$/i,crnRegex=/\.crn$/i;function ArcGisMapServerImageryProvider(n){n=defaultValue(n,defaultValue.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;var e=Resource.createIfNeeded(n.url);e.appendForwardSlash(),defined(n.token)&&e.setQueryParameters({token:n.token}),this._resource=e,this._tileDiscardPolicy=n.tileDiscardPolicy,this._tileWidth=defaultValue(n.tileWidth,256),this._tileHeight=defaultValue(n.tileHeight,256),this._maximumLevel=n.maximumLevel,this._tilingScheme=defaultValue(n.tilingScheme,new GeographicTilingScheme({ellipsoid:n.ellipsoid})),this._useTiles=defaultValue(n.usePreCachedTilesIfAvailable,!0),this._rectangle=defaultValue(n.rectangle,this._tilingScheme.rectangle),this._layers=n.layers;e=n.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e,this.enablePickFeatures=defaultValue(n.enablePickFeatures,!0),this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var a,o=this;function t(e){var t=e.tileInfo;if(defined(t)){if(o._tileWidth=t.rows,o._tileHeight=t.cols,102100===t.spatialReference.wkid||102113===t.spatialReference.wkid)o._tilingScheme=new WebMercatorTilingScheme({ellipsoid:n.ellipsoid});else{if(4326!==e.tileInfo.spatialReference.wkid){var i="Tile spatial reference WKID "+e.tileInfo.spatialReference.wkid+" is not supported.";return void(a=TileProviderError.handleError(a,o,o._errorEvent,i,void 0,void 0,void 0,s))}o._tilingScheme=new GeographicTilingScheme({ellipsoid:n.ellipsoid})}if(o._maximumLevel=e.tileInfo.lods.length-1,defined(e.fullExtent)){if(defined(e.fullExtent.spatialReference)&&defined(e.fullExtent.spatialReference.wkid))if(102100===e.fullExtent.spatialReference.wkid||102113===e.fullExtent.spatialReference.wkid){var t=new WebMercatorProjection,r=e.fullExtent,i=t.unproject(new Cartesian3(Math.max(r.xmin,-o._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-o._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),r=t.unproject(new Cartesian3(Math.min(r.xmax,o._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,o._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));o._rectangle=new Rectangle(i.longitude,i.latitude,r.longitude,r.latitude)}else{if(4326!==e.fullExtent.spatialReference.wkid){r="fullExtent.spatialReference WKID "+e.fullExtent.spatialReference.wkid+" is not supported.";return void(a=TileProviderError.handleError(a,o,o._errorEvent,r,void 0,void 0,void 0,s))}o._rectangle=Rectangle.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax)}}else o._rectangle=o._tilingScheme.rectangle;defined(o._tileDiscardPolicy)||(o._tileDiscardPolicy=new DiscardMissingTileImagePolicy({missingImageUrl:buildImageResource$3(o,0,0,o._maximumLevel).url,pixelsToCheck:[new Cartesian2(0,0),new Cartesian2(200,20),new Cartesian2(20,200),new Cartesian2(80,110),new Cartesian2(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),o._useTiles=!0}else o._useTiles=!1;defined(e.copyrightText)&&0'),this._tilingScheme=new WebMercatorTilingScheme({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._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();e=this._tileProtocol;defined(e)?0=d.zoomMin&&t<=d.zoomMax&&defined(Rectangle.intersection(i,d.bbox,intersectionScratch))&&(l=!0)}l&&r.push(o.credit)}return r}BingMapsImageryProvider._metadataCache={};var defaultDimensions=new Cartesian3(1,1,1);function BoxEmitter(e){e=defaultValue(e,defaultDimensions),this._dimensions=Cartesian3.clone(e)}Object.defineProperties(BoxEmitter.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){Cartesian3.clone(e,this._dimensions)}}});var scratchHalfDim=new Cartesian3;BoxEmitter.prototype.emit=function(e){var t=this._dimensions,i=Cartesian3.multiplyByScalar(t,.5,scratchHalfDim),r=CesiumMath.randomBetween(-i.x,i.x),t=CesiumMath.randomBetween(-i.y,i.y),i=CesiumMath.randomBetween(-i.z,i.z);e.position=Cartesian3.fromElements(r,t,i,e.position),e.velocity=Cartesian3.normalize(e.position,e.velocity)};var BrdfLutGeneratorFS="varying vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\nfloat vdcRadicalInverse(int i)\n{\nfloat r;\nfloat base = 2.0;\nfloat value = 0.0;\nfloat invBase = 1.0 / base;\nfloat invBi = invBase;\nfor (int x = 0; x < 100; x++)\n{\nif (i <= 0)\n{\nbreak;\n}\nr = mod(float(i), base);\nvalue += r * invBi;\ninvBi *= invBase;\ni = int(float(i) * invBase);\n}\nreturn value;\n}\nvec2 hammersley2D(int i, int N)\n{\nreturn vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\nfloat a = roughness * roughness;\nfloat phi = 2.0 * M_PI * xi.x;\nfloat cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\nfloat sinTheta = sqrt(1.0 - cosTheta * cosTheta);\nvec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\nvec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\nvec3 tangentX = normalize(cross(upVector, N));\nvec3 tangentY = cross(N, tangentX);\nreturn tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G1_Smith(float NdotV, float k)\n{\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\nfloat k = roughness * roughness / 2.0;\nreturn G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\nvec2 integrateBrdf(float roughness, float NdotV)\n{\nvec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\nfloat A = 0.0;\nfloat B = 0.0;\nconst int NumSamples = 1024;\nfor (int i = 0; i < NumSamples; i++)\n{\nvec2 xi = hammersley2D(i, NumSamples);\nvec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\nvec3 L = 2.0 * dot(V, H) * H - V;\nfloat NdotL = clamp(L.z, 0.0, 1.0);\nfloat NdotH = clamp(H.z, 0.0, 1.0);\nfloat VdotH = clamp(dot(V, H), 0.0, 1.0);\nif (NdotL > 0.0)\n{\nfloat G = G_Smith(roughness, NdotV, NdotL);\nfloat G_Vis = G * VdotH / (NdotH * NdotV);\nfloat Fc = pow(1.0 - VdotH, 5.0);\nA += (1.0 - Fc) * G_Vis;\nB += Fc * G_Vis;\n}\n}\nreturn vec2(A, B) / float(NumSamples);\n}\nvoid main()\n{\ngl_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n";function BrdfLutGenerator(){this._framebuffer=void 0,this._colorTexture=void 0,this._drawCommand=void 0}function createCommand$1(e,t){var i=e._framebuffer,i=t.createViewportQuadCommand(BrdfLutGeneratorFS,{framebuffer:i,renderState:RenderState.fromCache({viewport:new BoundingRectangle(0,0,256,256)})});e._drawCommand=i}function createFramebuffer$1(e,t){var i=new Texture({context:t,width:256,height:256,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),i=new Framebuffer({context:t,colorTextures:[e._colorTexture=i],destroyAttachments:!1});e._framebuffer=i}Object.defineProperties(BrdfLutGenerator.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),BrdfLutGenerator.prototype.update=function(e){defined(this._colorTexture)||(createFramebuffer$1(this,e=e.context),createCommand$1(this,e),this._drawCommand.execute(e),this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy())},BrdfLutGenerator.prototype.isDestroyed=function(){return!1},BrdfLutGenerator.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),destroyObject(this)};var CameraFlightPath={};function getAltitude(e,t,i){if(e instanceof PerspectiveFrustum){var r=Math.tan(.5*e.fovy),n=e.near,a=e.near*r,r=e.aspectRatio*a;return Math.max(t*n/r,i*n/a)}return e instanceof PerspectiveOffCenterFrustum?(n=e.near,a=e.top,r=e.right,Math.max(t*n/r,i*n/a)):Math.max(t,i)}var scratchCart=new Cartesian3,scratchCart2=new Cartesian3;function createPitchFunction(i,r,n,e){if(defined(e)&&n(.5)>e){var a=n(0),o=n(1),e=n(.5),s=e-a,l=e-o;return function(e){var t=n(e);if(e<=.5){e=(t-a)/s;return CesiumMath.lerp(i,-CesiumMath.PI_OVER_TWO,e)}t=(t-o)/l;return CesiumMath.lerp(-CesiumMath.PI_OVER_TWO,r,1-t)}}return function(e){return CesiumMath.lerp(i,r,e)}}function createHeightFunction(e,t,i,r,n){var a,o,s=n,l=Math.max(i,r);if(defined(s)||(a=e.position,o=e.up,n=e.right,e=e.frustum,t=Cartesian3.subtract(a,t,scratchCart),o=Cartesian3.magnitude(Cartesian3.multiplyByScalar(o,Cartesian3.dot(t,o),scratchCart2)),n=Cartesian3.magnitude(Cartesian3.multiplyByScalar(n,Cartesian3.dot(t,n),scratchCart2)),s=Math.min(.2*getAltitude(e,o,n),1e9)),l(e=CesiumMath.equalsEpsilon(e,CesiumMath.TWO_PI,CesiumMath.EPSILON11)?0:e)+Math.PI?e+=CesiumMath.TWO_PI:tCesiumMath.PI&&(t.longitude+=CesiumMath.TWO_PI)}var scratchStartCart=new Cartographic,scratchEndCart=new Cartographic;function createUpdate3D(e,i,t,r,n,a,o,s,l,c){var u=e.camera,d=e.mapProjection.ellipsoid,h=Cartographic.clone(u.positionCartographic,scratchStartCart),p=u.pitch,m=adjustAngleForLERP(u.heading,r),f=adjustAngleForLERP(u.roll,a),g=d.cartesianToCartographic(t,scratchEndCart);h.longitude=CesiumMath.zeroToTwoPi(h.longitude),g.longitude=CesiumMath.zeroToTwoPi(g.longitude);var _=!1;defined(s)&&(e=CesiumMath.zeroToTwoPi(s),d=Math.min(h.longitude,g.longitude),s=Math.max(h.longitude,g.longitude),d=d<=e&&e<=s,defined(l)?(e=Math.abs(h.longitude-g.longitude),s=CesiumMath.TWO_PI-e,(d?e:s)<(d?s:e)*l&&!d&&(_=!0)):d||(_=!0)),(_?useLongestFlight:useShortestFlight)(h,g);var y,C,v,S,T=createHeightFunction(u,t,h.height,g.height,o),x=createPitchFunction(p,n,T,c);return y=h.longitude,C=g.longitude,v=h.latitude,S=g.latitude,function(e){var t=e.time/i,e=Cartesian3.fromRadians(CesiumMath.lerp(y,C,t),CesiumMath.lerp(v,S,t),T(t));u.setView({destination:e,orientation:{heading:CesiumMath.lerp(m,r,t),pitch:x(t),roll:CesiumMath.lerp(f,a,t)}})}}function createUpdate2D(e,r,n,a,t,i,o){var s=e.camera,l=Cartesian3.clone(s.position,scratchStart),c=adjustAngleForLERP(s.heading,a),e=s.frustum.right-s.frustum.left,u=createHeightFunction(s,n,e,n.z,o);return function(e){var t=e.time/r;s.setView({orientation:{heading:CesiumMath.lerp(c,a,t)}}),Cartesian2.lerp(l,n,t,s.position);var i=u(t),t=(e=s.frustum).top/e.right,i=.5*(i-(e.right-e.left));e.right+=i,e.left-=i,e.top=t*e.right,e.bottom=-e.top}}var scratchCartographic$4=new Cartographic,scratchDestination=new Cartesian3;function emptyFlight(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function wrapCallback(e,t){return function(){"function"==typeof t&&t(),e.enableInputs=!0}}CameraFlightPath.createTween=function(e,t){var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).destination,r=e.mode;if(r===SceneMode$1.MORPHING)return emptyFlight();var n=defaultValue(t.convert,!0),a=e.mapProjection,o=a.ellipsoid,s=t.maximumHeight,l=t.flyOverLongitude,c=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,d=t.easingFunction;n&&r!==SceneMode$1.SCENE3D&&(o.cartesianToCartographic(i,scratchCartographic$4),i=a.project(scratchCartographic$4,scratchDestination));var h=e.camera,p=t.endTransform;defined(p)&&h._setTransform(p);n=t.duration;defined(n)||(n=Math.ceil(Cartesian3.distance(h.position,i)/1e6)+2,n=Math.min(n,3));var m=defaultValue(t.heading,0),f=defaultValue(t.pitch,-CesiumMath.PI_OVER_TWO),g=defaultValue(t.roll,0),a=e.screenSpaceCameraController;a.enableInputs=!1;var _=wrapCallback(a,t.complete),p=wrapCallback(a,t.cancel),a=h.frustum,t=e.mode===SceneMode$1.SCENE2D;if(t=(t=(t=(t=t&&Cartesian2.equalsEpsilon(h.position,i,CesiumMath.EPSILON6))&&CesiumMath.equalsEpsilon(Math.max(a.right-a.left,a.top-a.bottom),i.z,CesiumMath.EPSILON6))||e.mode!==SceneMode$1.SCENE2D&&Cartesian3.equalsEpsilon(i,h.position,CesiumMath.EPSILON10))&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(m),CesiumMath.negativePiToPi(h.heading),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(f),CesiumMath.negativePiToPi(h.pitch),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(g),CesiumMath.negativePiToPi(h.roll),CesiumMath.EPSILON10))return emptyFlight(_,p);var y=new Array(4);if(y[SceneMode$1.SCENE2D]=createUpdate2D,y[SceneMode$1.SCENE3D]=createUpdate3D,y[SceneMode$1.COLUMBUS_VIEW]=createUpdateCV,n<=0)return emptyFlight(function(){y[r](e,1,i,m,f,g,s,l,c,u)({time:1}),"function"==typeof _&&_()},p);t=y[r](e,n,i,m,f,g,s,l,c,u);return defined(d)||(h=h.positionCartographic.height,d=(r===SceneMode$1.SCENE3D?o.cartesianToCartographic(i).height:i.z)CesiumMath.EPSILON10?Cartesian3.cross(s,c,l):(r=Cartesian4.add(Matrix4.getColumn(e._transform,1,scratchCartesian3$1),r,scratchCartesian3$1),i.cartesianToCartographic(r,n),t.project(n,a),l.x=a.z,l.y=a.x,l.z=a.y,l.w=0,Cartesian3.subtract(l,o,l),l.x=0,Cartesian3.magnitudeSquared(l)CesiumMath.EPSILON2&&(p=1/Cartesian3.magnitudeSquared(l),p=Cartesian3.dot(l,o)*p,p=Cartesian3.multiplyByScalar(o,p,scratchCartesian$1),l=Cartesian3.normalize(Cartesian3.subtract(l,p,e._up),e._up),Cartesian3.clone(l,e.up),u=Cartesian3.cross(o,l,e._right),Cartesian3.clone(u,e.right))),(s||h)&&(e._directionWC=Matrix4.multiplyByPointAsVector(i,o,e._directionWC),Cartesian3.normalize(e._directionWC,e._directionWC)),(c||h)&&(e._upWC=Matrix4.multiplyByPointAsVector(i,l,e._upWC),Cartesian3.normalize(e._upWC,e._upWC)),(d||h)&&(e._rightWC=Matrix4.multiplyByPointAsVector(i,u,e._rightWC),Cartesian3.normalize(e._rightWC,e._rightWC)),(a||s||c||d||h)&&updateViewMatrix(e)}function getHeading(e,t){e=CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)?Math.atan2(t.y,t.x)-CesiumMath.PI_OVER_TWO:Math.atan2(e.y,e.x)-CesiumMath.PI_OVER_TWO;return CesiumMath.TWO_PI-CesiumMath.zeroToTwoPi(e)}function getPitch(e){return CesiumMath.PI_OVER_TWO-CesiumMath.acosClamped(e.z)}function getRoll(e,t,i){var r=0;return CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=CesiumMath.zeroToTwoPi(r+CesiumMath.TWO_PI)),r}var scratchHPRMatrix1=new Matrix4,scratchHPRMatrix2=new Matrix4;Object.defineProperties(Camera.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return updateMembers(this),this._invTransform}},viewMatrix:{get:function(){return updateMembers(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return updateMembers(this),this._invViewMatrix}},positionCartographic:{get:function(){return updateMembers(this),this._positionCartographic}},positionWC:{get:function(){return updateMembers(this),this._positionWC}},directionWC:{get:function(){return updateMembers(this),this._directionWC}},upWC:{get:function(){return updateMembers(this),this._upWC}},rightWC:{get:function(){return updateMembers(this),this._rightWC}},heading:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getHeading(this.direction,this.up);return this._setTransform(t),e}}},pitch:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getPitch(this.direction);return this._setTransform(t),e}}},roll:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getRoll(this.direction,this.up,this.right);return this._setTransform(t),e}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),Camera.prototype.update=function(e){var t=!1;e!==this._mode&&(this._mode=e,this._modeChanged=e!==SceneMode$1.MORPHING,t=this._mode===SceneMode$1.SCENE2D),t&&(t=(e=this._max2Dfrustum=this.frustum.clone()).top/e.right,e.right=2*this._maxCoord.x,e.left=-e.right,e.top=t*e.right,e.bottom=-e.top),this._mode===SceneMode$1.SCENE2D&&clampMove2D(this,this.position)};var setTransformPosition=new Cartesian3,setTransformUp=new Cartesian3,setTransformDirection=new Cartesian3;Camera.prototype._setTransform=function(e){var t=Cartesian3.clone(this.positionWC,setTransformPosition),i=Cartesian3.clone(this.upWC,setTransformUp),r=Cartesian3.clone(this.directionWC,setTransformDirection);Matrix4.clone(e,this._transform),this._transformChanged=!0,updateMembers(this);e=this._actualInvTransform;Matrix4.multiplyByPoint(e,t,this.position),Matrix4.multiplyByPointAsVector(e,r,this.direction),Matrix4.multiplyByPointAsVector(e,i,this.up),Cartesian3.cross(this.direction,this.up,this.right),updateMembers(this)};var scratchAdjustOrthographicFrustumMousePosition=new Cartesian2,scratchPickRay$1=new Ray,scratchRayIntersection$1=new Cartesian3,scratchDepthIntersection$1=new Cartesian3;function calculateOrthographicFrustumWidth(e){if(!Matrix4.equals(Matrix4.IDENTITY,e.transform))return Cartesian3.magnitude(e.position);var t,i,r=e._scene,n=r.globe,a=scratchAdjustOrthographicFrustumMousePosition;return a.x=r.drawingBufferWidth/2,a.y=r.drawingBufferHeight/2,defined(n)&&(i=e.getPickRay(a,scratchPickRay$1),i=n.pickWorldCoordinates(i,r,!0,scratchRayIntersection$1)),r.pickPositionSupported&&(t=r.pickPositionWorldCoordinates(a,scratchDepthIntersection$1)),defined(i)||defined(t)?(t=defined(t)?Cartesian3.distance(t,e.positionWC):Number.POSITIVE_INFINITY,i=defined(i)?Cartesian3.distance(i,e.positionWC):Number.POSITIVE_INFINITY,Math.min(t,i)):Math.max(e.positionCartographic.height,0)}Camera.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof OrthographicFrustum&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=calculateOrthographicFrustumWidth(this)))};var scratchSetViewCartesian=new Cartesian3,scratchSetViewTransform1=new Matrix4,scratchSetViewTransform2=new Matrix4,scratchSetViewQuaternion=new Quaternion,scratchSetViewMatrix3=new Matrix3,scratchSetViewCartographic=new Cartographic;function setView3D(e,t,i){var r=Matrix4.clone(e.transform,scratchSetViewTransform1),t=Transforms.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,scratchSetViewTransform2);e._setTransform(t),Cartesian3.clone(Cartesian3.ZERO,e.position),i.heading=i.heading-CesiumMath.PI_OVER_TWO;i=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),i=Matrix3.fromQuaternion(i,scratchSetViewMatrix3);Matrix3.getColumn(i,0,e.direction),Matrix3.getColumn(i,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function setViewCV(e,t,i,r){var n,a=Matrix4.clone(e.transform,scratchSetViewTransform1);e._setTransform(Matrix4.IDENTITY),Cartesian3.equals(t,e.positionWC)||(r&&(r=(n=e._projection).ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic),t=n.project(r,scratchSetViewCartesian)),Cartesian3.clone(t,e.position)),i.heading=i.heading-CesiumMath.PI_OVER_TWO;i=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),i=Matrix3.fromQuaternion(i,scratchSetViewMatrix3);Matrix3.getColumn(i,0,e.direction),Matrix3.getColumn(i,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(a),e._adjustOrthographicFrustum(!0)}function setView2D(e,t,i,r){var n,a,o=Matrix4.clone(e.transform,scratchSetViewTransform1);e._setTransform(Matrix4.IDENTITY),Cartesian3.equals(t,e.positionWC)||(r&&(a=(n=e._projection).ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic),t=n.project(a,scratchSetViewCartesian)),Cartesian2.clone(t,e.position),n=-(r=.5*-t.z),a=e.frustum,rn&&(t.x=i),t.x<-n&&(t.x=r),t.y>e&&(t.y=e),t.y<-e&&(t.y=-e)}Camera.prototype.flyHome=function(e){var t,i,r=this._mode;r===SceneMode$1.MORPHING&&this._scene.completeMorph(),r===SceneMode$1.SCENE2D?this.flyTo({destination:Camera.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:Matrix4.IDENTITY}):r===SceneMode$1.SCENE3D?(i=this.getRectangleCameraCoordinates(Camera.DEFAULT_VIEW_RECTANGLE),t=Cartesian3.magnitude(i),t+=t*Camera.DEFAULT_VIEW_FACTOR,Cartesian3.normalize(i,i),Cartesian3.multiplyByScalar(i,t,i),this.flyTo({destination:i,duration:e,endTransform:Matrix4.IDENTITY})):r===SceneMode$1.COLUMBUS_VIEW&&(i=this._projection.ellipsoid.maximumRadius,r=new Cartesian3(0,-1,1),r=Cartesian3.multiplyByScalar(Cartesian3.normalize(r,r),5*i,r),this.flyTo({destination:r,duration:e,orientation:{heading:0,pitch:-Math.acos(Cartesian3.normalize(r,pitchScratch).z),roll:0},endTransform:Matrix4.IDENTITY,convert:!1}))},Camera.prototype.worldToCameraCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers(this),Matrix4.multiplyByVector(this._actualInvTransform,e,t)},Camera.prototype.worldToCameraCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPoint(this._actualInvTransform,e,t)},Camera.prototype.worldToCameraCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPointAsVector(this._actualInvTransform,e,t)},Camera.prototype.cameraToWorldCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers(this),Matrix4.multiplyByVector(this._actualTransform,e,t)},Camera.prototype.cameraToWorldCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPoint(this._actualTransform,e,t)},Camera.prototype.cameraToWorldCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPointAsVector(this._actualTransform,e,t)};var moveScratch=new Cartesian3;Camera.prototype.move=function(e,t){var i=this.position;Cartesian3.multiplyByScalar(e,t,moveScratch),Cartesian3.add(i,moveScratch,i),this._mode===SceneMode$1.SCENE2D&&clampMove2D(this,i),this._adjustOrthographicFrustum(!0)},Camera.prototype.moveForward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$1.SCENE2D?zoom2D$1(this,e):this.move(this.direction,e)},Camera.prototype.moveBackward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$1.SCENE2D?zoom2D$1(this,-e):this.move(this.direction,-e)},Camera.prototype.moveUp=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,e)},Camera.prototype.moveDown=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,-e)},Camera.prototype.moveRight=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,e)},Camera.prototype.moveLeft=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,-e)},Camera.prototype.lookLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.up,-e)},Camera.prototype.lookRight=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.up,e)},Camera.prototype.lookUp=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.right,-e)},Camera.prototype.lookDown=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.right,e)};var lookScratchQuaternion=new Quaternion,lookScratchMatrix=new Matrix3;Camera.prototype.look=function(e,t){var i=defaultValue(t,this.defaultLookAmount),r=Quaternion.fromAxisAngle(e,-i,lookScratchQuaternion),t=Matrix3.fromQuaternion(r,lookScratchMatrix),e=this.direction,i=this.up,r=this.right;Matrix3.multiplyByVector(t,e,e),Matrix3.multiplyByVector(t,i,i),Matrix3.multiplyByVector(t,r,r)},Camera.prototype.twistLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,e)},Camera.prototype.twistRight=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,-e)};var rotateScratchQuaternion=new Quaternion,rotateScratchMatrix=new Matrix3;Camera.prototype.rotate=function(e,t){t=defaultValue(t,this.defaultRotateAmount),t=Quaternion.fromAxisAngle(e,-t,rotateScratchQuaternion),t=Matrix3.fromQuaternion(t,rotateScratchMatrix);Matrix3.multiplyByVector(t,this.position,this.position),Matrix3.multiplyByVector(t,this.direction,this.direction),Matrix3.multiplyByVector(t,this.up,this.up),Cartesian3.cross(this.direction,this.up,this.right),Cartesian3.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},Camera.prototype.rotateDown=function(e){rotateVertical(this,e=defaultValue(e,this.defaultRotateAmount))},Camera.prototype.rotateUp=function(e){rotateVertical(this,-(e=defaultValue(e,this.defaultRotateAmount)))};var rotateVertScratchP=new Cartesian3,rotateVertScratchA=new Cartesian3,rotateVertScratchTan=new Cartesian3,rotateVertScratchNegate=new Cartesian3;function rotateVertical(e,t){var i,r,n,a=e.position;defined(e.constrainedAxis)&&!Cartesian3.equalsEpsilon(e.position,Cartesian3.ZERO,CesiumMath.EPSILON2)?(n=Cartesian3.normalize(a,rotateVertScratchP),i=Cartesian3.equalsEpsilon(n,e.constrainedAxis,CesiumMath.EPSILON2),r=Cartesian3.equalsEpsilon(n,Cartesian3.negate(e.constrainedAxis,rotateVertScratchNegate),CesiumMath.EPSILON2),i||r?(i&&t<0||r&&0Math.abs(a.left)+Math.abs(a.right)?(r=a.top-t,n=a.bottom+t,i=e._maxCoord.y,e._scene.mapMode2D===MapMode2D$1.ROTATE&&(i*=e.maximumZoomFactor),(r=iCesiumMath.PI_OVER_TWO-CesiumMath.RADIANS_PER_DEGREE?0:((y=viewRectangle3DCartographic1).longitude=u,y.latitude=o,y.height=0,(C=viewRectangle3DCartographic2).longitude=u,C.latitude=s,C.height=0,defined(v=viewRectangle3DEllipsoidGeodesic)&&v.ellipsoid===n||(viewRectangle3DEllipsoidGeodesic=v=new EllipsoidGeodesic(void 0,void 0,n)),v.setEndPoints(y,C),v.interpolateUsingFraction(.5,viewRectangle3DCartographic1).latitude),h=viewRectangle3DCartographic1;h.longitude=u,h.latitude=d,h.height=0;var p=n.cartographicToCartesian(h,viewRectangle3DCenter),m=viewRectangle3DCartographic1;m.longitude=l,m.latitude=o;var f=n.cartographicToCartesian(m,viewRectangle3DNorthEast);m.longitude=c;var g=n.cartographicToCartesian(m,viewRectangle3DNorthWest);m.longitude=u;var _=n.cartographicToCartesian(m,viewRectangle3DNorthCenter);m.latitude=s;r=n.cartographicToCartesian(m,viewRectangle3DSouthCenter);m.longitude=l;t=n.cartographicToCartesian(m,viewRectangle3DSouthEast);m.longitude=c;var y=n.cartographicToCartesian(m,viewRectangle3DSouthWest);Cartesian3.subtract(g,p,g),Cartesian3.subtract(t,p,t),Cartesian3.subtract(f,p,f),Cartesian3.subtract(y,p,y),Cartesian3.subtract(_,p,_),Cartesian3.subtract(r,p,r);var C=n.geodeticSurfaceNormal(p,a.direction);Cartesian3.negate(C,C);var v=Cartesian3.cross(C,Cartesian3.UNIT_Z,a.right);Cartesian3.normalize(v,v);var S,T,d=Cartesian3.cross(v,C,a.up);return e.frustum instanceof OrthographicFrustum?(h=Math.max(Cartesian3.distance(f,g),Cartesian3.distance(t,y)),(a=(u=Math.max(Cartesian3.distance(f,t),Cartesian3.distance(g,y)))*(m=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top))t.east&&(t=Rectangle.MAX_VALUE);var n=e._actualTransform,a=e._actualInvTransform,o=viewRectangleCVCartographic;o.longitude=t.east,o.latitude=t.north;var s=r.project(o,viewRectangleCVNorthEast);Matrix4.multiplyByPoint(n,s,s),Matrix4.multiplyByPoint(a,s,s),o.longitude=t.west,o.latitude=t.south;var l,o=r.project(o,viewRectangleCVSouthWest);return Matrix4.multiplyByPoint(n,o,o),Matrix4.multiplyByPoint(a,o,o),i.x=.5*(s.x-o.x)+o.x,i.y=.5*(s.y-o.y)+o.y,defined(e.frustum.fovy)?(l=Math.tan(.5*e.frustum.fovy),e=e.frustum.aspectRatio*l,i.z=.5*Math.max((s.x-o.x)/e,(s.y-o.y)/l)):(l=s.x-o.x,o=s.y-o.y,i.z=Math.max(l,o)),i}var viewRectangle2DCartographic=new Cartographic,viewRectangle2DNorthEast=new Cartesian3,viewRectangle2DSouthWest=new Cartesian3;function rectangleCameraPosition2D(e,t,i){var r=e._projection,n=t.east;t.west>t.east&&(e._scene.mapMode2D===MapMode2D$1.INFINITE_SCROLL?n+=CesiumMath.TWO_PI:n=(t=Rectangle.MAX_VALUE).east);var a=viewRectangle2DCartographic;a.longitude=n,a.latitude=t.north;var o=r.project(a,viewRectangle2DNorthEast);a.longitude=t.west,a.latitude=t.south;var s,l,c=r.project(a,viewRectangle2DSouthWest),u=.5*Math.abs(o.x-c.x),n=.5*Math.abs(o.y-c.y),t=e.frustum.right/e.frustum.top,e=n*t;return eCesiumMath.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(t,r)}var pickEllipsoidCVRay=new Ray;function pickMapColumbusView(e,t,i,r){e=e.getPickRay(t,pickEllipsoidCVRay),t=-e.origin.x/e.direction.x;Ray.getPoint(e,t,r);t=i.unproject(new Cartesian3(r.y,r.z,0));if(!(t.latitude<-CesiumMath.PI_OVER_TWO||t.latitude>CesiumMath.PI_OVER_TWO||t.longitude<-Math.PI||t.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(t,r)}Camera.prototype.pickEllipsoid=function(e,t,i){var r=this._scene.canvas;if(0!==r.clientWidth&&0!==r.clientHeight){if(defined(i)||(i=new Cartesian3),t=defaultValue(t,Ellipsoid.WGS84),this._mode===SceneMode$1.SCENE3D)i=pickEllipsoid3D(this,e,t,i);else if(this._mode===SceneMode$1.SCENE2D)i=pickMap2D(this,e,this._projection,i);else{if(this._mode!==SceneMode$1.COLUMBUS_VIEW)return;i=pickMapColumbusView(this,e,this._projection,i)}return i}};var pickPerspCenter=new Cartesian3,pickPerspXDir=new Cartesian3,pickPerspYDir=new Cartesian3;function getPickRayPerspective(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,o=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*o,l=e.frustum.near,r=2/n*t.x-1,n=2/a*(a-t.y)-1,a=e.positionWC;Cartesian3.clone(a,i.origin);t=Cartesian3.multiplyByScalar(e.directionWC,l,pickPerspCenter);Cartesian3.add(a,t,t);s=Cartesian3.multiplyByScalar(e.rightWC,r*l*s,pickPerspXDir),o=Cartesian3.multiplyByScalar(e.upWC,n*l*o,pickPerspYDir),s=Cartesian3.add(t,s,i.direction);return Cartesian3.add(s,o,s),Cartesian3.subtract(s,a,s),Cartesian3.normalize(s,s),i}var scratchDirection=new Cartesian3;function getPickRayOrthographic(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,r=e.frustum;defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);n=2/n*t.x-1;n*=.5*(r.right-r.left);t=2/a*(a-t.y)-1;t*=.5*(r.top-r.bottom);r=i.origin;return Cartesian3.clone(e.position,r),Cartesian3.multiplyByScalar(e.right,n,scratchDirection),Cartesian3.add(scratchDirection,r,r),Cartesian3.multiplyByScalar(e.up,t,scratchDirection),Cartesian3.add(scratchDirection,r,r),Cartesian3.clone(e.directionWC,i.direction),e._mode!==SceneMode$1.COLUMBUS_VIEW&&e._mode!==SceneMode$1.SCENE2D||Cartesian3.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}Camera.prototype.getPickRay=function(e,t){defined(t)||(t=new Ray);var i=this.frustum;return(defined(i.aspectRatio)&&defined(i.fov)&&defined(i.near)?getPickRayPerspective:getPickRayOrthographic)(this,e,t)};var scratchToCenter=new Cartesian3,scratchProj=new Cartesian3;Camera.prototype.distanceToBoundingSphere=function(e){var t=Cartesian3.subtract(this.positionWC,e.center,scratchToCenter),t=Cartesian3.multiplyByScalar(this.directionWC,Cartesian3.dot(t,this.directionWC),scratchProj);return Math.max(0,Cartesian3.magnitude(t)-e.radius)};var scratchPixelSize=new Cartesian2;function createAnimationTemplateCV(t,i,e,r,n,a){var o=Cartesian3.clone(i);return e.y>r?o.y-=e.y-r:e.y<-r&&(o.y+=-r-e.y),e.z>n?o.z-=e.z-n:e.z<-n&&(o.z+=-n-e.z),{easingFunction:EasingFunction$1.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:function(e){e=Cartesian3.lerp(i,o,e.time,new Cartesian3),t.worldToCameraCoordinatesPoint(e,t.position)}}}Camera.prototype.getPixelSize=function(e,t,i){e=this.distanceToBoundingSphere(e),e=this.frustum.getPixelDimensions(t,i,e,this._scene.pixelRatio,scratchPixelSize);return Math.max(e.x,e.y)};var normalScratch$1=new Cartesian3,centerScratch$1=new Cartesian3,posScratch=new Cartesian3,scratchCartesian3Subtract=new Cartesian3;function createAnimationCV(e,t){var i=e.position,r=e.direction,n=e.worldToCameraCoordinatesVector(Cartesian3.UNIT_X,normalScratch$1),a=-Cartesian3.dot(n,i)/Cartesian3.dot(n,r),o=Cartesian3.add(i,Cartesian3.multiplyByScalar(r,a,centerScratch$1),centerScratch$1);e.cameraToWorldCoordinatesPoint(o,o);var i=e.cameraToWorldCoordinatesPoint(e.position,posScratch),s=Math.tan(.5*e.frustum.fovy),n=e.frustum.aspectRatio*s,r=Cartesian3.magnitude(Cartesian3.subtract(i,o,scratchCartesian3Subtract)),a=n*r,n=s*r,s=e._maxCoord.x,r=e._maxCoord.y,a=Math.max(a-s,s),s=Math.max(n-r,r);if(i.z<-a||i.z>a||i.y<-s||i.y>s){n=o.y<-a||o.y>a,r=o.z<-s||o.z>s;if(n||r)return createAnimationTemplateCV(e,i,o,a,s,t)}}Camera.prototype.createCorrectPositionTween=function(e){if(this._mode===SceneMode$1.COLUMBUS_VIEW)return createAnimationCV(this,e)};var scratchFlyToDestination=new Cartesian3,newOptions={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};function distanceToBoundingSphere3D(e,t){var i=e.frustum,e=Math.tan(.5*i.fovy),i=i.aspectRatio*e;return Math.max(t/i,t/e)}function distanceToBoundingSphere2D(e,t){var i,r,n=e.frustum,e=(n=defined(n._offCenterFrustum)?n._offCenterFrustum:n).right/n.top,n=t*e;return nCesiumMath.PI?o+=CesiumMath.TWO_PI-u:o+=u,s=c}return CesiumMath.equalsEpsilon(Math.abs(o),CesiumMath.TWO_PI,CesiumMath.EPSILON9)&&(t.west=-CesiumMath.PI,t.east=CesiumMath.PI,0<=cartoArray[0].latitude?t.north=CesiumMath.PI_OVER_TWO:t.south=-CesiumMath.PI_OVER_TWO),t}},Camera.prototype.switchToPerspectiveFrustum=function(){var e;this._mode===SceneMode$1.SCENE2D||this.frustum instanceof PerspectiveFrustum||(e=this._scene,this.frustum=new PerspectiveFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=CesiumMath.toRadians(60))},Camera.prototype.switchToOrthographicFrustum=function(){var e,t;this._mode===SceneMode$1.SCENE2D||this.frustum instanceof OrthographicFrustum||(e=calculateOrthographicFrustumWidth(this),t=this._scene,this.frustum=new OrthographicFrustum,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e)},Camera.clone=function(e,t){return defined(t)||(t=new Camera(e._scene)),Cartesian3.clone(e.position,t.position),Cartesian3.clone(e.direction,t.direction),Cartesian3.clone(e.up,t.up),Cartesian3.clone(e.right,t.right),Matrix4.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var CameraEventType={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},CameraEventType$1=Object.freeze(CameraEventType);function getKey$1(e,t){return defined(t)&&(e+="+"+t),e}function clonePinchMovement(e,t){Cartesian2.clone(e.distance.startPosition,t.distance.startPosition),Cartesian2.clone(e.distance.endPosition,t.distance.endPosition),Cartesian2.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),Cartesian2.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function listenToPinch(t,e,n){var a=getKey$1(CameraEventType$1.PINCH,e),o=t._update,s=t._isDown,i=t._eventStartPosition,r=t._pressTime,l=t._releaseTime;o[a]=!0,s[a]=!1,i[a]=new Cartesian2;var c=t._movement[a];(c=!defined(c)?t._movement[a]={}:c).distance={startPosition:new Cartesian2,endPosition:new Cartesian2},c.angleAndHeight={startPosition:new Cartesian2,endPosition:new Cartesian2},c.prevAngle=0,t._eventHandler.setInputAction(function(e){t._buttonsDown++,s[a]=!0,r[a]=new Date,Cartesian2.lerp(e.position1,e.position2,.5,i[a])},ScreenSpaceEventType$1.PINCH_START,e),t._eventHandler.setInputAction(function(){t._buttonsDown=Math.max(t._buttonsDown-1,0),s[a]=!1,l[a]=new Date},ScreenSpaceEventType$1.PINCH_END,e),t._eventHandler.setInputAction(function(e){if(s[a]){o[a]?(clonePinchMovement(e,c),o[a]=!1,c.prevAngle=c.angleAndHeight.startPosition.x):(Cartesian2.clone(e.distance.endPosition,c.distance.endPosition),Cartesian2.clone(e.angleAndHeight.endPosition,c.angleAndHeight.endPosition));for(var t=c.angleAndHeight.endPosition.x,i=c.prevAngle,r=2*Math.PI;t>=i+Math.PI;)t-=r;for(;t ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:textColor}),e+=addStyle(".cesium-credit-lightbox > ul > li a:hover",{color:highlightColor$1}),e+=addStyle(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),e+=addStyle(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),e+=addStyle(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),e+=addStyle(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:textColor}),e+=addStyle(".cesium-credit-lightbox-close:hover",{color:highlightColor$1}),e+=addStyle(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),e+=addStyle(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),e+=addStyle(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),e+=addStyle(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:textColor}),e+=addStyle(".cesium-credit-expand-link:hover",{color:highlightColor$1}),e+=addStyle(".cesium-credit-text",{color:textColor}),e+=addStyle(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});var t=document.head,i=document.createElement("style");i.innerHTML=e,t.insertBefore(i,t.firstChild)}function CreditDisplay(e,t,i){var r=this;i=defaultValue(i,document.body);var n=document.createElement("div");n.className="cesium-credit-lightbox-overlay",i.appendChild(n);var a=document.createElement("div");function o(e){a.contains(e.target)||r.hideLightbox()}a.className="cesium-credit-lightbox",n.appendChild(a),n.addEventListener("click",o,!1);var s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",a.appendChild(s);var l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",a.appendChild(l);var c=document.createElement("ul");a.appendChild(c);var u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);var d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);s=document.createElement("a");s.className="cesium-credit-expand-link",s.onclick=this.showLightbox.bind(this),s.textContent="Data attribution",e.appendChild(s),appendCss();l=Credit.clone(CreditDisplay.cesiumCredit);this._delimiter=defaultValue(t," • "),this._screenContainer=d,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=a,this._creditList=c,this._lightbox=n,this._hideLightbox=o,this._expandLink=s,this._expanded=!1,this._defaultCredits=[],this._cesiumCredit=l,this._previousCesiumCredit=void 0,this._currentCesiumCredit=l,this._currentFrameCredits={screenCredits:new AssociativeArray,lightboxCredits:new AssociativeArray},this._defaultCredit=void 0,this.viewport=i,this.container=e}function getDefaultCredit(){var e;return defined(defaultCredit$3)||(0!==(e=buildModuleUrl("Assets/Images/ion-credit.png")).indexOf("http://")&&0!==e.indexOf("https://")&&0!==e.indexOf("data:")&&(e=new URI(e).getPath()),defaultCredit$3=new Credit('',!0)),CreditDisplay._cesiumCreditInitialized||(CreditDisplay._cesiumCredit=defaultCredit$3,CreditDisplay._cesiumCreditInitialized=!0),defaultCredit$3}function DebugAppearance(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).attributeName,i=e.perInstanceAttribute;defined(i)||(i=!1);var r,n=defaultValue(e.glslDatatype,"vec3"),a="v_"+t;if("normal"===t||"tangent"===t||"bitangent"===t)r="vec4 getColor() { return vec4(("+a+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch(n="st"===t?"vec2":n){case"float":r="vec4 getColor() { return vec4(vec3("+a+"), 1.0); }\n";break;case"vec2":r="vec4 getColor() { return vec4("+a+", 0.0, 1.0); }\n";break;case"vec3":r="vec4 getColor() { return vec4("+a+", 1.0); }\n";break;case"vec4":r="vec4 getColor() { return "+a+"; }\n"}var o="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(i?"":"attribute "+n+" "+t+";\n")+"varying "+n+" "+a+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(i?a+" = czm_batchTable_"+t+"(batchId);\n":a+" = "+t+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",i="varying "+n+" "+a+";\n"+r+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=defaultValue(e.translucent,!1),this._vertexShaderSource=defaultValue(e.vertexShaderSource,o),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,i),this._renderState=Appearance.getDefaultRenderState(!1,!1,e.renderState),this._closed=defaultValue(e.closed,!1),this._attributeName=t,this._glslDatatype=n}function DebugCameraPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=defaultValue(e.color,Color.CYAN),this._updateOnChange=defaultValue(e.updateOnChange,!0),this.show=defaultValue(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}CreditDisplay.prototype.addCredit=function(e){if(e._isIon)return defined(this._defaultCredit)||(this._defaultCredit=Credit.clone(getDefaultCredit())),void(this._currentCesiumCredit=this._defaultCredit);(e.showOnScreen?this._currentFrameCredits.screenCredits:this._currentFrameCredits.lightboxCredits).set(e.id,e)},CreditDisplay.prototype.addDefaultCredit=function(e){var t=this._defaultCredits;contains(t,e)||t.push(e)},CreditDisplay.prototype.removeDefaultCredit=function(e){var t=this._defaultCredits,e=t.indexOf(e);-1!==e&&t.splice(e,1)},CreditDisplay.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},CreditDisplay.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},CreditDisplay.prototype.update=function(){this._expanded&&styleLightboxContainer(this)},CreditDisplay.prototype.beginFrame=function(){var e=this._currentFrameCredits,t=e.screenCredits;t.removeAll();for(var i=this._defaultCredits,r=0;ri[r-1])return tableLastIndex=r-2;if(e>=i[tableLastIndex]){if(tableLastIndex+1=i[tableLastIndex-1])return--tableLastIndex;for(t=0;t=i[t]&&e=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/TimeConstants$1.SECONDS_PER_MILLISECOND;if(2<=e._frameTimes.length&&e._frameTimes[0]<=r){for(;2<=e._frameTimes.length&&e._frameTimes[1]e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup)\s*<\/body>/im,wmsServiceExceptionReportRegex=//im,titleRegex=/([\s\S]*)<\/title>/im;function textToFeatureInfo(e){if(!emptyBodyRegex.test(e)&&!wmsServiceExceptionReportRegex.test(e)){var t,i=titleRegex.exec(e);i&&1<i.length&&(t=i[1]);i=new ImageryLayerFeatureInfo;return i.name=t,i.description=e,i.data=e,[i]}}var GlobeFS="uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_DAY_NIGHT_ALPHA\nuniform float u_dayTextureNightAlpha[TEXTURE_UNITS];\nuniform float u_dayTextureDayAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_COLOR_TO_ALPHA\nuniform vec4 u_colorsToAlpha[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nuniform vec2 u_lightingFadeDistance;\n#endif\n#ifdef TILE_LIMIT_RECTANGLE\nuniform vec4 u_cartographicLimitRectangle;\n#endif\n#ifdef GROUND_ATMOSPHERE\nuniform vec2 u_nightFadeDistance;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nuniform highp sampler2D u_clippingPlanes;\nuniform mat4 u_clippingPlanesMatrix;\nuniform vec4 u_clippingPlanesEdgeStyle;\n#endif\n#if defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nuniform float u_minimumBrightness;\n#endif\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nuniform vec4 u_fillHighlightColor;\n#endif\n#ifdef TRANSLUCENT\nuniform vec4 u_frontFaceAlphaByDistance;\nuniform vec4 u_backFaceAlphaByDistance;\nuniform vec4 u_translucencyRectangle;\n#endif\n#ifdef UNDERGROUND_COLOR\nuniform vec4 u_undergroundColor;\nuniform vec4 u_undergroundColorAlphaByDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_height;\nvarying float v_slope;\nvarying float v_aspect;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nvarying float v_distance;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying vec3 v_fogRayleighColor;\nvarying vec3 v_fogMieColor;\n#endif\n#ifdef GROUND_ATMOSPHERE\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nfloat interpolateByDistance(vec4 nearFarScalar, float distance)\n{\nfloat startDistance = nearFarScalar.x;\nfloat startValue = nearFarScalar.y;\nfloat endDistance = nearFarScalar.z;\nfloat endValue = nearFarScalar.w;\nfloat t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\nreturn mix(startValue, endValue, t);\n}\n#endif\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)\n{\nreturn sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\n}\n#endif\n#ifdef TRANSLUCENT\nbool inTranslucencyRectangle()\n{\nreturn\nv_textureCoordinates.x > u_translucencyRectangle.x &&\nv_textureCoordinates.x < u_translucencyRectangle.z &&\nv_textureCoordinates.y > u_translucencyRectangle.y &&\nv_textureCoordinates.y < u_translucencyRectangle.w;\n}\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureNightAlpha,\nfloat textureDayAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split,\nvec4 colorToAlpha,\nfloat nightBlend)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\ntextureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);\n#endif\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_COLOR_TO_ALPHA\nvec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\ncolorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);\nalpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\n#endif\n#if !defined(APPLY_GAMMA)\nvec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\ncolor = tempColor.rgb;\nalpha = tempColor.a;\n#else\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition;\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\nalpha = 0.0;\n}\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\nalpha = 0.0;\n}\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\noutAlpha += sign(outAlpha) - 1.0;\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, max(outAlpha, 0.0));\n}\nvec3 colorCorrect(vec3 rgb) {\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\n#endif\nreturn rgb;\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\n#ifdef GROUND_ATMOSPHERE\nvec3 computeGroundAtmosphereColor(vec3 fogColor, vec4 finalColor, vec3 atmosphereLightDirection, float cameraDist);\n#endif\nconst float fExposure = 2.0;\nvoid main()\n{\n#ifdef TILE_LIMIT_RECTANGLE\nif (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\nv_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\n{\ndiscard;\n}\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nfloat clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\nfloat nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);\n#else\nfloat nightBlend = 0.0;\n#endif\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nfloat cameraDist;\nif (czm_sceneMode == czm_sceneMode2D)\n{\ncameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\n}\nelse if (czm_sceneMode == czm_sceneModeColumbusView)\n{\ncameraDist = -czm_view[3].z;\n}\nelse\n{\ncameraDist = length(czm_view[3]);\n}\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nif (czm_sceneMode != czm_sceneMode3D) {\nvec3 radii = czm_ellipsoidRadii;\nfloat maxRadii = max(radii.x, max(radii.y, radii.z));\nfadeOutDist -= maxRadii;\nfadeInDist -= maxRadii;\n}\nfloat fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#else\nfloat fade = 0.0;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nwaterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);\n}\n#endif\n#ifdef APPLY_MATERIAL\nczm_materialInput materialInput;\nmaterialInput.st = v_textureCoordinates.st;\nmaterialInput.normalEC = normalize(v_normalEC);\nmaterialInput.slope = v_slope;\nmaterialInput.height = v_height;\nmaterialInput.aspect = v_aspect;\nczm_material material = czm_getMaterial(materialInput);\nvec4 materialColor = vec4(material.diffuse, material.alpha);\ncolor = alphaBlend(materialColor, color);\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, fade);\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nvec4 clippingPlanesEdgeColor = vec4(1.0);\nclippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\nfloat clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\nif (clipDistance < clippingPlanesEdgeWidth)\n{\nfinalColor = clippingPlanesEdgeColor;\n}\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nfinalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvec3 fogColor = colorCorrect(v_fogMieColor) + finalColor.rgb * colorCorrect(v_fogRayleighColor);\n#ifndef HDR\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\n#endif\n#endif\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\nvec3 atmosphereLightDirection = czm_sunDirectionWC;\n#else\nvec3 atmosphereLightDirection = czm_lightDirectionWC;\n#endif\n#ifdef FOG\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nfloat darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);\nfogColor *= darken;\n#endif\n#ifdef HDR\nconst float modifier = 0.15;\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor, modifier), finalColor.a);\n#else\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#endif\n#endif\n#ifdef GROUND_ATMOSPHERE\nif (!czm_backFacing())\n{\nvec3 groundAtmosphereColor = computeGroundAtmosphereColor(fogColor, finalColor, atmosphereLightDirection, cameraDist);\nfinalColor = vec4(mix(finalColor.rgb, groundAtmosphereColor, fade), finalColor.a);\n}\n#endif\n#ifdef UNDERGROUND_COLOR\nif (czm_backFacing())\n{\nfloat distanceFromEllipsoid = max(czm_eyeHeight, 0.0);\nfloat distance = max(v_distance - distanceFromEllipsoid, 0.0);\nfloat blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);\nvec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);\nfinalColor = alphaBlend(undergroundColor, finalColor);\n}\n#endif\n#ifdef TRANSLUCENT\nif (inTranslucencyRectangle())\n{\nvec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\nfinalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\n}\n#endif\ngl_FragColor = finalColor;\n}\n#ifdef GROUND_ATMOSPHERE\nvec3 computeGroundAtmosphereColor(vec3 fogColor, vec4 finalColor, vec3 atmosphereLightDirection, float cameraDist)\n{\n#if defined(PER_FRAGMENT_GROUND_ATMOSPHERE) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\nfloat mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);\nvec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\nxy *= czm_viewport.zw * mpp * 0.5;\nvec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\nczm_ray ray = czm_ray(vec3(0.0), direction);\nvec3 ellipsoid_center = czm_view[3].xyz;\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\nvec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\nellipsoidPosition = (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(ellipsoidPosition, true, atmosphereLightDirection);\nvec3 groundAtmosphereColor = colorCorrect(atmosColor.mie) + finalColor.rgb * colorCorrect(atmosColor.rayleigh);\n#ifndef HDR\ngroundAtmosphereColor = vec3(1.0) - exp(-fExposure * groundAtmosphereColor);\n#endif\nfloat fadeInDist = u_nightFadeDistance.x;\nfloat fadeOutDist = u_nightFadeDistance.y;\nfloat sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#ifdef HDR\nsunlitAtmosphereIntensity = max(sunlitAtmosphereIntensity * sunlitAtmosphereIntensity, 0.03);\n#endif\ngroundAtmosphereColor = mix(groundAtmosphereColor, fogColor, sunlitAtmosphereIntensity);\n#else\nvec3 groundAtmosphereColor = fogColor;\n#endif\n#ifdef HDR\ngroundAtmosphereColor = czm_saturation(groundAtmosphereColor, 1.6);\n#endif\nreturn groundAtmosphereColor;\n}\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\n#ifdef HDR\nspecular *= 1.4;\nfloat e = 0.2;\nfloat d = 3.3;\nfloat c = 1.7;\nvec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\n#else\nvec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\n#endif\nreturn vec4(color, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n",GlobeVS="#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_slope;\nvarying float v_aspect;\nvarying float v_height;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nvarying float v_distance;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying vec3 v_fogMieColor;\nvarying vec3 v_fogRayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nvec3 normalMC = czm_octDecode(encodedNormal);\nv_normalMC = normalMC;\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION) || defined(HDR)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nAtmosphereColor atmosFogColor = computeGroundAtmosphereFromSpace(position3DWC, false, vec3(0.0));\nv_fogMieColor = atmosFogColor.mie;\nv_fogRayleighColor = atmosFogColor.rayleigh;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n#ifdef APPLY_MATERIAL\nfloat northPoleZ = czm_ellipsoidRadii.z;\nvec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\nvec3 ellipsoidNormal = normalize(v_positionMC);\nvec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\nfloat dotProd = abs(dot(ellipsoidNormal, v_normalMC));\nv_slope = acos(dotProd);\nvec3 normalRejected = ellipsoidNormal * dotProd;\nvec3 normalProjected = v_normalMC - normalRejected;\nvec3 aspectVector = normalize(normalProjected);\nv_aspect = acos(dot(aspectVector, vectorEastMC));\nfloat determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\nv_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\nv_height = height;\n#endif\n}\n",GroundAtmosphere="const float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst vec3 v3InvWavelength = vec3(5.60204474633241, 9.473284437923038, 19.64380261047721);\nconst float fScaleDepth = 0.25;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos, bool dynamicLighting, vec3 lightDirectionWC)\n{\nfloat fInnerRadius = czm_ellipsoidRadii.x;\nfloat fOuterRadius = czm_ellipsoidRadii.x * 1.025;\nfloat fOuterRadius2 = fOuterRadius * fOuterRadius;\nfloat fScale = 1.0 / (fOuterRadius - fInnerRadius);\nfloat fScaleOverScaleDepth = fScale / fScaleDepth;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = czm_branchFreeTernary(dynamicLighting, dot(lightDirectionWC, v3Pos) / length(v3Pos), 1.0);\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n";function GlobeSurfaceShader(e,t,i,r,n){this.numberOfDayTextures=e,this.flags=t,this.material=i,this.shaderProgram=r,this.clippingShaderState=n}function GlobeSurfaceShaderSet(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function getPositionMode(e){var t;switch(e){case SceneMode$1.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case SceneMode$1.SCENE2D:case SceneMode$1.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case SceneMode$1.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}function get2DYPositionFraction(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}GlobeSurfaceShaderSet.prototype.getShaderProgram=function(e){var t=e.frameState,i=e.surfaceTile,r=e.numberOfDayTextures,n=e.applyBrightness,a=e.applyContrast,o=e.applyHue,s=e.applySaturation,l=e.applyGamma,c=e.applyAlpha,u=e.applyDayNightAlpha,d=e.applySplit,h=e.showReflectiveOcean,p=e.showOceanWaves,m=e.enableLighting,f=e.dynamicAtmosphereLighting,g=e.dynamicAtmosphereLightingFromSun,_=e.showGroundAtmosphere,y=e.perFragmentGroundAtmosphere,C=e.hasVertexNormals,v=e.useWebMercatorProjection,S=e.enableFog,T=e.enableClippingPlanes,x=e.clippingPlanes,b=e.clippedByBoundaries,E=e.hasImageryLayerCutout,P=e.colorCorrect,A=e.highlightFillTile,w=e.colorToAlpha,D=e.showUndergroundColor,M=e.translucent,I=0,R="",O=i.renderedMesh.encoding;O.quantization===TerrainQuantization$1.BITS12&&(I=1,R="QUANTIZATION_BITS12");var L=0,F="";b&&(L=1,F="TILE_LIMIT_RECTANGLE");var N=0,B="";E&&(N=1,B="APPLY_IMAGERY_CUTOUT");var V=t.mode,k=V|n<<2|a<<3|o<<4|s<<5|l<<6|c<<7|h<<8|p<<9|m<<10|f<<11|g<<12|_<<13|y<<14|C<<15|v<<16|S<<17|I<<18|d<<19|T<<20|L<<21|N<<22|P<<23|A<<24|w<<25|D<<26|M<<27|u<<28,e=0;if(defined(x)&&0<x.length&&(e=T?x.clippingPlanesState:0),defined(b=i.surfaceShader)&&b.numberOfDayTextures===r&&b.flags===k&&b.material===this.material&&b.clippingShaderState===e)return b.shaderProgram;I=this._shadersByTexturesFlags[r];if(defined(I)||(I=this._shadersByTexturesFlags[r]=[]),!defined(b=I[k])||b.material!==this.material||b.clippingShaderState!==e){L=this.baseVertexShaderSource.clone(),N=this.baseFragmentShaderSource.clone();0!==e&&N.sources.unshift(getClippingFunction(x,t.context)),L.defines.push(R),N.defines.push("TEXTURE_UNITS "+r,F,B),n&&N.defines.push("APPLY_BRIGHTNESS"),a&&N.defines.push("APPLY_CONTRAST"),o&&N.defines.push("APPLY_HUE"),s&&N.defines.push("APPLY_SATURATION"),l&&N.defines.push("APPLY_GAMMA"),c&&N.defines.push("APPLY_ALPHA"),u&&N.defines.push("APPLY_DAY_NIGHT_ALPHA"),h&&(N.defines.push("SHOW_REFLECTIVE_OCEAN"),L.defines.push("SHOW_REFLECTIVE_OCEAN")),p&&N.defines.push("SHOW_OCEAN_WAVES"),w&&N.defines.push("APPLY_COLOR_TO_ALPHA"),D&&(L.defines.push("UNDERGROUND_COLOR"),N.defines.push("UNDERGROUND_COLOR")),M&&(L.defines.push("TRANSLUCENT"),N.defines.push("TRANSLUCENT")),m&&(C?(L.defines.push("ENABLE_VERTEX_LIGHTING"),N.defines.push("ENABLE_VERTEX_LIGHTING")):(L.defines.push("ENABLE_DAYNIGHT_SHADING"),N.defines.push("ENABLE_DAYNIGHT_SHADING"))),f&&(N.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),g&&N.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN")),_&&(L.defines.push("GROUND_ATMOSPHERE"),N.defines.push("GROUND_ATMOSPHERE"),y&&N.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE")),L.defines.push("INCLUDE_WEB_MERCATOR_Y"),N.defines.push("INCLUDE_WEB_MERCATOR_Y"),S&&(L.defines.push("FOG"),N.defines.push("FOG")),d&&N.defines.push("APPLY_SPLIT"),T&&N.defines.push("ENABLE_CLIPPING_PLANES"),P&&N.defines.push("COLOR_CORRECT"),A&&N.defines.push("HIGHLIGHT_FILL_TILE");var z=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)\n {\n vec4 color = initialColor;\n";E&&(z+=" vec4 cutoutAndColorResult;\n bool texelUnclipped;\n");for(var $=0;$<r;++$)z+=E?" cutoutAndColorResult = u_dayTextureCutoutRectangles["+$+"];\n texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\n cutoutAndColorResult = sampleAndBlend(\n":" color = sampleAndBlend(\n",z+=" color,\n u_dayTextures["+$+"],\n u_dayTextureUseWebMercatorT["+$+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+$+"],\n u_dayTextureTranslationAndScale["+$+"],\n "+(c?"u_dayTextureAlpha["+$+"]":"1.0")+",\n "+(u?"u_dayTextureNightAlpha["+$+"]":"1.0")+",\n"+(u?"u_dayTextureDayAlpha["+$+"]":"1.0")+",\n"+(n?"u_dayTextureBrightness["+$+"]":"0.0")+",\n "+(a?"u_dayTextureContrast["+$+"]":"0.0")+",\n "+(o?"u_dayTextureHue["+$+"]":"0.0")+",\n "+(s?"u_dayTextureSaturation["+$+"]":"0.0")+",\n "+(l?"u_dayTextureOneOverGamma["+$+"]":"0.0")+",\n "+(d?"u_dayTextureSplit["+$+"]":"0.0")+",\n "+(w?"u_colorsToAlpha["+$+"]":"vec4(0.0)")+",\n nightBlend );\n",E&&(z+=" color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n");z+=" return color;\n }",N.sources.push(z),L.sources.push(getPositionMode(V)),L.sources.push(get2DYPositionFraction(v));O=ShaderProgram.fromCache({context:t.context,vertexShaderSource:L,fragmentShaderSource:N,attributeLocations:O.getAttributeLocations()}),b=I[k]=new GlobeSurfaceShader(r,k,this.material,O,e)}return(i.surfaceShader=b).shaderProgram},GlobeSurfaceShaderSet.prototype.destroy=function(){var e,t,i,r=this._shadersByTexturesFlags;for(i in r)if(r.hasOwnProperty(i)){var n=r[i];if(defined(n))for(e in n)n.hasOwnProperty(e)&&defined(t=n[e])&&t.shaderProgram.destroy()}return destroyObject(this)};var ImageryState={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ImageryState$1=Object.freeze(ImageryState),QuadtreeTileLoadState={START:0,LOADING:1,DONE:2,FAILED:3},QuadtreeTileLoadState$1=Object.freeze(QuadtreeTileLoadState),TerrainState={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},TerrainState$1=Object.freeze(TerrainState);function GlobeSurfaceTile(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new Cartesian4(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.orientedBoundingBox=void 0,this.boundingVolumeSourceTile=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new Cartesian3,this.terrainState=TerrainState$1.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new BoundingSphere,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}function getPosition(e,t,i,r,n,a){return e.decodePosition(r,n,a),defined(t)&&t!==SceneMode$1.SCENE3D&&(t=i.ellipsoid.cartesianToCartographic(a),i.project(t,a),Cartesian3.fromElements(a.z,a.x,a.y,a)),a}Object.defineProperties(GlobeSurfaceTile.prototype,{eligibleForUnloading:{get:function(){for(var e=this.terrainState,t=!(e===TerrainState$1.RECEIVING||e===TerrainState$1.TRANSFORMING),i=this.imagery,r=0,n=i.length;t&&r<n;++r)var a=i[r],t=!defined(a.loadingImagery)||a.loadingImagery.state!==ImageryState$1.TRANSITIONING;return t}},renderedMesh:{get:function(){return defined(this.vertexArray)?this.mesh:defined(this.fill)?this.fill.mesh:void 0}}});var scratchV0=new Cartesian3,scratchV1=new Cartesian3,scratchV2=new Cartesian3;function prepareNewTile(e,t,i){var r,n,a=t.getTileDataAvailable(e.x,e.y,e.level);defined(a)||!defined(e.parent)||defined(n=(r=e.parent).data)&&defined(n.terrainData)&&(a=n.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)),!1===a&&(e.data.terrainState=TerrainState$1.FAILED);for(var o=0,s=i.length;o<s;++o){var l=i.get(o);l.show&&l._createTileImagerySkeletons(e,t)}}function processTerrainStateMachine(e,t,i,r,n){var a=e.data,o=e.parent;a.terrainState===TerrainState$1.FAILED&&void 0!==o&&(void 0!==o.data&&void 0!==o.data.terrainData&&!1!==o.data.terrainData.canUpsample||GlobeSurfaceTile.processStateMachine(o,t,i,r,!0)),a.terrainState===TerrainState$1.FAILED&&upsample(a,e,t,i,e.x,e.y,e.level),a.terrainState===TerrainState$1.UNLOADED&&requestTileGeometry(a,i,e.x,e.y,e.level),a.terrainState===TerrainState$1.RECEIVED&&transform(a,t,i,e.x,e.y,e.level),a.terrainState===TerrainState$1.TRANSFORMED&&createResources$2(a,t.context,i,e.x,e.y,e.level,n),a.terrainState>=TerrainState$1.RECEIVED&&void 0===a.waterMaskTexture&&i.hasWaterMask&&(void 0!==a.terrainData.waterMask?createWaterMaskTextureIfNeeded(t.context,a):defined(t=a._findAncestorTileWithTerrainData(e))&&defined(t.data.waterMaskTexture)&&(a.waterMaskTexture=t.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,t,a.waterMaskTranslationAndScale)))}function upsample(t,e,i,r,n,a,o){var s,l,c,u=e.parent;u?(s=u.data.terrainData,l=u.x,c=u.y,u=u.level,!defined(s)||defined(o=s.upsample(r.tilingScheme,l,c,u,n,a,o))&&(t.terrainState=TerrainState$1.RECEIVING,when(o,function(e){t.terrainData=e,t.terrainState=TerrainState$1.RECEIVED},function(){t.terrainState=TerrainState$1.FAILED}))):e.state=QuadtreeTileLoadState$1.FAILED}function requestTileGeometry(t,i,r,n,a){function o(e){t.terrainData=e,t.terrainState=TerrainState$1.RECEIVED,t.request=void 0}function s(){if(t.request.state===RequestState$1.CANCELLED)return t.terrainData=void 0,t.terrainState=TerrainState$1.UNLOADED,void(t.request=void 0);t.terrainState=TerrainState$1.FAILED,t.request=void 0;var e="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+a+".";i._requestError=TileProviderError.handleError(i._requestError,i,i.errorEvent,e,r,n,a,l)}function l(){var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.TERRAIN});t.request=e;e=i.requestTileGeometry(r,n,a,e);defined(e)?(t.terrainState=TerrainState$1.RECEIVING,when(e,o,s)):(t.terrainState=TerrainState$1.UNLOADED,t.request=void 0)}l()}GlobeSurfaceTile.prototype.pick=function(e,t,i,r,n){var a=this.renderedMesh;if(defined(a)){for(var o=a.vertices,s=a.indices,l=a.encoding,c=s.length,u=Number.MAX_VALUE,d=0;d<c;d+=3){var h=s[d],p=s[d+1],m=s[d+2],h=getPosition(l,t,i,o,h,scratchV0),p=getPosition(l,t,i,o,p,scratchV1),m=getPosition(l,t,i,o,m,scratchV2),m=IntersectionTests.rayTriangleParametric(e,h,p,m,r);defined(m)&&m<u&&0<=m&&(u=m)}return u!==Number.MAX_VALUE?Ray.getPoint(e,u,n):void 0}},GlobeSurfaceTile.prototype.freeResources=function(){defined(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=TerrainState$1.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();for(var e=this.imagery,t=0,i=e.length;t<i;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()},GlobeSurfaceTile.prototype.freeVertexArray=function(){GlobeSurfaceTile._freeVertexArray(this.vertexArray),this.vertexArray=void 0,GlobeSurfaceTile._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0},GlobeSurfaceTile.initialize=function(e,t,i){defined(e.data)||(e.data=new GlobeSurfaceTile),e.state===QuadtreeTileLoadState$1.START&&(prepareNewTile(e,t,i),e.state=QuadtreeTileLoadState$1.LOADING)},GlobeSurfaceTile.processStateMachine=function(e,t,i,r,n,a){GlobeSurfaceTile.initialize(e,i,r);var o=e.data;if(e.state===QuadtreeTileLoadState$1.LOADING&&processTerrainStateMachine(e,t,i,r,n),!a){n=e.renderable;e.renderable=defined(o.vertexArray);a=o.terrainState===TerrainState$1.READY;e.upsampledFromParent=defined(o.terrainData)&&o.terrainData.wasCreatedByUpsampling();t=o.processImagery(e,i,t);if(a&&t){var s,l=e._loadedCallbacks,c={};for(s in l)l.hasOwnProperty(s)&&(l[s](e)||(c[s]=l[s]));e._loadedCallbacks=c,e.state=QuadtreeTileLoadState$1.DONE}n&&(e.renderable=!0)}},GlobeSurfaceTile.prototype.processImagery=function(e,t,i,r){for(var n=e.data,a=e.upsampledFromParent,o=!1,s=!0,l=n.imagery,c=0,u=l.length;c<u;++c){var d=l[c];if(defined(d.loadingImagery)){if(d.loadingImagery.state===ImageryState$1.PLACEHOLDER){var h=d.loadingImagery.imageryLayer;if(h.imageryProvider.ready){d.freeResources(),l.splice(c,1),h._createTileImagerySkeletons(e,t,c),--c,u=l.length;continue}a=!1}h=d.processStateMachine(e,i,r),s=s&&h,o=o||h||defined(d.readyImagery),a=a&&defined(d.loadingImagery)&&(d.loadingImagery.state===ImageryState$1.FAILED||d.loadingImagery.state===ImageryState$1.INVALID)}else a=!1}return e.upsampledFromParent=a,e.renderable=e.renderable&&(o||s),s};var scratchCreateMeshOptions={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,throttle:!0};function transform(t,e,i,r,n,a){var o=i.tilingScheme,i=scratchCreateMeshOptions;i.tilingScheme=o,i.x=r,i.y=n,i.level=a,i.exaggeration=e.terrainExaggeration,i.throttle=!0;i=t.terrainData.createMesh(i);defined(i)&&(t.terrainState=TerrainState$1.TRANSFORMING,when(i,function(e){t.mesh=e,t.orientedBoundingBox=OrientedBoundingBox.clone(e.orientedBoundingBox,t.orientedBoundingBox),t.occludeePointInScaledSpace=Cartesian3.clone(e.occludeePointInScaledSpace,t.occludeePointInScaledSpace),t.terrainState=TerrainState$1.TRANSFORMED},function(){t.terrainState=TerrainState$1.FAILED}))}function createResources$2(e,t,i,r,n,a,o){e.vertexArray=GlobeSurfaceTile._createVertexArrayForMesh(t,e.mesh),e.terrainState=TerrainState$1.READY,e.fill=e.fill&&e.fill.destroy(o)}function getContextWaterMaskData(e){var t,i=e.cache.tile_waterMaskData;return defined(i)||((t=Texture.create({context:e,pixelFormat:PixelFormat$1.LUMINANCE,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}})).referenceCount=1,i={allWaterTexture:t,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR}),destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=i),i}function createWaterMaskTextureIfNeeded(e,t){var i=t.terrainData.waterMask,r=getContextWaterMaskData(e),n=i.length;if(1===n){if(0===i[0])return;a=r.allWaterTexture}else{var a,n=Math.sqrt(n);(a=Texture.create({context:e,pixelFormat:PixelFormat$1.LUMINANCE,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{width:n,height:n,arrayBufferView:i},sampler:r.sampler,flipY:!1})).referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,Cartesian4.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}GlobeSurfaceTile._createVertexArrayForMesh=function(e,t){var i=t.vertices,r=Buffer$1.createVertexBuffer({context:e,typedArray:i,usage:BufferUsage$1.STATIC_DRAW}),n=t.encoding.getAttributes(r),a=t.indices.indexBuffers||{},i=a[e.id];return!defined(i)||i.isDestroyed()?(r=t.indices,(i=Buffer$1.createIndexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.fromSizeInBytes(r.BYTES_PER_ELEMENT)})).vertexArrayDestroyable=!1,i.referenceCount=1,a[e.id]=i,t.indices.indexBuffers=a):++i.referenceCount,new VertexArray({context:e,attributes:n,indexBuffer:i})},GlobeSurfaceTile._freeVertexArray=function(e){var t;defined(e)&&(t=e.indexBuffer,e.destroy(),defined(t)&&!t.isDestroyed()&&defined(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy()))},GlobeSurfaceTile.prototype._findAncestorTileWithTerrainData=function(e){for(var t=e.parent;defined(t)&&(!defined(t.data)||!defined(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t},GlobeSurfaceTile.prototype._computeWaterMaskTranslationAndScale=function(e,t,i){var r=t.rectangle,n=e.rectangle,a=n.width,o=n.height,t=a/r.width,e=o/r.height;return i.x=t*(n.west-r.west)/a,i.y=e*(n.south-r.south)/o,i.z=t,i.w=e,i};var ReprojectWebMercatorFS="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n",ReprojectWebMercatorVS="attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n";function Imagery(e,t,i,r,n){var a,o,s;this.imageryLayer=e,this.x=t,this.y=i,this.level=r,this.request=void 0,0!==r&&(a=t/2|0,o=i/2|0,s=r-1,this.parent=e.getImageryFromCache(a,o,s)),this.state=ImageryState$1.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!defined(n)&&e.imageryProvider.ready&&(n=e.imageryProvider.tilingScheme.tileXYToRectangle(t,i,r)),this.rectangle=n}Imagery.createPlaceholder=function(e){e=new Imagery(e,0,0,0);return e.addReference(),e.state=ImageryState$1.PLACEHOLDER,e},Imagery.prototype.addReference=function(){++this.referenceCount},Imagery.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),defined(this.parent)&&this.parent.releaseReference(),defined(this.image)&&defined(this.image.destroy)&&this.image.destroy(),defined(this.texture)&&this.texture.destroy(),defined(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),destroyObject(this),0):this.referenceCount},Imagery.prototype.processStateMachine=function(e,t,i){this.state!==ImageryState$1.UNLOADED||i||(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ImageryState$1.RECEIVED&&(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));i=this.state===ImageryState$1.READY&&t&&!this.texture;this.state!==ImageryState$1.TEXTURE_LOADED&&!i||(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var ImagerySplitDirection={LEFT:-1,NONE:0,RIGHT:1},ImagerySplitDirection$1=Object.freeze(ImagerySplitDirection);function TileImagery(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}function ImageryLayer(e,t){this._imageryProvider=e,t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.alpha=defaultValue(t.alpha,defaultValue(e.defaultAlpha,1)),this.nightAlpha=defaultValue(t.nightAlpha,defaultValue(e.defaultNightAlpha,1)),this.dayAlpha=defaultValue(t.dayAlpha,defaultValue(e.defaultDayAlpha,1)),this.brightness=defaultValue(t.brightness,defaultValue(e.defaultBrightness,ImageryLayer.DEFAULT_BRIGHTNESS)),this.contrast=defaultValue(t.contrast,defaultValue(e.defaultContrast,ImageryLayer.DEFAULT_CONTRAST)),this.hue=defaultValue(t.hue,defaultValue(e.defaultHue,ImageryLayer.DEFAULT_HUE)),this.saturation=defaultValue(t.saturation,defaultValue(e.defaultSaturation,ImageryLayer.DEFAULT_SATURATION)),this.gamma=defaultValue(t.gamma,defaultValue(e.defaultGamma,ImageryLayer.DEFAULT_GAMMA)),this.splitDirection=defaultValue(t.splitDirection,defaultValue(e.defaultSplit,ImageryLayer.DEFAULT_SPLIT)),this.minificationFilter=defaultValue(t.minificationFilter,defaultValue(e.defaultMinificationFilter,ImageryLayer.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=defaultValue(t.magnificationFilter,defaultValue(e.defaultMagnificationFilter,ImageryLayer.DEFAULT_MAGNIFICATION_FILTER)),this.show=defaultValue(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=defaultValue(t.rectangle,Rectangle.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new TileImagery(Imagery.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=defaultValue(t.colorToAlphaThreshold,ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}TileImagery.prototype.freeResources=function(){defined(this.readyImagery)&&this.readyImagery.releaseReference(),defined(this.loadingImagery)&&this.loadingImagery.releaseReference()},TileImagery.prototype.processStateMachine=function(e,t,i){var r=this.loadingImagery,n=r.imageryLayer;if(r.processStateMachine(t,!this.useWebMercatorT,i),r.state===ImageryState$1.READY)return defined(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this),!0;for(var a,o=r.parent;defined(o)&&(o.state!==ImageryState$1.READY||!this.useWebMercatorT&&!defined(o.texture));)o.state!==ImageryState$1.FAILED&&o.state!==ImageryState$1.INVALID&&(a=a||o),o=o.parent;return this.readyImagery!==o&&(defined(this.readyImagery)&&this.readyImagery.releaseReference(),defined(this.readyImagery=o)&&(o.addReference(),this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this))),(r.state===ImageryState$1.FAILED||r.state===ImageryState$1.INVALID)&&(!defined(a)||(a.processStateMachine(t,!this.useWebMercatorT,i),!1))},Object.defineProperties(ImageryLayer.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),ImageryLayer.DEFAULT_BRIGHTNESS=1,ImageryLayer.DEFAULT_CONTRAST=1,ImageryLayer.DEFAULT_HUE=0,ImageryLayer.DEFAULT_SATURATION=1,ImageryLayer.DEFAULT_GAMMA=1,ImageryLayer.DEFAULT_SPLIT=ImagerySplitDirection$1.NONE,ImageryLayer.DEFAULT_MINIFICATION_FILTER=TextureMinificationFilter$1.LINEAR,ImageryLayer.DEFAULT_MAGNIFICATION_FILTER=TextureMagnificationFilter$1.LINEAR,ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004,ImageryLayer.prototype.isBaseLayer=function(){return this._isBaseLayer},ImageryLayer.prototype.isDestroyed=function(){return!1},ImageryLayer.prototype.destroy=function(){return destroyObject(this)};var imageryBoundsScratch=new Rectangle,tileImageryBoundsScratch=new Rectangle,clippedRectangleScratch=new Rectangle,terrainRectangleScratch=new Rectangle;function getSamplerKey(e,t,i){return e+":"+t+":"+i}function getImageryCacheKey(e,t,i){return JSON.stringify([e,t,i])}ImageryLayer.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return Rectangle.intersection(e.rectangle,t)})},ImageryLayer.prototype._createTileImagerySkeletons=function(e,t,i){var r=e.data;if(defined(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(defined(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var n=this._imageryProvider;if(defined(i)||(i=r.imagery.length),!n.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;var a=n.tilingScheme.projection instanceof WebMercatorProjection&&e.rectangle.north<WebMercatorProjection.MaximumLatitude&&e.rectangle.south>-WebMercatorProjection.MaximumLatitude,o=Rectangle.intersection(n.rectangle,this._rectangle,imageryBoundsScratch);if(!defined(c=Rectangle.intersection(e.rectangle,o,tileImageryBoundsScratch))){if(!this.isBaseLayer())return!1;var s=o,l=e.rectangle,c=tileImageryBoundsScratch;l.south>=s.north?c.north=c.south=s.north:l.north<=s.south?c.north=c.south=s.south:(c.south=Math.max(l.south,s.south),c.north=Math.min(l.north,s.north)),l.west>=s.east?c.west=c.east=s.east:l.east<=s.west?c.west=c.east=s.west:(c.west=Math.max(l.west,s.west),c.east=Math.min(l.east,s.east))}s=0;0<c.south?s=c.south:c.north<0&&(s=c.north);var u=getLevelWithMaximumTexelSpacing(this,+t.getLevelMaximumGeometricError(e.level),s),u=Math.max(0,u),s=n.maximumLevel;s<u&&(u=s),!defined(n.minimumLevel)||u<(s=n.minimumLevel)&&(u=s);var n=n.tilingScheme,d=n.positionToTileXY(Rectangle.northwest(c),u),h=n.positionToTileXY(Rectangle.southeast(c),u),p=e.rectangle.width/512,m=e.rectangle.height/512,c=n.tileXYToRectangle(d.x,d.y,u);Math.abs(c.south-e.rectangle.north)<m&&d.y<h.y&&++d.y,Math.abs(c.east-e.rectangle.west)<p&&d.x<h.x&&++d.x;c=n.tileXYToRectangle(h.x,h.y,u);Math.abs(c.north-e.rectangle.south)<m&&h.y>d.y&&--h.y,Math.abs(c.west-e.rectangle.east)<p&&h.x>d.x&&--h.x;var f,g,_=Rectangle.clone(e.rectangle,terrainRectangleScratch),y=n.tileXYToRectangle(d.x,d.y,u),C=Rectangle.intersection(y,o,clippedRectangleScratch);a?(n.rectangleToNativeRectangle(_,_),n.rectangleToNativeRectangle(y,y),n.rectangleToNativeRectangle(C,C),n.rectangleToNativeRectangle(o,o),f=n.tileXYToNativeRectangle.bind(n),p=_.width/512,m=_.height/512):f=n.tileXYToRectangle.bind(n);var v=0,S=1;!this.isBaseLayer()&&Math.abs(C.west-_.west)>=p&&(v=Math.min(1,(C.west-_.west)/_.width));for(var T=S=!this.isBaseLayer()&&Math.abs(C.north-_.north)>=m?Math.max(0,(C.north-_.south)/_.height):S,x=d.x;x<=h.x;x++)if(g=v,y=f(x,d.y,u),defined(C=Rectangle.simpleIntersection(y,o,clippedRectangleScratch))){v=Math.min(1,(C.east-_.west)/_.width),x===h.x&&(this.isBaseLayer()||Math.abs(C.east-_.east)<p)&&(v=1),S=T;for(var b=d.y;b<=h.y;b++){var E,P=S,y=f(x,b,u);defined(C=Rectangle.simpleIntersection(y,o,clippedRectangleScratch))&&(S=Math.max(0,(C.south-_.south)/_.height),E=new Cartesian4(g,S=b===h.y&&(this.isBaseLayer()||Math.abs(C.south-_.south)<m)?0:S,v,P),P=this.getImageryFromCache(x,b,u),r.imagery.splice(i,0,new TileImagery(P,E,a)),++i)}}return!0},ImageryLayer.prototype._calculateTextureTranslationAndScale=function(e,t){var i=t.readyImagery.rectangle,r=e.rectangle;t.useWebMercatorT&&(i=(a=t.readyImagery.imageryLayer.imageryProvider.tilingScheme).rectangleToNativeRectangle(i,imageryBoundsScratch),r=a.rectangleToNativeRectangle(r,terrainRectangleScratch));var n=r.width,e=r.height,t=n/i.width,a=e/i.height;return new Cartesian4(t*(r.west-i.west)/n,a*(r.south-i.south)/e,t,a)},ImageryLayer.prototype._requestImagery=function(i){var r=this._imageryProvider,n=this;function t(e){if(!defined(e))return a();i.image=e,i.state=ImageryState$1.RECEIVED,i.request=void 0,TileProviderError.handleSuccess(n._requestImageError)}function a(e){if(i.request.state===RequestState$1.CANCELLED)return i.state=ImageryState$1.UNLOADED,void(i.request=void 0);i.state=ImageryState$1.FAILED,i.request=void 0;var t="Failed to obtain image tile X: "+i.x+" Y: "+i.y+" Level: "+i.level+".";n._requestImageError=TileProviderError.handleError(n._requestImageError,r,r.errorEvent,t,i.x,i.y,i.level,o,e)}function o(){var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.IMAGERY});i.request=e,i.state=ImageryState$1.TRANSITIONING;e=r.requestImage(i.x,i.y,i.level,e);if(!defined(e))return i.state=ImageryState$1.UNLOADED,void(i.request=void 0);defined(r.getTileCredits)&&(i.credits=r.getTileCredits(i.x,i.y,i.level)),when(e,t,a)}o()},ImageryLayer.prototype._createTextureWebGL=function(e,t){var i=new Sampler({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),t=t.image;return defined(t.internalFormat)?new Texture({context:e,pixelFormat:t.internalFormat,width:t.width,height:t.height,source:{arrayBufferView:t.bufferView},sampler:i}):new Texture({context:e,source:t,pixelFormat:this._imageryProvider.hasAlphaChannel?PixelFormat$1.RGBA:PixelFormat$1.RGB,sampler:i})},ImageryLayer.prototype._createTexture=function(e,t){var i=this._imageryProvider,r=t.image;if(defined(i.tileDiscardPolicy)){var n=i.tileDiscardPolicy;if(defined(n)){if(!n.isReady())return void(t.state=ImageryState$1.RECEIVED);if(n.shouldDiscardImage(r))return void(t.state=ImageryState$1.INVALID)}}e=this._createTextureWebGL(e,t);i.tilingScheme.projection instanceof WebMercatorProjection?t.textureWebMercator=e:t.texture=e,t.image=void 0,t.state=ImageryState$1.TEXTURE_LOADED},ImageryLayer.prototype._finalizeReprojectTexture=function(e,t){var i,r,n,a,o=this.minificationFilter,s=this.magnificationFilter;o===TextureMinificationFilter$1.LINEAR&&s===TextureMagnificationFilter$1.LINEAR&&!PixelFormat$1.isCompressedFormat(t.pixelFormat)&&CesiumMath.isPowerOfTwo(t.width)&&CesiumMath.isPowerOfTwo(t.height)?(o=TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR,a=ContextLimits.maximumTextureFilterAnisotropy,i=getSamplerKey(o,s,n=Math.min(a,defaultValue(this._maximumAnisotropy,a))),defined(r=e.cache.imageryLayerMipmapSamplers)||(r={},e.cache.imageryLayerMipmapSamplers=r),defined(a=r[i])||(a=r[i]=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:o,magnificationFilter:s,maximumAnisotropy:n})),t.generateMipmap(MipmapHint$1.NICEST),t.sampler=a):(n=getSamplerKey(o,s,0),defined(a=e.cache.imageryLayerNonMipmapSamplers)||(a={},e.cache.imageryLayerNonMipmapSamplers=a),defined(e=a[n])||(e=a[n]=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:o,magnificationFilter:s})),t.sampler=e)},ImageryLayer.prototype._reprojectTexture=function(e,t,i){var r,n=t.textureWebMercator||t.texture,a=t.rectangle,o=e.context;(i=defaultValue(i,!0))&&!(this._imageryProvider.tilingScheme.projection instanceof GeographicProjection)&&1e-5<a.width/n.width?(r=this,t.addReference(),a=new ComputeCommand({persists:!0,owner:this,preExecute:function(e){reprojectToGeographic(e,o,n,t.rectangle)},postExecute:function(e){t.texture=e,r._finalizeReprojectTexture(o,e),t.state=ImageryState$1.READY,t.releaseReference()},canceled:function(){t.state=ImageryState$1.TEXTURE_LOADED,t.releaseReference()}}),this._reprojectComputeCommands.push(a)):(i&&(t.texture=n),this._finalizeReprojectTexture(o,n),t.state=ImageryState$1.READY)},ImageryLayer.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},ImageryLayer.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){defined(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0},ImageryLayer.prototype.getImageryFromCache=function(e,t,i,r){var n=getImageryCacheKey(e,t,i),a=this._imageryCache[n];return defined(a)||(a=new Imagery(this,e,t,i,r),this._imageryCache[n]=a),a.addReference(),a},ImageryLayer.prototype.removeImageryFromCache=function(e){e=getImageryCacheKey(e.x,e.y,e.level);delete this._imageryCache[e]};var uniformMap={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new Cartesian2,texture:void 0},float32ArrayScratch=FeatureDetection.supportsTypedArrays()?new Float32Array(128):void 0;function reprojectToGeographic(e,t,i,r){if(!defined(n=t.cache.imageryLayer_reproject)){for(var n=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){defined(this.framebuffer)&&this.framebuffer.destroy(),defined(this.vertexArray)&&this.vertexArray.destroy(),defined(this.shaderProgram)&&this.shaderProgram.destroy()}},a=new Float32Array(256),o=0,s=0;s<64;++s){var l=s/63;a[o++]=0,a[o++]=l,a[o++]=1,a[o++]=l}var c={position:0,webMercatorT:1},u=TerrainProvider.getRegularGridIndices(2,64),u=Buffer$1.createIndexBuffer({context:t,typedArray:u,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT});n.vertexArray=new VertexArray({context:t,attributes:[{index:c.position,vertexBuffer:Buffer$1.createVertexBuffer({context:t,typedArray:a,usage:BufferUsage$1.STATIC_DRAW}),componentsPerAttribute:2},{index:c.webMercatorT,vertexBuffer:Buffer$1.createVertexBuffer({context:t,sizeInBytes:512,usage:BufferUsage$1.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:u});u=new ShaderSource({sources:[ReprojectWebMercatorVS]});n.shaderProgram=ShaderProgram.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:ReprojectWebMercatorFS,attributeLocations:c}),n.sampler=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}i.sampler=n.sampler;u=i.width,c=i.height;uniformMap.textureDimensions.x=u,uniformMap.textureDimensions.y=c,uniformMap.texture=i;var d=Math.sin(r.south),h=.5*Math.log((1+d)/(1-d));d=Math.sin(r.north);var p=1/(.5*Math.log((1+d)/(1-d))-h),i=new Texture({context:t,width:u,height:c,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});CesiumMath.isPowerOfTwo(u)&&CesiumMath.isPowerOfTwo(c)&&i.generateMipmap(MipmapHint$1.NICEST);for(var m=r.south,f=r.north,g=float32ArrayScratch,_=0,y=0;y<64;++y){var C=y/63,C=CesiumMath.lerp(m,f,C),d=Math.sin(C),C=(.5*Math.log((1+d)/(1-d))-h)*p;g[_++]=C,g[_++]=C}n.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(g),e.shaderProgram=n.shaderProgram,e.outputTexture=i,e.uniformMap=uniformMap,e.vertexArray=n.vertexArray}function getLevelWithMaximumTexelSpacing(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,a=n.ellipsoid,e=e._imageryProvider.tilingScheme.projection instanceof GeographicProjection?1:Math.cos(i),i=n.rectangle,t=a.maximumRadius*i.width*e/(r.tileWidth*n.getNumberOfXTilesAtLevel(0))/t,t=Math.log(t)/Math.log(2);return 0|Math.round(t)}var TileSelectionResult={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>=TileSelectionResult.RENDERED_AND_KICKED},originalResult:function(e){return 3&e},kick:function(e){return 4|e}};function TerrainFillMesh(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 Cartesian4}TerrainFillMesh.prototype.update=function(e,t,i){this.changedThisFrame&&(createFillMesh(e,t,this.tile,i),this.changedThisFrame=!1)},TerrainFillMesh.prototype.destroy=function(e){defined(this.vertexArray)&&(defined(e)?e.push(this.vertexArray):GlobeSurfaceTile._freeVertexArray(this.vertexArray,e),this.vertexArray=void 0),defined(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};var traversalQueueScratch=new Queue;function visitRenderedTiles(e,t,i,r,n,a,o,s,l){if(void 0!==r){for(var c=r;c&&(c._lastSelectionResultFrame!==n||TileSelectionResult.wasKicked(c._lastSelectionResult)||TileSelectionResult.originalResult(c._lastSelectionResult)===TileSelectionResult.CULLED);){if(o)return;var u=c.parent;if(a>=TileEdge.NORTHWEST&&void 0!==u)switch(a){case TileEdge.NORTHWEST:c=c===u.northwestChild?u:void 0;break;case TileEdge.NORTHEAST:c=c===u.northeastChild?u:void 0;break;case TileEdge.SOUTHWEST:c=c===u.southwestChild?u:void 0;break;case TileEdge.SOUTHEAST:c=c===u.southeastChild?u:void 0}else c=u}if(void 0!==c){if(c._lastSelectionResult===TileSelectionResult.RENDERED)return!defined(c.data.vertexArray)&&void visitTile$1(e,t,i,c,a,n,s,l);if(TileSelectionResult.originalResult(r._lastSelectionResult)!==TileSelectionResult.CULLED)switch(a){case TileEdge.WEST:visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l);break;case TileEdge.EAST:visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l);break;case TileEdge.SOUTH:visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l);break;case TileEdge.NORTH:visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l);break;case TileEdge.NORTHWEST:visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l);break;case TileEdge.NORTHEAST:visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l);break;case TileEdge.SOUTHWEST:visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l);break;case TileEdge.SOUTHEAST:visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l);break;default:throw new DeveloperError("Invalid edge")}}}}function visitTile$1(e,t,i,r,n,a,o,s){var l=r.data;if(void 0===l.fill)l.fill=new TerrainFillMesh(r);else if(l.fill.visitedFrame===a)return;l.fill.enqueuedFrame!==a&&(l.fill.enqueuedFrame=a,l.fill.changedThisFrame=!1,o.enqueue(r)),propagateEdge(e,t,i,r,n,s)}function propagateEdge(e,t,i,r,n,a){var o,s,l,c,u,d=r.data.fill,h=i.data.fill,p=defined(h)?(h.visitedFrame=t.frameNumber,h.changedThisFrame&&(createFillMesh(e,t,i,a),h.changedThisFrame=!1),i.data.fill.mesh):i.data.mesh;switch(n){case TileEdge.WEST:o=d.westMeshes,s=d.westTiles;break;case TileEdge.SOUTH:o=d.southMeshes,s=d.southTiles;break;case TileEdge.EAST:o=d.eastMeshes,s=d.eastTiles;break;case TileEdge.NORTH:o=d.northMeshes,s=d.northTiles;break;case TileEdge.NORTHWEST:return d.changedThisFrame=d.changedThisFrame||d.northwestMesh!==p,d.northwestMesh=p,void(d.northwestTile=i);case TileEdge.NORTHEAST:return d.changedThisFrame=d.changedThisFrame||d.northeastMesh!==p,d.northeastMesh=p,void(d.northeastTile=i);case TileEdge.SOUTHWEST:return d.changedThisFrame=d.changedThisFrame||d.southwestMesh!==p,d.southwestMesh=p,void(d.southwestTile=i);case TileEdge.SOUTHEAST:return d.changedThisFrame=d.changedThisFrame||d.southeastMesh!==p,d.southeastMesh=p,void(d.southeastTile=i)}if(i.level<=r.level)return d.changedThisFrame=d.changedThisFrame||o[0]!==p||1!==o.length,o[0]=p,s[0]=i,o.length=1,void(s.length=1);var m,f=i.rectangle,g=r.rectangle;switch(n){case TileEdge.WEST:for(m=(g.north-g.south)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.greaterThan(f.north,u.south,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.greaterThanOrEquals(f.south,u.north,m));++c);break;case TileEdge.SOUTH:for(m=(g.east-g.west)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.lessThan(f.west,u.east,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.lessThanOrEquals(f.east,u.west,m));++c);break;case TileEdge.EAST:for(m=(g.north-g.south)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.lessThan(f.south,u.north,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.lessThanOrEquals(f.north,u.south,m));++c);break;case TileEdge.NORTH:for(m=(g.east-g.west)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.greaterThan(f.east,u.west,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.greaterThanOrEquals(f.west,u.east,m));++c);}c-l==1?(d.changedThisFrame=d.changedThisFrame||o[l]!==p,o[l]=p,s[l]=i):(d.changedThisFrame=!0,o.splice(l,c-l,p),s.splice(l,c-l,i))}TerrainFillMesh.updateFillTiles=function(e,t,i,r){var n=e._quadtree,a=n._levelZeroTiles,o=n._lastSelectionFrameNumber,s=traversalQueueScratch;s.clear();for(var l=0;l<t.length;++l)defined(t[l].data.vertexArray)&&s.enqueue(t[l]);for(var c=s.dequeue();void 0!==c;){var u=c.findTileToWest(a),d=c.findTileToSouth(a),h=c.findTileToEast(a),p=c.findTileToNorth(a);visitRenderedTiles(e,i,c,u,o,TileEdge.EAST,!1,s,r),visitRenderedTiles(e,i,c,d,o,TileEdge.NORTH,!1,s,r),visitRenderedTiles(e,i,c,h,o,TileEdge.WEST,!1,s,r),visitRenderedTiles(e,i,c,p,o,TileEdge.SOUTH,!1,s,r);d=u.findTileToNorth(a),p=u.findTileToSouth(a),u=h.findTileToNorth(a),h=h.findTileToSouth(a);visitRenderedTiles(e,i,c,d,o,TileEdge.SOUTHEAST,!1,s,r),visitRenderedTiles(e,i,c,u,o,TileEdge.SOUTHWEST,!1,s,r),visitRenderedTiles(e,i,c,p,o,TileEdge.NORTHEAST,!1,s,r),visitRenderedTiles(e,i,c,h,o,TileEdge.NORTHWEST,!1,s,r),c=s.dequeue()}};var cartographicScratch$1=new Cartographic,centerCartographicScratch=new Cartographic,cartesianScratch=new Cartesian3,normalScratch=new Cartesian3,octEncodedNormalScratch=new Cartesian2,uvScratch2=new Cartesian2,uvScratch=new Cartesian2;function HeightAndNormal(){this.height=0,this.encodedNormal=new Cartesian2}function fillMissingCorner(e,t,i,r,n,a,o,s,l){if(defined(n))return n;var c=defined(a)&&defined(o)?.5*(a.height+o.height):defined(a)?a.height:defined(o)?o.height:defined(s)?s.height:(c=o=0,defined(s=e.tile.data.tileBoundingRegion)&&(o=s.minimumHeight,c=s.maximumHeight),.5*(o+c));return getVertexWithHeightAtCorner(e,t,i,r,c,l),l}var heightRangeScratch={minimumHeight:0,maximumHeight:0},swVertexScratch=new HeightAndNormal,seVertexScratch=new HeightAndNormal,nwVertexScratch=new HeightAndNormal,neVertexScratch=new HeightAndNormal,heightmapBuffer="undefined"!=typeof Uint8Array?new Uint8Array(81):void 0,scratchCreateMeshSyncOptions={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1};function createFillMesh(e,t,i,r){GlobeSurfaceTile.initialize(i,e.terrainProvider,e._imageryLayers);var n=i.data,a=n.fill,o=i.rectangle,s=i.tilingScheme.ellipsoid,l=getCorner(a,s,0,1,a.northwestTile,a.northwestMesh,a.northTiles,a.northMeshes,a.westTiles,a.westMeshes,nwVertexScratch),c=getCorner(a,s,0,0,a.southwestTile,a.southwestMesh,a.westTiles,a.westMeshes,a.southTiles,a.southMeshes,swVertexScratch),u=getCorner(a,s,1,0,a.southeastTile,a.southeastMesh,a.southTiles,a.southMeshes,a.eastTiles,a.eastMeshes,seVertexScratch),l=fillMissingCorner(a,s,0,1,l,c,d=getCorner(a,s,1,1,a.northeastTile,a.northeastMesh,a.eastTiles,a.eastMeshes,a.northTiles,a.northMeshes,neVertexScratch),u,nwVertexScratch),c=fillMissingCorner(a,s,0,0,c,l,u,d,swVertexScratch),u=fillMissingCorner(a,s,1,1,u,c,d,l,seVertexScratch),d=fillMissingCorner(a,s,1,1,d,u,l,c,neVertexScratch),h=c.height,p=u.height,m=l.height,f=d.height,h=.5*((P=Math.min(h,p,m,f))+(A=Math.max(h,p,m,f))),p=e.getLevelMaximumGeometricError(i.level),m=s.maximumRadius-p,f=4*Math.acos(m/s.maximumRadius);if(f*=1.5,o.width>f&&A-P<=p){var g=new HeightmapTerrainData({width:9,height:9,buffer:heightmapBuffer,structure:{heightOffset:A}}),_=scratchCreateMeshSyncOptions;_.tilingScheme=i.tilingScheme,_.x=i.x,_.y=i.y,_.level=i.level,a.mesh=g._createMeshSync(_)}else{var y=new TerrainEncoding(void 0,void 0,void 0,void 0,!0,!0),m=centerCartographicScratch;m.longitude=.5*(o.east+o.west),m.latitude=.5*(o.north+o.south),m.height=h,y.center=s.cartographicToCartesian(m,y.center);for(var C=5,v=a.westMeshes,S=0,T=v.length;S<T;++S)C+=v[S].eastIndicesNorthToSouth.length;for(S=0,T=(v=a.southMeshes).length;S<T;++S)C+=v[S].northIndicesWestToEast.length;for(S=0,T=(v=a.eastMeshes).length;S<T;++S)C+=v[S].westIndicesSouthToNorth.length;for(S=0,T=(v=a.northMeshes).length;S<T;++S)C+=v[S].southIndicesEastToWest.length;f=heightRangeScratch;f.minimumHeight=P,f.maximumHeight=A;var p=y.getStride(),g=0,x=g=addEdge(a,s,y,_=new Float32Array(C*p),g=addVertexWithComputedPosition(s,o,y,_,0,0,1,l.height,l.encodedNormal,1,f),a.westTiles,a.westMeshes,TileEdge.EAST,f),b=g=addEdge(a,s,y,_,g=addVertexWithComputedPosition(s,o,y,_,g,0,0,c.height,c.encodedNormal,0,f),a.southTiles,a.southMeshes,TileEdge.NORTH,f),E=g=addEdge(a,s,y,_,g=addVertexWithComputedPosition(s,o,y,_,g,1,0,u.height,u.encodedNormal,0,f),a.eastTiles,a.eastMeshes,TileEdge.WEST,f);g=addEdge(a,s,y,_,g=addVertexWithComputedPosition(s,o,y,_,g,1,1,d.height,d.encodedNormal,1,f),a.northTiles,a.northMeshes,TileEdge.SOUTH,f);var P=f.minimumHeight,A=f.maximumHeight,u=OrientedBoundingBox.fromRectangle(o,P,A,i.tilingScheme.ellipsoid),d=WebMercatorProjection.geodeticLatitudeToMercatorAngle(o.south),f=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(o.north)-d),f=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(m.latitude)-d)*f;s.geodeticSurfaceNormalCartographic(cartographicScratch$1,normalScratch);var s=AttributeCompression.octEncode(normalScratch,octEncodedNormalScratch),w=g;y.encode(_,g*p,u.center,Cartesian2.fromElements(.5,.5,uvScratch),h,s,f);var D,M=++g,f=3*(M-1);D=f*(M<256?1:2)<=(_.length-M*p)*Float32Array.BYTES_PER_ELEMENT?(g=M*p*Float32Array.BYTES_PER_ELEMENT,new(M<256?Uint8Array:Uint16Array)(_.buffer,g,f)):new(M<256?Uint8Array:Uint16Array)(f);var _=new Float32Array(_.buffer,0,M*p),I=0;for(S=0;S<M-2;++S)D[I++]=w,D[I++]=S,D[I++]=S+1;D[I++]=w,D[I++]=S,D[I++]=0;var R=[];for(S=x;0<=S;--S)R.push(S);var O=[];for(S=b;x<=S;--S)O.push(S);var L=[];for(S=E;b<=S;--S)L.push(S);var F=[];for(F.push(0),S=w-1;E<=S;--S)F.push(S);a.mesh=new TerrainMesh(y.center,_,D,f,M,P,A,BoundingSphere.fromOrientedBoundingBox(u),computeOccludeePoint$1(e,u.center,o,P,A),y.getStride(),u,y,t.terrainExaggeration,R,O,L,F)}y=t.context;defined(a.vertexArray)&&(defined(r)?r.push(a.vertexArray):GlobeSurfaceTile._freeVertexArray(a.vertexArray)),a.vertexArray=GlobeSurfaceTile._createVertexArrayForMesh(y,a.mesh),n.processImagery(i,e.terrainProvider,t,!0);t=a.waterMaskTexture;a.waterMaskTexture=void 0,!e.terrainProvider.hasWaterMask||defined(e=n._findAncestorTileWithTerrainData(i))&&defined(e.data.waterMaskTexture)&&(a.waterMaskTexture=e.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,n._computeWaterMaskTranslationAndScale(i,e,a.waterMaskTranslationAndScale)),defined(t)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function addVertexWithComputedPosition(e,t,i,r,n,a,o,s,l,c,u){var d=cartographicScratch$1;d.longitude=CesiumMath.lerp(t.west,t.east,a),d.latitude=CesiumMath.lerp(t.south,t.north,o),d.height=s;e=e.cartographicToCartesian(d,cartesianScratch),d=uvScratch2;return d.x=a,d.y=o,i.encode(r,n*i.getStride(),e,d,s,l,c),u.minimumHeight=Math.min(u.minimumHeight,s),u.maximumHeight=Math.max(u.maximumHeight,s),n+1}var sourceRectangleScratch=new Rectangle;function transformTextureCoordinates(e,t,i,r){var n=e.rectangle,a=t.rectangle;0===t.x&&1===i.x&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?((n=Rectangle.clone(e.rectangle,sourceRectangleScratch)).west-=CesiumMath.TWO_PI,n.east-=CesiumMath.TWO_PI):0===e.x&&0===i.x&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&((n=Rectangle.clone(e.rectangle,sourceRectangleScratch)).west+=CesiumMath.TWO_PI,n.east+=CesiumMath.TWO_PI);var o=n.east-n.west,s=(a.west-n.west)/o,t=(a.east-n.west)/o,e=n.north-n.south,o=(a.south-n.south)/e,e=(a.north-n.south)/e,s=(i.x-s)/(t-s),o=(i.y-o)/(e-o);return Math.abs(s)<Math.EPSILON5?s=0:Math.abs(s-1)<Math.EPSILON5&&(s=1),Math.abs(o)<Math.EPSILON5?o=0:Math.abs(o-1)<Math.EPSILON5&&(o=1),r.x=s,r.y=o,r}var encodedNormalScratch=new Cartesian2;function getVertexFromTileAtCorner(e,t,i,r,n){var a=e.encoding,e=e.vertices;n.height=a.decodeHeight(e,t),a.hasVertexNormals?a.getOctEncodedNormal(e,t,n.encodedNormal):((n=n.encodedNormal).x=0,n.y=0)}var encodedNormalScratch2=new Cartesian2,cartesianScratch2=new Cartesian3;function getInterpolatedVertexAtCorner(e,t,i,r,n,a,o,s,l,c){var u,d=r.encoding,h=r.vertices,r=transformTextureCoordinates(t,i,d.decodeTextureCoordinates(h,n,uvScratch),uvScratch),t=transformTextureCoordinates(t,i,d.decodeTextureCoordinates(h,a,uvScratch2),uvScratch2),l=l?(o-r.x)/(t.x-r.x):(s-r.y)/(t.y-r.y),t=d.decodeHeight(h,n),r=d.decodeHeight(h,a),i=i.rectangle;cartographicScratch$1.longitude=CesiumMath.lerp(i.west,i.east,o),cartographicScratch$1.latitude=CesiumMath.lerp(i.south,i.north,s),c.height=cartographicScratch$1.height=CesiumMath.lerp(t,r,l),d.hasVertexNormals?(n=d.getOctEncodedNormal(h,n,encodedNormalScratch),u=d.getOctEncodedNormal(h,a,encodedNormalScratch2),n=AttributeCompression.octDecode(n.x,n.y,cartesianScratch),u=AttributeCompression.octDecode(u.x,u.y,cartesianScratch2),u=Cartesian3.lerp(n,u,l,cartesianScratch),Cartesian3.normalize(u,u)):u=e.geodeticSurfaceNormalCartographic(cartographicScratch$1,cartesianScratch),AttributeCompression.octEncode(u,c.encodedNormal)}function getVertexWithHeightAtCorner(e,t,i,r,n,a){a.height=n;t=t.geodeticSurfaceNormalCartographic(cartographicScratch$1,cartesianScratch);AttributeCompression.octEncode(t,a.encodedNormal)}function getCorner(e,t,i,r,n,a,o,s,l,c,u){return getCornerFromEdge(e,t,s,o,!1,i,r,u)||getCornerFromEdge(e,t,c,l,!0,i,r,u)?u:meshIsUsable(n,a)?(getVertexFromTileAtCorner(a,(0===i?0===r?a.eastIndicesNorthToSouth:a.southIndicesEastToWest:0===r?a.northIndicesWestToEast:a.westIndicesSouthToNorth)[0],i,r,u),u):defined(a=0===i?0===r?getClosestHeightToCorner(e.westMeshes,e.westTiles,TileEdge.EAST,e.southMeshes,e.southTiles,TileEdge.NORTH):getClosestHeightToCorner(e.northMeshes,e.northTiles,TileEdge.SOUTH,e.westMeshes,e.westTiles,TileEdge.EAST):0===r?getClosestHeightToCorner(e.southMeshes,e.southTiles,TileEdge.NORTH,e.eastMeshes,e.eastTiles,TileEdge.WEST):getClosestHeightToCorner(e.eastMeshes,e.eastTiles,TileEdge.WEST,e.northMeshes,e.northTiles,TileEdge.SOUTH))?(getVertexWithHeightAtCorner(e,t,i,r,a,u),u):void 0}function getClosestHeightToCorner(e,t,i,r,n,a,o,s){i=getNearestHeightOnEdge(e,t,!1,i),a=getNearestHeightOnEdge(r,n,!0,a);return defined(i)&&defined(a)?.5*(i+a):defined(i)?i:a}function addEdge(e,t,i,r,n,a,o,s,l){for(var c=0;c<a.length;++c)n=addEdgeMesh(e,t,i,r,n,a[c],o[c],s,l);return n}function addEdgeMesh(e,t,i,r,n,a,o,s,l){var c=a.rectangle;s===TileEdge.EAST&&0===e.tile.x?((c=Rectangle.clone(a.rectangle,sourceRectangleScratch)).west-=CesiumMath.TWO_PI,c.east-=CesiumMath.TWO_PI):s===TileEdge.WEST&&0===a.x&&((c=Rectangle.clone(a.rectangle,sourceRectangleScratch)).west+=CesiumMath.TWO_PI,c.east+=CesiumMath.TWO_PI);var u,d,h,p,m=e.tile.rectangle;switch(0<n&&(i.decodeTextureCoordinates(r,n-1,uvScratch),u=uvScratch.x,d=uvScratch.y),s){case TileEdge.WEST:h=o.westIndicesSouthToNorth,p=!1;break;case TileEdge.NORTH:h=o.northIndicesWestToEast,p=!0;break;case TileEdge.EAST:h=o.eastIndicesNorthToSouth,p=!1;break;case TileEdge.SOUTH:h=o.southIndicesEastToWest,p=!0}var f,g,_=a,y=e.tile,C=o.encoding,v=o.vertices,S=i.getStride();C.hasWebMercatorT&&(f=WebMercatorProjection.geodeticLatitudeToMercatorAngle(m.south),g=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(m.north)-f));for(var T=0;T<h.length;++T){var x=h[T],b=C.decodeTextureCoordinates(v,x,uvScratch);transformTextureCoordinates(_,y,b,b);var E,P=b.x,A=b.y,w=p?P:A;w<0||1<w||Math.abs(P-u)<CesiumMath.EPSILON5&&Math.abs(A-d)<CesiumMath.EPSILON5||(w=Math.abs(P)<CesiumMath.EPSILON5||Math.abs(P-1)<CesiumMath.EPSILON5,P=Math.abs(A)<CesiumMath.EPSILON5||Math.abs(A-1)<CesiumMath.EPSILON5,w&&P||(w=C.decodePosition(v,x,cartesianScratch),P=C.decodeHeight(v,x),C.hasVertexNormals?E=C.getOctEncodedNormal(v,x,octEncodedNormalScratch):((E=octEncodedNormalScratch).x=0,E.y=0),x=A,C.hasWebMercatorT&&(A=CesiumMath.lerp(m.south,m.north,A),x=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(A)-f)*g),i.encode(r,n*S,w,b,P,E,x),l.minimumHeight=Math.min(l.minimumHeight,P),l.maximumHeight=Math.max(l.maximumHeight,P),++n))}return n}function getNearestHeightOnEdge(e,t,i,r,n,a){for(var o,s,l=i?(o=0,s=e.length,1):(o=e.length-1,s=-1),c=o;c!==s;c+=l){var u,d=e[c];if(meshIsUsable(t[c],d)){switch(r){case TileEdge.WEST:u=d.westIndicesSouthToNorth;break;case TileEdge.SOUTH:u=d.southIndicesEastToWest;break;case TileEdge.EAST:u=d.eastIndicesNorthToSouth;break;case TileEdge.NORTH:u=d.northIndicesWestToEast}var h=u[i?0:u.length-1];if(defined(h))return d.encoding.decodeHeight(d.vertices,h)}}}function meshIsUsable(e,t){return defined(t)&&(!defined(e.data.fill)||!e.data.fill.changedThisFrame)}function getCornerFromEdge(i,e,t,r,n,a,o,s){var l,c,u,d=r[n?0:t.length-1],h=t[n?0:t.length-1];if(meshIsUsable(d,h)&&(u=0===a?0===o?(l=n?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,c=n):(l=n?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,c=!n,!1):0===o?(l=n?h.westIndicesSouthToNorth:h.northIndicesWestToEast,c=!n,!0):(l=n?h.southIndicesEastToWest:h.westIndicesSouthToNorth,!(c=n)),0<l.length)){t=l[r=n?0:l.length-1],h.encoding.decodeTextureCoordinates(h.vertices,t,uvScratch);n=transformTextureCoordinates(d,i.tile,uvScratch,uvScratch);if(n.x===a&&n.y===o)return getVertexFromTileAtCorner(h,t,a,o,s),!0;if(!((r=binarySearch(l,c?a:o,function(e,t){h.encoding.decodeTextureCoordinates(h.vertices,e,uvScratch);e=transformTextureCoordinates(d,i.tile,uvScratch,uvScratch);return u?c?e.x-a:e.y-o:c?a-e.x:o-e.y}))<0))return getVertexFromTileAtCorner(h,l[r],a,o,s),!0;if(0<(r=~r)&&r<l.length)return getInterpolatedVertexAtCorner(e,d,i.tile,h,l[r-1],l[r],a,o,c,s),!0}return!1}var cornerPositionsScratch$1=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeOccludeePoint$1(e,t,i,r,n,a){var o=e.quadtree._occluders.ellipsoid,s=o.ellipsoid,e=cornerPositionsScratch$1;return Cartesian3.fromRadians(i.west,i.south,n,s,e[0]),Cartesian3.fromRadians(i.east,i.south,n,s,e[1]),Cartesian3.fromRadians(i.west,i.north,n,s,e[2]),Cartesian3.fromRadians(i.east,i.north,n,s,e[3]),o.computeHorizonCullingPointPossiblyUnderEllipsoid(t,e,r,a)}function GlobeSurfaceTileProvider(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=ShadowMode$1.RECEIVE_ONLY,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.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 Event,this._imageryLayers.layerAdded.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Event,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 Color(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=Rectangle.clone(Rectangle.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}function sortTileImageryByLayerIndex(e,t){var i=e.loadingImagery;defined(i)||(i=e.readyImagery);e=t.loadingImagery;return defined(e)||(e=t.readyImagery),i.imageryLayer._layerIndex-e.imageryLayer._layerIndex}function updateCredits(e,t){var i=t.creditDisplay;e._terrainProvider.ready&&defined(e._terrainProvider.credit)&&i.addCredit(e._terrainProvider.credit);for(var r=e._imageryLayers,n=0,a=r.length;n<a;++n){var o=r.get(n).imageryProvider;o.ready&&defined(o.credit)&&i.addCredit(o.credit)}}function pushCommand(e,t){var i,r=t.globeTranslucencyState;r.translucent?(i=e.renderState.blending.enabled,r.pushDerivedCommands(e,i,t)):t.commandList.push(e)}Object.defineProperties(GlobeSurfaceTileProvider.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=Cartesian4.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){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,defined(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}}}),GlobeSurfaceTileProvider.prototype.update=function(e){this._imageryLayers._update()},GlobeSurfaceTileProvider.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(sortTileImageryByLayerIndex)})),updateCredits(this,e);for(var t=this._vertexArraysToDestroy,i=t.length,r=0;r<i;++r)GlobeSurfaceTile._freeVertexArray(t[r]);t.length=0},GlobeSurfaceTileProvider.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];defined(n)&&(n.length=0)}var a=this._clippingPlanes;defined(a)&&a.enabled&&a.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1},GlobeSurfaceTileProvider.prototype.endUpdate=function(e){var t;defined(this._renderState)||(this._renderState=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS}}),this._blendRenderState=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},blending:BlendingState$1.ALPHA_BLEND}),(t=clone$1(this._renderState,!0)).cull.enabled=!1,this._disableCullingRenderState=RenderState.fromCache(t),(t=clone$1(this._blendRenderState,!0)).cull.enabled=!1,this._disableCullingBlendRenderState=RenderState.fromCache(t)),this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&TerrainFillMesh.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);for(var i=this._tilesToRenderByTextureCount,r=0,n=i.length;r<n;++r){var a=i[r];if(defined(a))for(var o=0,s=a.length;o<s;++o){var l=a[o],c=l.data.tileBoundingRegion;addDrawCommandsForTile(this,l,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,c.minimumHeight)}}},GlobeSurfaceTileProvider.prototype.updateForPick=function(e){for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)pushCommand(t[i],e)},GlobeSurfaceTileProvider.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},GlobeSurfaceTileProvider.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},GlobeSurfaceTileProvider.prototype.loadTile=function(e,t){var i,r=t.data,n=!0;defined(r)&&(n=r.boundingVolumeSourceTile!==t||t._lastSelectionResult===TileSelectionResult.CULLED_BUT_NEEDED,i=r.terrainState),GlobeSurfaceTile.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n),r=t.data,n&&i!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==Visibility$1.NONE&&r.boundingVolumeSourceTile===t&&(n=!1,GlobeSurfaceTile.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n))};var boundingSphereScratch$1=new BoundingSphere,rectangleIntersectionScratch=new Rectangle,splitCartographicLimitRectangleScratch=new Rectangle,rectangleCenterScratch=new Cartographic;function clipRectangleAntimeridian(e,t){if(t.west<t.east)return t;t=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch).longitude?t.east=CesiumMath.PI:t.west=-CesiumMath.PI,t}function isUndergroundVisible(e,t){if(t.cameraUnderground)return!0;if(t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;t=e._clippingPlanes;return!(!defined(t)||!t.enabled)||!Rectangle.equals(e.cartographicLimitRectangle,Rectangle.MAX_VALUE)}GlobeSurfaceTileProvider.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);e._distance=r;var n=isUndergroundVisible(this,t);if(t.fog.enabled&&!n&&1<=CesiumMath.fog(r,t.fog.density))return Visibility$1.NONE;var a=e.data,o=a.tileBoundingRegion;if(void 0===a.boundingVolumeSourceTile)return Visibility$1.PARTIAL;var s=t.cullingVolume,l=a.orientedBoundingBox;!defined(l)&&defined(a.renderedMesh)&&(l=a.renderedMesh.boundingSphere3D),a.clippedByBoundaries=!1;r=clipRectangleAntimeridian(e.rectangle,this.cartographicLimitRectangle),r=Rectangle.simpleIntersection(r,e.rectangle,rectangleIntersectionScratch);if(!defined(r))return Visibility$1.NONE;if(Rectangle.equals(r,e.rectangle)||(a.clippedByBoundaries=!0),t.mode!==SceneMode$1.SCENE3D&&(l=boundingSphereScratch$1,BoundingSphere.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,o.minimumHeight,o.maximumHeight,l),Cartesian3.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===SceneMode$1.MORPHING&&defined(a.renderedMesh)&&(l=BoundingSphere.union(a.renderedMesh.boundingSphere3D,l,l))),!defined(l))return Visibility$1.PARTIAL;var c,r=this._clippingPlanes;if(defined(r)&&r.enabled){r=r.computeIntersectionWithBoundingVolume(l);if(e.isClipped=r!==Intersect$1.INSIDE,r===Intersect$1.OUTSIDE)return Visibility$1.NONE}l=s.computeVisibility(l);if(l===Intersect$1.OUTSIDE?c=Visibility$1.NONE:l===Intersect$1.INTERSECTING?c=Visibility$1.PARTIAL:l===Intersect$1.INSIDE&&(c=Visibility$1.FULL),c===Visibility$1.NONE)return c;l=t.mode===SceneMode$1.SCENE3D&&t.camera.frustum instanceof OrthographicFrustum;if(t.mode!==SceneMode$1.SCENE3D||l||!defined(i)||n)return c;a=a.occludeePointInScaledSpace;return!defined(a)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(a,o.minimumHeight)?c:Visibility$1.NONE},GlobeSurfaceTileProvider.prototype.canRefine=function(e){return!!defined(e.data.terrainData)||void 0!==this.terrainProvider.getTileDataAvailable(2*e.x,2*e.y,e.level+1)};var readyImageryScratch=[],canRenderTraversalStack=[];GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail=function(e,t){var i=e.data,r=readyImageryScratch;r.length=this._imageryLayers.length;var n,a=!1,o=!1;for(defined(i)&&(a=i.terrainState===TerrainState$1.READY,o=!0,n=i.imagery),m=0,f=r.length;m<f;++m)r[m]=o;if(defined(n))for(m=0,f=n.length;m<f;++m){var s=n[m],l=s.loadingImagery,l=!defined(l)||l.state===ImageryState$1.FAILED||l.state===ImageryState$1.INVALID,s=(s.loadingImagery||s.readyImagery).imageryLayer._layerIndex;r[s]=l&&r[s]}var c=this.quadtree._lastSelectionFrameNumber,u=canRenderTraversalStack;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);0<u.length;){var d=u.pop(),h=d._lastSelectionResultFrame===c?d._lastSelectionResult:TileSelectionResult.NONE;if(h===TileSelectionResult.RENDERED){if(defined(d.data)){if(!a&&d.data.terrainState===TerrainState$1.READY)return!1;for(var p=d.data.imagery,m=0,f=p.length;m<f;++m){var g=p[m],_=g.loadingImagery,_=!defined(_)||_.state===ImageryState$1.FAILED||_.state===ImageryState$1.INVALID,g=(g.loadingImagery||g.readyImagery).imageryLayer._layerIndex;if(_&&!r[g])return!1}}}else h===TileSelectionResult.REFINED&&u.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var tileDirectionScratch=new Cartesian3;GlobeSurfaceTileProvider.prototype.computeTileLoadPriority=function(e,t){var i=e.data;if(void 0===i)return 0;var r=i.orientedBoundingBox;if(void 0===r)return 0;i=t.camera.positionWC,t=t.camera.directionWC,r=Cartesian3.subtract(r.center,i,tileDirectionScratch),i=Cartesian3.magnitude(r);return i<CesiumMath.EPSILON5?0:(Cartesian3.divideByScalar(r,i,r),(1-Cartesian3.dot(r,t))*e._distance)};var modifiedModelViewScratch=new Matrix4,modifiedModelViewProjectionScratch=new Matrix4,tileRectangleScratch=new Cartesian4,localizedCartographicLimitRectangleScratch=new Cartesian4,localizedTranslucencyRectangleScratch=new Cartesian4,rtcScratch=new Cartesian3,centerEyeScratch=new Cartesian3,southwestScratch=new Cartesian3,northeastScratch=new Cartesian3;GlobeSurfaceTileProvider.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,a=r.length;n<a;++n){var o=r[n];defined(o.readyImagery)&&0!==o.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];defined(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e),defined(e.data.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;e=this._debug;++e.tilesRendered,e.texturesRendered+=i};var cornerPositionsScratch=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeOccludeePoint(e,t,i,r,n,a){var o=e.quadtree._occluders.ellipsoid,s=o.ellipsoid,e=cornerPositionsScratch;return Cartesian3.fromRadians(i.west,i.south,n,s,e[0]),Cartesian3.fromRadians(i.east,i.south,n,s,e[1]),Cartesian3.fromRadians(i.west,i.north,n,s,e[2]),Cartesian3.fromRadians(i.east,i.north,n,s,e[3]),o.computeHorizonCullingPointPossiblyUnderEllipsoid(t,e,r,a)}function updateTileBoundingRegion(e,t,i){var r=e.data;void 0===(r=void 0===r?e.data=new GlobeSurfaceTile:r).tileBoundingRegion&&(r.tileBoundingRegion=new TileBoundingRegion({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:e.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0}));var n=r.terrainData,a=r.mesh,o=r.tileBoundingRegion;if(void 0!==a&&void 0!==a.minimumHeight&&void 0!==a.maximumHeight)return o.minimumHeight=a.minimumHeight,o.maximumHeight=a.maximumHeight,e;if(void 0!==n&&void 0!==n._minimumHeight&&void 0!==n._maximumHeight)return o.minimumHeight=n._minimumHeight*i.terrainExaggeration,o.maximumHeight=n._maximumHeight*i.terrainExaggeration,e;o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;for(var s=e.parent;void 0!==s;){var l=s.data;if(void 0!==l){var c=l.mesh;if(void 0!==c&&void 0!==c.minimumHeight&&void 0!==c.maximumHeight)return o.minimumHeight=c.minimumHeight,o.maximumHeight=c.maximumHeight,s;l=l.terrainData;if(void 0!==l&&void 0!==l._minimumHeight&&void 0!==l._maximumHeight)return o.minimumHeight=l._minimumHeight*i.terrainExaggeration,o.maximumHeight=l._maximumHeight*i.terrainExaggeration,s}s=s.parent}}function getTileReadyCallback(l,c,u){return function(e){for(var t=-1,i=e.data.imagery,r=i.length,n=0;n<r;++n)if((s=defaultValue((a=i[n]).readyImagery,a.loadingImagery)).imageryLayer===c){t=n;break}if(-1!==t){var a,o=t+l,s=defined(a=i[o])?defaultValue(a.readyImagery,a.loadingImagery):void 0;if(!defined(s)||s.imageryLayer!==c)return!c._createTileImagerySkeletons(e,u,o);for(n=t;n<o;++n)i[n].freeResources();i.splice(t,l)}return!0}}GlobeSurfaceTileProvider.prototype.computeDistanceToTile=function(e,t){var i=updateTileBoundingRegion(e,this.terrainProvider,t),r=e.data,n=r.tileBoundingRegion;if(void 0===i)return 9999999999;r.boundingVolumeSourceTile!==i&&(r.boundingVolumeSourceTile=i,defined(e.rectangle)&&(r.orientedBoundingBox=OrientedBoundingBox.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=computeOccludeePoint(this,r.orientedBoundingBox.center,e.rectangle,n.minimumHeight,n.maximumHeight,r.occludeePointInScaledSpace)));var a=n.minimumHeight,i=n.maximumHeight;r.boundingVolumeSourceTile!==e&&(r=t.camera.positionCartographic.height,e=Math.abs(r-a),Math.abs(r-i)<e?(n.minimumHeight=a,n.maximumHeight=a):(n.minimumHeight=i,n.maximumHeight=i));t=n.distanceToCamera(t);return n.minimumHeight=a,n.maximumHeight=i,t},GlobeSurfaceTileProvider.prototype.isDestroyed=function(){return!1},GlobeSurfaceTileProvider.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),destroyObject(this)},GlobeSurfaceTileProvider.prototype._onLayerAdded=function(l,e){var c,t,i,r;l.show&&(c=this._terrainProvider,t=this,i=l.imageryProvider,r=this._imageryLayersUpdatedEvent,i._reload=function(){l._imageryCache={},t._quadtree.forEachLoadedTile(function(e){if(!defined(e._loadedCallbacks[l._layerIndex])){for(var t,i=e.data.imagery,r=i.length,n=-1,a=0,o=0;o<r;++o){var s=i[o];if(defaultValue(s.readyImagery,s.loadingImagery).imageryLayer===l)-1===n&&(n=o),++a;else if(-1!==n)break}-1!==n&&(t=n+a,l._createTileImagerySkeletons(e,c,t)&&(e._loadedCallbacks[l._layerIndex]=getTileReadyCallback(a,l,c),e.state=QuadtreeTileLoadState$1.LOADING))}})},this._quadtree.forEachLoadedTile(function(e){l._createTileImagerySkeletons(e,c)&&(e.state=QuadtreeTileLoadState$1.LOADING,0===e.level||e._lastSelectionResultFrame===t.quadtree._lastSelectionFrameNumber&&e._lastSelectionResult===TileSelectionResult.RENDERED||(e.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent())},GlobeSurfaceTileProvider.prototype._onLayerRemoved=function(l,e){this._quadtree.forEachLoadedTile(function(e){for(var t=e.data.imagery,i=-1,r=0,n=0,a=t.length;n<a;++n){var o=t[n],s=o.loadingImagery;if((s=!defined(s)?o.readyImagery:s).imageryLayer===l)-1===i&&(i=n),o.freeResources(),++r;else if(-1!==i)break}-1!==i&&t.splice(i,r)}),defined(l.imageryProvider)&&(l.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()},GlobeSurfaceTileProvider.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var scratchClippingPlanesMatrix=new Matrix4,scratchInverseTransposeClippingPlanesMatrix=new Matrix4,getDebugOrientedBoundingBox,getDebugBoundingSphere,debugDestroyPrimitive,Nmi,Omi,Kmi,Lmi,Mmi;function createTileUniformMap(r,t){var e={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_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var e=r.context.uniformState.view,t=Matrix4.multiplyByPoint(e,this.properties.rtc,centerEyeScratch);return Matrix4.setTranslation(e,t,modifiedModelViewScratch),modifiedModelViewScratch},u_modifiedModelViewProjection:function(){var e=r.context.uniformState.view,t=r.context.uniformState.projection,i=Matrix4.multiplyByPoint(e,this.properties.rtc,centerEyeScratch);return Matrix4.setTranslation(e,i,modifiedModelViewProjectionScratch),Matrix4.multiply(t,modifiedModelViewProjectionScratch,modifiedModelViewProjectionScratch),modifiedModelViewProjectionScratch},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(){var e=t._clippingPlanes;return defined(e)&&defined(e.texture)?e.texture:r.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){var e=t._clippingPlanes,e=defined(e)?Matrix4.multiply(r.context.uniformState.view,e.modelMatrix,scratchClippingPlanesMatrix):Matrix4.IDENTITY;return Matrix4.inverseTranspose(e,scratchInverseTransposeClippingPlanesMatrix)},u_clippingPlanesEdgeStyle:function(){var e=this.properties.clippingPlanesEdgeColor;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_minimumBrightness:function(){return r.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},properties:{initialColor:new Cartesian4(0,0,.5,1),fillHighlightColor:new Color(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new Cartesian2(65e5,9e6),nightFadeDistance:new Cartesian2(1e7,4e7),hsbShift:new Cartesian3,center3D:void 0,rtc:new Cartesian3,modifiedModelView:new Matrix4,tileRectangle:new Cartesian4,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new Cartesian2,southMercatorYAndOneOverHeight:new Cartesian2,waterMask:void 0,waterMaskTranslationAndScale:new Cartesian4,minMaxHeight:new Cartesian2,scaleAndBias:new Matrix4,clippingPlanesEdgeColor:Color.clone(Color.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new Cartesian4,frontFaceAlphaByDistance:new Cartesian4,backFaceAlphaByDistance:new Cartesian4,localizedTranslucencyRectangle:new Cartesian4,undergroundColor:Color.clone(Color.TRANSPARENT),undergroundColorAlphaByDistance:new Cartesian4}};return defined(t.materialUniformMap)?combine$2(e,t.materialUniformMap):e}function createWireframeVertexArrayIfNecessary(e,t,i){var r,n,i=i.data;if(defined(i.vertexArray)?(r=i.mesh,n=i.vertexArray):defined(i.fill)&&defined(i.fill.vertexArray)&&(r=i.fill.mesh,n=i.fill.vertexArray),defined(r)&&defined(n)){if(defined(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=createWireframeVertexArray(e,n,r),i.wireframeVertexArray.mesh=r}}function createWireframeVertexArray(e,t,i){i={indices:i.indices,primitiveType:PrimitiveType$1.TRIANGLES};GeometryPipeline.toWireframe(i);i=i.indices,i=Buffer$1.createIndexBuffer({context:e,typedArray:i,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.fromSizeInBytes(i.BYTES_PER_ELEMENT)});return new VertexArray({context:e,attributes:t._attributes,indexBuffer:i})}function Pmi(e){return new Primitive({geometryInstances:e,appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}Kmi=new GeometryInstance({geometry:BoxOutlineGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2)})}),Lmi=new GeometryInstance({geometry:new SphereOutlineGeometry({radius:1})}),Mmi=new Matrix4,getDebugOrientedBoundingBox=function(e,t){return e===Nmi?Omi:(debugDestroyPrimitive(),Nmi=e,Mmi=Matrix4.fromRotationTranslation(e.halfAxes,e.center,Mmi),Kmi.modelMatrix=Mmi,Kmi.attributes.color=ColorGeometryInstanceAttribute.fromColor(t),Omi=Pmi(Kmi))},getDebugBoundingSphere=function(e,t){return e===Nmi?Omi:(debugDestroyPrimitive(),Nmi=e,Mmi=Matrix4.fromTranslation(e.center,Mmi),Mmi=Matrix4.multiplyByUniformScale(Mmi,e.radius,Mmi),Lmi.modelMatrix=Mmi,Lmi.attributes.color=ColorGeometryInstanceAttribute.fromColor(t),Omi=Pmi(Lmi))},debugDestroyPrimitive=function(){defined(Omi)&&(Omi.destroy(),Nmi=Omi=void 0)};var otherPassesInitialColor=new Cartesian4(0,0,0,0),surfaceShaderSetOptionsScratch={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,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0},defaultUndergroundColor=Color.TRANSPARENT,defaultundergroundColorAlphaByDistance=new NearFarScalar;function addDrawCommandsForTile(e,t,i){var r=t.data;defined(r.vertexArray)||(void 0===r.fill&&(r.fill=new TerrainFillMesh(t)),r.fill.update(e,i));var n=i.creditDisplay,a=r.terrainData;if(defined(a)&&defined(a.credits))for(var o=a.credits,s=0,l=o.length;s<l;++s)n.addCredit(o[s]);var c=ContextLimits.maximumTextureImageUnits,u=r.waterMaskTexture,d=r.waterMaskTranslationAndScale;!defined(u)&&defined(r.fill)&&(u=r.fill.waterMaskTexture,d=r.fill.waterMaskTranslationAndScale);var h=i.cameraUnderground,p=i.globeTranslucencyState,m=p.translucent,f=p.frontFaceAlphaByDistance,g=p.backFaceAlphaByDistance,_=p.rectangle,y=defaultValue(e.undergroundColor,defaultUndergroundColor),C=defaultValue(e.undergroundColorAlphaByDistance,defaultundergroundColorAlphaByDistance),v=isUndergroundVisible(e,i)&&i.mode===SceneMode$1.SCENE3D&&0<y.alpha&&(0<C.nearValue||0<C.farValue),S=e.hasWaterMask&&defined(u),T=e.oceanNormalMap,x=S&&defined(T),b=e.terrainProvider.ready&&e.terrainProvider.hasVertexNormals,E=i.fog.enabled&&!h,P=e.showGroundAtmosphere&&i.mode===SceneMode$1.SCENE3D,A=ShadowMode$1.castShadows(e.shadows)&&!m,w=ShadowMode$1.receiveShadows(e.shadows)&&!m,D=e.hueShift,M=e.saturationShift,I=e.brightnessShift,R=!(CesiumMath.equalsEpsilon(D,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(M,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(I,0,CesiumMath.EPSILON7)),O=!1;P&&(F=Cartesian3.magnitude(i.camera.positionWC),O=e.nightFadeOutDistance<F),S&&--c,x&&--c,defined(i.shadowState)&&i.shadowState.shadowsEnabled&&--c,defined(e.clippingPlanes)&&e.clippingPlanes.enabled&&--c,c-=p.numberOfTextureUniforms;var L,F,N=r.renderedMesh,B=N.center,V=N.encoding,k=tileRectangleScratch,z=0,$=0,U=0,G=0,H=!1;i.mode!==SceneMode$1.SCENE3D&&(a=(L=i.mapProjection).project(Rectangle.southwest(t.rectangle),southwestScratch),F=L.project(Rectangle.northeast(t.rectangle),northeastScratch),k.x=a.x,k.y=a.y,k.z=F.x,k.w=F.y,i.mode!==SceneMode$1.MORPHING&&((B=rtcScratch).x=0,B.y=.5*(k.z+k.x),B.z=.5*(k.w+k.y),k.x-=B.y,k.y-=B.z,k.z-=B.y,k.w-=B.z),i.mode===SceneMode$1.SCENE2D&&V.quantization===TerrainQuantization$1.BITS12&&(a=1/(Math.pow(2,12)-1)*.5,F=(k.z-k.x)*a,a=(k.w-k.y)*a,k.x-=F,k.y-=a,k.z+=F,k.w+=a),L instanceof WebMercatorProjection&&(z=t.rectangle.south,$=t.rectangle.north,U=WebMercatorProjection.geodeticLatitudeToMercatorAngle(z),G=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle($)-U),H=!0));var W=surfaceShaderSetOptionsScratch;W.frameState=i,W.surfaceTile=r,W.showReflectiveOcean=S,W.showOceanWaves=x,W.enableLighting=e.enableLighting,W.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,W.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,W.showGroundAtmosphere=P,W.perFragmentGroundAtmosphere=O,W.hasVertexNormals=b,W.useWebMercatorProjection=H,W.clippedByBoundaries=r.clippedByBoundaries;var q=r.imagery,j=0,Y=q.length,X=e.showSkirts&&!h&&!m,b=e.backFaceCulling&&!h&&!m,H=b?e._renderState:e._disableCullingRenderState,Q=b?e._blendRenderState:e._disableCullingBlendRenderState,J=H,Z=e._firstPassInitialColor,K=i.context;if(defined(e._debug.boundingSphereTile)||debugDestroyPrimitive(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;for(var ee=e._drawCommands.length,te=0;te<ee;++te)e._uniformMaps[te]=createTileUniformMap(i,e)}do{var ie,re,ne=0;e._drawCommands.length<=e._usedDrawCommands?((ie=new DrawCommand).owner=t,ie.cull=!1,ie.boundingVolume=new BoundingSphere,ie.orientedBoundingBox=void 0,re=createTileUniformMap(i,e),e._drawCommands.push(ie),e._uniformMaps.push(re)):(ie=e._drawCommands[e._usedDrawCommands],re=e._uniformMaps[e._usedDrawCommands]),ie.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile&&(defined(ue=r.orientedBoundingBox)?getDebugOrientedBoundingBox(ue,Color.RED).update(i):defined(N)&&defined(N.boundingSphere3D)&&getDebugBoundingSphere(N.boundingSphere3D,Color.RED).update(i));var ae=re.properties;Cartesian4.clone(Z,ae.initialColor),ae.oceanNormalMap=T,ae.lightingFadeDistance.x=e.lightingFadeOutDistance,ae.lightingFadeDistance.y=e.lightingFadeInDistance,ae.nightFadeDistance.x=e.nightFadeOutDistance,ae.nightFadeDistance.y=e.nightFadeInDistance,ae.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;var oe=h?g:f,se=h?f:g;defined(oe)&&(Cartesian4.fromElements(oe.near,oe.nearValue,oe.far,oe.farValue,ae.frontFaceAlphaByDistance),Cartesian4.fromElements(se.near,se.nearValue,se.far,se.farValue,ae.backFaceAlphaByDistance)),Cartesian4.fromElements(C.near,C.nearValue,C.far,C.farValue,ae.undergroundColorAlphaByDistance),Color.clone(y,ae.undergroundColor);var le=!defined(r.vertexArray)&&defined(e.fillHighlightColor)&&0<e.fillHighlightColor.alpha;le&&Color.clone(e.fillHighlightColor,ae.fillHighlightColor),ae.center3D=N.center,Cartesian3.clone(B,ae.rtc),Cartesian4.clone(k,ae.tileRectangle),ae.southAndNorthLatitude.x=z,ae.southAndNorthLatitude.y=$,ae.southMercatorYAndOneOverHeight.x=U,ae.southMercatorYAndOneOverHeight.y=G;var ce=localizedCartographicLimitRectangleScratch,ue=clipRectangleAntimeridian(t.rectangle,e.cartographicLimitRectangle),oe=localizedTranslucencyRectangleScratch,se=clipRectangleAntimeridian(t.rectangle,_);Cartesian3.fromElements(D,M,I,ae.hsbShift);var de=t.rectangle,he=1/de.width,pe=1/de.height;ce.x=(ue.west-de.west)*he,ce.y=(ue.south-de.south)*pe,ce.z=(ue.east-de.west)*he,ce.w=(ue.north-de.south)*pe,Cartesian4.clone(ce,ae.localizedCartographicLimitRectangle),oe.x=(se.west-de.west)*he,oe.y=(se.south-de.south)*pe,oe.z=(se.east-de.west)*he,oe.w=(se.north-de.south)*pe,Cartesian4.clone(oe,ae.localizedTranslucencyRectangle);for(var ce=E&&CesiumMath.fog(t._distance,i.fog.density)>CesiumMath.EPSILON3,R=R&&(ce||P),me=!1,fe=!1,ge=!1,_e=!1,ye=!1,Ce=!1,ve=!1,Se=!1,Te=!1,xe=!1;ne<c&&j<Y;){var be=q[j],Ee=be.readyImagery;if(++j,defined(Ee)&&0!==Ee.imageryLayer.alpha){var Pe=be.useWebMercatorT?Ee.textureWebMercator:Ee.texture,Ae=Ee.imageryLayer;defined(be.textureTranslationAndScale)||(be.textureTranslationAndScale=Ae._calculateTextureTranslationAndScale(t,be)),ae.dayTextures[ne]=Pe,ae.dayTextureTranslationAndScale[ne]=be.textureTranslationAndScale,ae.dayTextureTexCoordsRectangle[ne]=be.textureCoordinateRectangle,ae.dayTextureUseWebMercatorT[ne]=be.useWebMercatorT,ae.dayTextureAlpha[ne]=Ae.alpha,Ce=Ce||1!==ae.dayTextureAlpha[ne],ae.dayTextureNightAlpha[ne]=Ae.nightAlpha,ve=ve||1!==ae.dayTextureNightAlpha[ne],ae.dayTextureDayAlpha[ne]=Ae.dayAlpha,ve=ve||1!==ae.dayTextureDayAlpha[ne],ae.dayTextureBrightness[ne]=Ae.brightness,me=me||ae.dayTextureBrightness[ne]!==ImageryLayer.DEFAULT_BRIGHTNESS,ae.dayTextureContrast[ne]=Ae.contrast,fe=fe||ae.dayTextureContrast[ne]!==ImageryLayer.DEFAULT_CONTRAST,ae.dayTextureHue[ne]=Ae.hue,ge=ge||ae.dayTextureHue[ne]!==ImageryLayer.DEFAULT_HUE,ae.dayTextureSaturation[ne]=Ae.saturation,_e=_e||ae.dayTextureSaturation[ne]!==ImageryLayer.DEFAULT_SATURATION,ae.dayTextureOneOverGamma[ne]=1/Ae.gamma,ye=ye||ae.dayTextureOneOverGamma[ne]!==1/ImageryLayer.DEFAULT_GAMMA,ae.dayTextureSplit[ne]=Ae.splitDirection;Se=Se||0!==ae.dayTextureSplit[ne],be=ae.dayTextureCutoutRectangles[ne];defined(be)||(be=ae.dayTextureCutoutRectangles[ne]=new Cartesian4),Cartesian4.clone(Cartesian4.ZERO,be),defined(Ae.cutoutRectangle)&&(we=clipRectangleAntimeridian(de,Ae.cutoutRectangle),Te=defined(Rectangle.simpleIntersection(we,de,rectangleIntersectionScratch))||Te,be.x=(we.west-de.west)*he,be.y=(we.south-de.south)*pe,be.z=(we.east-de.west)*he,be.w=(we.north-de.south)*pe);be=ae.colorsToAlpha[ne];defined(be)||(be=ae.colorsToAlpha[ne]=new Cartesian4);var we=defined(Ae.colorToAlpha)&&0<Ae.colorToAlphaThreshold,xe=xe||we;if(we?(we=Ae.colorToAlpha,be.x=we.red,be.y=we.green,be.z=we.blue,be.w=Ae.colorToAlphaThreshold):be.w=-1,defined(Ee.credits))for(var De=Ee.credits,Me=0,Ie=De.length;Me<Ie;++Me)n.addCredit(De[Me]);++ne}}ae.dayTextures.length=ne,ae.waterMask=u,Cartesian4.clone(d,ae.waterMaskTranslationAndScale),ae.minMaxHeight.x=V.minimumHeight,ae.minMaxHeight.y=V.maximumHeight,Matrix4.clone(V.matrix,ae.scaleAndBias);se=e._clippingPlanes,oe=defined(se)&&se.enabled&&t.isClipped;oe&&(ae.clippingPlanesEdgeColor=Color.clone(se.edgeColor,ae.clippingPlanesEdgeColor),ae.clippingPlanesEdgeWidth=se.edgeWidth),W.numberOfDayTextures=ne,W.applyBrightness=me,W.applyContrast=fe,W.applyHue=ge,W.applySaturation=_e,W.applyGamma=ye,W.applyAlpha=Ce,W.applyDayNightAlpha=ve,W.applySplit=Se,W.enableFog=ce,W.enableClippingPlanes=oe,W.clippingPlanes=se,W.hasImageryLayerCutout=Te,W.colorCorrect=R,W.highlightFillTile=le,W.colorToAlpha=xe,W.showUndergroundColor=v,W.translucent=m;oe=r.renderedMesh.indices.length;X||(oe=r.renderedMesh.indexCountWithoutSkirts),ie.shaderProgram=e._surfaceShaderSet.getShaderProgram(W),ie.castShadows=A,ie.receiveShadows=w,ie.renderState=J,ie.primitiveType=PrimitiveType$1.TRIANGLES,ie.vertexArray=r.vertexArray||r.fill.vertexArray,ie.count=oe,ie.uniformMap=re,ie.pass=Pass$1.GLOBE,e._debug.wireframe&&(createWireframeVertexArrayIfNecessary(K,e,t),defined(r.wireframeVertexArray)&&(ie.vertexArray=r.wireframeVertexArray,ie.primitiveType=PrimitiveType$1.LINES,ie.count=2*oe));se=ie.boundingVolume,le=ie.orientedBoundingBox}while(i.mode!==SceneMode$1.SCENE3D?(oe=r.tileBoundingRegion,BoundingSphere.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,oe.minimumHeight,oe.maximumHeight,se),Cartesian3.fromElements(se.center.z,se.center.x,se.center.y,se.center),i.mode===SceneMode$1.MORPHING&&(se=BoundingSphere.union(N.boundingSphere3D,se,se))):(ie.boundingVolume=BoundingSphere.clone(N.boundingSphere3D,se),ie.orientedBoundingBox=OrientedBoundingBox.clone(r.orientedBoundingBox,le)),ie.dirty=!0,m&&p.updateDerivedCommands(ie,i),pushCommand(ie,i),J=Q,Z=otherPassesInitialColor,j<Y)}function GlobeTranslucency(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=Rectangle.clone(Rectangle.MAX_VALUE)}function ImageryLayerCollection(){this._layers=[],this.layerAdded=new Event,this.layerRemoved=new Event,this.layerMoved=new Event,this.layerShownOrHidden=new Event}function getLayerIndex(e,t){return e.indexOf(t)}function swapLayers(e,t,i){var r,n=e._layers;(t=CesiumMath.clamp(t,0,n.length-1))!==(i=CesiumMath.clamp(i,0,n.length-1))&&(r=n[t],n[t]=n[i],n[i]=r,e._update(),e.layerMoved.raiseEvent(r,i,t))}Object.defineProperties(GlobeTranslucency.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=NearFarScalar.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=NearFarScalar.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){defined(e)||(e=Rectangle.clone(Rectangle.MAX_VALUE)),Rectangle.clone(e,this._rectangle)}}}),Object.defineProperties(ImageryLayerCollection.prototype,{length:{get:function(){return this._layers.length}}}),ImageryLayerCollection.prototype.add=function(e,t){defined(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t)},ImageryLayerCollection.prototype.addImageryProvider=function(e,t){e=new ImageryLayer(e);return this.add(e,t),e},ImageryLayerCollection.prototype.remove=function(e,t){t=defaultValue(t,!0);var i=this._layers.indexOf(e);return-1!==i&&(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(e,i),t&&e.destroy(),!0)},ImageryLayerCollection.prototype.removeAll=function(e){e=defaultValue(e,!0);for(var t=this._layers,i=0,r=t.length;i<r;i++){var n=t[i];this.layerRemoved.raiseEvent(n,i),e&&n.destroy()}this._layers=[]},ImageryLayerCollection.prototype.contains=function(e){return-1!==this.indexOf(e)},ImageryLayerCollection.prototype.indexOf=function(e){return this._layers.indexOf(e)},ImageryLayerCollection.prototype.get=function(e){return this._layers[e]},ImageryLayerCollection.prototype.raise=function(e){e=getLayerIndex(this._layers,e);swapLayers(this,e,e+1)},ImageryLayerCollection.prototype.lower=function(e){e=getLayerIndex(this._layers,e);swapLayers(this,e,e-1)},ImageryLayerCollection.prototype.raiseToTop=function(e){var t=getLayerIndex(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))},ImageryLayerCollection.prototype.lowerToBottom=function(e){var t=getLayerIndex(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var applicableRectangleScratch=new Rectangle,comparisonPoint;function QuadtreeOccluders(e){this._ellipsoid=new EllipsoidalOccluder(e.ellipsoid,Cartesian3.ZERO)}function QuadtreeTile(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=TileSelectionResult.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=QuadtreeTileLoadState$1.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function freeTile(e){defined(e)&&e.freeResources()}function TileReplacementQueue(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function remove(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}function QuadtreePrimitive(e){this._tileProvider=e.tileProvider,(this._tileProvider.quadtree=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};var t=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new TileReplacementQueue,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=defaultValue(e.maximumScreenSpaceError,2),this.tileCacheSize=defaultValue(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new QuadtreeOccluders({ellipsoid:t}),this._tileLoadProgressEvent=new Event,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}function invalidateAllTiles(e){var t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,clearTileLoadQueue(e);var i=e._levelZeroTiles;if(defined(i))for(var r=0;r<i.length;++r){for(var n=i[r].customData,a=n.length,o=0;o<a;++o){var s=n[o];s.level=0,e._addHeightCallbacks.push(s)}i[r].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}function clearTileLoadQueue(e){var 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}function updateTileLoadProgress(e,t){var i=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;i===e._lastTileLoadQueueLength&&!e._tilesInvalidated||(t.afterRender.push(Event.prototype.raiseEvent.bind(e._tileLoadProgressEvent,i)),e._lastTileLoadQueueLength=i);i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(e,t){return Math.max(e,t.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))}ImageryLayerCollection.prototype.pickImageryLayerFeatures=function(e,t){e=t.globe.pick(e,t);if(defined(e)){for(var i,s=t.globe.ellipsoid.cartesianToCartographic(e),r=t.globe._surface._tilesToRender,n=0;!defined(i)&&n<r.length;++n){var a=r[n];Rectangle.contains(a.rectangle,s)&&(i=a)}if(defined(i)){for(var o=i.data.imagery,l=[],c=[],u=o.length-1;0<=u;--u){var d,h,p,m=o[u],f=m.readyImagery;defined(f)&&(defined((p=f.imageryLayer.imageryProvider).pickFeatures)&&Rectangle.contains(f.rectangle,s)&&(h=1/1024,(d=applicableRectangleScratch).west=CesiumMath.lerp(i.rectangle.west,i.rectangle.east,m.textureCoordinateRectangle.x-h),d.east=CesiumMath.lerp(i.rectangle.west,i.rectangle.east,m.textureCoordinateRectangle.z+h),d.south=CesiumMath.lerp(i.rectangle.south,i.rectangle.north,m.textureCoordinateRectangle.y-h),d.north=CesiumMath.lerp(i.rectangle.south,i.rectangle.north,m.textureCoordinateRectangle.w+h),!Rectangle.contains(d,s)||defined(p=p.pickFeatures(f.x,f.y,f.level,s.longitude,s.latitude))&&(l.push(p),c.push(f.imageryLayer))))}if(0!==l.length)return when.all(l,function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i],n=c[i];if(defined(r)&&0<r.length)for(var a=0;a<r.length;++a){var o=r[a];o.imageryLayer=n,defined(o.position)||(o.position=s),t.push(o)}}return t})}}},ImageryLayerCollection.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},ImageryLayerCollection.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},ImageryLayerCollection.prototype.isDestroyed=function(){return!1},ImageryLayerCollection.prototype.destroy=function(){return this.removeAll(!0),destroyObject(this)},ImageryLayerCollection.prototype._update=function(){for(var e,t,i=!0,r=this._layers,n=0,a=r.length;n<a;++n)(t=r[n])._layerIndex=n,t.show?(t._isBaseLayer=i,i=!1):t._isBaseLayer=!1,t.show!==t._show&&(defined(t._show)&&(e=!defined(e)?[]:e).push(t),t._show=t.show);if(defined(e))for(n=0,a=e.length;n<a;++n)t=e[n],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)},Object.defineProperties(QuadtreeOccluders.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),QuadtreeTile.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var o=0;o<t;++o)r[n++]=new QuadtreeTile({tilingScheme:e,x:o,y:a,level:0});return r},QuadtreeTile.prototype._updateCustomData=function(e,t,i){var r,n=this.customData;if(defined(t)&&defined(i)){for(n=n.filter(function(e){return-1===i.indexOf(e)}),this._customData=n,a=this._rectangle,s=0;s<t.length;++s)r=t[s],Rectangle.contains(a,r.positionCartographic)&&n.push(r);this._frameUpdated=e}else{e=this._parent;if(defined(e)&&this._frameUpdated!==e._frameUpdated){n.length=0;for(var a=this._rectangle,o=e.customData,s=0;s<o.length;++s)r=o[s],Rectangle.contains(a,r.positionCartographic)&&n.push(r);this._frameUpdated=e._frameUpdated}}},Object.defineProperties(QuadtreeTile.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 defined(this._southwestChild)||(this._southwestChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return defined(this._southeastChild)||(this._southeastChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return defined(this._northwestChild)||(this._northwestChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return defined(this._northeastChild)||(this._northeastChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<QuadtreeTileLoadState$1.DONE}},eligibleForUnloading:{get:function(){var e=!0;return defined(this.data)&&(defined(e=this.data.eligibleForUnloading)||(e=!0)),e}}}),QuadtreeTile.prototype.findLevelZeroTile=function(e,t,i){var r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=r:r<=t&&(t-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(e){return e.x===t&&e.y===i})[0]},QuadtreeTile.prototype.findTileToWest=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;e=t.findTileToWest(e);return void 0!==e?t.southwestChild===this?e.southeastChild:e.northeastChild:void 0},QuadtreeTile.prototype.findTileToEast=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;e=t.findTileToEast(e);return void 0!==e?t.southeastChild===this?e.southwestChild:e.northwestChild:void 0},QuadtreeTile.prototype.findTileToSouth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;e=t.findTileToSouth(e);return void 0!==e?t.southwestChild===this?e.northwestChild:e.northeastChild:void 0},QuadtreeTile.prototype.findTileToNorth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;e=t.findTileToNorth(e);return void 0!==e?t.northwestChild===this?e.southwestChild:e.southeastChild:void 0},QuadtreeTile.prototype.freeResources=function(){this.state=QuadtreeTileLoadState$1.START,this.renderable=!1,this.upsampledFromParent=!1,defined(this.data)&&defined(this.data.freeResources)&&this.data.freeResources(),freeTile(this._southwestChild),this._southwestChild=void 0,freeTile(this._southeastChild),this._southeastChild=void 0,freeTile(this._northwestChild),this._northwestChild=void 0,freeTile(this._northeastChild),this._northeastChild=void 0},TileReplacementQueue.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},TileReplacementQueue.prototype.trimTiles=function(e){for(var t=this.tail,i=!0;i&&defined(this._lastBeforeStartOfFrame)&&this.count>e&&defined(t);){var i=t!==this._lastBeforeStartOfFrame,r=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),remove(this,t)),t=r}},TileReplacementQueue.prototype.markTileRendered=function(e){var t=this.head;if(t!==e){if(++this.count,!defined(t))return e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,void(this.tail=e);(defined(e.replacementPrevious)||defined(e.replacementNext))&&remove(this,e),e.replacementPrevious=void 0,(e.replacementNext=t).replacementPrevious=e,this.head=e}else e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext)},Object.defineProperties(QuadtreePrimitive.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}}),QuadtreePrimitive.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0},QuadtreePrimitive.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;defined(t);)t.state!==QuadtreeTileLoadState$1.START&&e(t),t=t.replacementNext},QuadtreePrimitive.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},QuadtreePrimitive.prototype.updateHeight=function(e,t){var r=this,n={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t,removeFunc:function(){for(var e=r._addHeightCallbacks,t=e.length,i=0;i<t;++i)if(e[i]===n){e.splice(i,1);break}r._removeHeightCallbacks.push(n)}};return r._addHeightCallbacks.push(n),n.removeFunc},QuadtreePrimitive.prototype.update=function(e){defined(this._tileProvider.update)&&this._tileProvider.update(e)},QuadtreePrimitive.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(invalidateAllTiles(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),clearTileLoadQueue(this),this._debug.suspendLodUpdate||this._tileReplacementQueue.markStartOfRenderFrame())},QuadtreePrimitive.prototype.render=function(e){var t=e.passes,i=this._tileProvider;t.render&&(i.beginUpdate(e),selectTilesForRendering(this,e),createRenderCommandsForSelectedTiles(this,e),i.endUpdate(e)),t.pick&&0<this._tilesToRender.length&&i.updateForPick(e)},QuadtreePrimitive.prototype.endFrame=function(e){e.passes.render&&e.mode!==SceneMode$1.MORPHING&&(processTileLoadQueue(this,e),updateHeights(this,e),updateTileLoadProgress(this,e))},QuadtreePrimitive.prototype.isDestroyed=function(){return!1},QuadtreePrimitive.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var centerScratch=new Cartographic;function compareDistanceToPoint(e,t){var i=Rectangle.center(e.rectangle,centerScratch),r=i.longitude-comparisonPoint.longitude,e=i.latitude-comparisonPoint.latitude,t=(i=Rectangle.center(t.rectangle,centerScratch)).longitude-comparisonPoint.longitude,i=i.latitude-comparisonPoint.latitude;return r*r+e*e-(t*t+i*i)}var cameraOriginScratch=new Cartesian3,rootTraversalDetails=[];function selectTilesForRendering(e,t){var i,r=e._debug;if(!r.suspendLodUpdate){e._tilesToRender.length=0;var n,a=e._tileProvider;if(!defined(e._levelZeroTiles)){if(!a.ready)return;var o=a.tilingScheme;e._levelZeroTiles=QuadtreeTile.createLevelZeroTiles(o);var s=e._levelZeroTiles.length;if(rootTraversalDetails.length<s)for(rootTraversalDetails=new Array(s),i=0;i<s;++i)void 0===rootTraversalDetails[i]&&(rootTraversalDetails[i]=new TraversalDetails)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l=e._levelZeroTiles,c=1<l.length?e._occluders:void 0;comparisonPoint=t.camera.positionCartographic,l.sort(compareDistanceToPoint);var u,d=e._addHeightCallbacks,h=e._removeHeightCallbacks,p=t.frameNumber;if(0<d.length||0<h.length){for(i=0,u=l.length;i<u;++i)(n=l[i])._updateCustomData(p,d,h);d.length=0,h.length=0}o=t.camera;e._cameraPositionCartographic=o.positionCartographic;o=Matrix4.getTranslation(o.transform,cameraOriginScratch);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(o,e._cameraReferenceFrameOriginCartographic),i=0,u=l.length;i<u;++i)n=l[i],e._tileReplacementQueue.markTileRendered(n),n.renderable?visitIfVisible(e,n,a,t,c,!1,rootTraversalDetails[i]):(queueTileLoad(e,e._tileLoadQueueHigh,n,t),++r.tilesWaitingForChildren);e._lastSelectionFrameNumber=p}}function queueTileLoad(e,t,i,r){i.needsLoading&&(void 0!==e.tileProvider.computeTileLoadPriority&&(i._loadPriority=e.tileProvider.computeTileLoadPriority(i,r)),t.push(i))}function TraversalDetails(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function TraversalQuadDetails(){this.southwest=new TraversalDetails,this.southeast=new TraversalDetails,this.northwest=new TraversalDetails,this.northeast=new TraversalDetails}TraversalQuadDetails.prototype.combine=function(e){var t=this.southwest,i=this.southeast,r=this.northwest,n=this.northeast;e.allAreRenderable=t.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable&&n.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount+n.notYetRenderableCount};for(var traversalQuadsByLevel=new Array(31),i$1=0;i$1<traversalQuadsByLevel.length;++i$1)traversalQuadsByLevel[i$1]=new TraversalQuadDetails;function visitTile(e,t,i,r,n){var a=e._debug;++a.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>a.maxDepthVisited&&(a.maxDepthVisited=i.level);var o=screenSpaceError(e,t,i)<e.maximumScreenSpaceError,s=i.southwestChild,l=i.southeastChild,c=i.northwestChild,u=i.northeastChild,d=e._lastSelectionFrameNumber,h=i._lastSelectionResultFrame===d?i._lastSelectionResult:TileSelectionResult.NONE,d=e.tileProvider;if(o||r){var p=TileSelectionResult.originalResult(h)===TileSelectionResult.RENDERED,m=TileSelectionResult.originalResult(h)===TileSelectionResult.CULLED||h===TileSelectionResult.NONE,f=i.state===QuadtreeTileLoadState$1.DONE,p=p||m||f;if(p||defined(d.canRenderWithoutLosingDetail)&&(p=d.canRenderWithoutLosingDetail(i)),p)return o&&queueTileLoad(e,e._tileLoadQueueMedium,i,t),addTileToRenderList(e,i),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));r=!0,o&&queueTileLoad(e,e._tileLoadQueueHigh,i,t)}if(d.canRefine(i)){if(s.upsampledFromParent&&l.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent)return addTileToRenderList(e,i),queueTileLoad(e,e._tileLoadQueueMedium,i,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.REFINED;m=e._tilesToRender.length,f=e._tileLoadQueueLow.length,p=e._tileLoadQueueMedium.length,o=e._tileLoadQueueHigh.length,d=e._tileToUpdateHeights.length;if(visitVisibleChildrenNearToFar(e,s,l,c,u,t,r,n),m!==e._tilesToRender.length){l=n.allAreRenderable,c=n.anyWereRenderedLastFrame,u=n.notYetRenderableCount,r=!1;if(!l&&!c){for(var g=e._tilesToRender,_=m;_<g.length;++_)for(var y=g[_];void 0!==y&&y._lastSelectionResult!==TileSelectionResult.KICKED&&y!==i;)y._lastSelectionResult=TileSelectionResult.kick(y._lastSelectionResult),y=y.parent;e._tilesToRender.length=m,e._tileToUpdateHeights.length=d,addTileToRenderList(e,i),i._lastSelectionResult=TileSelectionResult.RENDERED;d=h===TileSelectionResult.RENDERED;!d&&u>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=f,e._tileLoadQueueMedium.length=p,e._tileLoadQueueHigh.length=o,queueTileLoad(e,e._tileLoadQueueMedium,i,t),n.notYetRenderableCount=i.renderable?0:1,r=!0),n.allAreRenderable=i.renderable,(n.anyWereRenderedLastFrame=d)||e._tileToUpdateHeights.push(i),++a.tilesWaitingForChildren}e.preloadAncestors&&!r&&queueTileLoad(e,e._tileLoadQueueLow,i,t)}}else i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,addTileToRenderList(e,i),queueTileLoad(e,e._tileLoadQueueHigh,i,t),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1}function visitVisibleChildrenNearToFar(e,t,i,r,n,a,o,s){var l=a.camera.positionCartographic,c=e._tileProvider,u=e._occluders,d=traversalQuadsByLevel[t.level],h=d.southwest,p=d.southeast,m=d.northwest,f=d.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,n,c,a,u,o,f)):(visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,i,c,a,u,o,p)):l.latitude<t.rectangle.north?(visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,r,c,a,u,o,m)):(visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,t,c,a,u,o,h)),d.combine(s)}function containsNeededPosition(e,t){t=t.rectangle;return defined(e._cameraPositionCartographic)&&Rectangle.contains(t,e._cameraPositionCartographic)||defined(e._cameraReferenceFrameOriginCartographic)&&Rectangle.contains(t,e._cameraReferenceFrameOriginCartographic)}function visitIfVisible(e,t,i,r,n,a,o){if(i.computeTileVisibility(t,r,n)!==Visibility$1.NONE)return visitTile(e,r,t,a,o);++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),o.allAreRenderable=!0,o.anyWereRenderedLastFrame=!1,o.notYetRenderableCount=0,containsNeededPosition(e,t)?(defined(t.data)&&defined(t.data.vertexArray)||queueTileLoad(e,e._tileLoadQueueMedium,t,r),o=e._lastSelectionFrameNumber,(o=t._lastSelectionResultFrame===o?t._lastSelectionResult:TileSelectionResult.NONE)!==TileSelectionResult.CULLED_BUT_NEEDED&&o!==TileSelectionResult.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=TileSelectionResult.CULLED_BUT_NEEDED):(!e.preloadSiblings&&0!==t.level||queueTileLoad(e,e._tileLoadQueueLow,t,r),t._lastSelectionResult=TileSelectionResult.CULLED),t._lastSelectionResultFrame=r.frameNumber}function screenSpaceError(e,t,i){if(t.mode===SceneMode$1.SCENE2D||t.camera.frustum instanceof OrthographicFrustum||t.camera.frustum instanceof OrthographicOffCenterFrustum)return screenSpaceError2D(e,t,i);e=e._tileProvider.getLevelMaximumGeometricError(i.level),i=i._distance,e=e*t.context.drawingBufferHeight/(i*t.camera.frustum.sseDenominator);return t.fog.enabled&&(e-=CesiumMath.fog(i,t.fog.density)*t.fog.sse),e/=t.pixelRatio}function screenSpaceError2D(e,t,i){var r=t.camera.frustum;defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);var n=t.context,a=n.drawingBufferWidth,n=n.drawingBufferHeight,n=e._tileProvider.getLevelMaximumGeometricError(i.level)/(Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,n));return t.fog.enabled&&t.mode!==SceneMode$1.SCENE2D&&(n-=CesiumMath.fog(i._distance,t.fog.density)*t.fog.sse),n/=t.pixelRatio}function addTileToRenderList(e,t){e._tilesToRender.push(t)}function processTileLoadQueue(e,t){var i,r,n=e._tileLoadQueueHigh,a=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;0===n.length&&0===a.length&&0===o.length||(e._tileReplacementQueue.trimTiles(e.tileCacheSize),i=getTimestamp$1()+e._loadQueueTimeSlice,n=processSinglePriorityLoadQueue(e,t,r=e._tileProvider,i,n,!1),n=processSinglePriorityLoadQueue(e,t,r,i,a,n),processSinglePriorityLoadQueue(e,t,r,i,o,n))}function sortByLoadPriority(e,t){return e._loadPriority-t._loadPriority}function processSinglePriorityLoadQueue(e,t,i,r,n,a){void 0!==i.computeTileLoadPriority&&n.sort(sortByLoadPriority);for(var o=0,s=n.length;o<s&&(getTimestamp$1()<r||!a);++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l),a=!0}return a}var scratchRay=new Ray,scratchCartographic$2=new Cartographic,scratchPosition$1=new Cartesian3,scratchArray$1=[];function updateHeights(e,t){if(e.tileProvider.ready){var i=scratchArray$1;i.length=0;for(var r=e._tileToUpdateHeights,n=e._tileProvider.terrainProvider,a=getTimestamp$1()+e._updateHeightsTimeSlice,o=t.mode,s=t.mapProjection,l=e.tileProvider.tilingScheme.ellipsoid;0<r.length;){var c=r[0];if(defined(c.data)&&defined(c.data.mesh)){for(var u=c.customData,d=u.length,h=!1,p=e._lastTileIndex;p<d;++p){var m,f,g=u[p];if(c.level>g.level){defined(g.positionOnEllipsoidSurface)||(g.positionOnEllipsoidSurface=Cartesian3.fromRadians(g.positionCartographic.longitude,g.positionCartographic.latitude,0,l)),o===SceneMode$1.SCENE3D?(m=l.geodeticSurfaceNormal(g.positionOnEllipsoidSurface,scratchRay.direction),defined(l.getSurfaceNormalIntersectionWithZAxis(g.positionOnEllipsoidSurface,11500,scratchRay.origin))||(defined(c.data.tileBoundingRegion)&&(f=c.data.tileBoundingRegion.minimumHeight),_=Math.min(defaultValue(f,0),-11500),T=Cartesian3.multiplyByScalar(m,Math.abs(_)+1,scratchPosition$1),Cartesian3.subtract(g.positionOnEllipsoidSurface,T,scratchRay.origin))):(Cartographic.clone(g.positionCartographic,scratchCartographic$2),scratchCartographic$2.height=-11500,s.project(scratchCartographic$2,scratchPosition$1),Cartesian3.fromElements(scratchPosition$1.z,scratchPosition$1.x,scratchPosition$1.y,scratchPosition$1),Cartesian3.clone(scratchPosition$1,scratchRay.origin),Cartesian3.clone(Cartesian3.UNIT_X,scratchRay.direction));var _=c.data.pick(scratchRay,o,s,!1,scratchPosition$1);defined(_)&&(g.callback(_),g.level=c.level)}else if(c.level===g.level){for(var y,C=c.children,v=C.length,S=0;S<v&&(y=C[S],!Rectangle.contains(y.rectangle,g.positionCartographic));++S);var T=n.getTileDataAvailable(y.x,y.y,y.level),_=c.parent;(defined(T)&&!T||defined(_)&&defined(_.data)&&defined(_.data.terrainData)&&!_.data.terrainData.isChildAvailable(_.x,_.y,y.x,y.y))&&g.removeFunc()}if(getTimestamp$1()>=a){h=!0;break}}if(h){e._lastTileIndex=p;break}e._lastTileIndex=0,r.shift()}else{var x=c._lastSelectionResultFrame===e._lastSelectionFrameNumber?c._lastSelectionResult:TileSelectionResult.NONE;x!==TileSelectionResult.RENDERED&&x!==TileSelectionResult.CULLED_BUT_NEEDED||i.push(c),r.shift(),e._lastTileIndex=0}}for(p=0;p<i.length;p++)r.push(i[p])}}function createRenderCommandsForSelectedTiles(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=0,a=r.length;n<a;++n){var o=r[n];i.showTileThisFrame(o,t)}}function Globe(e){var t=new EllipsoidTerrainProvider({ellipsoid:e=defaultValue(e,Ellipsoid.WGS84)}),i=new ImageryLayerCollection;this._ellipsoid=e,this._imageryLayerCollection=i,this._surfaceShaderSet=new GlobeSurfaceShaderSet,this._material=void 0,this._surface=new QuadtreePrimitive({tileProvider:new GlobeSurfaceTileProvider({terrainProvider:t,imageryLayers:i,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new Event,this._undergroundColor=Color.clone(Color.BLACK),this._undergroundColorAlphaByDistance=new NearFarScalar(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new GlobeTranslucency,makeShadersDirty(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Resource({url:buildModuleUrl("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.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=ShadowMode$1.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}function makeShadersDirty(e){var t=[],i=defined(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),r=[GroundAtmosphere];!defined(e._material)||i&&!e._terrainProvider.requestVertexNormals?e._surface._tileProvider.materialUniformMap=void 0:(r.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms),r.push(GlobeFS),e._surfaceShaderSet.baseVertexShaderSource=new ShaderSource({sources:[GroundAtmosphere,GlobeVS],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new ShaderSource({sources:r,defines:t}),e._surfaceShaderSet.material=e._material}function createComparePickTileFunction(i){return function(e,t){return BoundingSphere.distanceSquaredTo(e.pickBoundingSphere,i)-BoundingSphere.distanceSquaredTo(t.pickBoundingSphere,i)}}Object.defineProperties(Globe.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!defined(this._surface)||this._surface.tileProvider.ready&&0===this._surface._tileLoadQueueHigh.length&&0===this._surface._tileLoadQueueMedium.length&&0===this._surface._tileLoadQueueLow.length}},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}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){defined(e)||(e=Rectangle.clone(Rectangle.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),defined(this._material)&&makeShadersDirty(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,makeShadersDirty(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=Color.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=NearFarScalar.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});var scratchArray=[],scratchSphereIntersectionResult={start:0,stop:0};Globe.prototype.pickWorldCoordinates=function(e,t,i,r){i=defaultValue(i,!0);var n=t.mode,a=t.mapProjection,o=scratchArray;o.length=0;for(var s,l=this._surface._tilesToRender,c=l.length,u=0;u<c;++u){var d,h=(d=l[u]).data;if(defined(h)){var p=h.pickBoundingSphere;if(n!==SceneMode$1.SCENE3D)h.pickBoundingSphere=p=BoundingSphere.fromRectangleWithHeights2D(d.rectangle,a,h.tileBoundingRegion.minimumHeight,h.tileBoundingRegion.maximumHeight,p),Cartesian3.fromElements(p.center.z,p.center.x,p.center.y,p.center);else{if(!defined(h.renderedMesh))continue;BoundingSphere.clone(h.renderedMesh.boundingSphere3D,p)}defined(IntersectionTests.raySphere(e,p,scratchSphereIntersectionResult))&&o.push(h)}}for(o.sort(createComparePickTileFunction(e.origin)),c=o.length,u=0;u<c&&!defined(s=o[u].pick(e,t.mode,t.mapProjection,i,r));++u);return s};var cartoScratch=new Cartographic;Globe.prototype.pick=function(e,t,i){return defined(i=this.pickWorldCoordinates(e,t,!0,i))&&t.mode!==SceneMode$1.SCENE3D&&(i=Cartesian3.fromElements(i.y,i.z,i.x,i),e=t.mapProjection.unproject(i,cartoScratch),i=t.globe.ellipsoid.cartographicToCartesian(e,i)),i};var scratchGetHeightCartesian=new Cartesian3,scratchGetHeightIntersection=new Cartesian3,scratchGetHeightCartographic=new Cartographic,scratchGetHeightRay=new Ray;function tileIfContainsCartographic(e,t){return defined(e)&&Rectangle.contains(e.rectangle,t)?e:void 0}Globe.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(defined(t)){for(var i,r=t.length,n=0;n<r&&(i=t[n],!Rectangle.contains(i.rectangle,e));++n);if(!(r<=n)){for(var a=i;defined(i);)defined(i=tileIfContainsCartographic(i._southwestChild,e)||tileIfContainsCartographic(i._southeastChild,e)||tileIfContainsCartographic(i._northwestChild,e)||i._northeastChild)&&defined(i.data)&&defined(i.data.renderedMesh)&&(a=i);if(defined(i=a)&&defined(i.data)&&defined(i.data.renderedMesh)){var o,s=this._surface._tileProvider.tilingScheme.ellipsoid,l=Cartesian3.fromRadians(e.longitude,e.latitude,0,s,scratchGetHeightCartesian),c=scratchGetHeightRay,u=s.geodeticSurfaceNormal(l,c.direction);defined(s.getSurfaceNormalIntersectionWithZAxis(l,11500,c.origin))||(defined(i.data.tileBoundingRegion)&&(o=i.data.tileBoundingRegion.minimumHeight),o=Math.min(defaultValue(o,0),-11500),o=Cartesian3.multiplyByScalar(u,Math.abs(o)+1,scratchGetHeightIntersection),Cartesian3.subtract(l,o,c.origin));c=i.data.pick(c,void 0,void 0,!1,scratchGetHeightIntersection);if(defined(c))return s.cartesianToCartographic(c,scratchGetHeightCartographic).height}}}},Globe.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)},Globe.prototype.beginFrame=function(t){var i,r,e=this._surface,n=e.tileProvider,a=this.terrainProvider,o=this.showWaterEffect&&a.ready&&a.hasWaterMask;o&&this._oceanNormalMapResourceDirty&&(this._oceanNormalMapResourceDirty=!1,s=this._oceanNormalMapResource,defined(i=s.url)?(r=this,when(s.fetchImage(),function(e){i===r._oceanNormalMapResource.url&&(r._oceanNormalMap=r._oceanNormalMap&&r._oceanNormalMap.destroy(),r._oceanNormalMap=new Texture({context:t.context,source:e}))})):this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy());var a=t.passes,s=t.mode;a.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e.tileCacheSize=this.tileCacheSize,e.loadingDescendantLimit=this.loadingDescendantLimit,e.preloadAncestors=this.preloadAncestors,e.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===SceneMode$1.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,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.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,e.beginFrame(t))},Globe.prototype.render=function(e){this.show&&(defined(this._material)&&this._material.update(e.context),this._surface.render(e))},Globe.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},Globe.prototype.isDestroyed=function(){return!1},Globe.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(),destroyObject(this)};var PassThrough="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n}\n",PassThroughDepth="uniform highp sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);\n}\n";function GlobeDepth(){this._globeColorTexture=void 0,this._primitiveColorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this._tempGlobeDepthTexture=void 0,this._tempCopyDepthTexture=void 0,this._globeColorFramebuffer=void 0,this._primitiveColorFramebuffer=void 0,this._copyDepthFramebuffer=void 0,this._tempCopyDepthFramebuffer=void 0,this._updateDepthFramebuffer=void 0,this._clearGlobeColorCommand=void 0,this._clearPrimitiveColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._mergeColorCommand=void 0,this._viewport=new BoundingRectangle,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useLogDepth=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0,this._debugGlobeDepthViewportCommand=void 0}function executeDebugGlobeDepth(e,t,i,r){var n;defined(e._debugGlobeDepthViewportCommand)&&r===e._useLogDepth||(n=new ShaderSource({defines:[r?"LOG_DEPTH":""],sources:["uniform highp sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"]}),e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_depthTexture:function(){return e._globeDepthTexture}},owner:e}),e._useLogDepth=r),e._debugGlobeDepthViewportCommand.execute(t,i)}function destroyTextures$2(e){e._globeColorTexture=e._globeColorTexture&&!e._globeColorTexture.isDestroyed()&&e._globeColorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function destroyFramebuffers$2(e){e._globeColorFramebuffer=e._globeColorFramebuffer&&!e._globeColorFramebuffer.isDestroyed()&&e._globeColorFramebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function destroyUpdateDepthResources(e){e._tempCopyDepthFramebuffer=e._tempCopyDepthFramebuffer&&!e._tempCopyDepthFramebuffer.isDestroyed()&&e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer=e._updateDepthFramebuffer&&!e._updateDepthFramebuffer.isDestroyed()&&e._updateDepthFramebuffer.destroy(),e._tempGlobeDepthTexture=e._tempGlobeDepthTexture&&!e._tempGlobeDepthTexture.isDestroyed()&&e._tempGlobeDepthTexture.destroy()}function createUpdateDepthResources(e,t,i,r,n){e._tempGlobeDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e._tempCopyDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._tempGlobeDepthTexture],destroyAttachments:!1}),e._updateDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeDepthTexture],depthStencilTexture:n.framebuffer.depthStencilTexture,destroyAttachments:!1})}function createTextures$1(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._globeColorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}),e._globeDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST})}function createFramebuffers$2(e,t){e._globeColorFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeColorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function createPrimitiveFramebuffer(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._primitiveColorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),e._primitiveColorFramebuffer=new Framebuffer({context:t,colorTextures:[e._primitiveColorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1})}function destroyPrimitiveFramebuffer(e){e._primitiveColorTexture=e._primitiveColorTexture&&!e._primitiveColorTexture.isDestroyed()&&e._primitiveColorTexture.destroy(),e._primitiveColorFramebuffer=e._primitiveColorFramebuffer&&!e._primitiveColorFramebuffer.isDestroyed()&&e._primitiveColorFramebuffer.destroy()}function updateFramebuffers$3(e,t,i,r,n,a){var o=e._globeColorTexture,o=!defined(o)||o.width!==i||o.height!==r||n!==e._useHdr;o&&(destroyTextures$2(e),destroyFramebuffers$2(e),createTextures$1(e,t,i,r,n),createFramebuffers$2(e,t)),!o&&a===e._clearGlobeDepth||(destroyPrimitiveFramebuffer(e),a&&createPrimitiveFramebuffer(e,t,i,r,n))}function updateCopyCommands$1(e,t,i,r,n){e._viewport.width=i,e._viewport.height=r;i=!BoundingRectangle.equals(e._viewport,n.viewport),r=i!==e._useScissorTest;e._useScissorTest=i,BoundingRectangle.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=BoundingRectangle.clone(n.viewport,e._scissorRectangle),r=!0),defined(e._rs)&&BoundingRectangle.equals(e._viewport,e._rs.viewport)&&!r||(e._rs=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:BlendingState$1.ALPHA_BLEND}),e._rsUpdate=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})),defined(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._depthStencilTexture}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer,e._copyDepthCommand.renderState=e._rs,defined(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._globeColorTexture}},owner:e})),e._copyColorCommand.renderState=e._rs,defined(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer,e._tempCopyDepthCommand.renderState=e._rs,defined(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._tempGlobeDepthTexture}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer,e._updateDepthCommand.renderState=e._rsUpdate,defined(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ClearCommand({color:new Color(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e._globeColorFramebuffer,defined(e._clearPrimitiveColorCommand)||(e._clearPrimitiveColorCommand=new ClearCommand({color:new Color(0,0,0,0),stencil:0,owner:e})),e._clearPrimitiveColorCommand.framebuffer=e._primitiveColorFramebuffer,defined(e._mergeColorCommand)||(e._mergeColorCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._primitiveColorTexture}},owner:e})),e._mergeColorCommand.framebuffer=e._globeColorFramebuffer,e._mergeColorCommand.renderState=e._rsBlend}function GlobeTranslucencyFramebuffer(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._framebuffer=void 0,this._packedDepthTexture=void 0,this._packedDepthFramebuffer=void 0,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new BoundingRectangle,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}function destroyResources$3(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&!e._depthStencilRenderbuffer.isDestroyed()&&e._depthStencilRenderbuffer.destroy(),e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy(),e._packedDepthTexture=e._packedDepthTexture&&!e._packedDepthTexture.isDestroyed()&&e._packedDepthTexture.destroy(),e._packedDepthFramebuffer=e._packedDepthFramebuffer&&!e._packedDepthFramebuffer.isDestroyed()&&e._packedDepthFramebuffer.destroy()}function createResources$1(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._colorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),t.depthTexture?e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}):e._depthStencilRenderbuffer=new Renderbuffer({context:t,width:i,height:r,format:RenderbufferFormat$1.DEPTH_STENCIL}),e._framebuffer=new Framebuffer({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,depthStencilRenderbuffer:e._depthStencilRenderbuffer,destroyAttachments:!1}),e._packedDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e._packedDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._packedDepthTexture],destroyAttachments:!1})}function updateResources(e,t,i,r,n){var a=e._colorTexture;defined(a)&&a.width===i&&a.height===r&&n===e._useHdr||(destroyResources$3(e),createResources$1(e,t,i,r,n))}function updateCommands(e,t,i,r,n){e._viewport.width=i,e._viewport.height=r;i=!BoundingRectangle.equals(e._viewport,n.viewport),r=i!==e._useScissorTest;e._useScissorTest=i,BoundingRectangle.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=BoundingRectangle.clone(n.viewport,e._scissorRectangle),r=!0),defined(e._renderState)&&BoundingRectangle.equals(e._viewport,e._renderState.viewport)&&!r||(e._renderState=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),defined(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._depthStencilTexture}},owner:e})),defined(e._clearCommand)||(e._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e._framebuffer,e._clearCommand.renderState=e._renderState}Object.defineProperties(GlobeDepth.prototype,{framebuffer:{get:function(){return this._globeColorFramebuffer}},primitiveFramebuffer:{get:function(){return this._primitiveColorFramebuffer}}}),GlobeDepth.prototype.executeDebugGlobeDepth=function(e,t,i){executeDebugGlobeDepth(this,e,t,i)},GlobeDepth.prototype.update=function(e,t,i,r,n){var a=i.width,i=i.height;updateFramebuffers$3(this,e,a,i,r,n),updateCopyCommands$1(this,e,a,i,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=n},GlobeDepth.prototype.executeCopyDepth=function(e,t){defined(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},GlobeDepth.prototype.executeUpdateDepth=function(e,t,i){var r,n=t.framebuffer.depthStencilTexture;i||n!==this._depthStencilTexture?defined(this._updateDepthCommand)&&(defined(this._updateDepthFramebuffer)&&this._updateDepthFramebuffer.depthStencilTexture===n&&this._updateDepthFramebuffer.getColorTexture(0)===this._globeDepthTexture||(r=this._globeDepthTexture.width,i=this._globeDepthTexture.height,destroyUpdateDepthResources(this),createUpdateDepthResources(this,e,r,i,t),updateCopyCommands$1(this,e,r,i,t)),this._tempCopyDepthTexture=n,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)):defined(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)},GlobeDepth.prototype.executeCopyColor=function(e,t){defined(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},GlobeDepth.prototype.executeMergeColor=function(e,t){defined(this._mergeColorCommand)&&this._mergeColorCommand.execute(e,t)},GlobeDepth.prototype.clear=function(e,t,i){var r=this._clearGlobeColorCommand;defined(r)&&(Color.clone(i,r.color),r.execute(e,t)),defined(r=this._clearPrimitiveColorCommand)&&defined(this._primitiveColorFramebuffer)&&r.execute(e,t)},GlobeDepth.prototype.isDestroyed=function(){return!1},GlobeDepth.prototype.destroy=function(){return destroyTextures$2(this),destroyFramebuffers$2(this),destroyPrimitiveFramebuffer(this),destroyUpdateDepthResources(this),defined(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),defined(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),defined(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),defined(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),defined(this._mergeColorCommand)&&(this._mergeColorCommand.shaderProgram=this._mergeColorCommand.shaderProgram.destroy()),defined(this._debugGlobeDepthViewportCommand)&&(this._debugGlobeDepthViewportCommand.shaderProgram=this._debugGlobeDepthViewportCommand.shaderProgram.destroy()),destroyObject(this)},Object.defineProperties(GlobeTranslucencyFramebuffer.prototype,{classificationTexture:{get:function(){return this._colorTexture}},classificationFramebuffer:{get:function(){return this._framebuffer}}}),GlobeTranslucencyFramebuffer.prototype.updateAndClear=function(e,t,i,r){var n=t.width,t=t.height;updateResources(this,i,n,t,e),updateCommands(this,i,n,t,r),this._useHdr=e},GlobeTranslucencyFramebuffer.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)},GlobeTranslucencyFramebuffer.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this._packedDepthTexture},GlobeTranslucencyFramebuffer.prototype.isDestroyed=function(){return!1},GlobeTranslucencyFramebuffer.prototype.destroy=function(){return destroyResources$3(this),destroyObject(this)};var DerivedCommandType={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},derivedCommandsMaximumLength=DerivedCommandType.DERIVED_COMMANDS_MAXIMUM_LENGTH,DerivedCommandNames=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function GlobeTranslucencyState(){this._frontFaceAlphaByDistance=new NearFarScalar(0,1,0,1),this._backFaceAlphaByDistance=new NearFarScalar(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=Rectangle.clone(Rectangle.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedBlendCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedPickCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedCommandTypesToUpdate=new Array(derivedCommandsMaximumLength),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}function updateAlphaByDistance(e,t,i,r){return e?defined(i)?(NearFarScalar.clone(i,r),r.nearValue*=t,r.farValue*=t):(r.nearValue=t,r.farValue=t):(r.nearValue=1,r.farValue=1),r}function isFaceTranslucent(e,t,i){return e&&(i.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function isSunVisibleThroughGlobe(e,t){var i=e._frontFaceTranslucent,e=e._backFaceTranslucent;return i&&(t.cameraUnderground||e)}function isEnvironmentVisible(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function useDepthPlane(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function requiresManualDepthTest(e,t,i){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!i.depthTestAgainstTerrain&&t.mode!==SceneMode$1.SCENE2D&&t.context.depthTexture}function getNumberOfTextureUniforms(e){var t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function gatherDerivedCommandRequirements(e,t){e._derivedCommandsLength=getDerivedCommandTypes(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=getDerivedCommandTypes(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=getDerivedCommandTypes(e,t,!1,!0,e._derivedPickCommandTypes);for(var i=0,r=0;r<e._derivedCommandsLength;++r)i|=1<<e._derivedCommandTypes[r];for(r=0;r<e._derivedBlendCommandsLength;++r)i|=1<<e._derivedBlendCommandTypes[r];for(r=0;r<e._derivedPickCommandsLength;++r)i|=1<<e._derivedPickCommandTypes[r];var n=0;for(r=0;r<derivedCommandsMaximumLength;++r)0<(i&1<<r)&&(e._derivedCommandTypesToUpdate[n++]=r);e._derivedCommandsToUpdateLength=n;t=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=t,!defined(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=createDerivedCommandPacks())}function getDerivedCommandTypes(e,t,i,r,n){var a=0,o=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!o)return a;var l=t.cameraUnderground,o=e._requiresManualDepthTest,e=r?DerivedCommandType.PICK_FRONT_FACE:o?DerivedCommandType.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:DerivedCommandType.TRANSLUCENT_FRONT_FACE,o=r?DerivedCommandType.PICK_BACK_FACE:o?DerivedCommandType.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:DerivedCommandType.TRANSLUCENT_BACK_FACE;return t.mode===SceneMode$1.SCENE2D?(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_FACE,n[a++]=e):s?(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(n[a++]=e,n[a++]=o):(n[a++]=o,n[a++]=e)):l?(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_BACK_FACE),n[a++]=DerivedCommandType.OPAQUE_FRONT_FACE,n[a++]=o):(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_FACE),n[a++]=DerivedCommandType.OPAQUE_BACK_FACE,n[a++]=e),a}function removeDefine(e,t){t=e.indexOf(t);-1<t&&e.splice(t,1)}function hasDefine(e,t){return-1<e.indexOf(t)}function getOpaqueFrontFaceShaderProgram(e,t){removeDefine(e.defines,"TRANSLUCENT"),removeDefine(t.defines,"TRANSLUCENT")}function getOpaqueBackFaceShaderProgram(e,t){removeDefine(e.defines,"GROUND_ATMOSPHERE"),removeDefine(t.defines,"GROUND_ATMOSPHERE"),removeDefine(e.defines,"FOG"),removeDefine(t.defines,"FOG"),removeDefine(e.defines,"TRANSLUCENT"),removeDefine(t.defines,"TRANSLUCENT")}function getDepthOnlyShaderProgram(e,t){hasDefine(t.defines,"TILE_LIMIT_RECTANGLE")||hasDefine(t.defines,"ENABLE_CLIPPING_PLANES")||(t.sources=["void main() \n{ \n gl_FragColor = vec4(1.0); \n} \n"])}function getTranslucentShaderProgram$1(e,t){for(var i=t.sources,r=i.length,n=0;n<r;++n)i[n]=ShaderSource.replaceMain(i[n],"czm_globe_translucency_main");i.push("\n\nuniform sampler2D u_classificationTexture; \nvoid main() \n{ \n vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n#ifdef MANUAL_DEPTH_TEST \n float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st)); \n if (logDepthOrDepth != 0.0) \n { \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); \n float depthEC = eyeCoordinate.z / eyeCoordinate.w; \n if (v_positionEC.z < depthEC) \n { \n discard; \n } \n } \n#endif \n czm_globe_translucency_main(); \n vec4 classificationColor = texture2D(u_classificationTexture, st); \n if (classificationColor.a > 0.0) \n { \n // Reverse premultiplication process to get the correct composited result of the classification primitives \n classificationColor.rgb /= classificationColor.a; \n } \n gl_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + gl_FragColor * (1.0 - classificationColor.a); \n} \n")}function getTranslucentBackFaceShaderProgram(e,t){getTranslucentShaderProgram$1(e,t),removeDefine(e.defines,"GROUND_ATMOSPHERE"),removeDefine(t.defines,"GROUND_ATMOSPHERE"),removeDefine(e.defines,"FOG"),removeDefine(t.defines,"FOG")}function getTranslucentFrontFaceManualDepthTestShaderProgram(e,t){getTranslucentShaderProgram$1(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function getTranslucentBackFaceManualDepthTestShaderProgram(e,t){getTranslucentBackFaceShaderProgram(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function getPickShaderProgram(e,t){t.sources=["uniform sampler2D u_classificationTexture; \nvoid main() \n{ \n vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n vec4 pickColor = texture2D(u_classificationTexture, st); \n if (pickColor == vec4(0.0)) \n { \n discard; \n } \n gl_FragColor = pickColor; \n} \n"]}function getDerivedShaderProgram(e,t,i,r,n,a){if(!defined(n))return t;if(!r&&defined(i))return i;var o,s=e.shaderCache.getDerivedShaderProgram(t,a);return defined(s)||(o=t._attributeLocations,r=t.vertexShaderSource.clone(),i=t.fragmentShaderSource.clone(),r.defines=defined(r.defines)?r.defines.slice(0):[],i.defines=defined(i.defines)?i.defines.slice(0):[],n(r,i),s=e.shaderCache.createDerivedShaderProgram(t,a,{vertexShaderSource:r,fragmentShaderSource:i,attributeLocations:o})),s}function getOpaqueFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0}function getOpaqueBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0}function getDepthOnlyFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getDepthOnlyBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getDepthOnlyFrontAndBackFaceRenderState(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getTranslucentFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND}function getTranslucentBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND}function getPickFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function getPickBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function getDerivedRenderState(e,t,i,r,n){if(!defined(r))return e;if(!i&&defined(t))return t;t=n[e.id];return defined(t)||(r(r=RenderState.getState(e)),t=RenderState.fromCache(r),n[e.id]=t),t}function getTranslucencyUniformMap(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function getDerivedUniformMap(e,t,i,r,n){return defined(n)?!r&&defined(i)?i:combine$2(t,n(e),!1):t}function DerivedCommandPack(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function createDerivedCommandPacks(){return[new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getOpaqueFrontFaceShaderProgram,getRenderStateFunction:getOpaqueFrontFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getOpaqueBackFaceShaderProgram,getRenderStateFunction:getOpaqueBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram,getRenderStateFunction:getDepthOnlyFrontFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram,getRenderStateFunction:getDepthOnlyBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram,getRenderStateFunction:getDepthOnlyFrontAndBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentShaderProgram$1,getRenderStateFunction:getTranslucentFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentBackFaceShaderProgram,getRenderStateFunction:getTranslucentBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentFrontFaceManualDepthTestShaderProgram,getRenderStateFunction:getTranslucentFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentBackFaceManualDepthTestShaderProgram,getRenderStateFunction:getTranslucentBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:getPickShaderProgram,getRenderStateFunction:getPickFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:getPickShaderProgram,getRenderStateFunction:getPickBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap})]}Object.defineProperties(GlobeTranslucencyState.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}}}),GlobeTranslucencyState.prototype.update=function(e){var t=e.globe;if(!defined(t)||!t.show)return this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,void(this._useDepthPlane=!1);this._frontFaceAlphaByDistance=updateAlphaByDistance(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=updateAlphaByDistance(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=isFaceTranslucent(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=isFaceTranslucent(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=requiresManualDepthTest(this,e,t),this._sunVisibleThroughGlobe=isSunVisibleThroughGlobe(this,e),this._environmentVisible=isEnvironmentVisible(this,e),this._useDepthPlane=useDepthPlane(this,e),this._numberOfTextureUniforms=getNumberOfTextureUniforms(this),this._rectangle=Rectangle.clone(t.translucency.rectangle,this._rectangle),gatherDerivedCommandRequirements(this,e)};var derivedCommandNames=new Array(derivedCommandsMaximumLength),derivedCommandPacks=new Array(derivedCommandsMaximumLength);function updateDerivedCommands$1(e,t,i,r,n,a,o){var s=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!defined(s)||l){t.dirty=!1,defined(s)||(s={},t.derivedCommands.globeTranslucency=s);var c=o.frameNumber,u=defaultValue(s.uniformMapDirtyFrame,0),d=defaultValue(s.shaderProgramDirtyFrame,0),h=defaultValue(s.renderStateDirtyFrame,0),p=s.uniformMap!==t.uniformMap,m=s.shaderProgramId!==t.shaderProgram.id,f=s.renderStateId!==t.renderState.id;p&&(s.uniformMapDirtyFrame=c),m&&(s.shaderProgramDirtyFrame=c),f&&(s.renderStateDirtyFrame=c),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(var g=0;g<i;++g){var _,y,C=a[g],v=r[g],S=n[g],T=defined(x=s[S])?(_=x.uniformMap,y=x.shaderProgram,x.renderState):y=_=void 0,x=DrawCommand.shallowClone(t,x),b=defaultValue((s[S]=x).derivedCommands.uniformMapDirtyFrame,0),E=defaultValue(x.derivedCommands.shaderProgramDirtyFrame,0),P=defaultValue(x.derivedCommands.renderStateDirtyFrame,0),b=p||b<u,E=m||E<d,P=f||P<h;b&&(x.derivedCommands.uniformMapDirtyFrame=c),E&&(x.derivedCommands.shaderProgramDirtyFrame=c),P&&(x.derivedCommands.renderStateDirtyFrame=c),x.derivedCommands.type=v,x.pass=C.pass,x.pickOnly=C.pickOnly,x.uniformMap=getDerivedUniformMap(e,t.uniformMap,_,b,C.getUniformMapFunction),x.shaderProgram=getDerivedShaderProgram(o.context,t.shaderProgram,y,E,C.getShaderProgramFunction,S),x.renderState=getDerivedRenderState(t.renderState,T,P,C.getRenderStateFunction,C.renderStateCache)}}}function executeCommandsMatchingType(e,t,i,r,n,a,o){for(var s=0;s<t;++s){var l=e[s],c=l.derivedCommands.type;(!defined(o)||-1<o.indexOf(c))&&i(l,r,n,a)}}function executeCommands$1(e,t,i,r,n,a){for(var o=0;o<t;++o)i(e[o],r,n,a)}GlobeTranslucencyState.prototype.updateDerivedCommands=function(e,t){var i=this._derivedCommandTypesToUpdate,r=this._derivedCommandsToUpdateLength;if(0!==r){for(var n=0;n<r;++n)derivedCommandPacks[n]=this._derivedCommandPacks[i[n]],derivedCommandNames[n]=DerivedCommandNames[i[n]];updateDerivedCommands$1(this,e,r,i,derivedCommandNames,derivedCommandPacks,t)}},GlobeTranslucencyState.prototype.pushDerivedCommands=function(e,t,i){var r=i.passes.pick;if(!r||!t){var n=this._derivedCommandTypes,a=this._derivedCommandsLength;if(r?(n=this._derivedPickCommandTypes,a=this._derivedPickCommandsLength):t&&(n=this._derivedBlendCommandTypes,a=this._derivedBlendCommandsLength),0!==a)for(var o=e.derivedCommands.globeTranslucency,s=0;s<a;++s){var l=DerivedCommandNames[n[s]];i.commandList.push(o[l])}else i.commandList.push(e)}};var opaqueTypes=[DerivedCommandType.OPAQUE_FRONT_FACE,DerivedCommandType.OPAQUE_BACK_FACE],depthOnlyTypes=[DerivedCommandType.DEPTH_ONLY_FRONT_FACE,DerivedCommandType.DEPTH_ONLY_BACK_FACE,DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE];function GoogleEarthEnterpriseDiscardPolicy(){this._image=new Image}function GoogleEarthEnterpriseImageryProvider(e){var t;e=defaultValue(e,defaultValue.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,t=defined(e.metadata)?e.metadata:new GoogleEarthEnterpriseMetadata(Resource.createIfNeeded(e.url)),this._metadata=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-CesiumMath.PI,-CesiumMath.PI,CesiumMath.PI,CesiumMath.PI),ellipsoid:e.ellipsoid});e=e.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,defined(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new GoogleEarthEnterpriseDiscardPolicy),this._errorEvent=new Event,this._ready=!1;var i,r=this;this._readyPromise=t.readyPromise.then(function(e){if(t.imageryPresent)return TileProviderError.handleSuccess(i),r._ready=e;e=new RuntimeError("The server "+t.url+" doesn't have imagery");return i=TileProviderError.handleError(i,r,r._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)}).otherwise(function(e){return i=TileProviderError.handleError(i,r,r._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)})}function buildImageResource$1(e,t,i,r,n,a){n=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(i,r,n),t=defined(t=t.imageryVersion)&&0<t?t:1;return e._metadata.resource.getDerivedResource({url:"flatfile?f1-0"+n+"-i."+t.toString(),request:a})}function getImageType(e){var 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";return e[1]==="PNG".charCodeAt(0)&&e[2]==="PNG".charCodeAt(1)&&e[3]==="PNG".charCodeAt(2)?"image/png":void 0}function decodeEarthImageryPacket(e){for(var t=protobuf.Reader.create(e),i=t.len,r={};t.pos<i;){var n=t.uint32();switch(n>>>3){case 1:r.imageType=t.uint32();break;case 2:r.imageData=t.bytes();break;case 3:r.alphaType=t.uint32();break;case 4:r.imageAlpha=t.bytes();break;case 5:var a=r.copyrightIds;if(defined(a)||(a=r.copyrightIds=[]),2==(7&n))for(var o=t.uint32()+t.pos;t.pos<o;)a.push(t.uint32());else a.push(t.uint32());break;default:t.skipType(7&n)}}e=r.imageType;if(defined(e))switch(e){case 0:r.imageType="image/jpeg";break;case 4:r.imageType="image/png";break;default:throw new RuntimeError("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}e=r.alphaType;return defined(e)&&0!==e&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete r.alphaType,delete r.imageAlpha),r}function GoogleEarthEnterpriseMapsProvider(a){a=defaultValue(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=1.9,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var e=a.url,t=defaultValue(a.path,"/default_map"),i=Resource.createIfNeeded(e).getDerivedResource({url:"/"===t[0]?t.substring(1):t});i.appendForwardSlash(),this._resource=i,this._url=e,this._path=t,this._tileDiscardPolicy=a.tileDiscardPolicy,this._channel=a.channel,this._requestType="ImageryMaps",this._credit=new Credit('<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="'+GoogleEarthEnterpriseMapsProvider.logoUrl+'" title="Google Imagery"/></a>'),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=a.maximumLevel,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var o,r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=this;function n(t){var i,e;try{i=JSON.parse(t)}catch(e){i=JSON.parse(t.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var r,n=0;n<i.layers.length;n++)if(i.layers[n].id===s._channel){e=i.layers[n];break}if(!defined(e))throw r="Could not find layer with channel (id) of "+s._channel+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);if(!defined(e.version))throw r="Could not find a version in channel (id) "+s._channel+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);if(s._version=e.version,defined(i.projection)&&"flat"===i.projection)s._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:a.ellipsoid});else{if(defined(i.projection)&&"mercator"!==i.projection)throw r="Unsupported projection "+i.projection+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);s._tilingScheme=new WebMercatorTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:a.ellipsoid})}s._ready=!0,s._readyPromise.resolve(!0),TileProviderError.handleSuccess(o)}function l(e){var t="An error occurred while accessing "+r.url+".";o=TileProviderError.handleError(o,s,s._errorEvent,t,void 0,void 0,void 0,c),s._readyPromise.reject(new RuntimeError(t))}function c(){when(r.fetchText(),n,l)}c()}GlobeTranslucencyState.prototype.executeGlobeCommands=function(e,t,i,r,n){var a=r.context,o=e.commands[Pass$1.GLOBE],e=e.indices[Pass$1.GLOBE];0!==e&&((this._globeTranslucencyFramebuffer=i).clearClassification(a,n),executeCommandsMatchingType(o,e,t,r,a,n,opaqueTypes))},GlobeTranslucencyState.prototype.executeGlobeClassificationCommands=function(e,t,i,r,n){var a,o=r.context,s=e.commands[Pass$1.GLOBE],l=e.indices[Pass$1.GLOBE],c=e.commands[Pass$1.TERRAIN_CLASSIFICATION],u=e.indices[Pass$1.TERRAIN_CLASSIFICATION];0!==l&&0!==u&&(a=this._frontFaceTranslucent,e=this._backFaceTranslucent,a&&e||executeCommands$1(c,u,t,r,o,n),(a||e)&&(this._globeTranslucencyFramebuffer=i,a=o.uniformState.globeDepthTexture,e=n.framebuffer,n.framebuffer=i.classificationFramebuffer,executeCommandsMatchingType(s,l,t,r,o,n,depthOnlyTypes),o.depthTexture&&(i=i.packDepth(o,n),o.uniformState.globeDepthTexture=i),executeCommands$1(c,u,t,r,o,n),o.uniformState.globeDepthTexture=a,n.framebuffer=e))},GoogleEarthEnterpriseDiscardPolicy.prototype.isReady=function(){return!0},GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage=function(e){return e===this._image},Object.defineProperties(GoogleEarthEnterpriseImageryProvider.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}}),GoogleEarthEnterpriseImageryProvider.prototype.getTileCredits=function(e,t,i){var r=this._metadata,i=r.getTileInformation(e,t,i);if(defined(i)){i=r.providers[i.imageryProvider];if(defined(i))return[i]}},GoogleEarthEnterpriseImageryProvider.prototype.requestImage=function(e,t,i,r){var n=this._tileDiscardPolicy._image,a=this._metadata,o=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),s=a.getTileInformation(e,t,i);if(!defined(s)){if(a.isValid(o)){o=new Request({throttle:r.throttle,throttleByServer:r.throttleByServer,type:r.type,priorityFunction:r.priorityFunction});return void a.populateSubtree(e,t,i,o)}return n}if(!s.hasImagery())return n;r=buildImageResource$1(this,s,e,t,i,r).fetchArrayBuffer();return defined(r)?r.then(function(e){decodeGoogleEarthEnterpriseData(a.key,e);var t,i=new Uint8Array(e),e=a.protoImagery;return defined(e)&&e||(t=getImageType(i)),defined(t)||defined(e)&&!e||(t=(e=decodeEarthImageryPacket(i)).imageType,i=e.imageData),defined(t)&&defined(i)?loadImageFromTypedArray({uint8Array:i,format:t,flipY:!0}):n}):void 0},GoogleEarthEnterpriseImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},Object.defineProperties(GoogleEarthEnterpriseMapsProvider.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),GoogleEarthEnterpriseMapsProvider.prototype.getTileCredits=function(e,t,i){},GoogleEarthEnterpriseMapsProvider.prototype.requestImage=function(e,t,i,r){i=this._resource.getDerivedResource({url:"query",request:r,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:i+1}});return ImageryProvider.loadImage(this,i)},GoogleEarthEnterpriseMapsProvider.prototype.pickFeatures=function(e,t,i,r,n){},GoogleEarthEnterpriseMapsProvider._logoUrl=void 0,Object.defineProperties(GoogleEarthEnterpriseMapsProvider,{logoUrl:{get:function(){return defined(GoogleEarthEnterpriseMapsProvider._logoUrl)||(GoogleEarthEnterpriseMapsProvider._logoUrl=buildModuleUrl("Assets/Images/google_earth_credit.png")),GoogleEarthEnterpriseMapsProvider._logoUrl},set:function(e){GoogleEarthEnterpriseMapsProvider._logoUrl=e}}});var defaultColor=new Color(1,1,1,.4),defaultGlowColor=new Color(0,1,0,.05),defaultBackgroundColor=new Color(0,.5,0,.2);function GridImageryProvider(e){e=defaultValue(e,defaultValue.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=defined(e.tilingScheme)?e.tilingScheme:new GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._cells=defaultValue(e.cells,8),this._color=defaultValue(e.color,defaultColor),this._glowColor=defaultValue(e.glowColor,defaultGlowColor),this._glowWidth=defaultValue(e.glowWidth,6),this._backgroundColor=defaultValue(e.backgroundColor,defaultBackgroundColor),this._errorEvent=new Event,this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._canvasSize=defaultValue(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=when.resolve(!0)}function InvertClassification(){this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._texture=void 0,this._classifiedTexture=void 0,this._depthStencilTexture=void 0,this._fbo=void 0,this._fboClassified=void 0,this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0});var e=this;this._uniformMap={colorTexture:function(){return e._texture},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._classifiedTexture}}}Object.defineProperties(GridImageryProvider.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}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),GridImageryProvider.prototype._drawGrid=function(e){for(var t=this._canvasSize,i=0;i<=this._cells;++i){var r=1+i/this._cells*(t-1);e.moveTo(r,0),e.lineTo(r,t),e.moveTo(0,r),e.lineTo(t,r)}e.stroke()},GridImageryProvider.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(0,0,t,t);r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i),i.lineWidth=.5*this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i);r=this._color.toCssColorString();return i.strokeStyle=r,i.lineWidth=2,i.strokeRect(0,0,t,t),i.lineWidth=1,this._drawGrid(i),e},GridImageryProvider.prototype.getTileCredits=function(e,t,i){},GridImageryProvider.prototype.requestImage=function(e,t,i,r){return this._canvas},GridImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},Object.defineProperties(InvertClassification.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),InvertClassification.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var rsUnclassified={depthMask:!1,stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},blending:BlendingState$1.ALPHA_BLEND},rsClassified={depthMask:!1,stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},blending:BlendingState$1.ALPHA_BLEND},rsDefault={depthMask:!0,depthTest:{enabled:!0},stencilTest:StencilConstants$1.setCesium3DTileBit(),stencilMask:StencilConstants$1.CESIUM_3D_TILE_MASK,blending:BlendingState$1.ALPHA_BLEND},translucentFS="#extension GL_EXT_frag_depth : enable\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform sampler2D classifiedTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n bool isClassified = all(equal(texture2D(classifiedTexture, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n vec4 highlightColor = czm_invertClassificationColor;\n if (isClassified)\n {\n discard;\n }\n#else\n vec4 highlightColor = vec4(1.0);\n if (!isClassified)\n {\n discard;\n }\n#endif\n gl_FragColor = color * highlightColor;\n gl_FragDepthEXT = texture2D(depthTexture, v_textureCoordinates).r;\n}\n",opaqueFS="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n#ifdef UNCLASSIFIED\n gl_FragColor = color * czm_invertClassificationColor;\n#else\n gl_FragColor = color;\n#endif\n}\n";InvertClassification.prototype.update=function(e){var t=this._texture,i=!defined(t)||this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;var r,n,a=e.drawingBufferWidth,o=e.drawingBufferHeight,t=!defined(t)||t.width!==a||t.height!==o;(t||i)&&(this._texture=this._texture&&this._texture.destroy(),this._classifiedTexture=this._classifiedTexture&&this._classifiedTexture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._texture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}),defined(this._previousFramebuffer)||(this._classifiedTexture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}),this._depthStencilTexture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}))),defined(this._fbo)&&!t&&!i||(this._fbo=this._fbo&&this._fbo.destroy(),this._fboClassified=this._fboClassified&&this._fboClassified.destroy(),defined(this._previousFramebuffer)?(n=this._previousFramebuffer.depthStencilTexture,r=this._previousFramebuffer.depthStencilRenderbuffer):n=this._depthStencilTexture,this._fbo=new Framebuffer({context:e,colorTextures:[this._texture],depthStencilTexture:n,depthStencilRenderbuffer:r,destroyAttachments:!1}),defined(this._previousFramebuffer)||(this._fboClassified=new Framebuffer({context:e,colorTextures:[this._classifiedTexture],depthStencilTexture:n,destroyAttachments:!1}))),defined(this._rsUnclassified)||(this._rsUnclassified=RenderState.fromCache(rsUnclassified),this._rsClassified=RenderState.fromCache(rsClassified),this._rsDefault=RenderState.fromCache(rsDefault)),defined(this._unclassifiedCommand)&&!i||(defined(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),i=new ShaderSource({defines:["UNCLASSIFIED"],sources:[n=defined(this._previousFramebuffer)?opaqueFS:translucentFS]}),n=new ShaderSource({sources:[n]}),this._unclassifiedCommand=e.createViewportQuadCommand(i,{renderState:defined(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(n,{renderState:defined(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),defined(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),defined(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(PassThrough,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this})))},InvertClassification.prototype.clear=function(e,t){var i=t.framebuffer;defined(this._previousFramebuffer)?(t.framebuffer=this._fbo,this._clearColorCommand.execute(e,t)):(t.framebuffer=this._fbo,this._clearCommand.execute(e,t),t.framebuffer=this._fboClassified,this._clearCommand.execute(e,t)),t.framebuffer=i},InvertClassification.prototype.executeClassified=function(e,t){var i;defined(this._previousFramebuffer)||(i=t.framebuffer,t.framebuffer=this._fboClassified,this._translucentCommand.execute(e,t),t.framebuffer=i),this._classifiedCommand.execute(e,t)},InvertClassification.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},InvertClassification.prototype.isDestroyed=function(){return!1},InvertClassification.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),defined(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),destroyObject(this)};var templateRegex=/{[^}]+}/g,tags={x:xTag,y:yTag,z:zTag,s:sTag,reverseX:reverseXTag,reverseY:reverseYTag,reverseZ:reverseZTag,westDegrees:westDegreesTag,southDegrees:southDegreesTag,eastDegrees:eastDegreesTag,northDegrees:northDegreesTag,westProjected:westProjectedTag,southProjected:southProjectedTag,eastProjected:eastProjectedTag,northProjected:northProjectedTag,width:widthTag,height:heightTag},pickFeaturesTags=combine$2(tags,{i:iTag,j:jTag,reverseI:reverseITag,reverseJ:reverseJTag,longitudeDegrees:longitudeDegreesTag,latitudeDegrees:latitudeDegreesTag,longitudeProjected:longitudeProjectedTag,latitudeProjected:latitudeProjectedTag,format:formatTag});function UrlTemplateImageryProvider(e){this._errorEvent=new Event,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._tags=void 0,this._pickFeaturesTags=void 0,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=!0,this.reinitialize(e)}Object.defineProperties(UrlTemplateImageryProvider.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}},ready:{get:function(){return defined(this._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),UrlTemplateImageryProvider.prototype.reinitialize=function(e){var a=this;a._readyPromise=when(e).then(function(e){var t=e.customTags,i=combine$2(tags,t),r=combine$2(pickFeaturesTags,t),n=Resource.createIfNeeded(e.url),t=Resource.createIfNeeded(e.pickFeaturesUrl);a.enablePickFeatures=defaultValue(e.enablePickFeatures,a.enablePickFeatures),a._urlSchemeZeroPadding=defaultValue(e.urlSchemeZeroPadding,a.urlSchemeZeroPadding),a._tileDiscardPolicy=e.tileDiscardPolicy,a._getFeatureInfoFormats=e.getFeatureInfoFormats,a._subdomains=e.subdomains,Array.isArray(a._subdomains)?a._subdomains=a._subdomains.slice():defined(a._subdomains)&&0<a._subdomains.length?a._subdomains=a._subdomains.split(""):a._subdomains=["a","b","c"],a._tileWidth=defaultValue(e.tileWidth,256),a._tileHeight=defaultValue(e.tileHeight,256),a._minimumLevel=defaultValue(e.minimumLevel,0),a._maximumLevel=e.maximumLevel,a._tilingScheme=defaultValue(e.tilingScheme,new WebMercatorTilingScheme({ellipsoid:e.ellipsoid})),a._rectangle=defaultValue(e.rectangle,a._tilingScheme.rectangle),a._rectangle=Rectangle.intersection(a._rectangle,a._tilingScheme.rectangle),a._hasAlphaChannel=defaultValue(e.hasAlphaChannel,!0);e=e.credit;return"string"==typeof e&&(e=new Credit(e)),a._credit=e,a._resource=n,a._tags=i,a._pickFeaturesResource=t,a._pickFeaturesTags=r,!0})},UrlTemplateImageryProvider.prototype.getTileCredits=function(e,t,i){},UrlTemplateImageryProvider.prototype.requestImage=function(e,t,i,r){return ImageryProvider.loadImage(this,buildImageResource(this,e,t,i,r))},UrlTemplateImageryProvider.prototype.pickFeatures=function(r,n,a,o,s){if(this.enablePickFeatures&&defined(this._pickFeaturesResource)&&0!==this._getFeatureInfoFormats.length){var l=0,c=this;return function e(){if(l>=c._getFeatureInfoFormats.length)return when([]);var t=c._getFeatureInfoFormats[l],i=buildPickFeaturesResource(c,r,n,a,o,s,t.format);return++l,("json"===t.type?i.fetchJson().then(t.callback):"xml"===t.type?i.fetchXML().then(t.callback):"text"===t.type||"html"===t.type?i.fetchText().then(t.callback):i.fetch({responseType:t.format}).then(function(e,t){return e.callback(t)}.bind(void 0,t))).otherwise(e)}()}};var degreesScratchComputed=!1,degreesScratch=new Rectangle,projectedScratchComputed=!1,projectedScratch=new Rectangle;function buildImageResource(t,i,r,n,e){projectedScratchComputed=degreesScratchComputed=!1;var a=t._resource,o=a.getUrlComponent(!0),s=t._tags,l={},o=o.match(templateRegex);return defined(o)&&o.forEach(function(e){e=e.substring(1,e.length-1);defined(s[e])&&(l[e]=s[e](t,i,r,n))}),a.getDerivedResource({request:e,templateValues:l})}var ijScratchComputed=!1,ijScratch=new Cartesian2,longitudeLatitudeProjectedScratchComputed=!1;function buildPickFeaturesResource(t,i,r,n,a,o,s){longitudeLatitudeProjectedScratchComputed=ijScratchComputed=projectedScratchComputed=degreesScratchComputed=!1;var e=t._pickFeaturesResource,l=e.getUrlComponent(!0),c=t._pickFeaturesTags,u={},l=l.match(templateRegex);return defined(l)&&l.forEach(function(e){e=e.substring(1,e.length-1);defined(c[e])&&(u[e]=c[e](t,i,r,n,a,o,s))}),e.getDerivedResource({templateValues:u})}function padWithZerosIfNecessary(e,t,i){return e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)&&("string"!=typeof(t=e.urlSchemeZeroPadding[t])||1<(t=t.length)&&(i=i.length>=t?i:new Array(t-i.toString().length+1).join("0")+i)),i}function xTag(e,t,i,r){return padWithZerosIfNecessary(e,"{x}",t)}function reverseXTag(e,t,i,r){t=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return padWithZerosIfNecessary(e,"{reverseX}",t)}function yTag(e,t,i,r){return padWithZerosIfNecessary(e,"{y}",i)}function reverseYTag(e,t,i,r){i=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return padWithZerosIfNecessary(e,"{reverseY}",i)}function reverseZTag(e,t,i,r){var n=e.maximumLevel;return padWithZerosIfNecessary(e,"{reverseZ}",defined(n)&&r<n?n-r-1:r)}function zTag(e,t,i,r){return padWithZerosIfNecessary(e,"{z}",r)}function sTag(e,t,i,r){r=(t+i+r)%e._subdomains.length;return e._subdomains[r]}function computeDegrees(e,t,i,r){degreesScratchComputed||(e.tilingScheme.tileXYToRectangle(t,i,r,degreesScratch),degreesScratch.west=CesiumMath.toDegrees(degreesScratch.west),degreesScratch.south=CesiumMath.toDegrees(degreesScratch.south),degreesScratch.east=CesiumMath.toDegrees(degreesScratch.east),degreesScratch.north=CesiumMath.toDegrees(degreesScratch.north),degreesScratchComputed=!0)}function westDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.west}function southDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.south}function eastDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.east}function northDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.north}function computeProjected(e,t,i,r){projectedScratchComputed||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,projectedScratch),projectedScratchComputed=!0)}function westProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.west}function southProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.south}function eastProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.east}function northProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.north}function widthTag(e,t,i,r){return e.tileWidth}function heightTag(e,t,i,r){return e.tileHeight}function iTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),ijScratch.x}function jTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),ijScratch.y}function reverseITag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),e.tileWidth-ijScratch.x-1}function reverseJTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),e.tileHeight-ijScratch.y-1}var rectangleScratch=new Rectangle,longitudeLatitudeProjectedScratch=new Cartesian3;function computeIJ(e,t,i,r,n,a,o){ijScratchComputed||(computeLongitudeLatitudeProjected(e,t,i,r,n,a),a=longitudeLatitudeProjectedScratch,r=e.tilingScheme.tileXYToNativeRectangle(t,i,r,rectangleScratch),ijScratch.x=e.tileWidth*(a.x-r.west)/r.width|0,ijScratch.y=e.tileHeight*(r.north-a.y)/r.height|0,ijScratchComputed=!0)}function longitudeDegreesTag(e,t,i,r,n,a,o){return CesiumMath.toDegrees(n)}function latitudeDegreesTag(e,t,i,r,n,a,o){return CesiumMath.toDegrees(a)}function longitudeProjectedTag(e,t,i,r,n,a,o){return computeLongitudeLatitudeProjected(e,t,i,r,n,a),longitudeLatitudeProjectedScratch.x}function latitudeProjectedTag(e,t,i,r,n,a,o){return computeLongitudeLatitudeProjected(e,t,i,r,n,a),longitudeLatitudeProjectedScratch.y}var cartographicScratch=new Cartographic;function computeLongitudeLatitudeProjected(e,t,i,r,n,a,o){var s;longitudeLatitudeProjectedScratchComputed||(e.tilingScheme.projection instanceof GeographicProjection?(longitudeLatitudeProjectedScratch.x=CesiumMath.toDegrees(n),longitudeLatitudeProjectedScratch.y=CesiumMath.toDegrees(a)):((s=cartographicScratch).longitude=n,s.latitude=a,e.tilingScheme.projection.project(s,longitudeLatitudeProjectedScratch)),longitudeLatitudeProjectedScratchComputed=!0)}function formatTag(e,t,i,r,n,a,o){return o}function TileMapServiceImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t,i=when.defer();UrlTemplateImageryProvider.call(this,i.promise),this._tmsResource=void 0,this._xmlResource=void 0,this._options=e,this._deferred=i,this._metadataError=void 0,this._metadataSuccess=this._metadataSuccess.bind(this),this._metadataFailure=this._metadataFailure.bind(this),this._requestMetadata=this._requestMetadata.bind(this);var r=this;when(e.url).then(function(e){(t=Resource.createIfNeeded(e)).appendForwardSlash(),r._tmsResource=t,r._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),r._requestMetadata()}).otherwise(function(e){i.reject(e)})}function confineRectangleToTilingScheme(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 calculateSafeMinimumDetailLevel(e,t,i){var r=e.positionToTileXY(Rectangle.southwest(t),i),t=e.positionToTileXY(Rectangle.northeast(t),i);return 4<(Math.abs(t.x-r.x)+1)*(Math.abs(t.y-r.y)+1)?0:i}defined(Object.create)&&(TileMapServiceImageryProvider.prototype=Object.create(UrlTemplateImageryProvider.prototype),TileMapServiceImageryProvider.prototype.constructor=TileMapServiceImageryProvider),TileMapServiceImageryProvider.prototype._requestMetadata=function(){this._xmlResource.fetchXML().then(this._metadataSuccess).otherwise(this._metadataFailure)},TileMapServiceImageryProvider.prototype._metadataSuccess=function(e){for(var t,i,r=/tileformat/i,n=/tileset/i,a=/tilesets/i,o=/boundingbox/i,s=[],l=this._xmlResource,c=this._metadataError,u=this._deferred,d=this._requestMetadata,h=e.childNodes[0].childNodes,p=0;p<h.length;p++)if(r.test(h.item(p).nodeName))t=h.item(p);else if(a.test(h.item(p).nodeName))for(var m=h.item(p),f=h.item(p).childNodes,g=0;g<f.length;g++)n.test(f.item(g).nodeName)&&s.push(f.item(g));else o.test(h.item(p).nodeName)&&(i=h.item(p));if(!defined(m)||!defined(i))return P="Unable to find expected tilesets or bbox attributes in "+l.url+".",(c=TileProviderError.handleError(c,this,this.errorEvent,P,void 0,void 0,void 0,d)).retry||u.reject(new RuntimeError(P)),void(this._metadataError=c);var _=this._options,y=defaultValue(_.fileExtension,t.getAttribute("extension")),C=defaultValue(_.tileWidth,parseInt(t.getAttribute("width"),10)),v=defaultValue(_.tileHeight,parseInt(t.getAttribute("height"),10)),S=defaultValue(_.minimumLevel,parseInt(s[0].getAttribute("order"),10)),T=defaultValue(_.maximumLevel,parseInt(s[s.length-1].getAttribute("order"),10)),x=m.getAttribute("profile"),e=_.tilingScheme;if(!defined(e))if("geodetic"===x||"global-geodetic"===x)e=new GeographicTilingScheme({ellipsoid:_.ellipsoid});else{if("mercator"!==x&&"global-mercator"!==x)return P=l.url+"specifies an unsupported profile attribute, "+x+".",(c=TileProviderError.handleError(c,this,this.errorEvent,P,void 0,void 0,void 0,d)).retry||u.reject(new RuntimeError(P)),void(this._metadataError=c);e=new WebMercatorTilingScheme({ellipsoid:_.ellipsoid})}var b,E,P=Rectangle.clone(_.rectangle);defined(P)||(c=defaultValue(_.flipXY,!1)?(b=new Cartesian2(parseFloat(i.getAttribute("miny")),parseFloat(i.getAttribute("minx"))),new Cartesian2(parseFloat(i.getAttribute("maxy")),parseFloat(i.getAttribute("maxx")))):(b=new Cartesian2(parseFloat(i.getAttribute("minx")),parseFloat(i.getAttribute("miny"))),new Cartesian2(parseFloat(i.getAttribute("maxx")),parseFloat(i.getAttribute("maxy")))),x="geodetic"===x||"mercator"===x,c=e.projection instanceof GeographicProjection||x?(E=Cartographic.fromDegrees(b.x,b.y),Cartographic.fromDegrees(c.x,c.y)):(E=(x=e.projection).unproject(b),x.unproject(c)),P=new Rectangle(E.longitude,E.latitude,c.longitude,c.latitude));S=calculateSafeMinimumDetailLevel(e,P=confineRectangleToTilingScheme(P,e),S),y=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+y});u.resolve({url:y,tilingScheme:e,rectangle:P,tileWidth:C,tileHeight:v,minimumLevel:S,maximumLevel:T,tileDiscardPolicy:_.tileDiscardPolicy,credit:_.credit})},TileMapServiceImageryProvider.prototype._metadataFailure=function(e){var t=this._options,i=defaultValue(t.fileExtension,"png"),r=defaultValue(t.tileWidth,256),n=defaultValue(t.tileHeight,256),a=t.maximumLevel,o=defined(t.tilingScheme)?t.tilingScheme:new WebMercatorTilingScheme({ellipsoid:t.ellipsoid}),s=defaultValue(t.rectangle,o.rectangle),l=calculateSafeMinimumDetailLevel(o,s=confineRectangleToTilingScheme(s,o),t.maximumLevel),i=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+i});this._deferred.resolve({url:i,tilingScheme:o,rectangle:s,tileWidth:r,tileHeight:n,minimumLevel:l,maximumLevel:a,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit})};var trailingSlashRegex$1=/\/$/,defaultCredit$2=new Credit('© <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 MapboxImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).mapId,i=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;var r=Resource.createIfNeeded(defaultValue(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=i;var n=defaultValue(e.format,"png");/\./.test(n)||(n="."+n),this._format=n;var a,n=r.getUrlComponent();trailingSlashRegex$1.test(n)||(n+="/"),n+=t+"/{z}/{x}/{y}"+this._format,r.url=n,r.setQueryParameters({access_token:i}),defined(e.credit)?"string"==typeof(a=e.credit)&&(a=new Credit(a)):a=defaultCredit$2,this._resource=r,this._imageryProvider=new UrlTemplateImageryProvider({url:r,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function SingleTileImageryProvider(e){e=defaultValue(e,defaultValue.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;var i=Resource.createIfNeeded(e.url),t=new GeographicTilingScheme({rectangle:defaultValue(e.rectangle,Rectangle.MAX_VALUE),numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=t,this._resource=i,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();e=e.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e;var r,n=this;function a(e){n._image=e,n._tileWidth=e.width,n._tileHeight=e.height,n._ready=!0,n._readyPromise.resolve(!0),TileProviderError.handleSuccess(n._errorEvent)}function o(e){var t="Failed to load image "+i.url+".";r=TileProviderError.handleError(r,n,n._errorEvent,t,0,0,0,s,e),n._readyPromise.reject(new RuntimeError(t))}function s(){ImageryProvider.loadImage(null,i).then(a).otherwise(o)}s()}function TimeDynamicImagery(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];var 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)}function getKey(e,t,i){return e+"-"+t+"-"+i}function getKeyElements(e){e=e.split("-");if(3===e.length)return{x:Number(e[0]),y:Number(e[1]),level:Number(e[2])}}function getApproachingInterval(e){var t=e._times;if(defined(t)){var i=e._clock,r=i.currentTime,n=i.canAnimate&&i.shouldAnimate,e=i.multiplier;if(n||0===e){var a,i=t.indexOf(r);if(!(i<0)){n=t.get(i);return 0<e?(a=JulianDate.secondsDifference(n.stop,r),++i):(a=JulianDate.secondsDifference(n.start,r),--i),a/=e,0<=i&&a<=5?t.get(i):void 0}}}}function addToCache(e,t,i){var r=e._times.indexOf(i.start),n=e._tileCache,a=n[r];defined(a)||(a=n[r]={});n=t.key;if(defined(a[n]))return!0;r=getKeyElements(n),t=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.IMAGERY,priorityFunction:t.priorityFunction}),i=e._requestImageFunction(r.x,r.y,r.level,t,i);return!!defined(i)&&(a[n]={promise:i,request:t},!0)}function WebMapServiceImageryProvider(e){if(defined((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times)&&!defined(e.clock))throw new DeveloperError("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;var t=Resource.createIfNeeded(e.url),i=t.clone();t.setQueryParameters(WebMapServiceImageryProvider.DefaultParameters,!0),i.setQueryParameters(WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters,!0),defined(e.parameters)&&t.setQueryParameters(objectToLowercase(e.parameters)),defined(e.getFeatureInfoParameters)&&i.setQueryParameters(objectToLowercase(e.getFeatureInfoParameters));var a=this;this._reload=void 0,defined(e.times)&&(this._timeDynamicImagery=new TimeDynamicImagery({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return requestImage$1(a,e,t,i,r,n)},reloadFunction:function(){defined(a._reload)&&a._reload()}}));var r={};r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",1.3<=parseFloat(t.queryParameters.version)?r.crs=defaultValue(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof WebMercatorProjection?"EPSG:3857":"CRS:84"):r.srs=defaultValue(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof WebMercatorProjection?"EPSG:3857":"EPSG:4326"),t.setQueryParameters(r,!0),i.setQueryParameters(r,!0);r={query_layers:e.layers,info_format:"{format}"};1.3<=parseFloat(i.queryParameters.version)?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),i.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=i,this._layers=e.layers,this._tileProvider=new UrlTemplateImageryProvider({url:t,pickFeaturesUrl:i,tilingScheme:defaultValue(e.tilingScheme,new GeographicTilingScheme({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:defaultValue(e.getFeatureInfoFormats,WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function requestImage$1(e,t,i,r,n,a){a=defined(a)?a.data:void 0,e=e._tileProvider;return defined(a)&&e._resource.setQueryParameters(a),e.requestImage(t,i,r,n)}function pickFeatures(e,t,i,r,n,a,o){o=defined(o)?o.data:void 0,e=e._tileProvider;return defined(o)&&e._pickFeaturesResource.setQueryParameters(o),e.pickFeatures(t,i,r,n,a)}function objectToLowercase(e){var t,i={};for(t in e)e.hasOwnProperty(t)&&(i[t.toLowerCase()]=e[t]);return i}Object.defineProperties(MapboxImageryProvider.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},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}}}),MapboxImageryProvider.prototype.getTileCredits=function(e,t,i){},MapboxImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},MapboxImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},MapboxImageryProvider._defaultCredit=defaultCredit$2,Object.defineProperties(SingleTileImageryProvider.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),SingleTileImageryProvider.prototype.getTileCredits=function(e,t,i){},SingleTileImageryProvider.prototype.requestImage=function(e,t,i,r){return this._image},SingleTileImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},Object.defineProperties(TimeDynamicImagery.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)}}}),TimeDynamicImagery.prototype.getFromCache=function(e,t,i,r){var n,a,t=getKey(e,t,i),i=this._tileCache[this._currentIntervalIndex];return defined(i)&&defined(i[t])&&(a=(n=i[t]).promise.otherwise(function(e){throw r.state=n.request.state,e}),delete i[t]),a},TimeDynamicImagery.prototype.checkApproachingInterval=function(e,t,i,r){e=getKey(e,t,i),t=this._tilesRequestedForInterval,i=getApproachingInterval(this),r={key:e,priorityFunction:r.priorityFunction};defined(i)&&addToCache(this,r,i)||t.push(r),512<=t.length&&t.splice(0,256)},TimeDynamicImagery.prototype._clockOnTick=function(e){var t=e.currentTime,e=this._times.indexOf(t),t=this._currentIntervalIndex;if(e!==t){var i,r=this._tileCache[t];for(i in r)r.hasOwnProperty(i)&&r[i].request.cancel();return delete this._tileCache[t],this._tilesRequestedForInterval=[],this._currentIntervalIndex=e,void this._reloadFunction()}var n=getApproachingInterval(this);if(defined(n))for(var a=this._tilesRequestedForInterval,o=!0;o&&0!==a.length;){var s=a.pop();(o=addToCache(this,s,n))||a.push(s)}},Object.defineProperties(WebMapServiceImageryProvider.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}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},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}}}),WebMapServiceImageryProvider.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},WebMapServiceImageryProvider.prototype.requestImage=function(e,t,i,r){var n,a,o=this._timeDynamicImagery;return defined(o)&&(a=o.currentInterval,n=o.getFromCache(e,t,i,r)),defined(n)||(n=requestImage$1(this,e,t,i,r,a)),defined(n)&&defined(o)&&o.checkApproachingInterval(e,t,i,r),n},WebMapServiceImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){var a=this._timeDynamicImagery;return pickFeatures(this,e,t,i,r,n,defined(a)?a.currentInterval:void 0)},WebMapServiceImageryProvider.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new GetFeatureInfoFormat("json","application/json")),Object.freeze(new GetFeatureInfoFormat("xml","text/xml")),Object.freeze(new GetFeatureInfoFormat("text","text/html"))]);var defaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function WebMapTileServiceImageryProvider(e){e=defaultValue(e,defaultValue.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;var t,i=Resource.createIfNeeded(e.url),r=e.style,n=e.tileMatrixSetID;0<=i.url.indexOf("{")?(t={style:r,Style:r,TileMatrixSet:n},i.setTemplateValues(t),this._useKvp=!1):(i.setQueryParameters(defaultParameters),this._useKvp=!0),this._resource=i,this._layer=e.layer,this._style=r,this._tileMatrixSetID=n,this._tileMatrixLabels=e.tileMatrixLabels,this._format=defaultValue(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._minimumLevel=defaultValue(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=defaultValue(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;var a=this;this._reload=void 0,defined(e.times)&&(this._timeDynamicImagery=new TimeDynamicImagery({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return requestImage(a,e,t,i,r,n)},reloadFunction:function(){defined(a._reload)&&a._reload()}})),this._readyPromise=when.resolve(!0);r=this._tilingScheme.positionToTileXY(Rectangle.southwest(this._rectangle),this._minimumLevel),n=this._tilingScheme.positionToTileXY(Rectangle.northeast(this._rectangle),this._minimumLevel);Math.abs(n.x-r.x),Math.abs(n.y-r.y),this._errorEvent=new Event;r=e.credit;this._credit="string"==typeof r?new Credit(r):r,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():defined(this._subdomains)&&0<this._subdomains.length?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function requestImage(e,t,i,r,n,a){var o,s=e._tileMatrixLabels,l=defined(s)?s[r]:r.toString(),c=e._subdomains,s=e._dimensions,a=defined(a)?a.data:void 0;return e._useKvp?((o={}).tilematrix=l,o.layer=e._layer,o.style=e._style,o.tilerow=i,o.tilecol=t,o.tilematrixset=e._tileMatrixSetID,o.format=e._format,defined(s)&&(o=combine$2(o,s)),defined(a)&&(o=combine$2(o,a)),o=e._resource.getDerivedResource({queryParameters:o,request:n})):(c={TileMatrix:l,TileRow:i.toString(),TileCol:t.toString(),s:c[(t+i+r)%c.length]},(o=e._resource.getDerivedResource({request:n})).setTemplateValues(c),defined(s)&&o.setTemplateValues(s),defined(a)&&o.setTemplateValues(a)),ImageryProvider.loadImage(e,o)}function createFactory(t){return function(e){return new t(e)}}Object.defineProperties(WebMapTileServiceImageryProvider.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}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},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,defined(this._reload)&&this._reload())}}}),WebMapTileServiceImageryProvider.prototype.getTileCredits=function(e,t,i){},WebMapTileServiceImageryProvider.prototype.requestImage=function(e,t,i,r){var n,a,o=this._timeDynamicImagery;return defined(o)&&(a=o.currentInterval,n=o.getFromCache(e,t,i,r)),defined(n)||(n=requestImage(this,e,t,i,r,a)),defined(n)&&defined(o)&&o.checkApproachingInterval(e,t,i,r),n},WebMapTileServiceImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){};var ImageryProviderMapping={ARCGIS_MAPSERVER:createFactory(ArcGisMapServerImageryProvider),BING:createFactory(BingMapsImageryProvider),GOOGLE_EARTH:createFactory(GoogleEarthEnterpriseMapsProvider),MAPBOX:createFactory(MapboxImageryProvider),SINGLE_TILE:createFactory(SingleTileImageryProvider),TMS:createFactory(TileMapServiceImageryProvider),URL_TEMPLATE:createFactory(UrlTemplateImageryProvider),WMS:createFactory(WebMapServiceImageryProvider),WMTS:createFactory(WebMapTileServiceImageryProvider)};function IonImageryProvider(e){var r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).assetId;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._ready=!1,this._tileCredits=void 0,this._errorEvent=new Event;var n=this,a=IonResource._createEndpointResource(r,e),t=e.assetId.toString()+e.accessToken+e.server,e=IonImageryProvider._endpointCache[t];defined(e)||(e=a.fetchJson(),IonImageryProvider._endpointCache[t]=e),this._readyPromise=e.then(function(e){if("IMAGERY"!==e.type)return when.reject(new RuntimeError("Cesium ion asset "+r+" is not an imagery asset."));var t=e.externalType;if(defined(t)){var i=ImageryProviderMapping[t];if(!defined(i))return when.reject(new RuntimeError("Unrecognized Cesium ion imagery type: "+t));i=i(e.options)}else i=new TileMapServiceImageryProvider({url:new IonResource(e,a)});return n._tileCredits=IonResource.getCreditsFromEndpoint(e,a),i.errorEvent.addEventListener(function(e){(e.provider=n)._errorEvent.raiseEvent(e)}),(n._imageryProvider=i).readyPromise.then(function(){return n._ready=!0})})}Object.defineProperties(IonImageryProvider.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},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(){}}}}),IonImageryProvider.prototype.getTileCredits=function(e,t,i){i=this._imageryProvider.getTileCredits(e,t,i);return defined(i)?this._tileCredits.concat(i):this._tileCredits},IonImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},IonImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},IonImageryProvider._endpointCache={};var IonWorldImageryStyle={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},IonWorldImageryStyle$1=Object.freeze(IonWorldImageryStyle);function JobTypeBudget(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function JobScheduler(e){var t=new Array(JobType$1.NUMBER_OF_JOB_TYPES);t[JobType$1.TEXTURE]=new JobTypeBudget(defined(e)?e[JobType$1.TEXTURE]:10),t[JobType$1.PROGRAM]=new JobTypeBudget(defined(e)?e[JobType$1.PROGRAM]:10),t[JobType$1.BUFFER]=new JobTypeBudget(defined(e)?e[JobType$1.BUFFER]:30);for(var i=t.length,r=0,n=0;n<i;++n)r+=t[n].total;var a=new Array(i);for(n=0;n<i;++n)a[n]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=a}function Light(){}Object.defineProperties(JobTypeBudget.prototype,{total:{get:function(){return this._total}}}),JobScheduler.getTimestamp=getTimestamp$1,Object.defineProperties(JobScheduler.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),JobScheduler.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},JobScheduler.prototype.resetBudgets=function(){for(var e=this._budgets,t=e.length,i=0;i<t;++i){var r=e[i];r.starvedLastFrame=r.starvedThisFrame,r.starvedThisFrame=!1,r.usedThisFrame=0,r.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},JobScheduler.prototype.execute=function(e,t){var i,r=this._budgets,n=r[t],a=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&a)return!(n.starvedThisFrame=!0);if(n.usedThisFrame+n.stolenFromMeThisFrame>=n.total){for(var o=r.length,s=0;s<o&&(!((i=r[s]).usedThisFrame+i.stolenFromMeThisFrame<i.total)||i.starvedLastFrame);++s);if(s===o&&a)return!1;a&&(n.starvedThisFrame=!0)}a=JobScheduler.getTimestamp();e.execute();a=JobScheduler.getTimestamp()-a;return this._totalUsedThisFrame+=a,i?i.stolenFromMeThisFrame+=a:n.usedThisFrame+=a,this._executedThisFrame[t]=!0},Object.defineProperties(Light.prototype,{color:{get:DeveloperError.throwInstantiationError},intensity:{get:DeveloperError.throwInstantiationError}});var trailingSlashRegex=/\/$/,defaultCredit$1=new Credit('© <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 MapboxStyleImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).styleId,i=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;var r=Resource.createIfNeeded(defaultValue(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=i;var n=defaultValue(e.tilesize,512);this._tilesize=n;var a=defaultValue(e.username,"mapbox");this._username=a;var o,n=defined(e.scaleFactor)?"@2x":"",a=r.getUrlComponent();trailingSlashRegex.test(a)||(a+="/"),a+=this._username+"/"+t+"/tiles/"+this._tilesize+"/{z}/{x}/{y}"+n,r.url=a,r.setQueryParameters({access_token:i}),defined(e.credit)?"string"==typeof(o=e.credit)&&(o=new Credit(o)):o=defaultCredit$1,this._resource=r,this._imageryProvider=new UrlTemplateImageryProvider({url:r,credit:o,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function Moon(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).textureUrl;defined(t)||(t=buildModuleUrl("Assets/Textures/moonSmall.jpg")),this.show=defaultValue(e.show,!0),this.textureUrl=t,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.MOON),this.onlySunLighting=defaultValue(e.onlySunLighting,!0),this._ellipsoidPrimitive=new EllipsoidPrimitive({radii:this.ellipsoid.radii,material:Material.fromType(Material.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new IauOrientationAxes}Object.defineProperties(MapboxStyleImageryProvider.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},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}}}),MapboxStyleImageryProvider.prototype.getTileCredits=function(e,t,i){},MapboxStyleImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},MapboxStyleImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},MapboxStyleImageryProvider._defaultCredit=defaultCredit$1,Object.defineProperties(Moon.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var icrfToFixed=new Matrix3,rotationScratch=new Matrix3,translationScratch=new Cartesian3,scratchCommandList=[];function NeverTileDiscardPolicy(e){}Moon.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;defined(Transforms.computeIcrfToFixedMatrix(i,icrfToFixed))||Transforms.computeTemeToPseudoFixedMatrix(i,icrfToFixed);var r=this._axes.evaluate(i,rotationScratch);Matrix3.transpose(r,r),Matrix3.multiply(icrfToFixed,r,r);i=Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(i,translationScratch);Matrix3.multiplyByVector(icrfToFixed,i,i),Matrix4.fromRotationTranslation(r,i,t.modelMatrix);i=e.commandList;return(e.commandList=scratchCommandList).length=0,t.update(e),e.commandList=i,1===scratchCommandList.length?scratchCommandList[0]:void 0}},Moon.prototype.isDestroyed=function(){return!1},Moon.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),destroyObject(this)},NeverTileDiscardPolicy.prototype.isReady=function(){return!0},NeverTileDiscardPolicy.prototype.shouldDiscardImage=function(e){return!1};var AdjustTranslucentFS="#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n",CompositeOITFS="uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\nif (opaque != czm_backgroundColor)\n{\ngl_FragColor.a = 1.0;\n}\n}\n";function OIT(e){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var t=e.colorBufferFloat&&e.depthTexture;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=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ClearCommand({color:new Color(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._alphaClearCommand=new ClearCommand({color:new Color(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 BoundingRectangle,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function destroyTextures$1(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function destroyFramebuffers$1(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function destroyResources$2(e){destroyTextures$1(e),destroyFramebuffers$1(e)}function updateTextures(e,t,i,r){destroyTextures$1(e),e._accumulationTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT});var n=new Float32Array(i*r*4);e._revealageTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT,source:{arrayBufferView:n,width:i,height:r},flipY:!1})}function updateFramebuffers$2(e,t){destroyFramebuffers$1(e);var i,r,n=WebGLConstants$1.FRAMEBUFFER_COMPLETE,a=!0;return e._translucentMRTSupport&&(e._translucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===n&&e._adjustTranslucentFBO.status===n||(destroyFramebuffers$1(e),e._translucentMRTSupport=!1)),e._translucentMRTSupport||(e._translucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new Framebuffer({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new Framebuffer({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1}),i=e._translucentFBO.status===n,r=e._alphaFBO.status===n,t=e._adjustTranslucentFBO.status===n,n=e._adjustAlphaFBO.status===n,i&&r&&t&&n||(destroyResources$2(e),a=e._translucentMultipassSupport=!1)),a}OIT.prototype.update=function(e,t,i,r){var n,a,o,s,l;this.isSupported()&&(this._opaqueFBO=i,this._opaqueTexture=i.getColorTexture(0),this._depthStencilTexture=i.depthStencilTexture,s=this._opaqueTexture.width,l=this._opaqueTexture.height,(i=!defined(i=this._accumulationTexture)||i.width!==s||i.height!==l||r!==this._useHDR)&&updateTextures(this,e,s,l),(defined(this._translucentFBO)&&!i||updateFramebuffers$2(this,e))&&(this._useHDR=r,defined((n=this)._compositeCommand)||(a=new ShaderSource({sources:[CompositeOITFS]}),this._translucentMRTSupport&&a.defines.push("MRT"),o={u_opaque:function(){return n._opaqueTexture},u_accumulation:function(){return n._accumulationTexture},u_revealage:function(){return n._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(a,{uniformMap:o,owner:this})),defined(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(a=new ShaderSource({defines:["MRT"],sources:[AdjustTranslucentFS]}),o={u_bgColor:function(){return n._translucentMRTClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(a,{uniformMap:o,owner:this})):this._translucentMultipassSupport&&(a=new ShaderSource({sources:[AdjustTranslucentFS]}),o={u_bgColor:function(){return n._translucentMultipassClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(a,{uniformMap:o,owner:this}),o={u_bgColor:function(){return n._alphaClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(a,{uniformMap:o,owner:this}))),this._viewport.width=s,this._viewport.height=l,l=(s=!BoundingRectangle.equals(this._viewport,t.viewport))!==this._useScissorTest,this._useScissorTest=s,BoundingRectangle.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=BoundingRectangle.clone(t.viewport,this._scissorRectangle),l=!0),defined(this._rs)&&BoundingRectangle.equals(this._viewport,this._rs.viewport)&&!l||(this._rs=RenderState.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),defined(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),defined(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)))};var translucentMRTBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ZERO,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA},translucentColorBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ONE,functionDestinationAlpha:BlendFunction$1.ONE},translucentAlphaBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ZERO,functionDestinationRgb:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:BlendFunction$1.ZERO,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA};function getTranslucentRenderState(e,t,i,r){var n,a=i[r.id];return defined(a)||((n=RenderState.getState(r)).depthMask=!1,n.blending=t,a=RenderState.fromCache(n),i[r.id]=a),a}function getTranslucentMRTRenderState(e,t,i){return getTranslucentRenderState(t,translucentMRTBlend,e._translucentRenderStateCache,i)}function getTranslucentColorRenderState(e,t,i){return getTranslucentRenderState(t,translucentColorBlend,e._translucentRenderStateCache,i)}function getTranslucentAlphaRenderState(e,t,i){return getTranslucentRenderState(t,translucentAlphaBlend,e._alphaRenderStateCache,i)}var mrtShaderSource=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",colorShaderSource=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",alphaShaderSource=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";function getTranslucentShaderProgram(e,t,i,r){var n,a,o=e.shaderCache.getDerivedShaderProgram(t,i);return defined(o)||(n=t._attributeLocations,(a=t.fragmentShaderSource.clone()).sources=a.sources.map(function(e){return e=(e=(e=(e=ShaderSource.replaceMain(e,"czm_translucent_main")).replace(/gl_FragColor/g,"czm_gl_FragColor")).replace(/\bdiscard\b/g,"czm_discard = true")).replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,(-1!==r.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),a.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+r+"}\n"),o=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:n})),o}function getTranslucentMRTShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"translucentMRT",mrtShaderSource)}function getTranslucentColorShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"translucentMultipass",colorShaderSource)}function getTranslucentAlphaShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"alphaMultipass",alphaShaderSource)}function executeTranslucentCommandsSortedMultipass(e,t,i,r,n,a){var o,s,l=t.context,c=t.frameState.useLogDepth,u=t._hdr,d=r.framebuffer,h=n.length,p=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var m=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<h;++s)o=n[s],o=c?o.derivedCommands.logDepth.command:o,o=u?o.derivedCommands.hdr.command:o,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).translucentCommand,t,l,r,m);for(defined(a)&&(o=a.unclassifiedCommand,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).translucentCommand,t,l,r,m)),r.framebuffer=e._alphaFBO,s=0;s<h;++s)o=n[s],o=c?o.derivedCommands.logDepth.command:o,o=u?o.derivedCommands.hdr.command:o,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).alphaCommand,t,l,r,m);defined(a)&&(o=a.unclassifiedCommand,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).alphaCommand,t,l,r,m)),r.framebuffer=d}function executeTranslucentCommandsSortedMRT(e,t,i,r,n,a){var o=t.context,s=t.frameState.useLogDepth,l=t._hdr,c=r.framebuffer,u=n.length,d=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var h,p=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var m=0;m<u;++m)h=n[m],h=s?h.derivedCommands.logDepth.command:h,h=l?h.derivedCommands.hdr.command:h,i((d&&h.receiveShadows?h.derivedCommands.oit.shadows:h.derivedCommands.oit).translucentCommand,t,o,r,p);defined(a)&&(h=a.unclassifiedCommand,i((d&&h.receiveShadows?h.derivedCommands.oit.shadows:h.derivedCommands.oit).translucentCommand,t,o,r,p)),r.framebuffer=c}OIT.prototype.createDerivedCommands=function(e,t,i){var r,n,a,o,s,l;return defined(i)||(i={}),this._translucentMRTSupport?(defined(i.translucentCommand)&&(r=i.translucentCommand.shaderProgram,n=i.translucentCommand.renderState),i.translucentCommand=DrawCommand.shallowClone(e,i.translucentCommand),defined(r)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=r,i.translucentCommand.renderState=n):(i.translucentCommand.shaderProgram=getTranslucentMRTShaderProgram(t,e.shaderProgram),i.translucentCommand.renderState=getTranslucentMRTRenderState(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)):(defined(i.translucentCommand)&&(a=i.translucentCommand.shaderProgram,o=i.translucentCommand.renderState,s=i.alphaCommand.shaderProgram,l=i.alphaCommand.renderState),i.translucentCommand=DrawCommand.shallowClone(e,i.translucentCommand),i.alphaCommand=DrawCommand.shallowClone(e,i.alphaCommand),defined(a)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=a,i.translucentCommand.renderState=o,i.alphaCommand.shaderProgram=s,i.alphaCommand.renderState=l):(i.translucentCommand.shaderProgram=getTranslucentColorShaderProgram(t,e.shaderProgram),i.translucentCommand.renderState=getTranslucentColorRenderState(this,t,e.renderState),i.alphaCommand.shaderProgram=getTranslucentAlphaShaderProgram(t,e.shaderProgram),i.alphaCommand.renderState=getTranslucentAlphaRenderState(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)),i},OIT.prototype.executeCommands=function(e,t,i,r,n){(this._translucentMRTSupport?executeTranslucentCommandsSortedMRT:executeTranslucentCommandsSortedMultipass)(this,e,t,i,r,n)},OIT.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},OIT.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._opaqueFBO,Color.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,t)),t.framebuffer=r},OIT.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},OIT.prototype.isDestroyed=function(){return!1},OIT.prototype.destroy=function(){return destroyResources$2(this),defined(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),defined(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),defined(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),destroyObject(this)};var defaultCredit=new Credit("MapQuest, Open Street Map and contributors, CC-BY-SA");function OpenStreetMapImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=Resource.createIfNeeded(defaultValue(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+="{z}/{x}/{y}."+defaultValue(e.fileExtension,"png");var i=new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),r=defaultValue(e.minimumLevel,0),n=e.maximumLevel,a=defaultValue(e.rectangle,i.rectangle),o=i.positionToTileXY(Rectangle.southwest(a),r),s=i.positionToTileXY(Rectangle.northeast(a),r);Math.abs(s.x-o.x),Math.abs(s.y-o.y);e=defaultValue(e.credit,defaultCredit);"string"==typeof e&&(e=new Credit(e)),UrlTemplateImageryProvider.call(this,{url:t,credit:e,tilingScheme:i,tileWidth:256,tileHeight:256,minimumLevel:r,maximumLevel:n,rectangle:a})}defined(Object.create)&&(OpenStreetMapImageryProvider.prototype=Object.create(UrlTemplateImageryProvider.prototype),OpenStreetMapImageryProvider.prototype.constructor=OpenStreetMapImageryProvider);var defaultSize=new Cartesian2(1,1);function Particle(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.mass=defaultValue(e.mass,1),this.position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this.velocity=Cartesian3.clone(defaultValue(e.velocity,Cartesian3.ZERO)),this.life=defaultValue(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=Color.clone(defaultValue(e.startColor,Color.WHITE)),this.endColor=Color.clone(defaultValue(e.endColor,Color.WHITE)),this.startScale=defaultValue(e.startScale,1),this.endScale=defaultValue(e.endScale,1),this.imageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultSize)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Particle.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var deltaScratch=new Cartesian3;function ParticleBurst(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.time=defaultValue(e.time,0),this.minimum=defaultValue(e.minimum,0),this.maximum=defaultValue(e.maximum,50),this._complete=!1}function ParticleEmitter(e){}Particle.prototype.update=function(e,t){return Cartesian3.multiplyByScalar(this.velocity,e,deltaScratch),Cartesian3.add(this.position,deltaScratch,this.position),defined(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},Object.defineProperties(ParticleBurst.prototype,{complete:{get:function(){return this._complete}}}),ParticleEmitter.prototype.emit=function(e){DeveloperError.throwInstantiationError()};var defaultImageSize=new Cartesian2(1,1);function ParticleSystem(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.updateCallback=e.updateCallback,this.loop=defaultValue(e.loop,!0),this.image=defaultValue(e.image,void 0);var t=e.emitter;defined(t)||(t=new CircleEmitter(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._emitterModelMatrix=Matrix4.clone(defaultValue(e.emitterModelMatrix,Matrix4.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new Matrix4,this._startColor=Color.clone(defaultValue(e.color,defaultValue(e.startColor,Color.WHITE))),this._endColor=Color.clone(defaultValue(e.color,defaultValue(e.endColor,Color.WHITE))),this._startScale=defaultValue(e.scale,defaultValue(e.startScale,1)),this._endScale=defaultValue(e.scale,defaultValue(e.endScale,1)),this._emissionRate=defaultValue(e.emissionRate,5),this._minimumSpeed=defaultValue(e.speed,defaultValue(e.minimumSpeed,1)),this._maximumSpeed=defaultValue(e.speed,defaultValue(e.maximumSpeed,1)),this._minimumParticleLife=defaultValue(e.particleLife,defaultValue(e.minimumParticleLife,5)),this._maximumParticleLife=defaultValue(e.particleLife,defaultValue(e.maximumParticleLife,5)),this._minimumMass=defaultValue(e.mass,defaultValue(e.minimumMass,1)),this._maximumMass=defaultValue(e.mass,defaultValue(e.maximumMass,1)),this._minimumImageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultValue(e.minimumImageSize,defaultImageSize))),this._maximumImageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultValue(e.maximumImageSize,defaultImageSize))),this._sizeInMeters=defaultValue(e.sizeInMeters,!1),this._lifetime=defaultValue(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 Event,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}function updateParticlePool(e){var t=e._emissionRate,i=e._maximumParticleLife,r=0,n=e._bursts;if(defined(n))for(var a=n.length,o=0;o<a;++o)r+=n[o].maximum;for(var s=e._billboardCollection,l=e.image,t=Math.ceil(t*i+r),i=e._particles,c=e._particlePool,u=Math.max(t-i.length-c.length,0),d=0;d<u;++d){var h=new Particle;h._billboard=s.add({image:l}),c.push(h)}e._particleEstimate=t}function getOrCreateParticle(e){e=e._particlePool.pop();return e=!defined(e)?new Particle:e}function addParticleToPool(e,t){e._particlePool.push(t)}function freeParticlePool(e){for(var t=e._particles,i=e._particlePool,r=e._billboardCollection,t=t.length,n=i.length,e=e._particleEstimate,t=n-Math.max(e-t-n,0),a=t;a<n;++a){var o=i[a];r.remove(o._billboard)}i.length=t}function removeBillboard(e){defined(e._billboard)&&(e._billboard.show=!1)}function updateBillboard(e,t){var i=t._billboard;(i=!defined(i)?t._billboard=e._billboardCollection.add({image:t.image}):i).width=t.imageSize.x,i.height=t.imageSize.y,i.position=t.position,i.sizeInMeters=e.sizeInMeters,i.show=!0;var r=CesiumMath.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),n=CesiumMath.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),a=CesiumMath.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),e=CesiumMath.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);i.color=new Color(r,n,a,e),i.scale=CesiumMath.lerp(t.startScale,t.endScale,t.normalizedAge)}function addParticle(e,t){t.startColor=Color.clone(e._startColor,t.startColor),t.endColor=Color.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=CesiumMath.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=CesiumMath.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=CesiumMath.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=CesiumMath.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;var i=CesiumMath.randomBetween(e._minimumSpeed,e._maximumSpeed);Cartesian3.multiplyByScalar(t.velocity,i,t.velocity),e._particles.push(t)}function calculateNumberToEmit(e,t){if(e._isComplete)return 0;var t=(t=CesiumMath.mod(t,e._lifetime))*e._emissionRate,i=Math.floor(t);if(e._carryOver+=t-i,1<e._carryOver&&(i++,--e._carryOver),defined(e.bursts))for(var r=e.bursts.length,n=0;n<r;n++){var a=e.bursts[n],o=e._currentTime;defined(a)&&!a._complete&&o>a.time&&(i+=CesiumMath.randomBetween(a.minimum,a.maximum),a._complete=!0)}return i}Object.defineProperties(ParticleSystem.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||!Matrix4.equals(this._modelMatrix,e),Matrix4.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!Matrix4.equals(this._emitterModelMatrix,e),Matrix4.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){Color.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){Color.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}}});var rotatedVelocityScratch=new Cartesian3;function getElement(e){return e="string"==typeof e?document.getElementById(e):e}function PerformanceDisplay(e){var t=getElement((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).container);this._container=t;var i=document.createElement("div");i.className="cesium-performanceDisplay";e=document.createElement("div");e.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),e.appendChild(this._fpsText);t=document.createElement("div");t.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),t.appendChild(this._msText),i.appendChild(t),i.appendChild(e),this._container.appendChild(i),this._lastFpsSampleTime=getTimestamp$1(),this._lastMsSampleTime=getTimestamp$1(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;e=document.createElement("div");e.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),e.appendChild(this._throttledText),i.appendChild(e)}function PickDepth(){this._framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._useLogDepth=void 0,this._debugPickDepthViewportCommand=void 0}function executeDebugPickDepth(e,t,i,r){var n;defined(e._debugPickDepthViewportCommand)&&r===e._useLogDepth||(n=new ShaderSource({defines:[r?"LOG_DEPTH":""],sources:["uniform highp sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"]}),e._debugPickDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._depthTexture}},owner:e}),e._useLogDepth=r),e._debugPickDepthViewportCommand.execute(t,i)}function destroyTextures(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function destroyFramebuffers(e){e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy()}function createTextures(e,t,i,r){e._depthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE})}function createFramebuffers$1(e,t,i,r){destroyTextures(e),destroyFramebuffers(e),createTextures(e,t,i,r),e._framebuffer=new Framebuffer({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function updateFramebuffers$1(e,t,i){var r=i.width,n=i.height,i=e._depthTexture,i=!defined(i)||i.width!==r||i.height!==n;defined(e._framebuffer)&&!i||createFramebuffers$1(e,t,r,n)}function updateCopyCommands(e,t,i){defined(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand("uniform highp sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{renderState:RenderState.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=i,e._copyDepthCommand.framebuffer=e._framebuffer}ParticleSystem.prototype.update=function(e){if(this.show){defined(this._billboardCollection)||(this._billboardCollection=new BillboardCollection),this._updateParticlePool&&(updateParticlePool(this),this._updateParticlePool=!1);var t=0;(t=this._previousTime?JulianDate.secondsDifference(e.time,this._previousTime):t)<0&&(t=0);var i,r=this._particles,n=this._emitter,a=this.updateCallback,o=r.length;for(c=0;c<o;++c)(i=r[c]).update(t,a)?updateBillboard(this,i):(removeBillboard(i),addParticleToPool(this,i),r[c]=r[o-1],--c,--o);r.length=o;var s=calculateNumberToEmit(this,t);if(0<s&&defined(n)){this._matrixDirty&&(this._combinedMatrix=Matrix4.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);for(var l=this._combinedMatrix,c=0;c<s;c++)i=getOrCreateParticle(this),this._emitter.emit(i),Cartesian3.add(i.position,i.velocity,rotatedVelocityScratch),Matrix4.multiplyByPoint(l,rotatedVelocityScratch,rotatedVelocityScratch),i.position=Matrix4.multiplyByPoint(l,i.position,i.position),Cartesian3.subtract(rotatedVelocityScratch,i.position,i.velocity),Cartesian3.normalize(i.velocity,i.velocity),addParticle(this,i),updateBillboard(this,i)}if(this._billboardCollection.update(e),this._previousTime=JulianDate.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=CesiumMath.mod(this._currentTime,this._lifetime),this.bursts){var u=this.bursts.length;for(c=0;c<u;c++)this.bursts[c]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120==0&&freeParticlePool(this)}},ParticleSystem.prototype.isDestroyed=function(){return!1},ParticleSystem.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),destroyObject(this)},Object.defineProperties(PerformanceDisplay.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(this._throttledText.nodeValue=e?"(throttled)":"",this._throttled=e)}}}),PerformanceDisplay.prototype.update=function(e){var t=getTimestamp$1(),i=defaultValue(e,!0);this._fpsFrameCount++;e=t-this._lastFpsSampleTime;1e3<e&&(r="N/A",i&&(r=1e3*this._fpsFrameCount/e|0),this._fpsText.nodeValue=r+" FPS",this._lastFpsSampleTime=t,this._fpsFrameCount=0),this._msFrameCount++;var r,e=t-this._lastMsSampleTime;200<e&&(r="N/A",i&&(r=(e/this._msFrameCount).toFixed(2)),this._msText.nodeValue=r+" MS",this._lastMsSampleTime=t,this._msFrameCount=0)},PerformanceDisplay.prototype.destroy=function(){return destroyObject(this)},PickDepth.prototype.executeDebugPickDepth=function(e,t,i){executeDebugPickDepth(this,e,t,i)},PickDepth.prototype.update=function(e,t){updateFramebuffers$1(this,e,t),updateCopyCommands(this,e,t)};var scratchPackedDepth=new Cartesian4,packedDepthScale=new Cartesian4(1,1/255,1/65025,1/16581375);function PickDepthFramebuffer(){this._depthStencilTexture=void 0,this._framebuffer=void 0,this._passState=void 0}function destroyResources$1(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy()}function createResources(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight;e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}),e._framebuffer=new Framebuffer({context:t,depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1});t=new PassState(t);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new BoundingRectangle},t.viewport=new BoundingRectangle,e._passState=t}function PickFramebuffer(e){var t=new PassState(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new BoundingRectangle},t.viewport=new BoundingRectangle,this._context=e,this._fb=void 0,this._passState=t,this._width=0,this._height=0}PickDepth.prototype.getDepth=function(e,t,i){if(defined(this._framebuffer)){i=e.readPixels({x:t,y:i,width:1,height:1,framebuffer:this._framebuffer}),i=Cartesian4.unpack(i,0,scratchPackedDepth);return Cartesian4.divideByScalar(i,255,i),Cartesian4.dot(i,packedDepthScale)}},PickDepth.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},PickDepth.prototype.isDestroyed=function(){return!1},PickDepth.prototype.destroy=function(){return destroyTextures(this),destroyFramebuffers(this),defined(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=defined(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),destroyObject(this)},PickDepthFramebuffer.prototype.update=function(e,t,i){var r=i.width,n=i.height;defined(this._framebuffer)&&r===this._depthStencilTexture.width&&n===this._depthStencilTexture.height||(destroyResources$1(this),createResources(this,e));i=this._framebuffer,e=this._passState;return e.framebuffer=i,e.viewport.width=r,e.viewport.height=n,e.scissorTest.rectangle.x=t.x,e.scissorTest.rectangle.y=n-t.y,e.scissorTest.rectangle.width=1,e.scissorTest.rectangle.height=1,e},PickDepthFramebuffer.prototype.isDestroyed=function(){return!1},PickDepthFramebuffer.prototype.destroy=function(){return destroyResources$1(this),destroyObject(this)},PickFramebuffer.prototype.begin=function(e,t){var i=this._context,r=t.width,t=t.height;return BoundingRectangle.clone(e,this._passState.scissorTest.rectangle),defined(this._fb)&&this._width===r&&this._height===t||(this._width=r,this._height=t,this._fb=this._fb&&this._fb.destroy(),this._fb=new Framebuffer({context:i,colorTextures:[new Texture({context:i,width:r,height:t})],depthStencilRenderbuffer:new Renderbuffer({context:i,width:r,height:t,format:RenderbufferFormat$1.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=r,this._passState.viewport.height=t,this._passState};var colorScratch=new Color;function SceneFramebuffer(){this._colorTexture=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._framebuffer=void 0,this._idFramebuffer=void 0,this._idClearColor=new Color(0,0,0,0),this._useHdr=void 0,this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,owner:this})}function destroyResources(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._idFramebuffer=e._idFramebuffer&&e._idFramebuffer.destroy(),e._colorTexture=e._colorTexture&&e._colorTexture.destroy(),e._idTexture=e._idTexture&&e._idTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._depthStencilIdTexture=e._depthStencilIdTexture&&e._depthStencilIdTexture.destroy(),e._depthStencilIdRenderbuffer=e._depthStencilIdRenderbuffer&&e._depthStencilIdRenderbuffer.destroy(),e._framebuffer=void 0,e._idFramebuffer=void 0,e._colorTexture=void 0,e._idTexture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,e._depthStencilIdTexture=void 0,e._depthStencilIdRenderbuffer=void 0}function ShadowMapShader(){}function ShadowMap(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context;this._enabled=defaultValue(e.enabled,!0),this._softShadows=defaultValue(e.softShadows,!1),this._normalOffset=defaultValue(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=defaultValue(e.fromLightSource,!0),this.darkness=defaultValue(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=defaultValue(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1;var i,r=this._needsUpdate=!0;(FeatureDetection.isInternetExplorer()||FeatureDetection.isEdge()||(FeatureDetection.isChrome()||FeatureDetection.isFirefox())&&FeatureDetection.isWindows()&&!t.depthTexture)&&(r=!1),this._polygonOffsetSupported=r,this._terrainBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:r,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 Matrix4,this._shadowMapTexture=void 0,this._lightDirectionEC=new Cartesian3,this._lightPositionEC=new Cartesian4,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ShadowMapCamera,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new BoundingSphere,this._isPointLight=defaultValue(e.isPointLight,!1),this._pointLightRadius=defaultValue(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&defaultValue(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?defaultValue(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Cartesian2,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new OrthographicOffCenterFrustum:defined(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Cartesian4,new Cartesian4],this._cascadeMatrices=[new Matrix4,new Matrix4,new Matrix4,new Matrix4],this._cascadeDistances=new Cartesian4,i=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(i);for(var n=0;n<i;++n)this._passes[n]=new ShadowPass(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,createRenderStates(this),this._clearCommand=new ClearCommand({depth:1,color:new Color}),this._clearPassState=new PassState(t),this._size=defaultValue(e.size,2048),this.size=this._size}function ShadowPass(e){this.camera=new ShadowMapCamera,this.passState=new PassState(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function createRenderState(e,t){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.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 createRenderStates(e){var t=!e._usesDepthTexture;e._primitiveRenderState=createRenderState(t,e._primitiveBias),e._terrainRenderState=createRenderState(t,e._terrainBias),e._pointRenderState=createRenderState(t,e._pointBias)}function destroyFramebuffer(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;defined(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function createFramebufferColor(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),a=e._passes.length,o=0;o<a;++o){var s=e._passes[o];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebufferDepth(e,t){for(var i=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),r=new Framebuffer({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,a=0;a<n;++a){var o=e._passes[a];o.framebuffer=r,o.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function createFramebufferCube(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new CubeMap({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],a=0;a<6;++a){var o=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[n[a]],destroyAttachments:!1}),s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebuffer(e,t){(e._isPointLight?createFramebufferCube:e._usesDepthTexture?createFramebufferDepth:createFramebufferColor)(e,t)}function checkFramebuffer(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==WebGLConstants$1.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,createRenderStates(e),destroyFramebuffer(e),createFramebuffer(e,t))}function updateFramebuffer(e,t){defined(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(destroyFramebuffer(e),createFramebuffer(e,t),checkFramebuffer(e,t),clearFramebuffer(e,t))}function clearFramebuffer(e,t,i){i=defaultValue(i,0),!e._isPointLight&&0!==i||(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function resize(e,t){e._size=t;var i,r=e._passes,n=r.length,a=e._textureSize;e._isPointLight?(t=ContextLimits.maximumCubeMapSize>=t?t:ContextLimits.maximumCubeMapSize,a.x=t,i=new BoundingRectangle(0,0,a.y=t,t),r[0].passState.viewport=i,r[1].passState.viewport=i,r[2].passState.viewport=i,r[3].passState.viewport=i,r[4].passState.viewport=i,r[5].passState.viewport=i):1===n?(t=ContextLimits.maximumTextureSize>=t?t:ContextLimits.maximumTextureSize,a.x=t,a.y=t,r[0].passState.viewport=new BoundingRectangle(0,0,t,t)):4===n&&(t=ContextLimits.maximumTextureSize>=2*t?t:ContextLimits.maximumTextureSize/2,a.x=2*t,a.y=2*t,r[0].passState.viewport=new BoundingRectangle(0,0,t,t),r[1].passState.viewport=new BoundingRectangle(t,0,t,t),r[2].passState.viewport=new BoundingRectangle(0,t,t,t),r[3].passState.viewport=new BoundingRectangle(t,t,t,t)),e._clearPassState.viewport=new BoundingRectangle(0,0,a.x,a.y);for(var o=0;o<n;++o){var s=r[o],l=s.passState.viewport,c=l.x/a.x,u=l.y/a.y,d=l.width/a.x,l=l.height/a.y;s.textureOffsets=new Matrix4(d,0,0,c,0,l,0,u,0,0,1,0,0,0,0,1)}}PickFramebuffer.prototype.end=function(e){for(var t=defaultValue(e.width,1),i=defaultValue(e.height,1),r=this._context,n=r.readPixels({x:e.x,y:e.y,width:t,height:i,framebuffer:this._fb}),e=Math.max(t,i),a=e*e,o=Math.floor(.5*t),s=Math.floor(.5*i),l=0,c=0,u=0,d=-1,h=0;h<a;++h){if(-o<=l&&l<=o&&-s<=c&&c<=s){var p=4*((s-c)*t+l+o);colorScratch.red=Color.byteToFloat(n[p]),colorScratch.green=Color.byteToFloat(n[1+p]),colorScratch.blue=Color.byteToFloat(n[2+p]),colorScratch.alpha=Color.byteToFloat(n[3+p]);var p=r.getObjectByPickColor(colorScratch);if(defined(p))return p}(l===c||l<0&&-l===c||0<l&&l===1-c)&&(p=u,u=-d,d=p),l+=u,c+=d}},PickFramebuffer.prototype.isDestroyed=function(){return!1},PickFramebuffer.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),destroyObject(this)},SceneFramebuffer.prototype.update=function(e,t,i){var r=t.width,n=t.height,t=this._colorTexture;defined(t)&&t.width===r&&t.height===n&&i===this._useHdr||(destroyResources(this),i=(this._useHdr=i)?e.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE,this._colorTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:i,sampler:Sampler.NEAREST}),this._idTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e.depthTexture?(this._depthStencilTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),this._depthStencilIdTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST})):(this._depthStencilRenderbuffer=new Renderbuffer({context:e,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL}),this._depthStencilIdRenderbuffer=new Renderbuffer({context:e,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL})),this._framebuffer=new Framebuffer({context:e,colorTextures:[this._colorTexture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}),this._idFramebuffer=new Framebuffer({context:e,colorTextures:[this._idTexture],depthStencilTexture:this._depthStencilIdTexture,depthStencilRenderbuffer:this._depthStencilIdRenderbuffer,destroyAttachments:!1}))},SceneFramebuffer.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._framebuffer,Color.clone(i,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=this._idFramebuffer,Color.clone(this._idClearColor,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=r},SceneFramebuffer.prototype.getFramebuffer=function(){return this._framebuffer},SceneFramebuffer.prototype.getIdFramebuffer=function(){return this._idFramebuffer},SceneFramebuffer.prototype.isDestroyed=function(){return!1},SceneFramebuffer.prototype.destroy=function(){return destroyResources(this),destroyObject(this)},ShadowMapShader.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},ShadowMapShader.createShadowCastVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);r.push("SHADOW_MAP"),i&&r.push("GENERATE_POSITION");e=defined(ShaderSource.findPositionVarying(e));if(t&&!e){for(var a=n.length,o=0;o<a;++o)n[o]=ShaderSource.replaceMain(n[o],"czm_shadow_cast_main");n.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new ShaderSource({defines:r,sources:n})},ShadowMapShader.createShadowCastFragmentShader=function(e,t,i,r){var n=e.defines.slice(0),a=e.sources.slice(0),o=ShaderSource.findPositionVarying(e),s=defined(o);s||(o="v_positionEC");for(var l=a.length,c=0;c<l;++c)a[c]=ShaderSource.replaceMain(a[c],"czm_shadow_cast_main");e="";return t&&(s||(e+="varying vec3 v_positionEC; \n"),e+="uniform vec4 shadowMap_lightPositionEC; \n"),e+=r?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",e+=t?" float distance = length("+o+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_FragColor = czm_packDepth(distance); \n":i?" gl_FragColor = vec4(1.0); \n":" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",e+="} \n",a.push(e),new ShaderSource({defines:n,sources:a})},ShadowMapShader.getShadowReceiveShaderKeyword=function(e,t,i,r){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+r},ShadowMapShader.createShadowReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),e=e.sources.slice(0);return r.push("SHADOW_MAP"),t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new ShaderSource({defines:r,sources:e})},ShadowMapShader.createShadowReceiveFragmentShader=function(e,t,i,r,n){for(var a=ShaderSource.findNormalVarying(e),o=!r&&defined(a)||r&&n,s=ShaderSource.findPositionVarying(e),l=defined(s),c=t._usesDepthTexture,u=t._polygonOffsetSupported,d=t._isPointLight,h=t._isSpotLight,p=1<t._numberOfCascades,m=t.debugCascadeColors,f=t.softShadows,n=d?t._pointBias:r?t._terrainBias:t._primitiveBias,t=e.defines.slice(0),g=e.sources.slice(0),_=g.length,y=0;y<_;++y)g[y]=ShaderSource.replaceMain(g[y],"czm_shadow_receive_main");d?t.push("USE_CUBE_MAP_SHADOW"):c&&t.push("USE_SHADOW_DEPTH_TEXTURE"),f&&!d&&t.push("USE_SOFT_SHADOWS"),p&&i&&r&&(o?t.push("ENABLE_VERTEX_LIGHTING"):t.push("ENABLE_DAYNIGHT_SHADING")),i&&n.normalShading&&o&&(t.push("USE_NORMAL_SHADING"),0<n.normalShadingSmooth&&t.push("USE_NORMAL_SHADING_SMOOTH"));i="";return i+=d?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",i+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+(l?" return vec4("+s+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n")+"} \nvec3 getNormalEC() \n{ \n"+(o?" return normalize("+a+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(n.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",i+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",i+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",r?i+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":u||(i+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),i+=d?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":h?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":p?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(m?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",i+=" gl_FragColor.rgb *= visibility; \n} \n",g.push(i),new ShaderSource({defines:t,sources:g})},ShadowMap.MAXIMUM_DISTANCE=2e4,ShadowMap.prototype.debugCreateRenderStates=function(){createRenderStates(this)},Object.defineProperties(ShadowMap.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){resize(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}}});var scratchViewport=new BoundingRectangle;function createDebugShadowViewCommand(e,t){var i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n",i=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Pass$1.OVERLAY,i}function updateDebugShadowViewCommand(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,a=.3*Math.min(r,n),n=scratchViewport;n.x=r-a,n.y=0,n.width=a,n.height=a;a=e._debugShadowViewCommand;defined(a)||(a=createDebugShadowViewCommand(e,i),e._debugShadowViewCommand=a),defined(a.renderState)&&BoundingRectangle.equals(a.renderState.viewport,n)||(a.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(n)})),t.commandList.push(e._debugShadowViewCommand)}var frustumCornersNDC=new Array(8);frustumCornersNDC[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC[6]=new Cartesian4(1,1,1,1),frustumCornersNDC[7]=new Cartesian4(-1,1,1,1);for(var scratchMatrix=new Matrix4,scratchFrustumCorners=new Array(8),i=0;i<8;++i)scratchFrustumCorners[i]=new Cartesian4;function createDebugPointLight(e,t){return new Primitive({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var debugOutlineColors=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale=new Cartesian3;function applyDebugSettings(e,t){updateDebugShadowViewCommand(e,t);var i,r,n,a=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(a&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new DebugCameraPrimitive({camera:e._sceneCamera,color:Color.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){a&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var o=0;o<e._numberOfCascades;++o)a&&(e._debugCascadeFrustums[o]=e._debugCascadeFrustums[o]&&e._debugCascadeFrustums[o].destroy(),e._debugCascadeFrustums[o]=new DebugCameraPrimitive({camera:e._passes[o].camera,color:debugOutlineColors[o],updateOnChange:!1})),e._debugCascadeFrustums[o].update(t)}}else e._isPointLight?defined(e._debugLightFrustum)&&!e._needsUpdate||(i=e._shadowMapCamera.positionWC,r=Quaternion.IDENTITY,n=2*e._pointLightRadius,n=Cartesian3.fromElements(n,n,n,scratchScale),n=Matrix4.fromTranslationQuaternionRotationScale(i,r,n,scratchMatrix),e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=createDebugPointLight(n,Color.YELLOW)):defined(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ShadowMapCamera(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesian3.clone(e.positionWC,this.positionWC),Cartesian3.clone(e.directionWC,this.directionWC),Cartesian3.clone(e.upWC,this.upWC),Cartesian3.clone(e.rightWC,this.rightWC)};var scaleBiasMatrix=new Matrix4(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ShadowMapCamera.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return Matrix4.multiply(t,e,this.viewProjectionMatrix),Matrix4.multiply(scaleBiasMatrix,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var scratchSplits=new Array(5),scratchFrustum=new PerspectiveFrustum,scratchCascadeDistances=new Array(4),scratchMin=new Cartesian3,scratchMax=new Cartesian3;function computeCascades(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=r.frustum.near,a=r.frustum.far,o=e._numberOfCascades,s=a-n,l=a/n,c=.9,u=!1;t.shadowState.closestObjectSize<200&&(u=!0,c=.9);var d=scratchCascadeDistances,h=scratchSplits;for(h[0]=n,h[o]=a,g=0;g<o;++g){var p=(g+1)/o,m=n*Math.pow(l,p),p=n+s*p,m=CesiumMath.lerp(p,m,c);h[g+1]=m,d[g]=m-h[g]}if(u){for(g=0;g<o;++g)d[g]=Math.min(d[g],e._maximumCascadeDistances[g]);for(var f=h[0],g=0;g<o-1;++g)f+=d[g],h[g+1]=f}Cartesian4.unpack(h,0,e._cascadeSplits[0]),Cartesian4.unpack(h,1,e._cascadeSplits[1]),Cartesian4.unpack(d,0,e._cascadeDistances);var u=i.frustum,_=u.left,y=u.right,C=u.bottom,v=u.top,S=u.near,T=u.far,x=i.positionWC,b=i.directionWC,E=i.upWC,P=r.frustum.clone(scratchFrustum),A=i.getViewProjection();for(g=0;g<o;++g){P.near=h[g],P.far=h[g+1];for(var w=Matrix4.multiply(P.projectionMatrix,r.viewMatrix,scratchMatrix),D=Matrix4.inverse(w,scratchMatrix),M=Matrix4.multiply(A,D,scratchMatrix),I=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin),R=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax),O=0;O<8;++O){var L=Cartesian4.clone(frustumCornersNDC[O],scratchFrustumCorners[O]);Matrix4.multiplyByVector(M,L,L),Cartesian3.divideByScalar(L,L.w,L),Cartesian3.minimumByComponent(L,I,I),Cartesian3.maximumByComponent(L,R,R)}I.x=Math.max(I.x,0),I.y=Math.max(I.y,0),I.z=0,R.x=Math.min(R.x,1),R.y=Math.min(R.y,1),R.z=Math.min(R.z,1);var F=e._passes[g],w=F.camera;w.clone(i);D=w.frustum;D.left=_+I.x*(y-_),D.right=_+R.x*(y-_),D.bottom=C+I.y*(v-C),D.top=C+R.y*(v-C),D.near=S+I.z*(T-S),D.far=S+R.z*(T-S),F.cullingVolume=w.frustum.computeCullingVolume(x,b,E);D=e._cascadeMatrices[g];Matrix4.multiply(w.getViewProjection(),r.inverseViewMatrix,D),Matrix4.multiply(F.textureOffsets,D,D)}}var scratchLightView=new Matrix4,scratchRight$1=new Cartesian3,scratchUp$1=new Cartesian3,scratchTranslation=new Cartesian3;function fitShadowMapToScene(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=Matrix4.multiply(r.frustum.projectionMatrix,r.viewMatrix,scratchMatrix),a=Matrix4.inverse(n,scratchMatrix),o=i.directionWC,s=r.directionWC;Cartesian3.equalsEpsilon(o,s,CesiumMath.EPSILON10)&&(s=r.upWC);var l=Cartesian3.cross(o,s,scratchRight$1),s=Cartesian3.cross(l,o,scratchUp$1);Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);for(var c=Cartesian3.fromElements(0,0,0,scratchTranslation),e=Matrix4.computeView(c,o,s,l,scratchLightView),u=Matrix4.multiply(e,a,scratchMatrix),d=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin),h=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax),p=0;p<8;++p){var m=Cartesian4.clone(frustumCornersNDC[p],scratchFrustumCorners[p]);Matrix4.multiplyByVector(u,m,m),Cartesian3.divideByScalar(m,m.w,m),Cartesian3.minimumByComponent(m,d,d),Cartesian3.maximumByComponent(m,h,h)}h.z+=1e3,d.z-=10;n=scratchTranslation;n.x=-.5*(d.x+h.x),n.y=-.5*(d.y+h.y),n.z=-h.z;r=Matrix4.fromTranslation(n,scratchMatrix),e=Matrix4.multiply(r,e,e),c=.5*(h.x-d.x),a=.5*(h.y-d.y),n=h.z-d.z,r=i.frustum;r.left=-c,r.right=c,r.bottom=-a,r.top=a,r.near=.01,r.far=n,Matrix4.clone(e,i.viewMatrix),Matrix4.inverse(e,i.inverseViewMatrix),Matrix4.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),Cartesian3.clone(o,i.directionWC),Cartesian3.clone(s,i.upWC),Cartesian3.clone(l,i.rightWC)}var directions=[new Cartesian3(-1,0,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(0,1,0),new Cartesian3(0,0,1)],ups=[new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(0,-1,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,1),new Cartesian3(0,-1,0)],rights=[new Cartesian3(0,0,1),new Cartesian3(1,0,0),new Cartesian3(-1,0,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(1,0,0)];function computeOmnidirectional(e,t){var i=new PerspectiveFrustum;i.fov=CesiumMath.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=directions[r],n.upWC=ups[r],n.rightWC=rights[r],Matrix4.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),Matrix4.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var scratchCartesian1=new Cartesian3,scratchCartesian2=new Cartesian3,scratchBoundingSphere=new BoundingSphere,scratchCenter$1=scratchBoundingSphere.center;function checkVisibility(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=scratchBoundingSphere;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var a=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,scratchCartesian1),i=Cartesian3.negate(r.directionWC,scratchCartesian2),a=Cartesian3.dot(a,i),i=CesiumMath.clamp(a/.1,0,1);if(e._darkness=CesiumMath.lerp(1,e.darkness,i),a<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else e._isPointLight?(n.center=r.positionWC,n.radius=e._pointLightRadius):(a=r.frustum.far/2,r=Cartesian3.add(r.positionWC,Cartesian3.multiplyByScalar(r.directionWC,a,scratchCenter$1),scratchCenter$1),n.center=r,n.radius=a),e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere)}function updateCameras(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?Cartesian3.clone(r.directionWC,a.directionWC):e._isPointLight?Cartesian3.clone(r.positionWC,a.positionWC):a.clone(r);var o,s,r=e._lightDirectionEC;Matrix4.multiplyByPointAsVector(i.viewMatrix,a.directionWC,r),Cartesian3.normalize(r,r),Cartesian3.negate(r,r),Matrix4.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,s=e._fitNearFar?(o=Math.min(t.shadowState.nearPlane,e.maximumDistance),s=Math.min(t.shadowState.farPlane,e.maximumDistance),Math.max(s,o+1)):(o=i.frustum.near,e.maximumDistance),e._sceneCamera=Camera.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=o,e._sceneCamera.frustum.far=s,e._distance=s-o,checkVisibility(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}ShadowMap.prototype.update=function(e){var t,i,r,n;updateCameras(this,e),this._needsUpdate&&(updateFramebuffer(this,e.context),this._isPointLight&&computeOmnidirectional(this,e),this._cascadesEnabled&&(fitShadowMapToScene(this,e),1<this._numberOfCascades&&computeCascades(this,e)),this._isPointLight?this._shadowMapCullingVolume=CullingVolume.fromBoundingSphere(this._boundingSphere):(t=(n=this._shadowMapCamera).positionWC,i=n.directionWC,r=n.upWC,this._shadowMapCullingVolume=n.frustum.computeCullingVolume(t,i,r),1===this._passes.length&&this._passes[0].camera.clone(n))),1===this._passes.length&&(n=this._sceneCamera.inverseViewMatrix,Matrix4.multiply(this._shadowMapCamera.getViewProjection(),n,this._shadowMapMatrix)),this.debugShow&&applyDebugSettings(this,e)},ShadowMap.prototype.updatePass=function(e,t){clearFramebuffer(this,e,t)};var scratchTexelStepSize=new Cartesian2;function combineUniforms(t,e,i){var r=t._isPointLight?t._pointBias:i?t._terrainBias:t._primitiveBias;return combine$2(e,{shadowMap_texture:function(){return t._shadowMapTexture},shadowMap_textureCube:function(){return t._shadowMapTexture},shadowMap_matrix:function(){return t._shadowMapMatrix},shadowMap_cascadeSplits:function(){return t._cascadeSplits},shadowMap_cascadeMatrices:function(){return t._cascadeMatrices},shadowMap_lightDirectionEC:function(){return t._lightDirectionEC},shadowMap_lightPositionEC:function(){return t._lightPositionEC},shadowMap_cascadeDistances:function(){return t._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var e=scratchTexelStepSize;return e.x=1/t._textureSize.x,e.y=1/t._textureSize.y,Cartesian4.fromElements(e.x,e.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cartesian4.fromElements(r.normalOffsetScale,t._distance,t.maximumDistance,t._darkness,this.combinedUniforms2)},combinedUniforms1:new Cartesian4,combinedUniforms2:new Cartesian4},!1)}function createCastDerivedCommand(e,t,i,r,n,a){var o,s,l,c,u,d,h,p,m;return defined(a)&&(m=a.shaderProgram,o=a.renderState,s=a.uniformMap),(a=DrawCommand.shallowClone(i,a)).castShadows=!0,a.receiveShadows=!1,defined(m)&&n===i.shaderProgram.id&&!t||(l=i.shaderProgram,c=i.pass===Pass$1.GLOBE,p=i.pass!==Pass$1.TRANSLUCENT,u=e._isPointLight,d=e._usesDepthTexture,h=ShadowMapShader.getShadowCastShaderKeyword(u,c,d,p),defined(m=r.shaderCache.getDerivedShaderProgram(l,h))||(n=l.vertexShaderSource,t=l.fragmentShaderSource,n=ShadowMapShader.createShadowCastVertexShader(n,u,c),p=ShadowMapShader.createShadowCastFragmentShader(t,u,d,p),m=r.shaderCache.createDerivedShaderProgram(l,h,{vertexShaderSource:n,fragmentShaderSource:p,attributeLocations:l._attributeLocations})),o=e._primitiveRenderState,u?o=e._pointRenderState:c&&(o=e._terrainRenderState),i.renderState.cull.enabled||((o=clone$1(o,!1)).cull=clone$1(o.cull,!1),o.cull.enabled=!1,o=RenderState.fromCache(o)),s=combineUniforms(e,i.uniformMap,c)),a.shaderProgram=m,a.renderState=o,a.uniformMap=s,a}function CommandExtent(){this.command=void 0,this.near=void 0,this.far=void 0}function View(e,t,i){var r,n,a=e.context;a.depthTexture&&(r=new GlobeDepth),e._useOIT&&a.depthTexture&&(n=new OIT(a));e=new PassState(a);e.viewport=BoundingRectangle.clone(i),this.camera=t,this._cameraClone=Camera.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=i,this.passState=e,this.pickFramebuffer=new PickFramebuffer(a),this.pickDepthFramebuffer=new PickDepthFramebuffer,this.sceneFramebuffer=new SceneFramebuffer,this.globeDepth=r,this.globeTranslucencyFramebuffer=new GlobeTranslucencyFramebuffer,this.oit=n,this.pickDepths=[],this.debugGlobeDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}ShadowMap.createReceiveDerivedCommand=function(e,t,i,r,n){defined(n)||(n={});var a,o,s,l=0<e.length,c=t.shaderProgram,u=c.vertexShaderSource,d=c.fragmentShaderSource,h=t.pass===Pass$1.GLOBE,p=!1;return h&&(p=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&l&&(defined(n.receiveCommand)&&(s=n.receiveCommand.shaderProgram,a=n.receiveCommand.uniformMap),n.receiveCommand=DrawCommand.shallowClone(t,n.receiveCommand),n.castShadows=!1,n.receiveShadows=!0,o=n.receiveShaderCastShadows!==t.castShadows,l=n.receiveShaderProgramId!==t.shaderProgram.id,(!defined(s)||l||i||o)&&(o=ShadowMapShader.getShadowReceiveShaderKeyword(e[0],t.castShadows,h,p),defined(s=r.shaderCache.getDerivedShaderProgram(c,o))||(u=ShadowMapShader.createShadowReceiveVertexShader(u,h,p),p=ShadowMapShader.createShadowReceiveFragmentShader(d,e[0],t.castShadows,h,p),s=r.shaderCache.createDerivedShaderProgram(c,o,{vertexShaderSource:u,fragmentShaderSource:p,attributeLocations:c._attributeLocations})),a=combineUniforms(e[0],t.uniformMap,h)),n.receiveCommand.shaderProgram=s,n.receiveCommand.uniformMap=a,n.receiveShaderProgramId=t.shaderProgram.id,n.receiveShaderCastShadows=t.castShadows),n},ShadowMap.createCastDerivedCommand=function(e,t,i,r,n){if(defined(n)||(n={}),t.castShadows){var a=n.castCommands;defined(a)||(a=n.castCommands=[]);var o=n.castShaderProgramId,s=e.length;a.length=s;for(var l=0;l<s;++l)a[l]=createCastDerivedCommand(e[l],i,t,r,o,a[l]);n.castShaderProgramId=t.shaderProgram.id}return n},ShadowMap.prototype.isDestroyed=function(){return!1},ShadowMap.prototype.destroy=function(){destroyFramebuffer(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(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return destroyObject(this)};var scratchPosition0=new Cartesian3,scratchPosition1=new Cartesian3;function maxComponent(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),t=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),t)}function cameraEqual(e,t,i){var r=1/Math.max(1,maxComponent(e.position,t.position));return Cartesian3.multiplyByScalar(e.position,r,scratchPosition0),Cartesian3.multiplyByScalar(t.position,r,scratchPosition1),Cartesian3.equalsEpsilon(scratchPosition0,scratchPosition1,i)&&Cartesian3.equalsEpsilon(e.direction,t.direction,i)&&Cartesian3.equalsEpsilon(e.up,t.up,i)&&Cartesian3.equalsEpsilon(e.right,t.right,i)&&Matrix4.equalsEpsilon(e.transform,t.transform,i)&&e.frustum.equalsEpsilon(t.frustum,i)}function updateFrustums(e,t,i,r){var n=t.frameState,a=n.camera,o=n.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,s=t.mode===SceneMode$1.SCENE2D,l=t.nearToFarDistance2D;r*=1+CesiumMath.EPSILON2,i=Math.min(Math.max(i,a.frustum.near),a.frustum.far),r=Math.max(Math.min(r,a.frustum.far),i);var c=s?(r=Math.min(r,a.position.z+t.nearToFarDistance2D),i=Math.min(i,r),Math.ceil(Math.max(1,r-i)/t.nearToFarDistance2D)):Math.ceil(Math.log(r/i)/Math.log(o)),u=e.frustumCommandsList;u.length=c;for(var d=0;d<c;++d){var h,p=s?(h=Math.min(r-l,i+d*l),Math.min(r,h+l)):(h=Math.max(i,Math.pow(o,d)*i),Math.min(r,o*h)),m=u[d];defined(m)?(m.near=h,m.far=p):m=u[d]=new FrustumCommands(h,p)}}function insertIntoBin(e,t,i,r,n){t.debugShowFrustums&&(i.debugOverlappingFrustums=0);for(var a,o=e.frustumCommandsList,s=o.length,l=0;l<s;++l){var c=o[l],u=c.near;if(!(c.far<r)){if(n<u)break;var d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<l),i.executeInClosestFrustum)break}}t.debugShowFrustums&&((a=e.debugFrustumStatistics.commandsInFrustums)[i.debugOverlappingFrustums]=defined(a[i.debugOverlappingFrustums])?a[i.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands),t.updateDerivedCommands(i)}View.prototype.checkForCameraUpdates=function(e){var t=this.camera,i=this._cameraClone;return cameraEqual(t,i,CesiumMath.EPSILON15)?(this._cameraStartFired&&getTimestamp$1()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=getTimestamp$1(),Camera.clone(t,i),!0)};var scratchCullingVolume$1=new CullingVolume,scratchNearFarInterval=new Interval;View.prototype.createPotentiallyVisibleSet=function(e){var t=e.frameState,i=t.camera,r=i.directionWC,n=i.positionWC,a=e._computeCommandList,o=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=this.frustumCommandsList,c=l.length,u=Pass$1.NUMBER_OF_PASSES,d=0;d<c;++d)for(var h=0;h<u;++h)l[d].indices[h]=0;a.length=0,o.length=0;for(var p=this._commandExtents,m=p.length,f=0,g=+Number.MAX_VALUE,_=-Number.MAX_VALUE,y=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,T=t.mode===SceneMode$1.SCENE3D?t.occluder:void 0,x=t.cullingVolume,b=scratchCullingVolume$1.planes,E=0;E<5;++E)b[E]=x.planes[E];for(var P,A,x=scratchCullingVolume$1,w=s.length,D=0;D<w;++D){var M=s[D],I=M.pass;if(I===Pass$1.COMPUTE)a.push(M);else if(I===Pass$1.OVERLAY)o.push(M);else{var R=M.boundingVolume;if(defined(R)){if(!e.isVisible(M,x,T))continue;var O=R.computePlaneDistances(n,r,scratchNearFarInterval),L=O.start,O=O.stop,g=Math.min(g,L),_=Math.max(_,O);y&&M.receiveShadows&&L<ShadowMap.MAXIMUM_DISTANCE&&!(I===Pass$1.GLOBE&&L<-100&&100<O)&&(F=O-L,I!==Pass$1.GLOBE&&L<100&&(S=Math.min(S,F)),C=Math.min(C,L),v=Math.max(v,O))}else M instanceof ClearCommand?(L=i.frustum.near,O=i.frustum.far):(L=i.frustum.near,O=i.frustum.far,g=Math.min(g,L),_=Math.max(_,O));var F=p[f];(F=!defined(F)?p[f]=new CommandExtent:F).command=M,F.near=L,F.far=O,f++}}for(y&&(C=Math.min(Math.max(C,i.frustum.near),i.frustum.far),v=Math.max(Math.min(v,i.frustum.far),C)),y&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=v,t.shadowState.closestObjectSize=S),updateFrustums(this,e,g,_),P=0;P<f;P++)insertIntoBin(this,e,(A=p[P]).command,A.near,A.far);if(f<m)for(P=f;P<m&&defined((A=p[P]).command);P++)A.command=void 0;var N=l.length,B=t.frustumSplits;B.length=N+1;for(var V=0;V<N;++V)B[V]=l[V].near,V===N-1&&(B[V+1]=l[V].far)},View.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.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();for(var e=this.pickDepths,t=this.debugGlobeDepths,i=e.length,r=0;r<i;++r)e[r].destroy();for(i=t.length,r=0;r<i;++r)t[r].destroy()};var offscreenDefaultWidth=.1,mostDetailedPreloadTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.MOST_DETAILED_PRELOAD}),mostDetailedPickTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.MOST_DETAILED_PICK}),pickTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PICK});function Picking(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;var t=new BoundingRectangle(0,0,1,1),i=new Camera(e);i.frustum=new OrthographicFrustum({width:offscreenDefaultWidth,aspectRatio:1,near:.1}),this._pickOffscreenView=new View(e,i,t)}Picking.prototype.update=function(){this._pickPositionCacheDirty=!0},Picking.prototype.getPickDepth=function(e,t){var i=e.view.pickDepths,e=i[t];return defined(e)||(e=new PickDepth,i[t]=e),e};var scratchOrthoPickingFrustum=new OrthographicOffCenterFrustum,scratchOrthoOrigin=new Cartesian3,scratchOrthoDirection=new Cartesian3,scratchOrthoPixelSize=new Cartesian2,scratchOrthoPickVolumeMatrix4=new Matrix4;function getPickOrthographicCullingVolume(e,t,i,r,n){var a=e.camera,o=a.frustum;defined(o._offCenterFrustum)&&(o=o._offCenterFrustum);var s=2*(t.x-n.x)/n.width-1;s*=.5*(o.right-o.left);var l=2*(n.height-t.y-n.y)/n.height-1;l*=.5*(o.top-o.bottom);var c=Matrix4.clone(a.transform,scratchOrthoPickVolumeMatrix4);a._setTransform(Matrix4.IDENTITY);t=Cartesian3.clone(a.position,scratchOrthoOrigin);Cartesian3.multiplyByScalar(a.right,s,scratchOrthoDirection),Cartesian3.add(scratchOrthoDirection,t,t),Cartesian3.multiplyByScalar(a.up,l,scratchOrthoDirection),Cartesian3.add(scratchOrthoDirection,t,t),a._setTransform(c),e.mode===SceneMode$1.SCENE2D&&Cartesian3.fromElements(t.z,t.x,t.y,t);e=o.getPixelDimensions(n.width,n.height,1,1,scratchOrthoPixelSize),n=scratchOrthoPickingFrustum;return n.right=.5*e.x,n.left=-n.right,n.top=.5*e.y,n.bottom=-n.top,n.near=o.near,n.far=o.far,n.computeCullingVolume(t,a.directionWC,a.upWC)}var scratchPerspPickingFrustum=new PerspectiveOffCenterFrustum,scratchPerspPixelSize=new Cartesian2;function getPickPerspectiveCullingVolume(e,t,i,r,n){var a=e.camera,o=a.frustum,s=o.near,l=Math.tan(.5*o.fovy),e=o.aspectRatio*l,e=(2*(t.x-n.x)/n.width-1)*s*e,l=(2*(n.height-t.y-n.y)/n.height-1)*s*l,n=o.getPixelDimensions(n.width,n.height,1,1,scratchPerspPixelSize),i=n.x*i*.5,n=n.y*r*.5,r=scratchPerspPickingFrustum;return r.top=l+n,r.bottom=l-n,r.right=e+i,r.left=e-i,r.near=s,r.far=o.far,r.computeCullingVolume(a.positionWC,a.directionWC,a.upWC)}function getPickCullingVolume(e,t,i,r,n){var a=e.camera.frustum;return(a instanceof OrthographicFrustum||a instanceof OrthographicOffCenterFrustum?getPickOrthographicCullingVolume:getPickPerspectiveCullingVolume)(e,t,i,r,n)}var scratchRectangleWidth=3,scratchRectangleHeight=3,scratchRectangle=new BoundingRectangle(0,0,scratchRectangleWidth,scratchRectangleHeight),scratchPosition=new Cartesian2,scratchColorZero=new Color(0,0,0,0);function renderTranslucentDepthForPick(e,t){var i=e.context,r=e.frameState,n=e.environmentState,a=e.defaultView,o=(e.view=a).viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;var s=a.passState;s.viewport=BoundingRectangle.clone(o,s.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=getPickCullingVolume(e,t,1,1,o),r.tilesetPassState=pickTilesetPassState,e.updateEnvironment(),n.renderTranslucentDepthForPick=!0,s=a.pickDepthFramebuffer.update(i,t,o),e.updateAndExecuteCommands(s,scratchColorZero),e.resolveFramebuffers(s),i.endFrame()}Picking.prototype.pick=function(e,t,i,r){scratchRectangleWidth=defaultValue(i,3),scratchRectangleHeight=defaultValue(r,scratchRectangleWidth);var n=e.context,a=n.uniformState,o=e.frameState,s=e.defaultView,i=(e.view=s).viewport;i.x=0,i.y=0,i.width=n.drawingBufferWidth,i.height=n.drawingBufferHeight;r=s.passState;r.viewport=BoundingRectangle.clone(i,r.viewport);t=SceneTransforms.transformWindowToDrawingBuffer(e,t,scratchPosition);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=getPickCullingVolume(e,t,scratchRectangleWidth,scratchRectangleHeight,i),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=pickTilesetPassState,a.update(o),e.updateEnvironment(),scratchRectangle.x=t.x-.5*(scratchRectangleWidth-1),scratchRectangle.y=e.drawingBufferHeight-t.y-.5*(scratchRectangleHeight-1),scratchRectangle.width=scratchRectangleWidth,scratchRectangle.height=scratchRectangleHeight,r=s.pickFramebuffer.begin(scratchRectangle,s.viewport),e.updateAndExecuteCommands(r,scratchColorZero),e.resolveFramebuffers(r);s=s.pickFramebuffer.end(scratchRectangle);return n.endFrame(),s};var scratchPerspectiveFrustum$1=new PerspectiveFrustum,scratchPerspectiveOffCenterFrustum$1=new PerspectiveOffCenterFrustum,scratchOrthographicFrustum$1=new OrthographicFrustum,scratchOrthographicOffCenterFrustum$1=new OrthographicOffCenterFrustum;Picking.prototype.pickPositionWorldCoordinates=function(e,t,i){if(e.useDepthPicking){var r=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return Cartesian3.clone(this._pickPositionCache[r],i);var n=e.frameState,a=e.context,o=a.uniformState,s=e.defaultView;e.view=s;var l=SceneTransforms.transformWindowToDrawingBuffer(e,t,scratchPosition);e.pickTranslucentDepth?renderTranslucentDepthForPick(e,l):(e.updateFrameState(),o.update(n),e.updateEnvironment()),l.y=e.drawingBufferHeight-l.y;for(var c=e.camera,u=defined(c.frustum.fov)?c.frustum.clone(scratchPerspectiveFrustum$1):defined(c.frustum.infiniteProjectionMatrix)?c.frustum.clone(scratchPerspectiveOffCenterFrustum$1):defined(c.frustum.width)?c.frustum.clone(scratchOrthographicFrustum$1):c.frustum.clone(scratchOrthographicOffCenterFrustum$1),d=s.frustumCommandsList,h=d.length,p=0;p<h;++p){var m=this.getPickDepth(e,p).getDepth(a,l.x,l.y);if(defined(m)&&(0<m&&m<1)){var f,g=d[p];return e.mode===SceneMode$1.SCENE2D?(f=c.position.z,c.position.z=f-g.near+1,u.far=Math.max(1,g.far-g.near),u.near=1,o.update(n)):(u.near=g.near*(0!==p?e.opaqueFrustumNearOffset:1),u.far=g.far),o.updateFrustum(u),i=SceneTransforms.drawingBufferToWgs84Coordinates(e,l,m,i),e.mode===SceneMode$1.SCENE2D&&(c.position.z=f,o.update(n)),this._pickPositionCache[r]=Cartesian3.clone(i),i}}this._pickPositionCache[r]=void 0}};var scratchPickPositionCartographic=new Cartographic;function drillPick(e,t){var i,r,n=[],a=[],o=[],s=[];defined(e)||(e=Number.MAX_VALUE);for(var l=t();defined(l);){var c=l.object,u=l.position,d=l.exclude;if(defined(u)&&!defined(c)){n.push(l);break}if(!defined(c)||!defined(c.primitive))break;if(!d&&(n.push(l),--e<=0))break;u=c.primitive,d=!1;"function"==typeof u.getGeometryInstanceAttributes&&defined(c.id)&&defined(r=u.getGeometryInstanceAttributes(c.id))&&defined(r.show)&&(d=!0,r.show=ShowGeometryInstanceAttribute.toValue(!1,r.show),o.push(r)),c instanceof Cesium3DTileFeature&&(d=!0,c.show=!1,s.push(c)),d||(u.show=!1,a.push(u)),l=t()}for(i=0;i<a.length;++i)a[i].show=!0;for(i=0;i<o.length;++i)(r=o[i]).show=ShowGeometryInstanceAttribute.toValue(!0,r.show);for(i=0;i<s.length;++i)s[i].show=!0;return n}Picking.prototype.pickPosition=function(e,t,i){return defined(i=this.pickPositionWorldCoordinates(e,t,i))&&e.mode!==SceneMode$1.SCENE3D&&(Cartesian3.fromElements(i.y,i.z,i.x,i),e=(t=e.mapProjection).ellipsoid,t=t.unproject(i,scratchPickPositionCartographic),e.cartographicToCartesian(t,i)),i},Picking.prototype.drillPick=function(t,i,e,r,n){var a=this;return drillPick(e,function(){var e=a.pick(t,i,r,n);if(defined(e))return{object:e,position:void 0,exclude:!1}}).map(function(e){return e.object})};var scratchRight=new Cartesian3,scratchUp=new Cartesian3;function MostDetailedRayPick(e,t,i){this.ray=e,this.width=t,this.tilesets=i,this.ready=!1,this.deferred=when.defer(),this.promise=this.deferred.promise}function updateOffscreenCameraFromRay(e,t,i,r){var n=t.direction,a=Cartesian3.mostOrthogonalAxis(n,scratchRight),o=Cartesian3.cross(n,a,scratchRight),a=Cartesian3.cross(n,o,scratchUp);return r.position=t.origin,r.direction=n,r.up=a,r.right=o,r.frustum.width=defaultValue(i,offscreenDefaultWidth),r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function updateMostDetailedRayPick(e,t,i){var r=t.frameState,n=i.ray,a=i.width,o=i.tilesets,s=e._pickOffscreenView.camera,a=updateOffscreenCameraFromRay(e,n,a,s),l=mostDetailedPreloadTilesetPassState;l.camera=s,l.cullingVolume=a;for(var c=!0,u=o.length,d=0;d<u;++d){var h=o[d];h.show&&t.primitives.contains(h)&&(h.updateForPass(r,l),c=c&&l.ready)}return c&&i.deferred.resolve(),c}function getTilesets(e,t,i){for(var r=e.length,n=0;n<r;++n){var a=e.get(n);a.show&&(defined(a.isCesium3DTileset)?defined(t)&&-1!==t.indexOf(a)||i.push(a):a instanceof PrimitiveCollection&&getTilesets(a,t,i))}}function launchMostDetailedRayPick(e,t,i,r,n,a){var o=[];if(getTilesets(t.primitives,r,o),0===o.length)return when.resolve(a());o=new MostDetailedRayPick(i,n,o);return e._mostDetailedRayPicks.push(o),o.promise.then(function(){return a()})}function isExcluded(e,t){return!(!defined(e)||!defined(t)||0===t.length)&&(-1<t.indexOf(e)||-1<t.indexOf(e.primitive)||-1<t.indexOf(e.id))}function getRayIntersection(e,t,i,r,n,a,o){var s=t.context,l=s.uniformState,c=t.frameState,u=e._pickOffscreenView;updateOffscreenCameraFromRay(e,i,n,(t.view=u).camera),scratchRectangle=BoundingRectangle.clone(u.viewport,scratchRectangle);n=u.pickFramebuffer.begin(scratchRectangle,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,c.tilesetPassState=o?mostDetailedPickTilesetPassState:pickTilesetPassState,l.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(n,scratchColorZero),t.resolveFramebuffers(n);n=u.pickFramebuffer.end(s);if(t.context.depthTexture)for(var d=u.frustumCommandsList.length,h=0;h<d;++h){var p=e.getPickDepth(t,h).getDepth(s,0,0);if(defined(p)&&(0<p&&p<1)){var m=u.frustumCommandsList[h],f=m.near*(0!==h?t.opaqueFrustumNearOffset:1),f=f+p*(m.far-f),g=Ray.getPoint(i,f);break}}if(t.view=t.defaultView,s.endFrame(),defined(n)||defined(g))return{object:n,position:g,exclude:!defined(g)&&a||isExcluded(n,r)}}function getRayIntersections(e,t,i,r,n,a,o,s){return drillPick(r,function(){return getRayIntersection(e,t,i,n,a,o,s)})}function pickFromRay(e,t,i,r,n,a,o){o=getRayIntersections(e,t,i,1,r,n,a,o);if(0<o.length)return o[0]}function drillPickFromRay(e,t,i,r,n,a,o,s){return getRayIntersections(e,t,i,r,n,a,o,s)}function deferPromiseUntilPostRender(i,e){var r=when.defer();return e.then(function(e){var t=i.postRender.addEventListener(function(){r.resolve(e),t()});i.requestRender()}).otherwise(function(e){r.reject(e)}),r.promise}Picking.prototype.updateMostDetailedRayPicks=function(e){for(var t=this._mostDetailedRayPicks,i=0;i<t.length;++i)updateMostDetailedRayPick(this,e,t[i])&&t.splice(i--,1)},Picking.prototype.pickFromRay=function(e,t,i,r){return pickFromRay(this,e,t,i,r,!1,!1)},Picking.prototype.drillPickFromRay=function(e,t,i,r,n){return drillPickFromRay(this,e,t,i,r,n,!1,!1)},Picking.prototype.pickFromRayMostDetailed=function(e,t,i,r){var n=this;return t=Ray.clone(t),i=defined(i)?i.slice():i,deferPromiseUntilPostRender(e,launchMostDetailedRayPick(n,e,t,i,r,function(){return pickFromRay(n,e,t,i,r,!1,!0)}))},Picking.prototype.drillPickFromRayMostDetailed=function(e,t,i,r,n){var a=this;return t=Ray.clone(t),r=defined(r)?r.slice():r,deferPromiseUntilPostRender(e,launchMostDetailedRayPick(a,e,t,r,n,function(){return drillPickFromRay(a,e,t,i,r,n,!1,!0)}))};var scratchSurfacePosition=new Cartesian3,scratchSurfaceNormal$1=new Cartesian3,scratchSurfaceRay=new Ray,scratchCartographic$1=new Cartographic;function getRayForSampleHeight(e,t){var i=e.globe,r=(defined(i)?i:e.mapProjection).ellipsoid,i=ApproximateTerrainHeights._defaultMaxTerrainHeight,e=r.geodeticSurfaceNormalCartographic(t,scratchSurfaceNormal$1),t=Cartographic.toCartesian(t,r,scratchSurfacePosition),r=scratchSurfaceRay;r.origin=t,r.direction=e;t=new Ray;return Ray.getPoint(r,i,t.origin),Cartesian3.negate(e,t.direction),t}function getRayForClampToHeight(e,t){var i=e.globe,i=(defined(i)?i:e.mapProjection).ellipsoid;return getRayForSampleHeight(e,Cartographic.fromCartesian(t,i,scratchCartographic$1))}function getHeightFromCartesian(e,t){var i=e.globe,e=(defined(i)?i:e.mapProjection).ellipsoid;return Cartographic.fromCartesian(t,e,scratchCartographic$1).height}function sampleHeightMostDetailed(t,i,e,r,n){var a=getRayForSampleHeight(i,e);return launchMostDetailedRayPick(t,i,a,r,n,function(){var e=pickFromRay(t,i,a,r,n,!0,!0);if(defined(e))return getHeightFromCartesian(i,e.position)})}function clampToHeightMostDetailed(t,i,e,r,n,a){var o=getRayForClampToHeight(i,e);return launchMostDetailedRayPick(t,i,o,r,n,function(){var e=pickFromRay(t,i,o,r,n,!0,!0);if(defined(e))return Cartesian3.clone(e.position,a)})}Picking.prototype.sampleHeight=function(e,t,i,r){r=pickFromRay(this,e,getRayForSampleHeight(e,t),i,r,!0,!1);if(defined(r))return getHeightFromCartesian(e,r.position)},Picking.prototype.clampToHeight=function(e,t,i,r,n){r=pickFromRay(this,e,getRayForClampToHeight(e,t),i,r,!0,!1);if(defined(r))return Cartesian3.clone(r.position,n)},Picking.prototype.sampleHeightMostDetailed=function(e,r,t,i){t=defined(t)?t.slice():t;for(var n=r.length,a=new Array(n),o=0;o<n;++o)a[o]=sampleHeightMostDetailed(this,e,r[o],t,i);return deferPromiseUntilPostRender(e,when.all(a).then(function(e){for(var t=e.length,i=0;i<t;++i)r[i].height=e[i];return r}))},Picking.prototype.clampToHeightMostDetailed=function(e,r,t,i){t=defined(t)?t.slice():t;for(var n=r.length,a=new Array(n),o=0;o<n;++o)a[o]=clampToHeightMostDetailed(this,e,r[o],t,i,r[o]);return deferPromiseUntilPostRender(e,when.all(a).then(function(e){for(var t=e.length,i=0;i<t;++i)r[i]=e[i];return r}))},Picking.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var PostProcessStageSampleMode={NEAREST:0,LINEAR:1};function PostProcessStage(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).fragmentShader,i=defaultValue(e.textureScale,1),r=defaultValue(e.pixelFormat,PixelFormat$1.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=i,this._forcePowerOfTwo=defaultValue(e.forcePowerOfTwo,!1),this._sampleMode=defaultValue(e.sampleMode,PostProcessStageSampleMode.NEAREST),this._pixelFormat=r,this._pixelDatatype=defaultValue(e.pixelDatatype,PixelDatatype$1.UNSIGNED_BYTE),this._clearColor=defaultValue(e.clearColor,Color.BLACK),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;r=new PassState;r.scissorTest={enabled:!0,rectangle:defined(e.scissorRectangle)?BoundingRectangle.clone(e.scissorRectangle):new BoundingRectangle},this._passState=r,this._ready=!1;e=e.name;defined(e)||(e=createGuid()),this._name=e,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(PostProcessStage.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(defined(this._textureCache)){var e=this._textureCache.getFramebuffer(this._name);if(defined(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 depthTextureRegex=/uniform\s+sampler2D\s+depthTexture/g;function getUniformValueGetterAndSetter(n,a,o){var e=a[o];return("string"==typeof e||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)&&n._dirtyUniforms.push(o),{get:function(){return a[o]},set:function(e){var t=a[o];a[o]=e;var i=n._actualUniforms,r=i[o];defined(r)&&r!==t&&r instanceof Texture&&!defined(n._textureCache.getStageByName(o))&&(n._texturesToRelease.push(r),delete i[o],delete i[o+"Dimensions"]),t instanceof Texture&&n._texturesToRelease.push(t),"string"==typeof e||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData?n._dirtyUniforms.push(o):i[o]=e}}}function getUniformMapFunction(t,i){return function(){var e=t._actualUniforms[i];return"function"==typeof e?e():e}}function getUniformMapDimensionsFunction(t,i){return function(){var e=t[i]();if(defined(e))return e.dimensions}}function createUniformMap(e){if(!defined(e._uniformMap)){var t,i,r={},n={},a=e._uniforms,o=e._actualUniforms;for(t in a)a.hasOwnProperty(t)&&("function"!=typeof a[t]?(r[t]=getUniformMapFunction(e,t),n[t]=getUniformValueGetterAndSetter(e,a,t)):(r[t]=a[t],n[t]=a[t]),o[t]=a[t],("string"==typeof(i=r[t]())||i instanceof Texture||i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(r[t+"Dimensions"]=getUniformMapDimensionsFunction(r,t)));e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=combine$2(r,{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 createDrawCommand(e,t){var i;defined(e._command)&&!e._logDepthChanged&&!e._selectedDirty||(i=e._fragmentShader,defined(e._selectedIdTexture)&&(i="#define CZM_SELECTED_FEATURE \nuniform sampler2D czm_idTexture; \nuniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nvarying vec2 v_textureCoordinates; \nbool czm_selected(vec2 offset) \n{ \n bool selected = false;\n vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset); \n for (int i = 0; i < "+e._selectedIdTexture.width+"; ++i) \n { \n vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n if (all(equal(id, selectedId))) \n { \n return true; \n } \n } \n return false; \n} \n\nbool czm_selected() \n{ \n return czm_selected(vec2(0.0)); \n} \n\n"+(i=i.replace(/varying\s+vec2\s+v_textureCoordinates;/g,""))),i=new ShaderSource({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[i]}),e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e}))}function createSampler(e){var t,i=e._sampleMode===PostProcessStageSampleMode.LINEAR?(t=TextureMinificationFilter$1.LINEAR,TextureMagnificationFilter$1.LINEAR):(t=TextureMinificationFilter$1.NEAREST,TextureMagnificationFilter$1.NEAREST),r=e._sampler;defined(r)&&r.minificationFilter===t&&r.magnificationFilter===i||(e._sampler=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i}))}function createLoadImageFunction(t,i){return function(e){t._texturesToCreate.push({name:i,source:e})}}function createStageOutputTextureFunction(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function updateUniformTextures(e,t){var i,r=e._texturesToRelease,n=r.length;for(d=0;d<n;++d)i=(i=r[d])&&i.destroy();r.length=0;var a=e._texturesToCreate;for(n=a.length,d=0;d<n;++d){var o=a[d],s=o.name,o=o.source;e._actualUniforms[s]=new Texture({context:t,source:o})}a.length=0;var l=e._dirtyUniforms;if(0!==l.length||defined(e._texturePromise)){if(0!==l.length&&!defined(e._texturePromise)){for(var n=l.length,c=e._uniforms,u=[],d=0;d<n;++d){var h,p=c[s=l[d]];defined(e._textureCache.getStageByName(p))?e._actualUniforms[s]=createStageOutputTextureFunction(e,p):"string"==typeof p?(h=new Resource({url:p}),u.push(h.fetchImage().then(createLoadImageFunction(e,s)))):e._texturesToCreate.push({name:s,source:p})}(l.length=0)<u.length?(e._ready=!1,e._texturePromise=when.all(u).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}}else e._ready=!0}function releaseResources$1(e){defined(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();var t=e._textureCache;if(defined(t)){var i,r=e._uniforms,n=e._actualUniforms;for(i in n)n.hasOwnProperty(i)&&n[i]instanceof Texture&&(defined(t.getStageByName(r[i]))||n[i].destroy(),e._dirtyUniforms.push(i))}}function isSelectedTextureDirty$1(e){var t=defined(e._selected)?e._selected.length:0,i=defined(e._parentSelected)?e._parentSelected:0,r=(r=e._selected!==e._selectedShadow||t!==e._selectedLength)||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength;if(defined(e._selected)&&defined(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):defined(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&defined(e._combinedSelected)){if(!defined(e._combinedSelectedShadow))return!0;for(var t=e._combinedSelected.length,n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}function createSelectedTexture(e,t){if(e._selectedDirty){e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;var i=e._combinedSelected;if(defined(i)){for(var r,n,a=0,o=i.length,s=0;s<o;++s)defined((r=i[s]).pickIds)?a+=r.pickIds.length:defined(r.pickId)&&++a;if(0===o||0===a){var l=new Uint8Array(4);return l[0]=255,l[1]=255,l[2]=255,l[3]=255,void(e._selectedIdTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:l,width:1,height:1},sampler:Sampler.NEAREST}))}var c=0,u=new Uint8Array(4*a);for(s=0;s<o;++s)if(defined((r=i[s]).pickIds))for(var d=r.pickIds,h=d.length,p=0;p<h;++p)n=d[p].color,u[c]=Color.floatToByte(n.red),u[c+1]=Color.floatToByte(n.green),u[c+2]=Color.floatToByte(n.blue),u[c+3]=Color.floatToByte(n.alpha),c+=4;else defined(r.pickId)&&(n=r.pickId.color,u[c]=Color.floatToByte(n.red),u[c+1]=Color.floatToByte(n.green),u[c+2]=Color.floatToByte(n.blue),u[c+3]=Color.floatToByte(n.alpha),c+=4);e._selectedIdTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:u,width:a,height:1},sampler:Sampler.NEAREST})}}}PostProcessStage.prototype._isSupported=function(e){return!depthTextureRegex.test(this._fragmentShader)||e.depthTexture},PostProcessStage.prototype.update=function(e,t){var i;this.enabled===this._enabled||this.enabled||releaseResources$1(this),this._enabled=this.enabled,this._enabled&&(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=isSelectedTextureDirty$1(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=defined(this._selected)?this._selected.length:0,this._parentSelectedLength=defined(this._parentSelected)?this._parentSelected.length:0,createSelectedTexture(this,e),createUniformMap(this),updateUniformTextures(this,e),createDrawCommand(this,e),createSampler(this),this._selectedDirty=!1,this._ready&&(t=this._textureCache.getFramebuffer(this._name),defined(this._command.framebuffer=t)&&((t=t.getColorTexture(0)).width===e.drawingBufferWidth&&t.height===e.drawingBufferHeight||defined(i=this._renderState)&&t.width===i.viewport.width&&t.height===i.viewport.height||(this._renderState=RenderState.fromCache({viewport:new BoundingRectangle(0,0,t.width,t.height)})),this._command.renderState=i)))},PostProcessStage.prototype.execute=function(e,t,i,r){defined(this._command)&&defined(this._command.framebuffer)&&this._ready&&this._enabled&&(this._colorTexture=t,this._depthTexture=i,this._idTexture=r,Sampler.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler),defined(r=0<this.scissorRectangle.width&&0<this.scissorRectangle.height?this._passState:void 0)&&(r.context=e),this._command.execute(e,r))},PostProcessStage.prototype.isDestroyed=function(){return!1},PostProcessStage.prototype.destroy=function(){return releaseResources$1(this),destroyObject(this)};var AcesTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\ncolor /= texture2D(autoExposure, vec2(0.5)).r;\n#endif\ncolor = czm_acesTonemapping(color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",AmbientOcclusionGenerate="uniform sampler2D randomTexture;\nuniform sampler2D depthTexture;\nuniform float intensity;\nuniform float bias;\nuniform float lengthCap;\nuniform float stepSize;\nuniform float frustumLength;\nvarying vec2 v_textureCoordinates;\nvec4 clipToEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\nposEC = posEC / posEC.w;\nreturn posEC;\n}\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\n{\nvec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\nvec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\nvec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\nvec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\nvec3 up = posInCamera.xyz - posInCameraUp.xyz;\nvec3 down = posInCameraDown.xyz - posInCamera.xyz;\nvec3 left = posInCamera.xyz - posInCameraLeft.xyz;\nvec3 right = posInCameraRight.xyz - posInCamera.xyz;\nvec3 DX = length(left) < length(right) ? left : right;\nvec3 DY = length(up) < length(down) ? up : down;\nreturn normalize(cross(DY, DX));\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = clipToEye(v_textureCoordinates, depth);\nif (posInCamera.z > frustumLength)\n{\ngl_FragColor = vec4(1.0);\nreturn;\n}\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\nfloat depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));\nfloat depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));\nfloat depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));\nfloat depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));\nvec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\nfloat ao = 0.0;\nvec2 sampleDirection = vec2(1.0, 0.0);\nfloat gapAngle = 90.0 * czm_radiansPerDegree;\nfloat randomVal = texture2D(randomTexture, v_textureCoordinates).x;\nfor (int i = 0; i < 4; i++)\n{\nfloat newGapAngle = gapAngle * (float(i) + randomVal);\nfloat cosVal = cos(newGapAngle);\nfloat sinVal = sin(newGapAngle);\nvec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\nfloat localAO = 0.0;\nfloat localStepSize = stepSize;\nfor (int j = 0; j < 6; j++)\n{\nvec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;\nif(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\n{\nbreak;\n}\nfloat stepDepthInfo = czm_readDepth(depthTexture, newCoords);\nvec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\nvec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\nfloat len = length(diffVec);\nif (len > lengthCap)\n{\nbreak;\n}\nfloat dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\nfloat weight = len / lengthCap;\nweight = 1.0 - weight * weight;\nif (dotVal < bias)\n{\ndotVal = 0.0;\n}\nlocalAO = max(localAO, dotVal * weight);\nlocalStepSize += stepSize;\n}\nao += localAO;\n}\nao /= 4.0;\nao = 1.0 - clamp(ao, 0.0, 1.0);\nao = pow(ao, intensity);\ngl_FragColor = vec4(vec3(ao), 1.0);\n}\n",AmbientOcclusionModulate="uniform sampler2D colorTexture;\nuniform sampler2D ambientOcclusionTexture;\nuniform bool ambientOcclusionOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 ao = texture2D(ambientOcclusionTexture, v_textureCoordinates).rgb;\ngl_FragColor.rgb = ambientOcclusionOnly ? ao : ao * color;\n}\n",BlackAndWhite="uniform sampler2D colorTexture;\nuniform float gradations;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = vec4(rgb, 1.0);\nreturn;\n}\n#endif\nfloat luminance = czm_luminance(rgb);\nfloat darkness = luminance * gradations;\ndarkness = (darkness - fract(darkness)) / gradations;\ngl_FragColor = vec4(vec3(darkness), 1.0);\n}\n",BloomComposite="uniform sampler2D colorTexture;\nuniform sampler2D bloomTexture;\nuniform bool glowOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = color;\nreturn;\n}\n#endif\nvec4 bloom = texture2D(bloomTexture, v_textureCoordinates);\ngl_FragColor = glowOnly ? bloom : bloom + color;\n}\n",Brightness="uniform sampler2D colorTexture;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 target = vec3(0.0);\ngl_FragColor = vec4(mix(target, rgb, brightness), 1.0);\n}\n",ContrastBias="uniform sampler2D colorTexture;\nuniform float contrast;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;\nsceneColor = czm_RGBToHSB(sceneColor);\nsceneColor.z += brightness;\nsceneColor = czm_HSBToRGB(sceneColor);\nfloat factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\nsceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\ngl_FragColor = vec4(sceneColor, 1.0);\n}\n",DepthOfField="uniform sampler2D colorTexture;\nuniform sampler2D blurTexture;\nuniform sampler2D depthTexture;\nuniform float focalDistance;\nvarying vec2 v_textureCoordinates;\nvec4 toEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\nposInCamera = posInCamera / posInCamera.w;\nreturn posInCamera;\n}\nfloat computeDepthBlur(float depth)\n{\nfloat f;\nif (depth < focalDistance)\n{\nf = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\n}\nelse\n{\nf = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\nf = pow(f, 0.1);\n}\nf *= f;\nf = clamp(f, 0.0, 1.0);\nreturn pow(f, 0.5);\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = toEye(v_textureCoordinates, depth);\nfloat d = computeDepthBlur(-posInCamera.z);\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), texture2D(blurTexture, v_textureCoordinates), d);\n}\n",DepthView="uniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\ngl_FragColor = vec4(vec3(depth), 1.0);\n}\n",EdgeDetection="uniform sampler2D depthTexture;\nuniform float length;\nuniform vec4 color;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat directions[3];\ndirections[0] = -1.0;\ndirections[1] = 0.0;\ndirections[2] = 1.0;\nfloat scalars[3];\nscalars[0] = 3.0;\nscalars[1] = 10.0;\nscalars[2] = 3.0;\nfloat padx = czm_pixelRatio / czm_viewport.z;\nfloat pady = czm_pixelRatio / czm_viewport.w;\n#ifdef CZM_SELECTED_FEATURE\nbool selected = false;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nselected = selected || czm_selected(vec2(-padx, dir * pady));\nselected = selected || czm_selected(vec2(padx, dir * pady));\nselected = selected || czm_selected(vec2(dir * padx, -pady));\nselected = selected || czm_selected(vec2(dir * padx, pady));\nif (selected)\n{\nbreak;\n}\n}\nif (!selected)\n{\ngl_FragColor = vec4(color.rgb, 0.0);\nreturn;\n}\n#endif\nfloat horizEdge = 0.0;\nfloat vertEdge = 0.0;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nfloat scale = scalars[i];\nhorizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\nhorizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\nvertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\nvertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n}\nfloat len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\ngl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n}\n",FilmicTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\nconst float A = 0.22;\nconst float B = 0.30;\nconst float C = 0.10;\nconst float D = 0.20;\nconst float E = 0.01;\nconst float F = 0.30;\nconst float white = 11.2;\nvec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\nfloat w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\nc = czm_inverseGamma(c / w);\ngl_FragColor = vec4(c, fragmentColor.a);\n}\n",FXAA="varying vec2 v_textureCoordinates;\nuniform sampler2D colorTexture;\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\nvoid main()\n{\nvec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;\nvec4 color = FxaaPixelShader(\nv_textureCoordinates,\ncolorTexture,\nfxaaQualityRcpFrame,\nfxaaQualitySubpix,\nfxaaQualityEdgeThreshold,\nfxaaQualityEdgeThresholdMin);\nfloat alpha = texture2D(colorTexture, v_textureCoordinates).a;\ngl_FragColor = vec4(color.rgb, alpha);\n}\n",GaussianBlur1D="#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D colorTexture;\n#ifdef USE_STEP_SIZE\nuniform float stepSize;\n#else\nuniform vec2 step;\n#endif\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\n#ifdef USE_STEP_SIZE\nvec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));\n#else\nvec2 step = step;\n#endif\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(colorTexture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * step;\nresult += texture2D(colorTexture, st - offset) * g.x;\nresult += texture2D(colorTexture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n",LensFlare="uniform sampler2D colorTexture;\nuniform sampler2D dirtTexture;\nuniform sampler2D starTexture;\nuniform vec2 dirtTextureDimensions;\nuniform float distortion;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform float dirtAmount;\nuniform float earthRadius;\nuniform float intensity;\nvarying vec2 v_textureCoordinates;\n#define DISTANCE_TO_SPACE 6500000.0\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\n{\nvec4 positionEC = czm_view * vec4(WC, 1.0);\npositionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nreturn czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n}\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\n{\nvec2 NDC = texcoord * 2.0 - 1.0;\nvec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\nvec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\nNDC.xy -= earthPosSC.xy;\nfloat X = abs(NDC.x) * sceneSize.x;\nfloat Y = abs(NDC.y) * sceneSize.y;\nreturn clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\n}\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\n{\nvec2 sceneSize = czm_viewport.zw;\nvec3 color;\nif(isSpace)\n{\ncolor.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture2D(tex, texcoord + direction * distortion.b).b;\n}\nelse\n{\ncolor.r = texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = texture2D(tex, texcoord + direction * distortion.b).b;\n}\nreturn vec4(clamp(color, 0.0, 1.0), 0.0);\n}\nvoid main(void)\n{\nvec4 originalColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 rgb = originalColor.rgb;\nbool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\nvec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\nvec4 sunPositionEC = czm_view * sunPos;\nvec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\nsunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\nif(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\n{\ngl_FragColor = originalColor;\nreturn;\n}\nvec2 texcoord = vec2(1.0) - v_textureCoordinates;\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\nvec2 invPixelSize = 1.0 / pixelSize;\nvec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);\nvec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\nvec3 direction = normalize(vec3(ghostVec, 0.0));\nvec4 result = vec4(0.0);\nvec4 ghost = vec4(0.0);\nfor (int i = 0; i < 4; ++i)\n{\nvec2 offset = fract(texcoord + ghostVec * float(i));\nghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\n}\nresult += ghost;\nvec2 haloVec = normalize(ghostVec) * haloWidth;\nfloat weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\nweightForHalo = pow(1.0 - weightForHalo, 5.0);\nresult += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\nvec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;\nif (dirtTexCoords.x > 1.0)\n{\ndirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);\n}\nif (dirtTexCoords.y > 1.0)\n{\ndirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);\n}\nresult += dirtAmount * texture2D(dirtTexture, dirtTexCoords);\nfloat camrot = czm_view[0].z + czm_view[1].y;\nfloat cosValue = cos(camrot);\nfloat sinValue = sin(camrot);\nmat3 rotation = mat3(\ncosValue, -sinValue, 0.0,\nsinValue, cosValue, 0.0,\n0.0, 0.0, 1.0\n);\nvec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\nvec3 st2 = vec3((rotation * st1).xy, 1.0);\nvec3 st3 = st2 * 0.5 + vec3(0.5);\nvec2 lensStarTexcoord = st3.xy;\nfloat weightForLensFlare = length(vec3(sunPos.xy, 0.0));\nfloat oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\nif (!isSpace)\n{\nresult *= oneMinusWeightForLensFlare * intensity * 0.2;\n}\nelse\n{\nresult *= oneMinusWeightForLensFlare * intensity;\nresult *= texture2D(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\n}\nresult += texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = result;\n}\n",ModifiedReinhardTonemapping="uniform sampler2D colorTexture;\nuniform vec3 white;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = (color * (1.0 + color / white)) / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",NightVision="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat rand(vec2 co)\n{\nreturn fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\nvoid main(void)\n{\nfloat noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 green = vec3(0.0, 1.0, 0.0);\ngl_FragColor = vec4((noiseValue + rgb) * green, 1.0);\n}\n",ReinhardTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = color / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",Silhouette="uniform sampler2D colorTexture;\nuniform sampler2D silhouetteTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\n}\n",FXAA3_11="#if (FXAA_QUALITY_PRESET == 10)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 3.0\n#define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 3.0\n#define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 4.0\n#define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 4.0\n#define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 4.0\n#define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 2.0\n#define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 3.0\n#define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n#define FXAA_QUALITY_PS 9\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 4.0\n#define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n#define FXAA_QUALITY_PS 10\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 4.0\n#define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n#define FXAA_QUALITY_PS 11\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 4.0\n#define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.0\n#define FXAA_QUALITY_P2 1.0\n#define FXAA_QUALITY_P3 1.0\n#define FXAA_QUALITY_P4 1.0\n#define FXAA_QUALITY_P5 1.5\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\nFxaaFloat4 FxaaPixelShader(\nFxaaFloat2 pos,\nFxaaTex tex,\nFxaaFloat2 fxaaQualityRcpFrame,\nFxaaFloat fxaaQualitySubpix,\nFxaaFloat fxaaQualityEdgeThreshold,\nFxaaFloat fxaaQualityEdgeThresholdMin\n) {\nFxaaFloat2 posM;\nposM.x = pos.x;\nposM.y = pos.y;\nFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n#define lumaM rgbyM.y\nFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat maxSM = max(lumaS, lumaM);\nFxaaFloat minSM = min(lumaS, lumaM);\nFxaaFloat maxESM = max(lumaE, maxSM);\nFxaaFloat minESM = min(lumaE, minSM);\nFxaaFloat maxWN = max(lumaN, lumaW);\nFxaaFloat minWN = min(lumaN, lumaW);\nFxaaFloat rangeMax = max(maxWN, maxESM);\nFxaaFloat rangeMin = min(minWN, minESM);\nFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\nFxaaFloat range = rangeMax - rangeMin;\nFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\nFxaaBool earlyExit = range < rangeMaxClamped;\nif(earlyExit)\nreturn rgbyM;\nFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNS = lumaN + lumaS;\nFxaaFloat lumaWE = lumaW + lumaE;\nFxaaFloat subpixRcpRange = 1.0/range;\nFxaaFloat subpixNSWE = lumaNS + lumaWE;\nFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\nFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\nFxaaFloat lumaNESE = lumaNE + lumaSE;\nFxaaFloat lumaNWNE = lumaNW + lumaNE;\nFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\nFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\nFxaaFloat lumaNWSW = lumaNW + lumaSW;\nFxaaFloat lumaSWSE = lumaSW + lumaSE;\nFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\nFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\nFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\nFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\nFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\nFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\nFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\nFxaaFloat lengthSign = fxaaQualityRcpFrame.x;\nFxaaBool horzSpan = edgeHorz >= edgeVert;\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\nif(!horzSpan) lumaN = lumaW;\nif(!horzSpan) lumaS = lumaE;\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\nFxaaFloat gradientN = lumaN - lumaM;\nFxaaFloat gradientS = lumaS - lumaM;\nFxaaFloat lumaNN = lumaN + lumaM;\nFxaaFloat lumaSS = lumaS + lumaM;\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\nif(pairN) lengthSign = -lengthSign;\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\nFxaaFloat2 posB;\nposB.x = posM.x;\nposB.y = posM.y;\nFxaaFloat2 offNP;\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\nif(!horzSpan) posB.x += lengthSign * 0.5;\nif( horzSpan) posB.y += lengthSign * 0.5;\nFxaaFloat2 posN;\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\nFxaaFloat2 posP;\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\nFxaaFloat subpixE = subpixC * subpixC;\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\nif(!pairN) lumaNN = lumaSS;\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\nFxaaFloat subpixF = subpixD * subpixE;\nFxaaBool lumaMLTZero = lumaMM < 0.0;\nlumaEndN -= lumaNN * 0.5;\nlumaEndP -= lumaNN * 0.5;\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\nFxaaBool doneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n#if (FXAA_QUALITY_PS > 3)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n#if (FXAA_QUALITY_PS > 4)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n#if (FXAA_QUALITY_PS > 5)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n#if (FXAA_QUALITY_PS > 6)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n#if (FXAA_QUALITY_PS > 7)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n#if (FXAA_QUALITY_PS > 8)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n#if (FXAA_QUALITY_PS > 9)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n#if (FXAA_QUALITY_PS > 10)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n#if (FXAA_QUALITY_PS > 11)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n#if (FXAA_QUALITY_PS > 12)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\nFxaaFloat dstN = posM.x - posN.x;\nFxaaFloat dstP = posP.x - posM.x;\nif(!horzSpan) dstN = posM.y - posN.y;\nif(!horzSpan) dstP = posP.y - posM.y;\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\nFxaaFloat spanLength = (dstP + dstN);\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\nFxaaFloat spanLengthRcp = 1.0/spanLength;\nFxaaBool directionN = dstN < dstP;\nFxaaFloat dst = min(dstN, dstP);\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\nFxaaFloat subpixG = subpixF * subpixF;\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n";function PostProcessStageComposite(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=defaultValue(e.inputPreviousStageTexture,!0);var t=e.name;defined(t)||(t=createGuid()),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}function isSelectedTextureDirty(e){var t=defined(e._selected)?e._selected.length:0,i=defined(e._parentSelected)?e._parentSelected:0,r=(r=e._selected!==e._selectedShadow||t!==e._selectedLength)||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength;if(defined(e._selected)&&defined(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):defined(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&defined(e._combinedSelected)){if(!defined(e._combinedSelectedShadow))return!0;for(var t=e._combinedSelected.length,n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}Object.defineProperties(PostProcessStageComposite.prototype,{ready:{get:function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)if(!e[i].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)t[r].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}}}),PostProcessStageComposite.prototype._isSupported=function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)if(!t[r]._isSupported(e))return!1;return!0},PostProcessStageComposite.prototype.get=function(e){return this._stages[e]},PostProcessStageComposite.prototype.update=function(e,t){this._selectedDirty=isSelectedTextureDirty(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=defined(this._selected)?this._selected.length:0,this._parentSelectedLength=defined(this._parentSelected)?this._parentSelected.length:0;for(var i=this._stages,r=i.length,n=0;n<r;++n){var a=i[n];this._selectedDirty&&(a.parentSelected=this._combinedSelected),a.update(e,t)}},PostProcessStageComposite.prototype.isDestroyed=function(){return!1},PostProcessStageComposite.prototype.destroy=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)};var PostProcessStageLibrary={};function createBlur(e){var t="#define USE_STEP_SIZE\n"+GaussianBlur1D,r=new PostProcessStage({name:e+"_x_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:PostProcessStageSampleMode.LINEAR}),n=new PostProcessStage({name:e+"_y_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:PostProcessStageSampleMode.LINEAR}),t={};return Object.defineProperties(t,{delta:{get:function(){return r.uniforms.delta},set:function(e){var t=r.uniforms,i=n.uniforms;t.delta=i.delta=e}},sigma:{get:function(){return r.uniforms.sigma},set:function(e){var t=r.uniforms,i=n.uniforms;t.sigma=i.sigma=e}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(e){var t=r.uniforms,i=n.uniforms;t.stepSize=i.stepSize=e}}}),new PostProcessStageComposite({name:e,stages:[r,n],uniforms:t})}function getSilhouetteEdgeDetection(e){if(!defined(e))return PostProcessStageLibrary.createEdgeDetectionStage();for(var t=new PostProcessStageComposite({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),i={},r="",n="",a=0;a<e.length;++a)r+="uniform sampler2D edgeTexture"+a+"; \n",n+=" vec4 edge"+a+" = texture2D(edgeTexture"+a+", v_textureCoordinates); \n if (edge"+a+".a > 0.0) \n { \n color = edge"+a+"; \n break; \n } \n",i["edgeTexture"+a]=e[a].name;return new PostProcessStageComposite({name:"czm_edge_detection_composite",stages:[t,new PostProcessStage({name:"czm_edge_detection_combine",fragmentShader:r+"varying vec2 v_textureCoordinates; \nvoid main() { \n vec4 color = vec4(0.0); \n for (int i = 0; i < "+e.length+"; i++) \n { \n"+n+" } \n gl_FragColor = color; \n} \n",uniforms:i})]})}PostProcessStageLibrary.createBlurStage=function(){return createBlur("czm_blur")},PostProcessStageLibrary.createDepthOfFieldStage=function(){var t=createBlur("czm_depth_of_field_blur"),i=new PostProcessStage({name:"czm_depth_of_field_composite",fragmentShader:DepthOfField,uniforms:{focalDistance:5,blurTexture:t.name}}),e={};return Object.defineProperties(e,{focalDistance:{get:function(){return i.uniforms.focalDistance},set:function(e){i.uniforms.focalDistance=e}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}}}),new PostProcessStageComposite({name:"czm_depth_of_field",stages:[t,i],inputPreviousStageTexture:!1,uniforms:e})},PostProcessStageLibrary.isDepthOfFieldSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createEdgeDetectionStage=function(){return new PostProcessStage({name:"czm_edge_detection_"+createGuid(),fragmentShader:EdgeDetection,uniforms:{length:.25,color:Color.clone(Color.BLACK)}})},PostProcessStageLibrary.isEdgeDetectionSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createSilhouetteStage=function(e){e=getSilhouetteEdgeDetection(e);return new PostProcessStageComposite({name:"czm_silhouette",stages:[e,new PostProcessStage({name:"czm_silhouette_color_edges",fragmentShader:Silhouette,uniforms:{silhouetteTexture:e.name}})],inputPreviousStageTexture:!1,uniforms:e.uniforms})},PostProcessStageLibrary.isSilhouetteSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createBloomStage=function(){var t=new PostProcessStage({name:"czm_bloom_contrast_bias",fragmentShader:ContrastBias,uniforms:{contrast:128,brightness:-.3}}),i=createBlur("czm_bloom_blur"),e=new PostProcessStageComposite({name:"czm_bloom_contrast_bias_blur",stages:[t,i]}),r=new PostProcessStage({name:"czm_bloom_generate_composite",fragmentShader:BloomComposite,uniforms:{glowOnly:!1,bloomTexture:e.name}}),n={};return Object.defineProperties(n,{glowOnly:{get:function(){return r.uniforms.glowOnly},set:function(e){r.uniforms.glowOnly=e}},contrast:{get:function(){return t.uniforms.contrast},set:function(e){t.uniforms.contrast=e}},brightness:{get:function(){return t.uniforms.brightness},set:function(e){t.uniforms.brightness=e}},delta:{get:function(){return i.uniforms.delta},set:function(e){i.uniforms.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){i.uniforms.sigma=e}},stepSize:{get:function(){return i.uniforms.stepSize},set:function(e){i.uniforms.stepSize=e}}}),new PostProcessStageComposite({name:"czm_bloom",stages:[e,r],inputPreviousStageTexture:!1,uniforms:n})},PostProcessStageLibrary.createAmbientOcclusionStage=function(){var t=new PostProcessStage({name:"czm_ambient_occlusion_generate",fragmentShader:AmbientOcclusionGenerate,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),i=createBlur("czm_ambient_occlusion_blur");i.uniforms.stepSize=.86;var e=new PostProcessStageComposite({name:"czm_ambient_occlusion_generate_blur",stages:[t,i]}),r=new PostProcessStage({name:"czm_ambient_occlusion_composite",fragmentShader:AmbientOcclusionModulate,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return t.uniforms.intensity},set:function(e){t.uniforms.intensity=e}},bias:{get:function(){return t.uniforms.bias},set:function(e){t.uniforms.bias=e}},lengthCap:{get:function(){return t.uniforms.lengthCap},set:function(e){t.uniforms.lengthCap=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}},frustumLength:{get:function(){return t.uniforms.frustumLength},set:function(e){t.uniforms.frustumLength=e}},randomTexture:{get:function(){return t.uniforms.randomTexture},set:function(e){t.uniforms.randomTexture=e}},delta:{get:function(){return i.uniforms.delta},set:function(e){i.uniforms.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){i.uniforms.sigma=e}},blurStepSize:{get:function(){return i.uniforms.stepSize},set:function(e){i.uniforms.stepSize=e}},ambientOcclusionOnly:{get:function(){return r.uniforms.ambientOcclusionOnly},set:function(e){r.uniforms.ambientOcclusionOnly=e}}}),new PostProcessStageComposite({name:"czm_ambient_occlusion",stages:[e,r],inputPreviousStageTexture:!1,uniforms:n})},PostProcessStageLibrary.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var fxaaFS="#define FXAA_QUALITY_PRESET 39 \n"+FXAA3_11+"\n"+FXAA;function PostProcessStageTextureCache(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function getLastStageName(e){for(;defined(e.length);)e=e.get(e.length-1);return e.name}function getStageDependencies(e,t,i,r,n){if(!r.enabled||!r._isSupported(t))return n;var a=i[r.name]={};defined(n)&&(a[getLastStageName(e.getStageByName(n))]=!0);var o=r.uniforms;if(defined(o))for(var s=Object.getOwnPropertyNames(o),l=s.length,c=0;c<l;++c){var u=o[s[c]];"string"!=typeof u||defined(u=e.getStageByName(u))&&(a[getLastStageName(u)]=!0)}return r.name}function getCompositeDependencies(e,t,i,r,n){if(defined(r.enabled)&&!r.enabled||defined(r._isSupported)&&!r._isSupported(t))return n;for(var a,o=n,s=!defined(r.inputPreviousStageTexture)||r.inputPreviousStageTexture,l=n,c=r.length,u=0;u<c;++u){var d=r.get(u),l=(defined(d.length)?getCompositeDependencies:getStageDependencies)(e,t,i,d,n);s&&(n=l)}if(s)for(a=1;a<c;++a)defined(i[h=getLastStageName(r.get(a))])||(i[h]={}),i[h][o]=!0;else for(a=1;a<c;++a)for(var h,p=i[h=getLastStageName(r.get(a))],m=0;m<a;++m)p[getLastStageName(r.get(m))]=!0;return l}function getDependencies(e,t){var i,r,n,a,o={};return defined(e.ambientOcclusion)?(a=e.ambientOcclusion,i=e.bloom,r=e._tonemapping,n=e.fxaa,a=getCompositeDependencies(e,t,o,a,void 0),a=getStageDependencies(e,t,o,r,a=getCompositeDependencies(e,t,o,i,a)),getStageDependencies(e,t,o,n,a=getCompositeDependencies(e,t,o,e,a))):getCompositeDependencies(e,t,o,e,void 0),o}function getFramebuffer(e,t,i){for(var r,n=e._collection.getStageByName(t),a=n._textureScale,o=n._forcePowerOfTwo,s=n._pixelFormat,l=n._pixelDatatype,c=n._clearColor,u=e._framebuffers,d=u.length,h=0;h<d;++h)if(a===(r=u[h]).textureScale&&o===r.forcePowerOfTwo&&s===r.pixelFormat&&l===r.pixelDatatype&&Color.equals(c,r.clearColor)){for(var p=r.stages,m=p.length,f=!1,g=0;g<m;++g)if(i[p[g]]){f=!0;break}if(!f)break}return defined(r)&&h<d?r.stages.push(t):(r={textureScale:a,forcePowerOfTwo:o,pixelFormat:s,pixelDatatype:l,clearColor:c,stages:[t],buffer:void 0,clear:void 0},u.push(r)),r}function createFramebuffers(e,t){var i,r=getDependencies(e._collection,t);for(i in r)r.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=getFramebuffer(e,i,r[i]))}function releaseResources(e){for(var t=e._framebuffers,i=t.length,r=0;r<i;++r){var n=t[r];n.buffer=n.buffer&&n.buffer.destroy(),n.buffer=void 0}}function updateFramebuffers(e,t){for(var i=e._width,r=e._height,n=e._framebuffers,a=n.length,o=0;o<a;++o){var s=n[o],l=s.textureScale,c=Math.ceil(i*l),u=Math.ceil(r*l),l=Math.min(c,u);s.forcePowerOfTwo&&(u=c=l=!CesiumMath.isPowerOfTwo(l)?CesiumMath.nextPowerOfTwo(l):l),s.buffer=new Framebuffer({context:t,colorTextures:[new Texture({context:t,width:c,height:u,pixelFormat:s.pixelFormat,pixelDatatype:s.pixelDatatype})]}),s.clear=new ClearCommand({color:s.clearColor,framebuffer:s.buffer})}}PostProcessStageLibrary.createFXAAStage=function(){return new PostProcessStage({name:"czm_FXAA",fragmentShader:fxaaFS,sampleMode:PostProcessStageSampleMode.LINEAR})},PostProcessStageLibrary.createAcesTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_aces",fragmentShader:e+=AcesTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createFilmicTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_filmic",fragmentShader:e+=FilmicTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createReinhardTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_reinhard",fragmentShader:e+=ReinhardTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createModifiedReinhardTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_modified_reinhard",fragmentShader:e+=ModifiedReinhardTonemapping,uniforms:{white:Color.WHITE,autoExposure:void 0}})},PostProcessStageLibrary.createAutoExposureStage=function(){return new AutoExposure},PostProcessStageLibrary.createBlackAndWhiteStage=function(){return new PostProcessStage({name:"czm_black_and_white",fragmentShader:BlackAndWhite,uniforms:{gradations:5}})},PostProcessStageLibrary.createBrightnessStage=function(){return new PostProcessStage({name:"czm_brightness",fragmentShader:Brightness,uniforms:{brightness:.5}})},PostProcessStageLibrary.createNightVisionStage=function(){return new PostProcessStage({name:"czm_night_vision",fragmentShader:NightVision})},PostProcessStageLibrary.createDepthViewStage=function(){return new PostProcessStage({name:"czm_depth_view",fragmentShader:DepthView})},PostProcessStageLibrary.createLensFlareStage=function(){return new PostProcessStage({name:"czm_lens_flare",fragmentShader:LensFlare,uniforms:{dirtTexture:buildModuleUrl("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:buildModuleUrl("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:Ellipsoid.WGS84.maximumRadius}})},PostProcessStageTextureCache.prototype.updateDependencies=function(){this._updateDependencies=!0},PostProcessStageTextureCache.prototype.update=function(e){var t=this._collection,i=this._updateDependencies,r=defined(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),n=defined(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),a=defined(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),o=defined(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),n=!defined(t._activeStages)||0<t._activeStages.length||r||n||a||o;(i||!n&&0<this._framebuffers.length)&&(releaseResources(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),(i||n)&&(0===this._framebuffers.length&&createFramebuffers(this,e),a=e.drawingBufferWidth,o=e.drawingBufferHeight,n=this._width!==a||this._height!==o,(i||n)&&(this._width=a,this._height=o,this._updateDependencies=!1,releaseResources(this),updateFramebuffers(this,e)))},PostProcessStageTextureCache.prototype.clear=function(e){for(var t=this._framebuffers,i=0;i<t.length;++i)t[i].clear.execute(e)},PostProcessStageTextureCache.prototype.getStageByName=function(e){return this._collection.getStageByName(e)},PostProcessStageTextureCache.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)},PostProcessStageTextureCache.prototype.getFramebuffer=function(e){e=this._stageNameToFramebuffer[e];if(defined(e))return e.buffer},PostProcessStageTextureCache.prototype.isDestroyed=function(){return!1},PostProcessStageTextureCache.prototype.destroy=function(){return releaseResources(this),destroyObject(this)};var Tonemapper={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===Tonemapper.REINHARD||e===Tonemapper.MODIFIED_REINHARD||e===Tonemapper.FILMIC||e===Tonemapper.ACES}},Tonemapper$1=Object.freeze(Tonemapper),stackScratch=[];function PostProcessStageCollection(){var e=PostProcessStageLibrary.createFXAAStage(),t=PostProcessStageLibrary.createAmbientOcclusionStage(),i=PostProcessStageLibrary.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=PostProcessStageLibrary.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Tonemapper$1.ACES;var r=this._tonemapping;e.enabled=!1,t.enabled=!1,i.enabled=!1,r.enabled=!1;var n=new PostProcessStageTextureCache(this),a={},o=stackScratch;for(o.push(e,t,i,r);0<o.length;){var s=o.pop();(a[s.name]=s)._textureCache=n;var l=s.length;if(defined(l))for(var c=0;c<l;++c)o.push(s.get(c))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;var u=this;t.uniforms.randomTexture=function(){return u._randomTexture},this._ao=t,this._bloom=i,this._fxaa=e,this._lastLength=void 0,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=a,this._textureCache=n}function removeStages(e){if(e._stagesRemoved){e._stagesRemoved=!1;for(var t=[],i=e._stages,r=i.length,n=0,a=0;n<r;++n){var o=i[n];o&&(o._index=a++,t.push(o))}e._stages=t}}function getOutputTexture(e){for(;defined(e.length);)e=e.get(e.length-1);return e.outputTexture}function execute(e,t,i,r,n){if(defined(e.execute))e.execute(t,i,r,n);else{var a,o=e.length;if(e.inputPreviousStageTexture)for(execute(e.get(0),t,i,r,n),a=1;a<o;++a)execute(e.get(a),t,getOutputTexture(e.get(a-1)),r,n);else for(a=0;a<o;++a)execute(e.get(a),t,i,r,n)}}function QuadtreeTileProvider(){DeveloperError.throwInstantiationError()}function SceneTransitioner(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Object.defineProperties(PostProcessStageCollection.prototype,{ready:{get:function(){for(var e=!1,t=this._stages,i=t.length-1;0<=i;--i)var r=t[i],e=e||r.ready&&r.enabled;var n=this._fxaa,a=this._ao,o=this._bloom,s=this._tonemapping;return e=(e=(e=(e=e||n.ready&&n.enabled)||a.ready&&a.enabled)||o.ready&&o.enabled)||s.ready&&s.enabled}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return removeStages(this),this._stages.length}},outputTexture:{get:function(){var e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);for(var t=this._stages,i=t.length-1;0<=i;--i){var r=t[i];if(defined(r)&&r.ready&&r.enabled)return this.getOutputTexture(r.name)}e=this._tonemapping;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);e=this._bloom;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);e=this._ao;return e.enabled&&e.ready?this.getOutputTexture(e.name):void 0}},hasSelected:{get:function(){for(var e=arraySlice(this._stages);0<e.length;){var t=e.pop();if(defined(t)){if(defined(t.selected))return!0;var i=t.length;if(defined(i))for(var r=0;r<i;++r)e.push(t.get(r))}}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper!==e){defined(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());var t,i,r=this._autoExposureEnabled;switch(e){case Tonemapper$1.REINHARD:t=PostProcessStageLibrary.createReinhardTonemappingStage(r);break;case Tonemapper$1.MODIFIED_REINHARD:t=PostProcessStageLibrary.createModifiedReinhardTonemappingStage(r);break;case Tonemapper$1.FILMIC:t=PostProcessStageLibrary.createFilmicTonemappingStage(r);break;default:t=PostProcessStageLibrary.createAcesTonemappingStage(r)}r&&(i=this._autoExposure,t.uniforms.autoExposure=function(){return i.outputTexture}),this._tonemapper=e,this._tonemapping=t,defined(this._stageNames)&&((this._stageNames[t.name]=t)._textureCache=this._textureCache),this._textureCacheDirty=!0}}}}),PostProcessStageCollection.prototype.add=function(e){var t=this._stageNames,i=stackScratch;for(i.push(e);0<i.length;){var r=i.pop();(t[r.name]=r)._textureCache=this._textureCache;var n=r.length;if(defined(n))for(var a=0;a<n;++a)i.push(r.get(a))}var o=this._stages;return e._index=o.length,o.push(e),this._textureCacheDirty=!0,e},PostProcessStageCollection.prototype.remove=function(e){if(!this.contains(e))return!1;var t=this._stageNames,i=stackScratch;for(i.push(e);0<i.length;){var r=i.pop();delete t[r.name];var n=r.length;if(defined(n))for(var a=0;a<n;++a)i.push(r.get(a))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0},PostProcessStageCollection.prototype.contains=function(e){return defined(e)&&defined(e._index)&&e._textureCache===this._textureCache},PostProcessStageCollection.prototype.get=function(e){return removeStages(this),this._stages[e]},PostProcessStageCollection.prototype.removeAll=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)this.remove(e[i]);e.length=0},PostProcessStageCollection.prototype.getStageByName=function(e){return this._stageNames[e]},PostProcessStageCollection.prototype.update=function(e,t,i){removeStages(this);var r=this._activeStages,n=this._activeStages=this._previousActiveStages;this._previousActiveStages=r;var a,o=this._stages,s=n.length=o.length,l=0;for(C=0;C<s;++C)(a=o[C]).ready&&a.enabled&&a._isSupported(e)&&(n[l++]=a);var c=(n.length=l)!==r.length;if(!c)for(C=0;C<l;++C)if(n[C]!==r[C]){c=!0;break}var u=this._ao,d=this._bloom,h=this._autoExposure,p=this._tonemapping,m=this._fxaa;p.enabled=i;var f=u.enabled&&u._isSupported(e),g=d.enabled&&d._isSupported(e),_=p.enabled&&p._isSupported(e),i=m.enabled&&m._isSupported(e);if((c||this._textureCacheDirty||l!==this._lastLength||f!==this._aoEnabled||g!==this._bloomEnabled||_!==this._tonemappingEnabled||i!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._lastLength=l,this._aoEnabled=f,this._bloomEnabled=g,this._tonemappingEnabled=_,this._fxaaEnabled=i,this._textureCacheDirty=!1),defined(this._randomTexture)&&!f&&(this._randomTexture.destroy(),this._randomTexture=void 0),!defined(this._randomTexture)&&f){for(var s=196608,y=new Uint8Array(s),C=0;C<s;C+=3)y[C]=Math.floor(255*Math.random());this._randomTexture=new Texture({context:e,pixelFormat:PixelFormat$1.RGB,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:y,width:256,height:256},sampler:new Sampler({wrapS:TextureWrap$1.REPEAT,wrapT:TextureWrap$1.REPEAT,minificationFilter:TextureMinificationFilter$1.NEAREST,magnificationFilter:TextureMagnificationFilter$1.NEAREST})})}for(this._textureCache.update(e),m.update(e,t),u.update(e,t),d.update(e,t),p.update(e,t),this._autoExposureEnabled&&h.update(e,t),s=o.length,C=0;C<s;++C)o[C].update(e,t)},PostProcessStageCollection.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)},PostProcessStageCollection.prototype.getOutputTexture=function(e){e=this.getStageByName(e);if(defined(e))return getOutputTexture(e)},PostProcessStageCollection.prototype.execute=function(e,t,i,r){var n=this._activeStages,a=n.length,o=this._fxaa,s=this._ao,l=this._bloom,c=this._autoExposure,u=this._tonemapping,d=s.enabled&&s._isSupported(e),h=l.enabled&&l._isSupported(e),p=this._autoExposureEnabled,m=u.enabled&&u._isSupported(e),f=o.enabled&&o._isSupported(e);if(f||d||h||m||0!==a){t=t;d&&s.ready&&(execute(s,e,t,i,r),t=getOutputTexture(s)),h&&l.ready&&(execute(l,e,t,i,r),t=getOutputTexture(l)),p&&c.ready&&execute(c,e,t,i,r),m&&u.ready&&(execute(u,e,t,i,r),t=getOutputTexture(u));u=t;if(0<a){execute(n[0],e,t,i,r);for(var g=1;g<a;++g)execute(n[g],e,getOutputTexture(n[g-1]),i,r);u=getOutputTexture(n[a-1])}f&&o.ready&&execute(o,e,u,i,r)}},PostProcessStageCollection.prototype.copy=function(e,t){var i;defined(this._copyColorCommand)||((i=this)._copyColorCommand=e.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return i.outputTexture}},owner:this})),this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},PostProcessStageCollection.prototype.isDestroyed=function(){return!1},PostProcessStageCollection.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(),destroyObject(this)},QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},Object.defineProperties(QuadtreeTileProvider.prototype,{quadtree:{get:DeveloperError.throwInstantiationError,set:DeveloperError.throwInstantiationError},ready:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError}}),QuadtreeTileProvider.prototype.update=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.beginUpdate=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.endUpdate=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.getLevelMaximumGeometricError=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.loadTile=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.computeTileVisibility=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.showTileThisFrame=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.computeDistanceToTile=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.isDestroyed=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.destroy=DeveloperError.throwInstantiationError,SceneTransitioner.prototype.completeMorph=function(){defined(this._completeMorph)&&this._completeMorph()},SceneTransitioner.prototype.morphTo2D=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._morphToOrthographic=i.camera.frustum instanceof OrthographicFrustum,this._previousMode!==SceneMode$1.SCENE2D&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.SCENE2D,!0),i._mode=SceneMode$1.MORPHING,i.camera._setTransform(Matrix4.IDENTITY),this._previousMode===SceneMode$1.COLUMBUS_VIEW?morphFromColumbusViewTo2D(this,e):morphFrom3DTo2D(this,e,t),0===e&&defined(this._completeMorph)&&this._completeMorph())};var scratchToCVPosition=new Cartesian3,scratchToCVDirection=new Cartesian3,scratchToCVUp=new Cartesian3,scratchToCVPosition2D=new Cartesian3,scratchToCVDirection2D=new Cartesian3,scratchToCVUp2D=new Cartesian3,scratchToCVSurfacePosition=new Cartesian3,scratchToCVCartographic=new Cartographic,scratchToCVToENU=new Matrix4,scratchToCVFrustumPerspective=new PerspectiveFrustum,scratchToCVFrustumOrthographic=new OrthographicFrustum,scratchToCVCamera={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};SceneTransitioner.prototype.morphToColumbusView=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i,r,n,a,o,s,l=this._scene;this._previousMode=l.mode,this._previousMode!==SceneMode$1.COLUMBUS_VIEW&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.COLUMBUS_VIEW,!0),l.camera._setTransform(Matrix4.IDENTITY),i=scratchToCVPosition,r=scratchToCVDirection,n=scratchToCVUp,0<e?(i.x=0,i.y=-1,i.z=1,i=Cartesian3.multiplyByScalar(Cartesian3.normalize(i,i),5*t.maximumRadius,i),Cartesian3.negate(Cartesian3.normalize(i,r),r),Cartesian3.cross(Cartesian3.UNIT_X,r,n)):(a=l.camera,this._previousMode===SceneMode$1.SCENE2D?(Cartesian3.clone(a.position,i),i.z=a.frustum.right-a.frustum.left,Cartesian3.negate(Cartesian3.UNIT_Z,r),Cartesian3.clone(Cartesian3.UNIT_Y,n)):(Cartesian3.clone(a.positionWC,i),Cartesian3.clone(a.directionWC,r),Cartesian3.clone(a.upWC,n),o=t.scaleToGeodeticSurface(i,scratchToCVSurfacePosition),o=Transforms.eastNorthUpToFixedFrame(o,t,scratchToCVToENU),Matrix4.inverseTransformation(o,o),l.mapProjection.project(t.cartesianToCartographic(i,scratchToCVCartographic),i),Matrix4.multiplyByPointAsVector(o,r,r),Matrix4.multiplyByPointAsVector(o,n,n))),this._morphToOrthographic?((s=scratchToCVFrustumOrthographic).width=l.camera.frustum.right-l.camera.frustum.left,s.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight):((s=scratchToCVFrustumPerspective).aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,s.fov=CesiumMath.toRadians(60)),(o=scratchToCVCamera).position=i,o.direction=r,o.up=n,o.frustum=s,createMorphHandler(this,s=completeColumbusViewCallback(o)),this._previousMode===SceneMode$1.SCENE2D?morphFrom2DToColumbusView(this,e,o,s):(o.position2D=Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,i,scratchToCVPosition2D),o.direction2D=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,r,scratchToCVDirection2D),o.up2D=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,n,scratchToCVUp2D),l._mode=SceneMode$1.MORPHING,morphFrom3DToColumbusView(this,e,o,s)),0===e&&defined(this._completeMorph)&&this._completeMorph())};var scratchCVTo3DCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,frustum:void 0},scratch2DTo3DFrustumPersp=new PerspectiveFrustum;function createMorphHandler(e,t){var i;e._scene.completeMorphOnUserInput&&(e._morphHandler=new ScreenSpaceEventHandler(e._scene.canvas),i=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)},e._completeMorph=i,e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.LEFT_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.MIDDLE_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.RIGHT_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.WHEEL))}function destroyMorphHandler(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}SceneTransitioner.prototype.morphTo3D=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i,r,n=this._scene;this._previousMode=n.mode,this._previousMode!==SceneMode$1.SCENE3D&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.SCENE3D,!0),n._mode=SceneMode$1.MORPHING,n.camera._setTransform(Matrix4.IDENTITY),this._previousMode===SceneMode$1.SCENE2D?morphFrom2DTo3D(this,e,t):(0<e?(i=scratchCVTo3DCamera,Cartesian3.fromDegrees(0,0,5*t.maximumRadius,t,i.position),Cartesian3.negate(i.position,i.direction),Cartesian3.normalize(i.direction,i.direction),Cartesian3.clone(Cartesian3.UNIT_Z,i.up)):i=getColumbusViewTo3DCamera(this,t),(t=n.camera).frustum instanceof OrthographicFrustum?r=t.frustum.clone():((r=scratch2DTo3DFrustumPersp).aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=CesiumMath.toRadians(60)),i.frustum=r,createMorphHandler(this,r=complete3DCallback(i)),morphFromColumbusViewTo3D(this,e,i,r)),0===e&&defined(this._completeMorph)&&this._completeMorph())},SceneTransitioner.prototype.isDestroyed=function(){return!1},SceneTransitioner.prototype.destroy=function(){return destroyMorphHandler(this),destroyObject(this)};var scratchCVTo3DCartographic=new Cartographic,scratchCVTo3DSurfacePoint=new Cartesian3,scratchCVTo3DFromENU=new Matrix4;function getColumbusViewTo3DCamera(e,t){var i=e._scene,r=i.camera,n=scratchCVTo3DCamera,a=n.position,o=n.direction,e=n.up,i=i.mapProjection.unproject(r.position,scratchCVTo3DCartographic);t.cartographicToCartesian(i,a);a=t.scaleToGeodeticSurface(a,scratchCVTo3DSurfacePoint),t=Transforms.eastNorthUpToFixedFrame(a,t,scratchCVTo3DFromENU);return Matrix4.multiplyByPointAsVector(t,r.direction,o),Matrix4.multiplyByPointAsVector(t,r.up,e),n}var scratchCVTo3DStartPos=new Cartesian3,scratchCVTo3DStartDir=new Cartesian3,scratchCVTo3DStartUp=new Cartesian3,scratchCVTo3DEndPos=new Cartesian3,scratchCVTo3DEndDir=new Cartesian3,scratchCVTo3DEndUp=new Cartesian3;function morphFromColumbusViewTo3D(e,t,i,r){t*=.5;var n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratchCVTo3DStartPos),s=Cartesian3.clone(a.direction,scratchCVTo3DStartDir),l=Cartesian3.clone(a.up,scratchCVTo3DStartUp),c=Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,i.position,scratchCVTo3DEndPos),u=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D_INVERSE,i.direction,scratchCVTo3DEndDir),d=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D_INVERSE,i.up,scratchCVTo3DEndUp);i=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,c,e.time,a.position),columbusViewMorph(s,u,e.time,a.direction),columbusViewMorph(l,d,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right)},complete:function(){addMorphTimeAnimations(e,n,0,1,t,r)}});e._currentTweens.push(i)}var scratch2DTo3DFrustumOrtho=new OrthographicFrustum,scratch3DToCVStartPos=new Cartesian3,scratch3DToCVStartDir=new Cartesian3,scratch3DToCVStartUp=new Cartesian3,scratch3DToCVEndPos=new Cartesian3,scratch3DToCVEndDir=new Cartesian3,scratch3DToCVEndUp=new Cartesian3;function morphFrom2DTo3D(e,t,i){t/=3;var r,n,a=e._scene,o=a.camera;0<t?(r=scratchCVTo3DCamera,Cartesian3.fromDegrees(0,0,5*i.maximumRadius,i,r.position),Cartesian3.negate(r.position,r.direction),Cartesian3.normalize(r.direction,r.direction),Cartesian3.clone(Cartesian3.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=getColumbusViewTo3DCamera(e,i)),e._morphToOrthographic?((n=scratch2DTo3DFrustumOrtho).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,n.width=o.frustum.right-o.frustum.left):((n=scratch2DTo3DFrustumPersp).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,n.fov=CesiumMath.toRadians(60)),r.frustum=n;var s,l=complete3DCallback(r);createMorphHandler(e,l),s=e._morphToOrthographic?function(){morphFromColumbusViewTo3D(e,t,r,l)}:function(){morphOrthographicToPerspective(e,t,r,function(){morphFromColumbusViewTo3D(e,t,r,l)})},0<t?(a._mode=SceneMode$1.SCENE2D,o.flyTo({duration:t,destination:Cartesian3.fromDegrees(0,0,5*i.maximumRadius,i,scratch3DToCVEndPos),complete:function(){a._mode=SceneMode$1.MORPHING,s()}})):s()}function columbusViewMorph(e,t,i,r){return Cartesian3.lerp(e,t,i,r)}function morphPerspectiveToOrthographic(e,t,i,r,n){var a,o,s,l=e._scene,c=l.camera;c.frustum instanceof OrthographicFrustum||(a=c.frustum.fov,o=.5*CesiumMath.RADIANS_PER_DEGREE,s=i.position.z*Math.tan(.5*a),c.frustum.far=s/Math.tan(.5*o)+1e7,t=l.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){c.frustum.fov=CesiumMath.lerp(a,o,e.time),e=s/Math.tan(.5*c.frustum.fov),r(c,e)},complete:function(){c.frustum=i.frustum.clone(),n(e)}}),e._currentTweens.push(t))}var scratchCVTo2DStartPos=new Cartesian3,scratchCVTo2DStartDir=new Cartesian3,scratchCVTo2DStartUp=new Cartesian3,scratchCVTo2DEndPos=new Cartesian3,scratchCVTo2DEndDir=new Cartesian3,scratchCVTo2DEndUp=new Cartesian3,scratchCVTo2DFrustum=new OrthographicOffCenterFrustum,scratchCVTo2DRay=new Ray,scratchCVTo2DPickPos=new Cartesian3,scratchCVTo2DCamera={position:void 0,direction:void 0,up:void 0,frustum:void 0};function morphFromColumbusViewTo2D(e,t){t*=.5;var i,r,n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratchCVTo2DStartPos),s=Cartesian3.clone(a.direction,scratchCVTo2DStartDir),l=Cartesian3.clone(a.up,scratchCVTo2DStartUp),c=Cartesian3.negate(Cartesian3.UNIT_Z,scratchCVTo2DEndDir),u=Cartesian3.clone(Cartesian3.UNIT_Y,scratchCVTo2DEndUp),d=scratchCVTo2DEndPos;0<t?(Cartesian3.clone(Cartesian3.ZERO,scratchCVTo2DEndPos),d.z=5*n.mapProjection.ellipsoid.maximumRadius):(Cartesian3.clone(o,scratchCVTo2DEndPos),i=scratchCVTo2DRay,Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,o,i.origin),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s,i.direction),!defined(r=n.globe)||defined(h=r.pickWorldCoordinates(i,n,!0,scratchCVTo2DPickPos))&&(Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,h,d),d.z+=Cartesian3.distance(o,d)));var h=scratchCVTo2DFrustum;h.right=.5*d.z,h.left=-h.right,h.top=h.right*(n.drawingBufferHeight/n.drawingBufferWidth),h.bottom=-h.top;var p=scratchCVTo2DCamera;p.position=d,p.direction=c,p.up=u,p.frustum=h;var m=complete2DCallback(p);function f(e,t){e.position.z=t}createMorphHandler(e,m);n=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,d,e.time,a.position),columbusViewMorph(s,c,e.time,a.direction),columbusViewMorph(l,u,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right),a._adjustOrthographicFrustum(!0)},complete:function(){morphPerspectiveToOrthographic(e,t,p,f,m)}});e._currentTweens.push(n)}var scratch3DTo2DCartographic=new Cartographic,scratch3DTo2DCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,position2D:new Cartesian3,direction2D:new Cartesian3,up2D:new Cartesian3,frustum:new OrthographicOffCenterFrustum},scratch3DTo2DEndCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,frustum:void 0},scratch3DTo2DPickPosition=new Cartesian3,scratch3DTo2DRay=new Ray,scratch3DTo2DToENU=new Matrix4,scratch3DTo2DSurfacePoint=new Cartesian3;function morphFrom3DTo2D(e,t,i){t*=.5;var r,n,a=e._scene,o=a.camera,s=scratch3DTo2DCamera;function l(e,t){e.position.x=t}0<t?(Cartesian3.clone(Cartesian3.ZERO,s.position),s.position.z=5*i.maximumRadius,Cartesian3.negate(Cartesian3.UNIT_Z,s.direction),Cartesian3.clone(Cartesian3.UNIT_Y,s.up)):(i.cartesianToCartographic(o.positionWC,scratch3DTo2DCartographic),a.mapProjection.project(scratch3DTo2DCartographic,s.position),Cartesian3.negate(Cartesian3.UNIT_Z,s.direction),Cartesian3.clone(Cartesian3.UNIT_Y,s.up),n=scratch3DTo2DRay,Cartesian3.clone(s.position2D,n.origin),r=Cartesian3.clone(o.directionWC,n.direction),o=i.scaleToGeodeticSurface(o.positionWC,scratch3DTo2DSurfacePoint),i=Transforms.eastNorthUpToFixedFrame(o,i,scratch3DTo2DToENU),Matrix4.inverseTransformation(i,i),Matrix4.multiplyByPointAsVector(i,r,r),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,r,r),!defined(r=a.globe)||defined(c=r.pickWorldCoordinates(n,a,!0,scratch3DTo2DPickPosition))&&(n=Cartesian3.distance(s.position2D,c),c.x+=n,Cartesian3.clone(c,s.position2D))),Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,s.position,s.position2D),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s.direction,s.direction2D),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s.up,s.up2D);var c=s.frustum;c.right=.5*s.position.z,c.left=-c.right,c.top=c.right*(a.drawingBufferHeight/a.drawingBufferWidth),c.bottom=-c.top;a=scratch3DTo2DEndCamera;Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,s.position2D,a.position),Cartesian3.clone(s.direction,a.direction),Cartesian3.clone(s.up,a.up),a.frustum=c;var u=complete2DCallback(a);createMorphHandler(e,u),morphFrom3DToColumbusView(e,t,s,function(){morphPerspectiveToOrthographic(e,t,s,l,u)})}function morphOrthographicToPerspective(e,t,i,r){var n=e._scene,a=n.camera,o=a.frustum.right-a.frustum.left;a.frustum=i.frustum.clone();var s=a.frustum.fov,l=.5*CesiumMath.RADIANS_PER_DEGREE,c=o*Math.tan(.5*s);a.frustum.far=c/Math.tan(.5*l)+1e7,a.frustum.fov=l;t=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){a.frustum.fov=CesiumMath.lerp(l,s,e.time),a.position.z=c/Math.tan(.5*a.frustum.fov)},complete:function(){r(e)}});e._currentTweens.push(t)}function morphFrom2DToColumbusView(n,a,o,s){a*=.5;var l=n._scene,c=l.camera,u=Cartesian3.clone(o.position,scratch3DToCVEndPos),d=Cartesian3.clone(o.direction,scratch3DToCVEndDir),h=Cartesian3.clone(o.up,scratch3DToCVEndUp);function e(){c.frustum=o.frustum.clone();var t=Cartesian3.clone(c.position,scratch3DToCVStartPos),i=Cartesian3.clone(c.direction,scratch3DToCVStartDir),r=Cartesian3.clone(c.up,scratch3DToCVStartUp);t.z=u.z;var e=l.tweens.add({duration:a,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(t,u,e.time,c.position),columbusViewMorph(i,d,e.time,c.direction),columbusViewMorph(r,h,e.time,c.up),Cartesian3.cross(c.direction,c.up,c.right),Cartesian3.normalize(c.right,c.right)},complete:function(){s(n)}});n._currentTweens.push(e)}l._mode=SceneMode$1.MORPHING,n._morphToOrthographic?e():morphOrthographicToPerspective(n,0,o,e)}function morphFrom3DToColumbusView(e,t,i,r){var n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratch3DToCVStartPos),s=Cartesian3.clone(a.direction,scratch3DToCVStartDir),l=Cartesian3.clone(a.up,scratch3DToCVStartUp),c=Cartesian3.clone(i.position2D,scratch3DToCVEndPos),u=Cartesian3.clone(i.direction2D,scratch3DToCVEndDir),d=Cartesian3.clone(i.up2D,scratch3DToCVEndUp);i=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,c,e.time,a.position),columbusViewMorph(s,u,e.time,a.direction),columbusViewMorph(l,d,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right),a._adjustOrthographicFrustum(!0)},complete:function(){addMorphTimeAnimations(e,n,1,0,t,r)}});e._currentTweens.push(i)}function addMorphTimeAnimations(e,t,i,r,n,a){n={object:t,property:"morphTime",startValue:i,stopValue:r,duration:n,easingFunction:EasingFunction$1.QUARTIC_OUT};defined(a)&&(n.complete=function(){a(e)});n=t.tweens.addProperty(n);e._currentTweens.push(n)}function complete3DCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.SCENE3D,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE3D),destroyMorphHandler(e);var i=t.camera;e._previousMode===SceneMode$1.MORPHING&&!e._morphCancelled||(e._morphCancelled=!1,Cartesian3.clone(r.position,i.position),Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right),i.frustum=r.frustum.clone());i=i.frustum;t.frameState.useLogDepth&&(i.near=.1,i.far=1e10);i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.SCENE3D,i)}}function complete2DCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.SCENE2D,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE2D),destroyMorphHandler(e);var i=t.camera;Cartesian3.clone(r.position,i.position),i.position.z=2*t.mapProjection.ellipsoid.maximumRadius,Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right),i.frustum=r.frustum.clone();i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.SCENE2D,i)}}function completeColumbusViewCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.COLUMBUS_VIEW,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.COLUMBUS_VIEW),destroyMorphHandler(e);var i=t.camera;e._previousModeMode===SceneMode$1.MORPHING&&!e._morphCancelled||(e._morphCancelled=!1,Cartesian3.clone(r.position,i.position),Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right));i=i.frustum;t.frameState.useLogDepth&&(i.near=.1,i.far=1e10);i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.COLUMBUS_VIEW,i)}}function Tween(e,t,i,r,n,a,o,s,l,c){this._tweens=e,this._tweenjs=t,this._startObject=clone$1(i),this._stopObject=clone$1(r),this._duration=n,this._delay=a,this._easingFunction=o,this._update=s,this._complete=l,this.cancel=c,this.needsStart=!0}function TweenCollection(){this._tweens=[]}function ScreenSpaceCameraController(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.translateEventTypes=CameraEventType$1.LEFT_DRAG,this.zoomEventTypes=[CameraEventType$1.RIGHT_DRAG,CameraEventType$1.WHEEL,CameraEventType$1.PINCH],this.rotateEventTypes=CameraEventType$1.LEFT_DRAG,this.tiltEventTypes=[CameraEventType$1.MIDDLE_DRAG,CameraEventType$1.PINCH,{eventType:CameraEventType$1.LEFT_DRAG,modifier:KeyboardEventModifier$1.CTRL},{eventType:CameraEventType$1.RIGHT_DRAG,modifier:KeyboardEventModifier$1.CTRL}],this.lookEventTypes={eventType:CameraEventType$1.LEFT_DRAG,modifier:KeyboardEventModifier$1.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new CameraEventAggregator(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 TweenCollection,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new Cartesian2(-1,-1),this._tiltCenter=new Cartesian3,this._rotateMousePosition=new Cartesian2(-1,-1),this._rotateStartPosition=new Cartesian3,this._strafeStartPosition=new Cartesian3,this._strafeMousePosition=new Cartesian2,this._strafeEndMousePosition=new Cartesian2,this._zoomMouseStart=new Cartesian2(-1,-1),this._zoomWorldPosition=new Cartesian3,this._useZoomWorldPosition=!1,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;e=e.mapProjection;this._maxCoord=e.project(new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function decay(e,t){if(e<0)return 0;t=25*(1-t);return Math.exp(-t*e)}function sameMousePosition(e){return Cartesian2.equalsEpsilon(e.startPosition,e.endPosition,CesiumMath.EPSILON14)}Object.defineProperties(Tween.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}}}),Tween.prototype.cancelTween=function(){this._tweens.remove(this)},Object.defineProperties(TweenCollection.prototype,{length:{get:function(){return this._tweens.length}}}),TweenCollection.prototype.add=function(e){if(0===(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).duration)return defined(e.complete)&&e.complete(),new Tween(this);var t=e.duration/TimeConstants$1.SECONDS_PER_MILLISECOND,i=defaultValue(e.delay,0),r=i/TimeConstants$1.SECONDS_PER_MILLISECOND,n=defaultValue(e.easingFunction,EasingFunction$1.LINEAR_NONE),a=e.startObject,o=new TWEEN.Tween(a);o.to(clone$1(e.stopObject),t),o.delay(r),o.easing(n),defined(e.update)&&o.onUpdate(function(){e.update(a)}),o.onComplete(defaultValue(e.complete,null)),o.repeat(defaultValue(e._repeat,0));n=new Tween(this,o,e.startObject,e.stopObject,e.duration,i,n,e.update,e.complete,e.cancel);return this._tweens.push(n),n},TweenCollection.prototype.addProperty=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).object,i=e.property,r=e.startValue,n=e.stopValue;return this.add({startObject:{value:r},stopObject:{value:n},duration:defaultValue(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){t[i]=e.value},complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},TweenCollection.prototype.addAlpha=function(e){var t,r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).material,n=[];for(t in r.uniforms)r.uniforms.hasOwnProperty(t)&&defined(r.uniforms[t])&&defined(r.uniforms[t].alpha)&&n.push(t);return this.add({startObject:{alpha:defaultValue(e.startValue,0)},stopObject:{alpha:defaultValue(e.stopValue,1)},duration:defaultValue(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){for(var t=n.length,i=0;i<t;++i)r.uniforms[n[i]].alpha=e.alpha},complete:e.complete,cancel:e.cancel})},TweenCollection.prototype.addOffsetIncrement=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).material.uniforms;return this.addProperty({object:t,property:"offset",startValue:t.offset,stopValue:t.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},TweenCollection.prototype.remove=function(e){if(!defined(e))return!1;var t=this._tweens.indexOf(e);return-1!==t&&(e.tweenjs.stop(),defined(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},TweenCollection.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var i=e[t];i.tweenjs.stop(),defined(i.cancel)&&i.cancel()}e.length=0},TweenCollection.prototype.contains=function(e){return defined(e)&&-1!==this._tweens.indexOf(e)},TweenCollection.prototype.get=function(e){return this._tweens[e]},TweenCollection.prototype.update=function(e){var t=this._tweens,i=0;for(e=defined(e)?e/TimeConstants$1.SECONDS_PER_MILLISECOND:getTimestamp$1();i<t.length;){var r=t[i],n=r.tweenjs;r.needsStart?(r.needsStart=!1,n.start(e)):n.update(e)?i++:(n.stop(),t.splice(i,1))}};var inertiaMaxClickTimeThreshold=.4;function maintainInertia(e,t,i,r,n,a,o){var s=a[o];defined(s)||(s=a[o]={startPosition:new Cartesian2,endPosition:new Cartesian2,motion:new Cartesian2,inertiaEnabled:!0});var l=e.getButtonPressTime(t,i),c=e.getButtonReleaseTime(t,i),u=l&&c&&(c.getTime()-l.getTime())/1e3,o=new Date,o=c&&(o.getTime()-c.getTime())/1e3;l&&c&&u<inertiaMaxClickTimeThreshold&&(o=decay(o,r),defined(r=e.getLastMovement(t,i))&&!sameMousePosition(r)&&s.inertiaEnabled&&(s.motion.x=.5*(r.endPosition.x-r.startPosition.x),s.motion.y=.5*(r.endPosition.y-r.startPosition.y),s.startPosition=Cartesian2.clone(r.startPosition,s.startPosition),s.endPosition=Cartesian2.multiplyByScalar(s.motion,o,s.endPosition),s.endPosition=Cartesian2.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||Cartesian2.distance(s.startPosition,s.endPosition)<.5||e.isButtonDown(t,i)||n(a,e.getStartMousePosition(t,i),s)))}function activateInertia(e,t){if(defined(t)){var i=e[t];defined(i)&&(i.inertiaEnabled=!0);var r=e._inertiaDisablers[t];if(defined(r))for(var n=r.length,a=0;a<n;++a)defined(i=e[r[a]])&&(i.inertiaEnabled=!1)}}var scratchEventTypeArray=[];function reactToInput(e,t,i,r,n,a){if(defined(i)){var o=e._aggregator;Array.isArray(i)||(scratchEventTypeArray[0]=i,i=scratchEventTypeArray);for(var s=i.length,l=0;l<s;++l){var c=i[l],u=defined(c.eventType)?c.eventType:c,d=c.modifier,h=o.isMoving(u,d)&&o.getMovement(u,d),c=o.getStartMousePosition(u,d);e.enableInputs&&t&&(h?(r(e,c,h),activateInertia(e,a)):n<1&&maintainInertia(o,u,d,n,r,e,a))}}}var scratchZoomPickRay=new Ray,scratchPickCartesian$1=new Cartesian3,scratchZoomOffset=new Cartesian2,scratchZoomDirection=new Cartesian3,scratchCenterPixel=new Cartesian2,scratchCenterPosition=new Cartesian3,scratchPositionNormal=new Cartesian3,scratchPickNormal=new Cartesian3,scratchZoomAxis=new Cartesian3,scratchCameraPositionNormal=new Cartesian3,scratchTargetNormal=new Cartesian3,scratchCameraPosition=new Cartesian3,scratchCameraUpNormal=new Cartesian3,scratchCameraRightNormal=new Cartesian3,scratchForwardNormal=new Cartesian3,scratchPositionToTarget=new Cartesian3,scratchPositionToTargetNormal=new Cartesian3,scratchPan=new Cartesian3,scratchCenterMovement=new Cartesian3,scratchCenter=new Cartesian3,scratchCartesian=new Cartesian3,scratchCartesianTwo=new Cartesian3,scratchCartesianThree=new Cartesian3,scratchZoomViewOptions={orientation:new HeadingPitchRoll};function handleZoom(e,t,i,r,n,a){var o=1;defined(a)&&(o=CesiumMath.clamp(Math.abs(a),.25,1));var s=e.minimumZoomDistance*o,l=e.maximumZoomDistance,c=r*(n-s),c=CesiumMath.clamp(c,e._minimumZoomRate,e._maximumZoomRate),a=(i.endPosition.y-i.startPosition.y)/e._scene.canvas.clientHeight,o=c*(a=Math.min(a,e.maximumMovementRatio));if(e.enableCollisionDetection||0===e.minimumZoomDistance||!defined(e._globe)){if(0<o&&Math.abs(n-s)<1)return;if(o<0&&Math.abs(n-l)<1)return;n-o<s?o=n-s-1:l<n-o&&(o=n-l)}r=e._scene,i=r.camera,c=r.mode,a=scratchZoomViewOptions.orientation;if(a.heading=i.heading,a.pitch=i.pitch,a.roll=i.roll,i.frustum instanceof OrthographicFrustum)0<Math.abs(o)&&(i.zoomIn(o),i._adjustOrthographicFrustum());else{s=Cartesian2.equals(t,e._zoomMouseStart),n=e._zoomingOnVector,l=e._rotatingZoom;if(s||(e._zoomMouseStart=Cartesian2.clone(t,e._zoomMouseStart),defined(e._globe)&&(_=c===SceneMode$1.SCENE2D?(_=i.getPickRay(t,scratchZoomPickRay).origin,Cartesian3.fromElements(_.y,_.z,_.x)):pickGlobe(e,t,scratchPickCartesian$1)),defined(_)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=Cartesian3.clone(_,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,n=e._zoomingOnVector=!1,l=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),e._useZoomWorldPosition){a=c===SceneMode$1.COLUMBUS_VIEW;if(i.positionCartographic.height<2e6&&(l=!0),!s||l){if(c===SceneMode$1.SCENE2D){var u=e._zoomWorldPosition,d=i.position;!Cartesian3.equals(u,d)&&i.positionCartographic.height<2*e._maxCoord.x&&(f=i.position.x,h=Cartesian3.subtract(u,d,scratchZoomDirection),Cartesian3.normalize(h,h),m=Cartesian3.distance(u,d)*o/(.5*i.getMagnitude()),i.move(h,.5*m),(i.position.x<0&&0<f||0<i.position.x&&f<0)&&(_=i.getPickRay(t,scratchZoomPickRay).origin,_=Cartesian3.fromElements(_.y,_.z,_.x),e._zoomWorldPosition=Cartesian3.clone(_,e._zoomWorldPosition)))}else if(c===SceneMode$1.SCENE3D){l=Cartesian3.normalize(i.position,scratchCameraPositionNormal);if(e._cameraUnderground||e._zoomingUnderground||i.positionCartographic.height<3e3&&Math.abs(Cartesian3.dot(i.direction,l))<.6)a=!0;else{u=r.canvas,d=scratchCenterPixel;d.x=u.clientWidth/2,d.y=u.clientHeight/2;var h=pickGlobe(e,d,scratchCenterPosition);if(defined(h))if(i.positionCartographic.height<1e6){if(!(-.5<=Cartesian3.dot(i.direction,l))){var p=scratchCameraPosition;Cartesian3.clone(i.position,p);var m=e._zoomWorldPosition,f=scratchTargetNormal,f=Cartesian3.normalize(m,f);if(Cartesian3.dot(f,l)<0)return;var g=scratchCenter,_=scratchForwardNormal;Cartesian3.clone(i.direction,_),Cartesian3.add(p,Cartesian3.multiplyByScalar(_,1e3,scratchCartesian),g);u=scratchPositionToTarget,d=scratchPositionToTargetNormal;Cartesian3.subtract(m,p,u),Cartesian3.normalize(u,d);f=Cartesian3.dot(l,d);if(0<=f)return void(e._zoomMouseStart.x=-1);l=Math.acos(-f),f=Cartesian3.magnitude(p),m=Cartesian3.magnitude(m),f=f-o,u=Cartesian3.magnitude(u),u=Math.asin(CesiumMath.clamp(u/m*Math.sin(l),-1,1))-Math.asin(CesiumMath.clamp(f/m*Math.sin(l),-1,1))+l,m=scratchCameraUpNormal;Cartesian3.normalize(p,m);l=scratchCameraRightNormal,l=Cartesian3.cross(d,m,l);l=Cartesian3.normalize(l,l),Cartesian3.normalize(Cartesian3.cross(m,l,scratchCartesian),_),Cartesian3.multiplyByScalar(Cartesian3.normalize(g,scratchCartesian),Cartesian3.magnitude(g)-o,g),Cartesian3.normalize(p,p),Cartesian3.multiplyByScalar(p,f,p);d=scratchPan;Cartesian3.multiplyByScalar(Cartesian3.add(Cartesian3.multiplyByScalar(m,Math.cos(u)-1,scratchCartesianTwo),Cartesian3.multiplyByScalar(_,Math.sin(u),scratchCartesianThree),scratchCartesian),f,d),Cartesian3.add(p,d,p),Cartesian3.normalize(g,m),Cartesian3.normalize(Cartesian3.cross(m,l,scratchCartesian),_);l=scratchCenterMovement;return Cartesian3.multiplyByScalar(Cartesian3.add(Cartesian3.multiplyByScalar(m,Math.cos(u)-1,scratchCartesianTwo),Cartesian3.multiplyByScalar(_,Math.sin(u),scratchCartesianThree),scratchCartesian),Cartesian3.magnitude(g),l),Cartesian3.add(g,l,g),Cartesian3.clone(p,i.position),Cartesian3.normalize(Cartesian3.subtract(g,p,scratchCartesian),i.direction),Cartesian3.clone(i.direction,i.direction),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.cross(i.right,i.direction,i.up),void i.setView(scratchZoomViewOptions)}a=!0}else{g=Cartesian3.normalize(h,scratchPositionNormal),p=Cartesian3.normalize(e._zoomWorldPosition,scratchPickNormal),h=Cartesian3.dot(p,g);0<h&&h<1&&(h=CesiumMath.acosClamped(h),p=Cartesian3.cross(p,g,scratchZoomAxis),g=o/(Math.abs(h)>CesiumMath.toRadians(20)?.75*i.positionCartographic.height:i.positionCartographic.height-o),i.rotate(p,h*g))}else a=!0}}e._rotatingZoom=!a}!s&&a||n?(r=SceneTransforms.wgs84ToWindowCoordinates(r,e._zoomWorldPosition,scratchZoomOffset),t=(c!==SceneMode$1.COLUMBUS_VIEW&&Cartesian2.equals(t,e._zoomMouseStart)&&defined(r)?i.getPickRay(r,scratchZoomPickRay):i.getPickRay(t,scratchZoomPickRay)).direction,c!==SceneMode$1.COLUMBUS_VIEW&&c!==SceneMode$1.SCENE2D||Cartesian3.fromElements(t.y,t.z,t.x,t),i.move(t,o),e._zoomingOnVector=!0):i.zoomIn(o),e._cameraUnderground||i.setView(scratchZoomViewOptions)}else i.zoomIn(o)}}var translate2DStart=new Ray,translate2DEnd=new Ray,scratchTranslateP0=new Cartesian3;function translate2D(e,t,i){var r=e._scene.camera,e=r.getPickRay(i.startPosition,translate2DStart).origin,i=r.getPickRay(i.endPosition,translate2DEnd).origin,e=Cartesian3.fromElements(e.y,e.z,e.x,e),i=Cartesian3.fromElements(i.y,i.z,i.x,i),e=Cartesian3.subtract(e,i,scratchTranslateP0),i=Cartesian3.magnitude(e);0<i&&(Cartesian3.normalize(e,e),r.move(e,i))}function zoom2D(e,t,i){defined(i.distance)&&(i=i.distance);var r=e._scene.camera;handleZoom(e,t,i,e._zoomFactor,r.getMagnitude())}var twist2DStart=new Cartesian2,twist2DEnd=new Cartesian2;function twist2D(e,t,i){var r,n,a;defined(i.angleAndHeight)?singleAxisTwist2D(e,t,i.angleAndHeight):(r=(a=e._scene).camera,t=(n=a.canvas).clientWidth,e=n.clientHeight,(a=twist2DStart).x=2/t*i.startPosition.x-1,a.y=2/e*(e-i.startPosition.y)-1,a=Cartesian2.normalize(a,a),(n=twist2DEnd).x=2/t*i.endPosition.x-1,n.y=2/e*(e-i.endPosition.y)-1,n=Cartesian2.normalize(n,n),i=CesiumMath.acosClamped(a.x),a.y<0&&(i=CesiumMath.TWO_PI-i),a=CesiumMath.acosClamped(n.x),i=(a=n.y<0?CesiumMath.TWO_PI-a:a)-i,r.twistRight(i))}function singleAxisTwist2D(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;(r=r>e._maximumRotateRate?e._maximumRotateRate:r)<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,a=n.camera,n=n.canvas,n=(i.endPosition.x-i.startPosition.x)/n.clientWidth,n=r*(n=Math.min(n,e.maximumMovementRatio))*Math.PI*4;a.twistRight(n)}function update2D(e){var t=e._scene.mapMode2D===MapMode2D$1.ROTATE;Matrix4.equals(Matrix4.IDENTITY,e._scene.camera.transform)?(reactToInput(e,e.enableTranslate,e.translateEventTypes,translate2D,e.inertiaTranslate,"_lastInertiaTranslateMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom2D,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&reactToInput(e,e.enableRotate,e.tiltEventTypes,twist2D,e.inertiaSpin,"_lastInertiaTiltMovement")):(reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom2D,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&reactToInput(e,e.enableRotate,e.translateEventTypes,twist2D,e.inertiaSpin,"_lastInertiaSpinMovement"))}var pickGlobeScratchRay=new Ray,scratchDepthIntersection=new Cartesian3,scratchRayIntersection=new Cartesian3;function pickGlobe(e,t,i){var r=e._scene,n=e._globe,a=r.camera;if(defined(n)){var o,e=!e._cameraUnderground;r.pickPositionSupported&&(o=r.pickPositionWorldCoordinates(t,scratchDepthIntersection));t=a.getPickRay(t,pickGlobeScratchRay),e=n.pickWorldCoordinates(t,r,e,scratchRayIntersection);return(defined(o)?Cartesian3.distance(o,a.positionWC):Number.POSITIVE_INFINITY)<(defined(e)?Cartesian3.distance(e,a.positionWC):Number.POSITIVE_INFINITY)?Cartesian3.clone(o,i):Cartesian3.clone(e,i)}}var scratchDistanceCartographic=new Cartographic;function getDistanceFromSurface(e){var t=e._ellipsoid,i=e._scene,r=i.camera,n=0;i.mode===SceneMode$1.SCENE3D?defined(t=t.cartesianToCartographic(r.position,scratchDistanceCartographic))&&(n=t.height):n=r.position.z;e=defaultValue(e._scene.globeHeight,0);return Math.abs(e-n)}var scratchSurfaceNormal=new Cartesian3;function getZoomDistanceUnderground(e,t){var i=t.origin,t=t.direction,e=getDistanceFromSurface(e),i=Cartesian3.normalize(i,scratchSurfaceNormal),t=Math.abs(Cartesian3.dot(i,t));return e*(t=2*Math.max(t,.5))}function getTiltCenterUnderground(e,t,i,r){var n=Cartesian3.distance(t.origin,i),i=getDistanceFromSurface(e);return CesiumMath.clamp(5*i,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance)<n&&(n=Math.min(n,i/5),n=Math.max(n,100)),Ray.getPoint(t,n,r)}function getStrafeStartPositionUnderground(e,t,i,r){var n;return(!defined(i)||(n=Cartesian3.distance(t.origin,i))>e._maximumUndergroundPickDistance)&&(n=getDistanceFromSurface(e)),Ray.getPoint(t,n,r)}var scratchInertialDelta=new Cartesian2;function continueStrafing(e,t){var i=t.endPosition,r=Cartesian2.subtract(t.endPosition,t.startPosition,scratchInertialDelta),n=e._strafeEndMousePosition;Cartesian2.add(n,r,n),t.endPosition=n,strafe(e,t,e._strafeStartPosition),t.endPosition=i}var translateCVStartRay=new Ray,translateCVEndRay=new Ray,translateCVStartPos=new Cartesian3,translateCVEndPos=new Cartesian3,translateCVDifference=new Cartesian3,translateCVOrigin=new Cartesian3,translateCVPlane=new Plane(Cartesian3.UNIT_X,0),translateCVStartMouse=new Cartesian2,translateCVEndMouse=new Cartesian2;function translateCV(e,t,i){if(Cartesian3.equals(t,e._translateMousePosition)||(e._looking=!1),Cartesian3.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking)look3D(e,t,i);else if(e._strafing)continueStrafing(e,i);else{var r,n=e._scene.camera,a=e._cameraUnderground,o=Cartesian2.clone(i.startPosition,translateCVStartMouse),s=Cartesian2.clone(i.endPosition,translateCVEndMouse),l=n.getPickRay(o,translateCVStartRay),c=Cartesian3.clone(Cartesian3.ZERO,translateCVOrigin),u=Cartesian3.UNIT_X;if(n.position.z<e._minimumPickingTerrainHeight&&defined(r=pickGlobe(e,o,translateCVStartPos))&&(c.x=r.x),a||c.x>n.position.z&&defined(r)){var d=r;return a&&(d=getStrafeStartPositionUnderground(e,l,r,translateCVStartPos)),Cartesian2.clone(t,e._strafeMousePosition),Cartesian2.clone(t,e._strafeEndMousePosition),Cartesian3.clone(d,e._strafeStartPosition),e._strafing=!0,void strafe(e,i,e._strafeStartPosition)}u=Plane.fromPointNormal(c,u,translateCVPlane),l=n.getPickRay(o,translateCVStartRay),l=IntersectionTests.rayPlane(l,u,translateCVStartPos),s=n.getPickRay(s,translateCVEndRay),u=IntersectionTests.rayPlane(s,u,translateCVEndPos);if(!defined(l)||!defined(u))return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._translateMousePosition);l=Cartesian3.subtract(l,u,translateCVDifference),u=l.x;l.x=l.y,l.y=l.z,l.z=u;u=Cartesian3.magnitude(l);u>CesiumMath.EPSILON6&&(Cartesian3.normalize(l,l),n.move(l,u))}}var rotateCVWindowPos=new Cartesian2,rotateCVWindowRay=new Ray,rotateCVCenter=new Cartesian3,rotateCVVerticalCenter=new Cartesian3,rotateCVTransform=new Matrix4,rotateCVVerticalTransform=new Matrix4,rotateCVOrigin=new Cartesian3,rotateCVPlane=new Plane(Cartesian3.UNIT_X,0),rotateCVCartesian3=new Cartesian3,rotateCVCart=new Cartographic,rotateCVOldTransform=new Matrix4,rotateCVQuaternion=new Quaternion,rotateCVMatrix=new Matrix3,tilt3DCartesian3=new Cartesian3;function rotateCV(e,t,i){var r;defined(i.angleAndHeight)&&(i=i.angleAndHeight),Cartesian2.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking?look3D(e,t,i):(r=e._scene.camera,e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,rotateCVOnPlane(e,t,i)):rotateCVOnTerrain(e,t,i))}function rotateCVOnPlane(e,t,i){var r=e._scene,n=r.camera,a=r.canvas,o=rotateCVWindowPos;o.x=a.clientWidth/2,o.y=a.clientHeight/2;var s=n.getPickRay(o,rotateCVWindowRay),l=Cartesian3.UNIT_X,a=s.origin,o=s.direction,s=Cartesian3.dot(l,o);if(!defined(c=Math.abs(s)>CesiumMath.EPSILON6?-Cartesian3.dot(l,a)/s:c)||c<=0)return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._tiltCenterMousePosition);o=Cartesian3.multiplyByScalar(o,c,rotateCVCenter);Cartesian3.add(a,o,o);var c=r.mapProjection,a=c.ellipsoid;Cartesian3.fromElements(o.y,o.z,o.x,o);r=c.unproject(o,rotateCVCart);a.cartographicToCartesian(r,o);c=Transforms.eastNorthUpToFixedFrame(o,a,rotateCVTransform),r=e._globe,o=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;a=Matrix4.clone(n.transform,rotateCVOldTransform);n._setTransform(c),rotate3D(e,t,i,Cartesian3.UNIT_Z),n._setTransform(a),e._globe=r;o=(e._ellipsoid=o).maximumRadius;e._rotateFactor=1/o,e._rotateRateRangeAdjustment=o}function rotateCVOnTerrain(e,t,i){var r=e._scene,n=r.camera,a=e._cameraUnderground,o=Cartesian3.UNIT_X;if(Cartesian2.equals(t,e._tiltCenterMousePosition))h=Cartesian3.clone(e._tiltCenter,rotateCVCenter);else{if(!defined(h=n.position.z<e._minimumPickingTerrainHeight?pickGlobe(e,t,rotateCVCenter):h)){var s=(d=n.getPickRay(t,rotateCVWindowRay)).origin,l=d.direction,c=Cartesian3.dot(o,l);if(!defined(u=Math.abs(c)>CesiumMath.EPSILON6?-Cartesian3.dot(o,s)/c:u)||u<=0)return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._tiltCenterMousePosition);h=Cartesian3.multiplyByScalar(l,u,rotateCVCenter),Cartesian3.add(s,h,h)}a&&getTiltCenterUnderground(e,d=!defined(d)?n.getPickRay(t,rotateCVWindowRay):d,h,h),Cartesian2.clone(t,e._tiltCenterMousePosition),Cartesian3.clone(h,e._tiltCenter)}var u=r.canvas,s=rotateCVWindowPos;s.x=u.clientWidth/2,s.y=e._tiltCenterMousePosition.y,d=n.getPickRay(s,rotateCVWindowRay);r=Cartesian3.clone(Cartesian3.ZERO,rotateCVOrigin);r.x=h.x;u=Plane.fromPointNormal(r,o,rotateCVPlane),s=IntersectionTests.rayPlane(d,u,rotateCVVerticalCenter),r=n._projection,o=r.ellipsoid;Cartesian3.fromElements(h.y,h.z,h.x,h);var d=r.unproject(h,rotateCVCart);o.cartographicToCartesian(d,h);var u=Transforms.eastNorthUpToFixedFrame(h,o,rotateCVTransform),h=defined(s)?(Cartesian3.fromElements(s.y,s.z,s.x,s),d=r.unproject(s,rotateCVCart),o.cartographicToCartesian(d,s),Transforms.eastNorthUpToFixedFrame(s,o,rotateCVVerticalTransform)):u,r=e._globe,d=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;s=Cartesian3.UNIT_Z,o=Matrix4.clone(n.transform,rotateCVOldTransform);n._setTransform(u);u=Cartesian3.cross(Cartesian3.UNIT_Z,Cartesian3.normalize(n.position,rotateCVCartesian3),rotateCVCartesian3),u=Cartesian3.dot(n.right,u);rotate3D(e,t,i,s,!1,!0),n._setTransform(h),u<0?(u=i.startPosition.y-i.endPosition.y,(a&&u<0||!a&&0<u)&&(s=void 0),u=n.constrainedAxis,rotate3D(e,t,i,s,!(n.constrainedAxis=void 0),!1),n.constrainedAxis=u):rotate3D(e,t,i,s,!0,!1),defined(n.constrainedAxis)&&(s=Cartesian3.cross(n.direction,n.constrainedAxis,tilt3DCartesian3),Cartesian3.equalsEpsilon(s,Cartesian3.ZERO,CesiumMath.EPSILON6)||(Cartesian3.dot(s,n.right)<0&&Cartesian3.negate(s,s),Cartesian3.cross(s,n.direction,n.up),Cartesian3.cross(n.direction,n.up,n.right),Cartesian3.normalize(n.up,n.up),Cartesian3.normalize(n.right,n.right))),n._setTransform(o),e._globe=r;d=(e._ellipsoid=d).maximumRadius;e._rotateFactor=1/d,e._rotateRateRangeAdjustment=d;d=Cartesian3.clone(n.positionWC,rotateCVCartesian3);e.enableCollisionDetection&&adjustHeightForTerrain(e),Cartesian3.equals(n.positionWC,d)||(n._setTransform(h),n.worldToCameraCoordinatesPoint(d,d),h=Cartesian3.magnitudeSquared(d),Cartesian3.magnitudeSquared(n.position)>h&&(Cartesian3.normalize(n.position,n.position),Cartesian3.multiplyByScalar(n.position,Math.sqrt(h),n.position)),h=Cartesian3.angleBetween(d,n.position),d=Cartesian3.cross(d,n.position,d),Cartesian3.normalize(d,d),h=Quaternion.fromAxisAngle(d,h,rotateCVQuaternion),h=Matrix3.fromQuaternion(h,rotateCVMatrix),Matrix3.multiplyByVector(h,n.direction,n.direction),Matrix3.multiplyByVector(h,n.up,n.up),Cartesian3.cross(n.direction,n.up,n.right),Cartesian3.cross(n.right,n.direction,n.up),n._setTransform(o))}var zoomCVWindowPos=new Cartesian2,zoomCVWindowRay=new Ray,zoomCVIntersection=new Cartesian3;function zoomCV(e,t,i){defined(i.distance)&&(i=i.distance);var r,n=e._scene,a=n.camera,o=n.canvas,s=e._cameraUnderground;s?r=t:((r=zoomCVWindowPos).x=o.clientWidth/2,r.y=o.clientHeight/2);var l,c,u,d=a.getPickRay(r,zoomCVWindowRay),n=d.origin,o=d.direction;defined(l=a.position.z<e._minimumPickingTerrainHeight?pickGlobe(e,r,zoomCVIntersection):l)&&(c=Cartesian3.distance(n,l)),s&&(u=getZoomDistanceUnderground(e,d),c=defined(c)?Math.min(c,u):u),defined(c)||(u=Cartesian3.UNIT_X,c=-Cartesian3.dot(u,n)/Cartesian3.dot(u,o)),handleZoom(e,t,i,e._zoomFactor,c)}function updateCV(e){var t,i=e._scene.camera;Matrix4.equals(Matrix4.IDENTITY,i.transform)?(t=e._tweens,e._aggregator.anyButtonDown&&t.removeAll(),reactToInput(e,e.enableTilt,e.tiltEventTypes,rotateCV,e.inertiaSpin,"_lastInertiaTiltMovement"),reactToInput(e,e.enableTranslate,e.translateEventTypes,translateCV,e.inertiaTranslate,"_lastInertiaTranslateMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoomCV,e.inertiaZoom,"_lastInertiaZoomMovement"),reactToInput(e,e.enableLook,e.lookEventTypes,look3D),e._aggregator.anyButtonDown||t.contains(e._tween)||defined(i=i.createCorrectPositionTween(e.bounceAnimationTime))&&(e._tween=t.add(i)),t.update()):(reactToInput(e,e.enableRotate,e.rotateEventTypes,rotate3D,e.inertiaSpin,"_lastInertiaSpinMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom3D,e.inertiaZoom,"_lastInertiaZoomMovement"))}var scratchStrafeRay=new Ray,scratchStrafePlane=new Plane(Cartesian3.UNIT_X,0),scratchStrafeIntersection=new Cartesian3,scratchStrafeDirection=new Cartesian3,scratchMousePos=new Cartesian3;function strafe(e,t,i){var r=e._scene,n=r.camera,a=n.getPickRay(t.endPosition,scratchStrafeRay),e=Cartesian3.clone(n.direction,scratchStrafeDirection);r.mode===SceneMode$1.COLUMBUS_VIEW&&Cartesian3.fromElements(e.z,e.x,e.y,e);t=Plane.fromPointNormal(i,e,scratchStrafePlane),t=IntersectionTests.rayPlane(a,t,scratchStrafeIntersection);defined(t)&&(e=Cartesian3.subtract(i,t,e),r.mode===SceneMode$1.COLUMBUS_VIEW&&Cartesian3.fromElements(e.y,e.z,e.x,e),Cartesian3.add(n.position,e,n.position))}var spin3DPick=new Cartesian3,scratchCartographic=new Cartographic,scratchRadii=new Cartesian3,scratchEllipsoid=new Ellipsoid,scratchLookUp=new Cartesian3,scratchNormal=new Cartesian3;function spin3D(e,t,i){var r=e._scene.camera,n=e._cameraUnderground,a=e._ellipsoid;if(Matrix4.equals(r.transform,Matrix4.IDENTITY)){var o,s,l=a.geodeticSurfaceNormal(r.position,scratchLookUp);if(Cartesian2.equals(t,e._rotateMousePosition))if(e._looking)look3D(e,t,i,l);else if(e._rotating)rotate3D(e,t,i);else if(e._strafing)continueStrafing(e,i);else{if(Cartesian3.magnitude(r.position)<Cartesian3.magnitude(e._rotateStartPosition))return;o=Cartesian3.magnitude(e._rotateStartPosition),(s=scratchRadii).x=s.y=s.z=o,pan3D(e,t,i,a=Ellipsoid.fromCartesian3(s,scratchEllipsoid))}else{e._looking=!1,e._rotating=!1,e._strafing=!1;var c,u,d,h=a.cartesianToCartographic(r.positionWC,scratchCartographic).height;defined(e._globe)&&h<e._minimumPickingTerrainHeight?defined(c=pickGlobe(e,i.startPosition,scratchMousePos))?(d=!1,u=r.getPickRay(i.startPosition,pickGlobeScratchRay),n?(d=!0,getStrafeStartPositionUnderground(e,u,c,c)):(n=a.geodeticSurfaceNormal(c,scratchNormal),d=Math.abs(Cartesian3.dot(u.direction,n))<.05||Cartesian3.magnitude(r.position)<Cartesian3.magnitude(c)),d?(Cartesian2.clone(t,e._strafeEndMousePosition),Cartesian3.clone(c,e._strafeStartPosition),e._strafing=!0,strafe(e,i,e._strafeStartPosition)):(o=Cartesian3.magnitude(c),(s=scratchRadii).x=s.y=s.z=o,pan3D(e,t,i,a=Ellipsoid.fromCartesian3(s,scratchEllipsoid)),Cartesian3.clone(c,e._rotateStartPosition))):(e._looking=!0,look3D(e,t,i,l)):defined(r.pickEllipsoid(i.startPosition,e._ellipsoid,spin3DPick))?(pan3D(e,t,i,e._ellipsoid),Cartesian3.clone(spin3DPick,e._rotateStartPosition)):h>e._minimumTrackBallHeight?(e._rotating=!0,rotate3D(e,t,i)):(e._looking=!0,look3D(e,t,i,l)),Cartesian2.clone(t,e._rotateMousePosition)}}else rotate3D(e,t,i)}function rotate3D(e,t,i,r,n,a){n=defaultValue(n,!1),a=defaultValue(a,!1);var o=e._scene,s=o.camera,l=o.canvas,c=s.constrainedAxis;defined(r)&&(s.constrainedAxis=r);o=Cartesian3.magnitude(s.position),r=e._rotateFactor*(o-e._rotateRateRangeAdjustment);(r=r>e._maximumRotateRate?e._maximumRotateRate:r)<e._minimumRotateRate&&(r=e._minimumRotateRate);o=(i.startPosition.x-i.endPosition.x)/l.clientWidth,l=(i.startPosition.y-i.endPosition.y)/l.clientHeight,o=Math.min(o,e.maximumMovementRatio),l=Math.min(l,e.maximumMovementRatio),o=r*o*Math.PI*2,l=r*l*Math.PI;n||s.rotateRight(o),a||s.rotateUp(l),s.constrainedAxis=c}var pan3DP0=Cartesian4.clone(Cartesian4.UNIT_W),pan3DP1=Cartesian4.clone(Cartesian4.UNIT_W),pan3DTemp0=new Cartesian3,pan3DTemp1=new Cartesian3,pan3DTemp2=new Cartesian3,pan3DTemp3=new Cartesian3,pan3DStartMousePosition=new Cartesian2,pan3DEndMousePosition=new Cartesian2;function pan3D(e,t,i,r){var n,a,o=e._scene.camera,s=Cartesian2.clone(i.startPosition,pan3DStartMousePosition),l=Cartesian2.clone(i.endPosition,pan3DEndMousePosition),c=o.pickEllipsoid(s,r,pan3DP0),u=o.pickEllipsoid(l,r,pan3DP1);if(!defined(c)||!defined(u))return e._rotating=!0,void rotate3D(e,t,i);c=o.worldToCameraCoordinates(c,c),u=o.worldToCameraCoordinates(u,u),defined(o.constrainedAxis)?(n=o.constrainedAxis,s=Cartesian3.mostOrthogonalAxis(n,pan3DTemp0),Cartesian3.cross(s,n,s),Cartesian3.normalize(s,s),l=Cartesian3.cross(n,s,pan3DTemp1),r=Cartesian3.magnitude(c),a=Cartesian3.dot(n,c),e=Math.acos(a/r),t=Cartesian3.multiplyByScalar(n,a,pan3DTemp2),Cartesian3.subtract(c,t,t),Cartesian3.normalize(t,t),i=Cartesian3.magnitude(u),r=Cartesian3.dot(n,u),a=Math.acos(r/i),i=Cartesian3.multiplyByScalar(n,r,pan3DTemp3),Cartesian3.subtract(u,i,i),Cartesian3.normalize(i,i),r=Math.acos(Cartesian3.dot(t,s)),Cartesian3.dot(t,l)<0&&(r=CesiumMath.TWO_PI-r),s=Math.acos(Cartesian3.dot(i,s)),i=r-(s=Cartesian3.dot(i,l)<0?CesiumMath.TWO_PI-s:s),l=Cartesian3.equalsEpsilon(n,o.position,CesiumMath.EPSILON2)?o.right:Cartesian3.cross(n,o.position,pan3DTemp0),s=Cartesian3.cross(n,l,pan3DTemp0),l=Cartesian3.dot(s,Cartesian3.subtract(c,n,pan3DTemp1)),s=Cartesian3.dot(s,Cartesian3.subtract(u,n,pan3DTemp1)),a=0<l&&0<s?a-e:0<l&&s<=0?0<Cartesian3.dot(o.position,n)?-e-a:e+a:e-a,o.rotateRight(i),o.rotateUp(a)):(Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),a=Cartesian3.dot(c,u),u=Cartesian3.cross(c,u,pan3DTemp0),a<1&&!Cartesian3.equalsEpsilon(u,Cartesian3.ZERO,CesiumMath.EPSILON14)&&(a=Math.acos(a),o.rotate(u,a)))}var zoom3DUnitPosition=new Cartesian3,zoom3DCartographic=new Cartographic;function zoom3D(e,t,i){defined(i.distance)&&(i=i.distance);var r,n=e._ellipsoid,a=e._scene,o=a.camera,s=a.canvas,a=e._cameraUnderground;a?r=t:((r=zoomCVWindowPos).x=s.clientWidth/2,r.y=s.clientHeight/2);var l,c,s=o.getPickRay(r,zoomCVWindowRay),n=n.cartesianToCartographic(o.position,zoom3DCartographic).height;defined(l=n<e._minimumPickingTerrainHeight?pickGlobe(e,r,zoomCVIntersection):l)&&(c=Cartesian3.distance(s.origin,l)),a&&(s=getZoomDistanceUnderground(e,s),c=defined(c)?Math.min(c,s):s),defined(c)||(c=n);n=Cartesian3.normalize(o.position,zoom3DUnitPosition);handleZoom(e,t,i,e._zoomFactor,c,Cartesian3.dot(n,o.direction))}var tilt3DWindowPos=new Cartesian2,tilt3DRay=new Ray,tilt3DCenter=new Cartesian3,tilt3DVerticalCenter=new Cartesian3,tilt3DTransform=new Matrix4,tilt3DVerticalTransform=new Matrix4,tilt3DOldTransform=new Matrix4,tilt3DQuaternion=new Quaternion,tilt3DMatrix=new Matrix3,tilt3DCart=new Cartographic,tilt3DLookUp=new Cartesian3;function tilt3D(e,t,i){var r,n=e._scene.camera;Matrix4.equals(n.transform,Matrix4.IDENTITY)&&(defined(i.angleAndHeight)&&(i=i.angleAndHeight),Cartesian2.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking?(r=e._ellipsoid.geodeticSurfaceNormal(n.position,tilt3DLookUp),look3D(e,t,i,r)):(n=e._ellipsoid.cartesianToCartographic(n.position,tilt3DCart),e._tiltOnEllipsoid||n.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,tilt3DOnEllipsoid(e,t,i)):tilt3DOnTerrain(e,t,i)))}var tilt3DOnEllipsoidCartographic=new Cartographic;function tilt3DOnEllipsoid(e,t,i){var r=e._ellipsoid,n=e._scene,a=n.camera,o=.25*e.minimumZoomDistance,s=r.cartesianToCartographic(a.positionWC,tilt3DOnEllipsoidCartographic).height;if(!(s-o-1<CesiumMath.EPSILON3&&i.endPosition.y-i.startPosition.y<0)){o=n.canvas,n=tilt3DWindowPos;n.x=o.clientWidth/2,n.y=o.clientHeight/2;o=a.getPickRay(n,tilt3DRay),n=IntersectionTests.rayEllipsoid(o,r);if(defined(n))u=Ray.getPoint(o,n.start,tilt3DCenter);else{if(!(s>e._minimumTrackBallHeight)){e._looking=!0;var l=e._ellipsoid.geodeticSurfaceNormal(a.position,tilt3DLookUp);return look3D(e,t,i,l),void Cartesian2.clone(t,e._tiltCenterMousePosition)}var c=IntersectionTests.grazingAltitudeLocation(o,r);if(!defined(c))return;l=r.cartesianToCartographic(c,tilt3DCart);l.height=0,u=r.cartographicToCartesian(l,tilt3DCenter)}var c=Transforms.eastNorthUpToFixedFrame(u,r,tilt3DTransform),l=e._globe,u=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;r=Matrix4.clone(a.transform,tilt3DOldTransform);a._setTransform(c),rotate3D(e,t,i,Cartesian3.UNIT_Z),a._setTransform(r),e._globe=l;u=(e._ellipsoid=u).maximumRadius;e._rotateFactor=1/u,e._rotateRateRangeAdjustment=u}}function tilt3DOnTerrain(e,t,i){var r=e._ellipsoid,n=e._scene,a=n.camera,o=e._cameraUnderground;if(Cartesian2.equals(t,e._tiltCenterMousePosition))d=Cartesian3.clone(e._tiltCenter,tilt3DCenter);else{if(!defined(d=pickGlobe(e,t,tilt3DCenter))){var s=a.getPickRay(t,tilt3DRay),l=IntersectionTests.rayEllipsoid(s,r);if(!defined(l))return void(r.cartesianToCartographic(a.position,tilt3DCart).height<=e._minimumTrackBallHeight&&(e._looking=!0,u=e._ellipsoid.geodeticSurfaceNormal(a.position,tilt3DLookUp),look3D(e,t,i,u),Cartesian2.clone(t,e._tiltCenterMousePosition)));d=Ray.getPoint(s,l.start,tilt3DCenter)}o&&getTiltCenterUnderground(e,s=!defined(s)?a.getPickRay(t,tilt3DRay):s,d,d),Cartesian2.clone(t,e._tiltCenterMousePosition),Cartesian3.clone(d,e._tiltCenter)}var c=n.canvas,u=tilt3DWindowPos;u.x=c.clientWidth/2,u.y=e._tiltCenterMousePosition.y,s=a.getPickRay(u,tilt3DRay);var d,n=Cartesian3.magnitude(d),c=Cartesian3.fromElements(n,n,n,scratchRadii),u=Ellipsoid.fromCartesian3(c,scratchEllipsoid);defined(l=IntersectionTests.rayEllipsoid(s,u))&&(c=Cartesian3.magnitude(s.origin)>n?l.start:l.stop,n=Ray.getPoint(s,c,tilt3DVerticalCenter),l=Transforms.eastNorthUpToFixedFrame(d,r,tilt3DTransform),s=Transforms.eastNorthUpToFixedFrame(n,u,tilt3DVerticalTransform),c=e._globe,d=e._ellipsoid,e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1,r=Cartesian3.UNIT_Z,u=Matrix4.clone(a.transform,tilt3DOldTransform),a._setTransform(l),n=Cartesian3.cross(n,a.positionWC,tilt3DCartesian3),n=Cartesian3.dot(a.rightWC,n),rotate3D(e,t,i,r,!1,!0),a._setTransform(s),n<0?(n=i.startPosition.y-i.endPosition.y,(o&&n<0||!o&&0<n)&&(r=void 0),n=a.constrainedAxis,rotate3D(e,t,i,r,!(a.constrainedAxis=void 0),!1),a.constrainedAxis=n):rotate3D(e,t,i,r,!0,!1),defined(a.constrainedAxis)&&(r=Cartesian3.cross(a.direction,a.constrainedAxis,tilt3DCartesian3),Cartesian3.equalsEpsilon(r,Cartesian3.ZERO,CesiumMath.EPSILON6)||(Cartesian3.dot(r,a.right)<0&&Cartesian3.negate(r,r),Cartesian3.cross(r,a.direction,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.up,a.up),Cartesian3.normalize(a.right,a.right))),a._setTransform(u),e._globe=c,d=(e._ellipsoid=d).maximumRadius,e._rotateFactor=1/d,e._rotateRateRangeAdjustment=d,d=Cartesian3.clone(a.positionWC,tilt3DCartesian3),e.enableCollisionDetection&&adjustHeightForTerrain(e),Cartesian3.equals(a.positionWC,d)||(a._setTransform(s),a.worldToCameraCoordinatesPoint(d,d),s=Cartesian3.magnitudeSquared(d),Cartesian3.magnitudeSquared(a.position)>s&&(Cartesian3.normalize(a.position,a.position),Cartesian3.multiplyByScalar(a.position,Math.sqrt(s),a.position)),s=Cartesian3.angleBetween(d,a.position),d=Cartesian3.cross(d,a.position,d),Cartesian3.normalize(d,d),s=Quaternion.fromAxisAngle(d,s,tilt3DQuaternion),s=Matrix3.fromQuaternion(s,tilt3DMatrix),Matrix3.multiplyByVector(s,a.direction,a.direction),Matrix3.multiplyByVector(s,a.up,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.cross(a.right,a.direction,a.up),a._setTransform(u)))}var look3DStartPos=new Cartesian2,look3DEndPos=new Cartesian2,look3DStartRay=new Ray,look3DEndRay=new Ray,look3DNegativeRot=new Cartesian3,look3DTan=new Cartesian3;function look3D(e,t,i,r){var n=e._scene.camera,a=look3DStartPos;a.x=i.startPosition.x,a.y=0;var o=look3DEndPos;o.x=i.endPosition.x,o.y=0;var s=n.getPickRay(a,look3DStartRay),l=n.getPickRay(o,look3DEndRay),c=0;n.frustum instanceof OrthographicFrustum?(h=s.origin,d=l.origin,Cartesian3.add(n.direction,h,h),Cartesian3.add(n.direction,d,d),Cartesian3.subtract(h,n.position,h),Cartesian3.subtract(d,n.position,d),Cartesian3.normalize(h,h),Cartesian3.normalize(d,d)):(h=s.direction,d=l.direction);var u=Cartesian3.dot(h,d);u<1&&(c=Math.acos(u));var d,h,c=i.startPosition.x>i.endPosition.x?-c:c,e=e._horizontalRotationAxis;defined(r)?n.look(r,-c):defined(e)?n.look(e,-c):n.lookLeft(c),a.x=0,a.y=i.startPosition.y,o.x=0,o.y=i.endPosition.y,s=n.getPickRay(a,look3DStartRay),l=n.getPickRay(o,look3DEndRay),c=0,n.frustum instanceof OrthographicFrustum?(h=s.origin,d=l.origin,Cartesian3.add(n.direction,h,h),Cartesian3.add(n.direction,d,d),Cartesian3.subtract(h,n.position,h),Cartesian3.subtract(d,n.position,d),Cartesian3.normalize(h,h),Cartesian3.normalize(d,d)):(h=s.direction,d=l.direction),(u=Cartesian3.dot(h,d))<1&&(c=Math.acos(u)),c=i.startPosition.y>i.endPosition.y?-c:c,defined(r=defaultValue(r,e))?(h=n.direction,d=Cartesian3.negate(r,look3DNegativeRot),i=Cartesian3.equalsEpsilon(h,r,CesiumMath.EPSILON2),e=Cartesian3.equalsEpsilon(h,d,CesiumMath.EPSILON2),i||e?(i&&c<0||e&&0<c)&&n.look(n.right,-c):(u=Cartesian3.dot(h,r),e=CesiumMath.acosClamped(u),0<c&&e<c&&(c=e-CesiumMath.EPSILON4),u=Cartesian3.dot(h,d),e=CesiumMath.acosClamped(u),c<0&&e<-c&&(c=-e+CesiumMath.EPSILON4),h=Cartesian3.cross(r,h,look3DTan),n.look(h,c))):n.lookUp(c)}function update3D(e){reactToInput(e,e.enableRotate,e.rotateEventTypes,spin3D,e.inertiaSpin,"_lastInertiaSpinMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom3D,e.inertiaZoom,"_lastInertiaZoomMovement"),reactToInput(e,e.enableTilt,e.tiltEventTypes,tilt3D,e.inertiaSpin,"_lastInertiaTiltMovement"),reactToInput(e,e.enableLook,e.lookEventTypes,look3D)}var scratchAdjustHeightTransform=new Matrix4,scratchAdjustHeightCartographic=new Cartographic;function adjustHeightForTerrain(e){e._adjustedHeightForTerrain=!0;var t,i,r,n,a,o,s=e._scene,l=s.mode,c=s.globe;defined(c)&&l!==SceneMode$1.SCENE2D&&l!==SceneMode$1.MORPHING&&(t=s.camera,i=c.ellipsoid,r=s.mapProjection,Matrix4.equals(t.transform,Matrix4.IDENTITY)||(n=Matrix4.clone(t.transform,scratchAdjustHeightTransform),a=Cartesian3.magnitude(t.position),t._setTransform(Matrix4.IDENTITY)),o=scratchAdjustHeightCartographic,l===SceneMode$1.SCENE3D?i.cartesianToCartographic(t.position,o):r.unproject(t.position,o),c=!1,o.height<e._minimumCollisionTerrainHeight&&(defined(s=e._scene.globeHeight)&&(s=s+e.minimumZoomDistance,o.height<s&&(o.height=s,l===SceneMode$1.SCENE3D?i.cartographicToCartesian(o,t.position):r.project(o,t.position),c=!0))),defined(n)&&(t._setTransform(n),c&&(Cartesian3.normalize(t.position,t.position),Cartesian3.negate(t.position,t.direction),Cartesian3.multiplyByScalar(t.position,Math.max(a,e.minimumZoomDistance),t.position),Cartesian3.normalize(t.direction,t.direction),Cartesian3.cross(t.direction,t.up,t.right),Cartesian3.cross(t.right,t.direction,t.up))))}ScreenSpaceCameraController.prototype.onMap=function(){var e=this._scene,t=e.mode,e=e.camera;return t!==SceneMode$1.COLUMBUS_VIEW||Math.abs(e.position.x)-this._maxCoord.x<0&&Math.abs(e.position.y)-this._maxCoord.y<0};var scratchPreviousPosition=new Cartesian3,scratchPreviousDirection=new Cartesian3;ScreenSpaceCameraController.prototype.update=function(){var e=this._scene,t=e.camera,i=e.globe,r=e.mode;Matrix4.equals(t.transform,Matrix4.IDENTITY)?(this._globe=i,this._ellipsoid=(defined(this._globe)?this._globe:e.mapProjection).ellipsoid):(this._globe=void 0,this._ellipsoid=Ellipsoid.UNIT_SPHERE),this._cameraUnderground=e.cameraUnderground&&defined(this._globe),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*e.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*e.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*e.terrainExaggeration;i=this._ellipsoid.maximumRadius;this._rotateFactor=1/i,this._rotateRateRangeAdjustment=i,this._adjustedHeightForTerrain=!1;e=Cartesian3.clone(t.positionWC,scratchPreviousPosition),i=Cartesian3.clone(t.directionWC,scratchPreviousDirection);r===SceneMode$1.SCENE2D?update2D(this):r===SceneMode$1.COLUMBUS_VIEW?(this._horizontalRotationAxis=Cartesian3.UNIT_Z,updateCV(this)):r===SceneMode$1.SCENE3D&&(this._horizontalRotationAxis=void 0,update3D(this)),!this.enableCollisionDetection||this._adjustedHeightForTerrain||Cartesian3.equals(e,t.positionWC)&&Cartesian3.equals(i,t.directionWC)||adjustHeightForTerrain(this),this._aggregator.reset()},ScreenSpaceCameraController.prototype.isDestroyed=function(){return!1},ScreenSpaceCameraController.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),destroyObject(this)};var AdditiveBlend="uniform sampler2D colorTexture;\nuniform sampler2D colorTexture2;\nuniform vec2 center;\nuniform float radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(colorTexture, v_textureCoordinates);\nvec4 color1 = texture2D(colorTexture2, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - center) / radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color1, t);\n}\n",BrightPass="uniform sampler2D colorTexture;\nuniform float avgLuminance;\nuniform float threshold;\nuniform float offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(avgLuminance) * luminance / avgLuminance;\nfloat brightLum = max(scaledLum - threshold, 0.0);\nfloat brightness = brightLum / (offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n";function SunPostProcess(){this._sceneFramebuffer=new SceneFramebuffer;var e=new Array(6);e[0]=new PostProcessStage({fragmentShader:PassThrough,textureScale:.125,forcePowerOfTwo:!0,sampleMode:PostProcessStageSampleMode.LINEAR});var t=e[1]=new PostProcessStage({fragmentShader:BrightPass,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:.125,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new Cartesian2,e[2]=new PostProcessStage({fragmentShader:GaussianBlur1D,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:.125,forcePowerOfTwo:!0}),e[3]=new PostProcessStage({fragmentShader:GaussianBlur1D,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:.125,forcePowerOfTwo:!0}),e[4]=new PostProcessStage({fragmentShader:PassThrough,sampleMode:PostProcessStageSampleMode.LINEAR}),this._uCenter=new Cartesian2,this._uRadius=void 0,e[5]=new PostProcessStage({fragmentShader:AdditiveBlend,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.getFramebuffer().getColorTexture(0)}}}),this._stages=new PostProcessStageComposite({stages:e});for(var r=new PostProcessStageTextureCache(this),n=e.length,a=0;a<n;++a)e[a]._textureCache=r;this._textureCache=r,this.length=e.length}SunPostProcess.prototype.get=function(e){return this._stages.get(e)},SunPostProcess.prototype.getStageByName=function(e){for(var t=this._stages.length,i=0;i<t;++i){var r=this._stages.get(i);if(r.name===e)return r}};var sunPositionECScratch=new Cartesian4,sunPositionWCScratch=new Cartesian2,sizeScratch=new Cartesian2,postProcessMatrix4Scratch=new Matrix4;function updateSunPosition(e,t,i){var r=t.uniformState,n=r.sunPositionWC,a=r.view,o=r.viewProjection,s=r.projection,l=Matrix4.computeViewportTransformation(i,0,1,postProcessMatrix4Scratch),c=Matrix4.multiplyByPoint(a,n,sunPositionECScratch),u=Transforms.pointToGLWindowCoordinates(o,l,n,sunPositionWCScratch);c.x+=CesiumMath.SOLAR_RADIUS;r=Transforms.pointToGLWindowCoordinates(s,l,c,c),i=30*Cartesian2.magnitude(Cartesian2.subtract(r,u,r))*2,a=sizeScratch;a.x=i,a.y=i,e._uCenter=Cartesian2.clone(u,e._uCenter),e._uRadius=.15*Math.max(a.x,a.y);var s=t.drawingBufferWidth,c=t.drawingBufferHeight,d=e._stages,r=d.get(0),i=r.outputTexture.width,t=r.outputTexture.height,e=new BoundingRectangle;e.width=i,e.height=t,l=Matrix4.computeViewportTransformation(e,0,1,postProcessMatrix4Scratch),u=Transforms.pointToGLWindowCoordinates(o,l,n,sunPositionWCScratch),a.x*=i/s,a.y*=t/c;var h=r.scissorRectangle;h.x=Math.max(u.x-.5*a.x,0),h.y=Math.max(u.y-.5*a.y,0),h.width=Math.min(a.x,s),h.height=Math.min(a.y,c);for(var p=1;p<4;++p)BoundingRectangle.clone(h,d.get(p).scissorRectangle)}SunPostProcess.prototype.clear=function(e,t,i){this._sceneFramebuffer.clear(e,t,i),this._textureCache.clear(e)},SunPostProcess.prototype.update=function(e){var t=e.context,i=e.viewport,e=this._sceneFramebuffer;e.update(t,i);e=e.getFramebuffer();return this._textureCache.update(t),this._stages.update(t,!1),updateSunPosition(this,t,i),e},SunPostProcess.prototype.execute=function(e){var t=this._sceneFramebuffer.getFramebuffer().getColorTexture(0),i=this._stages,r=i.length;i.get(0).execute(e,t);for(var n=1;n<r;++n)i.get(n).execute(e,i.get(n-1).outputTexture)},SunPostProcess.prototype.copy=function(e,t){var i;defined(this._copyColorCommand)||((i=this)._copyColorCommand=e.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return i._stages.get(i._stages.length-1).outputTexture}},owner:this})),this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},SunPostProcess.prototype.isDestroyed=function(){return!1},SunPostProcess.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),destroyObject(this)};var requestRenderAfterFrame=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Scene(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).canvas,i=e.creditContainer,r=e.creditViewport,n=clone$1(e.contextOptions);defined(n)||(n={}),defined(n.webgl)||(n.webgl={}),n.webgl.powerPreference=defaultValue(n.webgl.powerPreference,"high-performance");var a=defined(i),n=new Context(t,n);a||((i=document.createElement("div")).style.position="absolute",i.style.bottom="0",i.style["text-shadow"]="0 0 2px #000000",i.style.color="#ffffff",i.style["font-size"]="10px",i.style["padding-right"]="5px",t.parentNode.appendChild(i)),defined(r)||(r=t.parentNode),this._id=createGuid(),this._jobScheduler=new JobScheduler,this._frameState=new FrameState(n,new CreditDisplay(i," • ",r),this._jobScheduler),this._frameState.scene3DOnly=defaultValue(e.scene3DOnly,!1),this._removeCreditContainer=!a,this._creditContainer=i,this._canvas=t,this._context=n,this._computeEngine=new ComputeEngine(n),this._globe=void 0,this._globeTranslucencyState=new GlobeTranslucencyState,this._primitives=new PrimitiveCollection,this._groundPrimitives=new PrimitiveCollection,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=n.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new TweenCollection,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=defaultValue(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new DepthPlane,this._clearColorCommand=new ClearCommand({color:new Color,stencil:0,owner:this}),this._depthClearCommand=new ClearCommand({depth:1,owner:this}),this._stencilClearCommand=new ClearCommand({stencil:0}),this._classificationStencilClearCommand=new ClearCommand({stencil:0,renderState:RenderState.fromCache({stencilMask:StencilConstants$1.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new SceneTransitioner(this),this._preUpdate=new Event,this._postUpdate=new Event,this._renderError=new Event,this._preRender=new Event,this._postRender=new Event,this._minimumDisableDepthTestDistance=0,this._debugInspector=new DebugInspector,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Event,this.morphComplete=new Event,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=Color.clone(Color.BLACK),this._mode=SceneMode$1.SCENE3D,this._mapProjection=defined(e.mapProjection)?e.mapProjection:new GeographicProjection,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new Fog,this._shadowMapCamera=new Camera(this),this.shadowMap=new ShadowMap({context:n,lightCamera:this._shadowMapCamera,enabled:defaultValue(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=Color.clone(Color.WHITE),this._actualInvertClassificationColor=Color.clone(this._invertClassificationColor),this._invertClassification=new InvertClassification,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new PostProcessStageCollection,this._brdfLutGenerator=new BrdfLutGenerator,this._terrainExaggeration=defaultValue(e.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new ScreenSpaceCameraController(this),this._cameraUnderground=!1,this._mapMode2D=defaultValue(e.mapMode2D,MapMode2D$1.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,separatePrimitiveFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=defaultValue(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=defaultValue(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=RequestScheduler.requestCompletedEvent.addEventListener(requestRenderAfterFrame(this)),this._removeTaskProcessorListenerCallback=TaskProcessor.taskCompletedEvent.addEventListener(requestRenderAfterFrame(this)),this._removeGlobeCallbacks=[];e=new BoundingRectangle(0,0,n.drawingBufferWidth,n.drawingBufferHeight),n=new Camera(this);this._logDepthBuffer&&(n.frustum.near=.1,n.frustum.far=1e10),this.preloadFlightCamera=new Camera(this),this.preloadFlightCullingVolume=void 0,this._picking=new Picking(this),this._defaultView=new View(this,n,e),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._specularEnvironmentMapAtlas=void 0,this.light=new SunLight,updateFrameNumber(this,0,JulianDate.now()),this.updateFrameState(),this.initializeFrame()}function updateGlobeListeners(e,t){for(var i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;var r=[];defined(t)&&(r.push(t.imageryLayersUpdatedEvent.addEventListener(requestRenderAfterFrame(e))),r.push(t.terrainProviderChanged.addEventListener(requestRenderAfterFrame(e)))),e._removeGlobeCallbacks=r}function updateDerivedCommands(e,t,i){var r=e._frameState,n=e._context,a=e._view.oit,o=r.shadowState.lightShadowMaps,s=r.shadowState.lightShadowsEnabled,r=t.derivedCommands;defined(t.pickId)&&(r.picking=DerivedCommand.createPickDerivedCommand(e,t,n,r.picking)),t.pickOnly||(r.depth=DerivedCommand.createDepthOnlyDerivedCommand(e,t,n,r.depth)),r.originalCommand=t,e._hdr&&(r.hdr=DerivedCommand.createHdrCommand(t,n,r.hdr),r=(t=r.hdr.command).derivedCommands),s&&t.receiveShadows&&(r.shadows=ShadowMap.createReceiveDerivedCommand(o,t,i,n,r.shadows)),t.pass===Pass$1.TRANSLUCENT&&defined(a)&&a.isSupported()&&(s&&t.receiveShadows?(r.oit=defined(r.oit)?r.oit:{},r.oit.shadows=a.createDerivedCommands(r.shadows.receiveCommand,n,r.oit.shadows)):r.oit=a.createDerivedCommands(t,n,r.oit))}Object.defineProperties(Scene.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 ContextLimits.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return ContextLimits.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 OctahedralProjectedCubeMap.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,updateGlobeListeners(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(defined(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(defined(this.globe))return this.globe.terrainProvider},set:function(e){defined(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(defined(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===SceneMode$1.SCENE2D?this.morphTo2D(0):e===SceneMode$1.SCENE3D?this.morphTo3D(0):e===SceneMode$1.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Camera(this),defined(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new DeviceOrientationCameraController(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}},imagerySplitPosition:{get:function(){return this._frameState.imagerySplitPosition},set:function(e){this._frameState.imagerySplitPosition=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){var t=this._context,t=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=t!==this._hdr,this._hdr=t}},highDynamicRangeSupported:{get:function(){var e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},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}}}),Scene.prototype.getCompressedTextureFormatSupported=function(e){var t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1},Scene.prototype.updateDerivedCommands=function(e){var t,i,r,n,a,o,s,l,c,u;defined(e.derivedCommands)&&(t=this._frameState,i=this._context,r=!1,l=t.shadowState.lastDirtyTime,e.lastDirtyTime!==l&&(e.lastDirtyTime=l,r=e.dirty=!0),n=t.useLogDepth,c=this._hdr,o=defined((a=e.derivedCommands).logDepth),u=defined(a.hdr),s=defined(a.originalCommand),l=n&&!o,u=c&&!u,c=!(n&&c||s),e.dirty=e.dirty||l||u||c,e.dirty&&(e.dirty=!1,u=t.shadowState.shadowMaps,t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=ShadowMap.createCastDerivedCommand(u,e,r,i,a.shadows)),(o||l)&&(a.logDepth=DerivedCommand.createLogDepthCommand(e,i,a.logDepth),updateDerivedCommands(this,a.logDepth.command,r)),(s||c)&&updateDerivedCommands(this,e,r)))};var renderTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.RENDER}),preloadTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PRELOAD}),preloadFlightTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PRELOAD_FLIGHT}),requestRenderModeDeferCheckPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.REQUEST_RENDER_MODE_DEFER_CHECK}),scratchOccluderBoundingSphere=new BoundingSphere,scratchOccluder;function getOccluder(e){var t=e.globe;if(e._mode===SceneMode$1.SCENE3D&&defined(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){var i=t.ellipsoid,t=e.frameState.minimumTerrainHeight;return scratchOccluderBoundingSphere.radius=i.minimumRadius+t,scratchOccluder=Occluder.fromBoundingSphere(scratchOccluderBoundingSphere,e.camera.positionWC,scratchOccluder)}}function updateFrameNumber(e,t,i){e=e._frameState;e.frameNumber=t,e.time=JulianDate.clone(i,e.time)}Scene.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1},Scene.prototype.updateFrameState=function(){var 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=getOccluder(this),t.terrainExaggeration=this._terrainExaggeration,t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof OrthographicFrustum||this.camera.frustum instanceof OrthographicOffCenterFrustum),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=Color.clone(this.invertClassificationColor,this._actualInvertClassificationColor),InvertClassification.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,defined(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0},Scene.prototype.isVisible=function(e,t,i){return defined(e)&&(!defined(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==Intersect$1.OUTSIDE&&(!defined(i)||!e.occlude||!e.boundingVolume.isOccluded(i)))};var transformFrom2D=new Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function debugShowBoundingVolume(e,t,i,r){var n=t._frameState,a=n.context,o=e.boundingVolume;defined(t._debugVolume)&&t._debugVolume.destroy();var s,l,c,u=Cartesian3.clone(o.center);n.mode!==SceneMode$1.SCENE3D&&(u=Matrix4.multiplyByPoint(transformFrom2D,u,u),l=(s=n.mapProjection).unproject(u),u=s.ellipsoid.cartographicToCartesian(l)),defined(o.radius)?(c=o.radius,c=GeometryPipeline.toWireframe(EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(c,c,c),vertexFormat:PerInstanceColorAppearance.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Primitive({geometryInstances:new GeometryInstance({geometry:c,modelMatrix:Matrix4.fromTranslation(u),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)}}),appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1})):(h=o.halfAxes,c=GeometryPipeline.toWireframe(BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:PerInstanceColorAppearance.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Primitive({geometryInstances:new GeometryInstance({geometry:c,modelMatrix:Matrix4.fromRotationTranslation(h,u,new Matrix4),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)}}),appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1}));var d,h=n.commandList,u=n.commandList=[];t._debugVolume.update(n),e=u[0],n.useLogDepth&&(e=DerivedCommand.createLogDepthCommand(e,a).command),defined(r)&&(d=i.framebuffer,i.framebuffer=r),e.execute(a,i),defined(d)&&(i.framebuffer=d),n.commandList=h}function executeCommand(e,t,i,r,n){var a=t._frameState;if(!defined(t.debugCommandFilter)||t.debugCommandFilter(e))if(e instanceof ClearCommand)e.execute(i,r);else{e.debugShowBoundingVolume&&defined(e.boundingVolume)&&debugShowBoundingVolume(e,t,r,n),a.useLogDepth&&defined(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);n=a.passes;if(!n.pick&&!n.depth&&t._hdr&&defined(e.derivedCommands)&&defined(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),n.pick||n.depth){if(n.pick&&!n.depth&&defined(e.derivedCommands.picking))return void(e=e.derivedCommands.picking.pickCommand).execute(i,r);if(defined(e.derivedCommands.depth))return void(e=e.derivedCommands.depth.depthOnlyCommand).execute(i,r)}t.debugShowCommands||t.debugShowFrustums?t._debugInspector.executeDebugShowFrustumsCommand(t,e,r):(a.shadowState.lightShadowsEnabled&&e.receiveShadows&&defined(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand:e).execute(i,r)}}function executeIdCommand(e,t,i,r){var n=t._frameState,t=e.derivedCommands;defined(t)&&(n.useLogDepth&&defined(t.logDepth)&&(e=t.logDepth.command),defined((t=e.derivedCommands).picking)?(e=t.picking.pickCommand).execute(i,r):defined(t.depth)&&(e=t.depth.depthOnlyCommand).execute(i,r))}function backToFront(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function frontToBack(e,t,i){return e.boundingVolume.distanceSquaredTo(i)-t.boundingVolume.distanceSquaredTo(i)+CesiumMath.EPSILON12}function executeTranslucentCommandsBackToFront(e,t,i,r,n){var a=e.context;mergeSort(r,backToFront,e.camera.positionWC),defined(n)&&t(n.unclassifiedCommand,e,a,i);for(var o=r.length,s=0;s<o;++s)t(r[s],e,a,i)}function executeTranslucentCommandsFrontToBack(e,t,i,r,n){var a=e.context;mergeSort(r,frontToBack,e.camera.positionWC),defined(n)&&t(n.unclassifiedCommand,e,a,i);for(var o=r.length,s=0;s<o;++s)t(r[s],e,a,i)}function getDebugGlobeDepth(e,t){var i=e._view.debugGlobeDepths,r=i[t];return!defined(r)&&e.context.depthTexture&&(r=new GlobeDepth,i[t]=r),r}var transformFrom2D=Matrix4.inverseTransformation(transformFrom2D,transformFrom2D),scratchPerspectiveFrustum=new PerspectiveFrustum,scratchPerspectiveOffCenterFrustum=new PerspectiveOffCenterFrustum,scratchOrthographicFrustum=new OrthographicFrustum,scratchOrthographicOffCenterFrustum=new OrthographicOffCenterFrustum;function executeCommands(e,t){var i,r=e.camera,n=e.context,a=e.frameState,o=n.uniformState;o.updateCamera(r),(i=defined(r.frustum.fov)?r.frustum.clone(scratchPerspectiveFrustum):defined(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(scratchPerspectiveOffCenterFrustum):defined(r.frustum.width)?r.frustum.clone(scratchOrthographicFrustum):r.frustum.clone(scratchOrthographicOffCenterFrustum)).near=r.frustum.near,i.far=r.frustum.far,o.updateFrustum(i),o.updatePass(Pass$1.ENVIRONMENT);var s,l=a.passes,c=l.pick,u=e._environmentState,d=e._view,h=u.renderTranslucentDepthForPick,p=u.useWebVR;c||(defined(s=u.skyBoxCommand)&&executeCommand(s,e,n,t),u.isSkyAtmosphereVisible&&executeCommand(u.skyAtmosphereCommand,e,n,t),u.isSunVisible&&(u.sunDrawCommand.execute(n,t),e.sunBloom&&!p&&(p=u.useGlobeDepthFramebuffer?d.globeDepth.framebuffer:u.usePostProcess?d.sceneFramebuffer.getFramebuffer():u.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,p),t.framebuffer=p)),u.isMoonVisible&&u.moonCommand.execute(n,t));for(var m,f=u.useOIT?(defined(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r,n){d.oit.executeCommands(e,t,i,r,n)}),e._executeOITFunction):l.render?executeTranslucentCommandsBackToFront:executeTranslucentCommandsFrontToBack,g=d.frustumCommandsList,_=g.length,y=u.clearGlobeDepth,C=u.useDepthPlane,v=e._globeTranslucencyState,S=v.translucent,T=e._view.globeTranslucencyFramebuffer,x=(u.separatePrimitiveFramebuffer=!1,e._depthClearCommand),b=e._stencilClearCommand,E=e._classificationStencilClearCommand,P=e._depthPlane,A=u.usePostProcessSelected,w=r.position.z,D=0;D<_;++D){var M=_-D-1,I=g[M];e.mode===SceneMode$1.SCENE2D?(r.position.z=w-I.near+1,i.far=Math.max(1,I.far-I.near),i.near=1,o.update(a)):(i.near=0!=M?I.near*e.opaqueFrustumNearOffset:I.near,i.far=I.far),o.updateFrustum(i);var R,O=e.debugShowGlobeDepth?getDebugGlobeDepth(e,M):d.globeDepth;0,e.debugShowGlobeDepth&&defined(O)&&u.useGlobeDepthFramebuffer&&(O.update(n,t,d.viewport,e._hdr,y),O.clear(n,t,e._clearColorCommand.color),R=t.framebuffer,t.framebuffer=O.framebuffer),x.execute(n,t),n.stencilBuffer&&b.execute(n,t),o.updatePass(Pass$1.GLOBE);var L,F=I.commands[Pass$1.GLOBE],N=I.indices[Pass$1.GLOBE];if(S)v.executeGlobeCommands(I,executeCommand,T,e,t);else for(m=0;m<N;++m)executeCommand(F[m],e,n,t);if(defined(O)&&u.useGlobeDepthFramebuffer&&O.executeCopyDepth(n,t),e.debugShowGlobeDepth&&defined(O)&&u.useGlobeDepthFramebuffer&&(t.framebuffer=R),!u.renderTranslucentDepthForPick)if(o.updatePass(Pass$1.TERRAIN_CLASSIFICATION),F=I.commands[Pass$1.TERRAIN_CLASSIFICATION],N=I.indices[Pass$1.TERRAIN_CLASSIFICATION],S)v.executeGlobeClassificationCommands(I,executeCommand,T,e,t);else for(m=0;m<N;++m)executeCommand(F[m],e,n,t);if(y&&(x.execute(n,t),C&&P.execute(n,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],m=0;m<N;++m)executeCommand(F[m],e,n,t);if(0<N&&(defined(O)&&u.useGlobeDepthFramebuffer&&O.executeUpdateDepth(n,t,y),!u.renderTranslucentDepthForPick))for(o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<N;++m)executeCommand(F[m],e,n,t)}else{e._invertClassification.clear(n,t);var B=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo,o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],m=0;m<N;++m)executeCommand(F[m],e,n,t);for(defined(O)&&u.useGlobeDepthFramebuffer&&O.executeUpdateDepth(n,t,y),o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],m=0;m<N;++m)executeCommand(F[m],e,n,t);for(t.framebuffer=B,e._invertClassification.executeClassified(n,t),1===a.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(n,t),0<N&&n.stencilBuffer&&E.execute(n,t),o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<N;++m)executeCommand(F[m],e,n,t)}for(0<N&&n.stencilBuffer&&b.execute(n,t),o.updatePass(Pass$1.OPAQUE),F=I.commands[Pass$1.OPAQUE],N=I.indices[Pass$1.OPAQUE],m=0;m<N;++m)executeCommand(F[m],e,n,t);if(0!=M&&e.mode!==SceneMode$1.SCENE2D&&(i.near=I.near,o.updateFrustum(i)),!c&&u.useInvertClassification&&a.invertClassificationColor.alpha<1&&(L=e._invertClassification),o.updatePass(Pass$1.TRANSLUCENT),(F=I.commands[Pass$1.TRANSLUCENT]).length=I.indices[Pass$1.TRANSLUCENT],f(e,executeCommand,t,F,L),n.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||h)&&(O=(h?t:O).framebuffer.depthStencilTexture,(V=e._picking.getPickDepth(e,M)).update(n,O),V.executeCopyDepth(n,t)),!c&&A){var V=t.framebuffer;if(t.framebuffer=d.sceneFramebuffer.getIdFramebuffer(),i.near=0!=M?I.near*e.opaqueFrustumNearOffset:I.near,i.far=I.far,o.updateFrustum(i),o.updatePass(Pass$1.GLOBE),F=I.commands[Pass$1.GLOBE],N=I.indices[Pass$1.GLOBE],S)v.executeGlobeCommands(I,executeIdCommand,T,e,t);else for(m=0;m<N;++m)executeIdCommand(F[m],e,n,t);for(y&&(x.framebuffer=t.framebuffer,x.execute(n,t),x.framebuffer=void 0),y&&C&&P.execute(n,t),o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],m=0;m<N;++m)executeIdCommand(F[m],e,n,t);for(o.updatePass(Pass$1.OPAQUE),F=I.commands[Pass$1.OPAQUE],N=I.indices[Pass$1.OPAQUE],m=0;m<N;++m)executeIdCommand(F[m],e,n,t);for(o.updatePass(Pass$1.TRANSLUCENT),F=I.commands[Pass$1.TRANSLUCENT],N=I.indices[Pass$1.TRANSLUCENT],m=0;m<N;++m)executeIdCommand(F[m],e,n,t);t.framebuffer=V}}}function executeComputeCommands(e){e.context.uniformState.updatePass(Pass$1.COMPUTE);var t=e._environmentState.sunComputeCommand;defined(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;n<r;++n)i[n].execute(e._computeEngine)}function executeOverlayCommands(e,t){e.context.uniformState.updatePass(Pass$1.OVERLAY);for(var i=e.context,r=e._overlayCommandList,n=r.length,a=0;a<n;++a)r[a].execute(i,t)}function insertShadowCastCommands(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,a=i.passes,o=a.length,s=t.length,l=0;l<s;++l){var c=t[l];if(e.updateDerivedCommands(c),c.castShadows&&(c.pass===Pass$1.GLOBE||c.pass===Pass$1.CESIUM_3D_TILE||c.pass===Pass$1.OPAQUE||c.pass===Pass$1.TRANSLUCENT)&&e.isVisible(c,r))if(n)for(var u=0;u<o;++u)a[u].commandList.push(c);else if(1===o)a[0].commandList.push(c);else for(var d=!1,h=o-1;0<=h;--h){var p=a[h].cullingVolume;if(e.isVisible(c,p))a[h].commandList.push(c),d=!0;else if(d)break}}}function executeShadowMapCastCommands(e){var t=e.frameState,i=t.shadowState.shadowMaps,r=i.length;if(t.shadowState.shadowsEnabled)for(var n=e.context,a=n.uniformState,o=0;o<r;++o){var s=i[o];if(!s.outOfView){for(var l=s.passes,c=l.length,u=0;u<c;++u)l[u].commandList.length=0;for(insertShadowCastCommands(e,e.frameState.commandList,s),u=0;u<c;++u){var d=s.passes[u];a.updateCamera(d.camera),s.updatePass(n,u);for(var h=d.commandList.length,p=0;p<h;++p){var m=d.commandList[p];a.updatePass(m.pass),executeCommand(m.derivedCommands.shadows.castCommands[o],e,n,d.passState)}}}}}var scratchEyeTranslation=new Cartesian3;function executeWebVRCommands(e,t,i){var r=e._view,n=r.camera,a=e._environmentState.renderTranslucentDepthForPick;updateAndClearFramebuffers(e,t,i),a||updateAndRenderPrimitives(e),r.createPotentiallyVisibleSet(e),a||(executeComputeCommands(e),executeShadowMapCastCommands(e));var o=t.viewport;o.x=0,o.y=0,o.width=.5*o.width;var s=Camera.clone(n,e._cameraVR);s.frustum=n.frustum;var l=n.frustum.near,i=l*defaultValue(e.focalLength,5),r=defaultValue(e.eyeSeparation,i/30),a=Cartesian3.multiplyByScalar(s.right,.5*r,scratchEyeTranslation);n.frustum.aspectRatio=o.width/o.height;i=.5*r*l/i;Cartesian3.add(s.position,a,n.position),n.frustum.xOffset=i,executeCommands(e,t),o.x=o.width,Cartesian3.subtract(s.position,a,n.position),n.frustum.xOffset=-i,executeCommands(e,t),Camera.clone(s,n)}Scene.prototype.updateAndExecuteCommands=function(e,t){var i=this._frameState.mode;this._environmentState.useWebVR?executeWebVRCommands(this,e,t):i!==SceneMode$1.SCENE2D||this._mapMode2D===MapMode2D$1.ROTATE?executeCommandsInViewport(!0,this,e,t):(updateAndClearFramebuffers(this,e,t),execute2DViewportCommands(this,e))};var scratch2DViewportCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratch2DViewportMaxCoord=new Cartesian3,scratch2DViewportSavedPosition=new Cartesian3,scratch2DViewportTransform=new Matrix4,scratch2DViewportCameraTransform=new Matrix4,scratch2DViewportEyePoint=new Cartesian3,scratch2DViewportWindowCoords=new Cartesian3,scratch2DViewport=new BoundingRectangle;function execute2DViewportCommands(e,t){var i=e.context,r=e.frameState,n=e.camera,a=t.viewport,o=BoundingRectangle.clone(a,scratch2DViewport);t.viewport=o;var s=scratch2DViewportMaxCoord;e.mapProjection.project(scratch2DViewportCartographic,s);var l=Cartesian3.clone(n.position,scratch2DViewportSavedPosition),c=Matrix4.clone(n.transform,scratch2DViewportCameraTransform),u=n.frustum.clone();n._setTransform(Matrix4.IDENTITY);var d=Matrix4.computeViewportTransformation(o,0,1,scratch2DViewportTransform),h=n.frustum.projectionMatrix,p=n.positionWC.y,m=Cartesian3.fromElements(CesiumMath.sign(p)*s.x-p,0,-n.positionWC.x,scratch2DViewportEyePoint),f=Transforms.pointToGLWindowCoordinates(h,d,m,scratch2DViewportWindowCoords);f.x=Math.floor(f.x);h=o.x,d=o.width;0===p||f.x<=h||f.x>=h+d?executeCommandsInViewport(!0,e,t):(Math.abs(h+.5*d-f.x)<1?(o.width=f.x-o.x,n.position.x*=CesiumMath.sign(n.position.x),n.frustum.right=0,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=f.x,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=0):f.x>h+.5*d?(o.width=f.x-h,m=n.frustum.right,n.frustum.right=s.x-p,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=f.x,o.width=h+d-f.x,n.position.x=-n.position.x,n.frustum.left=-n.frustum.right,n.frustum.right=m-2*n.frustum.right):(o.x=f.x,o.width=h+d-f.x,d=n.frustum.left,n.frustum.left=-s.x-p,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=h,o.width=f.x-h,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=d-2*n.frustum.left),r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!1,e,t)),n._setTransform(c),Cartesian3.clone(l,n.position),n.frustum=u.clone(),t.viewport=a}function executeCommandsInViewport(e,t,i,r){var n=t._environmentState,a=t._view,n=n.renderTranslucentDepthForPick;e||n||(t.frameState.commandList.length=0),n||updateAndRenderPrimitives(t),a.createPotentiallyVisibleSet(t),e&&(defined(r)&&updateAndClearFramebuffers(t,i,r),n||(executeComputeCommands(t),executeShadowMapCastCommands(t))),executeCommands(t,i)}var scratchCullingVolume=new CullingVolume;function updateDebugFrustumPlanes(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new DebugCameraPrimitive({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),defined(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function updateShadowMaps(e){var t=e._frameState,i=t.shadowMaps,r=i.length,e=0<r&&!t.passes.pick&&e.mode===SceneMode$1.SCENE3D;if(e!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=e),t.shadowState.lightShadowsEnabled=!1,e){for(var n=0;n<r;++n)if(i[n]!==t.shadowState.shadowMaps[n]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0;for(var a=t.shadowState.lightShadowMaps.length=0;a<r;++a){var o=i[a];o.update(t),t.shadowState.shadowMaps.push(o),o.fromLightSource&&(t.shadowState.lightShadowMaps.push(o),t.shadowState.lightShadowsEnabled=!0),o.dirty&&(++t.shadowState.lastDirtyTime,o.dirty=!1)}}}function updateAndRenderPrimitives(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),updateDebugFrustumPlanes(e),updateShadowMaps(e),e._globe&&e._globe.render(t)}function updateAndClearFramebuffers(e,t,i){var r=e._context,n=e._frameState,a=e._environmentState,o=e._view,s=e._frameState.passes.pick,l=a.useWebVR;a.originalFramebuffer=t.framebuffer,defined(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new SunPostProcess:defined(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!defined(e.sun)&&defined(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var c=e._clearColorCommand;Color.clone(i,c.color),c.execute(r,t);var u=a.useGlobeDepthFramebuffer=defined(o.globeDepth);u&&(o.globeDepth.update(r,t,o.viewport,e._hdr,a.clearGlobeDepth),o.globeDepth.clear(r,t,i));var d=o.oit,h=a.useOIT=!s&&defined(d)&&d.isSupported();h&&(d.update(r,t,o.globeDepth.framebuffer,e._hdr),d.clear(r,t,i),a.useOIT=d.isSupported());var p,m=e.postProcessStages,f=a.usePostProcess=!s&&(e._hdr||0<m.length||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);a.usePostProcessSelected=!1,f&&(o.sceneFramebuffer.update(r,o.viewport,e._hdr),o.sceneFramebuffer.clear(r,t,i),m.update(r,n.useLogDepth,e._hdr),m.clear(r),f=a.usePostProcess=m.ready,a.usePostProcessSelected=f&&m.hasSelected),a.isSunVisible&&e.sunBloom&&!l?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(r,t,i)):u?t.framebuffer=o.globeDepth.framebuffer:f&&(t.framebuffer=o.sceneFramebuffer.getFramebuffer()),defined(t.framebuffer)&&c.execute(r,t),(a.useInvertClassification=!s&&defined(t.framebuffer)&&e.invertClassification)&&(defined(p=1===e.frameState.invertClassificationColor.alpha&&a.useGlobeDepthFramebuffer?o.globeDepth.framebuffer:p)||r.depthTexture?(e._invertClassification.previousFramebuffer=p,e._invertClassification.update(r),e._invertClassification.clear(r,t),e.frameState.invertClassificationColor.alpha<1&&h&&((h=(p=e._invertClassification.unclassifiedCommand).derivedCommands).oit=d.createDerivedCommands(p,r,h.oit))):a.useInvertClassification=!1),e._globeTranslucencyState.translucent&&o.globeTranslucencyFramebuffer.updateAndClear(e._hdr,o.viewport,r,t)}function callAfterRenderFunctions(e){for(var t=e._frameState.afterRender,i=0,r=t.length;i<r;++i)t[i](),e.requestRender();t.length=0}function getGlobeHeight(e){var t=e._globe,e=e.camera.positionCartographic;if(defined(t)&&t.show&&defined(e))return t.getHeight(e)}function isCameraUnderground(e){var t=e.camera,i=e._mode,r=e.globe,n=e._screenSpaceCameraController,t=t.positionCartographic;if(!defined(t))return!1;if(!n.onMap()&&t.height<0)return!0;if(!defined(r)||!r.show||i===SceneMode$1.SCENE2D||i===SceneMode$1.MORPHING)return!1;e=e._globeHeight;return defined(e)&&t.height<e}function updateDebugShowFramesPerSecond(e,t){var i,r;e.debugShowFramesPerSecond?(defined(e._performanceDisplay)||((i=document.createElement("div")).className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(i),r=new PerformanceDisplay({container:i}),e._performanceDisplay=r,e._performanceContainer=i),e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)):defined(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function prePassesUpdate(e){e._jobScheduler.resetBudgets();var t=e._frameState;e.primitives.prePassesUpdate(t),defined(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function postPassesUpdate(e){var t=e._frameState;e.primitives.postPassesUpdate(t),RequestScheduler.update()}Scene.prototype.updateEnvironment=function(){var e=this._frameState,t=this._view,i=this._environmentState,r=e.passes.render,n=e.passes.offscreen,a=this.skyAtmosphere,o=this.globe,s=this._globeTranslucencyState;!r||this._mode!==SceneMode$1.SCENE2D&&t.camera.frustum instanceof OrthographicFrustum||!s.environmentVisible?(i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0):(defined(a)?(defined(o)&&(a.setDynamicAtmosphereColor(o.enableLighting&&o.dynamicAtmosphereLighting,o.dynamicAtmosphereLightingFromSun),i.isReadyForAtmosphere=i.isReadyForAtmosphere||0<o._surface._tilesToRender.length),i.skyAtmosphereCommand=a.update(e,o),defined(i.skyAtmosphereCommand)&&this.updateDerivedCommands(i.skyAtmosphereCommand)):i.skyAtmosphereCommand=void 0,i.skyBoxCommand=defined(this.skyBox)?this.skyBox.update(e,this._hdr):void 0,t=defined(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0,i.sunDrawCommand=defined(t)?t.drawCommand:void 0,i.sunComputeCommand=defined(t)?t.computeCommand:void 0,i.moonCommand=defined(this.moon)?this.moon.update(e):void 0);o=i.clearGlobeDepth=defined(o)&&o.show&&(!o.depthTestAgainstTerrain||this.mode===SceneMode$1.SCENE2D);(i.useDepthPlane=o&&this.mode===SceneMode$1.SCENE3D&&s.useDepthPlane)&&this._depthPlane.update(e),i.renderTranslucentDepthForPick=!1,i.useWebVR=this._useWebVR&&this.mode!==SceneMode$1.SCENE2D&&!n;for(var s=e.mode!==SceneMode$1.SCENE3D||s.sunVisibleThroughGlobe?void 0:e.occluder,l=e.cullingVolume,c=scratchCullingVolume.planes,u=0;u<5;++u)c[u]=l.planes[u];l=scratchCullingVolume,i.isSkyAtmosphereVisible=defined(i.skyAtmosphereCommand)&&i.isReadyForAtmosphere,i.isSunVisible=this.isVisible(i.sunDrawCommand,l,s),i.isMoonVisible=this.isVisible(i.moonCommand,l,s);i=this.specularEnvironmentMaps,s=this._specularEnvironmentMapAtlas;!defined(i)||defined(s)&&s.url===i?!defined(i)&&defined(s)&&(s.destroy(),this._specularEnvironmentMapAtlas=void 0):(s=s&&s.destroy(),this._specularEnvironmentMapAtlas=new OctahedralProjectedCubeMap(i)),defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)},Scene.prototype.resolveFramebuffers=function(e){var t=this._context,i=this._frameState,r=this._environmentState,n=this._view,a=n.globeDepth,o=r.useOIT,s=r.useGlobeDepthFramebuffer,l=r.usePostProcess,c=r.originalFramebuffer,u=s?a.framebuffer:void 0,d=n.sceneFramebuffer.getFramebuffer(),h=n.sceneFramebuffer.getIdFramebuffer();r.separatePrimitiveFramebuffer&&a.executeMergeColor(t,e),o&&(e.framebuffer=l?d:c,n.oit.execute(t,e)),l&&(r=s&&!o?u:d,n=this.postProcessStages,r=r.getColorTexture(0),h=h.getColorTexture(0),d=defaultValue(u,d).depthStencilTexture,n.execute(t,r,d,h),n.copy(t,c)),o||l||!s||(e.framebuffer=c,a.executeCopyColor(t,e));i=i.useLogDepth;this.debugShowGlobeDepth&&s&&getDebugGlobeDepth(this,this.debugShowDepthFrustum-1).executeDebugGlobeDepth(t,e,i),this.debugShowPickDepth&&s&&this._picking.getPickDepth(this,this.debugShowDepthFrustum-1).executeDebugPickDepth(t,e,i)},Scene.prototype.initializeFrame=function(){120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=getGlobeHeight(this),this._cameraUnderground=isCameraUnderground(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),defined(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};var scratchBackgroundColor=new Color;function render(e){var t=e._frameState,i=e.context,r=i.uniformState,n=e._defaultView;e._view=n,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=renderTilesetPassState;var a=defaultValue(e.backgroundColor,Color.BLACK);e._hdr&&((a=Color.clone(a,scratchBackgroundColor)).red=Math.pow(a.red,e.gamma),a.green=Math.pow(a.green,e.gamma),a.blue=Math.pow(a.blue,e.gamma)),t.backgroundColor=a,e.fog.update(t),r.update(t);var o=e.shadowMap;defined(o)&&o.enabled&&(!defined(e.light)||e.light instanceof SunLight?Cartesian3.negate(r.sunDirectionWC,e._shadowMapCamera.direction):Cartesian3.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(o)),e._computeCommandList.length=0,e._overlayCommandList.length=0;o=n.viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;n=n.passState;n.framebuffer=void 0,n.blendingEnabled=void 0,n.scissorTest=void 0,n.viewport=BoundingRectangle.clone(o,n.viewport),defined(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(n,a),e.resolveFramebuffers(n),n.framebuffer=void 0,executeOverlayCommands(e,n),defined(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),i.endFrame()}function tryAndCatchError(t,e){try{e(t)}catch(e){if(t._renderError.raiseEvent(t,e),t.rethrowRenderErrors)throw e}}function updateMostDetailedRayPicks(e){return e._picking.updateMostDetailedRayPicks(e)}function updatePreloadPass(e){var t=e._frameState;preloadTilesetPassState.camera=t.camera,preloadTilesetPassState.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,preloadTilesetPassState)}function updatePreloadFlightPass(e){var t=e._frameState;t.camera.canPreloadFlight()&&(preloadFlightTilesetPassState.camera=e.preloadFlightCamera,preloadFlightTilesetPassState.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,preloadFlightTilesetPassState))}function updateRequestRenderModeDeferCheckPass(e){e.primitives.updateForPass(e._frameState,requestRenderModeDeferCheckPassState)}Scene.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);var t=this._frameState;t.newFrame=!1,defined(e)||(e=JulianDate.now());var i=this._view.checkForCameraUpdates(this),r=!this.requestRenderMode||this._renderRequested||i||this._logDepthBufferDirty||this._hdrDirty||this.mode===SceneMode$1.MORPHING;!r&&defined(this.maximumRenderTimeChange)&&defined(this._lastRenderTime)&&(i=Math.abs(JulianDate.secondsDifference(this._lastRenderTime,e)),r=r||i>this.maximumRenderTimeChange),r&&(this._lastRenderTime=JulianDate.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1,updateFrameNumber(this,CesiumMath.incrementWrap(t.frameNumber,15e6,1),e),t.newFrame=!0),tryAndCatchError(this,prePassesUpdate),this.primitives.show&&(tryAndCatchError(this,updateMostDetailedRayPicks),tryAndCatchError(this,updatePreloadPass),tryAndCatchError(this,updatePreloadFlightPass),r||tryAndCatchError(this,updateRequestRenderModeDeferCheckPass)),this._postUpdate.raiseEvent(this,e),r&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),tryAndCatchError(this,render)),updateDebugShowFramesPerSecond(this,r),tryAndCatchError(this,postPassesUpdate),callAfterRenderFunctions(this),r&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())},Scene.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},Scene.prototype.requestRender=function(){this._renderRequested=!0},Scene.prototype.clampLineWidth=function(e){return Math.max(ContextLimits.minimumAliasedLineWidth,Math.min(e,ContextLimits.maximumAliasedLineWidth))},Scene.prototype.pick=function(e,t,i){return this._picking.pick(this,e,t,i)},Scene.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)},Scene.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)},Scene.prototype.drillPick=function(e,t,i,r){return this._picking.drillPick(this,e,t,i,r)},Scene.prototype.pickFromRay=function(e,t,i){return this._picking.pickFromRay(this,e,t,i)},Scene.prototype.drillPickFromRay=function(e,t,i,r){return this._picking.drillPickFromRay(this,e,t,i,r)},Scene.prototype.pickFromRayMostDetailed=function(e,t,i){return this._picking.pickFromRayMostDetailed(this,e,t,i)},Scene.prototype.drillPickFromRayMostDetailed=function(e,t,i,r){return this._picking.drillPickFromRayMostDetailed(this,e,t,i,r)},Scene.prototype.sampleHeight=function(e,t,i){return this._picking.sampleHeight(this,e,t,i)},Scene.prototype.clampToHeight=function(e,t,i,r){return this._picking.clampToHeight(this,e,t,i,r)},Scene.prototype.sampleHeightMostDetailed=function(e,t,i){return this._picking.sampleHeightMostDetailed(this,e,t,i)},Scene.prototype.clampToHeightMostDetailed=function(e,t,i){return this._picking.clampToHeightMostDetailed(this,e,t,i)},Scene.prototype.cartesianToCanvasCoordinates=function(e,t){return SceneTransforms.wgs84ToWindowCoordinates(this,e,t)},Scene.prototype.completeMorph=function(){this._transitioner.completeMorph()},Scene.prototype.morphTo2D=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphTo2D(e,t)},Scene.prototype.morphToColumbusView=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphToColumbusView(e,t)},Scene.prototype.morphTo3D=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphTo3D(e,t)},Scene.prototype.isDestroyed=function(){return!1},Scene.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.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(),defined(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(var e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,destroyObject(this)};var SkyAtmosphereCommon="const float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nconst float g = -0.95;\nconst float g2 = g * g;\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nuniform vec3 u_radiiAndDynamicAtmosphereColor;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvec3 getLightDirection(vec3 positionWC)\n{\nfloat lightEnum = u_radiiAndDynamicAtmosphereColor.z;\nvec3 lightDirection =\npositionWC * float(lightEnum == 0.0) +\nczm_lightDirectionWC * float(lightEnum == 1.0) +\nczm_sunDirectionWC * float(lightEnum == 2.0);\nreturn normalize(lightDirection);\n}\nvoid calculateRayScatteringFromSpace(in vec3 positionWC, in vec3 ray, in float innerRadius, in float outerRadius, inout float far, out vec3 start, out float startOffset)\n{\nfloat cameraHeight = length(positionWC);\nfloat B = 2.0 * dot(positionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B * B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nstart = positionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth);\nstartOffset = startDepth * scale(startAngle);\n}\nvoid calculateRayScatteringFromGround(in vec3 positionWC, in vec3 ray, in float atmosphereScale, in float innerRadius, out vec3 start, out float startOffset)\n{\nfloat cameraHeight = length(positionWC);\nstart = positionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nstartOffset = depth*scale(startAngle);\n}\nczm_raySegment rayEllipsoidIntersection(czm_ray ray, vec3 inverseRadii)\n{\nvec3 o = inverseRadii * (czm_inverseView * vec4(ray.origin, 1.0)).xyz;\nvec3 d = inverseRadii * (czm_inverseView * vec4(ray.direction, 0.0)).xyz;\nfloat a = dot(d, d);\nfloat b = dot(d, o);\nfloat c = dot(o, o) - 1.0;\nfloat discriminant = b * b - a * c;\nif (discriminant < 0.0)\n{\nreturn czm_emptyRaySegment;\n}\ndiscriminant = sqrt(discriminant);\nfloat t1 = (-b - discriminant) / a;\nfloat t2 = (-b + discriminant) / a;\nif (t1 < 0.0 && t2 < 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nif (t1 < 0.0 && t2 >= 0.0)\n{\nt1 = 0.0;\n}\nreturn czm_raySegment(t1, t2);\n}\nvec3 getAdjustedPosition(vec3 positionWC, float innerRadius)\n{\nfloat cameraHeight = czm_eyeHeight + innerRadius;\nreturn normalize(positionWC) * cameraHeight;\n}\nvec3 getTranslucentPosition(vec3 positionWC, vec3 outerPositionWC, float innerRadius, out bool intersectsEllipsoid)\n{\nvec3 directionWC = normalize(outerPositionWC - positionWC);\nvec3 directionEC = czm_viewRotation * directionWC;\nczm_ray viewRay = czm_ray(vec3(0.0), directionEC);\nczm_raySegment raySegment = rayEllipsoidIntersection(viewRay, czm_ellipsoidInverseRadii);\nintersectsEllipsoid = raySegment.start >= 0.0;\nif (intersectsEllipsoid)\n{\nreturn positionWC + raySegment.stop * directionWC;\n}\nreturn getAdjustedPosition(positionWC, innerRadius);\n}\nvoid calculateMieColorAndRayleighColor(vec3 outerPositionWC, out vec3 mieColor, out vec3 rayleighColor)\n{\nfloat outerRadius = u_radiiAndDynamicAtmosphereColor.x;\nfloat innerRadius = u_radiiAndDynamicAtmosphereColor.y;\n#ifdef GLOBE_TRANSLUCENT\nbool intersectsEllipsoid = false;\nvec3 startPositionWC = getTranslucentPosition(czm_viewerPositionWC, outerPositionWC, innerRadius, intersectsEllipsoid);\n#else\nvec3 startPositionWC = getAdjustedPosition(czm_viewerPositionWC, innerRadius);\n#endif\nvec3 lightDirection = getLightDirection(startPositionWC);\nvec3 ray = outerPositionWC - startPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\nvec3 start;\nfloat startOffset;\n#ifdef SKY_FROM_SPACE\n#ifdef GLOBE_TRANSLUCENT\nif (intersectsEllipsoid)\n{\ncalculateRayScatteringFromGround(startPositionWC, ray, atmosphereScale, innerRadius, start, startOffset);\n}\nelse\n{\ncalculateRayScatteringFromSpace(startPositionWC, ray, innerRadius, outerRadius, far, start, startOffset);\n}\n#else\ncalculateRayScatteringFromSpace(startPositionWC, ray, innerRadius, outerRadius, far, start, startOffset);\n#endif\n#else\ncalculateRayScatteringFromGround(startPositionWC, ray, atmosphereScale, innerRadius, start, startOffset);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nfor (int i = 0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDirection, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nmieColor = frontColor * KmESun;\nrayleighColor = frontColor * (InvWavelength * KrESun);\nmieColor = min(mieColor, vec3(10000000.0));\nrayleighColor = min(rayleighColor, vec3(10000000.0));\n}\nvec4 calculateFinalColor(vec3 positionWC, vec3 toCamera, vec3 lightDirection, vec3 mieColor, vec3 rayleighColor)\n{\nfloat cosAngle = dot(lightDirection, normalize(toCamera)) / length(toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nvec3 rgb = rayleighPhase * rayleighColor + miePhase * mieColor;\nconst float exposure = 2.0;\nvec3 rgbExposure = vec3(1.0) - exp(-exposure * rgb);\n#ifndef HDR\nrgb = rgbExposure;\n#endif\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\n#endif\nfloat outerRadius = u_radiiAndDynamicAtmosphereColor.x;\nfloat innerRadius = u_radiiAndDynamicAtmosphereColor.y;\nfloat lightEnum = u_radiiAndDynamicAtmosphereColor.z;\nfloat cameraHeight = czm_eyeHeight + innerRadius;\nfloat atmosphereAlpha = clamp((outerRadius - cameraHeight) / (outerRadius - innerRadius), 0.0, 1.0);\nfloat nightAlpha = (lightEnum != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;\natmosphereAlpha *= pow(nightAlpha, 0.5);\nvec4 finalColor = vec4(rgb, mix(clamp(rgbExposure.b, 0.0, 1.0), 1.0, atmosphereAlpha) * smoothstep(0.0, 1.0, czm_morphTime));\nif (mieColor.b > 1.0)\n{\nfloat strength = mieColor.b;\nfloat minDistance = outerRadius;\nfloat maxDistance = outerRadius * 3.0;\nfloat maxStrengthLerp = 1.0 - clamp((maxDistance - cameraHeight) / (maxDistance - minDistance), 0.0, 1.0);\nfloat maxStrength = mix(100.0, 10000.0, maxStrengthLerp);\nstrength = min(strength, maxStrength);\nfloat alpha = 1.0 - (strength / maxStrength);\nfinalColor.a = alpha;\n}\nreturn finalColor;\n}\n",SkyAtmosphereFS="varying vec3 v_outerPositionWC;\n#ifndef PER_FRAGMENT_ATMOSPHERE\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvoid main (void)\n{\nvec3 toCamera = czm_viewerPositionWC - v_outerPositionWC;\nvec3 lightDirection = getLightDirection(czm_viewerPositionWC);\nvec3 mieColor;\nvec3 rayleighColor;\n#ifdef PER_FRAGMENT_ATMOSPHERE\ncalculateMieColorAndRayleighColor(v_outerPositionWC, mieColor, rayleighColor);\n#else\nmieColor = v_mieColor;\nrayleighColor = v_rayleighColor;\n#endif\ngl_FragColor = calculateFinalColor(czm_viewerPositionWC, toCamera, lightDirection, mieColor, rayleighColor);\n}\n",SkyAtmosphereVS="attribute vec4 position;\nvarying vec3 v_outerPositionWC;\n#ifndef PER_FRAGMENT_ATMOSPHERE\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvoid main(void)\n{\nvec4 positionWC = czm_model * position;\n#ifndef PER_FRAGMENT_ATMOSPHERE\ncalculateMieColorAndRayleighColor(positionWC.xyz, v_mieColor, v_rayleighColor);\n#endif\nv_outerPositionWC = positionWC.xyz;\ngl_Position = czm_modelViewProjection * position;\n}\n";function SkyAtmosphere(e){e=defaultValue(e,Ellipsoid.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;var t=Cartesian3.multiplyByScalar(e.radii,1.025,new Cartesian3);this._scaleMatrix=Matrix4.fromScale(t),this._modelMatrix=new Matrix4,this._command=new DrawCommand({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Cartesian3;t=new Cartesian3;t.x=1.025*e.maximumRadius,t.y=e.maximumRadius,t.z=0,this._radiiAndDynamicAtmosphereColor=t;var i=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return i._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return i._hueSaturationBrightness.x=i.hueShift,i._hueSaturationBrightness.y=i.saturationShift,i._hueSaturationBrightness.z=i.brightnessShift,i._hueSaturationBrightness}}}Object.defineProperties(SkyAtmosphere.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),SkyAtmosphere.prototype.setDynamicAtmosphereColor=function(e,t){t=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=t};var scratchModelMatrix$1=new Matrix4;function hasColorCorrection(e){return!(CesiumMath.equalsEpsilon(e.hueShift,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(e.saturationShift,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(e.brightnessShift,0,CesiumMath.EPSILON7))}SkyAtmosphere.prototype.update=function(e,t){if(this.show){var i=e.mode;if((i===SceneMode$1.SCENE3D||i===SceneMode$1.MORPHING)&&e.passes.render){var r=Matrix4.fromRotationTranslation(e.context.uniformState.inverseViewRotation,Cartesian3.ZERO,scratchModelMatrix$1),n=Matrix4.multiplyTransformation(r,Axis$1.Y_UP_TO_Z_UP,scratchModelMatrix$1),a=Matrix4.multiply(this._scaleMatrix,n,scratchModelMatrix$1);Matrix4.clone(a,this._modelMatrix);i=e.context,r=hasColorCorrection(this),n=e.globeTranslucencyState.translucent,a=this.perFragmentAtmosphere||n||!defined(t)||!t.show,t=this._command;defined(t.vertexArray)||(o=EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:VertexFormat.POSITION_ONLY})),t.vertexArray=VertexArray.fromGeometry({context:i,geometry:o,attributeLocations:GeometryPipeline.createAttributeLocations(o),bufferUsage:BufferUsage$1.STATIC_DRAW}),t.renderState=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},blending:BlendingState$1.ALPHA_BLEND,depthMask:!1}));var o=r|a<<2|n<<3;o!==this._flags&&(this._flags=o,o=[],r&&o.push("COLOR_CORRECT"),a&&o.push("PER_FRAGMENT_ATMOSPHERE"),n&&o.push("GLOBE_TRANSLUCENT"),a=new ShaderSource({defines:o.concat("SKY_FROM_SPACE"),sources:[SkyAtmosphereCommon,SkyAtmosphereVS]}),n=new ShaderSource({defines:o.concat("SKY_FROM_SPACE"),sources:[SkyAtmosphereCommon,SkyAtmosphereFS]}),this._spSkyFromSpace=ShaderProgram.fromCache({context:i,vertexShaderSource:a,fragmentShaderSource:n}),a=new ShaderSource({defines:o.concat("SKY_FROM_ATMOSPHERE"),sources:[SkyAtmosphereCommon,SkyAtmosphereVS]}),n=new ShaderSource({defines:o.concat("SKY_FROM_ATMOSPHERE"),sources:[SkyAtmosphereCommon,SkyAtmosphereFS]}),this._spSkyFromAtmosphere=ShaderProgram.fromCache({context:i,vertexShaderSource:a,fragmentShaderSource:n}));e=e.camera.positionWC;return Cartesian3.magnitude(e)>this._radiiAndDynamicAtmosphereColor.x?t.shaderProgram=this._spSkyFromSpace:t.shaderProgram=this._spSkyFromAtmosphere,t}}},SkyAtmosphere.prototype.isDestroyed=function(){return!1},SkyAtmosphere.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),destroyObject(this)};var SkyBoxFS="uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n",SkyBoxVS="attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n";function SkyBox(e){this.sources=e.sources,this._sources=void 0,this.show=defaultValue(e.show,!0),this._command=new DrawCommand({modelMatrix:Matrix4.clone(Matrix4.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}function SphereEmitter(e){e=defaultValue(e,1),this._radius=defaultValue(e,1)}function StyleExpression(){}SkyBox.prototype.update=function(e,t){var i=this;if(this.show&&(e.mode===SceneMode$1.SCENE3D||e.mode===SceneMode$1.MORPHING)&&e.passes.render){var r=e.context;this._sources!==this.sources&&(this._sources=this.sources,"string"==typeof(n=this.sources).positiveX?loadCubeMap(r,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new CubeMap({context:r,source:n})));var n,a,e=this._command;if(defined(e.vertexArray)||(e.uniformMap={u_cubeMap:function(){return i._cubeMap}},n=BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:VertexFormat.POSITION_ONLY})),a=this._attributeLocations=GeometryPipeline.createAttributeLocations(n),e.vertexArray=VertexArray.fromGeometry({context:r,geometry:n,attributeLocations:a,bufferUsage:BufferUsage$1.STATIC_DRAW}),e.renderState=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND})),defined(e.shaderProgram)&&this._useHdr===t||(a=new ShaderSource({defines:[t?"HDR":""],sources:[SkyBoxFS]}),e.shaderProgram=ShaderProgram.fromCache({context:r,vertexShaderSource:SkyBoxVS,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t),defined(this._cubeMap))return e}},SkyBox.prototype.isDestroyed=function(){return!1},SkyBox.prototype.destroy=function(){var 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(),destroyObject(this)},Object.defineProperties(SphereEmitter.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),SphereEmitter.prototype.emit=function(e){var t=CesiumMath.randomBetween(0,CesiumMath.TWO_PI),i=CesiumMath.randomBetween(0,CesiumMath.PI),r=CesiumMath.randomBetween(0,this._radius),n=r*Math.cos(t)*Math.sin(i),t=r*Math.sin(t)*Math.sin(i),i=r*Math.cos(i);e.position=Cartesian3.fromElements(n,t,i,e.position),e.velocity=Cartesian3.normalize(e.position,e.velocity)},StyleExpression.prototype.evaluate=function(e,t){DeveloperError.throwInstantiationError()},StyleExpression.prototype.evaluateColor=function(e,t){DeveloperError.throwInstantiationError()},StyleExpression.prototype.getShaderFunction=function(e,t,i,r){DeveloperError.throwInstantiationError()};var SunFS="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\ngl_FragColor = czm_gammaCorrect(color);\n}\n",SunTextureFS="uniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction, float lengthScalar)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition) * lengthScalar;\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nfloat lengthScalar = 2.0 / sqrt(2.0);\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position) * lengthScalar;\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(vec2(1.0), surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n",SunVS="attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n";function Sun(){this.show=!0,this._drawCommand=new DrawCommand({primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:new BoundingSphere,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new BoundingSphere,this._boundingVolume2D=new BoundingSphere,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;var e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(Sun.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var scratchPositionWC=new Cartesian2,scratchLimbWC=new Cartesian2,scratchPositionEC=new Cartesian4,scratchCartesian4=new Cartesian4;function TileBoundingVolume(){}function TileCoordinatesImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._color=defaultValue(e.color,Color.YELLOW),this._errorEvent=new Event,this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._readyPromise=when.resolve(!0),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}function TileDiscardPolicy(e){DeveloperError.throwInstantiationError()}Sun.prototype.update=function(e,t,i){if(this.show){var r=e.mode;if(r!==SceneMode$1.SCENE2D&&r!==SceneMode$1.MORPHING&&e.passes.render){var n,a=e.context,o=t.viewport.width,s=t.viewport.height;defined(this._texture)&&o===this._drawingBufferWidth&&s===this._drawingBufferHeight&&!this._glowFactorDirty&&i===this._useHdr||(this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=i,s=Math.max(o,s),s=Math.pow(2,Math.ceil(Math.log(s)/Math.log(2))-2),s=Math.max(1,s),l=i?a.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE,this._texture=new Texture({context:a,width:s,height:s,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:l}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5,l={u_radiusTS:function(){return n._radiusTS}},(n=this)._commands.computeCommand=new ComputeCommand({fragmentShaderSource:SunTextureFS,outputTexture:this._texture,uniformMap:l,persists:!1,owner:this,postExecute:function(){n._commands.computeCommand=void 0}}));var l=this._drawCommand;defined(l.vertexArray)||(h={direction:0},(d=new Uint8Array(8))[0]=0,d[1]=0,d[2]=255,d[3]=0,d[4]=255,d[5]=255,d[6]=0,d[7]=255,c=Buffer$1.createVertexBuffer({context:a,typedArray:d,usage:BufferUsage$1.STATIC_DRAW}),u=[{index:h.direction,vertexBuffer:c,componentsPerAttribute:2,normalize:!0,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE}],d=Buffer$1.createIndexBuffer({context:a,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT}),l.vertexArray=new VertexArray({context:a,attributes:u,indexBuffer:d}),l.shaderProgram=ShaderProgram.fromCache({context:a,vertexShaderSource:SunVS,fragmentShaderSource:SunFS,attributeLocations:h}),l.renderState=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND}),l.uniformMap=this._uniformMap);var c=a.uniformState.sunPositionWC,u=a.uniformState.sunPositionColumbusView,d=this._boundingVolume,h=this._boundingVolume2D;Cartesian3.clone(c,d.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,d.radius=CesiumMath.SOLAR_RADIUS+CesiumMath.SOLAR_RADIUS*this._glowLengthTS,h.radius=d.radius,r===SceneMode$1.SCENE3D?BoundingSphere.clone(d,l.boundingVolume):r===SceneMode$1.COLUMBUS_VIEW&&BoundingSphere.clone(h,l.boundingVolume);c=SceneTransforms.computeActualWgs84Position(e,c,scratchCartesian4),c=Cartesian3.magnitude(Cartesian3.subtract(c,e.camera.position,scratchCartesian4)),e=a.uniformState.projection,a=scratchPositionEC;a.x=0,a.y=0,a.z=-c,a.w=1;c=Matrix4.multiplyByVector(e,a,scratchCartesian4),c=SceneTransforms.clipToGLWindowCoordinates(t.viewport,c,scratchPositionWC);a.x=CesiumMath.SOLAR_RADIUS;a=Matrix4.multiplyByVector(e,a,scratchCartesian4),a=SceneTransforms.clipToGLWindowCoordinates(t.viewport,a,scratchLimbWC);return this._size=Cartesian2.magnitude(Cartesian2.subtract(a,c,scratchCartesian4)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands}}},Sun.prototype.isDestroyed=function(){return!1},Sun.prototype.destroy=function(){var 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(),destroyObject(this)},TileBoundingVolume.prototype.boundingVolume=void 0,TileBoundingVolume.prototype.boundingSphere=void 0,TileBoundingVolume.prototype.distanceToCamera=function(e){DeveloperError.throwInstantiationError()},TileBoundingVolume.prototype.intersectPlane=function(e){DeveloperError.throwInstantiationError()},TileBoundingVolume.prototype.createDebugVolume=function(e){DeveloperError.throwInstantiationError()},Object.defineProperties(TileCoordinatesImageryProvider.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}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),TileCoordinatesImageryProvider.prototype.getTileCredits=function(e,t,i){},TileCoordinatesImageryProvider.prototype.requestImage=function(e,t,i,r){var n=document.createElement("canvas");n.width=256,n.height=256;var a=n.getContext("2d"),o=this._color.toCssColorString();return a.strokeStyle=o,a.lineWidth=2,a.strokeRect(1,1,255,255),a.font="bold 25px Arial",a.textAlign="center",a.fillStyle=o,a.fillText("L: "+i,124,86),a.fillText("X: "+e,124,136),a.fillText("Y: "+t,124,186),n},TileCoordinatesImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},TileDiscardPolicy.prototype.isReady=DeveloperError.throwInstantiationError,TileDiscardPolicy.prototype.shouldDiscardImage=DeveloperError.throwInstantiationError;var TileState={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},TileState$1=Object.freeze(TileState);function TimeDynamicPointCloud(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this.maximumMemoryUsage=defaultValue(e.maximumMemoryUsage,256),this.shading=new PointCloudShading(e.shading),this.style=e.style,this.frameFailed=new Event,this.frameChanged=new Event,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new PointCloudEyeDomeLighting,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._readyPromise=when.defer(),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=arrayFill(new Array(5),0),this._runningAverage=0}function getFragmentShaderLoaded(e){return"uniform vec4 czm_pickColor;\n"+e}function getUniformMapLoaded(t){return function(e){return combine$2(e,{czm_pickColor:function(){return t._pickId.color}})}}function getPickIdLoaded(){return"czm_pickColor"}Object.defineProperties(TimeDynamicPointCloud.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(defined(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise.promise}}}),TimeDynamicPointCloud.prototype.makeStyleDirty=function(){this._styleDirty=!0},TimeDynamicPointCloud.prototype._getAverageLoadTime=function(){return 0===this._runningLength?.05:this._runningAverage};var scratchDate=new JulianDate;function getClockMultiplier(e){var t=e._clock,e=t.canAnimate&&t.shouldAnimate,t=t.multiplier;return e?t:0}function getIntervalIndex(e,t){return e._intervals.indexOf(t.start)}function getNextInterval(e,t){var i=e._intervals,r=e._clock,n=getClockMultiplier(e);if(0!==n){var a=e._getAverageLoadTime(),a=JulianDate.addSeconds(r.currentTime,a*n,scratchDate),a=i.indexOf(a);return a===getIntervalIndex(e,t)&&(0<=n?++a:--a),i.get(a)}}function getCurrentInterval(e){var t=e._intervals,e=e._clock.currentTime,e=t.indexOf(e);return t.get(e)}function reachedInterval(e,t,i){var r=getClockMultiplier(e),t=getIntervalIndex(e,t),i=getIntervalIndex(e,i);return 0<=r?i<=t:t<=i}function handleFrameFailure(t,i){return function(e){e=defined(e.message)?e.message:e.toString();0<t.frameFailed.numberOfListeners?t.frameFailed.raiseEvent({uri:i,message:e}):(console.log("A frame failed to load: "+i),console.log("Error: "+e))}}function requestFrame(t,e,i){var r,n=getIntervalIndex(t,e),a=t._frames,o=a[n];return defined(o)||(r=defined(r=e.data.transform)?Matrix4.fromArray(r):void 0,e=e.data.uri,o={pointCloud:void 0,transform:r,timestamp:getTimestamp$1(),sequential:!0,ready:!1,touchedFrameNumber:i.frameNumber},a[n]=o,Resource.fetchArrayBuffer({url:e}).then(function(e){return o.pointCloud=new PointCloud({arrayBuffer:e,cull:!0,fragmentShaderLoaded:getFragmentShaderLoaded,uniformMapLoaded:getUniformMapLoaded(t),pickIdLoaded:getPickIdLoaded}),o.pointCloud.readyPromise}).otherwise(handleFrameFailure(t,e))),o}function updateAverageLoadTime(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 prepareFrame(e,t,i,r){t.touchedFrameNumber<r.frameNumber-1&&(t.sequential=!1);var n,a,o=t.pointCloud;defined(o)&&!t.ready&&(a=(n=r.commandList).length,renderFrame(e,t,i,r),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,n.length=a,t.sequential&&updateAverageLoadTime(e,(getTimestamp$1()-t.timestamp)/1e3))),t.touchedFrameNumber=r.frameNumber}var scratchModelMatrix=new Matrix4;function getGeometricError(e,t){e=e.shading;return defined(e)&&defined(e.baseResolution)?e.baseResolution:defined(t.boundingSphere)?CesiumMath.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function getMaximumAttenuation(e){e=e.shading;return defined(e)&&defined(e.maximumAttenuation)?e.maximumAttenuation:10}var defaultShading=new PointCloudShading;function renderFrame(e,t,i,r){var n=defaultValue(e.shading,defaultShading),a=t.pointCloud,o=defaultValue(t.transform,Matrix4.IDENTITY);a.modelMatrix=Matrix4.multiplyTransformation(e.modelMatrix,o,scratchModelMatrix),a.style=e.style,a.time=i.timeSinceLoad,a.shadows=e.shadows,a.clippingPlanes=e._clippingPlanes,a.isClipped=i.isClipped,a.attenuation=n.attenuation,a.backFaceCulling=n.backFaceCulling,a.normalShading=n.normalShading,a.geometricError=getGeometricError(e,a),a.geometricErrorScale=n.geometricErrorScale,a.maximumAttenuation=getMaximumAttenuation(e),a.update(r),t.touchedFrameNumber=r.frameNumber}function loadFrame(e,t,i,r){prepareFrame(e,requestFrame(e,t,r),i,r)}function getUnloadCondition(t){return function(e){return e.touchedFrameNumber<t.frameNumber}}function unloadFrames(e,t){for(var i=e._frames,r=i.length,n=0;n<r;++n){var a,o=i[n];defined(o)&&(defined(t)&&!t(o)||(a=o.pointCloud,o.ready&&(e._totalMemoryUsageInBytes-=a.geometryByteLength),defined(a)&&a.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),i[n]=void 0))}}function getFrame(e,t){t=getIntervalIndex(e,t),t=e._frames[t];if(defined(t)&&t.ready)return t}function updateInterval(e,t,i,r,n){return defined(i)&&(i.ready||(loadFrame(e,t,r,n),i.ready))}function getNearestReadyInterval(e,t,i,r,n){var a,o,s=e._intervals,l=e._frames,i=getIntervalIndex(e,i),c=getIntervalIndex(e,t);if(c<=i){for(a=i;c<=a;--a)if(updateInterval(e,o=s.get(a),l[a],r,n))return o}else for(a=i;a<=c;++a)if(updateInterval(e,o=s.get(a),l[a],r,n))return o;return t}function setFramesDirty(e,t,i){for(var r=e._frames,n=r.length,a=0;a<n;++a){var o=r[a];defined(o)&&defined(o.pointCloud)&&(o.pointCloud.clippingPlanesDirty=t,o.pointCloud.styleDirty=i)}}var updateState={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};TimeDynamicPointCloud.prototype.update=function(e){var t,i,r,n,a,o,s,l,c,u,d;e.mode!==SceneMode$1.MORPHING&&this.show&&(defined(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),defined(this._loadTimestamp)||(this._loadTimestamp=JulianDate.clone(e.time)),o=Math.max(1e3*JulianDate.secondsDifference(e.time,this._loadTimestamp),0),n=0,u=!1,(s=defined(l=this._clippingPlanes)&&l.enabled)&&(l.update(e),n=l.clippingPlanesState),this._clippingPlanesState!==n&&(this._clippingPlanesState=n,u=!0),a=this._styleDirty,this._styleDirty=!1,(u||a)&&setFramesDirty(this,u,a),updateState.timeSinceLoad=o,updateState.isClipped=s,t=this.shading,i=this._pointCloudEyeDomeLighting,r=(d=e.commandList).length,l=this._previousInterval,n=this._nextInterval,defined(u=getCurrentInterval(this))&&(a=!1,s=0===(o=getClockMultiplier(this)),o!==this._clockMultiplier&&(a=!0,this._clockMultiplier=o),defined(l)&&!s||(l=u),defined(n)&&!a&&!reachedInterval(this,u,n)||(n=getNextInterval(this,u)),defined(u=getFrame(this,l=getNearestReadyInterval(this,l,u,updateState,e)))||(loadFrame(this,l,updateState,e),u=this._lastRenderedFrame),defined(u)&&renderFrame(this,u,updateState,e),defined(n)&&loadFrame(this,n,updateState,e),c=this,defined(u)&&!defined(this._lastRenderedFrame)&&e.afterRender.push(function(){c._readyPromise.resolve(c)}),defined(u)&&u!==this._lastRenderedFrame&&0<c.frameChanged.numberOfListeners&&e.afterRender.push(function(){c.frameChanged.raiseEvent(c)}),this._previousInterval=l,this._nextInterval=n,this._lastRenderedFrame=u,u=this._totalMemoryUsageInBytes,1024*this.maximumMemoryUsage*1024<u&&unloadFrames(this,getUnloadCondition(e)),d=d.length-r,defined(t)&&t.attenuation&&t.eyeDomeLighting&&0<d&&i.update(e,r,t,this.boundingSphere)))},TimeDynamicPointCloud.prototype.isDestroyed=function(){return!1},TimeDynamicPointCloud.prototype.destroy=function(){return unloadFrames(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),destroyObject(this)};var ViewportQuadFS="varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n";function ViewportQuad(e,t){this.show=!0,defined(e)||(e=new BoundingRectangle),this.rectangle=BoundingRectangle.clone(e),defined(t)||(t=Material.fromType(Material.ColorType,{color:new Color(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}function computeFlyToLocationForRectangle(t,i){var r=i.terrainProvider,e=i.mapProjection,n=e.ellipsoid,a=i.camera.getRectangleCameraCoordinates(t),o=i.mode===SceneMode$1.SCENE3D?n.cartesianToCartographic(a):e.unproject(a);return defined(r)?r.readyPromise.then(function(){if(!defined(r.availability)||i.mode===SceneMode$1.SCENE2D)return o;var e=[Rectangle.center(t),Rectangle.southeast(t),Rectangle.southwest(t),Rectangle.northeast(t),Rectangle.northwest(t)];return computeFlyToLocationForRectangle._sampleTerrainMostDetailed(r,e).then(function(e){var t=e.reduce(function(e,t){return Math.max(t.height,e)},-Number.MAX_VALUE),e=o;return e.height+=t,e})}):when.resolve(o)}ViewportQuad.prototype.update=function(e){var t,i;this.show&&(defined(i=this._rs)&&BoundingRectangle.equals(i.viewport,this.rectangle)||(this._rs=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render&&(t=e.context,this._material===this.material&&defined(this._overlayCommand)||(this._material=this.material,defined(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy(),i=new ShaderSource({sources:[this._material.shaderSource,ViewportQuadFS]}),this._overlayCommand=t.createViewportQuadCommand(i,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Pass$1.OVERLAY),this._material.update(t),this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)))},ViewportQuad.prototype.isDestroyed=function(){return!1},ViewportQuad.prototype.destroy=function(){return defined(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),destroyObject(this)},computeFlyToLocationForRectangle._sampleTerrainMostDetailed=sampleTerrainMostDetailed;var scratchColor$1=new Color,scratchColorAbove=new Color,scratchColorBelow=new Color,scratchColorBlend=new Color,scratchPackedFloat=new Cartesian4,scratchColorBytes=new Uint8Array(4);function lerpEntryColor(e,t,i,r){e=t.height===i.height?0:(e-t.height)/(i.height-t.height);return Color.lerp(t.color,i.color,e,r)}function createNewEntry(e,t){return{height:e,color:Color.clone(t)}}function removeDuplicates(e){return e=(e=(e=e.filter(function(e,t,i){var r=0<t,n=t<i.length-1,r=!r||e.height===i[t-1].height,t=!n||e.height===i[t+1].height;return!r||!t})).filter(function(e,t,i){var r=0<t,n=t<i.length-1,r=r&&Color.equals(e.color,i[t-1].color),t=n&&Color.equals(e.color,i[t+1].color);return!r||!t})).filter(function(e,t,i){var r=0<t,n=r&&Color.equals(e.color,i[t-1].color),t=!r||e.height===i[t-1].height;return!n||!t})}function preprocess(e){for(var t=[],i=e.length,r=0;r<i;r++){for(var n=e[r],a=n.entries,o=a.length,s=[],l=0;l<o;l++){var c=a[l],u=CesiumMath.clamp(c.height,createElevationBandMaterial._minimumHeight,createElevationBandMaterial._maximumHeight),c=Color.clone(c.color,scratchColor$1);c.red*=c.alpha,c.green*=c.alpha,c.blue*=c.alpha,s.push(createNewEntry(u,c))}var d=!0,h=!0;for(l=0;l<o-1;l++)var p=s[l+0],m=s[l+1],d=d&&p.height<=m.height,h=h&&p.height>=m.height;h?s=s.reverse():d||mergeSort(s,function(e,t){return CesiumMath.sign(e.height-t.height)});var f=defaultValue(n.extendDownwards,!1),n=defaultValue(n.extendUpwards,!1);1!==s.length||f||n||(n=f=!0),f&&s.splice(0,0,createNewEntry(createElevationBandMaterial._minimumHeight,s[0].color)),n&&s.splice(s.length,0,createNewEntry(createElevationBandMaterial._maximumHeight,s[s.length-1].color)),s=removeDuplicates(s),t.push(s)}return t}function createLayeredEntries(e){var t=preprocess(e),i=[];function r(e,t){i.push(createNewEntry(e,t))}function n(e,t,i){i=Color.multiplyByScalar(i,1-t.alpha,scratchColorBlend);r(e,i=Color.add(i,t,i))}for(var a=t.length,o=0;o<a;o++)for(var s=t[o],l=0,c=0,u=i,i=[],d=s.length,h=u.length;l<d||c<h;){var p,m,f,g,_,y,C,v=l<d?s[l]:void 0,S=0<l?s[l-1]:void 0,T=l<d-1?s[l+1]:void 0,x=c<h?u[c]:void 0,b=0<c?u[c-1]:void 0,E=c<h-1?u[c+1]:void 0;defined(v)&&defined(x)&&v.height===x.height?(p=defined(E)&&x.height===E.height,m=!defined(b),f=!defined(E),g=defined(T)&&v.height===T.height,_=!defined(S),y=!defined(T),p?g?(n(v.height,v.color,x.color),n(v.height,T.color,E.color)):_?(r(v.height,x.color),n(v.height,v.color,E.color)):y?(n(v.height,v.color,x.color),r(v.height,E.color)):(n(v.height,v.color,x.color),n(v.height,v.color,E.color)):m?g?(r(v.height,v.color),n(v.height,T.color,x.color)):y?(r(v.height,v.color),r(v.height,x.color)):(_||r(v.height,v.color),n(v.height,v.color,x.color)):f?g?(n(v.height,v.color,x.color),r(v.height,T.color)):_?(r(v.height,x.color),r(v.height,v.color)):y?n(v.height,v.color,x.color):(n(v.height,v.color,x.color),r(v.height,v.color)):g?(n(v.height,v.color,x.color),n(v.height,T.color,x.color)):_?(r(v.height,x.color),n(v.height,v.color,x.color)):y?(n(v.height,v.color,x.color),r(v.height,x.color)):n(v.height,v.color,x.color),l+=g?2:1,c+=p?2:1):defined(v)&&defined(x)&&defined(b)&&v.height<x.height?(C=lerpEntryColor(v.height,b,x,scratchColorBelow),defined(S)?defined(T)?n(v.height,v.color,C):(n(v.height,v.color,C),r(v.height,C)):(r(v.height,C),n(v.height,v.color,C)),l++):defined(x)&&defined(v)&&defined(S)&&x.height<v.height?(C=lerpEntryColor(x.height,S,v,scratchColorAbove),defined(b)?defined(E)?n(x.height,C,x.color):(n(x.height,C,x.color),r(x.height,C)):(r(x.height,C),n(x.height,C,x.color)),c++):defined(v)&&(!defined(x)||v.height<x.height)?(!defined(x)||defined(b)||defined(T)?(defined(x)||!defined(b)||defined(S)||(r(b.height,createElevationBandMaterial._emptyColor),r(v.height,createElevationBandMaterial._emptyColor)),r(v.height,v.color)):(r(v.height,v.color),r(v.height,createElevationBandMaterial._emptyColor),r(x.height,createElevationBandMaterial._emptyColor)),l++):defined(x)&&(!defined(v)||x.height<v.height)&&(r(x.height,x.color),c++)}return removeDuplicates(i)}function createElevationBandMaterial(e){var t,i,r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).scene,n=createLayeredEntries(e.layers),a=n.length;if(!createElevationBandMaterial._useFloatTexture(r.context))for(o=PixelDatatype$1.UNSIGNED_BYTE,i=PixelFormat$1.RGBA,t=new Uint8Array(4*a),l=0;l<a;l++)Cartesian4.packFloat(n[l].height,scratchPackedFloat),Cartesian4.pack(scratchPackedFloat,t,4*l);else for(o=PixelDatatype$1.FLOAT,i=PixelFormat$1.LUMINANCE,t=new Float32Array(a),l=0;l<a;l++)t[l]=n[l].height;for(var o=Texture.create({context:r.context,pixelFormat:i,pixelDatatype:o,source:{arrayBufferView:t,width:a,height:1},sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.NEAREST,magnificationFilter:TextureMagnificationFilter$1.NEAREST})}),s=new Uint8Array(4*a),l=0;l<a;l++)n[l].color.toBytes(scratchColorBytes),s[4*l+0]=scratchColorBytes[0],s[4*l+1]=scratchColorBytes[1],s[4*l+2]=scratchColorBytes[2],s[4*l+3]=scratchColorBytes[3];r=Texture.create({context:r.context,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:s,width:a,height:1},sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})});return Material.fromType("ElevationBand",{heights:o,colors:r})}function createOsmBuildings(e){var t=new Cesium3DTileset(e=combine$2(e,{url:IonResource.fromAssetId(96188)})),i=e.style;return defined(i)||(i=new Cesium3DTileStyle({color:"Boolean(${feature['cesium#color']}) ? color(${feature['cesium#color']}) : "+defaultValue(e.defaultColor,Color.WHITE).toCssColorString()})),t.style=i,t}function createTangentSpaceDebugPrimitive(e){var t=[],i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).geometry,r=(i=!defined(i.attributes)||!defined(i.primitiveType)?i.constructor.createGeometry(i):i).attributes,n=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),e=defaultValue(e.length,1e4);if(defined(r.normal)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"normal",e),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)},modelMatrix:n})),defined(r.tangent)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"tangent",e),attributes:{color:new ColorGeometryInstanceAttribute(0,1,0,1)},modelMatrix:n})),defined(r.bitangent)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"bitangent",e),attributes:{color:new ColorGeometryInstanceAttribute(0,0,1,1)},modelMatrix:n})),0<t.length)return new Primitive({asynchronous:!1,geometryInstances:t,appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1})})}function createWorldImagery(e){return e=defaultValue(e,defaultValue.EMPTY_OBJECT),new IonImageryProvider({assetId:defaultValue(e.style,IonWorldImageryStyle$1.AERIAL)})}createElevationBandMaterial._useFloatTexture=function(e){return e.floatingPointTexture},createElevationBandMaterial._maximumHeight=5906376425472,createElevationBandMaterial._minimumHeight=-5906376425472,createElevationBandMaterial._emptyColor=new Color(0,0,0,0);var tmp$1={},KGj,LGj,MGj,NGj,OGj,PGj,NOj,GGj,HGj,IGj,JGj;KGj={defaultNoDataValue:-34027999387901484e22,decode:function(e,t){var i=(t=t||{}).encodedMaskData||null===t.encodedMaskData,r=OGj(e,t.inputOffset||0,i),e=null!==t.noDataValue?t.noDataValue:KGj.defaultNoDataValue,i=LGj(r,t.pixelType||Float32Array,t.encodedMaskData,e,t.returnMask),e={width:r.width,height:r.height,pixelData:i.resultPixels,minValue:i.minValue,maxValue:r.pixels.maxValue,noDataValue:e};return i.resultMask&&(e.maskData=i.resultMask),t.returnEncodedMask&&r.mask&&(e.encodedMaskData=r.mask.bitset||null),t.returnFileInfo&&(e.fileInfo=MGj(r),t.computeUsedBitDepths&&(e.fileInfo.bitDepths=NGj(r))),e}},LGj=function(e,t,i,r,n){var a,o,s,l=0,c=e.pixels.numBlocksX,u=e.pixels.numBlocksY,d=Math.floor(e.width/c),h=Math.floor(e.height/u),p=2*e.maxZError,m=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),o=new t(e.width*e.height),n&&i&&(s=new Uint8Array(e.width*e.height));for(var f,g,_=new Float32Array(d*h),y=0;y<=u;y++){var C=y!==u?h:e.height%u;if(0!==C)for(var v=0;v<=c;v++){var S=v!==c?d:e.width%c;if(0!==S){var T,x,b,E,P=y*e.width*h+v*d,A=e.width-S,w=e.pixels.blocks[l];if(w.encoding<2?(T=0===w.encoding?w.rawData:(PGj(w.stuffedData,w.bitsPerPixel,w.numValidPixels,w.offset,p,_,e.pixels.maxValue),_),x=0):b=2===w.encoding?0:w.offset,i)for(g=0;g<C;g++){for(7&P&&(E=i[P>>3],E<<=7&P),f=0;f<S;f++)128&(E=!(7&P)?i[P>>3]:E)?(s&&(s[P]=1),m=(a=w.encoding<2?T[x++]:b)<m?a:m,o[P++]=a):(s&&(s[P]=0),o[P++]=r),E<<=1;P+=A}else if(w.encoding<2)for(g=0;g<C;g++){for(f=0;f<S;f++)m=(a=T[x++])<m?a:m,o[P++]=a;P+=A}else for(m=b<m?b:m,g=0;g<C;g++){for(f=0;f<S;f++)o[P++]=b;P+=A}if(1===w.encoding&&x!==w.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:o,resultMask:s,minValue:m}},MGj=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},NGj=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},r=0;r<t;r++){var n=e.pixels.blocks[r];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},OGj=function(e,t,i){var r={},n=new Uint8Array(e,t,10);if(r.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==r.fileIdentifierString.trim())throw"Unexpected file identifier string: "+r.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(r.fileVersion=a.getInt32(0,!0),r.imageType=a.getInt32(4,!0),r.height=a.getUint32(8,!0),r.width=a.getUint32(12,!0),r.maxZError=a.getFloat64(16,!0),t+=24,!i)if(a=new DataView(e,t,16),r.mask={},r.mask.numBlocksY=a.getUint32(0,!0),r.mask.numBlocksX=a.getUint32(4,!0),r.mask.numBytes=a.getUint32(8,!0),r.mask.maxValue=a.getFloat32(12,!0),t+=16,0<r.mask.numBytes){var o=new Uint8Array(Math.ceil(r.width*r.height/8)),s=(a=new DataView(e,t,r.mask.numBytes)).getInt16(0,!0),l=2,c=0;do{if(0<s)for(;s--;)o[c++]=a.getUint8(l++);else for(var u=a.getUint8(l++),s=-s;s--;)o[c++]=u}while(s=a.getInt16(l,!0),(l+=2)<r.mask.numBytes);if(-32768!==s||c<o.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=o,t+=r.mask.numBytes}else 0==(r.mask.numBytes|r.mask.numBlocksY|r.mask.maxValue)&&(r.mask.bitset=new Uint8Array(Math.ceil(r.width*r.height/8)));a=new DataView(e,t,16),r.pixels={},r.pixels.numBlocksY=a.getUint32(0,!0),r.pixels.numBlocksX=a.getUint32(4,!0),r.pixels.numBytes=a.getUint32(8,!0),r.pixels.maxValue=a.getFloat32(12,!0),t+=16;var n=r.pixels.numBlocksX,i=r.pixels.numBlocksY,d=n+(0<r.width%n?1:0),h=i+(0<r.height%i?1:0);r.pixels.blocks=new Array(d*h);for(var p=0,m=0;m<h;m++)for(var f=0;f<d;f++){var g=0,_=e.byteLength-t;a=new DataView(e,t,Math.min(10,_));var y={};r.pixels.blocks[p++]=y;var C,_=a.getUint8(0);if(g++,y.encoding=63&_,3<y.encoding)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==_&&2!==_){if(_>>=6,2===(y.offsetType=_))y.offset=a.getInt8(1),g++;else if(1===_)y.offset=a.getInt16(1,!0),g+=2;else{if(0!==_)throw"Invalid block offset type";y.offset=a.getFloat32(1,!0),g+=4}if(1===y.encoding)if(_=a.getUint8(g),g++,y.bitsPerPixel=63&_,_>>=6,2===(y.numValidPixelsType=_))y.numValidPixels=a.getUint8(g),g++;else if(1===_)y.numValidPixels=a.getUint16(g,!0),g+=2;else{if(0!==_)throw"Invalid valid pixel count type";y.numValidPixels=a.getUint32(g,!0),g+=4}}if(t+=g,3!==y.encoding)if(0===y.encoding){var v=(r.pixels.numBytes-1)/4;if(v!==Math.floor(v))throw"uncompressed block has invalid length";C=new ArrayBuffer(4*v),new Uint8Array(C).set(new Uint8Array(e,t,4*v));var S=new Float32Array(C);y.rawData=S,t+=4*v}else 1===y.encoding&&(S=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),v=Math.ceil(S/4),C=new ArrayBuffer(4*v),new Uint8Array(C).set(new Uint8Array(e,t,S)),y.stuffedData=new Uint32Array(C),t+=S)}else t++}return r.eofOffset=t,r},PGj=function(e,t,i,r,n,a,o){var s,l,c,u,d=(1<<t)-1,h=0,p=0,m=Math.ceil((o-r)/n),f=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*f,s=0;s<i;s++)0===p&&(u=e[h++],p=32),t<=p?(c=u>>>p-t&d,p-=t):(c=(u&d)<<(l=t-p)&d,c+=(u=e[h++])>>>(p=32-l)),a[s]=c<m?r+c*n:o;return a},GGj=KGj,HGj=function(){var v=function(e,t,i,r,n,a,o,s){var l,c,u,d,h,p=(1<<i)-1,m=0,f=0,g=4*e.length-Math.ceil(i*r/8);if(e[e.length-1]<<=8*g,n)for(l=0;l<r;l++)0===f&&(u=e[m++],f=32),i<=f?(c=u>>>f-i&p,f-=i):(c=(u&p)<<(d=i-f)&p,c+=(u=e[m++])>>>(f=32-d)),t[l]=n[c];else for(h=Math.ceil((s-a)/o),l=0;l<r;l++)0===f&&(u=e[m++],f=32),i<=f?(c=u>>>f-i&p,f-=i):(c=(u&p)<<(d=i-f)&p,c+=(u=e[m++])>>>(f=32-d)),t[l]=c<h?a+c*o:s},S=function(e,t,i,r,n,a){var o,s,l=(1<<t)-1,c=0,u=0,d=0,h=0,p=[],m=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*m;for(var f=Math.ceil((a-r)/n),u=0;u<i;u++)0===d&&(s=e[c++],d=32),t<=d?(h=s>>>d-t&l,d-=t):(h=(s&l)<<(o=t-d)&l,h+=(s=e[c++])>>>(d=32-o)),p[u]=h<f?r+h*n:a;return p.unshift(r),p},T=function(e,t,i,r,n,a,o,s){var l,c,u,d=(1<<i)-1,h=0,p=0,m=0;if(n)for(g=0;g<r;g++)0===p&&(c=e[h++],p=32,m=0),i<=p?(l=c>>>m&d,p-=i,m+=i):(l=c>>>m&d,p=32-(u=i-p),l|=((c=e[h++])&(1<<u)-1)<<i-u,m=u),t[g]=n[l];else for(var f=Math.ceil((s-a)/o),g=0;g<r;g++)0===p&&(c=e[h++],p=32,m=0),i<=p?(l=c>>>m&d,p-=i,m+=i):(l=c>>>m&d,p=32-(u=i-p),l|=((c=e[h++])&(1<<u)-1)<<i-u,m=u),t[g]=l<f?a+l*o:s;return t},x=function(e,t,i,r,n,a){for(var o,s,l=(1<<t)-1,c=0,u=0,d=0,h=0,p=0,m=[],f=Math.ceil((a-r)/n),u=0;u<i;u++)0===d&&(s=e[c++],d=32,p=0),t<=d?(h=s>>>p&l,d-=t,p+=t):(h=s>>>p&l,d=32-(o=t-d),h|=((s=e[c++])&(1<<o)-1)<<t-o,p=o),m[u]=h<f?r+h*n:a;return m.unshift(r),m},b=function(e,t,i,r){var n,a,o,s,l=(1<<i)-1,c=0,u=0,d=4*e.length-Math.ceil(i*r/8);for(e[e.length-1]<<=8*d,n=0;n<r;n++)0===u&&(o=e[c++],u=32),i<=u?(a=o>>>u-i&l,u-=i):(a=(o&l)<<(s=i-u)&l,a+=(o=e[c++])>>>(u=32-s)),t[n]=a;return t},E=function(e,t,i,r){for(var n,a,o,s=(1<<i)-1,l=0,c=0,u=0,d=0;d<r;d++)0===c&&(a=e[l++],c=32,u=0),i<=c?(n=a>>>u&s,c-=i,u+=i):(n=a>>>u&s,c=32-(o=i-c),n|=((a=e[l++])&(1<<o)-1)<<i-o,u=o),t[d]=n;return t},k={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,r=e.length,n=Math.floor(r/2),a=0;n;){var o=359<=n?359:n;for(n-=o;t+=e[a++]<<8,i+=t+=e[a++],--o;);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&r&&(i+=t+=e[a]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,r=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,r),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var a=new DataView(e,i,8),r=a.getInt32(0,!0);if(n.fileVersion=r,i+=4,3<=r&&(n.checksum=a.getUint32(4,!0),i+=4),a=new DataView(e,i,12),n.height=a.getUint32(0,!0),n.width=a.getUint32(4,!0),i+=8,4<=r?(n.numDims=a.getUint32(8,!0),i+=4):n.numDims=1,a=new DataView(e,i,40),n.numValidPixel=a.getUint32(0,!0),n.microBlockSize=a.getInt32(4,!0),n.blobSize=a.getInt32(8,!0),n.imageType=a.getInt32(12,!0),n.maxZError=a.getFloat64(16,!0),n.zMin=a.getFloat64(24,!0),n.zMax=a.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,3<=r&&(r=4<=r?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-r,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,r=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),a=this.readSubArray(e,t.ptr,r,n),o=this.readSubArray(e,t.ptr+n,r,n);t.ptr+=2*n;for(var s=!0,l=0;l<i.numDims;l++)if(a[l]!==o[l]){s=!1;break}return i.minValues=a,i.maxValues=o,s},readSubArray:function(e,t,i,r){var n=i===Uint8Array?new Uint8Array(e,t,r):(n=new ArrayBuffer(r),new Uint8Array(n).set(new Uint8Array(e,t,r)),new i(n));return n},readMask:function(e,t){var i=t.ptr,r=t.headerInfo,n=r.width*r.height,r=r.numValidPixel,a=new DataView(e,i,4),o={};if(o.numBytes=a.getUint32(0,!0),i+=4,(0===r||n===r)&&0!==o.numBytes)throw"invalid mask";if(0===r)l=new Uint8Array(Math.ceil(n/8)),o.bitset=l,h=new Uint8Array(n),t.pixels.resultMask=h,i+=o.numBytes;else if(0<o.numBytes){var s,l=new Uint8Array(Math.ceil(n/8)),c=(a=new DataView(e,i,o.numBytes)).getInt16(0,!0),u=2,d=0;do{if(0<c)for(;c--;)l[d++]=a.getUint8(u++);else for(s=a.getUint8(u++),c=-c;c--;)l[d++]=s}while(c=a.getInt16(u,!0),(u+=2)<o.numBytes);if(-32768!==c||d<l.length)throw"Unexpected end of mask RLE encoding";for(var h=new Uint8Array(n),p=0,m=0,m=0;m<n;m++)7&m?(p=l[m>>3],p<<=7&m):p=l[m>>3],128&p&&(h[m]=1);t.pixels.resultMask=h,o.bitset=l,i+=o.numBytes}return t.ptr=i,t.mask=o,!0},readDataOneSweep:function(e,t,i){var r=t.ptr,n=t.headerInfo,a=n.numDims,o=n.width*n.height,s=n.imageType,n=n.numValidPixel*k.getDataTypeSize(s)*a,l=t.pixels.resultMask,c=i===Uint8Array?new Uint8Array(e,r,n):(s=new ArrayBuffer(n),new Uint8Array(s).set(new Uint8Array(e,r,n)),new i(s));if(c.length===o*a)t.pixels.resultPixels=c;else{t.pixels.resultPixels=new i(o*a);var u,d=0,h=0,p=0;if(1<a)for(p=0;p<a;p++)for(u=p*o,h=0;h<o;h++)l[h]&&(t.pixels.resultPixels[u+h]=c[d++]);else for(h=0;h<o;h++)l[h]&&(t.pixels.resultPixels[h]=c[d++])}return r+=n,t.ptr=r,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,r=new DataView(e,t.ptr,16);if(t.ptr+=16,r.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=r.getInt32(4,!0),a=r.getInt32(8,!0),o=r.getInt32(12,!0);if(o<=a)return!1;var s=new Uint32Array(o-a);k.decodeBits(e,t,s);for(var l,c,u,d=[],h=a;h<o;h++)d[l=h-(h<n?0:n)]={first:s[h-a],second:null};var p=e.byteLength-t.ptr,r=Math.ceil(p/4),r=new ArrayBuffer(4*r);new Uint8Array(r).set(new Uint8Array(e,t.ptr,p));var m=new Uint32Array(r),f=0,g=0,_=m[0];for(h=a;h<o;h++)0<(u=d[l=h-(h<n?0:n)].first)&&(d[l].second=_<<f>>>32-u,u<=32-f?32===(f+=u)&&(f=0,_=m[++g]):(f+=u-32,_=m[++g],d[l].second|=_>>>32-f));var y=0,C=0,v=new A;for(h=0;h<d.length;h++)void 0!==d[h]&&(y=Math.max(y,d[h].first));C=i<=y?i:y,30<=y&&console.log("WARning, large NUM LUT BITS IS "+y);var S,T,x,b,E,P=[];for(h=a;h<o;h++)if(0<(u=d[l=h-(h<n?0:n)].first))if(S=[u,l],u<=C)for(T=d[l].second<<C-u,x=1<<C-u,c=0;c<x;c++)P[T|c]=S;else for(T=d[l].second,E=v,b=u-1;0<=b;b--)E=T>>>b&1?(E.right||(E.right=new A),E.right):(E.left||(E.left=new A),E.left),0!==b||E.val||(E.val=S[1]);return{decodeLut:P,numBitsLUTQick:C,numBitsLUT:y,tree:v,stuffedData:m,srcPtr:g,bitPos:f}},readHuffman:function(e,t,i){var r,n,a,o,s,l,c,u,d,h=t.headerInfo,p=h.numDims,m=t.headerInfo.height,f=t.headerInfo.width,g=f*m,e=this.readHuffmanTree(e,t),_=e.decodeLut,y=e.tree,C=e.stuffedData,v=e.srcPtr,S=e.bitPos,T=e.numBitsLUTQick,x=e.numBitsLUT,b=0===t.headerInfo.imageType?128:0,E=t.pixels.resultMask,P=0;0<S&&(v++,S=0);for(var A=C[v],w=1===t.encodeMode,D=new i(g*p),M=D,I=0;I<h.numDims;I++){if(1<p&&(M=new i(D.buffer,g*I,g),P=0),t.headerInfo.numValidPixel===f*m)for(l=u=0;l<m;l++)for(c=0;c<f;c++,u++){if(n=0,s=o=A<<S>>>32-T,_[s=32-S<T?o|=C[v+1]>>>64-S-T:s])n=_[s][1],S+=_[s][0];else for(s=o=A<<S>>>32-x,32-S<x&&(s=o|=C[v+1]>>>64-S-x),r=y,d=0;d<x;d++)if(!(r=o>>>x-d-1&1?r.right:r.left).left&&!r.right){n=r.val,S=S+d+1;break}32<=S&&(S-=32,A=C[++v]),a=n-b,w?(a+=!(0<c)&&0<l?M[u-f]:P,a&=255,P=M[u]=a):M[u]=a}else for(l=u=0;l<m;l++)for(c=0;c<f;c++,u++)if(E[u]){if(n=0,s=o=A<<S>>>32-T,_[s=32-S<T?o|=C[v+1]>>>64-S-T:s])n=_[s][1],S+=_[s][0];else for(s=o=A<<S>>>32-x,32-S<x&&(s=o|=C[v+1]>>>64-S-x),r=y,d=0;d<x;d++)if(!(r=o>>>x-d-1&1?r.right:r.left).left&&!r.right){n=r.val,S=S+d+1;break}32<=S&&(S-=32,A=C[++v]),a=n-b,w?(!(0<c&&E[u-1])&&0<l&&E[u-f]?a+=M[u-f]:a+=P,a&=255,P=M[u]=a):M[u]=a}t.ptr=t.ptr+4*(v+1)+(0<S?4:0)}t.pixels.resultPixels=D},decodeBits:function(e,t,i,r,n){var a=t.headerInfo,o=a.fileVersion,s=0,l=5<=e.byteLength-t.ptr?5:e.byteLength-t.ptr,c=new DataView(e,t.ptr,l),u=c.getUint8(0);s++;var d=u>>6,h=0==d?4:3-d,l=0<(32&u),d=31&u,u=0;if(1==h)u=c.getUint8(s),s++;else if(2==h)u=c.getUint16(s,!0),s+=2;else{if(4!=h)throw"Invalid valid pixel count type";u=c.getUint32(s,!0),s+=4}var p,m,f,g,_,y,C,h=2*a.maxZError,a=1<a.numDims?a.maxValues[n]:a.zMax;if(l){for(t.counter.lut++,y=c.getUint8(s),s++,g=Math.ceil((y-1)*d/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),f=new Uint8Array(m),t.ptr+=s,f.set(new Uint8Array(e,t.ptr,g)),c=new Uint32Array(m),t.ptr+=g,C=0;y-1>>>C;)C++;g=Math.ceil(u*C/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),(f=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,g)),p=new Uint32Array(m),t.ptr+=g,c=(3<=o?x:S)(c,d,y-1,r,h,a),(3<=o?T:v)(p,i,C,u,c)}else t.counter.bitstuffer++,C=d,t.ptr+=s,0<C&&(g=Math.ceil(u*C/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),(f=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,g)),p=new Uint32Array(m),t.ptr+=g,3<=o?null===r?E(p,i,C,u):T(p,i,C,u,!1,r,h,a):null===r?b(p,i,C,u):v(p,i,C,u,!1,r,h,a))},readTiles:function(e,t,i){var r=t.headerInfo,n=r.width,a=r.height,o=r.microBlockSize,s=r.imageType,l=k.getDataTypeSize(s),c=Math.ceil(n/o),u=Math.ceil(a/o);t.pixels.numBlocksY=u,t.pixels.numBlocksX=c;for(var d,h,p,m,f,g,_,y,C,v,S,T,x,b,E=t.pixels.ptr=0,P=0,A=0,w=0,D=0,M=0,I=0,R=0,O=new i(o*o),L=a%o||o,F=n%o||o,N=r.numDims,B=t.pixels.resultMask,V=t.pixels.resultPixels,A=0;A<u;A++)for(d=A!==u-1?o:L,w=0;w<c;w++)for(D=A*n*o+w*o,g=n-(h=w!==c-1?o:F),b=0;b<N;b++){if(1<N&&(V=new i(t.pixels.resultPixels.buffer,n*a*b*l,n*a)),p=e.byteLength-t.ptr,C={},R=0,R++,f=(m=(y=new DataView(e,t.ptr,Math.min(10,p))).getUint8(0))>>6&255,(m>>2&15)!=(w*o>>3&15))throw"integrity issue";if(3<(S=3&m))throw t.ptr+=R,"Invalid block encoding ("+S+")";if(2!=S)if(0==S){if(t.counter.uncompressed++,t.ptr+=R,M=(M=d*h*l)<(_=e.byteLength-t.ptr)?M:_,T=new ArrayBuffer(M%l==0?M:M+l-M%l),new Uint8Array(T).set(new Uint8Array(e,t.ptr,M)),v=new i(T),I=0,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=v[I++]),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=v[I++];D+=g}t.ptr+=I*l}else if(T=k.getDataTypeUsed(s,f),x=k.getOnePixel(C,R,T,y),R+=k.getDataTypeSize(T),3==S)if(t.ptr+=R,t.counter.constantoffset++,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=x),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=x;D+=g}else if(t.ptr+=R,k.decodeBits(e,t,O,x,b),R=0,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=O[R++]),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=O[R++];D+=g}else t.counter.constant++,t.ptr+=R}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:k.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t,i=e.headerInfo.zMax,r=e.headerInfo.numDims,n=e.headerInfo.height*e.headerInfo.width,a=n*r,o=0,s=0,l=e.pixels.resultMask;if(l)if(1<r)for(o=0;o<r;o++)for(t=o*n,s=0;s<n;s++)l[s]&&(e.pixels.resultPixels[t+s]=i);else for(s=0;s<n;s++)l[s]&&(e.pixels.resultPixels[s]=i);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(i);else for(s=0;s<a;s++)e.pixels.resultPixels[s]=i},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:t=Float32Array;break;case 7:t=Float64Array;break;default:t=Float32Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:t="F32";break;case 7:t="F64";break;default:t="F32"}return t},isValidPixelValue:function(e,t){if(null===t)return!1;var i;switch(e){case 0:i=-128<=t&&t<=127;break;case 1:i=0<=t&&t<=255;break;case 2:i=-32768<=t&&t<=32767;break;case 3:i=0<=t&&t<=65536;break;case 4:i=-2147483648<=t&&t<=2147483647;break;case 5:i=0<=t&&t<=4294967296;break;case 6:i=-34027999387901484e22<=t&&t<=34027999387901484e22;break;case 7:i=5e-324<=t&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,r){var n=0;switch(i){case 0:n=r.getInt8(t);break;case 1:n=r.getUint8(t);break;case 2:n=r.getInt16(t,!0);break;case 3:n=r.getUint16(t,!0);break;case 4:n=r.getInt32(t,!0);break;case 5:n=r.getUInt32(t,!0);break;case 6:n=r.getFloat32(t,!0);break;case 7:n=r.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},A=function(e,t,i){this.val=e,this.left=t,this.right=i};return{decode:function(e,t){var i=(t=t||{}).noDataValue,r=0,n={};if(n.ptr=t.inputOffset||0,n.pixels={},k.readHeaderInfo(e,n)){var a=n.headerInfo,o=a.fileVersion,s=k.getDataTypeArray(a.imageType);k.readMask(e,n),a.numValidPixel===a.width*a.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var l,c=a.width*a.height;if(n.pixels.resultPixels=new s(c*a.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==a.numValidPixel)if(a.zMax===a.zMin)k.constructConstantSurface(n);else if(4<=o&&k.checkMinMaxRanges(e,n))k.constructConstantSurface(n);else{var u=new DataView(e,n.ptr,2),d=u.getUint8(0);if(n.ptr++,d)k.readDataOneSweep(e,n,s);else if(1<o&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){u=u.getUint8(1);if(n.ptr++,2<(n.encodeMode=u)||o<4&&1<u)throw"Invalid Huffman flag "+u;u?k.readHuffman(e,n,s):k.readTiles(e,n,s)}else k.readTiles(e,n,s)}n.eofOffset=n.ptr,t.inputOffset?(l=n.headerInfo.blobSize+t.inputOffset-n.ptr,1<=Math.abs(l)&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(l=n.headerInfo.blobSize-n.ptr,1<=Math.abs(l)&&(n.eofOffset=n.headerInfo.blobSize));var h={width:a.width,height:a.height,pixelData:n.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&k.isValidPixelValue(a.imageType,i)){for(var p=n.pixels.resultMask,r=0;r<c;r++)p[r]||(h.pixelData[r]=i);h.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(h.fileInfo=k.formatFileInfo(n)),h}},getBandCount:function(e){for(var t=0,i=0,r={ptr:0,pixels:{}};i<e.byteLength-58;)k.readHeaderInfo(e,r),i+=r.headerInfo.blobSize,t++,r.ptr=i;return t}}}(),NOj=new ArrayBuffer(4),JGj=new Uint8Array(NOj),IGj=(new Uint32Array(NOj)[0]=1)===JGj[0],JGj={decode:function(e,t){if(!IGj)throw"Big endian system is not supported.";var i,r,n=(t=t||{}).inputOffset||0,a=new Uint8Array(e,n,10),a=String.fromCharCode.apply(null,a);if("CntZImage"===a.trim())i=GGj,r=1;else{if("Lerc2"!==a.substring(0,5))throw"Unexpected file identifier string: "+a;i=HGj,r=2}for(var o,s,l,c,u,d,h=0,p=e.byteLength-10,m=[],f={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<p;){var g=i.decode(e,{inputOffset:n,encodedMaskData:o,maskData:l,returnMask:0===h,returnEncodedMask:0===h,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null}),n=g.fileInfo.eofOffset;0===h&&(o=g.encodedMaskData,l=g.maskData,f.width=g.width,f.height=g.height,f.dimCount=g.dimCount||1,f.pixelType=g.pixelType||g.fileInfo.pixelType,f.mask=g.maskData),1<r&&g.fileInfo.mask&&0<g.fileInfo.mask.numBytes&&m.push(g.maskData),h++,f.pixels.push(g.pixelData),f.statistics.push({minValue:g.minValue,maxValue:g.maxValue,noDataValue:g.noDataValue,dimStats:g.dimStats})}if(1<r&&1<m.length){for(d=f.width*f.height,f.bandMasks=m,(l=new Uint8Array(d)).set(m[0]),c=1;c<m.length;c++)for(s=m[c],u=0;u<d;u++)l[u]=l[u]&s[u];f.maskData=l}return f}},tmp$1.Lerc=JGj;var LercDecode=tmp$1.Lerc,tmp={},hPj,iPj;hPj=tmp,iPj=function(){return n={},r.m=i=[function(e,t,i){var r=function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e};function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=i(1),a=i.webm,o=i.mp4,s="undefined"!=typeof navigator&&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,r=(r(l,[{key:"_addSourceToVideo",value:function(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}},{key:"enable",value:function(){s?(this.disable(),console.warn("\n NoSleep enabled for older iOS devices. This can interrupt\n active or long-running network requests from completing successfully.\n See https://github.com/richtr/NoSleep.js/issues/15 for more details.\n "),this.noSleepTimer=window.setInterval(function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){s?this.noSleepTimer&&(console.warn("\n NoSleep now disabled for older iOS devices.\n "),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),l);function l(){var e=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),s?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("muted",""),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",a),this._addSourceToVideo(this.noSleepVideo,"mp4",o),this.noSleepVideo.addEventListener("loadedmetadata",function(){e.noSleepVideo.duration<=1?e.noSleepVideo.setAttribute("loop",""):e.noSleepVideo.addEventListener("timeupdate",function(){.5<e.noSleepVideo.currentTime&&(e.noSleepVideo.currentTime=Math.random())})}))}e.exports=r},function(e,t,i){e.exports={webm:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",mp4:"data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}}],r.c=n,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0);function r(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var i,n},hPj.NoSleep=iPj();var NoSleep=tmp.NoSleep,oldValue;"undefined"!=typeof ko&&(oldValue=ko),function(R){var S=this||(0,eval)("this"),T=S.document,v=S.navigator,x=S.jQuery,b=S.JSON;x||"undefined"==typeof jQuery||(x=jQuery),function(e,r){function i(e,t){return null===e||typeof e in l?e===t:!1}function a(e,t){var i;return function(){i||(i=I.a.setTimeout(function(){i=R;e()},t))}}function o(e,t){var i;return function(){clearTimeout(i);i=I.a.setTimeout(e,t)}}function c(e,t){t&&"change"!==t?"beforeChange"===t?this.pc(e):this.gb(e,t):this.qc(e)}function n(e,t){null!==t&&t.s&&t.s()}function s(e,t){var i=this.qd,r=i[p];r.ra||(this.Qb&&this.mb[t]?(i.uc(t,e,this.mb[t]),this.mb[t]=null,--this.Qb):r.I[t]||i.uc(t,e,r.J?{da:e}:i.$c(e)),e.Ja&&e.gd())}var I="undefined"!==typeof e?e:{};I.b=function(e,t){for(var i=e.split("."),r=I,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},I.L=function(e,t,i){e[t]=i},I.version="3.5.1",I.b("version",I.version),I.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},I.a=function(){function d(e,t){for(var i in e)a.call(e,i)&&t(i,e[i])}function e(e,t){if(t)for(var i in t)a.call(t,i)&&(e[i]=t[i]);return e}function t(e,t){e.__proto__=t;return e}function n(e,t,i,r){var n=e[t].match(u)||[];I.a.D(i.match(u),function(e){I.a.Na(n,e,r)});e[t]=n.join(" ")}var a=Object.prototype.hasOwnProperty,i={__proto__:[]}instanceof Array,r="function"===typeof Symbol,o={},s={};o[v&&/Firefox\/2/i.test(v.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];o.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");d(o,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)s[t[i]]=e});var l={propertychange:!0},c=T&&function(){for(var e=3,t=T.createElement("div"),i=t.getElementsByTagName("i");t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e",i[0];);return 4<e?e:R}(),u=/\S+/g,h;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(e,t,i){for(var r=0,n=e.length;r<n;r++)t.call(i,e[r],r,e)},A:"function"==typeof Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t)}:function(e,t){for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Lb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r,e))return e[r];return R},Pa:function(e,t){var i=I.a.A(e,t);0<i?e.splice(i,1):0===i&&e.shift()},wc:function(e){var t=[];e&&I.a.D(e,function(e){0>I.a.A(t,e)&&t.push(e)});return t},Mb:function(e,t,i){var r=[];if(e)for(var n=0,a=e.length;n<a;n++)r.push(t.call(i,e[n],n));return r},jb:function(e,t,i){var r=[];if(e)for(var n=0,a=e.length;n<a;n++)t.call(i,e[n],n)&&r.push(e[n]);return r},Nb:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},Na:function(e,t,i){var r=I.a.A(I.a.bc(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},Ba:i,extend:e,setPrototypeOf:t,Ab:i?t:e,P:d,Ga:function(e,t,i){if(!e)return e;var r={},n;for(n in e)a.call(e,n)&&(r[n]=t.call(i,e[n],n,e));return r},Tb:function(e){for(;e.firstChild;)I.removeNode(e.firstChild)},Yb:function(e){e=I.a.la(e);for(var t=(e[0]&&e[0].ownerDocument||T).createElement("div"),i=0,r=e.length;i<r;i++)t.appendChild(I.oa(e[i]));return t},Ca:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var a=e[i].cloneNode(!0);n.push(t?I.oa(a):a)}return n},va:function(e,t){I.a.Tb(e);if(t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},Xc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,a=0,o=t.length;a<o;a++)n.insertBefore(t[a],r);a=0;for(o=i.length;a<o;a++)I.removeNode(i[a])}},Ua:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},Zc:function(e,t){7>c?e.setAttribute("selected",t):e.selected=t},Db:function(e){return null===e||e===R?"":e.trim?e.trim():e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(e,t){e=e||"";return t.length>e.length?!1:e.substring(0,t.length)===t},vd:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(1!==e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(t.compareDocumentPosition(e)&16);for(;e&&e!=t;)e=e.parentNode;return!!e},Sb:function(e){return I.a.vd(e,e.ownerDocument.documentElement)},kd:function(e){return!!I.a.Lb(e,I.a.Sb)},R:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Ac:function(e){return I.onError?function(){try{return e.apply(this,arguments)}catch(e){throw I.onError&&I.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(I.a.Ac(e),t)},Gc:function(e){setTimeout(function(){I.onError&&I.onError(e);throw e},0)},B:function(t,e,i){var r=I.a.Ac(i);i=l[e];if(I.options.useOnlyNativeEvents||i||!x)if(i||"function"!=typeof t.addEventListener)if("undefined"!=typeof t.attachEvent){var n=function(e){r.call(t,e)},a="on"+e;t.attachEvent(a,n);I.a.K.za(t,function(){t.detachEvent(a,n)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else t.addEventListener(e,r,!1);else h||(h="function"==typeof x(t).on?"on":"bind"),x(t)[h](e,r)},Fb:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var i;"input"===I.a.R(e)&&e.type&&"click"==t.toLowerCase()?(i=e.type,i="checkbox"==i||"radio"==i):i=!1;if(I.options.useOnlyNativeEvents||!x||i)if("function"==typeof T.createEvent)if("function"==typeof e.dispatchEvent)i=T.createEvent(s[t]||"HTMLEvents"),i.initEvent(t,!0,!0,S,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(i);else throw Error("The supplied element doesn't support dispatchEvent");else if(i&&e.click)e.click();else if("undefined"!=typeof e.fireEvent)e.fireEvent("on"+t);else throw Error("Browser doesn't support triggering events");else x(e).trigger(t)},f:function(e){return I.O(e)?e():e},bc:function(e){return I.O(e)?e.v():e},Eb:function(t,e,i){var r;e&&("object"===typeof t.classList?(r=t.classList[i?"add":"remove"],I.a.D(e.match(u),function(e){r.call(t.classList,e)})):"string"===typeof t.className.baseVal?n(t.className,"baseVal",e,i):n(t,"className",e,i))},Bb:function(e,t){var i=I.a.f(t);if(null===i||i===R)i="";var r=I.h.firstChild(e);!r||3!=r.nodeType||I.h.nextSibling(r)?I.h.va(e,[e.ownerDocument.createTextNode(i)]):r.data=i;I.a.Ad(e)},Yc:function(e,t){e.name=t;if(7>=c)try{var i=e.name.replace(/[&<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"});e.mergeAttributes(T.createElement("<input name='"+i+"'/>"),!1)}catch(e){}},Ad:function(e){9<=c&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},wd:function(e){if(c){var t=e.style.width;e.style.width=0;e.style.width=t}},Pd:function(e,t){e=I.a.f(e);t=I.a.f(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},la:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Da:function(e){return r?Symbol(e):e},Zd:6===c,$d:7===c,W:c,Lc:function(e,t){for(var i=I.a.la(e.getElementsByTagName("input")).concat(I.a.la(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],a=i.length-1;0<=a;a--)r(i[a])&&n.push(i[a]);return n},Nd:function(e){return"string"==typeof e&&(e=I.a.Db(e))?b&&b.parse?b.parse(e):new Function("return "+e)():null},hc:function(e,t,i){if(!b||!b.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 b.stringify(I.a.f(e),t,i)},Od:function(e,t,i){i=i||{};var r=i.params||{},n=i.includeFields||this.Jc,a=e;if("object"==typeof e&&"form"===I.a.R(e))for(var a=e.action,o=n.length-1;0<=o;o--)for(var s=I.a.Lc(e,n[o]),l=s.length-1;0<=l;l--)r[s[l].name]=s[l].value;t=I.a.f(t);var c=T.createElement("form");c.style.display="none";c.action=a;c.method="post";for(var u in t)e=T.createElement("input"),e.type="hidden",e.name=u,e.value=I.a.hc(I.a.f(t[u])),c.appendChild(e);d(r,function(e,t){var i=T.createElement("input");i.type="hidden";i.name=e;i.value=t;c.appendChild(i)});T.body.appendChild(c);i.submitter?i.submitter(c):c.submit();setTimeout(function(){c.parentNode.removeChild(c)},0)}}}(),I.b("utils",I.a),I.b("utils.arrayForEach",I.a.D),I.b("utils.arrayFirst",I.a.Lb),I.b("utils.arrayFilter",I.a.jb),I.b("utils.arrayGetDistinctValues",I.a.wc),I.b("utils.arrayIndexOf",I.a.A),I.b("utils.arrayMap",I.a.Mb),I.b("utils.arrayPushAll",I.a.Nb),I.b("utils.arrayRemoveItem",I.a.Pa),I.b("utils.cloneNodes",I.a.Ca),I.b("utils.createSymbolOrString",I.a.Da),I.b("utils.extend",I.a.extend),I.b("utils.fieldsIncludedWithJsonPost",I.a.Jc),I.b("utils.getFormFields",I.a.Lc),I.b("utils.objectMap",I.a.Ga),I.b("utils.peekObservable",I.a.bc),I.b("utils.postJson",I.a.Od),I.b("utils.parseJson",I.a.Nd),I.b("utils.registerEventHandler",I.a.B),I.b("utils.stringifyJson",I.a.hc),I.b("utils.range",I.a.Pd),I.b("utils.toggleDomNodeCssClass",I.a.Eb),I.b("utils.triggerEvent",I.a.Fb),I.b("utils.unwrapObservable",I.a.f),I.b("utils.objectForEach",I.a.P),I.b("utils.addOrRemoveItem",I.a.Na),I.b("utils.setTextContent",I.a.Bb),I.b("unwrap",I.a.f),Function.prototype.bind||(Function.prototype.bind=function(t){var i=this;if(1===arguments.length)return function(){return i.apply(t,arguments)};var r=Array.prototype.slice.call(arguments,1);return function(){var e=r.slice(0);e.push.apply(e,arguments);return i.apply(t,e)}}),I.a.g=new function(){var r=0,n="__ko__"+(new Date).getTime(),a={},o,e;I.a.W?(o=function(e,t){var i=e[n];if(!i||"null"===i||!a[i]){if(!t)return R;i=e[n]="ko"+r++;a[i]={}}return a[i]},e=function(e){var t=e[n];return t?(delete a[t],e[n]=null,!0):!1}):(o=function(e,t){var i=e[n];!i&&t&&(i=e[n]={});return i},e=function(e){return e[n]?(delete e[n],!0):!1});return{get:function(e,t){var i=o(e,!1);return i&&i[t]},set:function(e,t,i){(e=o(e,i!==R))&&(e[t]=i)},Ub:function(e,t,i){e=o(e,!0);return e[t]||(e[t]=i)},clear:e,Z:function(){return r+++n}}},I.b("utils.domData",I.a.g),I.b("utils.domData.clear",I.a.g.clear),I.a.K=new function(){function r(e,t){var i=I.a.g.get(e,o);i===R&&t&&(i=[],I.a.g.set(e,o,i));return i}function a(e){var t=r(e,!1);if(t)for(var t=t.slice(0),i=0;i<t.length;i++)t[i](e);I.a.g.clear(e);I.a.K.cleanExternalData(e);s[e.nodeType]&&n(e.childNodes,!0)}function n(e,t){for(var i=[],r,n=0;n<e.length;n++)if(!t||8===e[n].nodeType)if(a(i[i.length]=r=e[n]),e[n]!==r)for(;n--&&-1==I.a.A(i,e[n]););}var o=I.a.g.Z(),t={1:!0,8:!0,9:!0},s={1:!0,9:!0};return{za:function(e,t){if("function"!=typeof t)throw Error("Callback must be a function");r(e,!0).push(t)},yb:function(e,t){var i=r(e,!1);i&&(I.a.Pa(i,t),0==i.length&&I.a.g.set(e,o,R))},oa:function(e){I.u.G(function(){t[e.nodeType]&&(a(e),s[e.nodeType]&&n(e.getElementsByTagName("*")))});return e},removeNode:function(e){I.oa(e);e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){x&&"function"==typeof x.cleanData&&x.cleanData([e])}}},I.oa=I.a.K.oa,I.removeNode=I.a.K.removeNode,I.b("cleanNode",I.oa),I.b("removeNode",I.removeNode),I.b("utils.domNodeDisposal",I.a.K),I.b("utils.domNodeDisposal.addDisposeCallback",I.a.K.za),I.b("utils.domNodeDisposal.removeDisposeCallback",I.a.K.yb),function(){var s=[0,"",""],e=[1,"<table>","</table>"],t=[3,"<table><tbody><tr>","</tr></tbody></table>"],i=[1,"<select multiple='multiple'>","</select>"],l={thead:e,tbody:e,tfoot:e,tr:[2,"<table><tbody>","</tbody></table>"],td:t,th:t,option:i,optgroup:i},c=8>=I.a.W;I.a.ua=function(e,t){var i;if(x){if(x.parseHTML)i=x.parseHTML(e,t)||[];else if((i=x.clean([e],t))&&i[0]){for(var r=i[0];r.parentNode&&11!==r.parentNode.nodeType;)r=r.parentNode;r.parentNode&&r.parentNode.removeChild(r)}}else{(i=t)||(i=T);var r=i.parentWindow||i.defaultView||S,n=I.a.Db(e).toLowerCase(),a=i.createElement("div"),o;o=(n=n.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&l[n[1]]||s;n=o[0];o="ignored<div>"+o[1]+e+o[2]+"</div>";"function"==typeof r.innerShiv?a.appendChild(r.innerShiv(o)):(c&&i.body.appendChild(a),a.innerHTML=o,c&&a.parentNode.removeChild(a));for(;n--;)a=a.lastChild;i=I.a.la(a.lastChild.childNodes)}return i};I.a.Md=function(e,t){var i=I.a.ua(e,t);return i.length&&i[0].parentElement||I.a.Yb(i)};I.a.fc=function(e,t){I.a.Tb(e);t=I.a.f(t);if(null!==t&&t!==R)if("string"!=typeof t&&(t=t.toString()),x)x(e).html(t);else for(var i=I.a.ua(t,e.ownerDocument),r=0;r<i.length;r++)e.appendChild(i[r])}}(),I.b("utils.parseHtmlFragment",I.a.ua),I.b("utils.setHtml",I.a.fc),I.aa=function(){function s(e,t){if(e)if(8==e.nodeType){var i=I.aa.Uc(e.nodeValue);null!=i&&t.push({ud:e,Kd:i})}else if(1==e.nodeType)for(var i=0,r=e.childNodes,n=r.length;i<n;i++)s(r[i],t)}var r={};return{Xb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);r[t]=e;return"\x3c!--[ko_memo:"+t+"]--\x3e"},bd:function(e,t){var i=r[e];if(i===R)throw Error("Couldn't find any memo with ID "+e+". Perhaps it's already been unmemoized.");try{return i.apply(null,t||[]),!0}finally{delete r[e]}},cd:function(e,t){var i=[];s(e,i);for(var r=0,n=i.length;r<n;r++){var a=i[r].ud,o=[a];t&&I.a.Nb(o,t);I.aa.bd(i[r].Kd,o);a.nodeValue="";a.parentNode&&a.parentNode.removeChild(a)}},Uc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),I.b("memoization",I.aa),I.b("memoization.memoize",I.aa.Xb),I.b("memoization.unmemoize",I.aa.bd),I.b("memoization.parseMemoText",I.aa.Uc),I.b("memoization.unmemoizeDomNodeAndDescendants",I.aa.cd),I.na=function(){function e(){if(n)for(var e=n,t=0,i;o<n;)if(i=r[o++]){if(o>e){if(5e3<=++t){o=n;I.a.Gc(Error("'Too much recursion' after processing "+t+" task groups."));break}e=n}try{i()}catch(e){I.a.Gc(e)}}}function t(){e();o=n=r.length=0}var i,r=[],n=0,a=1,o=0;S.MutationObserver?i=function(e){var t=T.createElement("div");new MutationObserver(e).observe(t,{attributes:!0});return function(){t.classList.toggle("foo")}}(t):i=T&&"onreadystatechange"in T.createElement("script")?function(e){var t=T.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null;T.documentElement.removeChild(t);t=null;e()};T.documentElement.appendChild(t)}:function(e){setTimeout(e,0)};return{scheduler:i,zb:function(e){n||I.na.scheduler(t);r[n++]=e;return a++},cancel:function(e){e=e-(a-n);e>=o&&e<n&&(r[e]=null)},resetForTesting:function(){var e=n-o;o=n=r.length=0;return e},Sd:e}}(),I.b("tasks",I.na),I.b("tasks.schedule",I.na.zb),I.b("tasks.runEarly",I.na.Sd),I.Ta={throttle:function(t,i){t.throttleEvaluation=i;var r=null;return I.$({read:t,write:function(e){clearTimeout(r);r=I.a.setTimeout(function(){t(e)},i)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method);e.Hb=!1;n="function"==typeof r?r:"notifyWhenChangesStop"==r?o:a;e.ub(function(e){return n(e,i,t)})},deferred:function(r,e){if(!0!==e)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");r.Hb||(r.Hb=!0,r.ub(function(e){var t,i=!1;return function(){if(!i){I.na.cancel(t);t=I.na.zb(e);try{i=!0,r.notifySubscribers(R,"dirty")}finally{i=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:i}};var l={undefined:1,boolean:1,number:1,string:1};I.b("extenders",I.Ta),I.ic=function(e,t,i){this.da=e;this.lc=t;this.mc=i;this.Ib=!1;this.fb=this.Jb=null;I.L(this,"dispose",this.s);I.L(this,"disposeWhenNodeIsRemoved",this.l)},I.ic.prototype.s=function(){this.Ib||(this.fb&&I.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},I.ic.prototype.l=function(e){this.Jb=e;I.a.K.za(e,this.fb=this.s.bind(this))},I.T=function(){I.a.Ab(this,t);t.qb(this)};var t={qb:function(e){e.U={change:[]};e.sc=1},subscribe:function(e,t,i){var r=this;i=i||"change";var n=new I.ic(r,t?e.bind(t):e,function(){I.a.Pa(r.U[i],n);r.hb&&r.hb(i)});r.Qa&&r.Qa(i);r.U[i]||(r.U[i]=[]);r.U[i].push(n);return n},notifySubscribers:function(e,t){t=t||"change";"change"===t&&this.Gb();if(this.Wa(t)){var i="change"===t&&this.ed||this.U[t].slice(0);try{I.u.xc();for(var r=0,n;n=i[r];++r)n.Ib||n.lc(e)}finally{I.u.end()}}},ob:function(){return this.sc},Dd:function(e){return this.ob()!==e},Gb:function(){++this.sc},ub:function(e){var i=this,t=I.O(i),r,n,a,o,s;i.gb||(i.gb=i.notifySubscribers,i.notifySubscribers=c);var l=e(function(){i.Ja=!1;t&&o===i&&(o=i.nc?i.nc():i());var e=n||s&&i.sb(a,o);s=n=r=!1;e&&i.gb(a=o)});i.qc=function(e,t){t&&i.Ja||(s=!t);i.ed=i.U.change.slice(0);i.Ja=r=!0;o=e;l()};i.pc=function(e){r||(a=e,i.gb(e,"beforeChange"))};i.rc=function(){s=!0};i.gd=function(){i.sb(a,i.v(!0))&&(n=!0)}},Wa:function(e){return this.U[e]&&this.U[e].length},Bd:function(e){if(e)return this.U[e]&&this.U[e].length||0;var i=0;I.a.P(this.U,function(e,t){"dirty"!==e&&(i+=t.length)});return i},sb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},toString:function(){return"[object Object]"},extend:function(e){var r=this;e&&I.a.P(e,function(e,t){var i=I.Ta[e];"function"==typeof i&&(r=i(r,t)||r)});return r}};I.L(t,"init",t.qb),I.L(t,"subscribe",t.subscribe),I.L(t,"extend",t.extend),I.L(t,"getSubscriptionsCount",t.Bd),I.a.Ba&&I.a.setPrototypeOf(t,Function.prototype),I.T.fn=t,I.Qc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},I.b("subscribable",I.T),I.b("isSubscribable",I.Qc),I.S=I.u=function(){function r(e){t.push(i);i=e}function n(){i=t.pop()}var t=[],i,a=0;return{xc:r,end:n,cc:function(e){if(i){if(!I.Qc(e))throw Error("Only subscribable things can act as dependencies");i.od.call(i.pd,e,e.fd||(e.fd=++a))}},G:function(e,t,i){try{return r(),e.apply(t,i||[])}finally{n()}},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}}}(),I.b("computedContext",I.S),I.b("computedContext.getDependenciesCount",I.S.qa),I.b("computedContext.getDependencies",I.S.Va),I.b("computedContext.isInitial",I.S.Ya),I.b("computedContext.registerDependency",I.S.cc),I.b("ignoreDependencies",I.Yd=I.u.G);var u=I.a.Da("_latestValue");I.ta=function(e){function t(){if(0<arguments.length)return t.sb(t[u],arguments[0])&&(t.ya(),t[u]=arguments[0],t.xa()),this;I.u.cc(t);return t[u]}t[u]=e;I.a.Ba||I.a.extend(t,I.T.fn);I.T.fn.qb(t);I.a.Ab(t,d);I.options.deferUpdates&&I.Ta.deferred(t,!0);return t};var d={equalityComparer:i,v:function(){return this[u]},xa:function(){this.notifySubscribers(this[u],"spectate");this.notifySubscribers(this[u])},ya:function(){this.notifySubscribers(this[u],"beforeChange")}};I.a.Ba&&I.a.setPrototypeOf(d,I.T.fn);var h=I.ta.Ma="__ko_proto__";d[h]=I.ta,I.O=function(e){if((e="function"==typeof e&&e[h])&&e!==d[h]&&e!==I.o.fn[h])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},I.Za=function(e){return"function"==typeof e&&(e[h]===d[h]||e[h]===I.o.fn[h]&&e.Nc)},I.b("observable",I.ta),I.b("isObservable",I.O),I.b("isWriteableObservable",I.Za),I.b("isWritableObservable",I.Za),I.b("observable.fn",d),I.L(d,"peek",d.v),I.L(d,"valueHasMutated",d.xa),I.L(d,"valueWillMutate",d.ya),I.Ha=function(e){e=e||[];if("object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");e=I.ta(e);I.a.Ab(e,I.Ha.fn);return e.extend({trackArrayChanges:!0})},I.Ha.fn={remove:function(t){for(var e=this.v(),i=[],r="function"!=typeof t||I.O(t)?function(e){return e===t}:t,n=0;n<e.length;n++){var a=e[n];if(r(a)){0===i.length&&this.ya();if(e[n]!==a)throw Error("Array modified during remove; cannot remove item");i.push(a);e.splice(n,1);n--}}i.length&&this.xa();return i},removeAll:function(t){if(t===R){var e=this.v(),i=e.slice(0);this.ya();e.splice(0,e.length);this.xa();return i}return t?this.remove(function(e){return 0<=I.a.A(t,e)}):[]},destroy:function(t){var e=this.v(),i="function"!=typeof t||I.O(t)?function(e){return e===t}:t;this.ya();for(var r=e.length-1;0<=r;r--){var n=e[r];i(n)&&(n._destroy=!0)}this.xa()},destroyAll:function(t){return t===R?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=I.a.A(t,e)}):[]},indexOf:function(e){var t=this();return I.a.A(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ya(),this.v()[i]=t,this.xa())},sorted:function(e){var t=this().slice(0);return e?t.sort(e):t.sort()},reversed:function(){return this().slice(0).reverse()}},I.a.Ba&&I.a.setPrototypeOf(I.Ha.fn,I.ta.fn),I.a.D("pop push reverse shift sort splice unshift".split(" "),function(i){I.Ha.fn[i]=function(){var e=this.v();this.ya();this.zc(e,i,arguments);var t=e[i].apply(e,arguments);this.xa();return t===e?this:t}}),I.a.D(["slice"],function(t){I.Ha.fn[t]=function(){var e=this();return e[t].apply(e,arguments)}}),I.Pc=function(e){return I.O(e)&&"function"==typeof e.remove&&"function"==typeof e.push},I.b("observableArray",I.Ha),I.b("isObservableArray",I.Pc),I.Ta.trackArrayChanges=function(i,e){function t(){function e(){if(p){var e=[].concat(i.v()||[]),t;if(i.Wa("arrayChange")){if(!h||1<p)h=I.a.Pb(a,e,i.Ob);t=h}a=e;h=null;p=0;t&&t.length&&i.notifySubscribers(t,"arrayChange")}}d?e():(d=!0,n=i.subscribe(function(){++p},null,"spectate"),a=[].concat(i.v()||[]),h=null,r=i.subscribe(e))}i.Ob={};e&&"object"==typeof e&&I.a.extend(i.Ob,e);i.Ob.sparse=!0;if(!i.zc){var d=!1,h=null,r,n,p=0,a,o=i.Qa,s=i.hb;i.Qa=function(e){o&&o.call(i,e);"arrayChange"===e&&t()};i.hb=function(e){s&&s.call(i,e);"arrayChange"!==e||i.Wa("arrayChange")||(r&&r.s(),n&&n.s(),n=r=null,d=!1,a=R)};i.zc=function(e,t,i){function r(e,t,i){return n[n.length]={status:e,value:t,index:i}}if(d&&!p){var n=[],a=e.length,o=i.length,s=0;switch(t){case"push":s=a;case"unshift":for(t=0;t<o;t++)r("added",i[t],s+t);break;case"pop":s=a-1;case"shift":a&&r("deleted",e[s],s);break;case"splice":t=Math.min(Math.max(0,0>i[0]?a+i[0]:i[0]),a);for(var a=1===o?a:Math.min(t+(i[1]||0),a),o=t+o-2,s=Math.max(a,o),l=[],c=[],u=2;t<s;++t,++u)t<a&&c.push(r("deleted",e[t],t)),t<o&&l.push(r("added",i[u],t));I.a.Kc(c,l);break;default:return}h=n}}}};var p=I.a.Da("_state");I.o=I.$=function(e,t,i){function r(){if(0<arguments.length){if("function"===typeof n)n.apply(a.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}a.ra||I.u.cc(r);(a.ka||a.J&&r.Xa())&&r.ha();return a.X}"object"===typeof e?i=e:(i=i||{},e&&(i.read=e));if("function"!=typeof i.read)throw Error("Pass a function that returns the value of the ko.computed");var n=i.write,a={X:R,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:i.read,nb:t||i.owner,l:i.disposeWhenNodeIsRemoved||i.l||null,Sa:i.disposeWhen||i.Sa,Rb:null,I:{},V:0,Ic:null};r[p]=a;r.Nc="function"===typeof n;I.a.Ba||I.a.extend(r,I.T.fn);I.T.fn.qb(r);I.a.Ab(r,m);i.pure?(a.wb=!0,a.J=!0,I.a.extend(r,f)):i.deferEvaluation&&I.a.extend(r,g);I.options.deferUpdates&&I.Ta.deferred(r,!0);a.l&&(a.jc=!0,a.l.nodeType||(a.l=null));a.J||i.deferEvaluation||r.ha();a.l&&r.ja()&&I.a.K.za(a.l,a.Rb=function(){r.s()});return r};var m={equalityComparer:i,qa:function(){return this[p].V},Va:function(){var i=[];I.a.P(this[p].I,function(e,t){i[t.Ka]=t.da});return i},Vb:function(t){if(!this[p].V)return!1;var e=this.Va();return-1!==I.a.A(e,t)?!0:!!I.a.Lb(e,function(e){return e.Vb&&e.Vb(t)})},uc:function(e,t,i){if(this[p].wb&&t===this)throw Error("A 'pure' computed must not be called recursively");this[p].I[e]=i;i.Ka=this[p].V++;i.La=t.ob()},Xa:function(){var e,t,i=this[p].I;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&(t=i[e],this.Ia&&t.da.Ja||t.da.Dd(t.La)))return!0},Jd:function(){this.Ia&&!this[p].rb&&this.Ia(!1)},ja:function(){var e=this[p];return e.ka||0<e.V},Rd:function(){this.Ja?this[p].ka&&(this[p].sa=!0):this.Hc()},$c:function(e){if(e.Hb){var t=e.subscribe(this.Jd,this,"dirty"),i=e.subscribe(this.Rd,this);return{da:e,s:function(){t.s();i.s()}}}return e.subscribe(this.Hc,this)},Hc:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[p].Ic),this[p].Ic=I.a.setTimeout(function(){e.ha(!0)},t)):e.Ia?e.Ia(!0):e.ha(!0)},ha:function(e){var t=this[p],i=t.Sa,r=!1;if(!t.rb&&!t.ra){if(t.l&&!I.a.Sb(t.l)||i&&i()){if(!t.jc){this.s();return}}else t.jc=!1;t.rb=!0;try{r=this.zd(e)}finally{t.rb=!1}return r}},zd:function(e){var t=this[p],i=!1,r=t.wb?R:!t.V,i={qd:this,mb:t.I,Qb:t.V};I.u.xc({pd:i,od:s,o:this,Ya:r});t.I={};t.V=0;var n=this.yd(t,i);t.V?i=this.sb(t.X,n):(this.s(),i=!0);i&&(t.J?this.Gb():this.notifySubscribers(t.X,"beforeChange"),t.X=n,this.notifySubscribers(t.X,"spectate"),!t.J&&e&&this.notifySubscribers(t.X),this.rc&&this.rc());r&&this.notifySubscribers(t.X,"awake");return i},yd:function(e,t){try{var i=e.Wc;return e.nb?i.call(e.nb):i()}finally{I.u.end(),t.Qb&&!e.J&&I.a.P(t.mb,n),e.sa=e.ka=!1}},v:function(e){var t=this[p];(t.ka&&(e||!t.V)||t.J&&this.Xa())&&this.ha();return t.X},ub:function(e){I.T.fn.ub.call(this,e);this.nc=function(){this[p].J||(this[p].sa?this.ha():this[p].ka=!1);return this[p].X};this.Ia=function(e){this.pc(this[p].X);this[p].ka=!0;e&&(this[p].sa=!0);this.qc(this,!e)}},s:function(){var e=this[p];!e.J&&e.I&&I.a.P(e.I,function(e,t){t.s&&t.s()});e.l&&e.Rb&&I.a.K.yb(e.l,e.Rb);e.I=R;e.V=0;e.ra=!0;e.sa=!1;e.ka=!1;e.J=!1;e.l=R;e.Sa=R;e.Wc=R;this.Nc||(e.nb=R)}},f={Qa:function(e){var n=this,a=n[p];if(!a.ra&&a.J&&"change"==e){a.J=!1;if(a.sa||n.Xa())a.I=null,a.V=0,n.ha()&&n.Gb();else{var i=[];I.a.P(a.I,function(e,t){i[t.Ka]=e});I.a.D(i,function(e,t){var i=a.I[e],r=n.$c(i.da);r.Ka=t;r.La=i.La;a.I[e]=r});n.Xa()&&n.ha()&&n.Gb()}a.ra||n.notifySubscribers(a.X,"awake")}},hb:function(e){var i=this[p];i.ra||"change"!=e||this.Wa("change")||(I.a.P(i.I,function(e,t){t.s&&(i.I[e]={da:t.da,Ka:t.Ka,La:t.La},t.s())}),i.J=!0,this.notifySubscribers(R,"asleep"))},ob:function(){var e=this[p];e.J&&(e.sa||this.Xa())&&this.ha();return I.T.fn.ob.call(this)}},g={Qa:function(e){"change"!=e&&"beforeChange"!=e||this.v()}};I.a.Ba&&I.a.setPrototypeOf(m,I.T.fn);var _=I.ta.Ma;m[_]=I.o,I.Oc=function(e){return"function"==typeof e&&e[_]===m[_]},I.Fd=function(e){return I.Oc(e)&&e[p]&&e[p].wb},I.b("computed",I.o),I.b("dependentObservable",I.o),I.b("isComputed",I.Oc),I.b("isPureComputed",I.Fd),I.b("computed.fn",m),I.L(m,"peek",m.v),I.L(m,"dispose",m.s),I.L(m,"isActive",m.ja),I.L(m,"getDependenciesCount",m.qa),I.L(m,"getDependencies",m.Va),I.xb=function(e,t){if("function"===typeof e)return I.o(e,t,{pure:!0});e=I.a.extend({},e);e.pure=!0;return I.o(e,t)},I.b("pureComputed",I.xb),function(){function s(r,n,a){a=a||new t;r=n(r);if("object"!=typeof r||null===r||r===R||r instanceof RegExp||r instanceof Date||r instanceof String||r instanceof Number||r instanceof Boolean)return r;var o=r instanceof Array?[]:{};a.save(r,o);e(r,function(e){var t=n(r[e]);switch(typeof t){case"boolean":case"number":case"string":case"function":o[e]=t;break;case"object":case"undefined":var i=a.get(t);o[e]=i!==R?i:s(t,n,a)}});return o}function e(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function t(){this.keys=[];this.values=[]}I.ad=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return s(e,function(e){for(var t=0;I.O(e)&&10>t;t++)e=e();return e})};I.toJSON=function(e,t,i){e=I.ad(e);return I.a.hc(e,t,i)};t.prototype={constructor:t,save:function(e,t){var i=I.a.A(this.keys,e);0<=i?this.values[i]=t:(this.keys.push(e),this.values.push(t))},get:function(e){e=I.a.A(this.keys,e);return 0<=e?this.values[e]:R}}}(),I.b("toJS",I.ad),I.b("toJSON",I.toJSON),I.Wd=function(r,e,n){function t(t){var e=I.xb(r,n).extend({ma:"always"}),i=e.subscribe(function(e){e&&(i.s(),t(e))});e.notifySubscribers(e.v());return i}return"function"!==typeof Promise||e?t(e.bind(n)):new Promise(t)},I.b("when",I.Wd),function(){I.w={M:function(e){switch(I.a.R(e)){case"option":return!0===e.__ko__hasDomDataOptionValue__?I.a.g.get(e,I.c.options.$b):7>=I.a.W?e.getAttributeNode("value")&&e.getAttributeNode("value").specified?e.value:e.text:e.value;case"select":return 0<=e.selectedIndex?I.w.M(e.options[e.selectedIndex]):R;default:return e.value}},cb:function(e,t,i){switch(I.a.R(e)){case"option":"string"===typeof t?(I.a.g.set(e,I.c.options.$b,R),"__ko__hasDomDataOptionValue__"in e&&delete e.__ko__hasDomDataOptionValue__,e.value=t):(I.a.g.set(e,I.c.options.$b,t),e.__ko__hasDomDataOptionValue__=!0,e.value="number"===typeof t?t:"");break;case"select":if(""===t||null===t)t=R;for(var r=-1,n=0,a=e.options.length,o;n<a;++n)if(o=I.w.M(e.options[n]),o==t||""===o&&t===R){r=n;break}if(i||0<=r||t===R&&1<e.size)e.selectedIndex=r,6===I.a.W&&I.a.setTimeout(function(){e.selectedIndex=r},0);break;default:if(null===t||t===R)t="";e.value=t}}}}(),I.b("selectExtensions",I.w),I.b("selectExtensions.readValue",I.w.M),I.b("selectExtensions.writeValue",I.w.cb),I.m=function(){function r(e){e=I.a.Db(e);123===e.charCodeAt(0)&&(e=e.slice(1,-1));e+="\n,";var t=[],i=e.match(d),r,n=[],a=0;if(1<i.length){for(var o=0,s;s=i[o];++o){var l=s.charCodeAt(0);if(44===l){if(0>=a){t.push(r&&n.length?{key:r,value:n.join("")}:{unknown:r||n.join("")});r=a=0;n=[];continue}}else if(58===l){if(!a&&!r&&1===n.length){r=n.pop();continue}}else if(47===l&&1<s.length&&(47===s.charCodeAt(1)||42===s.charCodeAt(1)))continue;else 47===l&&o&&1<s.length?(l=i[o-1].match(h))&&!p[l[0]]&&(e=e.substr(e.indexOf(s)+1),i=e.match(d),o=-1,s="/"):40===l||123===l||91===l?++a:41===l||125===l||93===l?--a:r||n.length||34!==l&&39!==l||(s=s.slice(1,-1));n.push(s)}if(0<a)throw Error("Unbalanced parentheses, braces, or brackets")}return t}var c=["true","false","null","undefined"],u=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,d=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),h=/[\])"'A-Za-z0-9_$]+$/,p={in:1,return:1,typeof:1},m={};return{Ra:[],wa:m,ac:r,vb:function(e,t){function n(e,t){var i;if(!l){var r=I.getBindingHandler(e);if(r&&r.preprocess&&!(t=r.preprocess(t,e,n)))return;if(r=m[e])i=t,0<=I.a.A(c,i)?i=!1:(r=i.match(u),i=null===r?!1:r[1]?"Object("+r[1]+")"+r[2]:i),r=i;r&&o.push("'"+("string"==typeof m[e]?m[e]:e)+"':function(_z){"+i+"=_z}")}s&&(t="function(){return "+t+" }");a.push("'"+e+"':"+t)}t=t||{};var a=[],o=[],s=t.valueAccessors,l=t.bindingParams,i="string"===typeof e?r(e):e;I.a.D(i,function(e){n(e.key||e.unknown,e.value)});o.length&&n("_ko_property_writers","{"+o.join(",")+" }");return a.join(",")},Id:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},eb:function(e,t,i,r,n){if(e&&I.O(e))!I.Za(e)||n&&e.v()===r||e(r);else if((e=t.get("_ko_property_writers"))&&e[i])e[i](r)}}}(),I.b("expressionRewriting",I.m),I.b("expressionRewriting.bindingRewriteValidators",I.m.Ra),I.b("expressionRewriting.parseObjectLiteral",I.m.ac),I.b("expressionRewriting.preProcessBindings",I.m.vb),I.b("expressionRewriting._twoWayBindings",I.m.wa),I.b("jsonExpressionRewriting",I.m),I.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",I.m.vb),function(){function a(e){return 8==e.nodeType&&i.test(t?e.text:e.nodeValue)}function o(e){return 8==e.nodeType&&n.test(t?e.text:e.nodeValue)}function r(e,t){for(var i=e,r=1,n=[];i=i.nextSibling;){if(o(i)&&(I.a.g.set(i,c,!0),r--,0===r))return n;n.push(i);a(i)&&r++}if(!t)throw Error("Cannot find closing comment tag to match: "+e.nodeValue);return null}function s(e,t){var i=r(e,t);return i?0<i.length?i[i.length-1].nextSibling:e.nextSibling:null}var t=T&&"\x3c!--test--\x3e"===T.createComment("test").text,i=t?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,n=t?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0},c="__ko_matchedEndComment__";I.h={ea:{},childNodes:function(e){return a(e)?r(e):e.childNodes},Ea:function(e){if(a(e)){e=I.h.childNodes(e);for(var t=0,i=e.length;t<i;t++)I.removeNode(e[t])}else I.a.Tb(e)},va:function(e,t){if(a(e)){I.h.Ea(e);for(var i=e.nextSibling,r=0,n=t.length;r<n;r++)i.parentNode.insertBefore(t[r],i)}else I.a.va(e,t)},Vc:function(e,t){var i;a(e)?(i=e.nextSibling,e=e.parentNode):i=e.firstChild;i?t!==i&&e.insertBefore(t,i):e.appendChild(t)},Wb:function(e,t,i){i?(i=i.nextSibling,a(e)&&(e=e.parentNode),i?t!==i&&e.insertBefore(t,i):e.appendChild(t)):I.h.Vc(e,t)},firstChild:function(e){if(a(e))return!e.nextSibling||o(e.nextSibling)?null:e.nextSibling;if(e.firstChild&&o(e.firstChild))throw Error("Found invalid end comment, as the first child of "+e);return e.firstChild},nextSibling:function(e){a(e)&&(e=s(e));if(e.nextSibling&&o(e.nextSibling)){var t=e.nextSibling;if(o(t)&&!I.a.g.get(t,c))throw Error("Found end comment without a matching opening comment, as child of "+e);return null}return e.nextSibling},Cd:a,Vd:function(e){return(e=(t?e.text:e.nodeValue).match(i))?e[1]:null},Sc:function(e){if(l[I.a.R(e)]){var t=e.firstChild;if(t)do{if(1===t.nodeType){var i;i=t.firstChild;var r=null;if(i)do{if(r)r.push(i);else if(a(i)){var n=s(i,!0);n?i=n:r=[i]}else o(i)&&(r=[i])}while(i=i.nextSibling);if(i=r)for(r=t.nextSibling,n=0;n<i.length;n++)r?e.insertBefore(i[n],r):e.appendChild(i[n])}}while(t=t.nextSibling)}}}}(),I.b("virtualElements",I.h),I.b("virtualElements.allowedBindings",I.h.ea),I.b("virtualElements.emptyNode",I.h.Ea),I.b("virtualElements.insertAfter",I.h.Wb),I.b("virtualElements.prepend",I.h.Vc),I.b("virtualElements.setDomNodeChildren",I.h.va),function(){I.ga=function(){this.nd={}};I.a.extend(I.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||I.j.getComponentNameForNode(e);case 8:return I.h.Cd(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return I.j.tc(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return I.j.tc(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return I.h.Vd(e);default:return null}},parseBindingsString:function(t,e,i,r){try{var n=this.nd,a=t+(r&&r.valueAccessors||""),o;if(!(o=n[a])){var s,l="with($context){with($data||{}){return{"+I.m.vb(t,r)+"}}}";s=new Function("$context","$element",l);o=n[a]=s}return o(e,i)}catch(e){throw e.message="Unable to parse bindings.\nBindings value: "+t+"\nMessage: "+e.message,e}}});I.ga.instance=new I.ga}(),I.b("bindingProvider",I.ga),function(){function r(e){var t=(e=I.a.g.get(e,v))&&e.N;t&&(e.N=null,t.Tc())}function n(e,t,i){this.node=e;this.yc=t;this.kb=[];this.H=!1;t.N||I.a.K.za(e,r);i&&i.N&&(i.N.kb.push(e),this.Kb=i)}function a(e){return function(){return e}}function p(e){return e()}function o(i){return I.a.Ga(I.u.G(i),function(e,t){return function(){return i()[t]}})}function s(e,t,i){return"function"===typeof e?o(e.bind(null,t,i)):I.a.Ga(e,a)}function m(e,t){return o(this.getBindings.bind(this,e,t))}function l(e,t){var i=I.h.firstChild(t);if(i){var r,n=I.ga.instance,a=n.preprocessNode;if(a){for(;r=i;)i=I.h.nextSibling(r),a.call(n,r);i=I.h.firstChild(t)}for(;r=i;)i=I.h.nextSibling(r),c(e,r)}I.i.ma(t,I.i.H)}function c(e,t){var i=e,r=1===t.nodeType;r&&I.h.Sc(t);if(r||I.ga.instance.nodeHasBindings(t))i=u(t,null,e).bindingContextForDescendants;i&&!y[I.a.R(t)]&&l(i,t)}function f(r){var n=[],a={},o=[];I.a.P(r,function t(e){if(!a[e]){var i=I.getBindingHandler(e);i&&(i.after&&(o.push(e),I.a.D(i.after,function(e){if(r[e]){if(-1!==I.a.A(o,e))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+o.join(", "));t(e)}}),o.length--),n.push({key:e,Mc:i}));a[e]=!0}});return n}function u(n,e,t){var i=I.a.g.Ub(n,v,{}),r=i.hd;if(!e){if(r)throw Error("You cannot apply bindings multiple times to the same element.");i.hd=!0}r||(i.context=t);i.Zb||(i.Zb={});var a;if(e&&"function"!==typeof e)a=e;else{var o=I.ga.instance,s=o.getBindingAccessors||m,l=I.$(function(){if(a=e?e(t,n):s.call(o,n,t)){if(t[g])t[g]();if(t[_])t[_]()}return a},null,{l:n});a&&l.ja()||(l=null)}var c=t,u;if(a){var d=function(){return I.a.Ga(l?l():a,p)},h=l?function(e){return function(){return p(l()[e])}}:function(e){return a[e]};d.get=function(e){return a[e]&&p(h(e))};d.has=function(e){return e in a};I.i.H in a&&I.i.subscribe(n,I.i.H,function(){var e=(0,a[I.i.H])();if(e){var t=I.h.childNodes(n);t.length&&e(t,I.Ec(t[0]))}});I.i.pa in a&&(c=I.i.Cb(n,t),I.i.subscribe(n,I.i.pa,function(){var e=(0,a[I.i.pa])();e&&I.h.firstChild(n)&&e(n)}));i=f(a);I.a.D(i,function(e){var t=e.Mc.init,i=e.Mc.update,r=e.key;if(8===n.nodeType&&!I.h.ea[r])throw Error("The binding '"+r+"' cannot be used with virtual elements");try{"function"==typeof t&&I.u.G(function(){var e=t(n,h(r),d,c.$data,c);if(e&&e.controlsDescendantBindings){if(u!==R)throw Error("Multiple bindings ("+u+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=r}}),"function"==typeof i&&I.$(function(){i(n,h(r),d,c.$data,c)},null,{l:n})}catch(e){throw e.message='Unable to process binding "'+r+": "+a[r]+'"\nMessage: '+e.message,e}})}i=u===R;return{shouldBindDescendants:i,bindingContextForDescendants:i&&c}}function d(e,t){return e&&e instanceof I.fa?e:new I.fa(e,R,R,t)}var g=I.a.Da("_subscribable"),h=I.a.Da("_ancestorBindingInfo"),_=I.a.Da("_dataDependency");I.c={};var y={script:!0,textarea:!0,template:!0};I.getBindingHandler=function(e){return I.c[e]};var C={};I.fa=function(e,i,r,n,t){function a(){var e=c?l():l,t=I.a.f(e);i?(I.a.extend(o,i),h in i&&(o[h]=i[h])):(o.$parents=[],o.$root=t,o.ko=I);o[g]=u;s?t=o.$data:(o.$rawData=e,o.$data=t);r&&(o[r]=t);n&&n(o,i,t);if(i&&i[g]&&!I.S.o().Vb(i[g]))i[g]();d&&(o[_]=d);return o.$data}var o=this,s=e===C,l=s?R:e,c="function"==typeof l&&!I.O(l),u,d=t&&t.dataDependency;t&&t.exportDependencies?a():(u=I.xb(a),u.v(),u.ja()?u.equalityComparer=null:o[g]=R)};I.fa.prototype.createChildContext=function(t,i,r,e){!e&&i&&"object"==typeof i&&(e=i,i=e.as,r=e.extend);if(i&&e&&e.noChildContext){var n="function"==typeof t&&!I.O(t);return new I.fa(C,this,null,function(e){r&&r(e);e[i]=n?t():t},e)}return new I.fa(t,this,i,function(e,t){e.$parentContext=t;e.$parent=t.$data;e.$parents=(t.$parents||[]).slice(0);e.$parents.unshift(e.$parent);r&&r(e)},e)};I.fa.prototype.extend=function(t,e){return new I.fa(C,this,null,function(e){I.a.extend(e,"function"==typeof t?t(e):t)},e)};var v=I.a.g.Z();n.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)};n.prototype.sd=function(e){I.a.Pa(this.kb,e);!this.kb.length&&this.H&&this.Cc()};n.prototype.Cc=function(){this.H=!0;this.yc.N&&!this.kb.length&&(this.yc.N=null,I.a.K.yb(this.node,r),I.i.ma(this.node,I.i.pa),this.Tc())};I.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(e,t,i,r,n){var a=I.a.g.Ub(e,v,{});a.Fa||(a.Fa=new I.T);n&&n.notifyImmediately&&a.Zb[t]&&I.u.G(i,r,[e]);return a.Fa.subscribe(i,r,t)},ma:function(e,t){var i=I.a.g.get(e,v);if(i&&(i.Zb[t]=!0,i.Fa&&i.Fa.notifySubscribers(e,t),t==I.i.H))if(i.N)i.N.Cc();else if(i.N===R&&i.Fa&&i.Fa.Wa(I.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")},Cb:function(e,t){var i=I.a.g.Ub(e,v,{});i.N||(i.N=new n(e,i,t[h]));return t[h]==i?t:t.extend(function(e){e[h]=i})}};I.Td=function(e){return(e=I.a.g.get(e,v))&&e.context};I.ib=function(e,t,i){1===e.nodeType&&I.h.Sc(e);return u(e,t,d(i))};I.ld=function(e,t,i){i=d(i);return I.ib(e,s(t,i,e),i)};I.Oa=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(d(e),t)};I.vc=function(e,t,i){!x&&S.jQuery&&(x=S.jQuery);if(2>arguments.length){if(t=T.body,!t)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!t||1!==t.nodeType&&8!==t.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");c(d(e,i),t)};I.Dc=function(e){return!e||1!==e.nodeType&&8!==e.nodeType?R:I.Td(e)};I.Ec=function(e){return(e=I.Dc(e))?e.$data:R};I.b("bindingHandlers",I.c);I.b("bindingEvent",I.i);I.b("bindingEvent.subscribe",I.i.subscribe);I.b("bindingEvent.startPossiblyAsyncContentBinding",I.i.Cb);I.b("applyBindings",I.vc);I.b("applyBindingsToDescendants",I.Oa);I.b("applyBindingAccessorsToNode",I.ib);I.b("applyBindingsToNode",I.ld);I.b("contextFor",I.Dc);I.b("dataFor",I.Ec)}(),function(s){function r(r,e){var n=Object.prototype.hasOwnProperty.call(o,r)?o[r]:s,a;n?n.subscribe(e):(n=o[r]=new I.T,n.subscribe(e),t(r,function(e,t){var i=!(!t||!t.synchronous);c[r]={definition:e,Gd:i};delete o[r];a||i?n.notifySubscribers(e):I.na.zb(function(){n.notifySubscribers(e)})}),a=!0)}function t(e,i){l("getConfig",[e],function(t){t?l("loadComponent",[e,t],function(e){i(e,t)}):i(null,null)})}function l(t,i,r,n){n||(n=I.j.loaders.slice(0));var e=n.shift();if(e){var a=e[t];if(a){var o=!1;if(a.apply(e,i.concat(function(e){o?r(null):null!==e?r(e):l(t,i,r,n)}))!==s&&(o=!0,!e.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else l(t,i,r,n)}else r(null)}var o={},c={};I.j={get:function(e,t){var i=Object.prototype.hasOwnProperty.call(c,e)?c[e]:s;i?i.Gd?I.u.G(function(){t(i.definition)}):I.na.zb(function(){t(i.definition)}):r(e,t)},Bc:function(e){delete c[e]},oc:l};I.j.loaders=[];I.b("components",I.j);I.b("components.get",I.j.get);I.b("components.clearCachedDefinition",I.j.Bc)}(),function(){function n(t,e,i,r){function n(){0===--o&&r(a)}var a={},o=2,s=i.template;i=i.viewModel;s?l(e,s,function(e){I.j.oc("loadTemplate",[t,e],function(e){a.template=e;n()})}):n();i?l(e,i,function(e){I.j.oc("loadViewModel",[t,e],function(e){a[u]=e;n()})}):n()}function a(e,t,i){if("function"===typeof t)i(function(e){return new t(e)});else if("function"===typeof t[u])i(t[u]);else if("instance"in t){var r=t.instance;i(function(){return r})}else"viewModel"in t?a(e,t.viewModel,i):e("Unknown viewModel value: "+t)}function o(e){switch(I.a.R(e)){case"script":return I.a.ua(e.text);case"textarea":return I.a.ua(e.value);case"template":if(s(e.content))return I.a.Ca(e.content.childNodes)}return I.a.Ca(e.childNodes)}function s(e){return S.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function l(e,t,i){"string"===typeof t.require?r||S.require?(r||S.require)([t.require],function(e){e&&"object"===typeof e&&e.Xd&&e["default"]&&(e=e["default"]);i(e)}):e("Uses require, but no AMD loader is present"):i(t)}function c(t){return function(e){throw Error("Component '"+t+"': "+e)}}var i={};I.j.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(I.j.tb(e))throw Error("Component "+e+" is already registered");i[e]=t};I.j.tb=function(e){return Object.prototype.hasOwnProperty.call(i,e)};I.j.unregister=function(e){delete i[e];I.j.Bc(e)};I.j.Fc={getConfig:function(e,t){t(I.j.tb(e)?i[e]:null)},loadComponent:function(t,e,i){var r=c(t);l(r,e,function(e){n(t,r,e,i)})},loadTemplate:function(e,t,i){e=c(e);if("string"===typeof t)i(I.a.ua(t));else if(t instanceof Array)i(t);else if(s(t))i(I.a.la(t.childNodes));else if(t.element)if(t=t.element,S.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)i(o(t));else if("string"===typeof t){var r=T.getElementById(t);r?i(o(r)):e("Cannot find element with ID "+t)}else e("Unknown element type: "+t);else e("Unknown template value: "+t)},loadViewModel:function(e,t,i){a(c(e),t,i)}};var u="createViewModel";I.b("components.register",I.j.register);I.b("components.isRegistered",I.j.tb);I.b("components.unregister",I.j.unregister);I.b("components.defaultLoader",I.j.Fc);I.j.loaders.push(I.j.Fc);I.j.dd=i}(),function(){function o(i,e){var t=i.getAttribute("params");if(t){var t=n.parseBindingsString(t,e,i,{valueAccessors:!0,bindingParams:!0}),t=I.a.Ga(t,function(e){return I.o(e,null,{l:i})}),r=I.a.Ga(t,function(t){var e=t.v();return t.ja()?I.o({read:function(){return I.a.f(t())},write:I.Za(e)&&function(e){t()(e)},l:i}):e});Object.prototype.hasOwnProperty.call(r,"$raw")||(r.$raw=t);return r}return{$raw:{}}}I.j.getComponentNameForNode=function(e){var t=I.a.R(e);if(I.j.tb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=I.a.W&&e.tagName===t))return t};I.j.tc=function(e,t,i,r){if(1===t.nodeType){var n=I.j.getComponentNameForNode(t);if(n){e=e||{};if(e.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:n,params:o(t,i)};e.component=r?function(){return a}:a}}return e};var n=new I.ga;9>I.a.W&&(I.j.register=function(t){return function(e){return t.apply(this,arguments)}}(I.j.register),T.createDocumentFragment=function(t){return function(){var e=t();I.j.dd;return e}}(T.createDocumentFragment))}(),function(){function p(e,t,i){t=t.template;if(!t)throw Error("Component '"+e+"' has no template");e=I.a.Ca(t);I.h.va(i,e)}function m(e,t,i){var r=e.createViewModel;return r?r.call(e,t,i):t}var f=0;I.c.component={init:function(o,t,e,i,s){function l(){var e=c&&c.dispose;"function"===typeof e&&e.call(c);d&&d.s();u=c=d=null}var c,u,d,h=I.a.la(I.h.childNodes(o));I.h.Ea(o);I.a.K.za(o,l);I.o(function(){var e=I.a.f(t()),i,r;"string"===typeof e?i=e:(i=I.a.f(e.name),r=I.a.f(e.params));if(!i)throw Error("No component name specified");var n=I.i.Cb(o,s),a=u=++f;I.j.get(i,function(e){if(u===a){l();if(!e)throw Error("Unknown component '"+i+"'");p(i,e,o);var t=m(e,r,{element:o,templateNodes:h});e=n.createChildContext(t,{extend:function(e){e.$component=t;e.$componentTemplateNodes=h}});t&&t.koDescendantsComplete&&(d=I.i.subscribe(o,I.i.pa,t.koDescendantsComplete,t));c=t;I.Oa(e,o)}})},null,{l:o});return{controlsDescendantBindings:!0}}};I.h.ea.component=!0}();var y={class:"className",for:"htmlFor"};I.c.attr={update:function(n,e){var t=I.a.f(e())||{};I.a.P(t,function(e,t){t=I.a.f(t);var i=e.indexOf(":"),i="lookupNamespaceURI"in n&&0<i&&n.lookupNamespaceURI(e.substr(0,i)),r=!1===t||null===t||t===R;r?i?n.removeAttributeNS(i,e):n.removeAttribute(e):t=t.toString();8>=I.a.W&&e in y?(e=y[e],r?n.removeAttribute(e):n[e]=t):r||(i?n.setAttributeNS(i,e,t):n.setAttribute(e,t));"name"===e&&I.a.Yc(n,r?"":t)})}},function(){I.c.checked={after:["value","attr"],init:function(a,o,s){function e(){var e=a.checked,t=l();if(!I.S.Ya()&&(e||!u&&!I.S.qa())){var i=I.u.G(o);if(d){var r=h?i.v():i,n=p;p=t;n!==t?e&&(I.a.Na(r,t,!0),I.a.Na(r,n,!1)):I.a.Na(r,t,e);h&&I.Za(i)&&i(r)}else c&&(t===R?t=e:e||(t=R)),I.m.eb(i,s,"checked",t,!0)}}function t(){var e=I.a.f(o()),t=l();d?(a.checked=0<=I.a.A(e,t),p=t):a.checked=c&&t===R?!!e:l()===e}var l=I.xb(function(){if(s.has("checkedValue"))return I.a.f(s.get("checkedValue"));if(r)return s.has("value")?I.a.f(s.get("value")):a.value}),c="checkbox"==a.type,u="radio"==a.type;if(c||u){var i=o(),d=c&&I.a.f(i)instanceof Array,h=!(d&&i.push&&i.splice),r=u||d,p=d?l():R;u&&!a.name&&I.c.uniqueName.init(a,function(){return!0});I.o(e,null,{l:a});I.a.B(a,"click",e);I.o(t,null,{l:a});i=R}}};I.m.wa.checked=!0;I.c.checkedValue={update:function(e,t){e.value=I.a.f(t())}}}(),I.c["class"]={update:function(e,t){var i=I.a.Db(I.a.f(t()));I.a.Eb(e,e.__ko__cssValue,!1);e.__ko__cssValue=i;I.a.Eb(e,i,!0)}},I.c.css={update:function(i,e){var t=I.a.f(e());null!==t&&"object"==typeof t?I.a.P(t,function(e,t){t=I.a.f(t);I.a.Eb(i,e,t)}):I.c["class"].update(i,e)}},I.c.enable={update:function(e,t){var i=I.a.f(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},I.c.disable={update:function(e,t){I.c.enable.update(e,function(){return!I.a.f(t())})}},I.c.event={init:function(e,a,o,s,l){var t=a()||{};I.a.P(t,function(n){"string"==typeof n&&I.a.B(e,n,function(e){var t,i=a()[n];if(i){try{var r=I.a.la(arguments);s=l.$data;r.unshift(s);t=i.apply(s,r)}finally{!0!==t&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===o.get(n+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},I.c.foreach={Rc:function(i){return function(){var e=i(),t=I.a.bc(e);if(!t||"number"==typeof t.length)return{foreach:e,templateEngine:I.ba.Ma};I.a.f(e);return{foreach:t.data,as:t.as,noChildContext:t.noChildContext,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:I.ba.Ma}}},init:function(e,t){return I.c.template.init(e,I.c.foreach.Rc(t))},update:function(e,t,i,r,n){return I.c.template.update(e,I.c.foreach.Rc(t),i,r,n)}},I.m.Ra.foreach=!1,I.h.ea.foreach=!0,I.c.hasfocus={init:function(r,n,a){function e(e){r.__ko_hasfocusUpdating=!0;var t=r.ownerDocument;if("activeElement"in t){var i;try{i=t.activeElement}catch(e){i=t.body}e=i===r}t=n();I.m.eb(t,a,"hasfocus",e,!0);r.__ko_hasfocusLastValue=e;r.__ko_hasfocusUpdating=!1}var t=e.bind(null,!0),i=e.bind(null,!1);I.a.B(r,"focus",t);I.a.B(r,"focusin",t);I.a.B(r,"blur",i);I.a.B(r,"focusout",i);r.__ko_hasfocusLastValue=!1},update:function(e,t){var i=!!I.a.f(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),I.u.G(I.a.Fb,null,[e,i?"focusin":"focusout"]))}},I.m.wa.hasfocus=!0,I.c.hasFocus=I.c.hasfocus,I.m.wa.hasFocus="hasfocus",I.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){I.a.fc(e,t())}},function(){function e(e,p,m){I.c[e]={init:function(n,a,e,t,o){var s,l,c={},u,d,h;if(p){t=e.get("as");var i=e.get("noChildContext");h=!(t&&i);c={as:t,noChildContext:i,exportDependencies:h}}d=(u="render"==e.get("completeOn"))||e.has(I.i.pa);I.o(function(){var e=I.a.f(a()),t=!m!==!e,i=!l,r;if(h||t!==s){d&&(o=I.i.Cb(n,o));if(t){if(!p||h)c.dataDependency=I.S.o();r=p?o.createChildContext("function"==typeof e?e:a,c):I.S.qa()?o.extend(null,c):o}i&&I.S.qa()&&(l=I.a.Ca(I.h.childNodes(n),!0));t?(i||I.h.va(n,I.a.Ca(l)),I.Oa(r,n)):(I.h.Ea(n),u||I.i.ma(n,I.i.H));s=t}},null,{l:n});return{controlsDescendantBindings:!0}}};I.m.Ra[e]=!1;I.h.ea[e]=!0}e("if");e("ifnot",!1,!0);e("with",!0)}(),I.c.let={init:function(e,t,i,r,n){t=n.extend(t);I.Oa(t,e);return{controlsDescendantBindings:!0}}},I.h.ea.let=!0;var C={};I.c.options={init:function(e){if("select"!==I.a.R(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(r,e,n){function t(){return I.a.jb(r.options,function(e){return e.selected})}function a(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function i(e,t){if(p&&c)I.i.ma(r,I.i.H);else if(h.length){var i=0<=I.a.A(h,I.w.M(t[0]));I.a.Zc(t[0],i);p&&!i&&I.u.G(I.a.Fb,null,[r,"change"])}}var o=r.multiple,s=0!=r.length&&o?r.scrollTop:null,l=I.a.f(e()),c=n.get("valueAllowUnset")&&n.has("value"),u=n.get("optionsIncludeDestroyed");e={};var d,h=[];c||(o?h=I.a.Mb(t(),I.w.M):0<=r.selectedIndex&&h.push(I.w.M(r.options[r.selectedIndex])));l&&("undefined"==typeof l.length&&(l=[l]),d=I.a.jb(l,function(e){return u||e===R||null===e||!I.a.f(e._destroy)}),n.has("optionsCaption")&&(l=I.a.f(n.get("optionsCaption")),null!==l&&l!==R&&d.unshift(C)));var p=!1;e.beforeRemove=function(e){r.removeChild(e)};l=i;n.has("optionsAfterRender")&&"function"==typeof n.get("optionsAfterRender")&&(l=function(e,t){i(0,t);I.u.G(n.get("optionsAfterRender"),null,[t[0],e!==C?e:R])});I.a.ec(r,d,function(e,t,i){i.length&&(h=!c&&i[0].selected?[I.w.M(i[0])]:[],p=!0);t=r.ownerDocument.createElement("option");e===C?(I.a.Bb(t,n.get("optionsCaption")),I.w.cb(t,R)):(i=a(e,n.get("optionsValue"),e),I.w.cb(t,I.a.f(i)),e=a(e,n.get("optionsText"),i),I.a.Bb(t,e));return[t]},e,l);if(!c){var m;o?m=h.length&&t().length<h.length:m=h.length&&0<=r.selectedIndex?I.w.M(r.options[r.selectedIndex])!==h[0]:h.length||0<=r.selectedIndex;m&&I.u.G(I.a.Fb,null,[r,"change"])}(c||I.S.Ya())&&I.i.ma(r,I.i.H);I.a.wd(r);s&&20<Math.abs(s-r.scrollTop)&&(r.scrollTop=s)}},I.c.options.$b=I.a.g.Z(),I.c.selectedOptions={init:function(r,n,i){function e(){var e=n(),t=[];I.a.D(r.getElementsByTagName("option"),function(e){e.selected&&t.push(I.w.M(e))});I.m.eb(e,i,"selectedOptions",t)}function t(){var i=I.a.f(n()),e=r.scrollTop;i&&"number"==typeof i.length&&I.a.D(r.getElementsByTagName("option"),function(e){var t=0<=I.a.A(i,I.w.M(e));e.selected!=t&&I.a.Zc(e,t)});r.scrollTop=e}if("select"!=I.a.R(r))throw Error("selectedOptions binding applies only to SELECT elements");var a;I.i.subscribe(r,I.i.H,function(){a?e():(I.a.B(r,"change",e),a=I.o(t,null,{l:r}))},null,{notifyImmediately:!0})},update:function(){}},I.m.wa.selectedOptions=!0,I.c.style={update:function(r,e){var t=I.a.f(e()||{});I.a.P(t,function(e,t){t=I.a.f(t);if(null===t||t===R||!1===t)t="";if(x)x(r).css(e,t);else if(/^--/.test(e))r.style.setProperty(e,t);else{e=e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()});var i=r.style[e];r.style[e]=t;t===i||r.style[e]!=i||isNaN(t)||(r.style[e]=t+"px")}})}},I.c.submit={init:function(r,n,e,t,a){if("function"!=typeof n())throw Error("The value for a submit binding must be a function");I.a.B(r,"submit",function(e){var t,i=n();try{t=i.call(a.$data,r)}finally{!0!==t&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}})}},I.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){I.a.Bb(e,t())}},I.h.ea.text=!0,function(){if(S&&S.navigator){var e=function(e){if(e)return parseFloat(e[1])},t=S.navigator.userAgent,h,p,m,f,g;(h=S.opera&&S.opera.version&&parseInt(S.opera.version()))||(g=e(t.match(/Edge\/([^ ]+)$/)))||e(t.match(/Chrome\/([^ ]+)/))||(p=e(t.match(/Version\/([^ ]+) Safari/)))||(m=e(t.match(/Firefox\/([^ ]+)/)))||(f=I.a.W||e(t.match(/MSIE ([^ ]+)/)))||(f=e(t.match(/rv:([^ )]+)/)))}if(8<=f&&10>f)var r=I.a.g.Z(),n=I.a.g.Z(),a=function(e){var t=this.activeElement;(t=t&&I.a.g.get(t,n))&&t(e)},_=function(e,t){var i=e.ownerDocument;I.a.g.get(i,r)||(I.a.g.set(i,r,!0),I.a.B(i,"selectionchange",a));I.a.g.set(e,n,t)};I.c.textInput={init:function(i,t,r){function e(e,t){I.a.B(i,e,t)}function n(){var e=I.a.f(t());if(null===e||e===R)e="";c!==R&&e===c?I.a.setTimeout(n,4):i.value!==e&&(d=!0,i.value=e,d=!1,s=i.value)}function a(){l||(c=i.value,l=I.a.setTimeout(o,4))}function o(){clearTimeout(l);c=l=R;var e=i.value;s!==e&&(s=e,I.m.eb(t(),r,"textInput",e))}var s=i.value,l,c,u=9==I.a.W?a:o,d=!1;f&&e("keypress",o);11>f&&e("propertychange",function(e){d||"value"!==e.propertyName||u()});8==f&&(e("keyup",o),e("keydown",o));_&&(_(i,u),e("dragend",a));(!f||9<=f)&&e("input",u);5>p&&"textarea"===I.a.R(i)?(e("keydown",a),e("paste",a),e("cut",a)):11>h?e("keydown",a):4>m?(e("DOMAutoComplete",o),e("dragdrop",o),e("drop",o)):g&&"number"===i.type&&e("keydown",a);e("change",o);e("blur",o);I.o(n,null,{l:i})}};I.m.wa.textInput=!0;I.c.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),I.c.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++I.c.uniqueName.rd;I.a.Yc(e,i)}}},I.c.uniqueName.rd=0,I.c.using={init:function(e,t,i,r,n){var a;i.has("as")&&(a={as:i.get("as"),noChildContext:i.get("noChildContext")});t=n.createChildContext(t,a);I.Oa(t,e);return{controlsDescendantBindings:!0}}},I.h.ea.using=!0,I.c.value={init:function(i,r,n){var a=I.a.R(i),e="input"==a;if(!e||"checkbox"!=i.type&&"radio"!=i.type){var t=[],o=n.get("valueUpdate"),s=!1,l=null;o&&("string"==typeof o?t=[o]:t=I.a.wc(o),I.a.Pa(t,"change"));var c=function(){l=null;s=!1;var e=r(),t=I.w.M(i);I.m.eb(e,n,"value",t)};!I.a.W||!e||"text"!=i.type||"off"==i.autocomplete||i.form&&"off"==i.form.autocomplete||-1!=I.a.A(t,"propertychange")||(I.a.B(i,"propertychange",function(){s=!0}),I.a.B(i,"focus",function(){s=!1}),I.a.B(i,"blur",function(){s&&c()}));I.a.D(t,function(e){var t=c;I.a.Ud(e,"after")&&(t=function(){l=I.w.M(i);I.a.setTimeout(c,0)},e=e.substring(5));I.a.B(i,e,t)});var u;u=e&&"file"==i.type?function(){var e=I.a.f(r());null===e||e===R||""===e?i.value="":I.u.G(c)}:function(){var e=I.a.f(r()),t=I.w.M(i);if(null!==l&&e===l)I.a.setTimeout(u,0);else if(e!==t||t===R)"select"===a?(t=n.get("valueAllowUnset"),I.w.cb(i,e,t),t||e===I.w.M(i)||I.u.G(c)):I.w.cb(i,e)};if("select"===a){var d;I.i.subscribe(i,I.i.H,function(){d?n.get("valueAllowUnset")?u():c():(I.a.B(i,"change",c),d=I.o(u,null,{l:i}))},null,{notifyImmediately:!0})}else I.a.B(i,"change",c),I.o(u,null,{l:i})}else I.ib(i,{checkedValue:r})},update:function(){}},I.m.wa.value=!0,I.c.visible={update:function(e,t){var i=I.a.f(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},I.c.hidden={update:function(e,t){I.c.visible.update(e,function(){return!I.a.f(t())})}},function(a){I.c[a]={init:function(e,t,i,r,n){return I.c.event.init.call(this,e,function(){var e={};e[a]=t();return e},i,r,n)}}}("click"),I.ca=function(){},I.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},I.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},I.ca.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||T;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new I.C.F(i)}if(1==e.nodeType||8==e.nodeType)return new I.C.ia(e);throw Error("Unknown template type: "+e)},I.ca.prototype.renderTemplate=function(e,t,i,r){e=this.makeTemplateSource(e,r);return this.renderTemplateSource(e,t,i,r)},I.ca.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(e,t).data("isRewritten")},I.ca.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i);t=t(e.text());e.text(t);e.data("isRewritten",!0)},I.b("templateEngine",I.ca),I.kc=function(){function o(e,t,i,r){e=I.m.ac(e);for(var n=I.m.Ra,a=0;a<e.length;a++){var o=e[a].key;if(Object.prototype.hasOwnProperty.call(n,o)){var s=n[o];if("function"===typeof s){if(o=s(e[a].value))throw Error(o)}else if(!s)throw Error("This template engine does not support the '"+o+"' binding within its templates")}}i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+I.m.vb(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')";return r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return I.kc.Ld(e,t)},i)},Ld:function(e,a){return e.replace(t,function(e,t,i,r,n){return o(n,t,i,a)}).replace(i,function(e,t){return o(t,"\x3c!-- ko --\x3e","#comment",a)})},md:function(r,n){return I.aa.Xb(function(e,t){var i=e.nextSibling;i&&i.nodeName.toLowerCase()===n&&I.ib(i,r,t)})}}}(),I.b("__tr_ambtns",I.kc.md),function(){I.C={};I.C.F=function(e){if(this.F=e){var t=I.a.R(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}};I.C.F.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.F[e];var t=arguments[0];"innerHTML"===e?I.a.fc(this.F,t):this.F[e]=t};var t=I.a.g.Z()+"_";I.C.F.prototype.data=function(e){if(1===arguments.length)return I.a.g.get(this.F,t+e);I.a.g.set(this.F,t+e,arguments[1])};var n=I.a.g.Z();I.C.F.prototype.nodes=function(){var e=this.F;if(0==arguments.length){var t=I.a.g.get(e,n)||{},i=t.lb||(3===this.ab?e.content:4===this.ab?e:R);if(!i||t.jd){var r=this.text();r&&r!==t.bb&&(i=I.a.Md(r,e.ownerDocument),I.a.g.set(e,n,{lb:i,bb:r,jd:!0}))}return i}t=arguments[0];this.ab!==R&&this.text("");I.a.g.set(e,n,{lb:t})};I.C.ia=function(e){this.F=e};I.C.ia.prototype=new I.C.F;I.C.ia.prototype.constructor=I.C.ia;I.C.ia.prototype.text=function(){if(0==arguments.length){var e=I.a.g.get(this.F,n)||{};e.bb===R&&e.lb&&(e.bb=e.lb.innerHTML);return e.bb}I.a.g.set(this.F,n,{bb:arguments[0]})};I.b("templateSources",I.C);I.b("templateSources.domElement",I.C.F);I.b("templateSources.anonymousTemplate",I.C.ia)}(),function(){function r(e,t,i){var r;for(t=I.h.nextSibling(t);e&&(r=e)!==t;)e=I.h.nextSibling(r),i(r,e)}function h(e,t){if(e.length){var n=e[0],a=e[e.length-1],i=n.parentNode,o=I.ga.instance,s=o.preprocessNode;if(s){r(n,a,function(e,t){var i=e.previousSibling,r=s.call(o,e);r&&(e===n&&(n=r[0]||t),e===a&&(a=r[r.length-1]||i))});e.length=0;if(!n)return;n===a?e.push(n):(e.push(n,a),I.a.Ua(e,i))}r(n,a,function(e){1!==e.nodeType&&8!==e.nodeType||I.vc(t,e)});r(n,a,function(e){1!==e.nodeType&&8!==e.nodeType||I.aa.cd(e,[t])});I.a.Ua(e,i)}}function l(e){return e.nodeType?e:0<e.length?e[0]:null}function p(e,t,i,r,n){n=n||{};var a=(e&&l(e)||i||{}).ownerDocument,o=n.templateEngine||c;I.kc.xd(i,o,a);i=o.renderTemplate(i,r,n,a);if("number"!=typeof i.length||0<i.length&&"number"!=typeof i[0].nodeType)throw Error("Template engine must return an array of DOM nodes");a=!1;switch(t){case"replaceChildren":I.h.va(e,i);a=!0;break;case"replaceNode":I.a.Xc(e,i);a=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}a&&(h(i,r),n.afterRender&&I.u.G(n.afterRender,null,[i,r[n.as||"$data"]]),"replaceChildren"==t&&I.i.ma(e,I.i.H));return i}function m(e,t,i){return I.O(e)?e():"function"===typeof e?e(t,i):e}var c;I.gc=function(e){if(e!=R&&!(e instanceof I.ca))throw Error("templateEngine must inherit from ko.templateEngine");c=e};I.dc=function(i,r,n,a,o){n=n||{};if((n.templateEngine||c)==R)throw Error("Set a template engine before calling renderTemplate");o=o||"replaceChildren";if(a){var s=l(a);return I.$(function(){var e=r&&r instanceof I.fa?r:new I.fa(r,null,null,null,{exportDependencies:!0}),t=m(i,e.$data,e),e=p(a,o,t,e,n);"replaceNode"==o&&(a=e,s=l(a))},null,{Sa:function(){return!s||!I.a.Sb(s)},l:s&&"replaceNode"==o?s.parentNode:s})}return I.aa.Xb(function(e){I.dc(i,r,n,e,"replaceNode")})};I.Qd=function(r,t,n,a,o){function i(e,t){I.u.G(I.a.ec,null,[a,e,l,n,s,t]);I.i.ma(a,I.i.H)}function s(e,t){h(t,c);n.afterRender&&n.afterRender(t,e);c=null}function l(e,t){c=o.createChildContext(e,{as:u,noChildContext:n.noChildContext,extend:function(e){e.$index=t;u&&(e[u+"Index"]=t)}});var i=m(r,e,c);return p(a,"ignoreTargetNode",i,c,n)}var c,u=n.as,d=!1===n.includeDestroyed||I.options.foreachHidesDestroyed&&!n.includeDestroyed;if(d||n.beforeRemove||!I.Pc(t))return I.$(function(){var e=I.a.f(t)||[];"undefined"==typeof e.length&&(e=[e]);d&&(e=I.a.jb(e,function(e){return e===R||null===e||!I.a.f(e._destroy)}));i(e)},null,{l:a});i(t.v());var e=t.subscribe(function(e){i(t(),e)},null,"arrayChange");e.l(a);return e};var o=I.a.g.Z(),n=I.a.g.Z();I.c.template={init:function(e,t){var i=I.a.f(t());if("string"==typeof i||"name"in i)I.h.Ea(e);else if("nodes"in i){i=i.nodes||[];if(I.O(i))throw Error('The "nodes" option must be a plain, non-observable array.');var r=i[0]&&i[0].parentNode;r&&I.a.g.get(r,n)||(r=I.a.Yb(i),I.a.g.set(r,n,!0));new I.C.ia(e).nodes(r)}else if(i=I.h.childNodes(e),0<i.length)r=I.a.Yb(i),new I.C.ia(e).nodes(r);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(e,t,i,r,n){var a=t();t=I.a.f(a);i=!0;r=null;"string"==typeof t?t={}:(a="name"in t?t.name:e,"if"in t&&(i=I.a.f(t["if"])),i&&"ifnot"in t&&(i=!I.a.f(t.ifnot)),i&&!a&&(i=!1));"foreach"in t?r=I.Qd(a,i&&t.foreach||[],t,e,n):i?(i=n,"data"in t&&(i=n.createChildContext(t.data,{as:t.as,noChildContext:t.noChildContext,exportDependencies:!0})),r=I.dc(a,i,t,e)):I.h.Ea(e);n=r;(t=I.a.g.get(e,o))&&"function"==typeof t.s&&t.s();I.a.g.set(e,o,!n||n.ja&&!n.ja()?R:n)}};I.m.Ra.template=function(e){e=I.m.ac(e);return 1==e.length&&e[0].unknown||I.m.Id(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"};I.h.ea.template=!0}(),I.b("setTemplateEngine",I.gc),I.b("renderTemplate",I.dc),I.a.Kc=function(e,t,i){if(e.length&&t.length){var r,n,a,o,s;for(r=n=0;(!i||r<i)&&(o=e[n]);++n){for(a=0;s=t[a];++a)if(o.value===s.value){o.moved=s.index;s.moved=o.index;t.splice(a,1);r=a=0;break}r+=a}}},I.a.Pb=function(){function r(e,t,i,r,n){var a=Math.min,o=Math.max,s=[],l,c=e.length,u,d=t.length,h=d-c||1,p=c+d+1,m,f,g;for(l=0;l<=c;l++)for(f=m,s.push(m=[]),g=a(d,l+h),u=o(0,l-1);u<=g;u++)m[u]=u?l?e[l-1]===t[u-1]?f[u-1]:a(f[u]||p,m[u-1]||p)+1:u+1:l+1;a=[];o=[];h=[];l=c;for(u=d;l||u;)d=s[l][u]-1,u&&d===s[l][u-1]?o.push(a[a.length]={status:i,value:t[--u],index:u}):l&&d===s[l-1][u]?h.push(a[a.length]={status:r,value:e[--l],index:l}):(--u,--l,n.sparse||a.push({status:"retained",value:t[u]}));I.a.Kc(h,o,!n.dontLimitMoves&&10*c);return a.reverse()}return function(e,t,i){i="boolean"===typeof i?{dontLimitMoves:i}:i||{};e=e||[];t=t||[];return e.length<t.length?r(e,t,"added","deleted",i):r(t,e,"deleted","added",i)}}(),I.b("utils.compareArrays",I.a.Pb),function(){function w(t,i,r,n,a){var o=[],e=I.$(function(){var e=i(r,a,I.a.Ua(o,t))||[];0<o.length&&(I.a.Xc(o,e),n&&I.u.G(n,null,[r,e,a]));o.length=0;I.a.Nb(o,e)},null,{l:t,Sa:function(){return!I.a.kd(o)}});return{Y:o,$:e.ja()?e:R}}var D=I.a.g.Z(),M=I.a.g.Z();I.a.ec=function(t,e,i,r,n,a){function o(e){C={Aa:e,pb:I.ta(p++)};d.push(C);u||y.push(C)}function s(e){C=c[e];p!==C.pb.v()&&_.push(C);C.pb(p++);I.a.Ua(C.Y,t);d.push(C)}function l(t,i){if(t)for(var r=0,e=i.length;r<e;r++)I.a.D(i[r].Y,function(e){t(e,r,i[r].Aa)})}e=e||[];"undefined"==typeof e.length&&(e=[e]);r=r||{};var c=I.a.g.get(t,D),u=!c,d=[],h=0,p=0,m=[],f=[],g=[],_=[],y=[],C,v=0;if(u)I.a.D(e,o);else{if(!a||c&&c._countWaitingForRemove){var S=I.a.Mb(c,function(e){return e.Aa});a=I.a.Pb(S,e,{dontLimitMoves:r.dontLimitMoves,sparse:!0})}for(var S=0,T,x,b;T=a[S];S++)switch(x=T.moved,b=T.index,T.status){case"deleted":for(;h<b;)s(h++);x===R&&(C=c[h],C.$&&(C.$.s(),C.$=R),I.a.Ua(C.Y,t).length&&(r.beforeRemove&&(d.push(C),v++,C.Aa===M?C=null:g.push(C)),C&&m.push.apply(m,C.Y)));h++;break;case"added":for(;p<b;)s(h++);x!==R?(f.push(d.length),s(x)):o(T.value)}for(;p<e.length;)s(h++);d._countWaitingForRemove=v}I.a.g.set(t,D,d);l(r.beforeMove,_);I.a.D(m,r.beforeRemove?I.oa:I.removeNode);var E,P,A;try{A=t.ownerDocument.activeElement}catch(e){}if(f.length)for(;(S=f.shift())!=R;){C=d[S];for(E=R;S;)if((P=d[--S].Y)&&P.length){E=P[P.length-1];break}for(e=0;h=C.Y[e];E=h,e++)I.h.Wb(t,h,E)}for(S=0;C=d[S];S++){C.Y||I.a.extend(C,w(t,i,C.Aa,n,C.pb));for(e=0;h=C.Y[e];E=h,e++)I.h.Wb(t,h,E);!C.Ed&&n&&(n(C.Aa,C.Y,C.pb),C.Ed=!0,E=C.Y[C.Y.length-1])}A&&t.ownerDocument.activeElement!=A&&A.focus();l(r.beforeRemove,g);for(S=0;S<g.length;++S)g[S].Aa=M;l(r.afterMove,_);l(r.afterAdd,y)}}(),I.b("utils.setDomNodeChildrenFromArrayMapping",I.a.ec),I.ba=function(){this.allowTemplateRewriting=!1},I.ba.prototype=new I.ca,I.ba.prototype.constructor=I.ba,I.ba.prototype.renderTemplateSource=function(e,t,i,r){if(t=(9>I.a.W?0:e.nodes)?e.nodes():null)return I.a.la(t.cloneNode(!0).childNodes);e=e.text();return I.a.ua(e,r)},I.ba.Ma=new I.ba,I.gc(I.ba.Ma),I.b("nativeTemplateEngine",I.ba),function(){I.$a=function(){var a=this.Hd=function(){if(!x||!x.tmpl)return 0;try{if(0<=x.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(e,t,i,r){r=r||T;i=i||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var n=e.data("precompiled");n||(n=e.text()||"",n=x.template(null,"{{ko_with $item.koBindingContext}}"+n+"{{/ko_with}}"),e.data("precompiled",n));e=[t.$data];t=x.extend({koBindingContext:t},i.templateOptions);t=x.tmpl(n,e,t);t.appendTo(r.createElement("div"));x.fragments={};return t};this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"};this.addTemplate=function(e,t){T.write("<script type='text/html' id='"+e+"'>"+t+"<\/script>")};0<a&&(x.tmpl.tag.ko_code={open:"__.push($1 || '');"},x.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};I.$a.prototype=new I.ca;I.$a.prototype.constructor=I.$a;var e=new I.$a;0<e.Hd&&I.gc(e);I.b("jqueryTmplTemplateEngine",I.$a)}()}(S.ko={})}();var knockout=ko;"undefined"!=typeof window?(ko=window.ko,void 0!==oldValue?window.ko=oldValue:delete window.ko):(ko=global.ko,void 0!==oldValue?global.ko=oldValue:delete global.ko);var OBSERVABLES_PROPERTY="__knockoutObservables",SUBSCRIBABLE_PROPERTY="__knockoutSubscribable";function track(r,e){if(!r)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,a=getAllObservablesForObject(r,!0);return(e=e||Object.getOwnPropertyNames(r)).forEach(function(e){var t,i;e!==OBSERVABLES_PROPERTY&&e!==SUBSCRIBABLE_PROPERTY&&(e in a||(t=(i=r[e])instanceof Array,i=n.isObservable(i)?i:t?n.observableArray(i):n.observable(i),Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:i,set:n.isWriteableObservable(i)?i:void 0}),a[e]=i,t&¬ifyWhenPresentOrFutureArrayValuesMutate(n,i)))}),r}function getAllObservablesForObject(e,t){var i=e[OBSERVABLES_PROPERTY];return!i&&t&&(i={},Object.defineProperty(e,OBSERVABLES_PROPERTY,{value:i})),i}function defineComputedProperty(e,t,i){var r={owner:e,deferEvaluation:!0};if("function"==typeof i)r.read=i;else{if("value"in i)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof i.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=i.get,r.write=i.set}return e[t]=this.computed(r),track.call(this,e,[t]),e}function notifyWhenPresentOrFutureArrayValuesMutate(t,i){var r=null;t.computed(function(){r&&(r.dispose(),r=null);var e=i();e instanceof Array&&(r=startWatchingArrayInstance(t,i,e))})}function startWatchingArrayInstance(e,t,i){return getSubscribableForArray(e,i).subscribe(t)}function getSubscribableForArray(e,t){var i,r=t[SUBSCRIBABLE_PROPERTY];return r||(r=new e.subscribable,Object.defineProperty(t,SUBSCRIBABLE_PROPERTY,{value:r}),wrapStandardArrayMutators(t,r,i={}),addKnockoutArrayMutators(e,t,r,i)),r}function wrapStandardArrayMutators(i,r,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(e){var t=i[e];i[e]=function(){var e=t.apply(this,arguments);return!0!==n.pause&&r.notifySubscribers(this),e}})}function addKnockoutArrayMutators(i,r,n,a){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(t){Object.defineProperty(r,t,{enumerable:!1,value:function(){var e;a.pause=!0;try{e=i.observableArray.fn[t].apply(i.observableArray(r),arguments)}finally{a.pause=!1}return n.notifySubscribers(r),e}})})}function getObservable(e,t){if(!e)return null;e=getAllObservablesForObject(e,!1);return e&&e[t]||null}function valueHasMutated(e,t){t=getObservable(e,t);t&&t.valueHasMutated()}function attachToKo(e){e.track=track,e.getObservable=getObservable,e.valueHasMutated=valueHasMutated,e.defineProperty=defineComputedProperty}var knockout_es5={attachToKo:attachToKo},svgNS$1="http://www.w3.org/2000/svg",svgClassName="cesium-svgPath-svg",SvgPathBindingHandler={register:function(o){o.bindingHandlers.cesiumSvgPath={init:function(e,r){var n=document.createElementNS(svgNS$1,"svg:svg");n.setAttribute("class",svgClassName);var a=document.createElementNS(svgNS$1,"path");return n.appendChild(a),o.virtualElements.setDomNodeChildren(e,[n]),o.computed({read:function(){var e=o.unwrap(r());a.setAttribute("d",o.unwrap(e.path));var t=o.unwrap(e.width),i=o.unwrap(e.height);n.setAttribute("width",t),n.setAttribute("height",i),n.setAttribute("viewBox","0 0 "+t+" "+i),e.css&&n.setAttribute("class",svgClassName+" "+o.unwrap(e.css))},disposeWhenNodeIsRemoved:e}),{controlsDescendantBindings:!0}}},o.virtualElements.allowedBindings.cesiumSvgPath=!0}};function quickselect(e,t,i,r,n){quickselectStep(e,t,i||0,r||e.length-1,n||defaultCompare)}function quickselectStep(e,t,i,r,n){for(;i<r;){var a,o,s,l;600<r-i&&(a=r-i+1,o=t-i+1,l=Math.log(a),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(a-s)/a)*(o-a/2<0?-1:1),quickselectStep(e,t,Math.max(i,Math.floor(t-o*s/a+l)),Math.min(r,Math.floor(t+(a-o)*s/a+l)),n));var c=e[t],u=i,d=r;for(swap(e,i,t),0<n(e[r],c)&&swap(e,i,r);u<d;){for(swap(e,u,d),u++,d--;n(e[u],c)<0;)u++;for(;0<n(e[d],c);)d--}0===n(e[i],c)?swap(e,i,d):swap(e,++d,r),d<=t&&(i=d+1),t<=d&&(r=d-1)}}function swap(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function defaultCompare(e,t){return e<t?-1:t<e?1:0}function ClockViewModel(t){defined(t)||(t=new Clock),this._clock=t,this._eventHelper=new EventHelper,this._eventHelper.add(t.onTick,this.synchronize,this),this.systemTime=knockout.observable(JulianDate.now()),this.systemTime.equalityComparer=JulianDate.equals,this.startTime=knockout.observable(t.startTime),this.startTime.equalityComparer=JulianDate.equals,this.startTime.subscribe(function(e){t.startTime=e,this.synchronize()},this),this.stopTime=knockout.observable(t.stopTime),this.stopTime.equalityComparer=JulianDate.equals,this.stopTime.subscribe(function(e){t.stopTime=e,this.synchronize()},this),this.currentTime=knockout.observable(t.currentTime),this.currentTime.equalityComparer=JulianDate.equals,this.currentTime.subscribe(function(e){t.currentTime=e,this.synchronize()},this),this.multiplier=knockout.observable(t.multiplier),this.multiplier.subscribe(function(e){t.multiplier=e,this.synchronize()},this),this.clockStep=knockout.observable(t.clockStep),this.clockStep.subscribe(function(e){t.clockStep=e,this.synchronize()},this),this.clockRange=knockout.observable(t.clockRange),this.clockRange.subscribe(function(e){t.clockRange=e,this.synchronize()},this),this.canAnimate=knockout.observable(t.canAnimate),this.canAnimate.subscribe(function(e){t.canAnimate=e,this.synchronize()},this),this.shouldAnimate=knockout.observable(t.shouldAnimate),this.shouldAnimate.subscribe(function(e){t.shouldAnimate=e,this.synchronize()},this),knockout.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}function Command(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,DeveloperError.throwInstantiationError()}knockout_es5.attachToKo(knockout),SvgPathBindingHandler.register(knockout),Object.defineProperties(ClockViewModel.prototype,{clock:{get:function(){return this._clock}}}),ClockViewModel.prototype.synchronize=function(){var e=this._clock;this.systemTime=JulianDate.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},ClockViewModel.prototype.isDestroyed=function(){return!1},ClockViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var InspectorShared={};function ToggleButtonViewModel(e,t){this._command=e,t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.toggled=defaultValue(t.toggled,!1),this.tooltip=defaultValue(t.tooltip,""),knockout.track(this,["toggled","tooltip"])}function createCommand(i,e){e=defaultValue(e,!0);var r=new Event,n=new Event;function t(){var e,t={args:arguments,cancel:!1};return r.raiseEvent(t),t.cancel||(e=i.apply(null,arguments),n.raiseEvent(e)),e}return t.canExecute=e,knockout.track(t,["canExecute"]),Object.defineProperties(t,{beforeExecute:{value:r},afterExecute:{value:n}}),t}function subscribeAndEvaluate(e,t,i,r,n){return i.call(r,e[t]),knockout.getObservable(e,t).subscribe(i,r,n)}InspectorShared.createCheckbox=function(e,t,i){var r=document.createElement("div"),n=document.createElement("label"),a=document.createElement("input");a.type="checkbox";t="checked: "+t;return defined(i)&&(t+=", enable: "+i),a.setAttribute("data-bind",t),n.appendChild(a),n.appendChild(document.createTextNode(e)),r.appendChild(n),r},InspectorShared.createSection=function(e,t,i,r){var n=document.createElement("div");n.className="cesium-cesiumInspector-section",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-section-collapsed": !'+i+" }"),e.appendChild(n);e=document.createElement("h3");e.className="cesium-cesiumInspector-sectionHeader",e.appendChild(document.createTextNode(t)),e.setAttribute("data-bind","click: "+r),n.appendChild(e);e=document.createElement("div");return e.className="cesium-cesiumInspector-sectionContent",n.appendChild(e),e},Object.defineProperties(ToggleButtonViewModel.prototype,{command:{get:function(){return this._command}}});var DepthViewPacked="uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nfloat z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\nfloat scale = pow(z_ndc * 0.5 + 0.5, 8.0);\ngl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";function removePipelineExtras(e){return ForEach.shader(e,function(e){removeExtras(e)}),ForEach.buffer(e,function(e){removeExtras(e)}),ForEach.image(e,function(e){removeExtras(e),ForEach.compressedImage(e,function(e){removeExtras(e)})}),removeExtras(e),e}function removeExtras(e){defined(e.extras)&&(defined(e.extras._pipeline)&&delete e.extras._pipeline,0===Object.keys(e.extras).length&&delete e.extras)}var svgNS="http://www.w3.org/2000/svg",xlinkNS="http://www.w3.org/1999/xlink",widgetForDrag,gradientEnabledColor0=Color.fromCssColorString("rgba(247,250,255,0.384)"),gradientEnabledColor1=Color.fromCssColorString("rgba(143,191,255,0.216)"),gradientEnabledColor2=Color.fromCssColorString("rgba(153,197,255,0.098)"),gradientEnabledColor3=Color.fromCssColorString("rgba(255,255,255,0.086)"),gradientDisabledColor0=Color.fromCssColorString("rgba(255,255,255,0.267)"),gradientDisabledColor1=Color.fromCssColorString("rgba(255,255,255,0)"),gradientKnobColor=Color.fromCssColorString("rgba(66,67,68,0.3)"),gradientPointerColor=Color.fromCssColorString("rgba(0,0,0,0.5)");function getElementColor(e){return Color.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var svgIconsById={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 svgFromObject(e){var t,i=document.createElementNS(svgNS,e.tagName);for(t in e)if(e.hasOwnProperty(t)&&"tagName"!==t)if("children"===t)for(var r=e.children.length,n=0;n<r;++n)i.appendChild(svgFromObject(e.children[n]));else 0===t.indexOf("xlink:")?i.setAttributeNS(xlinkNS,t.substring(6),e[t]):"textContent"===t?i.textContent=e[t]:i.setAttribute(t,e[t]);return i}function svgText(e,t,i){var r=document.createElementNS(svgNS,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");t=document.createElementNS(svgNS,"tspan");return t.textContent=i,r.appendChild(t),r}function setShuttleRingPointer(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}var makeColorStringScratch=new Color;function makeColorString(e,t){var i=t.alpha,r=1-i;return makeColorStringScratch.red=e.red*r+t.red*i,makeColorStringScratch.green=e.green*r+t.green*i,makeColorStringScratch.blue=e.blue*r+t.blue*i,makeColorStringScratch.toCssColorString()}function rectButton(e,t,i){var r=svgIconsById[i];return svgFromObject({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:i,tagName:r.tagName,transform:r.transform,d:r.d},{tagName:"title",textContent:""}]})}function wingButton(e,t,i){var r=svgIconsById[i],n=svgIconsById.animation_pathWingButton;return svgFromObject({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:n.tagName,d:n.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:n.tagName,d:n.d},{class:"cesium-animation-buttonPath",id:i,tagName:r.tagName,transform:r.transform,d:r.d},{tagName:"title",textContent:""}]})}function setShuttleRingFromMouseOrTouch(e,t){var i,r,n,a,o,s,l=e._viewModel,c=l.shuttleRingDragging;c&&widgetForDrag!==e||("mousedown"===t.type||c&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||c&&"touchmove"===t.type&&1===t.touches.length?(s=e._centerX,i=e._centerY,o=e._svgNode.getBoundingClientRect(),n="touchstart"===t.type||"touchmove"===t.type?(r=t.touches[0].clientX,t.touches[0].clientY):(r=t.clientX,t.clientY),!c&&(r>o.right||r<o.left||n<o.top||n>o.bottom)||(a=e._shuttleRingPointer.getBoundingClientRect(),s=r-s-o.left,o=n-i-o.top,180<(o=180*Math.atan2(o,s)/Math.PI+90)&&(o-=360),s=l.shuttleRingAngle,c||r<a.right&&r>a.left&&n>a.top&&n<a.bottom?(widgetForDrag=e,l.shuttleRingDragging=!0,l.shuttleRingAngle=o):o<s?l.slower():s<o&&l.faster(),t.preventDefault())):(e===widgetForDrag&&(widgetForDrag=void 0),l.shuttleRingDragging=!1))}function SvgButton(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[subscribeAndEvaluate(t,"toggled",this.setToggled,this),subscribeAndEvaluate(t,"tooltip",this.setTooltip,this),subscribeAndEvaluate(t.command,"canExecute",this.setEnabled,this)]}function Animation(e,t){e=getElement(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;var i=e.ownerDocument,r=document.createElement("style");r.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); }",i.head.insertBefore(r,i.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.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=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var a=document.createElementNS(svgNS,"svg:svg");(this._svgNode=a).setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",xlinkNS);var o=document.createElementNS(svgNS,"g");this._topG=o,this._realtimeSVG=new SvgButton(wingButton(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new SvgButton(rectButton(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new SvgButton(rectButton(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new SvgButton(rectButton(84,99,"animation_pathPause"),t.pauseViewModel);var s=document.createElementNS(svgNS,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);var l=svgFromObject({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;var c=svgIconsById.animation_pathSwooshFX,u=svgIconsById.animation_pathPointer,d=svgFromObject({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:c.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:c.d},{tagName:c.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:c.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=svgFromObject({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});var h=svgFromObject({tagName:"g",transform:"translate(100,100)"});this._knobOuter=svgFromObject({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});r=svgFromObject({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=svgText(0,-24,""),this._knobTime=svgText(0,-7,""),this._knobStatus=svgText(0,-41,"");c=svgFromObject({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),u=document.createElementNS(svgNS,"g");u.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),o.appendChild(u),o.appendChild(h),o.appendChild(s),u.appendChild(l),u.appendChild(d),u.appendChild(this._shuttleRingPointer),h.appendChild(this._knobOuter),h.appendChild(r),h.appendChild(this._knobDate),h.appendChild(this._knobTime),h.appendChild(this._knobStatus),h.appendChild(c),a.appendChild(o),e.appendChild(a);var p=this;function m(e){setShuttleRingFromMouseOrTouch(p,e)}this._mouseCallback=m,l.addEventListener("mousedown",m,!0),l.addEventListener("touchstart",m,!0),d.addEventListener("mousedown",m,!0),d.addEventListener("touchstart",m,!0),i.addEventListener("mousemove",m,!0),i.addEventListener("touchmove",m,!0),i.addEventListener("mouseup",m,!0),i.addEventListener("touchend",m,!0),i.addEventListener("touchcancel",m,!0),this._shuttleRingPointer.addEventListener("mousedown",m,!0),this._shuttleRingPointer.addEventListener("touchstart",m,!0),this._knobOuter.addEventListener("mousedown",m,!0),this._knobOuter.addEventListener("touchstart",m,!0);var f,g=this._knobTime.childNodes[0],_=this._knobDate.childNodes[0],y=this._knobStatus.childNodes[0];this._subscriptions=[subscribeAndEvaluate(t.pauseViewModel,"toggled",function(e){f!==e&&((f=e)?p._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):p._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),subscribeAndEvaluate(t,"shuttleRingAngle",function(e){setShuttleRingPointer(p._shuttleRingPointer,p._knobOuter,e)}),subscribeAndEvaluate(t,"dateLabel",function(e){_.textContent!==e&&(_.textContent=e)}),subscribeAndEvaluate(t,"timeLabel",function(e){g.textContent!==e&&(g.textContent=e)}),subscribeAndEvaluate(t,"multiplierLabel",function(e){y.textContent!==e&&(y.textContent=e)})],this.applyThemeChanges(),this.resize()}SvgButton.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();destroyObject(this)},SvgButton.prototype.isDestroyed=function(){return!1},SvgButton.prototype.setEnabled=function(e){this._enabled!==e&&((this._enabled=e)?this._toggled?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton"):this.svgElement.setAttribute("class","cesium-animation-buttonDisabled"))},SvgButton.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")))},SvgButton.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},Object.defineProperties(Animation.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Animation.prototype.isDestroyed=function(){return!1},Animation.prototype.destroy=function(){defined(this._observer)&&(this._observer.disconnect(),this._observer=void 0);var 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();for(var i=this._subscriptions,r=0,n=i.length;r<n;r++)i[r].dispose();return destroyObject(this)},Animation.prototype.resize=function(){var e,t,i,r,n,a=this._container.clientWidth,o=this._container.clientHeight;a===this._lastWidth&&o===this._lastHeight||(i=o,0===(t=a)&&0===o?(t=200,i=132):0===a?t=(i=o)/132*200:0===o&&(i=(t=a)/200*132),r=t/200,n=i/132,(e=this._svgNode).style.cssText="width: "+t+"px; height: "+i+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",e.setAttribute("width",t),e.setAttribute("height",i),e.setAttribute("viewBox","0 0 "+t+" "+i),this._topG.setAttribute("transform","scale("+r+","+n+")"),this._centerX=Math.max(1,100*r),this._centerY=Math.max(1,100*n),this._lastHeight=a,this._lastWidth=o)},Animation.prototype.applyThemeChanges=function(){var e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(defined(this._observer))return;var t=this;return t._observer=new MutationObserver(function(){e.body.contains(t._container)&&(t._observer.disconnect(),t._observer=void 0,t.applyThemeChanges())}),void t._observer.observe(e,{childList:!0,subtree:!0})}var i=getElementColor(this._themeNormal),r=getElementColor(this._themeHover),n=getElementColor(this._themeSelect),a=getElementColor(this._themeDisabled),o=getElementColor(this._themeKnob),s=getElementColor(this._themePointer),l=getElementColor(this._themeSwoosh),c=getElementColor(this._themeSwooshHover),o=svgFromObject({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(i,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(i,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(i,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(i,gradientEnabledColor3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(r,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(r,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(r,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(r,gradientEnabledColor3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(n,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(n,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(n,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(n,gradientEnabledColor3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(a,gradientDisabledColor0)},{tagName:"stop",offset:"75%","stop-color":makeColorString(a,gradientDisabledColor1)}]},{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":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.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":makeColorString(s,gradientPointerColor)},{tagName:"stop",offset:"100%","stop-color":makeColorString(s,gradientPointerColor)}]},{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":makeColorString(o,gradientEnabledColor0)},{tagName:"stop",offset:"60%","stop-color":makeColorString(o,gradientKnobColor)},{tagName:"stop",offset:"85%","stop-color":makeColorString(o,gradientEnabledColor1)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":makeColorString(o,gradientKnobColor)},{tagName:"stop",offset:"60%","stop-color":makeColorString(o,gradientEnabledColor0)},{tagName:"stop",offset:"85%","stop-color":makeColorString(o,gradientEnabledColor3)}]}]});defined(this._defsElement)?this._svgNode.replaceChild(o,this._defsElement):this._svgNode.appendChild(o),this._defsElement=o};var monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],realtimeShuttleRingAngle=15,maxShuttleRingAngle=105;function numberComparator(e,t){return e-t}function getTypicalMultiplierIndex(e,t){e=binarySearch(t,e,numberComparator);return e<0?~e:e}function angleToMultiplier(e,t){if(Math.abs(e)<=realtimeShuttleRingAngle)return e/realtimeShuttleRingAngle;var i,r=realtimeShuttleRingAngle,n=maxShuttleRingAngle;return 0<e?(i=+Math.log(t[t.length-1])/(n-r),Math.exp(0+i*(e-r))):(i=+Math.log(-t[0])/(n-r),-Math.exp(0+i*(Math.abs(e)-r)))}function multiplierToAngle(e,t,i){if(i.clockStep===ClockStep$1.SYSTEM_CLOCK)return realtimeShuttleRingAngle;if(Math.abs(e)<=1)return e*realtimeShuttleRingAngle;var r=t[t.length-1];r<e?e=r:e<-r&&(e=-r);var n,a=realtimeShuttleRingAngle,i=maxShuttleRingAngle;return 0<e?(n=+Math.log(r)/(i-a),+Math.log(e)/n+a):(n=+Math.log(-t[0])/(i-a),-(+Math.log(Math.abs(e))/n+a))}function AnimationViewModel(e){var o=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=AnimationViewModel.defaultDateFormatter,this._timeFormatter=AnimationViewModel.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,knockout.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(AnimationViewModel.defaultTicks),this.timeLabel=void 0,knockout.defineProperty(this,"timeLabel",function(){return o._timeFormatter(o._clockViewModel.currentTime,o)}),this.dateLabel=void 0,knockout.defineProperty(this,"dateLabel",function(){return o._dateFormatter(o._clockViewModel.currentTime,o)}),this.multiplierLabel=void 0,knockout.defineProperty(this,"multiplierLabel",function(){var e=o._clockViewModel;if(e.clockStep===ClockStep$1.SYSTEM_CLOCK)return"Today";e=e.multiplier;return e%1==0?e.toFixed(0)+"x":e.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,knockout.defineProperty(this,"shuttleRingAngle",{get:function(){return multiplierToAngle(e.multiplier,o._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,maxShuttleRingAngle),-maxShuttleRingAngle);var t,i,r,n=o._allShuttleRingTicks,a=o._clockViewModel;a.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)!==maxShuttleRingAngle?(r=angleToMultiplier(e,n),o.snapToTicks?r=n[getTypicalMultiplierIndex(r,n)]:0!==r&&(100<(t=Math.abs(r))?(i=t.toFixed(0).length-2,i=Math.pow(10,i),r=Math.round(r/i)*i|0):realtimeShuttleRingAngle<t?r=Math.round(r):1<t?r=+r.toFixed(1):0<t&&(r=+r.toFixed(2))),a.multiplier=r):a.multiplier=0<e?n[n.length-1]:n[0]}}),this._canAnimate=void 0,knockout.defineProperty(this,"_canAnimate",function(){var e=o._clockViewModel,t=e.clockRange;if(o.shuttleRingDragging||t===ClockRange$1.UNBOUNDED)return!0;var i=e.multiplier,r=e.currentTime,n=e.startTime,a=!1;return(a=t===ClockRange$1.LOOP_STOP?JulianDate.greaterThan(r,n)||r.equals(n)&&0<i:(t=e.stopTime,JulianDate.greaterThan(r,n)&&JulianDate.lessThan(r,t)||r.equals(n)&&0<i||r.equals(t)&&i<0))||(e.shouldAnimate=!1),a}),this._isSystemTimeAvailable=void 0,knockout.defineProperty(this,"_isSystemTimeAvailable",function(){var e=o._clockViewModel;if(e.clockRange===ClockRange$1.UNBOUNDED)return!0;var t=e.systemTime;return JulianDate.greaterThanOrEquals(t,e.startTime)&&JulianDate.lessThanOrEquals(t,e.stopTime)}),this._isAnimating=void 0,knockout.defineProperty(this,"_isAnimating",function(){return o._clockViewModel.shouldAnimate&&(o._canAnimate||o.shuttleRingDragging)});var t=createCommand(function(){var e=o._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:o._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return!o._isAnimating}),tooltip:"Pause"});t=createCommand(function(){var e=o._clockViewModel,t=e.multiplier;0<t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return o._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});t=createCommand(function(){var e=o._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return o._isAnimating&&0<e.multiplier&&e.clockStep!==ClockStep$1.SYSTEM_CLOCK}),tooltip:"Play Forward"});t=createCommand(function(){o._clockViewModel.clockStep=ClockStep$1.SYSTEM_CLOCK},knockout.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return e.clockStep===ClockStep$1.SYSTEM_CLOCK}),tooltip:knockout.computed(function(){return o._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=createCommand(function(){var e=o._clockViewModel,t=o._allShuttleRingTicks,i=getTypicalMultiplierIndex(e.multiplier,t)-1;0<=i&&(e.multiplier=t[i])}),this._faster=createCommand(function(){var e=o._clockViewModel,t=o._allShuttleRingTicks,i=getTypicalMultiplierIndex(e.multiplier,t)+1;i<t.length&&(e.multiplier=t[i])})}function BaseLayerPickerViewModel(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).globe,i=defaultValue(e.imageryProviderViewModels,[]),r=defaultValue(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=i.slice(0),this.terrainProviderViewModels=r.slice(0),this.dropDownVisible=!1,knockout.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);var l=knockout.getObservable(this,"imageryProviderViewModels"),t=knockout.pureComputed(function(){for(var e=l(),t={},i=0;i<e.length;i++){var r=e[i],n=r.category;defined(t[n])?t[n].push(r):t[n]=[r]}var a=Object.keys(t),o=[];for(i=0;i<a.length;i++){var s=a[i];o.push({name:s,providers:t[s]})}return o});this._imageryProviders=t;var c=knockout.getObservable(this,"terrainProviderViewModels"),t=knockout.pureComputed(function(){for(var e=c(),t={},i=0;i<e.length;i++){var r=e[i],n=r.category;defined(t[n])?t[n].push(r):t[n]=[r]}var a=Object.keys(t),o=[];for(i=0;i<a.length;i++){var s=a[i];o.push({name:s,providers:t[s]})}return o});this._terrainProviders=t,this.buttonTooltip=void 0,knockout.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,t=this.selectedTerrain,e=defined(e)?e.name:void 0,t=defined(t)?t.name:void 0;return defined(e)&&defined(t)?e+"\n"+t:defined(e)?e:t}),this.buttonImageUrl=void 0,knockout.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;if(defined(e))return e.iconUrl}),this.selectedImagery=void 0;var d=knockout.observable();this._currentImageryProviders=[],knockout.defineProperty(this,"selectedImagery",{get:function(){return d()},set:function(e){if(d()!==e){var t=this._currentImageryProviders,i=t.length,r=this._globe.imageryLayers,n=!1;for(u=0;u<i;u++)for(var a=r.length,o=0;o<a;o++){var s=r.get(o);if(s.imageryProvider===t[u]){r.remove(s),n=!0;break}}if(defined(e)){var l,c=e.creationCommand();if(Array.isArray(c)){for(var u=c.length-1;0<=u;u--)r.addImageryProvider(c[u],0);this._currentImageryProviders=c.slice(0)}else this._currentImageryProviders=[c],n||defined(l=r.get(0))&&r.remove(l),r.addImageryProvider(c,0)}d(e),this.dropDownVisible=!1}else this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var n=knockout.observable();knockout.defineProperty(this,"selectedTerrain",{get:function(){return n()},set:function(e){var t;n()!==e&&(defined(e)&&(t=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(t instanceof EllipsoidTerrainProvider),this._globe.terrainProvider=t,n(e)),this.dropDownVisible=!1}});var a=this;this._toggleDropDown=createCommand(function(){a.dropDownVisible=!a.dropDownVisible}),this.selectedImagery=defaultValue(e.selectedImageryProviderViewModel,i[0]),this.selectedTerrain=defaultValue(e.selectedTerrainProviderViewModel,r[0])}function BaseLayerPicker(e,t){e=getElement(e);var i=new BaseLayerPickerViewModel(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var n=document.createElement("img");n.setAttribute("draggable","false"),n.className="cesium-baseLayerPicker-selected",n.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),r.appendChild(n);var a=document.createElement("div");a.className="cesium-baseLayerPicker-dropDown",a.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(a);t=document.createElement("div");t.className="cesium-baseLayerPicker-sectionTitle",t.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),t.innerHTML="Imagery",a.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-section",n.setAttribute("data-bind","foreach: _imageryProviders"),a.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-category",n.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-categoryTitle",n.setAttribute("data-bind","text: name"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-choices",n.setAttribute("data-bind","foreach: providers"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-item",t.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),n.appendChild(t);n=document.createElement("img");n.className="cesium-baseLayerPicker-itemIcon",n.setAttribute("data-bind","attr: { src: iconUrl }"),n.setAttribute("draggable","false"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-itemLabel",n.setAttribute("data-bind","text: name"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-sectionTitle",t.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),t.innerHTML="Terrain",a.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-section",n.setAttribute("data-bind","foreach: _terrainProviders"),a.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-category",n.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-categoryTitle",n.setAttribute("data-bind","text: name"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-choices",n.setAttribute("data-bind","foreach: providers"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-item",t.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),n.appendChild(t);n=document.createElement("img");n.className="cesium-baseLayerPicker-itemIcon",n.setAttribute("data-bind","attr: { src: iconUrl }"),n.setAttribute("draggable","false"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-itemLabel",n.setAttribute("data-bind","text: name"),t.appendChild(n),knockout.applyBindings(i,r),knockout.applyBindings(i,a),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=a,this._closeDropDown=function(e){r.contains(e.target)||a.contains(e.target)||(i.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function ProviderViewModel(e){var t=e.creationFunction;defined(t.canExecute)||(t=createCommand(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=defaultValue(e.category,""),knockout.track(this,["name","tooltip","iconUrl"])}function createDefaultImageryProviderViewModels(){var e=[];return e.push(new ProviderViewModel({name:"Bing Maps Aerial",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.AERIAL})}})),e.push(new ProviderViewModel({name:"Bing Maps Aerial with Labels",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.AERIAL_WITH_LABELS})}})),e.push(new ProviderViewModel({name:"Bing Maps Roads",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.ROAD})}})),e.push(new ProviderViewModel({name:"ESRI World Imagery",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"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 NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"ESRI World Street Map",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"ESRI National Geographic",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"Open­Street­Map",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new ProviderViewModel({name:"Stamen Watercolor",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new ProviderViewModel({name:"Stamen Toner",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new ProviderViewModel({name:"Sentinel-2",iconUrl:buildModuleUrl("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 new IonImageryProvider({assetId:3954})}})),e.push(new ProviderViewModel({name:"Blue Marble",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return new IonImageryProvider({assetId:3845})}})),e.push(new ProviderViewModel({name:"Earth at night",iconUrl:buildModuleUrl("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 new IonImageryProvider({assetId:3812})}})),e.push(new ProviderViewModel({name:"Natural Earth II",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",category:"Cesium ion",creationFunction:function(){return new TileMapServiceImageryProvider({url:buildModuleUrl("Assets/Textures/NaturalEarthII")})}})),e}function createDefaultTerrainProviderViewModels(){var e=[];return e.push(new ProviderViewModel({name:"WGS84 Ellipsoid",iconUrl:buildModuleUrl("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new EllipsoidTerrainProvider}})),e.push(new ProviderViewModel({name:"Cesium World Terrain",iconUrl:buildModuleUrl("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 createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}})),e}function getPickTileset(t){return function(e){e=t._scene.pick(e.position);defined(e)&&e.primitive instanceof Cesium3DTileset&&(t.tileset=e.primitive),t.pickActive=!1}}function selectTilesetOnHover(t,e){e?t._eventHandler.setInputAction(function(e){e=t._scene.pick(e.endPosition);defined(e)&&e.primitive instanceof Cesium3DTileset&&(t.tileset=e.primitive)},ScreenSpaceEventType$1.MOUSE_MOVE):(t._eventHandler.removeInputAction(ScreenSpaceEventType$1.MOUSE_MOVE),t.picking=t.picking)}AnimationViewModel.defaultDateFormatter=function(e,t){e=JulianDate.toGregorianDate(e);return monthNames[e.month-1]+" "+e.day+" "+e.year},AnimationViewModel.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],AnimationViewModel.defaultTimeFormatter=function(e,t){var i=JulianDate.toGregorianDate(e),e=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?sprintf("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,e):sprintf("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},AnimationViewModel.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},AnimationViewModel.prototype.setShuttleRingTicks=function(e){var t,i={},r=this._sortedFilteredPositiveTicks;for(o=r.length=0,n=e.length;o<n;++o)t=e[o],i.hasOwnProperty(t)||(i[t]=!0,r.push(t));r.sort(numberComparator);for(var n,a=[],o=(n=r.length)-1;0<=o;--o)0!==(t=r[o])&&a.push(-t);Array.prototype.push.apply(a,r),this._allShuttleRingTicks=a},Object.defineProperties(AnimationViewModel.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}}}),AnimationViewModel._maxShuttleRingAngle=maxShuttleRingAngle,AnimationViewModel._realtimeShuttleRingAngle=realtimeShuttleRingAngle,Object.defineProperties(BaseLayerPickerViewModel.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),Object.defineProperties(BaseLayerPicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),BaseLayerPicker.prototype.isDestroyed=function(){return!1},BaseLayerPicker.prototype.destroy=function(){return FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._element),knockout.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),destroyObject(this)},Object.defineProperties(ProviderViewModel.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var stringOptions={maximumFractionDigits:3};function formatMemoryString(e){e/=1048576;return e<1?e.toLocaleString(void 0,stringOptions):Math.round(e).toLocaleString()}function getStatistics(e,t){if(!defined(e))return"";var i=t?e._statisticsPerPass[Cesium3DTilePass$1.PICK]:e._statisticsPerPass[Cesium3DTilePass$1.RENDER],e='<ul class="cesium-cesiumInspector-statistics">';return e+="<li><strong>Visited: </strong>"+i.visited.toLocaleString()+"</li><li><strong>Selected: </strong>"+i.selected.toLocaleString()+"</li><li><strong>Commands: </strong>"+i.numberOfCommands.toLocaleString()+"</li>",e+="</ul>",t||(e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Requests: </strong>"+i.numberOfPendingRequests.toLocaleString()+"</li><li><strong>Attempted: </strong>"+i.numberOfAttemptedRequests.toLocaleString()+"</li><li><strong>Processing: </strong>"+i.numberOfTilesProcessing.toLocaleString()+"</li><li><strong>Content Ready: </strong>"+i.numberOfTilesWithContentReady.toLocaleString()+"</li><li><strong>Total: </strong>"+i.numberOfTilesTotal.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Features Selected: </strong>"+i.numberOfFeaturesSelected.toLocaleString()+"</li><li><strong>Features Loaded: </strong>"+i.numberOfFeaturesLoaded.toLocaleString()+"</li><li><strong>Points Selected: </strong>"+i.numberOfPointsSelected.toLocaleString()+"</li><li><strong>Points Loaded: </strong>"+i.numberOfPointsLoaded.toLocaleString()+"</li><li><strong>Triangles Selected: </strong>"+i.numberOfTrianglesSelected.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Tiles styled: </strong>"+i.numberOfTilesStyled.toLocaleString()+"</li><li><strong>Features styled: </strong>"+i.numberOfFeaturesStyled.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Children Union Culled: </strong>"+i.numberOfTilesCulledWithChildrenUnion.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Geometry Memory (MB): </strong>"+formatMemoryString(i.geometryByteLength)+"</li><li><strong>Texture Memory (MB): </strong>"+formatMemoryString(i.texturesByteLength)+"</li><li><strong>Batch Table Memory (MB): </strong>"+formatMemoryString(i.batchTableByteLength)+"</li>",e+="</ul>"),e}var colorBlendModes=[{text:"Highlight",value:Cesium3DTileColorBlendMode$1.HIGHLIGHT},{text:"Replace",value:Cesium3DTileColorBlendMode$1.REPLACE},{text:"Mix",value:Cesium3DTileColorBlendMode$1.MIX}],highlightColor=new Color(1,1,0,.4),scratchColor=new Color,oldColor=new Color;function Cesium3DTilesInspectorViewModel(r,e){var n=this,t=r.canvas;this._eventHandler=new ScreenSpaceEventHandler(t),this._scene=r,this._performanceContainer=e,this._canvas=t,this._performanceDisplay=new PerformanceDisplay({container:e}),this._statisticsText="",this._pickStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,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._tileset=void 0,this._feature=void 0,this._tile=void 0,knockout.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_editorError","showPickStatistics","showStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=knockout.observable({}),this.properties=[],knockout.defineProperty(this,"properties",function(){var e,t=[],i=n._properties();for(e in i)i.hasOwnProperty(e)&&t.push(e);return t});var i=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return i()},set:function(e){i(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;var a=knockout.observable();knockout.defineProperty(this,"colorBlendMode",{get:function(){return a()},set:function(e){a(e),defined(n._tileset)&&(n._tileset.colorBlendMode=e,n._scene.requestRender())}}),this.colorBlendMode=Cesium3DTileColorBlendMode$1.HIGHLIGHT;var o=knockout.observable(),s=knockout.observable();knockout.defineProperty(this,"picking",{get:function(){return s()},set:function(e){s(e),e?n._eventHandler.setInputAction(function(e){var t,i=r.pick(e.endPosition);i instanceof Cesium3DTileFeature?(n.feature=i,n.tile=i.content.tile):defined(i)&&defined(i.content)?(n.feature=void 0,n.tile=i.content.tile):(n.feature=void 0,n.tile=void 0),defined(n._tileset)&&(o&&defined(i)&&defined(i.content)?(r.pickPositionSupported&&defined(t=r.pickPosition(e.endPosition))&&(n._tileset.debugPickPosition=t),n._tileset.debugPickedTile=i.content.tile):n._tileset.debugPickedTile=void 0,n._scene.requestRender())},ScreenSpaceEventType$1.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(ScreenSpaceEventType$1.MOUSE_MOVE))}}),this.picking=!0;var l=knockout.observable();knockout.defineProperty(this,"colorize",{get:function(){return l()},set:function(e){l(e),defined(n._tileset)&&(n._tileset.debugColorizeTiles=e,n._scene.requestRender())}}),this.colorize=!1;var c=knockout.observable();knockout.defineProperty(this,"wireframe",{get:function(){return c()},set:function(e){c(e),defined(n._tileset)&&(n._tileset.debugWireframe=e,n._scene.requestRender())}}),this.wireframe=!1;var u=knockout.observable();knockout.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(e){u(e),defined(n._tileset)&&(n._tileset.debugShowBoundingVolume=e,n._scene.requestRender())}}),this.showBoundingVolumes=!1;var d=knockout.observable();knockout.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(e){d(e),defined(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=e,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;var h=knockout.observable();knockout.defineProperty(this,"showRequestVolumes",{get:function(){return h()},set:function(e){h(e),defined(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=e,n._scene.requestRender())}}),this.showRequestVolumes=!1;var p=knockout.observable();knockout.defineProperty(this,"freezeFrame",{get:function(){return p()},set:function(e){p(e),defined(n._tileset)&&(n._tileset.debugFreezeFrame=e,n._scene.debugShowFrustumPlanes=e,n._scene.requestRender())}}),this.freezeFrame=!1,knockout.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return o()},set:function(e){o(e),defined(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=e,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;var m=knockout.observable();knockout.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(e){m(e),defined(n._tileset)&&(n._tileset.debugShowGeometricError=e,n._scene.requestRender())}}),this.showGeometricError=!1;var f=knockout.observable();knockout.defineProperty(this,"showRenderingStatistics",{get:function(){return f()},set:function(e){f(e),defined(n._tileset)&&(n._tileset.debugShowRenderingStatistics=e,n._scene.requestRender())}}),this.showRenderingStatistics=!1;var g=knockout.observable();knockout.defineProperty(this,"showMemoryUsage",{get:function(){return g()},set:function(e){g(e),defined(n._tileset)&&(n._tileset.debugShowMemoryUsage=e,n._scene.requestRender())}}),this.showMemoryUsage=!1;var _=knockout.observable();knockout.defineProperty(this,"showUrl",{get:function(){return _()},set:function(e){_(e),defined(n._tileset)&&(n._tileset.debugShowUrl=e,n._scene.requestRender())}}),this.showUrl=!1;var y=knockout.observable();knockout.defineProperty(this,"maximumScreenSpaceError",{get:function(){return y()},set:function(e){e=Number(e),isNaN(e)||(y(e),defined(n._tileset)&&(n._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;var C=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return C()},set:function(e){e=Number(e),isNaN(e)||(C(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,knockout.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(C(),1/6)},set:function(e){C(Math.pow(e,6))}});var v=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return v()},set:function(e){e=Number(e),isNaN(e)||(v(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;var S=getPickTileset(this),T=knockout.observable();knockout.defineProperty(this,"pickActive",{get:function(){return T()},set:function(e){T(e),e?n._eventHandler.setInputAction(S,ScreenSpaceEventType$1.LEFT_CLICK):n._eventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}});var x=knockout.observable();knockout.defineProperty(this,"pointCloudShading",{get:function(){return x()},set:function(e){x(e),defined(n._tileset)&&(n._tileset.pointCloudShading.attenuation=e)}}),this.pointCloudShading=!1;var b=knockout.observable();knockout.defineProperty(this,"geometricErrorScale",{get:function(){return b()},set:function(e){e=Number(e),isNaN(e)||(b(e),defined(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=e))}}),this.geometricErrorScale=1;var E=knockout.observable();knockout.defineProperty(this,"maximumAttenuation",{get:function(){return E()},set:function(e){e=Number(e),isNaN(e)||(E(e),defined(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=0===e?void 0:e))}}),this.maximumAttenuation=0;var P=knockout.observable();knockout.defineProperty(this,"baseResolution",{get:function(){return P()},set:function(e){e=Number(e),isNaN(e)||(P(e),defined(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=0===e?void 0:e))}}),this.baseResolution=0;var A=knockout.observable();knockout.defineProperty(this,"eyeDomeLighting",{get:function(){return A()},set:function(e){A(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=e)}}),this.eyeDomeLighting=!1;var w=knockout.observable();knockout.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return w()},set:function(e){e=Number(e),isNaN(e)||(w(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=e))}}),this.eyeDomeLightingStrength=1;var D=knockout.observable();knockout.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return D()},set:function(e){e=Number(e),isNaN(e)||(D(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=e))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;var M=knockout.observable();knockout.defineProperty(this,"skipLevelOfDetail",{get:function(){return M()},set:function(e){M(e),defined(n._tileset)&&(n._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;var I=knockout.observable();knockout.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return I()},set:function(e){e=Number(e),isNaN(e)||(I(e),defined(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;var R=knockout.observable();knockout.defineProperty(this,"baseScreenSpaceError",{get:function(){return R()},set:function(e){e=Number(e),isNaN(e)||(R(e),defined(n._tileset)&&(n._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;var O=knockout.observable();knockout.defineProperty(this,"skipLevels",{get:function(){return O()},set:function(e){e=Number(e),isNaN(e)||(O(e),defined(n._tileset)&&(n._tileset.skipLevels=e))}}),this.skipLevels=1;var L=knockout.observable();knockout.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return L()},set:function(e){L(e),defined(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;var F=knockout.observable();knockout.defineProperty(this,"loadSiblings",{get:function(){return F()},set:function(e){F(e),defined(n._tileset)&&(n._tileset.loadSiblings=e)}}),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=r.postRender.addEventListener(function(){n._update()}),defined(this._tileset)||selectTilesetOnHover(this,!0)}function hasFeatures(e){if(0<e.featuresLength)return 1;var t=e.innerContents;if(defined(t)){for(var i=t.length,r=0;r<i;++r)if(!hasFeatures(t[r]))return;return 1}}function Cesium3DTilesInspector(e,t){e=getElement(e);var i=document.createElement("div"),r=document.createElement("div");r.setAttribute("data-bind","visible: performance");var n=new Cesium3DTilesInspectorViewModel(t,r);this._viewModel=n,this._container=e,this._element=i;var a=document.createElement("div");a.textContent="3D Tiles Inspector",a.className="cesium-cesiumInspector-button",a.setAttribute("data-bind","click: toggleInspector"),i.appendChild(a),i.className="cesium-cesiumInspector cesium-3DTilesInspector",i.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(i);var o=document.createElement("div");(this._panel=o).className="cesium-cesiumInspector-dropDown",i.appendChild(o);var s=InspectorShared.createSection,l=InspectorShared.createCheckbox,c=s(o,"Tileset","tilesetVisible","toggleTileset"),u=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Update","updateVisible","toggleUpdate"),h=s(o,"Logging","loggingVisible","toggleLogging"),p=s(o,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),t=s(o,"Style","styleVisible","toggleStyle"),a=s(o,"Optimization","optimizationVisible","toggleOptimization"),e=document.createElement("div");e.className="field-group";s=document.createElement("label");s.className="field-label",s.appendChild(document.createTextNode("Properties: "));o=document.createElement("div");o.setAttribute("data-bind","text: properties"),e.appendChild(s),e.appendChild(o),c.appendChild(e),c.appendChild(makeButton("togglePickTileset","Pick Tileset","pickActive")),c.appendChild(makeButton("trimTilesCache","Trim Tiles Cache")),c.appendChild(l("Enable Picking","picking")),u.appendChild(l("Colorize","colorize")),u.appendChild(l("Wireframe","wireframe")),u.appendChild(l("Bounding Volumes","showBoundingVolumes")),u.appendChild(l("Content Volumes","showContentBoundingVolumes")),u.appendChild(l("Request Volumes","showRequestVolumes")),u.appendChild(l("Point Cloud Shading","pointCloudShading"));c=document.createElement("div");c.setAttribute("data-bind","visible: pointCloudShading"),c.appendChild(makeRangeInput("geometricErrorScale",0,2,.01,"Geometric Error Scale")),c.appendChild(makeRangeInput("maximumAttenuation",0,32,1,"Maximum Attenuation")),c.appendChild(makeRangeInput("baseResolution",0,1,.01,"Base Resolution")),c.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),u.appendChild(c);u=document.createElement("div");u.setAttribute("data-bind","visible: eyeDomeLighting"),u.appendChild(makeRangeInput("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),u.appendChild(makeRangeInput("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),c.appendChild(u),d.appendChild(l("Freeze Frame","freezeFrame")),d.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));u=document.createElement("div");u.appendChild(makeRangeInput("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),d.appendChild(u);u=document.createElement("div");u.setAttribute("data-bind","visible: dynamicScreenSpaceError"),u.appendChild(makeRangeInput("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),u.appendChild(makeRangeInput("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),d.appendChild(u),h.appendChild(l("Performance","performance")),h.appendChild(r),h.appendChild(l("Statistics","showStatistics"));r=document.createElement("div");r.className="cesium-3dTilesInspector-statistics",r.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(r),h.appendChild(l("Pick Statistics","showPickStatistics"));r=document.createElement("div");r.className="cesium-3dTilesInspector-statistics",r.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(r);r=document.createElement("div");t.appendChild(r),r.appendChild(document.createTextNode("Color Blend Mode: "));t=document.createElement("select");t.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),r.appendChild(t);t=document.createElement("textarea");t.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),r.className="cesium-cesiumInspector-styleEditor",r.appendChild(t);t=makeButton("compileStyle","Compile (Ctrl+Enter)");r.appendChild(t);t=document.createElement("div");t.className="cesium-cesiumInspector-error",t.setAttribute("data-bind","text: editorError"),r.appendChild(t),p.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),p.appendChild(l("Geometric Error","showGeometricError")),p.appendChild(l("Rendering Statistics","showRenderingStatistics")),p.appendChild(l("Memory Usage (MB)","showMemoryUsage")),p.appendChild(l("Url","showUrl")),a.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));p=document.createElement("div");p.appendChild(makeRangeInput("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),a.appendChild(p);p=document.createElement("div");p.appendChild(makeRangeInput("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),a.appendChild(p);p=document.createElement("div");p.appendChild(makeRangeInput("skipLevels",0,10,1,"Min. levels to skip")),a.appendChild(p),a.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),a.appendChild(l("Load siblings of visible tiles","loadSiblings")),knockout.applyBindings(n,i)}function makeRangeInput(e,t,i,r,n,a){a=defaultValue(a,e);var o=document.createElement("input");o.setAttribute("data-bind","value: "+a),o.type="number";a=document.createElement("input");a.type="range",a.min=t,a.max=i,a.step=r,a.setAttribute("data-bind",'valueUpdate: "input", value: '+e);e=document.createElement("div");e.appendChild(a);a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(n)),a.appendChild(o),a.appendChild(e),a}function makeButton(e,t,i){var r=document.createElement("button");r.type="button",r.textContent=t,r.className="cesium-cesiumInspector-pickButton";e="click: "+e;return defined(i)&&(e+=', css: {"cesium-cesiumInspector-pickButtonHighlight" : '+i+"}"),r.setAttribute("data-bind",e),r}function frustumStatisticsToString(e){if(defined(e)){var t,i="Command Statistics",r=e.commandsInFrustums;for(t in r)if(r.hasOwnProperty(t)){var n,a=parseInt(t,10);if(7===a)n="1, 2 and 3";else{for(var o=[],s=2;0<=s;s--){var l=Math.pow(2,s);l<=a&&(o.push(s+1),a-=l)}n=o.reverse().join(" and ")}i+="<br>    "+r[t]+" in frustum "+n}i+="<br>Total: "+e.totalCommands}return i}function boundDepthFrustum(e,t,i){t=Math.min(i,t);return t=Math.max(t,e)}Object.defineProperties(Cesium3DTilesInspectorViewModel.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}},colorBlendModes:{get:function(){return colorBlendModes}},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,defined(e)){var t=this;e.readyPromise.then(function(e){t.isDestroyed()||t._properties(e.properties)});for(var i=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],r=i.length,n=0;n<r;++n){var a=i[n];this[a]=this[a]}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;var o=e.pointCloudShading;this.pointCloudShading=o.attenuation,this.geometricErrorScale=o.geometricErrorScale,this.maximumAttenuation=o.maximumAttenuation||0,this.baseResolution=o.baseResolution||0,this.eyeDomeLighting=o.eyeDomeLighting,this.eyeDomeLightingStrength=o.eyeDomeLightingStrength,this.eyeDomeLightingRadius=o.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=getStatistics(e,!1),this._pickStatisticsText=getStatistics(e,!0),selectTilesetOnHover(this,!1)}},feature:{get:function(){return this._feature},set:function(e){var t;this._feature!==e&&(defined(t=this._feature)&&!t.content.isDestroyed()&&(!this.colorize&&defined(this._style)?t.color=defined(this._style.color)?this._style.color.evaluateColor(t,scratchColor):Color.WHITE:t.color=oldColor,this._scene.requestRender()),defined(e)&&(Color.clone(e.color,oldColor),e.color=highlightColor,this._scene.requestRender()),this._feature=e)}},tile:{get:function(){return this._tile},set:function(e){var t;this._tile!==e&&(!defined(t=this._tile)||t.isDestroyed()||hasFeatures(t.content)||(t.color=oldColor,this._scene.requestRender()),defined(e)&&!hasFeatures(e.content)&&(Color.clone(e.color,oldColor),e.color=highlightColor,this._scene.requestRender()),this._tile=e)}}}),Cesium3DTilesInspectorViewModel.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},Cesium3DTilesInspectorViewModel.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},Cesium3DTilesInspectorViewModel.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},Cesium3DTilesInspectorViewModel.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},Cesium3DTilesInspectorViewModel.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},Cesium3DTilesInspectorViewModel.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},Cesium3DTilesInspectorViewModel.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},Cesium3DTilesInspectorViewModel.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},Cesium3DTilesInspectorViewModel.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},Cesium3DTilesInspectorViewModel.prototype.trimTilesCache=function(){defined(this._tileset)&&this._tileset.trimLoadedTiles()},Cesium3DTilesInspectorViewModel.prototype.compileStyle=function(){var e=this._tileset;if(defined(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new Cesium3DTileStyle(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},Cesium3DTilesInspectorViewModel.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();var i,r=t.target,n=r.selectionStart,a=r.selectionEnd,o=a,s=r.value.slice(n,a).split("\n"),l=s.length;if(t.shiftKey)for(i=0;i<l;++i)" "===s[i][0]&&(" "===s[i][1]?(s[i]=s[i].substr(2),o-=2):(s[i]=s[i].substr(1),--o));else for(i=0;i<l;++i)s[i]=" "+s[i],o+=2;var c=s.join("\n");r.value=r.value.slice(0,n)+c+r.value.slice(a),r.selectionStart=n!==a?n:o,r.selectionEnd=o}else!t.ctrlKey||10!==t.keyCode&&13!==t.keyCode||this.compileStyle();return!0},Cesium3DTilesInspectorViewModel.prototype._update=function(){var e=this._tileset;if(this.performance&&this._performanceDisplay.update(),defined(e)){if(e.isDestroyed())return this.tile=void 0,this.feature=void 0,void(this.tileset=void 0);var 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=getStatistics(e,!1),this._pickStatisticsText=getStatistics(e,!0))},Cesium3DTilesInspectorViewModel.prototype.isDestroyed=function(){return!1},Cesium3DTilesInspectorViewModel.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();var t=this;return this._definedProperties.forEach(function(e){knockout.getObservable(t,e).dispose()}),destroyObject(this)},Cesium3DTilesInspectorViewModel.getStatistics=getStatistics,Object.defineProperties(Cesium3DTilesInspector.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Cesium3DTilesInspector.prototype.isDestroyed=function(){return!1},Cesium3DTilesInspector.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),destroyObject(this)};var scratchPickRay=new Ray,scratchPickCartesian=new Cartesian3;function CesiumInspectorViewModel(e,t){var c=this,i=e.canvas,r=new ScreenSpaceEventHandler(i);this._eventHandler=r,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;var n,u=this._scene.globe;function a(e){e=c._scene.pick({x:e.position.x,y:e.position.y});defined(e)&&(c.primitive=defined(e.collection)?e.collection:e.primitive),c._scene.requestRender(),c.pickPrimitiveActive=!1}function o(e){var t,i=u.ellipsoid,e=c._scene.camera.getPickRay(e.position,scratchPickRay),e=u.pick(e,c._scene,scratchPickCartesian);if(defined(e))for(var r=i.cartesianToCartographic(e),n=u._surface.tileProvider._tilesToRenderByTextureCount,a=0;!t&&a<n.length;++a){var o=n[a];if(defined(o))for(var s=0;!t&&s<o.length;++s){var l=o[s];Rectangle.contains(l.rectangle,r)&&(t=l)}}c.tile=t,c.pickTileActive=!1}u.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.globeDepth=!1,this.pickDepth=!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="",knockout.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","globeDepth","pickDepth","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=createCommand(function(){c.dropDownVisible=!c.dropDownVisible}),this._toggleGeneral=createCommand(function(){c.generalVisible=!c.generalVisible}),this._togglePrimitives=createCommand(function(){c.primitivesVisible=!c.primitivesVisible}),this._toggleTerrain=createCommand(function(){c.terrainVisible=!c.terrainVisible}),this._frustumsSubscription=knockout.getObservable(this,"frustums").subscribe(function(e){c._scene.debugShowFrustums=e,c._scene.requestRender()}),this._frustumPlanesSubscription=knockout.getObservable(this,"frustumPlanes").subscribe(function(e){c._scene.debugShowFrustumPlanes=e,c._scene.requestRender()}),this._performanceSubscription=knockout.getObservable(this,"performance").subscribe(function(e){e?c._performanceDisplay=new PerformanceDisplay({container:c._performanceContainer}):c._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=createCommand(function(){return c._primitive.debugShowBoundingVolume=c.primitiveBoundingSphere,c._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=knockout.getObservable(this,"primitiveBoundingSphere").subscribe(function(){c._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=createCommand(function(){var e;return c.primitiveReferenceFrame?(e=c._primitive.modelMatrix,c._modelMatrixPrimitive=new DebugModelMatrixPrimitive({modelMatrix:e}),c._scene.primitives.add(c._modelMatrixPrimitive)):defined(c._modelMatrixPrimitive)&&(c._scene.primitives.remove(c._modelMatrixPrimitive),c._modelMatrixPrimitive=void 0),c._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=knockout.getObservable(this,"primitiveReferenceFrame").subscribe(function(){c._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=createCommand(function(){return c.filterPrimitive?c._scene.debugCommandFilter=function(e){return!(!defined(c._modelMatrixPrimitive)||e.owner!==c._modelMatrixPrimitive._primitive)||!!defined(c._primitive)&&(e.owner===c._primitive||e.owner===c._primitive._billboardCollection||e.owner.primitive===c._primitive)}:c._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=knockout.getObservable(this,"filterPrimitive").subscribe(function(){c._doFilterPrimitive(),c._scene.requestRender()}),this._wireframeSubscription=knockout.getObservable(this,"wireframe").subscribe(function(e){u._surface.tileProvider._debug.wireframe=e,c._scene.requestRender()}),this._globeDepthSubscription=knockout.getObservable(this,"globeDepth").subscribe(function(e){c._scene.debugShowGlobeDepth=e,c._scene.requestRender()}),this._pickDepthSubscription=knockout.getObservable(this,"pickDepth").subscribe(function(e){c._scene.debugShowPickDepth=e,c._scene.requestRender()}),this._depthFrustumSubscription=knockout.getObservable(this,"depthFrustum").subscribe(function(e){c._scene.debugShowDepthFrustum=e,c._scene.requestRender()}),this._incrementDepthFrustum=createCommand(function(){var e=c.depthFrustum+1;return c.depthFrustum=boundDepthFrustum(1,c._numberOfFrustums,e),c._scene.requestRender(),!0}),this._decrementDepthFrustum=createCommand(function(){var e=c.depthFrustum-1;return c.depthFrustum=boundDepthFrustum(1,c._numberOfFrustums,e),c._scene.requestRender(),!0}),this._suspendUpdatesSubscription=knockout.getObservable(this,"suspendUpdates").subscribe(function(e){(u._surface._debug.suspendLodUpdate=e)||(c.filterTile=!1)}),this._showTileCoordinates=createCommand(function(){return c.tileCoordinates&&!defined(n)?n=e.imageryLayers.addImageryProvider(new TileCoordinatesImageryProvider({tilingScheme:e.terrainProvider.tilingScheme})):!c.tileCoordinates&&defined(n)&&(e.imageryLayers.remove(n),n=void 0),!0}),this._tileCoordinatesSubscription=knockout.getObservable(this,"tileCoordinates").subscribe(function(){c._showTileCoordinates(),c._scene.requestRender()}),this._tileBoundingSphereSubscription=knockout.getObservable(this,"tileBoundingSphere").subscribe(function(){c._showTileBoundingSphere(),c._scene.requestRender()}),this._showTileBoundingSphere=createCommand(function(){return c.tileBoundingSphere?u._surface.tileProvider._debug.boundingSphereTile=c._tile:u._surface.tileProvider._debug.boundingSphereTile=void 0,c._scene.requestRender(),!0}),this._doFilterTile=createCommand(function(){return c.filterTile?(c.suspendUpdates=!0,u._surface._tilesToRender=[],defined(c._tile)&&c._tile.renderable&&u._surface._tilesToRender.push(c._tile)):c.suspendUpdates=!1,!0}),this._filterTileSubscription=knockout.getObservable(this,"filterTile").subscribe(function(){c.doFilterTile(),c._scene.requestRender()}),this._pickPrimitive=createCommand(function(){c.pickPrimitiveActive=!c.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=knockout.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?r.setInputAction(a,ScreenSpaceEventType$1.LEFT_CLICK):r.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}),this._pickTile=createCommand(function(){c.pickTileActive=!c.pickTileActive}),this._pickTileActiveSubscription=knockout.getObservable(this,"pickTileActive").subscribe(function(e){e?r.setInputAction(o,ScreenSpaceEventType$1.LEFT_CLICK):r.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){c._update()})}function CesiumInspector(e,t){e=getElement(e);var i=document.createElement("div"),r=new CesiumInspectorViewModel(t,i);this._viewModel=r,this._container=e;var n=document.createElement("div");this._element=n;var a=document.createElement("div");a.textContent="Cesium Inspector",a.className="cesium-cesiumInspector-button",a.setAttribute("data-bind","click: toggleDropDown"),n.appendChild(a),n.className="cesium-cesiumInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var o=document.createElement("div");(this._panel=o).className="cesium-cesiumInspector-dropDown",n.appendChild(o);var s=InspectorShared.createSection,l=InspectorShared.createCheckbox,c=s(o,"General","generalVisible","toggleGeneral"),u=l("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(d),c.appendChild(u),c.appendChild(l("Show Frustum Planes","frustumPlanes")),c.appendChild(l("Performance Display","performance")),i.className="cesium-cesiumInspector-performanceDisplay",c.appendChild(i);var h=document.createElement("div");h.className="cesium-cesiumInspector-shaderCache",h.setAttribute("data-bind","html: shaderCacheText"),c.appendChild(h);var p=document.createElement("div");c.appendChild(p);t=document.createElement("span");t.setAttribute("data-bind",'html: "     Frustum:"'),p.appendChild(t);a=document.createElement("span");a.setAttribute("data-bind","text: depthFrustumText"),p.appendChild(a);e=document.createElement("input");e.type="button",e.value="-",e.className="cesium-cesiumInspector-pickButton",e.setAttribute("data-bind","click: decrementDepthFrustum"),p.appendChild(e);n=document.createElement("input");n.type="button",n.value="+",n.className="cesium-cesiumInspector-pickButton",n.setAttribute("data-bind","click: incrementDepthFrustum"),p.appendChild(n);d=s(o,"Primitives","primitivesVisible","togglePrimitives"),u=document.createElement("div");u.className="cesium-cesiumInspector-pickSection",d.appendChild(u);i=document.createElement("input");i.type="button",i.value="Pick a primitive",i.className="cesium-cesiumInspector-pickButton",i.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');h=document.createElement("div");h.className="cesium-cesiumInspector-center",h.appendChild(i),u.appendChild(h),u.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),u.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),u.appendChild(this._primitiveOnly);c=s(o,"Terrain","terrainVisible","toggleTerrain"),t=document.createElement("div");t.className="cesium-cesiumInspector-pickSection",c.appendChild(t);a=document.createElement("input");a.type="button",a.value="Pick a tile",a.className="cesium-cesiumInspector-pickButton",a.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),(h=document.createElement("div")).appendChild(a),h.className="cesium-cesiumInspector-center",t.appendChild(h);e=document.createElement("div");t.appendChild(e);p=document.createElement("input");p.type="button",p.value="Parent",p.className="cesium-cesiumInspector-pickButton",p.setAttribute("data-bind","click: selectParent");n=document.createElement("input");n.type="button",n.value="NW",n.className="cesium-cesiumInspector-pickButton",n.setAttribute("data-bind","click: selectNW");d=document.createElement("input");d.type="button",d.value="NE",d.className="cesium-cesiumInspector-pickButton",d.setAttribute("data-bind","click: selectNE");i=document.createElement("input");i.type="button",i.value="SW",i.className="cesium-cesiumInspector-pickButton",i.setAttribute("data-bind","click: selectSW");u=document.createElement("input");u.type="button",u.value="SE",u.className="cesium-cesiumInspector-pickButton",u.setAttribute("data-bind","click: selectSE");s=document.createElement("div");s.className="cesium-cesiumInspector-tileText",e.className="cesium-cesiumInspector-frustumStatistics",e.appendChild(s),e.setAttribute("data-bind","visible: hasPickedTile"),s.setAttribute("data-bind","html: tileText");o=document.createElement("div");o.className="cesium-cesiumInspector-relativeText",o.textContent="Select relative:",e.appendChild(o);a=document.createElement("table"),h=document.createElement("tr"),s=document.createElement("tr"),o=document.createElement("td");o.appendChild(p);p=document.createElement("td");p.appendChild(n);n=document.createElement("td");n.appendChild(d),h.appendChild(o),h.appendChild(p),h.appendChild(n);p=document.createElement("td"),n=document.createElement("td");n.appendChild(i);i=document.createElement("td");i.appendChild(u),s.appendChild(p),s.appendChild(n),s.appendChild(i),a.appendChild(h),a.appendChild(s),e.appendChild(a),t.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),t.appendChild(l("Show only selected","filterTile","hasPickedTile")),c.appendChild(l("Wireframe","wireframe")),c.appendChild(l("Suspend LOD update","suspendUpdates")),c.appendChild(l("Show tile coordinates","tileCoordinates")),knockout.applyBindings(r,this._element)}function getDefaultSkyBoxUrl(e){return buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_"+e+".jpg")}function startRenderLoop(n){n._renderLoopRunning=!0;var a=0;requestAnimationFramePolyFill(function e(t){if(!n.isDestroyed())if(n._useDefaultRenderLoop)try{var i,r=n._targetFrameRate;defined(r)?(i=1e3/r)<(r=t-a)&&(n.resize(),n.render(),a=t-r%i):(n.resize(),n.render()),requestAnimationFramePolyFill(e)}catch(e){n._useDefaultRenderLoop=!1,n._renderLoopRunning=!1,n._showRenderLoopErrors&&n.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,e)}else n._renderLoopRunning=!1})}function configurePixelRatio(e){var t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,defined(e._scene)&&(e._scene.pixelRatio=t),t}function configureCanvasSize(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,n=configurePixelRatio(e);e._canvasClientWidth=i,e._canvasClientHeight=r,i*=n,r*=n,t.width=i,t.height=r,e._canRender=0!=i&&0!=r,e._lastDevicePixelRatio=window.devicePixelRatio}function configureCameraFrustum(e){var t=e._canvas,i=t.width,t=t.height;0!==i&&0!==t&&(defined((e=e._scene.camera.frustum).aspectRatio)?e.aspectRatio=i/t:(e.top=e.right*(t/i),e.bottom=-e.top))}function CesiumWidget(e,t){e=getElement(e),t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=document.createElement("div");i.className="cesium-widget",e.appendChild(i);var r=document.createElement("canvas"),n=FeatureDetection.supportsImageRenderingPixelated();function a(){r!==r.ownerDocument.activeElement&&r.ownerDocument.activeElement.blur()}(this._supportsImageRenderingPixelated=n)&&(r.style.imageRendering=FeatureDetection.imageRenderingValue()),r.oncontextmenu=function(){return!1},r.onselectstart=function(){return!1},r.addEventListener("mousedown",a),r.addEventListener("pointerdown",a),i.appendChild(r);var o=document.createElement("div");o.className="cesium-widget-credits";var s=defined(t.creditContainer)?getElement(t.creditContainer):i;s.appendChild(o);var l=defined(t.creditViewport)?getElement(t.creditViewport):i,c=defaultValue(t.showRenderLoopErrors,!0),n=defaultValue(t.useBrowserRecommendedResolution,!0);this._element=i,this._container=e,this._canvas=r,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=l,this._creditContainer=s,this._innerCreditContainer=o,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=c,this._resolutionScale=1,this._useBrowserRecommendedResolution=n,this._forceResize=!1,this._clock=defined(t.clock)?t.clock:new Clock,configureCanvasSize(this);try{var u=new Scene({canvas:r,contextOptions:t.contextOptions,creditContainer:o,creditViewport:l,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:defaultValue(t.scene3DOnly,!1),terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange});(this._scene=u).camera.constrainedAxis=Cartesian3.UNIT_Z,configurePixelRatio(this),configureCameraFrustum(this);var d=defaultValue(u.mapProjection.ellipsoid,Ellipsoid.WGS84),h=t.globe;!1!==(h=!defined(h)?new Globe(d):h)&&(u.globe=h,u.globe.shadows=defaultValue(t.terrainShadows,ShadowMode$1.RECEIVE_ONLY));h=t.skyBox;!1!==(h=!defined(h)?new SkyBox({sources:{positiveX:getDefaultSkyBoxUrl("px"),negativeX:getDefaultSkyBoxUrl("mx"),positiveY:getDefaultSkyBoxUrl("py"),negativeY:getDefaultSkyBoxUrl("my"),positiveZ:getDefaultSkyBoxUrl("pz"),negativeZ:getDefaultSkyBoxUrl("mz")}}):h)&&(u.skyBox=h,u.sun=new Sun,u.moon=new Moon);h=t.skyAtmosphere;!1!==(h=!defined(h)?new SkyAtmosphere(d):h)&&(u.skyAtmosphere=h);h=!1!==t.globe&&t.imageryProvider;!1!==(h=!defined(h)?createWorldImagery():h)&&u.imageryLayers.addImageryProvider(h),defined(t.terrainProvider)&&!1!==t.globe&&(u.terrainProvider=t.terrainProvider),this._screenSpaceEventHandler=new ScreenSpaceEventHandler(r),defined(t.sceneMode)&&(t.sceneMode===SceneMode$1.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===SceneMode$1.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=defaultValue(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;var p=this;this._onRenderError=function(e,t){p._useDefaultRenderLoop=!1,p._renderLoopRunning=!1,p._showRenderLoopErrors&&p.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)},u.renderError.addEventListener(this._onRenderError)}catch(e){throw c&&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:',e),e}}function FullscreenButtonViewModel(e,t){t=getElement(t=!defined(t)?document.body:t);var i=this,r=knockout.observable(Fullscreen.fullscreen),n=knockout.observable(Fullscreen.enabled),t=t.ownerDocument;this.isFullscreen=void 0,knockout.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,knockout.defineProperty(this,"isFullscreenEnabled",{get:function(){return n()},set:function(e){n(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=createCommand(function(){Fullscreen.fullscreen?Fullscreen.exitFullscreen():Fullscreen.requestFullscreen(i._fullscreenElement)},knockout.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=defaultValue(getElement(e),t.body),this._callback=function(){r(Fullscreen.fullscreen)},t.addEventListener(Fullscreen.changeEventName,this._callback)}Object.defineProperties(CesiumInspectorViewModel.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(){var e=this;return createCommand(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return createCommand(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return createCommand(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return createCommand(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return createCommand(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){var t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,defined(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,defined(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),(this._primitive=e).show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){var t;defined(e)?(this.hasPickedTile=!0,e!==this._tile&&(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,defined(t=e.data)&&defined(t.tileBoundingRegion)?this.tileText+="<br>Min: "+t.tileBoundingRegion.minimumHeight+" Max: "+t.tileBoundingRegion.maximumHeight:this.tileText+="<br>(Tile is not loaded)"),this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()):(this.hasPickedTile=!1,this._tile=void 0)}}}),CesiumInspectorViewModel.prototype._update=function(){this.frustums&&(this.frustumStatisticText=frustumStatisticsToString(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=boundDepthFrustum(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},CesiumInspectorViewModel.prototype.isDestroyed=function(){return!1},CesiumInspectorViewModel.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._globeDepthSubscription.dispose(),this._pickDepthSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),destroyObject(this)},Object.defineProperties(CesiumInspector.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),CesiumInspector.prototype.isDestroyed=function(){return!1},CesiumInspector.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),destroyObject(this)},Object.defineProperties(CesiumWidget.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}},camera:{get:function(){return this._scene.camera}},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)&&!this._renderLoopRunning&&startRenderLoop(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)}}}),CesiumWidget.prototype.showErrorPanel=function(e,t,i){var r=this._element,n=document.createElement("div");n.className="cesium-widget-errorPanel";var a=document.createElement("div");a.className="cesium-widget-errorPanel-content",n.appendChild(a);var o=document.createElement("div");o.className="cesium-widget-errorPanel-header",o.appendChild(document.createTextNode(e)),a.appendChild(o);var s=document.createElement("div");function l(){s.style.maxHeight=Math.max(Math.round(.9*r.clientHeight-100),30)+"px"}s.className="cesium-widget-errorPanel-scroll",a.appendChild(s),l(),defined(window.addEventListener)&&window.addEventListener("resize",l,!1);var c,u,d,h=defined(t),o=defined(i);(h||o)&&((p=document.createElement("div")).className="cesium-widget-errorPanel-message",s.appendChild(p),o&&(c=formatError(i),h||(t=formatError({name:(i="string"==typeof i?new Error(i):i).name,message:i.message}),c=i.stack),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+c),(u=document.createElement("div")).className="cesium-widget-errorPanel-message-details collapsed",(d=document.createElement("span")).className="cesium-widget-errorPanel-more-details",d.appendChild(document.createTextNode("See more...")),u.appendChild(d),u.onclick=function(e){u.removeChild(d),u.appendChild(document.createTextNode(c)),u.className="cesium-widget-errorPanel-message-details",a.className="cesium-widget-errorPanel-content expanded",u.onclick=void 0},s.appendChild(u)),p.innerHTML="<p>"+t+"</p>");var p=document.createElement("div");p.className="cesium-widget-errorPanel-buttonPanel",a.appendChild(p);t=document.createElement("button");t.setAttribute("type","button"),t.className="cesium-button",t.appendChild(document.createTextNode("OK")),t.onclick=function(){defined(l)&&defined(window.removeEventListener)&&window.removeEventListener("resize",l,!1),r.removeChild(n)},p.appendChild(t),r.appendChild(n)},CesiumWidget.prototype.isDestroyed=function(){return!1},CesiumWidget.prototype.destroy=function(){defined(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),destroyObject(this)},CesiumWidget.prototype.resize=function(){var e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,configureCanvasSize(this),configureCameraFrustum(this),this._scene.requestRender())},CesiumWidget.prototype.render=function(){var e;this._canRender?(this._scene.initializeFrame(),e=this._clock.tick(),this._scene.render(e)):this._clock.tick()},Object.defineProperties(FullscreenButtonViewModel.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),FullscreenButtonViewModel.prototype.isDestroyed=function(){return!1},FullscreenButtonViewModel.prototype.destroy=function(){document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};var enterFullScreenPath="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",exitFullScreenPath="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 FullscreenButton(e,t){var i=new FullscreenButtonViewModel(t,e=getElement(e));i._exitFullScreenPath=exitFullScreenPath,i._enterFullScreenPath=enterFullScreenPath;t=document.createElement("button");t.type="button",t.className="cesium-button cesium-fullscreenButton",t.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(t),knockout.applyBindings(i,t),this._container=e,this._viewModel=i,this._element=t}Object.defineProperties(FullscreenButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),FullscreenButton.prototype.isDestroyed=function(){return!1},FullscreenButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var DEFAULT_HEIGHT=1e3;function GeocoderViewModel(e){defined(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new CartographicGeocoderService,new IonGeocoderService({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new Event,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=handleArrowDown,this._handleArrowUp=handleArrowUp;var n=this;this._suggestionsVisible=knockout.pureComputed(function(){var e=0<knockout.getObservable(n,"_suggestions")().length,t=knockout.getObservable(n,"_showSuggestions")();return e&&t}),this._searchCommand=createCommand(function(e){return e=defaultValue(e,GeocodeType$1.SEARCH),n._focusTextbox=!1,defined(n._selectedSuggestion)?(n.activateSuggestion(n._selectedSuggestion),!1):(n.hideSuggestions(),void(n.isSearchInProgress?cancelGeocode(n):geocode(n,n._geocoderServices,e)))}),this.deselectSuggestion=function(){n._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(i||r)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,t="Enter"===t.key||13===t.keyCode;return r?handleArrowUp(n):i?handleArrowDown(n):t&&n._searchCommand(),!0},this.activateSuggestion=function(e){n.hideSuggestions(),n._searchText=e.displayName;e=e.destination;clearSuggestions(n),n.destinationFound(n,e)},this.hideSuggestions=function(){n._showSuggestions=!1,n._selectedSuggestion=void 0},this.showSuggestions=function(){n._showSuggestions=!0},this.handleMouseover=function(e,t){e!==n._selectedSuggestion&&(n._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=defaultValue(e.autocomplete,!0),this.destinationFound=defaultValue(e.destinationFound,GeocoderViewModel.flyToDestination),this._focusTextbox=!1,knockout.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);e=knockout.getObservable(this,"_searchText");e.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=e.subscribe(function(){GeocoderViewModel._updateSearchSuggestions(n)}),this.isSearchInProgress=void 0,knockout.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,knockout.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,knockout.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function handleArrowUp(e){var t;0!==e._suggestions.length&&(-1!==(t=e._suggestions.indexOf(e._selectedSuggestion))&&0!==t?(t=t-1,e._selectedSuggestion=e._suggestions[t],GeocoderViewModel._adjustSuggestionsScroll(e,t)):e._selectedSuggestion=void 0)}function handleArrowDown(e){var t;0!==e._suggestions.length&&(t=e._suggestions.length,t=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t,e._selectedSuggestion=e._suggestions[t],GeocoderViewModel._adjustSuggestionsScroll(e,t))}function computeFlyToLocationForCartographic(t,e){var i=defined(e)?e.availability:void 0;return defined(i)?sampleTerrainMostDetailed(e,[t]).then(function(e){return(t=e[0]).height+=DEFAULT_HEIGHT,t}):(t.height+=DEFAULT_HEIGHT,when.resolve(t))}function flyToDestination(e,t){var i,r=e._scene,n=r.mapProjection.ellipsoid,a=r.camera,o=r.terrainProvider,s=t;t instanceof Rectangle?CesiumMath.equalsEpsilon(t.south,t.north,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(t.east,t.west,CesiumMath.EPSILON7)?t=Rectangle.center(t):i=computeFlyToLocationForRectangle(t,r):t=n.cartesianToCartographic(t),(i=!defined(i)?computeFlyToLocationForCartographic(t,o):i).then(function(e){s=n.cartographicToCartesian(e)}).always(function(){a.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:Matrix4.IDENTITY})})}function chainPromise(e,t,i,r){return e.then(function(e){return defined(e)&&"fulfilled"===e.state&&0<e.value.length?e:t.geocode(i,r).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}})})}function geocode(i,e,t){var r=i._searchText;if(hasOnlyWhitespace(r))i.showSuggestions();else{i._isSearchInProgress=!0;for(var n=when.resolve(),a=0;a<e.length;a++)n=chainPromise(n,e[a],r,t);(i._geocodePromise=n).then(function(e){if(!n.cancel){i._isSearchInProgress=!1;var t=e.value;if("fulfilled"===e.state&&defined(t)&&0<t.length)return i._searchText=t[0].displayName,void i.destinationFound(i,t[0].destination);i._searchText=r+" (not found)"}})}}function adjustSuggestionsScroll(e,t){var i=getElement(e._viewContainer),e=i.getElementsByClassName("search-results")[0],i=i.getElementsByTagName("li")[t];0!==t?(t=i.offsetTop)+i.clientHeight>e.clientHeight?e.scrollTop=t+i.clientHeight:t<e.scrollTop&&(e.scrollTop=t):e.scrollTop=0}function cancelGeocode(e){e._isSearchInProgress=!1,defined(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function hasOnlyWhitespace(e){return/^\s*$/.test(e)}function clearSuggestions(e){knockout.getObservable(e,"_suggestions").removeAll()}function updateSearchSuggestions(r){var i,t;r.autoComplete&&(i=r._searchText,clearSuggestions(r),hasOnlyWhitespace(i)||(t=when.resolve([]),r._geocoderServices.forEach(function(e){t=t.then(function(t){return 5<=t.length?t:e.geocode(i,GeocodeType$1.AUTOCOMPLETE).then(function(e){return t=t.concat(e)})})}),t.then(function(e){for(var t=r._suggestions,i=0;i<e.length;i++)t.push(e[i])})))}Object.defineProperties(GeocoderViewModel.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}}}),GeocoderViewModel.prototype.destroy=function(){this._suggestionSubscription.dispose()},GeocoderViewModel.flyToDestination=flyToDestination,GeocoderViewModel._updateSearchSuggestions=updateSearchSuggestions,GeocoderViewModel._adjustSuggestionsScroll=adjustSuggestionsScroll;var startSearchPath="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",stopSearchPath="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 Geocoder(e){var i=getElement(e.container),r=new GeocoderViewModel(e);r._startSearchPath=startSearchPath,r._stopSearchPath=stopSearchPath;var t=document.createElement("form");t.setAttribute("data-bind","submit: search");var n=document.createElement("input");n.type="search",n.className="cesium-geocoder-input",n.setAttribute("placeholder","Enter an address or landmark..."),n.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(){n.select()},0)},n.addEventListener("focus",this._onTextBoxFocus,!1),t.appendChild(n),this._textBox=n;var a=document.createElement("span");a.className="cesium-geocoder-searchButton",a.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),t.appendChild(a),i.appendChild(t);var o=document.createElement("div");o.className="search-results",o.setAttribute("data-bind","visible: _suggestionsVisible");e=document.createElement("ul");e.setAttribute("data-bind","foreach: _suggestions");a=document.createElement("li");e.appendChild(a),a.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),o.appendChild(e),i.appendChild(o),knockout.applyBindings(r,t),knockout.applyBindings(r,o),this._container=i,this._searchSuggestionsContainer=o,this._viewModel=r,this._form=t,this._onInputBegin=function(e){var t=e.target;"function"==typeof e.composedPath&&(t=e.composedPath()[0]),i.contains(t)||(r._focusTextbox=!1,r.hideSuggestions())},this._onInputEnd=function(e){r._focusTextbox=!0,r.showSuggestions()},FeatureDetection.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),i.addEventListener("pointerup",this._onInputEnd,!0),i.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),i.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),i.addEventListener("touchend",this._onInputEnd,!0),i.addEventListener("touchcancel",this._onInputEnd,!0))}function HomeButtonViewModel(e,t){this._scene=e,this._duration=t;var i=this;this._command=createCommand(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",knockout.track(this,["tooltip"])}function HomeButton(e,t,i){e=getElement(e);t=new HomeButtonViewModel(t,i);t._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";i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-home-button",i.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(i),knockout.applyBindings(t,i),this._container=e,this._viewModel=t,this._element=i}Object.defineProperties(Geocoder.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),Geocoder.prototype.isDestroyed=function(){return!1},Geocoder.prototype.destroy=function(){var e=this._container;return FeatureDetection.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(),knockout.cleanNode(this._form),knockout.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),destroyObject(this)},Object.defineProperties(HomeButtonViewModel.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}}}),Object.defineProperties(HomeButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),HomeButton.prototype.isDestroyed=function(){return!1},HomeButton.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var cameraEnabledPath="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",cameraDisabledPath="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 InfoBoxViewModel(){this._cameraClicked=new Event,this._closeClicked=new Event,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",knockout.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,knockout.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?cameraDisabledPath:cameraEnabledPath}}),knockout.defineProperty(this,"_bodyless",{get:function(){return!defined(this.description)||0===this.description.length}})}function InfoBox(e){e=getElement(e);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(n);var t=document.createElement("div");t.className="cesium-infoBox-title",t.setAttribute("data-bind","text: titleText"),n.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-infoBox-camera",t.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-infoBox-close",t.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),t.innerHTML="×",n.appendChild(t);var a=document.createElement("iframe");a.className="cesium-infoBox-iframe",a.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),a.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),a.setAttribute("allowfullscreen",!0),n.appendChild(a);var i=new InfoBoxViewModel;knockout.applyBindings(i,n),this._container=e,this._element=n,this._frame=a,this._viewModel=i,this._descriptionSubscription=void 0;var o=this;a.addEventListener("load",function(){var e=a.contentDocument,t=e.createElement("link");t.href=buildModuleUrl("Widgets/InfoBox/InfoBoxDescription.css"),t.rel="stylesheet",t.type="text/css";var r=e.createElement("div");r.className="cesium-infoBox-description",e.head.appendChild(t),e.body.appendChild(r),o._descriptionSubscription=subscribeAndEvaluate(i,"description",function(e){a.style.height="5px",r.innerHTML=e;var t=null,i=r.firstElementChild;null===i||1!==r.childNodes.length||null!==(e=window.getComputedStyle(i))&&(i=e["background-color"],defined(i=Color.fromCssColorString(i))&&0!==i.alpha&&(t=e["background-color"])),n.style["background-color"]=t;t=r.getBoundingClientRect().height;a.style.height=t+"px"})}),a.setAttribute("src","about:blank")}function NavigationHelpButtonViewModel(){this.showInstructions=!1;var e=this;this._command=createCommand(function(){e.showInstructions=!e.showInstructions}),this._showClick=createCommand(function(){e._touch=!1}),this._showTouch=createCommand(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",knockout.track(this,["tooltip","showInstructions","_touch"])}function NavigationHelpButton(e){var t=getElement(e.container),i=new NavigationHelpButtonViewModel,r=defaultValue(e.instructionsInitiallyVisible,!1);i.showInstructions=r,i._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";var n=document.createElement("span");n.className="cesium-navigationHelpButton-wrapper",t.appendChild(n);var a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",a.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),n.appendChild(a);var o=document.createElement("div");o.className="cesium-navigation-help",o.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),n.appendChild(o);e=document.createElement("button");e.type="button",e.className="cesium-navigation-button cesium-navigation-button-left",e.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');r=document.createElement("img");r.src=buildModuleUrl("Widgets/Images/NavigationHelp/Mouse.svg"),r.className="cesium-navigation-button-icon",r.style.width="25px",r.style.height="25px",e.appendChild(r),e.appendChild(document.createTextNode("Mouse"));a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-right",a.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');r=document.createElement("img");r.src=buildModuleUrl("Widgets/Images/NavigationHelp/Touch.svg"),r.className="cesium-navigation-button-icon",r.style.width="25px",r.style.height="25px",a.appendChild(r),a.appendChild(document.createTextNode("Touch")),o.appendChild(e),o.appendChild(a);a=document.createElement("div");a.className="cesium-click-navigation-help cesium-navigation-help-instructions",a.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),a.innerHTML=' <table> <tr> <td><img src="'+buildModuleUrl("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="'+buildModuleUrl("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="'+buildModuleUrl("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>',o.appendChild(a);a=document.createElement("div");a.className="cesium-touch-navigation-help cesium-navigation-help-instructions",a.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),a.innerHTML=' <table> <tr> <td><img src="'+buildModuleUrl("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="'+buildModuleUrl("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="'+buildModuleUrl("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="'+buildModuleUrl("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>',o.appendChild(a),knockout.applyBindings(i,n),this._container=t,this._viewModel=i,this._wrapper=n,this._closeInstructions=function(e){n.contains(e.target)||(i.showInstructions=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}function PerformanceWatchdogViewModel(e){this._scene=e.scene,this.lowFrameRateMessage=defaultValue(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,knockout.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var t=this;this._dismissMessage=createCommand(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});e=FrameRateMonitor.fromScene(e.scene);this._unsubscribeLowFrameRate=e.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=e.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}function PerformanceWatchdog(e){var t=getElement(e.container),i=new PerformanceWatchdogViewModel(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");e=document.createElement("button");e.setAttribute("type","button"),e.className="cesium-performance-watchdog-message-dismiss",e.innerHTML="×",e.setAttribute("data-bind","click: dismissMessage"),r.appendChild(e);e=document.createElement("div");e.className="cesium-performance-watchdog-message",e.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(e),t.appendChild(r),knockout.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}function ProjectionPickerViewModel(e){this._scene=e,this._orthographic=e.camera.frustum instanceof OrthographicFrustum,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,knockout.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var n=this;knockout.defineProperty(this,"selectedTooltip",function(){return n._orthographic?n.tooltipOrthographic:n.tooltipPerspective}),this._toggleDropDown=createCommand(function(){n.sceneMode===SceneMode$1.SCENE2D||n._flightInProgress||(n.dropDownVisible=!n.dropDownVisible)}),this._eventHelper=new EventHelper,this._eventHelper.add(e.morphComplete,function(e,t,i,r){n.sceneMode=i,n._orthographic=i===SceneMode$1.SCENE2D||n._scene.camera.frustum instanceof OrthographicFrustum}),this._eventHelper.add(e.preRender,function(){n._flightInProgress=defined(e.camera._currentFlight)}),this._switchToPerspective=createCommand(function(){n.sceneMode!==SceneMode$1.SCENE2D&&(n._scene.camera.switchToPerspectiveFrustum(),n._orthographic=!1,n.dropDownVisible=!1)}),this._switchToOrthographic=createCommand(function(){n.sceneMode!==SceneMode$1.SCENE2D&&(n._scene.camera.switchToOrthographicFrustum(),n._orthographic=!0,n.dropDownVisible=!1)}),this._sceneMode=SceneMode$1}InfoBoxViewModel.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},Object.defineProperties(InfoBoxViewModel.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),Object.defineProperties(InfoBox.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),InfoBox.prototype.isDestroyed=function(){return!1},InfoBox.prototype.destroy=function(){var e=this._container;return knockout.cleanNode(this._element),e.removeChild(this._element),defined(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),destroyObject(this)},Object.defineProperties(NavigationHelpButtonViewModel.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),Object.defineProperties(NavigationHelpButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),NavigationHelpButton.prototype.isDestroyed=function(){return!1},NavigationHelpButton.prototype.destroy=function(){return FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)},Object.defineProperties(PerformanceWatchdogViewModel.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),PerformanceWatchdogViewModel.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),destroyObject(this)},Object.defineProperties(PerformanceWatchdog.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),PerformanceWatchdog.prototype.isDestroyed=function(){return!1},PerformanceWatchdog.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)},Object.defineProperties(ProjectionPickerViewModel.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}}}),ProjectionPickerViewModel.prototype.isDestroyed=function(){return!1},ProjectionPickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var perspectivePath="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",orthographicPath="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 ProjectionPicker(e,t){e=getElement(e);var i=new ProjectionPickerViewModel(t);i._perspectivePath=perspectivePath,i._orthographicPath=orthographicPath;var r=document.createElement("span");r.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(r);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button",t.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'),t.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --\x3e\x3c!-- /ko --\x3e',r.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",t.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 }'),r.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",t.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 }'),r.appendChild(t),knockout.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(e){r.contains(e.target)||(i.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function SceneModePickerViewModel(e,t){this._scene=e;var n=this;this._eventHelper=new EventHelper,this._eventHelper.add(e.morphStart,function(e,t,i,r){n.sceneMode=i,n.dropDownVisible=!1}),this._duration=defaultValue(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",knockout.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,knockout.defineProperty(this,"selectedTooltip",function(){var e=n.sceneMode;return e===SceneMode$1.SCENE2D?n.tooltip2D:e===SceneMode$1.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=createCommand(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=createCommand(function(){e.morphTo2D(n._duration)}),this._morphTo3D=createCommand(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=createCommand(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=SceneMode$1}Object.defineProperties(ProjectionPicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),ProjectionPicker.prototype.isDestroyed=function(){return!1},ProjectionPicker.prototype.destroy=function(){return this._viewModel.destroy(),FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)},Object.defineProperties(SceneModePickerViewModel.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}}}),SceneModePickerViewModel.prototype.isDestroyed=function(){return!1},SceneModePickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var globePath="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",flatMapPath="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",columbusViewPath="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 SceneModePicker(e,t,i){e=getElement(e);var r=new SceneModePickerViewModel(t,i);r._globePath=globePath,r._flatMapPath=flatMapPath,r._columbusViewPath=columbusViewPath;var n=document.createElement("span");n.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(n);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.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'),i.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --\x3e\x3c!-- /ko --\x3e',n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.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 }'),n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.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 }'),n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.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 }'),n.appendChild(i),knockout.applyBindings(r,n),this._viewModel=r,this._container=e,this._wrapper=n,this._closeDropDown=function(e){n.contains(e.target)||(r.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(SceneModePicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SceneModePicker.prototype.isDestroyed=function(){return!1},SceneModePicker.prototype.destroy=function(){return this._viewModel.destroy(),FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)};var screenSpacePos=new Cartesian2,offScreen="-1000px";function SelectionIndicatorViewModel(i,e,t){this._scene=i,this._screenPositionX=offScreen,this._screenPositionY=offScreen,this._tweens=i.tweens,this._container=defaultValue(t,document.body),this._selectionIndicatorElement=e,this._scale=1,this.position=void 0,this.showSelection=!1,knockout.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,knockout.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&defined(this.position)}}),knockout.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(e,t){return SceneTransforms.wgs84ToWindowCoordinates(i,e,t)}}function SelectionIndicator(e,t){e=getElement(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"svg:svg");n.setAttribute("width",160),n.setAttribute("height",160),n.setAttribute("viewBox","0 0 160 160");e=document.createElementNS(r,"g");e.setAttribute("transform","translate(80,80)"),n.appendChild(e);r=document.createElementNS(r,"path");r.setAttribute("data-bind","attr: { transform: _transform }"),r.setAttribute("d","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"),e.appendChild(r),i.appendChild(n);t=new SelectionIndicatorViewModel(t,this._element,this._container);this._viewModel=t,knockout.applyBindings(this._viewModel,this._element)}function TimelineHighlightRange(e,t,i){this._color=e,this._height=t,this._base=defaultValue(i,0)}function TimelineTrack(e,t,i,r){this.interval=e,this.height=t,this.color=i||new Color(.5,.5,.5,1),this.backgroundColor=r||new Color(0,0,0,0)}SelectionIndicatorViewModel.prototype.update=function(){var e,t,i,r,n;this.showSelection&&defined(this.position)&&(defined(e=this.computeScreenSpacePosition(this.position,screenSpacePos))?(t=(n=this._container).parentNode.clientWidth,i=n.parentNode.clientHeight,n=.5*(r=this._selectionIndicatorElement.clientWidth),e.x=Math.min(Math.max(e.x,-r),t+r)-n,e.y=Math.min(Math.max(e.y,-r),i+r)-n,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"):(this._screenPositionX=offScreen,this._screenPositionY=offScreen))},SelectionIndicatorViewModel.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:EasingFunction$1.EXPONENTIAL_OUT})},SelectionIndicatorViewModel.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:EasingFunction$1.EXPONENTIAL_OUT})},Object.defineProperties(SelectionIndicatorViewModel.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),Object.defineProperties(SelectionIndicator.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SelectionIndicator.prototype.isDestroyed=function(){return!1},SelectionIndicator.prototype.destroy=function(){var e=this._container;return knockout.cleanNode(this._element),e.removeChild(this._element),destroyObject(this)},TimelineHighlightRange.prototype.getHeight=function(){return this._height},TimelineHighlightRange.prototype.getBase=function(){return this._base},TimelineHighlightRange.prototype.getStartTime=function(){return this._start},TimelineHighlightRange.prototype.getStopTime=function(){return this._stop},TimelineHighlightRange.prototype.setRange=function(e,t){this._start=e,this._stop=t},TimelineHighlightRange.prototype.render=function(e){var t,i,r="";return this._start&&this._stop&&this._color&&(i=JulianDate.secondsDifference(this._start,e.epochJulian),t=Math.round(e.timeBarWidth*e.getAlpha(i)),i=JulianDate.secondsDifference(this._stop,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(i))-t,t<0&&(i+=t,t=0),0<(i=t+i>e.timeBarWidth?e.timeBarWidth-t:i)&&(r='<span class="cesium-timeline-highlight" style="left: '+t.toString()+"px; width: "+i.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')),r},TimelineTrack.prototype.render=function(e,t){var i=this.interval.start,r=this.interval.stop,n=t.startJulian,a=JulianDate.addSeconds(t.startJulian,t.duration,new JulianDate);if(JulianDate.lessThan(i,n)&&JulianDate.greaterThan(r,a))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(JulianDate.lessThanOrEquals(i,a)&&JulianDate.greaterThanOrEquals(r,n)){for(var o,s,l=0;l<t.timeBarWidth;++l){var c=JulianDate.addSeconds(t.startJulian,l/t.timeBarWidth*t.duration,new JulianDate);!defined(o)&&JulianDate.greaterThanOrEquals(c,i)?o=l:!defined(s)&&JulianDate.greaterThanOrEquals(c,r)&&(s=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),defined(o)&&(defined(s)||(s=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(o,t.y,Math.max(s-o,1),this.height))}};var timelineWheelDelta=1e12,timelineMouseMode={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},timelineTouchMode={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},timelineTicScales=[.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],timelineMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Timeline(e,t){var i=(e=getElement(e)).ownerDocument;this.container=e;var r=i.createElement("div");r.className="cesium-timeline-main",e.appendChild(r),this._topDiv=r,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=timelineMouseMode.none,this._touchMode=timelineTouchMode.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=createMouseDownCallback(this),this._onMouseUp=createMouseUpCallback(this),this._onMouseMove=createMouseMoveCallback(this),this._onMouseWheel=createMouseWheelCallback(this),this._onTouchStart=createTouchStartCallback(this),this._onTouchMove=createTouchMoveCallback(this),this._onTouchEnd=createTouchEndCallback(this);r=this._timeBarEle;i.addEventListener("mouseup",this._onMouseUp,!1),i.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function twoDigits(e){return e<10?"0"+e.toString():e.toString()}function createMouseDownCallback(t){return function(e){t._mouseMode!==timelineMouseMode.touchOnly&&(0===e.button?(t._mouseMode=timelineMouseMode.scrub,t._scrubElement&&(t._scrubElement.style.backgroundPosition="-16px 0"),t._onMouseMove(e)):(t._mouseX=e.clientX,2===e.button?t._mouseMode=timelineMouseMode.zoom:t._mouseMode=timelineMouseMode.slide)),e.preventDefault()}}function createMouseUpCallback(t){return function(e){t._mouseMode=timelineMouseMode.none,t._scrubElement&&(t._scrubElement.style.backgroundPosition="0 0"),t._timelineDrag=0,t._timelineDragLocation=void 0}}function createMouseMoveCallback(r){return function(e){var t,i;r._mouseMode===timelineMouseMode.scrub?(e.preventDefault(),(t=e.clientX-r._topDiv.getBoundingClientRect().left)<0?(r._timelineDragLocation=0,r._timelineDrag=-.01*r._timeBarSecondsSpan):t>r._topDiv.clientWidth?(r._timelineDragLocation=r._topDiv.clientWidth,r._timelineDrag=.01*r._timeBarSecondsSpan):(r._timelineDragLocation=void 0,r._setTimeBarTime(t,t*r._timeBarSecondsSpan/r._topDiv.clientWidth))):r._mouseMode===timelineMouseMode.slide?(i=r._mouseX-e.clientX,r._mouseX=e.clientX,0!==i&&(t=i*r._timeBarSecondsSpan/r._topDiv.clientWidth,r.zoomTo(JulianDate.addSeconds(r._startJulian,t,new JulianDate),JulianDate.addSeconds(r._endJulian,t,new JulianDate)))):r._mouseMode===timelineMouseMode.zoom&&(i=r._mouseX-e.clientX,r._mouseX=e.clientX,0!==i&&r.zoomFrom(Math.pow(1.01,i)))}}function createMouseWheelCallback(t){return function(e){e=e.wheelDeltaY||e.wheelDelta||-e.detail;e/=timelineWheelDelta=Math.max(Math.min(Math.abs(e),timelineWheelDelta),1),t.zoomFrom(Math.pow(1.05,-e))}}function createTouchStartCallback(n){return function(e){var t,i=e.touches.length,r=n._topDiv.getBoundingClientRect().left;e.preventDefault(),n._mouseMode=timelineMouseMode.touchOnly,1===i?(t=JulianDate.secondsDifference(n._scrubJulian,n._startJulian),t=Math.round(t*n._topDiv.clientWidth/n._timeBarSecondsSpan+r),Math.abs(e.touches[0].clientX-t)<50?(n._touchMode=timelineTouchMode.scrub,n._scrubElement&&(n._scrubElement.style.backgroundPosition=1===i?"-16px 0":"0 0")):(n._touchMode=timelineTouchMode.singleTap,n._touchState.centerX=e.touches[0].clientX-r)):2===i?(n._touchMode=timelineTouchMode.slideZoom,n._touchState.centerX=.5*(e.touches[0].clientX+e.touches[1].clientX)-r,n._touchState.spanX=Math.abs(e.touches[0].clientX-e.touches[1].clientX)):n._touchMode=timelineTouchMode.ignore}}function createTouchEndCallback(r){return function(e){var t=e.touches.length,i=r._topDiv.getBoundingClientRect().left;r._touchMode===timelineTouchMode.singleTap?(r._touchMode=timelineTouchMode.scrub,r._onTouchMove(e)):r._touchMode===timelineTouchMode.scrub&&r._onTouchMove(e),r._mouseMode=timelineMouseMode.touchOnly,1!==t?r._touchMode=0<t?timelineTouchMode.ignore:timelineTouchMode.none:r._touchMode===timelineTouchMode.slideZoom&&(r._touchState.centerX=e.touches[0].clientX-i),r._scrubElement&&(r._scrubElement.style.backgroundPosition="0 0")}}function createTouchMoveCallback(s){return function(e){var t,i,r,n,a=1,o=s._topDiv.getBoundingClientRect().left;s._touchMode===timelineTouchMode.singleTap&&(s._touchMode=timelineTouchMode.slideZoom),s._mouseMode=timelineMouseMode.touchOnly,s._touchMode===timelineTouchMode.scrub?(e.preventDefault(),1===e.changedTouches.length&&0<=(t=e.changedTouches[0].clientX-o)&&t<=s._topDiv.clientWidth&&s._setTimeBarTime(t,t*s._timeBarSecondsSpan/s._topDiv.clientWidth)):s._touchMode===timelineTouchMode.slideZoom&&(2===(t=e.touches.length)?(i=.5*(e.touches[0].clientX+e.touches[1].clientX)-o,r=Math.abs(e.touches[0].clientX-e.touches[1].clientX)):1===t&&(i=e.touches[0].clientX-o,r=0),defined(i)&&(n=0<r&&0<s._touchState.spanX?(a=s._touchState.spanX/r,JulianDate.addSeconds(s._startJulian,(s._touchState.centerX*s._timeBarSecondsSpan-i*s._timeBarSecondsSpan*a)/s._topDiv.clientWidth,new JulianDate)):(n=s._touchState.centerX-i,JulianDate.addSeconds(s._startJulian,n*s._timeBarSecondsSpan/s._topDiv.clientWidth,new JulianDate)),s.zoomTo(n,JulianDate.addSeconds(n,s._timeBarSecondsSpan*a,new JulianDate)),s._touchState.centerX=i,s._touchState.spanX=r))}}function lockScreen(e){var t=!1,i=window.screen;return defined(i)&&(defined(i.lockOrientation)?t=i.lockOrientation(e):defined(i.mozLockOrientation)?t=i.mozLockOrientation(e):defined(i.msLockOrientation)?t=i.msLockOrientation(e):defined(i.orientation&&i.orientation.lock)&&(t=i.orientation.lock(e))),t}function unlockScreen(){var e=window.screen;defined(e)&&(defined(e.unlockOrientation)?e.unlockOrientation():defined(e.mozUnlockOrientation)?e.mozUnlockOrientation():defined(e.msUnlockOrientation)?e.msUnlockOrientation():defined(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function toggleVR(e,t,i,r){r()||(i()?(t.useWebVR=!1,e._locked&&(unlockScreen(),e._locked=!1),e._noSleep.disable(),Fullscreen.exitFullscreen(),i(!1)):(Fullscreen.fullscreen||Fullscreen.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=lockScreen("landscape")),i(t.useWebVR=!0)))}function VRButtonViewModel(e,t){var i=this,r=knockout.observable(Fullscreen.enabled),n=knockout.observable(!1);this.isVRMode=void 0,knockout.defineProperty(this,"isVRMode",{get:function(){return n()}}),this.isVREnabled=void 0,knockout.defineProperty(this,"isVREnabled",{get:function(){return r()},set:function(e){r(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",function(){return r()?n()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});var a=knockout.observable(!1);this._isOrthographic=void 0,knockout.defineProperty(this,"_isOrthographic",{get:function(){return a()}}),this._eventHelper=new EventHelper,this._eventHelper.add(e.preRender,function(){a(e.camera.frustum instanceof OrthographicFrustum)}),this._locked=!1,this._noSleep=new NoSleep,this._command=createCommand(function(){toggleVR(i,e,n,a)},knockout.getObservable(this,"isVREnabled")),this._vrElement=defaultValue(getElement(t),document.body),this._callback=function(){!Fullscreen.fullscreen&&n()&&(e.useWebVR=!1,i._locked&&(unlockScreen(),i._locked=!1),i._noSleep.disable(),n(!1))},document.addEventListener(Fullscreen.changeEventName,this._callback)}Timeline.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},Timeline.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},Timeline.prototype.isDestroyed=function(){return!1},Timeline.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);var e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),destroyObject(this)},Timeline.prototype.addHighlightRange=function(e,t,i){i=new TimelineHighlightRange(e,t,i);return this._highlightRanges.push(i),this.resize(),i},Timeline.prototype.addTrack=function(e,t,i,r){r=new TimelineTrack(e,t,i,r);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r},Timeline.prototype.zoomTo=function(e,t){var i,r;this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=JulianDate.secondsDifference(t,e),this._clock&&this._clock.clockRange!==ClockRange$1.UNBOUNDED&&(i=this._clock.startTime,n=this._clock.stopTime,r=JulianDate.secondsDifference(n,i),t=JulianDate.secondsDifference(i,this._startJulian),e=JulianDate.secondsDifference(n,this._endJulian),this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):0<t?(this._endJulian=JulianDate.addSeconds(this._endJulian,t,new JulianDate),this._startJulian=i,this._timeBarSecondsSpan=JulianDate.secondsDifference(this._endJulian,this._startJulian)):e<0&&(this._startJulian=JulianDate.addSeconds(this._startJulian,e,new JulianDate),this._endJulian=n,this._timeBarSecondsSpan=JulianDate.secondsDifference(this._endJulian,this._startJulian))),this._makeTics();var 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)},Timeline.prototype.zoomFrom=function(e){var t=JulianDate.secondsDifference(this._scrubJulian,this._startJulian);1<e||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(JulianDate.addSeconds(this._startJulian,t-t*e,new JulianDate),JulianDate.addSeconds(this._endJulian,i*e-i,new JulianDate))},Timeline.prototype.makeLabel=function(e){var t=JulianDate.toGregorianDate(e),e=t.millisecond,i=" UTC";if(0<e&&this._timeBarSecondsSpan<3600){for(i=Math.floor(e).toString();i.length<3;)i="0"+i;i="."+i}return timelineMonthNames[t.month-1]+" "+t.day+" "+t.year+" "+twoDigits(t.hour)+":"+twoDigits(t.minute)+":"+twoDigits(t.second)+i},Timeline.prototype.smallestTicInPixels=7,Timeline.prototype._makeTics=function(){var e=this._timeBarEle,t=JulianDate.secondsDifference(this._scrubJulian,this._startJulian),i=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),r=i-8,n=this;this._needleEle.style.left=i.toString()+"px";var a="",t=31536e6,o=0,s=this._timeBarSecondsSpan;s<.01?(s=.01,this._timeBarSecondsSpan=.01,this._endJulian=JulianDate.addSeconds(this._startJulian,.01,new JulianDate)):t<s&&(s=t,this._timeBarSecondsSpan=t,this._endJulian=JulianDate.addSeconds(this._startJulian,t,new JulianDate));var l=this._timeBarEle.clientWidth;l<10&&(l=10);var c=this._startJulian,i=Math.min(s/l*1e-5,.4),t=JulianDate.toGregorianDate(c),t=31536e4<s?JulianDate.fromDate(new Date(Date.UTC(100*Math.floor(t.year/100),0))):31536e3<s?JulianDate.fromDate(new Date(Date.UTC(10*Math.floor(t.year/10),0))):86400<s?JulianDate.fromDate(new Date(Date.UTC(t.year,0))):JulianDate.fromDate(new Date(Date.UTC(t.year,t.month,t.day))),u=JulianDate.secondsDifference(this._startJulian,JulianDate.addSeconds(t,i,new JulianDate)),d=u+s;function h(e){return Math.floor(u/e)*e}function p(e,t){return Math.ceil(e/t+.5)*t}function m(e){return(e-u)/s}function f(e,t){return e-t*Math.round(e/t)}this._epochJulian=t,this._rulerEle.innerHTML=this.makeLabel(JulianDate.addSeconds(this._endJulian,-.01,new JulianDate));var g=this._rulerEle.offsetWidth+20;g<30&&(g=180);i=o;o-=1e-10;var _={startTime:u,startJulian:c,epochJulian:t,duration:s,timeBarWidth:l,getAlpha:m};this._highlightRanges.forEach(function(e){a+=e.render(_)});var y=0,C=0,v=0,S=g/l;1<S&&(S=1),S*=this._timeBarSecondsSpan;for(var T=-1,x=-1,b=timelineTicScales.length,E=0;E<b;++E){var P=timelineTicScales[E];if(++T,S<(y=P)&&o<P)break;x<0&&l*(P/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(x=T)}if(0<T){for(;0<T;)if(--T,Math.abs(f(y,timelineTicScales[T]))<1e-5){timelineTicScales[T]>=o&&(C=timelineTicScales[T]);break}if(0<=x)for(;x<T;){if(Math.abs(f(C,timelineTicScales[x]))<1e-5&&timelineTicScales[x]>=o){v=timelineTicScales[x];break}++x}}1e-10<(o=i)&&v<1e-5&&1e-10<Math.abs(o-y)&&(v=o)<=y+1e-10&&(C=0);var A=-999999;if(3<=l*(v/this._timeBarSecondsSpan))for(w=h(v);w<=d;w=p(w,v))a+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(l*m(w)).toString()+'px;"></span>';if(3<=l*(C/this._timeBarSecondsSpan))for(w=h(C);w<=d;w=p(w,C))a+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(l*m(w)).toString()+'px;"></span>';if(2<=l*(y/this._timeBarSecondsSpan)){d+=this._mainTicSpan=y;for(var w=h(y),D=JulianDate.computeTaiMinusUtc(t);w<=d;){var M,I=JulianDate.addSeconds(c,w-u,new JulianDate);2.1<y&&(M=JulianDate.computeTaiMinusUtc(I),.1<Math.abs(M-D)&&(w+=M-D,I=JulianDate.addSeconds(c,w-u,new JulianDate)));var R=Math.round(l*m(w)),O=this.makeLabel(I);this._rulerEle.innerHTML=O;I=R-((M=(M=this._rulerEle.offsetWidth)<10?g:M)/2-1);A<I?(A=I+M+5,a+='<span class="cesium-timeline-ticMain" style="left: '+R.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+I.toString()+'px;">'+O+"</span>"):a+='<span class="cesium-timeline-ticSub" style="left: '+R.toString()+'px;"></span>',w=p(w,y)}}else this._mainTicSpan=-1;a+='<span class="cesium-timeline-icon16" style="left:'+r+'px;bottom:0;background-position: 0 0;"></span>',e.innerHTML=a,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),_.y=0,this._trackList.forEach(function(e){e.render(n._context,_),_.y+=e.height})},Timeline.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e,t=this._scrubElement;defined(this._scrubElement)&&(e=JulianDate.secondsDifference(this._scrubJulian,this._startJulian),e=Math.round(e*this._topDiv.clientWidth/this._timeBarSecondsSpan),this._lastXPos!==e&&(this._lastXPos=e,t.style.left=e-8+"px",this._needleEle.style.left=e+"px")),defined(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(JulianDate.addSeconds(this._startJulian,this._timelineDrag,new JulianDate),JulianDate.addSeconds(this._endJulian,this._timelineDrag,new JulianDate)))},Timeline.prototype._setTimeBarTime=function(e,t){e=Math.round(e),this._scrubJulian=JulianDate.addSeconds(this._startJulian,t,new JulianDate),this._scrubElement&&(i=e-8,this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px");var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},Timeline.prototype.resize=function(){var t,e=this.container.clientWidth,i=this.container.clientHeight;e===this._lastWidth&&i===this._lastHeight||(this._trackContainer.style.height=i+"px",t=1,this._trackList.forEach(function(e){t+=e.height}),this._trackListEle.style.height=t.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=t,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=i)},Object.defineProperties(VRButtonViewModel.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),VRButtonViewModel.prototype.isDestroyed=function(){return!1},VRButtonViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};var enterVRPath="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",exitVRPath="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 VRButton(e,t,i){e=getElement(e);t=new VRButtonViewModel(t,i);t._exitVRPath=exitVRPath,t._enterVRPath=enterVRPath;i=document.createElement("button");i.type="button",i.className="cesium-button cesium-vrButton",i.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(i),knockout.applyBindings(t,i),this._container=e,this._viewModel=t,this._element=i}Object.defineProperties(VRButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),VRButton.prototype.isDestroyed=function(){return!1},VRButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var boundingSphereScratch=new BoundingSphere;function onTimelineScrubfunction(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function getCesium3DTileFeatureDescription(i){var e=i.getPropertyNames(),r="";return e.forEach(function(e){var t=i.getProperty(e);defined(t)&&(r+="<tr><th>"+e+"</th><td>"+t+"</td></tr>")}),r=0<r.length?'<table class="cesium-infoBox-defaultTable"><tbody>'+r+"</tbody></table>":r}function getCesium3DTileFeatureName(e){for(var t=[],i=e.getPropertyNames(),r=0;r<i.length;r++){var n=i[r];/^name$/i.test(n)?t[0]=e.getProperty(n):/name/i.test(n)?t[1]=e.getProperty(n):/^title$/i.test(n)?t[2]=e.getProperty(n):/^(id|identifier)$/i.test(n)?t[3]=e.getProperty(n):/element/i.test(n)?t[4]=e.getProperty(n):/(id|identifier)$/i.test(n)&&(t[5]=e.getProperty(n))}var a=t.length;for(r=0;r<a;r++){var o=t[r];if(defined(o)&&""!==o)return o}return"Unnamed Feature"}function pickEntity(e,t){var i=e.scene.pick(t.position);if(defined(i)){var r=defaultValue(i.id,i.primitive.id);if(r instanceof Entity)return r;if(i instanceof Cesium3DTileFeature)return new Entity({name:getCesium3DTileFeatureName(i),description:getCesium3DTileFeatureDescription(i),feature:i})}if(defined(e.scene.globe))return pickImageryLayerFeature(e,t.position)}function trackDataSourceClock(e,t,i){!defined(i)||defined(i=i.clock)&&(i.getValue(t),defined(e)&&(e.updateFromClock(),e.zoomTo(i.startTime,i.stopTime)))}var cartesian3Scratch=new Cartesian3;function pickImageryLayerFeature(i,e){var t=i.scene,e=t.camera.getPickRay(e),t=t.imageryLayers.pickImageryLayerFeatures(e,t);if(defined(t)){var r=new Entity({id:"Loading...",description:"Loading feature information..."});return when(t,function(e){var t;i.selectedEntity===r&&(defined(e)&&0!==e.length?(e=new Entity({id:(t=e[0]).name,description:t.description}),defined(t.position)&&(t=i.scene.globe.ellipsoid.cartographicToCartesian(t.position,cartesian3Scratch),e.position=new ConstantPositionProperty(t)),i.selectedEntity=e):i.selectedEntity=createNoFeaturesEntity())},function(){i.selectedEntity===r&&(i.selectedEntity=createNoFeaturesEntity())}),r}}function createNoFeaturesEntity(){return new Entity({id:"None",description:"No features found."})}function enableVRUI(e,t){var i=e._geocoder,r=e._homeButton,n=e._sceneModePicker,a=e._projectionPicker,o=e._baseLayerPicker,s=e._animation,l=e._timeline,c=e._fullscreenButton,u=e._infoBox,d=e._selectionIndicator,h=t?"hidden":"visible";defined(i)&&(i.container.style.visibility=h),defined(r)&&(r.container.style.visibility=h),defined(n)&&(n.container.style.visibility=h),defined(a)&&(a.container.style.visibility=h),defined(o)&&(o.container.style.visibility=h),defined(s)&&(s.container.style.visibility=h),defined(l)&&(l.container.style.visibility=h),defined(c)&&c.viewModel.isFullscreenEnabled&&(c.container.style.visibility=h),defined(u)&&(u.container.style.visibility=h),defined(d)&&(d.container.style.visibility=h),e._container&&(c=t||!defined(c)?0:c.container.clientWidth,e._vrButton.container.style.right=c+"px",e.forceResize())}function Viewer(e,t){e=getElement(e);var i=!(defined((t=defaultValue(t,defaultValue.EMPTY_OBJECT)).globe)&&!1===t.globe||defined(t.baseLayerPicker)&&!1===t.baseLayerPicker),r=this,n=document.createElement("div");n.className="cesium-viewer",e.appendChild(n);var a=document.createElement("div");a.className="cesium-viewer-cesiumWidgetContainer",n.appendChild(a);var o=document.createElement("div");o.className="cesium-viewer-bottom",n.appendChild(o);var s,l,c=defaultValue(t.scene3DOnly,!1),u=!1;defined(t.clockViewModel)?s=(l=t.clockViewModel).clock:(l=new ClockViewModel(s=new Clock),u=!0),defined(t.shouldAnimate)&&(s.shouldAnimate=t.shouldAnimate);var d=new CesiumWidget(a,{imageryProvider:!i&&!defined(t.imageryProvider)&&void 0,clock:s,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:defined(t.creditContainer)?t.creditContainer:o,creditViewport:t.creditViewport,scene3DOnly:c,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange}),h=t.dataSources,p=!1;defined(h)||(h=new DataSourceCollection,p=!0);var m,f,g=d.scene,_=new DataSourceDisplay({scene:g,dataSourceCollection:h}),a=new EventHelper;a.add(s.onTick,Viewer.prototype._onTick,this),a.add(g.morphStart,Viewer.prototype._clearTrackedObject,this),defined(t.selectionIndicator)&&!1===t.selectionIndicator||((m=document.createElement("div")).className="cesium-viewer-selectionIndicatorContainer",n.appendChild(m),m=new SelectionIndicator(m,g)),defined(t.infoBox)&&!1===t.infoBox||((B=document.createElement("div")).className="cesium-viewer-infoBoxContainer",n.appendChild(B),C=(f=new InfoBox(B)).viewModel,a.add(C.cameraClicked,Viewer.prototype._onInfoBoxCameraClicked,this),a.add(C.closeClicked,Viewer.prototype._onInfoBoxClockClicked,this));var y,C,v,S,T,x,b,E,P,A,w,D,M,I,R,O,L,F,N,B=document.createElement("div");if(B.className="cesium-viewer-toolbar",n.appendChild(B),defined(t.geocoder)&&!1===t.geocoder||((C=document.createElement("div")).className="cesium-viewer-geocoderContainer",B.appendChild(C),defined(t.geocoder)&&"boolean"!=typeof t.geocoder&&(v=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),y=new Geocoder({container:C,geocoderServices:v,scene:g}),a.add(y.viewModel.search.beforeExecute,Viewer.prototype._clearObjects,this)),defined(t.homeButton)&&!1===t.homeButton||(S=new HomeButton(B,g),defined(y)&&a.add(S.viewModel.command.afterExecute,function(){var e=y.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),a.add(S.viewModel.command.beforeExecute,Viewer.prototype._clearTrackedObject,this)),c||defined(t.sceneModePicker)&&!1===t.sceneModePicker||(T=new SceneModePicker(B,g)),t.projectionPicker&&(x=new ProjectionPicker(B,g)),i&&(b=defaultValue(t.imageryProviderViewModels,createDefaultImageryProviderViewModels()),E=defaultValue(t.terrainProviderViewModels,createDefaultTerrainProviderViewModels()),b=new BaseLayerPicker(B,{globe:g.globe,imageryProviderViewModels:b,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:E,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),E=B.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]),defined(t.imageryProvider)&&!1!==t.imageryProvider&&(i&&(b.viewModel.selectedImagery=void 0),g.imageryLayers.removeAll(),g.imageryLayers.addImageryProvider(t.imageryProvider)),defined(t.terrainProvider)&&(i&&(b.viewModel.selectedTerrain=void 0),g.terrainProvider=t.terrainProvider),!defined(t.navigationHelpButton)||!1!==t.navigationHelpButton){var V,k=!0;try{defined(window.localStorage)&&(defined(V=window.localStorage.getItem("cesium-hasSeenNavHelp"))&&Boolean(V)?k=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true"))}catch(e){}P=new NavigationHelpButton({container:B,instructionsInitiallyVisible:defaultValue(t.navigationInstructionsInitiallyVisible,k)})}defined(t.animation)&&!1===t.animation||((D=document.createElement("div")).className="cesium-viewer-animationContainer",n.appendChild(D),A=new Animation(D,new AnimationViewModel(l))),defined(t.timeline)&&!1===t.timeline||((D=document.createElement("div")).className="cesium-viewer-timelineContainer",n.appendChild(D),(w=new Timeline(D,s)).addEventListener("settime",onTimelineScrubfunction,!1),w.zoomTo(s.startTime,s.stopTime)),defined(t.fullscreenButton)&&!1===t.fullscreenButton||((R=document.createElement("div")).className="cesium-viewer-fullscreenContainer",n.appendChild(R),I=subscribeAndEvaluate((M=new FullscreenButton(R,t.fullscreenElement)).viewModel,"isFullscreenEnabled",function(e){R.style.display=e?"block":"none",defined(w)&&(w.container.style.right=R.clientWidth+"px",w.resize())})),t.vrButton&&((N=document.createElement("div")).className="cesium-viewer-vrContainer",n.appendChild(N),L=subscribeAndEvaluate((O=new VRButton(N,g,t.fullScreenElement)).viewModel,"isVREnabled",function(e){N.style.display=e?"block":"none",defined(M)&&(N.style.right=R.clientWidth+"px"),defined(w)&&(w.container.style.right=N.clientWidth+"px",w.resize())}),F=subscribeAndEvaluate(O.viewModel,"isVRMode",function(e){enableVRUI(r,e)})),this._baseLayerPickerDropDown=E,this._fullscreenSubscription=I,this._vrSubscription=L,this._vrModeSubscription=F,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=defaultValue(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=o,this._element=n,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=f,this._dataSourceCollection=h,this._destroyDataSourceCollection=p,this._dataSourceDisplay=_,this._clockViewModel=l,this._destroyClockViewModel=u,this._toolbar=B,this._homeButton=S,this._sceneModePicker=T,this._projectionPicker=x,this._baseLayerPicker=b,this._navigationHelpButton=P,this._animation=A,this._timeline=w,this._fullscreenButton=M,this._vrButton=O,this._geocoder=y,this._eventHelper=a,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=defined(f)||defined(m),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new Event,this._trackedEntityChanged=new Event,knockout.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),a.add(h.dataSourceAdded,Viewer.prototype._onDataSourceAdded,this),a.add(h.dataSourceRemoved,Viewer.prototype._onDataSourceRemoved,this),a.add(g.postUpdate,Viewer.prototype.resize,this),a.add(g.postRender,Viewer.prototype._postRender,this);for(var z=h.length,$=0;$<z;$++)this._dataSourceAdded(h,h.get($));this._dataSourceAdded(void 0,_.defaultDataSource),a.add(h.dataSourceAdded,Viewer.prototype._dataSourceAdded,this),a.add(h.dataSourceRemoved,Viewer.prototype._dataSourceRemoved,this),d.screenSpaceEventHandler.setInputAction(function(e){r.selectedEntity=pickEntity(r,e)},ScreenSpaceEventType$1.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(function(e){defined(e=pickEntity(r,e))?Property.getValueOrUndefined(e.position,r.clock.currentTime)?r.trackedEntity=e:r.zoomTo(e):defined(r.trackedEntity)&&(r.trackedEntity=void 0)},ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK)}function zoomToOrFly(i,e,t,r){cancelZoom(i);var n=when.defer();return i._zoomPromise=n,i._zoomIsFlight=r,i._zoomOptions=t,when(e,function(e){var t;i._zoomPromise===n&&(e instanceof ImageryLayer?e.getViewableRectangle().then(function(e){return computeFlyToLocationForRectangle(e,i.scene)}).then(function(e){i._zoomPromise===n&&(i._zoomTarget=e)}):e instanceof Cesium3DTileset||e instanceof TimeDynamicPointCloud?i._zoomTarget=e:e.isLoading&&defined(e.loadingEvent)?t=e.loadingEvent.addEventListener(function(){t(),i._zoomPromise===n&&(i._zoomTarget=e.entities.values.slice(0))}):Array.isArray(e)?i._zoomTarget=e.slice(0):(defined((e=defaultValue(e.values,e)).entities)&&(e=e.entities.values),Array.isArray(e)?i._zoomTarget=e.slice(0):i._zoomTarget=[e]))}),i.scene.requestRender(),n.promise}function clearZoom(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function cancelZoom(e){var t=e._zoomPromise;defined(t)&&(clearZoom(e),t.resolve(!1))}function updateZoomTarget(t){var i=t._zoomTarget;if(defined(i)&&t.scene.mode!==SceneMode$1.MORPHING){var r,e=t.scene,n=e.camera,a=t._zoomPromise,o=defaultValue(t._zoomOptions,{});if(i instanceof Cesium3DTileset)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(o.offset)||(o.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyToBoundingSphere(i.boundingSphere,r):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),a.resolve(!0)),clearZoom(t)});if(i instanceof TimeDynamicPointCloud)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(o.offset)||(o.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyToBoundingSphere(e,r):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),a.resolve(!0)),clearZoom(t)});if(i instanceof Cartographic)return r={destination:e.mapProjection.ellipsoid.cartographicToCartesian(i),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyTo(r):(n.setView(r),a.resolve(!0)),void clearZoom(t);for(var s=i,l=[],c=0,u=s.length;c<u;c++){var d=t._dataSourceDisplay.getBoundingSphere(s[c],!1,boundingSphereScratch);if(d===BoundingSphereState$1.PENDING)return;d!==BoundingSphereState$1.FAILED&&l.push(BoundingSphere.clone(boundingSphereScratch))}0!==l.length?(t.trackedEntity=void 0,e=BoundingSphere.fromBoundingSpheres(l),t._zoomIsFlight?(clearZoom(t),n.flyToBoundingSphere(e,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)},offset:o.offset})):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),clearZoom(t),a.resolve(!0))):cancelZoom(t)}}function updateTrackedEntity(e){var t,i,r,n,a;e._needTrackedEntityUpdate&&(t=e._trackedEntity,i=e.clock.currentTime,defined(Property.getValueOrUndefined(t.position,i))&&(r=e.scene,(a=e._dataSourceDisplay.getBoundingSphere(t,!1,boundingSphereScratch))!==BoundingSphereState$1.PENDING&&((n=r.mode)!==SceneMode$1.COLUMBUS_VIEW&&n!==SceneMode$1.SCENE2D||(r.screenSpaceCameraController.enableTranslate=!1),n!==SceneMode$1.COLUMBUS_VIEW&&n!==SceneMode$1.SCENE3D||(r.screenSpaceCameraController.enableTilt=!1),a=a!==BoundingSphereState$1.FAILED?boundingSphereScratch:void 0,e._entityView=new EntityView(t,r,r.mapProjection.ellipsoid),e._entityView.update(i,a),e._needTrackedEntityUpdate=!1)))}function viewerCesium3DTilesInspectorMixin(e){var t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);var i=new Cesium3DTilesInspector(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return i}}})}function viewerCesiumInspectorMixin(e){var t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);var i=new CesiumInspector(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return i}}})}function viewerDragDropMixin(o,e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=!0,i=defaultValue(e.flyToOnDrop,!0),r=new Event,s=defaultValue(e.clearOnDrop,!0),n=defaultValue(e.dropTarget,o.container),l=defaultValue(e.clampToGround,!0),c=e.proxy;function a(e){stop(e),s&&(o.entities.removeAll(),o.dataSources.removeAll());for(var t=e.dataTransfer.files,i=t.length,r=0;r<i;r++){var n=t[r],a=new FileReader;a.onload=createOnLoadCallback(o,n,c,l),a.onerror=createDropErrorCallback(o,n),a.readAsText(n)}}n=getElement(n),Object.defineProperties(o,{dropTarget:{get:function(){return n},set:function(e){unsubscribe(n,a),subscribe(n=e,a)}},dropEnabled:{get:function(){return t},set:function(e){e!==t&&((e?subscribe:unsubscribe)(n,a),t=e)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return s},set:function(e){s=e}},flyToOnDrop:{get:function(){return i},set:function(e){i=e}},proxy:{get:function(){return c},set:function(e){c=e}},clampToGround:{get:function(){return l},set:function(e){l=e}}}),subscribe(n,a),o.destroy=wrapFunction(o,o.destroy,function(){o.dropEnabled=!1}),o._handleDrop=a}function stop(e){e.stopPropagation(),e.preventDefault()}function unsubscribe(e,t){defined(e)&&(e.removeEventListener("drop",t,!1),e.removeEventListener("dragenter",stop,!1),e.removeEventListener("dragover",stop,!1),e.removeEventListener("dragexit",stop,!1))}function subscribe(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",stop,!1),e.addEventListener("dragover",stop,!1),e.addEventListener("dragexit",stop,!1)}function createOnLoadCallback(r,n,a,o){var s=r.scene;return function(e){var t,i=n.name;try{if(/\.czml$/i.test(i))t=CzmlDataSource.load(JSON.parse(e.target.result),{sourceUri:i});else if(/\.geojson$/i.test(i)||/\.json$/i.test(i)||/\.topojson$/i.test(i))t=GeoJsonDataSource.load(JSON.parse(e.target.result),{sourceUri:i,clampToGround:o});else{if(!/\.(kml|kmz)$/i.test(i))return void r.dropError.raiseEvent(r,i,"Unrecognized file: "+i);t=KmlDataSource.load(n,{sourceUri:i,proxy:a,camera:s.camera,canvas:s.canvas,clampToGround:o})}defined(t)&&r.dataSources.add(t).then(function(e){r.flyToOnDrop&&r.flyTo(e)}).otherwise(function(e){r.dropError.raiseEvent(r,i,e)})}catch(e){r.dropError.raiseEvent(r,i,e)}}}function createDropErrorCallback(t,i){return function(e){t.dropError.raiseEvent(t,i.name,e.target.error)}}function viewerPerformanceWatchdogMixin(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=new PerformanceWatchdog({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return i}}})}function callAndWrap(e,t,i){try{return e(t,i)}catch(e){return when.reject(e)}}function createTaskProcessorWorker(n){var a;return function(e){var t=e.data,i=[],r={id:t.id,result:void 0,error:void 0};return when(callAndWrap(n,t.parameters,i)).then(function(e){r.result=e}).otherwise(function(e){e instanceof Error?r.error={name:e.name,message:e.message,stack:e.stack}:r.error=e}).always(function(){defined(a)||(a=defaultValue(self.webkitPostMessage,self.postMessage)),t.canTransferArrayBuffer||(i.length=0);try{a(r,i)}catch(e){r.result=void 0,r.error="postMessage failed with error: "+formatError(e)+"\n with responseMessage: "+JSON.stringify(r),a(r)}})}}Object.defineProperties(Viewer.prototype,{container:{get:function(){return this._container}},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._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},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}},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._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){var t,i;this._trackedEntity!==e&&(this._trackedEntity=e,cancelZoom(this),i=(t=this.scene).mode,defined(e)&&defined(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(Matrix4.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender())}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){var t;this._selectedEntity!==e&&(this._selectedEntity=e,t=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0,defined(e)?defined(t)&&t.animateAppear():defined(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e))}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,trackDataSourceClock(this._timeline,this.clock,e))}}}),Viewer.prototype.extend=function(e,t){e(this,t)},Viewer.prototype.resize=function(){var e,t,i,r,n=this._cesiumWidget,a=this._container,o=a.clientWidth,s=a.clientHeight,l=defined(this._animation),c=defined(this._timeline);n.resize(),o===this._lastWidth&&s===this._lastHeight||(r=s-125,defined(e=this._baseLayerPickerDropDown)&&(e.style.maxHeight=r+"px"),defined(this._geocoder)&&(this._geocoder.searchSuggestionsContainer.style.maxHeight=r+"px"),defined(this._infoBox)&&(this._infoBox.viewModel.maxHeight=r),a=this._timeline,r=e=n=0,l&&"hidden"!==window.getComputedStyle(this._animation.container).visibility&&(t=this._lastWidth,i=this._animation.container,900<o?(n=169,t<=900&&(i.style.width="169px",i.style.height="112px",this._animation.resize())):600<=o?(n=136,(t<600||900<t)&&(i.style.width="136px",i.style.height="90px",this._animation.resize())):(n=106,(600<t||0===t)&&(i.style.width="106px",i.style.height="70px",this._animation.resize())),e=n+5),c&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility&&(l=this._fullscreenButton,t=this._vrButton,c=(i=a.container).style,r=i.clientHeight+3,c.left=n+"px",n=0,defined(l)&&(n+=l.container.clientWidth),defined(t)&&(n+=t.container.clientWidth),c.right=n+"px",a.resize()),this._bottomContainer.style.left=e+"px",this._bottomContainer.style.bottom=r+"px",this._lastWidth=o,this._lastHeight=s)},Viewer.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Viewer.prototype.render=function(){this._cesiumWidget.render()},Viewer.prototype.isDestroyed=function(){return!1},Viewer.prototype.destroy=function(){this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK);for(var e=this.dataSources,t=e.length,i=0;i<t;i++)this._dataSourceRemoved(e,e.get(i));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),defined(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),defined(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),defined(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),defined(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),defined(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),defined(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),defined(this._timeline)&&(this._timeline.removeEventListener("settime",onTimelineScrubfunction,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),defined(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),defined(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),defined(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),defined(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),destroyObject(this)},Viewer.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Viewer.prototype._onEntityCollectionChanged,this)},Viewer.prototype._dataSourceRemoved=function(e,t){t=t.entities;t.collectionChanged.removeEventListener(Viewer.prototype._onEntityCollectionChanged,this),defined(this.trackedEntity)&&t.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),defined(this.selectedEntity)&&t.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Viewer.prototype._onTick=function(e){var t=e.currentTime,i=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=i);var r,n=this._entityView;defined(n)&&(a=this._trackedEntity,this._dataSourceDisplay.getBoundingSphere(a,!1,boundingSphereScratch)===BoundingSphereState$1.DONE&&n.update(t,boundingSphereScratch));var e=!1,i=this.selectedEntity,a=defined(i)&&this._enableInfoOrSelection;a&&i.isShowing&&i.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(i,!0,boundingSphereScratch)!==BoundingSphereState$1.FAILED?r=boundingSphereScratch.center:defined(i.position)&&(r=i.position.getValue(t,r)),e=defined(r));n=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;defined(n)&&(n.position=Cartesian3.clone(r,n.position),n.showSelection=a&&e,n.update());n=defined(this._infoBox)?this._infoBox.viewModel:void 0;defined(n)&&(n.showInfo=a,n.enableCamera=e,n.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(n.titleText=defaultValue(i.name,i.id),n.description=Property.getValueOrDefault(i.description,t,"")):(n.titleText="",n.description=""))},Viewer.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var a=i[n];this.trackedEntity===a&&(this.trackedEntity=void 0),this.selectedEntity===a&&(this.selectedEntity=void 0)}},Viewer.prototype._onInfoBoxCameraClicked=function(e){e.isCameraTracking&&this.trackedEntity===this.selectedEntity?this.trackedEntity=void 0:defined(this.selectedEntity.position)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)},Viewer.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Viewer.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Viewer.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Viewer.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&trackDataSourceClock(this.timeline,this.clock,e)},Viewer.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,t=this._eventHelper.add(t.changedEvent,Viewer.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=t},Viewer.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,t=t.entities.id;this._dataSourceChangedListeners[t](),this._dataSourceChangedListeners[t]=void 0,i&&(i=e.length,this._automaticallyTrackDataSourceClocks&&0<i?this.clockTrackedDataSource=e.get(i-1):this.clockTrackedDataSource=void 0)},Viewer.prototype.zoomTo=function(e,t){return zoomToOrFly(this,e,{offset:t},!1)},Viewer.prototype.flyTo=function(e,t){return zoomToOrFly(this,e,t,!0)},Viewer.prototype._postRender=function(){updateZoomTarget(this),updateTrackedEntity(this)};const VERSION="1.79.1";exports.Animation=Animation,exports.AnimationViewModel=AnimationViewModel,exports.Appearance=Appearance,exports.ApproximateTerrainHeights=ApproximateTerrainHeights,exports.ArcGISTiledElevationTerrainProvider=ArcGISTiledElevationTerrainProvider,exports.ArcGisMapServerImageryProvider=ArcGisMapServerImageryProvider,exports.ArcType=ArcType$1,exports.AssociativeArray=AssociativeArray,exports.AttributeCompression=AttributeCompression,exports.AttributeType=AttributeType$1,exports.AutoExposure=AutoExposure,exports.Autolinker=Autolinker,exports.AutomaticUniforms=AutomaticUniforms,exports.Axis=Axis$1,exports.AxisAlignedBoundingBox=AxisAlignedBoundingBox,exports.BaseLayerPicker=BaseLayerPicker,exports.BaseLayerPickerViewModel=BaseLayerPickerViewModel,exports.BatchTable=BatchTable,exports.Batched3DModel3DTileContent=Batched3DModel3DTileContent,exports.Billboard=Billboard,exports.BillboardCollection=BillboardCollection,exports.BillboardGraphics=BillboardGraphics,exports.BillboardVisualizer=BillboardVisualizer,exports.BingMapsGeocoderService=BingMapsGeocoderService,exports.BingMapsImageryProvider=BingMapsImageryProvider,exports.BingMapsStyle=BingMapsStyle$1,exports.BlendEquation=BlendEquation$1,exports.BlendFunction=BlendFunction$1,exports.BlendOption=BlendOption$1,exports.BlendingState=BlendingState$1,exports.BoundingRectangle=BoundingRectangle,exports.BoundingSphere=BoundingSphere,exports.BoundingSphereState=BoundingSphereState$1,exports.BoxEmitter=BoxEmitter,exports.BoxGeometry=BoxGeometry,exports.BoxGeometryUpdater=BoxGeometryUpdater,exports.BoxGraphics=BoxGraphics,exports.BoxOutlineGeometry=BoxOutlineGeometry,exports.BrdfLutGenerator=BrdfLutGenerator,exports.Buffer=Buffer$1,exports.BufferUsage=BufferUsage$1,exports.CallbackProperty=CallbackProperty,exports.Camera=Camera,exports.CameraEventAggregator=CameraEventAggregator,exports.CameraEventType=CameraEventType$1,exports.CameraFlightPath=CameraFlightPath,exports.Cartesian2=Cartesian2,exports.Cartesian3=Cartesian3,exports.Cartesian4=Cartesian4,exports.Cartographic=Cartographic,exports.CartographicGeocoderService=CartographicGeocoderService,exports.CatmullRomSpline=CatmullRomSpline,exports.Cesium3DTile=Cesium3DTile,exports.Cesium3DTileBatchTable=Cesium3DTileBatchTable,exports.Cesium3DTileColorBlendMode=Cesium3DTileColorBlendMode$1,exports.Cesium3DTileContent=Cesium3DTileContent,exports.Cesium3DTileContentFactory=Cesium3DTileContentFactory,exports.Cesium3DTileContentState=Cesium3DTileContentState$1,exports.Cesium3DTileFeature=Cesium3DTileFeature,exports.Cesium3DTileFeatureTable=Cesium3DTileFeatureTable,exports.Cesium3DTileOptimizationHint=Cesium3DTileOptimizationHint$1,exports.Cesium3DTileOptimizations=Cesium3DTileOptimizations,exports.Cesium3DTilePass=Cesium3DTilePass$1,exports.Cesium3DTilePassState=Cesium3DTilePassState,exports.Cesium3DTilePointFeature=Cesium3DTilePointFeature,exports.Cesium3DTileRefine=Cesium3DTileRefine$1,exports.Cesium3DTileStyle=Cesium3DTileStyle,exports.Cesium3DTileStyleEngine=Cesium3DTileStyleEngine,exports.Cesium3DTilesInspector=Cesium3DTilesInspector,exports.Cesium3DTilesInspectorViewModel=Cesium3DTilesInspectorViewModel,exports.Cesium3DTileset=Cesium3DTileset,exports.Cesium3DTilesetCache=Cesium3DTilesetCache,exports.Cesium3DTilesetGraphics=Cesium3DTilesetGraphics,exports.Cesium3DTilesetHeatmap=Cesium3DTilesetHeatmap,exports.Cesium3DTilesetMostDetailedTraversal=Cesium3DTilesetMostDetailedTraversal,exports.Cesium3DTilesetStatistics=Cesium3DTilesetStatistics,exports.Cesium3DTilesetTraversal=Cesium3DTilesetTraversal,exports.Cesium3DTilesetVisualizer=Cesium3DTilesetVisualizer,exports.CesiumInspector=CesiumInspector,exports.CesiumInspectorViewModel=CesiumInspectorViewModel,exports.CesiumTerrainProvider=CesiumTerrainProvider,exports.CesiumWidget=CesiumWidget,exports.Check=Check,exports.CheckerboardMaterialProperty=CheckerboardMaterialProperty,exports.CircleEmitter=CircleEmitter,exports.CircleGeometry=CircleGeometry,exports.CircleOutlineGeometry=CircleOutlineGeometry,exports.ClassificationModel=ClassificationModel,exports.ClassificationPrimitive=ClassificationPrimitive,exports.ClassificationType=ClassificationType$1,exports.ClearCommand=ClearCommand,exports.ClippingPlane=ClippingPlane,exports.ClippingPlaneCollection=ClippingPlaneCollection,exports.Clock=Clock,exports.ClockRange=ClockRange$1,exports.ClockStep=ClockStep$1,exports.ClockViewModel=ClockViewModel,exports.Color=Color,exports.ColorBlendMode=ColorBlendMode$1,exports.ColorGeometryInstanceAttribute=ColorGeometryInstanceAttribute,exports.ColorMaterialProperty=ColorMaterialProperty,exports.Command=Command,exports.ComponentDatatype=ComponentDatatype$1,exports.Composite3DTileContent=Composite3DTileContent,exports.CompositeEntityCollection=CompositeEntityCollection,exports.CompositeMaterialProperty=CompositeMaterialProperty,exports.CompositePositionProperty=CompositePositionProperty,exports.CompositeProperty=CompositeProperty,exports.CompressedTextureBuffer=CompressedTextureBuffer,exports.ComputeCommand=ComputeCommand,exports.ComputeEngine=ComputeEngine,exports.ConditionsExpression=ConditionsExpression,exports.ConeEmitter=ConeEmitter,exports.ConstantPositionProperty=ConstantPositionProperty,exports.ConstantProperty=ConstantProperty,exports.Context=Context,exports.ContextLimits=ContextLimits,exports.CoplanarPolygonGeometry=CoplanarPolygonGeometry,exports.CoplanarPolygonGeometryLibrary=CoplanarPolygonGeometryLibrary,exports.CoplanarPolygonOutlineGeometry=CoplanarPolygonOutlineGeometry,exports.CornerType=CornerType$1,exports.CorridorGeometry=CorridorGeometry,exports.CorridorGeometryLibrary=CorridorGeometryLibrary,exports.CorridorGeometryUpdater=CorridorGeometryUpdater,exports.CorridorGraphics=CorridorGraphics,exports.CorridorOutlineGeometry=CorridorOutlineGeometry,exports.Credit=Credit,exports.CreditDisplay=CreditDisplay,exports.CubeMap=CubeMap,exports.CubeMapFace=CubeMapFace,exports.CubicRealPolynomial=CubicRealPolynomial,exports.CullFace=CullFace$1,exports.CullingVolume=CullingVolume,exports.CustomDataSource=CustomDataSource,exports.CylinderGeometry=CylinderGeometry,exports.CylinderGeometryLibrary=CylinderGeometryLibrary,exports.CylinderGeometryUpdater=CylinderGeometryUpdater,exports.CylinderGraphics=CylinderGraphics,exports.CylinderOutlineGeometry=CylinderOutlineGeometry,exports.CzmlDataSource=CzmlDataSource,exports.DataSource=DataSource,exports.DataSourceClock=DataSourceClock,exports.DataSourceCollection=DataSourceCollection,exports.DataSourceDisplay=DataSourceDisplay,exports.DebugAppearance=DebugAppearance,exports.DebugCameraPrimitive=DebugCameraPrimitive,exports.DebugInspector=DebugInspector,exports.DebugModelMatrixPrimitive=DebugModelMatrixPrimitive,exports.DefaultProxy=DefaultProxy,exports.DepthFunction=DepthFunction$1,exports.DepthPlane=DepthPlane,exports.DerivedCommand=DerivedCommand,exports.DeveloperError=DeveloperError,exports.DeviceOrientationCameraController=DeviceOrientationCameraController,exports.DirectionalLight=DirectionalLight,exports.DiscardEmptyTileImagePolicy=DiscardEmptyTileImagePolicy,exports.DiscardMissingTileImagePolicy=DiscardMissingTileImagePolicy,exports.DistanceDisplayCondition=DistanceDisplayCondition,exports.DistanceDisplayConditionGeometryInstanceAttribute=DistanceDisplayConditionGeometryInstanceAttribute,exports.DoublyLinkedList=DoublyLinkedList,exports.DracoLoader=DracoLoader,exports.DrawCommand=DrawCommand,exports.DynamicGeometryBatch=DynamicGeometryBatch,exports.DynamicGeometryUpdater=DynamicGeometryUpdater$1,exports.EarthOrientationParameters=EarthOrientationParameters,exports.EarthOrientationParametersSample=EarthOrientationParametersSample,exports.EasingFunction=EasingFunction$1,exports.EllipseGeometry=EllipseGeometry,exports.EllipseGeometryLibrary=EllipseGeometryLibrary,exports.EllipseGeometryUpdater=EllipseGeometryUpdater,exports.EllipseGraphics=EllipseGraphics,exports.EllipseOutlineGeometry=EllipseOutlineGeometry,exports.Ellipsoid=Ellipsoid,exports.EllipsoidGeodesic=EllipsoidGeodesic,exports.EllipsoidGeometry=EllipsoidGeometry,exports.EllipsoidGeometryUpdater=EllipsoidGeometryUpdater,exports.EllipsoidGraphics=EllipsoidGraphics,exports.EllipsoidOutlineGeometry=EllipsoidOutlineGeometry,exports.EllipsoidPrimitive=EllipsoidPrimitive,exports.EllipsoidRhumbLine=EllipsoidRhumbLine,exports.EllipsoidSurfaceAppearance=EllipsoidSurfaceAppearance,exports.EllipsoidTangentPlane=EllipsoidTangentPlane,exports.EllipsoidTerrainProvider=EllipsoidTerrainProvider,exports.EllipsoidalOccluder=EllipsoidalOccluder,exports.Empty3DTileContent=Empty3DTileContent,exports.EncodedCartesian3=EncodedCartesian3,exports.Entity=Entity,exports.EntityCluster=EntityCluster,exports.EntityCollection=EntityCollection,exports.EntityView=EntityView,exports.Event=Event,exports.EventHelper=EventHelper,exports.Expression=Expression,exports.ExpressionNodeType=ExpressionNodeType$1,exports.ExtrapolationType=ExtrapolationType$1,exports.FXAA3_11=FXAA3_11,exports.FeatureDetection=FeatureDetection,exports.Fog=Fog,exports.ForEach=ForEach,exports.FrameRateMonitor=FrameRateMonitor,exports.FrameState=FrameState,exports.Framebuffer=Framebuffer,exports.FrustumCommands=FrustumCommands,exports.FrustumGeometry=FrustumGeometry,exports.FrustumOutlineGeometry=FrustumOutlineGeometry,exports.Fullscreen=Fullscreen,exports.FullscreenButton=FullscreenButton,exports.FullscreenButtonViewModel=FullscreenButtonViewModel,exports.GeoJsonDataSource=GeoJsonDataSource,exports.GeocodeType=GeocodeType$1,exports.Geocoder=Geocoder,exports.GeocoderService=GeocoderService,exports.GeocoderViewModel=GeocoderViewModel,exports.GeographicProjection=GeographicProjection,exports.GeographicTilingScheme=GeographicTilingScheme,exports.Geometry=Geometry,exports.Geometry3DTileContent=Geometry3DTileContent,exports.GeometryAttribute=GeometryAttribute,exports.GeometryAttributes=GeometryAttributes,exports.GeometryFactory=GeometryFactory,exports.GeometryInstance=GeometryInstance,exports.GeometryInstanceAttribute=GeometryInstanceAttribute,exports.GeometryOffsetAttribute=GeometryOffsetAttribute$1,exports.GeometryPipeline=GeometryPipeline,exports.GeometryType=GeometryType$1,exports.GeometryUpdater=GeometryUpdater,exports.GeometryVisualizer=GeometryVisualizer,exports.GetFeatureInfoFormat=GetFeatureInfoFormat,exports.Globe=Globe,exports.GlobeDepth=GlobeDepth,exports.GlobeSurfaceShaderSet=GlobeSurfaceShaderSet,exports.GlobeSurfaceTile=GlobeSurfaceTile,exports.GlobeSurfaceTileProvider=GlobeSurfaceTileProvider,exports.GlobeTranslucency=GlobeTranslucency,exports.GlobeTranslucencyFramebuffer=GlobeTranslucencyFramebuffer,exports.GlobeTranslucencyState=GlobeTranslucencyState,exports.GoogleEarthEnterpriseImageryProvider=GoogleEarthEnterpriseImageryProvider,exports.GoogleEarthEnterpriseMapsProvider=GoogleEarthEnterpriseMapsProvider,exports.GoogleEarthEnterpriseMetadata=GoogleEarthEnterpriseMetadata,exports.GoogleEarthEnterpriseTerrainData=GoogleEarthEnterpriseTerrainData,exports.GoogleEarthEnterpriseTerrainProvider=GoogleEarthEnterpriseTerrainProvider,exports.GoogleEarthEnterpriseTileInformation=GoogleEarthEnterpriseTileInformation,exports.GregorianDate=GregorianDate,exports.GridImageryProvider=GridImageryProvider,exports.GridMaterialProperty=GridMaterialProperty,exports.GroundGeometryUpdater=GroundGeometryUpdater,exports.GroundPolylineGeometry=GroundPolylineGeometry,exports.GroundPolylinePrimitive=GroundPolylinePrimitive,exports.GroundPrimitive=GroundPrimitive,exports.HeadingPitchRange=HeadingPitchRange,exports.HeadingPitchRoll=HeadingPitchRoll,exports.Heap=Heap,exports.HeightReference=HeightReference$1,exports.HeightmapEncoding=HeightmapEncoding$1,exports.HeightmapTerrainData=HeightmapTerrainData,exports.HeightmapTessellator=HeightmapTessellator,exports.HermitePolynomialApproximation=HermitePolynomialApproximation,exports.HermiteSpline=HermiteSpline,exports.HomeButton=HomeButton,exports.HomeButtonViewModel=HomeButtonViewModel,exports.HorizontalOrigin=HorizontalOrigin$1,exports.Iau2000Orientation=Iau2000Orientation,exports.Iau2006XysData=Iau2006XysData,exports.Iau2006XysSample=Iau2006XysSample,exports.IauOrientationAxes=IauOrientationAxes,exports.IauOrientationParameters=IauOrientationParameters,exports.ImageMaterialProperty=ImageMaterialProperty,exports.Imagery=Imagery,exports.ImageryLayer=ImageryLayer,exports.ImageryLayerCollection=ImageryLayerCollection,exports.ImageryLayerFeatureInfo=ImageryLayerFeatureInfo,exports.ImageryProvider=ImageryProvider,exports.ImagerySplitDirection=ImagerySplitDirection$1,exports.ImageryState=ImageryState$1,exports.IndexDatatype=IndexDatatype$1,exports.InfoBox=InfoBox,exports.InfoBoxViewModel=InfoBoxViewModel,exports.InspectorShared=InspectorShared,exports.Instanced3DModel3DTileContent=Instanced3DModel3DTileContent,exports.InterpolationAlgorithm=InterpolationAlgorithm,exports.Intersect=Intersect$1,exports.IntersectionTests=IntersectionTests,exports.Intersections2D=Intersections2D,exports.Interval=Interval,exports.InvertClassification=InvertClassification,exports.Ion=Ion,exports.IonGeocoderService=IonGeocoderService,exports.IonImageryProvider=IonImageryProvider,exports.IonResource=IonResource,exports.IonWorldImageryStyle=IonWorldImageryStyle$1,exports.Iso8601=Iso8601,exports.JobScheduler=JobScheduler,exports.JobType=JobType$1,exports.JulianDate=JulianDate,exports.KeyboardEventModifier=KeyboardEventModifier$1,exports.KmlCamera=KmlCamera,exports.KmlDataSource=KmlDataSource,exports.KmlLookAt=KmlLookAt,exports.KmlTour=KmlTour,exports.KmlTourFlyTo=KmlTourFlyTo,exports.KmlTourWait=KmlTourWait,exports.Label=Label,exports.LabelCollection=LabelCollection,exports.LabelGraphics=LabelGraphics,exports.LabelStyle=LabelStyle$1,exports.LabelVisualizer=LabelVisualizer,exports.LagrangePolynomialApproximation=LagrangePolynomialApproximation,exports.LeapSecond=LeapSecond,exports.LercDecode=LercDecode,exports.Light=Light,exports.LinearApproximation=LinearApproximation,exports.LinearSpline=LinearSpline,exports.ManagedArray=ManagedArray,exports.MapMode2D=MapMode2D$1,exports.MapProjection=MapProjection,exports.MapboxImageryProvider=MapboxImageryProvider,exports.MapboxStyleImageryProvider=MapboxStyleImageryProvider,exports.Material=Material,exports.MaterialAppearance=MaterialAppearance,exports.MaterialProperty=MaterialProperty,exports.Math=CesiumMath,exports.Matrix2=Matrix2,exports.Matrix3=Matrix3,exports.Matrix4=Matrix4,exports.MipmapHint=MipmapHint$1,exports.Model=Model,exports.ModelAnimation=ModelAnimation,exports.ModelAnimationCache=ModelAnimationCache,exports.ModelAnimationCollection=ModelAnimationCollection,exports.ModelAnimationLoop=ModelAnimationLoop$1,exports.ModelAnimationState=ModelAnimationState,exports.ModelGraphics=ModelGraphics,exports.ModelInstance=ModelInstance,exports.ModelInstanceCollection=ModelInstanceCollection,exports.ModelLoadResources=ModelLoadResources,exports.ModelMaterial=ModelMaterial,exports.ModelMesh=ModelMesh,exports.ModelNode=ModelNode,exports.ModelOutlineLoader=ModelOutlineLoader,exports.ModelUtility=ModelUtility,exports.ModelVisualizer=ModelVisualizer,exports.Moon=Moon,exports.NavigationHelpButton=NavigationHelpButton,exports.NavigationHelpButtonViewModel=NavigationHelpButtonViewModel,exports.NearFarScalar=NearFarScalar,exports.NeverTileDiscardPolicy=NeverTileDiscardPolicy,exports.NoSleep=NoSleep,exports.NodeTransformationProperty=NodeTransformationProperty,exports.OIT=OIT,exports.Occluder=Occluder,exports.OctahedralProjectedCubeMap=OctahedralProjectedCubeMap,exports.OffsetGeometryInstanceAttribute=OffsetGeometryInstanceAttribute,exports.OpenCageGeocoderService=OpenCageGeocoderService,exports.OpenStreetMapImageryProvider=OpenStreetMapImageryProvider,exports.OrderedGroundPrimitiveCollection=OrderedGroundPrimitiveCollection,exports.OrientedBoundingBox=OrientedBoundingBox,exports.OrthographicFrustum=OrthographicFrustum,exports.OrthographicOffCenterFrustum=OrthographicOffCenterFrustum,exports.Packable=Packable,exports.PackableForInterpolation=PackableForInterpolation,exports.Particle=Particle,exports.ParticleBurst=ParticleBurst,exports.ParticleEmitter=ParticleEmitter,exports.ParticleSystem=ParticleSystem,exports.Pass=Pass$1,exports.PassState=PassState,exports.PathGraphics=PathGraphics,exports.PathVisualizer=PathVisualizer,exports.PeliasGeocoderService=PeliasGeocoderService,exports.PerInstanceColorAppearance=PerInstanceColorAppearance,exports.PerformanceDisplay=PerformanceDisplay,exports.PerformanceWatchdog=PerformanceWatchdog,exports.PerformanceWatchdogViewModel=PerformanceWatchdogViewModel,exports.PerspectiveFrustum=PerspectiveFrustum,exports.PerspectiveOffCenterFrustum=PerspectiveOffCenterFrustum,exports.PickDepth=PickDepth,exports.PickDepthFramebuffer=PickDepthFramebuffer,exports.PickFramebuffer=PickFramebuffer,exports.Picking=Picking,exports.PinBuilder=PinBuilder,exports.PixelDatatype=PixelDatatype$1,exports.PixelFormat=PixelFormat$1,exports.Plane=Plane,exports.PlaneGeometry=PlaneGeometry,exports.PlaneGeometryUpdater=PlaneGeometryUpdater,exports.PlaneGraphics=PlaneGraphics,exports.PlaneOutlineGeometry=PlaneOutlineGeometry,exports.PointCloud=PointCloud,exports.PointCloud3DTileContent=PointCloud3DTileContent,exports.PointCloudEyeDomeLighting=PointCloudEyeDomeLighting,exports.PointCloudShading=PointCloudShading,exports.PointGraphics=PointGraphics,exports.PointPrimitive=PointPrimitive,exports.PointPrimitiveCollection=PointPrimitiveCollection,exports.PointVisualizer=PointVisualizer,exports.PolygonGeometry=PolygonGeometry,exports.PolygonGeometryLibrary=PolygonGeometryLibrary,exports.PolygonGeometryUpdater=PolygonGeometryUpdater,exports.PolygonGraphics=PolygonGraphics,exports.PolygonHierarchy=PolygonHierarchy,exports.PolygonOutlineGeometry=PolygonOutlineGeometry,exports.PolygonPipeline=PolygonPipeline,exports.Polyline=Polyline,exports.PolylineArrowMaterialProperty=PolylineArrowMaterialProperty,exports.PolylineCollection=PolylineCollection,exports.PolylineColorAppearance=PolylineColorAppearance,exports.PolylineDashMaterialProperty=PolylineDashMaterialProperty,exports.PolylineGeometry=PolylineGeometry,exports.PolylineGeometryUpdater=PolylineGeometryUpdater,exports.PolylineGlowMaterialProperty=PolylineGlowMaterialProperty,exports.PolylineGraphics=PolylineGraphics,exports.PolylineMaterialAppearance=PolylineMaterialAppearance,exports.PolylineOutlineMaterialProperty=PolylineOutlineMaterialProperty,exports.PolylinePipeline=PolylinePipeline,exports.PolylineVisualizer=PolylineVisualizer,exports.PolylineVolumeGeometry=PolylineVolumeGeometry,exports.PolylineVolumeGeometryLibrary=PolylineVolumeGeometryLibrary,exports.PolylineVolumeGeometryUpdater=PolylineVolumeGeometryUpdater,exports.PolylineVolumeGraphics=PolylineVolumeGraphics,exports.PolylineVolumeOutlineGeometry=PolylineVolumeOutlineGeometry,exports.PositionProperty=PositionProperty,exports.PositionPropertyArray=PositionPropertyArray,exports.PostProcessStage=PostProcessStage,exports.PostProcessStageCollection=PostProcessStageCollection,exports.PostProcessStageComposite=PostProcessStageComposite,exports.PostProcessStageLibrary=PostProcessStageLibrary,exports.PostProcessStageSampleMode=PostProcessStageSampleMode,exports.PostProcessStageTextureCache=PostProcessStageTextureCache,exports.Primitive=Primitive,exports.PrimitiveCollection=PrimitiveCollection,exports.PrimitivePipeline=PrimitivePipeline,exports.PrimitiveState=PrimitiveState$1,exports.PrimitiveType=PrimitiveType$1,exports.ProjectionPicker=ProjectionPicker,exports.ProjectionPickerViewModel=ProjectionPickerViewModel,exports.Property=Property,exports.PropertyArray=PropertyArray,exports.PropertyBag=PropertyBag,exports.ProviderViewModel=ProviderViewModel,exports.Proxy=Proxy,exports.QuadraticRealPolynomial=QuadraticRealPolynomial,exports.QuadtreeOccluders=QuadtreeOccluders,exports.QuadtreePrimitive=QuadtreePrimitive,exports.QuadtreeTile=QuadtreeTile,exports.QuadtreeTileLoadState=QuadtreeTileLoadState$1,exports.QuadtreeTileProvider=QuadtreeTileProvider,exports.QuantizedMeshTerrainData=QuantizedMeshTerrainData,exports.QuarticRealPolynomial=QuarticRealPolynomial,exports.Quaternion=Quaternion,exports.QuaternionSpline=QuaternionSpline,exports.Queue=Queue,exports.Ray=Ray,exports.Rectangle=Rectangle,exports.RectangleCollisionChecker=RectangleCollisionChecker,exports.RectangleGeometry=RectangleGeometry,exports.RectangleGeometryLibrary=RectangleGeometryLibrary,exports.RectangleGeometryUpdater=RectangleGeometryUpdater,exports.RectangleGraphics=RectangleGraphics,exports.RectangleOutlineGeometry=RectangleOutlineGeometry,exports.ReferenceFrame=ReferenceFrame$1,exports.ReferenceProperty=ReferenceProperty,exports.RenderState=RenderState,exports.Renderbuffer=Renderbuffer,exports.RenderbufferFormat=RenderbufferFormat$1,exports.Request=Request,exports.RequestErrorEvent=RequestErrorEvent,exports.RequestScheduler=RequestScheduler,exports.RequestState=RequestState$1,exports.RequestType=RequestType$1,exports.Resource=Resource,exports.Rotation=Rotation,exports.RuntimeError=RuntimeError,exports.SDFSettings=SDFSettings$1,exports.SampledPositionProperty=SampledPositionProperty,exports.SampledProperty=SampledProperty,exports.Sampler=Sampler,exports.ScaledPositionProperty=ScaledPositionProperty,exports.Scene=Scene,exports.SceneFramebuffer=SceneFramebuffer,exports.SceneMode=SceneMode$1,exports.SceneModePicker=SceneModePicker,exports.SceneModePickerViewModel=SceneModePickerViewModel,exports.SceneTransforms=SceneTransforms,exports.SceneTransitioner=SceneTransitioner,exports.ScreenSpaceCameraController=ScreenSpaceCameraController,exports.ScreenSpaceEventHandler=ScreenSpaceEventHandler,exports.ScreenSpaceEventType=ScreenSpaceEventType$1,exports.SelectionIndicator=SelectionIndicator,exports.SelectionIndicatorViewModel=SelectionIndicatorViewModel,exports.ShaderCache=ShaderCache,exports.ShaderProgram=ShaderProgram,exports.ShaderSource=ShaderSource,exports.ShadowMap=ShadowMap,exports.ShadowMapShader=ShadowMapShader,exports.ShadowMode=ShadowMode$1,exports.ShadowVolumeAppearance=ShadowVolumeAppearance,exports.ShowGeometryInstanceAttribute=ShowGeometryInstanceAttribute,exports.Simon1994PlanetaryPositions=Simon1994PlanetaryPositions,exports.SimplePolylineGeometry=SimplePolylineGeometry,exports.SingleTileImageryProvider=SingleTileImageryProvider,exports.SkyAtmosphere=SkyAtmosphere,exports.SkyBox=SkyBox,exports.SphereEmitter=SphereEmitter,exports.SphereGeometry=SphereGeometry,exports.SphereOutlineGeometry=SphereOutlineGeometry,exports.Spherical=Spherical,exports.Spline=Spline,exports.StaticGeometryColorBatch=StaticGeometryColorBatch,exports.StaticGeometryPerMaterialBatch=StaticGeometryPerMaterialBatch,exports.StaticGroundGeometryColorBatch=StaticGroundGeometryColorBatch,exports.StaticGroundGeometryPerMaterialBatch=StaticGroundGeometryPerMaterialBatch,exports.StaticGroundPolylinePerMaterialBatch=StaticGroundPolylinePerMaterialBatch,exports.StaticOutlineGeometryBatch=StaticOutlineGeometryBatch,exports.StencilConstants=StencilConstants$1,exports.StencilFunction=StencilFunction$1,exports.StencilOperation=StencilOperation$1,exports.StripeMaterialProperty=StripeMaterialProperty,exports.StripeOrientation=StripeOrientation$1,exports.StyleExpression=StyleExpression,exports.Sun=Sun,exports.SunLight=SunLight,exports.SunPostProcess=SunPostProcess,exports.SvgPathBindingHandler=SvgPathBindingHandler,exports.TaskProcessor=TaskProcessor,exports.TerrainData=TerrainData,exports.TerrainEncoding=TerrainEncoding,exports.TerrainFillMesh=TerrainFillMesh,exports.TerrainMesh=TerrainMesh,exports.TerrainOffsetProperty=TerrainOffsetProperty,exports.TerrainProvider=TerrainProvider,exports.TerrainQuantization=TerrainQuantization$1,exports.TerrainState=TerrainState$1,exports.Texture=Texture,exports.TextureAtlas=TextureAtlas,exports.TextureCache=TextureCache,exports.TextureMagnificationFilter=TextureMagnificationFilter$1,exports.TextureMinificationFilter=TextureMinificationFilter$1,exports.TextureWrap=TextureWrap$1,exports.TileAvailability=TileAvailability,exports.TileBoundingRegion=TileBoundingRegion,exports.TileBoundingSphere=TileBoundingSphere,exports.TileBoundingVolume=TileBoundingVolume,exports.TileCoordinatesImageryProvider=TileCoordinatesImageryProvider,exports.TileDiscardPolicy=TileDiscardPolicy,exports.TileEdge=TileEdge,exports.TileImagery=TileImagery,exports.TileMapServiceImageryProvider=TileMapServiceImageryProvider,exports.TileOrientedBoundingBox=TileOrientedBoundingBox,exports.TileProviderError=TileProviderError,exports.TileReplacementQueue=TileReplacementQueue,exports.TileSelectionResult=TileSelectionResult,exports.TileState=TileState$1,exports.Tileset3DTileContent=Tileset3DTileContent,exports.TilingScheme=TilingScheme,exports.TimeConstants=TimeConstants$1,exports.TimeDynamicImagery=TimeDynamicImagery,exports.TimeDynamicPointCloud=TimeDynamicPointCloud,exports.TimeInterval=TimeInterval,exports.TimeIntervalCollection=TimeIntervalCollection,exports.TimeIntervalCollectionPositionProperty=TimeIntervalCollectionPositionProperty,exports.TimeIntervalCollectionProperty=TimeIntervalCollectionProperty,exports.TimeStandard=TimeStandard$1,exports.Timeline=Timeline,exports.TimelineHighlightRange=TimelineHighlightRange,exports.TimelineTrack=TimelineTrack,exports.Tipsify=Tipsify,exports.ToggleButtonViewModel=ToggleButtonViewModel,exports.Tonemapper=Tonemapper$1,exports.Transforms=Transforms,exports.TranslationRotationScale=TranslationRotationScale,exports.TridiagonalSystemSolver=TridiagonalSystemSolver,exports.TrustedServers=TrustedServers,exports.Tween=TWEEN,exports.TweenCollection=TweenCollection,exports.UniformState=UniformState,exports.Uri=URI,exports.UrlTemplateImageryProvider=UrlTemplateImageryProvider,exports.VERSION=VERSION,exports.VRButton=VRButton,exports.VRButtonViewModel=VRButtonViewModel,exports.VRTheWorldTerrainProvider=VRTheWorldTerrainProvider,exports.Vector3DTileBatch=Vector3DTileBatch,exports.Vector3DTileContent=Vector3DTileContent,exports.Vector3DTileGeometry=Vector3DTileGeometry,exports.Vector3DTilePoints=Vector3DTilePoints,exports.Vector3DTilePolygons=Vector3DTilePolygons,exports.Vector3DTilePolylines=Vector3DTilePolylines,exports.Vector3DTilePrimitive=Vector3DTilePrimitive,exports.VelocityOrientationProperty=VelocityOrientationProperty,exports.VelocityVectorProperty=VelocityVectorProperty,exports.VertexArray=VertexArray,exports.VertexArrayFacade=VertexArrayFacade,exports.VertexFormat=VertexFormat,exports.VerticalOrigin=VerticalOrigin$1,exports.VideoSynchronizer=VideoSynchronizer,exports.View=View,exports.Viewer=Viewer,exports.ViewportQuad=ViewportQuad,exports.Visibility=Visibility$1,exports.Visualizer=Visualizer,exports.WallGeometry=WallGeometry,exports.WallGeometryLibrary=WallGeometryLibrary,exports.WallGeometryUpdater=WallGeometryUpdater,exports.WallGraphics=WallGraphics,exports.WallOutlineGeometry=WallOutlineGeometry,exports.WebGLConstants=WebGLConstants$1,exports.WebMapServiceImageryProvider=WebMapServiceImageryProvider,exports.WebMapTileServiceImageryProvider=WebMapTileServiceImageryProvider,exports.WebMercatorProjection=WebMercatorProjection,exports.WebMercatorTilingScheme=WebMercatorTilingScheme,exports.WeightSpline=WeightSpline,exports.WindingOrder=WindingOrder$1,exports._shadersAcesTonemappingStage=AcesTonemapping,exports._shadersAdditiveBlend=AdditiveBlend,exports._shadersAdjustTranslucentFS=AdjustTranslucentFS,exports._shadersAllMaterialAppearanceFS=AllMaterialAppearanceFS,exports._shadersAllMaterialAppearanceVS=AllMaterialAppearanceVS,exports._shadersAmbientOcclusionGenerate=AmbientOcclusionGenerate,exports._shadersAmbientOcclusionModulate=AmbientOcclusionModulate,exports._shadersAspectRampMaterial=AspectRampMaterial,exports._shadersBasicMaterialAppearanceFS=BasicMaterialAppearanceFS,exports._shadersBasicMaterialAppearanceVS=BasicMaterialAppearanceVS,exports._shadersBillboardCollectionFS=BillboardCollectionFS,exports._shadersBillboardCollectionVS=BillboardCollectionVS,exports._shadersBlackAndWhite=BlackAndWhite,exports._shadersBloomComposite=BloomComposite,exports._shadersBrdfLutGeneratorFS=BrdfLutGeneratorFS,exports._shadersBrightPass=BrightPass,exports._shadersBrightness=Brightness,exports._shadersBumpMapMaterial=BumpMapMaterial,exports._shadersCheckerboardMaterial=CheckerboardMaterial,exports._shadersCompositeOITFS=CompositeOITFS,exports._shadersContrastBias=ContrastBias,exports._shadersCzmBuiltins=CzmBuiltins,exports._shadersDepthOfField=DepthOfField,exports._shadersDepthPlaneFS=DepthPlaneFS,exports._shadersDepthPlaneVS=DepthPlaneVS,exports._shadersDepthView=DepthView,exports._shadersDepthViewPacked=DepthViewPacked,exports._shadersDotMaterial=DotMaterial,exports._shadersEdgeDetection=EdgeDetection,exports._shadersElevationBandMaterial=ElevationBandMaterial,exports._shadersElevationContourMaterial=ElevationContourMaterial,exports._shadersElevationRampMaterial=ElevationRampMaterial,exports._shadersEllipsoidFS=EllipsoidFS,exports._shadersEllipsoidSurfaceAppearanceFS=EllipsoidSurfaceAppearanceFS,exports._shadersEllipsoidSurfaceAppearanceVS=EllipsoidSurfaceAppearanceVS,exports._shadersEllipsoidVS=EllipsoidVS,exports._shadersFXAA=FXAA,exports._shadersFadeMaterial=FadeMaterial,exports._shadersFilmicTonemapping=FilmicTonemapping,exports._shadersGaussianBlur1D=GaussianBlur1D,exports._shadersGlobeFS=GlobeFS,exports._shadersGlobeVS=GlobeVS,exports._shadersGridMaterial=GridMaterial,exports._shadersGroundAtmosphere=GroundAtmosphere,exports._shadersHSBToRGB=czm_HSBToRGB,exports._shadersHSLToRGB=czm_HSLToRGB,exports._shadersLensFlare=LensFlare,exports._shadersModifiedReinhardTonemapping=ModifiedReinhardTonemapping,exports._shadersNightVision=NightVision,exports._shadersNormalMapMaterial=NormalMapMaterial,exports._shadersOctahedralProjectionAtlasFS=OctahedralProjectionAtlasFS,exports._shadersOctahedralProjectionFS=OctahedralProjectionFS,exports._shadersOctahedralProjectionVS=OctahedralProjectionVS,exports._shadersPassThrough=PassThrough,exports._shadersPassThroughDepth=PassThroughDepth,exports._shadersPerInstanceColorAppearanceFS=PerInstanceColorAppearanceFS,exports._shadersPerInstanceColorAppearanceVS=PerInstanceColorAppearanceVS,exports._shadersPerInstanceFlatColorAppearanceFS=PerInstanceFlatColorAppearanceFS,exports._shadersPerInstanceFlatColorAppearanceVS=PerInstanceFlatColorAppearanceVS,exports._shadersPointCloudEyeDomeLighting=PointCloudEyeDomeLightingShader,exports._shadersPointPrimitiveCollectionFS=PointPrimitiveCollectionFS,exports._shadersPointPrimitiveCollectionVS=PointPrimitiveCollectionVS,exports._shadersPolylineArrowMaterial=PolylineArrowMaterial,exports._shadersPolylineColorAppearanceVS=PolylineColorAppearanceVS,exports._shadersPolylineCommon=PolylineCommon,exports._shadersPolylineDashMaterial=PolylineDashMaterial,exports._shadersPolylineFS=PolylineFS$1,exports._shadersPolylineGlowMaterial=PolylineGlowMaterial,exports._shadersPolylineMaterialAppearanceVS=PolylineMaterialAppearanceVS,exports._shadersPolylineOutlineMaterial=PolylineOutlineMaterial,exports._shadersPolylineShadowVolumeFS=PolylineShadowVolumeFS,exports._shadersPolylineShadowVolumeMorphFS=PolylineShadowVolumeMorphFS,exports._shadersPolylineShadowVolumeMorphVS=PolylineShadowVolumeMorphVS,exports._shadersPolylineShadowVolumeVS=PolylineShadowVolumeVS,exports._shadersPolylineVS=PolylineVS,exports._shadersRGBToHSB=czm_RGBToHSB,exports._shadersRGBToHSL=czm_RGBToHSL,exports._shadersRGBToXYZ=czm_RGBToXYZ,exports._shadersReinhardTonemapping=ReinhardTonemapping,exports._shadersReprojectWebMercatorFS=ReprojectWebMercatorFS,exports._shadersReprojectWebMercatorVS=ReprojectWebMercatorVS,exports._shadersRimLightingMaterial=RimLightingMaterial,exports._shadersShadowVolumeAppearanceFS=ShadowVolumeAppearanceFS,exports._shadersShadowVolumeAppearanceVS=ShadowVolumeAppearanceVS,exports._shadersShadowVolumeFS=ShadowVolumeFS,exports._shadersSilhouette=Silhouette,exports._shadersSkyAtmosphereCommon=SkyAtmosphereCommon,exports._shadersSkyAtmosphereFS=SkyAtmosphereFS,exports._shadersSkyAtmosphereVS=SkyAtmosphereVS,exports._shadersSkyBoxFS=SkyBoxFS,exports._shadersSkyBoxVS=SkyBoxVS,exports._shadersSlopeRampMaterial=SlopeRampMaterial,exports._shadersStripeMaterial=StripeMaterial,exports._shadersSunFS=SunFS,exports._shadersSunTextureFS=SunTextureFS,exports._shadersSunVS=SunVS,exports._shadersTexturedMaterialAppearanceFS=TexturedMaterialAppearanceFS,exports._shadersTexturedMaterialAppearanceVS=TexturedMaterialAppearanceVS,exports._shadersVector3DTilePolylinesVS=Vector3DTilePolylinesVS,exports._shadersVectorTileVS=VectorTileVS,exports._shadersViewportQuadFS=ViewportQuadFS,exports._shadersViewportQuadVS=ViewportQuadVS,exports._shadersWater=WaterMaterial,exports._shadersXYZToRGB=czm_XYZToRGB,exports._shadersacesTonemapping=czm_acesTonemapping,exports._shadersalphaWeight=czm_alphaWeight,exports._shadersantialias=czm_antialias,exports._shadersapproximateSphericalCoordinates=czm_approximateSphericalCoordinates,exports._shadersbackFacing=czm_backFacing,exports._shadersbranchFreeTernary=czm_branchFreeTernary,exports._shaderscascadeColor=czm_cascadeColor,exports._shaderscascadeDistance=czm_cascadeDistance,exports._shaderscascadeMatrix=czm_cascadeMatrix,exports._shaderscascadeWeights=czm_cascadeWeights,exports._shaderscolumbusViewMorph=czm_columbusViewMorph,exports._shaderscomputePosition=czm_computePosition,exports._shaderscosineAndSine=czm_cosineAndSine,exports._shadersdecompressTextureCoordinates=czm_decompressTextureCoordinates,exports._shadersdegreesPerRadian=czm_degreesPerRadian,exports._shadersdepthClamp=czm_depthClamp,exports._shadersdepthRange=czm_depthRange,exports._shadersdepthRangeStruct=czm_depthRangeStruct,exports._shaderseastNorthUpToEyeCoordinates=czm_eastNorthUpToEyeCoordinates,exports._shadersellipsoidContainsPoint=czm_ellipsoidContainsPoint,exports._shadersellipsoidWgs84TextureCoordinates=czm_ellipsoidWgs84TextureCoordinates,exports._shadersepsilon1=czm_epsilon1,exports._shadersepsilon2=czm_epsilon2,exports._shadersepsilon3=czm_epsilon3,exports._shadersepsilon4=czm_epsilon4,exports._shadersepsilon5=czm_epsilon5,exports._shadersepsilon6=czm_epsilon6,exports._shadersepsilon7=czm_epsilon7,exports._shadersequalsEpsilon=czm_equalsEpsilon,exports._shaderseyeOffset=czm_eyeOffset,exports._shaderseyeToWindowCoordinates=czm_eyeToWindowCoordinates,exports._shadersfastApproximateAtan=czm_fastApproximateAtan,exports._shadersfog=czm_fog,exports._shadersgammaCorrect=czm_gammaCorrect,exports._shadersgeodeticSurfaceNormal=czm_geodeticSurfaceNormal,exports._shadersgetDefaultMaterial=czm_getDefaultMaterial,exports._shadersgetLambertDiffuse=czm_getLambertDiffuse,exports._shadersgetSpecular=czm_getSpecular,exports._shadersgetWaterNoise=czm_getWaterNoise,exports._shadershue=czm_hue,exports._shadersinfinity=czm_infinity,exports._shadersinverseGamma=czm_inverseGamma,exports._shadersisEmpty=czm_isEmpty,exports._shadersisFull=czm_isFull,exports._shaderslatitudeToWebMercatorFraction=czm_latitudeToWebMercatorFraction,exports._shaderslineDistance=czm_lineDistance,exports._shadersluminance=czm_luminance,exports._shadersmaterial=czm_material,exports._shadersmaterialInput=czm_materialInput,exports._shadersmetersPerPixel=czm_metersPerPixel,exports._shadersmodelToWindowCoordinates=czm_modelToWindowCoordinates,exports._shadersmultiplyWithColorBalance=czm_multiplyWithColorBalance,exports._shadersnearFarScalar=czm_nearFarScalar,exports._shadersoctDecode=czm_octDecode,exports._shadersoneOverPi=czm_oneOverPi,exports._shadersoneOverTwoPi=czm_oneOverTwoPi,exports._shaderspackDepth=czm_packDepth,exports._shaderspassCesium3DTile=czm_passCesium3DTile,exports._shaderspassCesium3DTileClassification=czm_passCesium3DTileClassification,exports._shaderspassCesium3DTileClassificationIgnoreShow=czm_passCesium3DTileClassificationIgnoreShow,exports._shaderspassClassification=czm_passClassification,exports._shaderspassCompute=czm_passCompute,exports._shaderspassEnvironment=czm_passEnvironment,exports._shaderspassGlobe=czm_passGlobe,exports._shaderspassOpaque=czm_passOpaque,exports._shaderspassOverlay=czm_passOverlay,exports._shaderspassTerrainClassification=czm_passTerrainClassification,exports._shaderspassTranslucent=czm_passTranslucent,exports._shadersphong=czm_phong,exports._shaderspi=czm_pi,exports._shaderspiOverFour=czm_piOverFour,exports._shaderspiOverSix=czm_piOverSix,exports._shaderspiOverThree=czm_piOverThree,exports._shaderspiOverTwo=czm_piOverTwo,exports._shadersplaneDistance=czm_planeDistance,exports._shaderspointAlongRay=czm_pointAlongRay,exports._shadersradiansPerDegree=czm_radiansPerDegree,exports._shadersray=czm_ray,exports._shadersrayEllipsoidIntersectionInterval=czm_rayEllipsoidIntersectionInterval,exports._shadersraySegment=czm_raySegment,exports._shadersreadDepth=czm_readDepth,exports._shadersreadNonPerspective=czm_readNonPerspective,exports._shadersreverseLogDepth=czm_reverseLogDepth,exports._shaderssampleOctahedralProjection=czm_sampleOctahedralProjection;exports._shaderssaturation=czm_saturation,exports._shaderssceneMode2D=czm_sceneMode2D,exports._shaderssceneMode3D=czm_sceneMode3D,exports._shaderssceneModeColumbusView=czm_sceneModeColumbusView,exports._shaderssceneModeMorphing=czm_sceneModeMorphing,exports._shadersshadowDepthCompare=czm_shadowDepthCompare,exports._shadersshadowParameters=czm_shadowParameters,exports._shadersshadowVisibility=czm_shadowVisibility,exports._shaderssignNotZero=czm_signNotZero,exports._shaderssolarRadius=czm_solarRadius,exports._shaderssphericalHarmonics=czm_sphericalHarmonics,exports._shaderstangentToEyeSpaceMatrix=czm_tangentToEyeSpaceMatrix,exports._shadersthreePiOver2=czm_threePiOver2,exports._shaderstransformPlane=czm_transformPlane,exports._shaderstranslateRelativeToEye=czm_translateRelativeToEye,exports._shaderstranslucentPhong=czm_translucentPhong,exports._shaderstranspose=czm_transpose,exports._shaderstwoPi=czm_twoPi,exports._shadersunpackDepth=czm_unpackDepth,exports._shadersunpackFloat=czm_unpackFloat,exports._shadersvertexLogDepth=czm_vertexLogDepth,exports._shaderswebMercatorMaxLatitude=czm_webMercatorMaxLatitude,exports._shaderswindowToEyeCoordinates=czm_windowToEyeCoordinates,exports._shaderswriteDepthClamp=czm_writeDepthClamp,exports._shaderswriteLogDepth=czm_writeLogDepth,exports._shaderswriteNonPerspective=czm_writeNonPerspective,exports.addBuffer=addBuffer,exports.addDefaults=addDefaults,exports.addExtensionsRequired=addExtensionsRequired,exports.addExtensionsUsed=addExtensionsUsed,exports.addPipelineExtras=addPipelineExtras,exports.addToArray=addToArray,exports.appendForwardSlash=appendForwardSlash,exports.arrayFill=arrayFill,exports.arrayRemoveDuplicates=arrayRemoveDuplicates,exports.arraySlice=arraySlice,exports.barycentricCoordinates=barycentricCoordinates,exports.binarySearch=binarySearch,exports.bitmap_sdf=calcSDF,exports.buildModuleUrl=buildModuleUrl,exports.cancelAnimationFrame=cancelAnimationFramePolyfill,exports.clone=clone$1,exports.combine=combine$2,exports.computeFlyToLocationForRectangle=computeFlyToLocationForRectangle,exports.createBillboardPointCallback=createBillboardPointCallback,exports.createCommand=createCommand,exports.createDefaultImageryProviderViewModels=createDefaultImageryProviderViewModels,exports.createDefaultTerrainProviderViewModels=createDefaultTerrainProviderViewModels,exports.createElevationBandMaterial=createElevationBandMaterial,exports.createGuid=createGuid,exports.createMaterialPropertyDescriptor=createMaterialPropertyDescriptor,exports.createOsmBuildings=createOsmBuildings,exports.createPropertyDescriptor=createPropertyDescriptor,exports.createRawPropertyDescriptor=createRawPropertyDescriptor,exports.createTangentSpaceDebugPrimitive=createTangentSpaceDebugPrimitive,exports.createTaskProcessorWorker=createTaskProcessorWorker,exports.createUniform=createUniform,exports.createUniformArray=createUniformArray,exports.createWorldImagery=createWorldImagery,exports.createWorldTerrain=createWorldTerrain,exports.decodeGoogleEarthEnterpriseData=decodeGoogleEarthEnterpriseData,exports.defaultValue=defaultValue,exports.defined=defined,exports.deprecationWarning=deprecationWarning,exports.destroyObject=destroyObject,exports.earcut_2_2_1=earcut,exports.exportKml=exportKml,exports.findAccessorMinMax=findAccessorMinMax,exports.formatError=formatError,exports.freezeRenderState=freezeRenderState,exports.getAbsoluteUri=getAbsoluteUri,exports.getAccessorByteStride=getAccessorByteStride,exports.getBaseUri=getBaseUri,exports.getBinaryAccessor=getBinaryAccessor,exports.getClipAndStyleCode=getClipAndStyleCode,exports.getClippingFunction=getClippingFunction,exports.getComponentReader=getComponentReader,exports.getElement=getElement,exports.getExtensionFromUri=getExtensionFromUri,exports.getFilenameFromUri=getFilenameFromUri,exports.getImagePixels=getImagePixels,exports.getJsonFromTypedArray=getJsonFromTypedArray,exports.getMagic=getMagic,exports.getStringFromTypedArray=getStringFromTypedArray,exports.getTimestamp=getTimestamp$1,exports.graphemesplitter=GraphemeSplitter,exports.hasExtension=hasExtension,exports.heightReferenceOnEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,exports.isBitSet=isBitSet,exports.isBlobUri=isBlobUri,exports.isCrossOriginUrl=isCrossOriginUrl,exports.isDataUri=isDataUri,exports.isLeapYear=isLeapYear,exports.jsep=jsep,exports.kdbush=kdbush,exports.knockout=knockout,exports.knockout_3_5_1=knockout,exports.knockout_es5=knockout_es5,exports.loadAndExecuteScript=loadAndExecuteScript,exports.loadCRN=loadCRN,exports.loadCubeMap=loadCubeMap,exports.loadImageFromTypedArray=loadImageFromTypedArray,exports.loadKTX=loadKTX,exports.measureText=measureText,exports.mergeSort=mergeSort,exports.mersenne_twister=MersenneTwister,exports.modernizeShader=modernizeShader,exports.moveTechniqueRenderStates=moveTechniqueRenderStates,exports.moveTechniquesToExtension=moveTechniquesToExtension,exports.numberOfComponentsForType=numberOfComponentsForType,exports.objectToQuery=objectToQuery,exports.oneTimeWarning=oneTimeWarning,exports.parseGlb=parseGlb,exports.parseResponseHeaders=parseResponseHeaders,exports.pointInsideTriangle=pointInsideTriangle,exports.processModelMaterialsCommon=processModelMaterialsCommon,exports.processPbrMaterials=processPbrMaterials,exports.protobuf_minimal=protobuf,exports.purify=purify,exports.queryToObject=queryToObject,exports.quickselect=quickselect,exports.rbush=RBush,exports.readAccessorPacked=readAccessorPacked,exports.removeExtensionsRequired=removeExtensionsRequired,exports.removeExtensionsUsed=removeExtensionsUsed,exports.removePipelineExtras=removePipelineExtras,exports.removeUnusedElements=removeUnusedElements,exports.requestAnimationFrame=requestAnimationFramePolyFill,exports.sampleTerrain=sampleTerrain,exports.sampleTerrainMostDetailed=sampleTerrainMostDetailed,exports.scaleToGeodeticSurface=scaleToGeodeticSurface,exports.sprintf=sprintf,exports.subdivideArray=subdivideArray,exports.subscribeAndEvaluate=subscribeAndEvaluate,exports.topojson=topojson,exports.updateAccessorComponentTypes=updateAccessorComponentTypes,exports.updateVersion=updateVersion,exports.viewerCesium3DTilesInspectorMixin=viewerCesium3DTilesInspectorMixin,exports.viewerCesiumInspectorMixin=viewerCesiumInspectorMixin,exports.viewerDragDropMixin=viewerDragDropMixin,exports.viewerPerformanceWatchdogMixin=viewerPerformanceWatchdogMixin,exports.webGLConstantToGlslType=webGLConstantToGlslType,exports.when=when,exports.wrapFunction=wrapFunction,exports.writeTextToCanvas=writeTextToCanvas,exports.zip=zip,Object.defineProperty(exports,"__esModule",{value:!0})}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Cesium={})}(this,function(exports){"use strict";function appendForwardSlash(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}function defined(e){return null!=e}function DeveloperError(e){var t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}defined(Object.create)&&(DeveloperError.prototype=Object.create(Error.prototype),DeveloperError.prototype.constructor=DeveloperError),DeveloperError.prototype.toString=function(){var e=this.name+": "+this.message;return defined(this.stack)&&(e+="\n"+this.stack.toString()),e},DeveloperError.throwInstantiationError=function(){throw new DeveloperError("This function defines an interface and should not be called directly.")};var Check={};function getUndefinedErrorMessage(e){return e+" is required, actual value was undefined"}function getFailedTypeErrorMessage(e,t,i){return"Expected "+i+" to be typeof "+t+", actual typeof was "+e}function defaultValue(e,t){return null!=e?e:t}function MersenneTwister(e){null==e&&(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,this.init_genrand(e)}Check.typeOf={},Check.defined=function(e,t){if(!defined(t))throw new DeveloperError(getUndefinedErrorMessage(e))},Check.typeOf.func=function(e,t){if("function"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"function",e))},Check.typeOf.string=function(e,t){if("string"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"string",e))},Check.typeOf.number=function(e,t){if("number"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"number",e))},Check.typeOf.number.lessThan=function(e,t,i){if(Check.typeOf.number(e,t),i<=t)throw new DeveloperError("Expected "+e+" to be less than "+i+", actual value was "+t)},Check.typeOf.number.lessThanOrEquals=function(e,t,i){if(Check.typeOf.number(e,t),i<t)throw new DeveloperError("Expected "+e+" to be less than or equal to "+i+", actual value was "+t)},Check.typeOf.number.greaterThan=function(e,t,i){if(Check.typeOf.number(e,t),t<=i)throw new DeveloperError("Expected "+e+" to be greater than "+i+", actual value was "+t)},Check.typeOf.number.greaterThanOrEquals=function(e,t,i){if(Check.typeOf.number(e,t),t<i)throw new DeveloperError("Expected "+e+" to be greater than or equal to"+i+", actual value was "+t)},Check.typeOf.object=function(e,t){if("object"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"object",e))},Check.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"boolean",e))},Check.typeOf.number.equals=function(e,t,i,r){if(Check.typeOf.number(e,i),Check.typeOf.number(t,r),i!==r)throw new DeveloperError(e+" must be equal to "+t+", the actual values are "+i+" and "+r)},defaultValue.EMPTY_OBJECT=Object.freeze({}),MersenneTwister.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},MersenneTwister.prototype.genrand_int32=function(){var e,t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_genrand(5489),t=0;t<this.N-this.M;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+this.M]^e>>>1^i[1&e];for(;t<this.N-1;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+(this.M-this.N)]^e>>>1^i[1&e];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^i[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},MersenneTwister.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var CesiumMath={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};CesiumMath.sign=defaultValue(Math.sign,function(e){return 0===(e=+e)||e!=e?e:0<e?1:-1}),CesiumMath.signNotZero=function(e){return e<0?-1:1},CesiumMath.toSNorm=function(e,t){return t=defaultValue(t,255),Math.round((.5*CesiumMath.clamp(e,-1,1)+.5)*t)},CesiumMath.fromSNorm=function(e,t){return t=defaultValue(t,255),CesiumMath.clamp(e,0,t)/t*2-1},CesiumMath.normalize=function(e,t,i){return 0===(i=Math.max(i-t,0))?0:CesiumMath.clamp((e-t)/i,0,1)},CesiumMath.sinh=defaultValue(Math.sinh,function(e){return(Math.exp(e)-Math.exp(-e))/2}),CesiumMath.cosh=defaultValue(Math.cosh,function(e){return(Math.exp(e)+Math.exp(-e))/2}),CesiumMath.lerp=function(e,t,i){return(1-i)*e+i*t},CesiumMath.PI=Math.PI,CesiumMath.ONE_OVER_PI=1/Math.PI,CesiumMath.PI_OVER_TWO=Math.PI/2,CesiumMath.PI_OVER_THREE=Math.PI/3,CesiumMath.PI_OVER_FOUR=Math.PI/4,CesiumMath.PI_OVER_SIX=Math.PI/6,CesiumMath.THREE_PI_OVER_TWO=3*Math.PI/2,CesiumMath.TWO_PI=2*Math.PI,CesiumMath.ONE_OVER_TWO_PI=1/(2*Math.PI),CesiumMath.RADIANS_PER_DEGREE=Math.PI/180,CesiumMath.DEGREES_PER_RADIAN=180/Math.PI,CesiumMath.RADIANS_PER_ARCSECOND=CesiumMath.RADIANS_PER_DEGREE/3600,CesiumMath.toRadians=function(e){return e*CesiumMath.RADIANS_PER_DEGREE},CesiumMath.toDegrees=function(e){return e*CesiumMath.DEGREES_PER_RADIAN},CesiumMath.convertLongitudeRange=function(e){var t=CesiumMath.TWO_PI,e=e-Math.floor(e/t)*t;return e<-Math.PI?e+t:e>=Math.PI?e-t:e},CesiumMath.clampToLatitudeRange=function(e){return CesiumMath.clamp(e,-1*CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO)},CesiumMath.negativePiToPi=function(e){return e>=-CesiumMath.PI&&e<=CesiumMath.PI?e:CesiumMath.zeroToTwoPi(e+CesiumMath.PI)-CesiumMath.PI},CesiumMath.zeroToTwoPi=function(e){if(0<=e&&e<=CesiumMath.TWO_PI)return e;var t=CesiumMath.mod(e,CesiumMath.TWO_PI);return Math.abs(t)<CesiumMath.EPSILON14&&Math.abs(e)>CesiumMath.EPSILON14?CesiumMath.TWO_PI:t},CesiumMath.mod=function(e,t){return CesiumMath.sign(e)===CesiumMath.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t},CesiumMath.equalsEpsilon=function(e,t,i,r){i=defaultValue(i,0),r=defaultValue(r,i);var n=Math.abs(e-t);return n<=r||n<=i*Math.max(Math.abs(e),Math.abs(t))},CesiumMath.lessThan=function(e,t,i){return e-t<-i},CesiumMath.lessThanOrEquals=function(e,t,i){return e-t<i},CesiumMath.greaterThan=function(e,t,i){return i<e-t},CesiumMath.greaterThanOrEquals=function(e,t,i){return-i<e-t};var factorials=[1];CesiumMath.factorial=function(e){var t=factorials.length;if(t<=e)for(var i=factorials[t-1],r=t;r<=e;r++){var n=i*r;factorials.push(n),i=n}return factorials[e]},CesiumMath.incrementWrap=function(e,t,i){return i=defaultValue(i,0),e=t<++e?i:e},CesiumMath.isPowerOfTwo=function(e){return 0!==e&&0==(e&e-1)},CesiumMath.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},CesiumMath.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e=((e|=e>>32)>>>0)-(e>>>1)},CesiumMath.clamp=function(e,t,i){return e<t?t:i<e?i:e};var randomNumberGenerator=new MersenneTwister;function Cartesian3(e,t,i){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.z=defaultValue(i,0)}CesiumMath.setRandomNumberSeed=function(e){randomNumberGenerator=new MersenneTwister(e)},CesiumMath.nextRandomNumber=function(){return randomNumberGenerator.random()},CesiumMath.randomBetween=function(e,t){return CesiumMath.nextRandomNumber()*(t-e)+e},CesiumMath.acosClamped=function(e){return Math.acos(CesiumMath.clamp(e,-1,1))},CesiumMath.asinClamped=function(e){return Math.asin(CesiumMath.clamp(e,-1,1))},CesiumMath.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},CesiumMath.logBase=function(e,t){return Math.log(e)/Math.log(t)},CesiumMath.cbrt=defaultValue(Math.cbrt,function(e){var t=Math.pow(Math.abs(e),1/3);return e<0?-t:t}),CesiumMath.log2=defaultValue(Math.log2,function(e){return Math.log(e)*Math.LOG2E}),CesiumMath.fog=function(e,t){t*=e;return 1-Math.exp(-t*t)},CesiumMath.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},CesiumMath.fastApproximateAtan2=function(e,t){var i=Math.abs(e),r=Math.abs(t),n=Math.max(i,r);r=Math.min(i,r);i=CesiumMath.fastApproximateAtan(r/n);return i=Math.abs(t)>Math.abs(e)?CesiumMath.PI_OVER_TWO-i:i,i=e<0?CesiumMath.PI-i:i,i=t<0?-i:i},Cartesian3.fromSpherical=function(e,t){defined(t)||(t=new Cartesian3);var i=e.clock,r=e.cone,n=defaultValue(e.magnitude,1),e=n*Math.sin(r);return t.x=e*Math.cos(i),t.y=e*Math.sin(i),t.z=n*Math.cos(r),t},Cartesian3.fromElements=function(e,t,i,r){return defined(r)?(r.x=e,r.y=t,r.z=i,r):new Cartesian3(e,t,i)},Cartesian3.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Cartesian3(e.x,e.y,e.z)},Cartesian3.fromCartesian4=Cartesian3.clone,Cartesian3.packedLength=3,Cartesian3.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i]=e.z,t},Cartesian3.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Cartesian3:i).x=e[t++],i.y=e[t++],i.z=e[t],i},Cartesian3.packArray=function(e,t){var i=e.length,r=3*i;if(defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;n<i;++n)Cartesian3.pack(e[n],t,3*n);return t},Cartesian3.unpackArray=function(e,t){var i=e.length;defined(t)?t.length=i/3:t=new Array(i/3);for(var r=0;r<i;r+=3){var n=r/3;t[n]=Cartesian3.unpack(e,r,t[n])}return t},Cartesian3.fromArray=Cartesian3.unpack,Cartesian3.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},Cartesian3.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},Cartesian3.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},Cartesian3.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},Cartesian3.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},Cartesian3.magnitude=function(e){return Math.sqrt(Cartesian3.magnitudeSquared(e))};var distanceScratch$3=new Cartesian3;Cartesian3.distance=function(e,t){return Cartesian3.subtract(e,t,distanceScratch$3),Cartesian3.magnitude(distanceScratch$3)},Cartesian3.distanceSquared=function(e,t){return Cartesian3.subtract(e,t,distanceScratch$3),Cartesian3.magnitudeSquared(distanceScratch$3)},Cartesian3.normalize=function(e,t){var i=Cartesian3.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t},Cartesian3.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},Cartesian3.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},Cartesian3.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i},Cartesian3.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},Cartesian3.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},Cartesian3.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},Cartesian3.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},Cartesian3.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},Cartesian3.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 lerpScratch$3=new Cartesian3;Cartesian3.lerp=function(e,t,i,r){return Cartesian3.multiplyByScalar(t,i,lerpScratch$3),r=Cartesian3.multiplyByScalar(e,1-i,r),Cartesian3.add(lerpScratch$3,r,r)};var angleBetweenScratch$1=new Cartesian3,angleBetweenScratch2$1=new Cartesian3;Cartesian3.angleBetween=function(e,t){Cartesian3.normalize(e,angleBetweenScratch$1),Cartesian3.normalize(t,angleBetweenScratch2$1);e=Cartesian3.dot(angleBetweenScratch$1,angleBetweenScratch2$1),t=Cartesian3.magnitude(Cartesian3.cross(angleBetweenScratch$1,angleBetweenScratch2$1,angleBetweenScratch$1));return Math.atan2(t,e)};var mostOrthogonalAxisScratch$2=new Cartesian3;Cartesian3.mostOrthogonalAxis=function(e,t){e=Cartesian3.normalize(e,mostOrthogonalAxisScratch$2);return Cartesian3.abs(e,e),t=e.x<=e.y?e.x<=e.z?Cartesian3.clone(Cartesian3.UNIT_X,t):Cartesian3.clone(Cartesian3.UNIT_Z,t):e.y<=e.z?Cartesian3.clone(Cartesian3.UNIT_Y,t):Cartesian3.clone(Cartesian3.UNIT_Z,t)},Cartesian3.projectVector=function(e,t,i){e=Cartesian3.dot(e,t)/Cartesian3.dot(t,t);return Cartesian3.multiplyByScalar(t,e,i)},Cartesian3.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},Cartesian3.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},Cartesian3.equalsEpsilon=function(e,t,i,r){return e===t||defined(e)&&defined(t)&&CesiumMath.equalsEpsilon(e.x,t.x,i,r)&&CesiumMath.equalsEpsilon(e.y,t.y,i,r)&&CesiumMath.equalsEpsilon(e.z,t.z,i,r)},Cartesian3.cross=function(e,t,i){var r=e.x,n=e.y,a=e.z,o=t.x,s=t.y,e=t.z,t=a*o-r*e,o=r*s-n*o;return i.x=n*e-a*s,i.y=t,i.z=o,i},Cartesian3.midpoint=function(e,t,i){return i.x=.5*(e.x+t.x),i.y=.5*(e.y+t.y),i.z=.5*(e.z+t.z),i},Cartesian3.fromDegrees=function(e,t,i,r,n){return e=CesiumMath.toRadians(e),t=CesiumMath.toRadians(t),Cartesian3.fromRadians(e,t,i,r,n)};var scratchN=new Cartesian3,scratchK=new Cartesian3,wgs84RadiiSquared=new Cartesian3(40680631590769,40680631590769,40408299984661.445);Cartesian3.fromRadians=function(e,t,i,r,n){i=defaultValue(i,0);var a=defined(r)?r.radiiSquared:wgs84RadiiSquared,r=Math.cos(t);scratchN.x=r*Math.cos(e),scratchN.y=r*Math.sin(e),scratchN.z=Math.sin(t),scratchN=Cartesian3.normalize(scratchN,scratchN),Cartesian3.multiplyComponents(a,scratchN,scratchK);a=Math.sqrt(Cartesian3.dot(scratchN,scratchK));return scratchK=Cartesian3.divideByScalar(scratchK,a,scratchK),scratchN=Cartesian3.multiplyByScalar(scratchN,i,scratchN),defined(n)||(n=new Cartesian3),Cartesian3.add(scratchK,scratchN,n)},Cartesian3.fromDegreesArray=function(e,t,i){var r=e.length;defined(i)?i.length=r/2:i=new Array(r/2);for(var n=0;n<r;n+=2){var a=e[n],o=e[n+1],s=n/2;i[s]=Cartesian3.fromDegrees(a,o,0,t,i[s])}return i},Cartesian3.fromRadiansArray=function(e,t,i){var r=e.length;defined(i)?i.length=r/2:i=new Array(r/2);for(var n=0;n<r;n+=2){var a=e[n],o=e[n+1],s=n/2;i[s]=Cartesian3.fromRadians(a,o,0,t,i[s])}return i},Cartesian3.fromDegreesArrayHeights=function(e,t,i){var r=e.length;defined(i)?i.length=r/3:i=new Array(r/3);for(var n=0;n<r;n+=3){var a=e[n],o=e[n+1],s=e[n+2],l=n/3;i[l]=Cartesian3.fromDegrees(a,o,s,t,i[l])}return i},Cartesian3.fromRadiansArrayHeights=function(e,t,i){var r=e.length;defined(i)?i.length=r/3:i=new Array(r/3);for(var n=0;n<r;n+=3){var a=e[n],o=e[n+1],s=e[n+2],l=n/3;i[l]=Cartesian3.fromRadians(a,o,s,t,i[l])}return i},Cartesian3.ZERO=Object.freeze(new Cartesian3(0,0,0)),Cartesian3.UNIT_X=Object.freeze(new Cartesian3(1,0,0)),Cartesian3.UNIT_Y=Object.freeze(new Cartesian3(0,1,0)),Cartesian3.UNIT_Z=Object.freeze(new Cartesian3(0,0,1)),Cartesian3.prototype.clone=function(e){return Cartesian3.clone(this,e)},Cartesian3.prototype.equals=function(e){return Cartesian3.equals(this,e)},Cartesian3.prototype.equalsEpsilon=function(e,t,i){return Cartesian3.equalsEpsilon(this,e,t,i)},Cartesian3.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};var scaleToGeodeticSurfaceIntersection=new Cartesian3,scaleToGeodeticSurfaceGradient=new Cartesian3;function scaleToGeodeticSurface(e,t,i,r,n){var a=e.x,o=e.y,s=e.z,l=t.x,c=t.y,t=t.z,u=a*a*l*l,d=o*o*c*c,h=s*s*t*t,l=u+d+h,c=Math.sqrt(1/l),t=Cartesian3.multiplyByScalar(e,c,scaleToGeodeticSurfaceIntersection);if(l<r)return isFinite(c)?Cartesian3.clone(t,n):void 0;var p=i.x,m=i.y,f=i.z,i=scaleToGeodeticSurfaceGradient;i.x=t.x*p*2,i.y=t.y*m*2,i.z=t.z*f*2;var g=(1-c)*Cartesian3.magnitude(e)/(.5*Cartesian3.magnitude(i)),_=0;do{var y,C,v,S,T,x,b,_=(b=u*(S=(y=1/(1+(g-=_)*p))*y)+d*(T=(C=1/(1+g*m))*C)+h*(x=(v=1/(1+g*f))*v)-1)/(-2*(u*(S*y)*p+d*(T*C)*m+h*(x*v)*f))}while(Math.abs(b)>CesiumMath.EPSILON12);return defined(n)?(n.x=a*y,n.y=o*C,n.z=s*v,n):new Cartesian3(a*y,o*C,s*v)}function Cartographic(e,t,i){this.longitude=defaultValue(e,0),this.latitude=defaultValue(t,0),this.height=defaultValue(i,0)}Cartographic.fromRadians=function(e,t,i,r){return i=defaultValue(i,0),defined(r)?(r.longitude=e,r.latitude=t,r.height=i,r):new Cartographic(e,t,i)},Cartographic.fromDegrees=function(e,t,i,r){return e=CesiumMath.toRadians(e),t=CesiumMath.toRadians(t),Cartographic.fromRadians(e,t,i,r)};var cartesianToCartographicN$1=new Cartesian3,cartesianToCartographicP$1=new Cartesian3,cartesianToCartographicH$1=new Cartesian3,wgs84OneOverRadii=new Cartesian3(1/6378137,1/6378137,1/6356752.314245179),wgs84OneOverRadiiSquared=new Cartesian3(1/40680631590769,1/40680631590769,1/40408299984661.445),wgs84CenterToleranceSquared=CesiumMath.EPSILON1;function initialize$8(e,t,i,r){t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,0),e._radii=new Cartesian3(t,i,r),e._radiiSquared=new Cartesian3(t*t,i*i,r*r),e._radiiToTheFourth=new Cartesian3(t*t*t*t,i*i*i*i,r*r*r*r),e._oneOverRadii=new Cartesian3(0===t?0:1/t,0===i?0:1/i,0===r?0:1/r),e._oneOverRadiiSquared=new Cartesian3(0===t?0:1/(t*t),0===i?0:1/(i*i),0===r?0:1/(r*r)),e._minimumRadius=Math.min(t,i,r),e._maximumRadius=Math.max(t,i,r),e._centerToleranceSquared=CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ellipsoid(e,t,i){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,initialize$8(this,e,t,i)}Cartographic.fromCartesian=function(e,t,i){var r=defined(t)?t.oneOverRadii:wgs84OneOverRadii,n=defined(t)?t.oneOverRadiiSquared:wgs84OneOverRadiiSquared,r=scaleToGeodeticSurface(e,r,n,defined(t)?t._centerToleranceSquared:wgs84CenterToleranceSquared,cartesianToCartographicP$1);if(defined(r)){t=Cartesian3.multiplyComponents(r,n,cartesianToCartographicN$1),t=Cartesian3.normalize(t,t),n=Cartesian3.subtract(e,r,cartesianToCartographicH$1),r=Math.atan2(t.y,t.x),t=Math.asin(t.z),n=CesiumMath.sign(Cartesian3.dot(n,e))*Cartesian3.magnitude(n);return defined(i)?(i.longitude=r,i.latitude=t,i.height=n,i):new Cartographic(r,t,n)}},Cartographic.toCartesian=function(e,t,i){return Cartesian3.fromRadians(e.longitude,e.latitude,e.height,t,i)},Cartographic.clone=function(e,t){if(defined(e))return defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Cartographic(e.longitude,e.latitude,e.height)},Cartographic.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},Cartographic.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},Cartographic.ZERO=Object.freeze(new Cartographic(0,0,0)),Cartographic.prototype.clone=function(e){return Cartographic.clone(this,e)},Cartographic.prototype.equals=function(e){return Cartographic.equals(this,e)},Cartographic.prototype.equalsEpsilon=function(e,t){return Cartographic.equalsEpsilon(this,e,t)},Cartographic.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(Ellipsoid.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}}}),Ellipsoid.clone=function(e,t){if(defined(e)){var i=e._radii;return defined(t)?(Cartesian3.clone(i,t._radii),Cartesian3.clone(e._radiiSquared,t._radiiSquared),Cartesian3.clone(e._radiiToTheFourth,t._radiiToTheFourth),Cartesian3.clone(e._oneOverRadii,t._oneOverRadii),Cartesian3.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ellipsoid(i.x,i.y,i.z)}},Ellipsoid.fromCartesian3=function(e,t){return defined(t)||(t=new Ellipsoid),defined(e)&&initialize$8(t,e.x,e.y,e.z),t},Ellipsoid.WGS84=Object.freeze(new Ellipsoid(6378137,6378137,6356752.314245179)),Ellipsoid.UNIT_SPHERE=Object.freeze(new Ellipsoid(1,1,1)),Ellipsoid.MOON=Object.freeze(new Ellipsoid(CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS)),Ellipsoid.prototype.clone=function(e){return Ellipsoid.clone(this,e)},Ellipsoid.packedLength=Cartesian3.packedLength,Ellipsoid.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._radii,t,i),t},Ellipsoid.unpack=function(e,t,i){t=defaultValue(t,0);t=Cartesian3.unpack(e,t);return Ellipsoid.fromCartesian3(t,i)},Ellipsoid.prototype.geocentricSurfaceNormal=Cartesian3.normalize,Ellipsoid.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,r=e.latitude,n=Math.cos(r),e=n*Math.cos(i),i=n*Math.sin(i),r=Math.sin(r);return(t=!defined(t)?new Cartesian3:t).x=e,t.y=i,t.z=r,Cartesian3.normalize(t,t)},Ellipsoid.prototype.geodeticSurfaceNormal=function(e,t){if(!Cartesian3.equalsEpsilon(e,Cartesian3.ZERO,CesiumMath.EPSILON14))return defined(t)||(t=new Cartesian3),t=Cartesian3.multiplyComponents(e,this._oneOverRadiiSquared,t),Cartesian3.normalize(t,t)};var cartographicToCartesianNormal=new Cartesian3,cartographicToCartesianK=new Cartesian3;Ellipsoid.prototype.cartographicToCartesian=function(e,t){var i=cartographicToCartesianNormal,r=cartographicToCartesianK;this.geodeticSurfaceNormalCartographic(e,i),Cartesian3.multiplyComponents(this._radiiSquared,i,r);var n=Math.sqrt(Cartesian3.dot(i,r));return Cartesian3.divideByScalar(r,n,r),Cartesian3.multiplyByScalar(i,e.height,i),defined(t)||(t=new Cartesian3),Cartesian3.add(r,i,t)},Ellipsoid.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;defined(t)?t.length=i:t=new Array(i);for(var r=0;r<i;r++)t[r]=this.cartographicToCartesian(e[r],t[r]);return t};var cartesianToCartographicN=new Cartesian3,cartesianToCartographicP=new Cartesian3,cartesianToCartographicH=new Cartesian3;Ellipsoid.prototype.cartesianToCartographic=function(e,t){var i=this.scaleToGeodeticSurface(e,cartesianToCartographicP);if(defined(i)){var r=this.geodeticSurfaceNormal(i,cartesianToCartographicN),n=Cartesian3.subtract(e,i,cartesianToCartographicH),i=Math.atan2(r.y,r.x),r=Math.asin(r.z),n=CesiumMath.sign(Cartesian3.dot(n,e))*Cartesian3.magnitude(n);return defined(t)?(t.longitude=i,t.latitude=r,t.height=n,t):new Cartographic(i,r,n)}},Ellipsoid.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;defined(t)?t.length=i:t=new Array(i);for(var r=0;r<i;++r)t[r]=this.cartesianToCartographic(e[r],t[r]);return t},Ellipsoid.prototype.scaleToGeodeticSurface=function(e,t){return scaleToGeodeticSurface(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},Ellipsoid.prototype.scaleToGeocentricSurface=function(e,t){defined(t)||(t=new Cartesian3);var i=e.x,r=e.y,n=e.z,a=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*a.x+r*r*a.y+n*n*a.z);return Cartesian3.multiplyByScalar(e,a,t)},Ellipsoid.prototype.transformPositionToScaledSpace=function(e,t){return defined(t)||(t=new Cartesian3),Cartesian3.multiplyComponents(e,this._oneOverRadii,t)},Ellipsoid.prototype.transformPositionFromScaledSpace=function(e,t){return defined(t)||(t=new Cartesian3),Cartesian3.multiplyComponents(e,this._radii,t)},Ellipsoid.prototype.equals=function(e){return this===e||defined(e)&&Cartesian3.equals(this._radii,e._radii)},Ellipsoid.prototype.toString=function(){return this._radii.toString()},Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,i){t=defaultValue(t,0);var r=this._squaredXOverSquaredZ;if((i=!defined(i)?new Cartesian3:i).x=0,i.y=0,i.z=e.z*(1-r),!(Math.abs(i.z)>=this._radii.z-t))return i};var abscissas=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],weights=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function gaussLegendreQuadrature(e,t,i){for(var r=.5*(t+e),n=.5*(t-e),a=0,o=0;o<5;o++){var s=n*abscissas[o];a+=weights[o]*(i(r+s)+i(r-s))}return a*=n}function GeographicProjection(e){this._ellipsoid=defaultValue(e,Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Ellipsoid.prototype.surfaceArea=function(e){for(var t=e.west,n=e.east,i=e.south,r=e.north;n<t;)n+=CesiumMath.TWO_PI;var e=this._radiiSquared,a=e.x,o=e.y,s=e.z,l=a*o;return gaussLegendreQuadrature(i,r,function(e){var i=Math.cos(e),r=Math.sin(e);return Math.cos(e)*gaussLegendreQuadrature(t,n,function(e){var t=Math.cos(e),e=Math.sin(e);return Math.sqrt(l*r*r+s*(o*t*t+a*e*e)*i*i)})})},Object.defineProperties(GeographicProjection.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),GeographicProjection.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,i=e.latitude*i,e=e.height;return defined(t)?(t.x=r,t.y=i,t.z=e,t):new Cartesian3(r,i,e)},GeographicProjection.prototype.unproject=function(e,t){var i=this._oneOverSemimajorAxis,r=e.x*i,i=e.y*i,e=e.z;return defined(t)?(t.longitude=r,t.latitude=i,t.height=e,t):new Cartographic(r,i,e)};var Intersect={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Intersect$1=Object.freeze(Intersect);function Interval(e,t){this.start=defaultValue(e,0),this.stop=defaultValue(t,0)}function Matrix3(e,t,i,r,n,a,o,s,l){this[0]=defaultValue(e,0),this[1]=defaultValue(r,0),this[2]=defaultValue(o,0),this[3]=defaultValue(t,0),this[4]=defaultValue(n,0),this[5]=defaultValue(s,0),this[6]=defaultValue(i,0),this[7]=defaultValue(a,0),this[8]=defaultValue(l,0)}Matrix3.packedLength=9,Matrix3.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t},Matrix3.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Matrix3:i)[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},Matrix3.clone=function(e,t){if(defined(e))return defined(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 Matrix3(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},Matrix3.fromArray=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Matrix3:i)[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},Matrix3.fromColumnMajorArray=function(e,t){return Matrix3.clone(e,t)},Matrix3.fromRowMajorArray=function(e,t){return defined(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 Matrix3(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},Matrix3.fromQuaternion=function(e,t){var i=e.x*e.x,r=e.x*e.y,n=e.x*e.z,a=e.x*e.w,o=e.y*e.y,s=e.y*e.z,l=e.y*e.w,c=e.z*e.z,u=e.z*e.w,d=e.w*e.w,h=i-o-c+d,p=2*(r-u),m=2*(n+l),e=2*(r+u),r=o-i-c+d,u=2*(s-a),l=2*(n-l),a=2*(s+a),d=-i-o+c+d;return defined(t)?(t[0]=h,t[1]=e,t[2]=l,t[3]=p,t[4]=r,t[5]=a,t[6]=m,t[7]=u,t[8]=d,t):new Matrix3(h,p,m,e,r,u,l,a,d)},Matrix3.fromHeadingPitchRoll=function(e,t){var i=Math.cos(-e.pitch),r=Math.cos(-e.heading),n=Math.cos(e.roll),a=Math.sin(-e.pitch),o=Math.sin(-e.heading),s=Math.sin(e.roll),l=i*r,c=-n*o+s*a*r,u=s*o+n*a*r,d=i*o,e=n*r+s*a*o,o=-s*r+n*a*o,a=-a,s=s*i,i=n*i;return defined(t)?(t[0]=l,t[1]=d,t[2]=a,t[3]=c,t[4]=e,t[5]=s,t[6]=u,t[7]=o,t[8]=i,t):new Matrix3(l,c,u,d,e,o,a,s,i)},Matrix3.fromScale=function(e,t){return defined(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 Matrix3(e.x,0,0,0,e.y,0,0,0,e.z)},Matrix3.fromUniformScale=function(e,t){return defined(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 Matrix3(e,0,0,0,e,0,0,0,e)},Matrix3.fromCrossProduct=function(e,t){return defined(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 Matrix3(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},Matrix3.fromRotationX=function(e,t){var i=Math.cos(e),e=Math.sin(e);return defined(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=e,t[6]=0,t[7]=-e,t[8]=i,t):new Matrix3(1,0,0,0,i,-e,0,e,i)},Matrix3.fromRotationY=function(e,t){var i=Math.cos(e),e=Math.sin(e);return defined(t)?(t[0]=i,t[1]=0,t[2]=-e,t[3]=0,t[4]=1,t[5]=0,t[6]=e,t[7]=0,t[8]=i,t):new Matrix3(i,0,e,0,1,0,-e,0,i)},Matrix3.fromRotationZ=function(e,t){var i=Math.cos(e),e=Math.sin(e);return defined(t)?(t[0]=i,t[1]=e,t[2]=0,t[3]=-e,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Matrix3(i,-e,0,e,i,0,0,0,1)},Matrix3.toArray=function(e,t){return defined(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]]},Matrix3.getElementIndex=function(e,t){return 3*e+t},Matrix3.getColumn=function(e,t,i){var r=3*t,n=e[r],t=e[1+r],r=e[2+r];return i.x=n,i.y=t,i.z=r,i},Matrix3.setColumn=function(e,t,i,r){t*=3;return(r=Matrix3.clone(e,r))[t]=i.x,r[1+t]=i.y,r[2+t]=i.z,r},Matrix3.getRow=function(e,t,i){var r=e[t],n=e[t+3],t=e[t+6];return i.x=r,i.y=n,i.z=t,i},Matrix3.setRow=function(e,t,i,r){return(r=Matrix3.clone(e,r))[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var scratchColumn$2=new Cartesian3;Matrix3.getScale=function(e,t){return t.x=Cartesian3.magnitude(Cartesian3.fromElements(e[0],e[1],e[2],scratchColumn$2)),t.y=Cartesian3.magnitude(Cartesian3.fromElements(e[3],e[4],e[5],scratchColumn$2)),t.z=Cartesian3.magnitude(Cartesian3.fromElements(e[6],e[7],e[8],scratchColumn$2)),t};var scratchScale$8=new Cartesian3;Matrix3.getMaximumScale=function(e){return Matrix3.getScale(e,scratchScale$8),Cartesian3.maximumComponent(scratchScale$8)},Matrix3.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],u=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],t=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=a,i[3]=o,i[4]=s,i[5]=l,i[6]=c,i[7]=u,i[8]=t,i},Matrix3.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},Matrix3.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},Matrix3.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,a=t.z,o=e[0]*r+e[3]*n+e[6]*a,t=e[1]*r+e[4]*n+e[7]*a,a=e[2]*r+e[5]*n+e[8]*a;return i.x=o,i.y=t,i.z=a,i},Matrix3.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},Matrix3.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},Matrix3.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},Matrix3.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],a=e[1],o=e[4],s=e[7],l=e[2],c=e[5],e=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=l,t[7]=c,t[8]=e,t};var UNIT=new Cartesian3(1,1,1);function computeFrobeniusNorm(e){for(var t=0,i=0;i<9;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}Matrix3.getRotation=function(e,t){var i=Cartesian3.divideComponents(UNIT,Matrix3.getScale(e,scratchScale$8),scratchScale$8);return t=Matrix3.multiplyByScale(e,i,t)};var rowVal=[1,0,0],colVal=[2,2,1];function offDiagonalFrobeniusNorm(e){for(var t=0,i=0;i<3;++i){var r=e[Matrix3.getElementIndex(colVal[i],rowVal[i])];t+=2*r*r}return Math.sqrt(t)}function shurDecomposition(e,t){for(var i=CesiumMath.EPSILON15,r=0,n=1,a=0;a<3;++a){var o=Math.abs(e[Matrix3.getElementIndex(colVal[a],rowVal[a])]);r<o&&(n=a,r=o)}var s=1,l=0,c=rowVal[n],u=colVal[n];return Math.abs(e[Matrix3.getElementIndex(u,c)])>i&&(l=(i=(i=(e[Matrix3.getElementIndex(u,u)]-e[Matrix3.getElementIndex(c,c)])/2/e[Matrix3.getElementIndex(u,c)])<0?-1/(-i+Math.sqrt(1+i*i)):1/(i+Math.sqrt(1+i*i)))*(s=1/Math.sqrt(1+i*i))),(t=Matrix3.clone(Matrix3.IDENTITY,t))[Matrix3.getElementIndex(c,c)]=t[Matrix3.getElementIndex(u,u)]=s,t[Matrix3.getElementIndex(u,c)]=l,t[Matrix3.getElementIndex(c,u)]=-l,t}var jMatrix=new Matrix3,jMatrixTranspose=new Matrix3;Matrix3.computeEigenDecomposition=function(e,t){for(var i=CesiumMath.EPSILON20,r=0,n=0,a=(t=!defined(t)?{}:t).unitary=Matrix3.clone(Matrix3.IDENTITY,t.unitary),o=t.diagonal=Matrix3.clone(e,t.diagonal),s=i*computeFrobeniusNorm(o);n<10&&offDiagonalFrobeniusNorm(o)>s;)shurDecomposition(o,jMatrix),Matrix3.transpose(jMatrix,jMatrixTranspose),Matrix3.multiply(o,jMatrix,o),Matrix3.multiply(jMatrixTranspose,o,o),Matrix3.multiply(a,jMatrix,a),2<++r&&(++n,r=0);return t},Matrix3.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},Matrix3.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],a=e[4],o=e[7],s=e[2],l=e[5],e=e[8];return t*(a*e-l*o)+n*(l*r-i*e)+s*(i*o-a*r)},Matrix3.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],e=Matrix3.determinant(e);return t[0]=o*u-c*s,t[1]=c*n-r*u,t[2]=r*s-o*n,t[3]=l*s-a*u,t[4]=i*u-l*n,t[5]=a*n-i*s,t[6]=a*c-l*o,t[7]=l*r-i*c,t[8]=i*o-a*r,Matrix3.multiplyByScalar(t,1/e,t)};var scratchTransposeMatrix$1=new Matrix3;function Cartesian4(e,t,i,r){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.z=defaultValue(i,0),this.w=defaultValue(r,0)}Matrix3.inverseTranspose=function(e,t){return Matrix3.inverse(Matrix3.transpose(e,scratchTransposeMatrix$1),t)},Matrix3.equals=function(e,t){return e===t||defined(e)&&defined(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]},Matrix3.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},Matrix3.IDENTITY=Object.freeze(new Matrix3(1,0,0,0,1,0,0,0,1)),Matrix3.ZERO=Object.freeze(new Matrix3(0,0,0,0,0,0,0,0,0)),Matrix3.COLUMN0ROW0=0,Matrix3.COLUMN0ROW1=1,Matrix3.COLUMN0ROW2=2,Matrix3.COLUMN1ROW0=3,Matrix3.COLUMN1ROW1=4,Matrix3.COLUMN1ROW2=5,Matrix3.COLUMN2ROW0=6,Matrix3.COLUMN2ROW1=7,Matrix3.COLUMN2ROW2=8,Object.defineProperties(Matrix3.prototype,{length:{get:function(){return Matrix3.packedLength}}}),Matrix3.prototype.clone=function(e){return Matrix3.clone(this,e)},Matrix3.prototype.equals=function(e){return Matrix3.equals(this,e)},Matrix3.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},Matrix3.prototype.equalsEpsilon=function(e,t){return Matrix3.equalsEpsilon(this,e,t)},Matrix3.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},Cartesian4.fromElements=function(e,t,i,r,n){return defined(n)?(n.x=e,n.y=t,n.z=i,n.w=r,n):new Cartesian4(e,t,i,r)},Cartesian4.fromColor=function(e,t){return defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Cartesian4(e.red,e.green,e.blue,e.alpha)},Cartesian4.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Cartesian4(e.x,e.y,e.z,e.w)},Cartesian4.packedLength=4,Cartesian4.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},Cartesian4.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Cartesian4:i).x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},Cartesian4.packArray=function(e,t){var i=e.length,r=4*i;if(defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;n<i;++n)Cartesian4.pack(e[n],t,4*n);return t},Cartesian4.unpackArray=function(e,t){var i=e.length;defined(t)?t.length=i/4:t=new Array(i/4);for(var r=0;r<i;r+=4){var n=r/4;t[n]=Cartesian4.unpack(e,r,t[n])}return t},Cartesian4.fromArray=Cartesian4.unpack,Cartesian4.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},Cartesian4.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},Cartesian4.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},Cartesian4.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},Cartesian4.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Cartesian4.magnitude=function(e){return Math.sqrt(Cartesian4.magnitudeSquared(e))};var distanceScratch$2=new Cartesian4;Cartesian4.distance=function(e,t){return Cartesian4.subtract(e,t,distanceScratch$2),Cartesian4.magnitude(distanceScratch$2)},Cartesian4.distanceSquared=function(e,t){return Cartesian4.subtract(e,t,distanceScratch$2),Cartesian4.magnitudeSquared(distanceScratch$2)},Cartesian4.normalize=function(e,t){var i=Cartesian4.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,t},Cartesian4.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Cartesian4.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},Cartesian4.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i.w=e.w/t.w,i},Cartesian4.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},Cartesian4.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},Cartesian4.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},Cartesian4.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},Cartesian4.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Cartesian4.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 lerpScratch$2=new Cartesian4;Cartesian4.lerp=function(e,t,i,r){return Cartesian4.multiplyByScalar(t,i,lerpScratch$2),r=Cartesian4.multiplyByScalar(e,1-i,r),Cartesian4.add(lerpScratch$2,r,r)};var mostOrthogonalAxisScratch$1=new Cartesian4;Cartesian4.mostOrthogonalAxis=function(e,t){e=Cartesian4.normalize(e,mostOrthogonalAxisScratch$1);return Cartesian4.abs(e,e),t=e.x<=e.y?e.x<=e.z?e.x<=e.w?Cartesian4.clone(Cartesian4.UNIT_X,t):Cartesian4.clone(Cartesian4.UNIT_W,t):e.z<=e.w?Cartesian4.clone(Cartesian4.UNIT_Z,t):Cartesian4.clone(Cartesian4.UNIT_W,t):e.y<=e.z?e.y<=e.w?Cartesian4.clone(Cartesian4.UNIT_Y,t):Cartesian4.clone(Cartesian4.UNIT_W,t):e.z<=e.w?Cartesian4.clone(Cartesian4.UNIT_Z,t):Cartesian4.clone(Cartesian4.UNIT_W,t)},Cartesian4.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Cartesian4.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},Cartesian4.equalsEpsilon=function(e,t,i,r){return e===t||defined(e)&&defined(t)&&CesiumMath.equalsEpsilon(e.x,t.x,i,r)&&CesiumMath.equalsEpsilon(e.y,t.y,i,r)&&CesiumMath.equalsEpsilon(e.z,t.z,i,r)&&CesiumMath.equalsEpsilon(e.w,t.w,i,r)},Cartesian4.ZERO=Object.freeze(new Cartesian4(0,0,0,0)),Cartesian4.UNIT_X=Object.freeze(new Cartesian4(1,0,0,0)),Cartesian4.UNIT_Y=Object.freeze(new Cartesian4(0,1,0,0)),Cartesian4.UNIT_Z=Object.freeze(new Cartesian4(0,0,1,0)),Cartesian4.UNIT_W=Object.freeze(new Cartesian4(0,0,0,1)),Cartesian4.prototype.clone=function(e){return Cartesian4.clone(this,e)},Cartesian4.prototype.equals=function(e){return Cartesian4.equals(this,e)},Cartesian4.prototype.equalsEpsilon=function(e,t,i){return Cartesian4.equalsEpsilon(this,e,t,i)},Cartesian4.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var scratchF32Array=new Float32Array(1),scratchU8Array=new Uint8Array(scratchF32Array.buffer),testU32=new Uint32Array([287454020]),testU8=new Uint8Array(testU32.buffer),littleEndian=68===testU8[0];function RuntimeError(e){var t;this.name="RuntimeError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}function Matrix4(e,t,i,r,n,a,o,s,l,c,u,d,h,p,m,f){this[0]=defaultValue(e,0),this[1]=defaultValue(n,0),this[2]=defaultValue(l,0),this[3]=defaultValue(h,0),this[4]=defaultValue(t,0),this[5]=defaultValue(a,0),this[6]=defaultValue(c,0),this[7]=defaultValue(p,0),this[8]=defaultValue(i,0),this[9]=defaultValue(o,0),this[10]=defaultValue(u,0),this[11]=defaultValue(m,0),this[12]=defaultValue(r,0),this[13]=defaultValue(s,0),this[14]=defaultValue(d,0),this[15]=defaultValue(f,0)}Cartesian4.packFloat=function(e,t){return defined(t)||(t=new Cartesian4),scratchF32Array[0]=e,littleEndian?(t.x=scratchU8Array[0],t.y=scratchU8Array[1],t.z=scratchU8Array[2],t.w=scratchU8Array[3]):(t.x=scratchU8Array[3],t.y=scratchU8Array[2],t.z=scratchU8Array[1],t.w=scratchU8Array[0]),t},Cartesian4.unpackFloat=function(e){return littleEndian?(scratchU8Array[0]=e.x,scratchU8Array[1]=e.y,scratchU8Array[2]=e.z,scratchU8Array[3]=e.w):(scratchU8Array[0]=e.w,scratchU8Array[1]=e.z,scratchU8Array[2]=e.y,scratchU8Array[3]=e.x),scratchF32Array[0]},defined(Object.create)&&(RuntimeError.prototype=Object.create(Error.prototype),RuntimeError.prototype.constructor=RuntimeError),RuntimeError.prototype.toString=function(){var e=this.name+": "+this.message;return defined(this.stack)&&(e+="\n"+this.stack.toString()),e},Matrix4.packedLength=16,Matrix4.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t[i++]=e[9],t[i++]=e[10],t[i++]=e[11],t[i++]=e[12],t[i++]=e[13],t[i++]=e[14],t[i]=e[15],t},Matrix4.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Matrix4:i)[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},Matrix4.clone=function(e,t){if(defined(e))return defined(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 Matrix4(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])},Matrix4.fromArray=Matrix4.unpack,Matrix4.fromColumnMajorArray=function(e,t){return Matrix4.clone(e,t)},Matrix4.fromRowMajorArray=function(e,t){return defined(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 Matrix4(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])},Matrix4.fromRotationTranslation=function(e,t,i){return t=defaultValue(t,Cartesian3.ZERO),defined(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i):new Matrix4(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)},Matrix4.fromTranslationQuaternionRotationScale=function(e,t,i,r){defined(r)||(r=new Matrix4);var n=i.x,a=i.y,o=i.z,s=t.x*t.x,l=t.x*t.y,c=t.x*t.z,u=t.x*t.w,d=t.y*t.y,h=t.y*t.z,p=t.y*t.w,m=t.z*t.z,f=t.z*t.w,g=t.w*t.w,_=2*(l-f),i=2*(c+p),t=2*(l+f),l=d-s-m+g,f=2*(h-u),p=2*(c-p),h=2*(h+u),u=-s-d+m+g;return r[0]=(s-d-m+g)*n,r[1]=t*n,r[2]=p*n,r[3]=0,r[4]=_*a,r[5]=l*a,r[6]=h*a,r[7]=0,r[8]=i*o,r[9]=f*o,r[10]=u*o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},Matrix4.fromTranslationRotationScale=function(e,t){return Matrix4.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},Matrix4.fromTranslation=function(e,t){return Matrix4.fromRotationTranslation(Matrix3.IDENTITY,e,t)},Matrix4.fromScale=function(e,t){return defined(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 Matrix4(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},Matrix4.fromUniformScale=function(e,t){return defined(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 Matrix4(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var fromCameraF=new Cartesian3,fromCameraR=new Cartesian3,fromCameraU=new Cartesian3;Matrix4.fromCamera=function(e,t){var i=e.position,r=e.direction,n=e.up;Cartesian3.normalize(r,fromCameraF),Cartesian3.normalize(Cartesian3.cross(fromCameraF,n,fromCameraR),fromCameraR),Cartesian3.normalize(Cartesian3.cross(fromCameraR,fromCameraF,fromCameraU),fromCameraU);var a=fromCameraR.x,o=fromCameraR.y,s=fromCameraR.z,l=fromCameraF.x,c=fromCameraF.y,u=fromCameraF.z,d=fromCameraU.x,h=fromCameraU.y,p=fromCameraU.z,m=i.x,e=i.y,r=i.z,n=a*-m+o*-e+s*-r,i=d*-m+h*-e+p*-r,r=l*m+c*e+u*r;return defined(t)?(t[0]=a,t[1]=d,t[2]=-l,t[3]=0,t[4]=o,t[5]=h,t[6]=-c,t[7]=0,t[8]=s,t[9]=p,t[10]=-u,t[11]=0,t[12]=n,t[13]=i,t[14]=r,t[15]=1,t):new Matrix4(a,o,s,n,d,h,p,i,-l,-c,-u,r,0,0,0,1)},Matrix4.computePerspectiveFieldOfView=function(e,t,i,r,n){var a=1/Math.tan(.5*e),e=(r+i)/(i-r),r=2*r*i/(i-r);return n[0]=a/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e,n[11]=-1,n[12]=0,n[13]=0,n[14]=r,n[15]=0,n},Matrix4.computeOrthographicOffCenter=function(e,t,i,r,n,a,o){var s=1/(t-e),l=1/(r-i),c=1/(a-n),e=-(t+e)*s,i=-(r+i)*l,n=-(a+n)*c;return l*=2,c*=-2,o[0]=s*=2,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=l,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=e,o[13]=i,o[14]=n,o[15]=1,o},Matrix4.computePerspectiveOffCenter=function(e,t,i,r,n,a,o){var s=2*n/(r-i),l=(t+e)/(t-e),r=(r+i)/(r-i),i=-(a+n)/(a-n),a=-2*a*n/(a-n);return o[0]=2*n/(t-e),o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=l,o[9]=r,o[10]=i,o[11]=-1,o[12]=0,o[13]=0,o[14]=a,o[15]=0,o},Matrix4.computeInfinitePerspectiveOffCenter=function(e,t,i,r,n,a){var o=2*n/(r-i),s=(t+e)/(t-e),r=(r+i)/(r-i),i=-2*n;return a[0]=2*n/(t-e),a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=s,a[9]=r,a[10]=-1,a[11]=-1,a[12]=0,a[13]=0,a[14]=i,a[15]=0,a},Matrix4.computeViewportTransformation=function(e,t,i,r){defined(r)||(r=new Matrix4),e=defaultValue(e,defaultValue.EMPTY_OBJECT);var n=defaultValue(e.x,0),a=defaultValue(e.y,0),o=defaultValue(e.width,0),s=defaultValue(e.height,0);t=defaultValue(t,0);var l=.5*o,e=.5*s,o=.5*((i=defaultValue(i,1))-t),s=e,i=o,n=n+l,e=a+e,o=t+o;return r[0]=l,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=n,r[13]=e,r[14]=o,r[15]=1,r},Matrix4.computeView=function(e,t,i,r,n){return n[0]=r.x,n[1]=i.x,n[2]=-t.x,n[3]=0,n[4]=r.y,n[5]=i.y,n[6]=-t.y,n[7]=0,n[8]=r.z,n[9]=i.z,n[10]=-t.z,n[11]=0,n[12]=-Cartesian3.dot(r,e),n[13]=-Cartesian3.dot(i,e),n[14]=Cartesian3.dot(t,e),n[15]=1,n},Matrix4.toArray=function(e,t){return defined(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]]},Matrix4.getElementIndex=function(e,t){return 4*e+t},Matrix4.getColumn=function(e,t,i){var r=4*t,n=e[r],a=e[1+r],t=e[2+r],r=e[3+r];return i.x=n,i.y=a,i.z=t,i.w=r,i},Matrix4.setColumn=function(e,t,i,r){t*=4;return(r=Matrix4.clone(e,r))[t]=i.x,r[1+t]=i.y,r[2+t]=i.z,r[3+t]=i.w,r},Matrix4.setTranslation=function(e,t,i){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=e[15],i};var scaleScratch=new Cartesian3;Matrix4.setScale=function(e,t,i){var r=Matrix4.getScale(e,scaleScratch),r=Cartesian3.divideComponents(t,r,scaleScratch);return Matrix4.multiplyByScale(e,r,i)},Matrix4.getRow=function(e,t,i){var r=e[t],n=e[t+4],a=e[t+8],t=e[t+12];return i.x=r,i.y=n,i.z=a,i.w=t,i},Matrix4.setRow=function(e,t,i,r){return(r=Matrix4.clone(e,r))[t]=i.x,r[t+4]=i.y,r[t+8]=i.z,r[t+12]=i.w,r};var scratchColumn$1=new Cartesian3;Matrix4.getScale=function(e,t){return t.x=Cartesian3.magnitude(Cartesian3.fromElements(e[0],e[1],e[2],scratchColumn$1)),t.y=Cartesian3.magnitude(Cartesian3.fromElements(e[4],e[5],e[6],scratchColumn$1)),t.z=Cartesian3.magnitude(Cartesian3.fromElements(e[8],e[9],e[10],scratchColumn$1)),t};var scratchScale$7=new Cartesian3;Matrix4.getMaximumScale=function(e){return Matrix4.getScale(e,scratchScale$7),Cartesian3.maximumComponent(scratchScale$7)},Matrix4.multiply=function(e,t,i){var r=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=e[9],p=e[10],m=e[11],f=e[12],g=e[13],_=e[14],y=e[15],C=t[0],v=t[1],S=t[2],T=t[3],x=t[4],b=t[5],E=t[6],P=t[7],A=t[8],w=t[9],D=t[10],M=t[11],I=t[12],R=t[13],O=t[14],L=t[15],F=n*C+l*v+h*S+g*T,N=a*C+c*v+p*S+_*T,B=o*C+u*v+m*S+y*T,V=r*x+s*b+d*E+f*P,e=n*x+l*b+h*E+g*P,t=a*x+c*b+p*E+_*P,x=o*x+u*b+m*E+y*P,b=r*A+s*w+d*D+f*M,E=n*A+l*w+h*D+g*M,P=a*A+c*w+p*D+_*M,D=o*A+u*w+m*D+y*M,M=r*I+s*R+d*O+f*L,g=n*I+l*R+h*O+g*L,_=a*I+c*R+p*O+_*L,L=o*I+u*R+m*O+y*L;return i[0]=r*C+s*v+d*S+f*T,i[1]=F,i[2]=N,i[3]=B,i[4]=V,i[5]=e,i[6]=t,i[7]=x,i[8]=b,i[9]=E,i[10]=P,i[11]=D,i[12]=M,i[13]=g,i[14]=_,i[15]=L,i},Matrix4.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},Matrix4.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},Matrix4.multiplyTransformation=function(e,t,i){var r=e[0],n=e[1],a=e[2],o=e[4],s=e[5],l=e[6],c=e[8],u=e[9],d=e[10],h=e[12],p=e[13],m=e[14],f=t[0],g=t[1],_=t[2],y=t[4],C=t[5],v=t[6],S=t[8],T=t[9],x=t[10],b=t[12],E=t[13],P=t[14],A=n*f+s*g+u*_,w=a*f+l*g+d*_,e=r*y+o*C+c*v,t=n*y+s*C+u*v,y=a*y+l*C+d*v,C=r*S+o*T+c*x,v=n*S+s*T+u*x,x=a*S+l*T+d*x,h=r*b+o*E+c*P+h,p=n*b+s*E+u*P+p,m=a*b+l*E+d*P+m;return i[0]=r*f+o*g+c*_,i[1]=A,i[2]=w,i[3]=0,i[4]=e,i[5]=t,i[6]=y,i[7]=0,i[8]=C,i[9]=v,i[10]=x,i[11]=0,i[12]=h,i[13]=p,i[14]=m,i[15]=1,i},Matrix4.multiplyByMatrix3=function(e,t,i){var r=e[0],n=e[1],a=e[2],o=e[4],s=e[5],l=e[6],c=e[8],u=e[9],d=e[10],h=t[0],p=t[1],m=t[2],f=t[3],g=t[4],_=t[5],y=t[6],C=t[7],v=t[8],S=n*h+s*p+u*m,T=a*h+l*p+d*m,x=r*f+o*g+c*_,t=n*f+s*g+u*_,g=a*f+l*g+d*_,_=r*y+o*C+c*v,u=n*y+s*C+u*v,v=a*y+l*C+d*v;return i[0]=r*h+o*p+c*m,i[1]=S,i[2]=T,i[3]=0,i[4]=x,i[5]=t,i[6]=g,i[7]=0,i[8]=_,i[9]=u,i[10]=v,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},Matrix4.multiplyByTranslation=function(e,t,i){var r=t.x,n=t.y,a=t.z,o=r*e[0]+n*e[4]+a*e[8]+e[12],t=r*e[1]+n*e[5]+a*e[9]+e[13],a=r*e[2]+n*e[6]+a*e[10]+e[14];return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=o,i[13]=t,i[14]=a,i[15]=e[15],i};var uniformScaleScratch=new Cartesian3;Matrix4.multiplyByUniformScale=function(e,t,i){return uniformScaleScratch.x=t,uniformScaleScratch.y=t,uniformScaleScratch.z=t,Matrix4.multiplyByScale(e,uniformScaleScratch,i)},Matrix4.multiplyByScale=function(e,t,i){var r=t.x,n=t.y,t=t.z;return 1===r&&1===n&&1===t?Matrix4.clone(e,i):(i[0]=r*e[0],i[1]=r*e[1],i[2]=r*e[2],i[3]=0,i[4]=n*e[4],i[5]=n*e[5],i[6]=n*e[6],i[7]=0,i[8]=t*e[8],i[9]=t*e[9],i[10]=t*e[10],i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=1,i)},Matrix4.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,a=t.z,o=t.w,s=e[0]*r+e[4]*n+e[8]*a+e[12]*o,l=e[1]*r+e[5]*n+e[9]*a+e[13]*o,t=e[2]*r+e[6]*n+e[10]*a+e[14]*o,o=e[3]*r+e[7]*n+e[11]*a+e[15]*o;return i.x=s,i.y=l,i.z=t,i.w=o,i},Matrix4.multiplyByPointAsVector=function(e,t,i){var r=t.x,n=t.y,a=t.z,o=e[0]*r+e[4]*n+e[8]*a,t=e[1]*r+e[5]*n+e[9]*a,a=e[2]*r+e[6]*n+e[10]*a;return i.x=o,i.y=t,i.z=a,i},Matrix4.multiplyByPoint=function(e,t,i){var r=t.x,n=t.y,a=t.z,o=e[0]*r+e[4]*n+e[8]*a+e[12],t=e[1]*r+e[5]*n+e[9]*a+e[13],e=e[2]*r+e[6]*n+e[10]*a+e[14];return i.x=o,i.y=t,i.z=e,i},Matrix4.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},Matrix4.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},Matrix4.transpose=function(e,t){var i=e[1],r=e[2],n=e[3],a=e[6],o=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=o,t[14]=s,t[15]=e[15],t},Matrix4.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},Matrix4.equals=function(e,t){return e===t||defined(e)&&defined(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]},Matrix4.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},Matrix4.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},Matrix4.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 scratchInverseRotation=new Matrix3,scratchMatrix3Zero=new Matrix3,scratchBottomRow=new Cartesian4,scratchExpectedBottomRow=new Cartesian4(0,0,0,1);Matrix4.inverse=function(e,t){var i=e[0],r=e[4],n=e[8],a=e[12],o=e[1],s=e[5],l=e[9],c=e[13],u=e[2],d=e[6],h=e[10],p=e[14],m=e[3],f=e[7],g=e[11],_=e[15],y=h*_,C=p*g,v=d*_,S=p*f,T=d*g,x=h*f,b=u*_,E=p*m,P=u*g,A=h*m,w=u*f,D=d*m,M=y*s+S*l+T*c-(C*s+v*l+x*c),I=C*o+b*l+A*c-(y*o+E*l+P*c),R=v*o+E*s+w*c-(S*o+b*s+D*c),O=x*o+P*s+D*l-(T*o+A*s+w*l),L=C*r+v*n+x*a-(y*r+S*n+T*a),F=y*i+E*n+P*a-(C*i+b*n+A*a),N=S*i+b*r+D*a-(v*i+E*r+w*a),B=T*i+A*r+w*n-(x*i+P*r+D*n),V=(y=n*c)*f+(S=a*s)*g+(T=r*l)*_-((C=a*l)*f+(v=r*c)*g+(x=n*s)*_),l=C*m+(b=i*c)*g+(A=n*o)*_-(y*m+(E=a*o)*g+(P=i*l)*_),_=v*m+E*f+(w=i*s)*_-(S*m+b*f+(D=r*o)*_),f=x*m+P*f+D*g-(T*m+A*f+w*g),g=v*h+x*p+C*d-(T*p+y*d+S*h),C=P*p+y*u+E*h-(b*h+A*p+C*u),E=b*d+D*p+S*u-(w*p+v*u+E*d),u=w*h+T*u+A*d-(P*d+D*h+x*u),a=i*M+r*I+n*R+a*O;if(Math.abs(a)<CesiumMath.EPSILON21){if(Matrix3.equalsEpsilon(Matrix4.getMatrix3(e,scratchInverseRotation),scratchMatrix3Zero,CesiumMath.EPSILON7)&&Cartesian4.equals(Matrix4.getRow(e,3,scratchBottomRow),scratchExpectedBottomRow))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 RuntimeError("matrix is not invertible because its determinate is zero.")}return t[0]=M*(a=1/a),t[1]=I*a,t[2]=R*a,t[3]=O*a,t[4]=L*a,t[5]=F*a,t[6]=N*a,t[7]=B*a,t[8]=V*a,t[9]=l*a,t[10]=_*a,t[11]=f*a,t[12]=g*a,t[13]=C*a,t[14]=E*a,t[15]=u*a,t},Matrix4.inverseTransformation=function(e,t){var i=e[0],r=e[1],n=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],u=e[10],d=e[12],h=e[13],p=e[14],m=-i*d-r*h-n*p,e=-a*d-o*h-s*p,p=-l*d-c*h-u*p;return t[0]=i,t[1]=a,t[2]=l,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=n,t[9]=s,t[10]=u,t[11]=0,t[12]=m,t[13]=e,t[14]=p,t[15]=1,t};var scratchTransposeMatrix=new Matrix4;function Rectangle(e,t,i,r){this.west=defaultValue(e,0),this.south=defaultValue(t,0),this.east=defaultValue(i,0),this.north=defaultValue(r,0)}Matrix4.inverseTranspose=function(e,t){return Matrix4.inverse(Matrix4.transpose(e,scratchTransposeMatrix),t)},Matrix4.IDENTITY=Object.freeze(new Matrix4(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),Matrix4.ZERO=Object.freeze(new Matrix4(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),Matrix4.COLUMN0ROW0=0,Matrix4.COLUMN0ROW1=1,Matrix4.COLUMN0ROW2=2,Matrix4.COLUMN0ROW3=3,Matrix4.COLUMN1ROW0=4,Matrix4.COLUMN1ROW1=5,Matrix4.COLUMN1ROW2=6,Matrix4.COLUMN1ROW3=7,Matrix4.COLUMN2ROW0=8,Matrix4.COLUMN2ROW1=9,Matrix4.COLUMN2ROW2=10,Matrix4.COLUMN2ROW3=11,Matrix4.COLUMN3ROW0=12,Matrix4.COLUMN3ROW1=13,Matrix4.COLUMN3ROW2=14,Matrix4.COLUMN3ROW3=15,Object.defineProperties(Matrix4.prototype,{length:{get:function(){return Matrix4.packedLength}}}),Matrix4.prototype.clone=function(e){return Matrix4.clone(this,e)},Matrix4.prototype.equals=function(e){return Matrix4.equals(this,e)},Matrix4.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]&&e[9]===t[i+9]&&e[10]===t[i+10]&&e[11]===t[i+11]&&e[12]===t[i+12]&&e[13]===t[i+13]&&e[14]===t[i+14]&&e[15]===t[i+15]},Matrix4.prototype.equalsEpsilon=function(e,t){return Matrix4.equalsEpsilon(this,e,t)},Matrix4.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},Object.defineProperties(Rectangle.prototype,{width:{get:function(){return Rectangle.computeWidth(this)}},height:{get:function(){return Rectangle.computeHeight(this)}}}),Rectangle.packedLength=4,Rectangle.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},Rectangle.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Rectangle:i).west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},Rectangle.computeWidth=function(e){var t=e.east,e=e.west;return t<e&&(t+=CesiumMath.TWO_PI),t-e},Rectangle.computeHeight=function(e){return e.north-e.south},Rectangle.fromDegrees=function(e,t,i,r,n){return e=CesiumMath.toRadians(defaultValue(e,0)),t=CesiumMath.toRadians(defaultValue(t,0)),i=CesiumMath.toRadians(defaultValue(i,0)),r=CesiumMath.toRadians(defaultValue(r,0)),defined(n)?(n.west=e,n.south=t,n.east=i,n.north=r,n):new Rectangle(e,t,i,r)},Rectangle.fromRadians=function(e,t,i,r,n){return defined(n)?(n.west=defaultValue(e,0),n.south=defaultValue(t,0),n.east=defaultValue(i,0),n.north=defaultValue(r,0),n):new Rectangle(e,t,i,r)},Rectangle.fromCartographicArray=function(e,t){for(var i=Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=0,c=e.length;l<c;l++)var u=e[l],i=Math.min(i,u.longitude),r=Math.max(r,u.longitude),o=Math.min(o,u.latitude),s=Math.max(s,u.latitude),u=0<=u.longitude?u.longitude:u.longitude+CesiumMath.TWO_PI,n=Math.min(n,u),a=Math.max(a,u);return a-n<r-i&&((r=a)>CesiumMath.PI&&(r-=CesiumMath.TWO_PI),(i=n)>CesiumMath.PI&&(i-=CesiumMath.TWO_PI)),defined(t)?(t.west=i,t.south=o,t.east=r,t.north=s,t):new Rectangle(i,o,r,s)},Rectangle.fromCartesianArray=function(e,t,i){t=defaultValue(t,Ellipsoid.WGS84);for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,c=0,u=e.length;c<u;c++)var d=t.cartesianToCartographic(e[c]),r=Math.min(r,d.longitude),n=Math.max(n,d.longitude),s=Math.min(s,d.latitude),l=Math.max(l,d.latitude),d=0<=d.longitude?d.longitude:d.longitude+CesiumMath.TWO_PI,a=Math.min(a,d),o=Math.max(o,d);return o-a<n-r&&((n=o)>CesiumMath.PI&&(n-=CesiumMath.TWO_PI),(r=a)>CesiumMath.PI&&(r-=CesiumMath.TWO_PI)),defined(i)?(i.west=r,i.south=s,i.east=n,i.north=l,i):new Rectangle(r,s,n,l)},Rectangle.clone=function(e,t){if(defined(e))return defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Rectangle(e.west,e.south,e.east,e.north)},Rectangle.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.west-t.west)<=i&&Math.abs(e.south-t.south)<=i&&Math.abs(e.east-t.east)<=i&&Math.abs(e.north-t.north)<=i},Rectangle.prototype.clone=function(e){return Rectangle.clone(this,e)},Rectangle.prototype.equals=function(e){return Rectangle.equals(this,e)},Rectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Rectangle.prototype.equalsEpsilon=function(e,t){return Rectangle.equalsEpsilon(this,e,t)},Rectangle.validate=function(e){},Rectangle.southwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Cartographic(e.west,e.south)},Rectangle.northwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Cartographic(e.west,e.north)},Rectangle.northeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Cartographic(e.east,e.north)},Rectangle.southeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Cartographic(e.east,e.south)},Rectangle.center=function(e,t){var i=e.east,r=e.west;i<r&&(i+=CesiumMath.TWO_PI);i=CesiumMath.negativePiToPi(.5*(r+i)),e=.5*(e.south+e.north);return defined(t)?(t.longitude=i,t.latitude=e,t.height=0,t):new Cartographic(i,e)},Rectangle.intersection=function(e,t,i){var r=e.east,n=e.west,a=t.east,o=t.west;r<n&&0<a?r+=CesiumMath.TWO_PI:a<o&&0<r&&(a+=CesiumMath.TWO_PI),r<n&&o<0?o+=CesiumMath.TWO_PI:a<o&&n<0&&(n+=CesiumMath.TWO_PI);o=CesiumMath.negativePiToPi(Math.max(n,o)),r=CesiumMath.negativePiToPi(Math.min(r,a));if(!((e.west<e.east||t.west<t.east)&&r<=o)){a=Math.max(e.south,t.south),t=Math.min(e.north,t.north);if(!(t<=a))return defined(i)?(i.west=o,i.south=a,i.east=r,i.north=t,i):new Rectangle(o,a,r,t)}},Rectangle.simpleIntersection=function(e,t,i){var r=Math.max(e.west,t.west),n=Math.max(e.south,t.south),a=Math.min(e.east,t.east),t=Math.min(e.north,t.north);if(!(t<=n||a<=r))return defined(i)?(i.west=r,i.south=n,i.east=a,i.north=t,i):new Rectangle(r,n,a,t)},Rectangle.union=function(e,t,i){defined(i)||(i=new Rectangle);var r=e.east,n=e.west,a=t.east,o=t.west;r<n&&0<a?r+=CesiumMath.TWO_PI:a<o&&0<r&&(a+=CesiumMath.TWO_PI),r<n&&o<0?o+=CesiumMath.TWO_PI:a<o&&n<0&&(n+=CesiumMath.TWO_PI);o=CesiumMath.convertLongitudeRange(Math.min(n,o)),a=CesiumMath.convertLongitudeRange(Math.max(r,a));return i.west=o,i.south=Math.min(e.south,t.south),i.east=a,i.north=Math.max(e.north,t.north),i},Rectangle.expand=function(e,t,i){return(i=!defined(i)?new Rectangle:i).west=Math.min(e.west,t.longitude),i.south=Math.min(e.south,t.latitude),i.east=Math.max(e.east,t.longitude),i.north=Math.max(e.north,t.latitude),i},Rectangle.contains=function(e,t){var i=t.longitude,r=t.latitude,n=e.west,t=e.east;return t<n&&(t+=CesiumMath.TWO_PI,i<0&&(i+=CesiumMath.TWO_PI)),(n<i||CesiumMath.equalsEpsilon(i,n,CesiumMath.EPSILON14))&&(i<t||CesiumMath.equalsEpsilon(i,t,CesiumMath.EPSILON14))&&r>=e.south&&r<=e.north};var subsampleLlaScratch=new Cartographic;function BoundingSphere(e,t){this.center=Cartesian3.clone(defaultValue(e,Cartesian3.ZERO)),this.radius=defaultValue(t,0)}Rectangle.subsample=function(e,t,i,r){t=defaultValue(t,Ellipsoid.WGS84),i=defaultValue(i,0),defined(r)||(r=[]);var n=0,a=e.north,o=e.south,s=e.east,l=e.west,c=subsampleLlaScratch;c.height=i,c.longitude=l,c.latitude=a,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.longitude=s,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.latitude=o,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.longitude=l,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.latitude=a<0?a:0<o?o:0;for(var u=1;u<8;++u)c.longitude=-Math.PI+u*CesiumMath.PI_OVER_TWO,Rectangle.contains(e,c)&&(r[n]=t.cartographicToCartesian(c,r[n]),n++);return 0===c.latitude&&(c.longitude=l,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.longitude=s,r[n]=t.cartographicToCartesian(c,r[n]),n++),r.length=n,r},Rectangle.MAX_VALUE=Object.freeze(new Rectangle(-Math.PI,-CesiumMath.PI_OVER_TWO,Math.PI,CesiumMath.PI_OVER_TWO));var fromPointsXMin=new Cartesian3,fromPointsYMin=new Cartesian3,fromPointsZMin=new Cartesian3,fromPointsXMax=new Cartesian3,fromPointsYMax=new Cartesian3,fromPointsZMax=new Cartesian3,fromPointsCurrentPos=new Cartesian3,fromPointsScratch=new Cartesian3,fromPointsRitterCenter=new Cartesian3,fromPointsMinBoxPt=new Cartesian3,fromPointsMaxBoxPt=new Cartesian3,fromPointsNaiveCenterScratch=new Cartesian3,volumeConstant=4/3*CesiumMath.PI;BoundingSphere.fromPoints=function(e,t){if(defined(t)||(t=new BoundingSphere),!defined(e)||0===e.length)return t.center=Cartesian3.clone(Cartesian3.ZERO,t.center),t.radius=0,t;for(var i=Cartesian3.clone(e[0],fromPointsCurrentPos),r=Cartesian3.clone(i,fromPointsXMin),n=Cartesian3.clone(i,fromPointsYMin),a=Cartesian3.clone(i,fromPointsZMin),o=Cartesian3.clone(i,fromPointsXMax),s=Cartesian3.clone(i,fromPointsYMax),l=Cartesian3.clone(i,fromPointsZMax),c=e.length,u=1;u<c;u++){Cartesian3.clone(e[u],i);var d=i.x,h=i.y,p=i.z;d<r.x&&Cartesian3.clone(i,r),d>o.x&&Cartesian3.clone(i,o),h<n.y&&Cartesian3.clone(i,n),h>s.y&&Cartesian3.clone(i,s),p<a.z&&Cartesian3.clone(i,a),p>l.z&&Cartesian3.clone(i,l)}var m=Cartesian3.magnitudeSquared(Cartesian3.subtract(o,r,fromPointsScratch)),f=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,n,fromPointsScratch)),g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=r,y=o,m=m;m<f&&(m=f,_=n,y=s),m<g&&(m=g,_=a,y=l);var C=fromPointsRitterCenter;C.x=.5*(_.x+y.x),C.y=.5*(_.y+y.y),C.z=.5*(_.z+y.z);var v=Cartesian3.magnitudeSquared(Cartesian3.subtract(y,C,fromPointsScratch)),S=Math.sqrt(v),_=fromPointsMinBoxPt;_.x=r.x,_.y=n.y,_.z=a.z;y=fromPointsMaxBoxPt;y.x=o.x,y.y=s.y,y.z=l.z;var T=Cartesian3.midpoint(_,y,fromPointsNaiveCenterScratch),x=0;for(u=0;u<c;u++){Cartesian3.clone(e[u],i);var b=Cartesian3.magnitude(Cartesian3.subtract(i,T,fromPointsScratch));x<b&&(x=b);var E=Cartesian3.magnitudeSquared(Cartesian3.subtract(i,C,fromPointsScratch));v<E&&(v=(S=.5*(S+(b=Math.sqrt(E))))*S,C.x=(S*C.x+(E=b-S)*i.x)/b,C.y=(S*C.y+E*i.y)/b,C.z=(S*C.z+E*i.z)/b)}return S<x?(Cartesian3.clone(C,t.center),t.radius=S):(Cartesian3.clone(T,t.center),t.radius=x),t};var defaultProjection$1=new GeographicProjection,fromRectangle2DLowerLeft=new Cartesian3,fromRectangle2DUpperRight=new Cartesian3,fromRectangle2DSouthwest=new Cartographic,fromRectangle2DNortheast=new Cartographic;BoundingSphere.fromRectangle2D=function(e,t,i){return BoundingSphere.fromRectangleWithHeights2D(e,t,0,0,i)},BoundingSphere.fromRectangleWithHeights2D=function(e,t,i,r,n){if(defined(n)||(n=new BoundingSphere),!defined(e))return n.center=Cartesian3.clone(Cartesian3.ZERO,n.center),n.radius=0,n;t=defaultValue(t,defaultProjection$1),Rectangle.southwest(e,fromRectangle2DSouthwest),fromRectangle2DSouthwest.height=i,Rectangle.northeast(e,fromRectangle2DNortheast),fromRectangle2DNortheast.height=r;var a=t.project(fromRectangle2DSouthwest,fromRectangle2DLowerLeft),i=t.project(fromRectangle2DNortheast,fromRectangle2DUpperRight),e=i.x-a.x,r=i.y-a.y,t=i.z-a.z;n.radius=.5*Math.sqrt(e*e+r*r+t*t);i=n.center;return i.x=a.x+.5*e,i.y=a.y+.5*r,i.z=a.z+.5*t,n};var fromRectangle3DScratch=[];BoundingSphere.fromRectangle3D=function(e,t,i,r){if(t=defaultValue(t,Ellipsoid.WGS84),i=defaultValue(i,0),defined(r)||(r=new BoundingSphere),!defined(e))return r.center=Cartesian3.clone(Cartesian3.ZERO,r.center),r.radius=0,r;i=Rectangle.subsample(e,t,i,fromRectangle3DScratch);return BoundingSphere.fromPoints(i,r)},BoundingSphere.fromVertices=function(e,t,i,r){if(defined(r)||(r=new BoundingSphere),!defined(e)||0===e.length)return r.center=Cartesian3.clone(Cartesian3.ZERO,r.center),r.radius=0,r;t=defaultValue(t,Cartesian3.ZERO),i=defaultValue(i,3);var n=fromPointsCurrentPos;n.x=e[0]+t.x,n.y=e[1]+t.y,n.z=e[2]+t.z;for(var a=Cartesian3.clone(n,fromPointsXMin),o=Cartesian3.clone(n,fromPointsYMin),s=Cartesian3.clone(n,fromPointsZMin),l=Cartesian3.clone(n,fromPointsXMax),c=Cartesian3.clone(n,fromPointsYMax),u=Cartesian3.clone(n,fromPointsZMax),d=e.length,h=0;h<d;h+=i){var p=e[h]+t.x,m=e[h+1]+t.y,f=e[h+2]+t.z;n.x=p,n.y=m,n.z=f,p<a.x&&Cartesian3.clone(n,a),p>l.x&&Cartesian3.clone(n,l),m<o.y&&Cartesian3.clone(n,o),m>c.y&&Cartesian3.clone(n,c),f<s.z&&Cartesian3.clone(n,s),f>u.z&&Cartesian3.clone(n,u)}var g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,o,fromPointsScratch)),y=Cartesian3.magnitudeSquared(Cartesian3.subtract(u,s,fromPointsScratch)),C=a,v=l,g=g;g<_&&(g=_,C=o,v=c),g<y&&(g=y,C=s,v=u);var S=fromPointsRitterCenter;S.x=.5*(C.x+v.x),S.y=.5*(C.y+v.y),S.z=.5*(C.z+v.z);var T=Cartesian3.magnitudeSquared(Cartesian3.subtract(v,S,fromPointsScratch)),x=Math.sqrt(T),C=fromPointsMinBoxPt;C.x=a.x,C.y=o.y,C.z=s.z;v=fromPointsMaxBoxPt;v.x=l.x,v.y=c.y,v.z=u.z;var b=Cartesian3.midpoint(C,v,fromPointsNaiveCenterScratch),E=0;for(h=0;h<d;h+=i){n.x=e[h]+t.x,n.y=e[h+1]+t.y,n.z=e[h+2]+t.z;var P=Cartesian3.magnitude(Cartesian3.subtract(n,b,fromPointsScratch));E<P&&(E=P);var A=Cartesian3.magnitudeSquared(Cartesian3.subtract(n,S,fromPointsScratch));T<A&&(T=(x=.5*(x+(P=Math.sqrt(A))))*x,S.x=(x*S.x+(A=P-x)*n.x)/P,S.y=(x*S.y+A*n.y)/P,S.z=(x*S.z+A*n.z)/P)}return x<E?(Cartesian3.clone(S,r.center),r.radius=x):(Cartesian3.clone(b,r.center),r.radius=E),r},BoundingSphere.fromEncodedCartesianVertices=function(e,t,i){if(defined(i)||(i=new BoundingSphere),!defined(e)||!defined(t)||e.length!==t.length||0===e.length)return i.center=Cartesian3.clone(Cartesian3.ZERO,i.center),i.radius=0,i;var r=fromPointsCurrentPos;r.x=e[0]+t[0],r.y=e[1]+t[1],r.z=e[2]+t[2];for(var n=Cartesian3.clone(r,fromPointsXMin),a=Cartesian3.clone(r,fromPointsYMin),o=Cartesian3.clone(r,fromPointsZMin),s=Cartesian3.clone(r,fromPointsXMax),l=Cartesian3.clone(r,fromPointsYMax),c=Cartesian3.clone(r,fromPointsZMax),u=e.length,d=0;d<u;d+=3){var h=e[d]+t[d],p=e[d+1]+t[d+1],m=e[d+2]+t[d+2];r.x=h,r.y=p,r.z=m,h<n.x&&Cartesian3.clone(r,n),h>s.x&&Cartesian3.clone(r,s),p<a.y&&Cartesian3.clone(r,a),p>l.y&&Cartesian3.clone(r,l),m<o.z&&Cartesian3.clone(r,o),m>c.z&&Cartesian3.clone(r,c)}var f=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,n,fromPointsScratch)),g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,o,fromPointsScratch)),y=n,C=s,f=f;f<g&&(f=g,y=a,C=l),f<_&&(f=_,y=o,C=c);var v=fromPointsRitterCenter;v.x=.5*(y.x+C.x),v.y=.5*(y.y+C.y),v.z=.5*(y.z+C.z);var S=Cartesian3.magnitudeSquared(Cartesian3.subtract(C,v,fromPointsScratch)),T=Math.sqrt(S),y=fromPointsMinBoxPt;y.x=n.x,y.y=a.y,y.z=o.z;C=fromPointsMaxBoxPt;C.x=s.x,C.y=l.y,C.z=c.z;var x=Cartesian3.midpoint(y,C,fromPointsNaiveCenterScratch),b=0;for(d=0;d<u;d+=3){r.x=e[d]+t[d],r.y=e[d+1]+t[d+1],r.z=e[d+2]+t[d+2];var E=Cartesian3.magnitude(Cartesian3.subtract(r,x,fromPointsScratch));b<E&&(b=E);var P=Cartesian3.magnitudeSquared(Cartesian3.subtract(r,v,fromPointsScratch));S<P&&(S=(T=.5*(T+(E=Math.sqrt(P))))*T,v.x=(T*v.x+(P=E-T)*r.x)/E,v.y=(T*v.y+P*r.y)/E,v.z=(T*v.z+P*r.z)/E)}return T<b?(Cartesian3.clone(v,i.center),i.radius=T):(Cartesian3.clone(x,i.center),i.radius=b),i},BoundingSphere.fromCornerPoints=function(e,t,i){defined(i)||(i=new BoundingSphere);e=Cartesian3.midpoint(e,t,i.center);return i.radius=Cartesian3.distance(e,t),i},BoundingSphere.fromEllipsoid=function(e,t){return defined(t)||(t=new BoundingSphere),Cartesian3.clone(Cartesian3.ZERO,t.center),t.radius=e.maximumRadius,t};var fromBoundingSpheresScratch=new Cartesian3;BoundingSphere.fromBoundingSpheres=function(e,t){if(defined(t)||(t=new BoundingSphere),!defined(e)||0===e.length)return t.center=Cartesian3.clone(Cartesian3.ZERO,t.center),t.radius=0,t;var i=e.length;if(1===i)return BoundingSphere.clone(e[0],t);if(2===i)return BoundingSphere.union(e[0],e[1],t);for(var r=[],n=0;n<i;n++)r.push(e[n].center);var a=(t=BoundingSphere.fromPoints(r,t)).center,o=t.radius;for(n=0;n<i;n++)var s=e[n],o=Math.max(o,Cartesian3.distance(a,s.center,fromBoundingSpheresScratch)+s.radius);return t.radius=o,t};var fromOrientedBoundingBoxScratchU=new Cartesian3,fromOrientedBoundingBoxScratchV=new Cartesian3,fromOrientedBoundingBoxScratchW=new Cartesian3;BoundingSphere.fromOrientedBoundingBox=function(e,t){defined(t)||(t=new BoundingSphere);var i=e.halfAxes,r=Matrix3.getColumn(i,0,fromOrientedBoundingBoxScratchU),n=Matrix3.getColumn(i,1,fromOrientedBoundingBoxScratchV),i=Matrix3.getColumn(i,2,fromOrientedBoundingBoxScratchW);return Cartesian3.add(r,n,r),Cartesian3.add(r,i,r),t.center=Cartesian3.clone(e.center,t.center),t.radius=Cartesian3.magnitude(r),t},BoundingSphere.clone=function(e,t){if(defined(e))return defined(t)?(t.center=Cartesian3.clone(e.center,t.center),t.radius=e.radius,t):new BoundingSphere(e.center,e.radius)},BoundingSphere.packedLength=4,BoundingSphere.pack=function(e,t,i){i=defaultValue(i,0);var r=e.center;return t[i++]=r.x,t[i++]=r.y,t[i++]=r.z,t[i]=e.radius,t},BoundingSphere.unpack=function(e,t,i){t=defaultValue(t,0);var r=(i=!defined(i)?new BoundingSphere:i).center;return r.x=e[t++],r.y=e[t++],r.z=e[t++],i.radius=e[t],i};var unionScratch=new Cartesian3,unionScratchCenter=new Cartesian3;BoundingSphere.union=function(e,t,i){defined(i)||(i=new BoundingSphere);var r=e.center,n=e.radius,a=t.center,o=t.radius,s=Cartesian3.subtract(a,r,unionScratch),a=Cartesian3.magnitude(s);if(a+o<=n)return e.clone(i),i;if(a+n<=o)return t.clone(i),i;o=.5*(n+a+o),a=Cartesian3.multiplyByScalar(s,(o-n)/a,unionScratchCenter);return Cartesian3.add(a,r,a),Cartesian3.clone(a,i.center),i.radius=o,i};var expandScratch=new Cartesian3;BoundingSphere.expand=function(e,t,i){i=BoundingSphere.clone(e,i);t=Cartesian3.magnitude(Cartesian3.subtract(t,i.center,expandScratch));return t>i.radius&&(i.radius=t),i},BoundingSphere.intersectPlane=function(e,t){var i=e.center,r=e.radius,e=t.normal,t=Cartesian3.dot(e,i)+t.distance;return t<-r?Intersect$1.OUTSIDE:t<r?Intersect$1.INTERSECTING:Intersect$1.INSIDE},BoundingSphere.transform=function(e,t,i){return(i=!defined(i)?new BoundingSphere:i).center=Matrix4.multiplyByPoint(t,e.center,i.center),i.radius=Matrix4.getMaximumScale(t)*e.radius,i};var distanceSquaredToScratch=new Cartesian3;BoundingSphere.distanceSquaredTo=function(e,t){t=Cartesian3.subtract(e.center,t,distanceSquaredToScratch);return Cartesian3.magnitudeSquared(t)-e.radius*e.radius},BoundingSphere.transformWithoutScale=function(e,t,i){return(i=!defined(i)?new BoundingSphere:i).center=Matrix4.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var scratchCartesian3$d=new Cartesian3;BoundingSphere.computePlaneDistances=function(e,t,i,r){defined(r)||(r=new Interval);t=Cartesian3.subtract(e.center,t,scratchCartesian3$d),t=Cartesian3.dot(i,t);return r.start=t-e.radius,r.stop=t+e.radius,r};for(var projectTo2DNormalScratch=new Cartesian3,projectTo2DEastScratch=new Cartesian3,projectTo2DNorthScratch=new Cartesian3,projectTo2DWestScratch=new Cartesian3,projectTo2DSouthScratch=new Cartesian3,projectTo2DCartographicScratch=new Cartographic,projectTo2DPositionsScratch=new Array(8),n=0;n<8;++n)projectTo2DPositionsScratch[n]=new Cartesian3;var projectTo2DProjection=new GeographicProjection;function URI(e){e instanceof URI?(this.scheme=e.scheme,this.authority=e.authority,this.path=e.path,this.query=e.query,this.fragment=e.fragment):e&&(e=parseRegex$1.exec(e),this.scheme=e[1],this.authority=e[2],this.path=e[3],this.query=e[4],this.fragment=e[5])}BoundingSphere.projectTo2D=function(e,t,i){var r=(t=defaultValue(t,projectTo2DProjection)).ellipsoid,n=e.center,a=e.radius,o=Cartesian3.equals(n,Cartesian3.ZERO)?Cartesian3.clone(Cartesian3.UNIT_X,projectTo2DNormalScratch):r.geodeticSurfaceNormal(n,projectTo2DNormalScratch),s=Cartesian3.cross(Cartesian3.UNIT_Z,o,projectTo2DEastScratch);Cartesian3.normalize(s,s);var l=Cartesian3.cross(o,s,projectTo2DNorthScratch);Cartesian3.normalize(l,l),Cartesian3.multiplyByScalar(o,a,o),Cartesian3.multiplyByScalar(l,a,l),Cartesian3.multiplyByScalar(s,a,s);var c=Cartesian3.negate(l,projectTo2DSouthScratch),e=Cartesian3.negate(s,projectTo2DWestScratch),u=projectTo2DPositionsScratch,a=u[0];Cartesian3.add(o,l,a),Cartesian3.add(a,s,a),a=u[1],Cartesian3.add(o,l,a),Cartesian3.add(a,e,a),a=u[2],Cartesian3.add(o,c,a),Cartesian3.add(a,e,a),a=u[3],Cartesian3.add(o,c,a),Cartesian3.add(a,s,a),Cartesian3.negate(o,o),a=u[4],Cartesian3.add(o,l,a),Cartesian3.add(a,s,a),a=u[5],Cartesian3.add(o,l,a),Cartesian3.add(a,e,a),a=u[6],Cartesian3.add(o,c,a),Cartesian3.add(a,e,a),a=u[7],Cartesian3.add(o,c,a),Cartesian3.add(a,s,a);for(var d=u.length,h=0;h<d;++h){var p=u[h];Cartesian3.add(n,p,p);var m=r.cartesianToCartographic(p,projectTo2DCartographicScratch);t.project(m,p)}c=(n=(i=BoundingSphere.fromPoints(u,i)).center).x,s=n.y,a=n.z;return n.x=a,n.y=c,n.z=s,i},BoundingSphere.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},BoundingSphere.equals=function(e,t){return e===t||defined(e)&&defined(t)&&Cartesian3.equals(e.center,t.center)&&e.radius===t.radius},BoundingSphere.prototype.intersectPlane=function(e){return BoundingSphere.intersectPlane(this,e)},BoundingSphere.prototype.distanceSquaredTo=function(e){return BoundingSphere.distanceSquaredTo(this,e)},BoundingSphere.prototype.computePlaneDistances=function(e,t,i){return BoundingSphere.computePlaneDistances(this,e,t,i)},BoundingSphere.prototype.isOccluded=function(e){return BoundingSphere.isOccluded(this,e)},BoundingSphere.prototype.equals=function(e){return BoundingSphere.equals(this,e)},BoundingSphere.prototype.clone=function(e){return BoundingSphere.clone(this,e)},BoundingSphere.prototype.volume=function(){var e=this.radius;return volumeConstant*e*e*e},URI.prototype.scheme=null,URI.prototype.authority=null,URI.prototype.path="",URI.prototype.query=null,URI.prototype.fragment=null;var parseRegex$1=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");URI.prototype.getScheme=function(){return this.scheme},URI.prototype.getAuthority=function(){return this.authority},URI.prototype.getPath=function(){return this.path},URI.prototype.getQuery=function(){return this.query},URI.prototype.getFragment=function(){return this.fragment},URI.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},URI.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},URI.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},URI.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(authorityRegex,replaceAuthority).replace(caseRegex,replaceCase)),this.path&&(this.path=this.path.replace(caseRegex,replaceCase)),this.query&&(this.query=this.query.replace(caseRegex,replaceCase)),this.fragment&&(this.fragment=this.fragment.replace(caseRegex,replaceCase))};var caseRegex=/%[0-9a-z]{2}/gi,percentRegex=/[a-zA-Z0-9\-\._~]/,authorityRegex=/(.*@)?([^@:]*)(:.*)?/,reduceArray,slice,undef;function replaceCase(e){var t=unescape(e);return percentRegex.test(t)?t:e.toUpperCase()}function replaceAuthority(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}function getAbsoluteUri(e,t){var i;return"undefined"!=typeof document&&(i=document),getAbsoluteUri._implementation(e,t,i)}function when(e,t,i,r){return resolve$1(e).then(t,i,r)}function resolve$1(e){var t,e=e instanceof Promise$1?e:isPromise(e)?(t=defer(),e.then(function(e){t.resolve(e)},function(e){t.reject(e)},function(e){t.progress(e)}),t.promise):fulfilled(e);return e}function reject(e){return when(e,rejected)}function Promise$1(e){this.then=e}function fulfilled(t){return new Promise$1(function(e){try{return resolve$1(e?e(t):t)}catch(e){return rejected(e)}})}function rejected(i){return new Promise$1(function(e,t){try{return t?resolve$1(t(i)):rejected(i)}catch(e){return rejected(e)}})}function defer(){var e=new Promise$1(n),o=[],s=[],r=function(t,i,r){var n=defer(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)};return o.push(function(e){e.then(t,i).then(n.resolve,n.reject,a)}),s.push(a),n.promise},t=function(e){return processQueue(s,e),e},i=function(e){return e=resolve$1(e),r=e.then,i=resolve$1,t=noop,processQueue(o,e),s=o=undef,e};return{then:n,resolve:a,reject:l,progress:c,promise:e,resolver:{resolve:a,reject:l,progress:c}};function n(e,t,i){return r(e,t,i)}function a(e){return i(e)}function l(e){return i(rejected(e))}function c(e){return t(e)}}function isPromise(e){return e&&"function"==typeof e.then}function some(e,p,m,f,g){return checkCallbacks(2,arguments),when(e,function(e){var t,i,r,n,a=e.length>>>0,o=Math.max(0,Math.min(p,a)),s=[],l=a-o+1,c=[],u=defer();if(o)for(r=u.progress,i=function(e){c.push(e),--l||(t=i=noop,u.reject(c))},t=function(e){s.push(e),--o||(t=i=noop,u.resolve(s))},n=0;n<a;++n)n in e&&when(e[n],h,d,r);else u.resolve(s);return u.then(m,f,g);function d(e){i(e)}function h(e){t(e)}})}function any(e,t,i,r){return some(e,1,function(e){return t?t(e[0]):e[0]},i,r)}function all(e,t,i,r){return checkCallbacks(1,arguments),map(e,identity).then(t,i,r)}function join(){return map(arguments,identity)}function map(e,s){return when(e,function(e){var t,i,r,n=t=e.length>>>0,a=[],o=defer();if(n)for(i=function(e,t){when(e,s).then(function(e){a[t]=e,--n||o.resolve(a)},o.reject)},r=0;r<t;r++)r in e?i(e[r],r):--n;else o.resolve(a);return o.promise})}function reduce(e,a){var t=slice.call(arguments,1);return when(e,function(e){var n=e.length;return t[0]=function(e,i,r){return when(e,function(t){return when(i,function(e){return a(t,e,r,n)})})},reduceArray.apply(e,t)})}function chain(e,t,i){var r=2<arguments.length;return when(e,function(e){return t.resolve(e=r?i:e),e},function(e){return t.reject(e),rejected(e)},t.progress)}function processQueue(e,t){for(var i,r=0;i=e[r++];)i(t)}function checkCallbacks(e,t){for(var i,r=t.length;e<r;)if(null!=(i=t[--r])&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function noop(){}function identity(e){return e}function clone$1(e,t){if(null===e||"object"!=typeof e)return e;t=defaultValue(t,!1);var i,r,n=new e.constructor;for(i in e)e.hasOwnProperty(i)&&(r=e[i],t&&(r=clone$1(r,t)),n[i]=r);return n}function combine$2(e,t,i){i=defaultValue(i,!1);var r,n,a,o={},s=defined(e),l=defined(t);if(s)for(r in e)e.hasOwnProperty(r)&&(n=e[r],l&&i&&"object"==typeof n&&t.hasOwnProperty(r)?(a=t[r],o[r]="object"==typeof a?combine$2(n,a,i):n):o[r]=n);if(l)for(r in t)t.hasOwnProperty(r)&&!o.hasOwnProperty(r)&&(a=t[r],o[r]=a);return o}function getBaseUri(e,t){var i="",r=e.lastIndexOf("/");return-1!==r&&(i=e.substring(0,r+1)),t&&(defined((e=new URI(e)).query)&&(i+="?"+e.query),defined(e.fragment)&&(i+="#"+e.fragment)),i}function getExtensionFromUri(e){var t=new URI(e);t.normalize();e=t.path,t=e.lastIndexOf("/");return e=-1===(t=(e=-1!==t?e.substr(t+1):e).lastIndexOf("."))?"":e.substr(t+1)}URI.prototype.resolve=function(e){var t=new URI;return this.scheme?(t.scheme=this.scheme,t.authority=this.authority,t.path=this.path,t.query=this.query):(t.scheme=e.scheme,this.authority?(t.authority=this.authority,t.path=this.path,t.query=this.query):(t.authority=e.authority,""==this.path?(t.path=e.path,t.query=this.query||e.query):("/"==this.path.charAt(0)?t.path=this.path:e.authority&&""==e.path?t.path="/"+this.path:t.path=e.path.substring(0,e.path.lastIndexOf("/")+1)+this.path,t.removeDotSegments(),t.query=this.query))),t.fragment=this.fragment,t},URI.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];for(r&&t.shift(),""==t[0]&&t.shift();t.length;)".."==(e=t.shift())?i.pop():"."!=e&&i.push(e);"."!=e&&".."!=e||i.push(""),r&&i.unshift(""),this.path=i.join("/")},URI.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},getAbsoluteUri._implementation=function(e,t,i){if(!defined(t)){if(void 0===i)return e;t=defaultValue(i.baseURI,i.location.href)}t=new URI(t);return new URI(e).resolve(t).toString()},when.defer=defer,when.resolve=resolve$1,when.reject=reject,when.join=join,when.all=all,when.map=map,when.reduce=reduce,when.any=any,when.some=some,when.chain=chain,when.isPromise=isPromise,Promise$1.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(undef,e)},yield:function(e){return this.then(function(){return e})},spread:function(t){return this.then(function(e){return all(e,function(e){return t.apply(undef,e)})})}};var slice=[].slice,reduceArray=[].reduce||function(e){var t,i=0,r=Object(this),n=r.length>>>0,a=arguments;if(a.length<=1)for(;;){if(i in r){t=r[i++];break}if(++i>=n)throw new TypeError}else t=a[1];for(;i<n;++i)i in r&&(t=e(t,r[i],i,r));return t},blobUriRegex=/^blob:/i,a$1;function isBlobUri(e){return blobUriRegex.test(e)}function isCrossOriginUrl(e){(a$1=!defined(a$1)?document.createElement("a"):a$1).href=window.location.href;var t=a$1.host,i=a$1.protocol;return a$1.href=e,a$1.href=a$1.href,i!==a$1.protocol||t!==a$1.host}var dataUriRegex$2=/^data:/i;function isDataUri(e){return dataUriRegex$2.test(e)}function loadAndExecuteScript(e){var t=when.defer(),i=document.createElement("script");i.async=!0,i.src=e;var r=document.getElementsByTagName("head")[0];return i.onload=function(){i.onload=void 0,r.removeChild(i),t.resolve()},i.onerror=function(e){t.reject(e)},r.appendChild(i),t.promise}function objectToQuery(e){var t,i="";for(t in e)if(e.hasOwnProperty(t)){var r=e[t],n=encodeURIComponent(t)+"=";if(Array.isArray(r))for(var a=0,o=r.length;a<o;++a)i+=n+encodeURIComponent(r[a])+"&";else i+=n+encodeURIComponent(r)+"&"}return i=i.slice(0,-1)}function queryToObject(e){var t={};if(""===e)return t;for(var i=e.replace(/\+/g,"%20").split(/[&;]/),r=0,n=i.length;r<n;++r){var a=i[r].split("="),o=decodeURIComponent(a[0]),s=defined(s=a[1])?decodeURIComponent(s):"",a=t[o];"string"==typeof a?t[o]=[a,s]:Array.isArray(a)?a.push(s):t[o]=s}return t}var RequestState={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},RequestState$1=Object.freeze(RequestState),RequestType={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},RequestType$1=Object.freeze(RequestType);function Request(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.throttleByServer,!1),i=defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=defaultValue(e.priority,0),this.throttle=i,this.throttleByServer=t,this.type=defaultValue(e.type,RequestType$1.OTHER),this.serverKey=void 0,this.state=RequestState$1.UNISSUED,this.deferred=void 0,this.cancelled=!1}function parseResponseHeaders(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r<i.length;++r){var n,a=i[r],o=a.indexOf(": ");0<o&&(n=a.substring(0,o),o=a.substring(o+2),t[n]=o)}return t}function RequestErrorEvent(e,t,i){this.statusCode=e,this.response=t,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=parseResponseHeaders(this.responseHeaders))}function Event(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function compareNumber(e,t){return t-e}function Heap(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function swap$4(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function sortRequests(e,t){return e.priority-t.priority}Request.prototype.cancel=function(){this.cancelled=!0},Request.prototype.clone=function(e){return defined(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=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Request(this)},RequestErrorEvent.prototype.toString=function(){var e="Request has failed.";return defined(this.statusCode)&&(e+=" Status Code: "+this.statusCode),e},Object.defineProperties(Event.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Event.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},Event.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,a=0;a<i.length;a++)if(i[a]===e&&r[a]===t){n=a;break}return-1!==n&&(this._insideRaiseEvent?(this._toRemove.push(n),i[n]=void 0,r[n]=void 0):(i.splice(n,1),r.splice(n,1)),!0)},Event.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;for(var e=this._listeners,t=this._scopes,i=e.length,r=0;r<i;r++)defined(e[r])&&e[r].apply(t[r],arguments);var n=this._toRemove;if(0<(i=n.length)){for(n.sort(compareNumber),r=0;r<i;r++){var a=n[r];e.splice(a,1),t.splice(a,1)}n.length=0}this._insideRaiseEvent=!1},Object.defineProperties(Heap.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){var t=this._length;if(e<t){for(var i=this._array,r=e;r<t;++r)i[r]=void 0;this._length=e,i.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),Heap.prototype.reserve=function(e){e=defaultValue(e,this._length),this._array.length=e},Heap.prototype.heapify=function(e){e=defaultValue(e,0);for(var t=this._length,i=this._comparator,r=this._array,n=-1,a=!0;a;){var o=2*(e+1),s=o-1,n=s<t&&i(r[s],r[e])<0?s:e;(n=o<t&&i(r[o],r[n])<0?o:n)!==e?(swap$4(r,n,e),e=n):a=!1}},Heap.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);0<=t;--t)this.heapify(t)},Heap.prototype.insert=function(e){var t,i=this._array,r=this._comparator,n=this._maximumLength,a=this._length++;for(a<i.length?i[a]=e:i.push(e);0!==a;){var o=Math.floor((a-1)/2);if(!(r(i[a],i[o])<0))break;swap$4(i,a,o),a=o}return defined(n)&&this._length>n&&(t=i[n],this._length=n),t},Heap.prototype.pop=function(e){if(e=defaultValue(e,0),0!==this._length){var t=this._array,i=t[e];return swap$4(t,e,--this._length),this.heapify(e),t[this._length]=void 0,i}};var statistics={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},priorityHeapLength=20,requestHeap=new Heap({comparator:sortRequests});requestHeap.maximumLength=priorityHeapLength,requestHeap.reserve(priorityHeapLength);var activeRequests=[],numberOfActiveRequestsByServer={},pageUri="undefined"!=typeof document?new URI(document.location.href):new URI,requestCompletedEvent=new Event;function RequestScheduler(){}function updatePriority(e){defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function serverHasOpenSlots(e){var t=defaultValue(RequestScheduler.requestsByServer[e],RequestScheduler.maximumRequestsPerServer);return numberOfActiveRequestsByServer[e]<t}function issueRequest(e){return e.state===RequestState$1.UNISSUED&&(e.state=RequestState$1.ISSUED,e.deferred=when.defer()),e.deferred.promise}function getRequestReceivedFunction(i){return function(e){var t;i.state!==RequestState$1.CANCELLED&&(t=i.deferred,--statistics.numberOfActiveRequests,--numberOfActiveRequestsByServer[i.serverKey],requestCompletedEvent.raiseEvent(),i.state=RequestState$1.RECEIVED,i.deferred=void 0,t.resolve(e))}}function getRequestFailedFunction(t){return function(e){t.state!==RequestState$1.CANCELLED&&(++statistics.numberOfFailedRequests,--statistics.numberOfActiveRequests,--numberOfActiveRequestsByServer[t.serverKey],requestCompletedEvent.raiseEvent(e),t.state=RequestState$1.FAILED,t.deferred.reject(e))}}function startRequest(e){var t=issueRequest(e);return e.state=RequestState$1.ACTIVE,activeRequests.push(e),++statistics.numberOfActiveRequests,++statistics.numberOfActiveRequestsEver,++numberOfActiveRequestsByServer[e.serverKey],e.requestFunction().then(getRequestReceivedFunction(e)).otherwise(getRequestFailedFunction(e)),t}function cancelRequest(e){var t,i=e.state===RequestState$1.ACTIVE;e.state=RequestState$1.CANCELLED,++statistics.numberOfCancelledRequests,defined(e.deferred)&&(t=e.deferred,e.deferred=void 0,t.reject()),i&&(--statistics.numberOfActiveRequests,--numberOfActiveRequestsByServer[e.serverKey],++statistics.numberOfCancelledActiveRequests),defined(e.cancelFunction)&&e.cancelFunction()}function updateStatistics(){RequestScheduler.debugShowStatistics&&(0===statistics.numberOfActiveRequests&&0<statistics.lastNumberOfActiveRequests&&(0<statistics.numberOfAttemptedRequests&&(console.log("Number of attempted requests: "+statistics.numberOfAttemptedRequests),statistics.numberOfAttemptedRequests=0),0<statistics.numberOfCancelledRequests&&(console.log("Number of cancelled requests: "+statistics.numberOfCancelledRequests),statistics.numberOfCancelledRequests=0),0<statistics.numberOfCancelledActiveRequests&&(console.log("Number of cancelled active requests: "+statistics.numberOfCancelledActiveRequests),statistics.numberOfCancelledActiveRequests=0),0<statistics.numberOfFailedRequests&&(console.log("Number of failed requests: "+statistics.numberOfFailedRequests),statistics.numberOfFailedRequests=0)),statistics.lastNumberOfActiveRequests=statistics.numberOfActiveRequests)}RequestScheduler.maximumRequests=50,RequestScheduler.maximumRequestsPerServer=6,RequestScheduler.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},RequestScheduler.throttleRequests=!0,RequestScheduler.debugShowStatistics=!1,RequestScheduler.requestCompletedEvent=requestCompletedEvent,Object.defineProperties(RequestScheduler,{statistics:{get:function(){return statistics}},priorityHeapLength:{get:function(){return priorityHeapLength},set:function(e){if(e<priorityHeapLength)for(;requestHeap.length>e;)cancelRequest(requestHeap.pop());priorityHeapLength=e,requestHeap.maximumLength=e,requestHeap.reserve(e)}}}),RequestScheduler.update=function(){for(var e,t=0,i=activeRequests.length,r=0;r<i;++r)(e=activeRequests[r]).cancelled&&cancelRequest(e),e.state===RequestState$1.ACTIVE?0<t&&(activeRequests[r-t]=e):++t;activeRequests.length-=t;var n=requestHeap.internalArray,a=requestHeap.length;for(r=0;r<a;++r)updatePriority(n[r]);requestHeap.resort();for(var o=Math.max(RequestScheduler.maximumRequests-activeRequests.length,0),s=0;s<o&&0<requestHeap.length;)!(e=requestHeap.pop()).cancelled&&(!e.throttleByServer||serverHasOpenSlots(e.serverKey))?(startRequest(e),++s):cancelRequest(e);updateStatistics()},RequestScheduler.getServerKey=function(e){var t=new URI(e).resolve(pageUri);t.normalize();e=t.authority;return/:/.test(e)||(e=e+":"+("https"===t.scheme?"443":"80")),defined(numberOfActiveRequestsByServer[e])||(numberOfActiveRequestsByServer[e]=0),e},RequestScheduler.request=function(e){if(isDataUri(e.url)||isBlobUri(e.url))return requestCompletedEvent.raiseEvent(),e.state=RequestState$1.RECEIVED,e.requestFunction();if(++statistics.numberOfAttemptedRequests,defined(e.serverKey)||(e.serverKey=RequestScheduler.getServerKey(e.url)),!RequestScheduler.throttleRequests||!e.throttleByServer||serverHasOpenSlots(e.serverKey)){if(!RequestScheduler.throttleRequests||!e.throttle)return startRequest(e);if(!(activeRequests.length>=RequestScheduler.maximumRequests)){updatePriority(e);var t=requestHeap.insert(e);if(defined(t)){if(t===e)return;cancelRequest(t)}return issueRequest(e)}}},RequestScheduler.clearForSpecs=function(){for(;0<requestHeap.length;)cancelRequest(requestHeap.pop());for(var e=activeRequests.length,t=0;t<e;++t)cancelRequest(activeRequests[t]);activeRequests.length=0,numberOfActiveRequestsByServer={},statistics.numberOfAttemptedRequests=0,statistics.numberOfActiveRequests=0,statistics.numberOfCancelledRequests=0,statistics.numberOfCancelledActiveRequests=0,statistics.numberOfFailedRequests=0,statistics.numberOfActiveRequestsEver=0,statistics.lastNumberOfActiveRequests=0},RequestScheduler.numberOfActiveRequestsByServer=function(e){return numberOfActiveRequestsByServer[e]},RequestScheduler.requestHeap=requestHeap;var TrustedServers={},_servers={};function getAuthority(e){var t=new URI(e);t.normalize();e=t.getAuthority();if(defined(e)){if(-1===(e=-1!==e.indexOf("@")?e.split("@")[1]:e).indexOf(":")){t=t.getScheme();if("http"===(t=!defined(t)?(t=window.location.protocol).substring(0,t.length-1):t))e+=":80";else{if("https"!==t)return;e+=":443"}}return e}}TrustedServers.add=function(e,t){t=e.toLowerCase()+":"+t;defined(_servers[t])||(_servers[t]=!0)},TrustedServers.remove=function(e,t){t=e.toLowerCase()+":"+t;defined(_servers[t])&&delete _servers[t]},TrustedServers.contains=function(e){e=getAuthority(e);return!(!defined(e)||!defined(_servers[e]))},TrustedServers.clear=function(){_servers={}};var xhrBlobSupported=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),(e.responseType="blob")===e.responseType}catch(e){return!1}}(),supportsImageBitmapOptionsPromise;function parseQuery(e,t,i,r){var n,a=e.query;if(!defined(a)||0===a.length)return 1;a=-1===a.indexOf("=")?((n={})[a]=void 0,n):queryToObject(a),t._queryParameters=i?combineQueryParameters(a,t._queryParameters,r):a,e.query=void 0}function stringifyQuery(e,t){var i=t._queryParameters,t=Object.keys(i);1!==t.length||defined(i[t[0]])?e.query=objectToQuery(i):e.query=t[0]}function defaultClone(e,t){return defined(e)?defined(e.clone)?e.clone():clone$1(e):t}function checkAndResetRequest(e){if(e.state===RequestState$1.ISSUED||e.state===RequestState$1.ACTIVE)throw new RuntimeError("The Resource is already being fetched.");e.state=RequestState$1.UNISSUED,e.deferred=void 0}function combineQueryParameters(e,t,i){if(!i)return combine$2(e,t);var r,n,a,o=clone$1(e,!0);for(r in t)t.hasOwnProperty(r)&&(n=o[r],a=t[r],defined(n)?(Array.isArray(n)||(n=o[r]=[n]),o[r]=n.concat(a)):o[r]=Array.isArray(a)?a.slice():a);return o}function Resource(e){"string"==typeof(e=defaultValue(e,defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void 0,this._templateValues=defaultClone(e.templateValues,{}),this._queryParameters=defaultClone(e.queryParameters,{}),this.headers=defaultClone(e.headers,{}),this.request=defaultValue(e.request,new Request),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=defaultValue(e.retryAttempts,0),this._retryCount=0;e=new URI(e.url);parseQuery(e,this,!0,!0),e.fragment=void 0,this._url=e.toString()}function fetchImage(e){var i=e.resource,r=e.flipY,n=e.preferImageBitmap,a=i.request;a.url=i.url,a.requestFunction=function(){var e=!1;i.isDataUri||i.isBlobUri||(e=i.isCrossOriginUrl);var t=when.defer();return Resource._Implementations.createImage(a,e,t,r,n),t.promise};e=RequestScheduler.request(a);if(defined(e))return e.otherwise(function(t){return a.state!==RequestState$1.FAILED?when.reject(t):i.retryOnError(t).then(function(e){return e?(a.state=RequestState$1.UNISSUED,a.deferred=void 0,fetchImage({resource:i,flipY:r,preferImageBitmap:n})):when.reject(t)})})}function fetchJsonp(i,r,n){var e={};e[r]=n,i.setQueryParameters(e);var a=i.request;a.url=i.url,a.requestFunction=function(){var t=when.defer();return window[n]=function(e){t.resolve(e);try{delete window[n]}catch(e){window[n]=void 0}},Resource._Implementations.loadAndExecuteScript(i.url,n,t),t.promise};e=RequestScheduler.request(a);if(defined(e))return e.otherwise(function(t){return a.state!==RequestState$1.FAILED?when.reject(t):i.retryOnError(t).then(function(e){return e?(a.state=RequestState$1.UNISSUED,a.deferred=void 0,fetchJsonp(i,r,n)):when.reject(t)})})}Resource.createIfNeeded=function(e){return e instanceof Resource?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new Resource({url:e})},Resource.supportsImageBitmapOptions=function(){if(defined(supportsImageBitmapOptionsPromise))return supportsImageBitmapOptionsPromise;if("function"!=typeof createImageBitmap)return supportsImageBitmapOptionsPromise=when.resolve(!1);return supportsImageBitmapOptionsPromise=Resource.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg=="}).then(function(e){return createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none"})}).then(function(e){return!0}).otherwise(function(){return!1})},Object.defineProperties(Resource,{isBlobSupported:{get:function(){return xhrBlobSupported}}}),Object.defineProperties(Resource.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){e=new URI(e);parseQuery(e,this,!1),e.fragment=void 0,this._url=e.toString()}},extension:{get:function(){return getExtensionFromUri(this._url)}},isDataUri:{get:function(){return isDataUri(this._url)}},isBlobUri:{get:function(){return isBlobUri(this._url)}},isCrossOriginUrl:{get:function(){return isCrossOriginUrl(this._url)}},hasHeaders:{get:function(){return 0<Object.keys(this.headers).length}}}),Resource.prototype.toString=function(){return this.getUrlComponent(!0,!0)},Resource.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var i=new URI(this._url);e&&stringifyQuery(i,this);var i=i.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),r=this._templateValues,i=i.replace(/{(.*?)}/g,function(e,t){t=r[t];return defined(t)?encodeURIComponent(t):e});return i=t&&defined(this.proxy)?this.proxy.getURL(i):i},Resource.prototype.setQueryParameters=function(e,t){this._queryParameters=t?combineQueryParameters(this._queryParameters,e,!1):combineQueryParameters(e,this._queryParameters,!1)},Resource.prototype.appendQueryParameters=function(e){this._queryParameters=combineQueryParameters(e,this._queryParameters,!0)},Resource.prototype.setTemplateValues=function(e,t){this._templateValues=t?combine$2(this._templateValues,e):combine$2(e,this._templateValues)},Resource.prototype.getDerivedResource=function(e){var t,i=this.clone();return i._retryCount=0,defined(e.url)&&(parseQuery(t=new URI(e.url),i,!0,defaultValue(e.preserveQueryParameters,!1)),t.fragment=void 0,i._url=t.resolve(new URI(getAbsoluteUri(this._url))).toString()),defined(e.queryParameters)&&(i._queryParameters=combine$2(e.queryParameters,i._queryParameters)),defined(e.templateValues)&&(i._templateValues=combine$2(e.templateValues,i.templateValues)),defined(e.headers)&&(i.headers=combine$2(e.headers,i.headers)),defined(e.proxy)&&(i.proxy=e.proxy),defined(e.request)&&(i.request=e.request),defined(e.retryCallback)&&(i.retryCallback=e.retryCallback),defined(e.retryAttempts)&&(i.retryAttempts=e.retryAttempts),i},Resource.prototype.retryOnError=function(e){var t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return when(!1);var i=this;return when(t(this,e)).then(function(e){return++i._retryCount,e})},Resource.prototype.clone=function(e){return(e=!defined(e)?new Resource({url:this._url}):e)._url=this._url,e._queryParameters=clone$1(this._queryParameters),e._templateValues=clone$1(this._templateValues),e.headers=clone$1(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Resource.prototype.getBaseUri=function(e){return getBaseUri(this.getUrlComponent(e),e)},Resource.prototype.appendForwardSlash=function(){this._url=appendForwardSlash(this._url)},Resource.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Resource.fetchArrayBuffer=function(e){return new Resource(e).fetchArrayBuffer()},Resource.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Resource.fetchBlob=function(e){return new Resource(e).fetchBlob()},Resource.prototype.fetchImage=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.preferImageBitmap,!1),i=defaultValue(e.preferBlob,!1),r=defaultValue(e.flipY,!1);if(checkAndResetRequest(this.request),!xhrBlobSupported||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!i)return fetchImage({resource:this,flipY:r,preferImageBitmap:t});var n,a,o,s=this.fetchBlob();return defined(s)?Resource.supportsImageBitmapOptions().then(function(e){return n=e&&t,s}).then(function(e){if(defined(e)){if(o=e,n)return Resource.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1});e=window.URL.createObjectURL(e);return fetchImage({resource:a=new Resource({url:e}),flipY:r,preferImageBitmap:!1})}}).then(function(e){if(defined(e))return e.blob=o,n||window.URL.revokeObjectURL(a.url),e}).otherwise(function(e){return defined(a)&&window.URL.revokeObjectURL(a.url),e.blob=o,when.reject(e)}):void 0},Resource.fetchImage=function(e){return new Resource(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Resource.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Resource.fetchText=function(e){return new Resource(e).fetchText()},Resource.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(defined(e))return e.then(function(e){if(defined(e))return JSON.parse(e)})},Resource.fetchJson=function(e){return new Resource(e).fetchJson()},Resource.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Resource.fetchXML=function(e){return new Resource(e).fetchXML()},Resource.prototype.fetchJsonp=function(e){var t;for(e=defaultValue(e,"callback"),checkAndResetRequest(this.request);t="loadJsonp"+Math.random().toString().substring(2,8),defined(window[t]););return fetchJsonp(this,e,t)},Resource.fetchJsonp=function(e){return new Resource(e).fetchJsonp(e.callbackParameterName)},Resource.prototype._makeRequest=function(s){var l=this;checkAndResetRequest(l.request);var c=l.request;c.url=l.url,c.requestFunction=function(){var e=s.responseType,t=combine$2(s.headers,l.headers),i=s.overrideMimeType,r=s.method,n=s.data,a=when.defer(),o=Resource._Implementations.loadWithXhr(l.url,e,r,n,t,a,i);return defined(o)&&defined(o.abort)&&(c.cancelFunction=function(){o.abort()}),a.promise};var e=RequestScheduler.request(c);if(defined(e))return e.then(function(e){return c.cancelFunction=void 0,e}).otherwise(function(t){return c.cancelFunction=void 0,c.state!==RequestState$1.FAILED?when.reject(t):l.retryOnError(t).then(function(e){return e?(c.state=RequestState$1.UNISSUED,c.deferred=void 0,l.fetch(s)):when.reject(t)})})};var dataUriRegex$1=/^data:(.*?)(;base64)?,(.*)$/;function decodeDataUriText(e,t){t=decodeURIComponent(t);return e?atob(t):t}function decodeDataUriArrayBuffer(e,t){for(var i=decodeDataUriText(e,t),t=new ArrayBuffer(i.length),r=new Uint8Array(t),n=0;n<i.length;n++)r[n]=i.charCodeAt(n);return t}function decodeDataUri(e,t){t=defaultValue(t,"");var i=e[1],r=!!e[2],n=e[3];switch(t){case"":case"text":return decodeDataUriText(r,n);case"arraybuffer":return decodeDataUriArrayBuffer(r,n);case"blob":var a=decodeDataUriArrayBuffer(r,n);return new Blob([a],{type:i});case"document":return(new DOMParser).parseFromString(decodeDataUriText(r,n),i);case"json":return JSON.parse(decodeDataUriText(r,n))}}function loadImageElement(e,t,i){var r=new Image;r.onload=function(){i.resolve(r)},r.onerror=function(e){i.reject(e)},t&&(TrustedServers.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e}function decodeResponse(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function loadWithHttpRequest(e,r,t,i,n,a,o){var s=require("url").parse(e),e="https:"===s.protocol?require("https"):require("http"),l=require("zlib"),n={protocol:s.protocol,hostname:s.hostname,port:s.port,path:s.path,query:s.query,method:t,headers:n};e.request(n).on("response",function(t){var i;t.statusCode<200||300<=t.statusCode?a.reject(new RequestErrorEvent(t.statusCode,t,t.headers)):(i=[],t.on("data",function(e){i.push(e)}),t.on("end",function(){var e=Buffer.concat(i);"gzip"===t.headers["content-encoding"]?l.gunzip(e,function(e,t){e?a.reject(new RuntimeError("Error decompressing response.")):a.resolve(decodeResponse(t,r))}):a.resolve(decodeResponse(e,r))}))}).on("error",function(e){a.reject(new RequestErrorEvent)}).end()}Resource.prototype.fetch=function(e){return(e=defaultClone(e,{})).method="GET",this._makeRequest(e)},Resource.fetch=function(e){return new Resource(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Resource.prototype.delete=function(e){return(e=defaultClone(e,{})).method="DELETE",this._makeRequest(e)},Resource.delete=function(e){return new Resource(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},Resource.prototype.head=function(e){return(e=defaultClone(e,{})).method="HEAD",this._makeRequest(e)},Resource.head=function(e){return new Resource(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Resource.prototype.options=function(e){return(e=defaultClone(e,{})).method="OPTIONS",this._makeRequest(e)},Resource.options=function(e){return new Resource(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Resource.prototype.post=function(e,t){return Check.defined("data",e),(t=defaultClone(t,{})).method="POST",t.data=e,this._makeRequest(t)},Resource.post=function(e){return new Resource(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Resource.prototype.put=function(e,t){return Check.defined("data",e),(t=defaultClone(t,{})).method="PUT",t.data=e,this._makeRequest(t)},Resource.put=function(e){return new Resource(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Resource.prototype.patch=function(e,t){return Check.defined("data",e),(t=defaultClone(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},Resource.patch=function(e){return new Resource(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Resource._Implementations={},Resource._Implementations.createImage=function(i,r,n,a,o){var s=i.url;Resource.supportsImageBitmapOptions().then(function(e){if(e&&o){var e=when.defer(),t=Resource._Implementations.loadWithXhr(s,"blob","GET",void 0,void 0,e,void 0,void 0,void 0);return defined(t)&&defined(t.abort)&&(i.cancelFunction=function(){t.abort()}),e.promise.then(function(e){return defined(e)?Resource.createImageBitmapFromBlob(e,{flipY:a,premultiplyAlpha:!1}):void n.reject(new RuntimeError("Successfully retrieved "+s+" but it contained no content."))}).then(n.resolve)}loadImageElement(s,r,n)}).otherwise(n.reject)},Resource.createImageBitmapFromBlob=function(e,t){return Check.defined("options",t),Check.typeOf.bool("options.flipY",t.flipY),Check.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none"})};var noXMLHttpRequest="undefined"==typeof XMLHttpRequest;Resource._Implementations.loadWithXhr=function(e,n,a,t,i,o,r){var s=dataUriRegex$1.exec(e);if(null===s){if(!noXMLHttpRequest){var l=new XMLHttpRequest;if(TrustedServers.contains(e)&&(l.withCredentials=!0),l.open(a,e,!0),defined(r)&&defined(l.overrideMimeType)&&l.overrideMimeType(r),defined(i))for(var c in i)i.hasOwnProperty(c)&&l.setRequestHeader(c,i[c]);defined(n)&&(l.responseType=n);var u=!1;return"string"==typeof e&&(u=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),l.onload=function(){if(!(l.status<200||300<=l.status)||u&&0===l.status){var e=l.response,t=l.responseType;if("HEAD"===a||"OPTIONS"===a){var i=l.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return i.forEach(function(e){var t=e.split(": "),e=t.shift();r[e]=t.join(": ")}),void o.resolve(r)}if(204===l.status)o.resolve();else if(!defined(e)||defined(n)&&t!==n)if("json"===n&&"string"==typeof e)try{o.resolve(JSON.parse(e))}catch(e){o.reject(e)}else(""===t||"document"===t)&&defined(l.responseXML)&&l.responseXML.hasChildNodes()?o.resolve(l.responseXML):""!==t&&"text"!==t||!defined(l.responseText)?o.reject(new RuntimeError("Invalid XMLHttpRequest response type.")):o.resolve(l.responseText);else o.resolve(e)}else o.reject(new RequestErrorEvent(l.status,l.response,l.getAllResponseHeaders()))},l.onerror=function(e){o.reject(new RequestErrorEvent)},l.send(t),l}loadWithHttpRequest(e,n,a,t,i,o)}else o.resolve(decodeDataUri(s,n))},Resource._Implementations.loadAndExecuteScript=function(e,t,i){return loadAndExecuteScript(e).otherwise(i.reject)},Resource._DefaultImplementations={},Resource._DefaultImplementations.createImage=Resource._Implementations.createImage,Resource._DefaultImplementations.loadWithXhr=Resource._Implementations.loadWithXhr,Resource._DefaultImplementations.loadAndExecuteScript=Resource._Implementations.loadAndExecuteScript,Resource.DEFAULT=Object.freeze(new Resource({url:"undefined"==typeof document?"":document.location.href.split("?")[0]}));var cesiumScriptRegex=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/,a,baseResource,implementation$2;function getBaseUrlFromCesiumScript(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;t<i;++t){var r=e[t].getAttribute("src"),r=cesiumScriptRegex.exec(r);if(null!==r)return r[1]}}function tryMakeAbsolute(e){return"undefined"==typeof document?e:((a=!defined(a)?document.createElement("a"):a).href=e,a.href=a.href,a.href)}function getCesiumBaseUrl(){if(defined(baseResource))return baseResource;var e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&defined(define.amd)&&!define.amd.toUrlUndefined&&defined(require.toUrl)?getAbsoluteUri("..",buildModuleUrl("Core/buildModuleUrl.js")):getBaseUrlFromCesiumScript();return(baseResource=new Resource({url:tryMakeAbsolute(e)})).appendForwardSlash(),baseResource}function buildModuleUrlFromRequireToUrl(e){return tryMakeAbsolute(require.toUrl("../"+e))}function buildModuleUrlFromBaseUrl(e){return getCesiumBaseUrl().getDerivedResource({url:e}).url}function buildModuleUrl(e){return(implementation$2=!defined(implementation$2)?"object"==typeof define&&defined(define.amd)&&!define.amd.toUrlUndefined&&defined(require.toUrl)?buildModuleUrlFromRequireToUrl:buildModuleUrlFromBaseUrl:implementation$2)(e)}function Cartesian2(e,t){this.x=defaultValue(e,0),this.y=defaultValue(t,0)}buildModuleUrl._cesiumScriptRegex=cesiumScriptRegex,buildModuleUrl._buildModuleUrlFromBaseUrl=buildModuleUrlFromBaseUrl,buildModuleUrl._clearBaseResource=function(){baseResource=void 0},buildModuleUrl.setBaseUrl=function(e){baseResource=Resource.DEFAULT.getDerivedResource({url:e})},buildModuleUrl.getCesiumBaseUrl=getCesiumBaseUrl,Cartesian2.fromElements=function(e,t,i){return defined(i)?(i.x=e,i.y=t,i):new Cartesian2(e,t)},Cartesian2.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t):new Cartesian2(e.x,e.y)},Cartesian2.fromCartesian3=Cartesian2.clone,Cartesian2.fromCartesian4=Cartesian2.clone,Cartesian2.packedLength=2,Cartesian2.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i]=e.y,t},Cartesian2.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Cartesian2:i).x=e[t++],i.y=e[t],i},Cartesian2.packArray=function(e,t){var i=e.length,r=2*i;if(defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;n<i;++n)Cartesian2.pack(e[n],t,2*n);return t},Cartesian2.unpackArray=function(e,t){var i=e.length;defined(t)?t.length=i/2:t=new Array(i/2);for(var r=0;r<i;r+=2){var n=r/2;t[n]=Cartesian2.unpack(e,r,t[n])}return t},Cartesian2.fromArray=Cartesian2.unpack,Cartesian2.maximumComponent=function(e){return Math.max(e.x,e.y)},Cartesian2.minimumComponent=function(e){return Math.min(e.x,e.y)},Cartesian2.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},Cartesian2.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},Cartesian2.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},Cartesian2.magnitude=function(e){return Math.sqrt(Cartesian2.magnitudeSquared(e))};var distanceScratch$1=new Cartesian2;Cartesian2.distance=function(e,t){return Cartesian2.subtract(e,t,distanceScratch$1),Cartesian2.magnitude(distanceScratch$1)},Cartesian2.distanceSquared=function(e,t){return Cartesian2.subtract(e,t,distanceScratch$1),Cartesian2.magnitudeSquared(distanceScratch$1)},Cartesian2.normalize=function(e,t){var i=Cartesian2.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t},Cartesian2.dot=function(e,t){return e.x*t.x+e.y*t.y},Cartesian2.cross=function(e,t){return e.x*t.y-e.y*t.x},Cartesian2.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i},Cartesian2.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i},Cartesian2.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i},Cartesian2.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i},Cartesian2.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i},Cartesian2.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i},Cartesian2.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},Cartesian2.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var lerpScratch$1=new Cartesian2;Cartesian2.lerp=function(e,t,i,r){return Cartesian2.multiplyByScalar(t,i,lerpScratch$1),r=Cartesian2.multiplyByScalar(e,1-i,r),Cartesian2.add(lerpScratch$1,r,r)};var angleBetweenScratch=new Cartesian2,angleBetweenScratch2=new Cartesian2;Cartesian2.angleBetween=function(e,t){return Cartesian2.normalize(e,angleBetweenScratch),Cartesian2.normalize(t,angleBetweenScratch2),CesiumMath.acosClamped(Cartesian2.dot(angleBetweenScratch,angleBetweenScratch2))};var mostOrthogonalAxisScratch=new Cartesian2;function GeographicTilingScheme(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._rectangle=defaultValue(e.rectangle,Rectangle.MAX_VALUE),this._projection=new GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=defaultValue(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=defaultValue(e.numberOfLevelZeroTilesY,1)}Cartesian2.mostOrthogonalAxis=function(e,t){e=Cartesian2.normalize(e,mostOrthogonalAxisScratch);return Cartesian2.abs(e,e),t=e.x<=e.y?Cartesian2.clone(Cartesian2.UNIT_X,t):Cartesian2.clone(Cartesian2.UNIT_Y,t)},Cartesian2.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y},Cartesian2.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},Cartesian2.equalsEpsilon=function(e,t,i,r){return e===t||defined(e)&&defined(t)&&CesiumMath.equalsEpsilon(e.x,t.x,i,r)&&CesiumMath.equalsEpsilon(e.y,t.y,i,r)},Cartesian2.ZERO=Object.freeze(new Cartesian2(0,0)),Cartesian2.UNIT_X=Object.freeze(new Cartesian2(1,0)),Cartesian2.UNIT_Y=Object.freeze(new Cartesian2(0,1)),Cartesian2.prototype.clone=function(e){return Cartesian2.clone(this,e)},Cartesian2.prototype.equals=function(e){return Cartesian2.equals(this,e)},Cartesian2.prototype.equalsEpsilon=function(e,t,i){return Cartesian2.equalsEpsilon(this,e,t,i)},Cartesian2.prototype.toString=function(){return"("+this.x+", "+this.y+")"},Object.defineProperties(GeographicTilingScheme.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),GeographicTilingScheme.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},GeographicTilingScheme.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},GeographicTilingScheme.prototype.rectangleToNativeRectangle=function(e,t){var i=CesiumMath.toDegrees(e.west),r=CesiumMath.toDegrees(e.south),n=CesiumMath.toDegrees(e.east),e=CesiumMath.toDegrees(e.north);return defined(t)?(t.west=i,t.south=r,t.east=n,t.north=e,t):new Rectangle(i,r,n,e)},GeographicTilingScheme.prototype.tileXYToNativeRectangle=function(e,t,i,r){r=this.tileXYToRectangle(e,t,i,r);return r.west=CesiumMath.toDegrees(r.west),r.south=CesiumMath.toDegrees(r.south),r.east=CesiumMath.toDegrees(r.east),r.north=CesiumMath.toDegrees(r.north),r},GeographicTilingScheme.prototype.tileXYToRectangle=function(e,t,i,r){var n=this._rectangle,a=this.getNumberOfXTilesAtLevel(i),o=this.getNumberOfYTilesAtLevel(i),i=n.width/a,a=e*i+n.west,e=(e+1)*i+n.west,i=n.height/o,o=n.north-t*i,i=n.north-(t+1)*i;return(r=!defined(r)?new Rectangle(a,i,e,o):r).west=a,r.south=i,r.east=e,r.north=o,r},GeographicTilingScheme.prototype.positionToTileXY=function(e,t,i){var r=this._rectangle;if(Rectangle.contains(r,e)){var n=this.getNumberOfXTilesAtLevel(t),a=this.getNumberOfYTilesAtLevel(t),o=r.width/n,s=r.height/a,t=e.longitude;r.east<r.west&&(t+=CesiumMath.TWO_PI);o=(t-r.west)/o|0;n<=o&&(o=n-1);s=(r.north-e.latitude)/s|0;return(a<=s&&(s=a-1),defined(i))?(i.x=o,i.y=s,i):new Cartesian2(o,s)}};var scratchDiagonalCartesianNE=new Cartesian3,scratchDiagonalCartesianSW=new Cartesian3,scratchDiagonalCartographic=new Cartographic,scratchCenterCartesian=new Cartesian3,scratchSurfaceCartesian=new Cartesian3,scratchBoundingSphere$4=new BoundingSphere,tilingScheme=new GeographicTilingScheme,scratchCorners=[new Cartographic,new Cartographic,new Cartographic,new Cartographic],scratchTileXY=new Cartesian2,ApproximateTerrainHeights={};function getTileXYLevel(e){Cartographic.fromRadians(e.east,e.north,0,scratchCorners[0]),Cartographic.fromRadians(e.west,e.north,0,scratchCorners[1]),Cartographic.fromRadians(e.east,e.south,0,scratchCorners[2]),Cartographic.fromRadians(e.west,e.south,0,scratchCorners[3]);for(var t=0,i=0,r=0,n=0,a=ApproximateTerrainHeights._terrainHeightsMaxLevel,o=0;o<=a;++o){for(var s=!1,l=0;l<4;++l){var c=scratchCorners[l];if(tilingScheme.positionToTileXY(c,o,scratchTileXY),0===l)r=scratchTileXY.x,n=scratchTileXY.y;else if(r!==scratchTileXY.x||n!==scratchTileXY.y){s=!0;break}}if(s)break;t=r,i=n}if(0!==o)return{x:t,y:i,level:a<o?a:o-1}}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}ApproximateTerrainHeights.initialize=function(){var e=ApproximateTerrainHeights._initPromise;return defined(e)?e:(e=Resource.fetchJson(buildModuleUrl("Assets/approximateTerrainHeights.json")).then(function(e){ApproximateTerrainHeights._terrainHeights=e}),ApproximateTerrainHeights._initPromise=e)},ApproximateTerrainHeights.getMinimumMaximumHeights=function(e,t){t=defaultValue(t,Ellipsoid.WGS84);var i=getTileXYLevel(e),r=ApproximateTerrainHeights._defaultMinTerrainHeight,n=ApproximateTerrainHeights._defaultMaxTerrainHeight;return defined(i)&&(i=i.level+"-"+i.x+"-"+i.y,defined(i=ApproximateTerrainHeights._terrainHeights[i])&&(r=i[0],n=i[1]),t.cartographicToCartesian(Rectangle.northeast(e,scratchDiagonalCartographic),scratchDiagonalCartesianNE),t.cartographicToCartesian(Rectangle.southwest(e,scratchDiagonalCartographic),scratchDiagonalCartesianSW),Cartesian3.midpoint(scratchDiagonalCartesianSW,scratchDiagonalCartesianNE,scratchCenterCartesian),r=defined(t=t.scaleToGeodeticSurface(scratchCenterCartesian,scratchSurfaceCartesian))?(t=Cartesian3.distance(scratchCenterCartesian,t),Math.min(r,-t)):ApproximateTerrainHeights._defaultMinTerrainHeight),{minimumTerrainHeight:r=Math.max(ApproximateTerrainHeights._defaultMinTerrainHeight,r),maximumTerrainHeight:n}},ApproximateTerrainHeights.getBoundingSphere=function(e,t){t=defaultValue(t,Ellipsoid.WGS84);var i=getTileXYLevel(e),r=ApproximateTerrainHeights._defaultMaxTerrainHeight;defined(i)&&(n=i.level+"-"+i.x+"-"+i.y,defined(n=ApproximateTerrainHeights._terrainHeights[n])&&(r=n[1]));var n=BoundingSphere.fromRectangle3D(e,t,0);return BoundingSphere.fromRectangle3D(e,t,r,scratchBoundingSphere$4),BoundingSphere.union(n,scratchBoundingSphere$4,n)},ApproximateTerrainHeights._terrainHeightsMaxLevel=6,ApproximateTerrainHeights._defaultMaxTerrainHeight=9e3,ApproximateTerrainHeights._defaultMinTerrainHeight=-1e5,ApproximateTerrainHeights._terrainHeights=void 0,ApproximateTerrainHeights._initPromise=void 0,Object.defineProperties(ApproximateTerrainHeights,{initialized:{get:function(){return defined(ApproximateTerrainHeights._terrainHeights)}}});var hasOwnProperty=Object.hasOwnProperty,setPrototypeOf=Object.setPrototypeOf,isFrozen=Object.isFrozen,freeze=Object.freeze,seal=Object.seal,create=Object.create,_ref="undefined"!=typeof Reflect&&Reflect,apply=_ref.apply,construct=_ref.construct,apply=apply||function(e,t,i){return e.apply(t,i)},freeze=freeze||function(e){return e},seal=seal||function(e){return e},construct=construct||function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(_toConsumableArray(t))))},arrayForEach=unapply(Array.prototype.forEach),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),stringToLowerCase=unapply(String.prototype.toLowerCase),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(n){return function(e){for(var t=arguments.length,i=Array(1<t?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return apply(n,e,i)}}function unconstruct(r){return function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return construct(r,t)}}function addToSet(e,t){setPrototypeOf&&setPrototypeOf(e,null);for(var i=t.length;i--;){var r,n=t[i];"string"!=typeof n||(r=stringToLowerCase(n))!==n&&(isFrozen(t)||(t[i]=r),n=r),e[n]=!0}return e}function clone(e){var t=create(null),i=void 0;for(i in e)apply(hasOwnProperty,e,[i])&&(t[i]=e[i]);return t}var html=freeze(["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"]),svg=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","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","video","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),mathMl=freeze(["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"]),text=freeze(["#text"]),html$1=freeze(["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","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","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","xmlns"]),svg$1=freeze(["accent-height","accumulate","additive","alignment-baseline","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","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","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","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","targetx","targety","transform","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"]),mathMl$1=freeze(["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"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm),ERB_EXPR=seal(/<%[\s\S]*|[\s\S]*%>/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _toConsumableArray$1(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var getGlobal=function(){return"undefined"==typeof window?null:window},_createTrustedTypesPolicy=function(e,t){if("object"!==(void 0===e?"undefined":_typeof(e))||"function"!=typeof e.createPolicy)return null;var i=null,r="data-tt-policy-suffix",i="dompurify"+((i=t.currentScript&&t.currentScript.hasAttribute(r)?t.currentScript.getAttribute(r):i)?"#"+i:"");try{return e.createPolicy(i,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function createDOMPurify(){function u(e){return createDOMPurify(e)}var l=0<arguments.length&&void 0!==arguments[0]?arguments[0]:getGlobal();if(u.version="2.2.2",u.removed=[],!l||!l.document||9!==l.document.nodeType)return u.isSupported=!1,u;var c=l.document,a=l.document,d=l.DocumentFragment,e=l.HTMLTemplateElement,h=l.Node,t=l.NodeFilter,i=l.NamedNodeMap,n=void 0===i?l.NamedNodeMap||l.MozNamedAttrMap:i,o=l.Text,s=l.Comment,p=l.DOMParser,i=l.trustedTypes;"function"!=typeof e||(e=a.createElement("template")).content&&e.content.ownerDocument&&(a=e.content.ownerDocument);var m=_createTrustedTypesPolicy(i,c),f=m&&ie?m.createHTML(""):"",g=a.implementation,r=a.createNodeIterator,_=a.getElementsByTagName,y=a.createDocumentFragment,C=c.importNode,i={};try{i=clone(a).documentMode?a.documentMode:{}}catch(e){}var v={};u.isSupported=g&&void 0!==g.createHTMLDocument&&9!==i;function S(e){de&&de===e||(e=clone(e=!e||"object"!==(void 0===e?"undefined":_typeof(e))?{}:e),z="ALLOWED_TAGS"in e?addToSet({},e.ALLOWED_TAGS):$,U="ALLOWED_ATTR"in e?addToSet({},e.ALLOWED_ATTR):G,ce="ADD_URI_SAFE_ATTR"in e?addToSet(clone(ue),e.ADD_URI_SAFE_ATTR):ue,se="ADD_DATA_URI_TAGS"in e?addToSet(clone(le),e.ADD_DATA_URI_TAGS):le,H="FORBID_TAGS"in e?addToSet({},e.FORBID_TAGS):{},W="FORBID_ATTR"in e?addToSet({},e.FORBID_ATTR):{},R="USE_PROFILES"in e&&e.USE_PROFILES,q=!1!==e.ALLOW_ARIA_ATTR,j=!1!==e.ALLOW_DATA_ATTR,Y=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=e.SAFE_FOR_TEMPLATES||!1,Q=e.WHOLE_DOCUMENT||!1,K=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=!1!==e.RETURN_DOM_IMPORT,ie=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,k=e.ALLOWED_URI_REGEXP||k,X&&(j=!1),ee&&(K=!0),R&&(z=addToSet({},[].concat(_toConsumableArray$1(text))),U=[],!0===R.html&&(addToSet(z,html),addToSet(U,html$1)),!0===R.svg&&(addToSet(z,svg),addToSet(U,svg$1),addToSet(U,xml)),!0===R.svgFilters&&(addToSet(z,svgFilters),addToSet(U,svg$1),addToSet(U,xml)),!0===R.mathMl&&(addToSet(z,mathMl),addToSet(U,mathMl$1),addToSet(U,xml))),e.ADD_TAGS&&addToSet(z=z===$?clone(z):z,e.ADD_TAGS),e.ADD_ATTR&&addToSet(U=U===G?clone(U):U,e.ADD_ATTR),e.ADD_URI_SAFE_ATTR&&addToSet(ce,e.ADD_URI_SAFE_ATTR),ne&&(z["#text"]=!0),Q&&addToSet(z,["html","head","body"]),z.table&&(addToSet(z,["tbody"]),delete H.tbody),freeze&&freeze(e),de=e)}function T(t){arrayPush(u.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){t.outerHTML=f}}function x(e,t){try{arrayPush(u.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){arrayPush(u.removed,{attribute:null,from:t})}t.removeAttribute(e)}function b(e){var t=void 0,i=void 0;Z?e="<remove></remove>"+e:i=(r=stringMatch(e,/^[\r\n\t ]+/))&&r[0];var r,n=m?m.createHTML(e):e;try{t=(new p).parseFromString(n,"text/html")}catch(e){}return t&&t.documentElement||((r=(t=g.createHTMLDocument("")).body).parentNode.removeChild(r.parentNode.firstElementChild),r.outerHTML=n),e&&i&&t.body.insertBefore(a.createTextNode(i),t.body.childNodes[0]||null),_.call(t,Q?"html":"body")[0]}function E(e){return r.call(e.ownerDocument||e,e,t.SHOW_ELEMENT|t.SHOW_COMMENT|t.SHOW_TEXT,function(){return t.FILTER_ACCEPT},!1)}function P(e){return"object"===(void 0===h?"undefined":_typeof(h))?e instanceof h:e&&"object"===(void 0===e?"undefined":_typeof(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName}function A(e,t,i){v[e]&&arrayForEach(v[e],function(e){e.call(u,t,i,de)})}function w(e){var t;if(A("beforeSanitizeElements",e,null),!((i=e)instanceof o||i instanceof s)&&!("string"==typeof i.nodeName&&"string"==typeof i.textContent&&"function"==typeof i.removeChild&&i.attributes instanceof n&&"function"==typeof i.removeAttribute&&"function"==typeof i.setAttribute&&"string"==typeof i.namespaceURI))return T(e),1;if(stringMatch(e.nodeName,/[\u0080-\uFFFF]/))return T(e),1;var i=stringToLowerCase(e.nodeName);if(A("uponSanitizeElement",e,{tagName:i,allowedTags:z}),("svg"===i||"math"===i)&&0!==e.querySelectorAll("p, br, form, table").length)return T(e),1;if(!P(e.firstElementChild)&&(!P(e.content)||!P(e.content.firstElementChild))&®ExpTest(/<[!/\w]/g,e.innerHTML)&®ExpTest(/<[!/\w]/g,e.textContent))return T(e),1;if(z[i]&&!H[i])return"noscript"!==i&&"noembed"!==i||!regExpTest(/<\/no(script|embed)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,t=stringReplace(t,O," "),t=stringReplace(t,L," "),e.textContent!==t&&(arrayPush(u.removed,{element:e.cloneNode()}),e.textContent=t)),A("afterSanitizeElements",e,null),!1):(T(e),!0);if(ne&&!oe[i]&&"function"==typeof e.insertAdjacentHTML)try{var r=e.innerHTML;e.insertAdjacentHTML("AfterEnd",m?m.createHTML(r):r)}catch(e){}return T(e),1}function D(e,t,i){if(re&&("id"===t||"name"===t)&&(i in a||i in he))return!1;if(!(j&®ExpTest(F,t)||q&®ExpTest(N,t))){if(!U[t]||W[t])return!1;if(!ce[t]&&!regExpTest(k,stringReplace(i,V,"")))if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==stringIndexOf(i,"data:")||!se[e]){if((!Y||regExpTest(B,stringReplace(i,V,"")))&&i)return!1}else;}return!0}function M(e){var t=void 0,i=void 0,r=void 0;A("beforeSanitizeAttributes",e,null);var n=e.attributes;if(n){for(var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U},r=n.length;r--;){var o=(t=n[r]).name,s=t.namespaceURI,i=stringTrim(t.value),l=stringToLowerCase(o);if(a.attrName=l,a.attrValue=i,a.keepAttr=!0,a.forceKeepAttr=void 0,A("uponSanitizeAttribute",e,a),i=a.attrValue,!a.forceKeepAttr&&(x(o,e),a.keepAttr))if(regExpTest(/\/>/i,i))x(o,e);else{X&&(i=stringReplace(i,O," "),i=stringReplace(i,L," "));var c=e.nodeName.toLowerCase();if(D(c,l,i))try{s?e.setAttributeNS(s,o,i):e.setAttribute(o,i),arrayPop(u.removed)}catch(e){}}}A("afterSanitizeAttributes",e,null)}}function I(e){var t,i=E(e);for(A("beforeSanitizeShadowDOM",e,null);t=i.nextNode();)A("uponSanitizeShadowNode",t,null),w(t)||(t.content instanceof d&&I(t.content),M(t));A("afterSanitizeShadowDOM",e,null)}var R,O=MUSTACHE_EXPR,L=ERB_EXPR,F=DATA_ATTR,N=ARIA_ATTR,B=IS_SCRIPT_OR_DATA,V=ATTR_WHITESPACE,k=IS_ALLOWED_URI,z=null,$=addToSet({},[].concat(_toConsumableArray$1(html),_toConsumableArray$1(svg),_toConsumableArray$1(svgFilters),_toConsumableArray$1(mathMl),_toConsumableArray$1(text))),U=null,G=addToSet({},[].concat(_toConsumableArray$1(html$1),_toConsumableArray$1(svg$1),_toConsumableArray$1(mathMl$1),_toConsumableArray$1(xml))),H=null,W=null,q=!0,j=!0,Y=!1,X=!1,Q=!1,J=!1,Z=!1,K=!1,ee=!1,te=!0,ie=!1,re=!0,ne=!0,ae=!1,oe=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),se=null,le=addToSet({},["audio","video","img","source","image","track"]),ce=null,ue=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),de=null,he=a.createElement("form");return u.sanitize=function(e,t){var i,r,n=void 0,a=void 0,o=void 0;if("string"!=typeof(e=e||"\x3c!--\x3e")&&!P(e)){if("function"!=typeof e.toString)throw typeErrorCreate("toString is not a function");if("string"!=typeof(e=e.toString()))throw typeErrorCreate("dirty is not a string, aborting")}if(!u.isSupported){if("object"===_typeof(l.toStaticHTML)||"function"==typeof l.toStaticHTML){if("string"==typeof e)return l.toStaticHTML(e);if(P(e))return l.toStaticHTML(e.outerHTML)}return e}if(J||S(t),u.removed=[],!(ae="string"==typeof e?!1:ae))if(e instanceof h)1===(i=(n=b("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!K&&!X&&!Q&&-1===e.indexOf("<"))return m&&ie?m.createHTML(e):e;if(!(n=b(e)))return K?null:f}n&&Z&&T(n.firstChild);for(var s=E(ae?e:n);r=s.nextNode();)3===r.nodeType&&r===a||w(r)||(r.content instanceof d&&I(r.content),M(r),a=r);if(a=null,ae)return e;if(K){if(ee)for(o=y.call(n.ownerDocument);n.firstChild;)o.appendChild(n.firstChild);else o=n;return o=te?C.call(c,o,!0):o}e=Q?n.outerHTML:n.innerHTML;return X&&(e=stringReplace(e,O," "),e=stringReplace(e,L," ")),m&&ie?m.createHTML(e):e},u.setConfig=function(e){S(e),J=!0},u.clearConfig=function(){de=null,J=!1},u.isValidAttribute=function(e,t,i){de||S({});e=stringToLowerCase(e),t=stringToLowerCase(t);return D(e,t,i)},u.addHook=function(e,t){"function"==typeof t&&(v[e]=v[e]||[],arrayPush(v[e],t))},u.removeHook=function(e){v[e]&&arrayPop(v[e])},u.removeHooks=function(e){v[e]&&(v[e]=[])},u.removeAllHooks=function(){v={}},u}var purify=createDOMPurify(),nextCreditId=0,creditToId={};function Credit(e,t){var i,r=e;defined(creditToId[r])?i=creditToId[r]:(i=nextCreditId++,creditToId[r]=i),t=defaultValue(t,!1),this._id=i,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Credit.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen}},element:{get:function(){if(!defined(this._element)){var e=purify.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;for(var i=t.querySelectorAll("a"),r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=t}return this._element}}}),Credit.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e._id===t._id},Credit.prototype.equals=function(e){return Credit.equals(this,e)},Credit.getIonCredit=function(e){var t=defined(e.collapsible)&&!e.collapsible,t=new Credit(e.html,t);return t._isIon=-1!==t.html.indexOf("ion-credit.png"),t},Credit.clone=function(e){if(defined(e))return new Credit(e.html,e.showOnScreen)};var HeightmapEncoding={NONE:0,LERC:1},HeightmapEncoding$1=Object.freeze(HeightmapEncoding);function AxisAlignedBoundingBox(e,t,i){this.minimum=Cartesian3.clone(defaultValue(e,Cartesian3.ZERO)),this.maximum=Cartesian3.clone(defaultValue(t,Cartesian3.ZERO)),i=defined(i)?Cartesian3.clone(i):Cartesian3.midpoint(this.minimum,this.maximum,new Cartesian3),this.center=i}AxisAlignedBoundingBox.fromPoints=function(e,t){if(defined(t)||(t=new AxisAlignedBoundingBox),!defined(e)||0===e.length)return t.minimum=Cartesian3.clone(Cartesian3.ZERO,t.minimum),t.maximum=Cartesian3.clone(Cartesian3.ZERO,t.maximum),t.center=Cartesian3.clone(Cartesian3.ZERO,t.center),t;for(var i=e[0].x,r=e[0].y,n=e[0].z,a=e[0].x,o=e[0].y,s=e[0].z,l=e.length,c=1;c<l;c++)var u=e[c],d=u.x,h=u.y,u=u.z,i=Math.min(d,i),a=Math.max(d,a),r=Math.min(h,r),o=Math.max(h,o),n=Math.min(u,n),s=Math.max(u,s);var p=t.minimum;p.x=i,p.y=r,p.z=n;var m=t.maximum;return m.x=a,m.y=o,m.z=s,t.center=Cartesian3.midpoint(p,m,t.center),t},AxisAlignedBoundingBox.clone=function(e,t){if(defined(e))return defined(t)?(t.minimum=Cartesian3.clone(e.minimum,t.minimum),t.maximum=Cartesian3.clone(e.maximum,t.maximum),t.center=Cartesian3.clone(e.center,t.center),t):new AxisAlignedBoundingBox(e.minimum,e.maximum,e.center)},AxisAlignedBoundingBox.equals=function(e,t){return e===t||defined(e)&&defined(t)&&Cartesian3.equals(e.center,t.center)&&Cartesian3.equals(e.minimum,t.minimum)&&Cartesian3.equals(e.maximum,t.maximum)};var intersectScratch=new Cartesian3;function EllipsoidalOccluder(e,t){this._ellipsoid=e,this._cameraPosition=new Cartesian3,this._cameraPositionInScaledSpace=new Cartesian3,this._distanceToLimbInScaledSpaceSquared=0,defined(t)&&(this.cameraPosition=t)}AxisAlignedBoundingBox.intersectPlane=function(e,t){intersectScratch=Cartesian3.subtract(e.maximum,e.minimum,intersectScratch);var i=Cartesian3.multiplyByScalar(intersectScratch,.5,intersectScratch),r=t.normal,i=i.x*Math.abs(r.x)+i.y*Math.abs(r.y)+i.z*Math.abs(r.z),t=Cartesian3.dot(e.center,r)+t.distance;return 0<t-i?Intersect$1.INSIDE:t+i<0?Intersect$1.OUTSIDE:Intersect$1.INTERSECTING},AxisAlignedBoundingBox.prototype.clone=function(e){return AxisAlignedBoundingBox.clone(this,e)},AxisAlignedBoundingBox.prototype.intersectPlane=function(e){return AxisAlignedBoundingBox.intersectPlane(this,e)},AxisAlignedBoundingBox.prototype.equals=function(e){return AxisAlignedBoundingBox.equals(this,e)},Object.defineProperties(EllipsoidalOccluder.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var t=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=Cartesian3.magnitudeSquared(t)-1;Cartesian3.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=t,this._distanceToLimbInScaledSpaceSquared=i}}});var scratchCartesian$9=new Cartesian3;EllipsoidalOccluder.prototype.isPointVisible=function(e){return isScaledSpacePointVisible(this._ellipsoid.transformPositionToScaledSpace(e,scratchCartesian$9),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},EllipsoidalOccluder.prototype.isScaledSpacePointVisible=function(e){return isScaledSpacePointVisible(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var scratchCameraPositionInScaledSpaceShrunk=new Cartesian3;EllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){var i,r=this._ellipsoid,t=defined(t)&&t<0&&r.minimumRadius>-t?((i=scratchCameraPositionInScaledSpaceShrunk).x=this._cameraPosition.x/(r.radii.x+t),i.y=this._cameraPosition.y/(r.radii.y+t),i.z=this._cameraPosition.z/(r.radii.z+t),i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared);return isScaledSpacePointVisible(e,i,t)},EllipsoidalOccluder.prototype.computeHorizonCullingPoint=function(e,t,i){return computeHorizonCullingPointFromPositions(this._ellipsoid,e,t,i)};var scratchEllipsoidShrunk=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,i,r){return computeHorizonCullingPointFromPositions(getPossiblyShrunkEllipsoid(this._ellipsoid,i,scratchEllipsoidShrunk),e,t,r)},EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices=function(e,t,i,r,n){return computeHorizonCullingPointFromVertices(this._ellipsoid,e,t,i,r,n)},EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,i,r,n,a){return computeHorizonCullingPointFromVertices(getPossiblyShrunkEllipsoid(this._ellipsoid,n,scratchEllipsoidShrunk),e,t,i,r,a)};var subsampleScratch=[];EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle=function(e,t,i){var r=Rectangle.subsample(e,t,0,subsampleScratch),e=BoundingSphere.fromPoints(r);if(!(Cartesian3.magnitude(e.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(e.center,r,i)};var scratchEllipsoidShrunkRadii=new Cartesian3;function getPossiblyShrunkEllipsoid(e,t,i){return defined(t)&&t<0&&e.minimumRadius>-t&&(t=Cartesian3.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,scratchEllipsoidShrunkRadii),e=Ellipsoid.fromCartesian3(t,i)),e}function computeHorizonCullingPointFromPositions(e,t,i,r){defined(r)||(r=new Cartesian3);for(var n=computeScaledSpaceDirectionToPoint(e,t),a=0,o=0,s=i.length;o<s;++o){var l=computeMagnitude(e,i[o],n);if(l<0)return;a=Math.max(a,l)}return magnitudeToPoint(n,a,r)}var positionScratch$b=new Cartesian3;function computeHorizonCullingPointFromVertices(e,t,i,r,n,a){defined(a)||(a=new Cartesian3),r=defaultValue(r,3),n=defaultValue(n,Cartesian3.ZERO);for(var o=computeScaledSpaceDirectionToPoint(e,t),s=0,l=0,c=i.length;l<c;l+=r){positionScratch$b.x=i[l]+n.x,positionScratch$b.y=i[l+1]+n.y,positionScratch$b.z=i[l+2]+n.z;var u=computeMagnitude(e,positionScratch$b,o);if(u<0)return;s=Math.max(s,u)}return magnitudeToPoint(o,s,a)}function isScaledSpacePointVisible(e,t,i){e=Cartesian3.subtract(e,t,scratchCartesian$9),t=-Cartesian3.dot(e,t);return!(i<0?0<t:i<t&&t*t/Cartesian3.magnitudeSquared(e)>i)}var scaledSpaceScratch=new Cartesian3,directionScratch=new Cartesian3;function computeMagnitude(e,t,i){var r=e.transformPositionToScaledSpace(t,scaledSpaceScratch),e=Cartesian3.magnitudeSquared(r),t=Math.sqrt(e),r=Cartesian3.divideByScalar(r,t,directionScratch),e=Math.max(1,e),t=1/(t=Math.max(1,t));return 1/(Cartesian3.dot(r,i)*t-Cartesian3.magnitude(Cartesian3.cross(r,i,r))*(Math.sqrt(e-1)*t))}function magnitudeToPoint(e,t,i){if(!(t<=0||t===1/0||t!=t))return Cartesian3.multiplyByScalar(e,t,i)}var directionToPointScratch=new Cartesian3;function computeScaledSpaceDirectionToPoint(e,t){return Cartesian3.equals(t,Cartesian3.ZERO)?t:(e.transformPositionToScaledSpace(t,directionToPointScratch),Cartesian3.normalize(directionToPointScratch,directionToPointScratch))}var QuadraticRealPolynomial={};function addWithCancellationCheck$1(e,t,i){var r=e+t;return CesiumMath.sign(e)!==CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<i?0:r}QuadraticRealPolynomial.computeDiscriminant=function(e,t,i){return t*t-4*e*i},QuadraticRealPolynomial.computeRealRoots=function(e,t,i){if(0===e)return 0===t?[]:[-i/t];if(0===t){if(0===i)return[0,0];var r=Math.abs(i),n=Math.abs(e);if(r<n&&r/n<CesiumMath.EPSILON14)return[0,0];if(n<r&&n/r<CesiumMath.EPSILON14)return[];if((n=-i/e)<0)return[];r=Math.sqrt(n);return[-r,r]}if(0===i)return(n=-t/e)<0?[n,0]:[0,n];n=addWithCancellationCheck$1(t*t,-(4*e*i),CesiumMath.EPSILON14);if(n<0)return[];n=-.5*addWithCancellationCheck$1(t,CesiumMath.sign(t)*Math.sqrt(n),CesiumMath.EPSILON14);return 0<t?[n/e,i/n]:[i/n,n/e]};var CubicRealPolynomial={};function computeRealRoots(e,t,i,r){var n=e,a=t/3,o=i/3,s=r,l=n*o,c=a*s,u=a*a,d=o*o,h=n*o-u,e=n*s-a*o,t=a*s-d,i=4*h*t-e*e;if(i<0){var r=l*d<=u*c?-2*a*(f=h)+(m=n)*e:-(m=s)*e+2*o*(f=t),p=-(r<0?-1:1)*Math.abs(m)*Math.sqrt(-i),m=(g=p-r)/2,m=m<0?-Math.pow(-m,1/3):Math.pow(m,1/3),p=g===p?-m:-f/m,p=f<=0?m+p:-r/(m*m+p*p+f);return l*d<=u*c?[(p-a)/n]:[-s/(p+o)]}var f=h,l=-2*a*h+n*e,d=t,u=-s*e+2*o*t,c=Math.sqrt(i),h=Math.sqrt(3)/2,e=Math.abs(Math.atan2(n*c,-l)/3);p=2*Math.sqrt(-f);t=Math.cos(e);g=p*t;var i=p*(-t/2-h*Math.sin(e)),l=2*a<g+i?g-a:i-a,f=n,n=l/f,e=Math.abs(Math.atan2(s*c,-u)/3),s=-s,e=(g=(p=2*Math.sqrt(-d))*(t=Math.cos(e)))+(i=p*(-t/2-h*Math.sin(e)))<2*o?g+o:i+o,g=s/e,i=-l*e-f*s,e=(o*i-a*(l*s))/(-a*i+o*(f*e));return n<=e?n<=g?e<=g?[n,e,g]:[n,g,e]:[g,n,e]:n<=g?[e,n,g]:e<=g?[e,g,n]:[g,e,n]}CubicRealPolynomial.computeDiscriminant=function(e,t,i,r){var n=t*t,a=i*i;return 18*e*t*i*r+n*a-27*(e*e)*(r*r)-4*(e*a*i+n*t*r)},CubicRealPolynomial.computeRealRoots=function(e,t,i,r){var n;if(0===e)return QuadraticRealPolynomial.computeRealRoots(t,i,r);if(0!==t)return 0===i?0===r?(a=-t/e)<0?[a,0,0]:[0,0,a]:computeRealRoots(e,t,0,r):0===r?0===(n=QuadraticRealPolynomial.computeRealRoots(e,t,i)).length?[0]:n[1]<=0?[n[0],n[1],0]:0<=n[0]?[0,n[0],n[1]]:[n[0],0,n[1]]:computeRealRoots(e,t,i,r);if(0!==i)return 0===r?0===(n=QuadraticRealPolynomial.computeRealRoots(e,0,i)).Length?[0]:[n[0],0,n[1]]:computeRealRoots(e,0,i,r);if(0===r)return[0,0,0];var a=(a=-r/e)<0?-Math.pow(-a,1/3):Math.pow(a,1/3);return[a,a,a]};var QuarticRealPolynomial={};function original(e,t,i,r){var n=e*e,a=t-3*n/8,o=i-t*e/2+n*e/8,r=r-i*e/4+t*n/16-3*n*n/256,i=CubicRealPolynomial.computeRealRoots(1,2*a,a*a-4*r,-o*o);if(0<i.length){t=-e/4,n=i[i.length-1];if(Math.abs(n)<CesiumMath.EPSILON14){e=QuadraticRealPolynomial.computeRealRoots(1,a,r);if(2===e.length){var i=e[0],s=e[1];if(0<=i&&0<=s){r=Math.sqrt(i),e=Math.sqrt(s);return[t-e,t-r,t+r,t+e]}if(0<=i&&s<0)return[t-(l=Math.sqrt(i)),t+l];if(i<0&&0<=s)return[t-(l=Math.sqrt(s)),t+l]}return[]}if(0<n){var s=Math.sqrt(n),l=(a+n+o/s)/2,o=QuadraticRealPolynomial.computeRealRoots(1,s,(a+n-o/s)/2),l=QuadraticRealPolynomial.computeRealRoots(1,-s,l);return 0!==o.length?(o[0]+=t,o[1]+=t,0!==l.length?(l[0]+=t,l[1]+=t,o[1]<=l[0]?[o[0],o[1],l[0],l[1]]:l[1]<=o[0]?[l[0],l[1],o[0],o[1]]:o[0]>=l[0]&&o[1]<=l[1]?[l[0],o[0],o[1],l[1]]:l[0]>=o[0]&&l[1]<=o[1]?[o[0],l[0],l[1],o[1]]:o[0]>l[0]&&o[0]<l[1]?[l[0],o[0],l[1],o[1]]:[o[0],l[0],o[1],l[1]]):o):0!==l.length?(l[0]+=t,l[1]+=t,l):[]}}return[]}function neumark(e,t,i,r){var n=e*e,a=CubicRealPolynomial.computeRealRoots(1,-2*t,i*e+t*t-4*r,n*r-i*t*e+i*i);if(0<a.length){var o,s,l,c,u=a[0],d=t-u,h=d*d,p=e/2,a=d/2,t=h-4*r,d=h+4*Math.abs(r),h=n-4*u,n=n+4*Math.abs(u);s=u<0||t*n<h*d?(o=(h=Math.sqrt(h))/2,0===h?0:(e*a-i)/h):(o=0===(s=Math.sqrt(t))?0:(e*a-i)/s,s/2),0==p&&0===o?c=l=0:CesiumMath.sign(p)===CesiumMath.sign(o)?c=u/(l=p+o):l=u/(c=p-o),0==a&&0===s?f=m=0:CesiumMath.sign(a)===CesiumMath.sign(s)?f=r/(m=a+s):m=r/(f=a-s);var m=QuadraticRealPolynomial.computeRealRoots(1,l,m),f=QuadraticRealPolynomial.computeRealRoots(1,c,f);if(0!==m.length)return 0!==f.length?m[1]<=f[0]?[m[0],m[1],f[0],f[1]]:f[1]<=m[0]?[f[0],f[1],m[0],m[1]]:m[0]>=f[0]&&m[1]<=f[1]?[f[0],m[0],m[1],f[1]]:f[0]>=m[0]&&f[1]<=m[1]?[m[0],f[0],f[1],m[1]]:m[0]>f[0]&&m[0]<f[1]?[f[0],m[0],f[1],m[1]]:[m[0],f[0],m[1],f[1]]:m;if(0!==f.length)return f}return[]}function Ray(e,t){t=Cartesian3.clone(defaultValue(t,Cartesian3.ZERO)),Cartesian3.equals(t,Cartesian3.ZERO)||Cartesian3.normalize(t,t),this.origin=Cartesian3.clone(defaultValue(e,Cartesian3.ZERO)),this.direction=t}QuarticRealPolynomial.computeDiscriminant=function(e,t,i,r,n){var a=e*e,o=t*t,s=o*t,l=i*i,c=l*i,u=r*r,d=u*r,h=n*n;return o*l*u-4*s*d-4*e*c*u+18*e*t*i*d-27*a*u*u+256*(a*e)*(h*n)+n*(18*s*i*r-4*o*c+16*e*l*l-80*e*t*l*r-6*e*o*u+144*a*i*u)+h*(144*e*o*i-27*o*o-128*a*l-192*a*t*r)},QuarticRealPolynomial.computeRealRoots=function(e,t,i,r,n){if(Math.abs(e)<CesiumMath.EPSILON15)return CubicRealPolynomial.computeRealRoots(t,i,r,n);var a=t/e,o=i/e,s=r/e,l=n/e,e=a<0?1:0;switch(e+=o<0?e+1:e,e+=s<0?e+1:e,e+=l<0?e+1:e){case 0:return original(a,o,s,l);case 1:case 2:return neumark(a,o,s,l);case 3:case 4:return original(a,o,s,l);case 5:return neumark(a,o,s,l);case 6:case 7:return original(a,o,s,l);case 8:return neumark(a,o,s,l);case 9:case 10:return original(a,o,s,l);case 11:return neumark(a,o,s,l);case 12:case 13:case 14:case 15:return original(a,o,s,l);default:return}},Ray.clone=function(e,t){if(defined(e))return defined(t)?(t.origin=Cartesian3.clone(e.origin),t.direction=Cartesian3.clone(e.direction),t):new Ray(e.origin,e.direction)},Ray.getPoint=function(e,t,i){return defined(i)||(i=new Cartesian3),i=Cartesian3.multiplyByScalar(e.direction,t,i),Cartesian3.add(e.origin,i,i)};var IntersectionTests={rayPlane:function(e,t,i){defined(i)||(i=new Cartesian3);var r=e.origin,n=e.direction,a=t.normal,e=Cartesian3.dot(a,n);if(!(Math.abs(e)<CesiumMath.EPSILON15)){e=(-t.distance-Cartesian3.dot(a,r))/e;if(!(e<0))return i=Cartesian3.multiplyByScalar(n,e,i),Cartesian3.add(r,i,i)}}},scratchEdge0=new Cartesian3,scratchEdge1=new Cartesian3,scratchPVec=new Cartesian3,scratchTVec=new Cartesian3,scratchQVec=new Cartesian3;IntersectionTests.rayTriangleParametric=function(e,t,i,r,n){n=defaultValue(n,!1);var a,o,s,l=e.origin,c=e.direction,u=Cartesian3.subtract(i,t,scratchEdge0),e=Cartesian3.subtract(r,t,scratchEdge1),i=Cartesian3.cross(c,e,scratchPVec),r=Cartesian3.dot(u,i);if(n){if(r<CesiumMath.EPSILON6)return;if(h=Cartesian3.subtract(l,t,scratchTVec),(d=Cartesian3.dot(h,i))<0||r<d)return;if(a=Cartesian3.cross(h,u,scratchQVec),(o=Cartesian3.dot(c,a))<0||r<d+o)return;s=Cartesian3.dot(e,a)/r}else{if(Math.abs(r)<CesiumMath.EPSILON6)return;var d,r=1/r,h=Cartesian3.subtract(l,t,scratchTVec);if((d=Cartesian3.dot(h,i)*r)<0||1<d)return;if(a=Cartesian3.cross(h,u,scratchQVec),(o=Cartesian3.dot(c,a)*r)<0||1<d+o)return;s=Cartesian3.dot(e,a)*r}return s},IntersectionTests.rayTriangle=function(e,t,i,r,n,a){n=IntersectionTests.rayTriangleParametric(e,t,i,r,n);if(defined(n)&&!(n<0))return defined(a)||(a=new Cartesian3),Cartesian3.multiplyByScalar(e.direction,n,a),Cartesian3.add(e.origin,a,a)};var scratchLineSegmentTriangleRay=new Ray;function solveQuadratic(e,t,i,r){var n=t*t-4*e*i;if(!(n<0)){if(0<n){var a=1/(2*e),i=Math.sqrt(n),n=(-t+i)*a,a=(-t-i)*a;return n<a?(r.root0=n,r.root1=a):(r.root0=a,r.root1=n),r}e=-t/(2*e);if(0!=e)return r.root0=r.root1=e,r}}IntersectionTests.lineSegmentTriangle=function(e,t,i,r,n,a,o){var s=scratchLineSegmentTriangleRay;Cartesian3.clone(e,s.origin),Cartesian3.subtract(t,e,s.direction),Cartesian3.normalize(s.direction,s.direction);a=IntersectionTests.rayTriangleParametric(s,i,r,n,a);if(!(!defined(a)||a<0||a>Cartesian3.distance(e,t)))return defined(o)||(o=new Cartesian3),Cartesian3.multiplyByScalar(s.direction,a,o),Cartesian3.add(s.origin,o,o)};var raySphereRoots={root0:0,root1:0};function raySphere(e,t,i){defined(i)||(i=new Interval);var r=e.origin,n=e.direction,e=t.center,t=t.radius*t.radius,e=Cartesian3.subtract(r,e,scratchPVec),t=solveQuadratic(Cartesian3.dot(n,n),2*Cartesian3.dot(n,e),Cartesian3.magnitudeSquared(e)-t,raySphereRoots);if(defined(t))return i.start=t.root0,i.stop=t.root1,i}IntersectionTests.raySphere=function(e,t,i){if(defined(i=raySphere(e,t,i))&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var scratchLineSegmentRay=new Ray;IntersectionTests.lineSegmentSphere=function(e,t,i,r){var n=scratchLineSegmentRay;Cartesian3.clone(e,n.origin);t=Cartesian3.subtract(t,e,n.direction),e=Cartesian3.magnitude(t);if(Cartesian3.normalize(t,t),!(!defined(r=raySphere(n,i,r))||r.stop<0||r.start>e))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,e),r};var scratchQ=new Cartesian3,scratchW$1=new Cartesian3;function addWithCancellationCheck(e,t,i){var r=e+t;return CesiumMath.sign(e)!==CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<i?0:r}function quadraticVectorExpression(e,t,i,r,n){var a=r*r,o=n*n,s=(e[Matrix3.COLUMN1ROW1]-e[Matrix3.COLUMN2ROW2])*o,l=n*(r*addWithCancellationCheck(e[Matrix3.COLUMN1ROW0],e[Matrix3.COLUMN0ROW1],CesiumMath.EPSILON15)+t.y),c=e[Matrix3.COLUMN0ROW0]*a+e[Matrix3.COLUMN2ROW2]*o+r*t.x+i,u=o*addWithCancellationCheck(e[Matrix3.COLUMN2ROW1],e[Matrix3.COLUMN1ROW2],CesiumMath.EPSILON15),d=n*(r*addWithCancellationCheck(e[Matrix3.COLUMN2ROW0],e[Matrix3.COLUMN0ROW2])+t.z),h=[];if(0==d&&0==u){if(0===(_=QuadraticRealPolynomial.computeRealRoots(s,l,c)).length)return h;var p=_[0],m=Math.sqrt(Math.max(1-p*p,0));return h.push(new Cartesian3(r,n*p,n*-m)),h.push(new Cartesian3(r,n*p,n*m)),2===_.length&&(f=_[1],g=Math.sqrt(Math.max(1-f*f,0)),h.push(new Cartesian3(r,n*f,n*-g)),h.push(new Cartesian3(r,n*f,n*g))),h}var t=d*d,p=u*u,m=d*u,f=s*s+p,g=2*(l*s+m),p=2*c*s+l*l-p+t,m=2*(c*l-m);if(0==f&&0==g&&0==p&&0==m)return h;var _,y=(_=QuarticRealPolynomial.computeRealRoots(f,g,p,m,c*c-t)).length;if(0===y)return h;for(var C=0;C<y;++C){var v=_[C],S=v*v,T=Math.max(1-S,0),T=Math.sqrt(T),S=CesiumMath.sign(s)===CesiumMath.sign(c)?addWithCancellationCheck(s*S+c,l*v,CesiumMath.EPSILON12):CesiumMath.sign(c)===CesiumMath.sign(l*v)?addWithCancellationCheck(s*S,l*v+c,CesiumMath.EPSILON12):addWithCancellationCheck(s*S+l*v,c,CesiumMath.EPSILON12),S=S*addWithCancellationCheck(u*v,d,CesiumMath.EPSILON15);S<0?h.push(new Cartesian3(r,n*v,n*T)):0<S?h.push(new Cartesian3(r,n*v,n*-T)):0!==T?(h.push(new Cartesian3(r,n*v,n*-T)),h.push(new Cartesian3(r,n*v,n*T)),++C):h.push(new Cartesian3(r,n*v,n*T))}return h}IntersectionTests.rayEllipsoid=function(e,t){var i=t.oneOverRadii,r=Cartesian3.multiplyComponents(i,e.origin,scratchQ),t=Cartesian3.multiplyComponents(i,e.direction,scratchW$1),i=Cartesian3.magnitudeSquared(r),e=Cartesian3.dot(r,t);if(1<i){if(0<=e)return;var n,a,r=e*e,o=i-1;if(r<(a=(n=Cartesian3.magnitudeSquared(t))*o))return;if(a<r){var s,l=e*e-a,c=(s=-e+Math.sqrt(l))/n,r=o/s;return c<r?new Interval(c,r):{start:r,stop:c}}c=Math.sqrt(o/n);return new Interval(c,c)}return i<1?(o=i-1,l=e*e-(a=(n=Cartesian3.magnitudeSquared(t))*o),new Interval(0,(s=-e+Math.sqrt(l))/n)):e<0?new Interval(0,-e/(n=Cartesian3.magnitudeSquared(t))):void 0};var firstAxisScratch=new Cartesian3,secondAxisScratch=new Cartesian3,thirdAxisScratch=new Cartesian3,referenceScratch=new Cartesian3,bCart=new Cartesian3,bScratch=new Matrix3,btScratch=new Matrix3,diScratch=new Matrix3,dScratch=new Matrix3,cScratch=new Matrix3,tempMatrix=new Matrix3,aScratch=new Matrix3,sScratch=new Cartesian3,closestScratch=new Cartesian3,surfPointScratch=new Cartographic;IntersectionTests.grazingAltitudeLocation=function(e,t){var i=e.origin,r=e.direction;if(!Cartesian3.equals(i,Cartesian3.ZERO)){var n=t.geodeticSurfaceNormal(i,firstAxisScratch);if(0<=Cartesian3.dot(r,n))return i}var a=defined(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(r,firstAxisScratch),n=Cartesian3.normalize(o,o),e=Cartesian3.mostOrthogonalAxis(o,referenceScratch),o=Cartesian3.normalize(Cartesian3.cross(e,n,secondAxisScratch),secondAxisScratch),e=Cartesian3.normalize(Cartesian3.cross(n,o,thirdAxisScratch),thirdAxisScratch),s=bScratch;s[0]=n.x,s[1]=n.y,s[2]=n.z,s[3]=o.x,s[4]=o.y,s[5]=o.z,s[6]=e.x,s[7]=e.y,s[8]=e.z;var n=Matrix3.transpose(s,btScratch),l=Matrix3.fromScale(t.radii,diScratch),o=Matrix3.fromScale(t.oneOverRadii,dScratch),e=cScratch;e[0]=0,e[1]=-r.z,e[2]=r.y,e[3]=r.z,e[4]=0,e[5]=-r.x,e[6]=-r.y,e[7]=r.x,e[8]=0;var o=Matrix3.multiply(Matrix3.multiply(n,o,tempMatrix),e,tempMatrix),e=Matrix3.multiply(Matrix3.multiply(o,l,aScratch),s,aScratch),o=Matrix3.multiplyByVector(o,i,bCart),c=quadraticVectorExpression(e,Cartesian3.negate(o,firstAxisScratch),0,0,1),u=c.length;if(0<u){for(var d=Cartesian3.clone(Cartesian3.ZERO,closestScratch),h=Number.NEGATIVE_INFINITY,p=0;p<u;++p){var m=Matrix3.multiplyByVector(l,Matrix3.multiplyByVector(s,c[p],sScratch),sScratch),f=Cartesian3.normalize(Cartesian3.subtract(m,i,referenceScratch),referenceScratch),f=Cartesian3.dot(f,r);h<f&&(h=f,d=Cartesian3.clone(m,d))}e=t.cartesianToCartographic(d,surfPointScratch),h=CesiumMath.clamp(h,0,1),o=Cartesian3.magnitude(Cartesian3.subtract(d,i,referenceScratch))*Math.sqrt(1-h*h);return e.height=o=a?-o:o,t.cartographicToCartesian(e,new Cartesian3)}};var lineSegmentPlaneDifference=new Cartesian3;function Plane(e,t){this.normal=Cartesian3.clone(e),this.distance=t}IntersectionTests.lineSegmentPlane=function(e,t,i,r){defined(r)||(r=new Cartesian3);var n=Cartesian3.subtract(t,e,lineSegmentPlaneDifference),a=i.normal,t=Cartesian3.dot(a,n);if(!(Math.abs(t)<CesiumMath.EPSILON6)){a=Cartesian3.dot(a,e),t=-(i.distance+a)/t;if(!(t<0||1<t))return Cartesian3.multiplyByScalar(n,t,r),Cartesian3.add(e,r,r),r}},IntersectionTests.trianglePlaneIntersection=function(e,t,i,r){var n,a,o=r.normal,s=r.distance,l=Cartesian3.dot(o,e)+s<0,c=Cartesian3.dot(o,t)+s<0,o=Cartesian3.dot(o,i)+s<0,s=0;if(s+=l?1:0,s+=c?1:0,1!=(s+=o?1:0)&&2!=s||(n=new Cartesian3,a=new Cartesian3),1==s){if(l)return IntersectionTests.lineSegmentPlane(e,t,r,n),IntersectionTests.lineSegmentPlane(e,i,r,a),{positions:[e,t,i,n,a],indices:[0,3,4,1,2,4,1,4,3]};if(c)return IntersectionTests.lineSegmentPlane(t,i,r,n),IntersectionTests.lineSegmentPlane(t,e,r,a),{positions:[e,t,i,n,a],indices:[1,3,4,2,0,4,2,4,3]};if(o)return IntersectionTests.lineSegmentPlane(i,e,r,n),IntersectionTests.lineSegmentPlane(i,t,r,a),{positions:[e,t,i,n,a],indices:[2,3,4,0,1,4,0,4,3]}}else if(2==s){if(!l)return IntersectionTests.lineSegmentPlane(t,e,r,n),IntersectionTests.lineSegmentPlane(i,e,r,a),{positions:[e,t,i,n,a],indices:[1,2,4,1,4,3,0,3,4]};if(!c)return IntersectionTests.lineSegmentPlane(i,t,r,n),IntersectionTests.lineSegmentPlane(e,t,r,a),{positions:[e,t,i,n,a],indices:[2,0,4,2,4,3,1,3,4]};if(!o)return IntersectionTests.lineSegmentPlane(e,i,r,n),IntersectionTests.lineSegmentPlane(t,i,r,a),{positions:[e,t,i,n,a],indices:[0,1,4,0,4,3,2,3,4]}}},Plane.fromPointNormal=function(e,t,i){e=-Cartesian3.dot(t,e);return defined(i)?(Cartesian3.clone(t,i.normal),i.distance=e,i):new Plane(t,e)};var scratchNormal$7=new Cartesian3;Plane.fromCartesian4=function(e,t){var i=Cartesian3.fromCartesian4(e,scratchNormal$7),e=e.w;return defined(t)?(Cartesian3.clone(i,t.normal),t.distance=e,t):new Plane(i,e)},Plane.getPointDistance=function(e,t){return Cartesian3.dot(e.normal,t)+e.distance};var scratchCartesian$8=new Cartesian3;Plane.projectPointOntoPlane=function(e,t,i){defined(i)||(i=new Cartesian3);var r=Plane.getPointDistance(e,t),r=Cartesian3.multiplyByScalar(e.normal,r,scratchCartesian$8);return Cartesian3.subtract(t,r,i)};var scratchInverseTranspose=new Matrix4,scratchPlaneCartesian4=new Cartesian4,scratchTransformNormal=new Cartesian3;function binarySearch(e,t,i){for(var r,n,a=0,o=e.length-1;a<=o;)if((n=i(e[r=~~((a+o)/2)],t))<0)a=1+r;else{if(!(0<n))return r;o=r-1}return~(o+1)}function EarthOrientationParametersSample(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}function sprintf(){function C(e,t,i,r){return i=i||" ",i=e.length>=t?"":Array(1+t-e.length>>>0).join(i),r?e+i:i+e}function v(e,t,i,r,n,a){var o=r-e.length;return e=0<o?i||!n?C(e,r,a,i):e.slice(0,t.length)+C("",o,"0",!0)+e.slice(t.length):e}function S(e,t,i,r,n,a,o){var s=e>>>0;return e=(i=i&&s&&{2:"0b",8:"0",16:"0x"}[t]||"")+C(s.toString(t),a||0,"0",!1),v(e,i,r,n,o)}function T(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),v(e,"",t,i,n,a)}var x=arguments,b=0,e=x[b++];return e.replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,function(e,t,i,r,n,a,o){var s,l,c,u,d;if("%%"==e)return"%";for(var h=!1,p="",m=!1,f=!1,g=" ",_=i.length,y=0;i&&y<_;y++)switch(i.charAt(y)){case" ":p=" ";break;case"+":p="+";break;case"-":h=!0;break;case"'":g=i.charAt(y+1);break;case"0":m=!0;break;case"#":f=!0}if((r=r?"*"==r?+x[b++]:"*"==r.charAt(0)?+x[r.slice(1,-1)]:+r:0)<0&&(r=-r,h=!0),!isFinite(r))throw new Error("sprintf: (minimum-)width must be finite");switch(a=a?"*"==a?+x[b++]:"*"==a.charAt(0)?+x[a.slice(1,-1)]:+a:-1<"fFeE".indexOf(o)?6:"d"==o?0:void 0,d=t?x[t.slice(0,-1)]:x[b++],o){case"s":return T(String(d),h,r,a,m,g);case"c":return T(String.fromCharCode(+d),h,r,a,m);case"b":return S(d,2,f,h,r,a,m);case"o":return S(d,8,f,h,r,a,m);case"x":return S(d,16,f,h,r,a,m);case"X":return S(d,16,f,h,r,a,m).toUpperCase();case"u":return S(d,10,f,h,r,a,m);case"i":case"d":return s=+d||0,d=(l=(s=Math.round(s-s%1))<0?"-":p)+C(String(Math.abs(s)),a,"0",!1),v(d,l,h,r,m);case"e":case"E":case"f":case"F":case"g":case"G":return l=(s=+d)<0?"-":p,c=["toExponential","toFixed","toPrecision"]["efg".indexOf(o.toLowerCase())],u=["toString","toUpperCase"]["eEfFgG".indexOf(o)%2],d=l+Math.abs(s)[c](a),v(d,l,h,r,m)[u]();default:return e}})}function GregorianDate(e,t,i,r,n,a,o,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=a,this.millisecond=o,this.isLeapSecond=s}function isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}function LeapSecond(e,t){this.julianDate=e,this.offset=t}Plane.transform=function(e,t,i){var r=e.normal,e=e.distance,t=Matrix4.inverseTranspose(t,scratchInverseTranspose),e=Cartesian4.fromElements(r.x,r.y,r.z,e,scratchPlaneCartesian4),e=Matrix4.multiplyByVector(t,e,e),t=Cartesian3.fromCartesian4(e,scratchTransformNormal);return e=Cartesian4.divideByScalar(e,Cartesian3.magnitude(t),e),Plane.fromCartesian4(e,i)},Plane.clone=function(e,t){return defined(t)?(Cartesian3.clone(e.normal,t.normal),t.distance=e.distance,t):new Plane(e.normal,e.distance)},Plane.equals=function(e,t){return e.distance===t.distance&&Cartesian3.equals(e.normal,t.normal)},Plane.ORIGIN_XY_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_Z,0)),Plane.ORIGIN_YZ_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_X,0)),Plane.ORIGIN_ZX_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_Y,0));var TimeConstants={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:2400000.5},TimeConstants$1=Object.freeze(TimeConstants),TimeStandard={UTC:0,TAI:1},TimeStandard$1=Object.freeze(TimeStandard),gregorianDateScratch=new GregorianDate,daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31],daysInLeapFeburary=29;function compareLeapSecondDates$1(e,t){return JulianDate.compare(e.julianDate,t.julianDate)}var binarySearchScratchLeapSecond=new LeapSecond;function convertUtcToTai(e){binarySearchScratchLeapSecond.julianDate=e;var t=JulianDate.leapSeconds,i=binarySearch(t,binarySearchScratchLeapSecond,compareLeapSecondDates$1),r=t[i=(i=i<0?~i:i)>=t.length?t.length-1:i].offset;0<i&&r<JulianDate.secondsDifference(t[i].julianDate,e)&&(r=t[--i].offset),JulianDate.addSeconds(e,r,e)}function convertTaiToUtc(e,t){binarySearchScratchLeapSecond.julianDate=e;var i=JulianDate.leapSeconds,r=binarySearch(i,binarySearchScratchLeapSecond,compareLeapSecondDates$1);if(0===(r=r<0?~r:r))return JulianDate.addSeconds(e,-i[0].offset,t);if(r>=i.length)return JulianDate.addSeconds(e,-i[r-1].offset,t);var n=JulianDate.secondsDifference(i[r].julianDate,e);return 0===n?JulianDate.addSeconds(e,-i[r].offset,t):n<=1?void 0:JulianDate.addSeconds(e,-i[--r].offset,t)}function setComponents(e,t,i){var r=t/TimeConstants$1.SECONDS_PER_DAY|0;return e+=r,(t-=TimeConstants$1.SECONDS_PER_DAY*r)<0&&(e--,t+=TimeConstants$1.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function computeJulianDateComponents(e,t,i,r,n,a,o){var s=(t-14)/12|0,e=e+4800+s,i=(1461*e/4|0)+(367*(t-2-12*s)/12|0)-(3*((e+100)/100|0)/4|0)+i-32075;(r-=12)<0&&(r+=24);o=a+(r*TimeConstants$1.SECONDS_PER_HOUR+n*TimeConstants$1.SECONDS_PER_MINUTE+o*TimeConstants$1.SECONDS_PER_MILLISECOND);return 43200<=o&&--i,[i,o]}var matchCalendarYear=/^(\d{4})$/,matchCalendarMonth=/^(\d{4})-(\d{2})$/,matchOrdinalDate=/^(\d{4})-?(\d{3})$/,matchWeekDate=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,matchCalendarDate=/^(\d{4})-?(\d{2})-?(\d{2})$/,utcOffset=/([Z+\-])?(\d{2})?:?(\d{2})?$/,matchHours=/^(\d{2})(\.\d+)?/.source+utcOffset.source,matchHoursMinutes=/^(\d{2}):?(\d{2})(\.\d+)?/.source+utcOffset.source,matchHoursMinutesSeconds=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+utcOffset.source;function JulianDate(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,TimeStandard$1.UTC);var r=0|e;setComponents(r,t+=(e-r)*TimeConstants$1.SECONDS_PER_DAY,this),i===TimeStandard$1.UTC&&convertUtcToTai(this)}JulianDate.fromGregorianDate=function(e,t){e=computeJulianDateComponents(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return defined(t)?(setComponents(e[0],e[1],t),convertUtcToTai(t),t):new JulianDate(e[0],e[1],TimeStandard$1.UTC)},JulianDate.fromDate=function(e,t){e=computeJulianDateComponents(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return defined(t)?(setComponents(e[0],e[1],t),convertUtcToTai(t),t):new JulianDate(e[0],e[1],TimeStandard$1.UTC)},JulianDate.fromIso8601=function(e,t){var i,r,n,a,o,s=(e=e.replace(",",".")).split("T"),l=1,c=1,u=0,d=0,h=0,p=0,m=s[0],e=s[1];if(null!==(s=m.match(matchCalendarDate))?(n=+s[1],l=+s[2],c=+s[3]):null!==(s=m.match(matchCalendarMonth))?(n=+s[1],l=+s[2]):null!==(s=m.match(matchCalendarYear))?n=+s[1]:(null!==(s=m.match(matchOrdinalDate))?(n=+s[1],a=+s[2],r=isLeapYear(n)):null!==(s=m.match(matchWeekDate))&&(n=+s[1],a=7*+s[2]+(+s[3]||0)-new Date(Date.UTC(n,0,4)).getUTCDay()-3),(i=new Date(Date.UTC(n,0,1))).setUTCDate(a),l=i.getUTCMonth()+1,c=i.getUTCDate()),r=isLeapYear(n),defined(e)){null!==(s=e.match(matchHoursMinutesSeconds))?(u=+s[1],d=+s[2],h=+s[3],p=1e3*+(s[4]||0),o=5):null!==(s=e.match(matchHoursMinutes))?(u=+s[1],d=+s[2],h=60*+(s[3]||0),o=4):null!==(s=e.match(matchHours))&&(u=+s[1],d=60*+(s[2]||0),o=3);var f=s[o],g=+s[o+1],_=+(s[o+2]||0);switch(f){case"+":u-=g,d-=_;break;case"-":u+=g,d+=_;break;case"Z":break;default:d+=new Date(Date.UTC(n,l-1,c,u,d)).getTimezoneOffset()}}f=60===h;for(f&&h--;60<=d;)d-=60,u++;for(;24<=u;)u-=24,c++;for(i=r&&2===l?daysInLeapFeburary:daysInMonth[l-1];i<c;)c-=i,12<++l&&(l-=12,n++),i=r&&2===l?daysInLeapFeburary:daysInMonth[l-1];for(;d<0;)d+=60,u--;for(;u<0;)u+=24,c--;for(;c<1;)--l<1&&(l+=12,n--),c+=i=r&&2===l?daysInLeapFeburary:daysInMonth[l-1];p=computeJulianDateComponents(n,l,c,u,d,h,p);return defined(t)?(setComponents(p[0],p[1],t),convertUtcToTai(t)):t=new JulianDate(p[0],p[1],TimeStandard$1.UTC),f&&JulianDate.addSeconds(t,1,t),t},JulianDate.now=function(e){return JulianDate.fromDate(new Date,e)};var toGregorianDateScratch=new JulianDate(0,0,TimeStandard$1.TAI);function EarthOrientationParameters(e){var t,i;e=defaultValue(e,defaultValue.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._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=defaultValue(e.addNewLeapSeconds,!0),defined(e.data)?onDataReady(this,e.data):defined(e.url)?(t=Resource.createIfNeeded(e.url),(i=this)._downloadPromise=t.fetchJson().then(function(e){onDataReady(i,e)}).otherwise(function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})):onDataReady(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function compareLeapSecondDates(e,t){return JulianDate.compare(e.julianDate,t)}function onDataReady(e,t){if(defined(t.columnNames))if(defined(t.samples)){var i=t.columnNames.indexOf("modifiedJulianDateUtc"),r=t.columnNames.indexOf("xPoleWanderRadians"),n=t.columnNames.indexOf("yPoleWanderRadians"),a=t.columnNames.indexOf("ut1MinusUtcSeconds"),o=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||r<0||n<0||a<0||o<0||s<0||l<0)e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns";else{var c,u=e._samples=t.samples,d=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=r,e._yPoleWanderRadiansColumn=n,e._ut1MinusUtcSecondsColumn=a,e._xCelestialPoleOffsetRadiansColumn=o,e._yCelestialPoleOffsetRadiansColumn=s,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;for(var h=e._addNewLeapSeconds,p=0,m=u.length;p<m;p+=e._columnCount){var f,g=u[p+i],_=u[p+l],y=new JulianDate(g+TimeConstants$1.MODIFIED_JULIAN_DATE_DIFFERENCE,_,TimeStandard$1.TAI);d.push(y),h&&(_===c||!defined(c)||(g=binarySearch(f=JulianDate.leapSeconds,y,compareLeapSecondDates))<0&&(y=new LeapSecond(y,_),f.splice(~g,0,y)),c=_)}}}else e._dataError="Error in loaded EOP data: The samples property is required.";else e._dataError="Error in loaded EOP data: The columnNames property is required."}function fillResultFromIndex(e,t,i,r,n){r*=i;n.xPoleWander=t[r+e._xPoleWanderRadiansColumn],n.yPoleWander=t[r+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function linearInterp(e,t,i){return t+e*(i-t)}function interpolate(e,t,i,r,n,a,o){var s=e._columnCount;if(a>t.length-1)return o.xPoleWander=0,o.yPoleWander=0,o.xPoleOffset=0,o.yPoleOffset=0,o.ut1MinusUtc=0,o;var l=t[n],c=t[a];if(l.equals(c)||r.equals(l))return fillResultFromIndex(e,i,n,s,o),o;if(r.equals(c))return fillResultFromIndex(e,i,a,s,o),o;var u=JulianDate.secondsDifference(r,l)/JulianDate.secondsDifference(c,l),d=n*s,t=a*s,l=i[d+e._ut1MinusUtcSecondsColumn],n=i[t+e._ut1MinusUtcSecondsColumn],a=n-l;return!(.5<a||a<-.5)||(s=i[d+e._taiMinusUtcSecondsColumn])!==(a=i[t+e._taiMinusUtcSecondsColumn])&&(c.equals(r)?l=n:n-=a-s),o.xPoleWander=linearInterp(u,i[d+e._xPoleWanderRadiansColumn],i[t+e._xPoleWanderRadiansColumn]),o.yPoleWander=linearInterp(u,i[d+e._yPoleWanderRadiansColumn],i[t+e._yPoleWanderRadiansColumn]),o.xPoleOffset=linearInterp(u,i[d+e._xCelestialPoleOffsetRadiansColumn],i[t+e._xCelestialPoleOffsetRadiansColumn]),o.yPoleOffset=linearInterp(u,i[d+e._yCelestialPoleOffsetRadiansColumn],i[t+e._yCelestialPoleOffsetRadiansColumn]),o.ut1MinusUtc=linearInterp(u,l,n),o}function HeadingPitchRoll(e,t,i){this.heading=defaultValue(e,0),this.pitch=defaultValue(t,0),this.roll=defaultValue(i,0)}function Iau2006XysSample(e,t,i){this.x=e,this.y=t,this.s=i}function Iau2006XysData(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=Resource.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new JulianDate(this._sampleZeroJulianEphemerisDate,0,TimeStandard$1.TAI),this._stepSizeDays=defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=defaultValue(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,i=this._denominators=new Array(t+1),r=this._xTable=new Array(t+1),n=Math.pow(this._stepSizeDays,t),a=0;a<=t;++a){i[a]=n,r[a]=a*this._stepSizeDays;for(var o=0;o<=t;++o)o!==a&&(i[a]*=a-o);i[a]=1/i[a]}this._work=new Array(t+1),this._coef=new Array(t+1)}JulianDate.toGregorianDate=function(e,t){var i=!1,r=convertTaiToUtc(e,toGregorianDateScratch);defined(r)||(JulianDate.addSeconds(e,-1,toGregorianDateScratch),r=convertTaiToUtc(toGregorianDateScratch,toGregorianDateScratch),i=!0);var n=r.dayNumber,a=r.secondsOfDay;43200<=a&&(n+=1);var o=n+68569|0,s=4*o/146097|0,l=4e3*(1+(o=o-((146097*s+3)/4|0)|0))/1461001|0,e=80*(o=o-(1461*l/4|0)+31|0)/2447|0,r=o-(2447*e/80|0)|0,n=2+e-12*(o=e/11|0)|0,e=100*(s-49)+l+o|0,s=a/TimeConstants$1.SECONDS_PER_HOUR|0,l=a-s*TimeConstants$1.SECONDS_PER_HOUR,o=l/TimeConstants$1.SECONDS_PER_MINUTE|0,a=0|(l-=o*TimeConstants$1.SECONDS_PER_MINUTE),l=(l-a)/TimeConstants$1.SECONDS_PER_MILLISECOND;return 23<(s+=12)&&(s-=24),i&&(a+=1),defined(t)?(t.year=e,t.month=n,t.day=r,t.hour=s,t.minute=o,t.second=a,t.millisecond=l,t.isLeapSecond=i,t):new GregorianDate(e,n,r,s,o,a,l,i)},JulianDate.toDate=function(e){var t=JulianDate.toGregorianDate(e,gregorianDateScratch),e=t.second;return t.isLeapSecond&&--e,new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,e,t.millisecond))},JulianDate.toIso8601=function(e,t){var i=JulianDate.toGregorianDate(e,gregorianDateScratch),r=i.year,n=i.month,a=i.day,o=i.hour,s=i.minute,e=i.second,i=i.millisecond;return 1e4===r&&1===n&&1===a&&0===o&&0===s&&0===e&&0===i&&(r=9999,n=12,a=31,o=24),defined(t)||0===i?defined(t)&&0!==t?sprintf("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,n,a,o,s,e,(.01*i).toFixed(t).replace(".","").slice(0,t)):sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",r,n,a,o,s,e):sprintf("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,n,a,o,s,e,(.01*i).toString().replace(".",""))},JulianDate.clone=function(e,t){if(defined(e))return defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new JulianDate(e.dayNumber,e.secondsOfDay,TimeStandard$1.TAI)},JulianDate.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!=i?i:e.secondsOfDay-t.secondsOfDay},JulianDate.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},JulianDate.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(JulianDate.secondsDifference(e,t))<=i},JulianDate.totalDays=function(e){return e.dayNumber+e.secondsOfDay/TimeConstants$1.SECONDS_PER_DAY},JulianDate.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*TimeConstants$1.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},JulianDate.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY},JulianDate.computeTaiMinusUtc=function(e){binarySearchScratchLeapSecond.julianDate=e;var t=JulianDate.leapSeconds,e=binarySearch(t,binarySearchScratchLeapSecond,compareLeapSecondDates$1);return e<0&&(e=~e,--e<0&&(e=0)),t[e].offset},JulianDate.addSeconds=function(e,t,i){return setComponents(e.dayNumber,e.secondsOfDay+t,i)},JulianDate.addMinutes=function(e,t,i){t=e.secondsOfDay+t*TimeConstants$1.SECONDS_PER_MINUTE;return setComponents(e.dayNumber,t,i)},JulianDate.addHours=function(e,t,i){t=e.secondsOfDay+t*TimeConstants$1.SECONDS_PER_HOUR;return setComponents(e.dayNumber,t,i)},JulianDate.addDays=function(e,t,i){return setComponents(e.dayNumber+t,e.secondsOfDay,i)},JulianDate.lessThan=function(e,t){return JulianDate.compare(e,t)<0},JulianDate.lessThanOrEquals=function(e,t){return JulianDate.compare(e,t)<=0},JulianDate.greaterThan=function(e,t){return 0<JulianDate.compare(e,t)},JulianDate.greaterThanOrEquals=function(e,t){return 0<=JulianDate.compare(e,t)},JulianDate.prototype.clone=function(e){return JulianDate.clone(this,e)},JulianDate.prototype.equals=function(e){return JulianDate.equals(this,e)},JulianDate.prototype.equalsEpsilon=function(e,t){return JulianDate.equalsEpsilon(this,e,t)},JulianDate.prototype.toString=function(){return JulianDate.toIso8601(this)},JulianDate.leapSeconds=[new LeapSecond(new JulianDate(2441317,43210,TimeStandard$1.TAI),10),new LeapSecond(new JulianDate(2441499,43211,TimeStandard$1.TAI),11),new LeapSecond(new JulianDate(2441683,43212,TimeStandard$1.TAI),12),new LeapSecond(new JulianDate(2442048,43213,TimeStandard$1.TAI),13),new LeapSecond(new JulianDate(2442413,43214,TimeStandard$1.TAI),14),new LeapSecond(new JulianDate(2442778,43215,TimeStandard$1.TAI),15),new LeapSecond(new JulianDate(2443144,43216,TimeStandard$1.TAI),16),new LeapSecond(new JulianDate(2443509,43217,TimeStandard$1.TAI),17),new LeapSecond(new JulianDate(2443874,43218,TimeStandard$1.TAI),18),new LeapSecond(new JulianDate(2444239,43219,TimeStandard$1.TAI),19),new LeapSecond(new JulianDate(2444786,43220,TimeStandard$1.TAI),20),new LeapSecond(new JulianDate(2445151,43221,TimeStandard$1.TAI),21),new LeapSecond(new JulianDate(2445516,43222,TimeStandard$1.TAI),22),new LeapSecond(new JulianDate(2446247,43223,TimeStandard$1.TAI),23),new LeapSecond(new JulianDate(2447161,43224,TimeStandard$1.TAI),24),new LeapSecond(new JulianDate(2447892,43225,TimeStandard$1.TAI),25),new LeapSecond(new JulianDate(2448257,43226,TimeStandard$1.TAI),26),new LeapSecond(new JulianDate(2448804,43227,TimeStandard$1.TAI),27),new LeapSecond(new JulianDate(2449169,43228,TimeStandard$1.TAI),28),new LeapSecond(new JulianDate(2449534,43229,TimeStandard$1.TAI),29),new LeapSecond(new JulianDate(2450083,43230,TimeStandard$1.TAI),30),new LeapSecond(new JulianDate(2450630,43231,TimeStandard$1.TAI),31),new LeapSecond(new JulianDate(2451179,43232,TimeStandard$1.TAI),32),new LeapSecond(new JulianDate(2453736,43233,TimeStandard$1.TAI),33),new LeapSecond(new JulianDate(2454832,43234,TimeStandard$1.TAI),34),new LeapSecond(new JulianDate(2456109,43235,TimeStandard$1.TAI),35),new LeapSecond(new JulianDate(2457204,43236,TimeStandard$1.TAI),36),new LeapSecond(new JulianDate(2457754,43237,TimeStandard$1.TAI),37)],EarthOrientationParameters.NONE=Object.freeze({getPromiseToLoad:function(){return when.resolve()},compute:function(e,t){return defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new EarthOrientationParametersSample(0,0,0,0,0),t}}),EarthOrientationParameters.prototype.getPromiseToLoad=function(){return when(this._downloadPromise)},EarthOrientationParameters.prototype.compute=function(e,t){if(defined(this._samples)){if(defined(t)||(t=new EarthOrientationParametersSample(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;var i=this._dates,r=this._lastIndex,n=0,a=0;if(defined(r)){var o=i[r],s=i[r+1],l=JulianDate.lessThanOrEquals(o,e),c=!defined(s),o=c||JulianDate.greaterThanOrEquals(s,e);if(l&&o)return n=r,!c&&s.equals(e)&&++n,interpolate(this,i,this._samples,e,n,a=n+1,t),t}s=binarySearch(i,e,JulianDate.compare,this._dateColumn);return 0<=s?(s<i.length-1&&i[s+1].equals(e)&&++s,a=n=s):(n=(a=~s)-1)<0&&(n=0),this._lastIndex=n,interpolate(this,i,this._samples,e,n,a,t),t}if(defined(this._dataError))throw new RuntimeError(this._dataError)},HeadingPitchRoll.fromQuaternion=function(e,t){defined(t)||(t=new HeadingPitchRoll);var i=2*(e.w*e.y-e.z*e.x),r=1-2*(e.x*e.x+e.y*e.y),n=2*(e.w*e.x+e.y*e.z),a=1-2*(e.y*e.y+e.z*e.z),e=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(e,a),t.roll=Math.atan2(n,r),t.pitch=-CesiumMath.asinClamped(i),t},HeadingPitchRoll.fromDegrees=function(e,t,i,r){return(r=!defined(r)?new HeadingPitchRoll:r).heading=e*CesiumMath.RADIANS_PER_DEGREE,r.pitch=t*CesiumMath.RADIANS_PER_DEGREE,r.roll=i*CesiumMath.RADIANS_PER_DEGREE,r},HeadingPitchRoll.clone=function(e,t){if(defined(e))return defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new HeadingPitchRoll(e.heading,e.pitch,e.roll)},HeadingPitchRoll.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},HeadingPitchRoll.equalsEpsilon=function(e,t,i,r){return e===t||defined(e)&&defined(t)&&CesiumMath.equalsEpsilon(e.heading,t.heading,i,r)&&CesiumMath.equalsEpsilon(e.pitch,t.pitch,i,r)&&CesiumMath.equalsEpsilon(e.roll,t.roll,i,r)},HeadingPitchRoll.prototype.clone=function(e){return HeadingPitchRoll.clone(this,e)},HeadingPitchRoll.prototype.equals=function(e){return HeadingPitchRoll.equals(this,e)},HeadingPitchRoll.prototype.equalsEpsilon=function(e,t,i){return HeadingPitchRoll.equalsEpsilon(this,e,t,i)},HeadingPitchRoll.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"};var julianDateScratch$1=new JulianDate(0,0,TimeStandard$1.TAI),_supportsFullscreen;function getDaysSinceEpoch(e,t,i){var r=julianDateScratch$1;return r.dayNumber=t,r.secondsOfDay=i,JulianDate.daysDifference(r,e._sampleZeroDateTT)}function requestXysChunk(o,s){if(o._chunkDownloadsInProgress[s])return o._chunkDownloadsInProgress[s];var l=when.defer();o._chunkDownloadsInProgress[s]=l;var e=o._xysFileUrlTemplate;return when((defined(e)?e.getDerivedResource({templateValues:{0:s}}):new Resource({url:buildModuleUrl("Assets/IAU2006_XYS/IAU2006_XYS_"+s+".json")})).fetchJson(),function(e){o._chunkDownloadsInProgress[s]=!1;for(var t=o._samples,i=e.samples,r=s*o._samplesPerXysFile*3,n=0,a=i.length;n<a;++n)t[r+n]=i[n];l.resolve()}),l.promise}Iau2006XysData.prototype.preload=function(e,t,i,r){t=getDaysSinceEpoch(this,e,t),r=getDaysSinceEpoch(this,i,r),t=t/this._stepSizeDays-this._interpolationOrder/2|0,r=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;r>=this._totalSamples&&(r=this._totalSamples-1);for(var t=(t=t<0?0:t)/this._samplesPerXysFile|0,n=r/this._samplesPerXysFile|0,a=[],o=t;o<=n;++o)a.push(requestXysChunk(this,o));return when.all(a)},Iau2006XysData.prototype.computeXysRadians=function(e,t,i){var r=getDaysSinceEpoch(this,e,t);if(!(r<0)){e=r/this._stepSizeDays|0;if(!(e>=this._totalSamples)){var n=this._interpolationOrder,a=e-(n/2|0),t=(a=a<0?0:a)+n;t>=this._totalSamples&&(a=(t=this._totalSamples-1)-n)<0&&(a=0);var e=!1,o=this._samples;if(defined(o[3*a])||(requestXysChunk(this,a/this._samplesPerXysFile|0),e=!0),defined(o[3*t])||(requestXysChunk(this,t/this._samplesPerXysFile|0),e=!0),!e){defined(i)?(i.x=0,i.y=0,i.s=0):i=new Iau2006XysSample(0,0,0);for(var s,l=r-a*this._stepSizeDays,c=this._work,u=this._denominators,d=this._coef,h=this._xTable,p=0;p<=n;++p)c[p]=l-h[p];for(p=0;p<=n;++p){for(d[p]=1,s=0;s<=n;++s)s!==p&&(d[p]*=c[s]);d[p]*=u[p];var m=3*(a+p);i.x+=d[p]*o[m++],i.y+=d[p]*o[m++],i.s+=d[p]*o[m]}return i}}}};var _names={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Fullscreen={},theNavigator,isChromeResult,chromeVersionResult,isSafariResult,safariVersionResult,isWebkitResult,webkitVersionResult,isInternetExplorerResult,internetExplorerVersionResult,isEdgeResult,edgeVersionResult,isFirefoxResult,firefoxVersionResult,isWindowsResult,hasPointerEvents,imageRenderingValueResult,supportsImageRenderingPixelatedResult;function extractVersion(e){for(var t=e.split("."),i=0,r=t.length;i<r;++i)t[i]=parseInt(t[i],10);return t}function isChrome(){var e;return defined(isChromeResult)||(isChromeResult=!1,isEdge()||null!==(e=/ Chrome\/([\.0-9]+)/.exec(theNavigator.userAgent))&&(isChromeResult=!0,chromeVersionResult=extractVersion(e[1]))),isChromeResult}function chromeVersion(){return isChrome()&&chromeVersionResult}function isSafari(){var e;return defined(isSafariResult)||(isSafariResult=!1,isChrome()||isEdge()||!/ Safari\/[\.0-9]+/.test(theNavigator.userAgent)||null!==(e=/ Version\/([\.0-9]+)/.exec(theNavigator.userAgent))&&(isSafariResult=!0,safariVersionResult=extractVersion(e[1]))),isSafariResult}function safariVersion(){return isSafari()&&safariVersionResult}function isWebkit(){var e;return defined(isWebkitResult)||(isWebkitResult=!1,null!==(e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(theNavigator.userAgent))&&(isWebkitResult=!0,(webkitVersionResult=extractVersion(e[1])).isNightly=!!e[2])),isWebkitResult}function webkitVersion(){return isWebkit()&&webkitVersionResult}function isInternetExplorer(){var e;return defined(isInternetExplorerResult)||(isInternetExplorerResult=!1,"Microsoft Internet Explorer"===theNavigator.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(theNavigator.userAgent))&&(isInternetExplorerResult=!0,internetExplorerVersionResult=extractVersion(e[1])):"Netscape"===theNavigator.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(theNavigator.userAgent))&&(isInternetExplorerResult=!0,internetExplorerVersionResult=extractVersion(e[1]))),isInternetExplorerResult}function internetExplorerVersion(){return isInternetExplorer()&&internetExplorerVersionResult}function isEdge(){var e;return defined(isEdgeResult)||(isEdgeResult=!1,null!==(e=/ Edge\/([\.0-9]+)/.exec(theNavigator.userAgent))&&(isEdgeResult=!0,edgeVersionResult=extractVersion(e[1]))),isEdgeResult}function edgeVersion(){return isEdge()&&edgeVersionResult}function isFirefox(){var e;return defined(isFirefoxResult)||(isFirefoxResult=!1,null!==(e=/Firefox\/([\.0-9]+)/.exec(theNavigator.userAgent))&&(isFirefoxResult=!0,firefoxVersionResult=extractVersion(e[1]))),isFirefoxResult}function isWindows(){return isWindowsResult=!defined(isWindowsResult)?/Windows/i.test(theNavigator.appVersion):isWindowsResult}function firefoxVersion(){return isFirefox()&&firefoxVersionResult}function supportsPointerEvents(){return hasPointerEvents=!defined(hasPointerEvents)?!isFirefox()&&"undefined"!=typeof PointerEvent&&(!defined(theNavigator.pointerEnabled)||theNavigator.pointerEnabled):hasPointerEvents}function supportsImageRenderingPixelated(){var e;return defined(supportsImageRenderingPixelatedResult)||((e=document.createElement("canvas")).setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;"),e=e.style.imageRendering,(supportsImageRenderingPixelatedResult=defined(e)&&""!==e)&&(imageRenderingValueResult=e)),supportsImageRenderingPixelatedResult}function imageRenderingValue(){return supportsImageRenderingPixelated()?imageRenderingValueResult:void 0}function supportsWebP(){return supportsWebP._result}Object.defineProperties(Fullscreen,{element:{get:function(){if(Fullscreen.supportsFullscreen())return document[_names.fullscreenElement]}},changeEventName:{get:function(){if(Fullscreen.supportsFullscreen())return _names.fullscreenchange}},errorEventName:{get:function(){if(Fullscreen.supportsFullscreen())return _names.fullscreenerror}},enabled:{get:function(){if(Fullscreen.supportsFullscreen())return document[_names.fullscreenEnabled]}},fullscreen:{get:function(){if(Fullscreen.supportsFullscreen())return null!==Fullscreen.element}}}),Fullscreen.supportsFullscreen=function(){if(defined(_supportsFullscreen))return _supportsFullscreen;_supportsFullscreen=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return _names.requestFullscreen="requestFullscreen",_names.exitFullscreen="exitFullscreen",_names.fullscreenEnabled="fullscreenEnabled",_names.fullscreenElement="fullscreenElement",_names.fullscreenchange="fullscreenchange",_names.fullscreenerror="fullscreenerror",_supportsFullscreen=!0;for(var t=["webkit","moz","o","ms","khtml"],i=0,r=t.length;i<r;++i){var n,a=t[i];"function"!=typeof e[n=a+"RequestFullscreen"]&&"function"!=typeof e[n=a+"RequestFullScreen"]||(_names.requestFullscreen=n,_supportsFullscreen=!0),n=a+"ExitFullscreen","function"==typeof document[n]?_names.exitFullscreen=n:(n=a+"CancelFullScreen","function"==typeof document[n]&&(_names.exitFullscreen=n)),n=a+"FullscreenEnabled",void 0!==document[n]?_names.fullscreenEnabled=n:(n=a+"FullScreenEnabled",void 0!==document[n]&&(_names.fullscreenEnabled=n)),n=a+"FullscreenElement",void 0!==document[n]?_names.fullscreenElement=n:(n=a+"FullScreenElement",void 0!==document[n]&&(_names.fullscreenElement=n)),n=a+"fullscreenchange",void 0!==document["on"+n]&&(_names.fullscreenchange=n="ms"===a?"MSFullscreenChange":n),n=a+"fullscreenerror",void 0!==document["on"+n]&&(_names.fullscreenerror=n="ms"===a?"MSFullscreenError":n)}return _supportsFullscreen},Fullscreen.requestFullscreen=function(e,t){Fullscreen.supportsFullscreen()&&e[_names.requestFullscreen]({vrDisplay:t})},Fullscreen.exitFullscreen=function(){Fullscreen.supportsFullscreen()&&document[_names.exitFullscreen]()},Fullscreen._names=_names,theNavigator="undefined"!=typeof navigator?navigator:{},supportsWebP._promise=void 0,supportsWebP._result=void 0,supportsWebP.initialize=function(){if(defined(supportsWebP._promise))return supportsWebP._promise;var e=when.defer();if(supportsWebP._promise=e.promise,isEdge())return supportsWebP._result=!1,e.resolve(supportsWebP._result),e.promise;var t=new Image;return t.onload=function(){supportsWebP._result=0<t.width&&0<t.height,e.resolve(supportsWebP._result)},t.onerror=function(){supportsWebP._result=!1,e.resolve(supportsWebP._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},Object.defineProperties(supportsWebP,{initialized:{get:function(){return defined(supportsWebP._result)}}});var typedArrayTypes=[];"undefined"!=typeof ArrayBuffer&&(typedArrayTypes.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&typedArrayTypes.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&typedArrayTypes.push(Uint8ClampedArray));var FeatureDetection={isChrome:isChrome,chromeVersion:chromeVersion,isSafari:isSafari,safariVersion:safariVersion,isWebkit:isWebkit,webkitVersion:webkitVersion,isInternetExplorer:isInternetExplorer,internetExplorerVersion:internetExplorerVersion,isEdge:isEdge,edgeVersion:edgeVersion,isFirefox:isFirefox,firefoxVersion:firefoxVersion,isWindows:isWindows,hardwareConcurrency:defaultValue(theNavigator.hardwareConcurrency,3),supportsPointerEvents:supportsPointerEvents,supportsImageRenderingPixelated:supportsImageRenderingPixelated,supportsWebP:supportsWebP,imageRenderingValue:imageRenderingValue,typedArrayTypes:typedArrayTypes};function Quaternion(e,t,i,r){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.z=defaultValue(i,0),this.w=defaultValue(r,0)}FeatureDetection.supportsFullscreen=function(){return Fullscreen.supportsFullscreen()},FeatureDetection.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},FeatureDetection.supportsWebWorkers=function(){return"undefined"!=typeof Worker},FeatureDetection.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!FeatureDetection.isEdge()};var fromAxisAngleScratch=new Cartesian3;Quaternion.fromAxisAngle=function(e,t,i){var r=t/2,n=Math.sin(r),t=(fromAxisAngleScratch=Cartesian3.normalize(e,fromAxisAngleScratch)).x*n,e=fromAxisAngleScratch.y*n,n=fromAxisAngleScratch.z*n,r=Math.cos(r);return defined(i)?(i.x=t,i.y=e,i.z=n,i.w=r,i):new Quaternion(t,e,n,r)};var fromRotationMatrixNext=[1,2,0],fromRotationMatrixQuat=new Array(3);Quaternion.fromRotationMatrix=function(e,t){var i,r,n,a,o=e[Matrix3.COLUMN0ROW0],s=e[Matrix3.COLUMN1ROW1],l=e[Matrix3.COLUMN2ROW2],c=o+s+l,u=0<c?(n=.5*(a=Math.sqrt(c+1)),i=(e[Matrix3.COLUMN1ROW2]-e[Matrix3.COLUMN2ROW1])*(a=.5/a),r=(e[Matrix3.COLUMN2ROW0]-e[Matrix3.COLUMN0ROW2])*a,(e[Matrix3.COLUMN0ROW1]-e[Matrix3.COLUMN1ROW0])*a):(o=fromRotationMatrixNext[l=o<l&&s<l?2:o<s?1:0],s=fromRotationMatrixNext[o],a=Math.sqrt(e[Matrix3.getElementIndex(l,l)]-e[Matrix3.getElementIndex(o,o)]-e[Matrix3.getElementIndex(s,s)]+1),(u=fromRotationMatrixQuat)[l]=.5*a,a=.5/a,n=(e[Matrix3.getElementIndex(s,o)]-e[Matrix3.getElementIndex(o,s)])*a,u[o]=(e[Matrix3.getElementIndex(o,l)]+e[Matrix3.getElementIndex(l,o)])*a,u[s]=(e[Matrix3.getElementIndex(s,l)]+e[Matrix3.getElementIndex(l,s)])*a,i=-u[0],r=-u[1],-u[2]);return defined(t)?(t.x=i,t.y=r,t.z=u,t.w=n,t):new Quaternion(i,r,u,n)};var scratchHPRQuaternion$1=new Quaternion,scratchHeadingQuaternion=new Quaternion,scratchPitchQuaternion=new Quaternion,scratchRollQuaternion=new Quaternion;Quaternion.fromHeadingPitchRoll=function(e,t){return scratchRollQuaternion=Quaternion.fromAxisAngle(Cartesian3.UNIT_X,e.roll,scratchHPRQuaternion$1),scratchPitchQuaternion=Quaternion.fromAxisAngle(Cartesian3.UNIT_Y,-e.pitch,t),t=Quaternion.multiply(scratchPitchQuaternion,scratchRollQuaternion,scratchPitchQuaternion),scratchHeadingQuaternion=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,-e.heading,scratchHPRQuaternion$1),Quaternion.multiply(scratchHeadingQuaternion,t,t)};var sampledQuaternionAxis=new Cartesian3,sampledQuaternionRotation=new Cartesian3,sampledQuaternionTempQuaternion=new Quaternion,sampledQuaternionQuaternion0=new Quaternion,sampledQuaternionQuaternion0Conjugate=new Quaternion;Quaternion.packedLength=4,Quaternion.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},Quaternion.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Quaternion:i).x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},Quaternion.packedInterpolationLength=3,Quaternion.convertPackedArrayForInterpolation=function(e,t,i,r){Quaternion.unpack(e,4*i,sampledQuaternionQuaternion0Conjugate),Quaternion.conjugate(sampledQuaternionQuaternion0Conjugate,sampledQuaternionQuaternion0Conjugate);for(var n=0,a=i-t+1;n<a;n++){var o=3*n;Quaternion.unpack(e,4*(t+n),sampledQuaternionTempQuaternion),Quaternion.multiply(sampledQuaternionTempQuaternion,sampledQuaternionQuaternion0Conjugate,sampledQuaternionTempQuaternion),sampledQuaternionTempQuaternion.w<0&&Quaternion.negate(sampledQuaternionTempQuaternion,sampledQuaternionTempQuaternion),Quaternion.computeAxis(sampledQuaternionTempQuaternion,sampledQuaternionAxis);var s=Quaternion.computeAngle(sampledQuaternionTempQuaternion);(r=!defined(r)?[]:r)[o]=sampledQuaternionAxis.x*s,r[1+o]=sampledQuaternionAxis.y*s,r[2+o]=sampledQuaternionAxis.z*s}},Quaternion.unpackInterpolationResult=function(e,t,i,r,n){defined(n)||(n=new Quaternion),Cartesian3.fromArray(e,0,sampledQuaternionRotation);e=Cartesian3.magnitude(sampledQuaternionRotation);return Quaternion.unpack(t,4*r,sampledQuaternionQuaternion0),0===e?Quaternion.clone(Quaternion.IDENTITY,sampledQuaternionTempQuaternion):Quaternion.fromAxisAngle(sampledQuaternionRotation,e,sampledQuaternionTempQuaternion),Quaternion.multiply(sampledQuaternionTempQuaternion,sampledQuaternionQuaternion0,n)},Quaternion.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Quaternion(e.x,e.y,e.z,e.w)},Quaternion.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},Quaternion.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Quaternion.magnitude=function(e){return Math.sqrt(Quaternion.magnitudeSquared(e))},Quaternion.normalize=function(e,t){var i=1/Quaternion.magnitude(e),r=e.x*i,n=e.y*i,a=e.z*i,i=e.w*i;return t.x=r,t.y=n,t.z=a,t.w=i,t},Quaternion.inverse=function(e,t){var i=Quaternion.magnitudeSquared(e);return t=Quaternion.conjugate(e,t),Quaternion.multiplyByScalar(t,1/i,t)},Quaternion.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},Quaternion.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},Quaternion.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Quaternion.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Quaternion.multiply=function(e,t,i){var r=e.x,n=e.y,a=e.z,o=e.w,s=t.x,l=t.y,c=t.z,u=t.w,d=o*l-r*c+n*u+a*s,e=o*c+r*l-n*s+a*u,t=o*u-r*s-n*l-a*c;return i.x=o*s+r*u+n*c-a*l,i.y=d,i.z=e,i.w=t,i},Quaternion.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},Quaternion.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},Quaternion.computeAxis=function(e,t){var i=e.w;if(Math.abs(i-1)<CesiumMath.EPSILON6)return t.x=t.y=t.z=0,t;i=1/Math.sqrt(1-i*i);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},Quaternion.computeAngle=function(e){return Math.abs(e.w-1)<CesiumMath.EPSILON6?0:2*Math.acos(e.w)};var lerpScratch=new Quaternion;Quaternion.lerp=function(e,t,i,r){return lerpScratch=Quaternion.multiplyByScalar(t,i,lerpScratch),r=Quaternion.multiplyByScalar(e,1-i,r),Quaternion.add(lerpScratch,r,r)};var slerpEndNegated=new Quaternion,slerpScaledP=new Quaternion,slerpScaledR=new Quaternion;Quaternion.slerp=function(e,t,i,r){var n=Quaternion.dot(e,t),a=t;if(n<0&&(n=-n,a=slerpEndNegated=Quaternion.negate(t,slerpEndNegated)),1-n<CesiumMath.EPSILON6)return Quaternion.lerp(e,a,i,r);n=Math.acos(n);return slerpScaledP=Quaternion.multiplyByScalar(e,Math.sin((1-i)*n),slerpScaledP),slerpScaledR=Quaternion.multiplyByScalar(a,Math.sin(i*n),slerpScaledR),r=Quaternion.add(slerpScaledP,slerpScaledR,r),Quaternion.multiplyByScalar(r,1/Math.sin(n),r)},Quaternion.log=function(e,t){var i=CesiumMath.acosClamped(e.w),r=0;return 0!==i&&(r=i/Math.sin(i)),Cartesian3.multiplyByScalar(e,r,t)},Quaternion.exp=function(e,t){var i=Cartesian3.magnitude(e),r=0;return 0!==i&&(r=Math.sin(i)/i),t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t.w=Math.cos(i),t};var squadScratchCartesian0=new Cartesian3,squadScratchCartesian1=new Cartesian3,squadScratchQuaternion0=new Quaternion,squadScratchQuaternion1=new Quaternion;Quaternion.computeInnerQuadrangle=function(e,t,i,r){var n=Quaternion.conjugate(t,squadScratchQuaternion0);Quaternion.multiply(n,i,squadScratchQuaternion1);i=Quaternion.log(squadScratchQuaternion1,squadScratchCartesian0);Quaternion.multiply(n,e,squadScratchQuaternion1);e=Quaternion.log(squadScratchQuaternion1,squadScratchCartesian1);return Cartesian3.add(i,e,i),Cartesian3.multiplyByScalar(i,.25,i),Cartesian3.negate(i,i),Quaternion.exp(i,squadScratchQuaternion0),Quaternion.multiply(t,squadScratchQuaternion0,r)},Quaternion.squad=function(e,t,i,r,n,a){t=Quaternion.slerp(e,t,n,squadScratchQuaternion0),r=Quaternion.slerp(i,r,n,squadScratchQuaternion1);return Quaternion.slerp(t,r,2*n*(1-n),a)};for(var fastSlerpScratchQuaternion=new Quaternion,opmu=1.9011074535173003,u=FeatureDetection.supportsTypedArrays()?new Float32Array(8):[],v=FeatureDetection.supportsTypedArrays()?new Float32Array(8):[],bT=FeatureDetection.supportsTypedArrays()?new Float32Array(8):[],bD=FeatureDetection.supportsTypedArrays()?new Float32Array(8):[],i$5=0;i$5<7;++i$5){var s=i$5+1,t=2*s+1;u[i$5]=1/(s*t),v[i$5]=s/t}u[7]=opmu/136,v[7]=8*opmu/17,Quaternion.fastSlerp=function(e,t,i,r){var n,a=Quaternion.dot(e,t);0<=a?n=1:(n=-1,a=-a);for(var o=a-1,a=1-i,s=i*i,l=a*a,c=7;0<=c;--c)bT[c]=(u[c]*s-v[c])*o,bD[c]=(u[c]*l-v[c])*o;i=n*i*(1+bT[0]*(1+bT[1]*(1+bT[2]*(1+bT[3]*(1+bT[4]*(1+bT[5]*(1+bT[6]*(1+bT[7])))))))),a*=1+bD[0]*(1+bD[1]*(1+bD[2]*(1+bD[3]*(1+bD[4]*(1+bD[5]*(1+bD[6]*(1+bD[7]))))))),a=Quaternion.multiplyByScalar(e,a,fastSlerpScratchQuaternion);return Quaternion.multiplyByScalar(t,i,r),Quaternion.add(a,r,r)},Quaternion.fastSquad=function(e,t,i,r,n,a){t=Quaternion.fastSlerp(e,t,n,squadScratchQuaternion0),r=Quaternion.fastSlerp(i,r,n,squadScratchQuaternion1);return Quaternion.fastSlerp(t,r,2*n*(1-n),a)},Quaternion.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Quaternion.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i&&Math.abs(e.w-t.w)<=i},Quaternion.ZERO=Object.freeze(new Quaternion(0,0,0,0)),Quaternion.IDENTITY=Object.freeze(new Quaternion(0,0,0,1)),Quaternion.prototype.clone=function(e){return Quaternion.clone(this,e)},Quaternion.prototype.equals=function(e){return Quaternion.equals(this,e)},Quaternion.prototype.equalsEpsilon=function(e,t){return Quaternion.equalsEpsilon(this,e,t)},Quaternion.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var Transforms={},vectorProductLocalFrame={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"}},degeneratePositionLocalFrame={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},localFrameToFixedFrameCache={},scratchCalculateCartesian={east:new Cartesian3,north:new Cartesian3,up:new Cartesian3,west:new Cartesian3,south:new Cartesian3,down:new Cartesian3},scratchFirstCartesian=new Cartesian3,scratchSecondCartesian=new Cartesian3,scratchThirdCartesian=new Cartesian3;Transforms.localFrameToFixedFrameGenerator=function(n,a){if(!vectorProductLocalFrame.hasOwnProperty(n)||!vectorProductLocalFrame[n].hasOwnProperty(a))throw new DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");var e,o=vectorProductLocalFrame[n][a],t=n+a;return defined(localFrameToFixedFrameCache[t])?e=localFrameToFixedFrameCache[t]:localFrameToFixedFrameCache[t]=e=function(e,t,i){var r;return defined(i)||(i=new Matrix4),Cartesian3.equalsEpsilon(e,Cartesian3.ZERO,CesiumMath.EPSILON14)?(Cartesian3.unpack(degeneratePositionLocalFrame[n],0,scratchFirstCartesian),Cartesian3.unpack(degeneratePositionLocalFrame[a],0,scratchSecondCartesian),Cartesian3.unpack(degeneratePositionLocalFrame[o],0,scratchThirdCartesian)):CesiumMath.equalsEpsilon(e.x,0,CesiumMath.EPSILON14)&&CesiumMath.equalsEpsilon(e.y,0,CesiumMath.EPSILON14)?(r=CesiumMath.sign(e.z),Cartesian3.unpack(degeneratePositionLocalFrame[n],0,scratchFirstCartesian),"east"!==n&&"west"!==n&&Cartesian3.multiplyByScalar(scratchFirstCartesian,r,scratchFirstCartesian),Cartesian3.unpack(degeneratePositionLocalFrame[a],0,scratchSecondCartesian),"east"!==a&&"west"!==a&&Cartesian3.multiplyByScalar(scratchSecondCartesian,r,scratchSecondCartesian),Cartesian3.unpack(degeneratePositionLocalFrame[o],0,scratchThirdCartesian),"east"!==o&&"west"!==o&&Cartesian3.multiplyByScalar(scratchThirdCartesian,r,scratchThirdCartesian)):((t=defaultValue(t,Ellipsoid.WGS84)).geodeticSurfaceNormal(e,scratchCalculateCartesian.up),r=scratchCalculateCartesian.up,(t=scratchCalculateCartesian.east).x=-e.y,t.y=e.x,t.z=0,Cartesian3.normalize(t,scratchCalculateCartesian.east),Cartesian3.cross(r,t,scratchCalculateCartesian.north),Cartesian3.multiplyByScalar(scratchCalculateCartesian.up,-1,scratchCalculateCartesian.down),Cartesian3.multiplyByScalar(scratchCalculateCartesian.east,-1,scratchCalculateCartesian.west),Cartesian3.multiplyByScalar(scratchCalculateCartesian.north,-1,scratchCalculateCartesian.south),scratchFirstCartesian=scratchCalculateCartesian[n],scratchSecondCartesian=scratchCalculateCartesian[a],scratchThirdCartesian=scratchCalculateCartesian[o]),i[0]=scratchFirstCartesian.x,i[1]=scratchFirstCartesian.y,i[2]=scratchFirstCartesian.z,i[3]=0,i[4]=scratchSecondCartesian.x,i[5]=scratchSecondCartesian.y,i[6]=scratchSecondCartesian.z,i[7]=0,i[8]=scratchThirdCartesian.x,i[9]=scratchThirdCartesian.y,i[10]=scratchThirdCartesian.z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},e},Transforms.eastNorthUpToFixedFrame=Transforms.localFrameToFixedFrameGenerator("east","north"),Transforms.northEastDownToFixedFrame=Transforms.localFrameToFixedFrameGenerator("north","east"),Transforms.northUpEastToFixedFrame=Transforms.localFrameToFixedFrameGenerator("north","up"),Transforms.northWestUpToFixedFrame=Transforms.localFrameToFixedFrameGenerator("north","west");var scratchHPRQuaternion=new Quaternion,scratchScale$6=new Cartesian3(1,1,1),scratchHPRMatrix4=new Matrix4;Transforms.headingPitchRollToFixedFrame=function(e,t,i,r,n){r=defaultValue(r,Transforms.eastNorthUpToFixedFrame);t=Quaternion.fromHeadingPitchRoll(t,scratchHPRQuaternion),t=Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO,t,scratchScale$6,scratchHPRMatrix4);return n=r(e,i,n),Matrix4.multiply(n,t,n)};var scratchENUMatrix4=new Matrix4,scratchHPRMatrix3=new Matrix3;Transforms.headingPitchRollQuaternion=function(e,t,i,r,n){r=Transforms.headingPitchRollToFixedFrame(e,t,i,r,scratchENUMatrix4),r=Matrix4.getMatrix3(r,scratchHPRMatrix3);return Quaternion.fromRotationMatrix(r,n)};var noScale=new Cartesian3(1,1,1),hprCenterScratch=new Cartesian3,ffScratch=new Matrix4,hprTransformScratch=new Matrix4,hprRotationScratch=new Matrix3,hprQuaternionScratch=new Quaternion;Transforms.fixedFrameToHeadingPitchRoll=function(e,t,i,r){t=defaultValue(t,Ellipsoid.WGS84),i=defaultValue(i,Transforms.eastNorthUpToFixedFrame),defined(r)||(r=new HeadingPitchRoll);var n=Matrix4.getTranslation(e,hprCenterScratch);if(Cartesian3.equals(n,Cartesian3.ZERO))return r.heading=0,r.pitch=0,r.roll=0,r;t=Matrix4.inverseTransformation(i(n,t,ffScratch),ffScratch),e=Matrix4.setScale(e,noScale,hprTransformScratch),e=Matrix4.setTranslation(e,Cartesian3.ZERO,e),t=Matrix4.multiply(t,e,t),t=Quaternion.fromRotationMatrix(Matrix4.getMatrix3(t,hprRotationScratch),hprQuaternionScratch),t=Quaternion.normalize(t,t);return HeadingPitchRoll.fromQuaternion(t,r)};var gmstConstant0=24110.54841,gmstConstant1=8640184.812866,gmstConstant2=.093104,gmstConstant3=-62e-7,rateCoef=11772758384668e-32,wgs84WRPrecessing=72921158553e-15,twoPiOverSecondsInDay=CesiumMath.TWO_PI/86400,dateInUtc=new JulianDate;Transforms.computeTemeToPseudoFixedMatrix=function(e,t){var i=(dateInUtc=JulianDate.addSeconds(e,-JulianDate.computeTaiMinusUtc(e),dateInUtc)).dayNumber,r=dateInUtc.secondsOfDay,e=i-2451545,e=43200<=r?(.5+e)/TimeConstants$1.DAYS_PER_JULIAN_CENTURY:(e-.5)/TimeConstants$1.DAYS_PER_JULIAN_CENTURY,i=(gmstConstant0+e*(gmstConstant1+e*(gmstConstant2+e*gmstConstant3)))*twoPiOverSecondsInDay%CesiumMath.TWO_PI+(wgs84WRPrecessing+rateCoef*(i-2451545.5))*((r+.5*TimeConstants$1.SECONDS_PER_DAY)%TimeConstants$1.SECONDS_PER_DAY),r=Math.cos(i),i=Math.sin(i);return defined(t)?(t[0]=r,t[1]=-i,t[2]=0,t[3]=i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new Matrix3(r,i,0,-i,r,0,0,0,1)},Transforms.iau2006XysData=new Iau2006XysData,Transforms.earthOrientationParameters=EarthOrientationParameters.NONE;var ttMinusTai=32.184,j2000ttDays=2451545;Transforms.preloadIcrfFixed=function(e){var t=e.start.dayNumber,i=e.start.secondsOfDay+ttMinusTai,r=e.stop.dayNumber,e=e.stop.secondsOfDay+ttMinusTai,r=Transforms.iau2006XysData.preload(t,i,r,e),e=Transforms.earthOrientationParameters.getPromiseToLoad();return when.all([r,e])},Transforms.computeIcrfToFixedMatrix=function(e,t){defined(t)||(t=new Matrix3);e=Transforms.computeFixedToIcrfMatrix(e,t);if(defined(e))return Matrix3.transpose(e,t)};var xysScratch=new Iau2006XysSample(0,0,0),eopScratch=new EarthOrientationParametersSample(0,0,0,0,0,0),rotation1Scratch=new Matrix3,rotation2Scratch=new Matrix3;Transforms.computeFixedToIcrfMatrix=function(e,t){defined(t)||(t=new Matrix3);var i=Transforms.earthOrientationParameters.compute(e,eopScratch);if(defined(i)){var r=e.dayNumber,n=e.secondsOfDay+ttMinusTai,a=Transforms.iau2006XysData.computeXysRadians(r,n,xysScratch);if(defined(a)){var o=a.x+i.xPoleOffset,s=a.y+i.yPoleOffset,l=1/(1+Math.sqrt(1-o*o-s*s)),c=rotation1Scratch;c[0]=1-l*o*o,c[3]=-l*o*s,c[6]=o,c[1]=-l*o*s,c[4]=1-l*s*s,c[7]=s,c[2]=-o,c[5]=-s,c[8]=1-l*(o*o+s*s);o=Matrix3.fromRotationZ(-a.s,rotation2Scratch),s=Matrix3.multiply(c,o,rotation1Scratch),a=e.dayNumber,c=(e.secondsOfDay-JulianDate.computeTaiMinusUtc(e)+i.ut1MinusUtc)/TimeConstants$1.SECONDS_PER_DAY,o=(o=.779057273264+c+.00273781191135448*(a-2451545+c))%1*CesiumMath.TWO_PI,e=Matrix3.fromRotationZ(o,rotation2Scratch),a=Matrix3.multiply(s,e,rotation1Scratch),c=Math.cos(i.xPoleWander),o=Math.cos(i.yPoleWander),s=Math.sin(i.xPoleWander),e=Math.sin(i.yPoleWander),i=r-j2000ttDays+n/TimeConstants$1.SECONDS_PER_DAY,r=-47e-6*(i/=36525)*CesiumMath.RADIANS_PER_DEGREE/3600,n=Math.cos(r),i=Math.sin(r),r=rotation2Scratch;return r[0]=c*n,r[1]=c*i,r[2]=s,r[3]=-o*i+e*s*n,r[4]=o*n+e*s*i,r[5]=-e*c,r[6]=-e*i-o*s*n,r[7]=e*n-o*s*i,r[8]=o*c,Matrix3.multiply(a,r,t)}}};var pointToWindowCoordinatesTemp=new Cartesian4;Transforms.pointToWindowCoordinates=function(e,t,i,r){return(r=Transforms.pointToGLWindowCoordinates(e,t,i,r)).y=2*t[5]-r.y,r},Transforms.pointToGLWindowCoordinates=function(e,t,i,r){defined(r)||(r=new Cartesian2);var n=pointToWindowCoordinatesTemp;return Matrix4.multiplyByVector(e,Cartesian4.fromElements(i.x,i.y,i.z,1,n),n),Cartesian4.multiplyByScalar(n,1/n.w,n),Matrix4.multiplyByVector(t,n,n),Cartesian2.fromCartesian4(n,r)};var normalScratch$5=new Cartesian3,rightScratch$1=new Cartesian3,upScratch=new Cartesian3;Transforms.rotationMatrixFromPositionVelocity=function(e,t,i,r){i=defaultValue(i,Ellipsoid.WGS84).geodeticSurfaceNormal(e,normalScratch$5),e=Cartesian3.cross(t,i,rightScratch$1);Cartesian3.equalsEpsilon(e,Cartesian3.ZERO,CesiumMath.EPSILON6)&&(e=Cartesian3.clone(Cartesian3.UNIT_X,e));i=Cartesian3.cross(e,t,upScratch);return Cartesian3.normalize(i,i),Cartesian3.cross(t,i,e),Cartesian3.negate(e,e),Cartesian3.normalize(e,e),(r=!defined(r)?new Matrix3:r)[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=e.y,r[5]=e.z,r[6]=i.x,r[7]=i.y,r[8]=i.z,r};var swizzleMatrix=new Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),scratchCartographic$f=new Cartographic,scratchCartesian3Projection$1=new Cartesian3,scratchCenter$6=new Cartesian3,scratchRotation$2=new Matrix3,scratchFromENU=new Matrix4,scratchToENU=new Matrix4;Transforms.basisTo2D=function(e,t,i){var r=Matrix4.getTranslation(t,scratchCenter$6),n=e.ellipsoid,a=n.cartesianToCartographic(r,scratchCartographic$f),a=e.project(a,scratchCartesian3Projection$1);Cartesian3.fromElements(a.z,a.x,a.y,a);n=Transforms.eastNorthUpToFixedFrame(r,n,scratchFromENU),n=Matrix4.inverseTransformation(n,scratchToENU),t=Matrix4.getMatrix3(t,scratchRotation$2),t=Matrix4.multiplyByMatrix3(n,t,i);return Matrix4.multiply(swizzleMatrix,t,i),Matrix4.setTranslation(i,a,i),i},Transforms.wgs84To2DModelMatrix=function(e,t,i){var r=e.ellipsoid,n=Transforms.eastNorthUpToFixedFrame(t,r,scratchFromENU),n=Matrix4.inverseTransformation(n,scratchToENU),t=r.cartesianToCartographic(t,scratchCartographic$f),t=e.project(t,scratchCartesian3Projection$1);Cartesian3.fromElements(t.z,t.x,t.y,t);t=Matrix4.fromTranslation(t,scratchFromENU);return Matrix4.multiply(swizzleMatrix,n,i),Matrix4.multiply(t,i,i),i};var scratchCart4=new Cartesian4;function EllipsoidTangentPlane(e,t){e=(t=defaultValue(t,Ellipsoid.WGS84)).scaleToGeodeticSurface(e);var i=Transforms.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=Cartesian3.fromCartesian4(Matrix4.getColumn(i,0,scratchCart4)),this._yAxis=Cartesian3.fromCartesian4(Matrix4.getColumn(i,1,scratchCart4));i=Cartesian3.fromCartesian4(Matrix4.getColumn(i,2,scratchCart4));this._plane=Plane.fromPointNormal(e,i)}Object.defineProperties(EllipsoidTangentPlane.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 tmp$7=new AxisAlignedBoundingBox;EllipsoidTangentPlane.fromPoints=function(e,t){return new EllipsoidTangentPlane(AxisAlignedBoundingBox.fromPoints(e,tmp$7).center,t)};var scratchProjectPointOntoPlaneRay=new Ray,scratchProjectPointOntoPlaneCartesian3=new Cartesian3;EllipsoidTangentPlane.prototype.projectPointOntoPlane=function(e,t){var i=scratchProjectPointOntoPlaneRay;i.origin=e,Cartesian3.normalize(e,i.direction);e=IntersectionTests.rayPlane(i,this._plane,scratchProjectPointOntoPlaneCartesian3);if(defined(e)||(Cartesian3.negate(i.direction,i.direction),e=IntersectionTests.rayPlane(i,this._plane,scratchProjectPointOntoPlaneCartesian3)),defined(e)){i=Cartesian3.subtract(e,this._origin,e),e=Cartesian3.dot(this._xAxis,i),i=Cartesian3.dot(this._yAxis,i);return defined(t)?(t.x=e,t.y=i,t):new Cartesian2(e,i)}},EllipsoidTangentPlane.prototype.projectPointsOntoPlane=function(e,t){defined(t)||(t=[]);for(var i=0,r=e.length,n=0;n<r;n++){var a=this.projectPointOntoPlane(e[n],t[i]);defined(a)&&(t[i]=a,i++)}return t.length=i,t},EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane=function(e,t){defined(t)||(t=new Cartesian2);var i=scratchProjectPointOntoPlaneRay;i.origin=e,Cartesian3.clone(this._plane.normal,i.direction);e=IntersectionTests.rayPlane(i,this._plane,scratchProjectPointOntoPlaneCartesian3);defined(e)||(Cartesian3.negate(i.direction,i.direction),e=IntersectionTests.rayPlane(i,this._plane,scratchProjectPointOntoPlaneCartesian3));i=Cartesian3.subtract(e,this._origin,e),e=Cartesian3.dot(this._xAxis,i),i=Cartesian3.dot(this._yAxis,i);return t.x=e,t.y=i,t},EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane=function(e,t){defined(t)||(t=[]);var i=e.length;t.length=i;for(var r=0;r<i;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var projectPointsOntoEllipsoidScratch=new Cartesian3;function OrientedBoundingBox(e,t){this.center=Cartesian3.clone(defaultValue(e,Cartesian3.ZERO)),this.halfAxes=Matrix3.clone(defaultValue(t,Matrix3.ZERO))}EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid=function(e,t){defined(t)||(t=new Cartesian3);var i=this._ellipsoid,r=this._origin,n=this._xAxis,a=this._yAxis,o=projectPointsOntoEllipsoidScratch;return Cartesian3.multiplyByScalar(n,e.x,o),t=Cartesian3.add(r,o,t),Cartesian3.multiplyByScalar(a,e.y,o),Cartesian3.add(t,o,t),i.scaleToGeocentricSurface(t,t),t},EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid=function(e,t){var i=e.length;defined(t)?t.length=i:t=new Array(i);for(var r=0;r<i;++r)t[r]=this.projectPointOntoEllipsoid(e[r],t[r]);return t},OrientedBoundingBox.packedLength=Cartesian3.packedLength+Matrix3.packedLength,OrientedBoundingBox.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e.center,t,i),Matrix3.pack(e.halfAxes,t,i+Cartesian3.packedLength),t},OrientedBoundingBox.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new OrientedBoundingBox),Cartesian3.unpack(e,t,i.center),Matrix3.unpack(e,t+Cartesian3.packedLength,i.halfAxes),i};var scratchCartesian1$8=new Cartesian3,scratchCartesian2$b=new Cartesian3,scratchCartesian3$c=new Cartesian3,scratchCartesian4$6=new Cartesian3,scratchCartesian5$2=new Cartesian3,scratchCartesian6$1=new Cartesian3,scratchCovarianceResult=new Matrix3,scratchEigenResult={unitary:new Matrix3,diagonal:new Matrix3};OrientedBoundingBox.fromPoints=function(e,t){if(defined(t)||(t=new OrientedBoundingBox),!defined(e)||0===e.length)return t.halfAxes=Matrix3.ZERO,t.center=Cartesian3.ZERO,t;for(var i=e.length,r=Cartesian3.clone(e[0],scratchCartesian1$8),n=1;n<i;n++)Cartesian3.add(r,e[n],r);var a=1/i;Cartesian3.multiplyByScalar(r,a,r);var o,s=0,l=0,c=0,u=0,d=0,h=0;for(n=0;n<i;n++)s+=(o=Cartesian3.subtract(e[n],r,scratchCartesian2$b)).x*o.x,l+=o.x*o.y,c+=o.x*o.z,u+=o.y*o.y,d+=o.y*o.z,h+=o.z*o.z;l*=a,c*=a,u*=a,d*=a,h*=a;var p=scratchCovarianceResult;p[0]=s*=a,p[1]=l,p[2]=c,p[3]=l,p[4]=u,p[5]=d,p[6]=c,p[7]=d,p[8]=h;var p=Matrix3.computeEigenDecomposition(p,scratchEigenResult),p=Matrix3.clone(p.unitary,t.halfAxes),m=Matrix3.getColumn(p,0,scratchCartesian4$6),f=Matrix3.getColumn(p,1,scratchCartesian5$2),g=Matrix3.getColumn(p,2,scratchCartesian6$1),_=-Number.MAX_VALUE,y=-Number.MAX_VALUE,C=-Number.MAX_VALUE,v=Number.MAX_VALUE,S=Number.MAX_VALUE,T=Number.MAX_VALUE;for(n=0;n<i;n++)o=e[n],_=Math.max(Cartesian3.dot(m,o),_),y=Math.max(Cartesian3.dot(f,o),y),C=Math.max(Cartesian3.dot(g,o),C),v=Math.min(Cartesian3.dot(m,o),v),S=Math.min(Cartesian3.dot(f,o),S),T=Math.min(Cartesian3.dot(g,o),T);m=Cartesian3.multiplyByScalar(m,.5*(v+_),m),f=Cartesian3.multiplyByScalar(f,.5*(S+y),f),g=Cartesian3.multiplyByScalar(g,.5*(T+C),g),p=Cartesian3.add(m,f,t.center);Cartesian3.add(p,g,p);p=scratchCartesian3$c;return p.x=_-v,p.y=y-S,p.z=C-T,Cartesian3.multiplyByScalar(p,.5,p),Matrix3.multiplyByScale(t.halfAxes,p,t.halfAxes),t};var scratchOffset=new Cartesian3,scratchScale$5=new Cartesian3;function fromPlaneExtents(e,t,i,r,n,a,o,s,l,c,u){var d=(u=!defined(u)?new OrientedBoundingBox:u).halfAxes;Matrix3.setColumn(d,0,t,d),Matrix3.setColumn(d,1,i,d),Matrix3.setColumn(d,2,r,d),(i=scratchOffset).x=(n+a)/2,i.y=(o+s)/2,i.z=(l+c)/2;r=scratchScale$5;r.x=(a-n)/2,r.y=(s-o)/2,r.z=(c-l)/2;l=u.center,i=Matrix3.multiplyByVector(d,i,i);return Cartesian3.add(e,i,l),Matrix3.multiplyByScale(d,r,d),u}var scratchRectangleCenterCartographic=new Cartographic,scratchRectangleCenter=new Cartesian3,scratchPerimeterCartographicNC=new Cartographic,scratchPerimeterCartographicNW=new Cartographic,scratchPerimeterCartographicCW=new Cartographic,scratchPerimeterCartographicSW=new Cartographic,scratchPerimeterCartographicSC=new Cartographic,scratchPerimeterCartesianNC=new Cartesian3,scratchPerimeterCartesianNW=new Cartesian3,scratchPerimeterCartesianCW=new Cartesian3,scratchPerimeterCartesianSW=new Cartesian3,scratchPerimeterCartesianSC=new Cartesian3,scratchPerimeterProjectedNC=new Cartesian2,scratchPerimeterProjectedNW=new Cartesian2,scratchPerimeterProjectedCW=new Cartesian2,scratchPerimeterProjectedSW=new Cartesian2,scratchPerimeterProjectedSC=new Cartesian2,scratchPlaneOrigin=new Cartesian3,scratchPlaneNormal$1=new Cartesian3,scratchPlaneXAxis=new Cartesian3,scratchHorizonCartesian=new Cartesian3,scratchHorizonProjected=new Cartesian2,scratchMaxY=new Cartesian3,scratchMinY=new Cartesian3,scratchZ=new Cartesian3,scratchPlane$2=new Plane(Cartesian3.UNIT_X,0);OrientedBoundingBox.fromRectangle=function(e,t,i,r,n){if(t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,Ellipsoid.WGS84),e.width<=CesiumMath.PI){var a=Rectangle.center(e,scratchRectangleCenterCartographic),o=new EllipsoidTangentPlane(r.cartographicToCartesian(a,scratchRectangleCenter),r),s=o.plane,l=a.longitude,c=e.south<0&&0<e.north?0:a.latitude,u=Cartographic.fromRadians(l,e.north,i,scratchPerimeterCartographicNC),d=Cartographic.fromRadians(e.west,e.north,i,scratchPerimeterCartographicNW),h=Cartographic.fromRadians(e.west,c,i,scratchPerimeterCartographicCW),p=Cartographic.fromRadians(e.west,e.south,i,scratchPerimeterCartographicSW),m=Cartographic.fromRadians(l,e.south,i,scratchPerimeterCartographicSC),f=r.cartographicToCartesian(u,scratchPerimeterCartesianNC),g=r.cartographicToCartesian(d,scratchPerimeterCartesianNW),_=r.cartographicToCartesian(h,scratchPerimeterCartesianCW),y=r.cartographicToCartesian(p,scratchPerimeterCartesianSW),a=r.cartographicToCartesian(m,scratchPerimeterCartesianSC),c=o.projectPointToNearestOnPlane(f,scratchPerimeterProjectedNC),l=o.projectPointToNearestOnPlane(g,scratchPerimeterProjectedNW),u=o.projectPointToNearestOnPlane(_,scratchPerimeterProjectedCW),h=o.projectPointToNearestOnPlane(y,scratchPerimeterProjectedSW),m=o.projectPointToNearestOnPlane(a,scratchPerimeterProjectedSC),_=-(f=Math.min(l.x,u.x,h.x)),a=Math.max(l.y,c.y),u=Math.min(h.y,m.y);return d.height=p.height=t,g=r.cartographicToCartesian(d,scratchPerimeterCartesianNW),y=r.cartographicToCartesian(p,scratchPerimeterCartesianSW),l=Math.min(Plane.getPointDistance(s,g),Plane.getPointDistance(s,y)),fromPlaneExtents(o.origin,o.xAxis,o.yAxis,o.zAxis,f,_,u,a,l,i,n)}c=0<e.south,h=e.north<0,m=c?e.south:h?e.north:0,d=Rectangle.center(e,scratchRectangleCenterCartographic).longitude,p=Cartesian3.fromRadians(d,m,i,r,scratchPlaneOrigin);p.z=0;g=Math.abs(p.x)<CesiumMath.EPSILON10&&Math.abs(p.y)<CesiumMath.EPSILON10?Cartesian3.UNIT_X:Cartesian3.normalize(p,scratchPlaneNormal$1),y=Cartesian3.UNIT_Z,o=Cartesian3.cross(g,y,scratchPlaneXAxis);s=Plane.fromPointNormal(p,g,scratchPlane$2);d=Cartesian3.fromRadians(d+CesiumMath.PI_OVER_TWO,m,i,r,scratchHorizonCartesian);f=-(_=Cartesian3.dot(Plane.projectPointOntoPlane(s,d,scratchHorizonProjected),o)),a=Cartesian3.fromRadians(0,e.north,h?t:i,r,scratchMaxY).z,u=Cartesian3.fromRadians(0,e.south,c?t:i,r,scratchMinY).z;r=Cartesian3.fromRadians(e.east,m,i,r,scratchZ);return fromPlaneExtents(p,o,y,g,f,_,u,a,l=Plane.getPointDistance(s,r),0,n)},OrientedBoundingBox.clone=function(e,t){if(defined(e))return defined(t)?(Cartesian3.clone(e.center,t.center),Matrix3.clone(e.halfAxes,t.halfAxes),t):new OrientedBoundingBox(e.center,e.halfAxes)},OrientedBoundingBox.intersectPlane=function(e,t){var i=e.center,r=t.normal,n=e.halfAxes,a=r.x,o=r.y,e=r.z,n=Math.abs(a*n[Matrix3.COLUMN0ROW0]+o*n[Matrix3.COLUMN0ROW1]+e*n[Matrix3.COLUMN0ROW2])+Math.abs(a*n[Matrix3.COLUMN1ROW0]+o*n[Matrix3.COLUMN1ROW1]+e*n[Matrix3.COLUMN1ROW2])+Math.abs(a*n[Matrix3.COLUMN2ROW0]+o*n[Matrix3.COLUMN2ROW1]+e*n[Matrix3.COLUMN2ROW2]),t=Cartesian3.dot(r,i)+t.distance;return t<=-n?Intersect$1.OUTSIDE:n<=t?Intersect$1.INSIDE:Intersect$1.INTERSECTING};var scratchCartesianU=new Cartesian3,scratchCartesianV=new Cartesian3,scratchCartesianW=new Cartesian3,scratchPPrime=new Cartesian3;OrientedBoundingBox.distanceSquaredTo=function(e,t){var i=Cartesian3.subtract(t,e.center,scratchOffset),r=e.halfAxes,n=Matrix3.getColumn(r,0,scratchCartesianU),a=Matrix3.getColumn(r,1,scratchCartesianV),o=Matrix3.getColumn(r,2,scratchCartesianW),s=Cartesian3.magnitude(n),t=Cartesian3.magnitude(a),e=Cartesian3.magnitude(o);Cartesian3.normalize(n,n),Cartesian3.normalize(a,a),Cartesian3.normalize(o,o);r=scratchPPrime;r.x=Cartesian3.dot(i,n),r.y=Cartesian3.dot(i,a),r.z=Cartesian3.dot(i,o);var l,o=0;return r.x<-s?o+=(l=r.x+s)*l:r.x>s&&(o+=(l=r.x-s)*l),r.y<-t?o+=(l=r.y+t)*l:r.y>t&&(o+=(l=r.y-t)*l),r.z<-e?o+=(l=r.z+e)*l:r.z>e&&(o+=(l=r.z-e)*l),o};var scratchCorner=new Cartesian3,scratchToCenter$1=new Cartesian3;OrientedBoundingBox.computePlaneDistances=function(e,t,i,r){defined(r)||(r=new Interval);var n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=e.center,s=e.halfAxes,l=Matrix3.getColumn(s,0,scratchCartesianU),c=Matrix3.getColumn(s,1,scratchCartesianV),u=Matrix3.getColumn(s,2,scratchCartesianW),d=Cartesian3.add(l,c,scratchCorner);Cartesian3.add(d,u,d),Cartesian3.add(d,o,d);e=Cartesian3.subtract(d,t,scratchToCenter$1),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a);return Cartesian3.add(o,l,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.add(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.add(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.add(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),r.start=n,r.stop=a,r};var scratchBoundingSphere$3=new BoundingSphere;OrientedBoundingBox.isOccluded=function(e,t){e=BoundingSphere.fromOrientedBoundingBox(e,scratchBoundingSphere$3);return!t.isBoundingSphereVisible(e)},OrientedBoundingBox.prototype.intersectPlane=function(e){return OrientedBoundingBox.intersectPlane(this,e)},OrientedBoundingBox.prototype.distanceSquaredTo=function(e){return OrientedBoundingBox.distanceSquaredTo(this,e)},OrientedBoundingBox.prototype.computePlaneDistances=function(e,t,i){return OrientedBoundingBox.computePlaneDistances(this,e,t,i)},OrientedBoundingBox.prototype.isOccluded=function(e){return OrientedBoundingBox.isOccluded(this,e)},OrientedBoundingBox.equals=function(e,t){return e===t||defined(e)&&defined(t)&&Cartesian3.equals(e.center,t.center)&&Matrix3.equals(e.halfAxes,t.halfAxes)},OrientedBoundingBox.prototype.clone=function(e){return OrientedBoundingBox.clone(this,e)},OrientedBoundingBox.prototype.equals=function(e){return OrientedBoundingBox.equals(this,e)};var RIGHT_SHIFT=1/256,LEFT_SHIFT=256,AttributeCompression={octEncodeInRange:function(e,t,i){var r;return i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0&&(r=i.x,e=i.y,i.x=(1-Math.abs(e))*CesiumMath.signNotZero(r),i.y=(1-Math.abs(r))*CesiumMath.signNotZero(e)),i.x=CesiumMath.toSNorm(i.x,t),i.y=CesiumMath.toSNorm(i.y,t),i},octEncode:function(e,t){return AttributeCompression.octEncodeInRange(e,255,t)}},octEncodeScratch=new Cartesian2,uint8ForceArray=new Uint8Array(1);function forceUint8(e){return uint8ForceArray[0]=e,uint8ForceArray[0]}AttributeCompression.octEncodeToCartesian4=function(e,t){return AttributeCompression.octEncodeInRange(e,65535,octEncodeScratch),t.x=forceUint8(octEncodeScratch.x*RIGHT_SHIFT),t.y=forceUint8(octEncodeScratch.x),t.z=forceUint8(octEncodeScratch.y*RIGHT_SHIFT),t.w=forceUint8(octEncodeScratch.y),t},AttributeCompression.octDecodeInRange=function(e,t,i,r){return r.x=CesiumMath.fromSNorm(e,i),r.y=CesiumMath.fromSNorm(t,i),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0&&(i=r.x,r.x=(1-Math.abs(r.y))*CesiumMath.signNotZero(i),r.y=(1-Math.abs(i))*CesiumMath.signNotZero(r.y)),Cartesian3.normalize(r,r)},AttributeCompression.octDecode=function(e,t,i){return AttributeCompression.octDecodeInRange(e,t,255,i)},AttributeCompression.octDecodeFromCartesian4=function(e,t){var i=e.x,r=e.y,n=e.z,e=e.w;return AttributeCompression.octDecodeInRange(i*LEFT_SHIFT+r,n*LEFT_SHIFT+e,65535,t)},AttributeCompression.octPackFloat=function(e){return 256*e.x+e.y};var scratchEncodeCart2=new Cartesian2;function zigZagDecode(e){return e>>1^-(1&e)}AttributeCompression.octEncodeFloat=function(e){return AttributeCompression.octEncode(e,scratchEncodeCart2),AttributeCompression.octPackFloat(scratchEncodeCart2)},AttributeCompression.octDecodeFloat=function(e,t){var i=e/256,e=Math.floor(i);return AttributeCompression.octDecode(e,256*(i-e),t)},AttributeCompression.octPack=function(e,t,i,r){e=AttributeCompression.octEncodeFloat(e),t=AttributeCompression.octEncodeFloat(t),i=AttributeCompression.octEncode(i,scratchEncodeCart2);return r.x=65536*i.x+e,r.y=65536*i.y+t,r},AttributeCompression.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),o=65536*(n-a),n=e.y/65536,e=Math.floor(n),n=65536*(n-e);AttributeCompression.octDecodeFloat(o,t),AttributeCompression.octDecodeFloat(n,i),AttributeCompression.octDecode(a,e,r)},AttributeCompression.compressTextureCoordinates=function(e){return 4096*(4095*e.x|0)+(4095*e.y|0)},AttributeCompression.decompressTextureCoordinates=function(e,t){var i=Math.floor(e/4096);return t.x=i/4095,t.y=(e-4096*i)/4095,t},AttributeCompression.zigZagDeltaDecode=function(e,t,i){for(var r=e.length,n=0,a=0,o=0,s=0;s<r;++s)n+=zigZagDecode(e[s]),a+=zigZagDecode(t[s]),e[s]=n,t[s]=a,defined(i)&&(o+=zigZagDecode(i[s]),i[s]=o)};var WebGLConstants={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_RGB_ETC1_WEBGL:36196,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},WebGLConstants$1=Object.freeze(WebGLConstants),ComponentDatatype={BYTE:WebGLConstants$1.BYTE,UNSIGNED_BYTE:WebGLConstants$1.UNSIGNED_BYTE,SHORT:WebGLConstants$1.SHORT,UNSIGNED_SHORT:WebGLConstants$1.UNSIGNED_SHORT,INT:WebGLConstants$1.INT,UNSIGNED_INT:WebGLConstants$1.UNSIGNED_INT,FLOAT:WebGLConstants$1.FLOAT,DOUBLE:WebGLConstants$1.DOUBLE,getSizeInBytes:function(e){switch(e){case ComponentDatatype.BYTE:return Int8Array.BYTES_PER_ELEMENT;case ComponentDatatype.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ComponentDatatype.SHORT:return Int16Array.BYTES_PER_ELEMENT;case ComponentDatatype.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ComponentDatatype.INT:return Int32Array.BYTES_PER_ELEMENT;case ComponentDatatype.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case ComponentDatatype.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case ComponentDatatype.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},fromTypedArray:function(e){return e instanceof Int8Array?ComponentDatatype.BYTE:e instanceof Uint8Array?ComponentDatatype.UNSIGNED_BYTE:e instanceof Int16Array?ComponentDatatype.SHORT:e instanceof Uint16Array?ComponentDatatype.UNSIGNED_SHORT:e instanceof Int32Array?ComponentDatatype.INT:e instanceof Uint32Array?ComponentDatatype.UNSIGNED_INT:e instanceof Float32Array?ComponentDatatype.FLOAT:e instanceof Float64Array?ComponentDatatype.DOUBLE:void 0},validate:function(e){return defined(e)&&(e===ComponentDatatype.BYTE||e===ComponentDatatype.UNSIGNED_BYTE||e===ComponentDatatype.SHORT||e===ComponentDatatype.UNSIGNED_SHORT||e===ComponentDatatype.INT||e===ComponentDatatype.UNSIGNED_INT||e===ComponentDatatype.FLOAT||e===ComponentDatatype.DOUBLE)},createTypedArray:function(e,t){switch(e){case ComponentDatatype.BYTE:return new Int8Array(t);case ComponentDatatype.UNSIGNED_BYTE:return new Uint8Array(t);case ComponentDatatype.SHORT:return new Int16Array(t);case ComponentDatatype.UNSIGNED_SHORT:return new Uint16Array(t);case ComponentDatatype.INT:return new Int32Array(t);case ComponentDatatype.UNSIGNED_INT:return new Uint32Array(t);case ComponentDatatype.FLOAT:return new Float32Array(t);case ComponentDatatype.DOUBLE:return new Float64Array(t)}},createArrayBufferView:function(e,t,i,r){switch(i=defaultValue(i,0),r=defaultValue(r,(t.byteLength-i)/ComponentDatatype.getSizeInBytes(e)),e){case ComponentDatatype.BYTE:return new Int8Array(t,i,r);case ComponentDatatype.UNSIGNED_BYTE:return new Uint8Array(t,i,r);case ComponentDatatype.SHORT:return new Int16Array(t,i,r);case ComponentDatatype.UNSIGNED_SHORT:return new Uint16Array(t,i,r);case ComponentDatatype.INT:return new Int32Array(t,i,r);case ComponentDatatype.UNSIGNED_INT:return new Uint32Array(t,i,r);case ComponentDatatype.FLOAT:return new Float32Array(t,i,r);case ComponentDatatype.DOUBLE:return new Float64Array(t,i,r)}},fromName:function(e){switch(e){case"BYTE":return ComponentDatatype.BYTE;case"UNSIGNED_BYTE":return ComponentDatatype.UNSIGNED_BYTE;case"SHORT":return ComponentDatatype.SHORT;case"UNSIGNED_SHORT":return ComponentDatatype.UNSIGNED_SHORT;case"INT":return ComponentDatatype.INT;case"UNSIGNED_INT":return ComponentDatatype.UNSIGNED_INT;case"FLOAT":return ComponentDatatype.FLOAT;case"DOUBLE":return ComponentDatatype.DOUBLE}}},ComponentDatatype$1=Object.freeze(ComponentDatatype),TerrainQuantization={NONE:0,BITS12:1},TerrainQuantization$1=Object.freeze(TerrainQuantization),cartesian3Scratch$3=new Cartesian3,cartesian3DimScratch=new Cartesian3,cartesian2Scratch=new Cartesian2,matrix4Scratch$1=new Matrix4,matrix4Scratch2=new Matrix4,SHIFT_LEFT_12=Math.pow(2,12);function TerrainEncoding(e,t,i,r,n,a){var o,s,l,c,u,d=TerrainQuantization$1.NONE;defined(e)&&defined(t)&&defined(i)&&defined(r)&&(c=e.minimum,s=e.maximum,u=Cartesian3.subtract(s,c,cartesian3DimScratch),l=i-t,d=Math.max(Cartesian3.maximumComponent(u),l)<SHIFT_LEFT_12-1?TerrainQuantization$1.BITS12:TerrainQuantization$1.NONE,o=e.center,s=Matrix4.inverseTransformation(r,new Matrix4),l=Cartesian3.negate(c,cartesian3Scratch$3),Matrix4.multiply(Matrix4.fromTranslation(l,matrix4Scratch$1),s,s),(l=cartesian3Scratch$3).x=1/u.x,l.y=1/u.y,l.z=1/u.z,Matrix4.multiply(Matrix4.fromScale(l,matrix4Scratch$1),s,s),l=Matrix4.clone(r),Matrix4.setTranslation(l,Cartesian3.ZERO,l),r=Matrix4.clone(r,new Matrix4),c=Matrix4.fromTranslation(c,matrix4Scratch$1),u=Matrix4.fromScale(u,matrix4Scratch2),u=Matrix4.multiply(c,u,matrix4Scratch$1),Matrix4.multiply(r,u,r),Matrix4.multiply(l,u,l)),this.quantization=d,this.minimumHeight=t,this.maximumHeight=i,this.center=o,this.toScaledENU=s,this.fromScaledENU=r,this.matrix=l,this.hasVertexNormals=n,this.hasWebMercatorT=defaultValue(a,!1)}TerrainEncoding.prototype.encode=function(e,t,i,r,n,a,o){var s,l,c=r.x,u=r.y;return this.quantization===TerrainQuantization$1.BITS12?((i=Matrix4.multiplyByPoint(this.toScaledENU,i,cartesian3Scratch$3)).x=CesiumMath.clamp(i.x,0,1),i.y=CesiumMath.clamp(i.y,0,1),i.z=CesiumMath.clamp(i.z,0,1),s=this.maximumHeight-this.minimumHeight,l=CesiumMath.clamp((n-this.minimumHeight)/s,0,1),Cartesian2.fromElements(i.x,i.y,cartesian2Scratch),r=AttributeCompression.compressTextureCoordinates(cartesian2Scratch),Cartesian2.fromElements(i.z,l,cartesian2Scratch),s=AttributeCompression.compressTextureCoordinates(cartesian2Scratch),Cartesian2.fromElements(c,u,cartesian2Scratch),l=AttributeCompression.compressTextureCoordinates(cartesian2Scratch),e[t++]=r,e[t++]=s,e[t++]=l,this.hasWebMercatorT&&(Cartesian2.fromElements(o,0,cartesian2Scratch),l=AttributeCompression.compressTextureCoordinates(cartesian2Scratch),e[t++]=l)):(Cartesian3.subtract(i,this.center,cartesian3Scratch$3),e[t++]=cartesian3Scratch$3.x,e[t++]=cartesian3Scratch$3.y,e[t++]=cartesian3Scratch$3.z,e[t++]=n,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=o)),this.hasVertexNormals&&(e[t++]=AttributeCompression.octPackFloat(a)),t},TerrainEncoding.prototype.decodePosition=function(e,t,i){if(defined(i)||(i=new Cartesian3),t*=this.getStride(),this.quantization!==TerrainQuantization$1.BITS12)return i.x=e[t],i.y=e[t+1],i.z=e[t+2],Cartesian3.add(i,this.center,i);var r=AttributeCompression.decompressTextureCoordinates(e[t],cartesian2Scratch);i.x=r.x,i.y=r.y;t=AttributeCompression.decompressTextureCoordinates(e[t+1],cartesian2Scratch);return i.z=t.x,Matrix4.multiplyByPoint(this.fromScaledENU,i,i)},TerrainEncoding.prototype.decodeTextureCoordinates=function(e,t,i){return defined(i)||(i=new Cartesian2),t*=this.getStride(),this.quantization===TerrainQuantization$1.BITS12?AttributeCompression.decompressTextureCoordinates(e[t+2],i):Cartesian2.fromElements(e[t+4],e[t+5],i)},TerrainEncoding.prototype.decodeHeight=function(e,t){return t*=this.getStride(),this.quantization!==TerrainQuantization$1.BITS12?e[t+3]:AttributeCompression.decompressTextureCoordinates(e[t+1],cartesian2Scratch).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight},TerrainEncoding.prototype.decodeWebMercatorT=function(e,t){return t*=this.getStride(),this.quantization===TerrainQuantization$1.BITS12?AttributeCompression.decompressTextureCoordinates(e[t+3],cartesian2Scratch).x:e[t+6]},TerrainEncoding.prototype.getOctEncodedNormal=function(e,t,i){e=e[t=(t+1)*this.getStride()-1]/256,t=Math.floor(e);return Cartesian2.fromElements(t,256*(e-t),i)},TerrainEncoding.prototype.getStride=function(){var e=this.quantization===TerrainQuantization$1.BITS12?3:6;return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var attributesNone={position3DAndHeight:0,textureCoordAndEncodedNormals:1},attributes={compressed0:0,compressed1:1};function WebMercatorProjection(e){this._ellipsoid=defaultValue(e,Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}TerrainEncoding.prototype.getAttributes=function(e){var t,i=ComponentDatatype$1.FLOAT,r=ComponentDatatype$1.getSizeInBytes(i);if(this.quantization===TerrainQuantization$1.NONE){var n=2;return this.hasWebMercatorT&&++n,this.hasVertexNormals&&++n,[{index:attributesNone.position3DAndHeight,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:4,offsetInBytes:0,strideInBytes:t=(4+n)*r},{index:attributesNone.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:n,offsetInBytes:4*r,strideInBytes:t}]}var a=3,n=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++a,this.hasWebMercatorT&&this.hasVertexNormals?(++n,[{index:attributes.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:t=(a+1)*r},{index:attributes.compressed1,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:1,offsetInBytes:a*r,strideInBytes:t}]):[{index:attributes.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a}]},TerrainEncoding.prototype.getAttributeLocations=function(){return this.quantization===TerrainQuantization$1.NONE?attributesNone:attributes},TerrainEncoding.clone=function(e,t){return(t=!defined(t)?new TerrainEncoding:t).quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=Cartesian3.clone(e.center),t.toScaledENU=Matrix4.clone(e.toScaledENU),t.fromScaledENU=Matrix4.clone(e.fromScaledENU),t.matrix=Matrix4.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},Object.defineProperties(WebMercatorProjection.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),WebMercatorProjection.mercatorAngleToGeodeticLatitude=function(e){return CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},WebMercatorProjection.geodeticLatitudeToMercatorAngle=function(e){e>WebMercatorProjection.MaximumLatitude?e=WebMercatorProjection.MaximumLatitude:e<-WebMercatorProjection.MaximumLatitude&&(e=-WebMercatorProjection.MaximumLatitude);e=Math.sin(e);return.5*Math.log((1+e)/(1-e))},WebMercatorProjection.MaximumLatitude=WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI),WebMercatorProjection.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,i=WebMercatorProjection.geodeticLatitudeToMercatorAngle(e.latitude)*i,e=e.height;return defined(t)?(t.x=r,t.y=i,t.z=e,t):new Cartesian3(r,i,e)},WebMercatorProjection.prototype.unproject=function(e,t){var i=this._oneOverSemimajorAxis,r=e.x*i,i=WebMercatorProjection.mercatorAngleToGeodeticLatitude(e.y*i),e=e.z;return defined(t)?(t.longitude=r,t.latitude=i,t.height=e,t):new Cartographic(r,i,e)};var HeightmapTessellator={};HeightmapTessellator.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var cartesian3Scratch$2=new Cartesian3,matrix4Scratch=new Matrix4,minimumScratch=new Cartesian3,maximumScratch=new Cartesian3;function returnTrue(){return!0}function destroyObject(e,t){function i(){}for(var r in e)"function"==typeof e[r]&&(e[r]=i);e.isDestroyed=returnTrue}function canTransferArrayBuffer(){if(!defined(TaskProcessor._canTransferArrayBuffer)){var t=new Worker(getWorkerUrl("Workers/transferTypedArrayTest.js"));t.postMessage=defaultValue(t.webkitPostMessage,t.postMessage);var e=new Int8Array([99]);try{t.postMessage({array:e},[e.buffer])}catch(e){return TaskProcessor._canTransferArrayBuffer=!1,TaskProcessor._canTransferArrayBuffer}var i=when.defer();t.onmessage=function(e){e=e.data.array,e=defined(e)&&99===e[0];i.resolve(e),t.terminate(),TaskProcessor._canTransferArrayBuffer=e},TaskProcessor._canTransferArrayBuffer=i.promise}return TaskProcessor._canTransferArrayBuffer}HeightmapTessellator.computeVertices=function(e){var t,i,r,n=Math.cos,a=Math.sin,o=Math.sqrt,s=Math.atan,l=Math.exp,c=CesiumMath.PI_OVER_TWO,u=CesiumMath.toRadians,d=e.heightmap,h=e.width,p=e.height,m=e.skirtHeight,f=defaultValue(e.isGeographic,!0),g=defaultValue(e.ellipsoid,Ellipsoid.WGS84),_=1/g.maximumRadius,y=e.nativeRectangle,C=e.rectangle,v=defined(C)?(t=C.west,i=C.south,r=C.east,C.north):f?(t=u(y.west),i=u(y.south),r=u(y.east),u(y.north)):(t=y.west*_,i=c-2*s(l(-y.south*_)),r=y.east*_,c-2*s(l(-y.north*_))),S=defined(T=e.relativeToCenter),T=S?T:Cartesian3.ZERO,x=defaultValue(e.exaggeration,1),b=defaultValue(e.includeWebMercatorT,!1),E=defaultValue(e.structure,HeightmapTessellator.DEFAULT_STRUCTURE),P=defaultValue(E.heightScale,HeightmapTessellator.DEFAULT_STRUCTURE.heightScale),A=defaultValue(E.heightOffset,HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset),w=defaultValue(E.elementsPerHeight,HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight),D=defaultValue(E.stride,HeightmapTessellator.DEFAULT_STRUCTURE.stride),M=defaultValue(E.elementMultiplier,HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier),I=defaultValue(E.isBigEndian,HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian),R=Rectangle.computeWidth(y),O=Rectangle.computeHeight(y),L=R/(h-1),F=O/(p-1);f||(R*=_,O*=_);var N,B,e=g.radiiSquared,V=e.x,k=e.y,z=e.z,$=65536,U=-65536,E=Transforms.eastNorthUpToFixedFrame(T,g),G=Matrix4.inverseTransformation(E,matrix4Scratch);b&&(N=WebMercatorProjection.geodeticLatitudeToMercatorAngle(i),B=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(v)-N));var H=minimumScratch;H.x=Number.POSITIVE_INFINITY,H.y=Number.POSITIVE_INFINITY,H.z=Number.POSITIVE_INFINITY;var W=maximumScratch;W.x=Number.NEGATIVE_INFINITY,W.y=Number.NEGATIVE_INFINITY,W.z=Number.NEGATIVE_INFINITY;var q=Number.POSITIVE_INFINITY,j=h*p,Y=j+(0<m?2*h+2*p:0),X=new Array(Y),Q=new Array(Y),J=new Array(Y),Z=b?new Array(Y):[],K=0,ee=p,te=0,ie=h;0<m&&(--K,++ee,--te,++ie);for(var re=K;re<ee;++re){var ne=re;p<=(ne=ne<0?0:ne)&&(ne=p-1);var ae=y.north-F*ne,ae=f?u(ae):c-2*s(l(-ae*_)),oe=CesiumMath.clamp(oe=(ae-i)/(v-i),0,1),se=re===K,le=re===ee-1;0<m&&(se?ae+=1e-5*O:le&&(ae-=1e-5*O));var ce,ue=n(ae),de=a(ae),he=z*de;b&&(ce=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(ae)-N)*B);for(var pe=te;pe<ie;++pe){var me=pe,fe=ne*(h*D)+(me=h<=(me=me<0?0:me)?h-1:me)*D;if(1===w)_e=d[fe];else{var ge,_e=0;if(I)for(ge=0;ge<w;++ge)_e=_e*M+d[fe+ge];else for(ge=w-1;0<=ge;--ge)_e=_e*M+d[fe+ge]}_e=(_e*P+A)*x;var U=Math.max(U,_e),$=Math.min($,_e),ye=y.west+L*me;f?ye=u(ye):ye*=_;var Ce=CesiumMath.clamp(Ce=(ye-t)/(r-t),0,1),ve=ne*h+me;if(0<m){var Se=pe===te,Te=pe===ie-1,xe=se||le||Se||Te;if((se||le)&&(Se||Te))continue;xe&&(_e-=m,Se?(ve=p-ne-1+j,ye-=1e-5*R):le?ve=j+p+(h-me-1):Te?(ve=j+p+h+ne,ye+=1e-5*R):se&&(ve=j+p+h+p+me))}var be=ue*n(ye),xe=ue*a(ye),Se=V*be,Te=k*xe,me=1/o(Se*be+Te*xe+he*de),ye=Se*me,Se=Te*me,Te=he*me,me=new Cartesian3;me.x=ye+be*_e,me.y=Se+xe*_e,me.z=Te+de*_e,X[ve]=me,Q[ve]=_e,J[ve]=new Cartesian2(Ce,oe),b&&(Z[ve]=ce),Matrix4.multiplyByPoint(G,me,cartesian3Scratch$2),Cartesian3.minimumByComponent(cartesian3Scratch$2,H,H),Cartesian3.maximumByComponent(cartesian3Scratch$2,W,W),q=Math.min(q,_e)}}var Ee,Pe,e=BoundingSphere.fromPoints(X);defined(C)&&(Ee=OrientedBoundingBox.fromRectangle(C,$,U,g)),S&&(Pe=new EllipsoidalOccluder(g).computeHorizonCullingPointPossiblyUnderEllipsoid(T,X,$));for(var Ae=new TerrainEncoding(new AxisAlignedBoundingBox(H,W,T),q,U,E,!1,b),we=new Float32Array(Y*Ae.getStride()),De=0,Me=0;Me<Y;++Me)De=Ae.encode(we,De,X[Me],J[Me],Q[Me],void 0,Z[Me]);return{vertices:we,maximumHeight:U,minimumHeight:$,encoding:Ae,boundingSphere3D:e,orientedBoundingBox:Ee,occludeePointInScaledSpace:Pe}};var taskCompletedEvent=new Event,bootstrapperUrlResult;function completeTask(e,t){--e._activeTasks;var i,r,n=t.id;defined(n)&&(r=(i=e._deferreds)[n],defined(t.error)?("RuntimeError"===(e=t.error).name?(e=new RuntimeError(t.error.message)).stack=t.error.stack:"DeveloperError"===e.name&&((e=new DeveloperError(t.error.message)).stack=t.error.stack),taskCompletedEvent.raiseEvent(e),r.reject(e)):(taskCompletedEvent.raiseEvent(),r.resolve(t.result)),delete i[n])}function getWorkerUrl(t){if(isCrossOriginUrl(e=buildModuleUrl(t))){var i,r='importScripts("'+e+'");';try{i=new Blob([r],{type:"application/javascript"})}catch(e){t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);t.append(r),i=t.getBlob("application/javascript")}var e=(window.URL||window.webkitURL).createObjectURL(i)}return e}function getBootstrapperUrl(){return bootstrapperUrlResult=!defined(bootstrapperUrlResult)?getWorkerUrl("Workers/cesiumWorkerBootstrapper.js"):bootstrapperUrlResult}function createWorker(t){var e=new Worker(getBootstrapperUrl());e.postMessage=defaultValue(e.webkitPostMessage,e.postMessage);var i={loaderConfig:{paths:{Workers:buildModuleUrl("Workers")},baseUrl:buildModuleUrl.getCesiumBaseUrl().url},workerModule:t._workerPath};return e.postMessage(i),e.onmessage=function(e){completeTask(t,e.data)},e}function getWebAssemblyLoaderConfig(e,t){var i={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(FeatureDetection.supportsWebAssembly())return i.modulePath=buildModuleUrl(t.modulePath),i.wasmBinaryFile=buildModuleUrl(t.wasmBinaryFile),Resource.fetchArrayBuffer({url:i.wasmBinaryFile}).then(function(e){return i.wasmBinary=e,i});if(!defined(t.fallbackModulePath))throw new RuntimeError("This browser does not support Web Assembly, and no backup module was provided for "+e._workerPath);return i.modulePath=buildModuleUrl(t.fallbackModulePath),when.resolve(i)}function TaskProcessor(e,t){this._workerPath=new URI(e).isAbsolute()?e:TaskProcessor._workerModulePrefix+e,this._maximumActiveTasks=defaultValue(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}var emptyTransferableObjectArray=[];function TerrainData(){DeveloperError.throwInstantiationError()}function TerrainMesh(e,t,i,r,n,a,o,s,l,c,u,d,h,p,m,f,g){this.center=e,this.vertices=t,this.stride=defaultValue(c,6),this.indices=i,this.indexCountWithoutSkirts=r,this.vertexCountWithoutSkirts=n,this.minimumHeight=a,this.maximumHeight=o,this.boundingSphere3D=s,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=u,this.encoding=d,this.exaggeration=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=f,this.northIndicesWestToEast=g}TaskProcessor.prototype.scheduleTask=function(r,n){if(defined(this._worker)||(this._worker=createWorker(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var a=this;return when(canTransferArrayBuffer(),function(e){defined(n)?e||(n.length=0):n=emptyTransferableObjectArray;var t=a._nextID++,i=when.defer();return a._deferreds[t]=i,a._worker.postMessage({id:t,parameters:r,canTransferArrayBuffer:e},n),i.promise})}},TaskProcessor.prototype.initWebAssemblyModule=function(e){defined(this._worker)||(this._worker=createWorker(this));var n=when.defer(),a=this,o=this._worker;return getWebAssemblyLoaderConfig(this,e).then(function(r){return when(canTransferArrayBuffer(),function(e){var t,i=r.wasmBinary;defined(i)&&e&&(t=[i]),o.onmessage=function(e){o.onmessage=function(e){completeTask(a,e.data)},n.resolve(e.data)},o.postMessage({webAssemblyConfig:r},t)})}),n},TaskProcessor.prototype.isDestroyed=function(){return!1},TaskProcessor.prototype.destroy=function(){return defined(this._worker)&&this._worker.terminate(),destroyObject(this)},TaskProcessor.taskCompletedEvent=taskCompletedEvent,TaskProcessor._defaultWorkerModulePrefix="Workers/",TaskProcessor._workerModulePrefix=TaskProcessor._defaultWorkerModulePrefix,TaskProcessor._canTransferArrayBuffer=void 0,Object.defineProperties(TerrainData.prototype,{credits:{get:DeveloperError.throwInstantiationError},waterMask:{get:DeveloperError.throwInstantiationError}}),TerrainData.prototype.interpolateHeight=DeveloperError.throwInstantiationError,TerrainData.prototype.isChildAvailable=DeveloperError.throwInstantiationError,TerrainData.prototype.createMesh=DeveloperError.throwInstantiationError,TerrainData.prototype.upsample=DeveloperError.throwInstantiationError,TerrainData.prototype.wasCreatedByUpsampling=DeveloperError.throwInstantiationError,TerrainData.maximumAsynchronousTasks=5;var IndexDatatype={UNSIGNED_BYTE:WebGLConstants$1.UNSIGNED_BYTE,UNSIGNED_SHORT:WebGLConstants$1.UNSIGNED_SHORT,UNSIGNED_INT:WebGLConstants$1.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case IndexDatatype.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case IndexDatatype.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case IndexDatatype.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},fromSizeInBytes:function(e){switch(e){case 2:return IndexDatatype.UNSIGNED_SHORT;case 4:return IndexDatatype.UNSIGNED_INT;case 1:return IndexDatatype.UNSIGNED_BYTE}},validate:function(e){return defined(e)&&(e===IndexDatatype.UNSIGNED_BYTE||e===IndexDatatype.UNSIGNED_SHORT||e===IndexDatatype.UNSIGNED_INT)},createTypedArray:function(e,t){return new(e>=CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(t)},createTypedArrayFromArrayBuffer:function(e,t,i,r){return new(e>=CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(t,i,r)}},IndexDatatype$1=Object.freeze(IndexDatatype);function TerrainProvider(){DeveloperError.throwInstantiationError()}Object.defineProperties(TerrainProvider.prototype,{errorEvent:{get:DeveloperError.throwInstantiationError},credit:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},ready:{get:DeveloperError.throwInstantiationError},readyPromise:{get:DeveloperError.throwInstantiationError},hasWaterMask:{get:DeveloperError.throwInstantiationError},hasVertexNormals:{get:DeveloperError.throwInstantiationError},availability:{get:DeveloperError.throwInstantiationError}});var regularGridIndicesCache=[];TerrainProvider.getRegularGridIndices=function(e,t){var i=regularGridIndicesCache[e];defined(i)||(regularGridIndicesCache[e]=i=[]);var r=i[t];return defined(r)||addRegularGridIndices(e,t,r=e*t<CesiumMath.SIXTY_FOUR_KILOBYTES?i[t]=new Uint16Array((e-1)*(t-1)*6):i[t]=new Uint32Array((e-1)*(t-1)*6),0),r};var regularGridAndEdgeIndicesCache=[];TerrainProvider.getRegularGridIndicesAndEdgeIndices=function(e,t){var i=regularGridAndEdgeIndicesCache[e];defined(i)||(regularGridAndEdgeIndicesCache[e]=i=[]);var r,n,a,o,s=i[t];return defined(s)||(r=TerrainProvider.getRegularGridIndices(e,t),n=(o=getEdgeIndices(e,t)).westIndicesSouthToNorth,a=o.southIndicesEastToWest,e=o.eastIndicesNorthToSouth,o=o.northIndicesWestToEast,s=i[t]={indices:r,westIndicesSouthToNorth:n,southIndicesEastToWest:a,eastIndicesNorthToSouth:e,northIndicesWestToEast:o}),s};var regularGridAndSkirtAndEdgeIndicesCache=[];function getEdgeIndices(e,t){for(var i=new Array(t),r=new Array(e),n=new Array(t),a=new Array(e),o=0;o<e;++o)r[a[o]=o]=e*t-1-o;for(o=0;o<t;++o)n[o]=(o+1)*e-1,i[o]=(t-o-1)*e;return{westIndicesSouthToNorth:i,southIndicesEastToWest:r,eastIndicesNorthToSouth:n,northIndicesWestToEast:a}}function addRegularGridIndices(e,t,i,r){for(var n=0,a=0;a<t-1;++a){for(var o=0;o<e-1;++o){var s=n+e,l=s+1,c=n+1;i[r++]=n,i[r++]=s,i[r++]=c,i[r++]=c,i[r++]=s,i[r++]=l,++n}++n}}function addSkirtIndices(e,t,i,r){for(var n=e[0],a=e.length,o=1;o<a;++o){var s=e[o];i[r++]=n,i[r++]=s,i[r++]=t,i[r++]=t,i[r++]=s,i[r++]=t+1,n=s,++t}return r}function HeightmapTerrainData(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=defaultValue(e.childTileMask,15),this._encoding=defaultValue(e.encoding,HeightmapEncoding$1.NONE);var t=HeightmapTessellator.DEFAULT_STRUCTURE,i=e.structure;defined(i)?i!==t&&(i.heightScale=defaultValue(i.heightScale,t.heightScale),i.heightOffset=defaultValue(i.heightOffset,t.heightOffset),i.elementsPerHeight=defaultValue(i.elementsPerHeight,t.elementsPerHeight),i.stride=defaultValue(i.stride,t.stride),i.elementMultiplier=defaultValue(i.elementMultiplier,t.elementMultiplier),i.isBigEndian=defaultValue(i.isBigEndian,t.isBigEndian)):i=t,this._structure=i,this._createdByUpsampling=defaultValue(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===HeightmapEncoding$1.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){var i=regularGridAndSkirtAndEdgeIndicesCache[e];defined(i)||(regularGridAndSkirtAndEdgeIndicesCache[e]=i=[]);var r,n,a,o,s,l,c,u,d=i[t];return defined(d)||(a=(r=e*t)+(l=2*e+2*t),u=(n=(e-1)*(t-1)*6)+6*Math.max(0,l-4),o=(c=getEdgeIndices(e,t)).westIndicesSouthToNorth,s=c.southIndicesEastToWest,l=c.eastIndicesNorthToSouth,c=c.northIndicesWestToEast,addRegularGridIndices(e,t,u=IndexDatatype$1.createTypedArray(a,u),0),TerrainProvider.addSkirtIndices(o,s,l,c,r,u,n),d=i[t]={indices:u,westIndicesSouthToNorth:o,southIndicesEastToWest:s,eastIndicesNorthToSouth:l,northIndicesWestToEast:c,indexCountWithoutSkirts:n}),d},TerrainProvider.addSkirtIndices=function(e,t,i,r,n,a,o){o=addSkirtIndices(e,n,a,o),o=addSkirtIndices(t,n+=e.length,a,o),o=addSkirtIndices(i,n+=t.length,a,o),addSkirtIndices(r,n+=i.length,a,o)},TerrainProvider.heightmapTerrainQuality=.25,TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*TerrainProvider.heightmapTerrainQuality/(t*i)},TerrainProvider.prototype.requestTileGeometry=DeveloperError.throwInstantiationError,TerrainProvider.prototype.getLevelMaximumGeometricError=DeveloperError.throwInstantiationError,TerrainProvider.prototype.getTileDataAvailable=DeveloperError.throwInstantiationError,TerrainProvider.prototype.loadTileDataAvailability=DeveloperError.throwInstantiationError,Object.defineProperties(HeightmapTerrainData.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var createMeshTaskName$2="createVerticesFromHeightmap",createMeshTaskProcessorNoThrottle$2=new TaskProcessor(createMeshTaskName$2),createMeshTaskProcessorThrottle$2=new TaskProcessor(createMeshTaskName$2,TerrainData.maximumAsynchronousTasks);function interpolateHeight$2(e,t,i,r,n,a,o,s,l,c){var u=(l-a.west)*(o-1)/(a.east-a.west),d=(c-a.south)*(s-1)/(a.north-a.south),h=0|u,l=h+1;o<=l&&(l=o-1,h=o-2);c=0|d;s<=(a=c+1)&&(a=s-1,c=s-2);a=s-1-a;return triangleInterpolateHeight(u-h,d-c,getHeight(e,t,i,r,n,(c=s-1-c)*o+h),getHeight(e,t,i,r,n,c*o+l),getHeight(e,t,i,r,n,a*o+h),getHeight(e,t,i,r,n,a*o+l))}function interpolateMeshHeight$2(e,t,i,r,n,a,o,s,l,c){var u=(s-n.west)*(a-1)/(n.east-n.west),d=(l-n.south)*(o-1)/(n.north-n.south),h=0|u,s=h+1;a<=s&&(s=a-1,h=a-2);l=0|d;o<=(n=l+1)&&(n=o-1,l=o-2);n=o-1-n;return triangleInterpolateHeight(u-h,d-l,(t.decodeHeight(e,(l=o-1-l)*a+h)/c-i)/r,(t.decodeHeight(e,l*a+s)/c-i)/r,(t.decodeHeight(e,n*a+h)/c-i)/r,(t.decodeHeight(e,n*a+s)/c-i)/r)}function triangleInterpolateHeight(e,t,i,r,n,a){return t<e?i+e*(r-i)+t*(a-r):i+e*(a-n)+t*(n-i)}function getHeight(e,t,i,r,n,a){a*=r;var o,s=0;if(n)for(o=0;o<t;++o)s=s*i+e[a+o];else for(o=t-1;0<=o;--o)s=s*i+e[a+o];return s}function setHeight(e,t,i,r,n,a,o,s){var l;if(o*=n,a)for(l=0;l<t-1;++l)e[o+l]=s/r|0,s-=e[o+l]*r,r/=i;else for(l=t-1;0<l;--l)e[o+l]=s/r|0,s-=e[o+l]*r,r/=i;e[o+l]=s}function TileAvailability(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}HeightmapTerrainData.prototype.createMesh=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).tilingScheme,i=e.x,r=e.y,n=e.level,a=defaultValue(e.exaggeration,1),o=defaultValue(e.throttle,!0),s=t.ellipsoid,l=t.tileXYToNativeRectangle(i,r,n),e=t.tileXYToRectangle(i,r,n),c=s.cartographicToCartesian(Rectangle.center(e)),i=this._structure,r=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(s,this._width,t.getNumberOfXTilesAtLevel(0));this._skirtHeight=Math.min(4*(r/(1<<n)),1e3);t=(o?createMeshTaskProcessorThrottle$2:createMeshTaskProcessorNoThrottle$2).scheduleTask({heightmap:this._buffer,structure:i,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:e,relativeToCenter:c,ellipsoid:s,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof GeographicProjection,exaggeration:a,encoding:this._encoding});if(defined(t)){var u=this;return when(t,function(e){var t=0<u._skirtHeight?TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices(e.gridWidth,e.gridHeight):TerrainProvider.getRegularGridIndicesAndEdgeIndices(e.gridWidth,e.gridHeight),i=e.gridWidth*e.gridHeight;return u._mesh=new TerrainMesh(c,new Float32Array(e.vertices),t.indices,t.indexCountWithoutSkirts,i,e.minimumHeight,e.maximumHeight,BoundingSphere.clone(e.boundingSphere3D),Cartesian3.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,OrientedBoundingBox.clone(e.orientedBoundingBox),TerrainEncoding.clone(e.encoding),a,t.westIndicesSouthToNorth,t.southIndicesEastToWest,t.eastIndicesNorthToSouth,t.northIndicesWestToEast),u._buffer=void 0,u._mesh})}},HeightmapTerrainData.prototype._createMeshSync=function(e){var t=e.tilingScheme,i=e.x,r=e.y,n=e.level,a=defaultValue(e.exaggeration,1),o=t.ellipsoid,s=t.tileXYToNativeRectangle(i,r,n),l=t.tileXYToRectangle(i,r,n),e=o.cartographicToCartesian(Rectangle.center(l)),i=this._structure,r=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(o,this._width,t.getNumberOfXTilesAtLevel(0));this._skirtHeight=Math.min(4*(r/(1<<n)),1e3);l=HeightmapTessellator.computeVertices({heightmap:this._buffer,structure:i,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:s,rectangle:l,relativeToCenter:e,ellipsoid:o,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof GeographicProjection,exaggeration:a});this._buffer=void 0;o=0<this._skirtHeight?TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):TerrainProvider.getRegularGridIndicesAndEdgeIndices(this._width,this._height),t=l.gridWidth*l.gridHeight;return new TerrainMesh(e,l.vertices,o.indices,o.indexCountWithoutSkirts,t,l.minimumHeight,l.maximumHeight,l.boundingSphere3D,l.occludeePointInScaledSpace,l.encoding.getStride(),l.orientedBoundingBox,l.encoding,a,o.westIndicesSouthToNorth,o.southIndicesEastToWest,o.eastIndicesNorthToSouth,o.northIndicesWestToEast)},HeightmapTerrainData.prototype.interpolateHeight=function(e,t,i){var r=this._width,n=this._height,a=this._structure,o=a.stride,s=a.elementsPerHeight,l=a.elementMultiplier,c=a.isBigEndian,u=a.heightOffset,d=a.heightScale,h=defined(this._mesh),a=this._encoding===HeightmapEncoding$1.LERC,a=!h&&a;if(!a)return h?interpolateMeshHeight$2(this._mesh.vertices,this._mesh.encoding,u,d,e,r,n,t,i,this._mesh.exaggeration):interpolateHeight$2(this._buffer,s,l,o,c,e,r,n,t,i)*d+u},HeightmapTerrainData.prototype.upsample=function(e,t,i,r,n,a,o){var s=this._mesh;if(defined(s)){for(var l=this._width,c=this._height,u=this._structure,d=u.stride,h=new this._bufferType(l*c*d),p=s.vertices,m=s.encoding,f=e.tileXYToRectangle(t,i,r),g=e.tileXYToRectangle(n,a,o),_=u.heightOffset,y=u.heightScale,C=s.exaggeration,v=u.elementsPerHeight,S=u.elementMultiplier,T=u.isBigEndian,x=Math.pow(S,v-1),b=0;b<c;++b)for(var E=CesiumMath.lerp(g.north,g.south,b/(c-1)),P=0;P<l;++P){var A=interpolateMeshHeight$2(p,m,_,y,f,l,c,CesiumMath.lerp(g.west,g.east,P/(l-1)),E,C);setHeight(h,v,S,x,d,T,b*l+P,A=(A=A<u.lowestEncodedHeight?u.lowestEncodedHeight:A)>u.highestEncodedHeight?u.highestEncodedHeight:A)}return new HeightmapTerrainData({buffer:h,width:l,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},HeightmapTerrainData.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},HeightmapTerrainData.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var rectangleScratch$6=new Rectangle;function findNode$1(e,t,i,r){for(var n=r.length,a=0;a<n;++a){var o=r[a];if(o.x===t&&o.y===i&&o.level===e)return 1}}TileAvailability.prototype.addAvailableTileRange=function(e,t,i,r,n){var a=this._tilingScheme,o=this._rootNodes;if(0===e)for(var s=i;s<=n;++s)for(var l=t;l<=r;++l)findNode$1(e,l,s,o)||o.push(new QuadtreeNode(a,void 0,0,l,s));a.tileXYToRectangle(t,i,e,rectangleScratch$6);var c=rectangleScratch$6.west,u=rectangleScratch$6.north;a.tileXYToRectangle(r,n,e,rectangleScratch$6);for(var i=rectangleScratch$6.east,d=new RectangleWithLevel(e,c,rectangleScratch$6.south,i,u),h=0;h<o.length;++h){var p=o[h];rectanglesOverlap(p.extent,d)&&putRectangleInQuadtree(this._maximumLevel,p,d)}},TileAvailability.prototype.computeMaximumLevelAtPosition=function(e){for(var t,i=0;i<this._rootNodes.length;++i){var r=this._rootNodes[i];if(rectangleContainsPosition(r.extent,e)){t=r;break}}return defined(t)?findMaxLevelFromNode(void 0,t,e):-1};var rectanglesScratch=[],remainingToCoverByLevelScratch=[],westScratch$1=new Rectangle,eastScratch=new Rectangle;TileAvailability.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=rectanglesScratch;t.length=0,e.east<e.west?(t.push(Rectangle.fromRadians(-Math.PI,e.south,e.east,e.north,westScratch$1)),t.push(Rectangle.fromRadians(e.west,e.south,Math.PI,e.north,eastScratch))):t.push(e);for(var i=remainingToCoverByLevelScratch,r=i.length=0;r<this._rootNodes.length;++r)updateCoverageWithNode(i,this._rootNodes[r],t);for(r=i.length-1;0<=r;--r)if(defined(i[r])&&0===i[r].length)return r;return 0};var cartographicScratch$4=new Cartographic;function QuadtreeNode(e,t,i,r,n){this.tilingScheme=e,this.parent=t,this.level=i,this.x=r,this.y=n,this.extent=e.tileXYToRectangle(r,n,i),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function RectangleWithLevel(e,t,i,r,n){this.level=e,this.west=t,this.south=i,this.east=r,this.north=n}function rectanglesOverlap(e,t){var i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),n=Math.min(e.east,t.east);return r<Math.min(e.north,t.north)&&i<n}function putRectangleInQuadtree(e,t,i){for(;t.level<e;)if(rectangleFullyContainsRectangle(t.nw.extent,i))t=t.nw;else if(rectangleFullyContainsRectangle(t.ne.extent,i))t=t.ne;else if(rectangleFullyContainsRectangle(t.sw.extent,i))t=t.sw;else{if(!rectangleFullyContainsRectangle(t.se.extent,i))break;t=t.se}var r;0===t.rectangles.length||t.rectangles[t.rectangles.length-1].level<=i.level?t.rectangles.push(i):(r=binarySearch(t.rectangles,i.level,rectangleLevelComparator),t.rectangles.splice(r=r<0?~r:r,0,i))}function rectangleLevelComparator(e,t){return e.level-t}function rectangleFullyContainsRectangle(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function rectangleContainsPosition(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function findMaxLevelFromNode(e,t,i){for(var r=0,n=!1;!n;){var a=t._nw&&rectangleContainsPosition(t._nw.extent,i),o=t._ne&&rectangleContainsPosition(t._ne.extent,i),s=t._sw&&rectangleContainsPosition(t._sw.extent,i),l=t._se&&rectangleContainsPosition(t._se.extent,i);if(1<a+o+s+l){a&&(r=Math.max(r,findMaxLevelFromNode(t,t._nw,i))),o&&(r=Math.max(r,findMaxLevelFromNode(t,t._ne,i))),s&&(r=Math.max(r,findMaxLevelFromNode(t,t._sw,i))),l&&(r=Math.max(r,findMaxLevelFromNode(t,t._se,i)));break}a?t=t._nw:o?t=t._ne:s?t=t._sw:l?t=t._se:n=!0}for(;t!==e;){for(var c=t.rectangles,u=c.length-1;0<=u&&c[u].level>r;--u){var d=c[u];rectangleContainsPosition(d,i)&&(r=d.level)}t=t.parent}return r}function updateCoverageWithNode(e,t,i){if(t){var r=!1;for(a=0;a<i.length;++a)r=r||rectanglesOverlap(t.extent,i[a]);if(r){for(var n=t.rectangles,a=0;a<n.length;++a){var o=n[a];e[o.level]||(e[o.level]=i),e[o.level]=subtractRectangle(e[o.level],o)}updateCoverageWithNode(e,t._nw,i),updateCoverageWithNode(e,t._ne,i),updateCoverageWithNode(e,t._sw,i),updateCoverageWithNode(e,t._se,i)}}}function subtractRectangle(e,t){for(var i=[],r=0;r<e.length;++r){var n=e[r];rectanglesOverlap(n,t)?(n.west<t.west&&i.push(new Rectangle(n.west,n.south,t.west,n.north)),n.east>t.east&&i.push(new Rectangle(t.east,n.south,n.east,n.north)),n.south<t.south&&i.push(new Rectangle(Math.max(t.west,n.west),n.south,Math.min(t.east,n.east),t.south)),n.north>t.north&&i.push(new Rectangle(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):i.push(n)}return i}function formatError(e){var t=e.name,i=e.message,i=defined(t)&&defined(i)?t+": "+i:e.toString(),e=e.stack;return defined(e)&&(i+="\n"+e),i}function TileProviderError(e,t,i,r,n,a,o){this.provider=e,this.message=t,this.x=i,this.y=r,this.level=n,this.timesRetried=defaultValue(a,0),this.retry=!1,this.error=o}function WebMercatorTilingScheme(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._numberOfLevelZeroTilesX=defaultValue(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=defaultValue(e.numberOfLevelZeroTilesY,1),this._projection=new WebMercatorProjection(this._ellipsoid),defined(e.rectangleSouthwestInMeters)&&defined(e.rectangleNortheastInMeters)?(this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters):(t=this._ellipsoid.maximumRadius*Math.PI,this._rectangleSouthwestInMeters=new Cartesian2(-t,-t),this._rectangleNortheastInMeters=new Cartesian2(t,t));var e=this._projection.unproject(this._rectangleSouthwestInMeters),t=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Rectangle(e.longitude,e.latitude,t.longitude,t.latitude)}TileAvailability.prototype.isTileAvailable=function(e,t,i){i=this._tilingScheme.tileXYToRectangle(t,i,e,rectangleScratch$6);return Rectangle.center(i,cartographicScratch$4),this.computeMaximumLevelAtPosition(cartographicScratch$4)>=e},TileAvailability.prototype.computeChildMaskForTile=function(e,t,i){var r=e+1;if(r>=this._maximumLevel)return 0;e=0;return e|=this.isTileAvailable(r,2*t,2*i+1)?1:0,e|=this.isTileAvailable(r,2*t+1,2*i+1)?2:0,e|=this.isTileAvailable(r,2*t,2*i)?4:0,e|=this.isTileAvailable(r,2*t+1,2*i)?8:0},Object.defineProperties(QuadtreeNode.prototype,{nw:{get:function(){return this._nw||(this._nw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),TileProviderError.handleError=function(e,t,i,r,n,a,o,s,l){var c=e;return defined(e)?(c.provider=t,c.message=r,c.x=n,c.y=a,c.level=o,c.retry=!1,c.error=l,++c.timesRetried):c=new TileProviderError(t,r,n,a,o,0,l),0<i.numberOfListeners?i.raiseEvent(c):console.log('An error occurred in "'+t.constructor.name+'": '+formatError(r)),c.retry&&defined(s)&&s(),c},TileProviderError.handleSuccess=function(e){defined(e)&&(e.timesRetried=-1)},Object.defineProperties(WebMercatorTilingScheme.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),WebMercatorTilingScheme.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},WebMercatorTilingScheme.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},WebMercatorTilingScheme.prototype.rectangleToNativeRectangle=function(e,t){var i=this._projection,r=i.project(Rectangle.southwest(e)),e=i.project(Rectangle.northeast(e));return defined(t)?(t.west=r.x,t.south=r.y,t.east=e.x,t.north=e.y,t):new Rectangle(r.x,r.y,e.x,e.y)},WebMercatorTilingScheme.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),i=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/n,n=this._rectangleSouthwestInMeters.x+e*i,e=this._rectangleSouthwestInMeters.x+(e+1)*i,i=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,a=this._rectangleNortheastInMeters.y-t*i,i=this._rectangleNortheastInMeters.y-(t+1)*i;return defined(r)?(r.west=n,r.south=i,r.east=e,r.north=a,r):new Rectangle(n,i,e,a)},WebMercatorTilingScheme.prototype.tileXYToRectangle=function(e,t,i,r){t=this.tileXYToNativeRectangle(e,t,i,r),i=this._projection,r=i.unproject(new Cartesian2(t.west,t.south)),i=i.unproject(new Cartesian2(t.east,t.north));return t.west=r.longitude,t.south=r.latitude,t.east=i.longitude,t.north=i.latitude,t},WebMercatorTilingScheme.prototype.positionToTileXY=function(e,t,i){var r=this._rectangle;if(Rectangle.contains(r,e)){var n=this.getNumberOfXTilesAtLevel(t),a=this.getNumberOfYTilesAtLevel(t),r=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/n,t=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,e=this._projection.project(e),r=(e.x-this._rectangleSouthwestInMeters.x)/r|0;n<=r&&(r=n-1);t=(this._rectangleNortheastInMeters.y-e.y)/t|0;return(a<=t&&(t=a-1),defined(i))?(i.x=r,i.y=t,i):new Cartesian2(r,t)}};var ALL_CHILDREN=15;function ArcGISTiledElevationTerrainProvider(e){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._ready=!1,this._width=void 0,this._height=void 0,this._encoding=void 0;var t=e.token;this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailablityLoaded=void 0,this._availableCache={};var n=this,a=defaultValue(e.ellipsoid,Ellipsoid.WGS84);this._readyPromise=when(e.url).then(function(e){e=Resource.createIfNeeded(e);return e.appendForwardSlash(),defined(t)&&(e=e.getDerivedResource({queryParameters:{token:t}})),(n._resource=e).getDerivedResource({queryParameters:{f:"pjson"}}).fetchJson()}).then(function(e){var t=e.copyrightText;defined(t)&&(n._credit=new Credit(t));var i=e.spatialReference,r=defaultValue(i.latestWkid,i.wkid),t=e.extent,i={ellipsoid:a};if(4326===r)i.rectangle=Rectangle.fromDegrees(t.xmin,t.ymin,t.xmax,t.ymax),n._tilingScheme=new GeographicTilingScheme(i);else{if(3857!==r)return when.reject(new RuntimeError("Invalid spatial reference"));i.rectangleSouthwestInMeters=new Cartesian2(t.xmin,t.ymin),i.rectangleNortheastInMeters=new Cartesian2(t.xmax,t.ymax),n._tilingScheme=new WebMercatorTilingScheme(i)}i=e.tileInfo;return defined(i)?(n._width=i.rows+1,n._height=i.cols+1,n._encoding="LERC"===i.format?HeightmapEncoding$1.LERC:HeightmapEncoding$1.NONE,n._lodCount=i.lods.length-1,(n._hasAvailability=-1!==e.capabilities.indexOf("Tilemap"))&&(n._tilesAvailable=new TileAvailability(n._tilingScheme,n._lodCount),n._tilesAvailable.addAvailableTileRange(0,0,0,n._tilingScheme.getNumberOfXTilesAtLevel(0),n._tilingScheme.getNumberOfYTilesAtLevel(0)),n._tilesAvailablityLoaded=new TileAvailability(n._tilingScheme,n._lodCount)),n._levelZeroMaximumGeometricError=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(n._tilingScheme.ellipsoid,n._width,n._tilingScheme.getNumberOfXTilesAtLevel(0)),1<e.bandCount&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),n._terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:e.minValues[0],highestEncodedHeight:e.maxValues[0]},n._ready=!0):when.reject(new RuntimeError("tileInfo is required"))}).otherwise(function(e){var t="An error occurred while accessing "+n._resource.url+".";return TileProviderError.handleError(void 0,n,n._errorEvent,t),when.reject(e)}),this._errorEvent=new Event}function isTileAvailable(e,t,i,r){if(e._hasAvailability){var n=e._tilesAvailablityLoaded,a=e._tilesAvailable;return!(t>e._lodCount)&&(!!a.isTileAvailable(t,i,r)||!n.isTileAvailable(t,i,r)&&void 0)}}function findRange(e,t,i,r){for(var n=t-1,a=i-1,o=r[e.y*t+e.x],s=[],l={startX:e.x,startY:e.y,endX:0,endY:0},c=new Cartesian2(e.x+1,e.y+1),u=!1,d=!1;!u||!d;){var h=c.x,p=d?c.y+1:c.y;if(!u){for(var m=e.y;m<p;++m)if(r[m*t+c.x]!==o){u=!0;break}u?(s.push(new Cartesian2(c.x,e.y)),--c.x,--h,l.endX=c.x):c.x===n?(l.endX=c.x,u=!0):++c.x}if(!d){for(var f=c.y*t,g=e.x;g<=h;++g)if(r[f+g]!==o){d=!0;break}d?(s.push(new Cartesian2(e.x,c.y)),--c.y,l.endY=c.y):c.y===a?(l.endY=c.y,d=!0):++c.y}}return{endingIndices:s,range:l,value:o}}function computeAvailability(e,t,i,r,n){var a=[];if(n.every(function(e){return e===n[0]}))return 1===n[0]&&a.push({startX:e,startY:t,endX:e+i-1,endY:t+r-1}),a;for(var o=[new Cartesian2(0,0)];0<o.length;){var s,l=findRange(o.pop(),i,r,n);1===l.value&&((s=l.range).startX+=e,s.endX+=e,s.startY+=t,s.endY+=t,a.push(s));l=l.endingIndices;0<l.length&&(o=o.concat(l))}return a}function requestAvailability(a,o,s,l){if(!a._hasAvailability)return{};var c=128*Math.floor(s/128),u=128*Math.floor(l/128),d=Math.min(1<<o,128),t="tilemap/"+o+"/"+u+"/"+c+"/"+d+"/"+d,i=a._availableCache;if(defined(i[t]))return i[t];var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.TERRAIN}),r=a._resource.getDerivedResource({url:t,request:e}).fetchJson();return defined(r)?(r=r.then(function(e){var t=computeAvailability(c,u,d,d,e.data);a._tilesAvailablityLoaded.addAvailableTileRange(o,c,u,c+d,u+d);for(var i=a._tilesAvailable,r=0;r<t.length;++r){var n=t[r];i.addAvailableTileRange(o,n.startX,n.startY,n.endX,n.endY)}return isTileAvailable(a,o,s,l)}),i[t]={promise:r,request:e},{promise:r=r.always(function(e){return delete i[t],e}),request:e}):{}}Object.defineProperties(ArcGISTiledElevationTerrainProvider.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}}),ArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry=function(t,i,r,n){var e,a,o=this._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n}),s=this._hasAvailability,l=when.resolve(!0);s&&!defined(isTileAvailable(this,r+1,2*t,2*i))&&(l=(e=requestAvailability(this,r+1,2*t,2*i)).promise,a=e.request);o=o.fetchArrayBuffer();if(defined(o)&&defined(l)){var c=this,u=this._tilesAvailable;return when.join(o,l).then(function(e){return new HeightmapTerrainData({buffer:e[0],width:c._width,height:c._height,childTileMask:s?u.computeChildMaskForTile(r,t,i):ALL_CHILDREN,structure:c._terrainDataStructure,encoding:c._encoding})}).otherwise(function(e){return defined(a)&&a.state===RequestState$1.CANCELLED?(n.cancel(),n.deferred.promise.always(function(){return n.state=RequestState$1.CANCELLED,when.reject(e)})):when.reject(e)})}},ArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){if(this._hasAvailability){var r=isTileAvailable(this,i,e,t);if(defined(r))return r;requestAvailability(this,i,e,t)}},ArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){};var ArcType={NONE:0,GEODESIC:1,RHUMB:2},ArcType$1=Object.freeze(ArcType);function arrayFill(e,t,i,r){if("function"==typeof e.fill)return e.fill(t,i,r);for(var n=e.length>>>0,i=defaultValue(i,0),a=i<0?Math.max(n+i,0):Math.min(i,n),r=defaultValue(r,n),o=r<0?Math.max(n+r,0):Math.min(r,n);a<o;)e[a]=t,a++;return e}var removeDuplicatesEpsilon=CesiumMath.EPSILON10;function arrayRemoveDuplicates(e,t,i){if(defined(e)){i=defaultValue(i,!1);var r,n,a,o=e.length;if(o<2)return e;for(r=1;r<o&&!t(n=e[r-1],a=e[r],removeDuplicatesEpsilon);++r);if(r===o)return i&&t(e[0],e[e.length-1],removeDuplicatesEpsilon)?e.slice(1):e;for(var s=e.slice(0,r);r<o;++r)t(n,a=e[r],removeDuplicatesEpsilon)||(s.push(a),n=a);return i&&1<s.length&&t(s[0],s[s.length-1],removeDuplicatesEpsilon)&&s.shift(),s}}function arraySlice(e,t,i){if("function"==typeof e.slice)return e.slice(t,i);for(var r=Array.prototype.slice.call(e,t,i),n=FeatureDetection.typedArrayTypes,a=n.length,o=0;o<a;++o)if(e instanceof n[o]){r=new n[o](r);break}return r}function AssociativeArray(){this._array=[],this._hash={}}Object.defineProperties(AssociativeArray.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),AssociativeArray.prototype.contains=function(e){return defined(this._hash[e])},AssociativeArray.prototype.set=function(e,t){t!==this._hash[e]&&(this.remove(e),this._hash[e]=t,this._array.push(t))},AssociativeArray.prototype.get=function(e){return this._hash[e]},AssociativeArray.prototype.remove=function(e){var t,i=this._hash[e],r=defined(i);return r&&((t=this._array).splice(t.indexOf(i),1),delete this._hash[e]),r},AssociativeArray.prototype.removeAll=function(){var e=this._array;0<e.length&&(this._hash={},e.length=0)};var scratchCartesian1$7=new Cartesian3,scratchCartesian2$a=new Cartesian3,scratchCartesian3$b=new Cartesian3;function barycentricCoordinates(e,t,i,r,n){var a,o,s,l,c,u,d;if(defined(n)||(n=new Cartesian3),defined(t.z)){if(Cartesian3.equalsEpsilon(e,t,CesiumMath.EPSILON14))return Cartesian3.clone(Cartesian3.UNIT_X,n);if(Cartesian3.equalsEpsilon(e,i,CesiumMath.EPSILON14))return Cartesian3.clone(Cartesian3.UNIT_Y,n);if(Cartesian3.equalsEpsilon(e,r,CesiumMath.EPSILON14))return Cartesian3.clone(Cartesian3.UNIT_Z,n);a=Cartesian3.subtract(i,t,scratchCartesian1$7),o=Cartesian3.subtract(r,t,scratchCartesian2$a),s=Cartesian3.subtract(e,t,scratchCartesian3$b),l=Cartesian3.dot(a,a),h=Cartesian3.dot(a,o),c=Cartesian3.dot(a,s),u=Cartesian3.dot(o,o),d=Cartesian3.dot(o,s)}else{if(Cartesian2.equalsEpsilon(e,t,CesiumMath.EPSILON14))return Cartesian3.clone(Cartesian3.UNIT_X,n);if(Cartesian2.equalsEpsilon(e,i,CesiumMath.EPSILON14))return Cartesian3.clone(Cartesian3.UNIT_Y,n);if(Cartesian2.equalsEpsilon(e,r,CesiumMath.EPSILON14))return Cartesian3.clone(Cartesian3.UNIT_Z,n);a=Cartesian2.subtract(i,t,scratchCartesian1$7),o=Cartesian2.subtract(r,t,scratchCartesian2$a),s=Cartesian2.subtract(e,t,scratchCartesian3$b),l=Cartesian2.dot(a,a),h=Cartesian2.dot(a,o),c=Cartesian2.dot(a,s),u=Cartesian2.dot(o,o),d=Cartesian2.dot(o,s)}n.y=u*c-h*d,n.z=l*d-h*c;var h=l*u-h*h;return 0!==n.y&&(n.y/=h),0!==n.z&&(n.z/=h),n.x=1-n.y-n.z,n}var url="https://dev.virtualearth.net/REST/v1/Locations";function BingMapsGeocoderService(e){e=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).key;this._key=e,this._resource=new Resource({url:url,queryParameters:{key:e}})}function BoundingRectangle(e,t,i,r){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.width=defaultValue(i,0),this.height=defaultValue(r,0)}Object.defineProperties(BingMapsGeocoderService.prototype,{url:{get:function(){return url}},key:{get:function(){return this._key}}}),BingMapsGeocoderService.prototype.geocode=function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(e){return 0===e.resourceSets.length?[]:e.resourceSets[0].resources.map(function(e){var t=e.bbox,i=t[0],r=t[1],n=t[2],t=t[3];return{displayName:e.name,destination:Rectangle.fromDegrees(r,i,t,n)}})})},BoundingRectangle.packedLength=4,BoundingRectangle.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.width,t[i]=e.height,t},BoundingRectangle.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new BoundingRectangle:i).x=e[t++],i.y=e[t++],i.width=e[t++],i.height=e[t],i},BoundingRectangle.fromPoints=function(e,t){if(defined(t)||(t=new BoundingRectangle),!defined(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,r=e[0].x,n=e[0].y,a=e[0].x,o=e[0].y,s=1;s<i;s++)var l=e[s],c=l.x,l=l.y,r=Math.min(c,r),a=Math.max(c,a),n=Math.min(l,n),o=Math.max(l,o);return t.x=r,t.y=n,t.width=a-r,t.height=o-n,t};var defaultProjection=new GeographicProjection,fromRectangleLowerLeft=new Cartographic,fromRectangleUpperRight=new Cartographic;BoundingRectangle.fromRectangle=function(e,t,i){if(defined(i)||(i=new BoundingRectangle),!defined(e))return i.x=0,i.y=0,i.width=0,i.height=0,i;var r=(t=defaultValue(t,defaultProjection)).project(Rectangle.southwest(e,fromRectangleLowerLeft)),e=t.project(Rectangle.northeast(e,fromRectangleUpperRight));return Cartesian2.subtract(e,r,e),i.x=r.x,i.y=r.y,i.width=e.x,i.height=e.y,i},BoundingRectangle.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new BoundingRectangle(e.x,e.y,e.width,e.height)},BoundingRectangle.union=function(e,t,i){defined(i)||(i=new BoundingRectangle);var r=Math.min(e.x,t.x),n=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),t=Math.max(e.y+e.height,t.y+t.height);return i.x=r,i.y=n,i.width=a-r,i.height=t-n,i},BoundingRectangle.expand=function(e,t,i){i=BoundingRectangle.clone(e,i);var r=t.x-i.x,e=t.y-i.y;return r>i.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),e>i.height?i.height=e:e<0&&(i.height-=e,i.y=t.y),i},BoundingRectangle.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,a=t.y;return i>n+t.width||i+e.width<n||r+e.height<a||r>a+t.height?Intersect$1.OUTSIDE:Intersect$1.INTERSECTING},BoundingRectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},BoundingRectangle.prototype.clone=function(e){return BoundingRectangle.clone(this,e)},BoundingRectangle.prototype.intersect=function(e){return BoundingRectangle.intersect(this,e)},BoundingRectangle.prototype.equals=function(e){return BoundingRectangle.equals(this,e)};var GeometryType={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},GeometryType$1=Object.freeze(GeometryType);function Matrix2(e,t,i,r){this[0]=defaultValue(e,0),this[1]=defaultValue(i,0),this[2]=defaultValue(t,0),this[3]=defaultValue(r,0)}Matrix2.packedLength=4,Matrix2.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},Matrix2.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Matrix2:i)[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},Matrix2.clone=function(e,t){if(defined(e))return defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Matrix2(e[0],e[2],e[1],e[3])},Matrix2.fromArray=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Matrix2:i)[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},Matrix2.fromColumnMajorArray=function(e,t){return Matrix2.clone(e,t)},Matrix2.fromRowMajorArray=function(e,t){return defined(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Matrix2(e[0],e[1],e[2],e[3])},Matrix2.fromScale=function(e,t){return defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Matrix2(e.x,0,0,e.y)},Matrix2.fromUniformScale=function(e,t){return defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Matrix2(e,0,0,e)},Matrix2.fromRotation=function(e,t){var i=Math.cos(e),e=Math.sin(e);return defined(t)?(t[0]=i,t[1]=e,t[2]=-e,t[3]=i,t):new Matrix2(i,-e,e,i)},Matrix2.toArray=function(e,t){return defined(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]]},Matrix2.getElementIndex=function(e,t){return 2*e+t},Matrix2.getColumn=function(e,t,i){var r=2*t,t=e[r],r=e[1+r];return i.x=t,i.y=r,i},Matrix2.setColumn=function(e,t,i,r){t*=2;return(r=Matrix2.clone(e,r))[t]=i.x,r[1+t]=i.y,r},Matrix2.getRow=function(e,t,i){var r=e[t],t=e[t+2];return i.x=r,i.y=t,i},Matrix2.setRow=function(e,t,i,r){return(r=Matrix2.clone(e,r))[t]=i.x,r[t+2]=i.y,r};var scratchColumn=new Cartesian2;Matrix2.getScale=function(e,t){return t.x=Cartesian2.magnitude(Cartesian2.fromElements(e[0],e[1],scratchColumn)),t.y=Cartesian2.magnitude(Cartesian2.fromElements(e[2],e[3],scratchColumn)),t};var scratchScale$4=new Cartesian2;Matrix2.getMaximumScale=function(e){return Matrix2.getScale(e,scratchScale$4),Cartesian2.maximumComponent(scratchScale$4)},Matrix2.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],t=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=a,i[2]=n,i[3]=t,i},Matrix2.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},Matrix2.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},Matrix2.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,t=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=t,i},Matrix2.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},Matrix2.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},Matrix2.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},Matrix2.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],e=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=e,t},Matrix2.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},Matrix2.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},Matrix2.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},Matrix2.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},Matrix2.IDENTITY=Object.freeze(new Matrix2(1,0,0,1)),Matrix2.ZERO=Object.freeze(new Matrix2(0,0,0,0)),Matrix2.COLUMN0ROW0=0,Matrix2.COLUMN0ROW1=1,Matrix2.COLUMN1ROW0=2,Matrix2.COLUMN1ROW1=3,Object.defineProperties(Matrix2.prototype,{length:{get:function(){return Matrix2.packedLength}}}),Matrix2.prototype.clone=function(e){return Matrix2.clone(this,e)},Matrix2.prototype.equals=function(e){return Matrix2.equals(this,e)},Matrix2.prototype.equalsEpsilon=function(e,t){return Matrix2.equalsEpsilon(this,e,t)},Matrix2.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"};var PrimitiveType={POINTS:WebGLConstants$1.POINTS,LINES:WebGLConstants$1.LINES,LINE_LOOP:WebGLConstants$1.LINE_LOOP,LINE_STRIP:WebGLConstants$1.LINE_STRIP,TRIANGLES:WebGLConstants$1.TRIANGLES,TRIANGLE_STRIP:WebGLConstants$1.TRIANGLE_STRIP,TRIANGLE_FAN:WebGLConstants$1.TRIANGLE_FAN,validate:function(e){return e===PrimitiveType.POINTS||e===PrimitiveType.LINES||e===PrimitiveType.LINE_LOOP||e===PrimitiveType.LINE_STRIP||e===PrimitiveType.TRIANGLES||e===PrimitiveType.TRIANGLE_STRIP||e===PrimitiveType.TRIANGLE_FAN}},PrimitiveType$1=Object.freeze(PrimitiveType);function Geometry(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=defaultValue(e.primitiveType,PrimitiveType$1.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=defaultValue(e.geometryType,GeometryType$1.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}Geometry.computeNumberOfVertices=function(e){var t,i,r=-1;for(t in e.attributes)e.attributes.hasOwnProperty(t)&&defined(e.attributes[t])&&defined(e.attributes[t].values)&&(r=(i=e.attributes[t]).values.length/i.componentsPerAttribute);return r};var rectangleCenterScratch$3=new Cartographic,enuCenterScratch=new Cartesian3,fixedFrameToEnuScratch=new Matrix4,boundingRectanglePointsCartographicScratch=[new Cartographic,new Cartographic,new Cartographic],boundingRectanglePointsEnuScratch=[new Cartesian2,new Cartesian2,new Cartesian2],points2DScratch$2=[new Cartesian2,new Cartesian2,new Cartesian2],pointEnuScratch=new Cartesian3,enuRotationScratch=new Quaternion,enuRotationMatrixScratch=new Matrix4,rotation2DScratch$1=new Matrix2;function GeometryAttribute(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=defaultValue(e.normalize,!1),this.values=e.values}function GeometryAttributes(e){e=defaultValue(e,defaultValue.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}Geometry._textureCoordinateRotationPoints=function(e,t,i,r){var n=Rectangle.center(r,rectangleCenterScratch$3),a=Cartographic.toCartesian(n,i,enuCenterScratch),n=Transforms.eastNorthUpToFixedFrame(a,i,fixedFrameToEnuScratch),o=Matrix4.inverse(n,fixedFrameToEnuScratch),s=boundingRectanglePointsEnuScratch,l=boundingRectanglePointsCartographicScratch;l[0].longitude=r.west,l[0].latitude=r.south,l[1].longitude=r.west,l[1].latitude=r.north,l[2].longitude=r.east,l[2].latitude=r.south;for(var c=pointEnuScratch,u=0;u<3;u++)Cartographic.toCartesian(l[u],i,c),c=Matrix4.multiplyByPointAsVector(o,c,c),s[u].x=c.x,s[u].y=c.y;var a=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,-t,enuRotationScratch),d=Matrix3.fromQuaternion(a,enuRotationMatrixScratch),h=e.length,p=Number.POSITIVE_INFINITY,m=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,g=Number.NEGATIVE_INFINITY;for(u=0;u<h;u++)c=Matrix4.multiplyByPointAsVector(o,e[u],c),c=Matrix3.multiplyByVector(d,c,c),p=Math.min(p,c.x),m=Math.min(m,c.y),f=Math.max(f,c.x),g=Math.max(g,c.y);var _=Matrix2.fromRotation(t,rotation2DScratch$1),y=points2DScratch$2;y[0].x=p,y[0].y=m,y[1].x=p,y[1].y=g,y[2].x=f,y[2].y=m;var C=s[0],v=s[2].x-C.x,S=s[1].y-C.y;for(u=0;u<3;u++){var T=y[u];Matrix2.multiplyByVector(_,T,T),T.x=(T.x-C.x)/v,T.y=(T.y-C.y)/S}n=y[0],r=y[1],a=y[2],t=new Array(6);return Cartesian2.pack(n,t),Cartesian2.pack(r,t,2),Cartesian2.pack(a,t,4),t};var GeometryOffsetAttribute={NONE:0,TOP:1,ALL:2},GeometryOffsetAttribute$1=Object.freeze(GeometryOffsetAttribute);function VertexFormat(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.position=defaultValue(e.position,!1),this.normal=defaultValue(e.normal,!1),this.st=defaultValue(e.st,!1),this.bitangent=defaultValue(e.bitangent,!1),this.tangent=defaultValue(e.tangent,!1),this.color=defaultValue(e.color,!1)}VertexFormat.POSITION_ONLY=Object.freeze(new VertexFormat({position:!0})),VertexFormat.POSITION_AND_NORMAL=Object.freeze(new VertexFormat({position:!0,normal:!0})),VertexFormat.POSITION_NORMAL_AND_ST=Object.freeze(new VertexFormat({position:!0,normal:!0,st:!0})),VertexFormat.POSITION_AND_ST=Object.freeze(new VertexFormat({position:!0,st:!0})),VertexFormat.POSITION_AND_COLOR=Object.freeze(new VertexFormat({position:!0,color:!0})),VertexFormat.ALL=Object.freeze(new VertexFormat({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),VertexFormat.DEFAULT=VertexFormat.POSITION_NORMAL_AND_ST,VertexFormat.packedLength=6,VertexFormat.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.position?1:0,t[i++]=e.normal?1:0,t[i++]=e.st?1:0,t[i++]=e.tangent?1:0,t[i++]=e.bitangent?1:0,t[i]=e.color?1:0,t},VertexFormat.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new VertexFormat:i).position=1===e[t++],i.normal=1===e[t++],i.st=1===e[t++],i.tangent=1===e[t++],i.bitangent=1===e[t++],i.color=1===e[t],i},VertexFormat.clone=function(e,t){if(defined(e))return(t=!defined(t)?new VertexFormat: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 diffScratch$1=new Cartesian3;function BoxGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).minimum,i=e.maximum,r=defaultValue(e.vertexFormat,VertexFormat.DEFAULT);this._minimum=Cartesian3.clone(t),this._maximum=Cartesian3.clone(i),this._vertexFormat=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}BoxGeometry.fromDimensions=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).dimensions,t=Cartesian3.multiplyByScalar(t,.5,new Cartesian3);return new BoxGeometry({minimum:Cartesian3.negate(t,new Cartesian3),maximum:t,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})},BoxGeometry.fromAxisAlignedBoundingBox=function(e){return new BoxGeometry({minimum:e.minimum,maximum:e.maximum})},BoxGeometry.packedLength=2*Cartesian3.packedLength+VertexFormat.packedLength+1,BoxGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._minimum,t,i),Cartesian3.pack(e._maximum,t,i+Cartesian3.packedLength),VertexFormat.pack(e._vertexFormat,t,i+2*Cartesian3.packedLength),t[i+2*Cartesian3.packedLength+VertexFormat.packedLength]=defaultValue(e._offsetAttribute,-1),t};var scratchMin$3=new Cartesian3,scratchMax$3=new Cartesian3,scratchVertexFormat$c=new VertexFormat,scratchOptions$n={minimum:scratchMin$3,maximum:scratchMax$3,vertexFormat:scratchVertexFormat$c,offsetAttribute:void 0},unitBoxGeometry;BoxGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchMin$3),n=Cartesian3.unpack(e,t+Cartesian3.packedLength,scratchMax$3),a=VertexFormat.unpack(e,t+2*Cartesian3.packedLength,scratchVertexFormat$c),t=e[t+2*Cartesian3.packedLength+VertexFormat.packedLength];return defined(i)?(i._minimum=Cartesian3.clone(r,i._minimum),i._maximum=Cartesian3.clone(n,i._maximum),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$n.offsetAttribute=-1===t?void 0:t,new BoxGeometry(scratchOptions$n))},BoxGeometry.createGeometry=function(e){var t=e._minimum,i=e._maximum,r=e._vertexFormat;if(!Cartesian3.equals(t,i)){var n,a,o,s=new GeometryAttributes;r.position&&(r.st||r.normal||r.tangent||r.bitangent)?(r.position&&((l=new Float64Array(72))[0]=t.x,l[1]=t.y,l[2]=i.z,l[3]=i.x,l[4]=t.y,l[5]=i.z,l[6]=i.x,l[7]=i.y,l[8]=i.z,l[9]=t.x,l[10]=i.y,l[11]=i.z,l[12]=t.x,l[13]=t.y,l[14]=t.z,l[15]=i.x,l[16]=t.y,l[17]=t.z,l[18]=i.x,l[19]=i.y,l[20]=t.z,l[21]=t.x,l[22]=i.y,l[23]=t.z,l[24]=i.x,l[25]=t.y,l[26]=t.z,l[27]=i.x,l[28]=i.y,l[29]=t.z,l[30]=i.x,l[31]=i.y,l[32]=i.z,l[33]=i.x,l[34]=t.y,l[35]=i.z,l[36]=t.x,l[37]=t.y,l[38]=t.z,l[39]=t.x,l[40]=i.y,l[41]=t.z,l[42]=t.x,l[43]=i.y,l[44]=i.z,l[45]=t.x,l[46]=t.y,l[47]=i.z,l[48]=t.x,l[49]=i.y,l[50]=t.z,l[51]=i.x,l[52]=i.y,l[53]=t.z,l[54]=i.x,l[55]=i.y,l[56]=i.z,l[57]=t.x,l[58]=i.y,l[59]=i.z,l[60]=t.x,l[61]=t.y,l[62]=t.z,l[63]=i.x,l[64]=t.y,l[65]=t.z,l[66]=i.x,l[67]=t.y,l[68]=i.z,l[69]=t.x,l[70]=t.y,l[71]=i.z,s.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:l})),r.normal&&((n=new Float32Array(72))[0]=0,n[1]=0,n[2]=1,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=1,n[9]=0,n[10]=0,n[11]=1,n[12]=0,n[13]=0,n[14]=-1,n[15]=0,n[16]=0,n[17]=-1,n[18]=0,n[19]=0,n[20]=-1,n[21]=0,n[22]=0,n[23]=-1,n[24]=1,n[25]=0,n[26]=0,n[27]=1,n[28]=0,n[29]=0,n[30]=1,n[31]=0,n[32]=0,n[33]=1,n[34]=0,n[35]=0,n[36]=-1,n[37]=0,n[38]=0,n[39]=-1,n[40]=0,n[41]=0,n[42]=-1,n[43]=0,n[44]=0,n[45]=-1,n[46]=0,n[47]=0,n[48]=0,n[49]=1,n[50]=0,n[51]=0,n[52]=1,n[53]=0,n[54]=0,n[55]=1,n[56]=0,n[57]=0,n[58]=1,n[59]=0,n[60]=0,n[61]=-1,n[62]=0,n[63]=0,n[64]=-1,n[65]=0,n[66]=0,n[67]=-1,n[68]=0,n[69]=0,n[70]=-1,n[71]=0,s.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:n})),r.st&&((a=new Float32Array(48))[0]=0,a[1]=0,a[2]=1,a[3]=0,a[4]=1,a[5]=1,a[6]=0,a[7]=1,a[8]=1,a[9]=0,a[10]=0,a[11]=0,a[12]=0,a[13]=1,a[14]=1,a[15]=1,a[16]=0,a[17]=0,a[18]=1,a[19]=0,a[20]=1,a[21]=1,a[22]=0,a[23]=1,a[24]=1,a[25]=0,a[26]=0,a[27]=0,a[28]=0,a[29]=1,a[30]=1,a[31]=1,a[32]=1,a[33]=0,a[34]=0,a[35]=0,a[36]=0,a[37]=1,a[38]=1,a[39]=1,a[40]=0,a[41]=0,a[42]=1,a[43]=0,a[44]=1,a[45]=1,a[46]=0,a[47]=1,s.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:a})),r.tangent&&((a=new Float32Array(72))[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=0,a[5]=0,a[6]=1,a[7]=0,a[8]=0,a[9]=1,a[10]=0,a[11]=0,a[12]=-1,a[13]=0,a[14]=0,a[15]=-1,a[16]=0,a[17]=0,a[18]=-1,a[19]=0,a[20]=0,a[21]=-1,a[22]=0,a[23]=0,a[24]=0,a[25]=1,a[26]=0,a[27]=0,a[28]=1,a[29]=0,a[30]=0,a[31]=1,a[32]=0,a[33]=0,a[34]=1,a[35]=0,a[36]=0,a[37]=-1,a[38]=0,a[39]=0,a[40]=-1,a[41]=0,a[42]=0,a[43]=-1,a[44]=0,a[45]=0,a[46]=-1,a[47]=0,a[48]=-1,a[49]=0,a[50]=0,a[51]=-1,a[52]=0,a[53]=0,a[54]=-1,a[55]=0,a[56]=0,a[57]=-1,a[58]=0,a[59]=0,a[60]=1,a[61]=0,a[62]=0,a[63]=1,a[64]=0,a[65]=0,a[66]=1,a[67]=0,a[68]=0,a[69]=1,a[70]=0,a[71]=0,s.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:a})),r.bitangent&&((o=new Float32Array(72))[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=1,o[14]=0,o[15]=0,o[16]=1,o[17]=0,o[18]=0,o[19]=1,o[20]=0,o[21]=0,o[22]=1,o[23]=0,o[24]=0,o[25]=0,o[26]=1,o[27]=0,o[28]=0,o[29]=1,o[30]=0,o[31]=0,o[32]=1,o[33]=0,o[34]=0,o[35]=1,o[36]=0,o[37]=0,o[38]=1,o[39]=0,o[40]=0,o[41]=1,o[42]=0,o[43]=0,o[44]=1,o[45]=0,o[46]=0,o[47]=1,o[48]=0,o[49]=0,o[50]=1,o[51]=0,o[52]=0,o[53]=1,o[54]=0,o[55]=0,o[56]=1,o[57]=0,o[58]=0,o[59]=1,o[60]=0,o[61]=0,o[62]=1,o[63]=0,o[64]=0,o[65]=1,o[66]=0,o[67]=0,o[68]=1,o[69]=0,o[70]=0,o[71]=1,s.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:o})),(o=new Uint16Array(36))[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23):((l=new Float64Array(24))[0]=t.x,l[1]=t.y,l[2]=t.z,l[3]=i.x,l[4]=t.y,l[5]=t.z,l[6]=i.x,l[7]=i.y,l[8]=t.z,l[9]=t.x,l[10]=i.y,l[11]=t.z,l[12]=t.x,l[13]=t.y,l[14]=i.z,l[15]=i.x,l[16]=t.y,l[17]=i.z,l[18]=i.x,l[19]=i.y,l[20]=i.z,l[21]=t.x,l[22]=i.y,l[23]=i.z,s.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:l}),(o=new Uint16Array(36))[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4);var l,t=Cartesian3.subtract(i,t,diffScratch$1),t=.5*Cartesian3.magnitude(t);return defined(e._offsetAttribute)&&(l=l.length,arrayFill(l=new Uint8Array(l/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),s.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})),new Geometry({attributes:s,indices:o,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,t),offsetAttribute:e._offsetAttribute})}},BoxGeometry.getUnitBox=function(){return unitBoxGeometry=!defined(unitBoxGeometry)?BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(1,1,1),vertexFormat:VertexFormat.POSITION_ONLY})):unitBoxGeometry};var diffScratch=new Cartesian3;function BoxOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).minimum,i=e.maximum;this._min=Cartesian3.clone(t),this._max=Cartesian3.clone(i),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}BoxOutlineGeometry.fromDimensions=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).dimensions,t=Cartesian3.multiplyByScalar(t,.5,new Cartesian3);return new BoxOutlineGeometry({minimum:Cartesian3.negate(t,new Cartesian3),maximum:t,offsetAttribute:e.offsetAttribute})},BoxOutlineGeometry.fromAxisAlignedBoundingBox=function(e){return new BoxOutlineGeometry({minimum:e.minimum,maximum:e.maximum})},BoxOutlineGeometry.packedLength=2*Cartesian3.packedLength+1,BoxOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._min,t,i),Cartesian3.pack(e._max,t,i+Cartesian3.packedLength),t[i+2*Cartesian3.packedLength]=defaultValue(e._offsetAttribute,-1),t};var scratchMin$2=new Cartesian3,scratchMax$2=new Cartesian3,scratchOptions$m={minimum:scratchMin$2,maximum:scratchMax$2,offsetAttribute:void 0},implementation$1;function cancelAnimationFramePolyfill(e){implementation$1(e)}function CartographicGeocoderService(){}function Spline(){this.times=void 0,this.points=void 0,DeveloperError.throwInstantiationError()}function LinearSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).points,e=e.times;this._times=e,this._points=t,this._lastTimeIndex=0}BoxOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchMin$2),n=Cartesian3.unpack(e,t+Cartesian3.packedLength,scratchMax$2),t=e[t+2*Cartesian3.packedLength];return defined(i)?(i._min=Cartesian3.clone(r,i._min),i._max=Cartesian3.clone(n,i._max),i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$m.offsetAttribute=-1===t?void 0:t,new BoxOutlineGeometry(scratchOptions$m))},BoxOutlineGeometry.createGeometry=function(e){var t=e._min,i=e._max;if(!Cartesian3.equals(t,i)){var r=new GeometryAttributes,n=new Uint16Array(24),a=new Float64Array(24);a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=i.x,a[4]=t.y,a[5]=t.z,a[6]=i.x,a[7]=i.y,a[8]=t.z,a[9]=t.x,a[10]=i.y,a[11]=t.z,a[12]=t.x,a[13]=t.y,a[14]=i.z,a[15]=i.x,a[16]=t.y,a[17]=i.z,a[18]=i.x,a[19]=i.y,a[20]=i.z,a[21]=t.x,a[22]=i.y,a[23]=i.z,r.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a}),n[0]=4,n[1]=5,n[2]=5,n[3]=6,n[4]=6,n[5]=7,n[6]=7,n[7]=4,n[8]=0,n[9]=1,n[10]=1,n[11]=2,n[12]=2,n[13]=3,n[14]=3,n[15]=0,n[16]=0,n[17]=4,n[18]=1,n[19]=5,n[20]=2,n[21]=6,n[22]=3,n[23]=7;t=Cartesian3.subtract(i,t,diffScratch),t=.5*Cartesian3.magnitude(t);return defined(e._offsetAttribute)&&(a=a.length,arrayFill(a=new Uint8Array(a/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),r.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),new Geometry({attributes:r,indices:n,primitiveType:PrimitiveType$1.LINES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,t),offsetAttribute:e._offsetAttribute})}},"undefined"!=typeof cancelAnimationFrame&&(implementation$1=cancelAnimationFrame),function(){if(!defined(implementation$1)&&"undefined"!=typeof window)for(var e=["webkit","moz","ms","o"],t=0,i=e.length;t<i&&!defined(implementation$1);)defined(implementation$1=window[e[t]+"CancelAnimationFrame"])||(implementation$1=window[e[t]+"CancelRequestAnimationFrame"]),++t;defined(implementation$1)||(implementation$1=clearTimeout)}(),CartographicGeocoderService.prototype.geocode=function(e){var t=e.match(/[^\s,\n]+/g);if(2===t.length||3===t.length){var i=+t[0],r=+t[1],n=3===t.length?+t[2]:300;if(isNaN(i)&&isNaN(r))for(var a=/^(\d+.?\d*)([nsew])/i,o=0;o<t.length;++o){var s=t[o].match(a);a.test(t[o])&&3===s.length&&(/^[ns]/i.test(s[2])?r=/^[n]/i.test(s[2])?+s[1]:-s[1]:/^[ew]/i.test(s[2])&&(i=/^[e]/i.test(s[2])?+s[1]:-s[1]))}if(!isNaN(i)&&!isNaN(r)&&!isNaN(n)){n={displayName:e,destination:Cartesian3.fromDegrees(i,r,n)};return when.resolve([n])}}return when.resolve([])},Spline.prototype.evaluate=DeveloperError.throwInstantiationError,Spline.prototype.findTimeInterval=function(e,t){var i,r=this.times,n=r.length;if(e>=r[t=defaultValue(t,0)]){if(t+1<n&&e<r[t+1])return t;if(t+2<n&&e<r[t+2])return t+1}else if(0<=t-1&&e>=r[t-1])return t-1;if(e>r[t])for(i=t;i<n-1&&!(e>=r[i]&&e<r[i+1]);++i);else for(i=t-1;0<=i&&!(e>=r[i]&&e<r[i+1]);--i);return i=i===n-1?n-2:i},Spline.prototype.wrapTime=function(e){var t=this.times,i=t[t.length-1],r=t[0],t=i-r;return e<r&&(e+=(Math.floor((r-e)/t)+1)*t),i<e&&(e-=(Math.floor((e-i)/t)+1)*t),e},Spline.prototype.clampTime=function(e){var t=this.times;return CesiumMath.clamp(e,t[0],t[t.length-1])},Object.defineProperties(LinearSpline.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),LinearSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,LinearSpline.prototype.wrapTime=Spline.prototype.wrapTime,LinearSpline.prototype.clampTime=Spline.prototype.clampTime,LinearSpline.prototype.evaluate=function(e,t){var i=this.points,r=this.times,n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-r[n])/(r[n+1]-r[n]);return defined(t)||(t=new Cartesian3),Cartesian3.lerp(i[n],i[n+1],r,t)};var TridiagonalSystemSolver={solve:function(e,t,i,r){for(var n,a=new Array(i.length),o=new Array(r.length),s=new Array(r.length),l=0;l<o.length;l++)o[l]=new Cartesian3,s[l]=new Cartesian3;for(a[0]=i[0]/t[0],o[0]=Cartesian3.multiplyByScalar(r[0],1/t[0],o[0]),l=1;l<a.length;++l)n=1/(t[l]-a[l-1]*e[l-1]),a[l]=i[l]*n,o[l]=Cartesian3.subtract(r[l],Cartesian3.multiplyByScalar(o[l-1],e[l-1],o[l]),o[l]),o[l]=Cartesian3.multiplyByScalar(o[l],n,o[l]);for(n=1/(t[l]-a[l-1]*e[l-1]),o[l]=Cartesian3.subtract(r[l],Cartesian3.multiplyByScalar(o[l-1],e[l-1],o[l]),o[l]),o[l]=Cartesian3.multiplyByScalar(o[l],n,o[l]),s[s.length-1]=o[o.length-1],l=s.length-2;0<=l;--l)s[l]=Cartesian3.subtract(o[l],Cartesian3.multiplyByScalar(s[l+1],a[l],s[l]),s[l]);return s}},scratchLower=[],scratchDiagonal=[],scratchUpper=[],scratchRight$3=[];function generateClamped(e,t,i){var r,n=scratchLower,a=scratchUpper,o=scratchDiagonal,s=scratchRight$3;n.length=a.length=e.length-1,o.length=s.length=e.length,n[0]=o[0]=1;var l=s[a[0]=0];for(defined(l)||(l=s[0]=new Cartesian3),Cartesian3.clone(t,l),r=1;r<n.length-1;++r)n[r]=a[r]=1,o[r]=4,defined(l=s[r])||(l=s[r]=new Cartesian3),Cartesian3.subtract(e[r+1],e[r-1],l),Cartesian3.multiplyByScalar(l,3,l);return n[r]=0,a[r]=1,o[r]=4,defined(l=s[r])||(l=s[r]=new Cartesian3),Cartesian3.subtract(e[r+1],e[r-1],l),Cartesian3.multiplyByScalar(l,3,l),defined(l=s[r+(o[r+1]=1)])||(l=s[r+1]=new Cartesian3),Cartesian3.clone(i,l),TridiagonalSystemSolver.solve(n,o,a,s)}function generateNatural(e){var t,i=scratchLower,r=scratchUpper,n=scratchDiagonal,a=scratchRight$3;i.length=r.length=e.length-1,n.length=a.length=e.length,i[0]=r[0]=1,n[0]=2;var o=a[0];for(defined(o)||(o=a[0]=new Cartesian3),Cartesian3.subtract(e[1],e[0],o),Cartesian3.multiplyByScalar(o,3,o),t=1;t<i.length;++t)i[t]=r[t]=1,n[t]=4,defined(o=a[t])||(o=a[t]=new Cartesian3),Cartesian3.subtract(e[t+1],e[t-1],o),Cartesian3.multiplyByScalar(o,3,o);return n[t]=2,defined(o=a[t])||(o=a[t]=new Cartesian3),Cartesian3.subtract(e[t],e[t-1],o),Cartesian3.multiplyByScalar(o,3,o),TridiagonalSystemSolver.solve(i,n,r,a)}function HermiteSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).points,i=e.times,r=e.inTangents,e=e.outTangents;this._times=i,this._points=t,this._inTangents=r,this._outTangents=e,this._lastTimeIndex=0}Object.defineProperties(HermiteSpline.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}}}),HermiteSpline.createC1=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times,i=e.points,r=e.tangents,e=r.slice(0,r.length-1);return new HermiteSpline({times:t,points:i,inTangents:r.slice(1,r.length),outTangents:e})},HermiteSpline.createNaturalCubic=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times,i=e.points;if(i.length<3)return new LinearSpline({points:i,times:t});var r=generateNatural(i),e=r.slice(0,r.length-1);return new HermiteSpline({times:t,points:i,inTangents:r.slice(1,r.length),outTangents:e})},HermiteSpline.createClampedCubic=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times,i=e.points,r=e.firstTangent,e=e.lastTangent;if(i.length<3)return new LinearSpline({points:i,times:t});r=generateClamped(i,r,e),e=r.slice(0,r.length-1);return new HermiteSpline({times:t,points:i,inTangents:r.slice(1,r.length),outTangents:e})},HermiteSpline.hermiteCoefficientMatrix=new Matrix4(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),HermiteSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval;var scratchTimeVec$1=new Cartesian4,scratchTemp=new Cartesian3;HermiteSpline.prototype.wrapTime=Spline.prototype.wrapTime,HermiteSpline.prototype.clampTime=Spline.prototype.clampTime,HermiteSpline.prototype.evaluate=function(e,t){defined(t)||(t=new Cartesian3);var i=this.points,r=this.times,n=this.inTangents,a=this.outTangents,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),e=(e-r[o])/(r[o+1]-r[o]),r=scratchTimeVec$1;r.z=e,r.y=e*e,r.x=r.y*e,r.w=1;r=Matrix4.multiplyByVector(HermiteSpline.hermiteCoefficientMatrix,r,r);return t=Cartesian3.multiplyByScalar(i[o],r.x,t),Cartesian3.multiplyByScalar(i[o+1],r.y,scratchTemp),Cartesian3.add(t,scratchTemp,t),Cartesian3.multiplyByScalar(a[o],r.z,scratchTemp),Cartesian3.add(t,scratchTemp,t),Cartesian3.multiplyByScalar(n[o],r.w,scratchTemp),Cartesian3.add(t,scratchTemp,t)};var scratchTimeVec=new Cartesian4,scratchTemp0=new Cartesian3,scratchTemp1=new Cartesian3;function createEvaluateFunction$1(l){var c=l.points,u=l.times;if(c.length<3){var i=u[0],r=1/(u[1]-i),n=c[0],a=c[1];return function(e,t){return defined(t)||(t=new Cartesian3),Cartesian3.lerp(n,a,(e-i)*r,t)}}return function(e,t){defined(t)||(t=new Cartesian3);var i,r,n,a,o=l._lastTimeIndex=l.findTimeInterval(e,l._lastTimeIndex),s=(e-u[o])/(u[o+1]-u[o]),e=scratchTimeVec;return e.z=s,e.y=s*s,e.x=e.y*s,e.w=1,e=0===o?(i=c[0],r=c[1],n=l.firstTangent,a=Cartesian3.subtract(c[2],i,scratchTemp0),Cartesian3.multiplyByScalar(a,.5,a),Matrix4.multiplyByVector(HermiteSpline.hermiteCoefficientMatrix,e,e)):o===c.length-2?(i=c[o],r=c[o+1],a=l.lastTangent,n=Cartesian3.subtract(r,c[o-1],scratchTemp0),Cartesian3.multiplyByScalar(n,.5,n),Matrix4.multiplyByVector(HermiteSpline.hermiteCoefficientMatrix,e,e)):(i=c[o-1],r=c[o],n=c[o+1],a=c[o+2],Matrix4.multiplyByVector(CatmullRomSpline.catmullRomCoefficientMatrix,e,e)),t=Cartesian3.multiplyByScalar(i,e.x,t),Cartesian3.multiplyByScalar(r,e.y,scratchTemp1),Cartesian3.add(t,scratchTemp1,t),Cartesian3.multiplyByScalar(n,e.z,scratchTemp1),Cartesian3.add(t,scratchTemp1,t),Cartesian3.multiplyByScalar(a,e.w,scratchTemp1),Cartesian3.add(t,scratchTemp1,t)}}var firstTangentScratch=new Cartesian3,lastTangentScratch=new Cartesian3;function CatmullRomSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).points,i=e.times,r=e.firstTangent,n=e.lastTangent;2<t.length&&(defined(r)||(Cartesian3.multiplyByScalar(t[1],2,r=firstTangentScratch),Cartesian3.subtract(r,t[2],r),Cartesian3.subtract(r,t[0],r),Cartesian3.multiplyByScalar(r,.5,r)),defined(n)||(e=t.length-1,Cartesian3.multiplyByScalar(t[e-1],2,n=lastTangentScratch),Cartesian3.subtract(t[e],n,n),Cartesian3.add(n,t[e-2],n),Cartesian3.multiplyByScalar(n,.5,n))),this._times=i,this._points=t,this._firstTangent=Cartesian3.clone(r),this._lastTangent=Cartesian3.clone(n),this._evaluateFunction=createEvaluateFunction$1(this),this._lastTimeIndex=0}function getStringFromTypedArray(e,t,i){return t=defaultValue(t,0),i=defaultValue(i,e.byteLength-t),e=e.subarray(t,t+i),getStringFromTypedArray.decode(e)}function inRange(e,t,i){return t<=e&&e<=i}function utf8Handler(e){for(var t=0,i=0,r=0,n=128,a=191,o=[],s=e.length,l=0;l<s;++l){var c=e[l];if(0===r){if(inRange(c,0,127)){o.push(c);continue}if(inRange(c,194,223)){r=1,t=31&c;continue}if(inRange(c,224,239)){224===c&&(n=160),237===c&&(a=159),r=2,t=15&c;continue}if(inRange(c,240,244)){240===c&&(n=144),244===c&&(a=143),r=3,t=7&c;continue}throw new RuntimeError("String decoding failed.")}inRange(c,n,a)?(n=128,a=191,t=t<<6|63&c,++i===r&&(o.push(t),t=r=i=0)):(t=r=i=0,n=128,a=191,--l)}return o}function getJsonFromTypedArray(e,t,i){return JSON.parse(getStringFromTypedArray(e,t,i))}Object.defineProperties(CatmullRomSpline.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}}}),CatmullRomSpline.catmullRomCoefficientMatrix=new Matrix4(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),CatmullRomSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,CatmullRomSpline.prototype.wrapTime=Spline.prototype.wrapTime,CatmullRomSpline.prototype.clampTime=Spline.prototype.clampTime,CatmullRomSpline.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},getStringFromTypedArray.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)},getStringFromTypedArray.decodeWithFromCharCode=function(e){for(var t="",i=utf8Handler(e),r=i.length,n=0;n<r;++n){var a=i[n];a<=65535?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296+(a>>10),56320+(1023&a)))}return t},"undefined"!=typeof TextDecoder?getStringFromTypedArray.decode=getStringFromTypedArray.decodeWithTextDecoder:getStringFromTypedArray.decode=getStringFromTypedArray.decodeWithFromCharCode;var Intersections2D={};function QuantizedMeshTerrainData(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;var t=this._quantizedVertices.length/3,i=this._uValues=this._quantizedVertices.subarray(0,t),r=this._vValues=this._quantizedVertices.subarray(t,2*t);function n(e,t){return r[e]-r[t]}function a(e,t){return i[e]-i[t]}this._heightValues=this._quantizedVertices.subarray(2*t,3*t),this._westIndices=sortIndicesIfNecessary(e.westIndices,n,t),this._southIndices=sortIndicesIfNecessary(e.southIndices,a,t),this._eastIndices=sortIndicesIfNecessary(e.eastIndices,n,t),this._northIndices=sortIndicesIfNecessary(e.northIndices,a,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=defaultValue(e.childTileMask,15),this._createdByUpsampling=defaultValue(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Intersections2D.clipTriangleAtAxisAlignedThreshold=function(e,t,i,r,n,a){var o,s;defined(a)?a.length=0:a=[];var l,c,u,d,h,p,m=t?(o=i<e,s=r<e,n<e):(o=e<i,s=e<r,e<n),t=o+s+m;return 1===t?o?(l=(e-i)/(r-i),c=(e-i)/(n-i),a.push(1),a.push(2),1!==c&&(a.push(-1),a.push(0),a.push(2),a.push(c)),1!==l&&(a.push(-1),a.push(0),a.push(1),a.push(l))):s?(u=(e-r)/(n-r),d=(e-r)/(i-r),a.push(2),a.push(0),1!==d&&(a.push(-1),a.push(1),a.push(0),a.push(d)),1!==u&&(a.push(-1),a.push(1),a.push(2),a.push(u))):m&&(h=(e-n)/(i-n),p=(e-n)/(r-n),a.push(0),a.push(1),1!==p&&(a.push(-1),a.push(2),a.push(1),a.push(p)),1!==h&&(a.push(-1),a.push(2),a.push(0),a.push(h))):2===t?o||i===e?s||r===e?m||n===e||(c=(e-i)/(n-i),u=(e-r)/(n-r),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(c),a.push(-1),a.push(1),a.push(2),a.push(u)):(p=(e-n)/(r-n),l=(e-i)/(r-i),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(p),a.push(-1),a.push(0),a.push(1),a.push(l)):(d=(e-r)/(i-r),h=(e-n)/(i-n),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(d),a.push(-1),a.push(2),a.push(0),a.push(h)):3!==t&&(a.push(0),a.push(1),a.push(2)),a},Intersections2D.computeBarycentricCoordinates=function(e,t,i,r,n,a,o,s,l){var c=i-o,i=o-n,n=a-s,a=r-s,r=1/(n*c+i*a),s=t-s,o=e-o,i=(n*o+i*s)*r,s=(-a*o+c*s)*r,r=1-i-s;return defined(l)?(l.x=i,l.y=s,l.z=r,l):new Cartesian3(i,s,r)},Intersections2D.computeLineSegmentLineSegmentIntersection=function(e,t,i,r,n,a,o,s,l){var c=(o-n)*(t-a)-(s-a)*(e-n),u=(i-e)*(t-a)-(r-t)*(e-n),n=(s-a)*(i-e)-(o-n)*(r-t);if(0!=n){c=c/n,n=u/n;return 0<=c&&c<=1&&0<=n&&n<=1?((l=!defined(l)?new Cartesian2:l).x=e+c*(i-e),l.y=t+c*(r-t),l):void 0}},Object.defineProperties(QuantizedMeshTerrainData.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return defined(this._mesh)}}});var arrayScratch$1=[];function sortIndicesIfNecessary(e,t,i){arrayScratch$1.length=e.length;for(var r=!1,n=0,a=e.length;n<a;++n)arrayScratch$1[n]=e[n],r=r||0<n&&0<t(e[n-1],e[n]);return r?(arrayScratch$1.sort(t),IndexDatatype$1.createTypedArray(i,arrayScratch$1)):e}var createMeshTaskName$1="createVerticesFromQuantizedTerrainMesh",createMeshTaskProcessorNoThrottle$1=new TaskProcessor(createMeshTaskName$1),createMeshTaskProcessorThrottle$1=new TaskProcessor(createMeshTaskName$1,TerrainData.maximumAsynchronousTasks);QuantizedMeshTerrainData.prototype.createMesh=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).tilingScheme,i=e.x,r=e.y,n=e.level,h=defaultValue(e.exaggeration,1),a=defaultValue(e.throttle,!0),e=t.ellipsoid,n=t.tileXYToRectangle(i,r,n),e=(a?createMeshTaskProcessorThrottle$1:createMeshTaskProcessorNoThrottle$1).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:n,relativeToCenter:this._boundingSphere.center,ellipsoid:e,exaggeration:h});if(defined(e)){var p=this;return when(e,function(e){var t=p._quantizedVertices.length/3,i=t+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,r=IndexDatatype$1.createTypedArray(i,e.indices),n=new Float32Array(e.vertices),a=e.center,o=e.minimumHeight,s=e.maximumHeight,l=defaultValue(BoundingSphere.clone(e.boundingSphere),p._boundingSphere),c=defaultValue(OrientedBoundingBox.clone(e.orientedBoundingBox),p._orientedBoundingBox),u=defaultValue(Cartesian3.clone(e.occludeePointInScaledSpace),p._horizonOcclusionPoint),d=e.vertexStride,i=TerrainEncoding.clone(e.encoding);return p._mesh=new TerrainMesh(a,n,r,e.indexCountWithoutSkirts,t,o,s,l,u,d,c,i,h,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.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 upsampleTaskProcessor$1=new TaskProcessor("upsampleQuantizedTerrainMesh",TerrainData.maximumAsynchronousTasks);QuantizedMeshTerrainData.prototype.upsample=function(e,t,i,r,n,a,o){var s=this._mesh;if(defined(this._mesh)){var l=2*t!==n,t=2*i===a,i=e.ellipsoid,o=e.tileXYToRectangle(n,a,o),i=upsampleTaskProcessor$1.scheduleTask({vertices:s.vertices,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:l,isNorthChild:t,childRectangle:o,ellipsoid:i,exaggeration:s.exaggeration});if(defined(i)){s=Math.min(this._westSkirtHeight,this._eastSkirtHeight),s=Math.min(s,this._southSkirtHeight);s=Math.min(s,this._northSkirtHeight);var c=l?.5*s:this._westSkirtHeight,u=t?.5*s:this._southSkirtHeight,d=l?this._eastSkirtHeight:.5*s,h=t?this._northSkirtHeight:.5*s,p=this._credits;return when(i).then(function(e){var t,i=new Uint16Array(e.vertices);return new QuantizedMeshTerrainData({quantizedVertices:i,indices:IndexDatatype$1.createTypedArray(i.length/3,e.indices),encodedNormals:t=defined(e.encodedNormals)?new Uint8Array(e.encodedNormals):t,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:BoundingSphere.clone(e.boundingSphere),orientedBoundingBox:OrientedBoundingBox.clone(e.orientedBoundingBox),horizonOcclusionPoint:Cartesian3.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:c,southSkirtHeight:u,eastSkirtHeight:d,northSkirtHeight:h,childTileMask:0,credits:p,createdByUpsampling:!0})})}}};var maxShort$1=32767,barycentricCoordinateScratch$1=new Cartesian3;function pointInBoundingBox(e,t,i,r,n,a,o,s){var l=Math.min(i,n,o),n=Math.max(i,n,o),o=Math.min(r,a,s),s=Math.max(r,a,s);return l<=e&&e<=n&&o<=t&&t<=s}QuantizedMeshTerrainData.prototype.interpolateHeight=function(e,t,i){t=CesiumMath.clamp((t-e.west)/e.width,0,1);t*=maxShort$1;e=CesiumMath.clamp((i-e.south)/e.height,0,1);return e*=maxShort$1,(defined(this._mesh)?interpolateMeshHeight$1:interpolateHeight$1)(this,t,e)};var texCoordScratch0$1=new Cartesian2,texCoordScratch1$1=new Cartesian2,texCoordScratch2$1=new Cartesian2;function interpolateMeshHeight$1(e,t,i){for(var e=e._mesh,r=e.vertices,n=e.encoding,a=e.indices,o=0,s=a.length;o<s;o+=3){var l=a[o],c=a[o+1],u=a[o+2],d=n.decodeTextureCoordinates(r,l,texCoordScratch0$1),h=n.decodeTextureCoordinates(r,c,texCoordScratch1$1),p=n.decodeTextureCoordinates(r,u,texCoordScratch2$1);if(pointInBoundingBox(t,i,d.x,d.y,h.x,h.y,p.x,p.y)){p=Intersections2D.computeBarycentricCoordinates(t,i,d.x,d.y,h.x,h.y,p.x,p.y,barycentricCoordinateScratch$1);if(-1e-15<=p.x&&-1e-15<=p.y&&-1e-15<=p.z){l=n.decodeHeight(r,l),c=n.decodeHeight(r,c),u=n.decodeHeight(r,u);return p.x*l+p.y*c+p.z*u}}}}function interpolateHeight$1(e,t,i){for(var r=e._uValues,n=e._vValues,a=e._heightValues,o=e._indices,s=0,l=o.length;s<l;s+=3){var c=o[s],u=o[s+1],d=o[s+2],h=r[c],p=r[u],m=r[d],f=n[c],g=n[u],_=n[d];if(pointInBoundingBox(t,i,h,f,p,g,m,_)){_=Intersections2D.computeBarycentricCoordinates(t,i,h,f,p,g,m,_,barycentricCoordinateScratch$1);if(-1e-15<=_.x&&-1e-15<=_.y&&-1e-15<=_.z){d=_.x*a[c]+_.y*a[u]+_.z*a[d];return CesiumMath.lerp(e._minimumHeight,e._maximumHeight,d/maxShort$1)}}}}function LayerInformation(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 CesiumTerrainProvider(e){this._heightmapWidth=65,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=defaultValue(e.requestVertexNormals,!1),this._requestWaterMask=defaultValue(e.requestWaterMask,!1),this._requestMetadata=defaultValue(e.requestMetadata,!0),this._errorEvent=new Event;var t=e.credit;"string"==typeof t&&(t=new Credit(t)),this._credit=t,this._availability=void 0;var i=when.defer();this._ready=!1,this._readyPromise=i,this._tileCredits=void 0;var v,S,T,x=this,b=this._layers=[],E="",P=[],A=0;function w(e){var t;if(e.format){if(e.tiles&&0!==e.tiles.length){var i=!1,r=!1,n=!1,a=!0,o=!1;if("heightmap-1.0"===e.format)o=!0,defined(x._heightmapStructure)||(x._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),x._requestWaterMask=r=!0;else if(0!==e.format.indexOf("quantized-mesh-1."))return t='The tile format "'+e.format+'" is invalid or not supported.',void(T=TileProviderError.handleError(T,x,x._errorEvent,t,void 0,void 0,void 0,M));var s,l=e.tiles,c=e.maxzoom;if(A=Math.max(A,c),e.projection&&"EPSG:4326"!==e.projection){if("EPSG:3857"!==e.projection)return t='The projection "'+e.projection+'" is invalid or not supported.',void(T=TileProviderError.handleError(T,x,x._errorEvent,t,void 0,void 0,void 0,M));x._tilingScheme=new WebMercatorTilingScheme({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:x._ellipsoid})}else x._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:x._ellipsoid});if(x._levelZeroMaximumGeometricError=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(x._tilingScheme.ellipsoid,x._heightmapWidth,x._tilingScheme.getNumberOfXTilesAtLevel(0)),e.scheme&&"tms"!==e.scheme&&"slippyMap"!==e.scheme)return t='The scheme "'+e.scheme+'" is invalid or not supported.',void(T=TileProviderError.handleError(T,x,x._errorEvent,t,void 0,void 0,void 0,M));x._scheme=e.scheme,defined(e.extensions)&&-1!==e.extensions.indexOf("octvertexnormals")?i=!0:defined(e.extensions)&&-1!==e.extensions.indexOf("vertexnormals")&&(a=!(i=!0)),defined(e.extensions)&&-1!==e.extensions.indexOf("watermask")&&(r=!0),defined(e.extensions)&&-1!==e.extensions.indexOf("metadata")&&(n=!0);var u=e.metadataAvailability,d=e.available;if(defined(d)&&!defined(u))for(var h=new TileAvailability(x._tilingScheme,d.length),p=0;p<d.length;++p){var m=d[p],f=x._tilingScheme.getNumberOfYTilesAtLevel(p);defined(P[p])||(P[p]=[]);for(var g=0;g<m.length;++g){var _=m[g],y=f-_.endY-1,C=f-_.startY-1;P[p].push([_.startX,y,_.endX,C]),h.addAvailableTileRange(p,_.startX,y,_.endX,C)}}else defined(u)&&(s=new TileAvailability(x._tilingScheme,c),h=new TileAvailability(x._tilingScheme,c),P[0]=[[0,0,1,0]],h.addAvailableTileRange(0,0,0,1,0));x._hasWaterMask=x._hasWaterMask||r,x._hasVertexNormals=x._hasVertexNormals||i,x._hasMetadata=x._hasMetadata||n,defined(e.attribution)&&(0<E.length&&(E+=" "),E+=e.attribution),b.push(new LayerInformation({resource:v,version:e.version,isHeightmap:o,tileUrlTemplates:l,availability:h,hasVertexNormals:i,hasWaterMask:r,hasMetadata:n,availabilityLevels:u,availabilityTilesLoaded:s,littleEndianExtensionSize:a}));e=e.parentUrl;return defined(e)?defined(h)?((v=v.getDerivedResource({url:e})).appendForwardSlash(),when((S=v.getDerivedResource({url:"layer.json"})).fetchJson(),w,D)):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),when.resolve()):when.resolve()}T=TileProviderError.handleError(T,x,x._errorEvent,t="The layer.json file does not specify any tile URL templates.",void 0,void 0,void 0,M)}else T=TileProviderError.handleError(T,x,x._errorEvent,t="The tile format is not specified in the layer.json file.",void 0,void 0,void 0,M)}function D(e){var t="An error occurred while accessing "+S.url+".";T=TileProviderError.handleError(T,x,x._errorEvent,t,void 0,void 0,void 0,M)}function r(e){w(e).then(function(){if(!defined(T)){var e,t=P.length;if(0<t)for(var i=x._availability=new TileAvailability(x._tilingScheme,A),r=0;r<t;++r)for(var n=P[r],a=0;a<n.length;++a){var o=n[a];i.addAvailableTileRange(r,o[0],o[1],o[2],o[3])}0<E.length&&(e=new Credit(E),defined(x._tileCredits)?x._tileCredits.push(e):x._tileCredits=[e]),x._ready=!0,x._readyPromise.resolve(!0)}})}function n(e){defined(e)&&404===e.statusCode?r({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]}):D()}function M(){when(S.fetchJson()).then(r).otherwise(n)}when(e.url).then(function(e){e=Resource.createIfNeeded(e);e.appendForwardSlash(),S=(v=e).getDerivedResource({url:"layer.json"}),x._tileCredits=e.credits,M()}).otherwise(function(e){i.reject(e)})}QuantizedMeshTerrainData.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},QuantizedMeshTerrainData.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var QuantizedMeshExtensionIds={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function getRequestHeader(e){return defined(e)&&0!==e.length?{Accept:"application/vnd.quantized-mesh;extensions="+e.join("-")+",application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function createHeightmapTerrainData(e,t,i,r,n){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new HeightmapTerrainData({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function createQuantizedMeshTerrainData(e,t,i,r,n,a){var o=a.littleEndianExtensionSize,s=0,l=3*Float64Array.BYTES_PER_ELEMENT,c=4*Float64Array.BYTES_PER_ELEMENT,u=3*Uint16Array.BYTES_PER_ELEMENT,d=Uint16Array.BYTES_PER_ELEMENT,h=3*d,p=new DataView(t),m=new Cartesian3(p.getFloat64(s,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0)),f=p.getFloat32(s+=l,!0);s+=Float32Array.BYTES_PER_ELEMENT;var g=p.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;var _=new BoundingSphere(new Cartesian3(p.getFloat64(s,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0)),p.getFloat64(s+l,!0)),y=new Cartesian3(p.getFloat64(s+=c,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0)),C=p.getUint32(s+=l,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var v=new Uint16Array(t,s,3*C);s+=C*u,65536<C&&(h=3*(d=Uint32Array.BYTES_PER_ELEMENT));var S=v.subarray(0,C),c=v.subarray(C,2*C),l=v.subarray(2*C,3*C);AttributeCompression.zigZagDeltaDecode(S,c,l),s%d!=0&&(s+=d-s%d);u=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var T=IndexDatatype$1.createTypedArrayFromArrayBuffer(C,t,s,3*u);s+=u*h;for(var x=0,b=T.length,E=0;E<b;++E){var P=T[E];T[E]=x-P,0===P&&++x}S=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;c=IndexDatatype$1.createTypedArrayFromArrayBuffer(C,t,s,S),l=p.getUint32(s+=S*d,!0);s+=Uint32Array.BYTES_PER_ELEMENT;u=IndexDatatype$1.createTypedArrayFromArrayBuffer(C,t,s,l),h=p.getUint32(s+=l*d,!0);s+=Uint32Array.BYTES_PER_ELEMENT;S=IndexDatatype$1.createTypedArrayFromArrayBuffer(C,t,s,h),l=p.getUint32(s+=h*d,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var A,w,h=IndexDatatype$1.createTypedArrayFromArrayBuffer(C,t,s,l);for(s+=l*d;s<p.byteLength;){var D=p.getUint8(s,!0);s+=Uint8Array.BYTES_PER_ELEMENT;var M=p.getUint32(s,o);if(s+=Uint32Array.BYTES_PER_ELEMENT,D===QuantizedMeshExtensionIds.OCT_VERTEX_NORMALS&&e._requestVertexNormals)A=new Uint8Array(t,s,2*C);else if(D===QuantizedMeshExtensionIds.WATER_MASK&&e._requestWaterMask)w=new Uint8Array(t,s,M);else if(D===QuantizedMeshExtensionIds.METADATA&&e._requestMetadata){D=p.getUint32(s,!0);if(0<D){var I=getJsonFromTypedArray(new Uint8Array(t),s+Uint32Array.BYTES_PER_ELEMENT,D).available;if(defined(I))for(var R=0;R<I.length;++R)for(var O=i+R+1,L=I[R],F=e._tilingScheme.getNumberOfYTilesAtLevel(O),N=0;N<L.length;++N){var B=L[N],V=F-B.endY-1,k=F-B.startY-1;e.availability.addAvailableTileRange(O,B.startX,V,B.endX,k),a.availability.addAvailableTileRange(O,B.startX,V,B.endX,k)}}a.availabilityTilesLoaded.addAvailableTileRange(i,r,n,r,n)}s+=M}l=5*e.getLevelMaximumGeometricError(i),d=e._tilingScheme.tileXYToRectangle(r,n,i);return new QuantizedMeshTerrainData({center:m,minimumHeight:f,maximumHeight:g,boundingSphere:_,orientedBoundingBox:OrientedBoundingBox.fromRectangle(d,f,g,e._tilingScheme.ellipsoid),horizonOcclusionPoint:y,quantizedVertices:v,encodedNormals:A,indices:T,westIndices:c,southIndices:u,eastIndices:S,northIndices:h,westSkirtHeight:l,southSkirtHeight:l,eastSkirtHeight:l,northSkirtHeight:l,childTileMask:e.availability.computeChildMaskForTile(i,r,n),waterMask:w,credits:e._tileCredits})}function requestTileGeometry$1(t,i,r,n,a,e){if(!defined(a))return when.reject(new RuntimeError("Terrain tile doesn't exist"));var o,s=a.tileUrlTemplates;if(0!==s.length){o=t._scheme&&"tms"!==t._scheme?r:t._tilingScheme.getNumberOfYTilesAtLevel(n)-r-1;var l,c=[];t._requestVertexNormals&&a.hasVertexNormals&&c.push(a.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),t._requestWaterMask&&a.hasWaterMask&&c.push("watermask"),t._requestMetadata&&a.hasMetadata&&c.push("metadata");var u=s[(i+o+n)%s.length],s=a.resource,c=defined(s._ionEndpoint)&&!defined(s._ionEndpoint.externalType)?(0!==c.length&&(l={extensions:c.join("-")}),getRequestHeader(void 0)):getRequestHeader(c),e=s.getDerivedResource({url:u,templateValues:{version:a.version,z:n,x:i,y:o},queryParameters:l,headers:c,request:e}).fetchArrayBuffer();if(defined(e))return e.then(function(e){return defined(t._heightmapStructure)?createHeightmapTerrainData(t,e):createQuantizedMeshTerrainData(t,e,n,i,r,a)})}}function getAvailabilityTile(e,t,i,r){if(0!==r){e=e.availabilityLevels,e=r%e==0?r-e:(r/e|0)*e,r=1<<r-e;return{level:e,x:t/r|0,y:i/r|0}}}function checkLayer(e,t,i,r,n,a){if(!defined(n.availabilityLevels))return{result:!1};for(var o,s,l,c=function(){delete n.availabilityPromiseCache[l]},u=n.availabilityTilesLoaded,d=n.availability,h=getAvailabilityTile(n,t,i,r);defined(h);){if(d.isTileAvailable(h.level,h.x,h.y)&&!u.isTileAvailable(h.level,h.x,h.y))return a||(l=h.level+"-"+h.x+"-"+h.y,defined(s=n.availabilityPromiseCache[l])||(o=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.TERRAIN}),defined(s=requestTileGeometry$1(e,h.x,h.y,h.level,n,o))&&(n.availabilityPromiseCache[l]=s).then(c))),{result:!0,promise:s};h=getAvailabilityTile(n,h.x,h.y,h.level)}return{result:!1}}CesiumTerrainProvider.prototype.requestTileGeometry=function(e,t,i,r){var n,a=this._layers,o=a.length;if(1===o)n=a[0];else for(var s=0;s<o;++s){var l=a[s];if(!defined(l.availability)||l.availability.isTileAvailable(i,e,t)){n=l;break}}return requestTileGeometry$1(this,e,t,i,n,r)},Object.defineProperties(CesiumTerrainProvider.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},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}}}),CesiumTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},CesiumTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){if(defined(this._availability)){if(i>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(i,e,t))return!0;if(!this._hasMetadata)return!1;for(var r=this._layers,n=r.length,a=0;a<n;++a)if(checkLayer(this,e,t,i,r[a],0===a).result)return;return!1}},CesiumTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){if(!(!defined(this._availability)||i>this._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var r=this._layers,n=r.length,a=0;a<n;++a){var o=checkLayer(this,e,t,i,r[a],0===a);if(defined(o.promise))return o.promise}},CesiumTerrainProvider._getAvailabilityTile=getAvailabilityTile;var EllipseGeometryLibrary={},rotAxis=new Cartesian3,tempVec=new Cartesian3,unitQuat=new Quaternion,rotMtx=new Matrix3;function pointOnEllipsoid(e,t,i,r,n,a,o,s,l,c){t=e+t;Cartesian3.multiplyByScalar(r,Math.cos(t),rotAxis),Cartesian3.multiplyByScalar(i,Math.sin(t),tempVec),Cartesian3.add(rotAxis,tempVec,rotAxis);t=Math.cos(e);t*=t;e=Math.sin(e);e*=e;e=a/Math.sqrt(o*t+n*e);return Quaternion.fromAxisAngle(rotAxis,e/s,unitQuat),Matrix3.fromQuaternion(unitQuat,rotMtx),Matrix3.multiplyByVector(rotMtx,l,c),Cartesian3.normalize(c,c),Cartesian3.multiplyByScalar(c,s,c),c}var scratchCartesian1$6=new Cartesian3,scratchCartesian2$9=new Cartesian3,scratchCartesian3$a=new Cartesian3,scratchNormal$6=new Cartesian3;EllipseGeometryLibrary.raisePositionsToHeight=function(e,t,i){for(var r=t.ellipsoid,n=t.height,a=t.extrudedHeight,t=i?e.length/3*2:e.length/3,o=new Float64Array(3*t),s=e.length,l=i?s:0,c=0;c<s;c+=3){var u=c+1,d=c+2,h=Cartesian3.fromArray(e,c,scratchCartesian1$6);r.scaleToGeodeticSurface(h,h);var p=Cartesian3.clone(h,scratchCartesian2$9),m=r.geodeticSurfaceNormal(h,scratchNormal$6),f=Cartesian3.multiplyByScalar(m,n,scratchCartesian3$a);Cartesian3.add(h,f,h),i&&(Cartesian3.multiplyByScalar(m,a,f),Cartesian3.add(p,f,p),o[c+l]=p.x,o[u+l]=p.y,o[d+l]=p.z),o[c]=h.x,o[u]=h.y,o[d]=h.z}return o};var unitPosScratch=new Cartesian3,eastVecScratch=new Cartesian3,northVecScratch=new Cartesian3;function GeometryInstance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}function EncodedCartesian3(){this.high=Cartesian3.clone(Cartesian3.ZERO),this.low=Cartesian3.clone(Cartesian3.ZERO)}EllipseGeometryLibrary.computeEllipsePositions=function(e,t,i){var r=e.semiMinorAxis,n=e.semiMajorAxis,a=e.rotation,o=e.center,e=8*e.granularity,s=r*r,l=n*n,c=n*r,u=Cartesian3.magnitude(o),d=Cartesian3.normalize(o,unitPosScratch),h=Cartesian3.cross(Cartesian3.UNIT_Z,o,eastVecScratch),h=Cartesian3.normalize(h,h),p=Cartesian3.cross(d,h,northVecScratch),m=1+Math.ceil(CesiumMath.PI_OVER_TWO/e),f=CesiumMath.PI_OVER_TWO/(m-1),g=CesiumMath.PI_OVER_TWO-m*f;g<0&&(m-=Math.ceil(Math.abs(g)/f));var _,y,C,v,S=t?new Array(3*(m*(m+2)*2)):void 0,T=0,x=scratchCartesian1$6,b=scratchCartesian2$9,e=4*m*3,E=e-1,P=0,A=i?new Array(e):void 0,x=pointOnEllipsoid(g=CesiumMath.PI_OVER_TWO,a,p,h,s,c,l,u,d,x);for(t&&(S[T++]=x.x,S[T++]=x.y,S[T++]=x.z),i&&(A[E--]=x.z,A[E--]=x.y,A[E--]=x.x),g=CesiumMath.PI_OVER_TWO-f,_=1;_<m+1;++_){if(x=pointOnEllipsoid(g,a,p,h,s,c,l,u,d,x),b=pointOnEllipsoid(Math.PI-g,a,p,h,s,c,l,u,d,b),t){for(S[T++]=x.x,S[T++]=x.y,S[T++]=x.z,C=2*_+2,y=1;y<C-1;++y)v=Cartesian3.lerp(x,b,y/(C-1),scratchCartesian3$a),S[T++]=v.x,S[T++]=v.y,S[T++]=v.z;S[T++]=b.x,S[T++]=b.y,S[T++]=b.z}i&&(A[E--]=x.z,A[E--]=x.y,A[E--]=x.x,A[P++]=b.x,A[P++]=b.y,A[P++]=b.z),g=CesiumMath.PI_OVER_TWO-(_+1)*f}for(_=m;1<_;--_){if(x=pointOnEllipsoid(-(g=CesiumMath.PI_OVER_TWO-(_-1)*f),a,p,h,s,c,l,u,d,x),b=pointOnEllipsoid(g+Math.PI,a,p,h,s,c,l,u,d,b),t){for(S[T++]=x.x,S[T++]=x.y,S[T++]=x.z,C=2*(_-1)+2,y=1;y<C-1;++y)v=Cartesian3.lerp(x,b,y/(C-1),scratchCartesian3$a),S[T++]=v.x,S[T++]=v.y,S[T++]=v.z;S[T++]=b.x,S[T++]=b.y,S[T++]=b.z}i&&(A[E--]=x.z,A[E--]=x.y,A[E--]=x.x,A[P++]=b.x,A[P++]=b.y,A[P++]=b.z)}x=pointOnEllipsoid(-(g=CesiumMath.PI_OVER_TWO),a,p,h,s,c,l,u,d,x);e={};return t&&(S[T++]=x.x,S[T++]=x.y,S[T++]=x.z,e.positions=S,e.numPts=m),i&&(A[E--]=x.z,A[E--]=x.y,A[E--]=x.x,e.outerPositions=A),e},EncodedCartesian3.encode=function(e,t){var i;return defined(t)||(t={high:0,low:0}),0<=e?(i=65536*Math.floor(e/65536),t.high=i,t.low=e-i):(i=65536*Math.floor(-e/65536),t.high=-i,t.low=e+i),t};var scratchEncode={high:0,low:0};EncodedCartesian3.fromCartesian=function(e,t){var i=(t=!defined(t)?new EncodedCartesian3:t).high,r=t.low;return EncodedCartesian3.encode(e.x,scratchEncode),i.x=scratchEncode.high,r.x=scratchEncode.low,EncodedCartesian3.encode(e.y,scratchEncode),i.y=scratchEncode.high,r.y=scratchEncode.low,EncodedCartesian3.encode(e.z,scratchEncode),i.z=scratchEncode.high,r.z=scratchEncode.low,t};var encodedP=new EncodedCartesian3;EncodedCartesian3.writeElements=function(e,t,i){EncodedCartesian3.fromCartesian(e,encodedP);var r=encodedP.high,e=encodedP.low;t[i]=r.x,t[i+1]=r.y,t[i+2]=r.z,t[i+3]=e.x,t[i+4]=e.y,t[i+5]=e.z};var Tipsify={calculateACMR:function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).indices,i=e.maximumIndex,r=defaultValue(e.cacheSize,24),n=t.length;if(!defined(i))for(var i=0,a=0,o=t[a];a<n;)i<o&&(i=o),o=t[++a];for(var s=[],l=0;l<i+1;l++)s[l]=0;for(var c=r+1,u=0;u<n;++u)c-s[t[u]]>r&&(s[t[u]]=c,++c);return(c-r+1)/(n/3)}};Tipsify.tipsify=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).indices,i=e.maximumIndex,r=defaultValue(e.cacheSize,24);function n(e,t,i,r,n,a,o){for(var s,l=-1,c=-1,u=0;u<i.length;){var d=i[u];r[d].numLiveTriangles&&(s=0,(c<(s=n-r[d].timeStamp+2*r[d].numLiveTriangles<=t?n-r[d].timeStamp:s)||-1===c)&&(c=s,l=d)),++u}return-1===l?function(e,t,i){for(;1<=t.length;){var r=t[t.length-1];if(t.splice(t.length-1,1),0<e[r].numLiveTriangles)return r}for(;m<i;){if(0<e[m].numLiveTriangles)return++m-1;++m}return-1}(r,a,o):l}var e=t.length,a=0,o=t[b=0],s=e;if(defined(i))a=i+1;else{for(;b<s;)a<o&&(a=o),o=t[++b];if(-1===a)return 0;++a}for(var l=[],c=0;c<a;c++)l[c]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};for(var u=b=0;b<s;)l[t[b]].vertexTriangles.push(u),++l[t[b]].numLiveTriangles,l[t[b+1]].vertexTriangles.push(u),++l[t[b+1]].numLiveTriangles,l[t[b+2]].vertexTriangles.push(u),++l[t[b+2]].numLiveTriangles,++u,b+=3;var d,h=0,p=r+1,m=1,f=[],g=[],_=0,y=[],C=e/3,v=[];for(c=0;c<C;c++)v[c]=!1;for(;-1!==h;){for(var S,f=[],T=(S=l[h]).vertexTriangles.length,x=0;x<T;++x)if(!v[u=S.vertexTriangles[x]]){v[u]=!0;for(var b=u+u+u,E=0;E<3;++E)d=t[b],f.push(d),g.push(d),y[_]=d,++_,--(d=l[d]).numLiveTriangles,p-d.timeStamp>r&&(d.timeStamp=p,++p),++b}h=n(0,r,f,l,p,g,a)}return y};var GeometryPipeline={};function addTriangle(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function trianglesToLines(e){for(var t=e.length,i=IndexDatatype$1.createTypedArray(t,t/3*6),r=0,n=0;n<t;n+=3,r+=6)addTriangle(i,r,e[n],e[n+1],e[n+2]);return i}function triangleStripToLines(e){var t=e.length;if(3<=t){var i=IndexDatatype$1.createTypedArray(t,6*(t-2));addTriangle(i,0,e[0],e[1],e[2]);for(var r=6,n=3;n<t;++n,r+=6)addTriangle(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}function triangleFanToLines(e){if(0<e.length){for(var t=e.length-1,i=IndexDatatype$1.createTypedArray(t,6*(t-1)),r=e[0],n=0,a=1;a<t;++a,n+=6)addTriangle(i,n,r,e[a],e[a+1]);return i}return new Uint16Array}function copyAttributesDescriptions(e){var t,i,r={};for(t in e)e.hasOwnProperty(t)&&defined(e[t])&&defined(e[t].values)&&(i=e[t],r[t]=new GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]}));return r}function copyVertex(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&defined(t[r])&&defined(t[r].values))for(var n=t[r],a=0;a<n.componentsPerAttribute;++a)e[r].values.push(n.values[i*n.componentsPerAttribute+a])}GeometryPipeline.toWireframe=function(e){var t=e.indices;if(defined(t)){switch(e.primitiveType){case PrimitiveType$1.TRIANGLES:e.indices=trianglesToLines(t);break;case PrimitiveType$1.TRIANGLE_STRIP:e.indices=triangleStripToLines(t);break;case PrimitiveType$1.TRIANGLE_FAN:e.indices=triangleFanToLines(t)}e.primitiveType=PrimitiveType$1.LINES}return e},GeometryPipeline.createLineSegmentsForVectors=function(e,t,i){t=defaultValue(t,"normal"),i=defaultValue(i,1e4);for(var r,n=e.attributes.position.values,a=e.attributes[t].values,o=n.length,s=new Float64Array(2*o),l=0,c=0;c<o;c+=3)s[l++]=n[c],s[l++]=n[c+1],s[l++]=n[c+2],s[l++]=n[c]+a[c]*i,s[l++]=n[c+1]+a[c+1]*i,s[l++]=n[c+2]+a[c+2]*i;e=e.boundingSphere;return defined(e)&&(r=new BoundingSphere(e.center,e.radius+i)),new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:PrimitiveType$1.LINES,boundingSphere:r})},GeometryPipeline.createAttributeLocations=function(e){for(var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,n={},a=0,o=i.length,s=0;s<o;++s){var l=i[s];defined(r[l])&&(n[l]=a++)}for(t in r)r.hasOwnProperty(t)&&!defined(n[t])&&(n[t]=a++);return n},GeometryPipeline.reorderForPreVertexCache=function(e){var t=Geometry.computeNumberOfVertices(e),i=e.indices;if(defined(i)){for(var r=new Int32Array(t),n=0;n<t;n++)r[n]=-1;for(var a,o=i,s=o.length,l=IndexDatatype$1.createTypedArray(t,s),c=0,u=0,d=0;c<s;)-1!==(a=r[o[c]])?l[u]=a:(r[a=o[c]]=d,l[u]=d,++d),++c,++u;e.indices=l;var h,p=e.attributes;for(h in p)if(p.hasOwnProperty(h)&&defined(p[h])&&defined(p[h].values)){for(var m=p[h],f=m.values,g=0,_=m.componentsPerAttribute,y=ComponentDatatype$1.createTypedArray(m.componentDatatype,d*_);g<t;){var C=r[g];if(-1!==C)for(var v=0;v<_;v++)y[_*C+v]=f[_*g+v];++g}m.values=y}}return e},GeometryPipeline.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===PrimitiveType$1.TRIANGLES&&defined(i)){for(var r=i.length,n=0,a=0;a<r;a++)i[a]>n&&(n=i[a]);e.indices=Tipsify.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},GeometryPipeline.fitToUnsignedShortIndices=function(e){var t=[],i=Geometry.computeNumberOfVertices(e);if(defined(e.indices)&&i>=CesiumMath.SIXTY_FOUR_KILOBYTES){var r,n=[],a=[],o=0,s=copyAttributesDescriptions(e.attributes),l=e.indices,c=l.length;e.primitiveType===PrimitiveType$1.TRIANGLES?r=3:e.primitiveType===PrimitiveType$1.LINES?r=2:e.primitiveType===PrimitiveType$1.POINTS&&(r=1);for(var u=0;u<c;u+=r){for(var d=0;d<r;++d){var h=l[u+d],p=n[h];defined(p)||(p=o++,n[h]=p,copyVertex(s,e.attributes,h)),a.push(p)}o+r>=CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new Geometry({attributes:s,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],a=[],o=0,s=copyAttributesDescriptions(e.attributes))}0!==a.length&&t.push(new Geometry({attributes:s,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var scratchProjectTo2DCartesian3=new Cartesian3,scratchProjectTo2DCartographic=new Cartographic;GeometryPipeline.projectTo2D=function(e,t,i,r,n){for(var a=e.attributes[t],o=(n=defined(n)?n:new GeographicProjection).ellipsoid,s=a.values,l=new Float64Array(s.length),c=0,u=0;u<s.length;u+=3){var d=Cartesian3.fromArray(s,u,scratchProjectTo2DCartesian3),d=o.cartesianToCartographic(d,scratchProjectTo2DCartographic),d=n.project(d,scratchProjectTo2DCartesian3);l[c++]=d.x,l[c++]=d.y,l[c++]=d.z}return e.attributes[i]=a,e.attributes[r]=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};var encodedResult={high:0,low:0};GeometryPipeline.encodeAttribute=function(e,t,i,r){for(var n=e.attributes[t],a=n.values,o=a.length,s=new Float32Array(o),l=new Float32Array(o),c=0;c<o;++c)EncodedCartesian3.encode(a[c],encodedResult),s[c]=encodedResult.high,l[c]=encodedResult.low;n=n.componentsPerAttribute;return e.attributes[i]=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:n,values:s}),e.attributes[r]=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:n,values:l}),delete e.attributes[t],e};var scratchCartesian3$9=new Cartesian3;function transformPoint(e,t){if(defined(t))for(var i=t.values,r=i.length,n=0;n<r;n+=3)Cartesian3.unpack(i,n,scratchCartesian3$9),Matrix4.multiplyByPoint(e,scratchCartesian3$9,scratchCartesian3$9),Cartesian3.pack(scratchCartesian3$9,i,n)}function transformVector(e,t){if(defined(t))for(var i=t.values,r=i.length,n=0;n<r;n+=3)Cartesian3.unpack(i,n,scratchCartesian3$9),Matrix3.multiplyByVector(e,scratchCartesian3$9,scratchCartesian3$9),scratchCartesian3$9=Cartesian3.normalize(scratchCartesian3$9,scratchCartesian3$9),Cartesian3.pack(scratchCartesian3$9,i,n)}var inverseTranspose=new Matrix4,normalMatrix=new Matrix3;function findAttributesInAllGeometries(e,t){var i,r=e.length,n={},a=e[0][t].attributes;for(i in a)if(a.hasOwnProperty(i)&&defined(a[i])&&defined(a[i].values)){for(var o=a[i],s=o.values.length,l=!0,c=1;c<r;++c){var u=e[c][t].attributes[i];if(!defined(u)||o.componentDatatype!==u.componentDatatype||o.componentsPerAttribute!==u.componentsPerAttribute||o.normalize!==u.normalize){l=!1;break}s+=u.values.length}l&&(n[i]=new GeometryAttribute({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:ComponentDatatype$1.createTypedArray(o.componentDatatype,s)}))}return n}GeometryPipeline.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(Matrix4.equals(t,Matrix4.IDENTITY))return e;var i=e.geometry.attributes;transformPoint(t,i.position),transformPoint(t,i.prevPosition),transformPoint(t,i.nextPosition),(defined(i.normal)||defined(i.tangent)||defined(i.bitangent))&&(Matrix4.inverse(t,inverseTranspose),Matrix4.transpose(inverseTranspose,inverseTranspose),Matrix4.getMatrix3(inverseTranspose,normalMatrix),transformVector(normalMatrix,i.normal),transformVector(normalMatrix,i.tangent),transformVector(normalMatrix,i.bitangent));i=e.geometry.boundingSphere;return defined(i)&&(e.geometry.boundingSphere=BoundingSphere.transform(i,t,i)),e.modelMatrix=Matrix4.clone(Matrix4.IDENTITY),e};var tempScratch$1=new Cartesian3;function combineGeometries(e,t){var i,r,n=e.length;e[0].modelMatrix;var a,o,s,l=defined(e[0][t].indices),c=e[0][t].primitiveType,u=findAttributesInAllGeometries(e,t);for(i in u)if(u.hasOwnProperty(i))for(a=u[i].values,h=C=0;h<n;++h)for(s=(o=e[h][t].attributes[i].values).length,r=0;r<s;++r)a[C++]=o[r];if(l){for(var d=0,h=0;h<n;++h)d+=e[h][t].indices.length;var p=Geometry.computeNumberOfVertices(new Geometry({attributes:u,primitiveType:PrimitiveType$1.POINTS})),m=IndexDatatype$1.createTypedArray(p,d),f=0,g=0;for(h=0;h<n;++h){for(var _=e[h][t].indices,y=_.length,C=0;C<y;++C)m[f++]=g+_[C];g+=Geometry.computeNumberOfVertices(e[h][t])}p=m}var v=new Cartesian3,S=0;for(h=0;h<n;++h){if(!defined(T=e[h][t].boundingSphere)){v=void 0;break}Cartesian3.add(T.center,v,v)}if(defined(v))for(Cartesian3.divideByScalar(v,n,v),h=0;h<n;++h){var T=e[h][t].boundingSphere,x=Cartesian3.magnitude(Cartesian3.subtract(T.center,v,tempScratch$1))+T.radius;S<x&&(S=x)}return new Geometry({attributes:u,indices:p,primitiveType:c,boundingSphere:defined(v)?new BoundingSphere(v,S):void 0})}GeometryPipeline.combineInstances=function(e){for(var t=[],i=[],r=e.length,n=0;n<r;++n){var a=e[n];defined(a.geometry)?t.push(a):defined(a.westHemisphereGeometry)&&defined(a.eastHemisphereGeometry)&&i.push(a)}var o=[];return 0<t.length&&o.push(combineGeometries(t,"geometry")),0<i.length&&(o.push(combineGeometries(i,"westHemisphereGeometry")),o.push(combineGeometries(i,"eastHemisphereGeometry"))),o};var normal=new Cartesian3,v0=new Cartesian3,v1$1=new Cartesian3,v2$1=new Cartesian3;GeometryPipeline.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,n=i.position.values.length/3,a=t.length,o=new Array(n),s=new Array(a/3),l=new Array(a),c=0;c<n;c++)o[c]={indexOffset:0,count:0,currentCount:0};var u=0;for(c=0;c<a;c+=3){var d=t[c],h=t[c+1],p=t[c+2],m=3*d,f=3*h,g=3*p;v0.x=r[m],v0.y=r[1+m],v0.z=r[2+m],v1$1.x=r[f],v1$1.y=r[1+f],v1$1.z=r[2+f],v2$1.x=r[g],v2$1.y=r[1+g],v2$1.z=r[2+g],o[d].count++,o[h].count++,o[p].count++,Cartesian3.subtract(v1$1,v0,v1$1),Cartesian3.subtract(v2$1,v0,v2$1),s[u]=Cartesian3.cross(v1$1,v2$1,new Cartesian3),u++}var _=0;for(c=0;c<n;c++)o[c].indexOffset+=_,_+=o[c].count;for(c=u=0;c<a;c+=3){var y,C=(y=o[t[c]]).indexOffset+y.currentCount;l[C]=u,y.currentCount++,l[(y=o[t[c+1]]).indexOffset+y.currentCount]=u,y.currentCount++,l[(y=o[t[c+2]]).indexOffset+y.currentCount]=u,y.currentCount++,u++}var v=new Float32Array(3*n);for(c=0;c<n;c++){var S=3*c;if(y=o[c],Cartesian3.clone(Cartesian3.ZERO,normal),0<y.count){for(u=0;u<y.count;u++)Cartesian3.add(normal,s[l[y.indexOffset+u]],normal);Cartesian3.equalsEpsilon(Cartesian3.ZERO,normal,CesiumMath.EPSILON10)&&Cartesian3.clone(s[l[y.indexOffset]],normal)}Cartesian3.equalsEpsilon(Cartesian3.ZERO,normal,CesiumMath.EPSILON10)&&(normal.z=1),Cartesian3.normalize(normal,normal),v[S]=normal.x,v[1+S]=normal.y,v[2+S]=normal.z}return e.attributes.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:v}),e};var normalScratch$4=new Cartesian3,normalScale=new Cartesian3,tScratch=new Cartesian3;GeometryPipeline.computeTangentAndBitangent=function(e){e.attributes;for(var t=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,n=e.attributes.st.values,a=e.attributes.position.values.length/3,o=t.length,s=new Array(3*a),l=0;l<s.length;l++)s[l]=0;for(l=0;l<o;l+=3){var c,u,d,h=t[l],p=t[l+1],m=t[l+2],f=2*h,g=2*p,_=2*m,y=i[c=3*h],C=i[c+1],v=i[c+2],S=n[f],h=n[1+f],f=n[1+g]-h,h=n[1+_]-h,S=1/((n[g]-S)*h-(n[_]-S)*f),y=(h*(i[u=3*p]-y)-f*(i[d=3*m]-y))*S,C=(h*(i[u+1]-C)-f*(i[d+1]-C))*S,S=(h*(i[u+2]-v)-f*(i[d+2]-v))*S;s[c]+=y,s[c+1]+=C,s[c+2]+=S,s[u]+=y,s[u+1]+=C,s[u+2]+=S,s[d]+=y,s[d+1]+=C,s[d+2]+=S}var T=new Float32Array(3*a),x=new Float32Array(3*a);for(l=0;l<a;l++){u=(c=3*l)+1,d=c+2;var b=Cartesian3.fromArray(r,c,normalScratch$4),E=Cartesian3.fromArray(s,c,tScratch),P=Cartesian3.dot(b,E);Cartesian3.multiplyByScalar(b,P,normalScale),Cartesian3.normalize(Cartesian3.subtract(E,normalScale,E),E),T[c]=E.x,T[u]=E.y,T[d]=E.z,Cartesian3.normalize(Cartesian3.cross(b,E,E),E),x[c]=E.x,x[u]=E.y,x[d]=E.z}return e.attributes.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:T}),e.attributes.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:x}),e};var scratchCartesian2$8=new Cartesian2,toEncode1=new Cartesian3,toEncode2=new Cartesian3,toEncode3=new Cartesian3,encodeResult2=new Cartesian2;function indexTriangles(e){if(defined(e.indices))return e;for(var t=Geometry.computeNumberOfVertices(e),i=IndexDatatype$1.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function indexTriangleFan(e){var t=Geometry.computeNumberOfVertices(e),i=IndexDatatype$1.createTypedArray(t,3*(t-2));i[0]=1,i[1]=0,i[2]=2;for(var r=3,n=3;n<t;++n)i[r++]=n-1,i[r++]=0,i[r++]=n;return e.indices=i,e.primitiveType=PrimitiveType$1.TRIANGLES,e}function indexTriangleStrip(e){var t=Geometry.computeNumberOfVertices(e),i=IndexDatatype$1.createTypedArray(t,3*(t-2));i[0]=0,i[1]=1,i[2]=2,3<t&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;n<t-1;n+=2)i[r++]=n,i[r++]=n-1,i[r++]=n+1,n+2<t&&(i[r++]=n,i[r++]=n+1,i[r++]=n+2);return e.indices=i,e.primitiveType=PrimitiveType$1.TRIANGLES,e}function indexLines(e){if(defined(e.indices))return e;for(var t=Geometry.computeNumberOfVertices(e),i=IndexDatatype$1.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function indexLineStrip(e){var t=Geometry.computeNumberOfVertices(e),i=IndexDatatype$1.createTypedArray(t,2*(t-1));i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return e.indices=i,e.primitiveType=PrimitiveType$1.LINES,e}function indexLineLoop(e){var t=Geometry.computeNumberOfVertices(e),i=IndexDatatype$1.createTypedArray(t,2*t);i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return i[r++]=t-1,i[r]=0,e.indices=i,e.primitiveType=PrimitiveType$1.LINES,e}function indexPrimitive(e){switch(e.primitiveType){case PrimitiveType$1.TRIANGLE_FAN:return indexTriangleFan(e);case PrimitiveType$1.TRIANGLE_STRIP:return indexTriangleStrip(e);case PrimitiveType$1.TRIANGLES:return indexTriangles(e);case PrimitiveType$1.LINE_STRIP:return indexLineStrip(e);case PrimitiveType$1.LINE_LOOP:return indexLineLoop(e);case PrimitiveType$1.LINES:return indexLines(e)}return e}function offsetPointFromXZPlane(e,t){Math.abs(e.y)<CesiumMath.EPSILON6&&(e.y=t?-CesiumMath.EPSILON6:CesiumMath.EPSILON6)}function offsetTriangleFromXZPlane(e,t,i){if(0!==e.y&&0!==t.y&&0!==i.y)return offsetPointFromXZPlane(e,e.y<0),offsetPointFromXZPlane(t,t.y<0),void offsetPointFromXZPlane(i,i.y<0);var r=Math.abs(e.y),n=Math.abs(t.y),a=Math.abs(i.y),n=n<r?a<r?CesiumMath.sign(e.y):CesiumMath.sign(i.y):a<n?CesiumMath.sign(t.y):CesiumMath.sign(i.y),n=n<0;offsetPointFromXZPlane(e,n),offsetPointFromXZPlane(t,n),offsetPointFromXZPlane(i,n)}GeometryPipeline.compressVertices=function(e){var t=e.attributes.extrudeDirection;if(defined(t)){for(var i=t.values,r=i.length/3,n=new Float32Array(2*r),a=0,o=0;o<r;++o)Cartesian3.fromArray(i,3*o,toEncode1),Cartesian3.equals(toEncode1,Cartesian3.ZERO)?a+=2:(encodeResult2=AttributeCompression.octEncodeInRange(toEncode1,65535,encodeResult2),n[a++]=encodeResult2.x,n[a++]=encodeResult2.y);return e.attributes.compressedAttributes=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:n}),delete e.attributes.extrudeDirection,e}var s=e.attributes.normal,l=e.attributes.st,c=defined(s),u=defined(l);if(!c&&!u)return e;var d,h,p,m,f=e.attributes.tangent,t=e.attributes.bitangent,g=defined(f),_=defined(t);c&&(d=s.values),u&&(h=l.values),g&&(p=f.values),_&&(m=t.values);f=r=(c?d:h).length/(c?3:2),t=u&&c?2:1;f*=t+=g||_?1:0;var y=new Float32Array(f),C=0;for(o=0;o<r;++o){u&&(Cartesian2.fromArray(h,2*o,scratchCartesian2$8),y[C++]=AttributeCompression.compressTextureCoordinates(scratchCartesian2$8));var v=3*o;c&&defined(p)&&defined(m)?(Cartesian3.fromArray(d,v,toEncode1),Cartesian3.fromArray(p,v,toEncode2),Cartesian3.fromArray(m,v,toEncode3),AttributeCompression.octPack(toEncode1,toEncode2,toEncode3,scratchCartesian2$8),y[C++]=scratchCartesian2$8.x,y[C++]=scratchCartesian2$8.y):(c&&(Cartesian3.fromArray(d,v,toEncode1),y[C++]=AttributeCompression.octEncodeFloat(toEncode1)),g&&(Cartesian3.fromArray(p,v,toEncode1),y[C++]=AttributeCompression.octEncodeFloat(toEncode1)),_&&(Cartesian3.fromArray(m,v,toEncode1),y[C++]=AttributeCompression.octEncodeFloat(toEncode1)))}return e.attributes.compressedAttributes=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:t,values:y}),c&&delete e.attributes.normal,u&&delete e.attributes.st,_&&delete e.attributes.bitangent,g&&delete e.attributes.tangent,e};var c3$1=new Cartesian3;function getXZIntersectionOffsetPoints(e,t,i,r){Cartesian3.add(e,Cartesian3.multiplyByScalar(Cartesian3.subtract(t,e,c3$1),e.y/(e.y-t.y),c3$1),i),Cartesian3.clone(i,r),offsetPointFromXZPlane(i,!0),offsetPointFromXZPlane(r,!1)}var u1=new Cartesian3,u2=new Cartesian3,q1=new Cartesian3,q2=new Cartesian3,splitTriangleResult={positions:new Array(7),indices:new Array(9)};function splitTriangle(e,t,i){if(!(0<=e.x||0<=t.x||0<=i.x)){offsetTriangleFromXZPlane(e,t,i);var r=e.y<0,n=t.y<0,a=i.y<0,o=0;o+=r?1:0,o+=n?1:0;var s=splitTriangleResult.indices;1==(o+=a?1:0)?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(getXZIntersectionOffsetPoints(e,t,u1,q1),getXZIntersectionOffsetPoints(e,i,u2,q2),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(getXZIntersectionOffsetPoints(t,i,u1,q1),getXZIntersectionOffsetPoints(t,e,u2,q2),s[0]=1,s[3]=2,s[4]=0,s[6]=2):a&&(getXZIntersectionOffsetPoints(i,e,u1,q1),getXZIntersectionOffsetPoints(i,t,u2,q2),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2==o&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?a||(getXZIntersectionOffsetPoints(i,e,u1,q1),getXZIntersectionOffsetPoints(i,t,u2,q2),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(getXZIntersectionOffsetPoints(t,i,u1,q1),getXZIntersectionOffsetPoints(t,e,u2,q2),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(getXZIntersectionOffsetPoints(e,t,u1,q1),getXZIntersectionOffsetPoints(e,i,u2,q2),s[0]=1,s[1]=2,s[3]=1,s[6]=0));s=splitTriangleResult.positions;return s[0]=e,s[1]=t,s[2]=i,s.length=3,1!=o&&2!=o||(s[3]=u1,s[4]=u2,s[5]=q1,s[6]=q2,s.length=7),splitTriangleResult}}function updateGeometryAfterSplit(e,t){var i=e.attributes;if(0!==i.position.values.length){for(var r in i)i.hasOwnProperty(r)&&defined(i[r])&&defined(i[r].values)&&((r=i[r]).values=ComponentDatatype$1.createTypedArray(r.componentDatatype,r.values));var n=Geometry.computeNumberOfVertices(e);return e.indices=IndexDatatype$1.createTypedArray(n,e.indices),t&&(e.boundingSphere=BoundingSphere.fromVertices(i.position.values)),e}}function copyGeometryForSplit(e){var t,i,r=e.attributes,n={};for(t in r)r.hasOwnProperty(t)&&defined(r[t])&&defined(r[t].values)&&(i=r[t],n[t]=new GeometryAttribute({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]}));return new Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function updateInstanceAfterSplit(e,t,i){var r=defined(e.geometry.boundingSphere);t=updateGeometryAfterSplit(t,r),defined(i=updateGeometryAfterSplit(i,r))&&!defined(t)?e.geometry=i:!defined(i)&&defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function generateBarycentricInterpolateFunction(l,c){var u=new l,d=new l,h=new l;return function(e,t,i,r,n,a,o,s){e=l.fromArray(n,e*c,u),t=l.fromArray(n,t*c,d),i=l.fromArray(n,i*c,h);l.multiplyByScalar(e,r.x,e),l.multiplyByScalar(t,r.y,t),l.multiplyByScalar(i,r.z,i);e=l.add(e,t,e);l.add(e,i,e),s&&l.normalize(e,e),l.pack(e,a,o*c)}}var interpolateAndPackCartesian4=generateBarycentricInterpolateFunction(Cartesian4,4),interpolateAndPackCartesian3=generateBarycentricInterpolateFunction(Cartesian3,3),interpolateAndPackCartesian2=generateBarycentricInterpolateFunction(Cartesian2,2),interpolateAndPackBoolean=function(e,t,i,r,n,a,o){e=n[e]*r.x,t=n[t]*r.y,r=n[i]*r.z;a[o]=e+t+r>CesiumMath.EPSILON6?1:0},p0Scratch=new Cartesian3,p1Scratch$2=new Cartesian3,p2Scratch$2=new Cartesian3,barycentricScratch=new Cartesian3;function computeTriangleAttributes(e,t,i,r,n,a,o,s,l,c,u,d,h,p,m,f){if(defined(a)||defined(o)||defined(s)||defined(l)||defined(c)||0!==p){var g,_=barycentricCoordinates(r,Cartesian3.fromArray(n,3*e,p0Scratch),Cartesian3.fromArray(n,3*t,p1Scratch$2),Cartesian3.fromArray(n,3*i,p2Scratch$2),barycentricScratch);if(defined(a)&&interpolateAndPackCartesian3(e,t,i,_,a,d.normal.values,f,!0),defined(c)&&(n=Cartesian3.fromArray(c,3*e,p0Scratch),a=Cartesian3.fromArray(c,3*t,p1Scratch$2),c=Cartesian3.fromArray(c,3*i,p2Scratch$2),Cartesian3.multiplyByScalar(n,_.x,n),Cartesian3.multiplyByScalar(a,_.y,a),Cartesian3.multiplyByScalar(c,_.z,c),Cartesian3.equals(n,Cartesian3.ZERO)&&Cartesian3.equals(a,Cartesian3.ZERO)&&Cartesian3.equals(c,Cartesian3.ZERO)?((g=p0Scratch).x=0,g.y=0,g.z=0):(g=Cartesian3.add(n,a,n),Cartesian3.add(g,c,g),Cartesian3.normalize(g,g)),Cartesian3.pack(g,d.extrudeDirection.values,3*f)),defined(u)&&interpolateAndPackBoolean(e,t,i,_,u,d.applyOffset.values,f),defined(o)&&interpolateAndPackCartesian3(e,t,i,_,o,d.tangent.values,f,!0),defined(s)&&interpolateAndPackCartesian3(e,t,i,_,s,d.bitangent.values,f,!0),defined(l)&&interpolateAndPackCartesian2(e,t,i,_,l,d.st.values,f),0<p)for(var y=0;y<p;y++){var C=h[y];genericInterpolate(e,t,i,_,f,m[C],d[C])}}}function genericInterpolate(e,t,i,r,n,a,o){var s=a.componentsPerAttribute,l=a.values,c=o.values;switch(s){case 4:interpolateAndPackCartesian4(e,t,i,r,l,c,n,!1);break;case 3:interpolateAndPackCartesian3(e,t,i,r,l,c,n,!1);break;case 2:interpolateAndPackCartesian2(e,t,i,r,l,c,n,!1);break;default:c[n]=l[e]*r.x+l[t]*r.y+l[i]*r.z}}function insertSplitPoint(e,t,i,r,n,a){var o=e.position.values.length/3;if(-1===n)return e.position.values.push(a.x,a.y,a.z),t.push(o),o;r=r[n],n=i[r];return-1===n?(i[r]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(n),n)}var NAMED_ATTRIBUTES={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function splitLongitudeTriangles(e){var t,i=e.geometry,r=i.attributes,n=r.position.values,a=defined(r.normal)?r.normal.values:void 0,o=defined(r.bitangent)?r.bitangent.values:void 0,s=defined(r.tangent)?r.tangent.values:void 0,l=defined(r.st)?r.st.values:void 0,c=defined(r.extrudeDirection)?r.extrudeDirection.values:void 0,u=defined(r.applyOffset)?r.applyOffset.values:void 0,d=i.indices,h=[];for(t in r)r.hasOwnProperty(t)&&!NAMED_ATTRIBUTES[t]&&defined(r[t])&&h.push(t);var p,m,f=h.length,g=copyGeometryForSplit(i),_=copyGeometryForSplit(i),y=[];y.length=n.length/3;var C=[];for(C.length=n.length/3,S=0;S<y.length;++S)y[S]=-1,C[S]=-1;for(var v=d.length,S=0;S<v;S+=3){var T=d[S],x=d[S+1],b=d[S+2],E=Cartesian3.fromArray(n,3*T),P=Cartesian3.fromArray(n,3*x),A=Cartesian3.fromArray(n,3*b),w=splitTriangle(E,P,A);if(defined(w)&&3<w.positions.length)for(var D=w.positions,M=w.indices,I=M.length,R=0;R<I;++R){var O=M[R],L=D[O],F=L.y<0?(p=_.attributes,m=_.indices,y):(p=g.attributes,m=g.indices,C);computeTriangleAttributes(T,x,b,L,n,a,s,o,l,c,u,p,h,f,r,insertSplitPoint(p,m,F,d,O<3?S+O:-1,L))}else defined(w)&&(E=w.positions[0],P=w.positions[1],A=w.positions[2]),F=E.y<0?(p=_.attributes,m=_.indices,y):(p=g.attributes,m=g.indices,C),computeTriangleAttributes(T,x,b,E,n,a,s,o,l,c,u,p,h,f,r,insertSplitPoint(p,m,F,d,S,E)),computeTriangleAttributes(T,x,b,P,n,a,s,o,l,c,u,p,h,f,r,insertSplitPoint(p,m,F,d,S+1,P)),computeTriangleAttributes(T,x,b,A,n,a,s,o,l,c,u,p,h,f,r,insertSplitPoint(p,m,F,d,S+2,A))}updateInstanceAfterSplit(e,_,g)}var xzPlane=Plane.fromPointNormal(Cartesian3.ZERO,Cartesian3.UNIT_Y),offsetScratch$c=new Cartesian3,offsetPointScratch=new Cartesian3;function computeLineAttributes(e,t,i,r,n,a,o){defined(o)&&(r=Cartesian3.fromArray(r,3*e,p0Scratch),Cartesian3.equalsEpsilon(r,i,CesiumMath.EPSILON10)?a.applyOffset.values[n]=o[e]:a.applyOffset.values[n]=o[t])}function splitLongitudeLines(e){var t,i=e.geometry,r=i.attributes,n=r.position.values,a=defined(r.applyOffset)?r.applyOffset.values:void 0,o=i.indices,s=copyGeometryForSplit(i),l=copyGeometryForSplit(i),c=o.length,u=[];u.length=n.length/3;var d=[];for(d.length=n.length/3,t=0;t<u.length;++t)u[t]=-1,d[t]=-1;for(t=0;t<c;t+=2){var h=o[t],p=o[t+1],m=Cartesian3.fromArray(n,3*h,p0Scratch),f=Cartesian3.fromArray(n,3*p,p1Scratch$2);Math.abs(m.y)<CesiumMath.EPSILON6&&(m.y<0?m.y=-CesiumMath.EPSILON6:m.y=CesiumMath.EPSILON6),Math.abs(f.y)<CesiumMath.EPSILON6&&(f.y<0?f.y=-CesiumMath.EPSILON6:f.y=CesiumMath.EPSILON6);var g,_,y,C,v=s.attributes,S=s.indices,T=d,x=l.attributes,b=l.indices,E=u,P=IntersectionTests.lineSegmentPlane(m,f,xzPlane,p2Scratch$2);defined(P)?(g=Cartesian3.multiplyByScalar(Cartesian3.UNIT_Y,5*CesiumMath.EPSILON9,offsetScratch$c),m.y<0&&(Cartesian3.negate(g,g),v=l.attributes,S=l.indices,T=u,x=s.attributes,b=s.indices,E=d),_=Cartesian3.add(P,g,offsetPointScratch),computeLineAttributes(h,p,m,n,insertSplitPoint(v,S,T,o,t,m),v,a),computeLineAttributes(h,p,_,n,insertSplitPoint(v,S,T,o,-1,_),v,a),Cartesian3.negate(g,g),Cartesian3.add(P,g,_),computeLineAttributes(h,p,_,n,insertSplitPoint(x,b,E,o,-1,_),x,a),computeLineAttributes(h,p,f,n,insertSplitPoint(x,b,E,o,t+1,f),x,a)):(x=m.y<0?(y=l.attributes,C=l.indices,u):(y=s.attributes,C=s.indices,d),computeLineAttributes(h,p,m,n,insertSplitPoint(y,C,x,o,t,m),y,a),computeLineAttributes(h,p,f,n,insertSplitPoint(y,C,x,o,t+1,f),y,a))}updateInstanceAfterSplit(e,l,s)}var cartesian2Scratch0=new Cartesian2,cartesian2Scratch1=new Cartesian2,cartesian3Scratch0=new Cartesian3,cartesian3Scratch2$1=new Cartesian3,cartesian3Scratch3$1=new Cartesian3,cartesian3Scratch4=new Cartesian3,cartesian3Scratch5=new Cartesian3,cartesian3Scratch6=new Cartesian3,cartesian4Scratch0=new Cartesian4;function updateAdjacencyAfterSplit(e){for(var e=e.attributes,t=e.position.values,i=e.prevPosition.values,r=e.nextPosition.values,n=t.length,a=0;a<n;a+=3){var o,s=Cartesian3.unpack(t,a,cartesian3Scratch0);0<s.x||(o=Cartesian3.unpack(i,a,cartesian3Scratch2$1),(s.y<0&&0<o.y||0<s.y&&o.y<0)&&(0<a-3?(i[a]=t[a-3],i[a+1]=t[a-2],i[a+2]=t[a-1]):Cartesian3.pack(s,i,a)),o=Cartesian3.unpack(r,a,cartesian3Scratch3$1),(s.y<0&&0<o.y||0<s.y&&o.y<0)&&(a+3<n?(r[a]=t[a+3],r[a+1]=t[a+4],r[a+2]=t[a+5]):Cartesian3.pack(s,r,a)))}}var offsetScalar=5*CesiumMath.EPSILON9,coplanarOffset=CesiumMath.EPSILON6;function splitLongitudePolyline(e){for(var t=e.geometry,i=t.attributes,r=i.position.values,n=i.prevPosition.values,a=i.nextPosition.values,o=i.expandAndWidth.values,s=defined(i.st)?i.st.values:void 0,l=defined(i.color)?i.color.values:void 0,c=copyGeometryForSplit(t),u=copyGeometryForSplit(t),d=!1,h=r.length/3,p=0;p<h;p+=4){var m=p,f=p+2,g=Cartesian3.fromArray(r,3*m,cartesian3Scratch0),_=Cartesian3.fromArray(r,3*f,cartesian3Scratch2$1);if(Math.abs(g.y)<coplanarOffset)for(g.y=coplanarOffset*(_.y<0?-1:1),r[3*p+1]=g.y,r[3*(p+1)+1]=g.y,w=3*m;w<3*m+12;w+=3)n[w]=r[3*p],n[w+1]=r[3*p+1],n[w+2]=r[3*p+2];if(Math.abs(_.y)<coplanarOffset)for(_.y=coplanarOffset*(g.y<0?-1:1),r[3*(p+2)+1]=_.y,r[3*(p+3)+1]=_.y,w=3*m;w<3*m+12;w+=3)a[w]=r[3*(p+2)],a[w+1]=r[3*(p+2)+1],a[w+2]=r[3*(p+2)+2];var y=c.attributes,C=c.indices,v=u.attributes,S=u.indices,T=IntersectionTests.lineSegmentPlane(g,_,xzPlane,cartesian3Scratch4);if(defined(T)){var d=!0,x=Cartesian3.multiplyByScalar(Cartesian3.UNIT_Y,offsetScalar,cartesian3Scratch5);g.y<0&&(Cartesian3.negate(x,x),y=u.attributes,C=u.indices,v=c.attributes,S=c.indices);var b=Cartesian3.add(T,x,cartesian3Scratch6);y.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),y.position.values.push(b.x,b.y,b.z),y.position.values.push(b.x,b.y,b.z),y.prevPosition.values.push(n[3*m],n[3*m+1],n[3*m+2]),y.prevPosition.values.push(n[3*m+3],n[3*m+4],n[3*m+5]),y.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),y.nextPosition.values.push(b.x,b.y,b.z),y.nextPosition.values.push(b.x,b.y,b.z),y.nextPosition.values.push(b.x,b.y,b.z),y.nextPosition.values.push(b.x,b.y,b.z),Cartesian3.negate(x,x),Cartesian3.add(T,x,b),v.position.values.push(b.x,b.y,b.z),v.position.values.push(b.x,b.y,b.z),v.position.values.push(_.x,_.y,_.z,_.x,_.y,_.z),v.prevPosition.values.push(b.x,b.y,b.z),v.prevPosition.values.push(b.x,b.y,b.z),v.prevPosition.values.push(b.x,b.y,b.z),v.prevPosition.values.push(b.x,b.y,b.z),v.nextPosition.values.push(_.x,_.y,_.z,_.x,_.y,_.z),v.nextPosition.values.push(a[3*f],a[3*f+1],a[3*f+2]),v.nextPosition.values.push(a[3*f+3],a[3*f+4],a[3*f+5]);var E=Cartesian2.fromArray(o,2*m,cartesian2Scratch0),P=Math.abs(E.y);y.expandAndWidth.values.push(-1,P,1,P),y.expandAndWidth.values.push(-1,-P,1,-P),v.expandAndWidth.values.push(-1,P,1,P),v.expandAndWidth.values.push(-1,-P,1,-P);x=Cartesian3.magnitudeSquared(Cartesian3.subtract(T,g,cartesian3Scratch3$1));if(x/=Cartesian3.magnitudeSquared(Cartesian3.subtract(_,g,cartesian3Scratch3$1)),defined(l)){for(var b=Cartesian4.fromArray(l,4*m,cartesian4Scratch0),A=Cartesian4.fromArray(l,4*f,cartesian4Scratch0),E=CesiumMath.lerp(b.x,A.x,x),P=CesiumMath.lerp(b.y,A.y,x),T=CesiumMath.lerp(b.z,A.z,x),A=CesiumMath.lerp(b.w,A.w,x),w=4*m;w<4*m+8;++w)y.color.values.push(l[w]);for(y.color.values.push(E,P,T,A),y.color.values.push(E,P,T,A),v.color.values.push(E,P,T,A),v.color.values.push(E,P,T,A),w=4*f;w<4*f+8;++w)v.color.values.push(l[w])}if(defined(s)){var A=Cartesian2.fromArray(s,2*m,cartesian2Scratch0),D=Cartesian2.fromArray(s,2*(p+3),cartesian2Scratch1),x=CesiumMath.lerp(A.x,D.x,x);for(w=2*m;w<2*m+4;++w)y.st.values.push(s[w]);for(y.st.values.push(x,A.y),y.st.values.push(x,D.y),v.st.values.push(x,A.y),v.st.values.push(x,D.y),w=2*f;w<2*f+4;++w)v.st.values.push(s[w])}D=y.position.values.length/3-4,C.push(D,D+2,D+1),C.push(D+1,D+2,D+3),D=v.position.values.length/3-4,S.push(D,D+2,D+1),S.push(D+1,D+2,D+3)}else{var M,S=g.y<0?(M=u.attributes,u.indices):(M=c.attributes,c.indices);for(M.position.values.push(g.x,g.y,g.z),M.position.values.push(g.x,g.y,g.z),M.position.values.push(_.x,_.y,_.z),M.position.values.push(_.x,_.y,_.z),w=3*p;w<3*p+12;++w)M.prevPosition.values.push(n[w]),M.nextPosition.values.push(a[w]);for(w=2*p;w<2*p+8;++w)M.expandAndWidth.values.push(o[w]),defined(s)&&M.st.values.push(s[w]);if(defined(l))for(w=4*p;w<4*p+16;++w)M.color.values.push(l[w]);D=M.position.values.length/3-4,S.push(D,D+2,D+1),S.push(D+1,D+2,D+3)}}d&&(updateAdjacencyAfterSplit(u),updateAdjacencyAfterSplit(c)),updateInstanceAfterSplit(e,u,c)}GeometryPipeline.splitLongitude=function(e){var t=e.geometry,i=t.boundingSphere;if(defined(i)&&(0<i.center.x-i.radius||BoundingSphere.intersectPlane(i,Plane.ORIGIN_ZX_PLANE)!==Intersect$1.INTERSECTING))return e;if(t.geometryType!==GeometryType$1.NONE)switch(t.geometryType){case GeometryType$1.POLYLINES:splitLongitudePolyline(e);break;case GeometryType$1.TRIANGLES:splitLongitudeTriangles(e);break;case GeometryType$1.LINES:splitLongitudeLines(e)}else indexPrimitive(t),t.primitiveType===PrimitiveType$1.TRIANGLES?splitLongitudeTriangles(e):t.primitiveType===PrimitiveType$1.LINES&&splitLongitudeLines(e);return e};var scratchCartesian1$5=new Cartesian3,scratchCartesian2$7=new Cartesian3,scratchCartesian3$8=new Cartesian3,scratchCartesian4$5=new Cartesian3,texCoordScratch=new Cartesian2,textureMatrixScratch$1=new Matrix3,tangentMatrixScratch$1=new Matrix3,quaternionScratch$3=new Quaternion,scratchNormal$5=new Cartesian3,scratchTangent$4=new Cartesian3,scratchBitangent$4=new Cartesian3,scratchCartographic$e=new Cartographic,projectedCenterScratch=new Cartesian3,scratchMinTexCoord=new Cartesian2,scratchMaxTexCoord=new Cartesian2;function computeTopBottomAttributes(e,t,i){var r=t.vertexFormat,n=t.center,a=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,l=t.stRotation,c=i?e.length/3*2:e.length/3,u=t.shadowVolume,d=r.st?new Float32Array(2*c):void 0,h=r.normal?new Float32Array(3*c):void 0,p=r.tangent?new Float32Array(3*c):void 0,m=r.bitangent?new Float32Array(3*c):void 0,f=u?new Float32Array(3*c):void 0,g=0,_=scratchNormal$5,y=scratchTangent$4,C=scratchBitangent$4,v=new GeographicProjection(s),S=v.project(s.cartesianToCartographic(n,scratchCartographic$e),projectedCenterScratch),n=s.scaleToGeodeticSurface(n,scratchCartesian1$5);s.geodeticSurfaceNormal(n,n);var T=textureMatrixScratch$1,x=tangentMatrixScratch$1;x=0!==l?(N=Quaternion.fromAxisAngle(n,l,quaternionScratch$3),T=Matrix3.fromQuaternion(N,T),N=Quaternion.fromAxisAngle(n,-l,quaternionScratch$3),Matrix3.fromQuaternion(N,x)):(T=Matrix3.clone(Matrix3.IDENTITY,T),Matrix3.clone(Matrix3.IDENTITY,x));for(var b=Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,scratchMinTexCoord),E=Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,scratchMaxTexCoord),P=e.length,A=i?P:0,w=A/3*2,D=0;D<P;D+=3){var M,I=D+1,R=D+2,O=Cartesian3.fromArray(e,D,scratchCartesian1$5);r.st&&(M=Matrix3.multiplyByVector(T,O,scratchCartesian2$7),M=v.project(s.cartesianToCartographic(M,scratchCartographic$e),scratchCartesian3$8),Cartesian3.subtract(M,S,M),texCoordScratch.x=(M.x+a)/(2*a),texCoordScratch.y=(M.y+o)/(2*o),b.x=Math.min(texCoordScratch.x,b.x),b.y=Math.min(texCoordScratch.y,b.y),E.x=Math.max(texCoordScratch.x,E.x),E.y=Math.max(texCoordScratch.y,E.y),i&&(d[g+w]=texCoordScratch.x,d[g+1+w]=texCoordScratch.y),d[g++]=texCoordScratch.x,d[g++]=texCoordScratch.y),(r.normal||r.tangent||r.bitangent||u)&&(_=s.geodeticSurfaceNormal(O,_),u&&(f[D+A]=-_.x,f[I+A]=-_.y,f[R+A]=-_.z),(r.normal||r.tangent||r.bitangent)&&((r.tangent||r.bitangent)&&(y=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,_,y),y),Matrix3.multiplyByVector(x,y,y)),r.normal&&(h[D]=_.x,h[I]=_.y,h[R]=_.z,i&&(h[D+A]=-_.x,h[I+A]=-_.y,h[R+A]=-_.z)),r.tangent&&(p[D]=y.x,p[I]=y.y,p[R]=y.z,i&&(p[D+A]=-y.x,p[I+A]=-y.y,p[R+A]=-y.z)),r.bitangent&&(C=Cartesian3.normalize(Cartesian3.cross(_,y,C),C),m[D]=C.x,m[I]=C.y,m[R]=C.z,i&&(m[D+A]=C.x,m[I+A]=C.y,m[R+A]=C.z))))}if(r.st)for(var P=d.length,L=0;L<P;L+=2)d[L]=(d[L]-b.x)/(E.x-b.x),d[L+1]=(d[L+1]-b.y)/(E.y-b.y);var F,N=new GeometryAttributes;return r.position&&(F=EllipseGeometryLibrary.raisePositionsToHeight(e,t,i),N.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:F})),r.st&&(N.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:d})),r.normal&&(N.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(N.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(N.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:m})),u&&(N.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:f})),i&&defined(t.offsetAttribute)&&(F=new Uint8Array(c),F=t.offsetAttribute===GeometryOffsetAttribute$1.TOP?arrayFill(F,1,0,c/2):arrayFill(F,t.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),N.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})),N}function topIndices(e){for(var t,i,r=new Array(e*(e+1)*12-6),n=0,a=0,o=1,s=0;s<3;s++)r[n++]=o++,r[n++]=a,r[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,a=(s-1)*s-1,r[n++]=o++,r[n++]=a,r[n++]=o,t=2*s,i=0;i<t-1;++i)r[n++]=o,r[n++]=a++,r[n++]=a,r[n++]=o++,r[n++]=a,r[n++]=o;r[n++]=o++,r[n++]=a,r[n++]=o}for(t=2*e,++o,++a,s=0;s<t-1;++s)r[n++]=o,r[n++]=a++,r[n++]=a,r[n++]=o++,r[n++]=a,r[n++]=o;for(r[n++]=o,r[n++]=a++,r[n++]=a,r[n++]=o++,r[n++]=a++,r[n++]=a,++a,s=e-1;1<s;--s){for(r[n++]=a++,r[n++]=a,r[n++]=o,t=2*s,i=0;i<t-1;++i)r[n++]=o,r[n++]=a++,r[n++]=a,r[n++]=o++,r[n++]=a,r[n++]=o;r[n++]=a++,r[n++]=a++,r[n++]=o++}for(s=0;s<3;s++)r[n++]=a++,r[n++]=a,r[n++]=o;return r}var boundingSphereCenter$1=new Cartesian3;function computeEllipse$1(e){var t=e.center;boundingSphereCenter$1=Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,boundingSphereCenter$1),e.height,boundingSphereCenter$1);var i=new BoundingSphere(boundingSphereCenter$1=Cartesian3.add(t,boundingSphereCenter$1,boundingSphereCenter$1),e.semiMajorAxis),r=EllipseGeometryLibrary.computeEllipsePositions(e,!0,!1),t=r.positions,r=r.numPts,e=computeTopBottomAttributes(t,e,!1),r=topIndices(r);return{boundingSphere:i,attributes:e,indices:r=IndexDatatype$1.createTypedArray(t.length/3,r)}}function computeWallAttributes(e,t){var i=t.vertexFormat,r=t.center,n=t.semiMajorAxis,a=t.semiMinorAxis,o=t.ellipsoid,s=t.height,l=t.extrudedHeight,c=t.stRotation,u=e.length/3*2,d=new Float64Array(3*u),h=i.st?new Float32Array(2*u):void 0,p=i.normal?new Float32Array(3*u):void 0,m=i.tangent?new Float32Array(3*u):void 0,f=i.bitangent?new Float32Array(3*u):void 0,g=t.shadowVolume,_=g?new Float32Array(3*u):void 0,y=0,C=scratchNormal$5,v=scratchTangent$4,S=scratchBitangent$4,T=new GeographicProjection(o),x=T.project(o.cartesianToCartographic(r,scratchCartographic$e),projectedCenterScratch),r=o.scaleToGeodeticSurface(r,scratchCartesian1$5);o.geodeticSurfaceNormal(r,r);for(var r=Quaternion.fromAxisAngle(r,c,quaternionScratch$3),b=Matrix3.fromQuaternion(r,textureMatrixScratch$1),E=Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,scratchMinTexCoord),P=Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,scratchMaxTexCoord),A=(L=e.length)/3*2,w=0;w<L;w+=3){var D=w+1,M=w+2,I=Cartesian3.fromArray(e,w,scratchCartesian1$5);i.st&&(O=Matrix3.multiplyByVector(b,I,scratchCartesian2$7),R=T.project(o.cartesianToCartographic(O,scratchCartographic$e),scratchCartesian3$8),Cartesian3.subtract(R,x,R),texCoordScratch.x=(R.x+n)/(2*n),texCoordScratch.y=(R.y+a)/(2*a),E.x=Math.min(texCoordScratch.x,E.x),E.y=Math.min(texCoordScratch.y,E.y),P.x=Math.max(texCoordScratch.x,P.x),P.y=Math.max(texCoordScratch.y,P.y),h[y+A]=texCoordScratch.x,h[y+1+A]=texCoordScratch.y,h[y++]=texCoordScratch.x,h[y++]=texCoordScratch.y),I=o.scaleToGeodeticSurface(I,I),O=Cartesian3.clone(I,scratchCartesian2$7),C=o.geodeticSurfaceNormal(I,C),g&&(_[w+L]=-C.x,_[D+L]=-C.y,_[M+L]=-C.z);var R=Cartesian3.multiplyByScalar(C,s,scratchCartesian4$5),I=Cartesian3.add(I,R,I),R=Cartesian3.multiplyByScalar(C,l,R),O=Cartesian3.add(O,R,O);i.position&&(d[w+L]=O.x,d[D+L]=O.y,d[M+L]=O.z,d[w]=I.x,d[D]=I.y,d[M]=I.z),(i.normal||i.tangent||i.bitangent)&&(S=Cartesian3.clone(C,S),R=Cartesian3.fromArray(e,(w+3)%L,scratchCartesian4$5),Cartesian3.subtract(R,I,R),I=Cartesian3.subtract(O,I,scratchCartesian3$8),C=Cartesian3.normalize(Cartesian3.cross(I,R,C),C),i.normal&&(p[w]=C.x,p[D]=C.y,p[M]=C.z,p[w+L]=C.x,p[D+L]=C.y,p[M+L]=C.z),i.tangent&&(v=Cartesian3.normalize(Cartesian3.cross(S,C,v),v),m[w]=v.x,m[D]=v.y,m[M]=v.z,m[w+L]=v.x,m[w+1+L]=v.y,m[w+2+L]=v.z),i.bitangent&&(f[w]=S.x,f[D]=S.y,f[M]=S.z,f[w+L]=S.x,f[D+L]=S.y,f[M+L]=S.z))}if(i.st)for(var L=h.length,F=0;F<L;F+=2)h[F]=(h[F]-E.x)/(P.x-E.x),h[F+1]=(h[F+1]-E.y)/(P.y-E.y);c=new GeometryAttributes;return i.position&&(c.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:d})),i.st&&(c.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(c.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(c.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:m})),i.bitangent&&(c.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:f})),g&&(c.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:_})),defined(t.offsetAttribute)&&(r=new Uint8Array(u),r=t.offsetAttribute===GeometryOffsetAttribute$1.TOP?arrayFill(r,1,0,u/2):arrayFill(r,t.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),c.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})),c}function computeWallIndices(e){for(var t=e.length/3,i=IndexDatatype$1.createTypedArray(t,6*t),r=0,n=0;n<t;n++){var a=n+t,o=(n+1)%t,s=o+t;i[r++]=n,i[r++]=a,i[r++]=o,i[r++]=o,i[r++]=a,i[r++]=s}return i}var topBoundingSphere$3=new BoundingSphere,bottomBoundingSphere$3=new BoundingSphere;function computeExtrudedEllipse$1(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,n=Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,scratchCartesian1$5),e.height,scratchCartesian1$5);topBoundingSphere$3.center=Cartesian3.add(t,n,topBoundingSphere$3.center),topBoundingSphere$3.radius=r,n=Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,n),e.extrudedHeight,n),bottomBoundingSphere$3.center=Cartesian3.add(t,n,bottomBoundingSphere$3.center),bottomBoundingSphere$3.radius=r;var a=EllipseGeometryLibrary.computeEllipsePositions(e,!0,!0),i=a.positions,t=a.numPts,n=a.outerPositions,r=BoundingSphere.union(topBoundingSphere$3,bottomBoundingSphere$3),a=computeTopBottomAttributes(i,e,!0),o=(c=topIndices(t)).length;c.length=2*o;for(var s=i.length/3,l=0;l<o;l+=3)c[l+o]=c[l+2]+s,c[l+1+o]=c[l+1]+s,c[l+2+o]=c[l]+s;var a=new Geometry({attributes:a,indices:IndexDatatype$1.createTypedArray(2*s/3,c),primitiveType:PrimitiveType$1.TRIANGLES}),e=computeWallAttributes(n,e),c=computeWallIndices(n),n=new Geometry({attributes:e,indices:IndexDatatype$1.createTypedArray(2*n.length/3,c),primitiveType:PrimitiveType$1.TRIANGLES}),n=GeometryPipeline.combineInstances([new GeometryInstance({geometry:a}),new GeometryInstance({geometry:n})]);return{boundingSphere:r,attributes:n[0].attributes,indices:n[0].indices}}function computeRectangle$3(e,t,i,r,n,a,o){for(var s=EllipseGeometryLibrary.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:i,rotation:r,granularity:n},!1,!0).outerPositions,l=s.length/3,c=new Array(l),u=0;u<l;++u)c[u]=Cartesian3.fromArray(s,3*u);o=Rectangle.fromCartesianArray(c,a,o);return o.width>CesiumMath.PI&&(o.north=0<o.north?CesiumMath.PI_OVER_TWO-CesiumMath.EPSILON7:o.north,o.south=o.south<0?CesiumMath.EPSILON7-CesiumMath.PI_OVER_TWO:o.south,o.east=CesiumMath.PI,o.west=-CesiumMath.PI),o}function EllipseGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).center,i=defaultValue(e.ellipsoid,Ellipsoid.WGS84),r=e.semiMajorAxis,n=e.semiMinorAxis,a=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),o=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),s=defaultValue(e.height,0),l=defaultValue(e.extrudedHeight,s);this._center=Cartesian3.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=n,this._ellipsoid=Ellipsoid.clone(i),this._rotation=defaultValue(e.rotation,0),this._stRotation=defaultValue(e.stRotation,0),this._height=Math.max(l,s),this._granularity=a,this._vertexFormat=VertexFormat.clone(o),this._extrudedHeight=Math.min(l,s),this._shadowVolume=defaultValue(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}EllipseGeometry.packedLength=Cartesian3.packedLength+Ellipsoid.packedLength+VertexFormat.packedLength+9,EllipseGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._center,t,i),i+=Cartesian3.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchCenter$5=new Cartesian3,scratchEllipsoid$e=new Ellipsoid,scratchVertexFormat$b=new VertexFormat,scratchOptions$l={center:scratchCenter$5,ellipsoid:scratchEllipsoid$e,vertexFormat:scratchVertexFormat$b,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};function textureCoordinateRotationPoints$2(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];for(var i=EllipseGeometryLibrary.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,n=new Array(r),a=0;a<r;++a)n[a]=Cartesian3.fromArray(i,3*a);var o=e._ellipsoid,e=e.rectangle;return Geometry._textureCoordinateRotationPoints(n,t,o,e)}function CircleGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).radius,e={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 EllipseGeometry(e),this._workerName="createCircleGeometry"}EllipseGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchCenter$5);t+=Cartesian3.packedLength;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$e);t+=Ellipsoid.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$b);t+=VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],d=e[t++],h=e[t++],p=1===e[t++],t=e[t];return defined(i)?(i._center=Cartesian3.clone(r,i._center),i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._semiMajorAxis=o,i._semiMinorAxis=s,i._rotation=l,i._stRotation=c,i._height=u,i._granularity=d,i._extrudedHeight=h,i._shadowVolume=p,i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$l.height=u,scratchOptions$l.extrudedHeight=h,scratchOptions$l.granularity=d,scratchOptions$l.stRotation=c,scratchOptions$l.rotation=l,scratchOptions$l.semiMajorAxis=o,scratchOptions$l.semiMinorAxis=s,scratchOptions$l.shadowVolume=p,scratchOptions$l.offsetAttribute=-1===t?void 0:t,new EllipseGeometry(scratchOptions$l))},EllipseGeometry.computeRectangle=function(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).center,r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=e.semiMajorAxis,a=e.semiMinorAxis,o=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE);return computeRectangle$3(i,n,a,defaultValue(e.rotation,0),o,r,t)},EllipseGeometry.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!CesiumMath.equalsEpsilon(t,i,0,CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var n,t={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};return r?(t.extrudedHeight=i,t.shadowVolume=e._shadowVolume,t.offsetAttribute=e._offsetAttribute,n=computeExtrudedEllipse$1(t)):(n=computeEllipse$1(t),defined(e._offsetAttribute)&&(t=n.attributes.position.values.length,arrayFill(t=new Uint8Array(t/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),n.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:t}))),new Geometry({attributes:n.attributes,indices:n.indices,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:n.boundingSphere,offsetAttribute:e._offsetAttribute})}},EllipseGeometry.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,t=t(r,n),i=i(r,n);return new EllipseGeometry({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:t,height:i,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(EllipseGeometry.prototype,{rectangle:{get:function(){return defined(this._rectangle)||(this._rectangle=computeRectangle$3(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=textureCoordinateRotationPoints$2(this)),this._textureCoordinateRotationPoints}}}),CircleGeometry.packedLength=EllipseGeometry.packedLength,CircleGeometry.pack=function(e,t,i){return EllipseGeometry.pack(e._ellipseGeometry,t,i)};var scratchEllipseGeometry$1=new EllipseGeometry({center:new Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),scratchOptions$k={center:new Cartesian3,radius:void 0,ellipsoid:Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};CircleGeometry.unpack=function(e,t,i){t=EllipseGeometry.unpack(e,t,scratchEllipseGeometry$1);return scratchOptions$k.center=Cartesian3.clone(t._center,scratchOptions$k.center),scratchOptions$k.ellipsoid=Ellipsoid.clone(t._ellipsoid,scratchOptions$k.ellipsoid),scratchOptions$k.height=t._height,scratchOptions$k.extrudedHeight=t._extrudedHeight,scratchOptions$k.granularity=t._granularity,scratchOptions$k.vertexFormat=VertexFormat.clone(t._vertexFormat,scratchOptions$k.vertexFormat),scratchOptions$k.stRotation=t._stRotation,scratchOptions$k.shadowVolume=t._shadowVolume,defined(i)?(scratchOptions$k.semiMajorAxis=t._semiMajorAxis,scratchOptions$k.semiMinorAxis=t._semiMinorAxis,i._ellipseGeometry=new EllipseGeometry(scratchOptions$k),i):(scratchOptions$k.radius=t._semiMajorAxis,new CircleGeometry(scratchOptions$k))},CircleGeometry.createGeometry=function(e){return EllipseGeometry.createGeometry(e._ellipseGeometry)},CircleGeometry.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,t=t(r,n),i=i(r,n);return new CircleGeometry({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:t,height:i,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(CircleGeometry.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var scratchCartesian1$4=new Cartesian3,boundingSphereCenter=new Cartesian3;function computeEllipse(e){var t=e.center;boundingSphereCenter=Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,boundingSphereCenter),e.height,boundingSphereCenter);for(var i=new BoundingSphere(boundingSphereCenter=Cartesian3.add(t,boundingSphereCenter,boundingSphereCenter),e.semiMajorAxis),t=EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,e=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:EllipseGeometryLibrary.raisePositionsToHeight(t,e,!1)})}),r=t.length/3,n=IndexDatatype$1.createTypedArray(r,2*r),a=0,o=0;o<r;++o)n[a++]=o,n[a++]=(o+1)%r;return{boundingSphere:i,attributes:e,indices:n}}var topBoundingSphere$2=new BoundingSphere,bottomBoundingSphere$2=new BoundingSphere;function computeExtrudedEllipse(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,n=Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,scratchCartesian1$4),e.height,scratchCartesian1$4);topBoundingSphere$2.center=Cartesian3.add(t,n,topBoundingSphere$2.center),topBoundingSphere$2.radius=r,n=Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,n),e.extrudedHeight,n),bottomBoundingSphere$2.center=Cartesian3.add(t,n,bottomBoundingSphere$2.center),bottomBoundingSphere$2.radius=r;var t=EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,n=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:EllipseGeometryLibrary.raisePositionsToHeight(t,e,!0)})}),t=n.position.values,r=BoundingSphere.union(topBoundingSphere$2,bottomBoundingSphere$2),a=t.length/3;defined(e.offsetAttribute)&&(o=new Uint8Array(a),o=e.offsetAttribute===GeometryOffsetAttribute$1.TOP?arrayFill(o,1,0,a/2):arrayFill(o,e.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),n.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:o}));var o=defaultValue(e.numberOfVerticalLines,16),o=CesiumMath.clamp(o,0,a/2),s=IndexDatatype$1.createTypedArray(a,2*a+2*o);a/=2;var l=0;for(d=0;d<a;++d)s[l++]=d,s[l++]=(d+1)%a,s[l++]=d+a,s[l++]=(d+1)%a+a;if(0<o)for(var e=Math.min(o,a),c=Math.round(a/e),u=Math.min(c*o,a),d=0;d<u;d+=c)s[l++]=d,s[l++]=d+a;return{boundingSphere:r,attributes:n,indices:s}}function EllipseOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).center,i=defaultValue(e.ellipsoid,Ellipsoid.WGS84),r=e.semiMajorAxis,n=e.semiMinorAxis,a=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),o=defaultValue(e.height,0),s=defaultValue(e.extrudedHeight,o);this._center=Cartesian3.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=n,this._ellipsoid=Ellipsoid.clone(i),this._rotation=defaultValue(e.rotation,0),this._height=Math.max(s,o),this._granularity=a,this._extrudedHeight=Math.min(s,o),this._numberOfVerticalLines=Math.max(defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}EllipseOutlineGeometry.packedLength=Cartesian3.packedLength+Ellipsoid.packedLength+8,EllipseOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._center,t,i),i+=Cartesian3.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.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]=defaultValue(e._offsetAttribute,-1),t};var scratchCenter$4=new Cartesian3,scratchEllipsoid$d=new Ellipsoid,scratchOptions$j={center:scratchCenter$4,ellipsoid:scratchEllipsoid$d,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};function CircleOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).radius,e={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 EllipseOutlineGeometry(e),this._workerName="createCircleOutlineGeometry"}EllipseOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchCenter$4);t+=Cartesian3.packedLength;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$d);t+=Ellipsoid.packedLength;var a=e[t++],o=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],d=e[t++],t=e[t];return defined(i)?(i._center=Cartesian3.clone(r,i._center),i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._semiMajorAxis=a,i._semiMinorAxis=o,i._rotation=s,i._height=l,i._granularity=c,i._extrudedHeight=u,i._numberOfVerticalLines=d,i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$j.height=l,scratchOptions$j.extrudedHeight=u,scratchOptions$j.granularity=c,scratchOptions$j.rotation=s,scratchOptions$j.semiMajorAxis=a,scratchOptions$j.semiMinorAxis=o,scratchOptions$j.numberOfVerticalLines=d,scratchOptions$j.offsetAttribute=-1===t?void 0:t,new EllipseOutlineGeometry(scratchOptions$j))},EllipseOutlineGeometry.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!CesiumMath.equalsEpsilon(t,i,0,CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var n,t={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return r?(t.extrudedHeight=i,t.offsetAttribute=e._offsetAttribute,n=computeExtrudedEllipse(t)):(n=computeEllipse(t),defined(e._offsetAttribute)&&(t=n.attributes.position.values.length,arrayFill(t=new Uint8Array(t/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),n.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:t}))),new Geometry({attributes:n.attributes,indices:n.indices,primitiveType:PrimitiveType$1.LINES,boundingSphere:n.boundingSphere,offsetAttribute:e._offsetAttribute})}},CircleOutlineGeometry.packedLength=EllipseOutlineGeometry.packedLength,CircleOutlineGeometry.pack=function(e,t,i){return EllipseOutlineGeometry.pack(e._ellipseGeometry,t,i)};var scratchEllipseGeometry=new EllipseOutlineGeometry({center:new Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),scratchOptions$i={center:new Cartesian3,radius:void 0,ellipsoid:Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};CircleOutlineGeometry.unpack=function(e,t,i){t=EllipseOutlineGeometry.unpack(e,t,scratchEllipseGeometry);return scratchOptions$i.center=Cartesian3.clone(t._center,scratchOptions$i.center),scratchOptions$i.ellipsoid=Ellipsoid.clone(t._ellipsoid,scratchOptions$i.ellipsoid),scratchOptions$i.height=t._height,scratchOptions$i.extrudedHeight=t._extrudedHeight,scratchOptions$i.granularity=t._granularity,scratchOptions$i.numberOfVerticalLines=t._numberOfVerticalLines,defined(i)?(scratchOptions$i.semiMajorAxis=t._semiMajorAxis,scratchOptions$i.semiMinorAxis=t._semiMinorAxis,i._ellipseGeometry=new EllipseOutlineGeometry(scratchOptions$i),i):(scratchOptions$i.radius=t._semiMajorAxis,new CircleOutlineGeometry(scratchOptions$i))},CircleOutlineGeometry.createGeometry=function(e){return EllipseOutlineGeometry.createGeometry(e._ellipseGeometry)};var ClockRange={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},ClockRange$1=Object.freeze(ClockRange),ClockStep={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},ClockStep$1=Object.freeze(ClockStep),getTimestamp,getTimestamp="undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()},getTimestamp$1=getTimestamp,scratchArrayBuffer,scratchUint32Array,scratchUint8Array;function Clock(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).currentTime,i=e.startTime,r=e.stopTime,t=defined(t)?JulianDate.clone(t):defined(i)?JulianDate.clone(i):defined(r)?JulianDate.addDays(r,-1,new JulianDate):JulianDate.now(),i=defined(i)?JulianDate.clone(i):JulianDate.clone(t),r=defined(r)?JulianDate.clone(r):JulianDate.addDays(i,1,new JulianDate);this.startTime=i,this.stopTime=r,this.clockRange=defaultValue(e.clockRange,ClockRange$1.UNBOUNDED),this.canAnimate=defaultValue(e.canAnimate,!0),this.onTick=new Event,this.onStop=new Event,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=getTimestamp$1(),this.currentTime=t,this.multiplier=defaultValue(e.multiplier,1),this.shouldAnimate=defaultValue(e.shouldAnimate,!1),this.clockStep=defaultValue(e.clockStep,ClockStep$1.SYSTEM_CLOCK_MULTIPLIER)}function hue2rgb(e,t,i){return i<0&&(i+=1),1<i&&--i,6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function Color(e,t,i,r){this.red=defaultValue(e,1),this.green=defaultValue(t,1),this.blue=defaultValue(i,1),this.alpha=defaultValue(r,1)}Object.defineProperties(Clock.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){JulianDate.equals(this._currentTime,e)||(this._clockStep===ClockStep$1.SYSTEM_CLOCK&&(this._clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===ClockStep$1.SYSTEM_CLOCK&&(this._clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===ClockStep$1.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=JulianDate.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===ClockStep$1.SYSTEM_CLOCK&&(this._clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),Clock.prototype.tick=function(){var e=getTimestamp$1(),t=JulianDate.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var i=this._clockStep;if(i===ClockStep$1.SYSTEM_CLOCK)t=JulianDate.now(t);else{var r=this._multiplier;t=i===ClockStep$1.TICK_DEPENDENT?JulianDate.addSeconds(t,r,t):(n=e-this._lastSystemTime,JulianDate.addSeconds(t,r*(n/1e3),t));var n=this.clockRange,a=this.startTime,o=this.stopTime;if(n===ClockRange$1.CLAMPED)JulianDate.lessThan(t,a)?t=JulianDate.clone(a,t):JulianDate.greaterThan(t,o)&&(t=JulianDate.clone(o,t),this.onStop.raiseEvent(this));else if(n===ClockRange$1.LOOP_STOP)for(JulianDate.lessThan(t,a)&&(t=JulianDate.clone(a,t));JulianDate.greaterThan(t,o);)t=JulianDate.addSeconds(a,JulianDate.secondsDifference(t,o),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t},Color.fromCartesian4=function(e,t){return defined(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new Color(e.x,e.y,e.z,e.w)},Color.fromBytes=function(e,t,i,r,n){return e=Color.byteToFloat(defaultValue(e,255)),t=Color.byteToFloat(defaultValue(t,255)),i=Color.byteToFloat(defaultValue(i,255)),r=Color.byteToFloat(defaultValue(r,255)),defined(n)?(n.red=e,n.green=t,n.blue=i,n.alpha=r,n):new Color(e,t,i,r)},Color.fromAlpha=function(e,t,i){return defined(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=t,i):new Color(e.red,e.green,e.blue,t)},FeatureDetection.supportsTypedArrays()&&(scratchArrayBuffer=new ArrayBuffer(4),scratchUint32Array=new Uint32Array(scratchArrayBuffer),scratchUint8Array=new Uint8Array(scratchArrayBuffer)),Color.fromRgba=function(e,t){return scratchUint32Array[0]=e,Color.fromBytes(scratchUint8Array[0],scratchUint8Array[1],scratchUint8Array[2],scratchUint8Array[3],t)},Color.fromHsl=function(e,t,i,r,n){e=defaultValue(e,0)%1,t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,1);var a=i,o=i,s=i;return 0!==t&&(a=hue2rgb(t=2*i-(i=i<.5?i*(1+t):i+t-i*t),i,e+1/3),o=hue2rgb(t,i,e),s=hue2rgb(t,i,e-1/3)),defined(n)?(n.red=a,n.green=o,n.blue=s,n.alpha=r,n):new Color(a,o,s,r)},Color.fromRandom=function(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).red;defined(i)||(r=defaultValue(e.minimumRed,0),n=defaultValue(e.maximumRed,1),i=r+CesiumMath.nextRandomNumber()*(n-r));var r,n=e.green;defined(n)||(a=defaultValue(e.minimumGreen,0),r=defaultValue(e.maximumGreen,1),n=a+CesiumMath.nextRandomNumber()*(r-a));var a=e.blue;defined(a)||(o=defaultValue(e.minimumBlue,0),s=defaultValue(e.maximumBlue,1),a=o+CesiumMath.nextRandomNumber()*(s-o));var o,s=e.alpha;return defined(s)||(o=defaultValue(e.minimumAlpha,0),e=defaultValue(e.maximumAlpha,1),s=o+CesiumMath.nextRandomNumber()*(e-o)),defined(t)?(t.red=i,t.green=n,t.blue=a,t.alpha=s,t):new Color(i,n,a,s)};var rgbaMatcher=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,rrggbbaaMatcher=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,rgbParenthesesMatcher=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,hslParenthesesMatcher=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;function ColorGeometryInstanceAttribute(e,t,i,r){e=defaultValue(e,1),t=defaultValue(t,1),i=defaultValue(i,1),r=defaultValue(r,1),this.value=new Uint8Array([Color.floatToByte(e),Color.floatToByte(t),Color.floatToByte(i),Color.floatToByte(r)])}function CompressedTextureBuffer(e,t,i,r){this._format=e,this._width=t,this._height=i,this._buffer=r}Color.fromCssColorString=function(e,t){defined(t)||(t=new Color);var i=Color[(e=e.replace(/\s/g,"")).toUpperCase()];if(defined(i))return Color.clone(i,t),t;i=rgbaMatcher.exec(e);return null!==i?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(defaultValue(i[4],"f"),16)/15,t):null!==(i=rrggbbaaMatcher.exec(e))?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(defaultValue(i[4],"ff"),16)/255,t):null!==(i=rgbParenthesesMatcher.exec(e))?(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(defaultValue(i[4],"1.0")),t):null!==(i=hslParenthesesMatcher.exec(e))?Color.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(defaultValue(i[4],"1.0")),t):t=void 0},Color.packedLength=4,Color.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.red,t[i++]=e.green,t[i++]=e.blue,t[i]=e.alpha,t},Color.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new Color:i).red=e[t++],i.green=e[t++],i.blue=e[t++],i.alpha=e[t],i},Color.byteToFloat=function(e){return e/255},Color.floatToByte=function(e){return 1===e?255:256*e|0},Color.clone=function(e,t){if(defined(e))return defined(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new Color(e.red,e.green,e.blue,e.alpha)},Color.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},Color.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},Color.prototype.clone=function(e){return Color.clone(this,e)},Color.prototype.equals=function(e){return Color.equals(this,e)},Color.prototype.equalsEpsilon=function(e,t){return this===e||defined(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},Color.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},Color.prototype.toCssColorString=function(){var e=Color.floatToByte(this.red),t=Color.floatToByte(this.green),i=Color.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},Color.prototype.toCssHexString=function(){var e=Color.floatToByte(this.red).toString(16);e.length<2&&(e="0"+e);var t=Color.floatToByte(this.green).toString(16);t.length<2&&(t="0"+t);var i=Color.floatToByte(this.blue).toString(16);if(i.length<2&&(i="0"+i),this.alpha<1){var r=Color.floatToByte(this.alpha).toString(16);return"#"+e+t+i+(r=r.length<2?"0"+r:r)}return"#"+e+t+i},Color.prototype.toBytes=function(e){var t=Color.floatToByte(this.red),i=Color.floatToByte(this.green),r=Color.floatToByte(this.blue),n=Color.floatToByte(this.alpha);return defined(e)?(e[0]=t,e[1]=i,e[2]=r,e[3]=n,e):[t,i,r,n]},Color.prototype.toRgba=function(){return scratchUint8Array[0]=Color.floatToByte(this.red),scratchUint8Array[1]=Color.floatToByte(this.green),scratchUint8Array[2]=Color.floatToByte(this.blue),scratchUint8Array[3]=Color.floatToByte(this.alpha),scratchUint32Array[0]},Color.prototype.brighten=function(e,t){return t.red=1-(1-this.red)*(e=1-e),t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},Color.prototype.darken=function(e,t){return t.red=this.red*(e=1-e),t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},Color.prototype.withAlpha=function(e,t){return Color.fromAlpha(this,e,t)},Color.add=function(e,t,i){return i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},Color.subtract=function(e,t,i){return i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},Color.multiply=function(e,t,i){return i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},Color.divide=function(e,t,i){return i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},Color.mod=function(e,t,i){return i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},Color.lerp=function(e,t,i,r){return r.red=CesiumMath.lerp(e.red,t.red,i),r.green=CesiumMath.lerp(e.green,t.green,i),r.blue=CesiumMath.lerp(e.blue,t.blue,i),r.alpha=CesiumMath.lerp(e.alpha,t.alpha,i),r},Color.multiplyByScalar=function(e,t,i){return i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},Color.divideByScalar=function(e,t,i){return i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},Color.ALICEBLUE=Object.freeze(Color.fromCssColorString("#F0F8FF")),Color.ANTIQUEWHITE=Object.freeze(Color.fromCssColorString("#FAEBD7")),Color.AQUA=Object.freeze(Color.fromCssColorString("#00FFFF")),Color.AQUAMARINE=Object.freeze(Color.fromCssColorString("#7FFFD4")),Color.AZURE=Object.freeze(Color.fromCssColorString("#F0FFFF")),Color.BEIGE=Object.freeze(Color.fromCssColorString("#F5F5DC")),Color.BISQUE=Object.freeze(Color.fromCssColorString("#FFE4C4")),Color.BLACK=Object.freeze(Color.fromCssColorString("#000000")),Color.BLANCHEDALMOND=Object.freeze(Color.fromCssColorString("#FFEBCD")),Color.BLUE=Object.freeze(Color.fromCssColorString("#0000FF")),Color.BLUEVIOLET=Object.freeze(Color.fromCssColorString("#8A2BE2")),Color.BROWN=Object.freeze(Color.fromCssColorString("#A52A2A")),Color.BURLYWOOD=Object.freeze(Color.fromCssColorString("#DEB887")),Color.CADETBLUE=Object.freeze(Color.fromCssColorString("#5F9EA0")),Color.CHARTREUSE=Object.freeze(Color.fromCssColorString("#7FFF00")),Color.CHOCOLATE=Object.freeze(Color.fromCssColorString("#D2691E")),Color.CORAL=Object.freeze(Color.fromCssColorString("#FF7F50")),Color.CORNFLOWERBLUE=Object.freeze(Color.fromCssColorString("#6495ED")),Color.CORNSILK=Object.freeze(Color.fromCssColorString("#FFF8DC")),Color.CRIMSON=Object.freeze(Color.fromCssColorString("#DC143C")),Color.CYAN=Object.freeze(Color.fromCssColorString("#00FFFF")),Color.DARKBLUE=Object.freeze(Color.fromCssColorString("#00008B")),Color.DARKCYAN=Object.freeze(Color.fromCssColorString("#008B8B")),Color.DARKGOLDENROD=Object.freeze(Color.fromCssColorString("#B8860B")),Color.DARKGRAY=Object.freeze(Color.fromCssColorString("#A9A9A9")),Color.DARKGREEN=Object.freeze(Color.fromCssColorString("#006400")),Color.DARKGREY=Color.DARKGRAY,Color.DARKKHAKI=Object.freeze(Color.fromCssColorString("#BDB76B")),Color.DARKMAGENTA=Object.freeze(Color.fromCssColorString("#8B008B")),Color.DARKOLIVEGREEN=Object.freeze(Color.fromCssColorString("#556B2F")),Color.DARKORANGE=Object.freeze(Color.fromCssColorString("#FF8C00")),Color.DARKORCHID=Object.freeze(Color.fromCssColorString("#9932CC")),Color.DARKRED=Object.freeze(Color.fromCssColorString("#8B0000")),Color.DARKSALMON=Object.freeze(Color.fromCssColorString("#E9967A")),Color.DARKSEAGREEN=Object.freeze(Color.fromCssColorString("#8FBC8F")),Color.DARKSLATEBLUE=Object.freeze(Color.fromCssColorString("#483D8B")),Color.DARKSLATEGRAY=Object.freeze(Color.fromCssColorString("#2F4F4F")),Color.DARKSLATEGREY=Color.DARKSLATEGRAY,Color.DARKTURQUOISE=Object.freeze(Color.fromCssColorString("#00CED1")),Color.DARKVIOLET=Object.freeze(Color.fromCssColorString("#9400D3")),Color.DEEPPINK=Object.freeze(Color.fromCssColorString("#FF1493")),Color.DEEPSKYBLUE=Object.freeze(Color.fromCssColorString("#00BFFF")),Color.DIMGRAY=Object.freeze(Color.fromCssColorString("#696969")),Color.DIMGREY=Color.DIMGRAY,Color.DODGERBLUE=Object.freeze(Color.fromCssColorString("#1E90FF")),Color.FIREBRICK=Object.freeze(Color.fromCssColorString("#B22222")),Color.FLORALWHITE=Object.freeze(Color.fromCssColorString("#FFFAF0")),Color.FORESTGREEN=Object.freeze(Color.fromCssColorString("#228B22")),Color.FUCHSIA=Object.freeze(Color.fromCssColorString("#FF00FF")),Color.GAINSBORO=Object.freeze(Color.fromCssColorString("#DCDCDC")),Color.GHOSTWHITE=Object.freeze(Color.fromCssColorString("#F8F8FF")),Color.GOLD=Object.freeze(Color.fromCssColorString("#FFD700")),Color.GOLDENROD=Object.freeze(Color.fromCssColorString("#DAA520")),Color.GRAY=Object.freeze(Color.fromCssColorString("#808080")),Color.GREEN=Object.freeze(Color.fromCssColorString("#008000")),Color.GREENYELLOW=Object.freeze(Color.fromCssColorString("#ADFF2F")),Color.GREY=Color.GRAY,Color.HONEYDEW=Object.freeze(Color.fromCssColorString("#F0FFF0")),Color.HOTPINK=Object.freeze(Color.fromCssColorString("#FF69B4")),Color.INDIANRED=Object.freeze(Color.fromCssColorString("#CD5C5C")),Color.INDIGO=Object.freeze(Color.fromCssColorString("#4B0082")),Color.IVORY=Object.freeze(Color.fromCssColorString("#FFFFF0")),Color.KHAKI=Object.freeze(Color.fromCssColorString("#F0E68C")),Color.LAVENDER=Object.freeze(Color.fromCssColorString("#E6E6FA")),Color.LAVENDAR_BLUSH=Object.freeze(Color.fromCssColorString("#FFF0F5")),Color.LAWNGREEN=Object.freeze(Color.fromCssColorString("#7CFC00")),Color.LEMONCHIFFON=Object.freeze(Color.fromCssColorString("#FFFACD")),Color.LIGHTBLUE=Object.freeze(Color.fromCssColorString("#ADD8E6")),Color.LIGHTCORAL=Object.freeze(Color.fromCssColorString("#F08080")),Color.LIGHTCYAN=Object.freeze(Color.fromCssColorString("#E0FFFF")),Color.LIGHTGOLDENRODYELLOW=Object.freeze(Color.fromCssColorString("#FAFAD2")),Color.LIGHTGRAY=Object.freeze(Color.fromCssColorString("#D3D3D3")),Color.LIGHTGREEN=Object.freeze(Color.fromCssColorString("#90EE90")),Color.LIGHTGREY=Color.LIGHTGRAY,Color.LIGHTPINK=Object.freeze(Color.fromCssColorString("#FFB6C1")),Color.LIGHTSEAGREEN=Object.freeze(Color.fromCssColorString("#20B2AA")),Color.LIGHTSKYBLUE=Object.freeze(Color.fromCssColorString("#87CEFA")),Color.LIGHTSLATEGRAY=Object.freeze(Color.fromCssColorString("#778899")),Color.LIGHTSLATEGREY=Color.LIGHTSLATEGRAY,Color.LIGHTSTEELBLUE=Object.freeze(Color.fromCssColorString("#B0C4DE")),Color.LIGHTYELLOW=Object.freeze(Color.fromCssColorString("#FFFFE0")),Color.LIME=Object.freeze(Color.fromCssColorString("#00FF00")),Color.LIMEGREEN=Object.freeze(Color.fromCssColorString("#32CD32")),Color.LINEN=Object.freeze(Color.fromCssColorString("#FAF0E6")),Color.MAGENTA=Object.freeze(Color.fromCssColorString("#FF00FF")),Color.MAROON=Object.freeze(Color.fromCssColorString("#800000")),Color.MEDIUMAQUAMARINE=Object.freeze(Color.fromCssColorString("#66CDAA")),Color.MEDIUMBLUE=Object.freeze(Color.fromCssColorString("#0000CD")),Color.MEDIUMORCHID=Object.freeze(Color.fromCssColorString("#BA55D3")),Color.MEDIUMPURPLE=Object.freeze(Color.fromCssColorString("#9370DB")),Color.MEDIUMSEAGREEN=Object.freeze(Color.fromCssColorString("#3CB371")),Color.MEDIUMSLATEBLUE=Object.freeze(Color.fromCssColorString("#7B68EE")),Color.MEDIUMSPRINGGREEN=Object.freeze(Color.fromCssColorString("#00FA9A")),Color.MEDIUMTURQUOISE=Object.freeze(Color.fromCssColorString("#48D1CC")),Color.MEDIUMVIOLETRED=Object.freeze(Color.fromCssColorString("#C71585")),Color.MIDNIGHTBLUE=Object.freeze(Color.fromCssColorString("#191970")),Color.MINTCREAM=Object.freeze(Color.fromCssColorString("#F5FFFA")),Color.MISTYROSE=Object.freeze(Color.fromCssColorString("#FFE4E1")),Color.MOCCASIN=Object.freeze(Color.fromCssColorString("#FFE4B5")),Color.NAVAJOWHITE=Object.freeze(Color.fromCssColorString("#FFDEAD")),Color.NAVY=Object.freeze(Color.fromCssColorString("#000080")),Color.OLDLACE=Object.freeze(Color.fromCssColorString("#FDF5E6")),Color.OLIVE=Object.freeze(Color.fromCssColorString("#808000")),Color.OLIVEDRAB=Object.freeze(Color.fromCssColorString("#6B8E23")),Color.ORANGE=Object.freeze(Color.fromCssColorString("#FFA500")),Color.ORANGERED=Object.freeze(Color.fromCssColorString("#FF4500")),Color.ORCHID=Object.freeze(Color.fromCssColorString("#DA70D6")),Color.PALEGOLDENROD=Object.freeze(Color.fromCssColorString("#EEE8AA")),Color.PALEGREEN=Object.freeze(Color.fromCssColorString("#98FB98")),Color.PALETURQUOISE=Object.freeze(Color.fromCssColorString("#AFEEEE")),Color.PALEVIOLETRED=Object.freeze(Color.fromCssColorString("#DB7093")),Color.PAPAYAWHIP=Object.freeze(Color.fromCssColorString("#FFEFD5")),Color.PEACHPUFF=Object.freeze(Color.fromCssColorString("#FFDAB9")),Color.PERU=Object.freeze(Color.fromCssColorString("#CD853F")),Color.PINK=Object.freeze(Color.fromCssColorString("#FFC0CB")),Color.PLUM=Object.freeze(Color.fromCssColorString("#DDA0DD")),Color.POWDERBLUE=Object.freeze(Color.fromCssColorString("#B0E0E6")),Color.PURPLE=Object.freeze(Color.fromCssColorString("#800080")),Color.RED=Object.freeze(Color.fromCssColorString("#FF0000")),Color.ROSYBROWN=Object.freeze(Color.fromCssColorString("#BC8F8F")),Color.ROYALBLUE=Object.freeze(Color.fromCssColorString("#4169E1")),Color.SADDLEBROWN=Object.freeze(Color.fromCssColorString("#8B4513")),Color.SALMON=Object.freeze(Color.fromCssColorString("#FA8072")),Color.SANDYBROWN=Object.freeze(Color.fromCssColorString("#F4A460")),Color.SEAGREEN=Object.freeze(Color.fromCssColorString("#2E8B57")),Color.SEASHELL=Object.freeze(Color.fromCssColorString("#FFF5EE")),Color.SIENNA=Object.freeze(Color.fromCssColorString("#A0522D")),Color.SILVER=Object.freeze(Color.fromCssColorString("#C0C0C0")),Color.SKYBLUE=Object.freeze(Color.fromCssColorString("#87CEEB")),Color.SLATEBLUE=Object.freeze(Color.fromCssColorString("#6A5ACD")),Color.SLATEGRAY=Object.freeze(Color.fromCssColorString("#708090")),Color.SLATEGREY=Color.SLATEGRAY,Color.SNOW=Object.freeze(Color.fromCssColorString("#FFFAFA")),Color.SPRINGGREEN=Object.freeze(Color.fromCssColorString("#00FF7F")),Color.STEELBLUE=Object.freeze(Color.fromCssColorString("#4682B4")),Color.TAN=Object.freeze(Color.fromCssColorString("#D2B48C")),Color.TEAL=Object.freeze(Color.fromCssColorString("#008080")),Color.THISTLE=Object.freeze(Color.fromCssColorString("#D8BFD8")),Color.TOMATO=Object.freeze(Color.fromCssColorString("#FF6347")),Color.TURQUOISE=Object.freeze(Color.fromCssColorString("#40E0D0")),Color.VIOLET=Object.freeze(Color.fromCssColorString("#EE82EE")),Color.WHEAT=Object.freeze(Color.fromCssColorString("#F5DEB3")),Color.WHITE=Object.freeze(Color.fromCssColorString("#FFFFFF")),Color.WHITESMOKE=Object.freeze(Color.fromCssColorString("#F5F5F5")),Color.YELLOW=Object.freeze(Color.fromCssColorString("#FFFF00")),Color.YELLOWGREEN=Object.freeze(Color.fromCssColorString("#9ACD32")),Color.TRANSPARENT=Object.freeze(new Color(0,0,0,0)),Object.defineProperties(ColorGeometryInstanceAttribute.prototype,{componentDatatype:{get:function(){return ComponentDatatype$1.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),ColorGeometryInstanceAttribute.fromColor=function(e){return new ColorGeometryInstanceAttribute(e.red,e.green,e.blue,e.alpha)},ColorGeometryInstanceAttribute.toValue=function(e,t){return defined(t)?e.toBytes(t):new Uint8Array(e.toBytes())},ColorGeometryInstanceAttribute.equals=function(e,t){return e===t||defined(e)&&defined(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]},Object.defineProperties(CompressedTextureBuffer.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),CompressedTextureBuffer.clone=function(e){if(defined(e))return new CompressedTextureBuffer(e._format,e._width,e._height,e._buffer)},CompressedTextureBuffer.prototype.clone=function(){return CompressedTextureBuffer.clone(this)};var CoplanarPolygonGeometryLibrary={},scratchIntersectionPoint=new Cartesian3,scratchXAxis=new Cartesian3,scratchYAxis=new Cartesian3,scratchZAxis=new Cartesian3,obbScratch=new OrientedBoundingBox;function projectTo2D(e,t,i,r,n){t=Cartesian3.subtract(e,t,scratchIntersectionPoint),i=Cartesian3.dot(i,t),t=Cartesian3.dot(r,t);return Cartesian2.fromElements(i,t,n)}function calculateM(e,t,i){if(0===e)return t*i;var r=e*e,n=r*r,a=n*r,o=a*r,s=o*r,e=s*r,i=i;return t*((1-r/4-3*n/64-5*a/256-175*o/16384-441*s/65536-4851*e/1048576)*i-(3*r/8+3*n/32+45*a/1024+105*o/4096+2205*s/131072+6237*e/524288)*Math.sin(2*i)+(15*n/256+45*a/1024+525*o/16384+1575*s/65536+155925*e/8388608)*Math.sin(4*i)-(35*a/3072+175*o/12288+3675*s/262144+13475*e/1048576)*Math.sin(6*i)+(315*o/131072+2205*s/524288+43659*e/8388608)*Math.sin(8*i)-(693*s/1310720+6237*e/5242880)*Math.sin(10*i)+1001*e/8388608*Math.sin(12*i))}function calculateInverseM(e,t,i){var r=e/i;if(0===t)return r;var n=r*r,a=n*r,o=a*r,s=t*t,l=s*s,c=l*s,u=c*s,d=u*s,h=d*s,p=Math.sin(2*r),m=Math.cos(2*r),f=Math.sin(4*r),g=Math.cos(4*r),_=Math.sin(6*r),y=Math.cos(6*r),e=Math.sin(8*r),i=Math.cos(8*r),t=Math.sin(10*r);return r+r*s/4+7*r*l/64+15*r*c/256+579*r*u/16384+1515*r*d/65536+16837*r*h/1048576+(3*r*l/16+45*r*c/256-r*(32*n-561)*u/4096-r*(232*n-1677)*d/16384+r*(399985-90560*n+512*o)*h/5242880)*m+(21*r*c/256+483*r*u/4096-r*(224*n-1969)*d/16384-r*(33152*n-112599)*h/1048576)*g+(151*r*u/4096+4681*r*d/65536+1479*r*h/16384-453*a*h/32768)*y+(1097*r*d/65536+42783*r*h/1048576)*i+8011*r*h/1048576*Math.cos(10*r)+(3*s/8+3*l/16+213*c/2048-3*n*c/64+255*u/4096-33*n*u/512+20861*d/524288-33*n*d/512+o*d/1024+28273*h/1048576-471*n*h/8192+9*o*h/4096)*p+(21*l/256+21*c/256+533*u/8192-21*n*u/512+197*d/4096-315*n*d/4096+584039*h/16777216-12517*n*h/131072+7*o*h/2048)*f+(151*c/6144+151*u/4096+5019*d/131072-453*n*d/16384+26965*h/786432-8607*n*h/131072)*_+(1097*u/131072+1097*d/65536+225797*h/10485760-1097*n*h/65536)*e+(8011*d/2621440+8011*h/1048576)*t+293393*h/251658240*Math.sin(12*r)}function calculateSigma(e,t){if(0===e)return Math.log(Math.tan(.5*(CesiumMath.PI_OVER_TWO+t)));var i=e*Math.sin(t);return Math.log(Math.tan(.5*(CesiumMath.PI_OVER_TWO+t)))-e/2*Math.log((1+i)/(1-i))}function calculateHeading(e,t,i,r,n){i=calculateSigma(e._ellipticity,i),n=calculateSigma(e._ellipticity,n);return Math.atan2(CesiumMath.negativePiToPi(r-t),n-i)}function calculateArcLength(e,t,i,r,n,a,o){var s=e._heading,a=a-r,r=0;return r=CesiumMath.equalsEpsilon(Math.abs(s),CesiumMath.PI_OVER_TWO,CesiumMath.EPSILON8)?t===i?t*Math.cos(n)*CesiumMath.negativePiToPi(a):(i=Math.sin(n),t*Math.cos(n)*CesiumMath.negativePiToPi(a)/Math.sqrt(1-e._ellipticitySquared*i*i)):(n=calculateM(e._ellipticity,t,n),(calculateM(e._ellipticity,t,o)-n)/Math.cos(s)),Math.abs(r)}CoplanarPolygonGeometryLibrary.validOutline=function(e){var t=OrientedBoundingBox.fromPoints(e,obbScratch).halfAxes,i=Matrix3.getColumn(t,0,scratchXAxis),e=Matrix3.getColumn(t,1,scratchYAxis),t=Matrix3.getColumn(t,2,scratchZAxis),i=Cartesian3.magnitude(i),e=Cartesian3.magnitude(e),t=Cartesian3.magnitude(t);return!(0===i&&(0===e||0===t)||0===e&&0===t)},CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments=function(e,t,i,r){var n,a,o=OrientedBoundingBox.fromPoints(e,obbScratch),s=o.halfAxes,l=Matrix3.getColumn(s,0,scratchXAxis),c=Matrix3.getColumn(s,1,scratchYAxis),u=Matrix3.getColumn(s,2,scratchZAxis),d=Cartesian3.magnitude(l),h=Cartesian3.magnitude(c),e=Cartesian3.magnitude(u),s=Math.min(d,h,e);return(0!==d||0!==h&&0!==e)&&(0!==h||0!==e)&&(s!==h&&s!==e||(n=l),s===d?n=c:s===e&&(a=c),s!==d&&s!==h||(a=u),Cartesian3.normalize(n,i),Cartesian3.normalize(a,r),Cartesian3.clone(o.center,t),!0)},CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction=function(r,n,a){return function(e){for(var t=new Array(e.length),i=0;i<e.length;i++)t[i]=projectTo2D(e[i],r,n,a);return t}},CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction=function(i,r,n){return function(e,t){return projectTo2D(e,i,r,n,t)}};var scratchCart1$1=new Cartesian3,scratchCart2$2=new Cartesian3;function computeProperties$1(e,t,i,r){Cartesian3.normalize(r.cartographicToCartesian(t,scratchCart2$2),scratchCart1$1),Cartesian3.normalize(r.cartographicToCartesian(i,scratchCart2$2),scratchCart2$2);var n=r.maximumRadius,a=r.minimumRadius,n=n*n;e._ellipticitySquared=(n-a*a)/n,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=Cartographic.clone(t,e._start),e._start.height=0,e._end=Cartographic.clone(i,e._end),e._end.height=0,e._heading=calculateHeading(e,t.longitude,t.latitude,i.longitude,i.latitude),e._distance=calculateArcLength(e,r.maximumRadius,r.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude)}function interpolateUsingSurfaceDistance(e,t,i,r,n,a){if(0===i)return Cartographic.clone(e,a);var o,s,l,c=n*n;return l=Math.abs(CesiumMath.PI_OVER_TWO-Math.abs(t))>CesiumMath.EPSILON8?(o=calculateInverseM(calculateM(n,r,e.latitude)+i*Math.cos(t),n,r),l=calculateSigma(n,e.latitude),s=calculateSigma(n,o),l=Math.tan(t)*(s-l),CesiumMath.negativePiToPi(e.longitude+l)):(o=e.latitude,l=i/(0===n?r*Math.cos(e.latitude):(n=Math.sin(e.latitude),r*Math.cos(e.latitude)/Math.sqrt(1-c*n*n))),0<t?CesiumMath.negativePiToPi(e.longitude+l):CesiumMath.negativePiToPi(e.longitude-l)),defined(a)?(a.longitude=l,a.latitude=o,a.height=0,a):new Cartographic(l,o,0)}function EllipsoidRhumbLine(e,t,i){i=defaultValue(i,Ellipsoid.WGS84);this._ellipsoid=i,this._start=new Cartographic,this._end=new Cartographic,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,defined(e)&&defined(t)&&computeProperties$1(this,e,t,i)}function earcut(e,t,i){i=i||2;var r,n,a,o,s,l=t&&t.length,c=l?t[0]*i:e.length,u=linkedList(e,0,c,i,!0),d=[];if(!u||u.next===u.prev)return d;if(l&&(u=eliminateHoles(e,t,u,i)),e.length>80*i){for(var h=r=e[0],p=n=e[1],m=i;m<c;m+=i)(a=e[m])<h&&(h=a),(o=e[m+1])<p&&(p=o),r<a&&(r=a),n<o&&(n=o);s=0!==(s=Math.max(r-h,n-p))?1/s:0}return earcutLinked(u,d,i,h,p,s),d}function linkedList(e,t,i,r,n){var a,o;if(n===0<signedArea(e,t,i,r))for(a=t;a<i;a+=r)o=insertNode(a,e[a],e[a+1],o);else for(a=i-r;t<=a;a-=r)o=insertNode(a,e[a],e[a+1],o);return o&&equals(o,o.next)&&(removeNode(o),o=o.next),o}function filterPoints(e,t){if(!e)return e;t=t||e;var i,r=e;do{if(i=!1,r.steiner||!equals(r,r.next)&&0!==area(r.prev,r,r.next))r=r.next;else{if(removeNode(r),(r=t=r.prev)===r.next)break;i=!0}}while(i||r!==t);return t}function earcutLinked(e,t,i,r,n,a,o){if(e){!o&&a&&indexCurve(e,r,n,a);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?isEarHashed(e,r,n,a):isEar(e))t.push(s.i/i),t.push(e.i/i),t.push(l.i/i),removeNode(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?earcutLinked(e=cureLocalIntersections(filterPoints(e),t,i),t,i,r,n,a,2):2===o&&splitEarcut(e,t,i,r,n,a):earcutLinked(filterPoints(e),t,i,r,n,a,1);break}}}function isEar(e){var t=e.prev,i=e,r=e.next;if(!(0<=area(t,i,r))){for(var n=e.next.next;n!==e.prev;){if(pointInTriangle(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&0<=area(n.prev,n,n.next))return;n=n.next}return 1}}function isEarHashed(e,t,i,r){var n=e.prev,a=e,o=e.next;if(!(0<=area(n,a,o))){for(var s=(n.x<a.x?n.x<o.x?n:o:a.x<o.x?a:o).x,l=(n.y<a.y?n.y<o.y?n:o:a.y<o.y?a:o).y,c=(n.x>a.x?n.x>o.x?n:o:a.x>o.x?a:o).x,u=(n.y>a.y?n.y>o.y?n:o:a.y>o.y?a:o).y,d=zOrder(s,l,t,i,r),h=zOrder(c,u,t,i,r),p=e.prevZ,m=e.nextZ;p&&p.z>=d&&m&&m.z<=h;){if(p!==e.prev&&p!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return;if(p=p.prevZ,m!==e.prev&&m!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,m.x,m.y)&&0<=area(m.prev,m,m.next))return;m=m.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return;p=p.prevZ}for(;m&&m.z<=h;){if(m!==e.prev&&m!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,m.x,m.y)&&0<=area(m.prev,m,m.next))return;m=m.nextZ}return 1}}function cureLocalIntersections(e,t,i){var r=e;do{var n=r.prev,a=r.next.next}while(!equals(n,a)&&intersects$1(n,r,r.next,a)&&locallyInside(n,a)&&locallyInside(a,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(a.i/i),removeNode(r),removeNode(r.next),r=e=a),(r=r.next)!==e);return filterPoints(r)}function splitEarcut(e,t,i,r,n,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&isValidDiagonal(o,s)){var l=splitPolygon(o,s),o=filterPoints(o,o.next),l=filterPoints(l,l.next);return earcutLinked(o,t,i,r,n,a),void earcutLinked(l,t,i,r,n,a)}s=s.next}}while((o=o.next)!==e)}function eliminateHoles(e,t,i,r){for(var n,a=[],o=0,s=t.length;o<s;o++)(n=linkedList(e,t[o]*r,o<s-1?t[o+1]*r:e.length,r,!1))===n.next&&(n.steiner=!0),a.push(getLeftmost(n));for(a.sort(compareX),o=0;o<a.length;o++)eliminateHole(a[o],i),i=filterPoints(i,i.next);return i}function compareX(e,t){return e.x-t.x}function eliminateHole(e,t){(t=findHoleBridge(e,t))&&filterPoints(e=splitPolygon(t,e),e.next)}function findHoleBridge(e,t){var i,r=t,n=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&o<s){if((o=s)===n){if(a===r.y)return r;if(a===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}}while((r=r.next)!==t);if(!i)return null;if(n===o)return i;for(var l,c=i,u=i.x,d=i.y,h=1/0,r=i;n>=r.x&&r.x>=u&&n!==r.x&&pointInTriangle(a<d?n:o,a,u,d,a<d?o:n,a,r.x,r.y)&&(l=Math.abs(a-r.y)/(n-r.x),locallyInside(r,e)&&(l<h||l===h&&(r.x>i.x||r.x===i.x&§orContainsSector(i,r)))&&(i=r,h=l)),(r=r.next)!==c;);return i}function sectorContainsSector(e,t){return area(e.prev,e,t.prev)<0&&area(t.next,e,e.next)<0}function indexCurve(e,t,i,r){for(var n=e;null===n.z&&(n.z=zOrder(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,(n=n.next)!==e;);n.prevZ.nextZ=null,n.prevZ=null,sortLinked(n)}function sortLinked(e){var t,i,r,n,a,o,s,l,c=1;do{for(i=e,a=e=null,o=0;i;){for(o++,r=i,t=s=0;t<c&&(s++,r=r.nextZ);t++);for(l=c;0<s||0<l&&r;)0!==s&&(0===l||!r||i.z<=r.z)?(i=(n=i).nextZ,s--):(r=(n=r).nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;i=r}}while(a.nextZ=null,c*=2,1<o);return e}function zOrder(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function getLeftmost(e){for(var t=e,i=e;(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),(t=t.next)!==e;);return i}function pointInTriangle(e,t,i,r,n,a,o,s){return 0<=(n-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(r-s)-(i-o)*(t-s)&&0<=(i-o)*(a-s)-(n-o)*(r-s)}function isValidDiagonal(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!intersectsPolygon(e,t)&&(locallyInside(e,t)&&locallyInside(t,e)&&middleInside(e,t)&&(area(e.prev,e,t.prev)||area(e,t.prev,t))||equals(e,t)&&0<area(e.prev,e,e.next)&&0<area(t.prev,t,t.next))}function area(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function equals(e,t){return e.x===t.x&&e.y===t.y}function intersects$1(e,t,i,r){var n=sign(area(e,t,i)),a=sign(area(e,t,r)),o=sign(area(i,r,e)),s=sign(area(i,r,t));return n!==a&&o!==s||(0===n&&onSegment(e,i,t)||(0===a&&onSegment(e,r,t)||(0===o&&onSegment(i,e,r)||!(0!==s||!onSegment(i,t,r)))))}function onSegment(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function sign(e){return 0<e?1:e<0?-1:0}function intersectsPolygon(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&intersects$1(i,i.next,e,t))return 1}while((i=i.next)!==e)}function locallyInside(e,t){return area(e.prev,e,e.next)<0?0<=area(e,t,e.next)&&0<=area(e,e.prev,t):area(e,t,e.prev)<0||area(e,e.next,t)<0}function middleInside(e,t){for(var i=e,r=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),(i=i.next)!==e;);return r}function splitPolygon(e,t){var i=new Node$2(e.i,e.x,e.y),r=new Node$2(t.i,t.x,t.y),n=e.next,a=t.prev;return(e.next=t).prev=e,(i.next=n).prev=i,(r.next=i).prev=r,(a.next=r).prev=a,r}function insertNode(e,t,i,r){i=new Node$2(e,t,i);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function removeNode(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 Node$2(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(e,t,i,r){for(var n=0,a=t,o=i-r;a<i;a+=r)n+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return n}Object.defineProperties(EllipsoidRhumbLine.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}}}),EllipsoidRhumbLine.fromStartHeadingDistance=function(e,t,i,r,n){var a=defaultValue(r,Ellipsoid.WGS84),o=a.maximumRadius,s=a.minimumRadius,o=o*o,o=Math.sqrt((o-s*s)/o),o=interpolateUsingSurfaceDistance(e,t=CesiumMath.negativePiToPi(t),i,a.maximumRadius,o);return!defined(n)||defined(r)&&!r.equals(n.ellipsoid)?new EllipsoidRhumbLine(e,o,a):(n.setEndPoints(e,o),n)},EllipsoidRhumbLine.prototype.setEndPoints=function(e,t){computeProperties$1(this,e,t,this._ellipsoid)},EllipsoidRhumbLine.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance=function(e,t){return interpolateUsingSurfaceDistance(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},EllipsoidRhumbLine.prototype.findIntersectionWithLongitude=function(e,t){var i=this._ellipticity,r=this._heading,n=Math.abs(r),a=this._start;if(e=CesiumMath.negativePiToPi(e),CesiumMath.equalsEpsilon(Math.abs(e),Math.PI,CesiumMath.EPSILON14)&&(e=CesiumMath.sign(a.longitude)*Math.PI),defined(t)||(t=new Cartographic),Math.abs(CesiumMath.PI_OVER_TWO-n)<=CesiumMath.EPSILON8)return t.longitude=e,t.latitude=a.latitude,t.height=0,t;if(CesiumMath.equalsEpsilon(Math.abs(CesiumMath.PI_OVER_TWO-n),CesiumMath.PI_OVER_TWO,CesiumMath.EPSILON8))return CesiumMath.equalsEpsilon(e,a.longitude,CesiumMath.EPSILON12)?void 0:(t.longitude=e,t.latitude=CesiumMath.PI_OVER_TWO*CesiumMath.sign(CesiumMath.PI_OVER_TWO-r),t.height=0,t);var o=a.latitude,n=i*Math.sin(o),s=Math.tan(.5*(CesiumMath.PI_OVER_TWO+o))*Math.exp((e-a.longitude)/Math.tan(r)),l=(1+n)/(1-n),c=a.latitude;do{var u=c,d=i*Math.sin(u),c=2*Math.atan(s*Math.pow((1+d)/(1-d)/l,i/2))-CesiumMath.PI_OVER_TWO}while(!CesiumMath.equalsEpsilon(c,u,CesiumMath.EPSILON12));return t.longitude=e,t.latitude=c,t.height=0,t},EllipsoidRhumbLine.prototype.findIntersectionWithLatitude=function(e,t){var i=this._ellipticity,r=this._heading,n=this._start;if(!CesiumMath.equalsEpsilon(Math.abs(r),CesiumMath.PI_OVER_TWO,CesiumMath.EPSILON8)){var a=calculateSigma(i,n.latitude),i=calculateSigma(i,e),a=Math.tan(r)*(i-a),a=CesiumMath.negativePiToPi(n.longitude+a);return defined(t)?(t.longitude=a,t.latitude=e,t.height=0,t):new Cartographic(a,e,0)}},earcut.deviation=function(e,t,i,r){var n=t&&t.length,a=n?t[0]*i:e.length,o=Math.abs(signedArea(e,0,a,i));if(n)for(var s=0,l=t.length;s<l;s++){var c=t[s]*i,u=s<l-1?t[s+1]*i:e.length;o-=Math.abs(signedArea(e,c,u,i))}for(var d=0,s=0;s<r.length;s+=3){var h=r[s]*i,p=r[s+1]*i,m=r[s+2]*i;d+=Math.abs((e[h]-e[m])*(e[1+p]-e[1+h])-(e[h]-e[p])*(e[1+m]-e[1+h]))}return 0===o&&0===d?0:Math.abs((d-o)/o)},earcut.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var a=0;a<e[n].length;a++)for(var o=0;o<t;o++)i.vertices.push(e[n][a][o]);0<n&&(r+=e[n-1].length,i.holes.push(r))}return i};var WindingOrder={CLOCKWISE:WebGLConstants$1.CW,COUNTER_CLOCKWISE:WebGLConstants$1.CCW,validate:function(e){return e===WindingOrder.CLOCKWISE||e===WindingOrder.COUNTER_CLOCKWISE}},WindingOrder$1=Object.freeze(WindingOrder),scaleToGeodeticHeightN=new Cartesian3,scaleToGeodeticHeightP=new Cartesian3,PolygonPipeline={computeArea2D:function(e){for(var t=e.length,i=0,r=t-1,n=0;n<t;r=n++){var a=e[r],o=e[n];i+=a.x*o.y-o.x*a.y}return.5*i},computeWindingOrder2D:function(e){return 0<PolygonPipeline.computeArea2D(e)?WindingOrder$1.COUNTER_CLOCKWISE:WindingOrder$1.CLOCKWISE},triangulate:function(e,t){return earcut(Cartesian2.packArray(e),t,2)}},subdivisionV0Scratch=new Cartesian3,subdivisionV1Scratch=new Cartesian3,subdivisionV2Scratch=new Cartesian3,subdivisionS0Scratch=new Cartesian3,subdivisionS1Scratch=new Cartesian3,subdivisionS2Scratch=new Cartesian3,subdivisionMidScratch=new Cartesian3;PolygonPipeline.computeSubdivision=function(e,t,i,r){r=defaultValue(r,CesiumMath.RADIANS_PER_DEGREE);for(var n=i.slice(0),a=t.length,o=new Array(3*a),s=0,l=0;l<a;l++){var c=t[l];o[s++]=c.x,o[s++]=c.y,o[s++]=c.z}for(var u=[],d={},h=e.maximumRadius,r=CesiumMath.chordLength(r,h),p=r*r;0<n.length;){var m,f,g=n.pop(),_=n.pop(),y=n.pop(),C=Cartesian3.fromArray(o,3*y,subdivisionV0Scratch),v=Cartesian3.fromArray(o,3*_,subdivisionV1Scratch),S=Cartesian3.fromArray(o,3*g,subdivisionV2Scratch),T=Cartesian3.multiplyByScalar(Cartesian3.normalize(C,subdivisionS0Scratch),h,subdivisionS0Scratch),x=Cartesian3.multiplyByScalar(Cartesian3.normalize(v,subdivisionS1Scratch),h,subdivisionS1Scratch),b=Cartesian3.multiplyByScalar(Cartesian3.normalize(S,subdivisionS2Scratch),h,subdivisionS2Scratch),E=Cartesian3.magnitudeSquared(Cartesian3.subtract(T,x,subdivisionMidScratch)),x=Cartesian3.magnitudeSquared(Cartesian3.subtract(x,b,subdivisionMidScratch)),b=Cartesian3.magnitudeSquared(Cartesian3.subtract(b,T,subdivisionMidScratch)),T=Math.max(E,x,b);p<T?E===T?(defined(l=d[m=Math.min(y,_)+" "+Math.max(y,_)])||(f=Cartesian3.add(C,v,subdivisionMidScratch),Cartesian3.multiplyByScalar(f,.5,f),o.push(f.x,f.y,f.z),l=o.length/3-1,d[m]=l),n.push(y,l,g),n.push(l,_,g)):x===T?(defined(l=d[m=Math.min(_,g)+" "+Math.max(_,g)])||(f=Cartesian3.add(v,S,subdivisionMidScratch),Cartesian3.multiplyByScalar(f,.5,f),o.push(f.x,f.y,f.z),l=o.length/3-1,d[m]=l),n.push(_,l,y),n.push(l,g,y)):b===T&&(defined(l=d[m=Math.min(g,y)+" "+Math.max(g,y)])||(f=Cartesian3.add(S,C,subdivisionMidScratch),Cartesian3.multiplyByScalar(f,.5,f),o.push(f.x,f.y,f.z),l=o.length/3-1,d[m]=l),n.push(g,l,_),n.push(l,y,_)):(u.push(y),u.push(_),u.push(g))}return new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:o})},indices:u,primitiveType:PrimitiveType$1.TRIANGLES})};var subdivisionC0Scratch=new Cartographic,subdivisionC1Scratch=new Cartographic,subdivisionC2Scratch=new Cartographic,subdivisionCartographicScratch=new Cartographic;function Queue(){this._array=[],this._offset=0,this._length=0}PolygonPipeline.computeRhumbLineSubdivision=function(e,t,i,r){r=defaultValue(r,CesiumMath.RADIANS_PER_DEGREE);for(var n=i.slice(0),a=t.length,o=new Array(3*a),s=0,l=0;l<a;l++){var c=t[l];o[s++]=c.x,o[s++]=c.y,o[s++]=c.z}for(var u=[],d={},i=e.maximumRadius,h=CesiumMath.chordLength(r,i),p=new EllipsoidRhumbLine(void 0,void 0,e),m=new EllipsoidRhumbLine(void 0,void 0,e),f=new EllipsoidRhumbLine(void 0,void 0,e);0<n.length;){var g=n.pop(),_=n.pop(),y=n.pop(),C=Cartesian3.fromArray(o,3*y,subdivisionV0Scratch),v=Cartesian3.fromArray(o,3*_,subdivisionV1Scratch),S=Cartesian3.fromArray(o,3*g,subdivisionV2Scratch),T=e.cartesianToCartographic(C,subdivisionC0Scratch),x=e.cartesianToCartographic(v,subdivisionC1Scratch),b=e.cartesianToCartographic(S,subdivisionC2Scratch);p.setEndPoints(T,x);var E=p.surfaceDistance;m.setEndPoints(x,b);C=m.surfaceDistance;f.setEndPoints(b,T);var P,A,w,D,v=f.surfaceDistance,S=Math.max(E,C,v);h<S?E===S?(defined(l=d[P=Math.min(y,_)+" "+Math.max(y,_)])||(A=p.interpolateUsingFraction(.5,subdivisionCartographicScratch),w=.5*(T.height+x.height),D=Cartesian3.fromRadians(A.longitude,A.latitude,w,e,subdivisionMidScratch),o.push(D.x,D.y,D.z),l=o.length/3-1,d[P]=l),n.push(y,l,g),n.push(l,_,g)):C===S?(defined(l=d[P=Math.min(_,g)+" "+Math.max(_,g)])||(A=m.interpolateUsingFraction(.5,subdivisionCartographicScratch),w=.5*(x.height+b.height),D=Cartesian3.fromRadians(A.longitude,A.latitude,w,e,subdivisionMidScratch),o.push(D.x,D.y,D.z),l=o.length/3-1,d[P]=l),n.push(_,l,y),n.push(l,g,y)):v===S&&(defined(l=d[P=Math.min(g,y)+" "+Math.max(g,y)])||(A=f.interpolateUsingFraction(.5,subdivisionCartographicScratch),w=.5*(b.height+T.height),D=Cartesian3.fromRadians(A.longitude,A.latitude,w,e,subdivisionMidScratch),o.push(D.x,D.y,D.z),l=o.length/3-1,d[P]=l),n.push(g,l,_),n.push(l,y,_)):(u.push(y),u.push(_),u.push(g))}return new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:o})},indices:u,primitiveType:PrimitiveType$1.TRIANGLES})},PolygonPipeline.scaleToGeodeticHeight=function(e,t,i,r){i=defaultValue(i,Ellipsoid.WGS84);var n=scaleToGeodeticHeightN,a=scaleToGeodeticHeightP;if(t=defaultValue(t,0),r=defaultValue(r,!0),defined(e))for(var o=e.length,s=0;s<o;s+=3)Cartesian3.fromArray(e,s,a),r&&(a=i.scaleToGeodeticSurface(a,a)),0!==t&&(n=i.geodeticSurfaceNormal(a,n),Cartesian3.multiplyByScalar(n,t,n),Cartesian3.add(a,n,a)),e[s]=a.x,e[s+1]=a.y,e[s+2]=a.z;return e},Object.defineProperties(Queue.prototype,{length:{get:function(){return this._length}}}),Queue.prototype.enqueue=function(e){this._array.push(e),this._length++},Queue.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,10<++t&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},Queue.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},Queue.prototype.contains=function(e){return-1!==this._array.indexOf(e)},Queue.prototype.clear=function(){this._array.length=this._offset=this._length=0},Queue.prototype.sort=function(e){0<this._offset&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var PolygonGeometryLibrary={computeHierarchyPackedLength:function(e){for(var t=0,i=[e];0<i.length;){var r=i.pop();if(defined(r)){t+=2;var n=r.positions,a=r.holes;if(defined(n)&&(t+=n.length*Cartesian3.packedLength),defined(a))for(var o=a.length,s=0;s<o;++s)i.push(a[s])}}return t},packPolygonHierarchy:function(e,t,i){for(var r=[e];0<r.length;){var n=r.pop();if(defined(n)){var a=n.positions,o=n.holes;if(t[i++]=defined(a)?a.length:0,t[i++]=defined(o)?o.length:0,defined(a))for(var s=a.length,l=0;l<s;++l,i+=3)Cartesian3.pack(a[l],t,i);if(defined(o))for(var c=o.length,u=0;u<c;++u)r.push(o[u])}}return i},unpackPolygonHierarchy:function(e,t){for(var i=e[t++],r=e[t++],n=new Array(i),a=0<r?new Array(r):void 0,o=0;o<i;++o,t+=Cartesian3.packedLength)n[o]=Cartesian3.unpack(e,t);for(var s=0;s<r;++s)a[s]=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:n,holes:a,startingIndex:t}}},distanceScratch=new Cartesian3;function getPointAtDistance(e,t,i,r){return Cartesian3.subtract(t,e,distanceScratch),Cartesian3.multiplyByScalar(distanceScratch,i/r,distanceScratch),Cartesian3.add(e,distanceScratch,distanceScratch),[distanceScratch.x,distanceScratch.y,distanceScratch.z]}PolygonGeometryLibrary.subdivideLineCount=function(e,t,i){t=Cartesian3.distance(e,t),i=Math.max(0,Math.ceil(CesiumMath.log2(t/i)));return Math.pow(2,i)};var scratchCartographic0$1=new Cartographic,scratchCartographic1$2=new Cartographic,scratchCartographic2$1=new Cartographic,scratchCartesian0=new Cartesian3;PolygonGeometryLibrary.subdivideRhumbLineCount=function(e,t,i,r){r=new EllipsoidRhumbLine(e.cartesianToCartographic(t,scratchCartographic0$1),e.cartesianToCartographic(i,scratchCartographic1$2),e).surfaceDistance/r,r=Math.max(0,Math.ceil(CesiumMath.log2(r)));return Math.pow(2,r)},PolygonGeometryLibrary.subdivideLine=function(e,t,i,r){var n=PolygonGeometryLibrary.subdivideLineCount(e,t,i),a=Cartesian3.distance(e,t),o=a/n,s=r=!defined(r)?[]:r;s.length=3*n;for(var l=0,c=0;c<n;c++){var u=getPointAtDistance(e,t,c*o,a);s[l++]=u[0],s[l++]=u[1],s[l++]=u[2]}return s},PolygonGeometryLibrary.subdivideRhumbLine=function(e,t,i,r,n){var a=new EllipsoidRhumbLine(e.cartesianToCartographic(t,scratchCartographic0$1),e.cartesianToCartographic(i,scratchCartographic1$2),e),r=a.surfaceDistance/r,r=Math.max(0,Math.ceil(CesiumMath.log2(r))),o=Math.pow(2,r),s=a.surfaceDistance/o,l=n=!defined(n)?[]:n;l.length=3*o;for(var c=0,u=0;u<o;u++){var d=a.interpolateUsingSurfaceDistance(u*s,scratchCartographic2$1),d=e.cartographicToCartesian(d,scratchCartesian0);l[c++]=d.x,l[c++]=d.y,l[c++]=d.z}return l};var scaleToGeodeticHeightN1=new Cartesian3,scaleToGeodeticHeightN2=new Cartesian3,scaleToGeodeticHeightP1=new Cartesian3,scaleToGeodeticHeightP2=new Cartesian3;PolygonGeometryLibrary.scaleToGeodeticHeightExtruded=function(e,t,i,r,n){r=defaultValue(r,Ellipsoid.WGS84);var a=scaleToGeodeticHeightN1,o=scaleToGeodeticHeightN2,s=scaleToGeodeticHeightP1,l=scaleToGeodeticHeightP2;if(defined(e)&&defined(e.attributes)&&defined(e.attributes.position))for(var c=e.attributes.position.values,u=c.length/2,d=0;d<u;d+=3)Cartesian3.fromArray(c,d,s),r.geodeticSurfaceNormal(s,a),l=r.scaleToGeodeticSurface(s,l),o=Cartesian3.multiplyByScalar(a,i,o),o=Cartesian3.add(l,o,o),c[d+u]=o.x,c[d+1+u]=o.y,c[d+2+u]=o.z,n&&(l=Cartesian3.clone(s,l)),o=Cartesian3.multiplyByScalar(a,t,o),o=Cartesian3.add(l,o,o),c[d]=o.x,c[d+1]=o.y,c[d+2]=o.z;return e},PolygonGeometryLibrary.polygonOutlinesFromHierarchy=function(e,t,i){var r,n,a=[],o=new Queue;for(o.enqueue(e);0!==o.length;){var s=o.dequeue(),l=s.positions;if(t)for(n=l.length,u=0;u<n;u++)i.scaleToGeodeticSurface(l[u],l[u]);if(!((l=arrayRemoveDuplicates(l,Cartesian3.equalsEpsilon,!0)).length<3)){for(var c=s.holes?s.holes.length:0,u=0;u<c;u++){var d=s.holes[u],h=d.positions;if(t)for(n=h.length,r=0;r<n;++r)i.scaleToGeodeticSurface(h[r],h[r]);if(!((h=arrayRemoveDuplicates(h,Cartesian3.equalsEpsilon,!0)).length<3)){a.push(h);var p=0;for(defined(d.holes)&&(p=d.holes.length),r=0;r<p;r++)o.enqueue(d.holes[r])}}a.push(l)}}return a},PolygonGeometryLibrary.polygonsFromHierarchy=function(e,t,i,r){var n=[],a=[],o=new Queue;for(o.enqueue(e);0!==o.length;){var s,l=o.dequeue(),c=l.positions,u=l.holes;if(i)for(s=c.length,_=0;_<s;_++)r.scaleToGeodeticSurface(c[_],c[_]);if(!((c=arrayRemoveDuplicates(c,Cartesian3.equalsEpsilon,!0)).length<3))if(defined(S=t(c))){var d=[],h=PolygonPipeline.computeWindingOrder2D(S);h===WindingOrder$1.CLOCKWISE&&(S.reverse(),c=c.slice().reverse());for(var p,m=c.slice(),f=defined(u)?u.length:0,g=[],_=0;_<f;_++){var y=u[_],C=y.positions;if(i)for(s=C.length,p=0;p<s;++p)r.scaleToGeodeticSurface(C[p],C[p]);if(!((C=arrayRemoveDuplicates(C,Cartesian3.equalsEpsilon,!0)).length<3)){var v=t(C);if(defined(v)){PolygonPipeline.computeWindingOrder2D(v)===WindingOrder$1.CLOCKWISE&&(v.reverse(),C=C.slice().reverse()),g.push(C),d.push(m.length);var m=m.concat(C),S=S.concat(v),T=0;for(defined(y.holes)&&(T=y.holes.length),p=0;p<T;p++)o.enqueue(y.holes[p])}}}n.push({outerRing:c,holes:g}),a.push({positions:m,positions2D:S,holes:d})}}return{hierarchy:n,polygons:a}};var computeBoundingRectangleCartesian2=new Cartesian2,computeBoundingRectangleCartesian3=new Cartesian3,computeBoundingRectangleQuaternion=new Quaternion,computeBoundingRectangleMatrix3=new Matrix3;PolygonGeometryLibrary.computeBoundingRectangle=function(e,t,i,r,n){for(var r=Quaternion.fromAxisAngle(e,r,computeBoundingRectangleQuaternion),a=Matrix3.fromQuaternion(r,computeBoundingRectangleMatrix3),o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=i.length,d=0;d<u;++d){var h=Cartesian3.clone(i[d],computeBoundingRectangleCartesian3);Matrix3.multiplyByVector(a,h,h);h=t(h,computeBoundingRectangleCartesian2);defined(h)&&(o=Math.min(o,h.x),s=Math.max(s,h.x),l=Math.min(l,h.y),c=Math.max(c,h.y))}return n.x=o,n.y=l,n.width=s-o,n.height=c-l,n},PolygonGeometryLibrary.createGeometryFromPositions=function(e,t,i,r,n,a){var o=PolygonPipeline.triangulate(t.positions2D,t.holes);o.length<3&&(o=[0,1,2]);var s=t.positions;if(r){for(var l=s.length,c=new Array(3*l),u=0,d=0;d<l;d++){var h=s[d];c[u++]=h.x,c[u++]=h.y,c[u++]=h.z}r=new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:c})},indices:o,primitiveType:PrimitiveType$1.TRIANGLES});return n.normal?GeometryPipeline.computeNormal(r):r}return a===ArcType$1.GEODESIC?PolygonPipeline.computeSubdivision(e,s,o,i):a===ArcType$1.RHUMB?PolygonPipeline.computeRhumbLineSubdivision(e,s,o,i):void 0};var computeWallIndicesSubdivided=[],p1Scratch$1=new Cartesian3,p2Scratch$1=new Cartesian3;PolygonGeometryLibrary.computeWallGeometry=function(e,t,i,r,n){var a,o,s,l=e.length,c=0;if(r)for(o=3*l*2,a=new Array(2*o),s=0;s<l;s++)p=e[s],m=e[(s+1)%l],a[c]=a[c+o]=p.x,a[++c]=a[c+o]=p.y,a[++c]=a[c+o]=p.z,a[++c]=a[c+o]=m.x,a[++c]=a[c+o]=m.y,a[++c]=a[c+o]=m.z,++c;else{var u=CesiumMath.chordLength(i,t.maximumRadius),d=0;if(n===ArcType$1.GEODESIC)for(s=0;s<l;s++)d+=PolygonGeometryLibrary.subdivideLineCount(e[s],e[(s+1)%l],u);else if(n===ArcType$1.RHUMB)for(s=0;s<l;s++)d+=PolygonGeometryLibrary.subdivideRhumbLineCount(t,e[s],e[(s+1)%l],u);for(o=3*(d+l),a=new Array(2*o),s=0;s<l;s++){var h,p=e[s],m=e[(s+1)%l];n===ArcType$1.GEODESIC?h=PolygonGeometryLibrary.subdivideLine(p,m,u,computeWallIndicesSubdivided):n===ArcType$1.RHUMB&&(h=PolygonGeometryLibrary.subdivideRhumbLine(t,p,m,u,computeWallIndicesSubdivided));for(var f=h.length,g=0;g<f;++g,++c)a[c]=h[g],a[c+o]=h[g];a[c]=m.x,a[c+o]=m.x,a[++c]=m.y,a[c+o]=m.y,a[++c]=m.z,a[c+o]=m.z,++c}}var l=a.length,_=IndexDatatype$1.createTypedArray(l/3,l-6*e.length),y=0;for(l/=6,s=0;s<l;s++){var C=s,v=C+1,S=C+l,T=S+1;p=Cartesian3.fromArray(a,3*C,p1Scratch$1),m=Cartesian3.fromArray(a,3*v,p2Scratch$1),Cartesian3.equalsEpsilon(p,m,CesiumMath.EPSILON10,CesiumMath.EPSILON10)||(_[y++]=C,_[y++]=S,_[y++]=v,_[y++]=v,_[y++]=S,_[y++]=T)}return new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a})}),indices:_,primitiveType:PrimitiveType$1.TRIANGLES})};var scratchPosition$b=new Cartesian3,scratchBR=new BoundingRectangle,stScratch$1=new Cartesian2,textureCoordinatesOrigin=new Cartesian2,scratchNormal$4=new Cartesian3,scratchTangent$3=new Cartesian3,scratchBitangent$3=new Cartesian3,centerScratch$5=new Cartesian3,axis1Scratch=new Cartesian3,axis2Scratch=new Cartesian3,quaternionScratch$2=new Quaternion,textureMatrixScratch=new Matrix3,tangentRotationScratch=new Matrix3,surfaceNormalScratch=new Cartesian3;function createGeometryFromPolygon(e,t,i,r,n,a,o,s){var l=e.positions,c=PolygonPipeline.triangulate(e.positions2D,e.holes);c.length<3&&(c=[0,1,2]);e=IndexDatatype$1.createTypedArray(l.length,c.length);e.set(c);var u=textureMatrixScratch;0!==r?(c=Quaternion.fromAxisAngle(a,r,quaternionScratch$2),u=Matrix3.fromQuaternion(c,u),(t.tangent||t.bitangent)&&(c=Quaternion.fromAxisAngle(a,-r,quaternionScratch$2),p=Matrix3.fromQuaternion(c,tangentRotationScratch),o=Cartesian3.normalize(Matrix3.multiplyByVector(p,o,o),o),t.bitangent&&(s=Cartesian3.normalize(Cartesian3.cross(a,o,s),s)))):u=Matrix3.clone(Matrix3.IDENTITY,u);var d=textureCoordinatesOrigin;t.st&&(d.x=i.x,d.y=i.y);for(var h=l.length,p=3*h,m=new Float64Array(p),f=t.normal?new Float32Array(p):void 0,g=t.tangent?new Float32Array(p):void 0,_=t.bitangent?new Float32Array(p):void 0,y=t.st?new Float32Array(2*h):void 0,C=0,v=0,S=0,T=0,x=0,b=0;b<h;b++){var E,P=l[b];m[C++]=P.x,m[C++]=P.y,m[C++]=P.z,t.st&&(E=n(Matrix3.multiplyByVector(u,P,scratchPosition$b),stScratch$1),Cartesian2.subtract(E,d,E),P=CesiumMath.clamp(E.x/i.width,0,1),E=CesiumMath.clamp(E.y/i.height,0,1),y[x++]=P,y[x++]=E),t.normal&&(f[v++]=a.x,f[v++]=a.y,f[v++]=a.z),t.tangent&&(g[T++]=o.x,g[T++]=o.y,g[T++]=o.z),t.bitangent&&(_[S++]=s.x,_[S++]=s.y,_[S++]=s.z)}p=new GeometryAttributes;return t.position&&(p.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:m})),t.normal&&(p.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:f})),t.tangent&&(p.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:g})),t.bitangent&&(p.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:_})),t.st&&(p.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:y})),new Geometry({attributes:p,indices:e,primitiveType:PrimitiveType$1.TRIANGLES})}function CoplanarPolygonGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).polygonHierarchy,i=defaultValue(e.vertexFormat,VertexFormat.DEFAULT);this._vertexFormat=VertexFormat.clone(i),this._polygonHierarchy=t,this._stRotation=defaultValue(e.stRotation,0),this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=PolygonGeometryLibrary.computeHierarchyPackedLength(t)+VertexFormat.packedLength+Ellipsoid.packedLength+2}CoplanarPolygonGeometry.fromPositions=function(e){return new CoplanarPolygonGeometry({polygonHierarchy:{positions:(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},CoplanarPolygonGeometry.pack=function(e,t,i){return i=defaultValue(i,0),i=PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._stRotation,t[i]=e.packedLength,t};var scratchEllipsoid$c=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$a=new VertexFormat,scratchOptions$h={polygonHierarchy:{}};function createGeometryFromPositions$1(e){for(var t=e.length,i=new Float64Array(3*t),r=IndexDatatype$1.createTypedArray(t,2*t),n=0,a=0,o=0;o<t;o++){var s=e[o];i[n++]=s.x,i[n++]=s.y,i[n++]=s.z,r[a++]=o,r[a++]=(o+1)%t}return new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:i})}),indices:r,primitiveType:PrimitiveType$1.LINES})}function CoplanarPolygonOutlineGeometry(e){e=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=PolygonGeometryLibrary.computeHierarchyPackedLength(e)+1}CoplanarPolygonGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$c);t+=Ellipsoid.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$a);t+=VertexFormat.packedLength;var o=e[t++],t=e[t];return(i=!defined(i)?new CoplanarPolygonGeometry(scratchOptions$h):i)._polygonHierarchy=r,i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._stRotation=o,i.packedLength=t,i},CoplanarPolygonGeometry.createGeometry=function(e){var t=e._vertexFormat,i=e._polygonHierarchy,r=e._stRotation;if(!((h=arrayRemoveDuplicates(h=i.positions,Cartesian3.equalsEpsilon,!0)).length<3)){var n=scratchNormal$4,a=scratchTangent$3,o=scratchBitangent$3,s=axis1Scratch,l=axis2Scratch;if(CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(h,centerScratch$5,s,l)){n=Cartesian3.cross(s,l,n);n=Cartesian3.normalize(n,n),Cartesian3.equalsEpsilon(centerScratch$5,Cartesian3.ZERO,CesiumMath.EPSILON6)||(c=e._ellipsoid.geodeticSurfaceNormal(centerScratch$5,surfaceNormalScratch),Cartesian3.dot(n,c)<0&&(n=Cartesian3.negate(n,n),s=Cartesian3.negate(s,s)));var c=CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(centerScratch$5,s,l),u=CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(centerScratch$5,s,l);t.tangent&&(a=Cartesian3.clone(s,a)),t.bitangent&&(o=Cartesian3.clone(l,o));var i=PolygonGeometryLibrary.polygonsFromHierarchy(i,c,!1),c=i.hierarchy,d=i.polygons;if(0!==c.length){for(var h=c[0].outerRing,i=BoundingSphere.fromPoints(h),p=PolygonGeometryLibrary.computeBoundingRectangle(n,u,h,r,scratchBR),m=[],f=0;f<d.length;f++){var g=new GeometryInstance({geometry:createGeometryFromPolygon(d[f],t,p,r,u,n,a,o)});m.push(g)}c=GeometryPipeline.combineInstances(m)[0];c.attributes.position.values=new Float64Array(c.attributes.position.values),c.indices=IndexDatatype$1.createTypedArray(c.attributes.position.values.length/3,c.indices);h=c.attributes;return t.position||delete h.position,new Geometry({attributes:h,indices:c.indices,primitiveType:c.primitiveType,boundingSphere:i})}}}},CoplanarPolygonOutlineGeometry.fromPositions=function(e){return new CoplanarPolygonOutlineGeometry({polygonHierarchy:{positions:(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions}})},CoplanarPolygonOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),t[i=PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i)]=e.packedLength,t};var scratchOptions$g={polygonHierarchy:{}};CoplanarPolygonOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;t=e[t];return(i=!defined(i)?new CoplanarPolygonOutlineGeometry(scratchOptions$g):i)._polygonHierarchy=r,i.packedLength=t,i},CoplanarPolygonOutlineGeometry.createGeometry=function(e){var t=e._polygonHierarchy,e=arrayRemoveDuplicates(e=t.positions,Cartesian3.equalsEpsilon,!0);if(!(e.length<3)&&CoplanarPolygonGeometryLibrary.validOutline(e)){var i=PolygonGeometryLibrary.polygonOutlinesFromHierarchy(t,!1);if(0!==i.length){for(var r=[],n=0;n<i.length;n++){var a=new GeometryInstance({geometry:createGeometryFromPositions$1(i[n])});r.push(a)}e=GeometryPipeline.combineInstances(r)[0],t=BoundingSphere.fromPoints(t.positions);return new Geometry({attributes:e.attributes,indices:e.indices,primitiveType:e.primitiveType,boundingSphere:t})}}};var CornerType={ROUNDED:0,MITERED:1,BEVELED:2},CornerType$1=Object.freeze(CornerType);function setConstants(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,a=Math.cos(e._startHeading),o=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),c=l*s,u=Math.atan2(s,a),d=l*o,h=d*d,p=1-h,m=Math.sqrt(p),f=t/4,g=f*f,_=g*f,y=g*g,C=1+f-3*g/4+5*_/4-175*y/64,v=1-f+15*g/8-35*_/8,S=1-3*f+35*g/4,T=1-5*f,t=C*u-v*Math.sin(2*u)*f/2-S*Math.sin(4*u)*g/16-T*Math.sin(6*u)*_/48-5*Math.sin(8*u)*y/512,e=e._constants;e.a=i,e.b=r,e.f=n,e.cosineHeading=a,e.sineHeading=o,e.tanU=s,e.cosineU=l,e.sineU=c,e.sigma=u,e.sineAlpha=d,e.sineSquaredAlpha=h,e.cosineSquaredAlpha=p,e.cosineAlpha=m,e.u2Over4=f,e.u4Over16=g,e.u6Over64=_,e.u8Over256=y,e.a0=C,e.a1=v,e.a2=S,e.a3=T,e.distanceRatio=t}function computeC(e,t){return e*t*(4+e*(4-3*t))/16}function computeDeltaLambda(e,t,i,r,n,a,o){i=computeC(e,i);return(1-i)*e*t*(r+i*n*(o+i*a*(2*o*o-1)))}function vincentyInverseFormula(e,t,i,r,n,a,o){var s=(t-i)/t,l=a-r,r=Math.atan((1-s)*Math.tan(n)),n=Math.atan((1-s)*Math.tan(o)),o=Math.cos(r),r=Math.sin(r),c=Math.cos(n),n=Math.sin(n),u=o*c,d=o*n,h=r*n,p=r*c,m=l,f=CesiumMath.TWO_PI,g=Math.cos(m),_=Math.sin(m);do{var y,C,v,S,T,g=Math.cos(m),_=Math.sin(m),x=d-p*g,f=m,b=(v=h+u*g)-2*h/(T=0===(C=Math.sqrt(c*c*_*_+x*x))?(y=0,1):1-(y=u*_/C)*y),m=l+computeDeltaLambda(s,y,T,S=Math.atan2(C,v),C,v,b=!isFinite(b)?0:b)}while(Math.abs(m-f)>CesiumMath.EPSILON12);n=T*(t*t-i*i)/(i*i),r=n*(256+n*(n*(74-47*n)-128))/1024,t=b*b,r=i*(1+n*(4096+n*(n*(320-175*n)-768))/16384)*(S-r*C*(b+r*(v*(2*t-1)-r*b*(4*C*C-3)*(4*t-3)/6)/4)),t=Math.atan2(c*_,d-p*g),o=Math.atan2(o*_,d*g-p);e._distance=r,e._startHeading=t,e._endHeading=o,e._uSquared=n}var scratchCart1=new Cartesian3,scratchCart2$1=new Cartesian3;function computeProperties(e,t,i,r){Cartesian3.normalize(r.cartographicToCartesian(t,scratchCart2$1),scratchCart1),Cartesian3.normalize(r.cartographicToCartesian(i,scratchCart2$1),scratchCart2$1),vincentyInverseFormula(e,r.maximumRadius,r.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude),e._start=Cartographic.clone(t,e._start),e._end=Cartographic.clone(i,e._end),e._start.height=0,e._end.height=0,setConstants(e)}function EllipsoidGeodesic(e,t,i){i=defaultValue(i,Ellipsoid.WGS84);this._ellipsoid=i,this._start=new Cartographic,this._end=new Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,defined(e)&&defined(t)&&computeProperties(this,e,t,i)}Object.defineProperties(EllipsoidGeodesic.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}}}),EllipsoidGeodesic.prototype.setEndPoints=function(e,t){computeProperties(this,e,t,this._ellipsoid)},EllipsoidGeodesic.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance=function(e,t){var i=this._constants,r=i.distanceRatio+e/i.b,n=Math.cos(2*r),a=Math.cos(4*r),o=Math.cos(6*r),s=Math.sin(2*r),l=Math.sin(4*r),c=Math.sin(6*r),u=Math.sin(8*r),d=r*r,h=i.u8Over256,p=i.u2Over4,m=i.u6Over64,e=i.u4Over16,d=2*(r*d)*h*n/3+r*(1-p+7*e/4-15*m/4+579*h/64-(e-15*m/4+187*h/16)*n-(5*m/4-115*h/16)*a-29*h*o/16)+(p/2-e+71*m/32-85*h/16)*s+(5*e/16-5*m/4+383*h/96)*l-d*((m-11*h/2)*s+5*h*l/2)+(29*m/96-29*h/16)*c+539*h*u/1536,s=Math.asin(Math.sin(d)*i.cosineAlpha),l=Math.atan(i.a/i.b*Math.tan(s));d-=i.sigma;m=Math.cos(2*i.sigma+d),c=Math.sin(d),h=Math.cos(d),u=i.cosineU*h,s=i.sineU*c,m=Math.atan2(c*i.sineHeading,u-s*i.cosineHeading)-computeDeltaLambda(i.f,i.sineAlpha,i.cosineSquaredAlpha,d,c,h,m);return defined(t)?(t.longitude=this._start.longitude+m,t.latitude=l,t.height=0,t):new Cartographic(this._start.longitude+m,l,0)};var PolylinePipeline={numberOfPoints:function(e,t,i){t=Cartesian3.distance(e,t);return Math.ceil(t/i)},numberOfPointsRhumbLine:function(e,t,i){t=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(t/(i*i))))}},cartoScratch$2=new Cartographic;PolylinePipeline.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;n<i;n++){var a=e[n];r[n]=t.cartesianToCartographic(a,cartoScratch$2).height}return r};var wrapLongitudeInversMatrix=new Matrix4,wrapLongitudeOrigin=new Cartesian3,wrapLongitudeXZNormal=new Cartesian3,wrapLongitudeXZPlane=new Plane(Cartesian3.UNIT_X,0),wrapLongitudeYZNormal=new Cartesian3,wrapLongitudeYZPlane=new Plane(Cartesian3.UNIT_X,0),wrapLongitudeIntersection=new Cartesian3,wrapLongitudeOffset=new Cartesian3,subdivideHeightsScratchArray=[];function subdivideHeights$1(e,t,i){var r=subdivideHeightsScratchArray;if(r.length=e,t===i){for(a=0;a<e;a++)r[a]=t;return r}for(var n=(i-t)/e,a=0;a<e;a++)r[a]=t+a*n;return r}var carto1=new Cartographic,carto2=new Cartographic,cartesian=new Cartesian3,scaleFirst=new Cartesian3,scaleLast=new Cartesian3,ellipsoidGeodesic$1=new EllipsoidGeodesic,ellipsoidRhumb=new EllipsoidRhumbLine;function generateCartesianArc(e,t,i,r,n,a,o,s){var l=r.scaleToGeodeticSurface(e,scaleFirst),c=r.scaleToGeodeticSurface(t,scaleLast),u=PolylinePipeline.numberOfPoints(e,t,i),l=r.cartesianToCartographic(l,carto1),c=r.cartesianToCartographic(c,carto2),d=subdivideHeights$1(u,n,a);ellipsoidGeodesic$1.setEndPoints(l,c);var h=ellipsoidGeodesic$1.surfaceDistance/u,p=s;l.height=n;var m=r.cartographicToCartesian(l,cartesian);Cartesian3.pack(m,o,p),p+=3;for(var f=1;f<u;f++){var g=ellipsoidGeodesic$1.interpolateUsingSurfaceDistance(f*h,carto2);g.height=d[f],m=r.cartographicToCartesian(g,cartesian),Cartesian3.pack(m,o,p),p+=3}return p}function generateCartesianRhumbArc(e,t,i,r,n,a,o,s){var e=r.cartesianToCartographic(e,carto1),t=r.cartesianToCartographic(t,carto2),l=PolylinePipeline.numberOfPointsRhumbLine(e,t,i);e.height=0,t.height=0;var c=subdivideHeights$1(l,n,a);(ellipsoidRhumb=!ellipsoidRhumb.ellipsoid.equals(r)?new EllipsoidRhumbLine(void 0,void 0,r):ellipsoidRhumb).setEndPoints(e,t);var u=ellipsoidRhumb.surfaceDistance/l,d=s;e.height=n;var h=r.cartographicToCartesian(e,cartesian);Cartesian3.pack(h,o,d),d+=3;for(var p=1;p<l;p++){var m=ellipsoidRhumb.interpolateUsingSurfaceDistance(p*u,carto2);m.height=c[p],h=r.cartographicToCartesian(m,cartesian),Cartesian3.pack(h,o,d),d+=3}return d}PolylinePipeline.wrapLongitude=function(e,t){var i=[],r=[];if(defined(e)&&0<e.length){t=defaultValue(t,Matrix4.IDENTITY);var n=Matrix4.inverseTransformation(t,wrapLongitudeInversMatrix),t=Matrix4.multiplyByPoint(n,Cartesian3.ZERO,wrapLongitudeOrigin),a=Cartesian3.normalize(Matrix4.multiplyByPointAsVector(n,Cartesian3.UNIT_Y,wrapLongitudeXZNormal),wrapLongitudeXZNormal),o=Plane.fromPointNormal(t,a,wrapLongitudeXZPlane),n=Cartesian3.normalize(Matrix4.multiplyByPointAsVector(n,Cartesian3.UNIT_X,wrapLongitudeYZNormal),wrapLongitudeYZNormal),s=Plane.fromPointNormal(t,n,wrapLongitudeYZPlane),l=1;i.push(Cartesian3.clone(e[0]));for(var c=i[0],u=e.length,d=1;d<u;++d){var h,p,m=e[d];!(Plane.getPointDistance(s,c)<0||Plane.getPointDistance(s,m)<0)||defined(h=IntersectionTests.lineSegmentPlane(c,m,o,wrapLongitudeIntersection))&&(p=Cartesian3.multiplyByScalar(a,5e-9,wrapLongitudeOffset),Plane.getPointDistance(o,c)<0&&Cartesian3.negate(p,p),i.push(Cartesian3.add(h,p,new Cartesian3)),r.push(l+1),Cartesian3.negate(p,p),i.push(Cartesian3.add(h,p,new Cartesian3)),l=1),i.push(Cartesian3.clone(e[d])),l++,c=m}r.push(l)}return{positions:i,lengths:r}},PolylinePipeline.generateArc=function(e){var t=(e=!defined(e)?{}:e).positions,i=t.length,r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=defaultValue(e.height,0),a=Array.isArray(n);if(i<1)return[];if(1===i){var o,s=r.scaleToGeodeticSurface(t[0],scaleFirst);return 0!==(n=a?n[0]:n)&&(o=r.geodeticSurfaceNormal(s,cartesian),Cartesian3.multiplyByScalar(o,n,o),Cartesian3.add(s,o,s)),[s.x,s.y,s.z]}var l=e.minDistance;defined(l)||(p=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),l=CesiumMath.chordLength(p,r.maximumRadius));for(var c=0,u=0;u<i-1;u++)c+=PolylinePipeline.numberOfPoints(t[u],t[u+1],l);var e=3*(c+1),d=new Array(e),h=0;for(u=0;u<i-1;u++)h=generateCartesianArc(t[u],t[u+1],l,r,a?n[u]:n,a?n[u+1]:n,d,h);subdivideHeightsScratchArray.length=0;var p=t[i-1],p=r.cartesianToCartographic(p,carto1);p.height=a?n[i-1]:n;p=r.cartographicToCartesian(p,cartesian);return Cartesian3.pack(p,d,e-3),d};var scratchCartographic0=new Cartographic,scratchCartographic1$1=new Cartographic;PolylinePipeline.generateRhumbArc=function(e){var t=(e=!defined(e)?{}:e).positions,i=t.length,r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=defaultValue(e.height,0),a=Array.isArray(n);if(i<1)return[];if(1===i){var o,s=r.scaleToGeodeticSurface(t[0],scaleFirst);return 0!==(n=a?n[0]:n)&&(o=r.geodeticSurfaceNormal(s,cartesian),Cartesian3.multiplyByScalar(o,n,o),Cartesian3.add(s,o,s)),[s.x,s.y,s.z]}for(var l,c=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),u=0,d=r.cartesianToCartographic(t[0],scratchCartographic0),h=0;h<i-1;h++)l=r.cartesianToCartographic(t[h+1],scratchCartographic1$1),u+=PolylinePipeline.numberOfPointsRhumbLine(d,l,c),d=Cartographic.clone(l,scratchCartographic0);var s=3*(u+1),p=new Array(s),m=0;for(h=0;h<i-1;h++)m=generateCartesianRhumbArc(t[h],t[h+1],c,r,a?n[h]:n,a?n[h+1]:n,p,m);subdivideHeightsScratchArray.length=0;e=t[i-1],e=r.cartesianToCartographic(e,carto1);e.height=a?n[i-1]:n;e=r.cartographicToCartesian(e,cartesian);return Cartesian3.pack(e,p,s-3),p},PolylinePipeline.generateCartesianArc=function(e){for(var t=PolylinePipeline.generateArc(e),i=t.length/3,r=new Array(i),n=0;n<i;n++)r[n]=Cartesian3.unpack(t,3*n);return r},PolylinePipeline.generateCartesianRhumbArc=function(e){for(var t=PolylinePipeline.generateRhumbArc(e),i=t.length/3,r=new Array(i),n=0;n<i;n++)r[n]=Cartesian3.unpack(t,3*n);return r};var scratch2Array=[new Cartesian3,new Cartesian3],scratchCartesian1$3=new Cartesian3,scratchCartesian2$6=new Cartesian3,scratchCartesian3$7=new Cartesian3,scratchCartesian4$4=new Cartesian3,scratchCartesian5$1=new Cartesian3,scratchCartesian6=new Cartesian3,scratchCartesian7=new Cartesian3,scratchCartesian8=new Cartesian3,scratchCartesian9=new Cartesian3,scratch1$2=new Cartesian3,scratch2$2=new Cartesian3,PolylineVolumeGeometryLibrary={},cartographic=new Cartographic;function scaleToSurface$2(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++){var n=e[r];cartographic=t.cartesianToCartographic(n,cartographic),i[r]=cartographic.height,e[r]=t.scaleToGeodeticSurface(n,n)}return i}function subdivideHeights(e,t,i,r){var n=e[0],e=e[1],e=Cartesian3.angleBetween(n,e),a=Math.ceil(e/r),o=new Array(a);if(t===i){for(l=0;l<a;l++)o[l]=t;return o.push(i),o}for(var s=(i-t)/a,l=1;l<a;l++)o[l]=t+l*s;return o[0]=t,o.push(i),o}var nextScratch=new Cartesian3,prevScratch=new Cartesian3;function computeRotationAngle(e,t,i,r){r=new EllipsoidTangentPlane(i,r),e=r.projectPointOntoPlane(Cartesian3.add(i,e,nextScratch),nextScratch),i=r.projectPointOntoPlane(Cartesian3.add(i,t,prevScratch),prevScratch),t=Cartesian2.angleBetween(e,i);return 0<=i.x*e.y-i.y*e.x?-t:t}var negativeX=new Cartesian3(-1,0,0),transform$1=new Matrix4,translation$1=new Matrix4,rotationZ=new Matrix3,scaleMatrix=Matrix3.IDENTITY.clone(),westScratch=new Cartesian3,finalPosScratch=new Cartesian4,heightCartesian=new Cartesian3;function addPosition(e,t,i,r,n,a,o,s){var l=westScratch,c=finalPosScratch;transform$1=Transforms.eastNorthUpToFixedFrame(e,n,transform$1),l=Matrix4.multiplyByPointAsVector(transform$1,negativeX,l);n=computeRotationAngle(l=Cartesian3.normalize(l,l),t,e,n);rotationZ=Matrix3.fromRotationZ(n,rotationZ),heightCartesian.z=a,transform$1=Matrix4.multiplyTransformation(transform$1,Matrix4.fromRotationTranslation(rotationZ,heightCartesian,translation$1),transform$1);var u=scaleMatrix;u[0]=o;for(var d=0;d<s;d++)for(var h=0;h<i.length;h+=3)c=Cartesian3.fromArray(i,h,c),c=Matrix3.multiplyByVector(u,c,c),c=Matrix4.multiplyByPoint(transform$1,c,c),r.push(c.x,c.y,c.z);return r}var centerScratch$4=new Cartesian3;function addPositions(e,t,i,r,n,a,o){for(var s=0;s<e.length;s+=3)r=addPosition(Cartesian3.fromArray(e,s,centerScratch$4),t,i,r,n,a[s/3],o,1);return r}function convertShapeTo3DDuplicate(e,t){var i=e.length,r=new Array(6*i),n=0,a=t.x+t.width/2,o=t.y+t.height/2,s=e[0];r[n++]=s.x-a,r[n++]=0,r[n++]=s.y-o;for(var l=1;l<i;l++){var c=(s=e[l]).x-a,u=s.y-o;r[n++]=c,r[n++]=0,r[n++]=u,r[n++]=c,r[n++]=0,r[n++]=u}return s=e[0],r[n++]=s.x-a,r[n++]=0,r[n++]=s.y-o,r}function convertShapeTo3D(e,t){for(var i=e.length,r=new Array(3*i),n=0,a=t.x+t.width/2,o=t.y+t.height/2,s=0;s<i;s++)r[n++]=e[s].x-a,r[n++]=0,r[n++]=e[s].y-o;return r}var quaterion$1=new Quaternion,startPointScratch=new Cartesian3,rotMatrix$1=new Matrix3;function computeRoundCorner$1(e,t,i,r,n,a,o,s,l,c){var u,d=Cartesian3.angleBetween(Cartesian3.subtract(t,e,scratch1$2),Cartesian3.subtract(i,e,scratch2$2)),h=r===CornerType$1.BEVELED?0:Math.ceil(d/CesiumMath.toRadians(5)),p=n?Matrix3.fromQuaternion(Quaternion.fromAxisAngle(Cartesian3.negate(e,scratch1$2),d/(h+1),quaterion$1),rotMatrix$1):Matrix3.fromQuaternion(Quaternion.fromAxisAngle(e,d/(h+1),quaterion$1),rotMatrix$1);if(t=Cartesian3.clone(t,startPointScratch),0<h)for(var m=c?2:1,f=0;f<h;f++)t=Matrix3.multiplyByVector(p,t,t),u=Cartesian3.subtract(t,e,scratch1$2),u=Cartesian3.normalize(u,u),n||(u=Cartesian3.negate(u,u)),o=addPosition(a.scaleToGeodeticSurface(t,scratch2$2),u,s,o,a,l,1,m);else u=Cartesian3.subtract(t,e,scratch1$2),u=Cartesian3.normalize(u,u),n||(u=Cartesian3.negate(u,u)),o=addPosition(a.scaleToGeodeticSurface(t,scratch2$2),u,s,o,a,l,1,1),i=Cartesian3.clone(i,startPointScratch),u=Cartesian3.subtract(i,e,scratch1$2),u=Cartesian3.normalize(u,u),n||(u=Cartesian3.negate(u,u)),o=addPosition(a.scaleToGeodeticSurface(i,scratch2$2),u,s,o,a,l,1,1);return o}PolylineVolumeGeometryLibrary.removeDuplicatesFromShape=function(e){for(var t=e.length,i=[],r=t-1,n=0;n<t;r=n++){var a=e[r],o=e[n];Cartesian2.equals(a,o)||i.push(o)}return i},PolylineVolumeGeometryLibrary.angleIsGreaterThanPi=function(e,t,i,r){r=new EllipsoidTangentPlane(i,r),e=r.projectPointOntoPlane(Cartesian3.add(i,e,nextScratch),nextScratch),t=r.projectPointOntoPlane(Cartesian3.add(i,t,prevScratch),prevScratch);return 0<=t.x*e.y-t.y*e.x};var scratchForwardProjection$1=new Cartesian3,scratchBackwardProjection$1=new Cartesian3;PolylineVolumeGeometryLibrary.computePositions=function(e,t,i,r,n){var a=r._ellipsoid,o=scaleToSurface$2(e,a),s=r._granularity,l=r._cornerType,c=(n?convertShapeTo3DDuplicate:convertShapeTo3D)(t,i),t=n?convertShapeTo3D(t,i):void 0,u=i.height/2,d=i.width/2,h=e.length,p=[],i=n?[]:void 0,m=scratchCartesian1$3,f=scratchCartesian2$6,g=scratchCartesian3$7,_=scratchCartesian5$1,y=scratchCartesian6,C=scratchCartesian7,v=scratchCartesian8,S=scratchCartesian9,T=e[0],x=e[1];D=a.geodeticSurfaceNormal(T,D=scratchCartesian4$4),m=Cartesian3.subtract(x,T,m),m=Cartesian3.normalize(m,m),v=Cartesian3.cross(D,m,v);var b,v=Cartesian3.normalize(v,v),E=o[0],P=o[1];n&&(i=addPosition(T,v,t,i,a,E+u,1,1)),S=Cartesian3.clone(T,S),T=x,f=Cartesian3.negate(m,f);for(var A=1;A<h-1;A++){var w=n?2:1,x=e[A+1],m=Cartesian3.subtract(x,T,m);m=Cartesian3.normalize(m,m),g=Cartesian3.add(m,f,g),g=Cartesian3.normalize(g,g);var D=a.geodeticSurfaceNormal(T,D),M=Cartesian3.multiplyByScalar(D,Cartesian3.dot(m,D),scratchForwardProjection$1);Cartesian3.subtract(m,M,M),Cartesian3.normalize(M,M);var I=Cartesian3.multiplyByScalar(D,Cartesian3.dot(f,D),scratchBackwardProjection$1);Cartesian3.subtract(f,I,I),Cartesian3.normalize(I,I),!CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(M,I)),1,CesiumMath.EPSILON7)?(g=Cartesian3.cross(g,D,g),g=Cartesian3.cross(D,g,g),g=Cartesian3.normalize(g,g),M=1/Math.max(.25,Cartesian3.magnitude(Cartesian3.cross(g,f,scratch1$2))),(I=PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(m,f,T,a))?(_=Cartesian3.add(T,Cartesian3.multiplyByScalar(g,M*d,g),_),y=Cartesian3.add(_,Cartesian3.multiplyByScalar(v,d,y),y),scratch2Array[0]=Cartesian3.clone(S,scratch2Array[0]),scratch2Array[1]=Cartesian3.clone(y,scratch2Array[1]),b=subdivideHeights(scratch2Array,E+u,P+u,s),p=addPositions(PolylinePipeline.generateArc({positions:scratch2Array,granularity:s,ellipsoid:a}),v,c,p,a,b,1),v=Cartesian3.cross(D,m,v),v=Cartesian3.normalize(v,v),C=Cartesian3.add(_,Cartesian3.multiplyByScalar(v,d,C),C),l===CornerType$1.ROUNDED||l===CornerType$1.BEVELED?computeRoundCorner$1(_,y,C,l,I,a,p,c,P+u,n):p=addPosition(T,g=Cartesian3.negate(g,g),c,p,a,P+u,M,w)):(_=Cartesian3.add(T,Cartesian3.multiplyByScalar(g,M*d,g),_),y=Cartesian3.add(_,Cartesian3.multiplyByScalar(v,-d,y),y),scratch2Array[0]=Cartesian3.clone(S,scratch2Array[0]),scratch2Array[1]=Cartesian3.clone(y,scratch2Array[1]),b=subdivideHeights(scratch2Array,E+u,P+u,s),p=addPositions(PolylinePipeline.generateArc({positions:scratch2Array,granularity:s,ellipsoid:a}),v,c,p,a,b,1),v=Cartesian3.cross(D,m,v),v=Cartesian3.normalize(v,v),C=Cartesian3.add(_,Cartesian3.multiplyByScalar(v,-d,C),C),l===CornerType$1.ROUNDED||l===CornerType$1.BEVELED?computeRoundCorner$1(_,y,C,l,I,a,p,c,P+u,n):p=addPosition(T,g,c,p,a,P+u,M,w)),S=Cartesian3.clone(C,S),f=Cartesian3.negate(m,f)):(p=addPosition(S,v,c,p,a,E+u,1,1),S=T),E=P,P=o[A+1],T=x}scratch2Array[0]=Cartesian3.clone(S,scratch2Array[0]),scratch2Array[1]=Cartesian3.clone(T,scratch2Array[1]),b=subdivideHeights(scratch2Array,E+u,P+u,s),p=addPositions(PolylinePipeline.generateArc({positions:scratch2Array,granularity:s,ellipsoid:a}),v,c,p,a,b,1),n&&(i=addPosition(T,v,t,i,a,P+u,1,1));h=p.length,t=n?h+i.length:h,t=new Float64Array(t);return t.set(p),n&&t.set(i,h),t};var CorridorGeometryLibrary={},scratch1$1=new Cartesian3,scratch2$1=new Cartesian3,scratch3=new Cartesian3,scratch4=new Cartesian3,scaleArray2=[new Cartesian3,new Cartesian3],cartesian1$2=new Cartesian3,cartesian2$2=new Cartesian3,cartesian3$2=new Cartesian3,cartesian4$1=new Cartesian3,cartesian5$1=new Cartesian3,cartesian6$1=new Cartesian3,cartesian7=new Cartesian3,cartesian8=new Cartesian3,cartesian9=new Cartesian3,cartesian10=new Cartesian3,quaterion=new Quaternion,rotMatrix=new Matrix3;function computeRoundCorner(e,t,i,r,n){var a=Cartesian3.angleBetween(Cartesian3.subtract(t,e,scratch1$1),Cartesian3.subtract(i,e,scratch2$1)),o=r===CornerType$1.BEVELED?1:Math.ceil(a/CesiumMath.toRadians(5))+1,r=3*o,s=new Array(r);s[r-3]=i.x,s[r-2]=i.y,s[r-1]=i.z;var l=n?Matrix3.fromQuaternion(Quaternion.fromAxisAngle(Cartesian3.negate(e,scratch1$1),a/o,quaterion),rotMatrix):Matrix3.fromQuaternion(Quaternion.fromAxisAngle(e,a/o,quaterion),rotMatrix),c=0;t=Cartesian3.clone(t,scratch1$1);for(var u=0;u<o;u++)t=Matrix3.multiplyByVector(l,t,t),s[c++]=t.x,s[c++]=t.y,s[c++]=t.z;return s}function addEndCaps(e){var t=cartesian1$2,i=cartesian3$2,r=e[1],n=Cartesian3.fromArray(e[1],r.length-3,n=cartesian2$2),i=Cartesian3.fromArray(e[0],0,i),a=computeRoundCorner(t=Cartesian3.midpoint(n,i,t),n,i,CornerType$1.ROUNDED,!1),o=e.length-1,s=e[o-1],r=e[o];return n=Cartesian3.fromArray(s,s.length-3,n),i=Cartesian3.fromArray(r,0,i),[a,computeRoundCorner(t=Cartesian3.midpoint(n,i,t),n,i,CornerType$1.ROUNDED,!1)]}function computeMiteredCorner(e,t,i,r){var n=scratch1$1;return[(n=(r||(t=Cartesian3.negate(t,t)),Cartesian3.add(e,t,n))).x,n.y,n.z,i.x,i.y,i.z]}function addShiftedPositions(e,t,i,r){for(var n=new Array(e.length),a=new Array(e.length),o=Cartesian3.multiplyByScalar(t,i,scratch1$1),s=Cartesian3.negate(o,scratch2$1),l=0,c=e.length-1,u=0;u<e.length;u+=3){var d=Cartesian3.fromArray(e,u,scratch3),h=Cartesian3.add(d,s,scratch4);n[l++]=h.x,n[l++]=h.y,n[l++]=h.z;d=Cartesian3.add(d,o,scratch4);a[c--]=d.z,a[c--]=d.y,a[c--]=d.x}return r.push(n,a),r}CorridorGeometryLibrary.addAttribute=function(e,t,i,r){var n=t.x,a=t.y,t=t.z;defined(i)&&(e[i]=n,e[i+1]=a,e[i+2]=t),defined(r)&&(e[r]=t,e[r-1]=a,e[r-2]=n)};var scratchForwardProjection=new Cartesian3,scratchBackwardProjection=new Cartesian3;CorridorGeometryLibrary.computePositions=function(e){var t=e.granularity,i=e.positions,r=e.ellipsoid,n=e.width/2,a=e.cornerType,o=e.saveAttributes,s=cartesian1$2,l=cartesian3$2,c=cartesian4$1,u=cartesian5$1,d=cartesian6$1,h=cartesian7,p=cartesian8,m=cartesian9,f=cartesian10,g=[],_=o?[]:void 0,y=o?[]:void 0,C=i[0],v=i[1],S=Cartesian3.normalize(Cartesian3.subtract(v,C,S=cartesian2$2),S),s=r.geodeticSurfaceNormal(C,s),c=Cartesian3.normalize(Cartesian3.cross(s,S,c),c);o&&(_.push(c.x,c.y,c.z),y.push(s.x,s.y,s.z));for(var T,h=Cartesian3.clone(C,h),C=v,l=Cartesian3.negate(S,l),x=[],b=i.length,E=1;E<b-1;E++){s=r.geodeticSurfaceNormal(C,s),v=i[E+1],S=Cartesian3.normalize(Cartesian3.subtract(v,C,S),S),u=Cartesian3.normalize(Cartesian3.add(S,l,u),u);var P=Cartesian3.multiplyByScalar(s,Cartesian3.dot(S,s),scratchForwardProjection);Cartesian3.subtract(S,P,P),Cartesian3.normalize(P,P);var A=Cartesian3.multiplyByScalar(s,Cartesian3.dot(l,s),scratchBackwardProjection);Cartesian3.subtract(l,A,A),Cartesian3.normalize(A,A),CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(P,A)),1,CesiumMath.EPSILON7)||(u=Cartesian3.cross(u,s,u),u=Cartesian3.cross(s,u,u),u=Cartesian3.normalize(u,u),P=n/Math.max(.25,Cartesian3.magnitude(Cartesian3.cross(u,l,scratch1$1))),A=PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(S,l,C,r),u=Cartesian3.multiplyByScalar(u,P,u),A?(p=Cartesian3.add(C,u,p),f=Cartesian3.add(p,Cartesian3.multiplyByScalar(c,n,f),f),m=Cartesian3.add(p,Cartesian3.multiplyByScalar(c,2*n,m),m),scaleArray2[0]=Cartesian3.clone(h,scaleArray2[0]),scaleArray2[1]=Cartesian3.clone(f,scaleArray2[1]),g=addShiftedPositions(PolylinePipeline.generateArc({positions:scaleArray2,granularity:t,ellipsoid:r}),c,n,g),o&&(_.push(c.x,c.y,c.z),y.push(s.x,s.y,s.z)),d=Cartesian3.clone(m,d),c=Cartesian3.normalize(Cartesian3.cross(s,S,c),c),m=Cartesian3.add(p,Cartesian3.multiplyByScalar(c,2*n,m),m),h=Cartesian3.add(p,Cartesian3.multiplyByScalar(c,n,h),h),a===CornerType$1.ROUNDED||a===CornerType$1.BEVELED?x.push({leftPositions:computeRoundCorner(p,d,m,a,A)}):x.push({leftPositions:computeMiteredCorner(C,Cartesian3.negate(u,u),m,A)})):(m=Cartesian3.add(C,u,m),f=Cartesian3.add(m,Cartesian3.negate(Cartesian3.multiplyByScalar(c,n,f),f),f),p=Cartesian3.add(m,Cartesian3.negate(Cartesian3.multiplyByScalar(c,2*n,p),p),p),scaleArray2[0]=Cartesian3.clone(h,scaleArray2[0]),scaleArray2[1]=Cartesian3.clone(f,scaleArray2[1]),g=addShiftedPositions(PolylinePipeline.generateArc({positions:scaleArray2,granularity:t,ellipsoid:r}),c,n,g),o&&(_.push(c.x,c.y,c.z),y.push(s.x,s.y,s.z)),d=Cartesian3.clone(p,d),c=Cartesian3.normalize(Cartesian3.cross(s,S,c),c),p=Cartesian3.add(m,Cartesian3.negate(Cartesian3.multiplyByScalar(c,2*n,p),p),p),h=Cartesian3.add(m,Cartesian3.negate(Cartesian3.multiplyByScalar(c,n,h),h),h),a===CornerType$1.ROUNDED||a===CornerType$1.BEVELED?x.push({rightPositions:computeRoundCorner(m,d,p,a,A)}):x.push({rightPositions:computeMiteredCorner(C,u,p,A)})),l=Cartesian3.negate(S,l)),C=v}return s=r.geodeticSurfaceNormal(C,s),scaleArray2[0]=Cartesian3.clone(h,scaleArray2[0]),scaleArray2[1]=Cartesian3.clone(C,scaleArray2[1]),g=addShiftedPositions(PolylinePipeline.generateArc({positions:scaleArray2,granularity:t,ellipsoid:r}),c,n,g),o&&(_.push(c.x,c.y,c.z),y.push(s.x,s.y,s.z)),{positions:g,corners:x,lefts:_,normals:y,endPositions:T=a===CornerType$1.ROUNDED?addEndCaps(g):T}};var cartesian1$1=new Cartesian3,cartesian2$1=new Cartesian3,cartesian3$1=new Cartesian3,cartesian4=new Cartesian3,cartesian5=new Cartesian3,cartesian6=new Cartesian3,scratch1=new Cartesian3,scratch2=new Cartesian3;function scaleToSurface$1(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function addNormals(e,t,i,r,n,a){var o=e.normals,s=e.tangents,l=e.bitangents,e=Cartesian3.normalize(Cartesian3.cross(i,t,scratch1),scratch1);a.normal&&CorridorGeometryLibrary.addAttribute(o,t,r,n),a.tangent&&CorridorGeometryLibrary.addAttribute(s,e,r,n),a.bitangent&&CorridorGeometryLibrary.addAttribute(l,i,r,n)}function combine$1(e,t,i){var r,n=e.positions,a=e.corners,o=e.endPositions,s=e.lefts,l=e.normals,c=new GeometryAttributes,u=0,d=0,h=0;for(O=0;O<n.length;O+=2)u+=r=n[O].length-3,h+=2*r,d+=n[O+1].length-3;for(u+=3,d+=3,O=0;O<a.length;O++){var p=a[O],m=a[O].leftPositions;defined(m)?u+=r=m.length:d+=r=a[O].rightPositions.length,h+=r}var f,g=defined(o);g&&(u+=f=o[0].length-3,d+=f,h+=6*(f/=3));var _,y,C,v,e=u+d,S=new Float64Array(e),T={normals:t.normal?new Float32Array(e):void 0,tangents:t.tangent?new Float32Array(e):void 0,bitangents:t.bitangent?new Float32Array(e):void 0},x=0,b=e-1,E=cartesian1$1,P=cartesian2$1,A=f/2,w=IndexDatatype$1.createTypedArray(e/3,h),D=0;if(g)for(var M=cartesian3$1,I=cartesian4,R=o[0],E=Cartesian3.fromArray(l,0,E),P=Cartesian3.fromArray(s,0,P),O=0;O<A;O++)M=Cartesian3.fromArray(R,3*(A-1-O),M),I=Cartesian3.fromArray(R,3*(A+O),I),CorridorGeometryLibrary.addAttribute(S,I,x),CorridorGeometryLibrary.addAttribute(S,M,void 0,b),addNormals(T,E,P,x,b,t),v=(y=x/3)+1,C=(_=(b-2)/3)-1,w[D++]=_,w[D++]=y,w[D++]=C,w[D++]=C,w[D++]=y,w[D++]=v,x+=3,b-=3;var L,F,N=0,B=0,V=n[N++],k=n[N++];for(S.set(V,x),S.set(k,b-k.length+1),P=Cartesian3.fromArray(s,B,P),r=k.length-3,O=0;O<r;O+=3)L=i.geodeticSurfaceNormal(Cartesian3.fromArray(V,O,scratch1),scratch1),F=i.geodeticSurfaceNormal(Cartesian3.fromArray(k,r-O,scratch2),scratch2),addNormals(T,E=Cartesian3.normalize(Cartesian3.add(L,F,E),E),P,x,b,t),v=(y=x/3)+1,C=(_=(b-2)/3)-1,w[D++]=_,w[D++]=y,w[D++]=C,w[D++]=C,w[D++]=y,w[D++]=v,x+=3,b-=3;for(L=i.geodeticSurfaceNormal(Cartesian3.fromArray(V,r,scratch1),scratch1),F=i.geodeticSurfaceNormal(Cartesian3.fromArray(k,r,scratch2),scratch2),E=Cartesian3.normalize(Cartesian3.add(L,F,E),E),B+=3,O=0;O<a.length;O++){var z,$,U,G=(p=a[O]).leftPositions,H=p.rightPositions,W=cartesian6,q=cartesian3$1,j=cartesian4;if(E=Cartesian3.fromArray(l,B,E),defined(G)){for(addNormals(T,E,P,void 0,b,t),b-=3,$=v,U=C,z=0;z<G.length/3;z++)W=Cartesian3.fromArray(G,3*z,W),w[D++]=$,w[D++]=U-z-1,w[D++]=U-z,CorridorGeometryLibrary.addAttribute(S,W,void 0,b),q=Cartesian3.fromArray(S,3*(U-z-1),q),j=Cartesian3.fromArray(S,3*$,j),addNormals(T,E,P=Cartesian3.normalize(Cartesian3.subtract(q,j,P),P),void 0,b,t),b-=3;W=Cartesian3.fromArray(S,3*$,W),q=Cartesian3.subtract(Cartesian3.fromArray(S,3*U,q),W,q),j=Cartesian3.subtract(Cartesian3.fromArray(S,3*(U-z),j),W,j),addNormals(T,E,P=Cartesian3.normalize(Cartesian3.add(q,j,P),P),x,void 0,t),x+=3}else{for(addNormals(T,E,P,x,void 0,t),x+=3,$=C,U=v,z=0;z<H.length/3;z++)W=Cartesian3.fromArray(H,3*z,W),w[D++]=$,w[D++]=U+z,w[D++]=U+z+1,CorridorGeometryLibrary.addAttribute(S,W,x),q=Cartesian3.fromArray(S,3*$,q),j=Cartesian3.fromArray(S,3*(U+z),j),addNormals(T,E,P=Cartesian3.normalize(Cartesian3.subtract(q,j,P),P),x,void 0,t),x+=3;W=Cartesian3.fromArray(S,3*$,W),q=Cartesian3.subtract(Cartesian3.fromArray(S,3*(U+z),q),W,q),j=Cartesian3.subtract(Cartesian3.fromArray(S,3*U,j),W,j),addNormals(T,E,P=Cartesian3.normalize(Cartesian3.negate(Cartesian3.add(j,q,P),P),P),void 0,b,t),b-=3}for(V=n[N++],k=n[N++],V.splice(0,3),k.splice(k.length-3,3),S.set(V,x),S.set(k,b-k.length+1),r=k.length-3,B+=3,P=Cartesian3.fromArray(s,B,P),z=0;z<k.length;z+=3)L=i.geodeticSurfaceNormal(Cartesian3.fromArray(V,z,scratch1),scratch1),F=i.geodeticSurfaceNormal(Cartesian3.fromArray(k,r-z,scratch2),scratch2),addNormals(T,E=Cartesian3.normalize(Cartesian3.add(L,F,E),E),P,x,b,t),y=(v=x/3)-1,w[D++]=_=(C=(b-2)/3)+1,w[D++]=y,w[D++]=C,w[D++]=C,w[D++]=y,w[D++]=v,x+=3,b-=3;x-=3,b+=3}if(addNormals(T,E=Cartesian3.fromArray(l,l.length-3,E),P,x,b,t),g){x+=3,b-=3,M=cartesian3$1,I=cartesian4;var Y=o[1];for(O=0;O<A;O++)M=Cartesian3.fromArray(Y,3*(f-O-1),M),I=Cartesian3.fromArray(Y,3*O,I),CorridorGeometryLibrary.addAttribute(S,M,void 0,b),CorridorGeometryLibrary.addAttribute(S,I,x),addNormals(T,E,P,x,b,t),y=(v=x/3)-1,w[D++]=_=(C=(b-2)/3)+1,w[D++]=y,w[D++]=C,w[D++]=C,w[D++]=y,w[D++]=v,x+=3,b-=3}if(c.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:S}),t.st){var X=new Float32Array(e/3*2),Q=0;if(g){u/=3,d/=3;var J,Z=Math.PI/(f+1),K=1/(u-f+1),ee=1/(d-f+1),te=f/2;for(O=1+te;O<f+1;O++)J=CesiumMath.PI_OVER_TWO+Z*O,X[Q++]=ee*(1+Math.cos(J)),X[Q++]=.5*(1+Math.sin(J));for(O=1;O<d-f+1;O++)X[Q++]=O*ee,X[Q++]=0;for(O=f;te<O;O--)J=CesiumMath.PI_OVER_TWO-O*Z,X[Q++]=1-ee*(1+Math.cos(J)),X[Q++]=.5*(1+Math.sin(J));for(O=te;0<O;O--)J=CesiumMath.PI_OVER_TWO-Z*O,X[Q++]=1-K*(1+Math.cos(J)),X[Q++]=.5*(1+Math.sin(J));for(O=u-f;0<O;O--)X[Q++]=O*K,X[Q++]=1;for(O=1;O<1+te;O++)J=CesiumMath.PI_OVER_TWO+Z*O,X[Q++]=K*(1+Math.cos(J)),X[Q++]=.5*(1+Math.sin(J))}else{for(K=1/((u/=3)-1),ee=1/((d/=3)-1),O=0;O<d;O++)X[Q++]=O*ee,X[Q++]=0;for(O=u;0<O;O--)X[Q++]=(O-1)*K,X[Q++]=1}c.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:X})}return t.normal&&(c.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:T.normals})),t.tangent&&(c.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:T.tangents})),t.bitangent&&(c.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:T.bitangents})),{attributes:c,indices:w}}function extrudedAttributes(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var i,r=e.position.values;(t.normal||t.bitangent)&&(i=e.normal.values,l=e.bitangent.values);var n=e.position.values.length/18,a=3*n,o=2*n,s=2*a;if(t.normal||t.bitangent||t.tangent){for(var l,c=t.normal?new Float32Array(6*a):void 0,u=t.tangent?new Float32Array(6*a):void 0,d=t.bitangent?new Float32Array(6*a):void 0,h=cartesian1$1,p=cartesian2$1,m=cartesian3$1,f=cartesian4,g=cartesian5,_=cartesian6,y=s,C=0;C<a;C+=3){var v=y+s,h=Cartesian3.fromArray(r,C,h),p=Cartesian3.fromArray(r,C+a,p),m=Cartesian3.fromArray(r,(C+3)%a,m);p=Cartesian3.subtract(p,h,p),m=Cartesian3.subtract(m,h,m),f=Cartesian3.normalize(Cartesian3.cross(p,m,f),f),t.normal&&(CorridorGeometryLibrary.addAttribute(c,f,v),CorridorGeometryLibrary.addAttribute(c,f,v+3),CorridorGeometryLibrary.addAttribute(c,f,y),CorridorGeometryLibrary.addAttribute(c,f,y+3)),(t.tangent||t.bitangent)&&(_=Cartesian3.fromArray(i,C,_),t.bitangent&&(CorridorGeometryLibrary.addAttribute(d,_,v),CorridorGeometryLibrary.addAttribute(d,_,v+3),CorridorGeometryLibrary.addAttribute(d,_,y),CorridorGeometryLibrary.addAttribute(d,_,y+3)),t.tangent&&(g=Cartesian3.normalize(Cartesian3.cross(_,f,g),g),CorridorGeometryLibrary.addAttribute(u,g,v),CorridorGeometryLibrary.addAttribute(u,g,v+3),CorridorGeometryLibrary.addAttribute(u,g,y),CorridorGeometryLibrary.addAttribute(u,g,y+3))),y+=6}if(t.normal){for(c.set(i),C=0;C<a;C+=3)c[C+a]=-i[C],c[C+a+1]=-i[C+1],c[C+a+2]=-i[C+2];e.normal.values=c}else e.normal=void 0;t.bitangent?(d.set(l),d.set(l,a),e.bitangent.values=d):e.bitangent=void 0,t.tangent&&(l=e.tangent.values,u.set(l),u.set(l,a),e.tangent.values=u)}if(t.st){var S=e.st.values,T=new Float32Array(6*o);T.set(S),T.set(S,o);for(var x=2*o,b=0;b<2;b++){for(T[x++]=S[0],T[x++]=S[1],C=2;C<o;C+=2){var E=S[C],P=S[C+1];T[x++]=E,T[x++]=P,T[x++]=E,T[x++]=P}T[x++]=S[0],T[x++]=S[1]}e.st.values=T}return e}function addWallPositions$1(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;r<e.length;r+=3){var n=e[r],a=e[r+1],o=e[r+2];i[t++]=n,i[t++]=a,i[t++]=o,i[t++]=n,i[t++]=a,i[t++]=o}return i[t++]=e[0],i[t++]=e[1],i[t++]=e[2],i}function computePositionsExtruded$1(e,t){var i=new VertexFormat({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),r=e.ellipsoid,n=combine$1(CorridorGeometryLibrary.computePositions(e),i,r),a=e.height,o=e.extrudedHeight,s=n.attributes,l=n.indices,c=s.position.values,u=c.length,d=new Float64Array(6*u),i=new Float64Array(u);i.set(c);n=new Float64Array(4*u),n=addWallPositions$1(c=PolygonPipeline.scaleToGeodeticHeight(c,a,r),0,n);n=addWallPositions$1(i=PolygonPipeline.scaleToGeodeticHeight(i,o,r),2*u,n),d.set(c),d.set(i,u),d.set(n,2*u),s.position.values=d;var s=extrudedAttributes(s,t),h=u/3;if(e.shadowVolume){for(var p=s.normal.values,u=p.length,n=new Float32Array(6*u),m=0;m<u;m++)p[m]=-p[m];n.set(p,u),n=addWallPositions$1(p,4*u,n),s.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:n}),t.normal||(s.normal=void 0)}defined(e.offsetAttribute)&&(t=new Uint8Array(6*h),t=e.offsetAttribute===GeometryOffsetAttribute$1.TOP?(t=arrayFill(t,1,0,h),arrayFill(t,1,2*h,4*h)):arrayFill(t,e.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),s.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:t}));var f=l.length,g=h+h,_=IndexDatatype$1.createTypedArray(d.length/3,2*f+3*g);_.set(l);var y,C,v,S,T=f;for(m=0;m<f;m+=3){var x=l[m],b=l[m+1],E=l[m+2];_[T++]=E+h,_[T++]=b+h,_[T++]=x+h}for(m=0;m<g;m+=2)v=(y=m+g)+1,S=(C=y+g)+1,_[T++]=y,_[T++]=C,_[T++]=v,_[T++]=v,_[T++]=C,_[T++]=S;return{attributes:s,indices:_}}var scratchCartesian1$2=new Cartesian3,scratchCartesian2$5=new Cartesian3,scratchCartographic$d=new Cartographic;function computeOffsetPoints(e,t,i,r,n,a){var o=Cartesian3.subtract(t,e,scratchCartesian1$2);Cartesian3.normalize(o,o);var s=i.geodeticSurfaceNormal(e,scratchCartesian2$5),l=Cartesian3.cross(o,s,scratchCartesian1$2);Cartesian3.multiplyByScalar(l,r,l);var c=n.latitude,u=n.longitude,t=a.latitude,o=a.longitude;Cartesian3.add(e,l,scratchCartesian2$5),i.cartesianToCartographic(scratchCartesian2$5,scratchCartographic$d);s=scratchCartographic$d.latitude,r=scratchCartographic$d.longitude,c=Math.min(c,s),u=Math.min(u,r),t=Math.max(t,s),o=Math.max(o,r);Cartesian3.subtract(e,l,scratchCartesian2$5),i.cartesianToCartographic(scratchCartesian2$5,scratchCartographic$d),s=scratchCartographic$d.latitude,r=scratchCartographic$d.longitude,c=Math.min(c,s),u=Math.min(u,r),t=Math.max(t,s),o=Math.max(o,r),n.latitude=c,n.longitude=u,a.latitude=t,a.longitude=o}var scratchCartesianOffset=new Cartesian3,scratchCartesianEnds=new Cartesian3,scratchCartographicMin=new Cartographic,scratchCartographicMax=new Cartographic;function computeRectangle$2(e,t,i,r,n){var a=arrayRemoveDuplicates(e=scaleToSurface$1(e,t),Cartesian3.equalsEpsilon),o=a.length;if(o<2||i<=0)return new Rectangle;var s,l,c=.5*i;scratchCartographicMin.latitude=Number.POSITIVE_INFINITY,scratchCartographicMin.longitude=Number.POSITIVE_INFINITY,scratchCartographicMax.latitude=Number.NEGATIVE_INFINITY,scratchCartographicMax.longitude=Number.NEGATIVE_INFINITY,r===CornerType$1.ROUNDED&&(d=a[0],Cartesian3.subtract(d,a[1],scratchCartesianOffset),Cartesian3.normalize(scratchCartesianOffset,scratchCartesianOffset),Cartesian3.multiplyByScalar(scratchCartesianOffset,c,scratchCartesianOffset),Cartesian3.add(d,scratchCartesianOffset,scratchCartesianEnds),t.cartesianToCartographic(scratchCartesianEnds,scratchCartographic$d),s=scratchCartographic$d.latitude,l=scratchCartographic$d.longitude,scratchCartographicMin.latitude=Math.min(scratchCartographicMin.latitude,s),scratchCartographicMin.longitude=Math.min(scratchCartographicMin.longitude,l),scratchCartographicMax.latitude=Math.max(scratchCartographicMax.latitude,s),scratchCartographicMax.longitude=Math.max(scratchCartographicMax.longitude,l));for(var u=0;u<o-1;++u)computeOffsetPoints(a[u],a[u+1],t,c,scratchCartographicMin,scratchCartographicMax);var d=a[o-1];Cartesian3.subtract(d,a[o-2],scratchCartesianOffset),Cartesian3.normalize(scratchCartesianOffset,scratchCartesianOffset),Cartesian3.multiplyByScalar(scratchCartesianOffset,c,scratchCartesianOffset),Cartesian3.add(d,scratchCartesianOffset,scratchCartesianEnds),computeOffsetPoints(d,scratchCartesianEnds,t,c,scratchCartographicMin,scratchCartographicMax),r===CornerType$1.ROUNDED&&(t.cartesianToCartographic(scratchCartesianEnds,scratchCartographic$d),s=scratchCartographic$d.latitude,l=scratchCartographic$d.longitude,scratchCartographicMin.latitude=Math.min(scratchCartographicMin.latitude,s),scratchCartographicMin.longitude=Math.min(scratchCartographicMin.longitude,l),scratchCartographicMax.latitude=Math.max(scratchCartographicMax.latitude,s),scratchCartographicMax.longitude=Math.max(scratchCartographicMax.longitude,l));n=defined(n)?n:new Rectangle;return n.north=scratchCartographicMax.latitude,n.south=scratchCartographicMin.latitude,n.east=scratchCartographicMax.longitude,n.west=scratchCartographicMin.longitude,n}function CorridorGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=defaultValue(e.height,0),n=defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._vertexFormat=VertexFormat.clone(defaultValue(e.vertexFormat,VertexFormat.DEFAULT)),this._width=i,this._height=Math.max(r,n),this._extrudedHeight=Math.min(r,n),this._cornerType=defaultValue(e.cornerType,CornerType$1.ROUNDED),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=defaultValue(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*Cartesian3.packedLength+Ellipsoid.packedLength+VertexFormat.packedLength+7}CorridorGeometry.pack=function(e,t,i){i=defaultValue(i,0);var r=e._positions,n=r.length;t[i++]=n;for(var a=0;a<n;++a,i+=Cartesian3.packedLength)Cartesian3.pack(r[a],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i++]=e._shadowVolume?1:0,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchEllipsoid$b=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$9=new VertexFormat,scratchOptions$f={positions:void 0,ellipsoid:scratchEllipsoid$b,vertexFormat:scratchVertexFormat$9,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};CorridorGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r=e[t++],n=new Array(r),a=0;a<r;++a,t+=Cartesian3.packedLength)n[a]=Cartesian3.unpack(e,t);var o=Ellipsoid.unpack(e,t,scratchEllipsoid$b);t+=Ellipsoid.packedLength;var s=VertexFormat.unpack(e,t,scratchVertexFormat$9);t+=VertexFormat.packedLength;var l=e[t++],c=e[t++],u=e[t++],d=e[t++],h=e[t++],p=1===e[t++],m=e[t];return defined(i)?(i._positions=n,i._ellipsoid=Ellipsoid.clone(o,i._ellipsoid),i._vertexFormat=VertexFormat.clone(s,i._vertexFormat),i._width=l,i._height=c,i._extrudedHeight=u,i._cornerType=d,i._granularity=h,i._shadowVolume=p,i._offsetAttribute=-1===m?void 0:m,i):(scratchOptions$f.positions=n,scratchOptions$f.width=l,scratchOptions$f.height=c,scratchOptions$f.extrudedHeight=u,scratchOptions$f.cornerType=d,scratchOptions$f.granularity=h,scratchOptions$f.shadowVolume=p,scratchOptions$f.offsetAttribute=-1===m?void 0:m,new CorridorGeometry(scratchOptions$f))},CorridorGeometry.computeRectangle=function(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,r=e.width;return computeRectangle$2(i,defaultValue(e.ellipsoid,Ellipsoid.WGS84),r,defaultValue(e.cornerType,CornerType$1.ROUNDED),t)},CorridorGeometry.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,n=arrayRemoveDuplicates(t=scaleToSurface$1(t,r),Cartesian3.equalsEpsilon);if(!(n.length<2||i<=0)){var a,o=e._height,s=e._extrudedHeight,l=!CesiumMath.equalsEpsilon(o,s,0,CesiumMath.EPSILON2),t=e._vertexFormat,i={ellipsoid:r,positions:n,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0};l?(i.height=o,i.extrudedHeight=s,i.shadowVolume=e._shadowVolume,i.offsetAttribute=e._offsetAttribute,a=computePositionsExtruded$1(i,t)):((a=combine$1(CorridorGeometryLibrary.computePositions(i),t,r)).attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,o,r),defined(e._offsetAttribute)&&(c=e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1,u=a.attributes.position.values.length,arrayFill(u=new Uint8Array(u/3),c),a.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})));var c=a.attributes,u=BoundingSphere.fromVertices(c.position.values,void 0,3);return t.position||(a.attributes.position.values=void 0),new Geometry({attributes:c,indices:a.indices,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:u,offsetAttribute:e._offsetAttribute})}},CorridorGeometry.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,t=t(r,n),i=i(r,n);return new CorridorGeometry({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:t,height:i,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(CorridorGeometry.prototype,{rectangle:{get:function(){return defined(this._rectangle)||(this._rectangle=computeRectangle$2(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var cartesian1=new Cartesian3,cartesian2=new Cartesian3,cartesian3=new Cartesian3;function scaleToSurface(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function combine(e,t){var i,r=[],n=e.positions,a=e.corners,o=e.endPositions,s=new GeometryAttributes,l=0,c=0,u=0;for(w=0;w<n.length;w+=2)l+=i=n[w].length-3,u+=i/3*4,c+=n[w+1].length-3;for(l+=3,c+=3,w=0;w<a.length;w++){var d=a[w],h=a[w].leftPositions;defined(h)?l+=i=h.length:c+=i=a[w].rightPositions.length,u+=i/3*2}var p,m=defined(o);m&&(l+=p=o[0].length-3,c+=p,u+=4*(p/=3));var f,g,_,y,e=l+c,C=new Float64Array(e),v=0,S=e-1,T=p/2,x=IndexDatatype$1.createTypedArray(e/3,u+4),b=0;if(x[b++]=v/3,x[b++]=(S-2)/3,m){r.push(v/3);for(var E=cartesian1,P=cartesian2,A=o[0],w=0;w<T;w++)E=Cartesian3.fromArray(A,3*(T-1-w),E),P=Cartesian3.fromArray(A,3*(T+w),P),CorridorGeometryLibrary.addAttribute(C,P,v),CorridorGeometryLibrary.addAttribute(C,E,void 0,S),y=(g=v/3)+1,_=(f=(S-2)/3)-1,x[b++]=f,x[b++]=_,x[b++]=g,x[b++]=y,v+=3,S-=3}var D=0,M=n[D++],I=n[D++];for(C.set(M,v),C.set(I,S-I.length+1),i=I.length-3,r.push(v/3,(S-2)/3),w=0;w<i;w+=3)y=(g=v/3)+1,_=(f=(S-2)/3)-1,x[b++]=f,x[b++]=_,x[b++]=g,x[b++]=y,v+=3,S-=3;for(w=0;w<a.length;w++){var R,O,L=(d=a[w]).leftPositions,F=d.rightPositions,N=cartesian3;if(defined(L)){for(S-=3,O=_,r.push(y),R=0;R<L.length/3;R++)N=Cartesian3.fromArray(L,3*R,N),x[b++]=O-R-1,x[b++]=O-R,CorridorGeometryLibrary.addAttribute(C,N,void 0,S),S-=3;r.push(O-Math.floor(L.length/6)),t===CornerType$1.BEVELED&&r.push((S-2)/3+1),v+=3}else{for(v+=3,O=y,r.push(_),R=0;R<F.length/3;R++)N=Cartesian3.fromArray(F,3*R,N),x[b++]=O+R,x[b++]=O+R+1,CorridorGeometryLibrary.addAttribute(C,N,v),v+=3;r.push(O+Math.floor(F.length/6)),t===CornerType$1.BEVELED&&r.push(v/3-1),S-=3}for(M=n[D++],I=n[D++],M.splice(0,3),I.splice(I.length-3,3),C.set(M,v),C.set(I,S-I.length+1),i=I.length-3,R=0;R<I.length;R+=3)g=(y=v/3)-1,x[b++]=f=(_=(S-2)/3)+1,x[b++]=_,x[b++]=g,x[b++]=y,v+=3,S-=3;v-=3,S+=3,r.push(v/3,(S-2)/3)}if(m){v+=3,S-=3,E=cartesian1,P=cartesian2;var B=o[1];for(w=0;w<T;w++)E=Cartesian3.fromArray(B,3*(p-w-1),E),P=Cartesian3.fromArray(B,3*w,P),CorridorGeometryLibrary.addAttribute(C,E,void 0,S),CorridorGeometryLibrary.addAttribute(C,P,v),g=(y=v/3)-1,x[b++]=f=(_=(S-2)/3)+1,x[b++]=_,x[b++]=g,x[b++]=y,v+=3,S-=3;r.push(v/3)}else r.push(v/3,(S-2)/3);return x[b++]=v/3,x[b++]=(S-2)/3,s.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:C}),{attributes:s,indices:x,wallIndices:r}}function computePositionsExtruded(e){var t=e.ellipsoid,i=combine(CorridorGeometryLibrary.computePositions(e),e.cornerType),r=i.wallIndices,n=e.height,a=e.extrudedHeight,o=i.attributes,s=i.indices,l=(c=o.position.values).length;(u=new Float64Array(l)).set(c);var i=new Float64Array(2*l),c=PolygonPipeline.scaleToGeodeticHeight(c,n,t),u=PolygonPipeline.scaleToGeodeticHeight(u,a,t);i.set(c),i.set(u,l),o.position.values=i,l/=3,defined(e.offsetAttribute)&&(u=new Uint8Array(2*l),u=e.offsetAttribute===GeometryOffsetAttribute$1.TOP?arrayFill(u,1,0,l):arrayFill(u,e.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),o.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:u}));var d=s.length,h=IndexDatatype$1.createTypedArray(i.length/3,2*(d+r.length));h.set(s);for(var p,m,f=d,g=0;g<d;g+=2){var _=s[g],y=s[g+1];h[f++]=_+l,h[f++]=y+l}for(g=0;g<r.length;g++)m=(p=r[g])+l,h[f++]=p,h[f++]=m;return{attributes:o,indices:h}}function CorridorOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=defaultValue(e.height,0),n=defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._width=i,this._height=Math.max(r,n),this._extrudedHeight=Math.min(r,n),this._cornerType=defaultValue(e.cornerType,CornerType$1.ROUNDED),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*Cartesian3.packedLength+Ellipsoid.packedLength+6}CorridorOutlineGeometry.pack=function(e,t,i){i=defaultValue(i,0);var r=e._positions,n=r.length;t[i++]=n;for(var a=0;a<n;++a,i+=Cartesian3.packedLength)Cartesian3.pack(r[a],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchEllipsoid$a=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$e={positions:void 0,ellipsoid:scratchEllipsoid$a,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0},defaultTokenCredit;function createGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}CorridorOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r=e[t++],n=new Array(r),a=0;a<r;++a,t+=Cartesian3.packedLength)n[a]=Cartesian3.unpack(e,t);var o=Ellipsoid.unpack(e,t,scratchEllipsoid$a);t+=Ellipsoid.packedLength;var s=e[t++],l=e[t++],c=e[t++],u=e[t++],d=e[t++],h=e[t];return defined(i)?(i._positions=n,i._ellipsoid=Ellipsoid.clone(o,i._ellipsoid),i._width=s,i._height=l,i._extrudedHeight=c,i._cornerType=u,i._granularity=d,i._offsetAttribute=-1===h?void 0:h,i):(scratchOptions$e.positions=n,scratchOptions$e.width=s,scratchOptions$e.height=l,scratchOptions$e.extrudedHeight=c,scratchOptions$e.cornerType=u,scratchOptions$e.granularity=d,scratchOptions$e.offsetAttribute=-1===h?void 0:h,new CorridorOutlineGeometry(scratchOptions$e))},CorridorOutlineGeometry.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,n=arrayRemoveDuplicates(t=scaleToSurface(t,r),Cartesian3.equalsEpsilon);if(!(n.length<2||i<=0)){var a,o=e._height,s=e._extrudedHeight,t=!CesiumMath.equalsEpsilon(o,s,0,CesiumMath.EPSILON2),i={ellipsoid:r,positions:n,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};t?(i.height=o,i.extrudedHeight=s,i.offsetAttribute=e._offsetAttribute,a=computePositionsExtruded(i)):((a=combine(CorridorGeometryLibrary.computePositions(i),i.cornerType)).attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,o,r),defined(e._offsetAttribute)&&(l=a.attributes.position.values.length,arrayFill(c=new Uint8Array(l/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),a.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})));var l=a.attributes,c=BoundingSphere.fromVertices(l.position.values,void 0,3);return new Geometry({attributes:l,indices:a.indices,primitiveType:PrimitiveType$1.LINES,boundingSphere:c,offsetAttribute:e._offsetAttribute})}};var defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlNzhiOGFmZi0wMDhkLTQyZGItODMxYi1jZTE1Yzc1YWU5NDAiLCJpZCI6MjU5LCJpYXQiOjE2MTcyOTExODV9.ZMm6ggSpVEnvlUfE_sa-ZQ5AXhPAFVjshKZMB48w0AE",Ion={};function IonResource(e,t){var i,r=e.externalType,n=defined(r);if(n){if("3DTILES"!==r&&"STK_TERRAIN_SERVER"!==r)throw new RuntimeError("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");i={url:e.options.url}}else i={url:e.url,retryAttempts:1,retryCallback:retryCallback};Resource.call(this,i),this._ionEndpoint=e,this._ionEndpointDomain=n?void 0:new URI(e.url).authority,this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=n}function retryCallback(t,e){var i=defaultValue(t._ionRoot,t),r=i._ionEndpointResource,n="undefined"!=typeof Image;return defined(e)&&(401===e.statusCode||n&&e.target instanceof Image)?(defined(i._pendingPromise)||(i._pendingPromise=r.fetchJson().then(function(e){return i._ionEndpoint=e}).always(function(e){return i._pendingPromise=void 0,e})),i._pendingPromise.then(function(e){return t._ionEndpoint=e,!0})):when.resolve(!1)}function createWorldTerrain(e){return e=defaultValue(e,defaultValue.EMPTY_OBJECT),new CesiumTerrainProvider({url:IonResource.fromAssetId(1),requestVertexNormals:defaultValue(e.requestVertexNormals,!1),requestWaterMask:defaultValue(e.requestWaterMask,!1)})}function CullingVolume(e){this.planes=defaultValue(e,[])}Ion.defaultAccessToken=defaultAccessToken,Ion.defaultServer=new Resource({url:"https://api.cesium.com/"}),Ion.getDefaultTokenCredit=function(e){if(e===defaultAccessToken)return defined(defaultTokenCredit)||(defaultTokenCredit=new Credit('<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>',!0)),defaultTokenCredit},defined(Object.create)&&(IonResource.prototype=Object.create(Resource.prototype),IonResource.prototype.constructor=IonResource),IonResource.fromAssetId=function(e,t){var i=IonResource._createEndpointResource(e,t);return i.fetchJson().then(function(e){return new IonResource(e,i)})},Object.defineProperties(IonResource.prototype,{credits:{get:function(){return defined(this._ionRoot)?this._ionRoot.credits:(defined(this._credits)||(this._credits=IonResource.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource)),this._credits)}}}),IonResource.getCreditsFromEndpoint=function(e,t){e=e.attributions.map(Credit.getIonCredit),t=Ion.getDefaultTokenCredit(t.queryParameters.access_token);return defined(t)&&e.push(Credit.clone(t)),e},IonResource.prototype.clone=function(e){var t=defaultValue(this._ionRoot,this);return defined(e)||(e=new IonResource(t._ionEndpoint,t._ionEndpointResource)),(e=Resource.prototype.clone.call(this,e))._ionRoot=t,e._isExternal=this._isExternal,e},IonResource.prototype.fetchImage=function(e){var t;return this._isExternal||(t=e,e={preferBlob:!0},defined(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)),Resource.prototype.fetchImage.call(this,e)},IonResource.prototype._makeRequest=function(e){return this._isExternal||new URI(this.url).authority!==this._ionEndpointDomain||(defined(e.headers)||(e.headers={}),e.headers.Authorization="Bearer "+this._ionEndpoint.accessToken),Resource.prototype._makeRequest.call(this,e)},IonResource._createEndpointResource=function(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=defaultValue(t.server,Ion.defaultServer),t=defaultValue(t.accessToken,Ion.defaultAccessToken),i=Resource.createIfNeeded(i),e={url:"v1/assets/"+e+"/endpoint"};return defined(t)&&(e.queryParameters={access_token:t}),i.getDerivedResource(e)};var faces=[new Cartesian3,new Cartesian3,new Cartesian3];Cartesian3.clone(Cartesian3.UNIT_X,faces[0]),Cartesian3.clone(Cartesian3.UNIT_Y,faces[1]),Cartesian3.clone(Cartesian3.UNIT_Z,faces[2]);var scratchPlaneCenter=new Cartesian3,scratchPlaneNormal=new Cartesian3,scratchPlane$1=new Plane(new Cartesian3(1,0,0),0);CullingVolume.fromBoundingSphere=function(e,t){defined(t)||(t=new CullingVolume);var i=faces.length,r=t.planes;r.length=2*i;for(var n=e.center,a=e.radius,o=0,s=0;s<i;++s){var l=faces[s],c=r[o],u=r[o+1];defined(c)||(c=r[o]=new Cartesian4),defined(u)||(u=r[o+1]=new Cartesian4),Cartesian3.multiplyByScalar(l,-a,scratchPlaneCenter),Cartesian3.add(n,scratchPlaneCenter,scratchPlaneCenter),c.x=l.x,c.y=l.y,c.z=l.z,c.w=-Cartesian3.dot(l,scratchPlaneCenter),Cartesian3.multiplyByScalar(l,a,scratchPlaneCenter),Cartesian3.add(n,scratchPlaneCenter,scratchPlaneCenter),u.x=-l.x,u.y=-l.y,u.z=-l.z,u.w=-Cartesian3.dot(Cartesian3.negate(l,scratchPlaneNormal),scratchPlaneCenter),o+=2}return t},CullingVolume.prototype.computeVisibility=function(e){for(var t=this.planes,i=!1,r=0,n=t.length;r<n;++r){var a=e.intersectPlane(Plane.fromCartesian4(t[r],scratchPlane$1));if(a===Intersect$1.OUTSIDE)return Intersect$1.OUTSIDE;a===Intersect$1.INTERSECTING&&(i=!0)}return i?Intersect$1.INTERSECTING:Intersect$1.INSIDE},CullingVolume.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===CullingVolume.MASK_OUTSIDE||t===CullingVolume.MASK_INSIDE)return t;for(var i=CullingVolume.MASK_INSIDE,r=this.planes,n=0,a=r.length;n<a;++n){var o=n<31?1<<n:0;if(!(n<31&&0==(t&o))){var s=e.intersectPlane(Plane.fromCartesian4(r[n],scratchPlane$1));if(s===Intersect$1.OUTSIDE)return CullingVolume.MASK_OUTSIDE;s===Intersect$1.INTERSECTING&&(i|=o)}}return i},CullingVolume.MASK_OUTSIDE=4294967295,CullingVolume.MASK_INSIDE=0,CullingVolume.MASK_INDETERMINATE=2147483647;var CylinderGeometryLibrary={computePositions:function(e,t,i,r,n){for(var a=.5*e,o=-a,e=r+r,s=new Float64Array(3*(n?2*e:e)),l=0,c=0,u=n?3*e:0,d=n?3*(e+r):3*r,h=0;h<r;h++){var p=h/r*CesiumMath.TWO_PI,m=Math.cos(p),f=Math.sin(p),g=m*i,p=f*i,m=m*t,f=f*t;s[c+u]=g,s[c+u+1]=p,s[c+u+2]=o,s[c+d]=m,s[c+d+1]=f,s[c+d+2]=a,c+=3,n&&(s[l++]=g,s[l++]=p,s[l++]=o,s[l++]=m,s[l++]=f,s[l++]=a)}return s}},radiusScratch$1=new Cartesian2,normalScratch$3=new Cartesian3,bitangentScratch$1=new Cartesian3,tangentScratch$1=new Cartesian3,positionScratch$a=new Cartesian3;function CylinderGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).length,i=e.topRadius,r=e.bottomRadius,n=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),a=defaultValue(e.slices,128);this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=VertexFormat.clone(n),this._slices=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}CylinderGeometry.packedLength=VertexFormat.packedLength+5,CylinderGeometry.pack=function(e,t,i){return i=defaultValue(i,0),VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchVertexFormat$8=new VertexFormat,scratchOptions$d={vertexFormat:scratchVertexFormat$8,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0},unitCylinderGeometry;CylinderGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=VertexFormat.unpack(e,t,scratchVertexFormat$8);t+=VertexFormat.packedLength;var n=e[t++],a=e[t++],o=e[t++],s=e[t++],t=e[t];return defined(i)?(i._vertexFormat=VertexFormat.clone(r,i._vertexFormat),i._length=n,i._topRadius=a,i._bottomRadius=o,i._slices=s,i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$d.length=n,scratchOptions$d.topRadius=a,scratchOptions$d.bottomRadius=o,scratchOptions$d.slices=s,scratchOptions$d.offsetAttribute=-1===t?void 0:t,new CylinderGeometry(scratchOptions$d))},CylinderGeometry.createGeometry=function(e){var t=e._length,i=e._topRadius,r=e._bottomRadius,n=e._vertexFormat,a=e._slices;if(!(t<=0||i<0||r<0||0===i&&0===r)){var o=a+a,s=a+o,l=o+o,c=CylinderGeometryLibrary.computePositions(t,i,r,a,!0),u=n.st?new Float32Array(2*l):void 0,d=n.normal?new Float32Array(3*l):void 0,h=n.tangent?new Float32Array(3*l):void 0,p=n.bitangent?new Float32Array(3*l):void 0,m=n.normal||n.tangent||n.bitangent;if(m){var f=n.tangent||n.bitangent,g=0,_=0,y=0,C=Math.atan2(r-i,t),v=normalScratch$3;v.z=Math.sin(C);for(var S=Math.cos(C),T=tangentScratch$1,x=bitangentScratch$1,b=0;b<a;b++){var E=b/a*CesiumMath.TWO_PI,P=S*Math.cos(E),E=S*Math.sin(E);m&&(v.x=P,v.y=E,f&&(T=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,v,T),T)),n.normal&&(d[g++]=v.x,d[g++]=v.y,d[g++]=v.z,d[g++]=v.x,d[g++]=v.y,d[g++]=v.z),n.tangent&&(h[_++]=T.x,h[_++]=T.y,h[_++]=T.z,h[_++]=T.x,h[_++]=T.y,h[_++]=T.z),n.bitangent&&(x=Cartesian3.normalize(Cartesian3.cross(v,T,x),x),p[y++]=x.x,p[y++]=x.y,p[y++]=x.z,p[y++]=x.x,p[y++]=x.y,p[y++]=x.z))}for(b=0;b<a;b++)n.normal&&(d[g++]=0,d[g++]=0,d[g++]=-1),n.tangent&&(h[_++]=1,h[_++]=0,h[_++]=0),n.bitangent&&(p[y++]=0,p[y++]=-1,p[y++]=0);for(b=0;b<a;b++)n.normal&&(d[g++]=0,d[g++]=0,d[g++]=1),n.tangent&&(h[_++]=1,h[_++]=0,h[_++]=0),n.bitangent&&(p[y++]=0,p[y++]=1,p[y++]=0)}var A=IndexDatatype$1.createTypedArray(l,12*a-12),w=0,D=0;for(b=0;b<a-1;b++)A[w++]=D,A[w++]=D+2,A[w++]=D+3,A[w++]=D,A[w++]=D+3,A[w++]=D+1,D+=2;for(A[w++]=o-2,A[w++]=0,A[w++]=1,A[w++]=o-2,A[w++]=1,A[w++]=o-1,b=1;b<a-1;b++)A[w++]=o+b+1,A[w++]=o+b,A[w++]=o;for(b=1;b<a-1;b++)A[w++]=s,A[w++]=s+b,A[w++]=s+b+1;var M=0;if(n.st){var I=Math.max(i,r);for(b=0;b<l;b++){var R=Cartesian3.fromArray(c,3*b,positionScratch$a);u[M++]=(R.x+I)/(2*I),u[M++]=(R.y+I)/(2*I)}}C=new GeometryAttributes;n.position&&(C.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:c})),n.normal&&(C.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:d})),n.tangent&&(C.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:h})),n.bitangent&&(C.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:p})),n.st&&(C.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:u})),radiusScratch$1.x=.5*t,radiusScratch$1.y=Math.max(r,i);i=new BoundingSphere(Cartesian3.ZERO,Cartesian2.magnitude(radiusScratch$1));return defined(e._offsetAttribute)&&(t=c.length,arrayFill(t=new Uint8Array(t/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),C.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})),new Geometry({attributes:C,indices:A,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:i,offsetAttribute:e._offsetAttribute})}},CylinderGeometry.getUnitCylinder=function(){return unitCylinderGeometry=!defined(unitCylinderGeometry)?CylinderGeometry.createGeometry(new CylinderGeometry({topRadius:1,bottomRadius:1,length:1,vertexFormat:VertexFormat.POSITION_ONLY})):unitCylinderGeometry};var radiusScratch=new Cartesian2;function CylinderOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).length,i=e.topRadius,r=e.bottomRadius,n=defaultValue(e.slices,128),a=Math.max(defaultValue(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}CylinderOutlineGeometry.packedLength=6,CylinderOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i++]=e._numberOfVerticalLines,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchOptions$c={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};CylinderOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=e[t++],n=e[t++],a=e[t++],o=e[t++],s=e[t++],t=e[t];return defined(i)?(i._length=r,i._topRadius=n,i._bottomRadius=a,i._slices=o,i._numberOfVerticalLines=s,i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$c.length=r,scratchOptions$c.topRadius=n,scratchOptions$c.bottomRadius=a,scratchOptions$c.slices=o,scratchOptions$c.numberOfVerticalLines=s,scratchOptions$c.offsetAttribute=-1===t?void 0:t,new CylinderOutlineGeometry(scratchOptions$c))},CylinderOutlineGeometry.createGeometry=function(e){var t=e._length,i=e._topRadius,r=e._bottomRadius,n=e._slices,a=e._numberOfVerticalLines;if(!(t<=0||i<0||r<0||0===i&&0===r)){var o,s,l=2*n,c=CylinderGeometryLibrary.computePositions(t,i,r,n,!1),u=2*n;0<a&&(o=Math.min(a,n),s=Math.round(n/o),u+=o);for(var d=IndexDatatype$1.createTypedArray(l,2*u),h=0,p=0;p<n-1;p++)d[h++]=p,d[h++]=p+1,d[h++]=p+n,d[h++]=p+1+n;if(d[h++]=n-1,d[h++]=0,d[h++]=n+n-1,d[h++]=n,0<a)for(p=0;p<n;p+=s)d[h++]=p,d[h++]=p+n;a=new GeometryAttributes;a.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:c}),radiusScratch.x=.5*t,radiusScratch.y=Math.max(r,i);i=new BoundingSphere(Cartesian3.ZERO,Cartesian2.magnitude(radiusScratch));return defined(e._offsetAttribute)&&(t=c.length,arrayFill(t=new Uint8Array(t/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),a.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})),new Geometry({attributes:a,indices:d,primitiveType:PrimitiveType$1.LINES,boundingSphere:i,offsetAttribute:e._offsetAttribute})}};var compressedMagic=1953029805,compressedMagicSwap=2917034100;function decodeGoogleEarthEnterpriseData(e,t){if(decodeGoogleEarthEnterpriseData.passThroughDataForTesting)return t;var i=e.byteLength;if(0===i||i%4!=0)throw new RuntimeError("The length of key must be greater than 0 and a multiple of 4.");var r=new DataView(t),n=r.getUint32(0,!0);if(n===compressedMagic||n===compressedMagicSwap)return t;for(var a,o=new DataView(e),s=0,l=t.byteLength,c=l-l%8,u=i,d=8;s<c;)for(a=d=(d+8)%24;s<c&&a<u;)r.setUint32(s,r.getUint32(s,!0)^o.getUint32(a,!0),!0),r.setUint32(s+4,r.getUint32(s+4,!0)^o.getUint32(a+4,!0),!0),s+=8,a+=24;if(s<l)for(u<=a&&(a=d=(d+8)%24);s<l;)r.setUint8(s,r.getUint8(s)^o.getUint8(a)),s++,a++}decodeGoogleEarthEnterpriseData.passThroughDataForTesting=!1;var maxShort=32767,scratchBVCartographic$1=new Cartographic,scratchEncodedPosition=new Cartesian3;function decodeVectorPolylinePositions(e,t,i,r,n){var a=e.length/3,o=e.subarray(0,a),s=e.subarray(a,2*a),l=e.subarray(2*a,3*a);AttributeCompression.zigZagDeltaDecode(o,s,l);for(var c=new Float64Array(e.length),u=0;u<a;++u){var d=o[u],h=s[u],p=l[u],d=CesiumMath.lerp(t.west,t.east,d/maxShort),h=CesiumMath.lerp(t.south,t.north,h/maxShort),p=CesiumMath.lerp(i,r,p/maxShort),p=Cartographic.fromRadians(d,h,p,scratchBVCartographic$1),p=n.cartographicToCartesian(p,scratchEncodedPosition);Cartesian3.pack(p,c,3*u)}return c}function DefaultProxy(e){this.proxy=e}DefaultProxy.prototype.getURL=function(e){var t=-1===this.proxy.indexOf("?")?"?":"";return this.proxy+t+encodeURIComponent(e)};var warnings={};function oneTimeWarning(e,t){defined(warnings[e])||(warnings[e]=!0,console.warn(defaultValue(t,e)))}function deprecationWarning(e,t){oneTimeWarning(e,t)}function DistanceDisplayCondition(e,t){e=defaultValue(e,0),this._near=e,t=defaultValue(t,Number.MAX_VALUE),this._far=t}function DistanceDisplayConditionGeometryInstanceAttribute(e,t){e=defaultValue(e,0),t=defaultValue(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}function DoubleEndedPriorityQueue(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=defined(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}function swap$3(e,t,i){var r=e._array,e=r[t];r[t]=r[i],r[i]=e}function lessThan(e,t,i){return e._comparator(e._array[t],e._array[i])<0}function greaterThan(e,t,i){return 0<e._comparator(e._array[t],e._array[i])}function pushUp(e,t){if(0!==t){var i=Math.floor(CesiumMath.log2(t+1))%2==0,r=Math.floor((t-1)/2),n=lessThan(e,t,r);for(n!==i&&(swap$3(e,t,r),t=r);3<=t;){var a=Math.floor((t-3)/4);if(lessThan(e,t,a)!==n)break;swap$3(e,t,a),t=a}}}function pushDown(e,t){for(var i,r=e._length,n=Math.floor(CesiumMath.log2(t+1))%2==0;(i=2*t+1)<r;){var a=i,o=1+i;if(o<r){lessThan(e,o,a)===n&&(a=o);for(var s=2*i+1,l=Math.max(Math.min(r-s,4),0),c=0;c<l;c++){var u=s+c;lessThan(e,u,a)===n&&(a=u)}}lessThan(e,a,t)===n&&(swap$3(e,a,t),a===i||a===o||greaterThan(e,a,o=Math.floor((a-1)/2))===n&&swap$3(e,a,o)),t=a}}function DoublyLinkedList(){this.head=void 0,this.tail=void 0,this._length=0}function DoublyLinkedListNode(e,t,i){this.item=e,this.previous=t,this.next=i}function remove$1(e,t){defined(t.previous)&&defined(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):defined(t.previous)?(t.previous.next=void 0,e.tail=t.previous):defined(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}oneTimeWarning.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.",oneTimeWarning.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",oneTimeWarning.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",oneTimeWarning.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",Object.defineProperties(DistanceDisplayCondition.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}}}),DistanceDisplayCondition.packedLength=2,DistanceDisplayCondition.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.near,t[i]=e.far,t},DistanceDisplayCondition.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new DistanceDisplayCondition:i).near=e[t++],i.far=e[t],i},DistanceDisplayCondition.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.near===t.near&&e.far===t.far},DistanceDisplayCondition.clone=function(e,t){if(defined(e))return(t=!defined(t)?new DistanceDisplayCondition:t).near=e.near,t.far=e.far,t},DistanceDisplayCondition.prototype.clone=function(e){return DistanceDisplayCondition.clone(this,e)},DistanceDisplayCondition.prototype.equals=function(e){return DistanceDisplayCondition.equals(this,e)},Object.defineProperties(DistanceDisplayConditionGeometryInstanceAttribute.prototype,{componentDatatype:{get:function(){return ComponentDatatype$1.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition=function(e){return new DistanceDisplayConditionGeometryInstanceAttribute(e.near,e.far)},DistanceDisplayConditionGeometryInstanceAttribute.toValue=function(e,t){return defined(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},Object.defineProperties(DoubleEndedPriorityQueue.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(defined(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}}}),DoubleEndedPriorityQueue.prototype.clone=function(){var e=this._maximumLength,t=this._comparator,i=this._array,r=this._length,n=new DoubleEndedPriorityQueue({comparator:t,maximumLength:e});n._length=r;for(var a=0;a<r;a++)n._array[a]=i[a];return n},DoubleEndedPriorityQueue.prototype.reset=function(){this._length=0;var e=this._maximumLength;if(defined(e))for(var t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0},DoubleEndedPriorityQueue.prototype.resort=function(){for(var e=this._length,t=0;t<e;t++)pushUp(this,t)},DoubleEndedPriorityQueue.prototype.insert=function(e){var t,i=this._maximumLength;if(defined(i)){if(0===i)return;if(this._length===i){var r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}r=this._length;return this._array[r]=e,this._length++,pushUp(this,r),t},DoubleEndedPriorityQueue.prototype.removeMinimum=function(){var e=this._length;if(0!==e){this._length--;var t=this._array[0];return 2<=e&&(this._array[0]=this._array[e-1],pushDown(this,0)),this._array[e-1]=void 0,t}},DoubleEndedPriorityQueue.prototype.removeMaximum=function(){var e,t,i=this._length;if(0!==i)return this._length--,i<=2?t=this._array[i-1]:(e=greaterThan(this,1,2)?1:2,t=this._array[e],this._array[e]=this._array[i-1],4<=i&&pushDown(this,e)),this._array[i-1]=void 0,t},DoubleEndedPriorityQueue.prototype.getMinimum=function(){if(0!==this._length)return this._array[0]},DoubleEndedPriorityQueue.prototype.getMaximum=function(){var e=this._length;if(0!==e)return e<=2?this._array[e-1]:this._array[greaterThan(this,1,2)?1:2]},Object.defineProperties(DoublyLinkedList.prototype,{length:{get:function(){return this._length}}}),DoublyLinkedList.prototype.add=function(e){e=new DoublyLinkedListNode(e,this.tail,void 0);return defined(this.tail)?this.tail.next=e:this.head=e,this.tail=e,++this._length,e},DoublyLinkedList.prototype.remove=function(e){defined(e)&&(remove$1(this,e),--this._length)},DoublyLinkedList.prototype.splice=function(e,t){var i;e!==t&&(remove$1(this,t),i=e.next,e.next=t,this.tail===e?this.tail=t:i.previous=t,t.next=i,t.previous=e)},void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var TWEEN=TWEEN||(HCb=[],{REVISION:"13",getAll:function(){return HCb},removeAll:function(){HCb=[]},add:function(e){HCb.push(e)},remove:function(e){e=HCb.indexOf(e);-1!==e&&HCb.splice(e,1)},update:function(e){if(0===HCb.length)return!1;var t=0;for(e=void 0!==e?e:("undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance:Date).now();t<HCb.length;)HCb[t].update(e)?t++:HCb.splice(t,1);return!0}}),HCb,REb;TWEEN.Tween=function(e){var t,c=e,u={},d={},h={},p=1e3,m=0,f=!1,i=!1,g=0,_=null,y=TWEEN.Easing.Linear.None,C=TWEEN.Interpolation.Linear,v=[],S=null,T=!1,x=null,b=null,r=null;for(t in e)u[t]=parseFloat(e[t],10);this.to=function(e,t){return void 0!==t&&(p=t),d=e,this},this.start=function(e){for(var t in TWEEN.add(this),T=!(i=!0),_=void 0!==e?e:("undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance:Date).now(),_+=g,d){if(d[t]instanceof Array){if(0===d[t].length)continue;d[t]=[c[t]].concat(d[t])}u[t]=c[t],u[t]instanceof Array==!1&&(u[t]*=1),h[t]=u[t]||0}return this},this.stop=function(){return i&&(TWEEN.remove(this),i=!1,null!==r&&r.call(c),this.stopChainedTweens()),this},this.stopChainedTweens=function(){for(var e=0,t=v.length;e<t;e++)v[e].stop()},this.delay=function(e){return g=e,this},this.repeat=function(e){return m=e,this},this.yoyo=function(e){return f=e,this},this.easing=function(e){return y=e,this},this.interpolation=function(e){return C=e,this},this.chain=function(){return v=arguments,this},this.onStart=function(e){return S=e,this},this.onUpdate=function(e){return x=e,this},this.onComplete=function(e){return b=e,this},this.onStop=function(e){return r=e,this},this.update=function(e){if(e<_)return!0;!1===T&&(null!==S&&S.call(c),T=!0);var t,i=(e-_)/p,r=y(i=1<i?1:i);for(var n in d){var a=u[n]||0,o=d[n];o instanceof Array?c[n]=C(o,r):"number"==typeof(o="string"==typeof o?a+parseFloat(o,10):o)&&(c[n]=a+(o-a)*r)}if(null!==x&&x.call(c,r),1!=i)return!0;if(0<m){for(n in isFinite(m)&&m--,h)"string"==typeof d[n]&&(h[n]=h[n]+parseFloat(d[n],10)),f&&(t=h[n],h[n]=d[n],d[n]=t),u[n]=h[n];return _=e+g,!0}null!==b&&b.call(c);for(var s=0,l=v.length;s<l;s++)v[s].start(e);return!1}},TWEEN.Easing={Linear:{None:function(e){return e}},Quadratic:{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:{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:{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:{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:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{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:{In:function(e){var t,i=.1;return 0===e?0:1===e?1:(t=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*--e)*Math.sin((e-t)*(2*Math.PI)/.4)))},Out:function(e){var t,i=.1;return 0===e?0:1===e?1:(t=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},InOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(t=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*--e)*Math.sin((e-t)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*--e)*Math.sin((e-t)*(2*Math.PI)/.4)*.5+1)}},Back:{In:function(e){return e*e*(2.70158*e-1.70158)},Out:function(e){return--e*e*(2.70158*e+1.70158)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((1+t)*e-t)*.5:.5*((e-=2)*e*((1+t)*e+t)+2)}},Bounce:{In:function(e){return 1-TWEEN.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*TWEEN.Easing.Bounce.In(2*e):.5*TWEEN.Easing.Bounce.Out(2*e-1)+.5}}},TWEEN.Interpolation={Linear:function(e,t){var i=e.length-1,r=i*t,n=Math.floor(r),a=TWEEN.Interpolation.Utils.Linear;return t<0?a(e[0],e[1],r):1<t?a(e[i],e[i-1],i-r):a(e[n],e[i<n+1?i:n+1],r-n)},Bezier:function(e,t){for(var i=0,r=e.length-1,n=Math.pow,a=TWEEN.Interpolation.Utils.Bernstein,o=0;o<=r;o++)i+=n(1-t,r-o)*n(t,o)*e[o]*a(r,o);return i},CatmullRom:function(e,t){var i=e.length-1,r=i*t,n=Math.floor(r),a=TWEEN.Interpolation.Utils.CatmullRom;return e[0]===e[i]?a(e[((n=t<0?Math.floor(r=i*(1+t)):n)-1+i)%i],e[n],e[(n+1)%i],e[(n+2)%i],r-n):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-r)-e[0]):1<t?e[i]-(a(e[i],e[i],e[i-1],e[i-1],r-i)-e[i]):a(e[n?n-1:0],e[n],e[i<n+1?i:n+1],e[i<n+2?i:n+2],r-n)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,t){var i=TWEEN.Interpolation.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:(REb=[1],function(e){var t,i=1;if(REb[e])return REb[e];for(t=e;1<t;t--)i*=t;return REb[e]=i}),CatmullRom:function(e,t,i,r,n){var a=.5*(i-e),e=.5*(r-t),r=n*n;return(2*t-2*i+a+e)*(n*r)+(-3*t+3*i-2*a-e)*r+a*n+t}}};var EasingFunction={LINEAR_NONE:TWEEN.Easing.Linear.None,QUADRATIC_IN:TWEEN.Easing.Quadratic.In,QUADRATIC_OUT:TWEEN.Easing.Quadratic.Out,QUADRATIC_IN_OUT:TWEEN.Easing.Quadratic.InOut,CUBIC_IN:TWEEN.Easing.Cubic.In,CUBIC_OUT:TWEEN.Easing.Cubic.Out,CUBIC_IN_OUT:TWEEN.Easing.Cubic.InOut,QUARTIC_IN:TWEEN.Easing.Quartic.In,QUARTIC_OUT:TWEEN.Easing.Quartic.Out,QUARTIC_IN_OUT:TWEEN.Easing.Quartic.InOut,QUINTIC_IN:TWEEN.Easing.Quintic.In,QUINTIC_OUT:TWEEN.Easing.Quintic.Out,QUINTIC_IN_OUT:TWEEN.Easing.Quintic.InOut,SINUSOIDAL_IN:TWEEN.Easing.Sinusoidal.In,SINUSOIDAL_OUT:TWEEN.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:TWEEN.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:TWEEN.Easing.Exponential.In,EXPONENTIAL_OUT:TWEEN.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:TWEEN.Easing.Exponential.InOut,CIRCULAR_IN:TWEEN.Easing.Circular.In,CIRCULAR_OUT:TWEEN.Easing.Circular.Out,CIRCULAR_IN_OUT:TWEEN.Easing.Circular.InOut,ELASTIC_IN:TWEEN.Easing.Elastic.In,ELASTIC_OUT:TWEEN.Easing.Elastic.Out,ELASTIC_IN_OUT:TWEEN.Easing.Elastic.InOut,BACK_IN:TWEEN.Easing.Back.In,BACK_OUT:TWEEN.Easing.Back.Out,BACK_IN_OUT:TWEEN.Easing.Back.InOut,BOUNCE_IN:TWEEN.Easing.Bounce.In,BOUNCE_OUT:TWEEN.Easing.Bounce.Out,BOUNCE_IN_OUT:TWEEN.Easing.Bounce.InOut},EasingFunction$1=Object.freeze(EasingFunction),scratchPosition$a=new Cartesian3,scratchNormal$3=new Cartesian3,scratchTangent$2=new Cartesian3,scratchBitangent$2=new Cartesian3,scratchNormalST=new Cartesian3,defaultRadii$1=new Cartesian3(1,1,1),cos$2=Math.cos,sin$2=Math.sin;function EllipsoidGeometry(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.radii,defaultRadii$1),i=defaultValue(e.innerRadii,t),r=defaultValue(e.minimumClock,0),n=defaultValue(e.maximumClock,CesiumMath.TWO_PI),a=defaultValue(e.minimumCone,0),o=defaultValue(e.maximumCone,CesiumMath.PI),s=Math.round(defaultValue(e.stackPartitions,64)),l=Math.round(defaultValue(e.slicePartitions,64)),c=defaultValue(e.vertexFormat,VertexFormat.DEFAULT);this._radii=Cartesian3.clone(t),this._innerRadii=Cartesian3.clone(i),this._minimumClock=r,this._maximumClock=n,this._minimumCone=a,this._maximumCone=o,this._stackPartitions=s,this._slicePartitions=l,this._vertexFormat=VertexFormat.clone(c),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}EllipsoidGeometry.packedLength=2*Cartesian3.packedLength+VertexFormat.packedLength+7,EllipsoidGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._radii,t,i),i+=Cartesian3.packedLength,Cartesian3.pack(e._innerRadii,t,i),i+=Cartesian3.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._minimumClock,t[i++]=e._maximumClock,t[i++]=e._minimumCone,t[i++]=e._maximumCone,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchRadii$2=new Cartesian3,scratchInnerRadii$1=new Cartesian3,scratchVertexFormat$7=new VertexFormat,scratchOptions$b={radii:scratchRadii$2,innerRadii:scratchInnerRadii$1,vertexFormat:scratchVertexFormat$7,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0},unitEllipsoidGeometry;EllipsoidGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchRadii$2);t+=Cartesian3.packedLength;var n=Cartesian3.unpack(e,t,scratchInnerRadii$1);t+=Cartesian3.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$7);t+=VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],d=e[t++],t=e[t];return defined(i)?(i._radii=Cartesian3.clone(r,i._radii),i._innerRadii=Cartesian3.clone(n,i._innerRadii),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._minimumClock=o,i._maximumClock=s,i._minimumCone=l,i._maximumCone=c,i._stackPartitions=u,i._slicePartitions=d,i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$b.minimumClock=o,scratchOptions$b.maximumClock=s,scratchOptions$b.minimumCone=l,scratchOptions$b.maximumCone=c,scratchOptions$b.stackPartitions=u,scratchOptions$b.slicePartitions=d,scratchOptions$b.offsetAttribute=-1===t?void 0:t,new EllipsoidGeometry(scratchOptions$b))},EllipsoidGeometry.createGeometry=function(e){var t=e._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var i=e._innerRadii;if(!(i.x<=0||i.y<=0||i.z<=0)){var r=e._minimumClock,n=e._maximumClock,a=e._minimumCone,o=e._maximumCone,s=e._vertexFormat,l=e._slicePartitions+1,c=e._stackPartitions+1;(l=Math.round(l*Math.abs(n-r)/CesiumMath.TWO_PI))<2&&(l=2),(c=Math.round(c*Math.abs(o-a)/CesiumMath.PI))<2&&(c=2);var u=0,d=[a],h=[r];for(U=0;U<c;U++)d.push(a+U*(o-a)/(c-1));for(d.push(o),F=0;F<l;F++)h.push(r+F*(n-r)/(l-1));h.push(n);var p=d.length,m=h.length,f=0,g=1,_=i.x!==t.x||i.y!==t.y||i.z!==t.z,y=!1,C=!1,v=!1;_&&(g=2,0<a&&(y=!0,f+=l-1),o<Math.PI&&(C=!0,f+=l-1),(n-r)%CesiumMath.TWO_PI?(v=!0,f+=2*(c-1)+1):f+=1);var S=m*p*g,T=new Float64Array(3*S),x=arrayFill(new Array(S),!1),b=arrayFill(new Array(S),!1),E=l*c*g,P=IndexDatatype$1.createTypedArray(E,6*(E+f+1-(l+c)*g)),A=s.normal?new Float32Array(3*S):void 0,w=s.tangent?new Float32Array(3*S):void 0,D=s.bitangent?new Float32Array(3*S):void 0,M=s.st?new Float32Array(2*S):void 0,I=new Array(p),R=new Array(p);for(U=0;U<p;U++)I[U]=sin$2(d[U]),R[U]=cos$2(d[U]);for(var O=new Array(m),L=new Array(m),F=0;F<m;F++)L[F]=cos$2(h[F]),O[F]=sin$2(h[F]);for(U=0;U<p;U++)for(F=0;F<m;F++)T[u++]=t.x*I[U]*L[F],T[u++]=t.y*I[U]*O[F],T[u++]=t.z*R[U];var N,B,V,k,z=S/2;if(_)for(U=0;U<p;U++)for(F=0;F<m;F++)T[u++]=i.x*I[U]*L[F],T[u++]=i.y*I[U]*O[F],T[u++]=i.z*R[U],x[z]=!0,0<U&&U!==p-1&&0!==F&&F!==m-1&&(b[z]=!0),z++;for(u=0,U=1;U<p-2;U++)for(N=U*m,B=(U+1)*m,F=1;F<m-2;F++)P[u++]=B+F,P[u++]=B+F+1,P[u++]=N+F+1,P[u++]=B+F,P[u++]=N+F+1,P[u++]=N+F;if(_)for(var $=p*m,U=1;U<p-2;U++)for(N=$+U*m,B=$+(U+1)*m,F=1;F<m-2;F++)P[u++]=B+F,P[u++]=N+F,P[u++]=N+F+1,P[u++]=B+F,P[u++]=N+F+1,P[u++]=B+F+1;if(_){if(y)for(k=p*m,U=1;U<m-2;U++)P[u++]=U,P[u++]=U+1,P[u++]=k+U+1,P[u++]=U,P[u++]=k+U+1,P[u++]=k+U;if(C)for(V=p*m-m,k=p*m*g-m,U=1;U<m-2;U++)P[u++]=V+U+1,P[u++]=V+U,P[u++]=k+U,P[u++]=V+U+1,P[u++]=k+U,P[u++]=k+U+1}if(v){for(U=1;U<p-2;U++)P[u++]=k=m*p+(V=m*U),P[u++]=V+m,P[u++]=V,P[u++]=k,P[u++]=k+m,P[u++]=V+m;for(U=1;U<p-2;U++)k=m*p+m*(U+1)-1,P[u++]=(V=m*(U+1)-1)+m,P[u++]=k,P[u++]=V,P[u++]=V+m,P[u++]=k+m,P[u++]=k}g=new GeometryAttributes;s.position&&(g.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:T}));var G=0,H=0,W=0,q=0,j=S/2,Y=Ellipsoid.fromCartesian3(t),X=Ellipsoid.fromCartesian3(i);if(s.st||s.normal||s.tangent||s.bitangent){for(U=0;U<S;U++){var Q,J=x[U]?X:Y,Z=Cartesian3.fromArray(T,3*U,scratchPosition$a),Z=J.geodeticSurfaceNormal(Z,scratchNormal$3);b[U]&&Cartesian3.negate(Z,Z),s.st&&(Q=Cartesian2.negate(Z,scratchNormalST),M[G++]=Math.atan2(Q.y,Q.x)/CesiumMath.TWO_PI+.5,M[G++]=Math.asin(Z.z)/Math.PI+.5),s.normal&&(A[H++]=Z.x,A[H++]=Z.y,A[H++]=Z.z),(s.tangent||s.bitangent)&&(Q=0,x[U]&&(Q=j),Q=!y&&Q<=U&&U<Q+2*m?Cartesian3.UNIT_X:Cartesian3.UNIT_Z,Cartesian3.cross(Q,Z,Q=scratchTangent$2),Cartesian3.normalize(Q,Q),s.tangent&&(w[W++]=Q.x,w[W++]=Q.y,w[W++]=Q.z),s.bitangent&&(Q=Cartesian3.cross(Z,Q,scratchBitangent$2),Cartesian3.normalize(Q,Q),D[q++]=Q.x,D[q++]=Q.y,D[q++]=Q.z))}s.st&&(g.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:M})),s.normal&&(g.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:A})),s.tangent&&(g.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:w})),s.bitangent&&(g.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:D}))}return defined(e._offsetAttribute)&&(v=T.length,arrayFill(v=new Uint8Array(v/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),g.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})),new Geometry({attributes:g,indices:P,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:BoundingSphere.fromEllipsoid(Y),offsetAttribute:e._offsetAttribute})}}},EllipsoidGeometry.getUnitEllipsoid=function(){return unitEllipsoidGeometry=!defined(unitEllipsoidGeometry)?EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(1,1,1),vertexFormat:VertexFormat.POSITION_ONLY})):unitEllipsoidGeometry};var defaultRadii=new Cartesian3(1,1,1),cos$1=Math.cos,sin$1=Math.sin;function EllipsoidOutlineGeometry(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.radii,defaultRadii),i=defaultValue(e.innerRadii,t),r=defaultValue(e.minimumClock,0),n=defaultValue(e.maximumClock,CesiumMath.TWO_PI),a=defaultValue(e.minimumCone,0),o=defaultValue(e.maximumCone,CesiumMath.PI),s=Math.round(defaultValue(e.stackPartitions,10)),l=Math.round(defaultValue(e.slicePartitions,8)),c=Math.round(defaultValue(e.subdivisions,128));this._radii=Cartesian3.clone(t),this._innerRadii=Cartesian3.clone(i),this._minimumClock=r,this._maximumClock=n,this._minimumCone=a,this._maximumCone=o,this._stackPartitions=s,this._slicePartitions=l,this._subdivisions=c,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}EllipsoidOutlineGeometry.packedLength=2*Cartesian3.packedLength+8,EllipsoidOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._radii,t,i),i+=Cartesian3.packedLength,Cartesian3.pack(e._innerRadii,t,i),i+=Cartesian3.packedLength,t[i++]=e._minimumClock,t[i++]=e._maximumClock,t[i++]=e._minimumCone,t[i++]=e._maximumCone,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i++]=e._subdivisions,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchRadii$1=new Cartesian3,scratchInnerRadii=new Cartesian3,scratchOptions$a={radii:scratchRadii$1,innerRadii:scratchInnerRadii,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};function EllipsoidTerrainProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,defined(this._tilingScheme)||(this._tilingScheme=new GeographicTilingScheme({ellipsoid:defaultValue(e.ellipsoid,Ellipsoid.WGS84)})),this._levelZeroMaximumGeometricError=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Event,this._readyPromise=when.resolve(!0)}function EventHelper(){this._removalFunctions=[]}EllipsoidOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchRadii$1);t+=Cartesian3.packedLength;var n=Cartesian3.unpack(e,t,scratchInnerRadii);t+=Cartesian3.packedLength;var a=e[t++],o=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],d=e[t++],t=e[t];return defined(i)?(i._radii=Cartesian3.clone(r,i._radii),i._innerRadii=Cartesian3.clone(n,i._innerRadii),i._minimumClock=a,i._maximumClock=o,i._minimumCone=s,i._maximumCone=l,i._stackPartitions=c,i._slicePartitions=u,i._subdivisions=d,i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$a.minimumClock=a,scratchOptions$a.maximumClock=o,scratchOptions$a.minimumCone=s,scratchOptions$a.maximumCone=l,scratchOptions$a.stackPartitions=c,scratchOptions$a.slicePartitions=u,scratchOptions$a.subdivisions=d,scratchOptions$a.offsetAttribute=-1===t?void 0:t,new EllipsoidOutlineGeometry(scratchOptions$a))},EllipsoidOutlineGeometry.createGeometry=function(e){var t=e._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var i=e._innerRadii;if(!(i.x<=0||i.y<=0||i.z<=0)){var r=e._minimumClock,n=e._maximumClock,a=e._minimumCone,o=e._maximumCone,s=e._subdivisions,l=Ellipsoid.fromCartesian3(t),c=e._slicePartitions+1,u=e._stackPartitions+1;(c=Math.round(c*Math.abs(n-r)/CesiumMath.TWO_PI))<2&&(c=2),(u=Math.round(u*Math.abs(o-a)/CesiumMath.PI))<2&&(u=2);var d=0,h=1,p=i.x!==t.x||i.y!==t.y||i.z!==t.z,m=!1,f=!1;p&&(h=2,0<a&&(m=!0,d+=c),o<Math.PI&&(f=!0,d+=c));for(var g,_,y=s*h*(u+c),C=new Float64Array(3*y),v=IndexDatatype$1.createTypedArray(y,2*(y+d-(c+u)*h)),S=0,T=new Array(u),x=new Array(u),b=0;b<u;b++)T[b]=sin$1(_=a+b*(o-a)/(u-1)),x[b]=cos$1(_);var E=new Array(s),P=new Array(s);for(b=0;b<s;b++)E[b]=sin$1(g=r+b*(n-r)/(s-1)),P[b]=cos$1(g);for(b=0;b<u;b++)for(w=0;w<s;w++)C[S++]=t.x*T[b]*P[w],C[S++]=t.y*T[b]*E[w],C[S++]=t.z*x[b];if(p)for(b=0;b<u;b++)for(w=0;w<s;w++)C[S++]=i.x*T[b]*P[w],C[S++]=i.y*T[b]*E[w],C[S++]=i.z*x[b];for(T.length=s,x.length=s,b=0;b<s;b++)T[b]=sin$1(_=a+b*(o-a)/(s-1)),x[b]=cos$1(_);for(E.length=c,P.length=c,b=0;b<c;b++)E[b]=sin$1(g=r+b*(n-r)/(c-1)),P[b]=cos$1(g);for(b=0;b<s;b++)for(w=0;w<c;w++)C[S++]=t.x*T[b]*P[w],C[S++]=t.y*T[b]*E[w],C[S++]=t.z*x[b];if(p)for(b=0;b<s;b++)for(w=0;w<c;w++)C[S++]=i.x*T[b]*P[w],C[S++]=i.y*T[b]*E[w],C[S++]=i.z*x[b];for(b=S=0;b<u*h;b++)for(var A=b*s,w=0;w<s-1;w++)v[S++]=A+w,v[S++]=A+w+1;var D=u*s*h;for(b=0;b<c;b++)for(w=0;w<s-1;w++)v[S++]=D+b+w*c,v[S++]=D+b+(w+1)*c;if(p)for(D=u*s*h+c*s,b=0;b<c;b++)for(w=0;w<s-1;w++)v[S++]=D+b+w*c,v[S++]=D+b+(w+1)*c;if(p){var M=u*s*h,I=M+s*c;if(m)for(b=0;b<c;b++)v[S++]=M+b,v[S++]=I+b;if(f)for(M+=s*c-c,I+=s*c-c,b=0;b<c;b++)v[S++]=M+b,v[S++]=I+b}m=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:C})});return defined(e._offsetAttribute)&&(f=C.length,arrayFill(f=new Uint8Array(f/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),m.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})),new Geometry({attributes:m,indices:v,primitiveType:PrimitiveType$1.LINES,boundingSphere:BoundingSphere.fromEllipsoid(l),offsetAttribute:e._offsetAttribute})}}},Object.defineProperties(EllipsoidTerrainProvider.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}}),EllipsoidTerrainProvider.prototype.requestTileGeometry=function(e,t,i,r){return when.resolve(new HeightmapTerrainData({buffer:new Uint8Array(256),width:16,height:16}))},EllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},EllipsoidTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){},EllipsoidTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){},EventHelper.prototype.add=function(e,t,i){var r=e.addEventListener(t,i);this._removalFunctions.push(r);var n=this;return function(){r();var e=n._removalFunctions;e.splice(e.indexOf(r),1)}},EventHelper.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,i=e.length;t<i;++t)e[t]();e.length=0};var ExtrapolationType={NONE:0,HOLD:1,EXTRAPOLATE:2},ExtrapolationType$1=Object.freeze(ExtrapolationType);function OrthographicOffCenterFrustum(e){e=defaultValue(e,defaultValue.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=defaultValue(e.near,1),this._near=this.near,this.far=defaultValue(e.far,5e8),this._far=this.far,this._cullingVolume=new CullingVolume,this._orthographicMatrix=new Matrix4}function update$5(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=Matrix4.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(OrthographicOffCenterFrustum.prototype,{projectionMatrix:{get:function(){return update$5(this),this._orthographicMatrix}}});var getPlanesRight$1=new Cartesian3,getPlanesNearCenter$1=new Cartesian3,getPlanesPoint=new Cartesian3,negateScratch=new Cartesian3;function OrthographicFrustum(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new OrthographicOffCenterFrustum,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=defaultValue(e.near,1),this._near=this.near,this.far=defaultValue(e.far,5e8),this._far=this.far}function update$4(e){var t,i=e._offCenterFrustum;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,t=1/e.aspectRatio,i.right=.5*e.width,i.left=-i.right,i.top=t*i.right,i.bottom=-i.top,i.near=e.near,i.far=e.far)}function PerspectiveOffCenterFrustum(e){e=defaultValue(e,defaultValue.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=defaultValue(e.near,1),this._near=this.near,this.far=defaultValue(e.far,5e8),this._far=this.far,this._cullingVolume=new CullingVolume,this._perspectiveMatrix=new Matrix4,this._infinitePerspective=new Matrix4}function update$3(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,a=e.near,o=e.far;t===e._top&&i===e._bottom&&n===e._left&&r===e._right&&a===e._near&&o===e._far||(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=a,e._far=o,e._perspectiveMatrix=Matrix4.computePerspectiveOffCenter(n,r,i,t,a,o,e._perspectiveMatrix),e._infinitePerspective=Matrix4.computeInfinitePerspectiveOffCenter(n,r,i,t,a,e._infinitePerspective))}OrthographicOffCenterFrustum.prototype.computeCullingVolume=function(e,t,i){var r=this._cullingVolume.planes,n=this.top,a=this.bottom,o=this.right,s=this.left,l=this.near,c=this.far,u=Cartesian3.cross(t,i,getPlanesRight$1);Cartesian3.normalize(u,u);var d=getPlanesNearCenter$1;Cartesian3.multiplyByScalar(t,l,d),Cartesian3.add(e,d,d);l=getPlanesPoint;Cartesian3.multiplyByScalar(u,s,l),Cartesian3.add(d,l,l);s=r[0];return(s=!defined(s)?r[0]=new Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-Cartesian3.dot(u,l),Cartesian3.multiplyByScalar(u,o,l),Cartesian3.add(d,l,l),(s=!defined(s=r[1])?r[1]=new Cartesian4:s).x=-u.x,s.y=-u.y,s.z=-u.z,s.w=-Cartesian3.dot(Cartesian3.negate(u,negateScratch),l),Cartesian3.multiplyByScalar(i,a,l),Cartesian3.add(d,l,l),(s=!defined(s=r[2])?r[2]=new Cartesian4:s).x=i.x,s.y=i.y,s.z=i.z,s.w=-Cartesian3.dot(i,l),Cartesian3.multiplyByScalar(i,n,l),Cartesian3.add(d,l,l),(s=!defined(s=r[3])?r[3]=new Cartesian4:s).x=-i.x,s.y=-i.y,s.z=-i.z,s.w=-Cartesian3.dot(Cartesian3.negate(i,negateScratch),l),(s=!defined(s=r[4])?r[4]=new Cartesian4:s).x=t.x,s.y=t.y,s.z=t.z,s.w=-Cartesian3.dot(t,d),Cartesian3.multiplyByScalar(t,c,l),Cartesian3.add(e,l,l),(s=!defined(s=r[5])?r[5]=new Cartesian4:s).x=-t.x,s.y=-t.y,s.z=-t.z,s.w=-Cartesian3.dot(Cartesian3.negate(t,negateScratch),l),this._cullingVolume},OrthographicOffCenterFrustum.prototype.getPixelDimensions=function(e,t,i,r,n){update$5(this);var a=this.right-this.left,t=r*(this.top-this.bottom)/t;return n.x=r*a/e,n.y=t,n},OrthographicOffCenterFrustum.prototype.clone=function(e){return(e=!defined(e)?new OrthographicOffCenterFrustum: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},OrthographicOffCenterFrustum.prototype.equals=function(e){return defined(e)&&e instanceof OrthographicOffCenterFrustum&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},OrthographicOffCenterFrustum.prototype.equalsEpsilon=function(e,t,i){return e===this||defined(e)&&e instanceof OrthographicOffCenterFrustum&&CesiumMath.equalsEpsilon(this.right,e.right,t,i)&&CesiumMath.equalsEpsilon(this.left,e.left,t,i)&&CesiumMath.equalsEpsilon(this.top,e.top,t,i)&&CesiumMath.equalsEpsilon(this.bottom,e.bottom,t,i)&&CesiumMath.equalsEpsilon(this.near,e.near,t,i)&&CesiumMath.equalsEpsilon(this.far,e.far,t,i)},OrthographicFrustum.packedLength=4,OrthographicFrustum.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.width,t[i++]=e.aspectRatio,t[i++]=e.near,t[i]=e.far,t},OrthographicFrustum.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new OrthographicFrustum:i).width=e[t++],i.aspectRatio=e[t++],i.near=e[t++],i.far=e[t],i},Object.defineProperties(OrthographicFrustum.prototype,{projectionMatrix:{get:function(){return update$4(this),this._offCenterFrustum.projectionMatrix}}}),OrthographicFrustum.prototype.computeCullingVolume=function(e,t,i){return update$4(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},OrthographicFrustum.prototype.getPixelDimensions=function(e,t,i,r,n){return update$4(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r,n)},OrthographicFrustum.prototype.clone=function(e){return(e=!defined(e)?new OrthographicFrustum: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},OrthographicFrustum.prototype.equals=function(e){return!!(defined(e)&&e instanceof OrthographicFrustum)&&(update$4(this),update$4(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},OrthographicFrustum.prototype.equalsEpsilon=function(e,t,i){return!!(defined(e)&&e instanceof OrthographicFrustum)&&(update$4(this),update$4(e),CesiumMath.equalsEpsilon(this.width,e.width,t,i)&&CesiumMath.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,i))},Object.defineProperties(PerspectiveOffCenterFrustum.prototype,{projectionMatrix:{get:function(){return update$3(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return update$3(this),this._infinitePerspective}}});var getPlanesRight=new Cartesian3,getPlanesNearCenter=new Cartesian3,getPlanesFarCenter=new Cartesian3,getPlanesNormal=new Cartesian3;function PerspectiveFrustum(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new PerspectiveOffCenterFrustum,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=defaultValue(e.near,1),this._near=this.near,this.far=defaultValue(e.far,5e8),this._far=this.far,this.xOffset=defaultValue(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=defaultValue(e.yOffset,0),this._yOffset=this.yOffset}function update$2(e){var t=e._offCenterFrustum;e.fov===e._fov&&e.aspectRatio===e._aspectRatio&&e.near===e._near&&e.far===e._far&&e.xOffset===e._xOffset&&e.yOffset===e._yOffset||(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}PerspectiveOffCenterFrustum.prototype.computeCullingVolume=function(e,t,i){var r=this._cullingVolume.planes,n=this.top,a=this.bottom,o=this.right,s=this.left,l=this.near,c=this.far,u=Cartesian3.cross(t,i,getPlanesRight),d=getPlanesNearCenter;Cartesian3.multiplyByScalar(t,l,d),Cartesian3.add(e,d,d);l=getPlanesFarCenter;Cartesian3.multiplyByScalar(t,c,l),Cartesian3.add(e,l,l);c=getPlanesNormal;Cartesian3.multiplyByScalar(u,s,c),Cartesian3.add(d,c,c),Cartesian3.subtract(c,e,c),Cartesian3.normalize(c,c),Cartesian3.cross(c,i,c),Cartesian3.normalize(c,c);s=r[0];return(s=!defined(s)?r[0]=new Cartesian4:s).x=c.x,s.y=c.y,s.z=c.z,s.w=-Cartesian3.dot(c,e),Cartesian3.multiplyByScalar(u,o,c),Cartesian3.add(d,c,c),Cartesian3.subtract(c,e,c),Cartesian3.cross(i,c,c),Cartesian3.normalize(c,c),(s=!defined(s=r[1])?r[1]=new Cartesian4:s).x=c.x,s.y=c.y,s.z=c.z,s.w=-Cartesian3.dot(c,e),Cartesian3.multiplyByScalar(i,a,c),Cartesian3.add(d,c,c),Cartesian3.subtract(c,e,c),Cartesian3.cross(u,c,c),Cartesian3.normalize(c,c),(s=!defined(s=r[2])?r[2]=new Cartesian4:s).x=c.x,s.y=c.y,s.z=c.z,s.w=-Cartesian3.dot(c,e),Cartesian3.multiplyByScalar(i,n,c),Cartesian3.add(d,c,c),Cartesian3.subtract(c,e,c),Cartesian3.cross(c,u,c),Cartesian3.normalize(c,c),(s=!defined(s=r[3])?r[3]=new Cartesian4:s).x=c.x,s.y=c.y,s.z=c.z,s.w=-Cartesian3.dot(c,e),(s=!defined(s=r[4])?r[4]=new Cartesian4:s).x=t.x,s.y=t.y,s.z=t.z,s.w=-Cartesian3.dot(t,d),Cartesian3.negate(t,c),(s=!defined(s=r[5])?r[5]=new Cartesian4:s).x=c.x,s.y=c.y,s.z=c.z,s.w=-Cartesian3.dot(c,l),this._cullingVolume},PerspectiveOffCenterFrustum.prototype.getPixelDimensions=function(e,t,i,r,n){update$3(this);var a=1/this.near,t=2*r*i*(o=this.top*a)/t,o=this.right*a;return n.x=2*r*i*o/e,n.y=t,n},PerspectiveOffCenterFrustum.prototype.clone=function(e){return(e=!defined(e)?new PerspectiveOffCenterFrustum: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},PerspectiveOffCenterFrustum.prototype.equals=function(e){return defined(e)&&e instanceof PerspectiveOffCenterFrustum&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},PerspectiveOffCenterFrustum.prototype.equalsEpsilon=function(e,t,i){return e===this||defined(e)&&e instanceof PerspectiveOffCenterFrustum&&CesiumMath.equalsEpsilon(this.right,e.right,t,i)&&CesiumMath.equalsEpsilon(this.left,e.left,t,i)&&CesiumMath.equalsEpsilon(this.top,e.top,t,i)&&CesiumMath.equalsEpsilon(this.bottom,e.bottom,t,i)&&CesiumMath.equalsEpsilon(this.near,e.near,t,i)&&CesiumMath.equalsEpsilon(this.far,e.far,t,i)},PerspectiveFrustum.packedLength=6,PerspectiveFrustum.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.fov,t[i++]=e.aspectRatio,t[i++]=e.near,t[i++]=e.far,t[i++]=e.xOffset,t[i]=e.yOffset,t},PerspectiveFrustum.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new PerspectiveFrustum:i).fov=e[t++],i.aspectRatio=e[t++],i.near=e[t++],i.far=e[t++],i.xOffset=e[t++],i.yOffset=e[t],i},Object.defineProperties(PerspectiveFrustum.prototype,{projectionMatrix:{get:function(){return update$2(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return update$2(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return update$2(this),this._fovy}},sseDenominator:{get:function(){return update$2(this),this._sseDenominator}}}),PerspectiveFrustum.prototype.computeCullingVolume=function(e,t,i){return update$2(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},PerspectiveFrustum.prototype.getPixelDimensions=function(e,t,i,r,n){return update$2(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r,n)},PerspectiveFrustum.prototype.clone=function(e){return(e=!defined(e)?new PerspectiveFrustum: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},PerspectiveFrustum.prototype.equals=function(e){return!!(defined(e)&&e instanceof PerspectiveFrustum)&&(update$2(this),update$2(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},PerspectiveFrustum.prototype.equalsEpsilon=function(e,t,i){return!!(defined(e)&&e instanceof PerspectiveFrustum)&&(update$2(this),update$2(e),CesiumMath.equalsEpsilon(this.fov,e.fov,t,i)&&CesiumMath.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,i))};var PERSPECTIVE$1=0,ORTHOGRAPHIC$1=1;function FrustumGeometry(e){var t,i,r=e.frustum,n=e.orientation,a=e.origin,o=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),e=defaultValue(e._drawNearPlane,!0);r instanceof PerspectiveFrustum?(t=PERSPECTIVE$1,i=PerspectiveFrustum.packedLength):r instanceof OrthographicFrustum&&(t=ORTHOGRAPHIC$1,i=OrthographicFrustum.packedLength),this._frustumType=t,this._frustum=r.clone(),this._origin=Cartesian3.clone(a),this._orientation=Quaternion.clone(n),this._drawNearPlane=e,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+i+Cartesian3.packedLength+Quaternion.packedLength+VertexFormat.packedLength}FrustumGeometry.pack=function(e,t,i){i=defaultValue(i,0);var r=e._frustumType,n=e._frustum;return(t[i++]=r)===PERSPECTIVE$1?(PerspectiveFrustum.pack(n,t,i),i+=PerspectiveFrustum.packedLength):(OrthographicFrustum.pack(n,t,i),i+=OrthographicFrustum.packedLength),Cartesian3.pack(e._origin,t,i),i+=Cartesian3.packedLength,Quaternion.pack(e._orientation,t,i),i+=Quaternion.packedLength,VertexFormat.pack(e._vertexFormat,t,i),t[i+=VertexFormat.packedLength]=e._drawNearPlane?1:0,t};var scratchPackPerspective$1=new PerspectiveFrustum,scratchPackOrthographic$1=new OrthographicFrustum,scratchPackQuaternion$1=new Quaternion,scratchPackorigin$1=new Cartesian3,scratchVertexFormat$6=new VertexFormat;function getAttributes(e,t,i,r,n,a,o,s){for(var l=e/3*2,c=0;c<4;++c)defined(t)&&(t[e]=a.x,t[e+1]=a.y,t[e+2]=a.z),defined(i)&&(i[e]=o.x,i[e+1]=o.y,i[e+2]=o.z),defined(r)&&(r[e]=s.x,r[e+1]=s.y,r[e+2]=s.z),e+=3;n[l]=0,n[1+l]=0,n[2+l]=1,n[3+l]=0,n[4+l]=1,n[5+l]=1,n[6+l]=0,n[7+l]=1}FrustumGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r,n=e[t++];n===PERSPECTIVE$1?(r=PerspectiveFrustum.unpack(e,t,scratchPackPerspective$1),t+=PerspectiveFrustum.packedLength):(r=OrthographicFrustum.unpack(e,t,scratchPackOrthographic$1),t+=OrthographicFrustum.packedLength);var a=Cartesian3.unpack(e,t,scratchPackorigin$1);t+=Cartesian3.packedLength;var o=Quaternion.unpack(e,t,scratchPackQuaternion$1);t+=Quaternion.packedLength;var s=VertexFormat.unpack(e,t,scratchVertexFormat$6),e=1===e[t+=VertexFormat.packedLength];if(!defined(i))return new FrustumGeometry({frustum:r,origin:a,orientation:o,vertexFormat:s,_drawNearPlane:e});t=n===i._frustumType?i._frustum:void 0;return i._frustum=r.clone(t),i._frustumType=n,i._origin=Cartesian3.clone(a,i._origin),i._orientation=Quaternion.clone(o,i._orientation),i._vertexFormat=VertexFormat.clone(s,i._vertexFormat),i._drawNearPlane=e,i};var scratchRotationMatrix=new Matrix3,scratchViewMatrix=new Matrix4,scratchInverseMatrix=new Matrix4,scratchXDirection=new Cartesian3,scratchYDirection=new Cartesian3,scratchZDirection=new Cartesian3,scratchNegativeX=new Cartesian3,scratchNegativeY=new Cartesian3,scratchNegativeZ=new Cartesian3,frustumSplits=new Array(3),frustumCornersNDC$1=new Array(4);frustumCornersNDC$1[0]=new Cartesian4(-1,-1,1,1),frustumCornersNDC$1[1]=new Cartesian4(1,-1,1,1),frustumCornersNDC$1[2]=new Cartesian4(1,1,1,1),frustumCornersNDC$1[3]=new Cartesian4(-1,1,1,1);for(var scratchFrustumCorners$1=new Array(4),i$4=0;i$4<4;++i$4)scratchFrustumCorners$1[i$4]=new Cartesian4;FrustumGeometry._computeNearFarPlanes=function(e,t,i,r,n,a,o,s){var t=Matrix3.fromQuaternion(t,scratchRotationMatrix),a=defaultValue(a,scratchXDirection),o=defaultValue(o,scratchYDirection),l=defaultValue(s,scratchZDirection),a=Matrix3.getColumn(t,0,a),o=Matrix3.getColumn(t,1,o),l=Matrix3.getColumn(t,2,l);Cartesian3.normalize(a,a),Cartesian3.normalize(o,o),Cartesian3.normalize(l,l),Cartesian3.negate(a,a);var c,u,a=Matrix4.computeView(e,l,o,a,scratchViewMatrix);i===PERSPECTIVE$1?(i=r.projectionMatrix,i=Matrix4.multiply(i,a,scratchInverseMatrix),u=Matrix4.inverse(i,scratchInverseMatrix)):c=Matrix4.inverseTransformation(a,scratchInverseMatrix),defined(u)?(frustumSplits[0]=r.near,frustumSplits[1]=r.far):(frustumSplits[0]=0,frustumSplits[1]=r.near,frustumSplits[2]=r.far);for(var d=0;d<2;++d)for(var h=0;h<4;++h){var p,m,f=Cartesian4.clone(frustumCornersNDC$1[h],scratchFrustumCorners$1[h]);defined(u)?(p=1/(f=Matrix4.multiplyByVector(u,f,f)).w,Cartesian3.multiplyByScalar(f,p,f),Cartesian3.subtract(f,e,f),Cartesian3.normalize(f,f),m=Cartesian3.dot(l,f),Cartesian3.multiplyByScalar(f,frustumSplits[d]/m,f),Cartesian3.add(f,e,f)):(defined(r._offCenterFrustum)&&(r=r._offCenterFrustum),p=frustumSplits[d],m=frustumSplits[d+1],f.x=.5*(f.x*(r.right-r.left)+r.left+r.right),f.y=.5*(f.y*(r.top-r.bottom)+r.bottom+r.top),f.z=.5*(f.z*(p-m)-p-m),f.w=1,Matrix4.multiplyByVector(c,f,f)),n[12*d+3*h]=f.x,n[12*d+3*h+1]=f.y,n[12*d+3*h+2]=f.z}},FrustumGeometry.createGeometry=function(e){var t=e._frustumType,i=e._frustum,r=e._origin,n=e._orientation,a=e._drawNearPlane,o=e._vertexFormat,s=a?6:5,l=new Float64Array(72);FrustumGeometry._computeNearFarPlanes(r,n,t,i,l);var c=24;l[c]=l[12],l[c+1]=l[13],l[c+2]=l[14],l[c+3]=l[0],l[c+4]=l[1],l[c+5]=l[2],l[c+6]=l[9],l[c+7]=l[10],l[c+8]=l[11],l[c+9]=l[21],l[c+10]=l[22],l[c+11]=l[23],l[c+=12]=l[15],l[c+1]=l[16],l[c+2]=l[17],l[c+3]=l[3],l[c+4]=l[4],l[c+5]=l[5],l[c+6]=l[0],l[c+7]=l[1],l[c+8]=l[2],l[c+9]=l[12],l[c+10]=l[13],l[c+11]=l[14],l[c+=12]=l[3],l[c+1]=l[4],l[c+2]=l[5],l[c+3]=l[15],l[c+4]=l[16],l[c+5]=l[17],l[c+6]=l[18],l[c+7]=l[19],l[c+8]=l[20],l[c+9]=l[6],l[c+10]=l[7],l[c+11]=l[8],l[c+=12]=l[6],l[c+1]=l[7],l[c+2]=l[8],l[c+3]=l[18],l[c+4]=l[19],l[c+5]=l[20],l[c+6]=l[21],l[c+7]=l[22],l[c+8]=l[23],l[c+9]=l[9],l[c+10]=l[10],l[c+11]=l[11],a||(l=l.subarray(12));var u,d,h,p,m=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:l})});(defined(o.normal)||defined(o.tangent)||defined(o.bitangent)||defined(o.st))&&(u=defined(o.normal)?new Float32Array(12*s):void 0,d=defined(o.tangent)?new Float32Array(12*s):void 0,h=defined(o.bitangent)?new Float32Array(12*s):void 0,p=defined(o.st)?new Float32Array(8*s):void 0,e=scratchYDirection,r=scratchZDirection,t=Cartesian3.negate(n=scratchXDirection,scratchNegativeX),i=Cartesian3.negate(e,scratchNegativeY),o=Cartesian3.negate(r,scratchNegativeZ),c=0,a&&(getAttributes(c,u,d,h,p,o,n,e),c+=12),getAttributes(c,u,d,h,p,r,t,e),getAttributes(c+=12,u,d,h,p,t,o,e),getAttributes(c+=12,u,d,h,p,i,o,t),getAttributes(c+=12,u,d,h,p,n,r,e),getAttributes(c+=12,u,d,h,p,e,r,t),defined(u)&&(m.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:u})),defined(d)&&(m.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:d})),defined(h)&&(m.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:h})),defined(p)&&(m.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:p})));for(var f=new Uint16Array(6*s),g=0;g<s;++g){var _=6*g,y=4*g;f[_]=y,f[1+_]=1+y,f[2+_]=2+y,f[3+_]=y,f[4+_]=2+y,f[5+_]=3+y}return new Geometry({attributes:m,indices:f,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:BoundingSphere.fromVertices(l)})};var PERSPECTIVE=0,ORTHOGRAPHIC=1;function FrustumOutlineGeometry(e){var t,i,r=e.frustum,n=e.orientation,a=e.origin,e=defaultValue(e._drawNearPlane,!0);r instanceof PerspectiveFrustum?(t=PERSPECTIVE,i=PerspectiveFrustum.packedLength):r instanceof OrthographicFrustum&&(t=ORTHOGRAPHIC,i=OrthographicFrustum.packedLength),this._frustumType=t,this._frustum=r.clone(),this._origin=Cartesian3.clone(a),this._orientation=Quaternion.clone(n),this._drawNearPlane=e,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+i+Cartesian3.packedLength+Quaternion.packedLength}FrustumOutlineGeometry.pack=function(e,t,i){i=defaultValue(i,0);var r=e._frustumType,n=e._frustum;return(t[i++]=r)===PERSPECTIVE?(PerspectiveFrustum.pack(n,t,i),i+=PerspectiveFrustum.packedLength):(OrthographicFrustum.pack(n,t,i),i+=OrthographicFrustum.packedLength),Cartesian3.pack(e._origin,t,i),i+=Cartesian3.packedLength,Quaternion.pack(e._orientation,t,i),t[i+=Quaternion.packedLength]=e._drawNearPlane?1:0,t};var scratchPackPerspective=new PerspectiveFrustum,scratchPackOrthographic=new OrthographicFrustum,scratchPackQuaternion=new Quaternion,scratchPackorigin=new Cartesian3;function GeocoderService(){}FrustumOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r,n=e[t++];n===PERSPECTIVE?(r=PerspectiveFrustum.unpack(e,t,scratchPackPerspective),t+=PerspectiveFrustum.packedLength):(r=OrthographicFrustum.unpack(e,t,scratchPackOrthographic),t+=OrthographicFrustum.packedLength);var a=Cartesian3.unpack(e,t,scratchPackorigin);t+=Cartesian3.packedLength;var o=Quaternion.unpack(e,t,scratchPackQuaternion),e=1===e[t+=Quaternion.packedLength];if(!defined(i))return new FrustumOutlineGeometry({frustum:r,origin:a,orientation:o,_drawNearPlane:e});t=n===i._frustumType?i._frustum:void 0;return i._frustum=r.clone(t),i._frustumType=n,i._origin=Cartesian3.clone(a,i._origin),i._orientation=Quaternion.clone(o,i._orientation),i._drawNearPlane=e,i},FrustumOutlineGeometry.createGeometry=function(e){var t=e._frustumType,i=e._frustum,r=e._origin,n=e._orientation,a=e._drawNearPlane,e=new Float64Array(24);FrustumGeometry._computeNearFarPlanes(r,n,t,i,e);for(var o,s,i=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:e})}),l=a?2:1,c=new Uint16Array(8*(1+l)),u=a?0:1;u<2;++u)c[o=a?8*u:0]=s=4*u,c[o+1]=s+1,c[o+2]=s+1,c[o+3]=s+2,c[o+4]=s+2,c[o+5]=s+3,c[o+6]=s+3,c[o+7]=s;for(u=0;u<2;++u)c[o=8*(l+u)]=s=4*u,c[o+1]=s+4,c[o+2]=s+1,c[o+3]=s+5,c[o+4]=s+2,c[o+5]=s+6,c[o+6]=s+3,c[o+7]=s+7;return new Geometry({attributes:i,indices:c,primitiveType:PrimitiveType$1.LINES,boundingSphere:BoundingSphere.fromVertices(e)})},GeocoderService.prototype.geocode=DeveloperError.throwInstantiationError;var GeocodeType={SEARCH:0,AUTOCOMPLETE:1},GeocodeType$1=Object.freeze(GeocodeType);function GeometryFactory(){DeveloperError.throwInstantiationError()}function GeometryInstanceAttribute(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=defaultValue(e.normalize,!1),this.value=e.value}function getFilenameFromUri(e){var t=new URI(e);t.normalize();e=t.path,t=e.lastIndexOf("/");return e=-1!==t?e.substr(t+1):e}GeometryFactory.createGeometry=function(e){DeveloperError.throwInstantiationError()};var context2DsByWidthAndHeight={};function getImagePixels(e,t,i){defined(t)||(t=e.width),defined(i)||(i=e.height);var r=context2DsByWidthAndHeight[t];defined(r)||(context2DsByWidthAndHeight[t]=r={});var n,a=r[i];return defined(a)||((n=document.createElement("canvas")).width=t,n.height=i,(a=n.getContext("2d")).globalCompositeOperation="copy",r[i]=a),a.drawImage(e,0,0,t,i),a.getImageData(0,0,t,i).data}function getMagic(e,t){return getStringFromTypedArray(e,t=defaultValue(t,0),Math.min(4,e.length))}var tmp$6={};!function(global,undefined$1){var QMb,RMb,SMb;QMb={1:[function(e,t,i){t.exports=function(e,t){for(var i=[],r=2;r<arguments.length;)i.push(arguments[r++]);var a=!0;return new Promise(function(r,n){i.push(function(e){if(a)if(a=!1,e)n(e);else{for(var t=[],i=1;i<arguments.length;)t.push(arguments[i++]);r.apply(null,t)}});try{e.apply(t||this,i)}catch(e){a&&(a=!1,n(e))}})}},{}],2:[function(e,t,i){i.length=function(e){var t=e.length;if(!t)return 0;for(var i=0;1<--t%4&&"="===e.charAt(t);)++i;return Math.ceil(3*e.length)/4-i};for(var l=new Array(64),c=new Array(123),r=0;r<64;)c[l[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;i.encode=function(e,t,i){for(var r,n=[],a=0,o=0;t<i;){var s=e[t++];switch(o){case 0:n[a++]=l[s>>2],r=(3&s)<<4,o=1;break;case 1:n[a++]=l[r|s>>4],r=(15&s)<<2,o=2;break;case 2:n[a++]=l[r|s>>6],n[a++]=l[63&s],o=0}}return o&&(n[a++]=l[r],n[a]=61,1===o&&(n[a+1]=61)),String.fromCharCode.apply(String,n)};var u="invalid encoding";i.decode=function(e,t,i){for(var r,n=i,a=0,o=0;o<e.length;){var s=e.charCodeAt(o++);if(61===s&&1<a)break;if((s=c[s])===undefined$1)throw Error(u);switch(a){case 0:r=s,a=1;break;case 1:t[i++]=r<<2|(48&s)>>4,r=s,a=2;break;case 2:t[i++]=(15&r)<<4|(60&s)>>2,r=s,a=3;break;case 3:t[i++]=(3&r)<<6|s,a=0}}if(1===a)throw Error(u);return i-n},i.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},{}],3:[function(e,t,i){function r(){this._listeners={}}(t.exports=r).prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},r.prototype.off=function(e,t){if(e===undefined$1)this._listeners={};else if(t===undefined$1)this._listeners[e]=[];else for(var i=this._listeners[e],r=0;r<i.length;)i[r].fn===t?i.splice(r,1):++r;return this},r.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var i=[],r=1;r<arguments.length;)i.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,i)}return this}},{}],4:[function(require,module,exports){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}module.exports=inquire},{}],5:[function(e,t,i){t.exports=function(t,i,e){var r=e||8192,n=r>>>1,a=null,o=r;return function(e){if(e<1||n<e)return t(e);r<o+e&&(a=t(r),o=0);e=i.call(a,o,o+=e);return 7&o&&(o=1+(7|o)),e}}},{}],6:[function(e,t,i){i.length=function(e){for(var t,i=0,r=0;r<e.length;++r)(t=e.charCodeAt(r))<128?i+=1:t<2048?i+=2:55296==(64512&t)&&56320==(64512&e.charCodeAt(r+1))?(++r,i+=4):i+=3;return i},i.read=function(e,t,i){if(i-t<1)return"";for(var r,n=null,a=[],o=0;t<i;)(r=e[t++])<128?a[o++]=r:191<r&&r<224?a[o++]=(31&r)<<6|63&e[t++]:239<r&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[o++]=55296+(r>>10),a[o++]=56320+(1023&r)):a[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],8191<o&&((n=n||[]).push(String.fromCharCode.apply(String,a)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,a.slice(0,o))),n.join("")):String.fromCharCode.apply(String,a.slice(0,o))},i.write=function(e,t,i){for(var r,n,a=i,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(o+1)))?(++o,t[i++]=(r=65536+((1023&r)<<10)+(1023&n))>>18|240,t[i++]=r>>12&63|128):t[i++]=r>>12|224,t[i++]=r>>6&63|128),t[i++]=63&r|128);return i-a}},{}],7:[function(e,t,i){var r=i;function n(){r.Reader._configure(r.BufferReader),r.util._configure()}r.build="minimal",r.roots={},r.Writer=e(14),r.BufferWriter=e(15),r.Reader=e(8),r.BufferReader=e(9),r.util=e(13),r.rpc=e(10),r.configure=n,r.Writer._configure(r.BufferWriter),n()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,i){t.exports=l;var r,n=e(13),a=n.LongBits,o=n.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")};function d(){var e=new a(0,0),t=0;if(!(4<this.len-this.pos)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,4<this.len-this.pos){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new a(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}l.create=n.Buffer?function(e){return(l.create=function(e){return n.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u,l.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)};var m,f,g="undefined"!=typeof Float32Array?(m=new Float32Array(1),f=new Uint8Array(m.buffer),m[0]=-0,f[3]?function(e,t){return f[0]=e[t],f[1]=e[t+1],f[2]=e[t+2],f[3]=e[t+3],m[0]}:function(e,t){return f[0]=e[t+3],f[1]=e[t+2],f[2]=e[t+1],f[3]=e[t],m[0]}):function(e,t){var i=h(e,t+4),e=2*(i>>31)+1,t=i>>>23&255,i=8388607&i;return 255==t?i?NaN:1/0*e:0==t?1401298464324817e-60*e*i:e*Math.pow(2,t-150)*(8388608+i)};l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=g(this.buf,this.pos);return this.pos+=4,e};var _,y,C="undefined"!=typeof Float64Array?(_=new Float64Array(1),y=new Uint8Array(_.buffer),_[0]=-0,y[7]?function(e,t){return y[0]=e[t],y[1]=e[t+1],y[2]=e[t+2],y[3]=e[t+3],y[4]=e[t+4],y[5]=e[t+5],y[6]=e[t+6],y[7]=e[t+7],_[0]}:function(e,t){return y[0]=e[t+7],y[1]=e[t+6],y[2]=e[t+5],y[3]=e[t+4],y[4]=e[t+3],y[5]=e[t+2],y[6]=e[t+1],y[7]=e[t],_[0]}):function(e,t){var i=h(e,t+4),r=h(e,t+8),e=2*(r>>31)+1,t=r>>>20&2047,i=4294967296*(1048575&r)+i;return 2047==t?i?NaN:1/0*e:0==t?5e-324*e*i:e*Math.pow(2,t-1075)*(i+4503599627370496)};l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=C(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw s(this,e);return this.pos+=e,t===i?new this.buf.constructor(0):this._slice.call(this.buf,t,i)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e;var t=n.Long?"toLong":"toNumber";n.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,i){t.exports=n;var r=e(8);(n.prototype=Object.create(r.prototype)).constructor=n;e=e(13);function n(e){r.call(this,e)}e.Buffer&&(n.prototype._slice=e.Buffer.prototype.slice),n.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{13:13,8:8}],10:[function(e,t,i){i.Service=e(11)},{11:11}],11:[function(e,t,i){t.exports=r;var s=e(13);function r(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");s.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}((r.prototype=Object.create(s.EventEmitter.prototype)).constructor=r).prototype.rpcCall=function e(i,t,r,n,a){if(!n)throw TypeError("request must be specified");var o=this;if(!a)return s.asPromise(e,o,i,t,r,n);if(!o.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),undefined$1;try{return o.rpcImpl(i,t[o.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,t){if(e)return o.emit("error",e,i),a(e);if(null===t)return o.end(!0),undefined$1;if(!(t instanceof r))try{t=r[o.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return o.emit("error",e,i),a(e)}return o.emit("data",t,i),a(null,t)})}catch(e){return o.emit("error",e,i),setTimeout(function(){a(e)},0),undefined$1}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{13:13}],12:[function(e,t,i){t.exports=n;var r=e(13);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=n.zero=new n(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return a;var t=e<0,i=(e=t?-e:e)>>>0,e=(e-i)/4294967296>>>0;return t&&(e=~e>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++e&&(e=0))),new n(i,e)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(r.isString(e)){if(!r.Long)return n.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):a},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,e=~this.hi>>>0;return-(t+4294967296*(e=!t?e+1>>>0:e))}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var o=String.prototype.charCodeAt;n.fromHash=function(e){return"\0\0\0\0\0\0\0\0"===e?a:new n((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0==i?0==t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},{13:13}],13:[function(e,t,i){var r=i;function n(e,t,i){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]!==undefined$1&&i||(e[r[n]]=t[r[n]]);return e}function a(e){function i(e,t){if(!(this instanceof i))return new i(e,t);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,i):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),t&&n(this,t)}return(i.prototype=Object.create(Error.prototype)).constructor=i,Object.defineProperty(i.prototype,"name",{get:function(){return e}}),i.prototype.toString=function(){return this.name+": "+this.message},i}r.asPromise=e(1),r.base64=e(2),r.EventEmitter=e(3),r.inquire=e(4),r.utf8=e(6),r.pool=e(5),r.LongBits=e(12),r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isNode=Boolean(global.process&&global.process.versions&&global.process.versions.node),r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=global.dcodeIO&&global.dcodeIO.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){e=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(e.lo,e.hi,t):e.toNumber(Boolean(t))},r.merge=n,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(e){for(var i={},t=0;t<e.length;++t)i[e[t]]=1;return function(){for(var e=Object.keys(this),t=e.length-1;-1<t;--t)if(1===i[e[t]]&&this[e[t]]!==undefined$1&&null!==this[e[t]])return e[t]}},r.oneOfSetter=function(i){return function(e){for(var t=0;t<i.length;++t)i[t]!==e&&delete this[i[t]]}},r.lazyResolve=function(e,t){for(var i=0;i<t.length;++i)for(var r=Object.keys(t[i]),n=0;n<r.length;++n){for(var a=t[i][r[n]].split("."),o=e;a.length;)o=o[a.shift()];t[i][r[n]]=o}},r.toJSONOptions={longs:String,enums:String,bytes:String},r._configure=function(){var i=r.Buffer;i?(r._Buffer_from=i.from!==Uint8Array.from&&i.from||function(e,t){return new i(e,t)},r._Buffer_allocUnsafe=i.allocUnsafe||function(e){return new i(e)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},{1:1,12:12,2:2,3:3,4:4,5:5,6:6}],14:[function(e,t,i){t.exports=d;var r,n=e(13),a=n.LongBits,o=n.base64,s=n.utf8;function l(e,t,i){this.fn=e,this.len=t,this.next=undefined$1,this.val=i}function c(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}function h(e,t,i){t[i]=255&e}function p(e,t){this.len=e,this.next=undefined$1,this.val=t}function m(e,t,i){for(;e.hi;)t[i++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;127<e.lo;)t[i++]=127&e.lo|128,e.lo=e.lo>>>7;t[i++]=e.lo}function f(e,t,i){t[i++]=255&e,t[i++]=e>>>8&255,t[i++]=e>>>16&255,t[i]=e>>>24}d.create=n.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d},d.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(d.alloc=n.pool(d.alloc,n.Array.prototype.subarray)),d.prototype.push=function(e,t,i){return this.tail=this.tail.next=new l(e,t,i),this.len+=t,this},(p.prototype=Object.create(l.prototype)).fn=function(e,t,i){for(;127<e;)t[i++]=127&e|128,e>>>=7;t[i]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((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(m,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.int64=d.prototype.uint64=function(e){e=a.from(e);return this.push(m,e.length(),e)},d.prototype.sint64=function(e){e=a.from(e).zzEncode();return this.push(m,e.length(),e)},d.prototype.bool=function(e){return this.push(h,1,e?1:0)},d.prototype.sfixed32=d.prototype.fixed32=function(e){return this.push(f,4,e>>>0)},d.prototype.sfixed64=d.prototype.fixed64=function(e){e=a.from(e);return this.push(f,4,e.lo).push(f,4,e.hi)};var g,_,y="undefined"!=typeof Float32Array?(g=new Float32Array(1),_=new Uint8Array(g.buffer),g[0]=-0,_[3]?function(e,t,i){g[0]=e,t[i++]=_[0],t[i++]=_[1],t[i++]=_[2],t[i]=_[3]}:function(e,t,i){g[0]=e,t[i++]=_[3],t[i++]=_[2],t[i++]=_[1],t[i]=_[0]}):function(e,t,i){var r=e<0?1:0;0===(e=r?-e:e)?f(0<1/e?0:2147483648,t,i):isNaN(e)?f(2147483647,t,i):f(34028234663852886e22<e?(r<<31|2139095040)>>>0:e<11754943508222875e-54?(r<<31|Math.round(e/1401298464324817e-60))>>>0:(r<<31|(r=Math.floor(Math.log(e)/Math.LN2))+127<<23|8388607&Math.round(e*Math.pow(2,-r)*8388608))>>>0,t,i)};d.prototype.float=function(e){return this.push(y,4,e)};var C,v,S="undefined"!=typeof Float64Array?(C=new Float64Array(1),v=new Uint8Array(C.buffer),C[0]=-0,v[7]?function(e,t,i){C[0]=e,t[i++]=v[0],t[i++]=v[1],t[i++]=v[2],t[i++]=v[3],t[i++]=v[4],t[i++]=v[5],t[i++]=v[6],t[i]=v[7]}:function(e,t,i){C[0]=e,t[i++]=v[7],t[i++]=v[6],t[i++]=v[5],t[i++]=v[4],t[i++]=v[3],t[i++]=v[2],t[i++]=v[1],t[i]=v[0]}):function(e,t,i){var r,n,a=e<0?1:0;0===(e=a?-e:e)?(f(0,t,i),f(0<1/e?0:2147483648,t,i+4)):isNaN(e)?(f(4294967295,t,i),f(2147483647,t,i+4)):17976931348623157e292<e?(f(0,t,i),f((a<<31|2146435072)>>>0,t,i+4)):e<22250738585072014e-324?(f((r=e/5e-324)>>>0,t,i),f((a<<31|r/4294967296)>>>0,t,i+4)):(1024===(n=Math.floor(Math.log(e)/Math.LN2))&&(n=1023),f(4503599627370496*(r=e*Math.pow(2,-n))>>>0,t,i),f((a<<31|n+1023<<20|1048576*r&1048575)>>>0,t,i+4))};d.prototype.double=function(e){return this.push(S,8,e)};var T=n.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var r=0;r<e.length;++r)t[i+r]=e[r]};d.prototype.bytes=function(e){var t,i=e.length>>>0;return i?(n.isString(e)&&(t=d.alloc(i=o.length(e)),o.decode(e,t,0),e=t),this.uint32(i).push(T,i,e)):this.push(h,1,0)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t).push(s.write,t,e):this.push(h,1,0)},d.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,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 l(c,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},d._configure=function(e){r=e}},{13:13}],15:[function(e,t,i){t.exports=o;var r=e(14);(o.prototype=Object.create(r.prototype)).constructor=o;var n=e(13),a=n.Buffer;function o(){r.call(this)}o.alloc=function(e){return(o.alloc=n._Buffer_allocUnsafe)(e)};var s=a&&a.prototype instanceof Uint8Array&&"set"===a.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var r=0;r<e.length;)t[i++]=e[r++]};function l(e,t,i){e.length<40?n.utf8.write(e,t,i):t.utf8Write(e,i)}o.prototype.bytes=function(e){var t=(e=n.isString(e)?n._Buffer_from(e,"base64"):e).length>>>0;return this.uint32(t),t&&this.push(s,t,e),this},o.prototype.string=function(e){var t=a.byteLength(e);return this.uint32(t),t&&this.push(l,t,e),this}},{13:13,14:14}]},RMb={},SMb=[7],global.protobuf=function e(t){var i=RMb[t];return i||QMb[t][0].call(i=RMb[t]={exports:{}},e,i,i.exports),i.exports}(SMb[0])}(tmp$6);var protobuf=tmp$6.protobuf;function isBitSet(e,t){return 0!=(e&t)}var childrenBitmasks=[1,2,4,8],anyChildBitmask=15,cacheFlagBitmask=16,imageBitmask=64,terrainBitmask=128;function GoogleEarthEnterpriseTileInformation(e,t,i,r,n,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=i,this.terrainVersion=r,this.imageryProvider=n,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}function stringToBuffer(e){for(var t=e.length,i=new ArrayBuffer(t),r=new Uint8Array(i),n=0;n<t;++n)r[n]=e.charCodeAt(n);return i}GoogleEarthEnterpriseTileInformation.clone=function(e,t){return defined(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 GoogleEarthEnterpriseTileInformation(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t},GoogleEarthEnterpriseTileInformation.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},GoogleEarthEnterpriseTileInformation.prototype.hasSubtree=function(){return isBitSet(this._bits,cacheFlagBitmask)},GoogleEarthEnterpriseTileInformation.prototype.hasImagery=function(){return isBitSet(this._bits,imageBitmask)},GoogleEarthEnterpriseTileInformation.prototype.hasTerrain=function(){return isBitSet(this._bits,terrainBitmask)},GoogleEarthEnterpriseTileInformation.prototype.hasChildren=function(){return isBitSet(this._bits,anyChildBitmask)},GoogleEarthEnterpriseTileInformation.prototype.hasChild=function(e){return isBitSet(this._bits,childrenBitmasks[e])},GoogleEarthEnterpriseTileInformation.prototype.getChildBitmask=function(){return this._bits&anyChildBitmask};var defaultKey=stringToBuffer('Eô½\vyâjE"’,ÍqøIFgQ\0B%Æèa,f)\bÆ4Üjb%y\nwmiÖðœk“¡½NuàA[ß@V\fÙ»r›|3SîOlÔq°{ÀEVZ­wUe\v3’*¬l5Å0sø3>mF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;Áěð<VqH‚\'UfYNe˜u£aF}a?A\0Ÿ×´4M·F°Õ¸Š\'{‹Ü+»Mg0ÈÑö\\Pú[/F›n5/\'C.ë\n\f^¥se4ål.jC\'c#U©?q{gC}:¯ÍâTUœýKÆâŸ/(íË\\Æ-fˆ§;/*"N°k.Ý\r•}}GºC²²+>Mª>}æÎI‰Ææx\fa1-¤O¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©­S+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ï1²&/çÃu-6,rt°#G·ÓÑ&…7râ\0ŒDÏÚ3-Þ`†i#i*|ÍKQ\r•T9w.)ê¦P¢joP™\\>TûïP[\vE‰m(w7ێJfJo™ åpâ¹q~\fmI-zþrÇòY0»]såÉ êxì ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1’;µoÜl\r’ˆўÛ?âéÚ_ԄâFaZÞUϤ\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÐKW>\'\'Ç`Û;íšSD>?’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj å*x°Öprª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldIœ\'­xtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Á\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)…{II¥wy¾IV.6ç\v:»Ob{ÒM1•/½8{¨O!áìFpv•})"xˆ\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-È܈F|Š["');function GoogleEarthEnterpriseMetadata(e){var t=e;"string"==typeof t||t instanceof Resource||(t=e.url);t=Resource.createIfNeeded(t);t.appendForwardSlash(),this._resource=t,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=CesiumMath.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};var i=this;this._readyPromise=requestDbRoot(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).otherwise(function(e){var t="An error occurred while accessing "+getMetadataResource(i,"",1).url+".";return when.reject(new RuntimeError(t))})}Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}}}),GoogleEarthEnterpriseMetadata.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;0<=n;--n){var a=1<<n,o=0;isBitSet(t,a)?isBitSet(e,a)&&(o|=1):(o|=2,isBitSet(e,a)||(o|=1)),r+=o}return r},GoogleEarthEnterpriseMetadata.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;0<=n;--n){var a=1<<n,o=+e[r-n];isBitSet(o,2)?isBitSet(o,1)||(t|=a):(i|=a,isBitSet(o,1)&&(t|=a))}return{x:t,y:i,level:r}},GoogleEarthEnterpriseMetadata.prototype.isValid=function(e){var t=this.getTileInformationFromQuadKey(e);if(defined(t))return null!==t;for(var i,r=!0,n=e;1<n.length;){if(i=n.substring(n.length-1),n=n.substring(0,n.length-1),defined(t=this.getTileInformationFromQuadKey(n))){t.hasSubtree()||t.hasChild(parseInt(i))||(r=!1);break}if(null===t){r=!1;break}}return r};var taskProcessor$1=new TaskProcessor("decodeGoogleEarthEnterprisePacket"),dbrootParser,dbrootParserPromise;function populateSubtree(e,t,i){var r,n=e._tileInfo,a=t,o=n[a];if(defined(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;void 0===o&&1<a.length;)o=n[a=a.substring(0,a.length-1)];var s=e._subtreePromises,l=s[a];return defined(l)?l.then(function(){return r=new Request({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),populateSubtree(e,t,r)}):defined(o)&&o.hasSubtree()?defined(l=e.getQuadTreePacket(a,o.cnodeVersion,i))?(s[a]=l).then(function(){return r=new Request({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),populateSubtree(e,t,r)}).always(function(){delete s[a]}):void 0:when.reject(new RuntimeError("Couldn't load metadata for tile "+t))}function getMetadataResource(e,t,i,r){return e._resource.getDerivedResource({url:"flatfile?q2-0"+t+"-q."+i.toString(),request:r})}function requestDbRoot(l){var e,t,i=l._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});return defined(dbrootParserPromise)||(e=buildModuleUrl("ThirdParty/google-earth-dbroot-parser.js"),t=window.cesiumGoogleEarthDbRootParser,dbrootParserPromise=loadAndExecuteScript(e).then(function(){dbrootParser=window.cesiumGoogleEarthDbRootParser(protobuf),defined(t)?window.cesiumGoogleEarthDbRootParser=t:delete window.cesiumGoogleEarthDbRootParser})),dbrootParserPromise.then(function(){return i.fetchArrayBuffer()}).then(function(e){var t=dbrootParser.EncryptedDbRootProto.decode(new Uint8Array(e)),i=t.encryptionData,r=i.byteOffset,n=r+i.byteLength,e=l.key=i.buffer.slice(r,n),n=(r=(i=t.dbrootData).byteOffset)+i.byteLength,n=i.buffer.slice(r,n);return taskProcessor$1.scheduleTask({buffer:n,type:"DbRoot",key:e},[n])}).then(function(e){var t=dbrootParser.DbRootProto.decode(new Uint8Array(e.buffer));l.imageryPresent=defaultValue(t.imageryPresent,l.imageryPresent),l.protoImagery=t.protoImagery,l.terrainPresent=defaultValue(t.terrainPresent,l.terrainPresent),defined(t.endSnippet)&&defined(t.endSnippet.model)&&(e=t.endSnippet.model,l.negativeAltitudeExponentBias=defaultValue(e.negativeAltitudeExponentBias,l.negativeAltitudeExponentBias),l.negativeAltitudeThreshold=defaultValue(e.compressedNegativeAltitudeThreshold,l.negativeAltitudeThreshold)),defined(t.databaseVersion)&&(l._quadPacketVersion=defaultValue(t.databaseVersion.quadtreeVersion,l._quadPacketVersion));for(var i=l.providers,r=defaultValue(t.providerInfo,[]),n=r.length,a=0;a<n;++a){var o=r[a],s=o.copyrightString;defined(s)&&(i[o.providerId]=new Credit(s.value))}}).otherwise(function(){console.log("Failed to retrieve "+i.url+". Using defaults."),l.key=defaultKey})}function GoogleEarthEnterpriseTerrainData(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;var t=defaultValue(e.childTileMask,15),i=3&t;i|=4&t?8:0,this._childTileMask=i|=8&t?4:0,this._createdByUpsampling=defaultValue(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket=function(u,e,t){e=defaultValue(e,1);t=getMetadataResource(this,u=defaultValue(u,""),e,t).fetchArrayBuffer();if(defined(t)){var d=this._tileInfo,i=this.key;return t.then(function(e){return taskProcessor$1.scheduleTask({buffer:e,quadKey:u,type:"Metadata",key:i},[e]).then(function(e){var t,i,r=-1;""!==u&&(r=u.length+1,t=e[u],(i=d[u])._bits|=t._bits,delete e[u]);var n=Object.keys(e);n.sort(function(e,t){return e.length-t.length});for(var a=n.length,o=0;o<a;++o){var s,l,c=n[o];null!==e[c]?(s=GoogleEarthEnterpriseTileInformation.clone(e[c]),(l=c.length)===r?s.setParent(i):1<l&&(l=d[c.substring(0,c.length-1)],s.setParent(l)),d[c]=s):d[c]=null}})})}},GoogleEarthEnterpriseMetadata.prototype.populateSubtree=function(e,t,i,r){return populateSubtree(this,GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),r)},GoogleEarthEnterpriseMetadata.prototype.getTileInformation=function(e,t,i){i=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i);return this._tileInfo[i]},GoogleEarthEnterpriseMetadata.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]},Object.defineProperties(GoogleEarthEnterpriseTerrainData.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var createMeshTaskName="createVerticesFromGoogleEarthEnterpriseBuffer",createMeshTaskProcessorNoThrottle=new TaskProcessor(createMeshTaskName),createMeshTaskProcessorThrottle=new TaskProcessor(createMeshTaskName,TerrainData.maximumAsynchronousTasks),nativeRectangleScratch=new Rectangle,rectangleScratch$5=new Rectangle;GoogleEarthEnterpriseTerrainData.prototype.createMesh=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).tilingScheme,i=e.x,r=e.y,n=e.level,a=defaultValue(e.exaggeration,1),o=defaultValue(e.throttle,!0),e=t.ellipsoid;t.tileXYToNativeRectangle(i,r,n,nativeRectangleScratch),t.tileXYToRectangle(i,r,n,rectangleScratch$5);var s=e.cartographicToCartesian(Rectangle.center(rectangleScratch$5));this._skirtHeight=Math.min(8*(40075.16/(1<<n)),1e3);e=(o?createMeshTaskProcessorThrottle:createMeshTaskProcessorNoThrottle).scheduleTask({buffer:this._buffer,nativeRectangle:nativeRectangleScratch,rectangle:rectangleScratch$5,relativeToCenter:s,ellipsoid:e,skirtHeight:this._skirtHeight,exaggeration:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(defined(e)){var l=this;return e.then(function(e){return l._mesh=new TerrainMesh(s,new Float32Array(e.vertices),new Uint16Array(e.indices),e.indexCountWithoutSkirts,e.vertexCountWithoutSkirts,e.minimumHeight,e.maximumHeight,BoundingSphere.clone(e.boundingSphere3D),Cartesian3.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,OrientedBoundingBox.clone(e.orientedBoundingBox),TerrainEncoding.clone(e.encoding),a,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast),l._minimumHeight=e.minimumHeight,l._maximumHeight=e.maximumHeight,l._buffer=void 0,l._mesh})}},GoogleEarthEnterpriseTerrainData.prototype.interpolateHeight=function(e,t,i){t=CesiumMath.clamp((t-e.west)/e.width,0,1),i=CesiumMath.clamp((i-e.south)/e.height,0,1);return defined(this._mesh)?interpolateMeshHeight(this,t,i):interpolateHeight(this,t,i,e)};var upsampleTaskProcessor=new TaskProcessor("upsampleQuantizedTerrainMesh",TerrainData.maximumAsynchronousTasks);GoogleEarthEnterpriseTerrainData.prototype.upsample=function(e,t,i,r,n,a,o){var s=this._mesh;if(defined(this._mesh)){var l=2*t!==n,t=2*i===a,i=e.ellipsoid,o=e.tileXYToRectangle(n,a,o),s=upsampleTaskProcessor.scheduleTask({vertices:s.vertices,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:l,isNorthChild:t,childRectangle:o,ellipsoid:i,exaggeration:s.exaggeration});if(defined(s)){var c=this;return s.then(function(e){var t=new Uint16Array(e.vertices),i=IndexDatatype$1.createTypedArray(t.length/3,e.indices),r=c._skirtHeight;return new QuantizedMeshTerrainData({quantizedVertices:t,indices:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:BoundingSphere.clone(e.boundingSphere),orientedBoundingBox:OrientedBoundingBox.clone(e.orientedBoundingBox),horizonOcclusionPoint:Cartesian3.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:r,southSkirtHeight:r,eastSkirtHeight:r,northSkirtHeight:r,childTileMask:0,createdByUpsampling:!0,credits:c._credits})})}}},GoogleEarthEnterpriseTerrainData.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},GoogleEarthEnterpriseTerrainData.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var texCoordScratch0=new Cartesian2,texCoordScratch1=new Cartesian2,texCoordScratch2=new Cartesian2,barycentricCoordinateScratch=new Cartesian3;function interpolateMeshHeight(e,t,i){for(var e=e._mesh,r=e.vertices,n=e.encoding,a=e.indices,o=0,s=a.length;o<s;o+=3){var l=a[o],c=a[o+1],u=a[o+2],d=n.decodeTextureCoordinates(r,l,texCoordScratch0),h=n.decodeTextureCoordinates(r,c,texCoordScratch1),p=n.decodeTextureCoordinates(r,u,texCoordScratch2),p=Intersections2D.computeBarycentricCoordinates(t,i,d.x,d.y,h.x,h.y,p.x,p.y,barycentricCoordinateScratch);if(-1e-15<=p.x&&-1e-15<=p.y&&-1e-15<=p.z){l=n.decodeHeight(r,l),c=n.decodeHeight(r,c),u=n.decodeHeight(r,u);return p.x*l+p.y*c+p.z*u}}}var sizeOfUint16=Uint16Array.BYTES_PER_ELEMENT,sizeOfUint32$8=Uint32Array.BYTES_PER_ELEMENT,sizeOfInt32=Int32Array.BYTES_PER_ELEMENT,sizeOfFloat=Float32Array.BYTES_PER_ELEMENT,sizeOfDouble=Float64Array.BYTES_PER_ELEMENT;function interpolateHeight(e,t,i,r){var n=e._buffer,a=0,o=0,s=0;.5<i?(.5<t?(a=2,o=.5):a=3,s=.5):.5<t&&(a=1,o=.5);for(var l=new DataView(n),c=0,u=0;u<a;++u)c+=l.getUint32(c,!0),c+=sizeOfUint32$8;c+=sizeOfUint32$8;var e=CesiumMath.toRadians(180*l.getFloat64(c+=2*sizeOfDouble,!0)),n=CesiumMath.toRadians(180*l.getFloat64(c+=sizeOfDouble,!0)),d=r.width/e/2,h=r.height/n/2,p=l.getInt32(c+=sizeOfDouble,!0),m=3*l.getInt32(c+=sizeOfInt32,!0);c+=sizeOfInt32,c+=sizeOfInt32;for(var f=new Array(p),g=new Array(p),_=new Array(p),y=0;y<p;++y)f[y]=o+l.getUint8(c++)*d,g[y]=s+l.getUint8(c++)*h,_[y]=6371010*l.getFloat32(c,!0),c+=sizeOfFloat;var C=new Array(m);for(y=0;y<m;++y)C[y]=l.getUint16(c,!0),c+=sizeOfUint16;for(y=0;y<m;y+=3){var v=C[y],S=C[y+1],T=C[y+2],x=f[v],b=f[S],E=f[T],P=g[v],A=g[S],w=g[T],w=Intersections2D.computeBarycentricCoordinates(t,i,x,P,b,A,E,w,barycentricCoordinateScratch);if(-1e-15<=w.x&&-1e-15<=w.y&&-1e-15<=w.z)return w.x*_[v]+w.y*_[S]+w.z*_[T]}}var TerrainState$2={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},julianDateScratch=new JulianDate;function TerrainCache(){this._terrainCache={},this._lastTidy=JulianDate.now()}function GoogleEarthEnterpriseTerrainProvider(e){var t;e=defaultValue(e,defaultValue.EMPTY_OBJECT),t=defined(e.metadata)?e.metadata:new GoogleEarthEnterpriseMetadata(Resource.createIfNeeded(e.url)),this._metadata=t,this._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-CesiumMath.PI,-CesiumMath.PI,CesiumMath.PI,CesiumMath.PI),ellipsoid:e.ellipsoid});e=e.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new TerrainCache,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Event,this._ready=!1;var i,r=this;this._readyPromise=t.readyPromise.then(function(e){if(t.terrainPresent)return TileProviderError.handleSuccess(i),r._ready=e;e=new RuntimeError("The server "+t.url+" doesn't have terrain");return i=TileProviderError.handleError(i,r,r._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)}).otherwise(function(e){return i=TileProviderError.handleError(i,r,r._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)})}TerrainCache.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:JulianDate.now()}},TerrainCache.prototype.get=function(e){var t=this._terrainCache[e];if(defined(t))return delete this._terrainCache[e],t.buffer},TerrainCache.prototype.tidy=function(){if(JulianDate.now(julianDateScratch),10<JulianDate.secondsDifference(julianDateScratch,this._lastTidy)){for(var e=this._terrainCache,t=Object.keys(e),i=t.length,r=0;r<i;++r){var n=t[r],a=e[n];10<JulianDate.secondsDifference(julianDateScratch,a.timestamp)&&delete e[n]}JulianDate.clone(julianDateScratch,this._lastTidy)}},Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});var taskProcessor=new TaskProcessor("decodeGoogleEarthEnterprisePacket");function computeChildMask(e,t,i){var r=t.getChildBitmask();if(t.terrainState===TerrainState$2.PARENT)for(var r=0,n=0;n<4;++n){var a=i.getTileInformationFromQuadKey(e+n.toString());defined(a)&&a.hasTerrain()&&(r|=1<<n)}return r}function buildTerrainResource(e,t,i,r){return i=defined(i)&&0<i?i:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1c-0"+t+"-t."+i.toString(),request:r})}GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry=function(e,t,i,r){var n=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),s=this._terrainCache,l=this._metadata,a=l.getTileInformationFromQuadKey(n);if(!defined(a))return when.reject(new RuntimeError("Terrain tile doesn't exist"));e=a.terrainState;defined(e)||(e=a.terrainState=TerrainState$2.UNKNOWN);var o,t=s.get(n);if(defined(t)){i=l.providers[a.terrainProvider];return when.resolve(new GoogleEarthEnterpriseTerrainData({buffer:t,childTileMask:computeChildMask(n,a,l),credits:defined(i)?[i]:void 0,negativeAltitudeExponentBias:l.negativeAltitudeExponentBias,negativeElevationThreshold:l.negativeAltitudeThreshold}))}if(s.tidy(),!a.ancestorHasTerrain)return when.resolve(new HeightmapTerrainData({buffer:new Uint8Array(256),width:16,height:16}));if(e===TerrainState$2.NONE)return when.reject(new RuntimeError("Terrain tile doesn't exist"));var c=n,u=-1;switch(e){case TerrainState$2.SELF:u=a.terrainVersion;break;case TerrainState$2.PARENT:c=c.substring(0,c.length-1),u=(o=l.getTileInformationFromQuadKey(c)).terrainVersion;break;case TerrainState$2.UNKNOWN:a.hasTerrain()?u=a.terrainVersion:(c=c.substring(0,c.length-1),defined(o=l.getTileInformationFromQuadKey(c))&&o.hasTerrain()&&(u=o.terrainVersion))}if(u<0)return when.reject(new RuntimeError("Terrain tile doesn't exist"));var d,h=this._terrainPromises,p=this._terrainRequests;if(defined(h[c]))d=h[c],m=p[c];else{var m,e=buildTerrainResource(this,c,u,m=r).fetchArrayBuffer();if(!defined(e))return;d=e.then(function(e){return defined(e)?taskProcessor.scheduleTask({buffer:e,type:"Terrain",key:l.key},[e]).then(function(e){var t=l.getTileInformationFromQuadKey(c);t.terrainState=TerrainState$2.SELF,s.add(c,e[0]);for(var i=t.terrainProvider,r=e.length-1,n=0;n<r;++n){var a=c+n.toString(),o=l.getTileInformationFromQuadKey(a);defined(o)&&(s.add(a,e[n+1]),o.terrainState=TerrainState$2.PARENT,0===o.terrainProvider&&(o.terrainProvider=i))}}):when.reject(new RuntimeError("Failed to load terrain."))}),h[c]=d,p[c]=m,d=d.always(function(){delete h[c],delete p[c]})}return d.then(function(){var e=s.get(n);if(defined(e)){var t=l.providers[a.terrainProvider];return new GoogleEarthEnterpriseTerrainData({buffer:e,childTileMask:computeChildMask(n,a,l),credits:defined(t)?[t]:void 0,negativeAltitudeExponentBias:l.negativeAltitudeExponentBias,negativeElevationThreshold:l.negativeAltitudeThreshold})}return when.reject(new RuntimeError("Failed to load terrain."))}).otherwise(function(e){return m.state===RequestState$1.CANCELLED?r.state=m.state:a.terrainState=TerrainState$2.NONE,when.reject(e)})},GoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},GoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){var r=this._metadata,n=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),a=r.getTileInformation(e,t,i);if(null===a)return!1;if(defined(a)){if(!a.ancestorHasTerrain)return!0;var o=a.terrainState;if(o===TerrainState$2.NONE)return!1;if(!(defined(o)&&o!==TerrainState$2.UNKNOWN||(a.terrainState=TerrainState$2.UNKNOWN,a.hasTerrain()))){var n=n.substring(0,n.length-1),a=r.getTileInformationFromQuadKey(n);if(!defined(a)||!a.hasTerrain())return!1}return!0}return r.isValid(n)&&(n=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.TERRAIN}),r.populateSubtree(e,t,i,n)),!1},GoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){};var PROJECTIONS=[GeographicProjection,WebMercatorProjection],PROJECTION_COUNT=PROJECTIONS.length,MITER_BREAK_SMALL=Math.cos(CesiumMath.toRadians(30)),MITER_BREAK_LARGE=Math.cos(CesiumMath.toRadians(150)),WALL_INITIAL_MIN_HEIGHT=0,WALL_INITIAL_MAX_HEIGHT=1e3;function GroundPolylineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions;this.width=defaultValue(e.width,1),this._positions=t,this.granularity=defaultValue(e.granularity,9999),this.loop=defaultValue(e.loop,!1),this.arcType=defaultValue(e.arcType,ArcType$1.GEODESIC),this._ellipsoid=Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(GroundPolylineGeometry.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+Ellipsoid.packedLength+1+1}}}),GroundPolylineGeometry.setProjectionAndEllipsoid=function(e,t){for(var i=0,r=0;r<PROJECTION_COUNT;r++)if(t instanceof PROJECTIONS[r]){i=r;break}e._projectionIndex=i,e._ellipsoid=t.ellipsoid};var cart3Scratch1=new Cartesian3,cart3Scratch2=new Cartesian3,cart3Scratch3=new Cartesian3;function computeRightNormal(e,t,i,r,n){var a=getPosition$2(r,e,0,cart3Scratch1),i=getPosition$2(r,e,i,cart3Scratch2),t=getPosition$2(r,t,0,cart3Scratch3),i=direction(i,a,cart3Scratch2),a=direction(t,a,cart3Scratch3);return Cartesian3.cross(a,i,n),Cartesian3.normalize(n,n)}var interpolatedCartographicScratch$1=new Cartographic,interpolatedBottomScratch=new Cartesian3,interpolatedTopScratch=new Cartesian3,interpolatedNormalScratch=new Cartesian3;function interpolateSegment(e,t,i,r,n,a,o,s,l,c,u){if(0!==n){var d;a===ArcType$1.GEODESIC?d=new EllipsoidGeodesic(e,t,o):a===ArcType$1.RHUMB&&(d=new EllipsoidRhumbLine(e,t,o));a=d.surfaceDistance;if(!(a<n))for(var h=computeRightNormal(e,t,r,o,interpolatedNormalScratch),n=Math.ceil(a/n),p=a/n,m=p,f=n-1,g=s.length,_=0;_<f;_++){var y=d.interpolateUsingSurfaceDistance(m,interpolatedCartographicScratch$1),C=getPosition$2(o,y,i,interpolatedBottomScratch),v=getPosition$2(o,y,r,interpolatedTopScratch);Cartesian3.pack(h,s,g),Cartesian3.pack(C,l,g),Cartesian3.pack(v,c,g),u.push(y.latitude),u.push(y.longitude),g+=3,m+=p}}}var heightlessCartographicScratch=new Cartographic;function getPosition$2(e,t,i,r){return Cartographic.clone(t,heightlessCartographicScratch),heightlessCartographicScratch.height=i,Cartographic.toCartesian(heightlessCartographicScratch,e,r)}function direction(e,t,i){return Cartesian3.subtract(e,t,i),Cartesian3.normalize(i,i),i}function tangentDirection(e,t,i,r){return r=direction(e,t,r),r=Cartesian3.cross(r,i,r),r=Cartesian3.normalize(r,r),r=Cartesian3.cross(i,r,r)}GroundPolylineGeometry.pack=function(e,t,i){var r=defaultValue(i,0),n=e._positions,a=n.length;t[r++]=a;for(var o=0;o<a;++o){var s=n[o];Cartesian3.pack(s,t,r),r+=3}return t[r++]=e.granularity,t[r++]=e.loop?1:0,t[r++]=e.arcType,Ellipsoid.pack(e._ellipsoid,t,r),r+=Ellipsoid.packedLength,t[r++]=e._projectionIndex,t[r++]=e._scene3DOnly?1:0,t},GroundPolylineGeometry.unpack=function(e,t,i){for(var r=defaultValue(t,0),n=e[r++],a=new Array(n),o=0;o<n;o++)a[o]=Cartesian3.unpack(e,r),r+=3;var s=e[r++],l=1===e[r++],c=e[r++],u=Ellipsoid.unpack(e,r);r+=Ellipsoid.packedLength;var d=e[r++],t=1===e[r++];return(i=!defined(i)?new GroundPolylineGeometry({positions:a}):i)._positions=a,i.granularity=s,i.loop=l,i.arcType=c,i._ellipsoid=u,i._projectionIndex=d,i._scene3DOnly=t,i};var toPreviousScratch=new Cartesian3,toNextScratch=new Cartesian3,forwardScratch=new Cartesian3,vertexUpScratch=new Cartesian3,cosine90=0,cosine180=-1;function computeVertexMiterNormal(e,t,i,r,n){i=direction(i,t,vertexUpScratch),e=tangentDirection(e,t,i,toPreviousScratch),t=tangentDirection(r,t,i,toNextScratch);if(CesiumMath.equalsEpsilon(Cartesian3.dot(e,t),cosine180,CesiumMath.EPSILON5))return n=Cartesian3.cross(i,e,n),n=Cartesian3.normalize(n,n);n=Cartesian3.add(t,e,n),n=Cartesian3.normalize(n,n);i=Cartesian3.cross(i,n,forwardScratch);return n=Cartesian3.dot(t,i)<cosine90?Cartesian3.negate(n,n):n}var XZ_PLANE=Plane.fromPointNormal(Cartesian3.ZERO,Cartesian3.UNIT_Y),previousBottomScratch=new Cartesian3,vertexBottomScratch=new Cartesian3,vertexTopScratch=new Cartesian3,nextBottomScratch=new Cartesian3,vertexNormalScratch=new Cartesian3,intersectionScratch$1=new Cartesian3,cartographicScratch0=new Cartographic,cartographicScratch1=new Cartographic,cartographicIntersectionScratch=new Cartographic;GroundPolylineGeometry.createGeometry=function(e){var t,i,r,n,a,o=!e._scene3DOnly,s=e.loop,l=e._ellipsoid,c=e.granularity,u=e.arcType,d=new PROJECTIONS[e._projectionIndex](l),h=WALL_INITIAL_MIN_HEIGHT,p=WALL_INITIAL_MAX_HEIGHT,m=e._positions,f=m.length;2===f&&(s=!1);for(var g,_,y,C=new EllipsoidRhumbLine(void 0,void 0,l),v=[m[0]],S=0;S<f-1;S++)i=m[S],r=m[S+1],!defined(g=IntersectionTests.lineSegmentPlane(i,r,XZ_PLANE,intersectionScratch$1))||Cartesian3.equalsEpsilon(g,i,CesiumMath.EPSILON7)||Cartesian3.equalsEpsilon(g,r,CesiumMath.EPSILON7)||(e.arcType===ArcType$1.GEODESIC?v.push(Cartesian3.clone(g)):e.arcType===ArcType$1.RHUMB&&(y=l.cartesianToCartographic(g,cartographicScratch0).longitude,n=l.cartesianToCartographic(i,cartographicScratch0),a=l.cartesianToCartographic(r,cartographicScratch1),C.setEndPoints(n,a),_=C.findIntersectionWithLongitude(y,cartographicIntersectionScratch),!defined(g=l.cartographicToCartesian(_,intersectionScratch$1))||Cartesian3.equalsEpsilon(g,i,CesiumMath.EPSILON7)||Cartesian3.equalsEpsilon(g,r,CesiumMath.EPSILON7)||v.push(Cartesian3.clone(g)))),v.push(r);s&&(i=m[f-1],r=m[0],!defined(g=IntersectionTests.lineSegmentPlane(i,r,XZ_PLANE,intersectionScratch$1))||Cartesian3.equalsEpsilon(g,i,CesiumMath.EPSILON7)||Cartesian3.equalsEpsilon(g,r,CesiumMath.EPSILON7)||(e.arcType===ArcType$1.GEODESIC?v.push(Cartesian3.clone(g)):e.arcType===ArcType$1.RHUMB&&(y=l.cartesianToCartographic(g,cartographicScratch0).longitude,n=l.cartesianToCartographic(i,cartographicScratch0),a=l.cartesianToCartographic(r,cartographicScratch1),C.setEndPoints(n,a),_=C.findIntersectionWithLongitude(y,cartographicIntersectionScratch),!defined(g=l.cartographicToCartesian(_,intersectionScratch$1))||Cartesian3.equalsEpsilon(g,i,CesiumMath.EPSILON7)||Cartesian3.equalsEpsilon(g,r,CesiumMath.EPSILON7)||v.push(Cartesian3.clone(g)))));var T=v.length,x=new Array(T);for(S=0;S<T;S++){var b=Cartographic.fromCartesian(v[S],l);b.height=0,x[S]=b}if(!((T=(x=arrayRemoveDuplicates(x,Cartographic.equalsEpsilon)).length)<2)){var E=[],P=[],A=[],w=[],D=vertexBottomScratch,M=vertexTopScratch,I=nextBottomScratch,R=vertexNormalScratch,O=x[0],L=x[1];for(F=getPosition$2(l,x[T-1],h,F=previousBottomScratch),I=getPosition$2(l,L,h,I),D=getPosition$2(l,O,h,D),M=getPosition$2(l,O,p,M),R=s?computeVertexMiterNormal(F,D,M,I,R):computeRightNormal(O,L,p,l,R),Cartesian3.pack(R,P,0),Cartesian3.pack(D,A,0),Cartesian3.pack(M,w,0),E.push(O.latitude),E.push(O.longitude),interpolateSegment(O,L,h,p,c,u,l,P,A,w,E),S=1;S<T-1;++S){var F=Cartesian3.clone(D,F),D=Cartesian3.clone(I,D),N=x[S];getPosition$2(l,N,p,M),getPosition$2(l,x[S+1],h,I),computeVertexMiterNormal(F,D,M,I,R),t=P.length,Cartesian3.pack(R,P,t),Cartesian3.pack(D,A,t),Cartesian3.pack(M,w,t),E.push(N.latitude),E.push(N.longitude),interpolateSegment(x[S],x[S+1],h,p,c,u,l,P,A,w,E)}var B=x[T-1],V=x[T-2];if(D=getPosition$2(l,B,h,D),M=getPosition$2(l,B,p,M),R=s?(L=x[0],computeVertexMiterNormal(F=getPosition$2(l,V,h,F),D,M,I=getPosition$2(l,L,h,I),R)):computeRightNormal(V,B,p,l,R),t=P.length,Cartesian3.pack(R,P,t),Cartesian3.pack(D,A,t),Cartesian3.pack(M,w,t),E.push(B.latitude),E.push(B.longitude),s){for(interpolateSegment(B,O,h,p,c,u,l,P,A,w,E),t=P.length,S=0;S<3;++S)P[t+S]=P[S],A[t+S]=A[S],w[t+S]=w[S];E.push(O.latitude),E.push(O.longitude)}return generateGeometryAttributes(s,d,A,w,P,E,o)}};var lineDirectionScratch=new Cartesian3,matrix3Scratch$1=new Matrix3,quaternionScratch$1=new Quaternion;function breakMiter(e,t,i,r){t=direction(i,t,lineDirectionScratch),t=Cartesian3.dot(t,e);if(MITER_BREAK_SMALL<t||t<MITER_BREAK_LARGE){i=direction(r,i,vertexUpScratch),t=t<MITER_BREAK_LARGE?CesiumMath.PI_OVER_TWO:-CesiumMath.PI_OVER_TWO,t=Quaternion.fromAxisAngle(i,t,quaternionScratch$1),t=Matrix3.fromQuaternion(t,matrix3Scratch$1);return Matrix3.multiplyByVector(t,e,e),!0}return!1}var endPosCartographicScratch=new Cartographic,normalStartpointScratch=new Cartesian3,normalEndpointScratch=new Cartesian3;function projectNormal(e,t,i,r,n){var a=Cartographic.toCartesian(t,e._ellipsoid,normalStartpointScratch),o=Cartesian3.add(a,i,normalEndpointScratch),s=!1,l=e._ellipsoid,c=l.cartesianToCartographic(o,endPosCartographicScratch);Math.abs(t.longitude-c.longitude)>CesiumMath.PI_OVER_TWO&&(s=!0,o=Cartesian3.subtract(a,i,normalEndpointScratch),c=l.cartesianToCartographic(o,endPosCartographicScratch)),c.height=0;c=e.project(c,n);return(n=Cartesian3.subtract(c,r,n)).z=0,n=Cartesian3.normalize(n,n),s&&Cartesian3.negate(n,n),n}var adjustHeightNormalScratch=new Cartesian3,adjustHeightOffsetScratch=new Cartesian3;function adjustHeights(e,t,i,r,n,a){var o=Cartesian3.subtract(t,e,adjustHeightNormalScratch);Cartesian3.normalize(o,o);i=Cartesian3.multiplyByScalar(o,i-WALL_INITIAL_MIN_HEIGHT,adjustHeightOffsetScratch);Cartesian3.add(e,i,n);i=Cartesian3.multiplyByScalar(o,r-WALL_INITIAL_MAX_HEIGHT,adjustHeightOffsetScratch);Cartesian3.add(t,i,a)}var nudgeDirectionScratch=new Cartesian3;function nudgeXZ(e,t){var i=Plane.getPointDistance(XZ_PLANE,e),r=Plane.getPointDistance(XZ_PLANE,t),n=nudgeDirectionScratch;CesiumMath.equalsEpsilon(i,0,CesiumMath.EPSILON2)?(n=direction(t,e,n),Cartesian3.multiplyByScalar(n,CesiumMath.EPSILON2,n),Cartesian3.add(e,n,e)):CesiumMath.equalsEpsilon(r,0,CesiumMath.EPSILON2)&&(n=direction(e,t,n),Cartesian3.multiplyByScalar(n,CesiumMath.EPSILON2,n),Cartesian3.add(t,n,t))}function nudgeCartographic(e,t){var i=Math.abs(e.longitude),r=Math.abs(t.longitude);if(CesiumMath.equalsEpsilon(i,CesiumMath.PI,CesiumMath.EPSILON11)){var n=CesiumMath.sign(t.longitude);return e.longitude=n*(i-CesiumMath.EPSILON11),1}if(CesiumMath.equalsEpsilon(r,CesiumMath.PI,CesiumMath.EPSILON11)){e=CesiumMath.sign(e.longitude);return t.longitude=e*(r-CesiumMath.EPSILON11),2}return 0}var startCartographicScratch$1=new Cartographic,endCartographicScratch$1=new Cartographic,segmentStartTopScratch=new Cartesian3,segmentEndTopScratch=new Cartesian3,segmentStartBottomScratch=new Cartesian3,segmentEndBottomScratch=new Cartesian3,segmentStartNormalScratch=new Cartesian3,segmentEndNormalScratch=new Cartesian3,getHeightCartographics=[startCartographicScratch$1,endCartographicScratch$1],getHeightRectangleScratch=new Rectangle,adjustHeightStartTopScratch=new Cartesian3,adjustHeightEndTopScratch=new Cartesian3,adjustHeightStartBottomScratch=new Cartesian3,adjustHeightEndBottomScratch=new Cartesian3,segmentStart2DScratch=new Cartesian3,segmentEnd2DScratch=new Cartesian3,segmentStartNormal2DScratch=new Cartesian3,segmentEndNormal2DScratch=new Cartesian3,offsetScratch$b=new Cartesian3,startUpScratch=new Cartesian3,endUpScratch=new Cartesian3,rightScratch=new Cartesian3,startPlaneNormalScratch=new Cartesian3,endPlaneNormalScratch=new Cartesian3,encodeScratch$1=new EncodedCartesian3,encodeScratch2D=new EncodedCartesian3,forwardOffset2DScratch=new Cartesian3,right2DScratch=new Cartesian3,normalNudgeScratch=new Cartesian3,scratchBoundingSpheres=[new BoundingSphere,new BoundingSphere],REFERENCE_INDICES=[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],REFERENCE_INDICES_LENGTH=REFERENCE_INDICES.length;function generateGeometryAttributes(e,t,i,r,n,a,o){var s,l,c,u,d=t._ellipsoid,h=i.length/3-1,p=8*h,m=4*p,f=36*h,g=new(65535<p?Uint32Array:Uint16Array)(f),_=new Float64Array(3*p),y=new Float32Array(m),C=new Float32Array(m),v=new Float32Array(m),S=new Float32Array(m),T=new Float32Array(m);o&&(s=new Float32Array(m),l=new Float32Array(m),c=new Float32Array(m),u=new Float32Array(2*p));var x=a.length/2,b=0,E=startCartographicScratch$1;E.height=0;var P=endCartographicScratch$1;P.height=0;var A=segmentStartTopScratch,w=segmentEndTopScratch;if(o)for(R=0,O=1;O<x;O++)E.latitude=a[R],E.longitude=a[R+1],P.latitude=a[R+2],P.longitude=a[R+3],A=t.project(E,A),w=t.project(P,w),b+=Cartesian3.distance(A,w),R+=2;for(var D,M=r.length/3,w=Cartesian3.unpack(r,0,w),I=0,R=3,O=1;O<M;O++)A=Cartesian3.clone(w,A),w=Cartesian3.unpack(r,R,w),I+=Cartesian3.distance(A,w),R+=3;var L=0,F=0,N=0,B=0,V=!(R=3),k=Cartesian3.unpack(i,0,segmentEndBottomScratch),z=Cartesian3.unpack(r,0,segmentEndTopScratch),$=Cartesian3.unpack(n,0,segmentEndNormalScratch);e&&breakMiter($,Cartesian3.unpack(i,i.length-6,segmentStartBottomScratch),k,z)&&($=Cartesian3.negate($,$));var U=0,G=0,H=0;for(O=0;O<h;O++){var W,q,j,Y,X=Cartesian3.clone(k,segmentStartBottomScratch),Q=Cartesian3.clone(z,segmentStartTopScratch),J=Cartesian3.clone($,segmentStartNormalScratch);V&&(J=Cartesian3.negate(J,J)),k=Cartesian3.unpack(i,R,segmentEndBottomScratch),z=Cartesian3.unpack(r,R,segmentEndTopScratch),V=breakMiter($=Cartesian3.unpack(n,R,segmentEndNormalScratch),X,k,z),E.latitude=a[L],E.longitude=a[L+1],P.latitude=a[L+2],P.longitude=a[L+3],o&&(Se=nudgeCartographic(E,P),j=t.project(E,segmentStart2DScratch),(he=direction(Y=t.project(P,segmentEnd2DScratch),j,forwardOffset2DScratch)).y=Math.abs(he.y),W=segmentStartNormal2DScratch,q=segmentEndNormal2DScratch,0===Se||Cartesian3.dot(he,Cartesian3.UNIT_Y)>MITER_BREAK_SMALL?(W=projectNormal(t,E,J,j,segmentStartNormal2DScratch),q=projectNormal(t,P,$,Y,segmentEndNormal2DScratch)):1===Se?(q=projectNormal(t,P,$,Y,segmentEndNormal2DScratch),W.x=0,W.y=CesiumMath.sign(E.longitude-Math.abs(P.longitude)),W.z=0):(W=projectNormal(t,E,J,j,segmentStartNormal2DScratch),q.x=0,q.y=CesiumMath.sign(E.longitude-P.longitude),q.z=0));var Z,K,ee,te=Cartesian3.distance(Q,z),ie=EncodedCartesian3.fromCartesian(X,encodeScratch$1),re=Cartesian3.subtract(k,X,offsetScratch$b),ne=Cartesian3.normalize(re,rightScratch),ae=Cartesian3.subtract(Q,X,startUpScratch),ae=Cartesian3.normalize(ae,ae),oe=Cartesian3.cross(ne,ae,rightScratch),oe=Cartesian3.normalize(oe,oe),se=Cartesian3.cross(ae,J,startPlaneNormalScratch),se=Cartesian3.normalize(se,se),le=Cartesian3.subtract(z,k,endUpScratch),le=Cartesian3.normalize(le,le),ce=Cartesian3.cross($,le,endPlaneNormalScratch),ce=Cartesian3.normalize(ce,ce),ue=te/I,de=U/I,he=0,pe=0,me=0;for(o&&(he=Cartesian3.distance(j,Y),Z=EncodedCartesian3.fromCartesian(j,encodeScratch2D),K=Cartesian3.subtract(Y,j,forwardOffset2DScratch),Te=(ee=Cartesian3.normalize(K,right2DScratch)).x,ee.x=ee.y,ee.y=-Te,pe=he/b,me=G/b),D=0;D<8;D++){var fe=B+4*D,ge=F+2*D,_e=fe+3,ye=D<4?1:-1,Ce=2===D||3===D||6===D||7===D?1:-1;Cartesian3.pack(ie.high,y,fe),y[_e]=re.x,Cartesian3.pack(ie.low,C,fe),C[_e]=re.y,Cartesian3.pack(se,v,fe),v[_e]=re.z,Cartesian3.pack(ce,S,fe),S[_e]=ue*ye,Cartesian3.pack(oe,T,fe);var ve=de*Ce;0===ve&&Ce<0&&(ve=9),T[_e]=ve,o&&(s[fe]=Z.high.x,s[fe+1]=Z.high.y,s[fe+2]=Z.low.x,s[fe+3]=Z.low.y,c[fe]=-W.y,c[fe+1]=W.x,c[fe+2]=q.y,c[fe+3]=-q.x,l[fe]=K.x,l[fe+1]=K.y,l[fe+2]=ee.x,l[fe+3]=ee.y,u[ge]=pe*ye,0===(ve=me*Ce)&&Ce<0&&(ve=9),u[ge+1]=ve)}var Se=adjustHeightStartBottomScratch,ne=adjustHeightEndBottomScratch,ae=adjustHeightStartTopScratch,J=adjustHeightEndTopScratch,le=Rectangle.fromCartographicArray(getHeightCartographics,getHeightRectangleScratch),Te=ApproximateTerrainHeights.getMinimumMaximumHeights(le,d),le=Te.minimumTerrainHeight,Te=Te.maximumTerrainHeight;H+=le,H+=Te,adjustHeights(X,Q,le,Te,Se,ae),adjustHeights(k,z,le,Te,ne,J);Te=Cartesian3.multiplyByScalar(oe,CesiumMath.EPSILON5,normalNudgeScratch);Cartesian3.add(Se,Te,Se),Cartesian3.add(ne,Te,ne),Cartesian3.add(ae,Te,ae),Cartesian3.add(J,Te,J),nudgeXZ(Se,ne),nudgeXZ(ae,J),Cartesian3.pack(Se,_,N),Cartesian3.pack(ne,_,N+3),Cartesian3.pack(J,_,N+6),Cartesian3.pack(ae,_,N+9),Te=Cartesian3.multiplyByScalar(oe,-2*CesiumMath.EPSILON5,normalNudgeScratch),Cartesian3.add(Se,Te,Se),Cartesian3.add(ne,Te,ne),Cartesian3.add(ae,Te,ae),Cartesian3.add(J,Te,J),nudgeXZ(Se,ne),nudgeXZ(ae,J),Cartesian3.pack(Se,_,N+12),Cartesian3.pack(ne,_,N+15),Cartesian3.pack(J,_,N+18),Cartesian3.pack(ae,_,N+21),L+=2,R+=3,F+=16,N+=24,B+=32,U+=te,G+=he}var xe=R=0;for(O=0;O<h;O++){for(D=0;D<REFERENCE_INDICES_LENGTH;D++)g[R+D]=REFERENCE_INDICES[D]+xe;xe+=8,R+=REFERENCE_INDICES_LENGTH}p=scratchBoundingSpheres;BoundingSphere.fromVertices(i,Cartesian3.ZERO,3,p[0]),BoundingSphere.fromVertices(r,Cartesian3.ZERO,3,p[1]);e=BoundingSphere.fromBoundingSpheres(p);e.radius+=H/(2*h);p={position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,normalize:!1,values:_}),startHiAndForwardOffsetX:getVec4GeometryAttribute(y),startLoAndForwardOffsetY:getVec4GeometryAttribute(C),startNormalAndForwardOffsetZ:getVec4GeometryAttribute(v),endNormalAndTextureCoordinateNormalizationX:getVec4GeometryAttribute(S),rightNormalAndTextureCoordinateNormalizationY:getVec4GeometryAttribute(T)};return o&&(p.startHiLo2D=getVec4GeometryAttribute(s),p.offsetAndRight2D=getVec4GeometryAttribute(l),p.startEndNormals2D=getVec4GeometryAttribute(c),p.texcoordNormalization2D=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,normalize:!1,values:u})),new Geometry({attributes:p,indices:g,boundingSphere:e})}function getVec4GeometryAttribute(e){return new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}function HeadingPitchRange(e,t,i){this.heading=defaultValue(e,0),this.pitch=defaultValue(t,0),this.range=defaultValue(i,0)}GroundPolylineGeometry._projectNormal=projectNormal,HeadingPitchRange.clone=function(e,t){if(defined(e))return(t=!defined(t)?new HeadingPitchRange:t).heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var factorial=CesiumMath.factorial;function calculateCoefficientTerm(e,t,i,r,n,a){var o,s,l,c=0;if(0<r){for(s=0;s<n;s++){for(o=!1,l=0;l<a.length&&!o;l++)s===a[l]&&(o=!0);o||(a.push(s),c+=calculateCoefficientTerm(e,t,i,r-1,n,a),a.splice(a.length-1,1))}return c}for(c=1,s=0;s<n;s++){for(o=!1,l=0;l<a.length&&!o;l++)s===a[l]&&(o=!0);o||(c*=e-i[t[s]])}return c}var HermitePolynomialApproximation={type:"Hermite",getRequiredDataPoints:function(e,t){return t=defaultValue(t,0),Math.max(Math.floor((e+1)/(t+1)),2)},interpolateOrderZero:function(e,t,i,r,n){var a,o;defined(n)||(n=new Array(r));for(var s=t.length,l=new Array(r),c=0;c<r;c++){n[c]=0;var u=new Array(s);for(l[c]=u,f=0;f<s;f++)u[f]=[]}var d=s,h=new Array(d);for(c=0;c<d;c++)h[c]=c;var p=s-1;for(v=0;v<r;v++){for(f=0;f<d;f++)o=h[f]*r+v,l[v][0].push(i[o]);for(c=1;c<d;c++){for(var m=!1,f=0;f<d-c;f++){var g,_=t[h[f]],y=t[h[f+c]];y-_<=0?(g=i[o=h[f]*r+r*c+v],l[v][c].push(g/factorial(c))):(g=l[v][c-1][f+1]-l[v][c-1][f],l[v][c].push(g/(y-_))),m=m||0!==g}m||(p=c-1)}}for(a=0;a<=0;a++)for(c=a;c<=p;c++)for(var C=calculateCoefficientTerm(e,h,t,a,c,[]),v=0;v<r;v++){var S=l[v][c][0];n[v+a*r]+=S*C}return n}},arrayScratch=[];function fillCoefficientList(e,t,i,r,n,a){for(var o,s=-1,l=t.length,c=l*(l+1)/2,u=0;u<n;u++){var d=Math.floor(u*c);for(g=0;g<l;g++)o=t[g]*n*(a+1)+u,e[d+g]=r[o];for(var h=1;h<l;h++){for(var p=0,m=Math.floor(h*(1-h)/2)+l*h,f=!1,g=0;g<l-h;g++){var _,y,C,v=i[t[g]],S=i[t[g+h]];S-v<=0?(C=(y=r[o=t[g]*n*(a+1)+n*h+u])/CesiumMath.factorial(h),e[d+m+p]=C):(y=e[d+(_=Math.floor((h-1)*(2-h)/2)+l*(h-1))+g+1]-e[d+_+g],e[d+m+p]=C=y/(S-v)),p++,f=f||0!==y}f&&(s=Math.max(s,h))}}return s}function IauOrientationParameters(e,t,i,r){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=r}HermitePolynomialApproximation.interpolate=function(e,t,i,r,n,a,o){var s=r*(a+1);defined(o)||(o=new Array(s));for(var l=0;l<s;l++)o[l]=0;for(var c=t.length,u=new Array(c*(n+1)),d=0;d<c;d++)for(var h=0;h<n+1;h++)u[d*(n+1)+h]=d;for(var p=u.length,m=arrayScratch,f=fillCoefficientList(m,u,t,i,r,n),g=[],_=p*(p+1)/2,y=Math.min(f,a),C=0;C<=y;C++)for(d=C;d<=f;d++){g.length=0;for(var v=calculateCoefficientTerm(e,u,t,C,d,g),S=Math.floor(d*(1-d)/2)+p*d,T=0;T<r;T++){var x=m[Math.floor(T*_)+S];o[T+C*r]+=x*v}}return o};var Iau2000Orientation={},TdtMinusTai$1=32.184,J2000d$1=2451545,c1=-.0529921,c2=-.1059842,c3=13.0120009,c4=13.3407154,c5=.9856003,c6=26.4057084,c7=13.064993,c8=.3287146,c9=1.7484877,c10=-.1589763,c11=.0036096,c12=.1643573,c13=12.9590088,dateTT=new JulianDate;function IauOrientationAxes(e){defined(e)&&"function"==typeof e||(e=Iau2000Orientation.ComputeMoon),this._computeFunction=e}Iau2000Orientation.ComputeMoon=function(e,t){defined(e)||(e=JulianDate.now()),dateTT=JulianDate.addSeconds(e,TdtMinusTai$1,dateTT);var i=JulianDate.totalDays(dateTT)-J2000d$1,r=i/TimeConstants$1.DAYS_PER_JULIAN_CENTURY,n=(125.045+c1*i)*CesiumMath.RADIANS_PER_DEGREE,a=(250.089+c2*i)*CesiumMath.RADIANS_PER_DEGREE,o=(260.008+c3*i)*CesiumMath.RADIANS_PER_DEGREE,s=(176.625+c4*i)*CesiumMath.RADIANS_PER_DEGREE,l=(357.529+c5*i)*CesiumMath.RADIANS_PER_DEGREE,c=(311.589+c6*i)*CesiumMath.RADIANS_PER_DEGREE,u=(134.963+c7*i)*CesiumMath.RADIANS_PER_DEGREE,d=(276.617+c8*i)*CesiumMath.RADIANS_PER_DEGREE,h=(34.226+c9*i)*CesiumMath.RADIANS_PER_DEGREE,p=(15.134+c10*i)*CesiumMath.RADIANS_PER_DEGREE,m=(119.743+c11*i)*CesiumMath.RADIANS_PER_DEGREE,f=(239.961+c12*i)*CesiumMath.RADIANS_PER_DEGREE,g=(25.053+c13*i)*CesiumMath.RADIANS_PER_DEGREE,_=Math.sin(n),y=Math.sin(a),C=Math.sin(o),v=Math.sin(s),S=Math.sin(l),T=Math.sin(c),x=Math.sin(u),b=Math.sin(d),E=Math.sin(h),P=Math.sin(p),A=Math.sin(m),w=Math.sin(f),D=Math.sin(g),e=Math.cos(n),n=Math.cos(a),a=Math.cos(o),o=Math.cos(s),s=Math.cos(l),l=Math.cos(c),c=Math.cos(u),u=Math.cos(d),d=Math.cos(h),h=Math.cos(p),p=Math.cos(m),m=Math.cos(f),f=Math.cos(g),g=(269.9949+.0031*r-3.8787*_-.1204*y+.07*C-.0172*v+.0072*T-.0052*P+.0043*D)*CesiumMath.RADIANS_PER_DEGREE,r=(66.5392+.013*r+1.5419*e+.0239*n-.0278*a+.0068*o-.0029*l+9e-4*c+8e-4*h-9e-4*f)*CesiumMath.RADIANS_PER_DEGREE,D=(38.3213+13.17635815*i-14e-13*i*i+3.561*_+.1208*y-.0642*C+.0158*v+.0252*S-.0066*T-.0047*x-.0046*b+.0028*E+.0052*P+.004*A+.0019*w-.0044*D)*CesiumMath.RADIANS_PER_DEGREE,f=(13.17635815-2*i*14e-13+3.561*e*c1+.1208*n*c2-.0642*a*c3+.0158*o*c4+.0252*s*c5-.0066*l*c6-.0047*c*c7-.0046*u*c8+.0028*d*c9+.0052*h*c10+.004*p*c11+.0019*m*c12-.0044*f*c13)/86400*CesiumMath.RADIANS_PER_DEGREE;return(t=!defined(t)?new IauOrientationParameters:t).rightAscension=g,t.declination=r,t.rotation=D,t.rotationRate=f,t};var xAxisScratch=new Cartesian3,yAxisScratch=new Cartesian3,zAxisScratch=new Cartesian3;function computeRotationMatrix(e,t,i){var r=xAxisScratch;r.x=Math.cos(e+CesiumMath.PI_OVER_TWO),r.y=Math.sin(e+CesiumMath.PI_OVER_TWO),r.z=0;var n=Math.cos(t),a=zAxisScratch;a.x=n*Math.cos(e),a.y=n*Math.sin(e),a.z=Math.sin(t);t=Cartesian3.cross(a,r,yAxisScratch);return(i=!defined(i)?new Matrix3:i)[0]=r.x,i[1]=t.x,i[2]=a.x,i[3]=r.y,i[4]=t.y,i[5]=a.y,i[6]=r.z,i[7]=t.z,i[8]=a.z,i}var rotMtxScratch=new Matrix3,quatScratch=new Quaternion;IauOrientationAxes.prototype.evaluate=function(e,t){defined(e)||(e=JulianDate.now());e=this._computeFunction(e),t=computeRotationMatrix(e.rightAscension,e.declination,t),e=CesiumMath.zeroToTwoPi(e.rotation),e=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,e,quatScratch),e=Matrix3.fromQuaternion(Quaternion.conjugate(e,e),rotMtxScratch);return Matrix3.multiply(e,t,t)};var InterpolationAlgorithm={};function PeliasGeocoderService(e){this._url=Resource.createIfNeeded(e),this._url.appendForwardSlash()}function IonGeocoderService(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.accessToken,Ion.defaultAccessToken),i=Resource.createIfNeeded(defaultValue(e.server,Ion.defaultServer));i.appendForwardSlash();var r=Ion.getDefaultTokenCredit(t);defined(r)&&e.scene.frameState.creditDisplay.addDefaultCredit(Credit.clone(r));r=i.getDerivedResource({url:"v1/geocode"});defined(t)&&r.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=i,this._pelias=new PeliasGeocoderService(r)}function TimeInterval(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.start=defined(e.start)?JulianDate.clone(e.start):new JulianDate,this.stop=defined(e.stop)?JulianDate.clone(e.stop):new JulianDate,this.data=e.data,this.isStartIncluded=defaultValue(e.isStartIncluded,!0),this.isStopIncluded=defaultValue(e.isStopIncluded,!0)}InterpolationAlgorithm.type=void 0,InterpolationAlgorithm.getRequiredDataPoints=DeveloperError.throwInstantiationError,InterpolationAlgorithm.interpolateOrderZero=DeveloperError.throwInstantiationError,InterpolationAlgorithm.interpolate=DeveloperError.throwInstantiationError,Object.defineProperties(PeliasGeocoderService.prototype,{url:{get:function(){return this._url}}}),PeliasGeocoderService.prototype.geocode=function(e,t){return this._url.getDerivedResource({url:t===GeocodeType$1.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(e){return e.features.map(function(e){var t,i=e.bbox;return t=defined(i)?Rectangle.fromDegrees(i[0],i[1],i[2],i[3]):(i=e.geometry.coordinates[0],t=e.geometry.coordinates[1],Cartesian3.fromDegrees(i,t)),{displayName:e.properties.label,destination:t}})})},IonGeocoderService.prototype.geocode=function(e,t){return this._pelias.geocode(e,t)},Object.defineProperties(TimeInterval.prototype,{isEmpty:{get:function(){var e=JulianDate.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var scratchInterval={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};TimeInterval.fromIso8601=function(e,t){var i=e.iso8601.split("/");if(2!==i.length)throw new DeveloperError("options.iso8601 is an invalid ISO 8601 interval.");var r=JulianDate.fromIso8601(i[0]),n=JulianDate.fromIso8601(i[1]),a=defaultValue(e.isStartIncluded,!0),i=defaultValue(e.isStopIncluded,!0),e=e.data;return defined(t)?(t.start=r,t.stop=n,t.isStartIncluded=a,t.isStopIncluded=i,t.data=e,t):(scratchInterval.start=r,scratchInterval.stop=n,scratchInterval.isStartIncluded=a,scratchInterval.isStopIncluded=i,scratchInterval.data=e,new TimeInterval(scratchInterval))},TimeInterval.toIso8601=function(e,t){return JulianDate.toIso8601(e.start,t)+"/"+JulianDate.toIso8601(e.stop,t)},TimeInterval.clone=function(e,t){if(defined(e))return defined(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new TimeInterval(e)},TimeInterval.equals=function(e,t,i){return e===t||defined(e)&&defined(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&JulianDate.equals(e.start,t.start)&&JulianDate.equals(e.stop,t.stop)&&(e.data===t.data||defined(i)&&i(e.data,t.data)))},TimeInterval.equalsEpsilon=function(e,t,i,r){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&JulianDate.equalsEpsilon(e.start,t.start,i)&&JulianDate.equalsEpsilon(e.stop,t.stop,i)&&(e.data===t.data||defined(r)&&r(e.data,t.data)))},TimeInterval.intersect=function(e,t,i,r){if(!defined(t))return TimeInterval.clone(TimeInterval.EMPTY,i);var n=e.start,a=e.stop,o=t.start,s=t.stop,l=JulianDate.greaterThanOrEquals(o,n)&&JulianDate.greaterThanOrEquals(a,o),c=!l&&JulianDate.lessThanOrEquals(o,n)&&JulianDate.lessThanOrEquals(n,s);if(!l&&!c)return TimeInterval.clone(TimeInterval.EMPTY,i);var u=e.isStartIncluded,d=e.isStopIncluded,h=t.isStartIncluded,p=t.isStopIncluded,m=JulianDate.lessThan(a,s);return(i=!defined(i)?new TimeInterval:i).start=l?o:n,i.isStartIncluded=u&&h||!JulianDate.equals(o,n)&&(l&&h||c&&u),i.stop=m?a:s,i.isStopIncluded=m?d:d&&p||!JulianDate.equals(s,a)&&p,i.data=defined(r)?r(e.data,t.data):e.data,i},TimeInterval.contains=function(e,t){if(e.isEmpty)return!1;var i=JulianDate.compare(e.start,t);if(0===i)return e.isStartIncluded;t=JulianDate.compare(t,e.stop);return 0===t?e.isStopIncluded:i<0&&t<0},TimeInterval.prototype.clone=function(e){return TimeInterval.clone(this,e)},TimeInterval.prototype.equals=function(e,t){return TimeInterval.equals(this,e,t)},TimeInterval.prototype.equalsEpsilon=function(e,t,i){return TimeInterval.equalsEpsilon(this,e,t,i)},TimeInterval.prototype.toString=function(){return TimeInterval.toIso8601(this)},TimeInterval.EMPTY=Object.freeze(new TimeInterval({start:new JulianDate,stop:new JulianDate,isStartIncluded:!1,isStopIncluded:!1}));var MINIMUM_VALUE=Object.freeze(JulianDate.fromIso8601("0000-01-01T00:00:00Z")),MAXIMUM_VALUE=Object.freeze(JulianDate.fromIso8601("9999-12-31T24:00:00Z")),MAXIMUM_INTERVAL=Object.freeze(new TimeInterval({start:MINIMUM_VALUE,stop:MAXIMUM_VALUE})),Iso8601={MINIMUM_VALUE:MINIMUM_VALUE,MAXIMUM_VALUE:MAXIMUM_VALUE,MAXIMUM_INTERVAL:MAXIMUM_INTERVAL},KeyboardEventModifier={SHIFT:0,CTRL:1,ALT:2},KeyboardEventModifier$1=Object.freeze(KeyboardEventModifier),LagrangePolynomialApproximation={type:"Lagrange",getRequiredDataPoints:function(e){return Math.max(e+1,2)},interpolateOrderZero:function(e,t,i,r,n){defined(n)||(n=new Array(r));for(var a=t.length,o=0;o<r;o++)n[o]=0;for(o=0;o<a;o++){for(var s,l=1,c=0;c<a;c++)c!==o&&(s=t[o]-t[c],l*=(e-t[c])/s);for(c=0;c<r;c++)n[c]+=l*i[o*r+c]}return n}},LinearApproximation={type:"Linear",getRequiredDataPoints:function(e){return 2},interpolateOrderZero:function(e,t,i,r,n){var a,o;defined(n)||(n=new Array(r));for(var s=t[0],l=t[1],c=0;c<r;c++)a=i[c],o=i[c+r],n[c]=((o-a)*e+l*a-s*o)/(l-s);return n}},transcodeTaskProcessor=new TaskProcessor("transcodeCRNToDXT");function loadCRN(e){if(defined(e=e instanceof ArrayBuffer||ArrayBuffer.isView(e)?when.resolve(e):Resource.createIfNeeded(e).fetchArrayBuffer()))return e.then(function(e){if(defined(e)){var t=[];return e instanceof ArrayBuffer?t.push(e):(0===e.byteOffset&&e.byteLength===e.buffer.byteLength||(e=e.slice(0,e.length)),t.push(e.buffer)),transcodeTaskProcessor.scheduleTask(e,t)}}).then(function(e){return CompressedTextureBuffer.clone(e)})}function loadImageFromTypedArray(e){var t,i=e.uint8Array,r=e.format,n=e.request,a=defaultValue(e.flipY,!1),o=new Blob([i],{type:r});return Resource.supportsImageBitmapOptions().then(function(e){return e?when(Resource.createImageBitmapFromBlob(o,{flipY:a,premultiplyAlpha:!1})):new Resource({url:t=window.URL.createObjectURL(o),request:n}).fetchImage({flipY:a})}).then(function(e){return defined(t)&&window.URL.revokeObjectURL(t),e}).otherwise(function(e){return defined(t)&&window.URL.revokeObjectURL(t),when.reject(e)})}var PixelDatatype={UNSIGNED_BYTE:WebGLConstants$1.UNSIGNED_BYTE,UNSIGNED_SHORT:WebGLConstants$1.UNSIGNED_SHORT,UNSIGNED_INT:WebGLConstants$1.UNSIGNED_INT,FLOAT:WebGLConstants$1.FLOAT,HALF_FLOAT:WebGLConstants$1.HALF_FLOAT_OES,UNSIGNED_INT_24_8:WebGLConstants$1.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:WebGLConstants$1.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:WebGLConstants$1.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:WebGLConstants$1.UNSIGNED_SHORT_5_6_5,toWebGLConstant:function(e,t){switch(e){case PixelDatatype.UNSIGNED_BYTE:return WebGLConstants$1.UNSIGNED_BYTE;case PixelDatatype.UNSIGNED_SHORT:return WebGLConstants$1.UNSIGNED_SHORT;case PixelDatatype.UNSIGNED_INT:return WebGLConstants$1.UNSIGNED_INT;case PixelDatatype.FLOAT:return WebGLConstants$1.FLOAT;case PixelDatatype.HALF_FLOAT:return t.webgl2?WebGLConstants$1.HALF_FLOAT:WebGLConstants$1.HALF_FLOAT_OES;case PixelDatatype.UNSIGNED_INT_24_8:return WebGLConstants$1.UNSIGNED_INT_24_8;case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:return WebGLConstants$1.UNSIGNED_SHORT_4_4_4_4;case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:return WebGLConstants$1.UNSIGNED_SHORT_5_5_5_1;case PixelDatatype.UNSIGNED_SHORT_5_6_5:return PixelDatatype.UNSIGNED_SHORT_5_6_5}},isPacked:function(e){return e===PixelDatatype.UNSIGNED_INT_24_8||e===PixelDatatype.UNSIGNED_SHORT_4_4_4_4||e===PixelDatatype.UNSIGNED_SHORT_5_5_5_1||e===PixelDatatype.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case PixelDatatype.UNSIGNED_BYTE:return 1;case PixelDatatype.UNSIGNED_SHORT:case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:case PixelDatatype.UNSIGNED_SHORT_5_6_5:case PixelDatatype.HALF_FLOAT:return 2;case PixelDatatype.UNSIGNED_INT:case PixelDatatype.FLOAT:case PixelDatatype.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===PixelDatatype.UNSIGNED_BYTE||e===PixelDatatype.UNSIGNED_SHORT||e===PixelDatatype.UNSIGNED_INT||e===PixelDatatype.FLOAT||e===PixelDatatype.HALF_FLOAT||e===PixelDatatype.UNSIGNED_INT_24_8||e===PixelDatatype.UNSIGNED_SHORT_4_4_4_4||e===PixelDatatype.UNSIGNED_SHORT_5_5_5_1||e===PixelDatatype.UNSIGNED_SHORT_5_6_5}},PixelDatatype$1=Object.freeze(PixelDatatype),PixelFormat={DEPTH_COMPONENT:WebGLConstants$1.DEPTH_COMPONENT,DEPTH_STENCIL:WebGLConstants$1.DEPTH_STENCIL,ALPHA:WebGLConstants$1.ALPHA,RGB:WebGLConstants$1.RGB,RGBA:WebGLConstants$1.RGBA,LUMINANCE:WebGLConstants$1.LUMINANCE,LUMINANCE_ALPHA:WebGLConstants$1.LUMINANCE_ALPHA,RGB_DXT1:WebGLConstants$1.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:WebGLConstants$1.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:WebGLConstants$1.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:WebGLConstants$1.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:WebGLConstants$1.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:WebGLConstants$1.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:WebGLConstants$1.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:WebGLConstants$1.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:WebGLConstants$1.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case PixelFormat.RGB:return 3;case PixelFormat.RGBA:return 4;case PixelFormat.LUMINANCE_ALPHA:return 2;case PixelFormat.ALPHA:case PixelFormat.LUMINANCE:default:return 1}},validate:function(e){return e===PixelFormat.DEPTH_COMPONENT||e===PixelFormat.DEPTH_STENCIL||e===PixelFormat.ALPHA||e===PixelFormat.RGB||e===PixelFormat.RGBA||e===PixelFormat.LUMINANCE||e===PixelFormat.LUMINANCE_ALPHA||e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5||e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1||e===PixelFormat.RGB_ETC1},isColorFormat:function(e){return e===PixelFormat.ALPHA||e===PixelFormat.RGB||e===PixelFormat.RGBA||e===PixelFormat.LUMINANCE||e===PixelFormat.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===PixelFormat.DEPTH_COMPONENT||e===PixelFormat.DEPTH_STENCIL},isCompressedFormat:function(e){return e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5||e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1||e===PixelFormat.RGB_ETC1},isDXTFormat:function(e){return e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5},isPVRTCFormat:function(e){return e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===PixelFormat.RGB_ETC1},compressedTextureSizeInBytes:function(e,t,i){switch(e){case PixelFormat.RGB_DXT1:case PixelFormat.RGBA_DXT1:case PixelFormat.RGB_ETC1:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*8;case PixelFormat.RGBA_DXT3:case PixelFormat.RGBA_DXT5:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*16;case PixelFormat.RGB_PVRTC_4BPPV1:case PixelFormat.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(i,8)*4+7)/8);case PixelFormat.RGB_PVRTC_2BPPV1:case PixelFormat.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(i,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(e,t,i,r){e=PixelFormat.componentsLength(e);return(e=PixelDatatype$1.isPacked(t)?1:e)*PixelDatatype$1.sizeInBytes(t)*i*r},alignmentInBytes:function(e,t,i){i=PixelFormat.textureSizeInBytes(e,t,i,1)%4;return 0==i?4:2==i?2:1},createTypedArray:function(e,t,i,r){var n=PixelDatatype$1.sizeInBytes(t),t=n===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:n===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:n===Float32Array.BYTES_PER_ELEMENT&&t===PixelDatatype$1.FLOAT?Float32Array:Uint32Array;return new t(PixelFormat.componentsLength(e)*i*r)},flipY:function(e,t,i,r,n){if(1===n)return e;for(var a=PixelFormat.createTypedArray(t,i,r,n),o=PixelFormat.componentsLength(t),s=r*o,l=0;l<n;++l)for(var c=l*r*o,u=(n-l-1)*r*o,d=0;d<s;++d)a[u+d]=e[c+d];return a},toInternalFormat:function(e,t,i){if(!i.webgl2)return e;if(e===PixelFormat.DEPTH_STENCIL)return WebGLConstants$1.DEPTH24_STENCIL8;if(e===PixelFormat.DEPTH_COMPONENT){if(t===PixelDatatype$1.UNSIGNED_SHORT)return WebGLConstants$1.DEPTH_COMPONENT16;if(t===PixelDatatype$1.UNSIGNED_INT)return WebGLConstants$1.DEPTH_COMPONENT24}if(t===PixelDatatype$1.FLOAT)switch(e){case PixelFormat.RGBA:return WebGLConstants$1.RGBA32F;case PixelFormat.RGB:return WebGLConstants$1.RGB32F;case PixelFormat.RG:return WebGLConstants$1.RG32F;case PixelFormat.R:return WebGLConstants$1.R32F}if(t===PixelDatatype$1.HALF_FLOAT)switch(e){case PixelFormat.RGBA:return WebGLConstants$1.RGBA16F;case PixelFormat.RGB:return WebGLConstants$1.RGB16F;case PixelFormat.RG:return WebGLConstants$1.RG16F;case PixelFormat.R:return WebGLConstants$1.R16F}return e}},PixelFormat$1=Object.freeze(PixelFormat);function loadKTX(e){if(defined(e=e instanceof ArrayBuffer||ArrayBuffer.isView(e)?when.resolve(e):Resource.createIfNeeded(e).fetchArrayBuffer()))return e.then(function(e){if(defined(e))return parseKTX(e)})}var fileIdentifier=[171,75,84,88,32,49,49,187,13,10,26,10],endiannessTest=67305985,faceOrder=["positiveX","negativeX","positiveY","negativeY","positiveZ","negativeZ"],sizeOfUint32$7=4;function parseKTX(e){for(var t,i=new Uint8Array(e),r=!0,n=0;n<fileIdentifier.length;++n)if(fileIdentifier[n]!==i[n]){r=!1;break}if(!r)throw new RuntimeError("Invalid KTX file.");var a=defined(e.buffer)?(t=new DataView(e.buffer),e.byteOffset):(t=new DataView(e),0),o=t.getUint32(a+=12,!0);if(a+=sizeOfUint32$7,o!==endiannessTest)throw new RuntimeError("File is the wrong endianness.");var s=t.getUint32(a,!0),l=t.getUint32(a+=sizeOfUint32$7,!0),c=t.getUint32(a+=sizeOfUint32$7,!0),u=t.getUint32(a+=sizeOfUint32$7,!0),d=t.getUint32(a+=sizeOfUint32$7,!0),h=t.getUint32(a+=sizeOfUint32$7,!0),p=t.getUint32(a+=sizeOfUint32$7,!0),m=t.getUint32(a+=sizeOfUint32$7,!0),f=t.getUint32(a+=sizeOfUint32$7,!0),g=t.getUint32(a+=sizeOfUint32$7,!0),_=t.getUint32(a+=sizeOfUint32$7,!0),o=t.getUint32(a+=sizeOfUint32$7,!0);a+=sizeOfUint32$7;var y,o=t.getUint32(a+=o,!0);if(a+=sizeOfUint32$7,y=defined(e.buffer)?new Uint8Array(e.buffer,a,o):new Uint8Array(e,a,o),u===WebGLConstants$1.RGB8?u=PixelFormat$1.RGB:u===WebGLConstants$1.RGBA8&&(u=PixelFormat$1.RGBA),!PixelFormat$1.validate(u))throw new RuntimeError("glInternalFormat is not a valid format.");if(PixelFormat$1.isCompressedFormat(u)){if(0!==s)throw new RuntimeError("glType must be zero when the texture is compressed.");if(1!==l)throw new RuntimeError("The type size for compressed textures must be 1.");if(0!==c)throw new RuntimeError("glFormat must be zero when the texture is compressed.")}else{if(s!==WebGLConstants$1.UNSIGNED_BYTE)throw new RuntimeError("Only unsigned byte buffers are supported.");if(d!==c)throw new RuntimeError("The base internal format must be the same as the format for uncompressed textures.")}if(0!==m)throw new RuntimeError("3D textures are unsupported.");if(0!==f)throw new RuntimeError("Texture arrays are unsupported.");var C=y.byteOffset,v=new Array(_);for(n=0;n<_;++n){for(var S=v[n]={},T=0;T<g;++T){var x=h>>n,b=p>>n,E=PixelFormat$1.isCompressedFormat(u)?PixelFormat$1.compressedTextureSizeInBytes(u,x,b):PixelFormat$1.textureSizeInBytes(u,s,x,b),P=new Uint8Array(y.buffer,C,E);S[faceOrder[T]]=new CompressedTextureBuffer(u,x,b,P),C+=E}C+=3-(C+3)%4+4}var A=v;if(1===g)for(n=0;n<_;++n)A[n]=A[n][faceOrder[0]];return A=1===_?A[0]:A}function ManagedArray(e){e=defaultValue(e,0),this._array=new Array(e),this._length=e}function MapProjection(){DeveloperError.throwInstantiationError()}Object.defineProperties(ManagedArray.prototype,{length:{get:function(){return this._length},set:function(e){var t=this._array,i=this._length;if(e<i)for(var r=e;r<i;++r)t[r]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}}),ManagedArray.prototype.get=function(e){return this._array[e]},ManagedArray.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t},ManagedArray.prototype.peek=function(){return this._array[this._length-1]},ManagedArray.prototype.push=function(e){var t=this.length++;this._array[t]=e},ManagedArray.prototype.pop=function(){if(0!==this._length){var e=this._array[this._length-1];return--this.length,e}},ManagedArray.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)},ManagedArray.prototype.resize=function(e){this.length=e},ManagedArray.prototype.trim=function(e){e=defaultValue(e,this._length),this._array.length=e},Object.defineProperties(MapProjection.prototype,{ellipsoid:{get:DeveloperError.throwInstantiationError}}),MapProjection.prototype.project=DeveloperError.throwInstantiationError,MapProjection.prototype.unproject=DeveloperError.throwInstantiationError;var leftScratchArray=[],rightScratchArray=[];function merge(e,t,i,r,n,a){for(var o=n-r+1,s=a-n,l=leftScratchArray,c=rightScratchArray,u=0;u<o;++u)l[u]=e[r+u];for(d=0;d<s;++d)c[d]=e[n+d+1];for(var d=u=0,h=r;h<=a;++h){var p=l[u],m=c[d];u<o&&(s<=d||t(p,m,i)<=0)?(e[h]=p,++u):d<s&&(e[h]=m,++d)}}function sort$1(e,t,i,r,n){var a;n<=r||(sort$1(e,t,i,r,a=Math.floor(.5*(r+n))),sort$1(e,t,i,a+1,n),merge(e,t,i,r,a,n))}function mergeSort(e,t,i){var r=e.length,n=Math.ceil(.5*r);leftScratchArray.length=n,rightScratchArray.length=n,sort$1(e,t,i,0,r-1),leftScratchArray.length=0,rightScratchArray.length=0}function NearFarScalar(e,t,i,r){this.near=defaultValue(e,0),this.nearValue=defaultValue(t,0),this.far=defaultValue(i,1),this.farValue=defaultValue(r,0)}NearFarScalar.clone=function(e,t){if(defined(e))return defined(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new NearFarScalar(e.near,e.nearValue,e.far,e.farValue)},NearFarScalar.packedLength=4,NearFarScalar.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.near,t[i++]=e.nearValue,t[i++]=e.far,t[i]=e.farValue,t},NearFarScalar.unpack=function(e,t,i){return t=defaultValue(t,0),(i=!defined(i)?new NearFarScalar:i).near=e[t++],i.nearValue=e[t++],i.far=e[t++],i.farValue=e[t],i},NearFarScalar.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},NearFarScalar.prototype.clone=function(e){return NearFarScalar.clone(this,e)},NearFarScalar.prototype.equals=function(e){return NearFarScalar.equals(this,e)};var Visibility={NONE:-1,PARTIAL:0,FULL:1},Visibility$1=Object.freeze(Visibility);function Occluder(e,t){this._occluderPosition=Cartesian3.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 scratchCartesian3$6=new Cartesian3;Object.defineProperties(Occluder.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=Cartesian3.clone(e,this._cameraPosition);var t,i,r,n=Cartesian3.subtract(this._occluderPosition,e,scratchCartesian3$6),a=Cartesian3.magnitudeSquared(n),o=this._occluderRadius*this._occluderRadius;o<a?(t=Math.sqrt(a-o),a=1/Math.sqrt(a),i=Cartesian3.multiplyByScalar(n,a,scratchCartesian3$6),r=Cartesian3.add(e,Cartesian3.multiplyByScalar(i,t*t*a,scratchCartesian3$6),scratchCartesian3$6)):t=Number.MAX_VALUE,this._horizonDistance=t,this._horizonPlaneNormal=i,this._horizonPlanePosition=r,this._cameraPosition=e}}}),Occluder.fromBoundingSphere=function(e,t,i){return defined(i)?(Cartesian3.clone(e.center,i._occluderPosition),i._occluderRadius=e.radius,i.cameraPosition=t,i):new Occluder(e,t)};var tempVecScratch=new Cartesian3;Occluder.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var t=Cartesian3.subtract(e,this._occluderPosition,tempVecScratch),i=this._occluderRadius;if(0<(i=Cartesian3.magnitudeSquared(t)-i*i))return i=Math.sqrt(i)+this._horizonDistance,t=Cartesian3.subtract(e,this._cameraPosition,t),i*i>Cartesian3.magnitudeSquared(t)}return!1};var occludeePositionScratch=new Cartesian3;Occluder.prototype.isBoundingSphereVisible=function(e){var t=Cartesian3.clone(e.center,occludeePositionScratch),i=e.radius;if(this._horizonDistance===Number.MAX_VALUE)return!1;var r=Cartesian3.subtract(t,this._occluderPosition,tempVecScratch),e=this._occluderRadius-i,e=Cartesian3.magnitudeSquared(r)-e*e;if(i<this._occluderRadius)return 0<e&&(e=Math.sqrt(e)+this._horizonDistance,r=Cartesian3.subtract(t,this._cameraPosition,r),e*e+i*i>Cartesian3.magnitudeSquared(r));if(0<e){r=Cartesian3.subtract(t,this._cameraPosition,r),t=Cartesian3.magnitudeSquared(r),r=this._occluderRadius*this._occluderRadius,i=i*i;return(this._horizonDistance*this._horizonDistance+r)*i>t*r?!0:t<(e=Math.sqrt(e)+this._horizonDistance)*e+i}return!0};var tempScratch=new Cartesian3;Occluder.prototype.computeVisibility=function(e){var t=Cartesian3.clone(e.center),i=e.radius;if(i>this._occluderRadius)return Visibility$1.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var r=Cartesian3.subtract(t,this._occluderPosition,tempScratch),n=this._occluderRadius-i,a=Cartesian3.magnitudeSquared(r);if(0<(n=a-n*n)){n=Math.sqrt(n)+this._horizonDistance,r=Cartesian3.subtract(t,this._cameraPosition,r),e=Cartesian3.magnitudeSquared(r);return n*n+i*i<e?Visibility$1.NONE:0<(n=a-(n=this._occluderRadius+i)*n)?e<(n=Math.sqrt(n)+this._horizonDistance)*n+i*i?Visibility$1.FULL:Visibility$1.PARTIAL:(r=Cartesian3.subtract(t,this._horizonPlanePosition,r),Cartesian3.dot(r,this._horizonPlaneNormal)>-i?Visibility$1.PARTIAL:Visibility$1.FULL)}}return Visibility$1.NONE};var occludeePointScratch=new Cartesian3;Occluder.computeOccludeePoint=function(e,t,i){var r=Cartesian3.clone(t),n=Cartesian3.clone(e.center),t=e.radius,a=i.length,o=Cartesian3.normalize(Cartesian3.subtract(r,n,occludeePointScratch),occludeePointScratch),s=-Cartesian3.dot(o,n),l=Occluder._anyRotationVector(n,o,s),c=Occluder._horizonToPlaneNormalDotProduct(e,o,s,l,i[0]);if(c){for(var u,d=1;d<a;++d){if(!(u=Occluder._horizonToPlaneNormalDotProduct(e,o,s,l,i[d])))return;u<c&&(c=u)}if(!(c<.0017453283658983088))return Cartesian3.add(n,Cartesian3.multiplyByScalar(o,t/c,occludeePointScratch),occludeePointScratch)}};var computeOccludeePointFromRectangleScratch=[];Occluder.computeOccludeePointFromRectangle=function(e,t){t=defaultValue(t,Ellipsoid.WGS84);var i=Rectangle.subsample(e,t,0,computeOccludeePointFromRectangleScratch),r=BoundingSphere.fromPoints(i),e=Cartesian3.ZERO;if(!Cartesian3.equals(e,r.center))return Occluder.computeOccludeePoint(new BoundingSphere(e,t.minimumRadius),r.center,i)};var tempVec0Scratch=new Cartesian3;Occluder._anyRotationVector=function(e,t,i){var r=Cartesian3.abs(t,tempVec0Scratch),n=r.x>r.y?0:1;(0===n&&r.z>r.x||1===n&&r.z>r.y)&&(n=2);var a=new Cartesian3,n=0===n?(r.x=e.x,r.y=e.y+1,r.z=e.z+1,Cartesian3.UNIT_X):1===n?(r.x=e.x+1,r.y=e.y,r.z=e.z+1,Cartesian3.UNIT_Y):(r.x=e.x+1,r.y=e.y+1,r.z=e.z,Cartesian3.UNIT_Z),t=(Cartesian3.dot(t,r)+i)/-Cartesian3.dot(t,n);return Cartesian3.normalize(Cartesian3.subtract(Cartesian3.add(r,Cartesian3.multiplyByScalar(n,t,a),r),e,r),r)};var posDirectionScratch=new Cartesian3;Occluder._rotationVector=function(e,t,i,r,n){e=Cartesian3.subtract(r,e,posDirectionScratch),e=Cartesian3.normalize(e,e);if(Cartesian3.dot(t,e)<.9999999847691291){e=Cartesian3.cross(t,e,e);if(Cartesian3.magnitude(e)>CesiumMath.EPSILON13)return Cartesian3.normalize(e,new Cartesian3)}return n};var posScratch1=new Cartesian3,occluerPosScratch=new Cartesian3,posScratch2=new Cartesian3,horizonPlanePosScratch=new Cartesian3;function OffsetGeometryInstanceAttribute(e,t,i){e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,0),this.value=new Float32Array([e,t,i])}function OpenCageGeocoderService(e,t,i){(e=Resource.createIfNeeded(e)).appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=defaultValue(i,{})}Occluder._horizonToPlaneNormalDotProduct=function(e,t,i,r,n){var a=Cartesian3.clone(n,posScratch1),o=Cartesian3.clone(e.center,occluerPosScratch),s=e.radius,l=Cartesian3.subtract(o,a,posScratch2),n=Cartesian3.magnitudeSquared(l),e=s*s;if(n<e)return!1;s=n-e,e=Math.sqrt(s),n=e*(1/Math.sqrt(n))*e,l=Cartesian3.normalize(l,l),e=Cartesian3.add(a,Cartesian3.multiplyByScalar(l,n,horizonPlanePosScratch),horizonPlanePosScratch),n=Math.sqrt(s-n*n),r=this._rotationVector(o,t,i,a,r),l=Cartesian3.fromElements(r.x*r.x*l.x+(r.x*r.y-r.z)*l.y+(r.x*r.z+r.y)*l.z,(r.x*r.y+r.z)*l.x+r.y*r.y*l.y+(r.y*r.z-r.x)*l.z,(r.x*r.z-r.y)*l.x+(r.y*r.z+r.x)*l.y+r.z*r.z*l.z,posScratch1),l=Cartesian3.normalize(l,l),l=Cartesian3.multiplyByScalar(l,n,posScratch1),r=Cartesian3.normalize(Cartesian3.subtract(Cartesian3.add(e,l,posScratch2),o,posScratch2),posScratch2),n=Cartesian3.dot(t,r);r=Cartesian3.normalize(Cartesian3.subtract(Cartesian3.subtract(e,l,r),o,r),r);r=Cartesian3.dot(t,r);return n<r?n:r},Object.defineProperties(OffsetGeometryInstanceAttribute.prototype,{componentDatatype:{get:function(){return ComponentDatatype$1.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),OffsetGeometryInstanceAttribute.fromCartesian3=function(e){return new OffsetGeometryInstanceAttribute(e.x,e.y,e.z)},OffsetGeometryInstanceAttribute.toValue=function(e,t){return(t=!defined(t)?new Float32Array([e.x,e.y,e.z]):t)[0]=e.x,t[1]=e.y,t[2]=e.z,t},Object.defineProperties(OpenCageGeocoderService.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}}}),OpenCageGeocoderService.prototype.geocode=function(e){return this._url.getDerivedResource({url:"json",queryParameters:combine$2(this._params,{q:e})}).fetchJson().then(function(e){return e.results.map(function(e){var t,i=e.bounds;return t=defined(i)?Rectangle.fromDegrees(i.southwest.lng,i.southwest.lat,i.northeast.lng,i.northeast.lat):(i=e.geometry.lat,t=e.geometry.lng,Cartesian3.fromDegrees(i,t)),{displayName:e.formatted,destination:t}})})};var Packable={packedLength:void 0,pack:DeveloperError.throwInstantiationError,unpack:DeveloperError.throwInstantiationError},PackableForInterpolation={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:DeveloperError.throwInstantiationError,unpackInterpolationResult:DeveloperError.throwInstantiationError},getCSSValue$1=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},measureText=function(e,t,i,r){var n=e.measureText(t),a=getCSSValue$1(e.canvas,"font-family"),o=getCSSValue$1(e.canvas,"font-size").replace("px",""),s=getCSSValue$1(e.canvas,"font-style"),l=getCSSValue$1(e.canvas,"font-weight"),c=!/\S/.test(t);n.fontsize=o;var u=document.createElement("div");u.style.position="absolute",u.style.opacity=0,u.style.font=s+" "+l+" "+o+"px "+a,u.innerHTML=t+"<br/>"+t,document.body.appendChild(u),n.leading=1.2*o;var d=getCSSValue$1(u,"height");if(2*o<=(d=d.replace("px",""))&&(n.leading=d/2|0),document.body.removeChild(u),c)n.ascent=0,n.descent=0,n.bounds={minx:0,maxx:n.width,miny:0,maxy:0},n.height=0;else{u=document.createElement("canvas");u.width=n.width+100,u.height=3*o,u.style.opacity=1,u.style.fontFamily=a,u.style.fontSize=o,u.style.fontStyle=s,u.style.fontWeight=l;c=u.getContext("2d");c.font=s+" "+l+" "+o+"px "+a;o=u.width,a=u.height,u=a/2;c.fillStyle="white",c.fillRect(-1,-1,o+2,a+2),i&&(c.strokeStyle="black",c.lineWidth=e.lineWidth,c.strokeText(t,50,u)),r&&(c.fillStyle="black",c.fillText(t,50,u));for(var h=c.getImageData(0,0,o,a).data,p=0,m=4*o,f=h.length;++p<f&&255===h[p];);for(t=p/m|0,p=f-1;0<--p&&255===h[p];);c=p/m|0;for(p=0;p<f&&255===h[p];)f<=(p+=m)&&(p=p-f+4);var a=p%m/4|0,g=1;for(p=f-3;0<=p&&255===h[p];)(p-=m)<0&&(p=f-3-4*g++);o=p%m/4+1|0;n.ascent=u-t,n.descent=c-u,n.bounds={minx:a-50,maxx:o-50,miny:0,maxy:c-t},n.height=c-t+1}return n},imageSmoothingEnabledName;function writeTextToCanvas(e,t){if(""!==e){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=defaultValue(t.font,"10px sans-serif"),r=defaultValue(t.stroke,!1),n=defaultValue(t.fill,!0),a=defaultValue(t.strokeWidth,1),o=defaultValue(t.backgroundColor,Color.TRANSPARENT),s=defaultValue(t.padding,0),l=2*s,c=document.createElement("canvas");c.width=1,c.height=1,c.style.font=i;var u=c.getContext("2d");defined(imageSmoothingEnabledName)||(defined(u.imageSmoothingEnabled)?imageSmoothingEnabledName="imageSmoothingEnabled":defined(u.mozImageSmoothingEnabled)?imageSmoothingEnabledName="mozImageSmoothingEnabled":defined(u.webkitImageSmoothingEnabled)?imageSmoothingEnabledName="webkitImageSmoothingEnabled":defined(u.msImageSmoothingEnabled)&&(imageSmoothingEnabledName="msImageSmoothingEnabled")),u.font=i,u.lineJoin="round",u.lineWidth=a,u[imageSmoothingEnabledName]=!1,u.textBaseline=defaultValue(t.textBaseline,"bottom"),c.style.visibility="hidden",document.body.appendChild(c);var d=measureText(u,e,r,n);c.dimensions=d,document.body.removeChild(c),c.style.visibility="";var h=-d.bounds.minx,p=Math.ceil(d.width)+h+l,m=d.height+l,l=m-(m-d.ascent+s)+l;return c.width=p,c.height=m,u.font=i,u.lineJoin="round",u.lineWidth=a,u[imageSmoothingEnabledName]=!1,o!==Color.TRANSPARENT&&(u.fillStyle=o.toCssColorString(),u.fillRect(0,0,c.width,c.height)),r&&(r=defaultValue(t.strokeColor,Color.BLACK),u.strokeStyle=r.toCssColorString(),u.strokeText(e,h+s,l)),n&&(t=defaultValue(t.fillColor,Color.WHITE),u.fillStyle=t.toCssColorString(),u.fillText(e,h+s,l)),c}}function PinBuilder(){this._cache={}}PinBuilder.prototype.fromColor=function(e,t){return createPin(void 0,void 0,e,t,this._cache)},PinBuilder.prototype.fromUrl=function(e,t,i){return createPin(e,void 0,t,i,this._cache)},PinBuilder.prototype.fromMakiIconId=function(e,t,i){return createPin(buildModuleUrl("Assets/Textures/maki/"+encodeURIComponent(e)+".png"),void 0,t,i,this._cache)},PinBuilder.prototype.fromText=function(e,t,i){return createPin(void 0,e,t,i,this._cache)};var colorScratch$7=new Color;function drawPin(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,colorScratch$7).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 drawIcon(e,t,i){var r=i/2.5,n=r,a=r;t.width>t.height?a=r*(t.height/t.width):t.width<t.height&&(n=r*(t.width/t.height));r=Math.round((i-n)/2),i=Math.round(7/24*i-a/2);e.globalCompositeOperation="destination-out",e.drawImage(t,r-1,i,n,a),e.drawImage(t,r,i-1,n,a),e.drawImage(t,r+1,i,n,a),e.drawImage(t,r,i+1,n,a),e.globalCompositeOperation="destination-over",e.fillStyle=Color.BLACK.toCssColorString(),e.fillRect(r-1,i-1,n+2,a+2),e.globalCompositeOperation="destination-out",e.drawImage(t,r,i,n,a),e.globalCompositeOperation="destination-over",e.fillStyle=Color.WHITE.toCssColorString(),e.fillRect(r-1,i-2,n+2,a+2)}var stringifyScratch=new Array(4);function createPin(e,t,i,r,n){stringifyScratch[0]=e,stringifyScratch[1]=t,stringifyScratch[2]=i,stringifyScratch[3]=r;var a=JSON.stringify(stringifyScratch),o=n[a];if(defined(o))return o;var s=document.createElement("canvas");s.width=r,s.height=r;var l=s.getContext("2d");if(drawPin(l,i,r),defined(e)){e=Resource.createIfNeeded(e).fetchImage().then(function(e){return drawIcon(l,e,r),n[a]=s});return n[a]=e}return defined(t)&&(t=writeTextToCanvas(t,{font:"bold "+r+"px sans-serif"}),drawIcon(l,t,r)),n[a]=s}function PlaneGeometry(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);e=defaultValue(e.vertexFormat,VertexFormat.DEFAULT);this._vertexFormat=e,this._workerName="createPlaneGeometry"}PlaneGeometry.packedLength=VertexFormat.packedLength,PlaneGeometry.pack=function(e,t,i){return i=defaultValue(i,0),VertexFormat.pack(e._vertexFormat,t,i),t};var scratchVertexFormat$5=new VertexFormat,scratchOptions$9={vertexFormat:scratchVertexFormat$5};PlaneGeometry.unpack=function(e,t,i){t=defaultValue(t,0);t=VertexFormat.unpack(e,t,scratchVertexFormat$5);return defined(i)?(i._vertexFormat=VertexFormat.clone(t,i._vertexFormat),i):new PlaneGeometry(scratchOptions$9)};var min$1=new Cartesian3(-.5,-.5,0),max$1=new Cartesian3(.5,.5,0);function PlaneOutlineGeometry(){this._workerName="createPlaneOutlineGeometry"}PlaneGeometry.createGeometry=function(e){var t,i,r=e._vertexFormat,n=new GeometryAttributes;return r.position&&((e=new Float64Array(12))[0]=min$1.x,e[1]=min$1.y,e[2]=0,e[3]=max$1.x,e[4]=min$1.y,e[5]=0,e[6]=max$1.x,e[7]=max$1.y,e[8]=0,e[9]=min$1.x,e[10]=max$1.y,e[11]=0,n.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:e}),r.normal&&((e=new Float32Array(12))[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,n.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:e})),r.st&&((t=new Float32Array(8))[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,n.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:t})),r.tangent&&((t=new Float32Array(12))[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,n.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:t})),r.bitangent&&((i=new Float32Array(12))[0]=0,i[1]=1,i[2]=0,i[3]=0,i[4]=1,i[5]=0,i[6]=0,i[7]=1,i[8]=0,i[9]=0,i[10]=1,i[11]=0,n.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:i})),(i=new Uint16Array(6))[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3),new Geometry({attributes:n,indices:i,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,Math.sqrt(2))})},PlaneOutlineGeometry.packedLength=0,PlaneOutlineGeometry.pack=function(e,t){return t},PlaneOutlineGeometry.unpack=function(e,t,i){return defined(i)?i:new PlaneOutlineGeometry};var min=new Cartesian3(-.5,-.5,0),max=new Cartesian3(.5,.5,0);PlaneOutlineGeometry.createGeometry=function(){var e=new GeometryAttributes,t=new Uint16Array(8),i=new Float64Array(12);return i[0]=min.x,i[1]=min.y,i[2]=min.z,i[3]=max.x,i[4]=min.y,i[5]=min.z,i[6]=max.x,i[7]=max.y,i[8]=min.z,i[9]=min.x,i[10]=max.y,i[11]=min.z,e.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:i}),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 Geometry({attributes:e,indices:t,primitiveType:PrimitiveType$1.LINES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,Math.sqrt(2))})};var coords=new Cartesian3;function pointInsideTriangle(e,t,i,r){return barycentricCoordinates(e,t,i,r,coords),0<coords.x&&0<coords.y&&0<coords.z}var scratchCarto1=new Cartographic,scratchCarto2=new Cartographic;function adjustPosHeightsForNormal(e,t,i,r){var n=r.cartesianToCartographic(e,scratchCarto1).height,e=r.cartesianToCartographic(t,scratchCarto2);e.height=n,r.cartographicToCartesian(e,t);t=r.cartesianToCartographic(i,scratchCarto2);t.height=n-100,r.cartographicToCartesian(t,i)}var scratchBoundingRectangle=new BoundingRectangle,scratchPosition$9=new Cartesian3,scratchNormal$2=new Cartesian3,scratchTangent$1=new Cartesian3,scratchBitangent$1=new Cartesian3,p1Scratch=new Cartesian3,p2Scratch=new Cartesian3,scratchPerPosNormal=new Cartesian3,scratchPerPosTangent=new Cartesian3,scratchPerPosBitangent=new Cartesian3,appendTextureCoordinatesOrigin=new Cartesian2,appendTextureCoordinatesCartesian2=new Cartesian2,appendTextureCoordinatesCartesian3=new Cartesian3,appendTextureCoordinatesQuaternion=new Quaternion,appendTextureCoordinatesMatrix3=new Matrix3,tangentMatrixScratch=new Matrix3;function computeAttributes$2(e){var t=e.vertexFormat,i=e.geometry,r=e.shadowVolume,n=i.attributes.position.values,a=n.length,o=e.wall,s=e.top||o,l=e.bottom||o;if(t.st||t.normal||t.tangent||t.bitangent||r){var c=e.boundingRectangle,u=e.tangentPlane,d=e.ellipsoid,h=e.stRotation,p=e.perPositionHeight,m=appendTextureCoordinatesOrigin;m.x=c.x,m.y=c.y;var f,g=t.st?new Float32Array(a/3*2):void 0;t.normal&&(f=p&&s&&!o?i.attributes.normal.values:new Float32Array(a));var _,y=t.tangent?new Float32Array(a):void 0,C=t.bitangent?new Float32Array(a):void 0,v=r?new Float32Array(a):void 0,S=0,T=0,x=scratchNormal$2,b=scratchTangent$1,E=scratchBitangent$1,P=!0,A=appendTextureCoordinatesMatrix3,w=tangentMatrixScratch;w=0!==h?(_=Quaternion.fromAxisAngle(u._plane.normal,h,appendTextureCoordinatesQuaternion),A=Matrix3.fromQuaternion(_,A),_=Quaternion.fromAxisAngle(u._plane.normal,-h,appendTextureCoordinatesQuaternion),Matrix3.fromQuaternion(_,w)):(A=Matrix3.clone(Matrix3.IDENTITY,A),Matrix3.clone(Matrix3.IDENTITY,w));var D=0,M=0;s&&l&&(D=a/2,M=a/3,a/=2);for(var I=0;I<a;I+=3){var R,O,L,F,N=Cartesian3.fromArray(n,I,appendTextureCoordinatesCartesian3);t.st&&(R=Matrix3.multiplyByVector(A,N,scratchPosition$9),R=d.scaleToGeodeticSurface(R,R),O=u.projectPointOntoPlane(R,appendTextureCoordinatesCartesian2),Cartesian2.subtract(O,m,O),L=CesiumMath.clamp(O.x/c.width,0,1),F=CesiumMath.clamp(O.y/c.height,0,1),l&&(g[S+M]=L,g[S+1+M]=F),s&&(g[S]=L,g[S+1]=F),S+=2),(t.normal||t.tangent||t.bitangent||r)&&(R=T+1,O=T+2,o?(I+3<a&&(L=Cartesian3.fromArray(n,I+3,p1Scratch),P&&(F=Cartesian3.fromArray(n,I+a,p2Scratch),p&&adjustPosHeightsForNormal(N,L,F,d),Cartesian3.subtract(L,N,L),Cartesian3.subtract(F,N,F),x=Cartesian3.normalize(Cartesian3.cross(F,L,x),x),P=!1),Cartesian3.equalsEpsilon(L,N,CesiumMath.EPSILON10)&&(P=!0)),(t.tangent||t.bitangent)&&(E=d.geodeticSurfaceNormal(N,E),t.tangent&&(b=Cartesian3.normalize(Cartesian3.cross(E,x,b),b)))):(x=d.geodeticSurfaceNormal(N,x),(t.tangent||t.bitangent)&&(p&&(scratchPerPosNormal=Cartesian3.fromArray(f,T,scratchPerPosNormal),scratchPerPosTangent=Cartesian3.cross(Cartesian3.UNIT_Z,scratchPerPosNormal,scratchPerPosTangent),scratchPerPosTangent=Cartesian3.normalize(Matrix3.multiplyByVector(w,scratchPerPosTangent,scratchPerPosTangent),scratchPerPosTangent),t.bitangent&&(scratchPerPosBitangent=Cartesian3.normalize(Cartesian3.cross(scratchPerPosNormal,scratchPerPosTangent,scratchPerPosBitangent),scratchPerPosBitangent))),b=Cartesian3.cross(Cartesian3.UNIT_Z,x,b),b=Cartesian3.normalize(Matrix3.multiplyByVector(w,b,b),b),t.bitangent&&(E=Cartesian3.normalize(Cartesian3.cross(x,b,E),E)))),t.normal&&(e.wall?(f[T+D]=x.x,f[R+D]=x.y,f[O+D]=x.z):l&&(f[T+D]=-x.x,f[R+D]=-x.y,f[O+D]=-x.z),(s&&!p||o)&&(f[T]=x.x,f[R]=x.y,f[O]=x.z)),r&&(o&&(x=d.geodeticSurfaceNormal(N,x)),v[T+D]=-x.x,v[R+D]=-x.y,v[O+D]=-x.z),t.tangent&&(e.wall?(y[T+D]=b.x,y[R+D]=b.y,y[O+D]=b.z):l&&(y[T+D]=-b.x,y[R+D]=-b.y,y[O+D]=-b.z),s&&(p?(y[T]=scratchPerPosTangent.x,y[R]=scratchPerPosTangent.y,y[O]=scratchPerPosTangent.z):(y[T]=b.x,y[R]=b.y,y[O]=b.z))),t.bitangent&&(l&&(C[T+D]=E.x,C[R+D]=E.y,C[O+D]=E.z),s&&(p?(C[T]=scratchPerPosBitangent.x,C[R]=scratchPerPosBitangent.y,C[O]=scratchPerPosBitangent.z):(C[T]=E.x,C[R]=E.y,C[O]=E.z))),T+=3)}t.st&&(i.attributes.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:g})),t.normal&&(i.attributes.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:f})),t.tangent&&(i.attributes.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:y})),t.bitangent&&(i.attributes.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:C})),r&&(i.attributes.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:v}))}return e.extrude&&defined(e.offsetAttribute)&&(h=n.length/3,_=new Uint8Array(h),e.offsetAttribute===GeometryOffsetAttribute$1.TOP?s&&l||o?_=arrayFill(_,1,0,h/2):s&&(_=arrayFill(_,1)):_=arrayFill(_,e.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),i.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})),i}var startCartographicScratch=new Cartographic,endCartographicScratch=new Cartographic,idlCross={westOverIDL:0,eastOverIDL:0},ellipsoidGeodesic=new EllipsoidGeodesic;function computeRectangle$1(e,t,i,r,n){if(n=defaultValue(n,new Rectangle),!defined(e)||e.length<3)return n.west=0,n.north=0,n.south=0,n.east=0,n;if(i===ArcType$1.RHUMB)return Rectangle.fromCartesianArray(e,t,n);ellipsoidGeodesic.ellipsoid.equals(t)||(ellipsoidGeodesic=new EllipsoidGeodesic(void 0,void 0,t)),n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,idlCross.westOverIDL=Number.POSITIVE_INFINITY,idlCross.eastOverIDL=Number.NEGATIVE_INFINITY;for(var a,o=1/CesiumMath.chordLength(r,t.maximumRadius),s=e.length,l=t.cartesianToCartographic(e[0],endCartographicScratch),c=startCartographicScratch,u=1;u<s;u++)a=c,c=l,l=t.cartesianToCartographic(e[u],a),ellipsoidGeodesic.setEndPoints(c,l),interpolateAndGrowRectangle(ellipsoidGeodesic,o,n,idlCross);return a=c,c=l,l=t.cartesianToCartographic(e[0],a),ellipsoidGeodesic.setEndPoints(c,l),interpolateAndGrowRectangle(ellipsoidGeodesic,o,n,idlCross),n.east-n.west>idlCross.eastOverIDL-idlCross.westOverIDL&&(n.west=idlCross.westOverIDL,n.east=idlCross.eastOverIDL,n.east>CesiumMath.PI&&(n.east=n.east-CesiumMath.TWO_PI),n.west>CesiumMath.PI&&(n.west=n.west-CesiumMath.TWO_PI)),n}var interpolatedCartographicScratch=new Cartographic;function interpolateAndGrowRectangle(e,t,i,r){for(var n=e.surfaceDistance,a=Math.ceil(n*t),o=0<a?n/(a-1):Number.POSITIVE_INFINITY,s=0,l=0;l<a;l++){var c=e.interpolateUsingSurfaceDistance(s,interpolatedCartographicScratch);s+=o;var u=c.longitude,c=c.latitude;i.west=Math.min(i.west,u),i.east=Math.max(i.east,u),i.south=Math.min(i.south,c),i.north=Math.max(i.north,c);u=0<=u?u:u+CesiumMath.TWO_PI;r.westOverIDL=Math.min(r.westOverIDL,u),r.eastOverIDL=Math.max(r.eastOverIDL,u)}}var createGeometryFromPositionsExtrudedPositions=[];function createGeometryFromPositionsExtruded$1(e,t,i,r,n,a,o,s,l){var c={walls:[]};if(a||o){var u=PolygonGeometryLibrary.createGeometryFromPositions(e,t,i,n,s,l),t=u.attributes.position.values,d=u.indices;if(a&&o){var h,a=t.concat(t),p=a.length/3;(h=IndexDatatype$1.createTypedArray(p,2*d.length)).set(d);for(var m=d.length,f=p/2,g=0;g<m;g+=3){var _=h[g]+f,y=h[g+1]+f,C=h[g+2]+f;h[g+m]=C,h[g+1+m]=y,h[g+2+m]=_}u.attributes.position.values=a,n&&s.normal&&(s=u.attributes.normal.values,u.attributes.normal.values=new Float32Array(a.length),u.attributes.normal.values.set(s)),u.indices=h}else if(o){for(p=t.length/3,h=IndexDatatype$1.createTypedArray(p,d.length),g=0;g<d.length;g+=3)h[g]=d[g+2],h[g+1]=d[g+1],h[g+2]=d[g];u.indices=h}c.topAndBottom=new GeometryInstance({geometry:u})}var u=r.outerRing,v=EllipsoidTangentPlane.fromPoints(u,e).projectPointsOntoPlane(u,createGeometryFromPositionsExtrudedPositions);PolygonPipeline.computeWindingOrder2D(v)===WindingOrder$1.CLOCKWISE&&(u=u.slice().reverse());var S=PolygonGeometryLibrary.computeWallGeometry(u,e,i,n,l);c.walls.push(new GeometryInstance({geometry:S}));var T=r.holes;for(g=0;g<T.length;g++){var x=T[g],v=EllipsoidTangentPlane.fromPoints(x,e).projectPointsOntoPlane(x,createGeometryFromPositionsExtrudedPositions);PolygonPipeline.computeWindingOrder2D(v)===WindingOrder$1.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),S=PolygonGeometryLibrary.computeWallGeometry(x,e,i,n,l),c.walls.push(new GeometryInstance({geometry:S}))}return c}function PolygonGeometry(e){var t,i=e.polygonHierarchy,r=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),n=defaultValue(e.ellipsoid,Ellipsoid.WGS84),a=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),o=defaultValue(e.stRotation,0),s=defaultValue(e.perPositionHeight,!1),l=s&&defined(e.extrudedHeight),c=defaultValue(e.height,0),u=defaultValue(e.extrudedHeight,c);l||(t=Math.max(c,u),u=Math.min(c,u),c=t),this._vertexFormat=VertexFormat.clone(r),this._ellipsoid=Ellipsoid.clone(n),this._granularity=a,this._stRotation=o,this._height=c,this._extrudedHeight=u,this._closeTop=defaultValue(e.closeTop,!0),this._closeBottom=defaultValue(e.closeBottom,!0),this._polygonHierarchy=i,this._perPositionHeight=s,this._perPositionHeightExtrude=l,this._shadowVolume=defaultValue(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=defaultValue(e.arcType,ArcType$1.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this.packedLength=PolygonGeometryLibrary.computeHierarchyPackedLength(i)+Ellipsoid.packedLength+VertexFormat.packedLength+12}PolygonGeometry.fromPositions=function(e){return new PolygonGeometry({polygonHierarchy:{positions:(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).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})},PolygonGeometry.pack=function(e,t,i){return i=defaultValue(i,0),i=PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i++]=e._shadowVolume?1:0,t[i++]=defaultValue(e._offsetAttribute,-1),t[i++]=e._arcType,t[i]=e.packedLength,t};var scratchEllipsoid$9=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$4=new VertexFormat,dummyOptions$1={polygonHierarchy:{}};function textureCoordinateRotationPoints$1(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];var i=e._ellipsoid,r=e._polygonHierarchy.positions,e=e.rectangle;return Geometry._textureCoordinateRotationPoints(r,t,i,e)}function PolygonHierarchy(e,t){this.positions=defined(e)?e:[],this.holes=defined(t)?t:[]}PolygonGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$9);t+=Ellipsoid.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$4);t+=VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],c=e[t++],u=1===e[t++],d=1===e[t++],h=1===e[t++],p=1===e[t++],m=1===e[t++],f=e[t++],g=e[t++],t=e[t];return(i=!defined(i)?new PolygonGeometry(dummyOptions$1):i)._polygonHierarchy=r,i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._height=o,i._extrudedHeight=s,i._granularity=l,i._stRotation=c,i._perPositionHeightExtrude=u,i._perPositionHeight=d,i._closeTop=h,i._closeBottom=p,i._shadowVolume=m,i._offsetAttribute=-1===f?void 0:f,i._arcType=g,i.packedLength=t,i},PolygonGeometry.computeRectangle=function(e,t){var i=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),r=defaultValue(e.arcType,ArcType$1.GEODESIC),n=e.polygonHierarchy,e=defaultValue(e.ellipsoid,Ellipsoid.WGS84);return computeRectangle$1(n.positions,e,r,i,t)},PolygonGeometry.createGeometry=function(e){var t=e._vertexFormat,i=e._ellipsoid,r=e._granularity,n=e._stRotation,a=e._polygonHierarchy,o=e._perPositionHeight,s=e._closeTop,l=e._closeBottom,c=e._arcType;if(!((m=a.positions).length<3)){var u=EllipsoidTangentPlane.fromPoints(m,i),a=PolygonGeometryLibrary.polygonsFromHierarchy(a,u.projectPointsOntoPlane.bind(u),!o,i),d=a.hierarchy,h=a.polygons;if(0!==d.length){var p,m=d[0].outerRing,m=PolygonGeometryLibrary.computeBoundingRectangle(u.plane.normal,u.projectPointOntoPlane.bind(u),m,n,scratchBoundingRectangle),f=[],g=e._height,_=e._extrudedHeight,y={perPositionHeight:o,vertexFormat:t,geometry:void 0,tangentPlane:u,boundingRectangle:m,ellipsoid:i,stRotation:n,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:c};if(e._perPositionHeightExtrude||!CesiumMath.equalsEpsilon(g,_,0,CesiumMath.EPSILON2))for(y.extrude=!0,y.top=s,y.bottom=l,y.shadowVolume=e._shadowVolume,y.offsetAttribute=e._offsetAttribute,p=0;p<h.length;p++){var C,v=createGeometryFromPositionsExtruded$1(i,h[p],r,d[p],o,s,l,t,c);s&&l?(C=v.topAndBottom,y.geometry=PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(C.geometry,g,_,i,o)):s?((C=v.topAndBottom).geometry.attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(C.geometry.attributes.position.values,g,i,!o),y.geometry=C.geometry):l&&((C=v.topAndBottom).geometry.attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(C.geometry.attributes.position.values,_,i,!0),y.geometry=C.geometry),(s||l)&&(y.wall=!1,C.geometry=computeAttributes$2(y),f.push(C));var S=v.walls;y.wall=!0;for(var T=0;T<S.length;T++){var x=S[T];y.geometry=PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(x.geometry,g,_,i,o),x.geometry=computeAttributes$2(y),f.push(x)}}else for(p=0;p<h.length;p++){var b,E=new GeometryInstance({geometry:PolygonGeometryLibrary.createGeometryFromPositions(i,h[p],r,o,t,c)});E.geometry.attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(E.geometry.attributes.position.values,g,i,!o),y.geometry=E.geometry,E.geometry=computeAttributes$2(y),defined(e._offsetAttribute)&&(b=E.geometry.attributes.position.values.length,arrayFill(b=new Uint8Array(b/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),E.geometry.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})),f.push(E)}u=GeometryPipeline.combineInstances(f)[0];u.attributes.position.values=new Float64Array(u.attributes.position.values),u.indices=IndexDatatype$1.createTypedArray(u.attributes.position.values.length/3,u.indices);m=u.attributes,n=BoundingSphere.fromVertices(m.position.values);return t.position||delete m.position,new Geometry({attributes:m,indices:u.indices,primitiveType:u.primitiveType,boundingSphere:n,offsetAttribute:e._offsetAttribute})}}},PolygonGeometry.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,t=t(r,n),i=i(r,n);return new PolygonGeometry({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:t,height:i,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(PolygonGeometry.prototype,{rectangle:{get:function(){var e;return defined(this._rectangle)||(e=this._polygonHierarchy.positions,this._rectangle=computeRectangle$1(e,this._ellipsoid,this._arcType,this._granularity)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=textureCoordinateRotationPoints$1(this)),this._textureCoordinateRotationPoints}}});var createGeometryFromPositionsPositions=[],createGeometryFromPositionsSubdivided=[];function createGeometryFromPositions(e,t,i,r,n){var a,o=EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,createGeometryFromPositionsPositions);PolygonPipeline.computeWindingOrder2D(o)===WindingOrder$1.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var s=t.length,l=0;if(r)for(a=new Float64Array(2*s*3),g=0;g<s;g++){var c=t[g],u=t[(g+1)%s];a[l++]=c.x,a[l++]=c.y,a[l++]=c.z,a[l++]=u.x,a[l++]=u.y,a[l++]=u.z}else{var d,h=0;if(n===ArcType$1.GEODESIC)for(g=0;g<s;g++)h+=PolygonGeometryLibrary.subdivideLineCount(t[g],t[(g+1)%s],i);else if(n===ArcType$1.RHUMB)for(g=0;g<s;g++)h+=PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[g],t[(g+1)%s],i);for(a=new Float64Array(3*h),g=0;g<s;g++){n===ArcType$1.GEODESIC?d=PolygonGeometryLibrary.subdivideLine(t[g],t[(g+1)%s],i,createGeometryFromPositionsSubdivided):n===ArcType$1.RHUMB&&(d=PolygonGeometryLibrary.subdivideRhumbLine(e,t[g],t[(g+1)%s],i,createGeometryFromPositionsSubdivided));for(var p=d.length,m=0;m<p;++m)a[l++]=d[m]}}for(var s=a.length/3,f=IndexDatatype$1.createTypedArray(s,2*s),l=0,g=0;g<s-1;g++)f[l++]=g,f[l++]=g+1;return f[l++]=s-1,f[l++]=0,new GeometryInstance({geometry:new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a})}),indices:f,primitiveType:PrimitiveType$1.LINES})})}function createGeometryFromPositionsExtruded(e,t,i,r,n){var a,o=EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,createGeometryFromPositionsPositions);PolygonPipeline.computeWindingOrder2D(o)===WindingOrder$1.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var s=t.length,l=new Array(s),c=0;if(r)for(a=new Float64Array(2*s*3*2),y=0;y<s;++y){l[y]=c/3;var u=t[y],d=t[(y+1)%s];a[c++]=u.x,a[c++]=u.y,a[c++]=u.z,a[c++]=d.x,a[c++]=d.y,a[c++]=d.z}else{var h,p=0;if(n===ArcType$1.GEODESIC)for(y=0;y<s;y++)p+=PolygonGeometryLibrary.subdivideLineCount(t[y],t[(y+1)%s],i);else if(n===ArcType$1.RHUMB)for(y=0;y<s;y++)p+=PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[y],t[(y+1)%s],i);for(a=new Float64Array(3*p*2),y=0;y<s;++y){l[y]=c/3,n===ArcType$1.GEODESIC?h=PolygonGeometryLibrary.subdivideLine(t[y],t[(y+1)%s],i,createGeometryFromPositionsSubdivided):n===ArcType$1.RHUMB&&(h=PolygonGeometryLibrary.subdivideRhumbLine(e,t[y],t[(y+1)%s],i,createGeometryFromPositionsSubdivided));for(var m=h.length,f=0;f<m;++f)a[c++]=h[f]}}for(var s=a.length/6,g=l.length,_=IndexDatatype$1.createTypedArray(s+g,2*(2*s+g)),c=0,y=0;y<s;++y)_[c++]=y,_[c++]=(y+1)%s,_[c++]=y+s,_[c++]=(y+1)%s+s;for(y=0;y<g;y++){var C=l[y];_[c++]=C,_[c++]=C+s}return new GeometryInstance({geometry:new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a})}),indices:_,primitiveType:PrimitiveType$1.LINES})})}function PolygonOutlineGeometry(e){var t,i=e.polygonHierarchy,r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),a=defaultValue(e.perPositionHeight,!1),o=a&&defined(e.extrudedHeight),s=defaultValue(e.arcType,ArcType$1.GEODESIC),l=defaultValue(e.height,0),c=defaultValue(e.extrudedHeight,l);o||(t=Math.max(l,c),c=Math.min(l,c),l=t),this._ellipsoid=Ellipsoid.clone(r),this._granularity=n,this._height=l,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=i,this._perPositionHeight=a,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=PolygonGeometryLibrary.computeHierarchyPackedLength(i)+Ellipsoid.packedLength+8}PolygonOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),i=PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=defaultValue(e._offsetAttribute,-1),t[i]=e.packedLength,t};var scratchEllipsoid$8=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),dummyOptions={polygonHierarchy:{}};PolygonOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$8);t+=Ellipsoid.packedLength;var a=e[t++],o=e[t++],s=e[t++],l=1===e[t++],c=1===e[t++],u=e[t++],d=e[t++],t=e[t];return(i=!defined(i)?new PolygonOutlineGeometry(dummyOptions):i)._polygonHierarchy=r,i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._height=a,i._extrudedHeight=o,i._granularity=s,i._perPositionHeight=c,i._perPositionHeightExtrude=l,i._arcType=u,i._offsetAttribute=-1===d?void 0:d,i.packedLength=t,i},PolygonOutlineGeometry.fromPositions=function(e){return new PolygonOutlineGeometry({polygonHierarchy:{positions:(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},PolygonOutlineGeometry.createGeometry=function(e){var t=e._ellipsoid,i=e._granularity,r=e._polygonHierarchy,n=e._perPositionHeight,a=e._arcType,o=PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!n,t);if(0!==o.length){var s,l,c,u,d,h=[],p=CesiumMath.chordLength(i,t.maximumRadius),m=e._height,f=e._extrudedHeight;if(e._perPositionHeightExtrude||!CesiumMath.equalsEpsilon(m,f,0,CesiumMath.EPSILON2))for(s=0;s<o.length;s++)(u=createGeometryFromPositionsExtruded(t,o[s],p,n,a)).geometry=PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(u.geometry,m,f,t,n),defined(e._offsetAttribute)&&(l=u.geometry.attributes.position.values.length/3,c=new Uint8Array(l),c=e._offsetAttribute===GeometryOffsetAttribute$1.TOP?arrayFill(c,1,0,l/2):arrayFill(c,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),u.geometry.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})),h.push(u);else for(s=0;s<o.length;s++)(u=createGeometryFromPositions(t,o[s],p,n,a)).geometry.attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(u.geometry.attributes.position.values,m,t,!n),defined(e._offsetAttribute)&&(d=u.geometry.attributes.position.values.length,arrayFill(d=new Uint8Array(d/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),u.geometry.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})),h.push(u);r=GeometryPipeline.combineInstances(h)[0],i=BoundingSphere.fromVertices(r.attributes.position.values);return new Geometry({attributes:r.attributes,indices:r.indices,primitiveType:r.primitiveType,boundingSphere:i,offsetAttribute:e._offsetAttribute})}};var scratchInterpolateColorsArray=[];function interpolateColors$1(e,t,i,r,n){var a=scratchInterpolateColorsArray;a.length=n;var o=i.red,s=i.green,l=i.blue,c=i.alpha,u=r.red,d=r.green,h=r.blue,p=r.alpha;if(Color.equals(i,r)){for(y=0;y<n;y++)a[y]=Color.clone(i);return a}for(var m=(u-o)/n,f=(d-s)/n,g=(h-l)/n,_=(p-c)/n,y=0;y<n;y++)a[y]=new Color(o+y*m,s+y*f,l+y*g,c+y*_);return a}function PolylineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.colors,r=defaultValue(e.width,1),n=defaultValue(e.colorsPerVertex,!1);this._positions=t,this._colors=i,this._width=r,this._colorsPerVertex=n,this._vertexFormat=VertexFormat.clone(defaultValue(e.vertexFormat,VertexFormat.DEFAULT)),this._arcType=defaultValue(e.arcType,ArcType$1.GEODESIC),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";t=1+t.length*Cartesian3.packedLength;t+=defined(i)?1+i.length*Color.packedLength:1,this.packedLength=t+Ellipsoid.packedLength+VertexFormat.packedLength+4}PolylineGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._colors,a=defined(o)?o.length:0;for(t[i++]=a,r=0;r<a;++r,i+=Color.packedLength)Color.pack(o[r],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._width,t[i++]=e._colorsPerVertex?1:0,t[i++]=e._arcType,t[i]=e._granularity,t};var scratchEllipsoid$7=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$3=new VertexFormat,scratchOptions$8={positions:void 0,colors:void 0,ellipsoid:scratchEllipsoid$7,vertexFormat:scratchVertexFormat$3,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};PolylineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r=e[t++],n=new Array(r),a=0;a<r;++a,t+=Cartesian3.packedLength)n[a]=Cartesian3.unpack(e,t);var o=0<(r=e[t++])?new Array(r):void 0;for(a=0;a<r;++a,t+=Color.packedLength)o[a]=Color.unpack(e,t);var s=Ellipsoid.unpack(e,t,scratchEllipsoid$7);t+=Ellipsoid.packedLength;var l=VertexFormat.unpack(e,t,scratchVertexFormat$3);t+=VertexFormat.packedLength;var c=e[t++],u=1===e[t++],d=e[t++],h=e[t];return defined(i)?(i._positions=n,i._colors=o,i._ellipsoid=Ellipsoid.clone(s,i._ellipsoid),i._vertexFormat=VertexFormat.clone(l,i._vertexFormat),i._width=c,i._colorsPerVertex=u,i._arcType=d,i._granularity=h,i):(scratchOptions$8.positions=n,scratchOptions$8.colors=o,scratchOptions$8.width=c,scratchOptions$8.colorsPerVertex=u,scratchOptions$8.arcType=d,scratchOptions$8.granularity=h,new PolylineGeometry(scratchOptions$8))};var scratchCartesian3$5=new Cartesian3,scratchPosition$8=new Cartesian3,scratchPrevPosition=new Cartesian3,scratchNextPosition=new Cartesian3;function computeAttributes$1(e,t,i,r){var n=new GeometryAttributes;r.position&&(n.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:e}));var a,o,s,l,c,u=t.length,d=e.length/3,h=(d-2*u)/(2*u),p=PolygonPipeline.triangulate(t),m=(h-1)*u*6+2*p.length,f=IndexDatatype$1.createTypedArray(d,m),g=2*u,_=0;for(E=0;E<h-1;E++){for(a=0;a<u-1;a++)c=(o=2*a+E*u*2)+g,l=(s=o+1)+g,f[_++]=s,f[_++]=o,f[_++]=l,f[_++]=l,f[_++]=o,f[_++]=c;l=(s=(o=2*u-2+E*u*2)+1)+g,c=o+g,f[_++]=s,f[_++]=o,f[_++]=l,f[_++]=l,f[_++]=o,f[_++]=c}if(r.st||r.tangent||r.bitangent){for(var y,C,v=new Float32Array(2*d),S=1/(h-1),T=1/i.height,x=i.height/2,b=0,E=0;E<h;E++){for(C=T*(t[0].y+x),v[b++]=y=E*S,v[b++]=C,a=1;a<u;a++)C=T*(t[a].y+x),v[b++]=y,v[b++]=C,v[b++]=y,v[b++]=C;C=T*(t[0].y+x),v[b++]=y,v[b++]=C}for(a=0;a<u;a++)C=T*(t[a].y+x),v[b++]=y=0,v[b++]=C;for(a=0;a<u;a++)C=T*(t[a].y+x),v[b++]=y=(h-1)*S,v[b++]=C;n.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}var P=d-2*u;for(E=0;E<p.length;E+=3){var A=p[E]+P,w=p[E+1]+P,D=p[E+2]+P;f[_++]=A,f[_++]=w,f[_++]=D,f[_++]=D+u,f[_++]=w+u,f[_++]=A+u}e=new Geometry({attributes:n,indices:f,boundingSphere:BoundingSphere.fromVertices(e),primitiveType:PrimitiveType$1.TRIANGLES});if(r.normal&&(e=GeometryPipeline.computeNormal(e)),r.tangent||r.bitangent){try{e=GeometryPipeline.computeTangentAndBitangent(e)}catch(e){oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}r.tangent||(e.attributes.tangent=void 0),r.bitangent||(e.attributes.bitangent=void 0),r.st||(e.attributes.st=void 0)}return e}function PolylineVolumeGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._cornerType=defaultValue(e.cornerType,CornerType$1.ROUNDED),this._vertexFormat=VertexFormat.clone(defaultValue(e.vertexFormat,VertexFormat.DEFAULT)),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";t=1+t.length*Cartesian3.packedLength;t+=1+i.length*Cartesian2.packedLength,this.packedLength=t+Ellipsoid.packedLength+VertexFormat.packedLength+2}PolylineGeometry.createGeometry=function(e){var t=e._width,i=e._vertexFormat,r=e._colors,n=e._colorsPerVertex,a=e._arcType,o=e._granularity,s=e._ellipsoid,l=arrayRemoveDuplicates(e._positions,Cartesian3.equalsEpsilon);if(!((x=l.length)<2||t<=0)){if(a===ArcType$1.GEODESIC||a===ArcType$1.RHUMB){var c,u=a===ArcType$1.GEODESIC?(c=CesiumMath.chordLength(o,s.maximumRadius),PolylinePipeline.numberOfPoints):(c=o,PolylinePipeline.numberOfPointsRhumbLine),d=PolylinePipeline.extractHeights(l,s);if(defined(r)){for(var h=1,p=0;p<x-1;++p)h+=u(l[p],l[p+1],c);var m=new Array(h),f=0;for(p=0;p<x-1;++p){var g=l[p],_=l[p+1],y=r[p],C=u(g,_,c);if(n&&p<h)for(var v=interpolateColors$1(g,_,y,r[p+1],C),S=v.length,T=0;T<S;++T)m[f++]=v[T];else for(T=0;T<C;++T)m[f++]=Color.clone(y)}m[f]=Color.clone(r[r.length-1]),r=m,scratchInterpolateColorsArray.length=0}l=a===ArcType$1.GEODESIC?PolylinePipeline.generateCartesianArc({positions:l,minDistance:c,ellipsoid:s,height:d}):PolylinePipeline.generateCartesianRhumbArc({positions:l,granularity:c,ellipsoid:s,height:d})}var x,b,E,P,s=4*(x=l.length)-4,A=new Float64Array(3*s),w=new Float64Array(3*s),D=new Float64Array(3*s),M=new Float32Array(2*s),I=i.st?new Float32Array(2*s):void 0,R=defined(r)?new Uint8Array(4*s):void 0,O=0,L=0,F=0,N=0;for(T=0;T<x;++T){0===T?(Cartesian3.subtract(l[0],l[1],b=scratchCartesian3$5),Cartesian3.add(l[0],b,b)):b=l[T-1],Cartesian3.clone(b,scratchPrevPosition),Cartesian3.clone(l[T],scratchPosition$8),T===x-1?(Cartesian3.subtract(l[x-1],l[x-2],b=scratchCartesian3$5),Cartesian3.add(l[x-1],b,b)):b=l[T+1],Cartesian3.clone(b,scratchNextPosition),defined(R)&&(E=0===T||n?r[T]:r[T-1],T!==x-1&&(P=r[T]));for(var B=T===x-1?2:4,V=0===T?2:0;V<B;++V){Cartesian3.pack(scratchPosition$8,A,O),Cartesian3.pack(scratchPrevPosition,w,O),Cartesian3.pack(scratchNextPosition,D,O),O+=3;var k=V-2<0?-1:1;M[L++]=V%2*2-1,M[L++]=k*t,i.st&&(I[F++]=T/(x-1),I[F++]=Math.max(M[L-2],0)),defined(R)&&(R[N++]=Color.floatToByte((k=V<2?E:P).red),R[N++]=Color.floatToByte(k.green),R[N++]=Color.floatToByte(k.blue),R[N++]=Color.floatToByte(k.alpha))}}d=new GeometryAttributes;d.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:A}),d.prevPosition=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:w}),d.nextPosition=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:D}),d.expandAndWidth=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:M}),i.st&&(d.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:I})),defined(R)&&(d.color=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));var z=IndexDatatype$1.createTypedArray(s,6*x-6),$=0,U=0,G=x-1;for(T=0;T<G;++T)z[U++]=$,z[U++]=$+2,z[U++]=$+1,z[U++]=$+1,z[U++]=$+2,z[U++]=$+3,$+=4;return new Geometry({attributes:d,indices:z,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:BoundingSphere.fromPoints(l),geometryType:GeometryType$1.POLYLINES})}},PolylineVolumeGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._shape,a=o.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian2.packedLength)Cartesian2.pack(o[r],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var scratchEllipsoid$6=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$2=new VertexFormat,scratchOptions$7={polylinePositions:void 0,shapePositions:void 0,ellipsoid:scratchEllipsoid$6,vertexFormat:scratchVertexFormat$2,cornerType:void 0,granularity:void 0};PolylineVolumeGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r=e[t++],n=new Array(r),a=0;a<r;++a,t+=Cartesian3.packedLength)n[a]=Cartesian3.unpack(e,t);var r=e[t++],o=new Array(r);for(a=0;a<r;++a,t+=Cartesian2.packedLength)o[a]=Cartesian2.unpack(e,t);var s=Ellipsoid.unpack(e,t,scratchEllipsoid$6);t+=Ellipsoid.packedLength;var l=VertexFormat.unpack(e,t,scratchVertexFormat$2);t+=VertexFormat.packedLength;var c=e[t++],u=e[t];return defined(i)?(i._positions=n,i._shape=o,i._ellipsoid=Ellipsoid.clone(s,i._ellipsoid),i._vertexFormat=VertexFormat.clone(l,i._vertexFormat),i._cornerType=c,i._granularity=u,i):(scratchOptions$7.polylinePositions=n,scratchOptions$7.shapePositions=o,scratchOptions$7.cornerType=c,scratchOptions$7.granularity=u,new PolylineVolumeGeometry(scratchOptions$7))};var brScratch$1=new BoundingRectangle;function computeAttributes(e,t){var i=new GeometryAttributes;i.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:e});var r=t.length,t=i.position.values.length/3,n=e.length/3/r,a=IndexDatatype$1.createTypedArray(t,2*r*(1+n)),o=0,s=0,l=s*r;for(d=0;d<r-1;d++)a[o++]=d+l,a[o++]=d+l+1;for(a[o++]=r-1+l,a[o++]=l,l=(s=n-1)*r,d=0;d<r-1;d++)a[o++]=d+l,a[o++]=d+l+1;for(a[o++]=r-1+l,a[o++]=l,s=0;s<n-1;s++)for(var c=r*s,u=c+r,d=0;d<r;d++)a[o++]=d+c,a[o++]=d+u;return new Geometry({attributes:i,indices:IndexDatatype$1.createTypedArray(t,a),boundingSphere:BoundingSphere.fromVertices(e),primitiveType:PrimitiveType$1.LINES})}function PolylineVolumeOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._cornerType=defaultValue(e.cornerType,CornerType$1.ROUNDED),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";t=1+t.length*Cartesian3.packedLength;t+=1+i.length*Cartesian2.packedLength,this.packedLength=t+Ellipsoid.packedLength+2}PolylineVolumeGeometry.createGeometry=function(e){var t=arrayRemoveDuplicates(e._positions,Cartesian3.equalsEpsilon),i=e._shape,i=PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i);if(!(t.length<2||i.length<3)){PolygonPipeline.computeWindingOrder2D(i)===WindingOrder$1.CLOCKWISE&&i.reverse();var r=BoundingRectangle.fromPoints(i,brScratch$1);return computeAttributes$1(PolylineVolumeGeometryLibrary.computePositions(t,i,r,e,!0),i,r,e._vertexFormat)}},PolylineVolumeOutlineGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._shape,a=o.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian2.packedLength)Cartesian2.pack(o[r],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var scratchEllipsoid$5=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$6={polylinePositions:void 0,shapePositions:void 0,ellipsoid:scratchEllipsoid$5,height:void 0,cornerType:void 0,granularity:void 0};PolylineVolumeOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r=e[t++],n=new Array(r),a=0;a<r;++a,t+=Cartesian3.packedLength)n[a]=Cartesian3.unpack(e,t);var r=e[t++],o=new Array(r);for(a=0;a<r;++a,t+=Cartesian2.packedLength)o[a]=Cartesian2.unpack(e,t);var s=Ellipsoid.unpack(e,t,scratchEllipsoid$5);t+=Ellipsoid.packedLength;var l=e[t++],c=e[t];return defined(i)?(i._positions=n,i._shape=o,i._ellipsoid=Ellipsoid.clone(s,i._ellipsoid),i._cornerType=l,i._granularity=c,i):(scratchOptions$6.polylinePositions=n,scratchOptions$6.shapePositions=o,scratchOptions$6.cornerType=l,scratchOptions$6.granularity=c,new PolylineVolumeOutlineGeometry(scratchOptions$6))};var brScratch=new BoundingRectangle;function Proxy(){DeveloperError.throwInstantiationError()}function createEvaluateFunction(n){var a=n.points,o=n.times;return function(e,t){defined(t)||(t=new Quaternion);var i=n._lastTimeIndex=n.findTimeInterval(e,n._lastTimeIndex),r=(e-o[i])/(o[i+1]-o[i]),e=a[i],i=a[i+1];return Quaternion.fastSlerp(e,i,r,t)}}function QuaternionSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).points,e=e.times;this._times=e,this._points=t,this._evaluateFunction=createEvaluateFunction(this),this._lastTimeIndex=0}function quickselect$1(e,t,i,r,n){quickselectStep$1(e,t,i||0,r||e.length-1,n||defaultCompare$1)}function quickselectStep$1(e,t,i,r,n){for(;i<r;){var a,o,s,l;600<r-i&&(a=r-i+1,o=t-i+1,l=Math.log(a),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(a-s)/a)*(o-a/2<0?-1:1),quickselectStep$1(e,t,Math.max(i,Math.floor(t-o*s/a+l)),Math.min(r,Math.floor(t+(a-o)*s/a+l)),n));var c=e[t],u=i,d=r;for(swap$2(e,i,t),0<n(e[r],c)&&swap$2(e,i,r);u<d;){for(swap$2(e,u,d),u++,d--;n(e[u],c)<0;)u++;for(;0<n(e[d],c);)d--}0===n(e[i],c)?swap$2(e,i,d):swap$2(e,++d,r),d<=t&&(i=d+1),t<=d&&(r=d-1)}}function swap$2(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function defaultCompare$1(e,t){return e<t?-1:t<e?1:0}function RBush(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function findItem(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function calcBBox(e,t){distBBox(e,0,e.children.length,t,e)}function distBBox(e,t,i,r,n){(n=n||createNode(null)).minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a=t;a<i;a++){var o=e.children[a];extend(n,e.leaf?r(o):o)}return n}function extend(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function compareNodeMinX(e,t){return e.minX-t.minX}function compareNodeMinY(e,t){return e.minY-t.minY}function bboxArea(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function bboxMargin(e){return e.maxX-e.minX+(e.maxY-e.minY)}function enlargedArea(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function intersectionArea(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),t=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,t-r)}function contains$1(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function intersects(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function createNode(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(e,t,i,r,n){for(var a,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=r||(quickselect$1(e,a=t+Math.ceil((i-t)/r/2)*r,t,i,n),o.push(t,a,a,i))}function RectangleCollisionChecker(){this._tree=new RBush}function RectangleWithId(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}function idCompare(e,t){return e.id===t.id}PolylineVolumeOutlineGeometry.createGeometry=function(e){var t=arrayRemoveDuplicates(e._positions,Cartesian3.equalsEpsilon),i=e._shape,i=PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i);if(!(t.length<2||i.length<3)){PolygonPipeline.computeWindingOrder2D(i)===WindingOrder$1.CLOCKWISE&&i.reverse();var r=BoundingRectangle.fromPoints(i,brScratch);return computeAttributes(PolylineVolumeGeometryLibrary.computePositions(t,i,r,e,!1),i)}},Proxy.prototype.getURL=DeveloperError.throwInstantiationError,Object.defineProperties(QuaternionSpline.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),QuaternionSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,QuaternionSpline.prototype.wrapTime=Spline.prototype.wrapTime,QuaternionSpline.prototype.clampTime=Spline.prototype.clampTime,QuaternionSpline.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},RBush.prototype.all=function(){return this._all(this.data,[])},RBush.prototype.search=function(e){var t=this.data,i=[];if(!intersects(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var a=0;a<t.children.length;a++){var o=t.children[a],s=t.leaf?r(o):o;intersects(e,s)&&(t.leaf?i.push(o):contains$1(e,s)?this._all(o,i):n.push(o))}t=n.pop()}return i},RBush.prototype.collides=function(e){var t=this.data;if(!intersects(e,t))return!1;for(var i=[];t;){for(var r=0;r<t.children.length;r++){var n=t.children[r],a=t.leaf?this.toBBox(n):n;if(intersects(e,a)){if(t.leaf||contains$1(e,a))return!0;i.push(n)}}t=i.pop()}return!1},RBush.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var i,r=this._build(e.slice(),0,e.length-1,0);return this.data.children.length?this.data.height===r.height?this._splitRoot(this.data,r):(this.data.height<r.height&&(i=this.data,this.data=r,r=i),this._insert(r,this.data.height-r.height-1,!0)):this.data=r,this},RBush.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},RBush.prototype.clear=function(){return this.data=createNode([]),this},RBush.prototype.remove=function(e,t){if(!e)return this;for(var i,r,n,a=this.data,o=this.toBBox(e),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],i=l.pop(),n=!0),a.leaf){var c=findItem(e,a.children,t);if(-1!==c)return a.children.splice(c,1),s.push(a),this._condense(s),this}n||a.leaf||!contains$1(a,o)?r?(i++,a=r.children[i],n=!1):a=null:(s.push(a),l.push(i),a=(r=a).children[i=0])}return this},RBush.prototype.toBBox=function(e){return e},RBush.prototype.compareMinX=function(e,t){return e.minX-t.minX},RBush.prototype.compareMinY=function(e,t){return e.minY-t.minY},RBush.prototype.toJSON=function(){return this.data},RBush.prototype.fromJSON=function(e){return this.data=e,this},RBush.prototype._all=function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},RBush.prototype._build=function(e,t,i,r){var n,a=i-t+1,o=this._maxEntries;if(a<=o)return calcBBox(n=createNode(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=createNode([])).leaf=!1,n.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));multiSelect(e,t,i,l,this.compareMinX);for(var c=t;c<=i;c+=l){var u=Math.min(c+l-1,i);multiSelect(e,c,u,s,this.compareMinY);for(var d=c;d<=u;d+=s){var h=Math.min(d+s-1,u);n.children.push(this._build(e,d,h,r-1))}}return calcBBox(n,this.toBBox),n},RBush.prototype._chooseSubtree=function(e,t,i,r){for(;r.push(t),!t.leaf&&r.length-1!==i;){for(var n=1/0,a=1/0,o=void 0,s=0;s<t.children.length;s++){var l=t.children[s],c=bboxArea(l),u=enlargedArea(e,l)-c;u<a?(a=u,n=c<n?c:n,o=l):u===a&&c<n&&(n=c,o=l)}t=o||t.children[0]}return t},RBush.prototype._insert=function(e,t,i){var r=i?e:this.toBBox(e),n=[],i=this._chooseSubtree(r,this.data,t,n);for(i.children.push(e),extend(i,r);0<=t&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},RBush.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);r=this._chooseSplitIndex(i,n,r),r=createNode(i.children.splice(r,i.children.length-r));r.height=i.height,r.leaf=i.leaf,calcBBox(i,this.toBBox),calcBBox(r,this.toBBox),t?e[t-1].children.push(r):this._splitRoot(i,r)},RBush.prototype._splitRoot=function(e,t){this.data=createNode([e,t]),this.data.height=e.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},RBush.prototype._chooseSplitIndex=function(e,t,i){for(var r,n=1/0,a=1/0,o=t;o<=i-t;o++){var s=distBBox(e,0,o,this.toBBox),l=distBBox(e,o,i,this.toBBox),c=intersectionArea(s,l),l=bboxArea(s)+bboxArea(l);c<n?(n=c,r=o,a=l<a?l:a):c===n&&l<a&&(a=l,r=o)}return r||i-t},RBush.prototype._chooseSplitAxis=function(e,t,i){var r=e.leaf?this.compareMinX:compareNodeMinX,n=e.leaf?this.compareMinY:compareNodeMinY;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},RBush.prototype._allDistMargin=function(e,t,i,r){e.children.sort(r);for(var n=this.toBBox,a=distBBox(e,0,t,n),o=distBBox(e,i-t,i,n),s=bboxMargin(a)+bboxMargin(o),l=t;l<i-t;l++){var c=e.children[l];extend(a,e.leaf?n(c):c),s+=bboxMargin(a)}for(var u=i-t-1;t<=u;u--){var d=e.children[u];extend(o,e.leaf?n(d):d),s+=bboxMargin(o)}return s},RBush.prototype._adjustParentBBoxes=function(e,t,i){for(var r=i;0<=r;r--)extend(t[r],e)},RBush.prototype._condense=function(e){for(var t=e.length-1,i=void 0;0<=t;t--)0===e[t].children.length?0<t?(i=e[t-1].children).splice(i.indexOf(e[t]),1):this.clear():calcBBox(e[t],this.toBBox)},RectangleWithId.fromRectangleAndId=function(e,t,i){return i.minX=t.west,i.minY=t.south,i.maxX=t.east,i.maxY=t.north,i.id=e,i},RectangleCollisionChecker.prototype.insert=function(e,t){t=RectangleWithId.fromRectangleAndId(e,t,new RectangleWithId);this._tree.insert(t)};var removalScratch=new RectangleWithId;RectangleCollisionChecker.prototype.remove=function(e,t){t=RectangleWithId.fromRectangleAndId(e,t,removalScratch);this._tree.remove(t,idCompare)};var collisionScratch=new RectangleWithId;RectangleCollisionChecker.prototype.collides=function(e){e=RectangleWithId.fromRectangleAndId("",e,collisionScratch);return this._tree.collides(e)};var cos=Math.cos,sin=Math.sin,sqrt=Math.sqrt,RectangleGeometryLibrary={computePosition:function(e,t,i,r,n,a,o){var s=t.radiiSquared,l=e.nwCorner,c=e.boundingRectangle,u=l.latitude-e.granYCos*r+n*e.granXSin,d=cos(u),h=sin(u),p=s.z*h,m=l.longitude+r*e.granYSin+n*e.granXCos,t=d*cos(m),l=d*sin(m),d=s.x*t,s=s.y*l,h=sqrt(d*t+s*l+p*h);a.x=d/h,a.y=s/h,a.z=p/h,i&&(defined(i=e.stNwCorner)?(u=i.latitude-e.stGranYCos*r+n*e.stGranXSin,m=i.longitude+r*e.stGranYSin+n*e.stGranXCos,o.x=(m-e.stWest)*e.lonScalar,o.y=(u-e.stSouth)*e.latScalar):(o.x=(m-c.west)*e.lonScalar,o.y=(u-c.south)*e.latScalar))}},rotationMatrixScratch=new Matrix2,nwCartesian=new Cartesian3,centerScratch$3=new Cartographic,centerCartesian=new Cartesian3,proj=new GeographicProjection;function getRotationOptions(e,t,i,r,n,a,o){var s=Math.cos(t),l=r*s,c=i*s,u=Math.sin(t),d=r*u,h=i*u;nwCartesian=proj.project(e,nwCartesian),nwCartesian=Cartesian3.subtract(nwCartesian,centerCartesian,nwCartesian);s=Matrix2.fromRotation(t,rotationMatrixScratch);nwCartesian=Matrix2.multiplyByVector(s,nwCartesian,nwCartesian),nwCartesian=Cartesian3.add(nwCartesian,centerCartesian,nwCartesian);r=(e=proj.unproject(nwCartesian,e)).latitude,i=r+--a*h,u=r-l*--o,t=r-l*o+a*h,s=Math.max(r,i,u,t),r=Math.min(r,i,u,t),i=e.longitude,u=i+a*c,t=i+o*d,a=i+o*d+a*c;return{north:s,south:r,east:Math.max(i,u,t,a),west:Math.min(i,u,t,a),granYCos:l,granYSin:d,granXCos:c,granXSin:h,nwCorner:e}}RectangleGeometryLibrary.computeOptions=function(e,t,i,r,n,a,o){var s=e.east,l=e.west,c=e.north,u=e.south,d=!1,h=!1;c===CesiumMath.PI_OVER_TWO&&(d=!0),u===-CesiumMath.PI_OVER_TWO&&(h=!0);var p,m=c-u,f=(_=s<l?CesiumMath.TWO_PI-l+s:s-l)/((p=Math.ceil(_/t)+1)-1),g=m/((y=Math.ceil(m/t)+1)-1),_=Rectangle.northwest(e,a),m=Rectangle.center(e,centerScratch$3);0===i&&0===r||(m.longitude<_.longitude&&(m.longitude+=CesiumMath.TWO_PI),centerCartesian=proj.project(m,centerCartesian));var y,t=g,a=f,n=Rectangle.clone(e,n),h={granYCos:t,granYSin:0,granXCos:a,granXSin:0,nwCorner:_,boundingRectangle:n,width:p,height:y,northCap:d,southCap:h};return 0!==i&&(c=(_=getRotationOptions(_,i,f,g,m,p,y)).north,u=_.south,s=_.east,l=_.west,h.granYCos=_.granYCos,h.granYSin=_.granYSin,h.granXCos=_.granXCos,h.granXSin=_.granXSin,n.north=c,n.south=u,n.east=s,n.west=l),0!==r&&(i-=r,y=getRotationOptions(o=Rectangle.northwest(n,o),i,f,g,m,p,y),h.stGranYCos=y.granYCos,h.stGranXCos=y.granXCos,h.stGranYSin=y.granYSin,h.stGranXSin=y.granXSin,h.stNwCorner=o,h.stWest=y.west,h.stSouth=y.south),h};var positionScratch$9=new Cartesian3,normalScratch$2=new Cartesian3,tangentScratch=new Cartesian3,bitangentScratch=new Cartesian3,rectangleScratch$4=new Rectangle,stScratch=new Cartesian2,bottomBoundingSphere$1=new BoundingSphere,topBoundingSphere$1=new BoundingSphere;function createAttributes(e,t){var i=new Geometry({attributes:new GeometryAttributes,primitiveType:PrimitiveType$1.TRIANGLES});return i.attributes.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(i.attributes.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:t.bitangents})),i}function calculateAttributes(e,t,i,r){var n=e.length,a=t.normal?new Float32Array(n):void 0,o=t.tangent?new Float32Array(n):void 0,s=t.bitangent?new Float32Array(n):void 0,l=0,c=bitangentScratch,u=tangentScratch,d=normalScratch$2;if(t.normal||t.tangent||t.bitangent)for(var h=0;h<n;h+=3){var p=Cartesian3.fromArray(e,h,positionScratch$9),m=l+1,f=l+2,d=i.geodeticSurfaceNormal(p,d);(t.tangent||t.bitangent)&&(Cartesian3.cross(Cartesian3.UNIT_Z,d,u),Matrix3.multiplyByVector(r,u,u),Cartesian3.normalize(u,u),t.bitangent&&Cartesian3.normalize(Cartesian3.cross(d,u,c),c)),t.normal&&(a[l]=d.x,a[m]=d.y,a[f]=d.z),t.tangent&&(o[l]=u.x,o[m]=u.y,o[f]=u.z),t.bitangent&&(s[l]=c.x,s[m]=c.y,s[f]=c.z),l+=3}return createAttributes(t,{positions:e,normals:a,tangents:o,bitangents:s})}var v1Scratch=new Cartesian3,v2Scratch=new Cartesian3;function calculateAttributesWall(e,t,i){var r=e.length,n=t.normal?new Float32Array(r):void 0,a=t.tangent?new Float32Array(r):void 0,o=t.bitangent?new Float32Array(r):void 0,s=0,l=0,c=0,u=!0,d=bitangentScratch,h=tangentScratch,p=normalScratch$2;if(t.normal||t.tangent||t.bitangent)for(var m=0;m<r;m+=6){var f,g=Cartesian3.fromArray(e,m,positionScratch$9),_=Cartesian3.fromArray(e,(m+6)%r,v1Scratch);u&&(f=Cartesian3.fromArray(e,(m+3)%r,v2Scratch),Cartesian3.subtract(_,g,_),Cartesian3.subtract(f,g,f),p=Cartesian3.normalize(Cartesian3.cross(f,_,p),p),u=!1),Cartesian3.equalsEpsilon(_,g,CesiumMath.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(d=i.geodeticSurfaceNormal(g,d),t.tangent&&(h=Cartesian3.normalize(Cartesian3.cross(d,p,h),h))),t.normal&&(n[s++]=p.x,n[s++]=p.y,n[s++]=p.z,n[s++]=p.x,n[s++]=p.y,n[s++]=p.z),t.tangent&&(a[l++]=h.x,a[l++]=h.y,a[l++]=h.z,a[l++]=h.x,a[l++]=h.y,a[l++]=h.z),t.bitangent&&(o[c++]=d.x,o[c++]=d.y,o[c++]=d.z,o[c++]=d.x,o[c++]=d.y,o[c++]=d.z)}return createAttributes(t,{positions:e,normals:n,tangents:a,bitangents:o})}function constructRectangle$1(e,t){var i=e._vertexFormat,r=e._ellipsoid,n=t.height,a=t.width,o=t.northCap,s=t.southCap,l=0,c=n,u=n,e=0;o&&(--u,e+=l=1),s&&(--c,--u,e+=1),e+=a*u;for(var d=i.position?new Float64Array(3*e):void 0,h=i.st?new Float32Array(2*e):void 0,p=0,m=0,f=positionScratch$9,g=stScratch,_=Number.MAX_VALUE,y=Number.MAX_VALUE,C=-Number.MAX_VALUE,v=-Number.MAX_VALUE,S=l;S<c;++S)for(var T=0;T<a;++T)RectangleGeometryLibrary.computePosition(t,r,i.st,S,T,f,g),d[p++]=f.x,d[p++]=f.y,d[p++]=f.z,i.st&&(h[m++]=g.x,h[m++]=g.y,_=Math.min(_,g.x),y=Math.min(y,g.y),C=Math.max(C,g.x),v=Math.max(v,g.y));if(o&&(RectangleGeometryLibrary.computePosition(t,r,i.st,0,0,f,g),d[p++]=f.x,d[p++]=f.y,d[p++]=f.z,i.st&&(h[m++]=g.x,h[m++]=g.y,_=g.x,y=g.y,C=g.x,v=g.y)),s&&(RectangleGeometryLibrary.computePosition(t,r,i.st,n-1,0,f,g),d[p++]=f.x,d[p++]=f.y,d[p]=f.z,i.st&&(h[m++]=g.x,h[m]=g.y,_=Math.min(_,g.x),y=Math.min(y,g.y),C=Math.max(C,g.x),v=Math.max(v,g.y))),i.st&&(_<0||y<0||1<C||1<v))for(var x=0;x<h.length;x+=2)h[x]=(h[x]-_)/(C-_),h[x+1]=(h[x+1]-y)/(v-y);l=calculateAttributes(d,i,r,t.tangentRotationMatrix),n=6*(a-1)*(u-1);o&&(n+=3*(a-1)),s&&(n+=3*(a-1));for(var b=IndexDatatype$1.createTypedArray(e,n),E=0,P=0,A=0;A<u-1;++A){for(var w=0;w<a-1;++w){var D=E+a,M=D+1,I=E+1;b[P++]=E,b[P++]=D,b[P++]=I,b[P++]=I,b[P++]=D,b[P++]=M,++E}++E}if(o||s){var R,O,L=e-1,F=e-1;if(o&&s&&(L=e-2),E=0,o)for(A=0;A<a-1;A++)O=(R=E)+1,b[P++]=L,b[P++]=R,b[P++]=O,++E;if(s)for(E=(u-1)*a,A=0;A<a-1;A++)O=(R=E)+1,b[P++]=R,b[P++]=F,b[P++]=O,++E}return l.indices=b,i.st&&(l.attributes.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:h})),l}function addWallPositions(e,t,i,r,n){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i+2],e[t++]=n[i],e[t++]=n[i+1],e[t]=n[i+2],e}function addWallTextureCoordinates(e,t,i,r){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i],e[t]=r[i+1],e}var scratchVertexFormat$1=new VertexFormat;function constructExtrudedRectangle$1(e,t){var i=e._shadowVolume,r=e._offsetAttribute,n=e._vertexFormat,a=e._extrudedHeight,o=e._surfaceHeight,s=e._ellipsoid,l=t.height,c=t.width;i&&((_=VertexFormat.clone(n,scratchVertexFormat$1)).normal=!0,e._vertexFormat=_);var u=constructRectangle$1(e,t);i&&(e._vertexFormat=n);var d=PolygonPipeline.scaleToGeodeticHeight(u.attributes.position.values,o,s,!1),h=2*(z=(d=new Float64Array(d)).length),p=new Float64Array(h);p.set(d);var m=PolygonPipeline.scaleToGeodeticHeight(u.attributes.position.values,a,s);p.set(m,z),u.attributes.position.values=p;var f,g,_=n.normal?new Float32Array(h):void 0,e=n.tangent?new Float32Array(h):void 0,o=n.bitangent?new Float32Array(h):void 0,a=n.st?new Float32Array(h/3*2):void 0;if(n.normal){for(g=u.attributes.normal.values,_.set(g),C=0;C<z;C++)g[C]=-g[C];_.set(g,z),u.attributes.normal.values=_}if(i){g=u.attributes.normal.values,n.normal||(u.attributes.normal=void 0);for(var y=new Float32Array(h),C=0;C<z;C++)g[C]=-g[C];y.set(g,z),u.attributes.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:y})}p=defined(r);if(p&&(_=z/3*2,y=new Uint8Array(_),y=r===GeometryOffsetAttribute$1.TOP?arrayFill(y,1,0,_/2):arrayFill(y,r===GeometryOffsetAttribute$1.NONE?0:1),u.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})),n.tangent){var v=u.attributes.tangent.values;for(e.set(v),C=0;C<z;C++)v[C]=-v[C];e.set(v,z),u.attributes.tangent.values=e}n.bitangent&&(E=u.attributes.bitangent.values,o.set(E),o.set(E,z),u.attributes.bitangent.values=o),n.st&&(f=u.attributes.st.values,a.set(f),a.set(f,z/3*2),u.attributes.st.values=a);var S=u.indices,T=S.length,x=z/3,b=IndexDatatype$1.createTypedArray(h/3,2*T);for(b.set(S),C=0;C<T;C+=3)b[C+T]=S[C+2]+x,b[C+1+T]=S[C+1]+x,b[C+2+T]=S[C]+x;u.indices=b;var e=t.northCap,E=t.southCap,o=l,a=2,h=0,t=4,l=4;e&&(--a,--o,h+=1,t-=2,--l),E&&(--a,--o,h+=1,t-=2,--l);var l=2*((h+=a*c+2*o-t)+l),P=new Float64Array(3*l),A=i?new Float32Array(3*l):void 0,w=p?new Uint8Array(l):void 0,D=n.st?new Float32Array(2*l):void 0,M=r===GeometryOffsetAttribute$1.TOP;p&&!M&&(w=arrayFill(w,r===GeometryOffsetAttribute$1.ALL?1:0));var I=0,R=0,O=0,L=0,F=c*o;for(C=0;C<F;C+=c)P=addWallPositions(P,I,B=3*C,d,m),I+=6,n.st&&(D=addWallTextureCoordinates(D,R,2*C,f),R+=4),i&&(O+=3,A[O++]=g[B],A[O++]=g[B+1],A[O++]=g[B+2]),M&&(w[L++]=1,L+=1);if(E){var N=e?1+F:F,B=3*N;for(C=0;C<2;C++)P=addWallPositions(P,I,B,d,m),I+=6,n.st&&(D=addWallTextureCoordinates(D,R,2*N,f),R+=4),i&&(O+=3,A[O++]=g[B],A[O++]=g[B+1],A[O++]=g[B+2]),M&&(w[L++]=1,L+=1)}else for(C=F-c;C<F;C++)P=addWallPositions(P,I,B=3*C,d,m),I+=6,n.st&&(D=addWallTextureCoordinates(D,R,2*C,f),R+=4),i&&(O+=3,A[O++]=g[B],A[O++]=g[B+1],A[O++]=g[B+2]),M&&(w[L++]=1,L+=1);for(C=F-1;0<C;C-=c)P=addWallPositions(P,I,B=3*C,d,m),I+=6,n.st&&(D=addWallTextureCoordinates(D,R,2*C,f),R+=4),i&&(O+=3,A[O++]=g[B],A[O++]=g[B+1],A[O++]=g[B+2]),M&&(w[L++]=1,L+=1);if(e){var V=F;for(B=3*V,C=0;C<2;C++)P=addWallPositions(P,I,B,d,m),I+=6,n.st&&(D=addWallTextureCoordinates(D,R,2*V,f),R+=4),i&&(O+=3,A[O++]=g[B],A[O++]=g[B+1],A[O++]=g[B+2]),M&&(w[L++]=1,L+=1)}else for(C=c-1;0<=C;C--)P=addWallPositions(P,I,B=3*C,d,m),I+=6,n.st&&(D=addWallTextureCoordinates(D,R,2*C,f),R+=4),i&&(O+=3,A[O++]=g[B],A[O++]=g[B+1],A[O++]=g[B+2]),M&&(w[L++]=1,L+=1);s=calculateAttributesWall(P,n,s);n.st&&(s.attributes.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:D})),i&&(s.attributes.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:A})),p&&(s.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:w}));var k=IndexDatatype$1.createTypedArray(l,6*h),z=P.length/3,$=0;for(C=0;C<z-1;C+=2){var U,G=((U=C)+2)%z,H=Cartesian3.fromArray(P,3*U,v1Scratch),W=Cartesian3.fromArray(P,3*G,v2Scratch);Cartesian3.equalsEpsilon(H,W,CesiumMath.EPSILON10)||(W=(2+(H=(U+1)%z))%z,k[$++]=U,k[$++]=H,k[$++]=G,k[$++]=G,k[$++]=H,k[$++]=W)}return s.indices=k,(s=GeometryPipeline.combineInstances([new GeometryInstance({geometry:u}),new GeometryInstance({geometry:s})]))[0]}var scratchRectanglePoints=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3],nwScratch$1=new Cartographic,stNwScratch=new Cartographic;function computeRectangle(e,t,i,r,n){if(0===i)return Rectangle.clone(e,n);var a=RectangleGeometryLibrary.computeOptions(e,t,i,0,rectangleScratch$4,nwScratch$1),e=a.height,t=a.width,i=scratchRectanglePoints;return RectangleGeometryLibrary.computePosition(a,r,!1,0,0,i[0]),RectangleGeometryLibrary.computePosition(a,r,!1,0,t-1,i[1]),RectangleGeometryLibrary.computePosition(a,r,!1,e-1,0,i[2]),RectangleGeometryLibrary.computePosition(a,r,!1,e-1,t-1,i[3]),Rectangle.fromCartesianArray(i,r,n)}function RectangleGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).rectangle,i=defaultValue(e.height,0),r=defaultValue(e.extrudedHeight,i);this._rectangle=Rectangle.clone(t),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._surfaceHeight=Math.max(i,r),this._rotation=defaultValue(e.rotation,0),this._stRotation=defaultValue(e.stRotation,0),this._vertexFormat=VertexFormat.clone(defaultValue(e.vertexFormat,VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(i,r),this._shadowVolume=defaultValue(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}RectangleGeometry.packedLength=Rectangle.packedLength+Ellipsoid.packedLength+VertexFormat.packedLength+7,RectangleGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Rectangle.pack(e._rectangle,t,i),i+=Rectangle.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchRectangle$7=new Rectangle,scratchEllipsoid$4=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$5={rectangle:scratchRectangle$7,ellipsoid:scratchEllipsoid$4,vertexFormat:scratchVertexFormat$1,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};RectangleGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Rectangle.unpack(e,t,scratchRectangle$7);t+=Rectangle.packedLength;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$4);t+=Ellipsoid.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$1);t+=VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],c=e[t++],u=e[t++],d=1===e[t++],t=e[t];return defined(i)?(i._rectangle=Rectangle.clone(r,i._rectangle),i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._granularity=o,i._surfaceHeight=s,i._rotation=l,i._stRotation=c,i._extrudedHeight=u,i._shadowVolume=d,i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$5.granularity=o,scratchOptions$5.height=s,scratchOptions$5.rotation=l,scratchOptions$5.stRotation=c,scratchOptions$5.extrudedHeight=u,scratchOptions$5.shadowVolume=d,scratchOptions$5.offsetAttribute=-1===t?void 0:t,new RectangleGeometry(scratchOptions$5))},RectangleGeometry.computeRectangle=function(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).rectangle,r=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),n=defaultValue(e.ellipsoid,Ellipsoid.WGS84);return computeRectangle(i,r,defaultValue(e.rotation,0),n,t)};var tangentRotationMatrixScratch=new Matrix3,quaternionScratch=new Quaternion,centerScratch$2=new Cartographic;RectangleGeometry.createGeometry=function(e){if(!CesiumMath.equalsEpsilon(e._rectangle.north,e._rectangle.south,CesiumMath.EPSILON10)&&!CesiumMath.equalsEpsilon(e._rectangle.east,e._rectangle.west,CesiumMath.EPSILON10)){var t=e._rectangle,i=e._ellipsoid,r=e._rotation,n=e._stRotation,a=e._vertexFormat,o=RectangleGeometryLibrary.computeOptions(t,e._granularity,r,n,rectangleScratch$4,nwScratch$1,stNwScratch),s=tangentRotationMatrixScratch;0!==n||0!==r?(c=Rectangle.center(t,centerScratch$2),u=i.geodeticSurfaceNormalCartographic(c,v1Scratch),Quaternion.fromAxisAngle(u,-n,quaternionScratch),Matrix3.fromQuaternion(quaternionScratch,s)):Matrix3.clone(Matrix3.IDENTITY,s);var l,c=e._surfaceHeight,u=e._extrudedHeight,n=!CesiumMath.equalsEpsilon(c,u,0,CesiumMath.EPSILON2);return o.lonScalar=1/e._rectangle.width,o.latScalar=1/e._rectangle.height,o.tangentRotationMatrix=s,t=e._rectangle,c=n?(l=constructExtrudedRectangle$1(e,o),n=BoundingSphere.fromRectangle3D(t,i,c,topBoundingSphere$1),u=BoundingSphere.fromRectangle3D(t,i,u,bottomBoundingSphere$1),BoundingSphere.union(n,u)):((l=constructRectangle$1(e,o)).attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,c,i,!1),defined(e._offsetAttribute)&&(o=l.attributes.position.values.length,arrayFill(o=new Uint8Array(o/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),l.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),BoundingSphere.fromRectangle3D(t,i,c)),a.position||delete l.attributes.position,new Geometry({attributes:l.attributes,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:c,offsetAttribute:e._offsetAttribute})}},RectangleGeometry.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,t=t(r,n),i=i(r,n);return new RectangleGeometry({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:i,height:t,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0})};var unrotatedTextureRectangleScratch=new Rectangle,points2DScratch$1=[new Cartesian2,new Cartesian2,new Cartesian2],rotation2DScratch=new Matrix2,rectangleCenterScratch$2=new Cartographic;function textureCoordinateRotationPoints(e){if(0===e._stRotation)return[0,0,0,1,1,0];var t=Rectangle.clone(e._rectangle,unrotatedTextureRectangleScratch),i=e._granularity,r=e._ellipsoid,t=computeRectangle(t,i,e._rotation-e._stRotation,r,unrotatedTextureRectangleScratch),n=points2DScratch$1;n[0].x=t.west,n[0].y=t.south,n[1].x=t.west,n[1].y=t.north,n[2].x=t.east,n[2].y=t.south;for(var a=e.rectangle,o=Matrix2.fromRotation(e._stRotation,rotation2DScratch),s=Rectangle.center(a,rectangleCenterScratch$2),l=0;l<3;++l){var c=n[l];c.x-=s.longitude,c.y-=s.latitude,Matrix2.multiplyByVector(o,c,c),c.x+=s.longitude,c.y+=s.latitude,c.x=(c.x-a.west)/a.width,c.y=(c.y-a.south)/a.height}i=n[0],r=n[1],t=n[2],e=new Array(6);return Cartesian2.pack(i,e),Cartesian2.pack(r,e,2),Cartesian2.pack(t,e,4),e}Object.defineProperties(RectangleGeometry.prototype,{rectangle:{get:function(){return defined(this._rotatedRectangle)||(this._rotatedRectangle=computeRectangle(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=textureCoordinateRotationPoints(this)),this._textureCoordinateRotationPoints}}});var bottomBoundingSphere=new BoundingSphere,topBoundingSphere=new BoundingSphere,positionScratch$8=new Cartesian3,rectangleScratch$3=new Rectangle;function constructRectangle(e,t){var i=e._ellipsoid,r=t.height,n=t.width,a=t.northCap,o=t.southCap,s=r,l=2,c=0,e=4;a&&(--l,--s,c+=1,e-=2),o&&(--l,--s,c+=1,e-=2),c+=l*n+2*s-e;var u,d=new Float64Array(3*c),h=0,p=0,m=positionScratch$8;if(a)RectangleGeometryLibrary.computePosition(t,i,!1,p,0,m),d[h++]=m.x,d[h++]=m.y,d[h++]=m.z;else for(u=0;u<n;u++)RectangleGeometryLibrary.computePosition(t,i,!1,p,u,m),d[h++]=m.x,d[h++]=m.y,d[h++]=m.z;for(u=n-1,p=1;p<r;p++)RectangleGeometryLibrary.computePosition(t,i,!1,p,u,m),d[h++]=m.x,d[h++]=m.y,d[h++]=m.z;if(p=r-1,!o)for(u=n-2;0<=u;u--)RectangleGeometryLibrary.computePosition(t,i,!1,p,u,m),d[h++]=m.x,d[h++]=m.y,d[h++]=m.z;for(u=0,p=r-2;0<p;p--)RectangleGeometryLibrary.computePosition(t,i,!1,p,u,m),d[h++]=m.x,d[h++]=m.y,d[h++]=m.z;for(var o=d.length/3*2,f=IndexDatatype$1.createTypedArray(d.length/3,o),g=0,_=0;_<d.length/3-1;_++)f[g++]=_,f[g++]=_+1;f[g++]=d.length/3-1,f[g++]=0;o=new Geometry({attributes:new GeometryAttributes,primitiveType:PrimitiveType$1.LINES});return o.attributes.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:d}),o.indices=f,o}function constructExtrudedRectangle(e,t){var i=e._surfaceHeight,r=e._extrudedHeight,n=e._ellipsoid,a=r,o=i,s=constructRectangle(e,t),r=t.height,i=t.width,e=PolygonPipeline.scaleToGeodeticHeight(s.attributes.position.values,o,n,!1),l=e.length,o=new Float64Array(2*l);o.set(e);a=PolygonPipeline.scaleToGeodeticHeight(s.attributes.position.values,a,n);o.set(a,l),s.attributes.position.values=o;n=t.northCap,a=t.southCap,t=4;n&&--t,a&&--t;for(var t=2*(o.length/3+t),c=IndexDatatype$1.createTypedArray(o.length/3,t),l=o.length/6,u=0,d=0;d<l-1;d++)c[u++]=d,c[u++]=d+1,c[u++]=d+l,c[u++]=d+l+1;return c[u++]=l-1,c[u++]=0,c[u++]=l+l-1,c[u++]=l,c[u++]=0,c[u++]=l,r=n?r-1:(c[u++]=n=i-1,c[u++]=n+l,i+r-2),c[u++]=r,c[u++]=r+l,a||(c[u++]=r=i+r-1,c[u]=r+l),s.indices=c,s}function RectangleOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).rectangle,i=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=defaultValue(e.rotation,0),a=defaultValue(e.height,0),o=defaultValue(e.extrudedHeight,a);this._rectangle=Rectangle.clone(t),this._granularity=i,this._ellipsoid=r,this._surfaceHeight=Math.max(a,o),this._rotation=n,this._extrudedHeight=Math.min(a,o),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}RectangleOutlineGeometry.packedLength=Rectangle.packedLength+Ellipsoid.packedLength+5,RectangleOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Rectangle.pack(e._rectangle,t,i),i+=Rectangle.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchRectangle$6=new Rectangle,scratchEllipsoid$3=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$4={rectangle:scratchRectangle$6,ellipsoid:scratchEllipsoid$3,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};RectangleOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Rectangle.unpack(e,t,scratchRectangle$6);t+=Rectangle.packedLength;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$3);t+=Ellipsoid.packedLength;var a=e[t++],o=e[t++],s=e[t++],l=e[t++],t=e[t];return defined(i)?(i._rectangle=Rectangle.clone(r,i._rectangle),i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._surfaceHeight=o,i._rotation=s,i._extrudedHeight=l,i._offsetAttribute=-1===t?void 0:t,i):(scratchOptions$4.granularity=a,scratchOptions$4.height=o,scratchOptions$4.rotation=s,scratchOptions$4.extrudedHeight=l,scratchOptions$4.offsetAttribute=-1===t?void 0:t,new RectangleOutlineGeometry(scratchOptions$4))};var nwScratch=new Cartographic;RectangleOutlineGeometry.createGeometry=function(e){var t=e._rectangle,i=e._ellipsoid,r=RectangleGeometryLibrary.computeOptions(t,e._granularity,e._rotation,0,rectangleScratch$3,nwScratch);if(!CesiumMath.equalsEpsilon(t.north,t.south,CesiumMath.EPSILON10)&&!CesiumMath.equalsEpsilon(t.east,t.west,CesiumMath.EPSILON10)){var n,a,o,s=e._surfaceHeight,l=e._extrudedHeight;return s=!CesiumMath.equalsEpsilon(s,l,0,CesiumMath.EPSILON2)?(a=constructExtrudedRectangle(e,r),defined(e._offsetAttribute)&&(n=a.attributes.position.values.length/3,o=new Uint8Array(n),o=e._offsetAttribute===GeometryOffsetAttribute$1.TOP?arrayFill(o,1,0,n/2):arrayFill(o,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),a.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),o=BoundingSphere.fromRectangle3D(t,i,s,topBoundingSphere),l=BoundingSphere.fromRectangle3D(t,i,l,bottomBoundingSphere),BoundingSphere.union(o,l)):((a=constructRectangle(e,r)).attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,s,i,!1),defined(e._offsetAttribute)&&(r=a.attributes.position.values.length,arrayFill(r=new Uint8Array(r/3),e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),a.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})),BoundingSphere.fromRectangle3D(t,i,s)),new Geometry({attributes:a.attributes,indices:a.indices,primitiveType:PrimitiveType$1.LINES,boundingSphere:s,offsetAttribute:e._offsetAttribute})}};var ReferenceFrame={FIXED:0,INERTIAL:1},ReferenceFrame$1=Object.freeze(ReferenceFrame),implementation;function requestAnimationFramePolyFill(e){return implementation(e)}function sampleTerrain(e,t,i){return e.readyPromise.then(function(){return doSampling(e,t,i)})}function doSampling(e,t,i){for(var r=e.tilingScheme,n=[],a={},o=0;o<i.length;++o){var s=r.positionToTileXY(i[o],t),l=s.toString();a.hasOwnProperty(l)||(s={x:s.x,y:s.y,level:t,tilingScheme:r,terrainProvider:e,positions:[]},a[l]=s,n.push(s)),a[l].positions.push(i[o])}var c=[];for(o=0;o<n.length;++o){var u=n[o],u=u.terrainProvider.requestTileGeometry(u.x,u.y,u.level).then(createInterpolateFunction(u)).otherwise(createMarkFailedFunction(u));c.push(u)}return when.all(c,function(){return i})}function interpolateAndAssignHeight(e,t,i){i=t.interpolateHeight(i,e.longitude,e.latitude);return void 0!==i&&(e.height=i,!0)}function createInterpolateFunction(r){var n=r.positions,a=r.tilingScheme.tileXYToRectangle(r.x,r.y,r.level);return function(t){for(var e=!1,i=0;i<n.length;++i)if(!interpolateAndAssignHeight(n[i],t,a)){e=!0;break}return e?t.createMesh({tilingScheme:r.tilingScheme,x:r.x,y:r.y,level:r.level,exaggeration:1,throttle:!1}).then(function(){for(var e=0;e<n.length;++e)interpolateAndAssignHeight(n[e],t,a)}):when.resolve()}}function createMarkFailedFunction(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e)t[e].height=void 0}}"undefined"!=typeof requestAnimationFrame&&(implementation=requestAnimationFrame),function(){if(!defined(implementation)&&"undefined"!=typeof window)for(var e=["webkit","moz","ms","o"],t=0,i=e.length;t<i&&!defined(implementation);)implementation=window[e[t]+"RequestAnimationFrame"],++t;var r;defined(implementation)||(r=0,implementation=function(e){var t=getTimestamp$1(),i=Math.max(1e3/60-(t-r),0);return r=t+i,setTimeout(function(){e(r)},i)})}();var scratchCartesian2$4=new Cartesian2;function sampleTerrainMostDetailed(l,c){return l.readyPromise.then(function(){for(var e=[],r=[],n=l.availability,t=[],i=0;i<c.length;++i){var a=c[i],o=n.computeMaximumLevelAtPosition(a);0===(r[i]=o)&&(l.tilingScheme.positionToTileXY(a,1,scratchCartesian2$4),defined(s=l.loadTileDataAvailability(scratchCartesian2$4.x,scratchCartesian2$4.y,1))&&t.push(s));var s=e[o];defined(s)||(e[o]=s=[]),s.push(a)}return when.all(t).then(function(){return when.all(e.map(function(e,t){if(defined(e))return sampleTerrain(l,t,e)}))}).then(function(){for(var e=[],t=0;t<c.length;++t){var i=c[t];n.computeMaximumLevelAtPosition(i)!==r[t]&&e.push(i)}if(0<e.length)return sampleTerrainMostDetailed(l,e)}).then(function(){return c})})}var ScreenSpaceEventType={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},ScreenSpaceEventType$1=Object.freeze(ScreenSpaceEventType);function getPosition$1(e,t,i){e=e._element;if(e===document)return i.x=t.clientX,i.y=t.clientY,i;e=e.getBoundingClientRect();return i.x=t.clientX-e.left,i.y=t.clientY-e.top,i}function getInputEventKey(e,t){return defined(t)&&(e+="+"+t),e}function getModifier(e){return e.shiftKey?KeyboardEventModifier$1.SHIFT:e.ctrlKey?KeyboardEventModifier$1.CTRL:e.altKey?KeyboardEventModifier$1.ALT:void 0}var MouseButton={LEFT:0,MIDDLE:1,RIGHT:2};function registerListener(t,e,i,r){function n(e){r(t,e)}FeatureDetection.isInternetExplorer()?i.addEventListener(e,n,!1):i.addEventListener(e,n,{capture:!1,passive:!1}),t._removalFunctions.push(function(){i.removeEventListener(e,n,!1)})}function registerListeners(e){var t=e._element,i=defined(t.disableRootEvents)?t:document;FeatureDetection.supportsPointerEvents()?(registerListener(e,"pointerdown",t,handlePointerDown),registerListener(e,"pointerup",t,handlePointerUp),registerListener(e,"pointermove",t,handlePointerMove),registerListener(e,"pointercancel",t,handlePointerUp)):(registerListener(e,"mousedown",t,handleMouseDown),registerListener(e,"mouseup",i,handleMouseUp),registerListener(e,"mousemove",i,handleMouseMove),registerListener(e,"touchstart",t,handleTouchStart),registerListener(e,"touchend",i,handleTouchEnd),registerListener(e,"touchmove",i,handleTouchMove),registerListener(e,"touchcancel",i,handleTouchEnd)),registerListener(e,"dblclick",t,handleDblClick),registerListener(e,"onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",t,handleWheel)}function unregisterListeners(e){for(var t=e._removalFunctions,i=0;i<t.length;++i)t[i]()}var mouseDownEvent={position:new Cartesian2};function gotTouchEvent(e){e._lastSeenTouchEvent=getTimestamp$1()}function canProcessMouseEvent(e){return getTimestamp$1()-e._lastSeenTouchEvent>ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds}function checkPixelTolerance(e,t,i){var r=e.x-t.x,t=e.y-t.y;return Math.sqrt(r*r+t*t)<i}function handleMouseDown(e,t){if(canProcessMouseEvent(e)){var i,r=t.button;if(e._buttonDown[r]=!0,r===MouseButton.LEFT)i=ScreenSpaceEventType$1.LEFT_DOWN;else if(r===MouseButton.MIDDLE)i=ScreenSpaceEventType$1.MIDDLE_DOWN;else{if(r!==MouseButton.RIGHT)return;i=ScreenSpaceEventType$1.RIGHT_DOWN}var n=getPosition$1(e,t,e._primaryPosition);Cartesian2.clone(n,e._primaryStartPosition),Cartesian2.clone(n,e._primaryPreviousPosition);r=getModifier(t),r=e.getInputAction(i,r);defined(r)&&(Cartesian2.clone(n,mouseDownEvent.position),r(mouseDownEvent),t.preventDefault())}}var mouseUpEvent={position:new Cartesian2},mouseClickEvent={position:new Cartesian2};function cancelMouseEvent(e,t,i,r){var n=getModifier(r),t=e.getInputAction(t,n),n=e.getInputAction(i,n);(defined(t)||defined(n))&&(r=getPosition$1(e,r,e._primaryPosition),defined(t)&&(Cartesian2.clone(r,mouseUpEvent.position),t(mouseUpEvent)),defined(n)&&checkPixelTolerance(e._primaryStartPosition,r,e._clickPixelTolerance)&&(Cartesian2.clone(r,mouseClickEvent.position),n(mouseClickEvent)))}function handleMouseUp(e,t){var i;canProcessMouseEvent(e)&&((i=t.button)!==MouseButton.LEFT&&i!==MouseButton.MIDDLE&&i!==MouseButton.RIGHT||(e._buttonDown[MouseButton.LEFT]&&(cancelMouseEvent(e,ScreenSpaceEventType$1.LEFT_UP,ScreenSpaceEventType$1.LEFT_CLICK,t),e._buttonDown[MouseButton.LEFT]=!1),e._buttonDown[MouseButton.MIDDLE]&&(cancelMouseEvent(e,ScreenSpaceEventType$1.MIDDLE_UP,ScreenSpaceEventType$1.MIDDLE_CLICK,t),e._buttonDown[MouseButton.MIDDLE]=!1),e._buttonDown[MouseButton.RIGHT]&&(cancelMouseEvent(e,ScreenSpaceEventType$1.RIGHT_UP,ScreenSpaceEventType$1.RIGHT_CLICK,t),e._buttonDown[MouseButton.RIGHT]=!1)))}var mouseMoveEvent={startPosition:new Cartesian2,endPosition:new Cartesian2};function handleMouseMove(e,t){var i,r,n;canProcessMouseEvent(e)&&(n=getModifier(t),i=getPosition$1(e,t,e._primaryPosition),r=e._primaryPreviousPosition,defined(n=e.getInputAction(ScreenSpaceEventType$1.MOUSE_MOVE,n))&&(Cartesian2.clone(r,mouseMoveEvent.startPosition),Cartesian2.clone(i,mouseMoveEvent.endPosition),n(mouseMoveEvent)),Cartesian2.clone(i,r),(e._buttonDown[MouseButton.LEFT]||e._buttonDown[MouseButton.MIDDLE]||e._buttonDown[MouseButton.RIGHT])&&t.preventDefault())}var mouseDblClickEvent={position:new Cartesian2};function handleDblClick(e,t){var i,r;t.button===MouseButton.LEFT&&(i=ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK,r=getModifier(t),defined(r=e.getInputAction(i,r))&&(getPosition$1(e,t,mouseDblClickEvent.position),r(mouseDblClickEvent)))}function handleWheel(e,t){var i,r;i=defined(t.deltaY)?(r=t.deltaMode)===t.DOM_DELTA_PIXEL?-t.deltaY:r===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY:0<t.detail?-120*t.detail:t.wheelDelta,defined(i)&&(r=getModifier(t),defined(r=e.getInputAction(ScreenSpaceEventType$1.WHEEL,r))&&(r(i),t.preventDefault()))}function handleTouchStart(e,t){gotTouchEvent(e);for(var i,r,n=t.changedTouches,a=n.length,o=e._positions,s=0;s<a;++s)r=(i=n[s]).identifier,o.set(r,getPosition$1(e,i,new Cartesian2));fireTouchEvents(e,t);var l=e._previousPositions;for(s=0;s<a;++s)r=(i=n[s]).identifier,l.set(r,Cartesian2.clone(o.get(r)))}function handleTouchEnd(e,t){gotTouchEvent(e);for(var i,r=t.changedTouches,n=r.length,a=e._positions,o=0;o<n;++o)i=r[o].identifier,a.remove(i);fireTouchEvents(e,t);var s=e._previousPositions;for(o=0;o<n;++o)i=r[o].identifier,s.remove(i)}var touchStartEvent={position:new Cartesian2},touch2StartEvent={position1:new Cartesian2,position2:new Cartesian2},touchEndEvent={position:new Cartesian2},touchClickEvent={position:new Cartesian2},touchHoldEvent={position:new Cartesian2};function fireTouchEvents(e,t){var i,r,n,a=getModifier(t),o=e._positions,s=o.length,l=e._isPinching;1!==s&&e._buttonDown[MouseButton.LEFT]&&(e._buttonDown[MouseButton.LEFT]=!1,defined(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),defined(i=e.getInputAction(ScreenSpaceEventType$1.LEFT_UP,a))&&(Cartesian2.clone(e._primaryPosition,touchEndEvent.position),i(touchEndEvent)),0!==s||e._isTouchHolding||defined(r=e.getInputAction(ScreenSpaceEventType$1.LEFT_CLICK,a))&&checkPixelTolerance(e._primaryStartPosition,e._previousPositions.values[0],e._clickPixelTolerance)&&(Cartesian2.clone(e._primaryPosition,touchClickEvent.position),r(touchClickEvent)),e._isTouchHolding=!1),0===s&&l&&(e._isPinching=!1,defined(i=e.getInputAction(ScreenSpaceEventType$1.PINCH_END,a))&&i()),1!==s||l||(n=o.values[0],Cartesian2.clone(n,e._primaryPosition),Cartesian2.clone(n,e._primaryStartPosition),Cartesian2.clone(n,e._primaryPreviousPosition),e._buttonDown[MouseButton.LEFT]=!0,defined(i=e.getInputAction(ScreenSpaceEventType$1.LEFT_DOWN,a))&&(Cartesian2.clone(n,touchStartEvent.position),i(touchStartEvent)),e._touchHoldTimer=setTimeout(function(){e.isDestroyed()||(e._touchHoldTimer=void 0,e._isTouchHolding=!0,defined(r=e.getInputAction(ScreenSpaceEventType$1.RIGHT_CLICK,a))&&checkPixelTolerance(e._primaryStartPosition,e._previousPositions.values[0],e._holdPixelTolerance)&&(Cartesian2.clone(e._primaryPosition,touchHoldEvent.position),r(touchHoldEvent)))},ScreenSpaceEventHandler.touchHoldDelayMilliseconds),t.preventDefault()),2!==s||l||(e._isPinching=!0,defined(i=e.getInputAction(ScreenSpaceEventType$1.PINCH_START,a))&&(Cartesian2.clone(o.values[0],touch2StartEvent.position1),Cartesian2.clone(o.values[1],touch2StartEvent.position2),i(touch2StartEvent),t.preventDefault()))}function handleTouchMove(e,t){gotTouchEvent(e);for(var i=t.changedTouches,r=i.length,n=e._positions,a=0;a<r;++a){var o,s=(o=i[a]).identifier,l=n.get(s);defined(l)&&getPosition$1(e,o,l)}fireTouchMoveEvents(e,t);var c=e._previousPositions;for(a=0;a<r;++a)s=(o=i[a]).identifier,Cartesian2.clone(n.get(s),c.get(s))}var touchMoveEvent={startPosition:new Cartesian2,endPosition:new Cartesian2},touchPinchMovementEvent={distance:{startPosition:new Cartesian2,endPosition:new Cartesian2},angleAndHeight:{startPosition:new Cartesian2,endPosition:new Cartesian2}};function fireTouchMoveEvents(e,t){var i,r,n,a,o,s=getModifier(t),l=e._positions,c=e._previousPositions,u=l.length;1===u&&e._buttonDown[MouseButton.LEFT]?(o=l.values[0],Cartesian2.clone(o,e._primaryPosition),n=e._primaryPreviousPosition,defined(i=e.getInputAction(ScreenSpaceEventType$1.MOUSE_MOVE,s))&&(Cartesian2.clone(n,touchMoveEvent.startPosition),Cartesian2.clone(o,touchMoveEvent.endPosition),i(touchMoveEvent)),Cartesian2.clone(o,n),t.preventDefault()):2===u&&e._isPinching&&defined(i=e.getInputAction(ScreenSpaceEventType$1.PINCH_MOVE,s))&&(a=l.values[0],r=l.values[1],o=c.values[0],n=c.values[1],t=r.x-a.x,u=r.y-a.y,e=.25*Math.sqrt(t*t+u*u),s=n.x-o.x,l=n.y-o.y,c=.25*Math.sqrt(s*s+l*l),a=.125*(r.y+a.y),o=.125*(n.y+o.y),t=Math.atan2(u,t),s=Math.atan2(l,s),Cartesian2.fromElements(0,c,touchPinchMovementEvent.distance.startPosition),Cartesian2.fromElements(0,e,touchPinchMovementEvent.distance.endPosition),Cartesian2.fromElements(s,o,touchPinchMovementEvent.angleAndHeight.startPosition),Cartesian2.fromElements(t,a,touchPinchMovementEvent.angleAndHeight.endPosition),i(touchPinchMovementEvent))}function handlePointerDown(e,t){var i,r;t.target.setPointerCapture(t.pointerId),"touch"===t.pointerType?(i=e._positions,r=t.pointerId,i.set(r,getPosition$1(e,t,new Cartesian2)),fireTouchEvents(e,t),e._previousPositions.set(r,Cartesian2.clone(i.get(r)))):handleMouseDown(e,t)}function handlePointerUp(e,t){var i,r;"touch"===t.pointerType?(i=e._positions,r=t.pointerId,i.remove(r),fireTouchEvents(e,t),e._previousPositions.remove(r)):handleMouseUp(e,t)}function handlePointerMove(e,t){var i,r,n;"touch"===t.pointerType?(i=e._positions,r=t.pointerId,defined(n=i.get(r))&&(getPosition$1(e,t,n),fireTouchMoveEvents(e,t),n=e._previousPositions,Cartesian2.clone(i.get(r),n.get(r)))):handleMouseMove(e,t)}function ScreenSpaceEventHandler(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new Cartesian2,this._primaryPosition=new Cartesian2,this._primaryPreviousPosition=new Cartesian2,this._positions=new AssociativeArray,this._previousPositions=new AssociativeArray,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=defaultValue(e,document),registerListeners(this)}function ShowGeometryInstanceAttribute(e){e=defaultValue(e,!0),this.value=ShowGeometryInstanceAttribute.toValue(e)}ScreenSpaceEventHandler.prototype.setInputAction=function(e,t,i){i=getInputEventKey(t,i);this._inputEvents[i]=e},ScreenSpaceEventHandler.prototype.getInputAction=function(e,t){t=getInputEventKey(e,t);return this._inputEvents[t]},ScreenSpaceEventHandler.prototype.removeInputAction=function(e,t){t=getInputEventKey(e,t);delete this._inputEvents[t]},ScreenSpaceEventHandler.prototype.isDestroyed=function(){return!1},ScreenSpaceEventHandler.prototype.destroy=function(){return unregisterListeners(this),destroyObject(this)},ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds=800,ScreenSpaceEventHandler.touchHoldDelayMilliseconds=1500,Object.defineProperties(ShowGeometryInstanceAttribute.prototype,{componentDatatype:{get:function(){return ComponentDatatype$1.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),ShowGeometryInstanceAttribute.toValue=function(e,t){return defined(t)?(t[0]=e,t):new Uint8Array([e])};var Simon1994PlanetaryPositions={};function computeTdbMinusTtSpice(e){e=6.239996+.0172019696544*e;return.001657*Math.sin(e+.01671*Math.sin(e))}var TdtMinusTai=32.184,J2000d=2451545;function taiToTdb(e,t){t=JulianDate.addSeconds(e,TdtMinusTai,t);e=JulianDate.totalDays(t)-J2000d;return t=JulianDate.addSeconds(t,computeTdbMinusTtSpice(e),t)}var epoch=new JulianDate(2451545,0,TimeStandard$1.TAI),MetersPerKilometer=1e3,RadiansPerDegree=CesiumMath.RADIANS_PER_DEGREE,RadiansPerArcSecond=CesiumMath.RADIANS_PER_ARCSECOND,MetersPerAstronomicalUnit=14959787e4,perifocalToEquatorial=new Matrix3;function elementsToCartesian(e,t,i,r,n,a,o){i<0&&(i=-i,n+=CesiumMath.PI);var s=e*(1-t),e=r-n,n=n,r=meanAnomalyToTrueAnomaly(a-r,t);perifocalToCartesianMatrix(e,i,n,perifocalToEquatorial);n=s*(1+t),s=Math.cos(r),r=Math.sin(r),t=n/(1+t*s);return defined(o)?(o.x=t*s,o.y=t*r,o.z=0):o=new Cartesian3(t*s,t*r,0),Matrix3.multiplyByVector(perifocalToEquatorial,o,o)}function meanAnomalyToTrueAnomaly(e,t){return eccentricAnomalyToTrueAnomaly(meanAnomalyToEccentricAnomaly(e,t),t)}var maxIterationCount=50,keplerEqConvergence=CesiumMath.EPSILON8;function meanAnomalyToEccentricAnomaly(e,t){for(var i=Math.floor(e/CesiumMath.TWO_PI),r=(e-=i*CesiumMath.TWO_PI)+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),n=Number.MAX_VALUE,a=0;a<maxIterationCount&&Math.abs(n-r)>keplerEqConvergence;++a)r=(n=r)-(n-t*Math.sin(n)-e)/(1-t*Math.cos(n));return n=r+i*CesiumMath.TWO_PI}function eccentricAnomalyToTrueAnomaly(e,t){var i=Math.floor(e/CesiumMath.TWO_PI);e-=i*CesiumMath.TWO_PI;var r=Math.cos(e)-t,t=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(t,r),r=CesiumMath.zeroToTwoPi(r);return e<0&&(r-=CesiumMath.TWO_PI),r+=i*CesiumMath.TWO_PI}function perifocalToCartesianMatrix(e,t,i,r){var n=Math.cos(e),a=Math.sin(e),o=Math.cos(t),e=Math.sin(t),t=Math.cos(i),i=Math.sin(i);return defined(r)?(r[0]=t*n-i*a*o,r[1]=i*n+t*a*o,r[2]=a*e,r[3]=-t*a-i*n*o,r[4]=-i*a+t*n*o,r[5]=n*e,r[6]=i*e,r[7]=-t*e,r[8]=o):r=new Matrix3(t*n-i*a*o,-t*a-i*n*o,i*e,i*n+t*a*o,-i*a+t*n*o,-t*e,a*e,n*e,o),r}var semiMajorAxis0=1.0000010178*MetersPerAstronomicalUnit,meanLongitude0=100.46645683*RadiansPerDegree,meanLongitude1=1295977422.83429*RadiansPerArcSecond,p1u=16002,p2u=21863,p3u=32004,p4u=10931,p5u=14529,p6u=16368,p7u=15318,p8u=32794,Ca1=64e-7*MetersPerAstronomicalUnit,Ca2=-152e-7*MetersPerAstronomicalUnit,Ca3=62e-7*MetersPerAstronomicalUnit,Ca4=-8e-7*MetersPerAstronomicalUnit,Ca5=32e-7*MetersPerAstronomicalUnit,Ca6=-41e-7*MetersPerAstronomicalUnit,Ca7=19e-7*MetersPerAstronomicalUnit,Ca8=-11e-7*MetersPerAstronomicalUnit,Sa1=1e-7*-150*MetersPerAstronomicalUnit,Sa2=-46e-7*MetersPerAstronomicalUnit,Sa3=68*1e-7*MetersPerAstronomicalUnit,Sa4=54e-7*MetersPerAstronomicalUnit,Sa5=14e-7*MetersPerAstronomicalUnit,Sa6=24e-7*MetersPerAstronomicalUnit,Sa7=-28e-7*MetersPerAstronomicalUnit,Sa8=22e-7*MetersPerAstronomicalUnit,q1u=10,q2u=16002,q3u=21863,q4u=10931,q5u=1473,q6u=32004,q7u=4387,q8u=73,Cl1=-325e-7,Cl2=-322e-7,Cl3=1e-7*-79,Cl4=232*1e-7,Cl5=1e-7*-52,Cl6=97e-7,Cl7=55e-7,Cl8=-41e-7,Sl1=-105e-7,Sl2=-137e-7,Sl3=258e-7,Sl4=35e-7,Sl5=1e-7*-116,Sl6=-88e-7,Sl7=-112e-7,Sl8=-8e-6,scratchDate$1=new JulianDate(0,0,TimeStandard$1.TAI);function computeSimonEarthMoonBarycenter(e,t){taiToTdb(e,scratchDate$1);var i=(scratchDate$1.dayNumber-epoch.dayNumber+(scratchDate$1.secondsOfDay-epoch.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY)/(10*TimeConstants$1.DAYS_PER_JULIAN_CENTURY),r=.3595362*i,e=semiMajorAxis0+Ca1*Math.cos(p1u*r)+Sa1*Math.sin(p1u*r)+Ca2*Math.cos(p2u*r)+Sa2*Math.sin(p2u*r)+Ca3*Math.cos(p3u*r)+Sa3*Math.sin(p3u*r)+Ca4*Math.cos(p4u*r)+Sa4*Math.sin(p4u*r)+Ca5*Math.cos(p5u*r)+Sa5*Math.sin(p5u*r)+Ca6*Math.cos(p6u*r)+Sa6*Math.sin(p6u*r)+Ca7*Math.cos(p7u*r)+Sa7*Math.sin(p7u*r)+Ca8*Math.cos(p8u*r)+Sa8*Math.sin(p8u*r),r=meanLongitude0+meanLongitude1*i+Cl1*Math.cos(q1u*r)+Sl1*Math.sin(q1u*r)+Cl2*Math.cos(q2u*r)+Sl2*Math.sin(q2u*r)+Cl3*Math.cos(q3u*r)+Sl3*Math.sin(q3u*r)+Cl4*Math.cos(q4u*r)+Sl4*Math.sin(q4u*r)+Cl5*Math.cos(q5u*r)+Sl5*Math.sin(q5u*r)+Cl6*Math.cos(q6u*r)+Sl6*Math.sin(q6u*r)+Cl7*Math.cos(q7u*r)+Sl7*Math.sin(q7u*r)+Cl8*Math.cos(q8u*r)+Sl8*Math.sin(q8u*r);return elementsToCartesian(e,.0167086342-.0004203654*i,469.97289*RadiansPerArcSecond*i,102.93734808*RadiansPerDegree+11612.3529*RadiansPerArcSecond*i,174.87317577*RadiansPerDegree-8679.27034*RadiansPerArcSecond*i,r,t)}function computeSimonMoon(e,t){taiToTdb(e,scratchDate$1);var i=(scratchDate$1.dayNumber-epoch.dayNumber+(scratchDate$1.secondsOfDay-epoch.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY)/TimeConstants$1.DAYS_PER_JULIAN_CENTURY,r=i*i,n=r*i,a=n*i,o=383397.7725+.004*i,s=.055545526-16e-9*i,l=5.15668983*RadiansPerDegree,c=-8e-5*i+.02966*r-42e-6*n-13e-8*a,u=83.35324312*RadiansPerDegree,d=14643420.2669*i-38.2702*r-.045047*n+21301e-8*a,h=125.04455501*RadiansPerDegree,p=-6967919.3631*i+6.3602*r+.007625*n-3586e-8*a,m=218.31664563*RadiansPerDegree,f=1732559343.4847*i-6.391*r+.006588*n-3169e-8*a,g=297.85019547*RadiansPerDegree+RadiansPerArcSecond*(1602961601.209*i-6.3706*r+.006593*n-3169e-8*a),_=134.96340251*RadiansPerDegree+RadiansPerArcSecond*(1717915923.2178*i+31.8792*r+.051635*n-2447e-7*a),y=357.52910918*RadiansPerDegree+RadiansPerArcSecond*(129596581.0481*i-.5532*r+136e-6*n-1149e-8*a),C=310.17137918*RadiansPerDegree-RadiansPerArcSecond*(6967051.436*i+6.2068*r+.007618*n-3219e-8*a),v=2*g,S=4*g,T=6*g,x=2*_,b=3*_,e=4*_,a=2*(93.27209062*RadiansPerDegree+RadiansPerArcSecond*(1739527262.8478*i-12.7512*r-.001037*n+417e-8*a));o+=3400.4*Math.cos(v)-635.6*Math.cos(v-_)-235.6*Math.cos(_)+218.1*Math.cos(v-y)+181*Math.cos(v+_),s+=.014216*Math.cos(v-_)+.008551*Math.cos(v-x)-.001383*Math.cos(_)+.001356*Math.cos(v+_)-.001147*Math.cos(S-b)-914e-6*Math.cos(S-x)+869e-6*Math.cos(v-y-_)-627e-6*Math.cos(v)-394e-6*Math.cos(S-e)+282e-6*Math.cos(v-y-x)-279e-6*Math.cos(g-_)-236e-6*Math.cos(x)+231e-6*Math.cos(S)+229e-6*Math.cos(T-e)-201e-6*Math.cos(x-a),c+=486.26*Math.cos(v-a)-40.13*Math.cos(v)+37.51*Math.cos(a)+25.73*Math.cos(x-a)+19.97*Math.cos(v-y-a),d+=-55609*Math.sin(v-_)-34711*Math.sin(v-x)-9792*Math.sin(_)+9385*Math.sin(S-b)+7505*Math.sin(S-x)+5318*Math.sin(v+_)+3484*Math.sin(S-e)-3417*Math.sin(v-y-_)-2530*Math.sin(T-e)-2376*Math.sin(v)-2075*Math.sin(v-b)-1883*Math.sin(x)-1736*Math.sin(T-5*_)+1626*Math.sin(y)-1370*Math.sin(T-b),p+=-5392*Math.sin(v-a)-540*Math.sin(y)-441*Math.sin(v)+423*Math.sin(a)-288*Math.sin(x-a),f+=-3332.9*Math.sin(v)+1197.4*Math.sin(v-_)-662.5*Math.sin(y)+396.3*Math.sin(_)-218*Math.sin(v-y);x=2*C,_=3*C;c+=46.997*Math.cos(C)*i-.614*Math.cos(v-a+C)*i+.614*Math.cos(v-a-C)*i-.0297*Math.cos(x)*r-.0335*Math.cos(C)*r+.0012*Math.cos(v-a+x)*r-16e-5*Math.cos(C)*n+4e-5*Math.cos(_)*n+4e-5*Math.cos(x)*n;y=2.116*Math.sin(C)*i-.111*Math.sin(v-a-C)*i-.0015*Math.sin(C)*r;return d+=y,f+=y,p+=-520.77*Math.sin(C)*i+13.66*Math.sin(v-a+C)*i+1.12*Math.sin(v-C)*i-1.06*Math.sin(a-C)*i+.66*Math.sin(x)*r+.371*Math.sin(C)*r-.035*Math.sin(v-a+x)*r-.015*Math.sin(v-a+C)*r+.0014*Math.sin(C)*n-.0011*Math.sin(_)*n-9e-4*Math.sin(x)*n,elementsToCartesian(o*=MetersPerKilometer,s,l+c*RadiansPerArcSecond,u+d*RadiansPerArcSecond,h+p*RadiansPerArcSecond,m+f*RadiansPerArcSecond,t)}var moonEarthMassRatio=.012300034,factor=moonEarthMassRatio/(moonEarthMassRatio+1)*-1;function computeSimonEarth(e,t){return t=computeSimonMoon(e,t),Cartesian3.multiplyByScalar(t,factor,t)}var axesTransformation=new Matrix3(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),translation=new Cartesian3;function interpolateColors(e,t,i,r,n,a,o){var s=PolylinePipeline.numberOfPoints(e,t,n),l=i.red,c=i.green,u=i.blue,d=i.alpha,h=r.red,e=r.green,t=r.blue,n=r.alpha;if(Color.equals(i,r)){for(y=0;y<s;y++)a[o++]=Color.floatToByte(l),a[o++]=Color.floatToByte(c),a[o++]=Color.floatToByte(u),a[o++]=Color.floatToByte(d);return o}for(var p=(h-l)/s,m=(e-c)/s,f=(t-u)/s,g=(n-d)/s,_=o,y=0;y<s;y++)a[_++]=Color.floatToByte(l+y*p),a[_++]=Color.floatToByte(c+y*m),a[_++]=Color.floatToByte(u+y*f),a[_++]=Color.floatToByte(d+y*g);return _}function SimplePolylineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.colors,r=defaultValue(e.colorsPerVertex,!1);this._positions=t,this._colors=i,this._colorsPerVertex=r,this._arcType=defaultValue(e.arcType,ArcType$1.GEODESIC),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";t=1+t.length*Cartesian3.packedLength;t+=defined(i)?1+i.length*Color.packedLength:1,this.packedLength=t+Ellipsoid.packedLength+3}Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame=function(e,t){return defined(e)||(e=JulianDate.now()),defined(t)||(t=new Cartesian3),translation=computeSimonEarthMoonBarycenter(e,translation),t=Cartesian3.negate(translation,t),computeSimonEarth(e,translation),Cartesian3.subtract(t,translation,t),Matrix3.multiplyByVector(axesTransformation,t,t),t},Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame=function(e,t){return t=computeSimonMoon(e=!defined(e)?JulianDate.now():e,t),Matrix3.multiplyByVector(axesTransformation,t,t),t},SimplePolylineGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._colors,a=defined(o)?o.length:0;for(t[i++]=a,r=0;r<a;++r,i+=Color.packedLength)Color.pack(o[r],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._colorsPerVertex?1:0,t[i++]=e._arcType,t[i]=e._granularity,t},SimplePolylineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r=e[t++],n=new Array(r),a=0;a<r;++a,t+=Cartesian3.packedLength)n[a]=Cartesian3.unpack(e,t);var o=0<(r=e[t++])?new Array(r):void 0;for(a=0;a<r;++a,t+=Color.packedLength)o[a]=Color.unpack(e,t);var s=Ellipsoid.unpack(e,t);t+=Ellipsoid.packedLength;var l=1===e[t++],c=e[t++],u=e[t];return defined(i)?(i._positions=n,i._colors=o,i._ellipsoid=s,i._colorsPerVertex=l,i._arcType=c,i._granularity=u,i):new SimplePolylineGeometry({positions:n,colors:o,ellipsoid:s,colorsPerVertex:l,arcType:c,granularity:u})};var scratchArray1=new Array(2),scratchArray2=new Array(2),generateArcOptionsScratch$1={positions:scratchArray1,height:scratchArray2,ellipsoid:void 0,minDistance:void 0,granularity:void 0};function SphereGeometry(e){var t=defaultValue(e.radius,1),e={radii:new Cartesian3(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new EllipsoidGeometry(e),this._workerName="createSphereGeometry"}SimplePolylineGeometry.createGeometry=function(e){var t=e._positions,i=e._colors,r=e._colorsPerVertex,n=e._arcType,a=e._granularity,e=e._ellipsoid,o=CesiumMath.chordLength(a,e.maximumRadius),s=defined(i)&&!r,l=t.length,c=0;if(n===ArcType$1.GEODESIC||n===ArcType$1.RHUMB){var u,d,h=n===ArcType$1.GEODESIC?(u=CesiumMath.chordLength(a,e.maximumRadius),d=PolylinePipeline.numberOfPoints,PolylinePipeline.generateArc):(u=a,d=PolylinePipeline.numberOfPointsRhumbLine,PolylinePipeline.generateRhumbArc),p=PolylinePipeline.extractHeights(t,e),m=generateArcOptionsScratch$1;if(n===ArcType$1.GEODESIC?m.minDistance=o:m.granularity=a,m.ellipsoid=e,s){for(var f=0,g=0;g<l-1;g++)f+=d(t[g],t[g+1],u)+1;b=new Float64Array(3*f),E=new Uint8Array(4*f),m.positions=scratchArray1,m.height=scratchArray2;var _=0;for(g=0;g<l-1;++g){scratchArray1[0]=t[g],scratchArray1[1]=t[g+1],scratchArray2[0]=p[g],scratchArray2[1]=p[g+1];var y=h(m);if(defined(i))for(var C=y.length/3,v=i[g],S=0;S<C;++S)E[_++]=Color.floatToByte(v.red),E[_++]=Color.floatToByte(v.green),E[_++]=Color.floatToByte(v.blue),E[_++]=Color.floatToByte(v.alpha);b.set(y,c),c+=y.length}}else if(m.positions=t,m.height=p,b=new Float64Array(h(m)),defined(i)){for(E=new Uint8Array(b.length/3*4),g=0;g<l-1;++g)c=interpolateColors(t[g],t[g+1],i[g],i[g+1],o,E,c);var T=i[l-1];E[c++]=Color.floatToByte(T.red),E[c++]=Color.floatToByte(T.green),E[c++]=Color.floatToByte(T.blue),E[c++]=Color.floatToByte(T.alpha)}}else{var x=s?2*l-2:l,b=new Float64Array(3*x),E=defined(i)?new Uint8Array(4*x):void 0,P=0,A=0;for(g=0;g<l;++g){var w=t[g];if(s&&0<g&&(Cartesian3.pack(w,b,P),P+=3,v=i[g-1],E[A++]=Color.floatToByte(v.red),E[A++]=Color.floatToByte(v.green),E[A++]=Color.floatToByte(v.blue),E[A++]=Color.floatToByte(v.alpha)),s&&g===l-1)break;Cartesian3.pack(w,b,P),P+=3,defined(i)&&(v=i[g],E[A++]=Color.floatToByte(v.red),E[A++]=Color.floatToByte(v.green),E[A++]=Color.floatToByte(v.blue),E[A++]=Color.floatToByte(v.alpha))}}T=new GeometryAttributes;T.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:b}),defined(i)&&(T.color=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0})),x=b.length/3;var D=IndexDatatype$1.createTypedArray(x,2*(x-1)),M=0;for(g=0;g<x-1;++g)D[M++]=g,D[M++]=g+1;return new Geometry({attributes:T,indices:D,primitiveType:PrimitiveType$1.LINES,boundingSphere:BoundingSphere.fromPoints(t)})},SphereGeometry.packedLength=EllipsoidGeometry.packedLength,SphereGeometry.pack=function(e,t,i){return EllipsoidGeometry.pack(e._ellipsoidGeometry,t,i)};var scratchEllipsoidGeometry$1=new EllipsoidGeometry,scratchOptions$3={radius:void 0,radii:new Cartesian3,vertexFormat:new VertexFormat,stackPartitions:void 0,slicePartitions:void 0};function SphereOutlineGeometry(e){var t=defaultValue(e.radius,1),e={radii:new Cartesian3(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new EllipsoidOutlineGeometry(e),this._workerName="createSphereOutlineGeometry"}SphereGeometry.unpack=function(e,t,i){t=EllipsoidGeometry.unpack(e,t,scratchEllipsoidGeometry$1);return scratchOptions$3.vertexFormat=VertexFormat.clone(t._vertexFormat,scratchOptions$3.vertexFormat),scratchOptions$3.stackPartitions=t._stackPartitions,scratchOptions$3.slicePartitions=t._slicePartitions,defined(i)?(Cartesian3.clone(t._radii,scratchOptions$3.radii),i._ellipsoidGeometry=new EllipsoidGeometry(scratchOptions$3),i):(scratchOptions$3.radius=t._radii.x,new SphereGeometry(scratchOptions$3))},SphereGeometry.createGeometry=function(e){return EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},SphereOutlineGeometry.packedLength=EllipsoidOutlineGeometry.packedLength,SphereOutlineGeometry.pack=function(e,t,i){return EllipsoidOutlineGeometry.pack(e._ellipsoidGeometry,t,i)};var scratchEllipsoidGeometry=new EllipsoidOutlineGeometry,scratchOptions$2={radius:void 0,radii:new Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};function Spherical(e,t,i){this.clock=defaultValue(e,0),this.cone=defaultValue(t,0),this.magnitude=defaultValue(i,1)}function subdivideArray(e,t){for(var i=[],r=e.length,n=0;n<r;){var a=Math.ceil((r-n)/t--);i.push(e.slice(n,n+a)),n+=a}return i}SphereOutlineGeometry.unpack=function(e,t,i){t=EllipsoidOutlineGeometry.unpack(e,t,scratchEllipsoidGeometry);return scratchOptions$2.stackPartitions=t._stackPartitions,scratchOptions$2.slicePartitions=t._slicePartitions,scratchOptions$2.subdivisions=t._subdivisions,defined(i)?(Cartesian3.clone(t._radii,scratchOptions$2.radii),i._ellipsoidGeometry=new EllipsoidOutlineGeometry(scratchOptions$2),i):(scratchOptions$2.radius=t._radii.x,new SphereOutlineGeometry(scratchOptions$2))},SphereOutlineGeometry.createGeometry=function(e){return EllipsoidOutlineGeometry.createGeometry(e._ellipsoidGeometry)},Spherical.fromCartesian3=function(e,t){var i=e.x,r=e.y,n=e.z,e=i*i+r*r;return(t=!defined(t)?new Spherical:t).clock=Math.atan2(r,i),t.cone=Math.atan2(Math.sqrt(e),n),t.magnitude=Math.sqrt(e+n*n),t},Spherical.clone=function(e,t){if(defined(e))return defined(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Spherical(e.clock,e.cone,e.magnitude)},Spherical.normalize=function(e,t){return defined(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Spherical(e.clock,e.cone,1)},Spherical.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},Spherical.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.clock-t.clock)<=i&&Math.abs(e.cone-t.cone)<=i&&Math.abs(e.magnitude-t.magnitude)<=i},Spherical.prototype.equals=function(e){return Spherical.equals(this,e)},Spherical.prototype.clone=function(e){return Spherical.clone(this,e)},Spherical.prototype.equalsEpsilon=function(e,t){return Spherical.equalsEpsilon(this,e,t)},Spherical.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"};var TileEdge={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7};function TilingScheme(e){}function compareIntervalStartTimes(e,t){return JulianDate.compare(e.start,t.start)}function TimeIntervalCollection(e){if(this._intervals=[],this._changedEvent=new Event,defined(e))for(var t=e.length,i=0;i<t;i++)this.addInterval(e[i])}Object.defineProperties(TilingScheme.prototype,{ellipsoid:{get:DeveloperError.throwInstantiationError},rectangle:{get:DeveloperError.throwInstantiationError},projection:{get:DeveloperError.throwInstantiationError}}),TilingScheme.prototype.getNumberOfXTilesAtLevel=DeveloperError.throwInstantiationError,TilingScheme.prototype.getNumberOfYTilesAtLevel=DeveloperError.throwInstantiationError,TilingScheme.prototype.rectangleToNativeRectangle=DeveloperError.throwInstantiationError,TilingScheme.prototype.tileXYToNativeRectangle=DeveloperError.throwInstantiationError,TilingScheme.prototype.tileXYToRectangle=DeveloperError.throwInstantiationError,TilingScheme.prototype.positionToTileXY=DeveloperError.throwInstantiationError,Object.defineProperties(TimeIntervalCollection.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),TimeIntervalCollection.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof TimeIntervalCollection))return!1;var i=this._intervals,r=e._intervals,n=i.length;if(n!==r.length)return!1;for(var a=0;a<n;a++)if(!TimeInterval.equals(i[a],r[a],t))return!1;return!0},TimeIntervalCollection.prototype.get=function(e){return this._intervals[e]},TimeIntervalCollection.prototype.removeAll=function(){0<this._intervals.length&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},TimeIntervalCollection.prototype.findIntervalContainingDate=function(e){e=this.indexOf(e);return 0<=e?this._intervals[e]:void 0},TimeIntervalCollection.prototype.findDataForIntervalContainingDate=function(e){e=this.indexOf(e);return 0<=e?this._intervals[e].data:void 0},TimeIntervalCollection.prototype.contains=function(e){return 0<=this.indexOf(e)};var indexOfScratch=new TimeInterval;TimeIntervalCollection.prototype.indexOf=function(e){var t=this._intervals;indexOfScratch.start=e,indexOfScratch.stop=e;var i=binarySearch(t,indexOfScratch,compareIntervalStartTimes);return 0<=i?t[i].isStartIncluded?i:0<i&&t[i-1].stop.equals(e)&&t[i-1].isStopIncluded?i-1:~i:0<(i=~i)&&i-1<t.length&&TimeInterval.contains(t[i-1],e)?i-1:~i},TimeIntervalCollection.prototype.findInterval=function(e){for(var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).start,i=e.stop,r=e.isStartIncluded,n=e.isStopIncluded,a=this._intervals,o=0,s=a.length;o<s;o++){var l=a[o];if((!defined(t)||l.start.equals(t))&&(!defined(i)||l.stop.equals(i))&&(!defined(r)||l.isStartIncluded===r)&&(!defined(n)||l.isStopIncluded===n))return a[o]}},TimeIntervalCollection.prototype.addInterval=function(e,t){if(!e.isEmpty){var i=this._intervals;if(0===i.length||JulianDate.greaterThan(e.start,i[i.length-1].stop))return i.push(e),void this._changedEvent.raiseEvent(this);var r,n=binarySearch(i,e,compareIntervalStartTimes);for(n<0?n=~n:0<n&&e.isStartIncluded&&i[n-1].isStartIncluded&&i[n-1].start.equals(e.start)?--n:n<i.length&&!e.isStartIncluded&&i[n].isStartIncluded&&i[n].start.equals(e.start)&&++n,0<n&&(0<(r=JulianDate.compare(i[n-1].stop,e.start))||0===r&&(i[n-1].isStopIncluded||e.isStartIncluded))&&((defined(t)?t(i[n-1].data,e.data):i[n-1].data===e.data)?(e=JulianDate.greaterThan(e.stop,i[n-1].stop)?new TimeInterval({start:i[n-1].start,stop:e.stop,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):new TimeInterval({start:i[n-1].start,stop:i[n-1].stop,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:i[n-1].isStopIncluded||e.stop.equals(i[n-1].stop)&&e.isStopIncluded,data:e.data}),i.splice(n-1,1),--n):((0<(r=JulianDate.compare(i[n-1].stop,e.stop))||0===r&&i[n-1].isStopIncluded&&!e.isStopIncluded)&&i.splice(n,0,new TimeInterval({start:e.stop,stop:i[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:i[n-1].isStopIncluded,data:i[n-1].data})),i[n-1]=new TimeInterval({start:i[n-1].start,stop:e.start,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:i[n-1].data})));n<i.length&&(0<(r=JulianDate.compare(e.stop,i[n].start))||0===r&&(e.isStopIncluded||i[n].isStartIncluded));)if(defined(t)?t(i[n].data,e.data):i[n].data===e.data)e=new TimeInterval({start:e.start,stop:(JulianDate.greaterThan(i[n].stop,e.stop)?i[n]:e).stop,isStartIncluded:e.isStartIncluded,isStopIncluded:(JulianDate.greaterThan(i[n].stop,e.stop)?i[n]:e).isStopIncluded,data:e.data}),i.splice(n,1);else{if(i[n]=new TimeInterval({start:e.stop,stop:i[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:i[n].isStopIncluded,data:i[n].data}),!i[n].isEmpty)break;i.splice(n,1)}i.splice(n,0,e),this._changedEvent.raiseEvent(this)}},TimeIntervalCollection.prototype.removeInterval=function(e){if(e.isEmpty)return!1;var t=this._intervals,i=binarySearch(t,e,compareIntervalStartTimes),r=!1;for(0<(i=i<0?~i:i)&&(JulianDate.greaterThan(t[i-1].stop,e.start)||t[i-1].stop.equals(e.start)&&t[i-1].isStopIncluded&&e.isStartIncluded)&&(r=!0,(JulianDate.greaterThan(t[i-1].stop,e.stop)||t[i-1].isStopIncluded&&!e.isStopIncluded&&t[i-1].stop.equals(e.stop))&&t.splice(i,0,new TimeInterval({start:e.stop,stop:t[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[i-1].isStopIncluded,data:t[i-1].data})),t[i-1]=new TimeInterval({start:t[i-1].start,stop:e.start,isStartIncluded:t[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[i-1].data})),i<t.length&&!e.isStartIncluded&&t[i].isStartIncluded&&e.start.equals(t[i].start)&&(t.splice(i,0,new TimeInterval({start:t[i].start,stop:t[i].start,isStartIncluded:r=!0,isStopIncluded:!0,data:t[i].data})),++i);i<t.length&&JulianDate.greaterThan(e.stop,t[i].stop);)r=!0,t.splice(i,1);return i<t.length&&e.stop.equals(t[i].stop)&&(r=!0,!e.isStopIncluded&&t[i].isStopIncluded?i+1<t.length&&t[i+1].start.equals(e.stop)&&t[i].data===t[i+1].data?(t.splice(i,1),t[i]=new TimeInterval({start:t[i].start,stop:t[i].stop,isStartIncluded:!0,isStopIncluded:t[i].isStopIncluded,data:t[i].data})):t[i]=new TimeInterval({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[i].data}):t.splice(i,1)),i<t.length&&(JulianDate.greaterThan(e.stop,t[i].start)||e.stop.equals(t[i].start)&&e.isStopIncluded&&t[i].isStartIncluded)&&(r=!0,t[i]=new TimeInterval({start:e.stop,stop:t[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[i].isStopIncluded,data:t[i].data})),r&&this._changedEvent.raiseEvent(this),r},TimeIntervalCollection.prototype.intersect=function(e,t,i){for(var r=new TimeIntervalCollection,n=0,a=0,o=this._intervals,s=e._intervals;n<o.length&&a<s.length;){var l,c=o[n],u=s[a];JulianDate.lessThan(c.stop,u.start)?++n:JulianDate.lessThan(u.stop,c.start)?++a:((defined(i)||defined(t)&&t(c.data,u.data)||!defined(t)&&u.data===c.data)&&((l=TimeInterval.intersect(c,u,new TimeInterval,i)).isEmpty||r.addInterval(l,t)),JulianDate.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++n:++a)}return r},TimeIntervalCollection.fromJulianDateArray=function(e,t){defined(t)||(t=new TimeIntervalCollection);var i=e.julianDates,r=i.length,n=e.dataCallback,a=defaultValue(e.isStartIncluded,!0),o=defaultValue(e.isStopIncluded,!0),s=defaultValue(e.leadingInterval,!1),e=defaultValue(e.trailingInterval,!1),l=0;s&&(++l,(u=new TimeInterval({start:Iso8601.MINIMUM_VALUE,stop:i[0],isStartIncluded:!0,isStopIncluded:!a})).data=defined(n)?n(u,t.length):t.length,t.addInterval(u));for(var c=0;c<r-1;++c){var u,d=i[c],h=i[c+1];(u=new TimeInterval({start:d,stop:h,isStartIncluded:t.length!==l||a,isStopIncluded:c===r-2&&o})).data=defined(n)?n(u,t.length):t.length,t.addInterval(u),0}return e&&((u=new TimeInterval({start:i[r-1],stop:Iso8601.MAXIMUM_VALUE,isStartIncluded:!o,isStopIncluded:!0})).data=defined(n)?n(u,t.length):t.length,t.addInterval(u)),t};var scratchGregorianDate=new GregorianDate,monthLengths=[0,31,28,31,30,31,30,31,31,30,31,30,31];function addToDate(e,t,i){defined(i)||(i=new JulianDate),JulianDate.toGregorianDate(e,scratchGregorianDate);var r=scratchGregorianDate.millisecond+t.millisecond,n=scratchGregorianDate.second+t.second,a=scratchGregorianDate.minute+t.minute,e=scratchGregorianDate.hour+t.hour,o=scratchGregorianDate.day+t.day,s=scratchGregorianDate.month+t.month,l=scratchGregorianDate.year+t.year;for(1e3<=r&&(n+=Math.floor(r/1e3),r%=1e3),60<=n&&(a+=Math.floor(n/60),n%=60),60<=a&&(e+=Math.floor(a/60),a%=60),24<=e&&(o+=Math.floor(e/24),e%=24),monthLengths[2]=isLeapYear(l)?29:28;o>monthLengths[s]||13<=s;)o>monthLengths[s]&&(o-=monthLengths[s],++s),13<=s&&(--s,l+=Math.floor(s/12),s%=12,++s),monthLengths[2]=isLeapYear(l)?29:28;return scratchGregorianDate.millisecond=r,scratchGregorianDate.second=n,scratchGregorianDate.minute=a,scratchGregorianDate.hour=e,scratchGregorianDate.day=o,scratchGregorianDate.month=s,scratchGregorianDate.year=l,JulianDate.fromGregorianDate(scratchGregorianDate,i)}var scratchJulianDate$2=new JulianDate,durationRegex=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function parseDuration(e,t){if(defined(e)&&0!==e.length){if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,"P"===e[t.millisecond=0]){var i=e.match(durationRegex);if(!defined(i))return;defined(i[1])&&(t.year=Number(i[1].replace(",","."))),defined(i[2])&&(t.month=Number(i[2].replace(",","."))),defined(i[3])&&(t.day=7*Number(i[3].replace(",","."))),defined(i[4])&&(t.day+=Number(i[4].replace(",","."))),defined(i[5])&&(t.hour=Number(i[5].replace(",","."))),defined(i[6])&&(t.minute=Number(i[6].replace(",","."))),defined(i[7])&&(i=Number(i[7].replace(",",".")),t.second=Math.floor(i),t.millisecond=i%1*1e3)}else"Z"!==e[e.length-1]&&(e+="Z"),JulianDate.toGregorianDate(JulianDate.fromIso8601(e,scratchJulianDate$2),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}}var scratchDuration=new GregorianDate;TimeIntervalCollection.fromIso8601=function(e,t){var i=e.iso8601.split("/"),r=JulianDate.fromIso8601(i[0]),n=JulianDate.fromIso8601(i[1]),a=[];if(parseDuration(i[2],scratchDuration)){var o=JulianDate.clone(r);for(a.push(o);JulianDate.compare(o,n)<0;){o=addToDate(o,scratchDuration);JulianDate.compare(n,o)<=0&&JulianDate.clone(n,o),a.push(o)}}else a.push(r,n);return TimeIntervalCollection.fromJulianDateArray({julianDates:a,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},TimeIntervalCollection.fromIso8601DateArray=function(e,t){return TimeIntervalCollection.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(e){return JulianDate.fromIso8601(e)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},TimeIntervalCollection.fromIso8601DurationArray=function(e,t){for(var i,r,n=e.epoch,a=e.iso8601Durations,o=defaultValue(e.relativeToPrevious,!1),s=[],l=a.length,c=0;c<l;++c)!parseDuration(a[c],scratchDuration)&&0!==c||(i=o&&defined(r)?addToDate(r,scratchDuration):addToDate(n,scratchDuration),s.push(i),r=i);return TimeIntervalCollection.fromJulianDateArray({julianDates:s,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var defaultScale$3=new Cartesian3(1,1,1),defaultTranslation=Cartesian3.ZERO,defaultRotation$1=Quaternion.IDENTITY;function TranslationRotationScale(e,t,i){this.translation=Cartesian3.clone(defaultValue(e,defaultTranslation)),this.rotation=Quaternion.clone(defaultValue(t,defaultRotation$1)),this.scale=Cartesian3.clone(defaultValue(i,defaultScale$3))}function VideoSynchronizer(e){e=defaultValue(e,defaultValue.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=defaultValue(e.epoch,Iso8601.MINIMUM_VALUE),this.tolerance=defaultValue(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function createSeekFunction(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}function DataRectangle(e,t){this.rectangle=e,this.maxLevel=t}function VRTheWorldTerrainProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=Resource.createIfNeeded(e.url);this._resource=t,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer(),this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};t=e.credit;"string"==typeof t&&(t=new Credit(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[];var i,u=this,d=defaultValue(e.ellipsoid,Ellipsoid.WGS84);function r(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"===t){u._tilingScheme=new GeographicTilingScheme({ellipsoid:d});var i=e.getElementsByTagName("TileFormat")[0];u._heightmapWidth=parseInt(i.getAttribute("width"),10),u._heightmapHeight=parseInt(i.getAttribute("height"),10),u._levelZeroMaximumGeometricError=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(d,Math.min(u._heightmapWidth,u._heightmapHeight),u._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n<r.length;++n){var a=r[n],o=CesiumMath.toRadians(parseFloat(a.getAttribute("minx"))),s=CesiumMath.toRadians(parseFloat(a.getAttribute("miny"))),l=CesiumMath.toRadians(parseFloat(a.getAttribute("maxx"))),c=CesiumMath.toRadians(parseFloat(a.getAttribute("maxy"))),a=parseInt(a.getAttribute("maxlevel"),10);u._rectangles.push(new DataRectangle(new Rectangle(o,s,l,c),a))}u._ready=!0,u._readyPromise.resolve(!0)}else h("SRS "+t+" is not supported.")}function h(e){e=defaultValue(e,"An error occurred while accessing "+u._resource.url+".");i=TileProviderError.handleError(i,u,u._errorEvent,e,void 0,void 0,void 0,n)}function n(){when(u._resource.fetchXML(),r,h)}n()}TranslationRotationScale.prototype.equals=function(e){return this===e||defined(e)&&Cartesian3.equals(this.translation,e.translation)&&Quaternion.equals(this.rotation,e.rotation)&&Cartesian3.equals(this.scale,e.scale)},Object.defineProperties(VideoSynchronizer.prototype,{clock:{get:function(){return this._clock},set:function(e){var t=this._clock;t!==e&&(defined(t)&&(this._clockSubscription(),this._clockSubscription=void 0),defined(e)&&(this._clockSubscription=e.onTick.addEventListener(VideoSynchronizer.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var t=this._element;t!==e&&(defined(t)&&t.removeEventListener("seeked",this._seekFunction,!1),defined(e)&&(this._seeking=!1,this._seekFunction=createSeekFunction(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),VideoSynchronizer.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,destroyObject(this)},VideoSynchronizer.prototype.isDestroyed=function(){return!1},VideoSynchronizer.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate!==e.multiplier){var t=this._element;try{t.playbackRate=e.multiplier}catch(e){t.playbackRate=0}this._lastPlaybackRate=e.multiplier}},VideoSynchronizer.prototype._onTick=function(e){var t,i,r,n=this._element;!defined(n)||n.readyState<2||(i=n.paused,(r=e.shouldAnimate)===i&&(r?n.play():n.pause()),this._seeking||this._firstTickAfterSeek?this._firstTickAfterSeek=!1:(this._trySetPlaybackRate(e),t=e.currentTime,i=defaultValue(this.epoch,Iso8601.MINIMUM_VALUE),e=JulianDate.secondsDifference(t,i),t=n.duration,i=n.currentTime,e=n.loop?e=(e%=t)<0?t-e:e:t<e?t:e<0?0:e,r=r?defaultValue(this.tolerance,1):.001,Math.abs(e-i)>r&&(this._seeking=!0,n.currentTime=e)))},Object.defineProperties(VRTheWorldTerrainProvider.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}}),VRTheWorldTerrainProvider.prototype.requestTileGeometry=function(t,i,r,e){var n=this._tilingScheme.getNumberOfYTilesAtLevel(r),e=this._resource.getDerivedResource({url:r+"/"+t+"/"+(n-i-1)+".tif",queryParameters:{cesium:!0},request:e}).fetchImage({preferImageBitmap:!0});if(defined(e)){var a=this;return when(e).then(function(e){return new HeightmapTerrainData({buffer:getImagePixels(e),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:getChildMask(a,t,i,r),structure:a._terrainDataStructure})})}},VRTheWorldTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var rectangleScratch$2=new Rectangle;function getChildMask(e,t,i,r){for(var n=e._tilingScheme,a=e._rectangles,o=n.tileXYToRectangle(t,i,r),s=0,l=0;l<a.length&&15!==s;++l){var c=a[l];c.maxLevel<=r||(c=c.rectangle,defined(Rectangle.intersection(c,o,rectangleScratch$2))&&(isTileInRectangle(n,c,2*t,2*i,r+1)&&(s|=4),isTileInRectangle(n,c,2*t+1,2*i,r+1)&&(s|=8),isTileInRectangle(n,c,2*t,2*i+1,r+1)&&(s|=1),isTileInRectangle(n,c,2*t+1,2*i+1,r+1)&&(s|=2)))}return s}function isTileInRectangle(e,t,i,r,n){n=e.tileXYToRectangle(i,r,n);return defined(Rectangle.intersection(n,t,rectangleScratch$2))}VRTheWorldTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){},VRTheWorldTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){};var WallGeometryLibrary={};function latLonEquals(e,t){return CesiumMath.equalsEpsilon(e.latitude,t.latitude,CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(e.longitude,t.longitude,CesiumMath.EPSILON10)}var scratchCartographic1=new Cartographic,scratchCartographic2=new Cartographic;function removeDuplicates$1(e,t,i,r){var n=(t=arrayRemoveDuplicates(t,Cartesian3.equalsEpsilon)).length;if(!(n<2)){var a=defined(r),o=defined(i),s=new Array(n),l=new Array(n),c=new Array(n),u=t[0];s[0]=u;var d=e.cartesianToCartographic(u,scratchCartographic1);o&&(d.height=i[0]),l[0]=d.height,c[0]=a?r[0]:0;for(var h=l[0]===c[0],p=1,m=1;m<n;++m){var f=t[m],g=e.cartesianToCartographic(f,scratchCartographic2);o&&(g.height=i[m]),h=h&&0===g.height,latLonEquals(d,g)?d.height<g.height&&(l[p-1]=g.height):(s[p]=f,l[p]=g.height,c[p]=a?r[m]:0,h=h&&l[p]===c[p],Cartographic.clone(g,d),++p)}if(!(h||p<2))return s.length=p,l.length=p,c.length=p,{positions:s,topHeights:l,bottomHeights:c}}}var positionsArrayScratch=new Array(2),heightsArrayScratch=new Array(2),generateArcOptionsScratch={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};WallGeometryLibrary.computePositions=function(e,t,i,r,n,a){var o=removeDuplicates$1(e,t,i,r);if(defined(o)){t=o.positions,i=o.topHeights,r=o.bottomHeights;var s=t.length,o=s-2,l=CesiumMath.chordLength(n,e.maximumRadius),c=generateArcOptionsScratch;if(c.minDistance=l,c.ellipsoid=e,a){for(var u=0,d=0;d<s-1;d++)u+=PolylinePipeline.numberOfPoints(t[d],t[d+1],l)+1;var h=new Float64Array(3*u),p=new Float64Array(3*u),m=positionsArrayScratch,f=heightsArrayScratch;c.positions=m,c.height=f;var g=0;for(d=0;d<s-1;d++){m[0]=t[d],m[1]=t[d+1],f[0]=i[d],f[1]=i[d+1];var _=PolylinePipeline.generateArc(c);h.set(_,g),f[0]=r[d],f[1]=r[d+1],p.set(PolylinePipeline.generateArc(c),g),g+=_.length}}else c.positions=t,c.height=i,h=new Float64Array(PolylinePipeline.generateArc(c)),c.height=r,p=new Float64Array(PolylinePipeline.generateArc(c));return{bottomPositions:p,topPositions:h,numCorners:o}}};var scratchCartesian3Position1$1=new Cartesian3,scratchCartesian3Position2$1=new Cartesian3,scratchCartesian3Position4=new Cartesian3,scratchCartesian3Position5=new Cartesian3,scratchBitangent=new Cartesian3,scratchTangent=new Cartesian3,scratchNormal$1=new Cartesian3;function WallGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.maximumHeights,r=e.minimumHeights,n=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),a=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),e=defaultValue(e.ellipsoid,Ellipsoid.WGS84);this._positions=t,this._minimumHeights=r,this._maximumHeights=i,this._vertexFormat=VertexFormat.clone(n),this._granularity=a,this._ellipsoid=Ellipsoid.clone(e),this._workerName="createWallGeometry";t=1+t.length*Cartesian3.packedLength+2;defined(r)&&(t+=r.length),defined(i)&&(t+=i.length),this.packedLength=t+Ellipsoid.packedLength+VertexFormat.packedLength+1}WallGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._minimumHeights,a=defined(o)?o.length:0;if(t[i++]=a,defined(o))for(r=0;r<a;++r)t[i++]=o[r];var s=e._maximumHeights;if(a=defined(s)?s.length:0,t[i++]=a,defined(s))for(r=0;r<a;++r)t[i++]=s[r];return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),t[i+=VertexFormat.packedLength]=e._granularity,t};var scratchEllipsoid$2=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat=new VertexFormat,scratchOptions$1={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:scratchEllipsoid$2,vertexFormat:scratchVertexFormat,granularity:void 0};WallGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r,n,a=e[t++],o=new Array(a),s=0;s<a;++s,t+=Cartesian3.packedLength)o[s]=Cartesian3.unpack(e,t);if(0<(a=e[t++]))for(r=new Array(a),s=0;s<a;++s)r[s]=e[t++];if(0<(a=e[t++]))for(n=new Array(a),s=0;s<a;++s)n[s]=e[t++];var l=Ellipsoid.unpack(e,t,scratchEllipsoid$2);t+=Ellipsoid.packedLength;var c=VertexFormat.unpack(e,t,scratchVertexFormat),u=e[t+=VertexFormat.packedLength];return defined(i)?(i._positions=o,i._minimumHeights=r,i._maximumHeights=n,i._ellipsoid=Ellipsoid.clone(l,i._ellipsoid),i._vertexFormat=VertexFormat.clone(c,i._vertexFormat),i._granularity=u,i):(scratchOptions$1.positions=o,scratchOptions$1.minimumHeights=r,scratchOptions$1.maximumHeights=n,scratchOptions$1.granularity=u,new WallGeometry(scratchOptions$1))},WallGeometry.fromConstantHeights=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.minimumHeight,r=e.maximumHeight,n=defined(i),a=defined(r);if(n||a)for(var o=t.length,s=n?new Array(o):void 0,l=a?new Array(o):void 0,c=0;c<o;++c)n&&(s[c]=i),a&&(l[c]=r);return new WallGeometry({positions:t,maximumHeights:l,minimumHeights:s,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},WallGeometry.createGeometry=function(e){var t=e._positions,i=e._minimumHeights,r=e._maximumHeights,n=e._vertexFormat,a=e._granularity,o=e._ellipsoid,r=WallGeometryLibrary.computePositions(o,t,r,i,a,!0);if(defined(r)){for(var s=r.bottomPositions,l=r.topPositions,i=r.numCorners,c=l.length,a=2*c,u=n.position?new Float64Array(a):void 0,d=n.normal?new Float32Array(a):void 0,h=n.tangent?new Float32Array(a):void 0,p=n.bitangent?new Float32Array(a):void 0,m=n.st?new Float32Array(a/3*2):void 0,f=0,g=0,_=0,y=0,C=0,v=scratchNormal$1,S=scratchTangent,T=scratchBitangent,x=!0,b=0,E=1/((c/=3)-i-1),P=0;P<c;++P){var A,w=3*P,D=Cartesian3.fromArray(l,w,scratchCartesian3Position1$1),M=Cartesian3.fromArray(s,w,scratchCartesian3Position2$1);n.position&&(u[f++]=M.x,u[f++]=M.y,u[f++]=M.z,u[f++]=D.x,u[f++]=D.y,u[f++]=D.z),n.st&&(m[C++]=b,m[C++]=0,m[C++]=b,m[C++]=1),(n.normal||n.tangent||n.bitangent)&&(A=Cartesian3.clone(Cartesian3.ZERO,scratchCartesian3Position5),M=Cartesian3.subtract(D,o.geodeticSurfaceNormal(D,scratchCartesian3Position2$1),scratchCartesian3Position2$1),P+1<c&&(A=Cartesian3.fromArray(l,3+w,scratchCartesian3Position5)),x&&(w=Cartesian3.subtract(A,D,scratchCartesian3Position4),M=Cartesian3.subtract(M,D,scratchCartesian3Position1$1),v=Cartesian3.normalize(Cartesian3.cross(M,w,v),v),x=!1),Cartesian3.equalsEpsilon(D,A,CesiumMath.EPSILON10)?x=!0:(b+=E,n.tangent&&(S=Cartesian3.normalize(Cartesian3.subtract(A,D,S),S)),n.bitangent&&(T=Cartesian3.normalize(Cartesian3.cross(v,S,T),T))),n.normal&&(d[g++]=v.x,d[g++]=v.y,d[g++]=v.z,d[g++]=v.x,d[g++]=v.y,d[g++]=v.z),n.tangent&&(h[y++]=S.x,h[y++]=S.y,h[y++]=S.z,h[y++]=S.x,h[y++]=S.y,h[y++]=S.z),n.bitangent&&(p[_++]=T.x,p[_++]=T.y,p[_++]=T.z,p[_++]=T.x,p[_++]=T.y,p[_++]=T.z))}r=new GeometryAttributes;n.position&&(r.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&(r.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:d})),n.tangent&&(r.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:h})),n.bitangent&&(r.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:p})),n.st&&(r.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:m}));var I=a/3,R=IndexDatatype$1.createTypedArray(I,a-=6*(i+1)),O=0;for(P=0;P<I-2;P+=2){var L=P,F=P+2,N=Cartesian3.fromArray(u,3*L,scratchCartesian3Position1$1),B=Cartesian3.fromArray(u,3*F,scratchCartesian3Position2$1);Cartesian3.equalsEpsilon(N,B,CesiumMath.EPSILON10)||(B=P+3,R[O++]=P+1,R[O++]=L,R[O++]=B,R[O++]=B,R[O++]=L,R[O++]=F)}return new Geometry({attributes:r,indices:R,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:new BoundingSphere.fromVertices(u)})}};var scratchCartesian3Position1=new Cartesian3,scratchCartesian3Position2=new Cartesian3;function WallOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.maximumHeights,r=e.minimumHeights,n=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),e=defaultValue(e.ellipsoid,Ellipsoid.WGS84);this._positions=t,this._minimumHeights=r,this._maximumHeights=i,this._granularity=n,this._ellipsoid=Ellipsoid.clone(e),this._workerName="createWallOutlineGeometry";t=1+t.length*Cartesian3.packedLength+2;defined(r)&&(t+=r.length),defined(i)&&(t+=i.length),this.packedLength=t+Ellipsoid.packedLength+1}WallOutlineGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._minimumHeights,a=defined(o)?o.length:0;if(t[i++]=a,defined(o))for(r=0;r<a;++r)t[i++]=o[r];var s=e._maximumHeights;if(a=defined(s)?s.length:0,t[i++]=a,defined(s))for(r=0;r<a;++r)t[i++]=s[r];return Ellipsoid.pack(e._ellipsoid,t,i),t[i+=Ellipsoid.packedLength]=e._granularity,t};var scratchEllipsoid$1=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:scratchEllipsoid$1,granularity:void 0};function webGLConstantToGlslType(e){switch(e){case WebGLConstants$1.FLOAT:return"float";case WebGLConstants$1.FLOAT_VEC2:return"vec2";case WebGLConstants$1.FLOAT_VEC3:return"vec3";case WebGLConstants$1.FLOAT_VEC4:return"vec4";case WebGLConstants$1.FLOAT_MAT2:return"mat2";case WebGLConstants$1.FLOAT_MAT3:return"mat3";case WebGLConstants$1.FLOAT_MAT4:return"mat4";case WebGLConstants$1.SAMPLER_2D:return"sampler2D";case WebGLConstants$1.BOOL:return"bool"}}function WeightSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).weights,e=e.times;this._times=e,this._weights=t,this._count=t.length/e.length,this._lastTimeIndex=0}function wrapFunction(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}function ConstantProperty(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Event,this.setValue(e)}function createProperty(r,n,a,e,o){return{configurable:e,get:function(){return this[n]},set:function(e){var t=this[n],i=this[a];defined(i)&&(i(),this[a]=void 0),t!==(e=!(!(void 0!==e)||defined(e)&&defined(e.getValue))&&defined(o)?o(e):e)&&(this[n]=e,this._definitionChanged.raiseEvent(this,r,e,t)),defined(e)&&defined(e.definitionChanged)&&(this[a]=e.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,r,e,e)},this))}}}function createConstantProperty$1(e){return new ConstantProperty(e)}function createPropertyDescriptor(e,t,i){return createProperty(e,"_"+e.toString(),"_"+e.toString()+"Subscription",defaultValue(t,!1),defaultValue(i,createConstantProperty$1))}function BillboardGraphics(e){this._definitionChanged=new Event,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.merge(defaultValue(e,defaultValue.EMPTY_OBJECT))}WallOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r,n,a=e[t++],o=new Array(a),s=0;s<a;++s,t+=Cartesian3.packedLength)o[s]=Cartesian3.unpack(e,t);if(0<(a=e[t++]))for(r=new Array(a),s=0;s<a;++s)r[s]=e[t++];if(0<(a=e[t++]))for(n=new Array(a),s=0;s<a;++s)n[s]=e[t++];var l=Ellipsoid.unpack(e,t,scratchEllipsoid$1),c=e[t+=Ellipsoid.packedLength];return defined(i)?(i._positions=o,i._minimumHeights=r,i._maximumHeights=n,i._ellipsoid=Ellipsoid.clone(l,i._ellipsoid),i._granularity=c,i):(scratchOptions.positions=o,scratchOptions.minimumHeights=r,scratchOptions.maximumHeights=n,scratchOptions.granularity=c,new WallOutlineGeometry(scratchOptions))},WallOutlineGeometry.fromConstantHeights=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.minimumHeight,r=e.maximumHeight,n=defined(i),a=defined(r);if(n||a)for(var o=t.length,s=n?new Array(o):void 0,l=a?new Array(o):void 0,c=0;c<o;++c)n&&(s[c]=i),a&&(l[c]=r);return new WallOutlineGeometry({positions:t,maximumHeights:l,minimumHeights:s,ellipsoid:e.ellipsoid})},WallOutlineGeometry.createGeometry=function(e){var t=e._positions,i=e._minimumHeights,r=e._maximumHeights,n=e._granularity,e=e._ellipsoid,i=WallGeometryLibrary.computePositions(e,t,r,i,n,!1);if(defined(i)){var a=i.bottomPositions,o=i.topPositions,s=o.length,n=2*s,l=new Float64Array(n),c=0;for(s/=3,f=0;f<s;++f){var u=3*f,d=Cartesian3.fromArray(o,u,scratchCartesian3Position1),u=Cartesian3.fromArray(a,u,scratchCartesian3Position2);l[c++]=u.x,l[c++]=u.y,l[c++]=u.z,l[c++]=d.x,l[c++]=d.y,l[c++]=d.z}for(var i=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:l})}),h=n/3,p=IndexDatatype$1.createTypedArray(h,n=2*h-4+h),m=0,f=0;f<h-2;f+=2){var g=f,_=f+2,y=Cartesian3.fromArray(l,3*g,scratchCartesian3Position1),C=Cartesian3.fromArray(l,3*_,scratchCartesian3Position2);Cartesian3.equalsEpsilon(y,C,CesiumMath.EPSILON10)||(y=f+3,p[m++]=C=f+1,p[m++]=g,p[m++]=C,p[m++]=y,p[m++]=g,p[m++]=_)}return p[m++]=h-2,p[m++]=h-1,new Geometry({attributes:i,indices:p,primitiveType:PrimitiveType$1.LINES,boundingSphere:new BoundingSphere.fromVertices(l)})}},Object.defineProperties(WeightSpline.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}}),WeightSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,WeightSpline.prototype.wrapTime=Spline.prototype.wrapTime,WeightSpline.prototype.clampTime=Spline.prototype.clampTime,WeightSpline.prototype.evaluate=function(e,t){var i=this.weights,r=this.times,n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),a=(e-r[n])/(r[n+1]-r[n]);defined(t)||(t=new Array(this._count));for(var o=0;o<this._count;o++){var s=n*this._count+o;t[o]=i[s]*(1-a)+i[s+this._count]*a}return t},Object.defineProperties(ConstantProperty.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),ConstantProperty.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},ConstantProperty.prototype.setValue=function(e){var t,i,r=this._value;r!==e&&(t=(i=defined(e))&&"function"==typeof e.clone,(i=i&&"function"==typeof e.equals)&&e.equals(r)||(this._hasClone=t,this._hasEquals=i,this._value=t?e.clone(this._value):e,this._definitionChanged.raiseEvent(this)))},ConstantProperty.prototype.equals=function(e){return this===e||e instanceof ConstantProperty&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},ConstantProperty.prototype.valueOf=function(){return this._value},ConstantProperty.prototype.toString=function(){return String(this._value)},Object.defineProperties(BillboardGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),image:createPropertyDescriptor("image"),scale:createPropertyDescriptor("scale"),pixelOffset:createPropertyDescriptor("pixelOffset"),eyeOffset:createPropertyDescriptor("eyeOffset"),horizontalOrigin:createPropertyDescriptor("horizontalOrigin"),verticalOrigin:createPropertyDescriptor("verticalOrigin"),heightReference:createPropertyDescriptor("heightReference"),color:createPropertyDescriptor("color"),rotation:createPropertyDescriptor("rotation"),alignedAxis:createPropertyDescriptor("alignedAxis"),sizeInMeters:createPropertyDescriptor("sizeInMeters"),width:createPropertyDescriptor("width"),height:createPropertyDescriptor("height"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),pixelOffsetScaleByDistance:createPropertyDescriptor("pixelOffsetScaleByDistance"),imageSubRegion:createPropertyDescriptor("imageSubRegion"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),BillboardGraphics.prototype.clone=function(e){return defined(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):new BillboardGraphics(this)},BillboardGraphics.prototype.merge=function(e){this.show=defaultValue(this._show,e.show),this.image=defaultValue(this._image,e.image),this.scale=defaultValue(this._scale,e.scale),this.pixelOffset=defaultValue(this._pixelOffset,e.pixelOffset),this.eyeOffset=defaultValue(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=defaultValue(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=defaultValue(this._verticalOrigin,e.verticalOrigin),this.heightReference=defaultValue(this._heightReference,e.heightReference),this.color=defaultValue(this._color,e.color),this.rotation=defaultValue(this._rotation,e.rotation),this.alignedAxis=defaultValue(this._alignedAxis,e.alignedAxis),this.sizeInMeters=defaultValue(this._sizeInMeters,e.sizeInMeters),this.width=defaultValue(this._width,e.width),this.height=defaultValue(this._height,e.height),this.scaleByDistance=defaultValue(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=defaultValue(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=defaultValue(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=defaultValue(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=defaultValue(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this._disableDepthTestDistance,e.disableDepthTestDistance)};var HeightReference={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},HeightReference$1=Object.freeze(HeightReference),HorizontalOrigin={CENTER:0,LEFT:1,RIGHT:-1},HorizontalOrigin$1=Object.freeze(HorizontalOrigin),VerticalOrigin={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},VerticalOrigin$1=Object.freeze(VerticalOrigin),BoundingSphereState={DONE:0,PENDING:1,FAILED:2},BoundingSphereState$1=Object.freeze(BoundingSphereState);function Property(){DeveloperError.throwInstantiationError()}Object.defineProperties(Property.prototype,{isConstant:{get:DeveloperError.throwInstantiationError},definitionChanged:{get:DeveloperError.throwInstantiationError}}),Property.prototype.getValue=DeveloperError.throwInstantiationError,Property.prototype.equals=DeveloperError.throwInstantiationError,Property.equals=function(e,t){return e===t||defined(e)&&e.equals(t)},Property.arrayEquals=function(e,t){if(e===t)return!0;if(!defined(e)||!defined(t)||e.length!==t.length)return!1;for(var i=e.length,r=0;r<i;r++)if(!Property.equals(e[r],t[r]))return!1;return!0},Property.isConstant=function(e){return!defined(e)||e.isConstant},Property.getValueOrUndefined=function(e,t,i){return defined(e)?e.getValue(t,i):void 0},Property.getValueOrDefault=function(e,t,i,r){return defined(e)?defaultValue(e.getValue(t,r),i):i},Property.getValueOrClonedDefault=function(e,t,i,r){var n;return defined(e)&&(n=e.getValue(t,r)),n=!defined(n)?i.clone(n):n};var defaultColor$8=Color.WHITE,defaultEyeOffset$1=Cartesian3.ZERO,defaultHeightReference$2=HeightReference$1.NONE,defaultPixelOffset$1=Cartesian2.ZERO,defaultScale$2=1,defaultRotation=0,defaultAlignedAxis=Cartesian3.ZERO,defaultHorizontalOrigin$1=HorizontalOrigin$1.CENTER,defaultVerticalOrigin$1=VerticalOrigin$1.CENTER,defaultSizeInMeters=!1,positionScratch$7=new Cartesian3,colorScratch$6=new Color,eyeOffsetScratch$1=new Cartesian3,pixelOffsetScratch$1=new Cartesian2,scaleByDistanceScratch$2=new NearFarScalar,translucencyByDistanceScratch$2=new NearFarScalar,pixelOffsetScaleByDistanceScratch$1=new NearFarScalar,boundingRectangleScratch=new BoundingRectangle,distanceDisplayConditionScratch$8=new DistanceDisplayCondition;function EntityData$3(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function BillboardVisualizer(e,t){t.collectionChanged.addEventListener(BillboardVisualizer.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function returnPrimitive$2(e,t,i){defined(e)&&(e.billboard=void 0,i.removeBillboard(t))}BillboardVisualizer.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,o,s=t[r],l=s.entity,c=l._billboard,u=s.billboard,d=l.isShowing&&l.isAvailable(e)&&Property.getValueOrDefault(c._show,e,!0);d&&(o=Property.getValueOrUndefined(l._position,e,positionScratch$7),a=Property.getValueOrUndefined(c._image,e),d=defined(o)&&defined(a)),d?(Property.isConstant(l._position)||(i._clusterDirty=!0),defined(u)||((u=i.getBillboard(l)).id=l,u.image=void 0,s.billboard=u),u.show=d,defined(u.image)&&s.textureValue===a||(u.image=a,s.textureValue=a),u.position=o,u.color=Property.getValueOrDefault(c._color,e,defaultColor$8,colorScratch$6),u.eyeOffset=Property.getValueOrDefault(c._eyeOffset,e,defaultEyeOffset$1,eyeOffsetScratch$1),u.heightReference=Property.getValueOrDefault(c._heightReference,e,defaultHeightReference$2),u.pixelOffset=Property.getValueOrDefault(c._pixelOffset,e,defaultPixelOffset$1,pixelOffsetScratch$1),u.scale=Property.getValueOrDefault(c._scale,e,defaultScale$2),u.rotation=Property.getValueOrDefault(c._rotation,e,defaultRotation),u.alignedAxis=Property.getValueOrDefault(c._alignedAxis,e,defaultAlignedAxis),u.horizontalOrigin=Property.getValueOrDefault(c._horizontalOrigin,e,defaultHorizontalOrigin$1),u.verticalOrigin=Property.getValueOrDefault(c._verticalOrigin,e,defaultVerticalOrigin$1),u.width=Property.getValueOrUndefined(c._width,e),u.height=Property.getValueOrUndefined(c._height,e),u.scaleByDistance=Property.getValueOrUndefined(c._scaleByDistance,e,scaleByDistanceScratch$2),u.translucencyByDistance=Property.getValueOrUndefined(c._translucencyByDistance,e,translucencyByDistanceScratch$2),u.pixelOffsetScaleByDistance=Property.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,pixelOffsetScaleByDistanceScratch$1),u.sizeInMeters=Property.getValueOrDefault(c._sizeInMeters,e,defaultSizeInMeters),u.distanceDisplayCondition=Property.getValueOrUndefined(c._distanceDisplayCondition,e,distanceDisplayConditionScratch$8),u.disableDepthTestDistance=Property.getValueOrUndefined(c._disableDepthTestDistance,e),defined(c=Property.getValueOrUndefined(c._imageSubRegion,e,boundingRectangleScratch))&&u.setImageSubRegion(u._imageId,c)):returnPrimitive$2(s,l,i)}return!0},BillboardVisualizer.prototype.getBoundingSphere=function(e,t){e=this._items.get(e.id);if(!defined(e)||!defined(e.billboard))return BoundingSphereState$1.FAILED;e=e.billboard;if(e.heightReference===HeightReference$1.NONE)t.center=Cartesian3.clone(e.position,t.center);else{if(!defined(e._clampedPosition))return BoundingSphereState$1.PENDING;t.center=Cartesian3.clone(e._clampedPosition,t.center)}return t.radius=0,BoundingSphereState$1.DONE},BillboardVisualizer.prototype.isDestroyed=function(){return!1},BillboardVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(BillboardVisualizer.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return destroyObject(this)},BillboardVisualizer.prototype._onCollectionChanged=function(e,t,i,r){for(var n,a=this._items,o=this._cluster,s=t.length-1;-1<s;s--)defined((n=t[s])._billboard)&&defined(n._position)&&a.set(n.id,new EntityData$3(n));for(s=r.length-1;-1<s;s--)defined((n=r[s])._billboard)&&defined(n._position)?a.contains(n.id)||a.set(n.id,new EntityData$3(n)):(returnPrimitive$2(a.get(n.id),n,o),a.remove(n.id));for(s=i.length-1;-1<s;s--)n=i[s],returnPrimitive$2(a.get(n.id),n,o),a.remove(n.id)};var AllMaterialAppearanceFS="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",AllMaterialAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_bitangentEC = czm_normal * bitangent;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",BasicMaterialAppearanceFS="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",BasicMaterialAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",TexturedMaterialAppearanceFS="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",TexturedMaterialAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",BlendEquation={ADD:WebGLConstants$1.FUNC_ADD,SUBTRACT:WebGLConstants$1.FUNC_SUBTRACT,REVERSE_SUBTRACT:WebGLConstants$1.FUNC_REVERSE_SUBTRACT,MIN:WebGLConstants$1.MIN,MAX:WebGLConstants$1.MAX},BlendEquation$1=Object.freeze(BlendEquation),BlendFunction={ZERO:WebGLConstants$1.ZERO,ONE:WebGLConstants$1.ONE,SOURCE_COLOR:WebGLConstants$1.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:WebGLConstants$1.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:WebGLConstants$1.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:WebGLConstants$1.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:WebGLConstants$1.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:WebGLConstants$1.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:WebGLConstants$1.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:WebGLConstants$1.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:WebGLConstants$1.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:WebGLConstants$1.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:WebGLConstants$1.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:WebGLConstants$1.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:WebGLConstants$1.SRC_ALPHA_SATURATE},BlendFunction$1=Object.freeze(BlendFunction),BlendingState={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.SOURCE_ALPHA,functionSourceAlpha:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.SOURCE_ALPHA,functionSourceAlpha:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionDestinationAlpha:BlendFunction$1.ONE})},BlendingState$1=Object.freeze(BlendingState),CullFace={FRONT:WebGLConstants$1.FRONT,BACK:WebGLConstants$1.BACK,FRONT_AND_BACK:WebGLConstants$1.FRONT_AND_BACK},CullFace$1=Object.freeze(CullFace);function Appearance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.material=e.material,this.translucent=defaultValue(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=defaultValue(e.closed,!1)}Object.defineProperties(Appearance.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}}}),Appearance.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),defined(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},Appearance.prototype.isTranslucent=function(){return defined(this.material)&&this.material.isTranslucent()||!defined(this.material)&&this.translucent},Appearance.prototype.getRenderState=function(){var e=this.isTranslucent(),t=clone$1(this.renderState,!1);return e?(t.depthMask=!1,t.blending=BlendingState$1.ALPHA_BLEND):t.depthMask=!0,t},Appearance.getDefaultRenderState=function(e,t,i){var r={depthTest:{enabled:!0}};return e&&(r.depthMask=!1,r.blending=BlendingState$1.ALPHA_BLEND),t&&(r.cull={enabled:!0,face:CullFace$1.BACK}),r=defined(i)?combine$2(i,r,!0):r};var ContextLimits={_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,_highpFloatSupported:!1,_highpIntSupported:!1};function CubeMapFace(e,t,i,r,n,a,o,s,l,c,u){this._context=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelDatatype=o,this._internalFormat=n,this._pixelFormat=a,this._size=s,this._preMultiplyAlpha=l,this._flipY=c,this._initialized=u}Object.defineProperties(ContextLimits,{maximumCombinedTextureImageUnits:{get:function(){return ContextLimits._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return ContextLimits._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return ContextLimits._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return ContextLimits._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return ContextLimits._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return ContextLimits._maximumTextureSize}},maximumVaryingVectors:{get:function(){return ContextLimits._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return ContextLimits._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return ContextLimits._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return ContextLimits._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return ContextLimits._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return ContextLimits._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return ContextLimits._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return ContextLimits._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return ContextLimits._maximumViewportWidth}},maximumViewportHeight:{get:function(){return ContextLimits._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return ContextLimits._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return ContextLimits._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return ContextLimits._maximumColorAttachments}},highpFloatSupported:{get:function(){return ContextLimits._highpFloatSupported}},highpIntSupported:{get:function(){return ContextLimits._highpIntSupported}}}),Object.defineProperties(CubeMapFace.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),CubeMapFace.prototype.copyFrom=function(e,t,i){t=defaultValue(t,0),i=defaultValue(i,0);var r=this._context._gl,n=this._textureTarget,a=this._targetFace;r.activeTexture(r.TEXTURE0),r.bindTexture(n,this._texture);var o=e.width,s=e.height,l=e.arrayBufferView,c=this._size,u=this._pixelFormat,d=this._internalFormat,h=this._pixelDatatype,p=this._preMultiplyAlpha,m=this._flipY,f=4;defined(l)&&(f=PixelFormat$1.alignmentInBytes(u,h,o)),r.pixelStorei(r.UNPACK_ALIGNMENT,f);var g=!1;this._initialized||(0===t&&0===i&&o===c&&s===c?(defined(l)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),m&&(l=PixelFormat$1.flipY(l,u,h,c,c)),r.texImage2D(a,0,d,c,c,0,u,PixelDatatype$1.toWebGLConstant(h,this._context),l)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,m),r.texImage2D(a,0,d,u,PixelDatatype$1.toWebGLConstant(h,this._context),e)),g=!0):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),f=PixelFormat$1.createTypedArray(u,h,c,c),r.texImage2D(a,0,d,c,c,0,u,PixelDatatype$1.toWebGLConstant(h,this._context),f)),this._initialized=!0),g||(defined(l)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),m&&(l=PixelFormat$1.flipY(l,u,h,o,s)),r.texSubImage2D(a,0,t,i,o,s,u,PixelDatatype$1.toWebGLConstant(h,this._context),l)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,m),r.texSubImage2D(a,0,t,i,u,PixelDatatype$1.toWebGLConstant(h,this._context),e))),r.bindTexture(n,null)},CubeMapFace.prototype.copyFromFramebuffer=function(e,t,i,r,n,a){e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,0),n=defaultValue(n,this._size),a=defaultValue(a,this._size);var o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexSubImage2D(this._targetFace,0,e,t,i,r,n,a),o.bindTexture(s,null),this._initialized=!0};var MipmapHint={DONT_CARE:WebGLConstants$1.DONT_CARE,FASTEST:WebGLConstants$1.FASTEST,NICEST:WebGLConstants$1.NICEST,validate:function(e){return e===MipmapHint.DONT_CARE||e===MipmapHint.FASTEST||e===MipmapHint.NICEST}},MipmapHint$1=Object.freeze(MipmapHint),TextureMagnificationFilter={NEAREST:WebGLConstants$1.NEAREST,LINEAR:WebGLConstants$1.LINEAR,validate:function(e){return e===TextureMagnificationFilter.NEAREST||e===TextureMagnificationFilter.LINEAR}},TextureMagnificationFilter$1=Object.freeze(TextureMagnificationFilter),TextureMinificationFilter={NEAREST:WebGLConstants$1.NEAREST,LINEAR:WebGLConstants$1.LINEAR,NEAREST_MIPMAP_NEAREST:WebGLConstants$1.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:WebGLConstants$1.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:WebGLConstants$1.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:WebGLConstants$1.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===TextureMinificationFilter.NEAREST||e===TextureMinificationFilter.LINEAR||e===TextureMinificationFilter.NEAREST_MIPMAP_NEAREST||e===TextureMinificationFilter.LINEAR_MIPMAP_NEAREST||e===TextureMinificationFilter.NEAREST_MIPMAP_LINEAR||e===TextureMinificationFilter.LINEAR_MIPMAP_LINEAR}},TextureMinificationFilter$1=Object.freeze(TextureMinificationFilter),TextureWrap={CLAMP_TO_EDGE:WebGLConstants$1.CLAMP_TO_EDGE,REPEAT:WebGLConstants$1.REPEAT,MIRRORED_REPEAT:WebGLConstants$1.MIRRORED_REPEAT,validate:function(e){return e===TextureWrap.CLAMP_TO_EDGE||e===TextureWrap.REPEAT||e===TextureWrap.MIRRORED_REPEAT}},TextureWrap$1=Object.freeze(TextureWrap);function Sampler(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.wrapS,TextureWrap$1.CLAMP_TO_EDGE),i=defaultValue(e.wrapT,TextureWrap$1.CLAMP_TO_EDGE),r=defaultValue(e.minificationFilter,TextureMinificationFilter$1.LINEAR),n=defaultValue(e.magnificationFilter,TextureMagnificationFilter$1.LINEAR),e=defined(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=n,this._maximumAnisotropy=e}function CubeMap(e){var o,s=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context,t=e.source;defined(t)?(p=[t.positiveX,t.negativeX,t.positiveY,t.negativeY,t.positiveZ,t.negativeZ],o=p[0].width,p[0].height):(o=e.width,e.height);var l=o,c=defaultValue(e.pixelDatatype,PixelDatatype$1.UNSIGNED_BYTE),u=defaultValue(e.pixelFormat,PixelFormat$1.RGBA),d=PixelFormat$1.toInternalFormat(u,c,s),i=6*PixelFormat$1.textureSizeInBytes(u,c,l,l),r=e.preMultiplyAlpha||u===PixelFormat$1.RGB||u===PixelFormat$1.LUMINANCE,n=defaultValue(e.flipY,!0),h=s._gl,a=h.TEXTURE_CUBE_MAP,p=h.createTexture();function m(e,t,i,r){var n=t.arrayBufferView;defined(n)||(n=t.bufferView);var a=4;defined(n)&&(a=PixelFormat$1.alignmentInBytes(u,c,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,a),defined(n)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),r&&(n=PixelFormat$1.flipY(n,u,c,l,l)),h.texImage2D(e,0,d,l,l,0,u,PixelDatatype$1.toWebGLConstant(c,s),n)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,r),h.texImage2D(e,0,d,u,PixelDatatype$1.toWebGLConstant(c,s),t))}h.activeTexture(h.TEXTURE0),h.bindTexture(a,p),defined(t)?(m(h.TEXTURE_CUBE_MAP_POSITIVE_X,t.positiveX,r,n),m(h.TEXTURE_CUBE_MAP_NEGATIVE_X,t.negativeX,r,n),m(h.TEXTURE_CUBE_MAP_POSITIVE_Y,t.positiveY,r,n),m(h.TEXTURE_CUBE_MAP_NEGATIVE_Y,t.negativeY,r,n),m(h.TEXTURE_CUBE_MAP_POSITIVE_Z,t.positiveZ,r,n),m(h.TEXTURE_CUBE_MAP_NEGATIVE_Z,t.negativeZ,r,n)):(h.texImage2D(h.TEXTURE_CUBE_MAP_POSITIVE_X,0,d,l,l,0,u,PixelDatatype$1.toWebGLConstant(c,s),null),h.texImage2D(h.TEXTURE_CUBE_MAP_NEGATIVE_X,0,d,l,l,0,u,PixelDatatype$1.toWebGLConstant(c,s),null),h.texImage2D(h.TEXTURE_CUBE_MAP_POSITIVE_Y,0,d,l,l,0,u,PixelDatatype$1.toWebGLConstant(c,s),null),h.texImage2D(h.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,d,l,l,0,u,PixelDatatype$1.toWebGLConstant(c,s),null),h.texImage2D(h.TEXTURE_CUBE_MAP_POSITIVE_Z,0,d,l,l,0,u,PixelDatatype$1.toWebGLConstant(c,s),null),h.texImage2D(h.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,d,l,l,0,u,PixelDatatype$1.toWebGLConstant(c,s),null)),h.bindTexture(a,null),this._context=s,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=a,this._texture=p,this._pixelFormat=u,this._pixelDatatype=c,this._size=l,this._hasMipmap=!1,this._sizeInBytes=i,this._preMultiplyAlpha=r,this._flipY=n,this._sampler=void 0;t=defined(t);this._positiveX=new CubeMapFace(s,p,a,h.TEXTURE_CUBE_MAP_POSITIVE_X,d,u,c,l,r,n,t),this._negativeX=new CubeMapFace(s,p,a,h.TEXTURE_CUBE_MAP_NEGATIVE_X,d,u,c,l,r,n,t),this._positiveY=new CubeMapFace(s,p,a,h.TEXTURE_CUBE_MAP_POSITIVE_Y,d,u,c,l,r,n,t),this._negativeY=new CubeMapFace(s,p,a,h.TEXTURE_CUBE_MAP_NEGATIVE_Y,d,u,c,l,r,n,t),this._positiveZ=new CubeMapFace(s,p,a,h.TEXTURE_CUBE_MAP_POSITIVE_Z,d,u,c,l,r,n,t),this._negativeZ=new CubeMapFace(s,p,a,h.TEXTURE_CUBE_MAP_NEGATIVE_Z,d,u,c,l,r,n,t),this.sampler=defined(e.sampler)?e.sampler:new Sampler}function Texture(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context,i=e.width,r=e.height,n=e.source;defined(n)&&(defined(i)||(i=defaultValue(n.videoWidth,n.width)),defined(r)||(r=defaultValue(n.videoHeight,n.height)));var a=defaultValue(e.pixelFormat,PixelFormat$1.RGBA),o=defaultValue(e.pixelDatatype,PixelDatatype$1.UNSIGNED_BYTE),s=PixelFormat$1.toInternalFormat(a,o,t),l=PixelFormat$1.isCompressedFormat(s),c=e.preMultiplyAlpha||a===PixelFormat$1.RGB||a===PixelFormat$1.LUMINANCE,u=defaultValue(e.flipY,!0),d=!0,h=t._gl,p=h.TEXTURE_2D,m=h.createTexture();h.activeTexture(h.TEXTURE0),h.bindTexture(p,m);var f=4;if(defined(n)&&defined(n.arrayBufferView)&&!l&&(f=PixelFormat$1.alignmentInBytes(a,o,i)),h.pixelStorei(h.UNPACK_ALIGNMENT,f),defined(n))if(defined(n.arrayBufferView)){h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1);f=n.arrayBufferView;if(l)h.compressedTexImage2D(p,0,s,i,r,0,f);else if(u&&(f=PixelFormat$1.flipY(f,a,o,i,r)),h.texImage2D(p,0,s,i,r,0,a,PixelDatatype$1.toWebGLConstant(o,t),f),defined(n.mipLevels))for(var g=i,_=r,y=0;y<n.mipLevels.length;++y)(g=0|Math.floor(g/2))<1&&(g=1),(_=0|Math.floor(_/2))<1&&(_=1),h.texImage2D(p,y+1,s,g,_,0,a,PixelDatatype$1.toWebGLConstant(o,t),n.mipLevels[y])}else defined(n.framebuffer)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),n.framebuffer!==t.defaultFramebuffer&&n.framebuffer._bind(),h.copyTexImage2D(p,0,s,n.xOffset,n.yOffset,i,r,0),n.framebuffer!==t.defaultFramebuffer&&n.framebuffer._unBind()):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,u),h.texImage2D(p,0,s,a,PixelDatatype$1.toWebGLConstant(o,t),n));else h.texImage2D(p,0,s,i,r,0,a,PixelDatatype$1.toWebGLConstant(o,t),null),d=!1;h.bindTexture(p,null),l=l?PixelFormat$1.compressedTextureSizeInBytes(a,i,r):PixelFormat$1.textureSizeInBytes(a,o,i,r),this._id=createGuid(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=p,this._texture=m,this._internalFormat=s,this._pixelFormat=a,this._pixelDatatype=o,this._width=i,this._height=r,this._dimensions=new Cartesian2(i,r),this._hasMipmap=!1,this._sizeInBytes=l,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=d,this._sampler=void 0,this.sampler=defined(e.sampler)?e.sampler:new Sampler}Object.defineProperties(Sampler.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}}}),Sampler.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},Sampler.NEAREST=Object.freeze(new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.NEAREST,magnificationFilter:TextureMagnificationFilter$1.NEAREST})),Object.defineProperties(CubeMap.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){var t=e.minificationFilter,i=e.magnificationFilter,r=t===TextureMinificationFilter$1.NEAREST_MIPMAP_NEAREST||t===TextureMinificationFilter$1.NEAREST_MIPMAP_LINEAR||t===TextureMinificationFilter$1.LINEAR_MIPMAP_NEAREST||t===TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR,n=this._context,a=this._pixelDatatype;(a===PixelDatatype$1.FLOAT&&!n.textureFloatLinear||a===PixelDatatype$1.HALF_FLOAT&&!n.textureHalfFloatLinear)&&(t=r?TextureMinificationFilter$1.NEAREST_MIPMAP_NEAREST:TextureMinificationFilter$1.NEAREST,i=TextureMagnificationFilter$1.NEAREST);r=n._gl,n=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(n,this._texture),r.texParameteri(n,r.TEXTURE_MIN_FILTER,t),r.texParameteri(n,r.TEXTURE_MAG_FILTER,i),r.texParameteri(n,r.TEXTURE_WRAP_S,e.wrapS),r.texParameteri(n,r.TEXTURE_WRAP_T,e.wrapT),defined(this._textureFilterAnisotropic)&&r.texParameteri(n,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),r.bindTexture(n,null),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(4*this._sizeInBytes/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),CubeMap.prototype.generateMipmap=function(e){e=defaultValue(e,MipmapHint$1.DONT_CARE),this._hasMipmap=!0;var t=this._context._gl,i=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i),t.bindTexture(i,null)},CubeMap.prototype.isDestroyed=function(){return!1},CubeMap.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=destroyObject(this._positiveX),this._negativeX=destroyObject(this._negativeX),this._positiveY=destroyObject(this._positiveY),this._negativeY=destroyObject(this._negativeY),this._positiveZ=destroyObject(this._positiveZ),this._negativeZ=destroyObject(this._negativeZ),destroyObject(this)},Texture.create=function(e){return new Texture(e)},Texture.fromFramebuffer=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context,i=t._gl,r=defaultValue(e.pixelFormat,PixelFormat$1.RGB),n=defaultValue(e.framebufferXOffset,0),a=defaultValue(e.framebufferYOffset,0),o=defaultValue(e.width,i.drawingBufferWidth),i=defaultValue(e.height,i.drawingBufferHeight),e=e.framebuffer;return new Texture({context:t,width:o,height:i,pixelFormat:r,source:{framebuffer:defined(e)?e:t.defaultFramebuffer,xOffset:n,yOffset:a,width:o,height:i}})},Object.defineProperties(Texture.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,i=e.magnificationFilter,r=this._context,n=this._pixelFormat,a=this._pixelDatatype,o=t===TextureMinificationFilter$1.NEAREST_MIPMAP_NEAREST||t===TextureMinificationFilter$1.NEAREST_MIPMAP_LINEAR||t===TextureMinificationFilter$1.LINEAR_MIPMAP_NEAREST||t===TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR;(a===PixelDatatype$1.FLOAT&&!r.textureFloatLinear||a===PixelDatatype$1.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(t=o?TextureMinificationFilter$1.NEAREST_MIPMAP_NEAREST:TextureMinificationFilter$1.NEAREST,i=TextureMagnificationFilter$1.NEAREST),r.webgl2&&PixelFormat$1.isDepthFormat(n)&&(t=TextureMinificationFilter$1.NEAREST,i=TextureMagnificationFilter$1.NEAREST);n=r._gl,r=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(r,this._texture),n.texParameteri(r,n.TEXTURE_MIN_FILTER,t),n.texParameteri(r,n.TEXTURE_MAG_FILTER,i),n.texParameteri(r,n.TEXTURE_WRAP_S,e.wrapS),n.texParameteri(r,n.TEXTURE_WRAP_T,e.wrapT),defined(this._textureFilterAnisotropic)&&n.texParameteri(r,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),n.bindTexture(r,null),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(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),Texture.prototype.copyFrom=function(e,t,i){t=defaultValue(t,0),i=defaultValue(i,0);var r=this._context,n=r._gl,a=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(a,this._texture);var o=e.width,s=e.height,l=e.arrayBufferView,c=this._width,u=this._height,d=this._internalFormat,h=this._pixelFormat,p=this._pixelDatatype,m=this._preMultiplyAlpha,f=this._flipY,g=4;defined(l)&&(g=PixelFormat$1.alignmentInBytes(h,p,o)),n.pixelStorei(n.UNPACK_ALIGNMENT,g);var _=!1;this._initialized||(0===t&&0===i&&o===c&&s===u?(defined(l)?(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),f&&(l=PixelFormat$1.flipY(l,h,p,c,u)),n.texImage2D(a,0,d,c,u,0,h,PixelDatatype$1.toWebGLConstant(p,r),l)):(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,f),n.texImage2D(a,0,d,h,PixelDatatype$1.toWebGLConstant(p,r),e)),_=!0):(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),g=PixelFormat$1.createTypedArray(h,p,c,u),n.texImage2D(a,0,d,c,u,0,h,PixelDatatype$1.toWebGLConstant(p,r),g)),this._initialized=!0),_||(defined(l)?(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),f&&(l=PixelFormat$1.flipY(l,h,p,o,s)),n.texSubImage2D(a,0,t,i,o,s,h,PixelDatatype$1.toWebGLConstant(p,r),l)):(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,f),n.texSubImage2D(a,0,t,i,h,PixelDatatype$1.toWebGLConstant(p,r),e))),n.bindTexture(a,null)},Texture.prototype.copyFromFramebuffer=function(e,t,i,r,n,a){e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,0),n=defaultValue(n,this._width),a=defaultValue(a,this._height);var o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexSubImage2D(s,0,e,t,i,r,n,a),o.bindTexture(s,null),this._initialized=!0},Texture.prototype.generateMipmap=function(e){e=defaultValue(e,MipmapHint$1.DONT_CARE),this._hasMipmap=!0;var t=this._context._gl,i=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i),t.bindTexture(i,null)},Texture.prototype.isDestroyed=function(){return!1},Texture.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),destroyObject(this)};var AspectRampMaterial="uniform sampler2D image;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 rampColor = texture2D(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n",BumpMapMaterial="uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n",CheckerboardMaterial="uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\ncolor = czm_gammaCorrect(color);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",DotMaterial="uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\ncolor = czm_gammaCorrect(color);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",ElevationBandMaterial="uniform sampler2D heights;\nuniform sampler2D colors;\nfloat getHeight(int idx, float invTexSize)\n{\nvec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);\n#ifdef OES_texture_float\nreturn texture2D(heights, uv).x;\n#else\nreturn czm_unpackFloat(texture2D(heights, uv));\n#endif\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat height = materialInput.height;\nfloat invTexSize = 1.0 / float(heightsDimensions.x);\nfloat minHeight = getHeight(0, invTexSize);\nfloat maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);\nif (height < minHeight || height > maxHeight) {\nmaterial.diffuse = vec3(0.0);\nmaterial.alpha = 0.0;\nreturn material;\n}\nint idxBelow = 0;\nint idxAbove = heightsDimensions.x;\nfloat heightBelow = minHeight;\nfloat heightAbove = maxHeight;\nconst int maxIterations = 16;\nfor (int i = 0; i < maxIterations; i++) {\nif (idxBelow >= idxAbove - 1) {\nbreak;\n}\nint idxMid = (idxBelow + idxAbove) / 2;\nfloat heightTex = getHeight(idxMid, invTexSize);\nif (height > heightTex) {\nidxBelow = idxMid;\nheightBelow = heightTex;\n} else {\nidxAbove = idxMid;\nheightAbove = heightTex;\n}\n}\nfloat lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);\nvec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);\nvec4 color = texture2D(colors, colorUv);\nif (color.a > 0.0)\n{\ncolor.rgb /= color.a;\n}\ncolor.rgb = czm_gammaCorrect(color.rgb);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",ElevationContourMaterial="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float spacing;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat distanceToContour = mod(materialInput.height, spacing);\n#ifdef GL_OES_standard_derivatives\nfloat dxc = abs(dFdx(materialInput.height));\nfloat dyc = abs(dFdy(materialInput.height));\nfloat dF = max(dxc, dyc) * czm_pixelRatio * width;\nfloat alpha = (distanceToContour < dF) ? 1.0 : 0.0;\n#else\nfloat alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;\n#endif\nvec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n",ElevationRampMaterial="uniform sampler2D image;\nuniform float minimumHeight;\nuniform float maximumHeight;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\nvec4 rampColor = texture2D(image, vec2(scaledHeight, 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n",FadeMaterial="uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\ncolor = czm_gammaCorrect(color);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",GridMaterial="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec4 halfColor;\nhalfColor.rgb = color.rgb * 0.5;\nhalfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nhalfColor = czm_gammaCorrect(halfColor);\nmaterial.diffuse = halfColor.rgb;\nmaterial.emission = halfColor.rgb;\nmaterial.alpha = halfColor.a;\nreturn material;\n}\n",NormalMapMaterial="uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n",PolylineArrowMaterial="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\n#ifdef GL_OES_standard_derivatives\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;\n#else\nfloat base = 0.975;\n#endif\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\noutColor = czm_gammaCorrect(outColor);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n",PolylineDashMaterial="uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nvarying float v_polylineAngle;\nconst float maskLength = 16.0;\nmat2 rotate(float rad) {\nfloat c = cos(rad);\nfloat s = sin(rad);\nreturn mat2(\nc, s,\n-s, c\n);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\nfloat dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));\nfloat maskIndex = floor(dashPosition * maskLength);\nfloat maskTest = floor(dashPattern / pow(2.0, maskIndex));\nvec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\nif (fragColor.a < 0.005) {\ndiscard;\n}\nfragColor = czm_gammaCorrect(fragColor);\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.a;\nreturn material;\n}\n",PolylineGlowMaterial="uniform vec4 color;\nuniform float glowPower;\nuniform float taperPower;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nif (taperPower <= 0.99999) {\nglow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\n}\nvec4 fragColor;\nfragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nfragColor.a = clamp(0.0, 1.0, glow) * color.a;\nfragColor = czm_gammaCorrect(fragColor);\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.a;\nreturn material;\n}\n",PolylineOutlineMaterial="uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\noutColor = czm_gammaCorrect(outColor);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n",RimLightingMaterial="uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nvec4 outColor = czm_gammaCorrect(color);\nvec4 outRimColor = czm_gammaCorrect(rimColor);\nmaterial.diffuse = outColor.rgb;\nmaterial.emission = outRimColor.rgb * s;\nmaterial.alpha = mix(outColor.a, outRimColor.a, s);\nreturn material;\n}\n",SlopeRampMaterial="uniform sampler2D image;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 rampColor = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n",StripeMaterial="uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\ncolor = czm_gammaCorrect(color);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",WaterMaterial="uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.diffuse = material.diffuse;\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n";function Material(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=defaultValue(e.minificationFilter,TextureMinificationFilter$1.LINEAR),this._magnificationFilter=defaultValue(e.magnificationFilter,TextureMagnificationFilter$1.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,initializeMaterial(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),defined(Material._uniformList[this.type])||(Material._uniformList[this.type]=Object.keys(this._uniforms))}function initializeMaterial(e,t){e=defaultValue(e,defaultValue.EMPTY_OBJECT),t._strict=defaultValue(e.strict,!1),t._count=defaultValue(e.count,0),t._template=clone$1(defaultValue(e.fabric,defaultValue.EMPTY_OBJECT)),t._template.uniforms=clone$1(defaultValue(t._template.uniforms,defaultValue.EMPTY_OBJECT)),t._template.materials=clone$1(defaultValue(t._template.materials,defaultValue.EMPTY_OBJECT)),t.type=defined(t._template.type)?t._template.type:createGuid(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];var i,r=Material._materialCache.getMaterial(t.type);defined(r)&&(i=clone$1(r.fabric,!0),t._template=combine$2(t._template,i,!0),n=r.translucent),checkForTemplateErrors(t),defined(r)||Material._materialCache.addMaterial(t.type,t),createMethodDefinition(t),createUniforms(t),createSubMaterials(t);var r=0===t._translucentFunctions.length||void 0,n=defaultValue(n,r);defined(n=defaultValue(e.translucent,n))&&("function"==typeof n?t._translucentFunctions.push(function(){return n(t)}):t._translucentFunctions.push(n))}function checkForValidProperties(e,t,i,r){if(defined(e))for(var n in e){var a;e.hasOwnProperty(n)&&(a=-1!==t.indexOf(n),(r&&!a||!r&&a)&&i(n,t))}}function invalidNameError(e,t){}function duplicateNameError(e,t){}Material._uniformList={},Material.fromType=function(e,t){var i=new Material({fabric:{type:e}});if(defined(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},Material.prototype.isTranslucent=function(){if(defined(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;r<i;++r){var n=t[r];if(!(e="function"==typeof n?e&&n():e&&n))break}return e},Material.prototype.update=function(e){for(var t=this._loadedImages,i=t.length,r=0;r<i;++r){var n=t[r],a=n.id,o=n.image,n=new Sampler({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),o=defined(o.internalFormat)?new Texture({context:e,pixelFormat:o.internalFormat,width:o.width,height:o.height,source:{arrayBufferView:o.bufferView},sampler:n}):new Texture({context:e,source:o,sampler:n});this._textures[a]=o;n=a+"Dimensions";this.uniforms.hasOwnProperty(n)&&((n=this.uniforms[n]).x=o._width,n.y=o._height)}t.length=0;var s=this._loadedCubeMaps,i=s.length;for(r=0;r<i;++r){var l=s[r];a=l.id;l=l.images,l=new CubeMap({context:e,source:{positiveX:l[0],negativeX:l[1],positiveY:l[2],negativeY:l[3],positiveZ:l[4],negativeZ:l[5]},sampler:new Sampler({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[a]=l}s.length=0;var c=this._updateFunctions;for(i=c.length,r=0;r<i;++r)c[r](this,e);var u,d=this.materials;for(u in d)d.hasOwnProperty(u)&&d[u].update(e)},Material.prototype.isDestroyed=function(){return!1},Material.prototype.destroy=function(){var e,t,i=this._textures;for(e in i)!i.hasOwnProperty(e)||(t=i[e])!==this._defaultTexture&&t.destroy();var r,n=this.materials;for(r in n)n.hasOwnProperty(r)&&n[r].destroy();return destroyObject(this)};var templateProperties=["type","materials","uniforms","components","source"],componentProperties=["diffuse","specular","shininess","normal","emission","alpha"];function checkForTemplateErrors(e){var t=e._template,i=t.uniforms,r=t.materials,e=t.components;checkForValidProperties(t,templateProperties,invalidNameError,!0),checkForValidProperties(e,componentProperties,invalidNameError,!0);var n,a=[];for(n in r)r.hasOwnProperty(n)&&a.push(n);checkForValidProperties(i,a,duplicateNameError,!1)}function isMaterialFused(e,t){var i,r=t._template.materials;for(i in r)if(r.hasOwnProperty(i)&&-1<e.indexOf(i))return!0;return!1}function createMethodDefinition(e){var t=e._template.components,i=e._template.source;if(defined(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",defined(t)){var r,n,a=0<Object.keys(e._template.materials).length;for(r in t)t.hasOwnProperty(r)&&("diffuse"===r||"emission"===r?(n=a&&isMaterialFused(t[r],e)?t[r]:"czm_gammaCorrect("+t[r]+")",e.shaderSource+="material."+r+" = "+n+"; \n"):e.shaderSource+="alpha"===r?"material.alpha = "+t.alpha+"; \n":"material."+r+" = "+t[r]+";\n")}e.shaderSource+="return material;\n}\n"}}var matrixMap={mat2:Matrix2,mat3:Matrix3,mat4:Matrix4},ktxRegex$2=/\.ktx$/i,crnRegex$2=/\.crn$/i;function createTexture2DUpdateFunction(l){var c;return function(t,e){var i=t.uniforms,r=i[l],n=c!==r;c=r;var a,o=t._textures[l];if(r instanceof HTMLVideoElement)if(2<=r.readyState){if(n&&defined(o)&&(o!==e.defaultTexture&&o.destroy(),o=void 0),!defined(o)||o===e.defaultTexture){var o=new Texture({context:e,source:r,sampler:new Sampler({minificationFilter:t._minificationFilter,magnificationFilter:t._magnificationFilter})});return void(t._textures[l]=o)}o.copyFrom(r)}else defined(o)||(t._textures[l]=e.defaultTexture);else{if(r instanceof Texture&&r!==o){t._texturePaths[l]=void 0;var s=t._textures[l];return s!==t._defaultTexture&&s.destroy(),t._textures[l]=r,void(i.hasOwnProperty(s=l+"Dimensions")&&((a=i[s]).x=r._width,a.y=r._height))}defined(o)||(t._texturePaths[l]=void 0,defined(t._defaultTexture)||(t._defaultTexture=e.defaultTexture),o=t._textures[l]=t._defaultTexture,i.hasOwnProperty(s=l+"Dimensions")&&((a=i[s]).x=o._width,a.y=o._height)),r!==Material.DefaultImageId&&(o=r instanceof Resource,(!defined(t._texturePaths[l])||o&&r.url!==t._texturePaths[l].url||!o&&r!==t._texturePaths[l])&&("string"==typeof r||o?(o=o?r:Resource.createIfNeeded(r),when(ktxRegex$2.test(o.url)?loadKTX(o):crnRegex$2.test(o.url)?loadCRN(o):o.fetchImage(),function(e){t._loadedImages.push({id:l,image:e})})):(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&t._loadedImages.push({id:l,image:r}),t._texturePaths[l]=r))}}}function createCubeMapUpdateFunction(n){return function(t,e){var i=t.uniforms[n];if(i instanceof CubeMap){var r=t._textures[n];return r!==t._defaultTexture&&r.destroy(),t._texturePaths[n]=void 0,void(t._textures[n]=i)}defined(t._textures[n])||(t._texturePaths[n]=void 0,t._textures[n]=e.defaultCubeMap),i===Material.DefaultCubeMapId||(e=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ)!==t._texturePaths[n]&&(i=[Resource.createIfNeeded(i.positiveX).fetchImage(),Resource.createIfNeeded(i.negativeX).fetchImage(),Resource.createIfNeeded(i.positiveY).fetchImage(),Resource.createIfNeeded(i.negativeY).fetchImage(),Resource.createIfNeeded(i.positiveZ).fetchImage(),Resource.createIfNeeded(i.negativeZ).fetchImage()],when.all(i).then(function(e){t._loadedCubeMaps.push({id:n,images:e})}),t._texturePaths[n]=e)}}function createUniforms(e){var t,i=e._template.uniforms;for(t in i)i.hasOwnProperty(t)&&createUniform$1(e,t)}function createUniform$1(e,t){e._strict;var i,r,n=e._template.uniforms,a=n[t],o=getUniformType(a);"channels"===o?replaceToken(e,t,a,!1):("sampler2D"!==o||0<getNumberOfTokens(e,i=t+"Dimensions")&&(n[i]={type:"ivec3",x:1,y:1},createUniform$1(e,i)),new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;").test(e.shaderSource)||(e.shaderSource="uniform "+o+" "+t+";"+e.shaderSource),i=t+"_"+e._count++,replaceToken(e,t,i),e.uniforms[t]=a,"sampler2D"===o?(e._uniforms[i]=function(){return e._textures[t]},e._updateFunctions.push(createTexture2DUpdateFunction(t))):"samplerCube"===o?(e._uniforms[i]=function(){return e._textures[t]},e._updateFunctions.push(createCubeMapUpdateFunction(t))):-1!==o.indexOf("mat")?(r=new matrixMap[o],e._uniforms[i]=function(){return matrixMap[o].fromColumnMajorArray(e.uniforms[t],r)}):e._uniforms[i]=function(){return e.uniforms[t]})}function getUniformType(e){var t=e.type;if(!defined(t)){var i=typeof e;if("number"==i)t="float";else if("boolean"==i)t="bool";else if("string"==i||e instanceof Resource||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===Material.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"==i)if(Array.isArray(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var r,n=0;for(r in e)e.hasOwnProperty(r)&&(n+=1);2<=n&&n<=4?t="vec"+n:6===n&&(t="samplerCube")}}return t}function createSubMaterials(e){var t,i,r,n=e._strict,a=e._template.materials;for(t in a)a.hasOwnProperty(t)&&(i=new Material({strict:n,fabric:a[t],count:e._count}),e._count=i._count,e._uniforms=combine$2(e._uniforms,i._uniforms,!0),e.materials[t]=i,e._translucentFunctions=e._translucentFunctions.concat(i._translucentFunctions),replaceToken(i,r="czm_getMaterial",r=r+"_"+e._count++),e.shaderSource=i.shaderSource+e.shaderSource,replaceToken(e,t,r+"(materialInput)"))}function replaceToken(e,t,r,i){i=defaultValue(i,!0);var n=0,t=new RegExp("([\\w"+(i?".":"")+"])?"+t+"([\\w])?","g");return e.shaderSource=e.shaderSource.replace(t,function(e,t,i){return t||i?e:(n+=1,r)}),n}function getNumberOfTokens(e,t,i){return replaceToken(e,t,t,i)}function MaterialAppearance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.translucent,!0),i=defaultValue(e.closed,!1),r=defaultValue(e.materialSupport,MaterialAppearance.MaterialSupport.TEXTURED);this.material=defined(e.material)?e.material:Material.fromType(Material.ColorType),this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,r.vertexShaderSource),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,r.fragmentShaderSource),this._renderState=Appearance.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._materialSupport=r,this._vertexFormat=r.vertexFormat,this._flat=defaultValue(e.flat,!1),this._faceForward=defaultValue(e.faceForward,!i)}Material._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},Material.DefaultImageId="czm_defaultImage",Material.DefaultCubeMapId="czm_defaultCubeMap",Material.ColorType="Color",Material._materialCache.addMaterial(Material.ColorType,{fabric:{type:Material.ColorType,uniforms:{color:new Color(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),Material.ImageType="Image",Material._materialCache.addMaterial(Material.ImageType,{fabric:{type:Material.ImageType,uniforms:{image:Material.DefaultImageId,repeat:new Cartesian2(1,1),color:new Color(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),Material.DiffuseMapType="DiffuseMap",Material._materialCache.addMaterial(Material.DiffuseMapType,{fabric:{type:Material.DiffuseMapType,uniforms:{image:Material.DefaultImageId,channels:"rgb",repeat:new Cartesian2(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Material.AlphaMapType="AlphaMap",Material._materialCache.addMaterial(Material.AlphaMapType,{fabric:{type:Material.AlphaMapType,uniforms:{image:Material.DefaultImageId,channel:"a",repeat:new Cartesian2(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),Material.SpecularMapType="SpecularMap",Material._materialCache.addMaterial(Material.SpecularMapType,{fabric:{type:Material.SpecularMapType,uniforms:{image:Material.DefaultImageId,channel:"r",repeat:new Cartesian2(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),Material.EmissionMapType="EmissionMap",Material._materialCache.addMaterial(Material.EmissionMapType,{fabric:{type:Material.EmissionMapType,uniforms:{image:Material.DefaultImageId,channels:"rgb",repeat:new Cartesian2(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Material.BumpMapType="BumpMap",Material._materialCache.addMaterial(Material.BumpMapType,{fabric:{type:Material.BumpMapType,uniforms:{image:Material.DefaultImageId,channel:"r",strength:.8,repeat:new Cartesian2(1,1)},source:BumpMapMaterial},translucent:!1}),Material.NormalMapType="NormalMap",Material._materialCache.addMaterial(Material.NormalMapType,{fabric:{type:Material.NormalMapType,uniforms:{image:Material.DefaultImageId,channels:"rgb",strength:.8,repeat:new Cartesian2(1,1)},source:NormalMapMaterial},translucent:!1}),Material.GridType="Grid",Material._materialCache.addMaterial(Material.GridType,{fabric:{type:Material.GridType,uniforms:{color:new Color(0,1,0,1),cellAlpha:.1,lineCount:new Cartesian2(8,8),lineThickness:new Cartesian2(1,1),lineOffset:new Cartesian2(0,0)},source:GridMaterial},translucent:function(e){e=e.uniforms;return e.color.alpha<1||e.cellAlpha<1}}),Material.StripeType="Stripe",Material._materialCache.addMaterial(Material.StripeType,{fabric:{type:Material.StripeType,uniforms:{horizontal:!0,evenColor:new Color(1,1,1,.5),oddColor:new Color(0,0,1,.5),offset:0,repeat:5},source:StripeMaterial},translucent:function(e){e=e.uniforms;return e.evenColor.alpha<1||e.oddColor.alpha<1}}),Material.CheckerboardType="Checkerboard",Material._materialCache.addMaterial(Material.CheckerboardType,{fabric:{type:Material.CheckerboardType,uniforms:{lightColor:new Color(1,1,1,.5),darkColor:new Color(0,0,0,.5),repeat:new Cartesian2(5,5)},source:CheckerboardMaterial},translucent:function(e){e=e.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<1}}),Material.DotType="Dot",Material._materialCache.addMaterial(Material.DotType,{fabric:{type:Material.DotType,uniforms:{lightColor:new Color(1,1,0,.75),darkColor:new Color(0,1,1,.75),repeat:new Cartesian2(5,5)},source:DotMaterial},translucent:function(e){e=e.uniforms;return e.lightColor.alpha<1||e.darkColor.alpha<1}}),Material.WaterType="Water",Material._materialCache.addMaterial(Material.WaterType,{fabric:{type:Material.WaterType,uniforms:{baseWaterColor:new Color(.2,.3,.6,1),blendColor:new Color(0,1,.699,1),specularMap:Material.DefaultImageId,normalMap:Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:WaterMaterial},translucent:function(e){e=e.uniforms;return e.baseWaterColor.alpha<1||e.blendColor.alpha<1}}),Material.RimLightingType="RimLighting",Material._materialCache.addMaterial(Material.RimLightingType,{fabric:{type:Material.RimLightingType,uniforms:{color:new Color(1,0,0,.7),rimColor:new Color(1,1,1,.4),width:.3},source:RimLightingMaterial},translucent:function(e){e=e.uniforms;return e.color.alpha<1||e.rimColor.alpha<1}}),Material.FadeType="Fade",Material._materialCache.addMaterial(Material.FadeType,{fabric:{type:Material.FadeType,uniforms:{fadeInColor:new Color(1,0,0,1),fadeOutColor:new Color(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new Cartesian2(.5,.5)},source:FadeMaterial},translucent:function(e){e=e.uniforms;return e.fadeInColor.alpha<1||e.fadeOutColor.alpha<1}}),Material.PolylineArrowType="PolylineArrow",Material._materialCache.addMaterial(Material.PolylineArrowType,{fabric:{type:Material.PolylineArrowType,uniforms:{color:new Color(1,1,1,1)},source:PolylineArrowMaterial},translucent:!0}),Material.PolylineDashType="PolylineDash",Material._materialCache.addMaterial(Material.PolylineDashType,{fabric:{type:Material.PolylineDashType,uniforms:{color:new Color(1,0,1,1),gapColor:new Color(0,0,0,0),dashLength:16,dashPattern:255},source:PolylineDashMaterial},translucent:!0}),Material.PolylineGlowType="PolylineGlow",Material._materialCache.addMaterial(Material.PolylineGlowType,{fabric:{type:Material.PolylineGlowType,uniforms:{color:new Color(0,.5,1,1),glowPower:.25,taperPower:1},source:PolylineGlowMaterial},translucent:!0}),Material.PolylineOutlineType="PolylineOutline",Material._materialCache.addMaterial(Material.PolylineOutlineType,{fabric:{type:Material.PolylineOutlineType,uniforms:{color:new Color(1,1,1,1),outlineColor:new Color(1,0,0,1),outlineWidth:1},source:PolylineOutlineMaterial},translucent:function(e){e=e.uniforms;return e.color.alpha<1||e.outlineColor.alpha<1}}),Material.ElevationContourType="ElevationContour",Material._materialCache.addMaterial(Material.ElevationContourType,{fabric:{type:Material.ElevationContourType,uniforms:{spacing:100,color:new Color(1,0,0,1),width:1},source:ElevationContourMaterial},translucent:!1}),Material.ElevationRampType="ElevationRamp",Material._materialCache.addMaterial(Material.ElevationRampType,{fabric:{type:Material.ElevationRampType,uniforms:{image:Material.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:ElevationRampMaterial},translucent:!1}),Material.SlopeRampMaterialType="SlopeRamp",Material._materialCache.addMaterial(Material.SlopeRampMaterialType,{fabric:{type:Material.SlopeRampMaterialType,uniforms:{image:Material.DefaultImageId},source:SlopeRampMaterial},translucent:!1}),Material.AspectRampMaterialType="AspectRamp",Material._materialCache.addMaterial(Material.AspectRampMaterialType,{fabric:{type:Material.AspectRampMaterialType,uniforms:{image:Material.DefaultImageId},source:AspectRampMaterial},translucent:!1}),Material.ElevationBandType="ElevationBand",Material._materialCache.addMaterial(Material.ElevationBandType,{fabric:{type:Material.ElevationBandType,uniforms:{heights:Material.DefaultImageId,colors:Material.DefaultImageId},source:ElevationBandMaterial},translucent:!0}),Object.defineProperties(MaterialAppearance.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}}}),MaterialAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,MaterialAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,MaterialAppearance.prototype.getRenderState=Appearance.prototype.getRenderState,MaterialAppearance.MaterialSupport={BASIC:Object.freeze({vertexFormat:VertexFormat.POSITION_AND_NORMAL,vertexShaderSource:BasicMaterialAppearanceVS,fragmentShaderSource:BasicMaterialAppearanceFS}),TEXTURED:Object.freeze({vertexFormat:VertexFormat.POSITION_NORMAL_AND_ST,vertexShaderSource:TexturedMaterialAppearanceVS,fragmentShaderSource:TexturedMaterialAppearanceFS}),ALL:Object.freeze({vertexFormat:VertexFormat.ALL,vertexShaderSource:AllMaterialAppearanceVS,fragmentShaderSource:AllMaterialAppearanceFS})};var PerInstanceColorAppearanceFS="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nvec4 color = czm_gammaCorrect(v_color);\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n}\n",PerInstanceColorAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",PerInstanceFlatColorAppearanceFS="varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = czm_gammaCorrect(v_color);\n}\n",PerInstanceFlatColorAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";function PerInstanceColorAppearance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.translucent,!0),i=defaultValue(e.closed,!1),r=defaultValue(e.flat,!1),n=r?PerInstanceFlatColorAppearanceVS:PerInstanceColorAppearanceVS,a=r?PerInstanceFlatColorAppearanceFS:PerInstanceColorAppearanceFS,o=r?PerInstanceColorAppearance.FLAT_VERTEX_FORMAT:PerInstanceColorAppearance.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,n),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,a),this._renderState=Appearance.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._vertexFormat=o,this._flat=r,this._faceForward=defaultValue(e.faceForward,!i)}function ColorMaterialProperty(e){this._definitionChanged=new Event,this._color=void 0,this._colorSubscription=void 0,this.color=e}function DrawCommand(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._cull=defaultValue(e.cull,!0),this._occlude=defaultValue(e.occlude,!0),this._modelMatrix=e.modelMatrix,this._primitiveType=defaultValue(e.primitiveType,PrimitiveType$1.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=defaultValue(e.offset,0),this._instanceCount=defaultValue(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._executeInClosestFrustum=defaultValue(e.executeInClosestFrustum,!1),this._owner=e.owner,this._debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=defaultValue(e.castShadows,!1),this._receiveShadows=defaultValue(e.receiveShadows,!1),this._pickId=e.pickId,this._pickOnly=defaultValue(e.pickOnly,!1),this._depthForTranslucentClassification=defaultValue(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}Object.defineProperties(PerInstanceColorAppearance.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}}}),PerInstanceColorAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_NORMAL,PerInstanceColorAppearance.FLAT_VERTEX_FORMAT=VertexFormat.POSITION_ONLY,PerInstanceColorAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PerInstanceColorAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PerInstanceColorAppearance.prototype.getRenderState=Appearance.prototype.getRenderState,Object.defineProperties(ColorMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color")}),ColorMaterialProperty.prototype.getType=function(e){return"Color"},ColorMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).color=Property.getValueOrClonedDefault(this._color,e,Color.WHITE,t.color),t},ColorMaterialProperty.prototype.equals=function(e){return this===e||e instanceof ColorMaterialProperty&&Property.equals(this._color,e._color)},Object.defineProperties(DrawCommand.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 this._cull},set:function(e){this._cull!==e&&(this._cull=e,this.dirty=!0)}},occlude:{get:function(){return this._occlude},set:function(e){this._occlude!==e&&(this._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 this._castShadows},set:function(e){this._castShadows!==e&&(this._castShadows=e,this.dirty=!0)}},receiveShadows:{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=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 this._executeInClosestFrustum},set:function(e){this._executeInClosestFrustum!==e&&(this._executeInClosestFrustum=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 this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=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)}},pickOnly:{get:function(){return this._pickOnly},set:function(e){this._pickOnly!==e&&(this._pickOnly=e,this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return this._depthForTranslucentClassification},set:function(e){this._depthForTranslucentClassification!==e&&(this._depthForTranslucentClassification=e,this.dirty=!0)}}}),DrawCommand.shallowClone=function(e,t){if(defined(e))return(t=!defined(t)?new DrawCommand:t)._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._cull=e._cull,t._occlude=e._occlude,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._executeInClosestFrustum=e._executeInClosestFrustum,t._owner=e._owner,t._debugShowBoundingVolume=e._debugShowBoundingVolume,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._castShadows=e._castShadows,t._receiveShadows=e._receiveShadows,t._pickId=e._pickId,t._pickOnly=e._pickOnly,t._depthForTranslucentClassification=e._depthForTranslucentClassification,t.dirty=!0,t.lastDirtyTime=0,t},DrawCommand.prototype.execute=function(e,t){e.draw(this,t)};var Pass={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,OVERLAY:9,NUMBER_OF_PASSES:10},Pass$1=Object.freeze(Pass);function freezeRenderState(e){if("object"!=typeof e||null===e)return e;for(var t,i=Object.keys(e),r=0;r<i.length;r++)t=i[r],e.hasOwnProperty(t)&&"_applyFunctions"!==t&&(e[t]=freezeRenderState(e[t]));return Object.freeze(e)}function RenderState(e){var t=defaultValue(e,defaultValue.EMPTY_OBJECT),i=defaultValue(t.cull,defaultValue.EMPTY_OBJECT),r=defaultValue(t.polygonOffset,defaultValue.EMPTY_OBJECT),n=defaultValue(t.scissorTest,defaultValue.EMPTY_OBJECT),a=defaultValue(n.rectangle,defaultValue.EMPTY_OBJECT),o=defaultValue(t.depthRange,defaultValue.EMPTY_OBJECT),s=defaultValue(t.depthTest,defaultValue.EMPTY_OBJECT),l=defaultValue(t.colorMask,defaultValue.EMPTY_OBJECT),c=defaultValue(t.blending,defaultValue.EMPTY_OBJECT),u=defaultValue(c.color,defaultValue.EMPTY_OBJECT),d=defaultValue(t.stencilTest,defaultValue.EMPTY_OBJECT),h=defaultValue(d.frontOperation,defaultValue.EMPTY_OBJECT),p=defaultValue(d.backOperation,defaultValue.EMPTY_OBJECT),m=defaultValue(t.sampleCoverage,defaultValue.EMPTY_OBJECT),e=t.viewport;this.frontFace=defaultValue(t.frontFace,WindingOrder$1.COUNTER_CLOCKWISE),this.cull={enabled:defaultValue(i.enabled,!1),face:defaultValue(i.face,WebGLConstants$1.BACK)},this.lineWidth=defaultValue(t.lineWidth,1),this.polygonOffset={enabled:defaultValue(r.enabled,!1),factor:defaultValue(r.factor,0),units:defaultValue(r.units,0)},this.scissorTest={enabled:defaultValue(n.enabled,!1),rectangle:BoundingRectangle.clone(a)},this.depthRange={near:defaultValue(o.near,0),far:defaultValue(o.far,1)},this.depthTest={enabled:defaultValue(s.enabled,!1),func:defaultValue(s.func,WebGLConstants$1.LESS)},this.colorMask={red:defaultValue(l.red,!0),green:defaultValue(l.green,!0),blue:defaultValue(l.blue,!0),alpha:defaultValue(l.alpha,!0)},this.depthMask=defaultValue(t.depthMask,!0),this.stencilMask=defaultValue(t.stencilMask,-1),this.blending={enabled:defaultValue(c.enabled,!1),color:new Color(defaultValue(u.red,0),defaultValue(u.green,0),defaultValue(u.blue,0),defaultValue(u.alpha,0)),equationRgb:defaultValue(c.equationRgb,WebGLConstants$1.FUNC_ADD),equationAlpha:defaultValue(c.equationAlpha,WebGLConstants$1.FUNC_ADD),functionSourceRgb:defaultValue(c.functionSourceRgb,WebGLConstants$1.ONE),functionSourceAlpha:defaultValue(c.functionSourceAlpha,WebGLConstants$1.ONE),functionDestinationRgb:defaultValue(c.functionDestinationRgb,WebGLConstants$1.ZERO),functionDestinationAlpha:defaultValue(c.functionDestinationAlpha,WebGLConstants$1.ZERO)},this.stencilTest={enabled:defaultValue(d.enabled,!1),frontFunction:defaultValue(d.frontFunction,WebGLConstants$1.ALWAYS),backFunction:defaultValue(d.backFunction,WebGLConstants$1.ALWAYS),reference:defaultValue(d.reference,0),mask:defaultValue(d.mask,-1),frontOperation:{fail:defaultValue(h.fail,WebGLConstants$1.KEEP),zFail:defaultValue(h.zFail,WebGLConstants$1.KEEP),zPass:defaultValue(h.zPass,WebGLConstants$1.KEEP)},backOperation:{fail:defaultValue(p.fail,WebGLConstants$1.KEEP),zFail:defaultValue(p.zFail,WebGLConstants$1.KEEP),zPass:defaultValue(p.zPass,WebGLConstants$1.KEEP)}},this.sampleCoverage={enabled:defaultValue(m.enabled,!1),value:defaultValue(m.value,1),invert:defaultValue(m.invert,!1)},this.viewport=defined(e)?new BoundingRectangle(e.x,e.y,e.width,e.height):void 0,this.id=0,this._applyFunctions=[]}var nextRenderStateId=0,renderStateCache={};function enableOrDisable(e,t,i){i?e.enable(t):e.disable(t)}function applyFrontFace(e,t){e.frontFace(t.frontFace)}function applyCull(e,t){var i=t.cull,t=i.enabled;enableOrDisable(e,e.CULL_FACE,t),t&&e.cullFace(i.face)}function applyLineWidth(e,t){e.lineWidth(t.lineWidth)}function applyPolygonOffset(e,t){var i=t.polygonOffset,t=i.enabled;enableOrDisable(e,e.POLYGON_OFFSET_FILL,t),t&&e.polygonOffset(i.factor,i.units)}function applyScissorTest(e,t,i){var r=t.scissorTest,t=(defined(i.scissorTest)?i.scissorTest:r).enabled;enableOrDisable(e,e.SCISSOR_TEST,t),t&&(r=(defined(i.scissorTest)?i.scissorTest:r).rectangle,e.scissor(r.x,r.y,r.width,r.height))}function applyDepthRange(e,t){t=t.depthRange;e.depthRange(t.near,t.far)}function applyDepthTest(e,t){var i=t.depthTest,t=i.enabled;enableOrDisable(e,e.DEPTH_TEST,t),t&&e.depthFunc(i.func)}function applyColorMask(e,t){t=t.colorMask;e.colorMask(t.red,t.green,t.blue,t.alpha)}function applyDepthMask(e,t){e.depthMask(t.depthMask)}function applyStencilMask(e,t){e.stencilMask(t.stencilMask)}function applyBlendingColor(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function applyBlending(e,t,i){t=t.blending,i=defined(i.blendingEnabled)?i.blendingEnabled:t.enabled;enableOrDisable(e,e.BLEND,i),i&&(applyBlendingColor(e,t.color),e.blendEquationSeparate(t.equationRgb,t.equationAlpha),e.blendFuncSeparate(t.functionSourceRgb,t.functionDestinationRgb,t.functionSourceAlpha,t.functionDestinationAlpha))}function applyStencilTest(e,t){var i,r,n=t.stencilTest,a=n.enabled;enableOrDisable(e,e.STENCIL_TEST,a),a&&(r=n.frontFunction,i=n.backFunction,t=n.reference,a=n.mask,e.stencilFunc(r,t,a),e.stencilFuncSeparate(e.BACK,i,t,a),e.stencilFuncSeparate(e.FRONT,r,t,a),t=(r=n.frontOperation).fail,a=r.zFail,r=r.zPass,e.stencilOpSeparate(e.FRONT,t,a,r),r=(a=n.backOperation).fail,n=a.zFail,a=a.zPass,e.stencilOpSeparate(e.BACK,r,n,a))}function applySampleCoverage(e,t){var i=t.sampleCoverage,t=i.enabled;enableOrDisable(e,e.SAMPLE_COVERAGE,t),t&&e.sampleCoverage(i.value,i.invert)}RenderState.fromCache=function(e){var t=JSON.stringify(e),i=renderStateCache[t];if(defined(i))return++i.referenceCount,i.state;var r=new RenderState(e),e=JSON.stringify(r);return defined(i=renderStateCache[e])||(r.id=nextRenderStateId++,renderStateCache[e]=i={referenceCount:0,state:r}),++i.referenceCount,renderStateCache[t]={referenceCount:1,state:i.state},i.state},RenderState.removeFromCache=function(e){var t=new RenderState(e),i=JSON.stringify(t),r=renderStateCache[i],t=JSON.stringify(e),e=renderStateCache[t];defined(e)&&(--e.referenceCount,0===e.referenceCount&&(delete renderStateCache[t],defined(r)&&--r.referenceCount)),defined(r)&&0===r.referenceCount&&delete renderStateCache[i]},RenderState.getCache=function(){return renderStateCache},RenderState.clearCache=function(){renderStateCache={}};var scratchViewport$2=new BoundingRectangle;function applyViewport(e,t,i){t=defaultValue(t.viewport,i.viewport);defined(t)||((t=scratchViewport$2).width=i.context.drawingBufferWidth,t.height=i.context.drawingBufferHeight),i.context.uniformState.viewport=t,e.viewport(t.x,t.y,t.width,t.height)}function createFuncs(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(applyFrontFace),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||i.push(applyCull),e.lineWidth!==t.lineWidth&&i.push(applyLineWidth),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||i.push(applyPolygonOffset),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||i.push(applyDepthRange),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||i.push(applyDepthTest),e.colorMask.red===t.colorMask.red&&e.colorMask.green===t.colorMask.green&&e.colorMask.blue===t.colorMask.blue&&e.colorMask.alpha===t.colorMask.alpha||i.push(applyColorMask),e.depthMask!==t.depthMask&&i.push(applyDepthMask),e.stencilMask!==t.stencilMask&&i.push(applyStencilMask),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||i.push(applyStencilTest),e.sampleCoverage.enabled===t.sampleCoverage.enabled&&e.sampleCoverage.value===t.sampleCoverage.value&&e.sampleCoverage.invert===t.sampleCoverage.invert||i.push(applySampleCoverage),i}RenderState.apply=function(e,t,i){applyFrontFace(e,t),applyCull(e,t),applyLineWidth(e,t),applyPolygonOffset(e,t),applyDepthRange(e,t),applyDepthTest(e,t),applyColorMask(e,t),applyDepthMask(e,t),applyStencilMask(e,t),applyStencilTest(e,t),applySampleCoverage(e,t),applyScissorTest(e,t,i),applyBlending(e,t,i),applyViewport(e,t,i)},RenderState.partialApply=function(e,t,i,r,n,a){if(t!==i){var o=i._applyFunctions[t.id];defined(o)||(o=createFuncs(t,i),i._applyFunctions[t.id]=o);for(var s=o.length,l=0;l<s;++l)o[l](e,i)}(defined(r.scissorTest)?r:t).scissorTest===(defined(n.scissorTest)?n:i).scissorTest&&!a||applyScissorTest(e,i,n);var c=defined(r.blendingEnabled)?r.blendingEnabled:t.blending.enabled,a=defined(n.blendingEnabled)?n.blendingEnabled:i.blending.enabled;(c!==a||a&&t.blending!==i.blending)&&applyBlending(e,i,n),t===i&&r===n&&r.context===n.context||applyViewport(e,i,n)},RenderState.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:BoundingRectangle.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:Color.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:defined(e.viewport)?BoundingRectangle.clone(e.viewport):void 0}};var viewerPositionWCScratch=new Cartesian3;function AutomaticUniform(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var datatypeToGlsl={};datatypeToGlsl[WebGLConstants$1.FLOAT]="float",datatypeToGlsl[WebGLConstants$1.FLOAT_VEC2]="vec2",datatypeToGlsl[WebGLConstants$1.FLOAT_VEC3]="vec3",datatypeToGlsl[WebGLConstants$1.FLOAT_VEC4]="vec4",datatypeToGlsl[WebGLConstants$1.INT]="int",datatypeToGlsl[WebGLConstants$1.INT_VEC2]="ivec2",datatypeToGlsl[WebGLConstants$1.INT_VEC3]="ivec3",datatypeToGlsl[WebGLConstants$1.INT_VEC4]="ivec4",datatypeToGlsl[WebGLConstants$1.BOOL]="bool",datatypeToGlsl[WebGLConstants$1.BOOL_VEC2]="bvec2",datatypeToGlsl[WebGLConstants$1.BOOL_VEC3]="bvec3",datatypeToGlsl[WebGLConstants$1.BOOL_VEC4]="bvec4",datatypeToGlsl[WebGLConstants$1.FLOAT_MAT2]="mat2",datatypeToGlsl[WebGLConstants$1.FLOAT_MAT3]="mat3",datatypeToGlsl[WebGLConstants$1.FLOAT_MAT4]="mat4",datatypeToGlsl[WebGLConstants$1.SAMPLER_2D]="sampler2D",datatypeToGlsl[WebGLConstants$1.SAMPLER_CUBE]="samplerCube",AutomaticUniform.prototype.getDeclaration=function(e){var t="uniform "+datatypeToGlsl[this._datatype]+" "+e,e=this._size;return t+=1===e?";":"["+e.toString()+"];"};var AutomaticUniforms={czm_viewport:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new AutomaticUniform({size:1,datatype:WebGLConstants$1.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return Matrix4.getTranslation(e.inverseView,viewerPositionWCScratch)}}),czm_frameNumber:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new AutomaticUniform({size:1,datatype:WebGLConstants$1.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new AutomaticUniform({size:1,datatype:WebGLConstants$1.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new AutomaticUniform({size:1,datatype:WebGLConstants$1.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new AutomaticUniform({size:9,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.fogDensity}}),czm_imagerySplitPosition:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.imagerySplitPosition}}),czm_geometricToleranceOverMeter:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new AutomaticUniform({size:1,datatype:WebGLConstants$1.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})};function createUniform(e,t,i,r){switch(t.type){case e.FLOAT:return new UniformFloat(e,t,i,r);case e.FLOAT_VEC2:return new UniformFloatVec2(e,t,i,r);case e.FLOAT_VEC3:return new UniformFloatVec3(e,t,i,r);case e.FLOAT_VEC4:return new UniformFloatVec4(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new UniformSampler(e,t,i,r);case e.INT:case e.BOOL:return new UniformInt(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new UniformIntVec2(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new UniformIntVec3(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new UniformIntVec4(e,t,i,r);case e.FLOAT_MAT2:return new UniformMat2(e,t,i,r);case e.FLOAT_MAT3:return new UniformMat3(e,t,i,r);case e.FLOAT_MAT4:return new UniformMat4(e,t,i,r);default:throw new RuntimeError("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function UniformFloat(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function UniformFloatVec2(e,t,i,r){this.name=i,this.value=void 0,this._value=new Cartesian2,this._gl=e,this._location=r}function UniformFloatVec3(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function UniformFloatVec4(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function UniformSampler(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0}function UniformInt(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function UniformIntVec2(e,t,i,r){this.name=i,this.value=void 0,this._value=new Cartesian2,this._gl=e,this._location=r}function UniformIntVec3(e,t,i,r){this.name=i,this.value=void 0,this._value=new Cartesian3,this._gl=e,this._location=r}function UniformIntVec4(e,t,i,r){this.name=i,this.value=void 0,this._value=new Cartesian4,this._gl=e,this._location=r}UniformFloat.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},UniformFloatVec2.prototype.set=function(){var e=this.value;Cartesian2.equals(e,this._value)||(Cartesian2.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))},UniformFloatVec3.prototype.set=function(){var e=this.value;defined(e.red)?Color.equals(e,this._value)||(this._value=Color.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):defined(e.x)&&(Cartesian3.equals(e,this._value)||(this._value=Cartesian3.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))},UniformFloatVec4.prototype.set=function(){var e=this.value;defined(e.red)?Color.equals(e,this._value)||(this._value=Color.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):defined(e.x)&&(Cartesian4.equals(e,this._value)||(this._value=Cartesian4.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))},UniformSampler.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},UniformSampler.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},UniformInt.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},UniformIntVec2.prototype.set=function(){var e=this.value;Cartesian2.equals(e,this._value)||(Cartesian2.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))},UniformIntVec3.prototype.set=function(){var e=this.value;Cartesian3.equals(e,this._value)||(Cartesian3.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},UniformIntVec4.prototype.set=function(){var e=this.value;Cartesian4.equals(e,this._value)||(Cartesian4.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var scratchUniformArray$1=new Float32Array(4);function UniformMat2(e,t,i,r){this.name=i,this.value=void 0,this._value=new Matrix2,this._gl=e,this._location=r}UniformMat2.prototype.set=function(){var e;Matrix2.equalsArray(this.value,this._value,0)||(Matrix2.clone(this.value,this._value),e=Matrix2.toArray(this.value,scratchUniformArray$1),this._gl.uniformMatrix2fv(this._location,!1,e))};var scratchMat3Array=new Float32Array(9);function UniformMat3(e,t,i,r){this.name=i,this.value=void 0,this._value=new Matrix3,this._gl=e,this._location=r}UniformMat3.prototype.set=function(){var e;Matrix3.equalsArray(this.value,this._value,0)||(Matrix3.clone(this.value,this._value),e=Matrix3.toArray(this.value,scratchMat3Array),this._gl.uniformMatrix3fv(this._location,!1,e))};var scratchMat4Array=new Float32Array(16);function UniformMat4(e,t,i,r){this.name=i,this.value=void 0,this._value=new Matrix4,this._gl=e,this._location=r}function createUniformArray(e,t,i,r){switch(t.type){case e.FLOAT:return new UniformArrayFloat(e,t,i,r);case e.FLOAT_VEC2:return new UniformArrayFloatVec2(e,t,i,r);case e.FLOAT_VEC3:return new UniformArrayFloatVec3(e,t,i,r);case e.FLOAT_VEC4:return new UniformArrayFloatVec4(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new UniformArraySampler(e,t,i,r);case e.INT:case e.BOOL:return new UniformArrayInt(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new UniformArrayIntVec2(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new UniformArrayIntVec3(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new UniformArrayIntVec4(e,t,i,r);case e.FLOAT_MAT2:return new UniformArrayMat2(e,t,i,r);case e.FLOAT_MAT3:return new UniformArrayMat3(e,t,i,r);case e.FLOAT_MAT4:return new UniformArrayMat4(e,t,i,r);default:throw new RuntimeError("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function UniformArrayFloat(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=r[0]}function UniformArrayFloatVec2(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=r[0]}function UniformArrayFloatVec3(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=r[0]}function UniformArrayFloatVec4(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function UniformArraySampler(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=r,this.textureUnitIndex=void 0}function UniformArrayInt(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=r[0]}function UniformArrayIntVec2(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=r[0]}function UniformArrayIntVec3(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=r[0]}function UniformArrayIntVec4(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=r[0]}function UniformArrayMat2(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function UniformArrayMat3(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=r[0]}function UniformArrayMat4(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=r[0]}UniformMat4.prototype.set=function(){var e;Matrix4.equalsArray(this.value,this._value,0)||(Matrix4.clone(this.value,this._value),e=Matrix4.toArray(this.value,scratchMat4Array),this._gl.uniformMatrix4fv(this._location,!1,e))},UniformArrayFloat.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var a=e[n];a!==i[n]&&(i[n]=a,r=!0)}r&&this._gl.uniform1fv(this._location,i)},UniformArrayFloatVec2.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];Cartesian2.equalsArray(o,i,n)||(Cartesian2.pack(o,i,n),r=!0),n+=2}r&&this._gl.uniform2fv(this._location,i)},UniformArrayFloatVec3.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];defined(o.red)?o.red===i[n]&&o.green===i[n+1]&&o.blue===i[n+2]||(i[n]=o.red,i[n+1]=o.green,i[n+2]=o.blue,r=!0):defined(o.x)&&(Cartesian3.equalsArray(o,i,n)||(Cartesian3.pack(o,i,n),r=!0)),n+=3}r&&this._gl.uniform3fv(this._location,i)},UniformArrayFloatVec4.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];defined(o.red)?Color.equalsArray(o,i,n)||(Color.pack(o,i,n),r=!0):defined(o.x)&&(Cartesian4.equalsArray(o,i,n)||(Cartesian4.pack(o,i,n),r=!0)),n+=4}r&&this._gl.uniform4fv(this._location,i)},UniformArraySampler.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length,n=0;n<r;++n){var a=i[n];e.activeTexture(t+n),e.bindTexture(a._target,a._texture)}},UniformArraySampler.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,i=t.length,r=0;r<i;++r)this._gl.uniform1i(t[r],e+r);return e+i},UniformArrayInt.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var a=e[n];a!==i[n]&&(i[n]=a,r=!0)}r&&this._gl.uniform1iv(this._location,i)},UniformArrayIntVec2.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];Cartesian2.equalsArray(o,i,n)||(Cartesian2.pack(o,i,n),r=!0),n+=2}r&&this._gl.uniform2iv(this._location,i)},UniformArrayIntVec3.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];Cartesian3.equalsArray(o,i,n)||(Cartesian3.pack(o,i,n),r=!0),n+=3}r&&this._gl.uniform3iv(this._location,i)},UniformArrayIntVec4.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];Cartesian4.equalsArray(o,i,n)||(Cartesian4.pack(o,i,n),r=!0),n+=4}r&&this._gl.uniform4iv(this._location,i)},UniformArrayMat2.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];Matrix2.equalsArray(o,i,n)||(Matrix2.pack(o,i,n),r=!0),n+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)},UniformArrayMat3.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];Matrix3.equalsArray(o,i,n)||(Matrix3.pack(o,i,n),r=!0),n+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)},UniformArrayMat4.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,a=0;a<t;++a){var o=e[a];Matrix4.equalsArray(o,i,n)||(Matrix4.pack(o,i,n),r=!0),n+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)};var nextShaderProgramId=0;function ShaderProgram(e){var t=e.vertexShaderText,i=e.fragmentShaderText;"undefined"!=typeof spector&&(t=t.replace(/^#line/gm,"//#line"),i=i.replace(/^#line/gm,"//#line"));i=handleUniformPrecisionMismatches(t,i);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=nextShaderProgramId++}function extractUniforms(e){var t=[],i=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(defined(i))for(var r=i.length,n=0;n<r;n++){var a=i[n].trim(),a=a.slice(a.lastIndexOf(" ")+1);t.push(a)}return t}function handleUniformPrecisionMismatches(e,t){var i={};if(!ContextLimits.highpFloatSupported||!ContextLimits.highpIntSupported)for(var r,n,a,o,s=extractUniforms(e),l=extractUniforms(t),c=s.length,u=l.length,d=0;d<c;d++)for(r=0;r<u;r++)s[d]===l[r]&&(a="czm_mediump_"+(n=s[d]),o=new RegExp(n+"\\b","g"),t=t.replace(o,a),i[a]=n);return{fragmentShaderText:t,duplicateUniformNames:i}}ShaderProgram.fromCache=function(e){return(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context.shaderCache.getShaderProgram(e)},ShaderProgram.replaceCache=function(e){return(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context.shaderCache.replaceShaderProgram(e)},Object.defineProperties(ShaderProgram.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return initialize$7(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return initialize$7(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return initialize$7(this),this._uniformsByName}}});var consolePrefix="[Cesium WebGL] ";function createAndLinkProgram(e,t){var i=t._vertexShaderText,r=t._fragmentShaderText,n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,i),e.compileShader(n);i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,r),e.compileShader(i);var a=e.createProgram();e.attachShader(a,n),e.attachShader(a,i),e.deleteShader(n),e.deleteShader(i);var o=t._attributeLocations;if(defined(o))for(var s in o)o.hasOwnProperty(s)&&e.bindAttribLocation(a,o[s],s);if(e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS)){r=t._debugShaders;if(!e.getShaderParameter(i,e.COMPILE_STATUS)){var l,c=e.getShaderInfoLog(i);throw console.error(consolePrefix+"Fragment shader compile log: "+c),defined(r)&&(""!==(l=r.getTranslatedShaderSource(i))?console.error(consolePrefix+"Translated fragment shader source:\n"+l):console.error(consolePrefix+"Fragment shader translation failed.")),e.deleteProgram(a),new RuntimeError("Fragment shader failed to compile. Compile log: "+c)}if(!e.getShaderParameter(n,e.COMPILE_STATUS))throw c=e.getShaderInfoLog(n),console.error(consolePrefix+"Vertex shader compile log: "+c),defined(r)&&(""!==(l=r.getTranslatedShaderSource(n))?console.error(consolePrefix+"Translated vertex shader source:\n"+l):console.error(consolePrefix+"Vertex shader translation failed.")),e.deleteProgram(a),new RuntimeError("Vertex shader failed to compile. Compile log: "+c);throw c=e.getProgramInfoLog(a),console.error(consolePrefix+"Shader program link log: "+c),defined(r)&&(console.error(consolePrefix+"Translated vertex shader source:\n"+r.getTranslatedShaderSource(n)),console.error(consolePrefix+"Translated fragment shader source:\n"+r.getTranslatedShaderSource(i))),e.deleteProgram(a),new RuntimeError("Program failed to link. Link log: "+c)}t=t._logShaderCompilation;return t&&defined(c=e.getShaderInfoLog(n))&&0<c.length&&console.log(consolePrefix+"Vertex shader compile log: "+c),t&&defined(c=e.getShaderInfoLog(i))&&0<c.length&&console.log(consolePrefix+"Fragment shader compile log: "+c),t&&defined(c=e.getProgramInfoLog(a))&&0<c.length&&console.log(consolePrefix+"Shader program link log: "+c),a}function findVertexAttributes(e,t,i){for(var r={},n=0;n<i;++n){var a=e.getActiveAttrib(t,n),o=e.getAttribLocation(t,a.name);r[a.name]={name:a.name,type:a.type,index:o}}return r}function findUniforms(e,t){for(var i={},r=[],n=[],a=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),o=0;o<a;++o){var s=e.getActiveUniform(t,o),l=-1!==s.name.indexOf("[0]",s.name.length-"[0]".length)?s.name.slice(0,s.name.length-3):s.name;if(0!==l.indexOf("gl_"))if(s.name.indexOf("[")<0){var c=e.getUniformLocation(t,l);null!==c&&(h=createUniform(e,s,l,c),i[l]=h,r.push(h),h._setSampler&&n.push(h))}else{var u,d,h=l.indexOf("[");if(0<=h)defined(u=i[l.slice(0,h)])&&(p=u._locations).length<=1&&(h=u.value,null!==(d=e.getUniformLocation(t,l))&&(p.push(d),h.push(e.getUniform(t,d))));else{for(var p=[],m=0;m<s.size;++m)null!==(d=e.getUniformLocation(t,l+"["+m+"]"))&&p.push(d);u=createUniformArray(e,s,l,p),i[l]=u,r.push(u),u._setSampler&&n.push(u)}}}return{uniformsByName:i,uniforms:r,samplerUniforms:n}}function partitionUniforms(e,t){var i,r,n,a,o=[],s=[];for(i in t)t.hasOwnProperty(i)&&(r=t[i],defined(n=e._duplicateUniformNames[a=i])&&(a=r.name=n),defined(a=AutomaticUniforms[a])?o.push({uniform:r,automaticUniform:a}):s.push(r));return{automaticUniforms:o,manualUniforms:s}}function setSamplerUniforms(e,t,i){e.useProgram(t);for(var r=0,n=i.length,a=0;a<n;++a)r=i[a]._setSampler(r);return e.useProgram(null),r}function initialize$7(e){defined(e._program)||reinitialize(e)}function reinitialize(s){var e=s._program,t=s._gl,i=createAndLinkProgram(t,s,s._debugShaders),r=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES),n=findUniforms(t,i),a=partitionUniforms(s,n.uniformsByName);s._program=i,s._numberOfVertexAttributes=r,s._vertexAttributes=findVertexAttributes(t,i,r),s._uniformsByName=n.uniformsByName,s._uniforms=n.uniforms,s._automaticUniforms=a.automaticUniforms,s._manualUniforms=a.manualUniforms,s.maximumTextureUnitIndex=setSamplerUniforms(t,i,n.samplerUniforms),e&&s._gl.deleteProgram(e),"undefined"!=typeof spector&&(s._program.__SPECTOR_rebuildProgram=function(e,t,i,r){var n=s._vertexShaderText,a=s._fragmentShaderText,o=/ ! = /g;s._vertexShaderText=e.replace(o," != "),s._fragmentShaderText=t.replace(o," != ");try{reinitialize(s),i(s._program)}catch(e){s._vertexShaderText=n,s._fragmentShaderText=a;a=/(?:Compile|Link) error: ([^]*)/.exec(e.message);r(a?a[1]:e.message)}})}function modernizeShader(e,t){var i=/#define OUTPUT_DECLARATION/,r=e.split("\n");if(/#version 300 es/g.test(e))return e;for(var n,a=-1,o=0;o<r.length;++o)if(n=r[o],i.test(n)){a=o;break}if(-1===a)throw new DeveloperError("Could not find a #define OUTPUT_DECLARATION!");var s=[];for(o=0;o<10;o++){var l="gl_FragData\\["+o+"\\]",c="czm_out"+o;new RegExp(l,"g").test(e)&&(setAdd(c,s),replaceInSourceString(l,c,r),r.splice(a,0,"layout(location = "+o+") out vec4 "+c+";"),a+=1)}var u="czm_fragColor";findInSource("gl_FragColor",r)&&(setAdd(u,s),replaceInSourceString("gl_FragColor",u,r),r.splice(a,0,"layout(location = 0) out vec4 czm_fragColor;"),a+=1);var d,h=getVariablePreprocessorBranch(s,r),p={};for(o=0;o<r.length;o++)for(var m in n=r[o],h)h.hasOwnProperty(m)&&new RegExp("(layout)[^]+(out)[^]+("+m+")[^]+","g").test(n)&&(p[n]=m);for(d in p)if(p.hasOwnProperty(d)){for(var f=p[d],g=r.indexOf(d),_=h[f],y=_.length,C=0;C<y;C++)r.splice(g,0,_[C]);for(g+=y+1,C=y-1;0<=C;C--)r.splice(g,0,"#endif //"+_[C])}var u="WEBGL_2",v="#version 300 es",S=!1;for(o=0;o<r.length;o++)if(/#version/.test(r[o])){r[o]=v,S=!0;break}return S||r.splice(0,0,v),r.splice(1,0,"#define WEBGL_2"),removeExtension("EXT_draw_buffers",u,r),removeExtension("EXT_frag_depth",u,r),removeExtension("OES_standard_derivatives",u,r),replaceInSourceString("texture2D","texture",r),replaceInSourceString("texture3D","texture",r),replaceInSourceString("textureCube","texture",r),replaceInSourceString("gl_FragDepthEXT","gl_FragDepth",r),t?replaceInSourceString("varying","in",r):(replaceInSourceString("attribute","in",r),replaceInSourceString("varying","out",r)),compileSource(r)}function replaceInSourceString(e,t,i){for(var r=new RegExp("(^|[^\\w])("+e+")($|[^\\w])","g"),n=i.length,a=0;a<n;++a){var o=i[a];i[a]=o.replace(r,"$1"+t+"$3")}}function replaceInSourceRegex(e,t,i){for(var r=i.length,n=0;n<r;++n){var a=i[n];i[n]=a.replace(e,t)}}function findInSource(e,t){for(var i=new RegExp("(^|[^\\w])("+e+")($|[^\\w])","g"),r=t.length,n=0;n<r;++n){var a=t[n];if(i.test(a))return 1}}function compileSource(e){for(var t="",i=e.length,r=0;r<i;++r)t+=e[r]+"\n";return t}function setAdd(e,t){-1===t.indexOf(e)&&t.push(e)}function getVariablePreprocessorBranch(e,t){for(var i={},r=e.length,n=[],a=0;a<t.length;++a){var o=t[a],s=/(#ifdef|#if)/g.test(o),l=/#else/g.test(o),c=/#endif/g.test(o);if(s)n.push(o);else if(l){l=n[n.length-1].replace("ifdef","ifndef");/if/g.test(l)&&(l=l.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),n.pop(),n.push(l)}else if(c)n.pop();else if(!/layout/g.test(o))for(var u=0;u<r;++u){var d=e[u];-1!==o.indexOf(d)&&(defined(i[d])?i[d]=i[d].filter(function(e){return 0<=n.indexOf(e)}):i[d]=n.slice())}}return i}function removeExtension(e,t,i){replaceInSourceRegex(new RegExp("#extension\\s+GL_"+e+"\\s+:\\s+[a-zA-Z0-9]+\\s*$","g"),"",i),replaceInSourceString("GL_"+e,t,i)}ShaderProgram.prototype._bind=function(){initialize$7(this),this._gl.useProgram(this._program)},ShaderProgram.prototype._setUniforms=function(e,t,i){if(defined(e))for(var r=this._manualUniforms,n=r.length,a=0;a<n;++a){var o=r[a];o.value=e[o.name]()}var s=this._automaticUniforms;for(n=s.length,a=0;a<n;++a){var l=s[a];l.uniform.value=l.automaticUniform.getValue(t)}var c,u=this._uniforms;for(n=u.length,a=0;a<n;++a)u[a].set();i&&(c=this._gl,i=this._program,c.validateProgram(i))},ShaderProgram.prototype.isDestroyed=function(){return!1},ShaderProgram.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},ShaderProgram.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),destroyObject(this)};var czm_degreesPerRadian="const float czm_degreesPerRadian = 57.29577951308232;\n",czm_depthRange="const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n",czm_epsilon1="const float czm_epsilon1 = 0.1;\n",czm_epsilon2="const float czm_epsilon2 = 0.01;\n",czm_epsilon3="const float czm_epsilon3 = 0.001;\n",czm_epsilon4="const float czm_epsilon4 = 0.0001;\n",czm_epsilon5="const float czm_epsilon5 = 0.00001;\n",czm_epsilon6="const float czm_epsilon6 = 0.000001;\n",czm_epsilon7="const float czm_epsilon7 = 0.0000001;\n",czm_infinity="const float czm_infinity = 5906376272000.0;\n",czm_oneOverPi="const float czm_oneOverPi = 0.3183098861837907;\n",czm_oneOverTwoPi="const float czm_oneOverTwoPi = 0.15915494309189535;\n",czm_passCesium3DTile="const float czm_passCesium3DTile = 4.0;\n",czm_passCesium3DTileClassification="const float czm_passCesium3DTileClassification = 5.0;\n",czm_passCesium3DTileClassificationIgnoreShow="const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n",czm_passClassification="const float czm_passClassification = 7.0;\n",czm_passCompute="const float czm_passCompute = 1.0;\n",czm_passEnvironment="const float czm_passEnvironment = 0.0;\n",czm_passGlobe="const float czm_passGlobe = 2.0;\n",czm_passOpaque="const float czm_passOpaque = 7.0;\n",czm_passOverlay="const float czm_passOverlay = 9.0;\n",czm_passTerrainClassification="const float czm_passTerrainClassification = 3.0;\n",czm_passTranslucent="const float czm_passTranslucent = 8.0;\n",czm_pi="const float czm_pi = 3.141592653589793;\n",czm_piOverFour="const float czm_piOverFour = 0.7853981633974483;\n",czm_piOverSix="const float czm_piOverSix = 0.5235987755982988;\n",czm_piOverThree="const float czm_piOverThree = 1.0471975511965976;\n",czm_piOverTwo="const float czm_piOverTwo = 1.5707963267948966;\n",czm_radiansPerDegree="const float czm_radiansPerDegree = 0.017453292519943295;\n",czm_sceneMode2D="const float czm_sceneMode2D = 2.0;\n",czm_sceneMode3D="const float czm_sceneMode3D = 3.0;\n",czm_sceneModeColumbusView="const float czm_sceneModeColumbusView = 1.0;\n",czm_sceneModeMorphing="const float czm_sceneModeMorphing = 0.0;\n",czm_solarRadius="const float czm_solarRadius = 695500000.0;\n",czm_threePiOver2="const float czm_threePiOver2 = 4.71238898038469;\n",czm_twoPi="const float czm_twoPi = 6.283185307179586;\n",czm_webMercatorMaxLatitude="const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n",czm_depthRangeStruct="struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n",czm_material="struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n",czm_materialInput="struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\nfloat height;\nfloat slope;\nfloat aspect;\n};\n",czm_ray="struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n",czm_raySegment="struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n",czm_shadowParameters="struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\nvec3 texCoords;\n#else\nvec2 texCoords;\n#endif\nfloat depthBias;\nfloat depth;\nfloat nDotL;\nvec2 texelStepSize;\nfloat normalShadingSmooth;\nfloat darkness;\n};\n",czm_acesTonemapping="vec3 czm_acesTonemapping(vec3 color) {\nfloat g = 0.985;\nfloat a = 0.065;\nfloat b = 0.0001;\nfloat c = 0.433;\nfloat d = 0.238;\ncolor = (color * (color + a) - b) / (color * (g * color + c) + d);\ncolor = clamp(color, 0.0, 1.0);\nreturn color;\n}\n",czm_alphaWeight="float czm_alphaWeight(float a)\n{\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));\n}\n",czm_antialias="vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n",czm_approximateSphericalCoordinates="vec2 czm_approximateSphericalCoordinates(vec3 normal) {\nfloat latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\nfloat longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\nreturn vec2(latitudeApproximation, longitudeApproximation);\n}\n",czm_backFacing="bool czm_backFacing()\n{\nreturn gl_FrontFacing == false;\n}\n",czm_branchFreeTernary="float czm_branchFreeTernary(bool comparison, float a, float b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\n",czm_cascadeColor="vec4 czm_cascadeColor(vec4 weights)\n{\nreturn vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\nvec4(0.0, 1.0, 0.0, 1.0) * weights.y +\nvec4(0.0, 0.0, 1.0, 1.0) * weights.z +\nvec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n",czm_cascadeDistance="uniform vec4 shadowMap_cascadeDistances;\nfloat czm_cascadeDistance(vec4 weights)\n{\nreturn dot(shadowMap_cascadeDistances, weights);\n}\n",czm_cascadeMatrix="uniform mat4 shadowMap_cascadeMatrices[4];\nmat4 czm_cascadeMatrix(vec4 weights)\n{\nreturn shadowMap_cascadeMatrices[0] * weights.x +\nshadowMap_cascadeMatrices[1] * weights.y +\nshadowMap_cascadeMatrices[2] * weights.z +\nshadowMap_cascadeMatrices[3] * weights.w;\n}\n",czm_cascadeWeights="uniform vec4 shadowMap_cascadeSplits[2];\nvec4 czm_cascadeWeights(float depthEye)\n{\nvec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\nvec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\nreturn near * far;\n}\n",czm_columbusViewMorph="vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n",czm_computePosition="vec4 czm_computePosition();\n",czm_cosineAndSine="vec2 cordic(float angle)\n{\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\nvector = rotation * vector;\nangle -= sense * 7.8539816339744828e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfloat factor = sense * 5.0e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.6364760900080609e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.5e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4497866312686414e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.25e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2435499454676144e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.25e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.2418809995957350e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.125e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.1239833430268277e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.5625e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5623728620476831e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.8125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.8123410601011111e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.90625e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.9062301319669718e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.953125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9531225164788188e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.765625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.7656218955931946e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.8828125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.8828121119489829e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.44140625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4414062014936177e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.220703125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2207031189367021e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.103515625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.1035156174208773e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.0517578125e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.0517578115526096e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.52587890625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5258789061315762e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.62939453125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.6293945311019700e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.814697265625e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.8146972656064961e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.9073486328125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9073486328101870e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.5367431640625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.5367431640596084e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.76837158203125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.7683715820308884e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.384185791015625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.3841857910155797e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.1920928955078125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nreturn vector;\n}\nvec2 czm_cosineAndSine(float angle)\n{\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n",czm_decompressTextureCoordinates="vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n",czm_depthClamp="#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\nvarying float v_WindowZ;\n#endif\nvec4 czm_depthClamp(vec4 coords)\n{\n#ifndef LOG_DEPTH\n#ifdef GL_EXT_frag_depth\nv_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\ncoords.z = 0.0;\n#else\ncoords.z = min(coords.z, coords.w);\n#endif\n#endif\nreturn coords;\n}\n",czm_eastNorthUpToEyeCoordinates="mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n",czm_ellipsoidContainsPoint="bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)\n{\nvec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n",czm_ellipsoidWgs84TextureCoordinates="vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n",czm_equalsEpsilon="bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n",czm_eyeOffset="vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n",czm_eyeToWindowCoordinates="vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n",czm_fastApproximateAtan="float czm_fastApproximateAtan(float x) {\nreturn x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\n}\nfloat czm_fastApproximateAtan(float x, float y) {\nfloat t = abs(x);\nfloat opposite = abs(y);\nfloat adjacent = max(t, opposite);\nopposite = min(t, opposite);\nt = czm_fastApproximateAtan(opposite / adjacent);\nt = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\nt = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\nt = czm_branchFreeTernary(y < 0.0, -t, t);\nreturn t;\n}\n",czm_fog="vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\nreturn mix(color, fogColor, fog);\n}\n",czm_gammaCorrect="vec3 czm_gammaCorrect(vec3 color) {\n#ifdef HDR\ncolor = pow(color, vec3(czm_gamma));\n#endif\nreturn color;\n}\nvec4 czm_gammaCorrect(vec4 color) {\n#ifdef HDR\ncolor.rgb = pow(color.rgb, vec3(czm_gamma));\n#endif\nreturn color;\n}\n",czm_geodeticSurfaceNormal="vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n",czm_getDefaultMaterial="czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n",czm_getLambertDiffuse="float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n",czm_getSpecular="float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n",czm_getWaterNoise="vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n",czm_HSBToRGB="const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 czm_HSBToRGB(vec3 hsb)\n{\nvec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n",czm_HSLToRGB="vec3 hueToRGB(float hue)\n{\nfloat r = abs(hue * 6.0 - 3.0) - 1.0;\nfloat g = 2.0 - abs(hue * 6.0 - 2.0);\nfloat b = 2.0 - abs(hue * 6.0 - 4.0);\nreturn clamp(vec3(r, g, b), 0.0, 1.0);\n}\nvec3 czm_HSLToRGB(vec3 hsl)\n{\nvec3 rgb = hueToRGB(hsl.x);\nfloat c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\nreturn (rgb - 0.5) * c + hsl.z;\n}\n",czm_hue="vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n",czm_inverseGamma="vec3 czm_inverseGamma(vec3 color) {\nreturn pow(color, vec3(1.0 / czm_gamma));\n}\n",czm_isEmpty="bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n",czm_isFull="bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n",czm_latitudeToWebMercatorFraction="float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n",czm_lineDistance="float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\nreturn abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\n}\n",czm_luminance="float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n",czm_metersPerPixel="float czm_metersPerPixel(vec4 positionEC, float pixelRatio)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight) * pixelRatio;\n}\nfloat czm_metersPerPixel(vec4 positionEC)\n{\nreturn czm_metersPerPixel(positionEC, czm_pixelRatio);\n}\n",czm_modelToWindowCoordinates="vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n",czm_multiplyWithColorBalance="vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n",czm_nearFarScalar="float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n",czm_octDecode="vec3 czm_octDecode(vec2 encoded, float range)\n{\nif (encoded.x == 0.0 && encoded.y == 0.0) {\nreturn vec3(0.0, 0.0, 0.0);\n}\nencoded = encoded / range * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(vec2 encoded)\n{\nreturn czm_octDecode(encoded, 255.0);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n",czm_packDepth="vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n",czm_phong="float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse * czm_lightColor;\ncolor += material.specular * specular * czm_lightColor;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse * czm_lightColor;\ncolor += material.specular * specular * czm_lightColor;\nreturn vec4(color, material.alpha);\n}\n",czm_planeDistance="float czm_planeDistance(vec4 plane, vec3 point) {\nreturn (dot(plane.xyz, point) + plane.w);\n}\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\nreturn (dot(planeNormal, point) + planeDistance);\n}\n",czm_pointAlongRay="vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n",czm_rayEllipsoidIntersectionInterval="czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\n{\nvec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n",czm_readDepth="float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\n{\nreturn czm_reverseLogDepth(texture2D(depthTexture, texCoords).r);\n}\n",czm_readNonPerspective="float czm_readNonPerspective(float value, float oneOverW) {\nreturn value * oneOverW;\n}\nvec2 czm_readNonPerspective(vec2 value, float oneOverW) {\nreturn value * oneOverW;\n}\nvec3 czm_readNonPerspective(vec3 value, float oneOverW) {\nreturn value * oneOverW;\n}\nvec4 czm_readNonPerspective(vec4 value, float oneOverW) {\nreturn value * oneOverW;\n}\n",czm_reverseLogDepth="float czm_reverseLogDepth(float logZ)\n{\n#ifdef LOG_DEPTH\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nfloat log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\nfloat depthFromNear = pow(2.0, log2Depth) - 1.0;\nreturn far * (1.0 - near / (depthFromNear + near)) / (far - near);\n#endif\nreturn logZ;\n}\n",czm_RGBToHSB="const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec3 czm_RGBToHSB(vec3 rgb)\n{\nvec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\nvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\n",czm_RGBToHSL="vec3 RGBtoHCV(vec3 rgb)\n{\nvec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\nvec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\nfloat c = q.x - min(q.w, q.y);\nfloat h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\nreturn vec3(h, c, q.x);\n}\nvec3 czm_RGBToHSL(vec3 rgb)\n{\nvec3 hcv = RGBtoHCV(rgb);\nfloat l = hcv.z - hcv.y * 0.5;\nfloat s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\nreturn vec3(hcv.x, s, l);\n}\n",czm_RGBToXYZ="vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n",czm_sampleOctahedralProjection="vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\n{\ndirection /= dot(vec3(1.0), abs(direction));\nvec2 rev = abs(direction.zx) - vec2(1.0);\nvec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\ndirection.z < 0.0 ? rev.y : -rev.y);\nvec2 uv = direction.y < 0.0 ? neg : direction.xz;\nvec2 coord = 0.5 * uv + vec2(0.5);\nvec2 pixel = 1.0 / textureSize;\nif (lod > 0.0)\n{\nfloat scale = 1.0 / pow(2.0, lod);\nfloat offset = ((textureSize.y + 1.0) / textureSize.x);\ncoord.x *= offset;\ncoord *= scale;\ncoord.x += offset + pixel.x;\ncoord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\n}\nelse\n{\ncoord.x *= (textureSize.y / textureSize.x);\n}\n#ifndef OES_texture_float_linear\nvec3 color1 = texture2D(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\nvec3 color2 = texture2D(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\nvec3 color3 = texture2D(projectedMap, coord + pixel).rgb;\nvec3 color4 = texture2D(projectedMap, coord).rgb;\nvec2 texturePosition = coord * textureSize;\nfloat fu = fract(texturePosition.x);\nfloat fv = fract(texturePosition.y);\nvec3 average1 = mix(color4, color2, fu);\nvec3 average2 = mix(color1, color3, fu);\nvec3 color = mix(average1, average2, fv);\n#else\nvec3 color = texture2D(projectedMap, coord).rgb;\n#endif\nreturn color;\n}\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\nfloat currentLod = floor(lod + 0.5);\nfloat nextLod = min(currentLod + 1.0, maxLod);\nvec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\nvec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\nreturn mix(colorNextLod, colorCurrentLod, nextLod - lod);\n}\n",czm_saturation="vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n",czm_shadowDepthCompare="float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n",czm_shadowVisibility="float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n",czm_signNotZero="float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n",czm_sphericalHarmonics="vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\n{\nconst float c1 = 0.429043;\nconst float c2 = 0.511664;\nconst float c3 = 0.743125;\nconst float c4 = 0.886227;\nconst float c5 = 0.247708;\nvec3 L00 = coefficients[0];\nvec3 L1_1 = coefficients[1];\nvec3 L10 = coefficients[2];\nvec3 L11 = coefficients[3];\nvec3 L2_2 = coefficients[4];\nvec3 L2_1 = coefficients[5];\nvec3 L20 = coefficients[6];\nvec3 L21 = coefficients[7];\nvec3 L22 = coefficients[8];\nfloat x = normal.x;\nfloat y = normal.y;\nfloat z = normal.z;\nreturn c1 * L22 * (x * x - y * y) + c3 * L20 * z * z + c4 * L00 - c5 * L20 +\n2.0 * c1 * (L2_2 * x * y + L21 * x * z + L2_1 * y * z) +\n2.0 * c2 * (L11 * x + L1_1 * y + L10 * z);\n}\n",czm_tangentToEyeSpaceMatrix="mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 bitangent = normalize(bitangentEC);\nreturn mat3(tangent.x , tangent.y , tangent.z,\nbitangent.x, bitangent.y, bitangent.z,\nnormal.x , normal.y , normal.z);\n}\n",czm_transformPlane="vec4 czm_transformPlane(vec4 plane, mat4 transform) {\nvec4 transformedPlane = transform * plane;\nfloat normalMagnitude = length(transformedPlane.xyz);\nreturn transformedPlane / normalMagnitude;\n}\n",czm_translateRelativeToEye="vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n",czm_translucentPhong="vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse * czm_lightColor;\ncolor += material.specular * specular * czm_lightColor;\nreturn vec4(color, material.alpha);\n}\n",czm_transpose="mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n",czm_unpackDepth="float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n",czm_unpackFloat="float czm_unpackFloat(vec4 packedFloat)\n{\npackedFloat = floor(packedFloat * 255.0 + 0.5);\nfloat sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;\nfloat exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;\nif (exponent == -127.0)\n{\nreturn 0.0;\n}\nfloat mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);\nfloat result = sign * exp2(exponent - 23.0) * mantissa;\nreturn result;\n}\n",czm_vertexLogDepth="#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n#ifdef SHADOW_MAP\nvarying vec3 v_logPositionEC;\n#endif\n#endif\nvec4 czm_updatePositionDepth(vec4 coords) {\n#if defined(LOG_DEPTH)\n#ifdef SHADOW_MAP\nvec3 logPositionEC = (czm_inverseProjection * coords).xyz;\nv_logPositionEC = logPositionEC;\n#endif\ncoords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;\n#endif\nreturn coords;\n}\nvoid czm_vertexLogDepth()\n{\n#ifdef LOG_DEPTH\nv_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;\ngl_Position = czm_updatePositionDepth(gl_Position);\n#endif\n}\nvoid czm_vertexLogDepth(vec4 clipCoords)\n{\n#ifdef LOG_DEPTH\nv_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;\nczm_updatePositionDepth(clipCoords);\n#endif\n}\n",czm_windowToEyeCoordinates="vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nif (!(czm_inverseProjection == mat4(0.0)))\n{\nq = czm_inverseProjection * q;\n}\nelse\n{\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\n}\nreturn q;\n}\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\n{\n#ifdef LOG_DEPTH\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nfloat log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;\nfloat depthFromNear = pow(2.0, log2Depth) - 1.0;\nfloat depthFromCamera = depthFromNear + near;\nvec4 windowCoord = vec4(fragmentCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\neyeCoordinate.w = 1.0 / depthFromCamera;\nreturn eyeCoordinate;\n#else\nvec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n#endif\nreturn eyeCoordinate;\n}\n",czm_writeDepthClamp="#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\nvarying float v_WindowZ;\n#endif\nvoid czm_writeDepthClamp()\n{\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\ngl_FragDepthEXT = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\n#endif\n}\n",czm_writeLogDepth="#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n#ifdef POLYGON_OFFSET\nuniform vec2 u_polygonOffset;\n#endif\n#endif\nvoid czm_writeLogDepth(float depth)\n{\n#if defined(GL_EXT_frag_depth) && defined(LOG_DEPTH)\nif (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\ndiscard;\n}\n#ifdef POLYGON_OFFSET\nfloat factor = u_polygonOffset[0];\nfloat units = u_polygonOffset[1];\n#ifdef GL_OES_standard_derivatives\nfloat x = dFdx(depth);\nfloat y = dFdy(depth);\nfloat m = sqrt(x * x + y * y);\ndepth += m * factor;\n#endif\n#endif\ngl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#ifdef POLYGON_OFFSET\ngl_FragDepthEXT += czm_epsilon7 * units;\n#endif\n#endif\n}\nvoid czm_writeLogDepth() {\n#ifdef LOG_DEPTH\nczm_writeLogDepth(v_depthFromNearPlusOne);\n#endif\n}\n",czm_writeNonPerspective="float czm_writeNonPerspective(float value, float w) {\nreturn value * w;\n}\nvec2 czm_writeNonPerspective(vec2 value, float w) {\nreturn value * w;\n}\nvec3 czm_writeNonPerspective(vec3 value, float w) {\nreturn value * w;\n}\nvec4 czm_writeNonPerspective(vec4 value, float w) {\nreturn value * w;\n}\n",czm_XYZToRGB="vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n",CzmBuiltins={czm_degreesPerRadian:czm_degreesPerRadian,czm_depthRange:czm_depthRange,czm_epsilon1:czm_epsilon1,czm_epsilon2:czm_epsilon2,czm_epsilon3:czm_epsilon3,czm_epsilon4:czm_epsilon4,czm_epsilon5:czm_epsilon5,czm_epsilon6:czm_epsilon6,czm_epsilon7:czm_epsilon7,czm_infinity:czm_infinity,czm_oneOverPi:czm_oneOverPi,czm_oneOverTwoPi:czm_oneOverTwoPi,czm_passCesium3DTile:czm_passCesium3DTile,czm_passCesium3DTileClassification:czm_passCesium3DTileClassification,czm_passCesium3DTileClassificationIgnoreShow:czm_passCesium3DTileClassificationIgnoreShow,czm_passClassification:czm_passClassification,czm_passCompute:czm_passCompute,czm_passEnvironment:czm_passEnvironment,czm_passGlobe:czm_passGlobe,czm_passOpaque:czm_passOpaque,czm_passOverlay:czm_passOverlay,czm_passTerrainClassification:czm_passTerrainClassification,czm_passTranslucent:czm_passTranslucent,czm_pi:czm_pi,czm_piOverFour:czm_piOverFour,czm_piOverSix:czm_piOverSix,czm_piOverThree:czm_piOverThree,czm_piOverTwo:czm_piOverTwo,czm_radiansPerDegree:czm_radiansPerDegree,czm_sceneMode2D:czm_sceneMode2D,czm_sceneMode3D:czm_sceneMode3D,czm_sceneModeColumbusView:czm_sceneModeColumbusView,czm_sceneModeMorphing:czm_sceneModeMorphing,czm_solarRadius:czm_solarRadius,czm_threePiOver2:czm_threePiOver2,czm_twoPi:czm_twoPi,czm_webMercatorMaxLatitude:czm_webMercatorMaxLatitude,czm_depthRangeStruct:czm_depthRangeStruct,czm_material:czm_material,czm_materialInput:czm_materialInput,czm_ray:czm_ray,czm_raySegment:czm_raySegment,czm_shadowParameters:czm_shadowParameters,czm_acesTonemapping:czm_acesTonemapping,czm_alphaWeight:czm_alphaWeight,czm_antialias:czm_antialias,czm_approximateSphericalCoordinates:czm_approximateSphericalCoordinates,czm_backFacing:czm_backFacing,czm_branchFreeTernary:czm_branchFreeTernary,czm_cascadeColor:czm_cascadeColor,czm_cascadeDistance:czm_cascadeDistance,czm_cascadeMatrix:czm_cascadeMatrix,czm_cascadeWeights:czm_cascadeWeights,czm_columbusViewMorph:czm_columbusViewMorph,czm_computePosition:czm_computePosition,czm_cosineAndSine:czm_cosineAndSine,czm_decompressTextureCoordinates:czm_decompressTextureCoordinates,czm_depthClamp:czm_depthClamp,czm_eastNorthUpToEyeCoordinates:czm_eastNorthUpToEyeCoordinates,czm_ellipsoidContainsPoint:czm_ellipsoidContainsPoint,czm_ellipsoidWgs84TextureCoordinates:czm_ellipsoidWgs84TextureCoordinates,czm_equalsEpsilon:czm_equalsEpsilon,czm_eyeOffset:czm_eyeOffset,czm_eyeToWindowCoordinates:czm_eyeToWindowCoordinates,czm_fastApproximateAtan:czm_fastApproximateAtan,czm_fog:czm_fog,czm_gammaCorrect:czm_gammaCorrect,czm_geodeticSurfaceNormal:czm_geodeticSurfaceNormal,czm_getDefaultMaterial:czm_getDefaultMaterial,czm_getLambertDiffuse:czm_getLambertDiffuse,czm_getSpecular:czm_getSpecular,czm_getWaterNoise:czm_getWaterNoise,czm_HSBToRGB:czm_HSBToRGB,czm_HSLToRGB:czm_HSLToRGB,czm_hue:czm_hue,czm_inverseGamma:czm_inverseGamma,czm_isEmpty:czm_isEmpty,czm_isFull:czm_isFull,czm_latitudeToWebMercatorFraction:czm_latitudeToWebMercatorFraction,czm_lineDistance:czm_lineDistance,czm_luminance:czm_luminance,czm_metersPerPixel:czm_metersPerPixel,czm_modelToWindowCoordinates:czm_modelToWindowCoordinates,czm_multiplyWithColorBalance:czm_multiplyWithColorBalance,czm_nearFarScalar:czm_nearFarScalar,czm_octDecode:czm_octDecode,czm_packDepth:czm_packDepth,czm_phong:czm_phong,czm_planeDistance:czm_planeDistance,czm_pointAlongRay:czm_pointAlongRay,czm_rayEllipsoidIntersectionInterval:czm_rayEllipsoidIntersectionInterval,czm_readDepth:czm_readDepth,czm_readNonPerspective:czm_readNonPerspective,czm_reverseLogDepth:czm_reverseLogDepth,czm_RGBToHSB:czm_RGBToHSB,czm_RGBToHSL:czm_RGBToHSL,czm_RGBToXYZ:czm_RGBToXYZ,czm_sampleOctahedralProjection:czm_sampleOctahedralProjection,czm_saturation:czm_saturation,czm_shadowDepthCompare:czm_shadowDepthCompare,czm_shadowVisibility:czm_shadowVisibility,czm_signNotZero:czm_signNotZero,czm_sphericalHarmonics:czm_sphericalHarmonics,czm_tangentToEyeSpaceMatrix:czm_tangentToEyeSpaceMatrix,czm_transformPlane:czm_transformPlane,czm_translateRelativeToEye:czm_translateRelativeToEye,czm_translucentPhong:czm_translucentPhong,czm_transpose:czm_transpose,czm_unpackDepth:czm_unpackDepth,czm_unpackFloat:czm_unpackFloat,czm_vertexLogDepth:czm_vertexLogDepth,czm_windowToEyeCoordinates:czm_windowToEyeCoordinates,czm_writeDepthClamp:czm_writeDepthClamp,czm_writeLogDepth:czm_writeLogDepth,czm_writeNonPerspective:czm_writeNonPerspective,czm_XYZToRGB:czm_XYZToRGB},builtinName,uniformName,uniform;function removeComments(e){return(e=e.replace(/\/\/.*/g,"")).replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;r<t;++r)i+="\n";return i})}function getDependencyNode(e,t,i){for(var r,n=0;n<i.length;++n)i[n].name===e&&(r=i[n]);return defined(r)||(t=removeComments(t),i.push(r={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1})),r}function generateDependencies(t,i){var r;t.evaluated||(t.evaluated=!0,defined(r=t.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g))&&null!==r&&(r=r.filter(function(e,t){return r.indexOf(e)===t})).forEach(function(e){e!==t.name&&ShaderSource._czmBuiltinsAndUniforms.hasOwnProperty(e)&&(e=getDependencyNode(e,ShaderSource._czmBuiltinsAndUniforms[e],i),t.dependsOn.push(e),e.requiredBy.push(t),generateDependencies(e,i))}))}function sortDependencies(e){for(var t=[],i=[];0<e.length;){var r=e.pop();i.push(r),0===r.requiredBy.length&&t.push(r)}for(;0<t.length;){var n=t.shift();e.push(n);for(var a=0;a<n.dependsOn.length;++a){var o=n.dependsOn[a],s=o.requiredBy.indexOf(n);o.requiredBy.splice(s,1),0===o.requiredBy.length&&t.push(o)}}for(var l=0;l<i.length;++l)i[l].requiredBy.length}function getBuiltinsAndAutomaticUniforms(e){var t=[],e=getDependencyNode("main",e,t);generateDependencies(e,t),sortDependencies(t);for(var i="",r=t.length-1;0<=r;--r)i=i+t[r].glslSource+"\n";return i.replace(e.glslSource,"")}function combineShader(e,t,i){var r,n,a="",o=e.sources;if(defined(o))for(d=0,r=o.length;d<r;++d)a+="\n#line 0\n"+o[d];var a=(a=removeComments(a)).replace(/#version\s+(.*?)\n/gm,function(e,t){return n=t,"\n"}),s=[];a=(a=a.replace(/#extension.*\n/gm,function(e){return s.push(e),"\n"})).replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var l=e.pickColorQualifier;defined(l)&&(a=ShaderSource.createPickFragmentShaderSource(a,l));var c="";defined(n)&&(c="#version "+n+"\n");for(var u=s.length,d=0;d<u;d++)c+=s[d];t&&(c+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n #define highp mediump\n#endif\n\n");var h=e.defines;if(defined(h))for(d=0,r=h.length;d<r;++d){var p=h[d];0!==p.length&&(c+="#define "+p+"\n")}return i.webgl2&&(c+="#define OUTPUT_DECLARATION\n\n"),i.textureFloatLinear&&(c+="#define OES_texture_float_linear\n\n"),i.floatingPointTexture&&(c+="#define OES_texture_float\n\n"),e.includeBuiltIns&&(c+=getBuiltinsAndAutomaticUniforms(a)),c+="\n#line 0\n",c+=a,c=i.webgl2?modernizeShader(c,t):c}function ShaderSource(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).pickColorQualifier;this.defines=defined(e.defines)?e.defines.slice(0):[],this.sources=defined(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=defaultValue(e.includeBuiltIns,!0)}for(builtinName in ShaderSource.prototype.clone=function(){return new ShaderSource({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},ShaderSource.replaceMain=function(e,t){return e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t="void "+t+"()")},ShaderSource.prototype.createCombinedVertexShader=function(e){return combineShader(this,!1,e)},ShaderSource.prototype.createCombinedFragmentShader=function(e){return combineShader(this,!0,e)},ShaderSource._czmBuiltinsAndUniforms={},CzmBuiltins)CzmBuiltins.hasOwnProperty(builtinName)&&(ShaderSource._czmBuiltinsAndUniforms[builtinName]=CzmBuiltins[builtinName]);for(uniformName in AutomaticUniforms){AutomaticUniforms.hasOwnProperty(uniformName)&&(uniform=AutomaticUniforms[uniformName],"function"==typeof uniform.getDeclaration&&(ShaderSource._czmBuiltinsAndUniforms[uniformName]=uniform.getDeclaration(uniformName)))}ShaderSource.createPickVertexShaderSource=function(e){return ShaderSource.replaceMain(e,"czm_old_main")+"\nattribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}"},ShaderSource.createPickFragmentShaderSource=function(e,t){return ShaderSource.replaceMain(e,"czm_old_main")+"\n"+(t+" vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = czm_pickColor; \n}")},ShaderSource.findVarying=function(e,t){for(var i=e.sources,r=t.length,n=0;n<r;++n)for(var a=t[n],o=i.length,s=0;s<o;++s)if(-1!==i[s].indexOf(a))return a};var normalVaryingNames=["v_normalEC","v_normal"];ShaderSource.findNormalVarying=function(e){return ShaderSource.findVarying(e,normalVaryingNames)};var positionVaryingNames=["v_positionEC"];ShaderSource.findPositionVarying=function(e){return ShaderSource.findVarying(e,positionVaryingNames)};var ShadowVolumeAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\nuniform float u_globeMinimumAltitude;\n#endif // EXTRUDED_GEOMETRY\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif // PER_INSTANCE_COLOR\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\nvoid main()\n{\nvec4 position = czm_computePosition();\n#ifdef EXTRUDED_GEOMETRY\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\ndelta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\nposition = position + vec4(extrudeDirection * delta, 0.0);\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nv_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\nv_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\n#else // SPHERICAL\n#ifdef COLUMBUS_VIEW_2D\nvec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\nvec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\nvec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\nbool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\nplanes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\nplanes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\nidlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\nidlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\nplanes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\nplanes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\nvec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\nvec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\n#else // COLUMBUS_VIEW_2D\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\nvec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\nvec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\n#endif // COLUMBUS_VIEW_2D\nvec3 eastWard = southEastCorner - southWestCorner;\nfloat eastExtent = length(eastWard);\neastWard /= eastExtent;\nvec3 northWard = northWestCorner - southWestCorner;\nfloat northExtent = length(northWard);\nnorthWard /= northExtent;\nv_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\nv_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\nv_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n#endif // SPHERICAL\nvec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\nvec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\nv_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\nv_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\nv_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\n#endif // TEXTURE_COORDINATES\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#endif\ngl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);\n}\n",ShadowVolumeFS="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvoid main(void)\n{\n#ifdef VECTOR_TILE\ngl_FragColor = czm_gammaCorrect(u_highlightColor);\n#else\ngl_FragColor = vec4(1.0);\n#endif\nczm_writeDepthClamp();\n}\n",ClassificationType={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2,NUMBER_OF_CLASSIFICATION_TYPES:3},ClassificationType$1=Object.freeze(ClassificationType),DepthFunction={NEVER:WebGLConstants$1.NEVER,LESS:WebGLConstants$1.LESS,EQUAL:WebGLConstants$1.EQUAL,LESS_OR_EQUAL:WebGLConstants$1.LEQUAL,GREATER:WebGLConstants$1.GREATER,NOT_EQUAL:WebGLConstants$1.NOTEQUAL,GREATER_OR_EQUAL:WebGLConstants$1.GEQUAL,ALWAYS:WebGLConstants$1.ALWAYS},DepthFunction$1=Object.freeze(DepthFunction),BufferUsage={STREAM_DRAW:WebGLConstants$1.STREAM_DRAW,STATIC_DRAW:WebGLConstants$1.STATIC_DRAW,DYNAMIC_DRAW:WebGLConstants$1.DYNAMIC_DRAW,validate:function(e){return e===BufferUsage.STREAM_DRAW||e===BufferUsage.STATIC_DRAW||e===BufferUsage.DYNAMIC_DRAW}},BufferUsage$1=Object.freeze(BufferUsage);function Buffer$1(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context._gl,i=e.bufferTarget,r=e.typedArray,n=e.sizeInBytes,a=e.usage,o=defined(r);o&&(n=r.byteLength);var s=t.createBuffer();t.bindBuffer(i,s),t.bufferData(i,o?r:n,a),t.bindBuffer(i,null),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=i,this._sizeInBytes=n,this._usage=a,this._buffer=s,this.vertexArrayDestroyable=!0}function addAttribute(e,t,i,r){var n=defined(t.vertexBuffer),a=defined(t.value),o=t.value?t.value.length:t.componentsPerAttribute,s={index:defaultValue(t.index,i),enabled:defaultValue(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:a?t.value.slice(0):void 0,componentsPerAttribute:o,componentDatatype:defaultValue(t.componentDatatype,ComponentDatatype$1.FLOAT),normalize:defaultValue(t.normalize,!1),offsetInBytes:defaultValue(t.offsetInBytes,0),strideInBytes:defaultValue(t.strideInBytes,0),instanceDivisor:defaultValue(t.instanceDivisor,0)};if(n)s.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),0<this.instanceDivisor&&(r.glVertexAttribDivisor(t,this.instanceDivisor),r._vertexAttribDivisors[t]=this.instanceDivisor,r._previousDrawInstanced=!0)},s.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),0<this.instanceDivisor&&r.glVertexAttribDivisor(i,0)};else{switch(s.componentsPerAttribute){case 1:s.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:s.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:s.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:s.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}s.disableVertexAttribArray=function(e){}}e.push(s)}function bind(e,t,i){for(var r=0;r<t.length;++r){var n=t[r];n.enabled&&n.vertexAttrib(e)}defined(i)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i._getBuffer())}function VertexArray(e){for(var t,i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context,r=i._gl,n=e.attributes,e=e.indexBuffer,a=[],o=1,s=!1,l=!1,c=n.length,u=0;u<c;++u)addAttribute(a,n[u],u,i);for(c=a.length,u=0;u<c;++u){var d=a[u];if(defined(d.vertexBuffer)&&0===d.instanceDivisor){var h=d.strideInBytes||d.componentsPerAttribute*ComponentDatatype$1.getSizeInBytes(d.componentDatatype),o=d.vertexBuffer.sizeInBytes/h;break}}for(u=0;u<c;++u)0<a[u].instanceDivisor&&(s=!0),defined(a[u].value)&&(l=!0);i.vertexArrayObject&&(t=i.glCreateVertexArray(),i.glBindVertexArray(t),bind(r,a,e),i.glBindVertexArray(null)),this._numberOfVertices=o,this._hasInstancedAttributes=s,this._hasConstantAttributes=l,this._context=i,this._gl=r,this._vao=t,this._attributes=a,this._indexBuffer=e}function computeNumberOfVertices(e){return e.values.length/e.componentsPerAttribute}function computeAttributeSizeInBytes(e){return ComponentDatatype$1.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function interleaveAttributes(i){var e,t=[];for(h in i)i.hasOwnProperty(h)&&defined(i[h])&&defined(i[h].values)&&(t.push(h),i[h].componentDatatype===ComponentDatatype$1.DOUBLE&&(i[h].componentDatatype=ComponentDatatype$1.FLOAT,i[h].values=ComponentDatatype$1.createTypedArray(ComponentDatatype$1.FLOAT,i[h].values)));var r=t.length;if(0<r)for(e=computeNumberOfVertices(i[t[0]]),d=1;d<r;++d){var n=computeNumberOfVertices(i[t[d]]);if(n!==e)throw new RuntimeError("Each attribute list must have the same number of vertices. Attribute "+t[d]+" has a different number of vertices ("+n.toString()+") than attribute "+t[0]+" ("+e.toString()+").")}t.sort(function(e,t){return ComponentDatatype$1.getSizeInBytes(i[t].componentDatatype)-ComponentDatatype$1.getSizeInBytes(i[e].componentDatatype)});var a=0,o={};for(d=0;d<r;++d)h=t[d],f=i[h],o[h]=a,a+=computeAttributeSizeInBytes(f);if(0<a){var s=ComponentDatatype$1.getSizeInBytes(i[t[0]].componentDatatype),l=a%s;0!=l&&(a+=s-l);for(var c=new ArrayBuffer(e*a),u={},d=0;d<r;++d){var h=t[d],p=ComponentDatatype$1.getSizeInBytes(i[h].componentDatatype);u[h]={pointer:ComponentDatatype$1.createTypedArray(i[h].componentDatatype,c),index:o[h]/p,strideInComponentType:a/p}}for(d=0;d<e;++d)for(var m=0;m<r;++m){h=t[m];for(var f,g=(f=i[h]).values,_=u[h],y=_.pointer,C=f.componentsPerAttribute,v=0;v<C;++v)y[_.index+v]=g[d*C+v];_.index+=_.strideInComponentType}return{buffer:c,offsetsInBytes:o,vertexSizeInBytes:a}}}function setVertexAttribDivisor(e){var t=e._context,i=e._hasInstancedAttributes;if(i||t._previousDrawInstanced){t._previousDrawInstanced=i;var r=t._vertexAttribDivisors,n=e._attributes,a=ContextLimits.maximumVertexAttributes;if(i)for(var o=n.length,s=0;s<o;++s){var l,c=n[s];!c.enabled||(l=c.instanceDivisor)!==r[c=c.index]&&(t.glVertexAttribDivisor(c,l),r[c]=l)}else for(s=0;s<a;++s)0<r[s]&&(t.glVertexAttribDivisor(s,0),r[s]=0)}}function setConstantAttributes(e,t){for(var i=e._attributes,r=i.length,n=0;n<r;++n){var a=i[n];a.enabled&&defined(a.value)&&a.vertexAttrib(t)}}function BatchTable(e,t,i){var r,n,a,o,s,l,c;this._attributes=t,this._numberOfInstances=i,0!==t.length&&(r=getDatatype(t),s=e.floatingPointTexture,o=getStride(a=createOffsets(t,n=r===PixelDatatype$1.FLOAT&&!s),t,n),c=Math.floor(ContextLimits.maximumTextureSize/o),t=.5*(s=1/(e=o*(l=Math.min(i,c)))),l=.5*(i=1/(c=Math.ceil(i/l))),this._textureDimensions=new Cartesian2(e,c),this._textureStep=new Cartesian4(s,t,i,l),this._pixelDatatype=n?PixelDatatype$1.UNSIGNED_BYTE:r,this._packFloats=n,this._offsets=a,this._stride=o,this._texture=void 0,c=4*e*c,this._batchValues=new(r!==PixelDatatype$1.FLOAT||n?Uint8Array:Float32Array)(c),this._batchValuesDirty=!1)}function getDatatype(e){for(var t=!1,i=e.length,r=0;r<i;++r)if(e[r].componentDatatype!==ComponentDatatype$1.UNSIGNED_BYTE){t=!0;break}return t?PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE}function getAttributeType(e,t){t=e[t].componentsPerAttribute;return 2===t?Cartesian2:3===t?Cartesian3:4===t?Cartesian4:Number}function createOffsets(e,t){for(var i=new Array(e.length),r=0,n=e.length,a=0;a<n;++a){var o=e[a].componentDatatype;i[a]=r,o!==ComponentDatatype$1.UNSIGNED_BYTE&&t?r+=4:++r}return i}function getStride(e,t,i){var r=e.length,e=e[r-1];return t[r-1].componentDatatype!==ComponentDatatype$1.UNSIGNED_BYTE&&i?e+4:e+1}Buffer$1.createVertexBuffer=function(e){return new Buffer$1({context:e.context,bufferTarget:WebGLConstants$1.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},Buffer$1.createIndexBuffer=function(e){var t=e.context,i=e.indexDatatype,r=IndexDatatype$1.getSizeInBytes(i),e=new Buffer$1({context:t,bufferTarget:WebGLConstants$1.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),n=e.sizeInBytes/r;return Object.defineProperties(e,{indexDatatype:{get:function(){return i}},bytesPerIndex:{get:function(){return r}},numberOfIndices:{get:function(){return n}}}),e},Object.defineProperties(Buffer$1.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),Buffer$1.prototype._getBuffer=function(){return this._buffer},Buffer$1.prototype.copyFromArrayView=function(e,t){t=defaultValue(t,0);var i=this._gl,r=this._bufferTarget;i.bindBuffer(r,this._buffer),i.bufferSubData(r,t,e),i.bindBuffer(r,null)},Buffer$1.prototype.copyFromBuffer=function(e,t,i,r){var n=WebGLConstants$1.COPY_READ_BUFFER,a=WebGLConstants$1.COPY_WRITE_BUFFER,o=this._gl;o.bindBuffer(a,this._buffer),o.bindBuffer(n,e._buffer),o.copyBufferSubData(n,a,t,i,r),o.bindBuffer(a,null),o.bindBuffer(n,null)},Buffer$1.prototype.getBufferData=function(e,t,i,r){t=defaultValue(t,0),i=defaultValue(i,0);var n=this._gl,a=WebGLConstants$1.COPY_READ_BUFFER;n.bindBuffer(a,this._buffer),n.getBufferSubData(a,t,e,i,r),n.bindBuffer(a,null)},Buffer$1.prototype.isDestroyed=function(){return!1},Buffer$1.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),destroyObject(this)},VertexArray.fromGeometry=function(e){var t,i,r,n,a=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context,o=defaultValue(e.geometry,defaultValue.EMPTY_OBJECT),s=defaultValue(e.bufferUsage,BufferUsage$1.DYNAMIC_DRAW),l=defaultValue(e.attributeLocations,defaultValue.EMPTY_OBJECT),c=defaultValue(e.interleave,!1),e=e.vertexArrayAttributes,u=defined(e)?e:[],d=o.attributes;if(c){var h=interleaveAttributes(d);if(defined(h)){var p=Buffer$1.createVertexBuffer({context:a,typedArray:h.buffer,usage:s}),m=h.offsetsInBytes,f=h.vertexSizeInBytes;for(t in d)d.hasOwnProperty(t)&&defined(d[t])&&(defined((i=d[t]).values)?u.push({index:l[t],vertexBuffer:p,componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,offsetInBytes:m[t],strideInBytes:f}):u.push({index:l[t],value:i.value,componentDatatype:i.componentDatatype,normalize:i.normalize}))}}else for(t in d)d.hasOwnProperty(t)&&defined(d[t])&&((r=(i=d[t]).componentDatatype)===ComponentDatatype$1.DOUBLE&&(r=ComponentDatatype$1.FLOAT),p=void 0,defined(i.values)&&(p=Buffer$1.createVertexBuffer({context:a,typedArray:ComponentDatatype$1.createTypedArray(r,i.values),usage:s})),u.push({index:l[t],vertexBuffer:p,value:i.value,componentDatatype:r,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize}));h=o.indices;return new VertexArray({context:a,attributes:u,indexBuffer:n=defined(h)?Geometry.computeNumberOfVertices(o)>=CesiumMath.SIXTY_FOUR_KILOBYTES&&a.elementIndexUint?Buffer$1.createIndexBuffer({context:a,typedArray:new Uint32Array(h),usage:s,indexDatatype:IndexDatatype$1.UNSIGNED_INT}):Buffer$1.createIndexBuffer({context:a,typedArray:new Uint16Array(h),usage:s,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT}):n})},Object.defineProperties(VertexArray.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),VertexArray.prototype.getAttribute=function(e){return this._attributes[e]},VertexArray.prototype._bind=function(){defined(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&setVertexAttribDivisor(this),this._hasConstantAttributes&&setConstantAttributes(this,this._gl)):bind(this._gl,this._attributes,this._indexBuffer)},VertexArray.prototype._unBind=function(){if(defined(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,i=0;i<e.length;++i){var r=e[i];r.enabled&&r.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},VertexArray.prototype.isDestroyed=function(){return!1},VertexArray.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var i=e[t].vertexBuffer;defined(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}var r=this._indexBuffer;return defined(r)&&!r.isDestroyed()&&r.vertexArrayDestroyable&&r.destroy(),defined(this._vao)&&this._context.glDeleteVertexArray(this._vao),destroyObject(this)},Object.defineProperties(BatchTable.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var scratchPackedFloatCartesian4=new Cartesian4;function getPackedFloat(e,t,i){var r=Cartesian4.unpack(e,t,scratchPackedFloatCartesian4),n=Cartesian4.unpackFloat(r),r=Cartesian4.unpack(e,t+4,scratchPackedFloatCartesian4),a=Cartesian4.unpackFloat(r);r=Cartesian4.unpack(e,t+8,scratchPackedFloatCartesian4);var o=Cartesian4.unpackFloat(r);r=Cartesian4.unpack(e,t+12,scratchPackedFloatCartesian4);r=Cartesian4.unpackFloat(r);return Cartesian4.fromElements(n,a,o,r,i)}function setPackedAttribute(e,t,i){var r=Cartesian4.packFloat(e.x,scratchPackedFloatCartesian4);Cartesian4.pack(r,t,i),r=Cartesian4.packFloat(e.y,r),Cartesian4.pack(r,t,i+4),r=Cartesian4.packFloat(e.z,r),Cartesian4.pack(r,t,i+8),r=Cartesian4.packFloat(e.w,r),Cartesian4.pack(r,t,i+12)}var scratchGetAttributeCartesian4$1=new Cartesian4;BatchTable.prototype.getBatchedAttribute=function(e,t,i){var r=this._attributes,n=this._offsets[t],n=4*this._stride*e+4*n,n=this._packFloats&&r[t].componentDatatype!==PixelDatatype$1.UNSIGNED_BYTE?getPackedFloat(this._batchValues,n,scratchGetAttributeCartesian4$1):Cartesian4.unpack(this._batchValues,n,scratchGetAttributeCartesian4$1),t=getAttributeType(r,t);return defined(t.fromCartesian4)?t.fromCartesian4(n,i):defined(t.clone)?t.clone(n,i):n.x};var setAttributeScratchValues=[void 0,void 0,new Cartesian2,new Cartesian3,new Cartesian4],setAttributeScratchCartesian4=new Cartesian4;function createTexture$3(e,t){var i=e._textureDimensions;e._texture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:Sampler.NEAREST,flipY:!1})}function updateTexture(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function getGlslComputeSt$1(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float numberOfAttributes = float("+t+"); \n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float stepY = batchTextureStep.z; \n float centerY = batchTextureStep.w; \n float numberOfAttributes = float("+t+"); \n float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}function getComponentType(e){return 1===e?"float":"vec"+e}function getComponentSwizzle(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function getGlslAttributeFunction(e,t){var i=e._attributes[t],r=i.componentsPerAttribute,n=i.functionName,a=getComponentType(r),r=getComponentSwizzle(r),t=a+" "+n+"(float batchId) \n{ \n vec2 st = computeSt(batchId); \n st.x += batchTextureStep.x * float("+e._offsets[t]+"); \n";return e._packFloats&&i.componentDatatype!==PixelDatatype$1.UNSIGNED_BYTE?t+="vec4 textureValue; \ntextureValue.x = czm_unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":t+=" vec4 textureValue = texture2D(batchTexture, st); \n",t+=" "+a+" value = textureValue"+r+"; \n",e._pixelDatatype!==PixelDatatype$1.UNSIGNED_BYTE||i.componentDatatype!==ComponentDatatype$1.UNSIGNED_BYTE||i.normalize?e._pixelDatatype===PixelDatatype$1.FLOAT&&i.componentDatatype===ComponentDatatype$1.UNSIGNED_BYTE&&i.normalize&&(t+="value /= 255.0; \n"):t+="value *= 255.0; \n",t+=" return value; \n} \n"}function transformToWorldCoordinates(e,t,i){var r=!i,n=e.length;if(!r&&1<n)for(var a=e[0].modelMatrix,o=1;o<n;++o)if(!Matrix4.equals(a,e[o].modelMatrix)){r=!0;break}if(r)for(o=0;o<n;++o)defined(e[o].geometry)&&GeometryPipeline.transformToWorldCoordinates(e[o]);else Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}function addGeometryBatchId(e,t){var i=e.attributes,e=i.position,r=e.values.length/e.componentsPerAttribute;i.batchId=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});for(var n=i.batchId.values,a=0;a<r;++a)n[a]=t}function addBatchIds(e){for(var t=e.length,i=0;i<t;++i){var r=e[i];defined(r.geometry)?addGeometryBatchId(r.geometry,i):defined(r.westHemisphereGeometry)&&defined(r.eastHemisphereGeometry)&&(addGeometryBatchId(r.westHemisphereGeometry,i),addGeometryBatchId(r.eastHemisphereGeometry,i))}}function geometryPipeline(e){var t=e.instances,i=e.projection,r=e.elementIndexUintSupported,n=e.scene3DOnly,a=e.vertexCacheOptimize,o=e.compressVertices,e=e.modelMatrix,s=t.length;for(g=0;g<s;++g)if(defined(t[g].geometry)){t[g].geometry.primitiveType;break}if(transformToWorldCoordinates(t,e,n),!n)for(g=0;g<s;++g)defined(t[g].geometry)&&GeometryPipeline.splitLongitude(t[g]);if(addBatchIds(t),a)for(g=0;g<s;++g){var l=t[g];defined(l.geometry)?(GeometryPipeline.reorderForPostVertexCache(l.geometry),GeometryPipeline.reorderForPreVertexCache(l.geometry)):defined(l.westHemisphereGeometry)&&defined(l.eastHemisphereGeometry)&&(GeometryPipeline.reorderForPostVertexCache(l.westHemisphereGeometry),GeometryPipeline.reorderForPreVertexCache(l.westHemisphereGeometry),GeometryPipeline.reorderForPostVertexCache(l.eastHemisphereGeometry),GeometryPipeline.reorderForPreVertexCache(l.eastHemisphereGeometry))}var c=GeometryPipeline.combineInstances(t);for(s=c.length,g=0;g<s;++g){var u,d,h,p,m=(u=c[g]).attributes;if(n)for(d in m)m.hasOwnProperty(d)&&m[d].componentDatatype===ComponentDatatype$1.DOUBLE&&GeometryPipeline.encodeAttribute(u,d,d+"3DHigh",d+"3DLow");else for(d in m)m.hasOwnProperty(d)&&m[d].componentDatatype===ComponentDatatype$1.DOUBLE&&(GeometryPipeline.projectTo2D(u,d,h=d+"3D",p=d+"2D",i),defined(u.boundingSphere)&&"position"===d&&(u.boundingSphereCV=BoundingSphere.fromVertices(u.attributes.position2D.values)),GeometryPipeline.encodeAttribute(u,h,h+"High",h+"Low"),GeometryPipeline.encodeAttribute(u,p,p+"High",p+"Low"));o&&GeometryPipeline.compressVertices(u)}if(!r){for(var f=[],s=c.length,g=0;g<s;++g)u=c[g],f=f.concat(GeometryPipeline.fitToUnsignedShortIndices(u));c=f}return c}function createPickOffsets(e,t,i,r){var n,a,o,s=r.length-1;o=0<=s?(n=(s=r[s]).offset+s.count,i[a=s.index].indices.length):i[a=n=0].indices.length;for(var l=e.length,c=0;c<l;++c){var u=e[c][t];defined(u)&&(o<n+(u=u.indices.length)&&(n=0,o=i[++a].indices.length),r.push({index:a,offset:n,count:u}),n+=u)}}function createInstancePickOffsets(e,t){var i=[];return createPickOffsets(e,"geometry",t,i),createPickOffsets(e,"westHemisphereGeometry",t,i),createPickOffsets(e,"eastHemisphereGeometry",t,i),i}BatchTable.prototype.setBatchedAttribute=function(e,t,i){var r=this._attributes,n=setAttributeScratchValues[r[t].componentsPerAttribute],a=this.getBatchedAttribute(e,t,n),n=getAttributeType(this._attributes,t);(defined(n.equals)?n.equals(a,i):a===i)||((a=setAttributeScratchCartesian4).x=defined(i.x)?i.x:i,a.y=defined(i.y)?i.y:0,a.z=defined(i.z)?i.z:0,a.w=defined(i.w)?i.w:0,i=this._offsets[t],i=4*this._stride*e+4*i,this._packFloats&&r[t].componentDatatype!==PixelDatatype$1.UNSIGNED_BYTE?setPackedAttribute(a,this._batchValues,i):Cartesian4.pack(a,this._batchValues,i),this._batchValuesDirty=!0)},BatchTable.prototype.update=function(e){defined(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,defined(this._texture)||createTexture$3(this,e.context),updateTexture(this))},BatchTable.prototype.getUniformMapCallback=function(){var t=this;return function(e){return 0===t._attributes.length?e:combine$2(e,{batchTexture:function(){return t._texture},batchTextureDimensions:function(){return t._textureDimensions},batchTextureStep:function(){return t._textureStep}})}},BatchTable.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var r="uniform highp sampler2D batchTexture; \n";r+=getGlslComputeSt$1(this)+"\n";for(var t=e.length,i=0;i<t;++i)r+=getGlslAttributeFunction(this,i);return function(e){var t=e.indexOf("void main"),i=e.substring(0,t),t=e.substring(t);return i+"\n"+r+"\n"+t}},BatchTable.prototype.isDestroyed=function(){return!1},BatchTable.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),destroyObject(this)};var PrimitivePipeline={};function transferGeometry(e,t){var i,r,n=e.attributes;for(i in n)!n.hasOwnProperty(i)||defined(r=n[i])&&defined(r.values)&&t.push(r.values.buffer);defined(e.indices)&&t.push(e.indices.buffer)}function transferGeometries(e,t){for(var i=e.length,r=0;r<i;++r)transferGeometry(e[r],t)}function countCreateGeometryResults(e){for(var t=1,i=e.length,r=0;r<i;r++){var n=e[r];if(++t,defined(n)){var a,o=n.attributes;for(a in t+=7+2*BoundingSphere.packedLength+(defined(n.indices)?n.indices.length:0),o)o.hasOwnProperty(a)&&defined(o[a])&&(t+=5+o[a].values.length)}}return t}function packInstancesForCombine(e,t){var i=e.length,r=new Float64Array(1+19*i),n=0;r[n++]=i;for(var a=0;a<i;a++){var o=e[a];Matrix4.pack(o.modelMatrix,r,n),n+=Matrix4.packedLength,defined(o.attributes)&&defined(o.attributes.offset)&&(o=o.attributes.offset.value,r[n]=o[0],r[n+1]=o[1],r[n+2]=o[2]),n+=3}return t.push(r.buffer),r}function unpackInstancesForCombine(e){for(var t=e,i=new Array(t[0]),r=0,n=1;n<t.length;){var a,o=Matrix4.unpack(t,n);defined(t[n+=Matrix4.packedLength])&&(a={offset:new OffsetGeometryInstanceAttribute(t[n],t[n+1],t[n+2])}),n+=3,i[r++]={modelMatrix:o,attributes:a}}return i}function packBoundingSpheres(e){var t=e.length,i=1+(BoundingSphere.packedLength+1)*t,r=new Float32Array(i),n=0;r[n++]=t;for(var a=0;a<t;++a)defined(e[a])?(r[n++]=1,BoundingSphere.pack(e[a],r,n)):r[n++]=0,n+=BoundingSphere.packedLength;return r}function unpackBoundingSpheres(e){for(var t=new Array(e[0]),i=0,r=1;r<e.length;)1===e[r++]&&(t[i]=BoundingSphere.unpack(e,r)),++i,r+=BoundingSphere.packedLength;return t}PrimitivePipeline.combineGeometry=function(e){var t,i,r,n,a=e.instances,o=a.length,s=!1;0<o&&(0<(t=geometryPipeline(e)).length&&(i=GeometryPipeline.createAttributeLocations(t[0]),e.createPickOffsets&&(r=createInstancePickOffsets(a,t))),defined(a[0].attributes)&&defined(a[0].attributes.offset)&&(n=new Array(o),s=!0));for(var l=new Array(o),c=new Array(o),u=0;u<o;++u){var d=a[u],h=d.geometry;defined(h)&&(l[u]=h.boundingSphere,c[u]=h.boundingSphereCV,s&&(n[u]=d.geometry.offsetAttribute));h=d.eastHemisphereGeometry,d=d.westHemisphereGeometry;defined(h)&&defined(d)&&(defined(h.boundingSphere)&&defined(d.boundingSphere)&&(l[u]=BoundingSphere.union(h.boundingSphere,d.boundingSphere)),defined(h.boundingSphereCV)&&defined(d.boundingSphereCV)&&(c[u]=BoundingSphere.union(h.boundingSphereCV,d.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:i,pickOffsets:r,offsetInstanceExtend:n,boundingSpheres:l,boundingSpheresCV:c}},PrimitivePipeline.packCreateGeometryResults=function(e,t){var i=new Float64Array(countCreateGeometryResults(e)),r=[],n={},a=e.length,o=0;i[o++]=a;for(var s=0;s<a;s++){var l=e[s],c=defined(l);if(i[o++]=c?1:0,c){i[o++]=l.primitiveType,i[o++]=l.geometryType,i[o++]=defaultValue(l.offsetAttribute,-1);c=defined(l.boundingSphere)?1:0;(i[o++]=c)&&BoundingSphere.pack(l.boundingSphere,i,o),o+=BoundingSphere.packedLength;c=defined(l.boundingSphereCV)?1:0;(i[o++]=c)&&BoundingSphere.pack(l.boundingSphereCV,i,o),o+=BoundingSphere.packedLength;var u,d=l.attributes,h=[];for(u in d)d.hasOwnProperty(u)&&defined(d[u])&&(h.push(u),defined(n[u])||(n[u]=r.length,r.push(u)));i[o++]=h.length;for(var p=0;p<h.length;p++){var m=h[p],f=d[m];i[o++]=n[m],i[o++]=f.componentDatatype,i[o++]=f.componentsPerAttribute,i[o++]=f.normalize?1:0,i[o++]=f.values.length,i.set(f.values,o),o+=f.values.length}c=defined(l.indices)?l.indices.length:0;0<(i[o++]=c)&&(i.set(l.indices,o),o+=c)}}return t.push(i.buffer),{stringTable:r,packedData:i}},PrimitivePipeline.unpackCreateGeometryResults=function(e){for(var t=e.stringTable,i=e.packedData,r=new Array(i[0]),n=0,a=1;a<i.length;)if(1===i[a++]){var o,s,l=i[a++],c=i[a++],u=i[a++];-1===u&&(u=void 0),1===i[a++]&&(o=BoundingSphere.unpack(i,a)),a+=BoundingSphere.packedLength,1===i[a++]&&(s=BoundingSphere.unpack(i,a)),a+=BoundingSphere.packedLength;var d=new GeometryAttributes,h=i[a++];for(T=0;T<h;T++){for(var p=t[i[a++]],m=i[a++],f=i[a++],g=0!==i[a++],_=i[a++],y=ComponentDatatype$1.createTypedArray(m,_),C=0;C<_;C++)y[C]=i[a++];d[p]=new GeometryAttribute({componentDatatype:m,componentsPerAttribute:f,normalize:g,values:y})}if(0<(_=i[a++]))for(var v=y.length/f,S=IndexDatatype$1.createTypedArray(v,_),T=0;T<_;T++)S[T]=i[a++];r[n++]=new Geometry({primitiveType:l,geometryType:c,boundingSphere:o,boundingSphereCV:s,indices:S,attributes:d,offsetAttribute:u})}else r[n++]=void 0;return r},PrimitivePipeline.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;n<r;n++)t.push(i[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:packInstancesForCombine(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},PrimitivePipeline.unpackCombineGeometryParameters=function(e){for(var t=unpackInstancesForCombine(e.packedInstances),i=e.createGeometryResults,r=i.length,n=0,a=0;a<r;a++)for(var o=PrimitivePipeline.unpackCreateGeometryResults(i[a]),s=o.length,l=0;l<s;l++){var c=o[l];t[n].geometry=c,++n}var u=Ellipsoid.clone(e.ellipsoid);return{instances:t,ellipsoid:u,projection:new(e.isGeographic?GeographicProjection:WebMercatorProjection)(u),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},PrimitivePipeline.packCombineGeometryResults=function(e,t){defined(e.geometries)&&transferGeometries(e.geometries,t);var i=packBoundingSpheres(e.boundingSpheres),r=packBoundingSpheres(e.boundingSpheresCV);return t.push(i.buffer,r.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:i,boundingSpheresCV:r}},PrimitivePipeline.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:unpackBoundingSpheres(e.boundingSpheres),boundingSpheresCV:unpackBoundingSpheres(e.boundingSpheresCV)}};var PrimitiveState={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},PrimitiveState$1=Object.freeze(PrimitiveState),SceneMode={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3,getMorphTime:function(e){return e===SceneMode.SCENE3D?1:e!==SceneMode.MORPHING?0:void 0}},SceneMode$1=Object.freeze(SceneMode),ShadowMode={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4,castShadows:function(e){return e===ShadowMode.ENABLED||e===ShadowMode.CAST_ONLY},receiveShadows:function(e){return e===ShadowMode.ENABLED||e===ShadowMode.RECEIVE_ONLY},fromCastReceive:function(e,t){return e&&t?ShadowMode.ENABLED:e?ShadowMode.CAST_ONLY:t?ShadowMode.RECEIVE_ONLY:ShadowMode.DISABLED}},ShadowMode$1=Object.freeze(ShadowMode);function Primitive(e){e=defaultValue(e,defaultValue.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=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=new Matrix4,this.show=defaultValue(e.show,!0),this._vertexCacheOptimize=defaultValue(e.vertexCacheOptimize,!1),this._interleave=defaultValue(e.interleave,!1),this._releaseGeometryInstances=defaultValue(e.releaseGeometryInstances,!0),this._allowPicking=defaultValue(e.allowPicking,!0),this._asynchronous=defaultValue(e.asynchronous,!0),this._compressVertices=defaultValue(e.compressVertices,!0),this.cull=defaultValue(e.cull,!0),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=defaultValue(e.shadows,ShadowMode$1.DISABLED),this._translucent=void 0,this._state=PrimitiveState$1.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],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._readyPromise=when.defer(),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}function getCommonPerInstanceAttributeNames(e){var t,i=e.length,r=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)&&defined(n[t])){for(var a=n[t],o=!0,s=1;s<i;++s){var l=e[s].attributes[t];if(!defined(l)||a.componentDatatype!==l.componentDatatype||a.componentsPerAttribute!==l.componentsPerAttribute||a.normalize!==l.normalize){o=!1;break}}o&&r.push(t)}return r}Object.defineProperties(Primitive.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}},readyPromise:{get:function(){return this._readyPromise.promise}}});var scratchGetAttributeCartesian2=new Cartesian2,scratchGetAttributeCartesian3=new Cartesian3,scratchGetAttributeCartesian4=new Cartesian4;function getAttributeValue(e){var t=e.length;return 1===t?e[0]:2===t?Cartesian2.unpack(e,0,scratchGetAttributeCartesian2):3===t?Cartesian3.unpack(e,0,scratchGetAttributeCartesian3):4===t?Cartesian4.unpack(e,0,scratchGetAttributeCartesian4):void 0}function createBatchTable$1(e,t){var i=e.geometryInstances,r=Array.isArray(i)?i:[i],n=r.length;if(0!==n){for(var a,o=getCommonPerInstanceAttributeNames(r),s=o.length,l=[],c={},i={},u=r[0].attributes,d=0;d<s;++d)_=u[g=o[d]],c[g]=d,l.push({functionName:"czm_batchTable_"+g,componentDatatype:_.componentDatatype,componentsPerAttribute:_.componentsPerAttribute,normalize:_.normalize});-1!==o.indexOf("distanceDisplayCondition")&&(l.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:1}),i.center3DHigh=l.length-5,i.center3DLow=l.length-4,i.center2DHigh=l.length-3,i.center2DLow=l.length-2,i.radius=l.length-1),-1!==o.indexOf("offset")&&(l.push({functionName:"czm_batchTable_offset2D",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3}),a=l.length-1),l.push({functionName:"czm_batchTable_pickColor",componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var h=l.length,p=new BatchTable(t,l,n);for(d=0;d<n;++d){for(var m=r[d],u=m.attributes,f=0;f<s;++f){var g,_,y=getAttributeValue((_=u[g=o[f]]).value),C=c[g];p.setBatchedAttribute(d,C,y)}var v={primitive:defaultValue(m.pickPrimitive,e)};defined(m.id)&&(v.id=m.id);m=t.createPickId(v);e._pickIds.push(m);v=m.color,m=scratchGetAttributeCartesian4;m.x=Color.floatToByte(v.red),m.y=Color.floatToByte(v.green),m.z=Color.floatToByte(v.blue),m.w=Color.floatToByte(v.alpha),p.setBatchedAttribute(d,h-1,m)}e._batchTable=p,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=i,e._batchTableOffsetAttribute2DIndex=a}}function cloneAttribute(e){var t=Array.isArray(e.values)?e.values.slice(0):new e.values.constructor(e.values);return new GeometryAttribute({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function cloneGeometry(e){var t,i,r=e.attributes,n=new GeometryAttributes;for(t in r)r.hasOwnProperty(t)&&defined(r[t])&&(n[t]=cloneAttribute(r[t]));return defined(e.indices)&&(i=e.indices,i=Array.isArray(i)?i.slice(0):new i.constructor(i)),new Geometry({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:BoundingSphere.clone(e.boundingSphere)})}function cloneInstance(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:Matrix4.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var positionRegex=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;function appendPickToVertexShader(e){return ShaderSource.replaceMain(e,"czm_non_pick_main")+"\nvarying vec4 v_pickColor; \nvoid main() \n{ \n czm_non_pick_main(); \n v_pickColor = czm_batchTable_pickColor(batchId); \n}"}function appendPickToFragmentShader(e){return"varying vec4 v_pickColor;\n"+e}function modifyForEncodedNormals$1(e,t){if(!e.compressVertices)return t;var i=-1!==t.search(/attribute\s+vec3\s+normal;/g),r=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!i&&!r)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),a=-1!==t.search(/attribute\s+vec3\s+bitangent;/g),o=r&&i?2:1,s="compressedAttributes",l="attribute "+(1<(o+=n||a?1:0)?"vec"+o:"float")+" "+s+";",c="",e="";r&&(c+="vec2 st;\n",e+=" st = czm_decompressTextureCoordinates("+(1<o?s+".x":s)+");\n"),i&&n&&a?(c+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",e+=" czm_octDecode("+s+"."+(r?"yz":"xy")+", normal, tangent, bitangent);\n"):(i&&(c+="vec3 normal;\n",e+=" normal = czm_octDecode("+s+(1<o?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",e+=" tangent = czm_octDecode("+s+"."+(r&&i?"z":"y")+");\n"),a&&(c+="vec3 bitangent;\n",e+=" bitangent = czm_octDecode("+s+"."+(r&&i?"z":"y")+");\n"));return t=(t=(t=(t=t.replace(/attribute\s+vec3\s+normal;/g,"")).replace(/attribute\s+vec2\s+st;/g,"")).replace(/attribute\s+vec3\s+tangent;/g,"")).replace(/attribute\s+vec3\s+bitangent;/g,""),[l,c,t=ShaderSource.replaceMain(t,"czm_non_compressed_main"),"void main() \n{ \n"+e+" czm_non_compressed_main(); \n}"].join("\n")}function depthClampVS(e){e=ShaderSource.replaceMain(e,"czm_non_depth_clamp_main");return e+="void main() {\n czm_non_depth_clamp_main();\n gl_Position = czm_depthClamp(gl_Position);}\n"}function depthClampFS(e){e=ShaderSource.replaceMain(e,"czm_non_depth_clamp_main");return e="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"+(e+="void main() {\n czm_non_depth_clamp_main();\n#if defined(GL_EXT_frag_depth)\n #if defined(LOG_DEPTH)\n czm_writeLogDepth();\n #else\n czm_writeDepthClamp();\n #endif\n#endif\n}\n")}function validateShaderMatching(e,t){e.vertexAttributes}function getUniformFunction(e,t){return function(){return e[t]}}Primitive._modifyShaderPosition=function(e,t,i){for(var r="",n="",a="";null!==(s=positionRegex.exec(t));){var o=s[1],s="vec4 czm_compute"+o[0].toUpperCase()+o.substr(1)+"()";"vec4 czm_computePosition()"!=s&&(r+=s+";\n"),defined(e.rtcCenter)?(r+="uniform mat4 u_modifiedModelView;\n",n+="attribute vec4 position;\n",a+=s+"\n{\n return u_modifiedModelView * position;\n}\n\n",t=(t=(t=(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,"")).replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,"")).replace(/czm_modelViewRelativeToEye\s+\*\s+/g,"")).replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?a+=s+"\n{\n return czm_translateRelativeToEye("+o+"3DHigh, "+o+"3DLow);\n}\n\n":(n+="attribute vec3 "+o+"2DHigh;\nattribute vec3 "+o+"2DLow;\n",a+=s+"\n{\n vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye("+o+"3DHigh, "+o+"3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye("+o+"2DHigh.zxy, "+o+"2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye("+o+"2DHigh.zxy, "+o+"2DLow.zxy),\n czm_translateRelativeToEye("+o+"3DHigh, "+o+"3DLow),\n czm_morphTime);\n }\n return p;\n}\n\n")}return[r,n,t,a].join("\n")},Primitive._appendShowToShader=function(e,t){if(!defined(e._batchTableAttributeIndices.show))return t;return ShaderSource.replaceMain(t,"czm_non_show_main")+"\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= czm_batchTable_show(batchId); \n}"},Primitive._updateColorAttribute=function(e,t,i){if(!defined(e._batchTableAttributeIndices.color)&&!defined(e._batchTableAttributeIndices.depthFailColor))return t;if(-1===t.search(/attribute\s+vec4\s+color;/g))return t;t=(t=t).replace(/attribute\s+vec4\s+color;/g,"");return t=i?t.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):t.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},Primitive._updatePickColorAttribute=function(e){return e.replace(/attribute\s+vec4\s+pickColor;/g,"").replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2")},Primitive._appendOffsetToShader=function(e,t){if(!defined(e._batchTableAttributeIndices.offset))return t;e="attribute float batchId;\n";e+="attribute float applyOffset;";e=t.replace(/attribute\s+float\s+batchId;/g,"attribute float batchId;\nattribute float applyOffset;"),t="vec4 $1 = czm_computePosition();\n";return t+=" if (czm_sceneMode == czm_sceneMode3D)\n",t+=" {\n",t+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",t+=" }\n",t+=" else\n",t+=" {\n",t+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",t+=" }\n",e=e.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,"vec4 $1 = czm_computePosition();\n if (czm_sceneMode == czm_sceneMode3D)\n {\n $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0); }\n else\n {\n $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0); }\n")},Primitive._appendDistanceDisplayConditionToShader=function(e,t,i){if(!defined(e._batchTableAttributeIndices.distanceDisplayCondition))return t;e="void main() \n{ \n czm_non_distanceDisplayCondition_main(); \n vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return e+=i?" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":" vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n vec4 centerRTE;\n if (czm_morphTime == 1.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n }\n else\n {\n centerRTE = czm_columbusViewMorph(\n czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n czm_morphTime);\n }\n",ShaderSource.replaceMain(t,"czm_non_distanceDisplayCondition_main")+"\n"+(e+=" float radiusSq = boundingSphereRadius * boundingSphereRadius; \n float distanceSq; \n if (czm_sceneMode == czm_sceneMode2D) \n { \n distanceSq = czm_eyeHeight2D.y - radiusSq; \n } \n else \n { \n distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n } \n distanceSq = max(distanceSq, 0.0); \n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n gl_Position *= show; \n}")};var numberOfCreationWorkers=Math.max(FeatureDetection.hardwareConcurrency-1,1),createGeometryTaskProcessors,combineGeometryTaskProcessor=new TaskProcessor("combineGeometry");function loadAsynchronous(t,i){var e,r,n,a,o=t._instanceIds;if(t._state===PrimitiveState$1.READY){for(var s,l=Array.isArray(t.geometryInstances)?t.geometryInstances:[t.geometryInstances],c=t._numberOfInstances=l.length,u=[],d=[],h=0;h<c;++h)e=l[h].geometry,o.push(l[h].id),d.push({moduleName:e._workerName,geometry:e});if(!defined(createGeometryTaskProcessors))for(createGeometryTaskProcessors=new Array(numberOfCreationWorkers),h=0;h<numberOfCreationWorkers;h++)createGeometryTaskProcessors[h]=new TaskProcessor("createGeometry");for(d=subdivideArray(d,numberOfCreationWorkers),h=0;h<d.length;h++){var p=0,m=d[h],f=m.length;for(y=0;y<f;++y)defined((e=(s=m[y]).geometry).constructor.pack)&&(s.offset=p,p+=defaultValue(e.constructor.packedLength,e.packedLength));if(0<p)for(var g=new Float64Array(p),_=[g.buffer],y=0;y<f;++y)defined((e=(s=m[y]).geometry).constructor.pack)&&(e.constructor.pack(e,g,s.offset),s.geometry=g);u.push(createGeometryTaskProcessors[h].scheduleTask({subTasks:d[h]},_))}t._state=PrimitiveState$1.CREATING,when.all(u,function(e){t._createGeometryResults=e,t._state=PrimitiveState$1.CREATED}).otherwise(function(e){setReady(t,i,PrimitiveState$1.FAILED,e)})}else t._state===PrimitiveState$1.CREATED&&(a=[],l=Array.isArray(t.geometryInstances)?t.geometryInstances:[t.geometryInstances],r=i.scene3DOnly,n=i.mapProjection,a=combineGeometryTaskProcessor.scheduleTask(PrimitivePipeline.packCombineGeometryParameters({createGeometryResults:t._createGeometryResults,instances:l,ellipsoid:n.ellipsoid,projection:n,elementIndexUintSupported:i.context.elementIndexUint,scene3DOnly:r,vertexCacheOptimize:t.vertexCacheOptimize,compressVertices:t.compressVertices,modelMatrix:t.modelMatrix,createPickOffsets:t._createPickOffsets},a),a),t._createGeometryResults=void 0,t._state=PrimitiveState$1.COMBINING,when(a,function(e){e=PrimitivePipeline.unpackCombineGeometryResults(e);t._geometries=e.geometries,t._attributeLocations=e.attributeLocations,t.modelMatrix=Matrix4.clone(e.modelMatrix,t.modelMatrix),t._pickOffsets=e.pickOffsets,t._offsetInstanceExtend=e.offsetInstanceExtend,t._instanceBoundingSpheres=e.boundingSpheres,t._instanceBoundingSpheresCV=e.boundingSpheresCV,defined(t._geometries)&&0<t._geometries.length?(t._recomputeBoundingSpheres=!0,t._state=PrimitiveState$1.COMBINED):setReady(t,i,PrimitiveState$1.FAILED,void 0)}).otherwise(function(e){setReady(t,i,PrimitiveState$1.FAILED,e)}))}function loadSynchronous(e,t){for(var i=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],r=e._numberOfInstances=i.length,n=new Array(r),a=e._instanceIds,o=0,s=0;s<r;s++){var l,c=(l=i[s]).geometry,c=defined(c.attributes)&&defined(c.primitiveType)?cloneGeometry(c):c.constructor.createGeometry(c);n[o++]=cloneInstance(l,c),a.push(l.id)}n.length=o;var u=t.scene3DOnly,d=t.mapProjection,u=PrimitivePipeline.combineGeometry({instances:n,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=u.geometries,e._attributeLocations=u.attributeLocations,e.modelMatrix=Matrix4.clone(u.modelMatrix,e.modelMatrix),e._pickOffsets=u.pickOffsets,e._offsetInstanceExtend=u.offsetInstanceExtend,e._instanceBoundingSpheres=u.boundingSpheres,e._instanceBoundingSpheresCV=u.boundingSpheresCV,defined(e._geometries)&&0<e._geometries.length?(e._recomputeBoundingSpheres=!0,e._state=PrimitiveState$1.COMBINED):setReady(e,t,PrimitiveState$1.FAILED,void 0)}function recomputeBoundingSpheres(e,t){var i=e._batchTableAttributeIndices.offset;if(e._recomputeBoundingSpheres&&defined(i)){var r=e._offsetInstanceExtend,n=e._instanceBoundingSpheres,a=n.length,o=e._tempBoundingSpheres;if(!defined(o)){for(o=new Array(a),h=0;h<a;h++)o[h]=new BoundingSphere;e._tempBoundingSpheres=o}for(h=0;h<a;++h){var s=o[h],l=e._batchTable.getBatchedAttribute(h,i,new Cartesian3);transformBoundingSphere(s=n[h].clone(s),l,r[h])}for(var c=[],u=[],d=[],h=0;h<a;++h){var p=o[h];0<p.center.x-p.radius||BoundingSphere.intersectPlane(p,Plane.ORIGIN_ZX_PLANE)!==Intersect$1.INTERSECTING?c.push(p):(u.push(p),d.push(p))}var m=c[0],f=d[0],g=u[0];for(h=1;h<c.length;h++)m=BoundingSphere.union(m,c[h]);for(h=1;h<d.length;h++)f=BoundingSphere.union(f,d[h]);for(h=1;h<u.length;h++)g=BoundingSphere.union(g,u[h]);var _=[];for(defined(m)&&_.push(m),defined(f)&&_.push(f),defined(g)&&_.push(g),h=0;h<_.length;h++){var y=_[h].clone(e._boundingSpheres[h]);e._boundingSpheres[h]=y,e._boundingSphereCV[h]=BoundingSphere.projectTo2D(y,t.mapProjection,e._boundingSphereCV[h])}Primitive._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}else e._recomputeBoundingSpheres=!1}var scratchBoundingSphereCenterEncoded=new EncodedCartesian3,scratchBoundingSphereCartographic=new Cartographic,scratchBoundingSphereCenter2D=new Cartesian3,scratchBoundingSphere$2=new BoundingSphere;function updateBatchTableBoundingSpheres(e,t){if(defined(e._batchTableAttributeIndices.distanceDisplayCondition)&&!e._batchTableBoundingSpheresUpdated){for(var i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,n=i.center3DLow,a=i.center2DHigh,o=i.center2DLow,s=i.radius,l=t.mapProjection,c=l.ellipsoid,u=e._batchTable,d=e._instanceBoundingSpheres,h=d.length,p=0;p<h;++p){var m,f,g=d[p];defined(g)&&(f=(g=defined(m=e.modelMatrix)?BoundingSphere.transform(g,m,scratchBoundingSphere$2):g).center,m=g.radius,g=EncodedCartesian3.fromCartesian(f,scratchBoundingSphereCenterEncoded),u.setBatchedAttribute(p,r,g.high),u.setBatchedAttribute(p,n,g.low),t.scene3DOnly||(f=c.cartesianToCartographic(f,scratchBoundingSphereCartographic),f=l.project(f,scratchBoundingSphereCenter2D),g=EncodedCartesian3.fromCartesian(f,scratchBoundingSphereCenterEncoded),u.setBatchedAttribute(p,a,g.high),u.setBatchedAttribute(p,o,g.low)),u.setBatchedAttribute(p,s,m))}e._batchTableBoundingSpheresUpdated=!0}}var offsetScratchCartesian=new Cartesian3,offsetCenterScratch=new Cartesian3;function updateBatchTableOffsets(e,t){if(defined(e._batchTableAttributeIndices.offset)&&!e._batchTableOffsetsUpdated&&!t.scene3DOnly){for(var i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,n=r.ellipsoid,a=e._batchTable,o=e._instanceBoundingSpheres,s=o.length,l=0;l<s;++l){var c,u,d,h=o[l];defined(h)&&(c=a.getBatchedAttribute(l,e._batchTableAttributeIndices.offset),Cartesian3.equals(c,Cartesian3.ZERO)?a.setBatchedAttribute(l,i,Cartesian3.ZERO):(u=(h=defined(d=e.modelMatrix)?BoundingSphere.transform(h,d,scratchBoundingSphere$2):h).center,u=n.scaleToGeodeticSurface(u,offsetCenterScratch),d=n.cartesianToCartographic(u,scratchBoundingSphereCartographic),h=r.project(d,scratchBoundingSphereCenter2D),u=Cartesian3.add(c,u,offsetScratchCartesian),d=n.cartesianToCartographic(u,d),d=r.project(d,offsetScratchCartesian),h=(d=Cartesian3.subtract(d,h,offsetScratchCartesian)).x,d.x=d.z,d.z=d.y,d.y=h,a.setBatchedAttribute(l,i,d)))}e._batchTableOffsetsUpdated=!0}}function createVertexArray$5(e,t){for(var i=e._attributeLocations,r=e._geometries,n=t.scene3DOnly,a=t.context,o=[],s=r.length,l=0;l<s;++l){var c,u,d,h,p=r[l];o.push(VertexArray.fromGeometry({context:a,geometry:p,attributeLocations:i,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:e._interleave})),defined(e._createBoundingVolumeFunction)?e._createBoundingVolumeFunction(t,p):(e._boundingSpheres.push(BoundingSphere.clone(p.boundingSphere)),e._boundingSphereWC.push(new BoundingSphere),n||(u=(c=p.boundingSphereCV.center).x,d=c.y,h=c.z,c.x=h,c.y=u,c.z=d,e._boundingSphereCV.push(BoundingSphere.clone(p.boundingSphereCV)),e._boundingSphere2D.push(new BoundingSphere),e._boundingSphereMorph.push(new BoundingSphere)))}e._va=o,e._primitiveType=r[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,setReady(e,t,PrimitiveState$1.COMPLETE,void 0)}function createRenderStates$6(e,t,i,r){var n,i=i.getRenderState();r?((n=clone$1(i,!1)).cull={enabled:!0,face:CullFace$1.BACK},e._frontFaceRS=RenderState.fromCache(n),n.cull.face=CullFace$1.FRONT,e._backFaceRS=RenderState.fromCache(n)):(e._frontFaceRS=RenderState.fromCache(i),e._backFaceRS=e._frontFaceRS),n=clone$1(i,!1),defined(e._depthFailAppearance)&&(n.depthTest.enabled=!1),defined(e._depthFailAppearance)&&((n=clone$1(i=e._depthFailAppearance.getRenderState(),!1)).depthTest.func=DepthFunction$1.GREATER,r?(n.cull={enabled:!0,face:CullFace$1.BACK},e._frontFaceDepthFailRS=RenderState.fromCache(n),n.cull.face=CullFace$1.FRONT,e._backFaceDepthFailRS=RenderState.fromCache(n)):(e._frontFaceDepthFailRS=RenderState.fromCache(n),e._backFaceDepthFailRS=e._frontFaceRS))}function createShaderProgram$2(e,t,i){var r=t.context,n=e._attributeLocations,a=e._batchTable.getVertexShaderCallback()(i.vertexShaderSource),a=Primitive._appendOffsetToShader(e,a);a=Primitive._appendShowToShader(e,a),a=appendPickToVertexShader(Primitive._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly)),a=modifyForEncodedNormals$1(e,Primitive._updateColorAttribute(e,a,!1)),a=Primitive._modifyShaderPosition(e,a,t.scene3DOnly);i=appendPickToFragmentShader(i=i.getFragmentShaderSource());e._sp=ShaderProgram.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:a,fragmentShaderSource:i,attributeLocations:n}),validateShaderMatching(e._sp),defined(e._depthFailAppearance)&&(a=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),a=Primitive._appendShowToShader(e,a),a=appendPickToVertexShader(Primitive._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly)),a=modifyForEncodedNormals$1(e,Primitive._updateColorAttribute(e,a,!0)),a=depthClampVS(Primitive._modifyShaderPosition(e,a,t.scene3DOnly)),i=depthClampFS(i=appendPickToFragmentShader(i=e._depthFailAppearance.getFragmentShaderSource())),e._spDepthFail=ShaderProgram.replaceCache({context:r,shaderProgram:e._spDepthFail,vertexShaderSource:a,fragmentShaderSource:i,attributeLocations:n}),validateShaderMatching(e._spDepthFail))}var modifiedModelViewScratch$4=new Matrix4,rtcScratch$4=new Cartesian3;function getUniforms(t,e,i,r){var i=defined(i)?i._uniforms:void 0,n={},a=e.uniforms;if(defined(a))for(var o in a)a.hasOwnProperty(o)&&(n[o]=getUniformFunction(a,o));i=combine$2(n,i),i=t._batchTable.getUniformMapCallback()(i);return defined(t.rtcCenter)&&(i.u_modifiedModelView=function(){var e=r.context.uniformState.view;return Matrix4.multiply(e,t._modelMatrix,modifiedModelViewScratch$4),Matrix4.multiplyByPoint(modifiedModelViewScratch$4,t.rtcCenter,rtcScratch$4),Matrix4.setTranslation(modifiedModelViewScratch$4,rtcScratch$4,modifiedModelViewScratch$4),modifiedModelViewScratch$4}),i}function createCommands$5(e,t,i,r,n,a,o,s){var l,c=getUniforms(e,t,i,s);defined(e._depthFailAppearance)&&(l=getUniforms(e,e._depthFailAppearance,e._depthFailAppearance.material,s));var u=r?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,r=n?2:1;r*=defined(e._depthFailAppearance)?2:1,a.length=e._va.length*r;for(var d,h=a.length,p=0,m=0;m<h;++m)n&&((d=!defined(d=a[m])?a[m]=new DrawCommand({owner:e,primitiveType:e._primitiveType}):d).vertexArray=e._va[p],d.renderState=e._backFaceRS,d.shaderProgram=e._sp,d.uniformMap=c,d.pass=u,++m),(d=!defined(d=a[m])?a[m]=new DrawCommand({owner:e,primitiveType:e._primitiveType}):d).vertexArray=e._va[p],d.renderState=e._frontFaceRS,d.shaderProgram=e._sp,d.uniformMap=c,d.pass=u,defined(e._depthFailAppearance)&&(n&&((d=!defined(d=a[++m])?a[m]=new DrawCommand({owner:e,primitiveType:e._primitiveType}):d).vertexArray=e._va[p],d.renderState=e._backFaceDepthFailRS,d.shaderProgram=e._spDepthFail,d.uniformMap=l,d.pass=u),(d=!defined(d=a[++m])?a[m]=new DrawCommand({owner:e,primitiveType:e._primitiveType}):d).vertexArray=e._va[p],d.renderState=e._frontFaceDepthFailRS,d.shaderProgram=e._spDepthFail,d.uniformMap=l,d.pass=u),++p}function updateAndQueueCommands$3(e,t,i,r,n,a,o,s){var l;Primitive._updateBoundingVolumes(e,t,n),t.mode===SceneMode$1.SCENE3D?l=e._boundingSphereWC:t.mode===SceneMode$1.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===SceneMode$1.SCENE2D&&defined(e._boundingSphere2D)?l=e._boundingSphere2D:defined(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);var c=t.commandList,t=t.passes;if(t.render||t.pick){var u=e.allowPicking,d=ShadowMode$1.castShadows(e.shadows),h=ShadowMode$1.receiveShadows(e.shadows),p=i.length,m=s?2:1;m*=defined(e._depthFailAppearance)?2:1;for(var f=0;f<p;++f){var g=Math.floor(f/m),_=i[f];_.modelMatrix=n,_.boundingVolume=l[g],_.cull=a,_.debugShowBoundingVolume=o,_.castShadows=d,_.receiveShadows=h,_.pickId=u?"v_pickColor":void 0,c.push(_)}}}Primitive._updateBoundingVolumes=function(e,t,i,r){var n,a;if(r||!Matrix4.equals(i,e._modelMatrix))for(Matrix4.clone(i,e._modelMatrix),a=e._boundingSpheres.length,n=0;n<a;++n)defined(s=e._boundingSpheres[n])&&(e._boundingSphereWC[n]=BoundingSphere.transform(s,i,e._boundingSphereWC[n]),t.scene3DOnly||(e._boundingSphere2D[n]=BoundingSphere.clone(e._boundingSphereCV[n],e._boundingSphere2D[n]),e._boundingSphere2D[n].center.x=0,e._boundingSphereMorph[n]=BoundingSphere.union(e._boundingSphereWC[n],e._boundingSphereCV[n])));var o=e.appearance.pixelSize;if(defined(o))for(a=e._boundingSpheres.length,n=0;n<a;++n){var s=e._boundingSpheres[n],l=e._boundingSphereWC[n],c=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight);l.radius=s.radius+c*o}},Primitive.prototype.update=function(e){if(!(!defined(this.geometryInstances)&&0===this._va.length||defined(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&0===this.geometryInstances.length||!defined(this.appearance)||e.mode!==SceneMode$1.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(defined(this._error))throw this._error;if(this._state!==PrimitiveState$1.FAILED){var t,i,r,n,a,o,s=e.context;if(defined(this._batchTable)||createBatchTable$1(this,s),0<this._batchTable.attributes.length){if(0===ContextLimits.maximumVertexTextureImageUnits)throw new RuntimeError("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)}this._state!==PrimitiveState$1.COMPLETE&&this._state!==PrimitiveState$1.COMBINED&&(this.asynchronous?loadAsynchronous:loadSynchronous)(this,e),this._state===PrimitiveState$1.COMBINED&&(updateBatchTableBoundingSpheres(this,e),updateBatchTableOffsets(this,e),createVertexArray$5(this,e)),this.show&&this._state===PrimitiveState$1.COMPLETE&&(this._batchTableOffsetsUpdated||updateBatchTableOffsets(this,e),this._recomputeBoundingSpheres&&recomputeBoundingSpheres(this,e),i=(t=this.appearance).material,n=r=!1,this._appearance!==t?(this._appearance=t,this._material=i,n=r=!0):this._material!==i&&(this._material=i,n=!0),o=defined(a=this.depthFailAppearance)?a.material:void 0,this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=o,n=r=!0):this._depthFailMaterial!==o&&(this._depthFailMaterial=o,n=!0),a=this._appearance.isTranslucent(),this._translucent!==a&&(this._translucent=a,r=!0),defined(this._material)&&this._material.update(s),o=t.closed&&a,r&&defaultValue(this._createRenderStatesFunction,createRenderStates$6)(this,s,t,o),n&&defaultValue(this._createShaderProgramFunction,createShaderProgram$2)(this,e,t),(r||n)&&defaultValue(this._createCommandsFunction,createCommands$5)(this,t,i,a,o,this._colorCommands,this._pickCommands,e),defaultValue(this._updateAndQueueCommandsFunction,updateAndQueueCommands$3)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,o))}}};var offsetBoundingSphereScratch1=new BoundingSphere,offsetBoundingSphereScratch2=new BoundingSphere;function transformBoundingSphere(e,t,i){var r,n;return i===GeometryOffsetAttribute$1.TOP?(r=BoundingSphere.clone(e,offsetBoundingSphereScratch1),(n=BoundingSphere.clone(e,offsetBoundingSphereScratch2)).center=Cartesian3.add(n.center,t,n.center),e=BoundingSphere.union(r,n,e)):i===GeometryOffsetAttribute$1.ALL&&(e.center=Cartesian3.add(e.center,t,e.center)),e}function createGetFunction(r,n,a){return function(){var e=r.getBatchedAttribute(n,a),t=r.attributes[a],i=t.componentsPerAttribute,i=ComponentDatatype$1.createTypedArray(t.componentDatatype,i);return defined(e.constructor.pack)?e.constructor.pack(e,i,0):i[0]=e,i}}function createSetFunction(t,i,r,n,a){return function(e){e=getAttributeValue(e);t.setBatchedAttribute(i,r,e),"offset"===a&&(n._recomputeBoundingSpheres=!0,n._batchTableOffsetsUpdated=!1)}}var offsetScratch$a=new Cartesian3;function createBoundingSphereProperties(r,n,a){n.boundingSphere={get:function(){var e,t,i=r._instanceBoundingSpheres[a];return defined(i)&&(i=i.clone(),e=r.modelMatrix,defined(t=n.offset)&&transformBoundingSphere(i,Cartesian3.fromArray(t.get(),0,offsetScratch$a),r._offsetInstanceExtend[a]),defined(e)&&(i=BoundingSphere.transform(i,e))),i}},n.boundingSphereCV={get:function(){return r._instanceBoundingSpheresCV[a]}}}function createPickIdProperty(e,t,i){t.pickId={get:function(){return e._pickIds[i]}}}function setReady(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===PrimitiveState$1.COMPLETE||e._state===PrimitiveState$1.FAILED,defined(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}Primitive.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,a=0;a<n;++a){var o=(i+a)%n;if(e===r[o]){t=o;break}}if(-1!==t){if(defined(d=this._perInstanceAttributeCache[t]))return d;var s,l,c=this._batchTable,u=this._batchTableAttributeIndices,d={},h={};for(s in u)u.hasOwnProperty(s)&&(l=u[s],h[s]={get:createGetFunction(c,t,l),set:createSetFunction(c,t,l,this,s)});return createBoundingSphereProperties(this,h,t),createPickIdProperty(this,h,t),Object.defineProperties(d,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=d}},Primitive.prototype.isDestroyed=function(){return!1},Primitive.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();for(var e=this._va,t=e.length,i=0;i<t;++i)e[i].destroy();this._va=void 0;var r=this._pickIds;for(t=r.length,i=0;i<t;++i)r[i].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,destroyObject(this)};var ShadowVolumeAppearanceFS="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n#ifdef NORMAL_EC\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\nreturn eyeCoordinate.xyz / eyeCoordinate.w;\n}\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {\nvec2 glFragCoordXY = gl_FragCoord.xy;\nfloat upOrRightLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\nfloat downOrLeftLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\nbvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\nfloat useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\nfloat useDownOrLeft = float(useUpOrRight == 0.0);\nvec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\nvec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\nreturn (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n}\n#endif // NORMAL_EC\nvoid main(void)\n{\n#ifdef REQUIRES_EC\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n#endif\n#ifdef REQUIRES_WC\nvec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\nvec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n#endif\n#ifdef TEXTURE_COORDINATES\nvec2 uv;\n#ifdef SPHERICAL\nvec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\nsphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\nsphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\nuv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\nuv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\n#else // SPHERICAL\nuv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\nuv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\n#endif // SPHERICAL\n#endif // TEXTURE_COORDINATES\n#ifdef PICK\n#ifdef CULL_FRAGMENTS\nif (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {\ngl_FragColor.a = 1.0;\nczm_writeDepthClamp();\n}\n#else // CULL_FRAGMENTS\ngl_FragColor.a = 1.0;\n#endif // CULL_FRAGMENTS\n#else // PICK\n#ifdef CULL_FRAGMENTS\nif (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {\ndiscard;\n}\n#endif\n#ifdef NORMAL_EC\nvec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\nvec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\nvec3 normalEC = normalize(cross(leftRight, downUp));\n#endif\n#ifdef PER_INSTANCE_COLOR\nvec4 color = czm_gammaCorrect(v_color);\n#ifdef FLAT\ngl_FragColor = color;\n#else // FLAT\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\ngl_FragColor.rgb *= gl_FragColor.a;\n#else // PER_INSTANCE_COLOR\nczm_materialInput materialInput;\n#ifdef USES_NORMAL_EC\nmaterialInput.normalEC = normalEC;\n#endif\n#ifdef USES_POSITION_TO_EYE_EC\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\n#endif\n#ifdef USES_TANGENT_TO_EYE\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\n#endif\n#ifdef USES_ST\nmaterialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\nmaterialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\n#endif\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else // FLAT\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\ngl_FragColor.rgb *= gl_FragColor.a;\n#endif // PER_INSTANCE_COLOR\nczm_writeDepthClamp();\n#endif // PICK\n}\n";function ShadowVolumeAppearance(e,t,i){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};var r=new ShaderDependencies;r.requiresTextureCoordinates=e,r.requiresEC=!i.flat;var n,a=new ShaderDependencies;a.requiresTextureCoordinates=e,i instanceof PerInstanceColorAppearance?r.requiresNormalEC=!i.flat:(n=i.material.shaderSource+"\n"+i.fragmentShaderSource,r.normalEC=-1!==n.indexOf("materialInput.normalEC")||-1!==n.indexOf("czm_getDefaultMaterial"),r.positionToEyeEC=-1!==n.indexOf("materialInput.positionToEyeEC"),r.tangentToEyeMatrix=-1!==n.indexOf("materialInput.tangentToEyeMatrix"),r.st=-1!==n.indexOf("materialInput.st")),this._colorShaderDependencies=r,this._pickShaderDependencies=a,this._appearance=i,this._extentsCulling=e,this._planarExtents=t}ShadowVolumeAppearance.prototype.createFragmentShader=function(e){var t=this._appearance,i=this._colorShaderDependencies,r=[];e||this._planarExtents||r.push("SPHERICAL"),i.requiresEC&&r.push("REQUIRES_EC"),i.requiresWC&&r.push("REQUIRES_WC"),i.requiresTextureCoordinates&&r.push("TEXTURE_COORDINATES"),this._extentsCulling&&r.push("CULL_FRAGMENTS"),i.requiresNormalEC&&r.push("NORMAL_EC"),t instanceof PerInstanceColorAppearance&&r.push("PER_INSTANCE_COLOR"),i.normalEC&&r.push("USES_NORMAL_EC"),i.positionToEyeEC&&r.push("USES_POSITION_TO_EYE_EC"),i.tangentToEyeMatrix&&r.push("USES_TANGENT_TO_EYE"),i.st&&r.push("USES_ST"),t.flat&&r.push("FLAT");i="";return new ShaderSource({defines:r,sources:[i=!(t instanceof PerInstanceColorAppearance)?t.material.shaderSource:i,ShadowVolumeAppearanceFS]})},ShadowVolumeAppearance.prototype.createPickFragmentShader=function(e){var t=this._pickShaderDependencies,i=["PICK"];return e||this._planarExtents||i.push("SPHERICAL"),t.requiresEC&&i.push("REQUIRES_EC"),t.requiresWC&&i.push("REQUIRES_WC"),t.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),new ShaderSource({defines:i,sources:[ShadowVolumeAppearanceFS],pickColorQualifier:"varying"})},ShadowVolumeAppearance.prototype.createVertexShader=function(e,t,i,r){return createShadowVolumeAppearanceVS(this._colorShaderDependencies,this._planarExtents,i,e,t,this._appearance,r,this._projectionExtentDefines)},ShadowVolumeAppearance.prototype.createPickVertexShader=function(e,t,i,r){return createShadowVolumeAppearanceVS(this._pickShaderDependencies,this._planarExtents,i,e,t,void 0,r,this._projectionExtentDefines)};var longitudeExtentsCartesianScratch=new Cartesian3,longitudeExtentsCartographicScratch=new Cartographic,longitudeExtentsEncodeScratch={high:0,low:0};function createShadowVolumeAppearanceVS(e,t,i,r,n,a,o,s){var l,c=r.slice();return""===s.eastMostYhighDefine&&((l=longitudeExtentsCartographicScratch).longitude=CesiumMath.PI,l.latitude=0,l.height=0,r=o.project(l,longitudeExtentsCartesianScratch),l=EncodedCartesian3.encode(r.x,longitudeExtentsEncodeScratch),s.eastMostYhighDefine="EAST_MOST_X_HIGH "+l.high.toFixed((l.high+"").length+1),s.eastMostYlowDefine="EAST_MOST_X_LOW "+l.low.toFixed((l.low+"").length+1),(r=longitudeExtentsCartographicScratch).longitude=-CesiumMath.PI,r.latitude=0,r.height=0,r=o.project(r,longitudeExtentsCartesianScratch),l=EncodedCartesian3.encode(r.x,longitudeExtentsEncodeScratch),s.westMostYhighDefine="WEST_MOST_X_HIGH "+l.high.toFixed((l.high+"").length+1),s.westMostYlowDefine="WEST_MOST_X_LOW "+l.low.toFixed((l.low+"").length+1)),i&&(c.push(s.eastMostYhighDefine),c.push(s.eastMostYlowDefine),c.push(s.westMostYhighDefine),c.push(s.westMostYlowDefine)),defined(a)&&a instanceof PerInstanceColorAppearance&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||i||c.push("SPHERICAL"),i&&c.push("COLUMBUS_VIEW_2D")),new ShaderSource({defines:c,sources:[n]})}function ShaderDependencies(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}function pointLineDistance(e,t,i){return Math.abs((t.y-e.y)*i.x-(t.x-e.x)*i.y+t.x*e.y-t.y*e.x)/Cartesian2.distance(t,e)}Object.defineProperties(ShaderDependencies.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}}});var points2DScratch=[new Cartesian2,new Cartesian2,new Cartesian2,new Cartesian2];function addTextureCoordinateRotationAttributes(e,t){var i=points2DScratch,r=Cartesian2.unpack(t,0,i[0]),n=Cartesian2.unpack(t,2,i[1]),t=Cartesian2.unpack(t,4,i[2]);e.uMaxVmax=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:[n.x,n.y,t.x,t.y]});i=1/pointLineDistance(r,n,t),n=1/pointLineDistance(r,t,n);e.uvMinAndExtents=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,i,n]})}var cartographicScratch$3=new Cartographic,cornerScratch=new Cartesian3,northWestScratch=new Cartesian3,southEastScratch=new Cartesian3,highLowScratch={high:0,low:0};function add2DTextureCoordinateAttributes(e,t,i){var r=cartographicScratch$3;r.height=0,r.longitude=e.west,r.latitude=e.south;var n=t.project(r,cornerScratch);r.latitude=e.north;var a=t.project(r,northWestScratch);r.longitude=e.east,r.latitude=e.south;var o=t.project(r,southEastScratch),e=[0,0,0,0],t=[0,0,0,0],r=EncodedCartesian3.encode(n.x,highLowScratch);e[0]=r.high,t[0]=r.low,r=EncodedCartesian3.encode(n.y,highLowScratch),e[1]=r.high,t[1]=r.low,r=EncodedCartesian3.encode(a.y,highLowScratch),e[2]=r.high,t[2]=r.low,r=EncodedCartesian3.encode(o.x,highLowScratch),e[3]=r.high,t[3]=r.low,i.planes2D_HIGH=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:e}),i.planes2D_LOW=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:t})}var enuMatrixScratch=new Matrix4,inverseEnuScratch=new Matrix4,rectanglePointCartesianScratch=new Cartesian3,rectangleCenterScratch$1=new Cartographic,pointsCartographicScratch=[new Cartographic,new Cartographic,new Cartographic,new Cartographic,new Cartographic,new Cartographic,new Cartographic,new Cartographic];function computeRectangleBounds(e,t,i,r,n,a){var o=Rectangle.center(e,rectangleCenterScratch$1);o.height=i;var s=Cartographic.toCartesian(o,t,rectanglePointCartesianScratch),l=Transforms.eastNorthUpToFixedFrame(s,t,enuMatrixScratch),c=Matrix4.inverse(l,inverseEnuScratch),u=e.west,d=e.east,h=e.north,o=e.south,p=pointsCartographicScratch;p[0].latitude=o,p[0].longitude=u,p[1].latitude=h,p[1].longitude=u,p[2].latitude=h,p[2].longitude=d,p[3].latitude=o;s=.5*(u+(p[3].longitude=d)),e=.5*(h+o);p[4].latitude=o,p[4].longitude=s,p[5].latitude=h,p[5].longitude=s,p[6].latitude=e,p[6].longitude=u,p[7].latitude=e,p[7].longitude=d;for(var m=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,g=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,y=0;y<8;y++){p[y].height=i;var C=Cartographic.toCartesian(p[y],t,rectanglePointCartesianScratch);Matrix4.multiplyByPoint(c,C,C),C.z=0,m=Math.min(m,C.x),f=Math.max(f,C.x),g=Math.min(g,C.y),_=Math.max(_,C.y)}d=r;d.x=m,d.y=g,d.z=0,Matrix4.multiplyByPoint(l,d,d);r=n;r.x=f,r.y=g,r.z=0,Matrix4.multiplyByPoint(l,r,r),Cartesian3.subtract(r,d,n);n=a;n.x=m,n.y=_,n.z=0,Matrix4.multiplyByPoint(l,n,n),Cartesian3.subtract(n,d,a)}var eastwardScratch=new Cartesian3,northwardScratch=new Cartesian3,encodeScratch=new EncodedCartesian3;ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes=function(e,t,i,r,n){var a=cornerScratch,o=eastwardScratch,s=northwardScratch;computeRectangleBounds(e,i,defaultValue(n,0),a,o,s);n={};addTextureCoordinateRotationAttributes(n,t);a=EncodedCartesian3.fromCartesian(a,encodeScratch);return n.southWest_HIGH=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,normalize:!1,value:Cartesian3.pack(a.high,[0,0,0])}),n.southWest_LOW=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,normalize:!1,value:Cartesian3.pack(a.low,[0,0,0])}),n.eastward=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,normalize:!1,value:Cartesian3.pack(o,[0,0,0])}),n.northward=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,normalize:!1,value:Cartesian3.pack(s,[0,0,0])}),add2DTextureCoordinateAttributes(e,r,n),n};var spherePointScratch=new Cartesian3;function latLongToSpherical(e,t,i,r){var n=cartographicScratch$3;n.latitude=e,n.longitude=t,n.height=0;n=Cartographic.toCartesian(n,i,spherePointScratch),i=Math.sqrt(n.x*n.x+n.y*n.y),i=CesiumMath.fastApproximateAtan2(i,n.z),n=CesiumMath.fastApproximateAtan2(n.x,n.y);return r.x=i,r.y=n,r}var sphericalScratch=new Cartesian2;function shouldUseSpherical(e){return Math.max(e.width,e.height)>ShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS}ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes=function(e,t,i,r){var n=latLongToSpherical(e.south,e.west,i,sphericalScratch),a=n.x,o=n.y,s=latLongToSpherical(e.north,e.east,i,sphericalScratch),n=s.x,i=s.y,s=0;i<o&&(s=CesiumMath.PI-o,o=-CesiumMath.PI,i+=s),a-=CesiumMath.EPSILON5,o-=CesiumMath.EPSILON5,n+=CesiumMath.EPSILON5,i+=CesiumMath.EPSILON5;s={sphericalExtents:new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:[a,o,1/(n-a),1/(i-o)]}),longitudeRotation:new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:1,normalize:!1,value:[s]})};return addTextureCoordinateRotationAttributes(s,t),add2DTextureCoordinateAttributes(e,r,s),s},ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes=function(e){return defined(e.southWest_HIGH)&&defined(e.southWest_LOW)&&defined(e.northward)&&defined(e.eastward)&&defined(e.planes2D_HIGH)&&defined(e.planes2D_LOW)&&defined(e.uMaxVmax)&&defined(e.uvMinAndExtents)},ShadowVolumeAppearance.hasAttributesForSphericalExtents=function(e){return defined(e.sphericalExtents)&&defined(e.longitudeRotation)&&defined(e.planes2D_HIGH)&&defined(e.planes2D_LOW)&&defined(e.uMaxVmax)&&defined(e.uvMinAndExtents)},ShadowVolumeAppearance.shouldUseSphericalCoordinates=function(e){return shouldUseSpherical(e)},ShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS=CesiumMath.toRadians(1);var StencilFunction={NEVER:WebGLConstants$1.NEVER,LESS:WebGLConstants$1.LESS,EQUAL:WebGLConstants$1.EQUAL,LESS_OR_EQUAL:WebGLConstants$1.LEQUAL,GREATER:WebGLConstants$1.GREATER,NOT_EQUAL:WebGLConstants$1.NOTEQUAL,GREATER_OR_EQUAL:WebGLConstants$1.GEQUAL,ALWAYS:WebGLConstants$1.ALWAYS},StencilFunction$1=Object.freeze(StencilFunction),StencilOperation={ZERO:WebGLConstants$1.ZERO,KEEP:WebGLConstants$1.KEEP,REPLACE:WebGLConstants$1.REPLACE,INCREMENT:WebGLConstants$1.INCR,DECREMENT:WebGLConstants$1.DECR,INVERT:WebGLConstants$1.INVERT,INCREMENT_WRAP:WebGLConstants$1.INCR_WRAP,DECREMENT_WRAP:WebGLConstants$1.DECR_WRAP},StencilOperation$1=Object.freeze(StencilOperation),StencilConstants={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15,setCesium3DTileBit:function(){return{enabled:!0,frontFunction:StencilFunction$1.ALWAYS,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.REPLACE},backFunction:StencilFunction$1.ALWAYS,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.REPLACE},reference:StencilConstants.CESIUM_3D_TILE_MASK,mask:StencilConstants.CESIUM_3D_TILE_MASK}}},StencilConstants$1=Object.freeze(StencilConstants);function ClassificationPrimitive(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).geometryInstances;this.geometryInstances=t,this.show=defaultValue(e.show,!0),this.classificationType=defaultValue(e.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=defaultValue(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=defaultValue(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._readyPromise=when.defer(),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:defaultValue(e.vertexCacheOptimize,!1),interleave:defaultValue(e.interleave,!1),releaseGeometryInstances:defaultValue(e.releaseGeometryInstances,!0),allowPicking:defaultValue(e.allowPicking,!0),asynchronous:defaultValue(e.asynchronous,!0),compressVertices:defaultValue(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}function getStencilDepthRenderState$1(e,t){t=t?StencilFunction$1.EQUAL:StencilFunction$1.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:t,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.DECREMENT_WRAP,zPass:StencilOperation$1.KEEP},backFunction:t,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.INCREMENT_WRAP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},depthMask:!1}}function getColorRenderState(e){return{stencilTest:{enabled:e,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND}}Object.defineProperties(ClassificationPrimitive.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}},readyPromise:{get:function(){return this._readyPromise.promise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),ClassificationPrimitive.isSupported=function(e){return e.context.stencilBuffer};var pickRenderState$1={stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function createRenderStates$5(e,t,i,r){var n;defined(e._rsStencilDepthPass)||(n=!e.debugShowShadowVolume,e._rsStencilDepthPass=RenderState.fromCache(getStencilDepthRenderState$1(n,!1)),e._rsStencilDepthPass3DTiles=RenderState.fromCache(getStencilDepthRenderState$1(n,!0)),e._rsColorPass=RenderState.fromCache(getColorRenderState(n)),e._rsPickPass=RenderState.fromCache(pickRenderState$1))}function modifyForEncodedNormals(e,t){if(!e.compressVertices)return t;if(-1!==t.search(/attribute\s+vec3\s+extrudeDirection;/g)){var i="compressedAttributes",e="attribute vec2 "+i+";",t=(t=t).replace(/attribute\s+vec3\s+extrudeDirection;/g,"");return[e,"vec3 extrudeDirection;\n",t=ShaderSource.replaceMain(t,"czm_non_compressed_main"),"void main() \n{ \n extrudeDirection = czm_octDecode(compressedAttributes, 65535.0);\n czm_non_compressed_main(); \n}"].join("\n")}}function createShaderProgram$1(e,t){var i=t.context,r=e._primitive,n=ShadowVolumeAppearanceVS,n=e._primitive._batchTable.getVertexShaderCallback()(n);n=Primitive._appendDistanceDisplayConditionToShader(r,n),n=Primitive._modifyShaderPosition(e,n,t.scene3DOnly),n=Primitive._updateColorAttribute(r,n);var a=e._hasPlanarExtentsAttributes,o=a||e._hasSphericalExtentsAttribute;e._extruded&&(n=modifyForEncodedNormals(r,n));var s,l,c=e._extruded?"EXTRUDED_GEOMETRY":"",u=new ShaderSource({defines:[c],sources:[n]}),d=new ShaderSource({sources:[ShadowVolumeFS]}),h=e._primitive._attributeLocations,p=new ShadowVolumeAppearance(o,a,e.appearance);e._spStencil=ShaderProgram.replaceCache({context:i,shaderProgram:e._spStencil,vertexShaderSource:u,fragmentShaderSource:d,attributeLocations:h}),e._primitive.allowPicking?(l=ShaderSource.createPickVertexShaderSource(n),l=Primitive._appendShowToShader(r,l),l=Primitive._updatePickColorAttribute(l),s=p.createPickFragmentShader(!1),a=p.createPickVertexShader([c],l,!1,t.mapProjection),e._spPick=ShaderProgram.replaceCache({context:i,shaderProgram:e._spPick,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:h}),o&&(defined(a=i.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick"))||(s=p.createPickFragmentShader(!0),l=p.createPickVertexShader([c],l,!0,t.mapProjection),a=i.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:l,fragmentShaderSource:s,attributeLocations:h})),e._spPick2D=a)):e._spPick=ShaderProgram.fromCache({context:i,vertexShaderSource:u,fragmentShaderSource:d,attributeLocations:h}),u=new ShaderSource({defines:[c],sources:[n=Primitive._appendShowToShader(r,n)]}),e._sp=ShaderProgram.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:u,fragmentShaderSource:d,attributeLocations:h});u=p.createFragmentShader(!1),d=p.createVertexShader([c],n,!1,t.mapProjection);e._spColor=ShaderProgram.replaceCache({context:i,shaderProgram:e._spColor,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:h}),o&&(defined(u=i.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor"))||(o=p.createFragmentShader(!0),t=p.createVertexShader([c],n,!0,t.mapProjection),u=i.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:t,fragmentShaderSource:o,attributeLocations:h})),e._spColor2D=u)}function createColorCommands$1(e,t){var i,r=e._primitive,n=2*r._va.length;t.length=n;for(var a=0,o=r._batchTable.getUniformMapCallback()(e._uniformMap),s=e._needs2DShader,l=0;l<n;l+=2){var c,u=r._va[a++];(c=!defined(c=t[l])?t[l]=new DrawCommand({owner:e,primitiveType:r._primitiveType}):c).vertexArray=u,c.renderState=e._rsStencilDepthPass,c.shaderProgram=e._sp,c.uniformMap=o,c.pass=Pass$1.TERRAIN_CLASSIFICATION,(i=DrawCommand.shallowClone(c,c.derivedCommands.tileset)).renderState=e._rsStencilDepthPass3DTiles,i.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,c.derivedCommands.tileset=i,(c=!defined(c=t[l+1])?t[l+1]=new DrawCommand({owner:e,primitiveType:r._primitiveType}):c).vertexArray=u,c.renderState=e._rsColorPass,c.shaderProgram=e._spColor,c.pass=Pass$1.TERRAIN_CLASSIFICATION;u=e.appearance.material;defined(u)&&(o=combine$2(o,u._uniforms)),c.uniformMap=o,(i=DrawCommand.shallowClone(c,c.derivedCommands.tileset)).pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,c.derivedCommands.tileset=i,s&&((u=DrawCommand.shallowClone(c,c.derivedCommands.appearance2D)).shaderProgram=e._spColor2D,c.derivedCommands.appearance2D=u,(u=DrawCommand.shallowClone(i,i.derivedCommands.appearance2D)).shaderProgram=e._spColor2D,i.derivedCommands.appearance2D=u)}for(var d=e._commandsIgnoreShow,h=e._spStencil,p=0,n=d.length=n/2,m=0;m<n;++m){var f=d[m]=DrawCommand.shallowClone(t[p],d[m]);f.shaderProgram=h,f.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function createPickCommands$1(e,t){var i,r,n,a,o=e._usePickOffsets,s=e._primitive,l=2*s._va.length,c=0;o&&(l=2*(i=s._pickOffsets).length),t.length=l;for(var u=0,d=s._batchTable.getUniformMapCallback()(e._uniformMap),h=e._needs2DShader,p=0;p<l;p+=2){var m=s._va[u++];o&&(r=i[c++],m=s._va[r.index]),(n=!defined(n=t[p])?t[p]=new DrawCommand({owner:e,primitiveType:s._primitiveType,pickOnly:!0}):n).vertexArray=m,n.renderState=e._rsStencilDepthPass,n.shaderProgram=e._sp,n.uniformMap=d,n.pass=Pass$1.TERRAIN_CLASSIFICATION,o&&(n.offset=r.offset,n.count=r.count),(a=DrawCommand.shallowClone(n,n.derivedCommands.tileset)).renderState=e._rsStencilDepthPass3DTiles,a.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=a,(n=!defined(n=t[p+1])?t[p+1]=new DrawCommand({owner:e,primitiveType:s._primitiveType,pickOnly:!0}):n).vertexArray=m,n.renderState=e._rsPickPass,n.shaderProgram=e._spPick,n.uniformMap=d,n.pass=Pass$1.TERRAIN_CLASSIFICATION,o&&(n.offset=r.offset,n.count=r.count),(a=DrawCommand.shallowClone(n,n.derivedCommands.tileset)).pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=a,h&&((m=DrawCommand.shallowClone(n,n.derivedCommands.pick2D)).shaderProgram=e._spPick2D,n.derivedCommands.pick2D=m,(m=DrawCommand.shallowClone(a,a.derivedCommands.pick2D)).shaderProgram=e._spPick2D,a.derivedCommands.pick2D=m)}}function createCommands$4(e,t,i,r,n,a,o){createColorCommands$1(e,a),createPickCommands$1(e,o)}function boundingVolumeIndex$1(e,t){return Math.floor(e%t/2)}function updateAndQueueRenderCommand$1(e,t,i,r,n,a){e.modelMatrix=i,e.boundingVolume=n,e.cull=r,e.debugShowBoundingVolume=a,t.commandList.push(e)}function updateAndQueuePickCommand$1(e,t,i,r,n){e.modelMatrix=i,e.boundingVolume=n,e.cull=r,t.commandList.push(e)}function updateAndQueueCommands$2(e,t,i,r,n,a,o,s){var l,c=e._primitive;Primitive._updateBoundingVolumes(c,t,n),t.mode===SceneMode$1.SCENE3D?l=c._boundingSphereWC:t.mode===SceneMode$1.COLUMBUS_VIEW?l=c._boundingSphereCV:t.mode===SceneMode$1.SCENE2D&&defined(c._boundingSphere2D)?l=c._boundingSphere2D:defined(c._boundingSphereMorph)&&(l=c._boundingSphereMorph);var u=e.classificationType,d=u!==ClassificationType$1.CESIUM_3D_TILE,h=u!==ClassificationType$1.TERRAIN,u=t.passes;if(u.render){var p=i.length;for(g=0;g<p;++g)C=l[boundingVolumeIndex$1(g,p)],d&&updateAndQueueRenderCommand$1(i[g],t,n,a,C,o),h&&updateAndQueueRenderCommand$1(i[g].derivedCommands.tileset,t,n,a,C,o);if(t.invertClassification)for(var m=e._commandsIgnoreShow,f=m.length,g=0;g<f;++g)C=l[g],updateAndQueueRenderCommand$1(m[g],t,n,a,C,o)}if(u.pick){var _=r.length,y=c._pickOffsets;for(g=0;g<_;++g){var C=l[y[boundingVolumeIndex$1(g,_)].index];d&&updateAndQueuePickCommand$1(r[g],t,n,a,C),h&&updateAndQueuePickCommand$1(r[g].derivedCommands.tileset,t,n,a,C)}}}ClassificationPrimitive.prototype.update=function(e){if(defined(this._primitive)||defined(this.geometryInstances)){var t=this.appearance;defined(t)&&defined(t.material)&&t.material.update(e.context);var l=this,i=this._primitiveOptions;if(!defined(this._primitive)){var r,n,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=a.length,s=!1,c=!0,u=!1,d=!1;for(0<o&&(r=a[0].attributes,u=ShadowVolumeAppearance.hasAttributesForSphericalExtents(r),d=ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes(r),n=r.color),f=0;f<o;f++){var h,p=(h=a[f]).attributes.color;defined(p)&&(s=!0),c=c&&defined(p)&&ColorGeometryInstanceAttribute.equals(n,p)}if(!c&&!u&&!d)throw new DeveloperError("All GeometryInstances must have the same color attribute except via GroundPrimitives");s&&!defined(t)&&(t=new PerInstanceColorAppearance({flat:!0}),this.appearance=t),this._usePickOffsets=!u&&!d,this._hasSphericalExtentsAttribute=u,this._hasPlanarExtentsAttributes=d,this._hasPerColorAttribute=s;for(var m=new Array(o),f=0;f<o;++f)h=a[f],m[f]=new GeometryInstance({geometry:h.geometry,attributes:h.attributes,modelMatrix:h.modelMatrix,id:h.id,pickPrimitive:defaultValue(this._pickPrimitive,l)});i.appearance=t,i.geometryInstances=m,defined(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(e,t){l._createBoundingVolumeFunction(e,t)}),i._createRenderStatesFunction=function(e,t,i,r){createRenderStates$5(l)},i._createShaderProgramFunction=function(e,t,i){createShaderProgram$1(l,t)},i._createCommandsFunction=function(e,t,i,r,n,a,o){createCommands$4(l,void 0,void 0,!0,!1,a,o)},defined(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(e,t,i,r,n,a,o,s){l._updateAndQueueCommandsFunction(e,t,i,r,n,a,o,s)}:i._updateAndQueueCommandsFunction=function(e,t,i,r,n,a,o,s){updateAndQueueCommands$2(l,t,i,r,n,a,o)},this._primitive=new Primitive(i),this._primitive.readyPromise.then(function(e){l._ready=!0,l.releaseGeometryInstances&&(l.geometryInstances=void 0);e=e._error;defined(e)?l._readyPromise.reject(e):l._readyPromise.resolve(l)})}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=RenderState.fromCache(getStencilDepthRenderState$1(!1,!1)),this._rsStencilDepthPass3DTiles=RenderState.fromCache(getStencilDepthRenderState$1(!1,!0)),this._rsColorPass=RenderState.fromCache(getColorRenderState(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=RenderState.fromCache(getStencilDepthRenderState$1(!0,!1)),this._rsStencilDepthPass3DTiles=RenderState.fromCache(getStencilDepthRenderState$1(!0,!0)),this._rsColorPass=RenderState.fromCache(getColorRenderState(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},ClassificationPrimitive.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},ClassificationPrimitive.prototype.isDestroyed=function(){return!1},ClassificationPrimitive.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,destroyObject(this)};var GroundPrimitiveUniformMap={u_globeMinimumAltitude:function(){return 55e3}};function GroundPrimitive(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).appearance,i=e.geometryInstances;if(!defined(t)&&defined(i))for(var r=Array.isArray(i)?i:[i],n=r.length,a=0;a<n;a++){var o=r[a].attributes;if(defined(o)&&defined(o.color)){t=new PerInstanceColorAppearance({flat:!0});break}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=defaultValue(e.show,!0),this.classificationType=defaultValue(e.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=defaultValue(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=when.defer(),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=ApproximateTerrainHeights._defaultMaxTerrainHeight,this._minTerrainHeight=ApproximateTerrainHeights._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:defaultValue(e.vertexCacheOptimize,!1),interleave:defaultValue(e.interleave,!1),releaseGeometryInstances:defaultValue(e.releaseGeometryInstances,!0),allowPicking:defaultValue(e.allowPicking,!0),asynchronous:defaultValue(e.asynchronous,!0),compressVertices:defaultValue(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:this,_extruded:!0,_uniformMap:GroundPrimitiveUniformMap}}function getComputeMaximumHeightFunction(i){return function(e,t){t=t.maximumRadius,t=t/Math.cos(.5*e)-t;return i._maxHeight+t}}function getComputeMinimumHeightFunction(i){return function(e,t){return i._minHeight}}Object.defineProperties(GroundPrimitive.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}},readyPromise:{get:function(){return this._readyPromise.promise}}}),GroundPrimitive.isSupported=ClassificationPrimitive.isSupported;var scratchBVCartesianHigh=new Cartesian3,scratchBVCartesianLow=new Cartesian3,scratchBVCartesian=new Cartesian3,scratchBVCartographic=new Cartographic,scratchBVRectangle=new Rectangle;function getRectangle(e,t){var i=e.mapProjection.ellipsoid;if(!defined(t.attributes)||!defined(t.attributes.position3DHigh))return defined(t.rectangle)?t.rectangle:void 0;for(var r=t.attributes.position3DHigh.values,n=t.attributes.position3DLow.values,a=r.length,o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=0;u<a;u+=3)var d=Cartesian3.unpack(r,u,scratchBVCartesianHigh),h=Cartesian3.unpack(n,u,scratchBVCartesianLow),d=Cartesian3.add(d,h,scratchBVCartesian),h=i.cartesianToCartographic(d,scratchBVCartographic),d=h.latitude,h=h.longitude,o=Math.min(o,d),s=Math.min(s,h),l=Math.max(l,d),c=Math.max(c,h);t=scratchBVRectangle;return t.north=l,t.south=o,t.east=c,t.west=s,t}function setMinMaxTerrainHeights(e,t,i){i=ApproximateTerrainHeights.getMinimumMaximumHeights(t,i);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function createBoundingVolume(e,t,i){var r=t.mapProjection.ellipsoid,i=getRectangle(t,i),r=OrientedBoundingBox.fromRectangle(i,e._minHeight,e._maxHeight,r);e._boundingVolumes.push(r),t.scene3DOnly||(t=t.mapProjection,t=BoundingSphere.fromRectangleWithHeights2D(i,t,e._maxHeight,e._minHeight),Cartesian3.fromElements(t.center.z,t.center.x,t.center.y,t.center),e._boundingVolumes2D.push(t))}function boundingVolumeIndex(e,t){return Math.floor(e%t/2)}function updateAndQueueRenderCommand(e,t,i,r,n,a,o){var s=e._primitive;(t=i.mode!==SceneMode$1.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader?t.derivedCommands.appearance2D:t).owner=e,t.modelMatrix=r,t.boundingVolume=a,t.cull=n,t.debugShowBoundingVolume=o,i.commandList.push(t)}function updateAndQueuePickCommand(e,t,i,r,n,a){var o=e._primitive;(t=i.mode!==SceneMode$1.SCENE3D&&t.shaderProgram===o._spPick&&o._needs2DShader?t.derivedCommands.pick2D:t).owner=e,t.modelMatrix=r,t.boundingVolume=a,t.cull=n,i.commandList.push(t)}function updateAndQueueCommands$1(e,t,i,r,n,a,o,s){var l=t.mode===SceneMode$1.SCENE3D?e._boundingVolumes:e._boundingVolumes2D,c=e.classificationType,u=c!==ClassificationType$1.CESIUM_3D_TILE,d=c!==ClassificationType$1.TERRAIN,h=t.passes,c=e._primitive;if(h.render){var p=i.length;for(g=0;g<p;++g)y=l[boundingVolumeIndex(g,p)],u&&updateAndQueueRenderCommand(e,i[g],t,n,a,y,o),d&&updateAndQueueRenderCommand(e,i[g].derivedCommands.tileset,t,n,a,y,o);if(t.invertClassification)for(var m=c._commandsIgnoreShow,f=m.length,g=0;g<f;++g)y=l[g],updateAndQueueRenderCommand(e,m[g],t,n,a,y,o)}if(h.pick){var _,y,C=r.length;for(e._useFragmentCulling||(_=c._primitive._pickOffsets),g=0;g<C;++g)y=l[boundingVolumeIndex(g,C)],e._useFragmentCulling||(y=l[_[boundingVolumeIndex(g,C)].index]),u&&updateAndQueuePickCommand(e,r[g],t,n,a,y),d&&updateAndQueuePickCommand(e,r[g].derivedCommands.tileset,t,n,a,y)}}function MaterialProperty(){DeveloperError.throwInstantiationError()}function DynamicGeometryUpdater$1(e,t,i){this._primitives=t,this._orderedGroundPrimitives=i,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}GroundPrimitive.initializeTerrainHeights=function(){return ApproximateTerrainHeights.initialize()},GroundPrimitive.prototype.update=function(e){if(defined(this._primitive)||defined(this.geometryInstances))if(ApproximateTerrainHeights.initialized){var l=this,t=this._classificationPrimitiveOptions;if(!defined(this._primitive)){var i,r=e.mapProjection.ellipsoid,n=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],a=n.length,o=new Array(a);for(m=0;m<a;++m){var s,c,u=getRectangle(e,c=(s=n[m]).geometry);defined(i)?defined(u)&&Rectangle.union(i,u,i):i=Rectangle.clone(u);var d=s.id;defined(d)&&defined(u)&&(u=ApproximateTerrainHeights.getBoundingSphere(u,r),this._boundingSpheresKeys.push(d),this._boundingSpheres.push(u)),defined(g=c.constructor)&&defined(g.createShadowVolume)}setMinMaxTerrainHeights(this,i,r);var h=e.terrainExaggeration;this._minHeight=this._minTerrainHeight*h,this._maxHeight=this._maxTerrainHeight*h;h=GroundPrimitive._supportsMaterials(e.context);if(this._useFragmentCulling=h){for(var p=!0,m=0;m<a;++m)if(i=getRectangle(e,c=(s=n[m]).geometry),ShadowVolumeAppearance.shouldUseSphericalCoordinates(i)){p=!1;break}for(m=0;m<a;++m){var f,g=(c=(s=n[m]).geometry).constructor,_=getRectangle(e,c),y=c.textureCoordinateRotationPoints,C=p?ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes(_,y,r,e.mapProjection,this._maxHeight):ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes(_,y,r,e.mapProjection),v=s.attributes;for(f in v)v.hasOwnProperty(f)&&(C[f]=v[f]);o[m]=new GeometryInstance({geometry:g.createShadowVolume(c,getComputeMinimumHeightFunction(this),getComputeMaximumHeightFunction(this)),attributes:C,id:s.id})}}else for(m=0;m<a;++m)g=(c=(s=n[m]).geometry).constructor,o[m]=new GeometryInstance({geometry:g.createShadowVolume(c,getComputeMinimumHeightFunction(this),getComputeMaximumHeightFunction(this)),attributes:s.attributes,id:s.id});t.geometryInstances=o,t.appearance=this.appearance,t._createBoundingVolumeFunction=function(e,t){createBoundingVolume(l,e,t)},t._updateAndQueueCommandsFunction=function(e,t,i,r,n,a,o,s){updateAndQueueCommands$1(l,t,i,r,n,a,o)},this._primitive=new ClassificationPrimitive(t),this._primitive.readyPromise.then(function(e){l._ready=!0,l.releaseGeometryInstances&&(l.geometryInstances=void 0);e=e._error;defined(e)?l._readyPromise.reject(e):l._readyPromise.resolve(l)})}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}else GroundPrimitive.initializeTerrainHeights()},GroundPrimitive.prototype.getBoundingSphere=function(e){e=this._boundingSpheresKeys.indexOf(e);if(-1!==e)return this._boundingSpheres[e]},GroundPrimitive.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},GroundPrimitive.prototype.isDestroyed=function(){return!1},GroundPrimitive.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)},GroundPrimitive._supportsMaterials=function(e){return e.depthTexture},GroundPrimitive.supportsMaterials=function(e){return GroundPrimitive._supportsMaterials(e.frameState.context)},Object.defineProperties(MaterialProperty.prototype,{isConstant:{get:DeveloperError.throwInstantiationError},definitionChanged:{get:DeveloperError.throwInstantiationError}}),MaterialProperty.prototype.getType=DeveloperError.throwInstantiationError,MaterialProperty.prototype.getValue=DeveloperError.throwInstantiationError,MaterialProperty.prototype.equals=DeveloperError.throwInstantiationError,MaterialProperty.getValue=function(e,t,i){var r;return defined(t)&&defined(r=t.getType(e))?(defined(i)&&i.type===r||(i=Material.fromType(r)),t.getValue(e,i.uniforms)):(defined(i)&&i.type===Material.ColorType||(i=Material.fromType(Material.ColorType)),Color.clone(Color.WHITE,i.uniforms.color)),i},DynamicGeometryUpdater$1.prototype._isHidden=function(e,t,i){return!e.isShowing||!e.isAvailable(i)||!Property.getValueOrDefault(t.show,i,!0)},DynamicGeometryUpdater$1.prototype._setOptions=DeveloperError.throwInstantiationError,DynamicGeometryUpdater$1.prototype.update=function(e){var t=this._geometryUpdater,i=t._onTerrain,r=this._primitives,n=this._orderedGroundPrimitives;i?n.remove(this._primitive):(r.removeAndDestroy(this._primitive),r.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var a,o,s,l,c=this._entity,u=c[this._geometryUpdater._geometryPropertyName];this._setOptions(c,u,e),this._isHidden(c,u,e)||(a=this._geometryUpdater.shadowsProperty.getValue(e),l=this._options,defined(u.fill)&&!u.fill.getValue(e)||(o=(s=t.fillMaterialProperty)instanceof ColorMaterialProperty,c=t._getIsClosed(l),c=o?new PerInstanceColorAppearance({closed:c,flat:i&&!t._supportsMaterialsforEntitiesOnTerrain}):(s=MaterialProperty.getValue(e,s,this._material),new MaterialAppearance({material:this._material=s,translucent:s.isTranslucent(),closed:c})),i?(l.vertexFormat=PerInstanceColorAppearance.VERTEX_FORMAT,this._primitive=n.add(new GroundPrimitive({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:c,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),Property.getValueOrUndefined(this._geometryUpdater.zIndex,e))):(l.vertexFormat=c.vertexFormat,l=this._geometryUpdater.createFillGeometryInstance(e),o&&(c.translucent=255!==l.attributes.color.value[3]),this._primitive=r.add(new Primitive({geometryInstances:l,appearance:c,asynchronous:!1,shadows:a})))),!i&&defined(u.outline)&&u.outline.getValue(e)&&(i=this._geometryUpdater.createOutlineGeometryInstance(e),e=Property.getValueOrDefault(u.outlineWidth,e,1),this._outlinePrimitive=r.add(new Primitive({geometryInstances:i,appearance:new PerInstanceColorAppearance({flat:!0,translucent:255!==i.attributes.color.value[3],renderState:{lineWidth:t._scene.clampLineWidth(e)}}),asynchronous:!1,shadows:a}))))},DynamicGeometryUpdater$1.prototype.getBoundingSphere=function(e){var t,i=this._entity,r=this._primitive,n=this._outlinePrimitive;return defined(r)&&r.show&&r.ready&&defined(t=r.getGeometryInstanceAttributes(i))&&defined(t.boundingSphere)||defined(n)&&n.show&&n.ready&&defined(t=n.getGeometryInstanceAttributes(i))&&defined(t.boundingSphere)?(BoundingSphere.clone(t.boundingSphere,e),BoundingSphereState$1.DONE):defined(r)&&!r.ready||defined(n)&&!n.ready?BoundingSphereState$1.PENDING:BoundingSphereState$1.FAILED},DynamicGeometryUpdater$1.prototype.isDestroyed=function(){return!1},DynamicGeometryUpdater$1.prototype.destroy=function(){var e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),destroyObject(this)};var PolylineShadowVolumeFS="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC;\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\nvoid main(void)\n{\nfloat logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\nvec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\nif (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\ngl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\nreturn;\n#else // DEBUG_SHOW_VOLUME\ndiscard;\n#endif // DEBUG_SHOW_VOLUME\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\nfloat widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\nfloat distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\nfloat distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\nif (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\ngl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\nreturn;\n#else // DEBUG_SHOW_VOLUME\ndiscard;\n#endif // DEBUG_SHOW_VOLUME\n}\nvec3 alignedPlaneNormal;\nalignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\nalignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\ndistanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\nalignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\nalignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\ndistanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\n#ifdef PER_INSTANCE_COLOR\ngl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\nfloat s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\ns = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\nfloat t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\nczm_materialInput materialInput;\nmaterialInput.s = s;\nmaterialInput.st = vec2(s, t);\nmaterialInput.str = vec3(s, t, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\ngl_FragColor.rgb *= gl_FragColor.a;\nczm_writeDepthClamp();\n}\n",PolylineShadowVolumeMorphFS="varying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\nfloat rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {\nreturn (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);\n}\nvoid main(void)\n{\nvec4 eyeCoordinate = gl_FragCoord;\neyeCoordinate /= eyeCoordinate.w;\n#ifdef PER_INSTANCE_COLOR\ngl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\nfloat distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);\nfloat distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);\ndistanceFromStart = max(0.0, distanceFromStart);\ndistanceFromEnd = max(0.0, distanceFromEnd);\nfloat s = distanceFromStart / (distanceFromStart + distanceFromEnd);\ns = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;\nczm_materialInput materialInput;\nmaterialInput.s = s;\nmaterialInput.st = vec2(s, v_texcoordT);\nmaterialInput.str = vec3(s, v_texcoordT, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n}\n",PolylineShadowVolumeMorphVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\nattribute float batchId;\nvarying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\nvoid main()\n{\nv_batchId = batchId;\nvec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));\nvec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);\nvec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\nvec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\nvec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\nvec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\nvec4 startPlane2D;\nvec4 startPlane3D;\nstartPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\nstartPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\nstartPlane2D.w = -dot(startPlane2D.xyz, posEc2D);\nstartPlane3D.w = -dot(startPlane3D.xyz, posEc3D);\nvec4 rightPlane2D;\nvec4 rightPlane3D;\nrightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\nrightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\nrightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);\nrightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);\nposRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);\nposRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);\nposRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\nposEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\nposEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\nvec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\nvec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));\nvec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));\nvec4 endPlane2D;\nvec4 endPlane3D;\nendPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\nendPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\nendPlane2D.w = -dot(endPlane2D.xyz, posEc2D);\nendPlane3D.w = -dot(endPlane3D.xyz, posEc3D);\nv_forwardDirectionEC = normalize(endEC - startEC);\nvec2 cleanTexcoordNormalization2D;\ncleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);\ncleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));\nvec2 cleanTexcoordNormalization3D;\ncleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\ncleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;\ncleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));\nv_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#else // PER_INSTANCE_COLOR\nv_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);\nv_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);\n#endif // PER_INSTANCE_COLOR\n#ifdef WIDTH_VARYING\nfloat width = czm_batchTable_width(batchId);\nfloat halfWidth = width * 0.5;\nv_width = width;\nv_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#else\nfloat halfWidth = 0.5 * czm_batchTable_width(batchId);\nv_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#endif\nvec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow);\nfloat absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));\nfloat absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));\nvec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);\nvec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection));\nvec3 normalEC = normalize(cross(planeDirection, upOrDown));\nvec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));\ngeodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);\ngeodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\npositionEc3D.xyz += geodeticSurfaceNormal;\nnormalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\npositionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC;\nvec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nabsStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));\nabsEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));\nplaneDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);\nupOrDown = normalize(cross(rightPlane2D.xyz, planeDirection));\nnormalEC = normalize(cross(planeDirection, upOrDown));\ngeodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));\ngeodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);\ngeodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\npositionEc2D.xyz += geodeticSurfaceNormal;\nnormalEC *= sign(texcoordNormalization2D.x);\n#ifndef PER_INSTANCE_COLOR\nv_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);\n#endif\npositionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC;\ngl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);\n#ifdef ANGLE_VARYING\nvec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));\napproxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\nv_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n",PolylineShadowVolumeVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\n#ifndef COLUMBUS_VIEW_2D\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\n#else\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\n#endif\nattribute float batchId;\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC;\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef COLUMBUS_VIEW_2D\nvec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;\nvec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);\nvec3 ecEnd = forwardDirectionEC + ecStart;\nforwardDirectionEC = normalize(forwardDirectionEC);\nv_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\nv_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\nvec4 startPlaneEC;\nstartPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\nstartPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\nvec4 endPlaneEC;\nendPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\nendPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\nv_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);\nv_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;\n#else // COLUMBUS_VIEW_2D\nvec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\nvec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\nvec3 ecEnd = ecStart + offset;\nvec3 forwardDirectionEC = normalize(offset);\nvec4 startPlaneEC;\nstartPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\nstartPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\nvec4 endPlaneEC;\nendPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\nendPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\nv_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\nv_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\nv_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\nv_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\n#endif // COLUMBUS_VIEW_2D\nv_endEcAndStartEcX.xyz = ecEnd;\nv_endEcAndStartEcX.w = ecStart.x;\nv_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#endif // PER_INSTANCE_COLOR\nvec4 positionRelativeToEye = czm_computePosition();\nvec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye;\nfloat absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\nfloat absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\nvec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\nvec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection));\nvec3 normalEC = normalize(cross(planeDirection, upOrDown));\nupOrDown = cross(forwardDirectionEC, normalEC);\nupOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;\nupOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\nupOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;\npositionEC.xyz += upOrDown;\nv_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\nfloat width = czm_batchTable_width(batchId);\n#ifdef WIDTH_VARYING\nv_width = width;\n#endif\nv_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\nv_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\nv_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\nv_endPlaneNormalEcAndBatchId.w = batchId;\nwidth = width * max(0.0, czm_metersPerPixel(positionEC));\nwidth = width / dot(normalEC, v_rightPlaneEC.xyz);\n#ifdef COLUMBUS_VIEW_2D\nnormalEC *= sign(texcoordNormalization2D.x);\n#else\nnormalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n#endif\npositionEC.xyz += width * normalEC;\ngl_Position = czm_depthClamp(czm_projection * positionEC);\n#ifdef ANGLE_VARYING\nvec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));\napproxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\nv_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n",PolylineColorAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\nv_color = color;\n}\n",PolylineCommon="void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane,\nout vec4 clippedPositionEC)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p0ToP1 = p1 - p0;\nfloat magnitude = length(p0ToP1);\nvec3 direction = normalize(p0ToP1);\nfloat endPoint0Distance = czm_currentFrustum.x + p0.z;\nfloat denominator = -direction.z;\nif (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance > 0.0)\n{\nfloat t = endPoint0Distance / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\np0.z = min(p0.z, -czm_currentFrustum.x);\nclipped = true;\n}\n}\nclippedPositionEC = vec4(p0, 1.0);\npositionWC = czm_eyeToWindowCoordinates(clippedPositionEC);\n}\nvec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\n{\n#ifdef POLYLINE_DASH\nvec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\nvec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\nvec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\nvec2 lineDir;\nif (usePrevious) {\nlineDir = normalize(positionWindow.xy - previousWindow.xy);\n}\nelse {\nlineDir = normalize(nextWindow.xy - positionWindow.xy);\n}\nangle = atan(lineDir.x, lineDir.y) - 1.570796327;\nangle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\nvec4 clippedPrevWC, clippedPrevEC;\nbool prevSegmentClipped, prevSegmentCulled;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);\nvec4 clippedNextWC, clippedNextEC;\nbool nextSegmentClipped, nextSegmentCulled;\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);\nbool segmentClipped, segmentCulled;\nvec4 clippedPositionWC, clippedPositionEC;\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);\nif (segmentCulled)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);\nvec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);\nif (prevSegmentCulled)\n{\ndirectionToPrevWC = -directionToNextWC;\n}\nelse if (nextSegmentCulled)\n{\ndirectionToNextWC = -directionToPrevWC;\n}\nvec2 thisSegmentForwardWC, otherSegmentForwardWC;\nif (usePrevious)\n{\nthisSegmentForwardWC = -directionToPrevWC;\notherSegmentForwardWC = directionToNextWC;\n}\nelse\n{\nthisSegmentForwardWC = directionToNextWC;\notherSegmentForwardWC = -directionToPrevWC;\n}\nvec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);\nvec2 leftWC = thisSegmentLeftWC;\nfloat expandWidth = width * 0.5;\nif (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\n{\nvec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);\nvec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;\nfloat leftSumLength = length(leftSumWC);\nleftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);\nvec2 u = -thisSegmentForwardWC;\nvec2 v = leftWC;\nfloat sinAngle = abs(u.x * v.y - u.y * v.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\nreturn vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\n{\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nreturn getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\n}\n",defaultVertexShaderSource$1=PolylineCommon+"\n"+PolylineColorAppearanceVS,defaultFragmentShaderSource$1=PerInstanceFlatColorAppearanceFS;function PolylineColorAppearance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.translucent,!0),i=PolylineColorAppearance.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,defaultVertexShaderSource$1),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,defaultFragmentShaderSource$1),this._renderState=Appearance.getDefaultRenderState(t,!1,e.renderState),this._closed=!1,this._vertexFormat=i}FeatureDetection.isInternetExplorer()||(defaultVertexShaderSource$1="#define CLIP_POLYLINE \n"+defaultVertexShaderSource$1),Object.defineProperties(PolylineColorAppearance.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}}}),PolylineColorAppearance.VERTEX_FORMAT=VertexFormat.POSITION_ONLY,PolylineColorAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PolylineColorAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PolylineColorAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;var PolylineMaterialAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_polylineAngle;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\nv_width = width;\nv_st.s = st.s;\nv_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\nv_polylineAngle = angle;\n}\n",PolylineFS$1="#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec2 st = v_st;\nst.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = vec3(st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#ifdef VECTOR_TILE\ngl_FragColor *= u_highlightColor;\n#endif\nczm_writeLogDepth();\n}\n",defaultVertexShaderSource=PolylineCommon+"\n"+PolylineMaterialAppearanceVS,defaultFragmentShaderSource=PolylineFS$1;function PolylineMaterialAppearance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.translucent,!0),i=PolylineMaterialAppearance.VERTEX_FORMAT;this.material=defined(e.material)?e.material:Material.fromType(Material.ColorType),this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,defaultVertexShaderSource),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,defaultFragmentShaderSource),this._renderState=Appearance.getDefaultRenderState(t,!1,e.renderState),this._closed=!1,this._vertexFormat=i}function GroundPolylinePrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;var t=e.appearance;defined(t)||(t=new PolylineMaterialAppearance),this.appearance=t,this.show=defaultValue(e.show,!0),this.classificationType=defaultValue(e.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=defaultValue(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:defaultValue(e.interleave,!1),releaseGeometryInstances:defaultValue(e.releaseGeometryInstances,!0),allowPicking:defaultValue(e.allowPicking,!0),asynchronous:defaultValue(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._readyPromise=when.defer(),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=getRenderState$1(!1),this._renderState3DTiles=getRenderState$1(!0),this._renderStateMorph=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},depthTest:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}function createShaderProgram(e,t,i){var r=t.context,n=e._primitive,a=n._attributeLocations,o=n._batchTable.getVertexShaderCallback()(PolylineShadowVolumeVS),o=Primitive._appendShowToShader(n,o);o=Primitive._appendDistanceDisplayConditionToShader(n,o),o=Primitive._modifyShaderPosition(e,o,t.scene3DOnly);var s=n._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphVS),s=Primitive._appendShowToShader(n,s);s=Primitive._appendDistanceDisplayConditionToShader(n,s),s=Primitive._modifyShaderPosition(e,s,t.scene3DOnly);var l=n._batchTable.getVertexShaderCallback()(PolylineShadowVolumeFS),c=["GLOBE_MINIMUM_ALTITUDE "+t.mapProjection.ellipsoid.minimumRadius.toFixed(1)],u="",d="";defined(i.material)?(-1!==(d=defined(i.material)?i.material.shaderSource:"").search(/varying\s+float\s+v_polylineAngle;/g)&&c.push("ANGLE_VARYING"),-1!==d.search(/varying\s+float\s+v_width;/g)&&c.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",c.push(u);t=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],i=new ShaderSource({defines:c,sources:[o]}),u=new ShaderSource({defines:t,sources:[d,l]});e._sp=ShaderProgram.replaceCache({context:r,shaderProgram:n._sp,vertexShaderSource:i,fragmentShaderSource:u,attributeLocations:a});i=r.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");defined(i)||(o=new ShaderSource({defines:c.concat(["COLUMBUS_VIEW_2D"]),sources:[o]}),i=r.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:r,shaderProgram:e._sp2D,vertexShaderSource:o,fragmentShaderSource:u,attributeLocations:a})),e._sp2D=i;i=r.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");defined(i)||(s=new ShaderSource({defines:c.concat(["MAX_TERRAIN_HEIGHT "+ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed(1)]),sources:[s]}),l=new ShaderSource({defines:t,sources:[d,l=n._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphFS)]}),i=r.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:r,shaderProgram:e._spMorph,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:a})),e._spMorph=i}function getRenderState$1(e){return RenderState.fromCache({cull:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})}function createCommands$3(e,t,i,r,n,a){var o=e._primitive,s=o._va.length;n.length=s,a.length=s;for(var i=t instanceof PolylineColorAppearance?{}:i._uniforms,l=o._batchTable.getUniformMapCallback()(i),c=0;c<s;c++){var u=o._va[c],d=n[c];(d=!defined(d)?n[c]=new DrawCommand({owner:e,primitiveType:o._primitiveType}):d).vertexArray=u,d.renderState=e._renderState,d.shaderProgram=e._sp,d.uniformMap=l,d.pass=Pass$1.TERRAIN_CLASSIFICATION,d.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";var h=DrawCommand.shallowClone(d,d.derivedCommands.tileset);h.renderState=e._renderState3DTiles,h.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=h;u=DrawCommand.shallowClone(d,d.derivedCommands.color2D);u.shaderProgram=e._sp2D,d.derivedCommands.color2D=u;u=DrawCommand.shallowClone(h,h.derivedCommands.color2D);u.shaderProgram=e._sp2D,h.derivedCommands.color2D=u;u=DrawCommand.shallowClone(d,d.derivedCommands.colorMorph);u.renderState=e._renderStateMorph,u.shaderProgram=e._spMorph,u.pickId="czm_batchTable_pickColor(v_batchId)",d.derivedCommands.colorMorph=u}}function updateAndQueueCommand(e,t,i,r,n,a,o){i.mode===SceneMode$1.MORPHING?t=t.derivedCommands.colorMorph:i.mode!==SceneMode$1.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=r,t.boundingVolume=a,t.cull=n,t.debugShowBoundingVolume=o,i.commandList.push(t)}function updateAndQueueCommands(e,t,i,r,n,a,o){var s,l=e._primitive;Primitive._updateBoundingVolumes(l,t,n),t.mode===SceneMode$1.SCENE3D?s=l._boundingSphereWC:t.mode===SceneMode$1.COLUMBUS_VIEW?s=l._boundingSphereCV:t.mode===SceneMode$1.SCENE2D&&defined(l._boundingSphere2D)?s=l._boundingSphere2D:defined(l._boundingSphereMorph)&&(s=l._boundingSphereMorph);var c=t.mode===SceneMode$1.MORPHING,u=e.classificationType,d=u!==ClassificationType$1.CESIUM_3D_TILE,h=u!==ClassificationType$1.TERRAIN&&!c,c=t.passes;if(c.render||c.pick&&l.allowPicking)for(var p=i.length,m=0;m<p;++m){var f=s[m];d&&updateAndQueueCommand(e,i[m],t,n,a,f,o),h&&updateAndQueueCommand(e,i[m].derivedCommands.tileset,t,n,a,f,o)}}FeatureDetection.isInternetExplorer()||(defaultVertexShaderSource="#define CLIP_POLYLINE \n"+defaultVertexShaderSource),Object.defineProperties(PolylineMaterialAppearance.prototype,{vertexShaderSource:{get:function(){var e=this._vertexShaderSource;return e=-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)?"#define POLYLINE_DASH\n"+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}}}),PolylineMaterialAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_ST,PolylineMaterialAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PolylineMaterialAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PolylineMaterialAppearance.prototype.getRenderState=Appearance.prototype.getRenderState,Object.defineProperties(GroundPolylinePrimitive.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}},readyPromise:{get:function(){return this._readyPromise.promise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),GroundPolylinePrimitive.initializeTerrainHeights=function(){return ApproximateTerrainHeights.initialize()},GroundPolylinePrimitive.prototype.update=function(e){if(defined(this._primitive)||defined(this.geometryInstances))if(ApproximateTerrainHeights.initialized){var l=this,t=this._primitiveOptions;if(!defined(this._primitive)){for(var i=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=i.length,n=new Array(r),a=0;a<r;++a)if(!defined(c=i[a].attributes)||!defined(c.color)){this._hasPerInstanceColors=!1;break}for(a=0;a<r;++a){var o,s=i[a],c={},u=s.attributes;for(o in u)u.hasOwnProperty(o)&&(c[o]=u[o]);defined(c.width)||(c.width=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,value:[s.geometry.width]})),s.geometry._scene3DOnly=e.scene3DOnly,GroundPolylineGeometry.setProjectionAndEllipsoid(s.geometry,e.mapProjection),n[a]=new GeometryInstance({geometry:s.geometry,attributes:c,id:s.id,pickPrimitive:l})}t.geometryInstances=n,t.appearance=this.appearance,t._createShaderProgramFunction=function(e,t,i){createShaderProgram(l,t,i)},t._createCommandsFunction=function(e,t,i,r,n,a,o){createCommands$3(l,t,i,r,a,o)},t._updateAndQueueCommandsFunction=function(e,t,i,r,n,a,o,s){updateAndQueueCommands(l,t,i,r,n,a,o)},this._primitive=new Primitive(t),this._primitive.readyPromise.then(function(e){l._ready=!0,l.releaseGeometryInstances&&(l.geometryInstances=void 0);e=e._error;defined(e)?l._readyPromise.reject(e):l._readyPromise.resolve(l)})}if(this.appearance instanceof PolylineColorAppearance&&!this._hasPerInstanceColors)throw new DeveloperError("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)}else GroundPolylinePrimitive.initializeTerrainHeights()},GroundPolylinePrimitive.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},GroundPolylinePrimitive.isSupported=function(e){return e.frameState.context.depthTexture},GroundPolylinePrimitive.prototype.isDestroyed=function(){return!1},GroundPolylinePrimitive.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,destroyObject(this)};var defaultRepeat$2=new Cartesian2(1,1),defaultTransparent=!1,defaultColor$7=Color.WHITE;function ImageMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,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}function createMaterialProperty(e){if(e instanceof Color)return new ColorMaterialProperty(e);if("string"==typeof e||e instanceof Resource||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){var t=new ImageMaterialProperty;return t.image=e,t}}function createMaterialPropertyDescriptor(e,t){return createPropertyDescriptor(e,t,createMaterialProperty)}function BoxGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function PositionProperty(){DeveloperError.throwInstantiationError()}Object.defineProperties(ImageMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._image)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:createPropertyDescriptor("image"),repeat:createPropertyDescriptor("repeat"),color:createPropertyDescriptor("color"),transparent:createPropertyDescriptor("transparent")}),ImageMaterialProperty.prototype.getType=function(e){return"Image"},ImageMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).image=Property.getValueOrUndefined(this._image,e),t.repeat=Property.getValueOrClonedDefault(this._repeat,e,defaultRepeat$2,t.repeat),t.color=Property.getValueOrClonedDefault(this._color,e,defaultColor$7,t.color),Property.getValueOrDefault(this._transparent,e,defaultTransparent)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},ImageMaterialProperty.prototype.equals=function(e){return this===e||e instanceof ImageMaterialProperty&&Property.equals(this._image,e._image)&&Property.equals(this._repeat,e._repeat)&&Property.equals(this._color,e._color)&&Property.equals(this._transparent,e._transparent)},Object.defineProperties(BoxGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),dimensions:createPropertyDescriptor("dimensions"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),BoxGraphics.prototype.clone=function(e){return defined(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 BoxGraphics(this)},BoxGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.dimensions=defaultValue(this.dimensions,e.dimensions),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(PositionProperty.prototype,{isConstant:{get:DeveloperError.throwInstantiationError},definitionChanged:{get:DeveloperError.throwInstantiationError},referenceFrame:{get:DeveloperError.throwInstantiationError}}),PositionProperty.prototype.getValue=DeveloperError.throwInstantiationError,PositionProperty.prototype.getValueInReferenceFrame=DeveloperError.throwInstantiationError,PositionProperty.prototype.equals=DeveloperError.throwInstantiationError;var scratchMatrix3$1=new Matrix3;function ConstantPositionProperty(e,t){this._definitionChanged=new Event,this._value=Cartesian3.clone(e),this._referenceFrame=defaultValue(t,ReferenceFrame$1.FIXED)}function CorridorGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function createRawProperty(e){return e}function createRawPropertyDescriptor(e,t){return createPropertyDescriptor(e,t,createRawProperty)}function CylinderGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function EllipseGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function EllipsoidGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function LabelGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}PositionProperty.convertToReferenceFrame=function(e,t,i,r,n){if(!defined(t))return t;if(defined(n)||(n=new Cartesian3),i===r)return Cartesian3.clone(t,n);r=Transforms.computeIcrfToFixedMatrix(e,scratchMatrix3$1);return defined(r)||(r=Transforms.computeTemeToPseudoFixedMatrix(e,scratchMatrix3$1)),i===ReferenceFrame$1.INERTIAL?Matrix3.multiplyByVector(r,t,n):i===ReferenceFrame$1.FIXED?Matrix3.multiplyByVector(Matrix3.transpose(r,scratchMatrix3$1),t,n):void 0},Object.defineProperties(ConstantPositionProperty.prototype,{isConstant:{get:function(){return!defined(this._value)||this._referenceFrame===ReferenceFrame$1.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),ConstantPositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},ConstantPositionProperty.prototype.setValue=function(e,t){var i=!1;Cartesian3.equals(this._value,e)||(i=!0,this._value=Cartesian3.clone(e)),defined(t)&&this._referenceFrame!==t&&(i=!0,this._referenceFrame=t),i&&this._definitionChanged.raiseEvent(this)},ConstantPositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){return PositionProperty.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},ConstantPositionProperty.prototype.equals=function(e){return this===e||e instanceof ConstantPositionProperty&&Cartesian3.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame},Object.defineProperties(CorridorGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),CorridorGraphics.prototype.clone=function(e){return defined(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 CorridorGraphics(this)},CorridorGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.positions=defaultValue(this.positions,e.positions),this.width=defaultValue(this.width,e.width),this.height=defaultValue(this.height,e.height),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=defaultValue(this.cornerType,e.cornerType),this.granularity=defaultValue(this.granularity,e.granularity),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,e.classificationType),this.zIndex=defaultValue(this.zIndex,e.zIndex)},Object.defineProperties(CylinderGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),length:createPropertyDescriptor("length"),topRadius:createPropertyDescriptor("topRadius"),bottomRadius:createPropertyDescriptor("bottomRadius"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),slices:createPropertyDescriptor("slices"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),CylinderGraphics.prototype.clone=function(e){return defined(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 CylinderGraphics(this)},CylinderGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.length=defaultValue(this.length,e.length),this.topRadius=defaultValue(this.topRadius,e.topRadius),this.bottomRadius=defaultValue(this.bottomRadius,e.bottomRadius),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=defaultValue(this.slices,e.slices),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(EllipseGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),semiMajorAxis:createPropertyDescriptor("semiMajorAxis"),semiMinorAxis:createPropertyDescriptor("semiMinorAxis"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),EllipseGraphics.prototype.clone=function(e){return defined(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 EllipseGraphics(this)},EllipseGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.semiMajorAxis=defaultValue(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=defaultValue(this.semiMinorAxis,e.semiMinorAxis),this.height=defaultValue(this.height,e.height),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=defaultValue(this.rotation,e.rotation),this.stRotation=defaultValue(this.stRotation,e.stRotation),this.granularity=defaultValue(this.granularity,e.granularity),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,e.classificationType),this.zIndex=defaultValue(this.zIndex,e.zIndex)},Object.defineProperties(EllipsoidGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),radii:createPropertyDescriptor("radii"),innerRadii:createPropertyDescriptor("innerRadii"),minimumClock:createPropertyDescriptor("minimumClock"),maximumClock:createPropertyDescriptor("maximumClock"),minimumCone:createPropertyDescriptor("minimumCone"),maximumCone:createPropertyDescriptor("maximumCone"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),stackPartitions:createPropertyDescriptor("stackPartitions"),slicePartitions:createPropertyDescriptor("slicePartitions"),subdivisions:createPropertyDescriptor("subdivisions"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),EllipsoidGraphics.prototype.clone=function(e){return defined(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 EllipsoidGraphics(this)},EllipsoidGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.radii=defaultValue(this.radii,e.radii),this.innerRadii=defaultValue(this.innerRadii,e.innerRadii),this.minimumClock=defaultValue(this.minimumClock,e.minimumClock),this.maximumClock=defaultValue(this.maximumClock,e.maximumClock),this.minimumCone=defaultValue(this.minimumCone,e.minimumCone),this.maximumCone=defaultValue(this.maximumCone,e.maximumCone),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.stackPartitions=defaultValue(this.stackPartitions,e.stackPartitions),this.slicePartitions=defaultValue(this.slicePartitions,e.slicePartitions),this.subdivisions=defaultValue(this.subdivisions,e.subdivisions),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(LabelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),text:createPropertyDescriptor("text"),font:createPropertyDescriptor("font"),style:createPropertyDescriptor("style"),scale:createPropertyDescriptor("scale"),showBackground:createPropertyDescriptor("showBackground"),backgroundColor:createPropertyDescriptor("backgroundColor"),backgroundPadding:createPropertyDescriptor("backgroundPadding"),pixelOffset:createPropertyDescriptor("pixelOffset"),eyeOffset:createPropertyDescriptor("eyeOffset"),horizontalOrigin:createPropertyDescriptor("horizontalOrigin"),verticalOrigin:createPropertyDescriptor("verticalOrigin"),heightReference:createPropertyDescriptor("heightReference"),fillColor:createPropertyDescriptor("fillColor"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),pixelOffsetScaleByDistance:createPropertyDescriptor("pixelOffsetScaleByDistance"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),LabelGraphics.prototype.clone=function(e){return defined(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 LabelGraphics(this)},LabelGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.text=defaultValue(this.text,e.text),this.font=defaultValue(this.font,e.font),this.style=defaultValue(this.style,e.style),this.scale=defaultValue(this.scale,e.scale),this.showBackground=defaultValue(this.showBackground,e.showBackground),this.backgroundColor=defaultValue(this.backgroundColor,e.backgroundColor),this.backgroundPadding=defaultValue(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=defaultValue(this.pixelOffset,e.pixelOffset),this.eyeOffset=defaultValue(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=defaultValue(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=defaultValue(this.verticalOrigin,e.verticalOrigin),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.fillColor=defaultValue(this.fillColor,e.fillColor),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=defaultValue(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=defaultValue(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=defaultValue(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,e.disableDepthTestDistance)};var defaultNodeTransformation=new TranslationRotationScale;function NodeTransformationProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,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}function PropertyBag(e,t){this._propertyNames=[],this._definitionChanged=new Event,defined(e)&&this.merge(e,t)}function createConstantProperty(e){return new ConstantProperty(e)}function propertiesEqual(e,t){var i=e._propertyNames,r=t._propertyNames,n=i.length;if(n!==r.length)return!1;for(var a=0;a<n;++a){var o=i[a];if(-1===r.indexOf(o))return!1;if(!Property.equals(e[o],t[o]))return!1}return!0}function createNodeTransformationProperty(e){return new NodeTransformationProperty(e)}function createNodeTransformationPropertyBag(e){return new PropertyBag(e,createNodeTransformationProperty)}function createArticulationStagePropertyBag(e){return new PropertyBag(e)}function ModelGraphics(e){this._definitionChanged=new Event,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._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.merge(defaultValue(e,defaultValue.EMPTY_OBJECT))}function Cesium3DTilesetGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function PathGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function PlaneGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function PointGraphics(e){this._definitionChanged=new Event,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.merge(defaultValue(e,defaultValue.EMPTY_OBJECT))}function createPolygonHierarchyProperty(e){return new ConstantProperty(e=Array.isArray(e)?new PolygonHierarchy(e):e)}function PolygonGraphics(e){this._definitionChanged=new Event,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.merge(defaultValue(e,defaultValue.EMPTY_OBJECT))}function PolylineGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function PolylineVolumeGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function RectangleGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}function WallGraphics(e){this._definitionChanged=new Event,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(defaultValue(e,defaultValue.EMPTY_OBJECT))}Object.defineProperties(NodeTransformationProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._translation)&&Property.isConstant(this._rotation)&&Property.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:createPropertyDescriptor("translation"),rotation:createPropertyDescriptor("rotation"),scale:createPropertyDescriptor("scale")}),NodeTransformationProperty.prototype.getValue=function(e,t){return(t=!defined(t)?new TranslationRotationScale:t).translation=Property.getValueOrClonedDefault(this._translation,e,defaultNodeTransformation.translation,t.translation),t.rotation=Property.getValueOrClonedDefault(this._rotation,e,defaultNodeTransformation.rotation,t.rotation),t.scale=Property.getValueOrClonedDefault(this._scale,e,defaultNodeTransformation.scale,t.scale),t},NodeTransformationProperty.prototype.equals=function(e){return this===e||e instanceof NodeTransformationProperty&&Property.equals(this._translation,e._translation)&&Property.equals(this._rotation,e._rotation)&&Property.equals(this._scale,e._scale)},Object.defineProperties(PropertyBag.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,i=e.length;t<i;t++)if(!Property.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),PropertyBag.prototype.hasProperty=function(e){return-1!==this._propertyNames.indexOf(e)},PropertyBag.prototype.addProperty=function(e,t,i){this._propertyNames.push(e),Object.defineProperty(this,e,createPropertyDescriptor(e,!0,defaultValue(i,createConstantProperty))),defined(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.removeProperty=function(e){var t=this._propertyNames.indexOf(e);this._propertyNames.splice(t,1),delete this[e],this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.getValue=function(e,t){defined(t)||(t={});for(var i=this._propertyNames,r=0,n=i.length;r<n;r++){var a=i[r];t[a]=Property.getValueOrUndefined(this[a],e,t[a])}return t},PropertyBag.prototype.merge=function(e,t){for(var i=this._propertyNames,r=defined(e._propertyNames)?e._propertyNames:Object.keys(e),n=0,a=r.length;n<a;n++){var o=r[n],s=this[o],l=e[o];void 0===s&&-1===i.indexOf(o)&&this.addProperty(o,void 0,t),void 0!==l&&(void 0!==s?defined(s)&&defined(s.merge)&&s.merge(l):defined(l)&&defined(l.merge)&&defined(l.clone)?this[o]=l.clone():this[o]=l)}},PropertyBag.prototype.equals=function(e){return this===e||e instanceof PropertyBag&&propertiesEqual(this,e)},Object.defineProperties(ModelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),scale:createPropertyDescriptor("scale"),minimumPixelSize:createPropertyDescriptor("minimumPixelSize"),maximumScale:createPropertyDescriptor("maximumScale"),incrementallyLoadTextures:createPropertyDescriptor("incrementallyLoadTextures"),runAnimations:createPropertyDescriptor("runAnimations"),clampAnimations:createPropertyDescriptor("clampAnimations"),shadows:createPropertyDescriptor("shadows"),heightReference:createPropertyDescriptor("heightReference"),silhouetteColor:createPropertyDescriptor("silhouetteColor"),silhouetteSize:createPropertyDescriptor("silhouetteSize"),color:createPropertyDescriptor("color"),colorBlendMode:createPropertyDescriptor("colorBlendMode"),colorBlendAmount:createPropertyDescriptor("colorBlendAmount"),imageBasedLightingFactor:createPropertyDescriptor("imageBasedLightingFactor"),lightColor:createPropertyDescriptor("lightColor"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),nodeTransformations:createPropertyDescriptor("nodeTransformations",void 0,createNodeTransformationPropertyBag),articulations:createPropertyDescriptor("articulations",void 0,createArticulationStagePropertyBag),clippingPlanes:createPropertyDescriptor("clippingPlanes")}),ModelGraphics.prototype.clone=function(e){return defined(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,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):new ModelGraphics(this)},ModelGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.uri=defaultValue(this.uri,e.uri),this.scale=defaultValue(this.scale,e.scale),this.minimumPixelSize=defaultValue(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=defaultValue(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=defaultValue(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=defaultValue(this.runAnimations,e.runAnimations),this.clampAnimations=defaultValue(this.clampAnimations,e.clampAnimations),this.shadows=defaultValue(this.shadows,e.shadows),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.silhouetteColor=defaultValue(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=defaultValue(this.silhouetteSize,e.silhouetteSize),this.color=defaultValue(this.color,e.color),this.colorBlendMode=defaultValue(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=defaultValue(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=defaultValue(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=defaultValue(this.lightColor,e.lightColor),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=defaultValue(this.clippingPlanes,e.clippingPlanes);var t,i=e.nodeTransformations;defined(i)&&(defined(t=this.nodeTransformations)?t.merge(i):this.nodeTransformations=new PropertyBag(i,createNodeTransformationProperty));i=e.articulations;defined(i)&&(defined(e=this.articulations)?e.merge(i):this.articulations=new PropertyBag(i))},Object.defineProperties(Cesium3DTilesetGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),maximumScreenSpaceError:createPropertyDescriptor("maximumScreenSpaceError")}),Cesium3DTilesetGraphics.prototype.clone=function(e){return defined(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Cesium3DTilesetGraphics(this)},Cesium3DTilesetGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.uri=defaultValue(this.uri,e.uri),this.maximumScreenSpaceError=defaultValue(this.maximumScreenSpaceError,e.maximumScreenSpaceError)},Object.defineProperties(PathGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),leadTime:createPropertyDescriptor("leadTime"),trailTime:createPropertyDescriptor("trailTime"),width:createPropertyDescriptor("width"),resolution:createPropertyDescriptor("resolution"),material:createMaterialPropertyDescriptor("material"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PathGraphics.prototype.clone=function(e){return defined(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 PathGraphics(this)},PathGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.leadTime=defaultValue(this.leadTime,e.leadTime),this.trailTime=defaultValue(this.trailTime,e.trailTime),this.width=defaultValue(this.width,e.width),this.resolution=defaultValue(this.resolution,e.resolution),this.material=defaultValue(this.material,e.material),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(PlaneGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),plane:createPropertyDescriptor("plane"),dimensions:createPropertyDescriptor("dimensions"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PlaneGraphics.prototype.clone=function(e){return defined(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 PlaneGraphics(this)},PlaneGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.plane=defaultValue(this.plane,e.plane),this.dimensions=defaultValue(this.dimensions,e.dimensions),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(PointGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),pixelSize:createPropertyDescriptor("pixelSize"),heightReference:createPropertyDescriptor("heightReference"),color:createPropertyDescriptor("color"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),PointGraphics.prototype.clone=function(e){return defined(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):new PointGraphics(this)},PointGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.pixelSize=defaultValue(this.pixelSize,e.pixelSize),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.color=defaultValue(this.color,e.color),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.scaleByDistance=defaultValue(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=defaultValue(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,e.disableDepthTestDistance)},Object.defineProperties(PolygonGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),hierarchy:createPropertyDescriptor("hierarchy",void 0,createPolygonHierarchyProperty),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),perPositionHeight:createPropertyDescriptor("perPositionHeight"),closeTop:createPropertyDescriptor("closeTop"),closeBottom:createPropertyDescriptor("closeBottom"),arcType:createPropertyDescriptor("arcType"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),PolygonGraphics.prototype.clone=function(e){return defined(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):new PolygonGraphics(this)},PolygonGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.hierarchy=defaultValue(this.hierarchy,e.hierarchy),this.height=defaultValue(this.height,e.height),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=defaultValue(this.stRotation,e.stRotation),this.granularity=defaultValue(this.granularity,e.granularity),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.perPositionHeight=defaultValue(this.perPositionHeight,e.perPositionHeight),this.closeTop=defaultValue(this.closeTop,e.closeTop),this.closeBottom=defaultValue(this.closeBottom,e.closeBottom),this.arcType=defaultValue(this.arcType,e.arcType),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,e.classificationType),this.zIndex=defaultValue(this.zIndex,e.zIndex)},Object.defineProperties(PolylineGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),granularity:createPropertyDescriptor("granularity"),material:createMaterialPropertyDescriptor("material"),depthFailMaterial:createMaterialPropertyDescriptor("depthFailMaterial"),arcType:createPropertyDescriptor("arcType"),clampToGround:createPropertyDescriptor("clampToGround"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),PolylineGraphics.prototype.clone=function(e){return defined(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 PolylineGraphics(this)},PolylineGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.positions=defaultValue(this.positions,e.positions),this.width=defaultValue(this.width,e.width),this.granularity=defaultValue(this.granularity,e.granularity),this.material=defaultValue(this.material,e.material),this.depthFailMaterial=defaultValue(this.depthFailMaterial,e.depthFailMaterial),this.arcType=defaultValue(this.arcType,e.arcType),this.clampToGround=defaultValue(this.clampToGround,e.clampToGround),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,e.classificationType),this.zIndex=defaultValue(this.zIndex,e.zIndex)},Object.defineProperties(PolylineVolumeGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),shape:createPropertyDescriptor("shape"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PolylineVolumeGraphics.prototype.clone=function(e){return defined(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 PolylineVolumeGraphics(this)},PolylineVolumeGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.positions=defaultValue(this.positions,e.positions),this.shape=defaultValue(this.shape,e.shape),this.cornerType=defaultValue(this.cornerType,e.cornerType),this.granularity=defaultValue(this.granularity,e.granularity),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(RectangleGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),coordinates:createPropertyDescriptor("coordinates"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),RectangleGraphics.prototype.clone=function(e){return defined(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 RectangleGraphics(this)},RectangleGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.coordinates=defaultValue(this.coordinates,e.coordinates),this.height=defaultValue(this.height,e.height),this.heightReference=defaultValue(this.heightReference,e.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=defaultValue(this.rotation,e.rotation),this.stRotation=defaultValue(this.stRotation,e.stRotation),this.granularity=defaultValue(this.granularity,e.granularity),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,e.classificationType),this.zIndex=defaultValue(this.zIndex,e.zIndex)},Object.defineProperties(WallGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),minimumHeights:createPropertyDescriptor("minimumHeights"),maximumHeights:createPropertyDescriptor("maximumHeights"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),WallGraphics.prototype.clone=function(e){return defined(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 WallGraphics(this)},WallGraphics.prototype.merge=function(e){this.show=defaultValue(this.show,e.show),this.positions=defaultValue(this.positions,e.positions),this.minimumHeights=defaultValue(this.minimumHeights,e.minimumHeights),this.maximumHeights=defaultValue(this.maximumHeights,e.maximumHeights),this.granularity=defaultValue(this.granularity,e.granularity),this.fill=defaultValue(this.fill,e.fill),this.material=defaultValue(this.material,e.material),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition)};var cartoScratch$1=new Cartographic;function createConstantPositionProperty(e){return new ConstantPositionProperty(e)}function createPositionPropertyDescriptor(e){return createPropertyDescriptor(e,void 0,createConstantPositionProperty)}function createPropertyTypeDescriptor(e,t){return createPropertyDescriptor(e,void 0,function(e){return e instanceof t?e:new t(e)})}function Entity(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).id;defined(t)||(t=createGuid()),this._availability=void 0,this._id=t,this._definitionChanged=new Event,this._name=e.name,this._show=defaultValue(e.show,!0),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"],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 updateShow(e,t,i){for(var r=t.length,n=0;n<r;n++){var a=t[n],o=a._show;(!i&&o)!==(i&&o)&&updateShow(a,a._children,i)}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}Object.defineProperties(Entity.prototype,{availability:createRawPropertyDescriptor("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:createRawPropertyDescriptor("name"),show:{get:function(){return this._show},set:function(e){var t;e!==this._show&&(t=this.isShowing,this._show=e,t!==(t=this.isShowing)&&updateShow(this,this._children,t),this._definitionChanged.raiseEvent(this,"show",e,!e))}},isShowing:{get:function(){return this._show&&(!defined(this.entityCollection)||this.entityCollection.show)&&(!defined(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t,i,r=this._parent;r!==e&&(i=this.isShowing,defined(r)&&(t=r._children.indexOf(this),r._children.splice(t,1)),defined(this._parent=e)&&e._children.push(this),i!==(i=this.isShowing)&&updateShow(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,r))}},propertyNames:{get:function(){return this._propertyNames}},billboard:createPropertyTypeDescriptor("billboard",BillboardGraphics),box:createPropertyTypeDescriptor("box",BoxGraphics),corridor:createPropertyTypeDescriptor("corridor",CorridorGraphics),cylinder:createPropertyTypeDescriptor("cylinder",CylinderGraphics),description:createPropertyDescriptor("description"),ellipse:createPropertyTypeDescriptor("ellipse",EllipseGraphics),ellipsoid:createPropertyTypeDescriptor("ellipsoid",EllipsoidGraphics),label:createPropertyTypeDescriptor("label",LabelGraphics),model:createPropertyTypeDescriptor("model",ModelGraphics),tileset:createPropertyTypeDescriptor("tileset",Cesium3DTilesetGraphics),orientation:createPropertyDescriptor("orientation"),path:createPropertyTypeDescriptor("path",PathGraphics),plane:createPropertyTypeDescriptor("plane",PlaneGraphics),point:createPropertyTypeDescriptor("point",PointGraphics),polygon:createPropertyTypeDescriptor("polygon",PolygonGraphics),polyline:createPropertyTypeDescriptor("polyline",PolylineGraphics),polylineVolume:createPropertyTypeDescriptor("polylineVolume",PolylineVolumeGraphics),properties:createPropertyTypeDescriptor("properties",PropertyBag),position:createPositionPropertyDescriptor("position"),rectangle:createPropertyTypeDescriptor("rectangle",RectangleGraphics),viewFrom:createPropertyDescriptor("viewFrom"),wall:createPropertyTypeDescriptor("wall",WallGraphics)}),Entity.prototype.isAvailable=function(e){var t=this._availability;return!defined(t)||t.contains(e)},Entity.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,createRawPropertyDescriptor(e,!0))},Entity.prototype.removeProperty=function(e){var t=this._propertyNames.indexOf(e);this._propertyNames.splice(t,1),delete this[e]},Entity.prototype.merge=function(e){this.name=defaultValue(this.name,e.name),this.availability=defaultValue(this.availability,e.availability);for(var t=this._propertyNames,i=defined(e._propertyNames)?e._propertyNames:Object.keys(e),r=i.length,n=0;n<r;n++){var a,o,s=i[n];"parent"!==s&&"name"!==s&&"availability"!==s&&(a=this[s],o=e[s],defined(a)||-1!==t.indexOf(s)||this.addProperty(s),defined(o)&&(defined(a)?defined(a.merge)&&a.merge(o):defined(o.merge)&&defined(o.clone)?this[s]=o.clone():this[s]=o))}};var matrix3Scratch=new Matrix3,positionScratch$6=new Cartesian3,orientationScratch=new Quaternion;Entity.prototype.computeModelMatrix=function(e,t){var i=Property.getValueOrUndefined(this._position,e,positionScratch$6);if(defined(i)){e=Property.getValueOrUndefined(this._orientation,e,orientationScratch);return t=defined(e)?Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(e,matrix3Scratch),i,t):Transforms.eastNorthUpToFixedFrame(i,void 0,t)}},Entity.prototype.computeModelMatrixForHeightReference=function(e,t,i,r,n){var a=Property.getValueOrDefault(t,e,HeightReference$1.NONE),o=Property.getValueOrUndefined(this._position,e,positionScratch$6);if(a===HeightReference$1.NONE||!defined(o)||Cartesian3.equalsEpsilon(o,Cartesian3.ZERO,CesiumMath.EPSILON8))return this.computeModelMatrix(e,n);t=r.cartesianToCartographic(o,cartoScratch$1);a===HeightReference$1.CLAMP_TO_GROUND?t.height=i:t.height+=i;o=r.cartographicToCartesian(t,o),e=Property.getValueOrUndefined(this._orientation,e,orientationScratch);return n=defined(e)?Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(e,matrix3Scratch),o,n):Transforms.eastNorthUpToFixedFrame(o,void 0,n)},Entity.supportsMaterialsforEntitiesOnTerrain=function(e){return GroundPrimitive.supportsMaterials(e)},Entity.supportsPolylinesOnTerrain=function(e){return GroundPolylinePrimitive.isSupported(e)};var defaultMaterial$2=new ColorMaterialProperty(Color.WHITE),defaultShow$1=new ConstantProperty(!0),defaultFill$1=new ConstantProperty(!0),defaultOutline=new ConstantProperty(!1),defaultOutlineColor$3=new ConstantProperty(Color.BLACK),defaultShadows$2=new ConstantProperty(ShadowMode$1.DISABLED),defaultDistanceDisplayCondition$7=new ConstantProperty(new DistanceDisplayCondition),defaultClassificationType$1=new ConstantProperty(ClassificationType$1.BOTH);function GeometryUpdater(e){var t=e.entity,i=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 Event,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=i,this._id=i+"-"+t.id,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Entity.supportsMaterialsforEntitiesOnTerrain(e.scene)}function CallbackProperty(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new Event,this.setCallback(e,t)}Object.defineProperties(GeometryUpdater.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||!defined(this._entity.availability)&&Property.isConstant(this._showProperty)&&Property.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!defined(this._entity.availability)&&Property.isConstant(this._showProperty)&&Property.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}}}),GeometryUpdater.prototype.isOutlineVisible=function(e){var t=this._entity;return defaultValue(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e),!1)},GeometryUpdater.prototype.isFilled=function(e){var t=this._entity;return defaultValue(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e),!1)},GeometryUpdater.prototype.createFillGeometryInstance=DeveloperError.throwInstantiationError,GeometryUpdater.prototype.createOutlineGeometryInstance=DeveloperError.throwInstantiationError,GeometryUpdater.prototype.isDestroyed=function(){return!1},GeometryUpdater.prototype.destroy=function(){destroyObject(this)},GeometryUpdater.prototype._isHidden=function(e,t){t=t.show;return defined(t)&&t.isConstant&&!t.getValue(Iso8601.MINIMUM_VALUE)},GeometryUpdater.prototype._isOnTerrain=function(e,t){return!1},GeometryUpdater.prototype._getIsClosed=function(e){return!0},GeometryUpdater.prototype._isDynamic=DeveloperError.throwInstantiationError,GeometryUpdater.prototype._setStaticOptions=DeveloperError.throwInstantiationError,GeometryUpdater.prototype._onEntityPropertyChanged=function(e,t,i,r){var n,a,o,s;-1!==this._observedPropertyNames.indexOf(t)&&(defined(s=this._entity[this._geometryPropertyName])?(o=!defined(n=s.fill)||!n.isConstant||n.getValue(Iso8601.MINIMUM_VALUE),(t=defined(a=s.outline))&&a.isConstant&&(t=a.getValue(Iso8601.MINIMUM_VALUE)),o||t?(a=s.show,this._isHidden(e,s)?(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)):(this._materialProperty=defaultValue(s.material,defaultMaterial$2),this._fillProperty=defaultValue(n,defaultFill$1),this._showProperty=defaultValue(a,defaultShow$1),this._showOutlineProperty=defaultValue(s.outline,defaultOutline),this._outlineColorProperty=t?defaultValue(s.outlineColor,defaultOutlineColor$3):void 0,this._shadowsProperty=defaultValue(s.shadows,defaultShadows$2),this._distanceDisplayConditionProperty=defaultValue(s.distanceDisplayCondition,defaultDistanceDisplayCondition$7),this._classificationTypeProperty=defaultValue(s.classificationType,defaultClassificationType$1),this._fillEnabled=o,o=this._isOnTerrain(e,s)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof ColorMaterialProperty),t&&o&&(oneTimeWarning(oneTimeWarning.geometryOutlines),t=!1),this._onTerrain=o,this._outlineEnabled=t,this._isDynamic(e,s)?this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this)):(this._setStaticOptions(e,s),this._isClosed=this._getIsClosed(this._options),s=s.outlineWidth,this._outlineWidth=defined(s)?s.getValue(Iso8601.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)))):(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this))):(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)))},GeometryUpdater.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)},Object.defineProperties(CallbackProperty.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),CallbackProperty.prototype.getValue=function(e,t){return this._callback(e,t)},CallbackProperty.prototype.setCallback=function(e,t){var i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},CallbackProperty.prototype.equals=function(e){return this===e||e instanceof CallbackProperty&&this._callback===e._callback&&this._isConstant===e._isConstant};var scratchPosition$7=new Cartesian3,scratchCarto$1=new Cartographic;function TerrainOffsetProperty(e,t,i,r){this._scene=e,this._heightReference=i,this._extrudedHeightReference=r,this._positionProperty=t,this._position=new Cartesian3,this._cartographicPosition=new Cartographic,this._normal=new Cartesian3,this._definitionChanged=new Event,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;var n=this;defined(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){n._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){n._updateClamping()})),!t.isConstant||defined(t=t.getValue(Iso8601.MINIMUM_VALUE,scratchPosition$7))&&!Cartesian3.equals(t,Cartesian3.ZERO)&&defined(e.globe)&&(this._position=Cartesian3.clone(t,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(t,this._normal))}function heightReferenceOnEntityPropertyChanged(e,t,i,r){GeometryUpdater.prototype._onEntityPropertyChanged.call(this,e,t,i,r),-1===this._observedPropertyNames.indexOf(t)||defined(r=this._entity[this._geometryPropertyName])&&(defined(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),defined(t=r.heightReference)&&(r=new CallbackProperty(this._computeCenter.bind(this),!this._dynamic),this._terrainOffsetProperty=new TerrainOffsetProperty(this._scene,r,t)))}Object.defineProperties(TerrainOffsetProperty.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),TerrainOffsetProperty.prototype._updateClamping=function(){defined(this._removeCallbackFunc)&&this._removeCallbackFunc();var i,e,r,n=this._scene,t=n.globe,a=this._position;defined(t)&&!Cartesian3.equals(a,Cartesian3.ZERO)?(i=t.ellipsoid,e=t._surface,a=i.cartesianToCartographic(a,(r=this)._cartographicPosition),defined(t=t.getHeight(a))?this._terrainHeight=t:this._terrainHeight=0,this._removeCallbackFunc=e.updateHeight(a,function(e){var t;n.mode===SceneMode$1.SCENE3D?(t=i.cartesianToCartographic(e,scratchCarto$1),r._terrainHeight=t.height):r._terrainHeight=e.x,r.definitionChanged.raiseEvent()})):this._terrainHeight=0},TerrainOffsetProperty.prototype.getValue=function(e,t){var i=Property.getValueOrDefault(this._heightReference,e,HeightReference$1.NONE),r=Property.getValueOrDefault(this._extrudedHeightReference,e,HeightReference$1.NONE);if(i===HeightReference$1.NONE&&r!==HeightReference$1.RELATIVE_TO_GROUND)return this._position=Cartesian3.clone(Cartesian3.ZERO,this._position),Cartesian3.clone(Cartesian3.ZERO,t);if(this._positionProperty.isConstant)return Cartesian3.multiplyByScalar(this._normal,this._terrainHeight,t);r=this._scene,e=this._positionProperty.getValue(e,scratchPosition$7);if(!defined(e)||Cartesian3.equals(e,Cartesian3.ZERO)||!defined(r.globe))return Cartesian3.clone(Cartesian3.ZERO,t);if(Cartesian3.equalsEpsilon(this._position,e,CesiumMath.EPSILON10))return Cartesian3.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=Cartesian3.clone(e,this._position),this._updateClamping();e=r.globe.ellipsoid.geodeticSurfaceNormal(e,this._normal);return Cartesian3.multiplyByScalar(e,this._terrainHeight,t)},TerrainOffsetProperty.prototype.isDestroyed=function(){return!1},TerrainOffsetProperty.prototype.destroy=function(){return defined(this._removeEventListener)&&this._removeEventListener(),defined(this._removeModeListener)&&this._removeModeListener(),defined(this._removeCallbackFunc)&&this._removeCallbackFunc(),destroyObject(this)};var defaultOffset$a=Cartesian3.ZERO,offsetScratch$9=new Cartesian3,positionScratch$5=new Cartesian3,scratchColor$n=new Color;function BoxGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function BoxGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new BoxGeometryOptions(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function DynamicBoxGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}function ClearCommand(e){e=defaultValue(e,defaultValue.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}defined(Object.create)&&(BoxGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),BoxGeometryUpdater.prototype.constructor=BoxGeometryUpdater),Object.defineProperties(BoxGeometryUpdater.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),BoxGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),a={show:n,distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a),color:void 0,offset:void 0};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$n)),defined(t)||(t=Color.WHITE),a.color=ColorGeometryInstanceAttribute.fromColor(t)),defined(this._options.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$a,offsetScratch$9))),new GeometryInstance({id:i,geometry:BoxGeometry.fromDimensions(this._options),modelMatrix:i.computeModelMatrixForHeightReference(e,i.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:a})},BoxGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$n),n=this._distanceDisplayConditionProperty.getValue(e),n={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),offset:void 0};return defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$a,offsetScratch$9))),new GeometryInstance({id:t,geometry:BoxOutlineGeometry.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:n})},BoxGeometryUpdater.prototype._computeCenter=function(e,t){return Property.getValueOrUndefined(this._entity.position,e,t)},BoxGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.dimensions)||!defined(e.position)||GeometryUpdater.prototype._isHidden.call(this,e,t)},BoxGeometryUpdater.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&Property.isConstant(e.orientation)&&t.dimensions.isConstant&&Property.isConstant(t.outlineWidth))},BoxGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,r.dimensions=t.dimensions.getValue(Iso8601.MINIMUM_VALUE,r.dimensions),r.offsetAttribute=i!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0},BoxGeometryUpdater.prototype._onEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,BoxGeometryUpdater.DynamicGeometryUpdater=DynamicBoxGeometryUpdater,defined(Object.create)&&(DynamicBoxGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicBoxGeometryUpdater.prototype.constructor=DynamicBoxGeometryUpdater),DynamicBoxGeometryUpdater.prototype._isHidden=function(e,t,i){var r=Property.getValueOrUndefined(e.position,i,positionScratch$5),n=this._options.dimensions;return!defined(r)||!defined(n)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DynamicBoxGeometryUpdater.prototype._setOptions=function(e,t,i){var r=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),n=this._options;n.dimensions=Property.getValueOrUndefined(t.dimensions,i,n.dimensions),n.offsetAttribute=r!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0},ClearCommand.ALL=Object.freeze(new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0})),ClearCommand.prototype.execute=function(e,t){e.clear(this,t)};var Axis={X:0,Y:1,Z:2};Axis.Y_UP_TO_Z_UP=Matrix4.fromRotationTranslation(Matrix3.fromRotationX(CesiumMath.PI_OVER_TWO)),Axis.Z_UP_TO_Y_UP=Matrix4.fromRotationTranslation(Matrix3.fromRotationX(-CesiumMath.PI_OVER_TWO)),Axis.X_UP_TO_Z_UP=Matrix4.fromRotationTranslation(Matrix3.fromRotationY(-CesiumMath.PI_OVER_TWO)),Axis.Z_UP_TO_X_UP=Matrix4.fromRotationTranslation(Matrix3.fromRotationY(CesiumMath.PI_OVER_TWO)),Axis.X_UP_TO_Y_UP=Matrix4.fromRotationTranslation(Matrix3.fromRotationZ(CesiumMath.PI_OVER_TWO)),Axis.Y_UP_TO_X_UP=Matrix4.fromRotationTranslation(Matrix3.fromRotationZ(-CesiumMath.PI_OVER_TWO)),Axis.fromName=function(e){return Axis[e]};var Axis$1=Object.freeze(Axis),AttributeType={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"},AttributeType$1=Object.freeze(AttributeType),Cesium3DTileColorBlendMode={HIGHLIGHT:0,REPLACE:1,MIX:2},Cesium3DTileColorBlendMode$1=Object.freeze(Cesium3DTileColorBlendMode),ComponentsPerAttribute={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ClassPerType={SCALAR:void 0,VEC2:Cartesian2,VEC3:Cartesian3,VEC4:Cartesian4,MAT2:Matrix2,MAT3:Matrix3,MAT4:Matrix4};function getBinaryAccessor(e){var t=e.componentType,r="string"==typeof t?ComponentDatatype$1.fromName(t):t,n=ComponentsPerAttribute[e.type],e=ClassPerType[e.type];return{componentsPerAttribute:n,classType:e,createArrayBufferView:function(e,t,i){return ComponentDatatype$1.createArrayBufferView(r,e,t,n*i)}}}var DEFAULT_COLOR_VALUE$3=Color.WHITE,DEFAULT_SHOW_VALUE$3=!0;function Cesium3DTileBatchTable(e,t,i,r,n){this.featuresLength=t,this._translucentFeaturesLength=0,defined(i)&&(s=i.extensions),this._extensions=defaultValue(s,{});var a,o,s=initializeProperties(i);this._properties=s,this._batchTableHierarchy=initializeHierarchy(this,i,r),this._batchTableBinaryProperties=getBinaryProperties(t,s,r),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=[],this._content=e,this._colorChangedCallback=n,0<t&&(n=.5*(e=1/(r=Math.min(t,ContextLimits.maximumTextureSize))),o=.5*(t=1/(a=Math.ceil(t/ContextLimits.maximumTextureSize))),a=new Cartesian2(r,a),o=new Cartesian4(e,n,t,o)),this._textureDimensions=a,this._textureStep=o}function initializeProperties(e){var t,i={};if(!defined(e))return i;for(t in e)e.hasOwnProperty(t)&&"HIERARCHY"!==t&&"extensions"!==t&&"extras"!==t&&(i[t]=clone$1(e[t],!0));return i}function initializeHierarchy(e,t,i){if(defined(t)){var r=e._extensions["3DTILES_batch_table_hierarchy"],t=t.HIERARCHY;if(defined(t)&&(Cesium3DTileBatchTable._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=e._extensions["3DTILES_batch_table_hierarchy"]=t),defined(r))return initializeHierarchyValues(r,i)}}function initializeHierarchyValues(e,t){var i,r,n=e.instancesLength,a=e.classes,o=e.classIds,s=e.parentCounts,e=e.parentIds,l=n;if(defined(o.byteOffset)&&(o.componentType=defaultValue(o.componentType,ComponentDatatype$1.UNSIGNED_SHORT),o.type=AttributeType$1.SCALAR,o=getBinaryAccessor(o).createArrayBufferView(t.buffer,t.byteOffset+o.byteOffset,n)),defined(s))for(defined(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,ComponentDatatype$1.UNSIGNED_SHORT),s.type=AttributeType$1.SCALAR,s=getBinaryAccessor(s).createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,n)),r=new Uint16Array(n),u=l=0;u<n;++u)r[u]=l,l+=s[u];defined(e)&&defined(e.byteOffset)&&(e.componentType=defaultValue(e.componentType,ComponentDatatype$1.UNSIGNED_SHORT),e.type=AttributeType$1.SCALAR,e=getBinaryAccessor(e).createArrayBufferView(t.buffer,t.byteOffset+e.byteOffset,l));for(var c=a.length,u=0;u<c;++u){var d=a[u].length,h=a[u].instances,d=getBinaryProperties(d,h,t);a[u].instances=combine$2(d,h)}var p=arrayFill(new Array(c),0),m=new Uint16Array(n);for(u=0;u<n;++u)i=o[u],m[u]=p[i],++p[i];return{classes:a,classIds:o,classIndexes:m,parentCounts:s,parentIndexes:r,parentIds:e}}function getBinaryProperties(e,t,i){var r,n;for(n in t)if(t.hasOwnProperty(n)){var a=t[n],o=a.byteOffset;if(defined(o)){var s=a.componentType,l=a.type;if(!defined(s))throw new RuntimeError("componentType is required.");if(!defined(l))throw new RuntimeError("type is required.");if(!defined(i))throw new RuntimeError("Property "+n+" requires a batch table binary.");s=getBinaryAccessor(a),l=s.componentsPerAttribute,a=s.classType,o=s.createArrayBufferView(i.buffer,i.byteOffset+o,e);(r=!defined(r)?{}:r)[n]={typedArray:o,componentCount:l,type:a}}}return r}function getByteLength(e){e=e._textureDimensions;return e.x*e.y*4}function getBatchValues(e){var t;return defined(e._batchValues)||(t=getByteLength(e),arrayFill(t=new Uint8Array(t),255),e._batchValues=t),e._batchValues}function getShowAlphaProperties(e){var t;return defined(e._showAlphaProperties)||(t=2*e.featuresLength,arrayFill(t=new Uint8Array(t),255),e._showAlphaProperties=t),e._showAlphaProperties}Cesium3DTileBatchTable._deprecationWarning=deprecationWarning,Object.defineProperties(Cesium3DTileBatchTable.prototype,{memorySizeInBytes:{get:function(){var e=0;return defined(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),defined(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}}}),Cesium3DTileBatchTable.getBinaryProperties=function(e,t,i){return getBinaryProperties(e,t,i)},Cesium3DTileBatchTable.prototype.setShow=function(e,t){var i,r,n;t&&!defined(this._showAlphaProperties)||(i=getShowAlphaProperties(this))[r=2*e]!==(n=t?255:0)&&(i[r]=n,getBatchValues(this)[4*e+3]=t?i[1+r]:0,this._batchValuesDirty=!0)},Cesium3DTileBatchTable.prototype.setAllShow=function(e){for(var t=this.featuresLength,i=0;i<t;++i)this.setShow(i,e)},Cesium3DTileBatchTable.prototype.getShow=function(e){return!defined(this._showAlphaProperties)||255===this._showAlphaProperties[2*e]};var scratchColorBytes$1=new Array(4);Cesium3DTileBatchTable.prototype.setColor=function(e,t){var i,r,n,a,o,s,l;Color.equals(t,DEFAULT_COLOR_VALUE$3)&&!defined(this._batchValues)||(l=(s=t.toBytes(scratchColorBytes$1))[3],i=getBatchValues(this),r=4*e,n=getShowAlphaProperties(this),a=2*e,i[r]===s[0]&&i[1+r]===s[1]&&i[2+r]===s[2]&&n[1+a]===l||(i[r]=s[0],i[1+r]=s[1],i[2+r]=s[2],o=255!==n[1+a],s=0!==n[a],i[3+r]=s?l:0,(l=255!==(n[1+a]=l))&&!o?++this._translucentFeaturesLength:!l&&o&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,defined(this._colorChangedCallback)&&this._colorChangedCallback(e,t)))},Cesium3DTileBatchTable.prototype.setAllColor=function(e){for(var t=this.featuresLength,i=0;i<t;++i)this.setColor(i,e)},Cesium3DTileBatchTable.prototype.getColor=function(e,t){if(!defined(this._batchValues))return Color.clone(DEFAULT_COLOR_VALUE$3,t);var i=this._batchValues,r=4*e,n=this._showAlphaProperties;return Color.fromBytes(i[r],i[1+r],i[2+r],n[1+2*e],t)},Cesium3DTileBatchTable.prototype.getPickColor=function(e){return this._pickIds[e]};var scratchColor$m=new Color;function getBinaryProperty(e,t){var i=e.typedArray,r=e.componentCount;return 1===r?i[t]:e.type.unpack(i,t*r)}function setBinaryProperty(e,t,i){var r=e.typedArray,n=e.componentCount;1===n?r[t]=i:e.type.pack(i,r,t*n)}Cesium3DTileBatchTable.prototype.applyStyle=function(e){if(!defined(e))return this.setAllColor(DEFAULT_COLOR_VALUE$3),void this.setAllShow(DEFAULT_SHOW_VALUE$3);for(var t=this._content,i=this.featuresLength,r=0;r<i;++r){var n=t.getFeature(r),a=defined(e.color)?e.color.evaluateColor(n,scratchColor$m):DEFAULT_COLOR_VALUE$3,n=defined(e.show)?e.show.evaluate(n):DEFAULT_SHOW_VALUE$3;this.setColor(r,a),this.setShow(r,n)}};var scratchVisited=[],scratchStack$1=[],marker=0;function traverseHierarchyMultipleParents(e,t,i){var r=e.classIds,n=e.parentCounts,a=e.parentIds,o=e.parentIndexes,r=r.length,s=scratchVisited;s.length=Math.max(s.length,r);var l=++marker,c=scratchStack$1;for(c.length=0,c.push(t);0<c.length;)if(s[t=c.pop()]!==l){s[t]=l;var u=i(e,t);if(defined(u))return u;for(var d=n[t],h=o[t],p=0;p<d;++p){var m=a[h+p];m!==t&&c.push(m)}}}function traverseHierarchySingleParent(e,t,i){for(var r=!0;r;){var n=i(e,t);if(defined(n))return n;n=e.parentIds[t],r=n!==t;t=n}}function traverseHierarchy(e,t,i){var r=e.parentCounts;return defined(e.parentIds)?(defined(r)?traverseHierarchyMultipleParents:traverseHierarchySingleParent)(e,t,i):i(e,t)}function hasPropertyInHierarchy(e,t,i){t=traverseHierarchy(e._batchTableHierarchy,t,function(e,t){t=e.classIds[t];if(defined(e.classes[t].instances[i]))return!0});return defined(t)}function getPropertyNamesInHierarchy(e,t,n){traverseHierarchy(e._batchTableHierarchy,t,function(e,t){var i,t=e.classIds[t],r=e.classes[t].instances;for(i in r)r.hasOwnProperty(i)&&-1===n.indexOf(i)&&n.push(i)})}function getHierarchyProperty(e,t,r){return traverseHierarchy(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],i=e.classes[i],t=e.classIndexes[t],i=i.instances[r];if(defined(i))return defined(i.typedArray)?getBinaryProperty(i,t):clone$1(i[t],!0)})}function setHierarchyProperty(e,t,r,n){t=traverseHierarchy(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],i=e.classes[i],t=e.classIndexes[t],i=i.instances[r];if(defined(i))return defined(i.typedArray)?setBinaryProperty(i,t,n):i[t]=clone$1(n,!0),!0});return defined(t)}function getGlslComputeSt(e){return 1===e._textureDimensions.y?"uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n return vec2(centerX + (batchId * stepX), 0.5); \n} \n":"uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n float stepY = tile_textureStep.z; \n float centerY = tile_textureStep.w; \n float xId = mod(batchId, tile_textureDimensions.x); \n float yId = floor(batchId / tile_textureDimensions.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}function getDefaultShader(e,t){return e=ShaderSource.replaceMain(e,"tile_main"),t?e+"uniform float tile_colorBlend; \nvoid tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n} \n":e+"void tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n} \n"}function replaceDiffuseTextureCalls(e,t){for(var i,r="texture2D("+t,n=e.indexOf(r,0);-1<n;){for(var a=0,o=n;o<e.length;++o){var s=e.charAt(o);if("("===s)++a;else if(")"===s&&0===--a){i=o+1;break}}var l="tile_diffuse_final("+e.slice(n,i)+", tile_diffuse)",n=(e=e.slice(0,n)+l+e.slice(i)).indexOf(r,n+l.length)}return e}function modifyDiffuse(e,t,i){if(!defined(t))return getDefaultShader(e,i);var r=new RegExp("(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+"+t+";"),n=e.match(r);if(!defined(n))return getDefaultShader(e,i);var a=n[0],o=n[2];e=(e=ShaderSource.replaceMain(e,"tile_main")).replace(a,"");var s;return"vec3"===o||"vec4"===o?(s="vec3"===o?"vec4("+t+", 1.0)":t,n="vec3"===o?"tile_diffuse.xyz":"tile_diffuse",r=new RegExp(t,"g"),e=e.replace(r,n),s=" vec4 source = "+s+"; \n tile_diffuse = tile_diffuse_final(source, tile_featureColor); \n tile_main(); \n"):"sampler2D"===o&&(e=replaceDiffuseTextureCalls(e,t),s=" tile_diffuse = tile_featureColor; \n tile_main(); \n"),e="uniform float tile_colorBlend; \nvec4 tile_diffuse = vec4(1.0); \nbool isWhite(vec3 color) \n{ \n return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \n} \nvec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \n{ \n vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \n vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \n return vec4(diffuse.rgb, sourceDiffuse.a); \n} \n"+a+"\n"+e+"\nvoid tile_color(vec4 tile_featureColor) \n{ \n"+s,i&&(e+=" tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n"),e+="} \n"}function getColorBlend(e){var t=e._content.tileset,e=t.colorBlendMode,t=t.colorBlendAmount;return e===Cesium3DTileColorBlendMode$1.HIGHLIGHT?0:e===Cesium3DTileColorBlendMode$1.REPLACE?1:e===Cesium3DTileColorBlendMode$1.MIX?CesiumMath.clamp(t,CesiumMath.EPSILON4,1):void 0}Cesium3DTileBatchTable.prototype.isClass=function(e,i){var t=this._batchTableHierarchy;return!!defined(t)&&defined(traverseHierarchy(t,e,function(e,t){t=e.classIds[t];if(e.classes[t].name===i)return!0}))},Cesium3DTileBatchTable.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t},Cesium3DTileBatchTable.prototype.getExactClassName=function(e){var t=this._batchTableHierarchy;if(defined(t)){e=t.classIds[e];return t.classes[e].name}},Cesium3DTileBatchTable.prototype.hasProperty=function(e,t){return defined(this._properties[t])||defined(this._batchTableHierarchy)&&hasPropertyInHierarchy(this,e,t)},Cesium3DTileBatchTable.prototype.getPropertyNames=function(e,t){(t=defined(t)?t:[]).length=0;var i=Object.keys(this._properties);return t.push.apply(t,i),defined(this._batchTableHierarchy)&&getPropertyNamesInHierarchy(this,e,t),t},Cesium3DTileBatchTable.prototype.getProperty=function(e,t){if(defined(this._batchTableBinaryProperties)){var i=this._batchTableBinaryProperties[t];if(defined(i))return getBinaryProperty(i,e)}i=this._properties[t];if(defined(i))return clone$1(i[e],!0);if(defined(this._batchTableHierarchy)){t=getHierarchyProperty(this,e,t);if(defined(t))return t}},Cesium3DTileBatchTable.prototype.setProperty=function(e,t,i){var r=this.featuresLength;if(defined(this._batchTableBinaryProperties)){var n=this._batchTableBinaryProperties[t];if(defined(n))return void setBinaryProperty(n,e,i)}defined(this._batchTableHierarchy)&&setHierarchyProperty(this,e,t,i)||(defined(n=this._properties[t])||(this._properties[t]=new Array(r),n=this._properties[t]),n[e]=clone$1(i,!0))},Cesium3DTileBatchTable.prototype.getVertexShaderCallback=function(i,r,n){if(0!==this.featuresLength){var a=this;return function(e){var t,e=modifyDiffuse(e,n,!1);return 0<ContextLimits.maximumVertexTextureImageUnits?(t="",i&&(t+="uniform bool tile_translucentCommand; \n"),t+="uniform sampler2D tile_batchTexture; \nvarying vec4 tile_featureColor; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec2 st = computeSt("+r+"); \n vec4 featureProperties = texture2D(tile_batchTexture, st); \n tile_color(featureProperties); \n float show = ceil(featureProperties.a); \n gl_Position *= show; \n",i&&(t+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n gl_Position *= 0.0; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n gl_Position *= 0.0; \n } \n } \n"),t+=" tile_featureColor = featureProperties; \n tile_featureSt = st; \n}"):t="varying vec2 tile_featureSt; \nvoid main() \n{ \n tile_color(vec4(1.0)); \n tile_featureSt = computeSt("+r+"); \n}",e+"\n"+getGlslComputeSt(a)+t}}},Cesium3DTileBatchTable.prototype.getFragmentShaderCallback=function(t,i,r){if(0!==this.featuresLength)return function(e){return e=modifyDiffuse(e,i,!0),0<ContextLimits.maximumVertexTextureImageUnits?(e+="uniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_color(tile_featureColor); \n",r&&(e+=" gl_FragColor.rgb *= gl_FragColor.a; \n"),e+="}"):(t&&(e+="uniform bool tile_translucentCommand; \n"),e+="uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n",t&&(e+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n discard; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n discard; \n } \n } \n"),e+=" tile_color(featureProperties); \n",r&&(e+=" gl_FragColor.rgb *= gl_FragColor.a; \n"),e+="} \n"),e}},Cesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){return e=ShaderSource.replaceMain(e,"tile_main"),0<ContextLimits.maximumVertexTextureImageUnits?e+="uniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_main(); \n gl_FragColor = tile_featureColor; \n gl_FragColor.rgb *= gl_FragColor.a; \n}":e+="uniform sampler2D tile_batchTexture; \nuniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n gl_FragColor = featureProperties; \n gl_FragColor.rgb *= gl_FragColor.a; \n} \n",e}},Cesium3DTileBatchTable.prototype.getUniformMapCallback=function(){if(0!==this.featuresLength){var t=this;return function(e){return combine$2(e,{tile_batchTexture:function(){return defaultValue(t._batchTexture,t._defaultTexture)},tile_textureDimensions:function(){return t._textureDimensions},tile_textureStep:function(){return t._textureStep},tile_colorBlend:function(){return getColorBlend(t)},tile_pickTexture:function(){return t._pickTexture}})}}},Cesium3DTileBatchTable.prototype.getPickId=function(){return"texture2D(tile_pickTexture, tile_featureSt)"};var StyleCommandsNeeded={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};function getStyleCommandsNeeded(e){var t=e._translucentFeaturesLength;return 0===t?StyleCommandsNeeded.ALL_OPAQUE:t===e.featuresLength?StyleCommandsNeeded.ALL_TRANSLUCENT:StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT}function deriveCommand(e){var e=DrawCommand.shallowClone(e),t=e.pass===Pass$1.TRANSLUCENT;return e.uniformMap=defined(e.uniformMap)?e.uniformMap:{},e.uniformMap.tile_translucentCommand=function(){return t},e}function deriveTranslucentCommand$1(e){var t=DrawCommand.shallowClone(e);return t.pass=Pass$1.TRANSLUCENT,t.renderState=getTranslucentRenderState$2(e.renderState),t}function deriveOpaqueCommand(e){var t=DrawCommand.shallowClone(e);return t.renderState=getOpaqueRenderState(e.renderState),t}function getLogDepthPolygonOffsetFragmentShaderProgram(e,t){var i,r=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");return defined(r)||((i=t.fragmentShaderSource.clone()).defines=defined(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),i.sources.unshift("#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"),r=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})),r}function deriveZBackfaceCommand(e,t){var i=DrawCommand.shallowClone(t),r=clone$1(i.renderState,!0);r.cull.enabled=!0,r.cull.face=CullFace$1.FRONT,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r.polygonOffset={enabled:!0,factor:5,units:5},r.stencilTest=StencilConstants$1.setCesium3DTileBit(),r.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK,i.renderState=RenderState.fromCache(r),i.castShadows=!1,i.receiveShadows=!1,i.uniformMap=clone$1(t.uniformMap);var n=new Cartesian2(5,5);return i.uniformMap.u_polygonOffset=function(){return n},i.shaderProgram=getLogDepthPolygonOffsetFragmentShaderProgram(e,t.shaderProgram),i}function deriveStencilCommand(e,t){var i=DrawCommand.shallowClone(e),e=clone$1(i.renderState,!0);return e.stencilTest.enabled=!0,e.stencilTest.mask=StencilConstants$1.SKIP_LOD_MASK,e.stencilTest.reference=StencilConstants$1.CESIUM_3D_TILE_MASK|t<<StencilConstants$1.SKIP_LOD_BIT_SHIFT,e.stencilTest.frontFunction=StencilFunction$1.GREATER_OR_EQUAL,e.stencilTest.frontOperation.zPass=StencilOperation$1.REPLACE,e.stencilTest.backFunction=StencilFunction$1.GREATER_OR_EQUAL,e.stencilTest.backOperation.zPass=StencilOperation$1.REPLACE,e.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK|StencilConstants$1.SKIP_LOD_MASK,i.renderState=RenderState.fromCache(e),i}function getLastSelectionDepth(e){return(e.renderState.stencilTest.reference&StencilConstants$1.SKIP_LOD_MASK)>>>StencilConstants$1.SKIP_LOD_BIT_SHIFT}function getTranslucentRenderState$2(e){e=clone$1(e,!0);return e.cull.enabled=!1,e.depthTest.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND,e.stencilTest=StencilConstants$1.setCesium3DTileBit(),e.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK,RenderState.fromCache(e)}function getOpaqueRenderState(e){e=clone$1(e,!0);return e.stencilTest=StencilConstants$1.setCesium3DTileBit(),e.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK,RenderState.fromCache(e)}function createTexture$2(e,t,i){e=e._textureDimensions;return new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{width:e.x,height:e.y,arrayBufferView:i},flipY:!1,sampler:Sampler.NEAREST})}function createPickTexture(e,t){var i=e.featuresLength;if(!defined(e._pickTexture)&&0<i){for(var r=e._pickIds,n=getByteLength(e),a=new Uint8Array(n),o=e._content,s=0;s<i;++s){var l=t.createPickId(o.getFeature(s));r.push(l);var c=l.color,l=4*s;a[l]=Color.floatToByte(c.red),a[1+l]=Color.floatToByte(c.green),a[2+l]=Color.floatToByte(c.blue),a[3+l]=Color.floatToByte(c.alpha)}e._pickTexture=createTexture$2(e,t,a),o.tileset._statistics.batchTableByteLength+=e._pickTexture.sizeInBytes}}function updateBatchTexture(e){var t=e._textureDimensions;e._batchTexture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function Cesium3DTileFeature(e,t){this._content=e,this._batchId=t,this._color=void 0}function Cesium3DTileFeatureTable(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function getTypedArrayFromBinary(e,t,i,r,n,a){var o=e._cachedTypedArrays,s=o[t];return defined(s)||(s=ComponentDatatype$1.createArrayBufferView(i,e.buffer.buffer,e.buffer.byteOffset+a,n*r),o[t]=s),s}function getTypedArrayFromArray(e,t,i,r){var n=e._cachedTypedArrays,e=n[t];return defined(e)||(e=ComponentDatatype$1.createTypedArray(i,r),n[t]=e),e}function addToArray(e,t,i){if(i=defaultValue(i,!1)){i=e.indexOf(t);if(-1<i)return i}return e.push(t),e.length-1}function hasExtension(e,t){return defined(e.extensionsUsed)&&0<=e.extensionsUsed.indexOf(t)}function ForEach(){}function numberOfComponentsForType(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}}function getAccessorByteStride(e,t){var i=t.bufferView;if(defined(i)){i=e.bufferViews[i];if(defined(i.byteStride)&&0<i.byteStride)return i.byteStride}return ComponentDatatype$1.getSizeInBytes(t.componentType)*numberOfComponentsForType(t.type)}function addDefaults(i){ForEach.accessor(i,function(e){defined(e.bufferView)&&(e.byteOffset=defaultValue(e.byteOffset,0))}),ForEach.bufferView(i,function(e){defined(e.buffer)&&(e.byteOffset=defaultValue(e.byteOffset,0))}),ForEach.mesh(i,function(e){ForEach.meshPrimitive(e,function(e){e.mode=defaultValue(e.mode,WebGLConstants$1.TRIANGLES),defined(e.material)||(defined(i.materials)||(i.materials=[]),e.material=addToArray(i.materials,{name:"default"}))})}),ForEach.accessorContainingVertexAttributeData(i,function(e){var t=i.accessors[e],e=t.bufferView;t.normalized=defaultValue(t.normalized,!1),defined(e)&&((e=i.bufferViews[e]).byteStride=getAccessorByteStride(i,t),e.target=WebGLConstants$1.ARRAY_BUFFER)}),ForEach.accessorContainingIndexData(i,function(e){e=i.accessors[e].bufferView;defined(e)&&(i.bufferViews[e].target=WebGLConstants$1.ELEMENT_ARRAY_BUFFER)}),ForEach.material(i,function(e){var t=defaultValue(e.extensions,defaultValue.EMPTY_OBJECT),i=t.KHR_materials_common;if(defined(i)){var r=i.technique,n=defined(i.values)?i.values:{};return(i.values=n).ambient=defined(n.ambient)?n.ambient:[0,0,0,1],n.emission=defined(n.emission)?n.emission:[0,0,0,1],n.transparency=defaultValue(n.transparency,1),n.transparent=defaultValue(n.transparent,!1),n.doubleSided=defaultValue(n.doubleSided,!1),void("CONSTANT"!==r&&(n.diffuse=defined(n.diffuse)?n.diffuse:[0,0,0,1],"LAMBERT"!==r&&(n.specular=defined(n.specular)?n.specular:[0,0,0,1],n.shininess=defaultValue(n.shininess,0))))}e.emissiveFactor=defaultValue(e.emissiveFactor,[0,0,0]),e.alphaMode=defaultValue(e.alphaMode,"OPAQUE"),e.doubleSided=defaultValue(e.doubleSided,!1),"MASK"===e.alphaMode&&(e.alphaCutoff=defaultValue(e.alphaCutoff,.5)),defined(t.KHR_techniques_webgl)&&ForEach.materialValue(e,function(e){defined(e.index)&&addTextureDefaults(e)}),addTextureDefaults(e.emissiveTexture),addTextureDefaults(e.normalTexture),addTextureDefaults(e.occlusionTexture);e=e.pbrMetallicRoughness;defined(e)&&(e.baseColorFactor=defaultValue(e.baseColorFactor,[1,1,1,1]),e.metallicFactor=defaultValue(e.metallicFactor,1),e.roughnessFactor=defaultValue(e.roughnessFactor,1),addTextureDefaults(e.baseColorTexture),addTextureDefaults(e.metallicRoughnessTexture));t=t.pbrSpecularGlossiness;defined(t)&&(t.diffuseFactor=defaultValue(t.diffuseFactor,[1,1,1,1]),t.specularFactor=defaultValue(t.specularFactor,[1,1,1]),t.glossinessFactor=defaultValue(t.glossinessFactor,1),addTextureDefaults(t.specularGlossinessTexture))}),ForEach.animation(i,function(e){ForEach.animationSampler(e,function(e){e.interpolation=defaultValue(e.interpolation,"LINEAR")})});var r=getAnimatedNodes(i);return ForEach.node(i,function(e,t){defined(r[t])||defined(e.translation)||defined(e.rotation)||defined(e.scale)?(e.translation=defaultValue(e.translation,[0,0,0]),e.rotation=defaultValue(e.rotation,[0,0,0,1]),e.scale=defaultValue(e.scale,[1,1,1])):e.matrix=defaultValue(e.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),ForEach.sampler(i,function(e){e.wrapS=defaultValue(e.wrapS,WebGLConstants$1.REPEAT),e.wrapT=defaultValue(e.wrapT,WebGLConstants$1.REPEAT)}),defined(i.scenes)&&!defined(i.scene)&&(i.scene=0),i}function getAnimatedNodes(e){var i={};return ForEach.animation(e,function(e){ForEach.animationChannel(e,function(e){var t=e.target,e=t.node,t=t.path;"translation"!==t&&"rotation"!==t&&"scale"!==t||(i[e]=!0)})}),i}function addTextureDefaults(e){defined(e)&&(e.texCoord=defaultValue(e.texCoord,0))}function addPipelineExtras(e){return ForEach.shader(e,function(e){addExtras(e)}),ForEach.buffer(e,function(e){addExtras(e)}),ForEach.image(e,function(e){addExtras(e),ForEach.compressedImage(e,function(e){addExtras(e)})}),addExtras(e),e}function addExtras(e){e.extras=defined(e.extras)?e.extras:{},e.extras._pipeline=defined(e.extras._pipeline)?e.extras._pipeline:{}}function removeExtensionsRequired(e,t){var i=e.extensionsRequired;defined(i)&&(0<=(t=i.indexOf(t))&&i.splice(t,1),0===i.length&&delete e.extensionsRequired)}function removeExtensionsUsed(e,t){var i,r=e.extensionsUsed;defined(r)&&(0<=(i=r.indexOf(t))&&r.splice(i,1),removeExtensionsRequired(e,t),0===r.length&&delete e.extensionsUsed)}Cesium3DTileBatchTable.prototype.addDerivedCommands=function(e,t){for(var i=e.commandList,r=i.length,n=this._content._tile,a=n._finalResolution,o=n.tileset,s=o._skipLevelOfDetail&&o._hasMixedContent&&e.context.stencilBuffer,l=getStyleCommandsNeeded(this),c=t;c<r;++c){var u=i[c],d=u.derivedCommands.tileset;defined(d)&&!u.dirty||((u.derivedCommands.tileset=d={}).originalCommand=deriveCommand(u),u.dirty=!1);var h=d.originalCommand;l!==StyleCommandsNeeded.ALL_OPAQUE&&u.pass!==Pass$1.TRANSLUCENT&&(defined(d.translucent)||(d.translucent=deriveTranslucentCommand$1(h))),l!==StyleCommandsNeeded.ALL_TRANSLUCENT&&u.pass!==Pass$1.TRANSLUCENT&&(defined(d.opaque)||(d.opaque=deriveOpaqueCommand(h)),s&&(a||(defined(d.zback)||(d.zback=deriveZBackfaceCommand(e.context,h)),o._backfaceCommands.push(d.zback)),defined(d.stencil)&&n._selectionDepth===getLastSelectionDepth(d.stencil)||(u.renderState.depthMask?d.stencil=deriveStencilCommand(h,n._selectionDepth):d.stencil=d.opaque)));var p=s?d.stencil:d.opaque,d=d.translucent;u.pass!==Pass$1.TRANSLUCENT?(l===StyleCommandsNeeded.ALL_OPAQUE&&(i[c]=p),l===StyleCommandsNeeded.ALL_TRANSLUCENT&&(i[c]=d),l===StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT&&(i[c]=p,i.push(d))):i[c]=h}},Cesium3DTileBatchTable.prototype.update=function(e,t){var i=t.context;this._defaultTexture=i.defaultTexture;t=t.passes;(t.pick||t.postProcess)&&createPickTexture(this,i),this._batchValuesDirty&&(this._batchValuesDirty=!1,defined(this._batchTexture)||(this._batchTexture=createTexture$2(this,i,this._batchValues),e._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes),updateBatchTexture(this))},Cesium3DTileBatchTable.prototype.isDestroyed=function(){return!1},Cesium3DTileBatchTable.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)},Object.defineProperties(Cesium3DTileFeature.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 defined(this._color)||(this._color=new Color),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}}),Cesium3DTileFeature.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},Cesium3DTileFeature.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},Cesium3DTileFeature.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},Cesium3DTileFeature.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},Cesium3DTileFeature.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},Cesium3DTileFeature.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},Cesium3DTileFeature.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},Cesium3DTileFeatureTable.prototype.getGlobalProperty=function(e,t,i){var r=this.json[e];if(defined(r))return defined(r.byteOffset)?getTypedArrayFromBinary(this,e,t=defaultValue(t,ComponentDatatype$1.UNSIGNED_INT),i=defaultValue(i,1),1,r.byteOffset):r},Cesium3DTileFeatureTable.prototype.getPropertyArray=function(e,t,i){var r=this.json[e];if(defined(r))return defined(r.byteOffset)?getTypedArrayFromBinary(this,e,t=defined(r.componentType)?ComponentDatatype$1.fromName(r.componentType):t,i,this.featuresLength,r.byteOffset):getTypedArrayFromArray(this,e,t,r)},Cesium3DTileFeatureTable.prototype.getProperty=function(e,t,i,r,n){if(defined(this.json[e])){var a=this.getPropertyArray(e,t,i);if(1===i)return a[r];for(var o=0;o<i;++o)n[o]=a[i*r+o];return n}},ForEach.objectLegacy=function(e,t){if(defined(e))for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){i=t(e[i],i);if(defined(i))return i}},ForEach.object=function(e,t){if(defined(e))for(var i=e.length,r=0;r<i;r++){var n=t(e[r],r);if(defined(n))return n}},ForEach.topLevel=function(e,t,i){t=e[t];return defined(t)&&!Array.isArray(t)?ForEach.objectLegacy(t,i):ForEach.object(t,i)},ForEach.accessor=function(e,t){return ForEach.topLevel(e,"accessors",t)},ForEach.accessorWithSemantic=function(e,i,r){var n={};return ForEach.mesh(e,function(e){return ForEach.meshPrimitive(e,function(e){var t=ForEach.meshPrimitiveAttribute(e,function(e,t){if(0===t.indexOf(i)&&!defined(n[e])){n[e]=!0;e=r(e);if(defined(e))return e}});return defined(t)?t:ForEach.meshPrimitiveTarget(e,function(e){return ForEach.meshPrimitiveTargetAttribute(e,function(e,t){if(0===t.indexOf(i)&&!defined(n[e])){n[e]=!0;e=r(e);if(defined(e))return e}})})})})},ForEach.accessorContainingVertexAttributeData=function(e,i){var r={};return ForEach.mesh(e,function(e){return ForEach.meshPrimitive(e,function(e){var t=ForEach.meshPrimitiveAttribute(e,function(e){if(!defined(r[e])){r[e]=!0;e=i(e);if(defined(e))return e}});return defined(t)?t:ForEach.meshPrimitiveTarget(e,function(e){return ForEach.meshPrimitiveTargetAttribute(e,function(e){if(!defined(r[e])){r[e]=!0;e=i(e);if(defined(e))return e}})})})})},ForEach.accessorContainingIndexData=function(e,t){var i={};return ForEach.mesh(e,function(e){return ForEach.meshPrimitive(e,function(e){e=e.indices;if(defined(e)&&!defined(i[e])){i[e]=!0;e=t(e);if(defined(e))return e}})})},ForEach.animation=function(e,t){return ForEach.topLevel(e,"animations",t)},ForEach.animationChannel=function(e,t){e=e.channels;return ForEach.object(e,t)},ForEach.animationSampler=function(e,t){e=e.samplers;return ForEach.object(e,t)},ForEach.buffer=function(e,t){return ForEach.topLevel(e,"buffers",t)},ForEach.bufferView=function(e,t){return ForEach.topLevel(e,"bufferViews",t)},ForEach.camera=function(e,t){return ForEach.topLevel(e,"cameras",t)},ForEach.image=function(e,t){return ForEach.topLevel(e,"images",t)},ForEach.compressedImage=function(e,t){if(defined(e.extras)){var i,r=e.extras.compressedImage3DTiles;for(i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var n=t(r[i],i);if(defined(n))return n}}},ForEach.material=function(e,t){return ForEach.topLevel(e,"materials",t)},ForEach.materialValue=function(e,t){var i,r=e.values;for(i in r=defined(e.extensions)&&defined(e.extensions.KHR_techniques_webgl)?e.extensions.KHR_techniques_webgl.values:r)if(Object.prototype.hasOwnProperty.call(r,i)){var n=t(r[i],i);if(defined(n))return n}},ForEach.mesh=function(e,t){return ForEach.topLevel(e,"meshes",t)},ForEach.meshPrimitive=function(e,t){var i=e.primitives;if(defined(i))for(var r=i.length,n=0;n<r;n++){var a=t(i[n],n);if(defined(a))return a}},ForEach.meshPrimitiveAttribute=function(e,t){var i,r=e.attributes;for(i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var n=t(r[i],i);if(defined(n))return n}},ForEach.meshPrimitiveTarget=function(e,t){var i=e.targets;if(defined(i))for(var r=i.length,n=0;n<r;++n){var a=t(i[n],n);if(defined(a))return a}},ForEach.meshPrimitiveTargetAttribute=function(e,t){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){i=t(e[i],i);if(defined(i))return i}},ForEach.node=function(e,t){return ForEach.topLevel(e,"nodes",t)},ForEach.nodeInTree=function(e,t,i){var r=e.nodes;if(defined(r))for(var n=t.length,a=0;a<n;a++){var o=t[a],s=r[o];if(defined(s)){o=i(s,o);if(defined(o))return o;s=s.children;if(defined(s)&&defined(o=ForEach.nodeInTree(e,s,i)))return o}}},ForEach.nodeInScene=function(e,t,i){t=t.nodes;if(defined(t))return ForEach.nodeInTree(e,t,i)},ForEach.program=function(e,t){return hasExtension(e,"KHR_techniques_webgl")?ForEach.object(e.extensions.KHR_techniques_webgl.programs,t):ForEach.topLevel(e,"programs",t)},ForEach.sampler=function(e,t){return ForEach.topLevel(e,"samplers",t)},ForEach.scene=function(e,t){return ForEach.topLevel(e,"scenes",t)},ForEach.shader=function(e,t){return hasExtension(e,"KHR_techniques_webgl")?ForEach.object(e.extensions.KHR_techniques_webgl.shaders,t):ForEach.topLevel(e,"shaders",t)},ForEach.skin=function(e,t){return ForEach.topLevel(e,"skins",t)},ForEach.skinJoint=function(e,t){var i=e.joints;if(defined(i))for(var r=i.length,n=0;n<r;n++){var a=t(i[n]);if(defined(a))return a}},ForEach.techniqueAttribute=function(e,t){var i,r=e.attributes;for(i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var n=t(r[i],i);if(defined(n))return n}},ForEach.techniqueUniform=function(e,t){var i,r=e.uniforms;for(i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var n=t(r[i],i);if(defined(n))return n}},ForEach.techniqueParameter=function(e,t){var i,r=e.parameters;for(i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var n=t(r[i],i);if(defined(n))return n}},ForEach.technique=function(e,t){return hasExtension(e,"KHR_techniques_webgl")?ForEach.object(e.extensions.KHR_techniques_webgl.techniques,t):ForEach.topLevel(e,"techniques",t)},ForEach.texture=function(e,t){return ForEach.topLevel(e,"textures",t)};var sizeOfUint32$6=4;function parseGlb(e){if("glTF"!==getMagic(e))throw new RuntimeError("File is not valid binary glTF");var t=readHeader(e,0,5),i=t[1];if(1!==i&&2!==i)throw new RuntimeError("Binary glTF version is not 1 or 2");return(1===i?parseGlbVersion1:parseGlbVersion2)(e,t)}function readHeader(e,t,i){for(var r=new DataView(e.buffer),n=new Array(i),a=0;a<i;++a)n[a]=r.getUint32(e.byteOffset+t+a*sizeOfUint32$6,!0);return n}function parseGlbVersion1(e,t){var i=t[2],r=t[3];if(0!==t[4])throw new RuntimeError("Binary glTF scene format is not JSON");t=20+r,r=getJsonFromTypedArray(e,20,r);addPipelineExtras(r);t=e.subarray(t,i),i=r.buffers;return defined(i)&&0<Object.keys(i).length&&(defined(i=defaultValue(i.binary_glTF,i.KHR_binary_glTF))&&(i.extras._pipeline.source=t)),removeExtensionsUsed(r,"KHR_binary_glTF"),r}function parseGlbVersion2(e,t){for(var i,r,n=t[2],a=12;a<n;){var o=readHeader(e,a,2),s=o[0],l=o[1];a+=8;o=e.subarray(a,a+s);a+=s,1313821514===l?addPipelineExtras(i=getJsonFromTypedArray(o)):5130562===l&&(r=o)}return defined(i)&&defined(r)&&(defined(t=i.buffers)&&0<t.length&&(t[0].extras._pipeline.source=r)),i}function addExtensionsUsed(e,t){var i=e.extensionsUsed;defined(i)||(e.extensionsUsed=i=[]),addToArray(i,t,!0)}function getComponentReader(e){switch(e){case ComponentDatatype$1.BYTE:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getInt8(t+a*r)};case ComponentDatatype$1.UNSIGNED_BYTE:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getUint8(t+a*r)};case ComponentDatatype$1.SHORT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getInt16(t+a*r,!0)};case ComponentDatatype$1.UNSIGNED_SHORT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getUint16(t+a*r,!0)};case ComponentDatatype$1.INT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getInt32(t+a*r,!0)};case ComponentDatatype$1.UNSIGNED_INT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getUint32(t+a*r,!0)};case ComponentDatatype$1.FLOAT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getFloat32(t+a*r,!0)};case ComponentDatatype$1.DOUBLE:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getFloat64(t+a*r,!0)}}}function findAccessorMinMax(e,t){var i=e.bufferViews,r=e.buffers,n=t.bufferView,a=numberOfComponentsForType(t.type);if(!defined(t.bufferView))return{min:arrayFill(new Array(a),0),max:arrayFill(new Array(a),0)};for(var o=arrayFill(new Array(a),Number.POSITIVE_INFINITY),s=arrayFill(new Array(a),Number.NEGATIVE_INFINITY),n=i[n],r=r[n.buffer].extras._pipeline.source,l=t.count,c=getAccessorByteStride(e,t),u=t.byteOffset+n.byteOffset+r.byteOffset,t=t.componentType,d=ComponentDatatype$1.getSizeInBytes(t),h=new DataView(r.buffer),p=new Array(a),m=getComponentReader(t),f=0;f<l;f++){m(h,u,a,d,p);for(var g=0;g<a;g++){var _=p[g];o[g]=Math.min(o[g],_),s[g]=Math.max(s[g],_)}u+=c}return{min:o,max:s}}var defaultBlendEquation=[WebGLConstants$1.FUNC_ADD,WebGLConstants$1.FUNC_ADD],defaultBlendFactors=[WebGLConstants$1.ONE,WebGLConstants$1.ZERO,WebGLConstants$1.ONE,WebGLConstants$1.ZERO];function isStateEnabled(e,t){e=e.enable;return defined(e)&&-1<e.indexOf(t)}var supportedBlendFactors=[WebGLConstants$1.ZERO,WebGLConstants$1.ONE,WebGLConstants$1.SRC_COLOR,WebGLConstants$1.ONE_MINUS_SRC_COLOR,WebGLConstants$1.SRC_ALPHA,WebGLConstants$1.ONE_MINUS_SRC_ALPHA,WebGLConstants$1.DST_ALPHA,WebGLConstants$1.ONE_MINUS_DST_ALPHA,WebGLConstants$1.DST_COLOR,WebGLConstants$1.ONE_MINUS_DST_COLOR];function getSupportedBlendFactors(e,t){if(!defined(e))return t;for(var i=0;i<4;i++)if(-1===supportedBlendFactors.indexOf(e[i]))return t;return e}function moveTechniqueRenderStates(e){var a={},o={};return defined(e.techniques)&&(ForEach.technique(e,function(e,t){var i,r,n=e.states;defined(n)&&(i=o[t]={},isStateEnabled(n,WebGLConstants$1.BLEND)&&(i.alphaMode="BLEND",defined(r=n.functions)&&(defined(r.blendEquationSeparate)||defined(r.blendFuncSeparate))&&(a[t]={blendEquation:defaultValue(r.blendEquationSeparate,defaultBlendEquation),blendFactors:getSupportedBlendFactors(r.blendFuncSeparate,defaultBlendFactors)})),isStateEnabled(n,WebGLConstants$1.CULL_FACE)||(i.doubleSided=!0),delete e.states)}),0<Object.keys(a).length&&(defined(e.extensions)||(e.extensions={}),addExtensionsUsed(e,"KHR_blend")),ForEach.material(e,function(i){var e;defined(i.technique)&&(e=o[i.technique],ForEach.objectLegacy(e,function(e,t){i[t]=e}),defined(e=a[i.technique])&&(defined(i.extensions)||(i.extensions={}),i.extensions.KHR_blend=e))})),e}function addExtensionsRequired(e,t){var i=e.extensionsRequired;defined(i)||(e.extensionsRequired=i=[]),addToArray(i,t,!0),addExtensionsUsed(e,t)}function moveTechniquesToExtension(s){var l,c,e=s.techniques,u={},d={};return defined(e)&&(l={programs:[],shaders:[],techniques:[]},c=s.glExtensionsUsed,delete s.glExtensionsUsed,ForEach.technique(s,function(i,e){var r,n={name:i.name,program:void 0,attributes:{},uniforms:{}};ForEach.techniqueAttribute(i,function(e,t){r=i.parameters[e],n.attributes[t]={semantic:r.semantic}}),ForEach.techniqueUniform(i,function(e,t){r=i.parameters[e],n.uniforms[t]={count:r.count,node:r.node,type:r.type,semantic:r.semantic,value:r.value},u[e]=t});var t=s.programs[i.program],a={name:t.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:c},o=s.shaders[t.fragmentShader];a.fragmentShader=addToArray(l.shaders,o,!0);t=s.shaders[t.vertexShader];a.vertexShader=addToArray(l.shaders,t,!0),n.program=addToArray(l.programs,a),d[e]=addToArray(l.techniques,n)}),0<l.techniques.length&&(defined(s.extensions)||(s.extensions={}),s.extensions.KHR_techniques_webgl=l,addExtensionsUsed(s,"KHR_techniques_webgl"),addExtensionsRequired(s,"KHR_techniques_webgl"))),ForEach.material(s,function(e){var i;defined(e.technique)&&(i={technique:d[e.technique]},ForEach.objectLegacy(e.values,function(e,t){defined(i.values)||(i.values={});t=u[t];i.values[t]=e}),defined(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=i),delete e.technique,delete e.values}),delete s.techniques,delete s.programs,delete s.shaders,s}var allElementTypes=["mesh","node","material","accessor","bufferView","buffer"];function removeUnusedElements(t,i){return i=defaultValue(i,allElementTypes),allElementTypes.forEach(function(e){-1<i.indexOf(e)&&removeUnusedElementsByType(t,e)}),t}var TypeToGltfElementName={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",node:"nodes",material:"materials",mesh:"meshes"};function removeUnusedElementsByType(e,t){var i=e[TypeToGltfElementName[t]];if(defined(i))for(var r=0,n=getListOfElementsIdsInUse[t](e),a=i.length,o=0;o<a;++o)n[o]||(Remove[t](e,o-r),r++)}function Remove(){}function getListOfElementsIdsInUse(){}function nodeIsEmpty(t,e){return!(defined(e.mesh)||defined(e.camera)||defined(e.skin)||defined(e.weights)||defined(e.extras)||defined(e.extensions)&&0!==e.extensions.length)&&(!defined(e.children)||0===e.children.filter(function(e){return!nodeIsEmpty(t,t.nodes[e])}).length)}function addBuffer(e,t){var i={byteLength:t.length,extras:{_pipeline:{source:t}}},t={buffer:addToArray(e.buffers,i),byteOffset:0,byteLength:t.length};return addToArray(e.bufferViews,t)}function readAccessorPacked(e,t){var i=getAccessorByteStride(e,t),r=ComponentDatatype$1.getSizeInBytes(t.componentType),n=numberOfComponentsForType(t.type),a=t.count,o=new Array(n*a);if(!defined(t.bufferView))return arrayFill(o,0),o;for(var s=e.bufferViews[t.bufferView],e=e.buffers[s.buffer].extras._pipeline.source,l=t.byteOffset+s.byteOffset+e.byteOffset,c=new DataView(e.buffer),u=new Array(n),d=getComponentReader(t.componentType),h=0;h<a;++h){d(c,l,n,r,u);for(var p=0;p<n;++p)o[h*n+p]=u[p];l+=i}return o}function updateAccessorComponentTypes(t){var i;return ForEach.accessorWithSemantic(t,"JOINTS_0",function(e){e=t.accessors[e];(i=e.componentType)===WebGLConstants$1.BYTE?convertType(t,e,ComponentDatatype$1.UNSIGNED_BYTE):i!==WebGLConstants$1.UNSIGNED_BYTE&&i!==WebGLConstants$1.UNSIGNED_SHORT&&convertType(t,e,ComponentDatatype$1.UNSIGNED_SHORT)}),ForEach.accessorWithSemantic(t,"WEIGHTS_0",function(e){e=t.accessors[e];(i=e.componentType)===WebGLConstants$1.BYTE?convertType(t,e,ComponentDatatype$1.UNSIGNED_BYTE):i===WebGLConstants$1.SHORT&&convertType(t,e,ComponentDatatype$1.UNSIGNED_SHORT)}),t}function convertType(e,t,i){var r=ComponentDatatype$1.createTypedArray(i,readAccessorPacked(e,t)),r=new Uint8Array(r.buffer);t.bufferView=addBuffer(e,r),t.componentType=i,t.byteOffset=0}Remove.accessor=function(e,r){e.accessors.splice(r,1),ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(i){ForEach.meshPrimitiveAttribute(i,function(e,t){r<e&&i.attributes[t]--}),ForEach.meshPrimitiveTarget(i,function(i){ForEach.meshPrimitiveTargetAttribute(i,function(e,t){r<e&&i[t]--})});var e=i.indices;defined(e)&&r<e&&i.indices--})}),ForEach.skin(e,function(e){defined(e.inverseBindMatrices)&&e.inverseBindMatrices>r&&e.inverseBindMatrices--}),ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){defined(e.input)&&e.input>r&&e.input--,defined(e.output)&&e.output>r&&e.output--})})},Remove.buffer=function(e,t){e.buffers.splice(t,1),ForEach.bufferView(e,function(e){defined(e.buffer)&&e.buffer>t&&e.buffer--})},Remove.bufferView=function(e,i){e.bufferViews.splice(i,1),ForEach.accessor(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--}),ForEach.shader(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--}),ForEach.image(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--,ForEach.compressedImage(e,function(e){var t=e.bufferView;defined(t)&&i<t&&e.bufferView--})}),hasExtension(e,"KHR_draco_mesh_compression")&&ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.extensions)&&defined(e.extensions.KHR_draco_mesh_compression)&&e.extensions.KHR_draco_mesh_compression.bufferView>i&&e.extensions.KHR_draco_mesh_compression.bufferView--})})},Remove.mesh=function(e,t){e.meshes.splice(t,1),ForEach.node(e,function(e){defined(e.mesh)&&(e.mesh>t?e.mesh--:e.mesh===t&&delete e.mesh)})},Remove.node=function(e,t){e.nodes.splice(t,1),ForEach.skin(e,function(e){defined(e.skeleton)&&e.skeleton>t&&e.skeleton--,e.joints=e.joints.map(function(e){return t<e?e-1:e})}),ForEach.animation(e,function(e){ForEach.animationChannel(e,function(e){defined(e.target)&&defined(e.target.node)&&e.target.node>t&&e.target.node--})}),ForEach.technique(e,function(e){ForEach.techniqueUniform(e,function(e){defined(e.node)&&e.node>t&&e.node--})}),ForEach.node(e,function(e){defined(e.children)&&(e.children=e.children.filter(function(e){return e!==t}).map(function(e){return t<e?e-1:e}))}),ForEach.scene(e,function(e){e.nodes=e.nodes.filter(function(e){return e!==t}).map(function(e){return t<e?e-1:e})})},Remove.material=function(e,t){e.materials.splice(t,1),ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.material)&&e.material>t&&e.material--})})},getListOfElementsIdsInUse.accessor=function(e){var t={};return ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){ForEach.meshPrimitiveAttribute(e,function(e){t[e]=!0}),ForEach.meshPrimitiveTarget(e,function(e){ForEach.meshPrimitiveTargetAttribute(e,function(e){t[e]=!0})});e=e.indices;defined(e)&&(t[e]=!0)})}),ForEach.skin(e,function(e){defined(e.inverseBindMatrices)&&(t[e.inverseBindMatrices]=!0)}),ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){defined(e.input)&&(t[e.input]=!0),defined(e.output)&&(t[e.output]=!0)})}),t},getListOfElementsIdsInUse.buffer=function(e){var t={};return ForEach.bufferView(e,function(e){defined(e.buffer)&&(t[e.buffer]=!0)}),t},getListOfElementsIdsInUse.bufferView=function(e){var t={};return ForEach.accessor(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)}),ForEach.shader(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)}),ForEach.image(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0),ForEach.compressedImage(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)})}),hasExtension(e,"KHR_draco_mesh_compression")&&ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.extensions)&&defined(e.extensions.KHR_draco_mesh_compression)&&(t[e.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),t},getListOfElementsIdsInUse.mesh=function(i){var r={};return ForEach.node(i,function(e){var t;!defined(e.mesh&&defined(i.meshes))||defined(t=i.meshes[e.mesh])&&defined(t.primitives)&&0<t.primitives.length&&(r[e.mesh]=!0)}),r},getListOfElementsIdsInUse.node=function(i){var r={};return ForEach.node(i,function(e,t){nodeIsEmpty(i,e)||(r[t]=!0)}),ForEach.skin(i,function(e){defined(e.skeleton)&&(r[e.skeleton]=!0),ForEach.skinJoint(e,function(e){r[e]=!0})}),ForEach.animation(i,function(e){ForEach.animationChannel(e,function(e){defined(e.target)&&defined(e.target.node)&&(r[e.target.node]=!0)})}),ForEach.technique(i,function(e){ForEach.techniqueUniform(e,function(e){defined(e.node)&&(r[e.node]=!0)})}),r},getListOfElementsIdsInUse.material=function(e){var t={};return ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.material)&&(t[e.material]=!0)})}),t};var updateFunctions={.8:glTF08to10,"1.0":glTF10to20,"2.0":void 0};function updateVersion(e,t){var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).targetVersion,r=e.version;e.asset=defaultValue(e.asset,{version:"1.0"}),e.asset.version=defaultValue(e.asset.version,"1.0"),r=defaultValue(r,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(updateFunctions,r)||(defined(r)&&(r=r.substring(0,3)),Object.prototype.hasOwnProperty.call(updateFunctions,r)||(r="1.0"));for(var n=updateFunctions[r];defined(n)&&r!==i;)n(e,t),r=e.asset.version,n=updateFunctions[r];return e}function updateInstanceTechniques(e){var t,i,r,n=e.materials;for(t in n)!Object.prototype.hasOwnProperty.call(n,t)||defined(r=(i=n[t]).instanceTechnique)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}function setPrimitiveModes(e){var t,i=e.meshes;for(t in i)if(Object.prototype.hasOwnProperty.call(i,t)){var r=i[t].primitives;if(defined(r))for(var n=r.length,a=0;a<n;++a){var o=r[a],s=defaultValue(o.primitive,WebGLConstants$1.TRIANGLES);o.mode=defaultValue(o.mode,s),delete o.primitive}}}function updateNodes(e){var t,i,r,n=e.nodes,a=new Cartesian3,o=new Quaternion;for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(defined((i=n[t]).rotation)&&(r=i.rotation,Cartesian3.fromArray(r,0,a),Quaternion.fromAxisAngle(a,r[3],o),i.rotation=[o.x,o.y,o.z,o.w]),defined(r=i.instanceSkin)&&(i.skeletons=r.skeletons,i.skin=r.skin,i.meshes=r.meshes,delete i.instanceSkin))}function updateAnimations(e){var t,i=e.animations,r=e.accessors,n=e.bufferViews,a=e.buffers,o={},s=new Cartesian3,l=new Quaternion;for(t in i)if(Object.prototype.hasOwnProperty.call(i,t)){var c=i[t],u=c.channels,d=c.parameters,h=c.samplers;if(defined(u))for(var p=u.length,m=0;m<p;++m){var f=u[m];if("rotation"===f.target.path){var g=d[h[f.sampler].output];if(!defined(o[g])){o[g]=!0;for(var _=r[g],y=n[_.bufferView],f=a[y.buffer].extras._pipeline.source,g=f.byteOffset+y.byteOffset+_.byteOffset,y=_.componentType,C=_.count,v=numberOfComponentsForType(_.type),_=_.count*v,S=ComponentDatatype$1.createArrayBufferView(y,f.buffer,g,_),T=0;T<C;T++){var x=T*v;Cartesian3.unpack(S,x,s);var b=S[3+x];Quaternion.fromAxisAngle(s,b,l),Quaternion.pack(l,S,x)}}}}}}function removeTechniquePasses(e){var t,i,r,n,a=e.techniques;for(t in a)!Object.prototype.hasOwnProperty.call(a,t)||defined(r=(i=a[t]).passes)&&(n=defaultValue(i.pass,"defaultPass"),Object.prototype.hasOwnProperty.call(r,n)&&(n=(r=r[n]).instanceProgram,i.attributes=defaultValue(i.attributes,n.attributes),i.program=defaultValue(i.program,n.program),i.uniforms=defaultValue(i.uniforms,n.uniforms),i.states=defaultValue(i.states,r.states)),delete i.passes,delete i.pass)}function glTF08to10(e){defined(e.asset)||(e.asset={});var t,i=e.asset;i.version="1.0","string"==typeof i.profile?(t=i.profile.split(" "),i.profile={api:t[0],version:t[1]}):i.profile={},defined(e.version)&&delete e.version,updateInstanceTechniques(e),setPrimitiveModes(e),updateNodes(e),updateAnimations(e),removeTechniquePasses(e),defined(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),defined(e.lights)&&(t=defaultValue(e.extensions,{}),i=defaultValue((e.extensions=t).KHR_materials_common,{}),(t.KHR_materials_common=i).lights=e.lights,delete e.lights,addExtensionsUsed(e,"KHR_materials_common"))}function removeAnimationSamplersIndirection(e){var t,i=e.animations;for(t in i)if(Object.prototype.hasOwnProperty.call(i,t)){var r=i[t],n=r.parameters;if(defined(n)){var a,o,s=r.samplers;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&((o=s[a]).input=n[o.input],o.output=n[o.output]);delete r.parameters}}}function objectToArray(e,t){var i,r,n=[];for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r=e[i],t[i]=n.length,n.push(r),defined(r.name)||(r.name=i));return n}function objectsToArrays(s){var l,e,t,i,r,c={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},n={},a=s.nodes;for(t in a)Object.prototype.hasOwnProperty.call(a,t)&&defined(e=a[t].jointName)&&(n[e]=t);for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&defined(c[i])&&(r=s[i],s[i]=objectToArray(r,r={}),c[i]=r);for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&(n[e]=c.nodes[n[e]]);defined(s.scene)&&(s.scene=c.scenes[s.scene]),ForEach.bufferView(s,function(e){defined(e.buffer)&&(e.buffer=c.buffers[e.buffer])}),ForEach.accessor(s,function(e){defined(e.bufferView)&&(e.bufferView=c.bufferViews[e.bufferView])}),ForEach.shader(s,function(e){var t,i=e.extensions;defined(i)&&(defined(t=i.KHR_binary_glTF)&&(e.bufferView=c.bufferViews[t.bufferView],delete i.KHR_binary_glTF),0===Object.keys(i).length&&delete e.extensions)}),ForEach.program(s,function(e){defined(e.vertexShader)&&(e.vertexShader=c.shaders[e.vertexShader]),defined(e.fragmentShader)&&(e.fragmentShader=c.shaders[e.fragmentShader])}),ForEach.technique(s,function(e){defined(e.program)&&(e.program=c.programs[e.program]),ForEach.techniqueParameter(e,function(e){defined(e.node)&&(e.node=c.nodes[e.node]);var t=e.value;"string"==typeof t&&(e.value={index:c.textures[t]})})}),ForEach.mesh(s,function(e){ForEach.meshPrimitive(e,function(i){defined(i.indices)&&(i.indices=c.accessors[i.indices]),ForEach.meshPrimitiveAttribute(i,function(e,t){i.attributes[t]=c.accessors[e]}),defined(i.material)&&(i.material=c.materials[i.material])})}),ForEach.node(s,function(e){var t,i=e.children;if(defined(i)){var r=i.length;for(l=0;l<r;++l)i[l]=c.nodes[i[l]]}if(defined(e.meshes)){var n=e.meshes,a=n.length;if(0<a)for(e.mesh=c.meshes[n[0]],l=1;l<a;++l){var o={mesh:c.meshes[n[l]]},o=addToArray(s.nodes,o);defined(i)||(e.children=i=[]),i.push(o)}delete e.meshes}defined(e.camera)&&(e.camera=c.cameras[e.camera]),defined(e.skin)&&(e.skin=c.skins[e.skin]),defined(e.skeletons)&&(0<(t=e.skeletons).length&&defined(e.skin)&&(s.skins[e.skin].skeleton=c.nodes[t[0]]),delete e.skeletons),defined(e.jointName)&&delete e.jointName}),ForEach.skin(s,function(e){defined(e.inverseBindMatrices)&&(e.inverseBindMatrices=c.accessors[e.inverseBindMatrices]);var t=e.jointNames;if(defined(t)){var i=[],r=t.length;for(l=0;l<r;++l)i[l]=n[t[l]];e.joints=i,delete e.jointNames}}),ForEach.scene(s,function(e){var t=e.nodes;if(defined(t)){var i=t.length;for(l=0;l<i;++l)t[l]=c.nodes[t[l]]}}),ForEach.animation(s,function(e){var t={};e.samplers=objectToArray(e.samplers,t),ForEach.animationSampler(e,function(e){e.input=c.accessors[e.input],e.output=c.accessors[e.output]}),ForEach.animationChannel(e,function(e){e.sampler=t[e.sampler];e=e.target;defined(e)&&(e.node=c.nodes[e.id],delete e.id)})}),ForEach.material(s,function(i){defined(i.technique)&&(i.technique=c.techniques[i.technique]),ForEach.materialValue(i,function(e,t){"string"==typeof e&&(i.values[t]={index:c.textures[e]})});var r,e=i.extensions;!defined(e)||defined(r=e.KHR_materials_common)&&ForEach.materialValue(r,function(e,t){"string"==typeof e&&(r.values[t]={index:c.textures[e]})})}),ForEach.image(s,function(e){var t,r=e.extensions;defined(r)&&(defined(t=r.KHR_binary_glTF)&&(e.bufferView=c.bufferViews[t.bufferView],e.mimeType=t.mimeType,delete r.KHR_binary_glTF),0===Object.keys(r).length&&delete e.extensions),ForEach.compressedImage(e,function(e){var t,i=e.extensions;defined(i)&&(defined(t=i.KHR_binary_glTF)&&(e.bufferView=c.bufferViews[t.bufferView],e.mimeType=t.mimeType,delete i.KHR_binary_glTF),0===Object.keys(r).length&&delete e.extensions)})}),ForEach.texture(s,function(e){defined(e.sampler)&&(e.sampler=c.samplers[e.sampler]),defined(e.source)&&(e.source=c.images[e.source])})}function removeAnimationSamplerNames(e){ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){delete e.name})})}function removeEmptyArrays(e){for(var t in e){var i;Object.prototype.hasOwnProperty.call(e,t)&&(i=e[t],Array.isArray(i)&&0===i.length&&delete e[t])}ForEach.node(e,function(e){defined(e.children)&&0===e.children.length&&delete e.children})}function stripAsset(e){e=e.asset;delete e.profile,delete e.premultipliedAlpha}var knownExtensions={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function requireKnownExtensions(e){var t=e.extensionsUsed;if(e.extensionsRequired=defaultValue(e.extensionsRequired,[]),defined(t))for(var i=t.length,r=0;r<i;++r){var n=t[r];defined(knownExtensions[n])&&e.extensionsRequired.push(n)}}function removeBufferType(e){ForEach.buffer(e,function(e){delete e.type})}function removeTextureProperties(e){ForEach.texture(e,function(e){delete e.format,delete e.internalFormat,delete e.target,delete e.type})}function requireAttributeSetIndex(e){ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(i){ForEach.meshPrimitiveAttribute(i,function(e,t){"TEXCOORD"===t?i.attributes.TEXCOORD_0=e:"COLOR"===t&&(i.attributes.COLOR_0=e)}),delete i.attributes.TEXCOORD,delete i.attributes.COLOR})}),ForEach.technique(e,function(e){ForEach.techniqueParameter(e,function(e){var t=e.semantic;defined(t)&&("TEXCOORD"===t?e.semantic="TEXCOORD_0":"COLOR"===t&&(e.semantic="COLOR_0"))})})}var knownSemantics={POSITION:!0,NORMAL:!0,TANGENT:!0},indexedSemantics={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function underscoreApplicationSpecificSemantics(e){var a={};ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){for(var t in ForEach.meshPrimitiveAttribute(e,function(e,t){var i,r,n;"_"!==t.charAt(0)&&(n=t.search(/_[0-9]+/g),i=t,r="_0",0<=n&&(i=t.substring(0,n),r=t.substring(n)),defined(n=indexedSemantics[i])?a[t]=n+r:defined(knownSemantics[i])||(a[t]="_"+t))}),a){var i,r;Object.prototype.hasOwnProperty.call(a,t)&&(i=a[t],defined(r=e.attributes[t])&&(delete e.attributes[t],e.attributes[i]=r))}})}),ForEach.technique(e,function(e){ForEach.techniqueParameter(e,function(e){var t=a[e.semantic];defined(t)&&(e.semantic=t)})})}function clampCameraParameters(e){ForEach.camera(e,function(e){var t=e.perspective;defined(t)&&(defined(e=t.aspectRatio)&&0===e&&delete t.aspectRatio,defined(e=t.yfov)&&0===e&&(t.yfov=1))})}function computeAccessorByteStride(e,t){return defined(t.byteStride)&&0!==t.byteStride?t.byteStride:getAccessorByteStride(e,t)}function requireByteLength(r){ForEach.buffer(r,function(e){defined(e.byteLength)||(e.byteLength=e.extras._pipeline.source.length)}),ForEach.accessor(r,function(e){var t,i=e.bufferView;defined(i)&&(t=r.bufferViews[i],i=computeAccessorByteStride(r,e),i=e.byteOffset+e.count*i,t.byteLength=Math.max(defaultValue(t.byteLength,0),i))})}function moveByteStrideToBufferView(t){var e=t.bufferViews,i={};ForEach.accessorContainingVertexAttributeData(t,function(e){e=t.accessors[e];defined(e.bufferView)&&(i[e.bufferView]=!0)});var r,n={};for(r in ForEach.accessor(t,function(e){defined(e.bufferView)&&(n[e.bufferView]=defaultValue(n[e.bufferView],[]),n[e.bufferView].push(e))}),n)if(Object.prototype.hasOwnProperty.call(n,r)){var a=e[r],o=n[r];o.sort(function(e,t){return e.byteOffset-t.byteOffset});for(var s=0,l=0,c=o.length,u=0;u<c;++u){var d=o[u],h=computeAccessorByteStride(t,d),p=d.byteOffset,m=d.count*h;delete d.byteStride;var f=u<c-1;if(h!==(f?computeAccessorByteStride(t,o[u+1]):void 0)){var g=clone$1(a,!0);i[r]&&(g.byteStride=h),g.byteOffset+=s,g.byteLength=p+m-s;for(var _=addToArray(e,g),y=l;y<=u;++y)(d=o[y]).bufferView=_,d.byteOffset=d.byteOffset-s;s=f?o[u+1].byteOffset:void 0,l=u+1}}}removeUnusedElements(t,["accessor","bufferView","buffer"])}function requirePositionAccessorMinMax(i){ForEach.accessorWithSemantic(i,"POSITION",function(e){var t=i.accessors[e];defined(t.min)&&defined(t.max)||(e=findAccessorMinMax(i,t),t.min=e.min,t.max=e.max)})}function isNodeEmpty(e){return(!defined(e.children)||0===e.children.length)&&(!defined(e.meshes)||0===e.meshes.length)&&!defined(e.camera)&&!defined(e.skin)&&!defined(e.skeletons)&&!defined(e.jointName)&&(!defined(e.translation)||Cartesian3.fromArray(e.translation).equals(Cartesian3.ZERO))&&(!defined(e.scale)||Cartesian3.fromArray(e.scale).equals(new Cartesian3(1,1,1)))&&(!defined(e.rotation)||Cartesian4.fromArray(e.rotation).equals(new Cartesian4(0,0,0,1)))&&(!defined(e.matrix)||Matrix4.fromColumnMajorArray(e.matrix).equals(Matrix4.IDENTITY))&&!defined(e.extensions)&&!defined(e.extras)}function deleteNode(r,n){ForEach.scene(r,function(e){var t=e.nodes;if(defined(t))for(var i=t.length;0<=i;--i)if(t[i]===n)return void t.splice(i,1)}),ForEach.node(r,function(e,t){var i;!defined(e.children)||-1<(i=e.children.indexOf(n))&&(e.children.splice(i,1),isNodeEmpty(e)&&deleteNode(r,t))}),delete r.nodes[n]}function removeEmptyNodes(i){return ForEach.node(i,function(e,t){isNodeEmpty(e)&&deleteNode(i,t)}),i}function requireAnimationAccessorMinMax(i){ForEach.animation(i,function(e){ForEach.animationSampler(e,function(e){var t=i.accessors[e.input];defined(t.min)&&defined(t.max)||(e=findAccessorMinMax(i,t),t.min=e.min,t.max=e.max)})})}function glTF10to20(e){e.asset=defaultValue(e.asset,{}),e.asset.version="2.0",updateInstanceTechniques(e),removeAnimationSamplersIndirection(e),removeEmptyNodes(e),objectsToArrays(e),removeAnimationSamplerNames(e),stripAsset(e),requireKnownExtensions(e),requireByteLength(e),moveByteStrideToBufferView(e),requirePositionAccessorMinMax(e),requireAnimationAccessorMinMax(e),removeBufferType(e),removeTextureProperties(e),requireAttributeSetIndex(e),underscoreApplicationSpecificSemantics(e),updateAccessorComponentTypes(e),clampCameraParameters(e),moveTechniqueRenderStates(e),moveTechniquesToExtension(e),removeEmptyArrays(e)}function ModelLoadResources(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new Queue,this.indexBuffersToCreate=new Queue,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new Queue,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new Queue,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new Queue,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createdBufferViews={},this.primitivesToDecode=new Queue,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}function getSubarray(e,t,i){return e.subarray(t,t+i)}ModelLoadResources.prototype.getBuffer=function(e){return getSubarray(this.buffers[e.buffer],e.byteOffset,e.byteLength)},ModelLoadResources.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},ModelLoadResources.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length},ModelLoadResources.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},ModelLoadResources.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},ModelLoadResources.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return this.finishedDecoding()&&e&&t},ModelLoadResources.prototype.finishedDecoding=function(){return 0===this.primitivesToDecode.length&&0===this.activeDecodingTasks&&!this.pendingDecodingCache},ModelLoadResources.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()};var ModelUtility={updateForwardAxis:function(e){var t=e.gltf.extras.sourceVersion;(defined(t)&&"2.0"!==t||"2.0"!==ModelUtility.getAssetVersion(e.gltf))&&(e._gltfForwardAxis=Axis$1.X)},getAssetVersion:function(e){return defined(e.asset)&&defined(e.asset.version)?e.asset.version:"1.0"},splitIncompatibleMaterials:function(e){var p=e.accessors,m=e.materials,f={};return ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){var t,i=e.material,r=m[i],n=e.attributes.JOINTS_0;defined(n)&&(t=(d=p[n]).componentType,h=d.type);var a=defined(n)&&"VEC4"===h,o=defined(e.attributes.COLOR_0),s=defined(e.targets),l=defined(e.attributes.NORMAL),c=defined(e.attributes.TANGENT),u=defined(e.attributes.TEXCOORD_0),d=u&&defined(e.attributes.TEXCOORD_1),n=defined(e.extensions)&&defined(e.extensions.CESIUM_primitive_outline),h=f[i];defined(h)?h.skinning.skinned===a&&h.hasVertexColors===o&&h.hasMorphTargets===s&&h.hasNormals===l&&h.hasTangents===c&&h.hasTexCoords===u&&h.hasTexCoord1===d&&h.hasOutline===n||(r=clone$1(r,!0),i=addToArray(m,r),e.material=i,f[i]={skinning:{skinned:a,componentType:t},hasVertexColors:o,hasMorphTargets:s,hasNormals:l,hasTangents:c,hasTexCoords:u,hasTexCoord1:d,hasOutline:n}):f[i]={skinning:{skinned:a,componentType:t},hasVertexColors:o,hasMorphTargets:s,hasNormals:l,hasTangents:c,hasTexCoords:u,hasTexCoord1:d,hasOutline:n}})}),f},getShaderVariable:function(e){return"SCALAR"===e?"float":e.toLowerCase()},ModelState:{NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},getFailedLoadFunction:function(i,r,n){return function(e){i._state=ModelUtility.ModelState.FAILED;var t="Failed to load "+r+": "+n;defined(e)&&(t+="\n"+e.message),i._readyPromise.reject(new RuntimeError(t))}},parseBuffers:function(i,r){var n=i._loadResources;ForEach.buffer(i.gltf,function(e,t){defined(e.extras._pipeline.source)?n.buffers[t]=e.extras._pipeline.source:defined(r)&&(e=i._resource.getDerivedResource({url:e.uri}),++n.pendingBufferLoads,e.fetchArrayBuffer().then(r(i,t)).otherwise(ModelUtility.getFailedLoadFunction(i,"buffer",e.url)))})}},aMinScratch=new Cartesian3,aMaxScratch=new Cartesian3;function techniqueAttributeForSemantic(e,i){return ForEach.techniqueAttribute(e,function(e,t){if(e.semantic===i)return t})}function ensureSemanticExistenceForPrimitive(e,t){var i,r=e.accessors,n=e.materials,a=e.extensions.KHR_techniques_webgl,o=a.techniques,e=a.programs,a=a.shaders,s=t.targets,l=t.attributes;for(i in s)if(s.hasOwnProperty(i)){var c,u=s[i];for(c in u)"extras"!==c&&(l[c+"_"+i]=u[c])}var d,h,p,m,f,g=o[n[t.material].extensions.KHR_techniques_webgl.technique],_=a[e[g.program].vertexShader];for(d in l)l.hasOwnProperty(d)&&(defined(techniqueAttributeForSemantic(g,d))||(h=r[l[d]],p="a_"+(f="_"===(f=d.toLowerCase()).charAt(0)?f.slice(1):f),g.attributes[p]={semantic:d,type:h.componentType},f=(m=_.extras._pipeline).source,f="attribute "+ModelUtility.getShaderVariable(h.type)+" "+p+";\n"+f,m.source=f))}function getTechniqueAttributeOrUniformFunction(e,i,r,n){return hasExtension(e,"KHR_techniques_webgl")?function(e,t){if(!(e.semantic!==r||n&&defined(e.node)))return t}:function(e,t){e=i.parameters[e];if(!(e.semantic!==r||n&&defined(e.node)))return t}}ModelUtility.computeBoundingSphere=function(e){for(var t=e.gltf,i=t.nodes,r=t.meshes,n=t.scenes[t.scene].nodes,a=n.length,o=[],s=new Cartesian3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l=new Cartesian3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=0;c<a;++c)for((u=i[n[c]])._transformToRoot=ModelUtility.getTransform(u),o.push(u);0<o.length;){var u,d=(u=o.pop())._transformToRoot,h=u.mesh;if(defined(h))for(var p=r[h].primitives,m=p.length,f=0;f<m;++f){var g,_=p[f].attributes.POSITION;!defined(_)||defined((g=ModelUtility.getAccessorMinMax(t,_)).min)&&defined(g.max)&&(_=Cartesian3.fromArray(g.min,0,aMinScratch),g=Cartesian3.fromArray(g.max,0,aMaxScratch),Matrix4.multiplyByPoint(d,_,_),Matrix4.multiplyByPoint(d,g,g),Cartesian3.minimumByComponent(s,_,s),Cartesian3.maximumByComponent(l,g,l))}var y=u.children;if(defined(y))for(var C=y.length,v=0;v<C;++v){var S=i[y[v]];S._transformToRoot=ModelUtility.getTransform(S),Matrix4.multiplyTransformation(d,S._transformToRoot,S._transformToRoot),o.push(S)}delete u._transformToRoot}var T=BoundingSphere.fromCornerPoints(s,l);return e._forwardAxis===Axis$1.Z&&BoundingSphere.transformWithoutScale(T,Axis$1.Z_UP_TO_X_UP,T),e._upAxis===Axis$1.Y?BoundingSphere.transformWithoutScale(T,Axis$1.Y_UP_TO_Z_UP,T):e._upAxis===Axis$1.X&&BoundingSphere.transformWithoutScale(T,Axis$1.X_UP_TO_Z_UP,T),T},ModelUtility.ensureSemanticExistence=function(t){return ForEach.mesh(t,function(e){ForEach.meshPrimitive(e,function(e){ensureSemanticExistenceForPrimitive(t,e)})}),t},ModelUtility.createAttributeLocations=function(e,t){var i={},r=!1,n=1;if(ForEach.techniqueAttribute(e,function(e,t){/pos/i.test(t)&&!r?(i[t]=0,r=!0):i[t]=n++}),defined(t))for(var a in t)t.hasOwnProperty(a)&&(i[a]=n++);return i},ModelUtility.getAccessorMinMax=function(e,t){var i=e.accessors[t],e=i.extensions,t=i.min,i=i.max;return!defined(e)||defined(e=e.WEB3D_quantized_attributes)&&(t=e.decodedMin,i=e.decodedMax),{min:t,max:i}},ModelUtility.getAttributeOrUniformBySemantic=function(i,r,n,a){return ForEach.technique(i,function(e){if(!defined(n)||e.program===n){var t=ForEach.techniqueAttribute(e,getTechniqueAttributeOrUniformFunction(i,e,r,a));return defined(t)?t:ForEach.techniqueUniform(e,getTechniqueAttributeOrUniformFunction(i,e,r,a))}})},ModelUtility.getDiffuseAttributeOrUniform=function(e,t){var i=ModelUtility.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return i=!defined(i)?ModelUtility.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t):i};var nodeTranslationScratch=new Cartesian3,nodeQuaternionScratch=new Quaternion,nodeScaleScratch=new Cartesian3;function replaceAllButFirstInString(e,t,i){t+="(?!\\w)",t=new RegExp(t,"g");var r=e.search(t);return e.replace(t,function(e,t){return r===t?e:i})}function getQuantizedAttributes(e,t){t=e.accessors[t].extensions;if(defined(t))return t.WEB3D_quantized_attributes}function getAttributeVariableName(e,t,i){t=t.material,t=e.materials[t];if(hasExtension(e,"KHR_techniques_webgl")&&defined(t.extensions)&&defined(t.extensions.KHR_techniques_webgl)){t=t.extensions.KHR_techniques_webgl.technique,t=e.extensions.KHR_techniques_webgl.techniques[t];return ForEach.techniqueAttribute(t,function(e,t){if(e.semantic===i)return t})}}function getScalarUniformFunction(e){var t={value:e,clone:function(e,t){return e},func:function(){return t.value}};return t}function getVec2UniformFunction(e){var t={value:Cartesian2.fromArray(e),clone:Cartesian2.clone,func:function(){return t.value}};return t}function getVec3UniformFunction(e){var t={value:Cartesian3.fromArray(e),clone:Cartesian3.clone,func:function(){return t.value}};return t}function getVec4UniformFunction(e){var t={value:Cartesian4.fromArray(e),clone:Cartesian4.clone,func:function(){return t.value}};return t}function getMat2UniformFunction(e){var t={value:Matrix2.fromColumnMajorArray(e),clone:Matrix2.clone,func:function(){return t.value}};return t}function getMat3UniformFunction(e){var t={value:Matrix3.fromColumnMajorArray(e),clone:Matrix3.clone,func:function(){return t.value}};return t}function getMat4UniformFunction(e){var t={value:Matrix4.fromColumnMajorArray(e),clone:Matrix4.clone,func:function(){return t.value}};return t}function DelayLoadedTextureUniform(e,t,i){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=i}function getTextureUniformFunction(e,t,i){var r=new DelayLoadedTextureUniform(e,t,i);return r.func=function(){return r.value},r}ModelUtility.getTransform=function(e,t){return defined(e.matrix)?Matrix4.fromColumnMajorArray(e.matrix,t):Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.fromArray(e.translation,0,nodeTranslationScratch),Quaternion.unpack(e.rotation,0,nodeQuaternionScratch),Cartesian3.fromArray(e.scale,0,nodeScaleScratch),t)},ModelUtility.getUsedExtensions=function(e){var t=e.extensionsUsed,i={};if(defined(t))for(var r=t.length,n=0;n<r;n++)i[t[n]]=!0;return i},ModelUtility.getRequiredExtensions=function(e){var t=e.extensionsRequired,i={};if(defined(t))for(var r=t.length,n=0;n<r;n++)i[t[n]]=!0;return i},ModelUtility.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0},ModelUtility.checkSupportedExtensions=function(e,t){for(var i in e)if(e.hasOwnProperty(i)){if(!ModelUtility.supportedExtensions[i])throw new RuntimeError("Unsupported glTF Extension: "+i);if("EXT_texture_webp"===i&&!1===t)throw new RuntimeError("Loaded model requires WebP but browser does not support it.")}},ModelUtility.checkSupportedGlExtensions=function(e,t){if(defined(e))for(var i=e.length,r=0;r<i;r++){var n=e[r];if("OES_element_index_uint"!==n)throw new RuntimeError("Unsupported WebGL Extension: "+n);if(!t.elementIndexUint)throw new RuntimeError("OES_element_index_uint WebGL extension is not enabled.")}},ModelUtility.modifyShaderForDracoQuantizedAttributes=function(e,t,i,r){var n,a,o,s,l,c,u,d,h,p,m={};for(n in r)!r.hasOwnProperty(n)||defined(a=(u=r[n]).quantization)&&(o=getAttributeVariableName(e,t,n),defined(m[h="gltf_u_dec_"+(n="_"===n.charAt(0)?n.substring(1):n).toLowerCase()])||(s="gltf_decoded_"+n,l=o.replace("a_","gltf_a_dec_"),p=u.componentsPerAttribute,i=replaceAllButFirstInString(i,o,l),i=(c=a.octEncoded?"vec3":1<p?"vec"+p:"float")+" "+l+";\n"+i,(u=3===p&&"COLOR_0"===n)&&(i=replaceAllButFirstInString(i,l,"vec4("+l+", 1.0)")),p="",p=a.octEncoded?(i="uniform float "+(d=h+"_rangeConstant")+";\n"+i,"\nvoid main() {\n "+l+" = czm_octDecode("+o+".xy, "+d+").zxy;\n "+s+"();\n}\n"):(i="uniform float "+(d=h+"_normConstant")+";\nuniform "+c+" "+(h=h+"_min")+";\n"+i,"\nvoid main() {\n "+l+" = "+h+" + "+o+(u?".xyz":"")+" * "+d+";\n "+s+"();\n}\n"),i=ShaderSource.replaceMain(i,s),i+=p));return{shader:i}},ModelUtility.modifyShaderForQuantizedAttributes=function(e,t,i){var r,n,a,o,s,l,c,u,d,h,p={},m=t.attributes;for(r in m)m.hasOwnProperty(r)&&(n=getAttributeVariableName(e,t,r),u=t.attributes[r],o=(a="gltf_u_dec_"+(r="_"===r.charAt(0)?r.substring(1):r).toLowerCase())+"_scale",s=a+"_translate",defined(p[a])||defined(p[o])||defined(d=getQuantizedAttributes(e,u))&&(h=d.decodeMatrix,l="gltf_decoded_"+r,c=n.replace("a_","gltf_a_dec_"),i=(d=2<(u=Math.floor(Math.sqrt(h.length)))?"vec"+(u-1):"float")+" "+c+";\n"+(i=replaceAllButFirstInString(i,n,c)),h="",5===u?(i="uniform vec4 "+s+";\n"+(i="uniform mat4 "+o+";\n"+i),h="\nvoid main() {\n "+c+" = "+o+" * "+n+" + "+s+";\n "+l+"();\n}\n",p[o]={mat:4},p[s]={vec:4}):(i="uniform mat"+u+" "+a+";\n"+i,h="\nvoid main() {\n "+c+" = "+d+"("+a+" * vec"+u+"("+n+",1.0));\n "+l+"();\n}\n",p[a]={mat:u}),i=ShaderSource.replaceMain(i,l),i+=h));return{shader:i,uniforms:p}},Object.defineProperties(DelayLoadedTextureUniform.prototype,{value:{get:function(){if(!defined(this._value)){var e=this._textures[this._textureId];if(!defined(e))return this._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),DelayLoadedTextureUniform.prototype.clone=function(e){return e},DelayLoadedTextureUniform.prototype.func=void 0;var gltfUniformFunctions={};function scaleFromMatrix5Array(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function translateFromMatrix5Array(e){return[e[20],e[21],e[22],e[23]]}gltfUniformFunctions[WebGLConstants$1.FLOAT]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT2]=getMat2UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT3]=getMat3UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT4]=getMat4UniformFunction,gltfUniformFunctions[WebGLConstants$1.SAMPLER_2D]=getTextureUniformFunction,ModelUtility.createUniformFunction=function(e,t,i,r){return gltfUniformFunctions[e](t,i,r)},ModelUtility.createUniformsForDracoQuantizedAttributes=function(e){var t,i={};for(t in e)if(e.hasOwnProperty(t)){var r=e[t],n=r.quantization;if(defined(n)){var a="gltf_u_dec_"+(t="_"===t.charAt(0)?t.substring(1):t).toLowerCase();if(n.octEncoded){var o=(1<<n.quantizationBits)-1;i[a+"_rangeConstant"]=getScalarUniformFunction(o).func}else{o=n.range/(1<<n.quantizationBits);i[a+"_normConstant"]=getScalarUniformFunction(o).func;var s=a+"_min";switch(r.componentsPerAttribute){case 1:i[s]=getScalarUniformFunction(n.minValues).func;break;case 2:i[s]=getVec2UniformFunction(n.minValues).func;break;case 3:i[s]=getVec3UniformFunction(n.minValues).func;break;case 4:i[s]=getVec4UniformFunction(n.minValues).func}}}}return i},ModelUtility.createUniformsForQuantizedAttributes=function(e,t,i){var r,n,a,o=e.accessors,s={},l={},c=t.attributes;for(r in c)if(c.hasOwnProperty(r)){var u=o[c[r]],d=u.extensions;if("_"===r.charAt(0)&&(r=r.substring(1)),defined(d)){d=d.WEB3D_quantized_attributes;if(defined(d)){var h=d.decodeMatrix,p="gltf_u_dec_"+r.toLowerCase();switch(u.type){case AttributeType$1.SCALAR:l[p]=getMat2UniformFunction(h).func,s[p]=!0;break;case AttributeType$1.VEC2:l[p]=getMat3UniformFunction(h).func,s[p]=!0;break;case AttributeType$1.VEC3:l[p]=getMat4UniformFunction(h).func,s[p]=!0;break;case AttributeType$1.VEC4:var m=p+"_scale",f=p+"_translate";l[m]=getMat4UniformFunction(scaleFromMatrix5Array(h)).func,l[f]=getVec4UniformFunction(translateFromMatrix5Array(h)).func,s[m]=!0,s[f]=!0}}}}for(n in i)i.hasOwnProperty(n)&&(s[n]||(defined((a=i[n]).mat)&&(2===a.mat?l[n]=getMat2UniformFunction(Matrix2.IDENTITY).func:3===a.mat?l[n]=getMat3UniformFunction(Matrix3.IDENTITY).func:4===a.mat&&(l[n]=getMat4UniformFunction(Matrix4.IDENTITY).func)),defined(a.vec)&&4===a.vec&&(l[n]=getVec4UniformFunction([0,0,0,0]).func)));return l};var scratchTranslationRtc=new Cartesian3,gltfSemanticUniforms$1={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var i=new Matrix4;return function(){return defined(t._rtcCenter)?(Matrix4.getTranslation(e.model,scratchTranslationRtc),Cartesian3.add(scratchTranslationRtc,t._rtcCenter,scratchTranslationRtc),Matrix4.multiplyByPoint(e.view,scratchTranslationRtc,scratchTranslationRtc),Matrix4.setTranslation(e.modelView,scratchTranslationRtc,i)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};function processModelMaterialsCommon(l,c){if(c=defaultValue(c,defaultValue.EMPTY_OBJECT),defined(l)&&hasExtension(l,"KHR_materials_common")){hasExtension(l,"KHR_techniques_webgl")||(defined(l.extensions)||(l.extensions={}),l.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},l.extensionsUsed.push("KHR_techniques_webgl"),l.extensionsRequired.push("KHR_techniques_webgl"));var u=l.extensions.KHR_techniques_webgl;lightDefaults(l);var d=generateLightParameters(l),h=ModelUtility.splitIncompatibleMaterials(l),p={},m=!1;return(ForEach.material(l,function(e,t){if(defined(e.extensions)&&defined(e.extensions.KHR_materials_common)){var i=e.extensions.KHR_materials_common,r=h[t],n=getTechniqueKey(i,r),t=p[n];defined(t)||(t=generateTechnique$1(l,u,r,i,d,c.addBatchIdToGeneratedShaders),p[n]=t,m=!0);var a,o={},s=i.values;for(a in s)s.hasOwnProperty(a)&&"transparent"!==a&&"doubleSided"!==a&&(o["u_"+a.toLowerCase()]=s[a]);e.extensions.KHR_techniques_webgl={technique:t,values:o},e.alphaMode="OPAQUE",i.transparent&&(e.alphaMode="BLEND"),i.doubleSided&&(e.doubleSided=!0)}}),m)?(ModelUtility.ensureSemanticExistence(l),l):l}}function generateLightParameters(e){var t,i={};if(defined(e.extensions)&&defined(e.extensions.KHR_materials_common)&&(t=e.extensions.KHR_materials_common.lights),defined(t)){var r,n,a,o=e.nodes;for(r in o)!o.hasOwnProperty(r)||defined((n=o[r]).extensions)&&defined(n.extensions.KHR_materials_common)&&(defined(a=n.extensions.KHR_materials_common.light)&&defined(t[a])&&(t[a].node=r),delete n.extensions.KHR_materials_common);var s,l=0;for(s in t)if(t.hasOwnProperty(s)){var c=t[s],u=c.type;if("ambient"===u||defined(c.node)){var d="light"+l.toString();switch(c.baseName=d,u){case"ambient":var h=c.ambient;i[d+"Color"]={type:WebGLConstants$1.FLOAT_VEC3,value:h.color};break;case"directional":h=c.directional;i[d+"Color"]={type:WebGLConstants$1.FLOAT_VEC3,value:h.color},defined(c.node)&&(i[d+"Transform"]={node:c.node,semantic:"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4});break;case"point":var p=c.point;i[d+"Color"]={type:WebGLConstants$1.FLOAT_VEC3,value:p.color},defined(c.node)&&(i[d+"Transform"]={node:c.node,semantic:"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4}),i[d+"Attenuation"]={type:WebGLConstants$1.FLOAT_VEC3,value:[p.constantAttenuation,p.linearAttenuation,p.quadraticAttenuation]};break;case"spot":p=c.spot;i[d+"Color"]={type:WebGLConstants$1.FLOAT_VEC3,value:p.color},defined(c.node)&&(i[d+"Transform"]={node:c.node,semantic:"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4},i[d+"InverseTransform"]={node:c.node,semantic:"MODELVIEWINVERSE",type:WebGLConstants$1.FLOAT_MAT4,useInFragment:!0}),i[d+"Attenuation"]={type:WebGLConstants$1.FLOAT_VEC3,value:[p.constantAttenuation,p.linearAttenuation,p.quadraticAttenuation]},i[d+"FallOff"]={type:WebGLConstants$1.FLOAT_VEC2,value:[p.fallOffAngle,p.fallOffExponent]}}++l}else delete t[s]}}return i}function generateTechnique$1(e,t,i,r,n,a){defined(r)||(r={}),a=defaultValue(a,!1);var o,s=t.techniques,l=t.shaders,c=t.programs,u=r.technique.toUpperCase();defined(e.extensions)&&defined(e.extensions.KHR_materials_common)&&(o=e.extensions.KHR_materials_common.lights);var d=r.values,h=defaultValue(r.jointCount,0),p=!1,t=!1;defined(i)&&(p=i.skinning.skinned,t=i.hasVertexColors);var m="precision highp float;\n",f="precision highp float;\n",g="CONSTANT"!==u,_={u_modelViewMatrix:{semantic:hasExtension(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:WebGLConstants$1.FLOAT_MAT4}};g&&(_.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:WebGLConstants$1.FLOAT_MAT3}),p&&(_.u_jointMatrix={count:h,semantic:"JOINTMATRIX",type:WebGLConstants$1.FLOAT_MAT4});var y,C,v,S,T,x=!1;for(y in d)d.hasOwnProperty(y)&&"transparent"!==y&&"doubleSided"!==y&&(C=getKHRMaterialsCommonValueType(y,d[y]),v="u_"+y.toLowerCase(),x||C!==WebGLConstants$1.SAMPLER_2D||(x=!0),_[v]={type:C});if(defined(_.u_diffuse)&&(_.u_diffuse.semantic="_3DTILESDIFFUSE"),defined(n))for(var b in n)n.hasOwnProperty(b)&&(_[v="u_"+b]=n[b]);for(v in _)_.hasOwnProperty(v)&&(T=defined((S=_[v]).count)?"["+S.count+"]":"",S.type!==WebGLConstants$1.FLOAT_MAT3&&S.type!==WebGLConstants$1.FLOAT_MAT4||S.useInFragment?(f+="uniform "+webGLConstantToGlslType(S.type)+" "+v+T+";\n",delete S.useInFragment):m+="uniform "+webGLConstantToGlslType(S.type)+" "+v+T+";\n");var E="";p&&(E+=" mat4 skinMatrix =\n a_weight.x * u_jointMatrix[int(a_joint.x)] +\n a_weight.y * u_jointMatrix[int(a_joint.y)] +\n a_weight.z * u_jointMatrix[int(a_joint.z)] +\n a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var P,h={a_position:{semantic:"POSITION"}};m+="attribute vec3 a_position;\n",m+="varying vec3 v_positionEC;\n",E+=p?" vec4 pos = u_modelViewMatrix * skinMatrix * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",E+=" v_positionEC = pos.xyz;\n",E+=" gl_Position = u_projectionMatrix * pos;\n",f+="varying vec3 v_positionEC;\n",g&&(h.a_normal={semantic:"NORMAL"},m+="attribute vec3 a_normal;\n",m+="varying vec3 v_normal;\n",E+=p?" v_normal = u_normalMatrix * mat3(skinMatrix) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",f+="varying vec3 v_normal;\n"),x&&(h.a_texcoord_0={semantic:"TEXCOORD_0"},m+="attribute vec2 a_texcoord_0;\n",m+="varying vec2 "+(P="v_texcoord_0")+";\n",E+=" "+P+" = a_texcoord_0;\n",f+="varying vec2 "+P+";\n"),p&&(h.a_joint={semantic:"JOINTS_0"},h.a_weight={semantic:"WEIGHTS_0"},m+="attribute vec4 a_joint;\n",m+="attribute vec4 a_weight;\n"),t&&(h.a_vertexColor={semantic:"COLOR_0"},m+="attribute vec4 a_vertexColor;\n",m+="varying vec4 v_vertexColor;\n",E+=" v_vertexColor = a_vertexColor;\n",f+="varying vec4 v_vertexColor;\n"),a&&(h.a_batchId={semantic:"_BATCHID"},m+="attribute float a_batchId;\n");var A,w,D,M,I,R,O=g&&("BLINN"===u||"PHONG"===u)&&defined(_.u_specular)&&defined(_.u_shininess)&&0<_.u_shininess,L=!1,F=!1,N="";for(A in o)o.hasOwnProperty(A)&&(w=(R=o[A]).type.toLowerCase(),N+=" {\n",M="u_"+(D=R.baseName)+"Color","ambient"===w?(F=!0,N+=" ambientLight += "+M+";\n"):g&&(L=!0,I="v_"+D+"Direction",R="v_"+D+"Position","point"!==w&&(m+="varying vec3 "+I+";\n",f+="varying vec3 "+I+";\n",E+=" "+I+" = mat3(u_"+D+"Transform) * vec3(0.,0.,1.);\n","directional"===w&&(N+=" vec3 l = normalize("+I+");\n")),"directional"!==w?(m+="varying vec3 "+R+";\n",f+="varying vec3 "+R+";\n",E+=" "+R+" = u_"+D+"Transform[3].xyz;\n",N+=" vec3 VP = "+R+" - v_positionEC;\n",N+=" vec3 l = normalize(VP);\n",N+=" float range = length(VP);\n",N+=" float attenuation = 1.0 / (u_"+D+"Attenuation.x + ",N+="(u_"+D+"Attenuation.y * range) + ",N+="(u_"+D+"Attenuation.z * range * range));\n"):N+=" float attenuation = 1.0;\n","spot"===w&&(N+=" float spotDot = dot(l, normalize("+I+"));\n",N+=" if (spotDot < cos(u_"+D+"FallOff.x * 0.5))\n",N+=" {\n",N+=" attenuation = 0.0;\n",N+=" }\n",N+=" else\n",N+=" {\n",N+=" attenuation *= max(0.0, pow(spotDot, u_"+D+"FallOff.y));\n",N+=" }\n"),N+=" diffuseLight += "+M+"* max(dot(normal,l), 0.) * attenuation;\n",O&&("BLINN"===u?(N+=" vec3 h = normalize(l + viewDir);\n",N+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(N+=" vec3 reflectDir = reflect(-l, normal);\n",N+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),N+=" specularLight += "+M+" * specularIntensity;\n")),N+=" }\n");F||(N+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),L||"CONSTANT"===u||(f+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",f+="uniform vec3 gltf_lightColor; \n",f+="#endif \n",N+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",N+=" vec3 lightColor = czm_lightColor;\n",N+="#else \n",N+=" vec3 lightColor = gltf_lightColor;\n",N+="#endif \n",N+=" vec3 l = normalize(czm_lightDirectionEC);\n",N+=" diffuseLight += lightColor * max(dot(normal,l), 0.2);\n",O&&("BLINN"===u?(N+=" vec3 h = normalize(l + viewDir);\n",N+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(N+=" vec3 reflectDir = reflect(-l, normal);\n",N+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),N+=" specularLight += lightColor * specularIntensity;\n")),m+="void main(void) {\n",m+=E,m+="}\n",f+="void main(void) {\n";a=" vec3 color = vec3(0.0, 0.0, 0.0);\n";g&&(f+=" vec3 normal = normalize(v_normal);\n",r.doubleSided&&(f+=" if (czm_backFacing())\n",f+=" {\n",f+=" normal = -normal;\n",f+=" }\n")),r="CONSTANT"!==u?(defined(_.u_diffuse)&&(_.u_diffuse.type===WebGLConstants$1.SAMPLER_2D?f+=" vec4 diffuse = texture2D(u_diffuse, "+P+");\n":f+=" vec4 diffuse = u_diffuse;\n",f+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",a+=" color += diffuse.rgb * diffuseLight;\n"),O&&(_.u_specular.type===WebGLConstants$1.SAMPLER_2D?f+=" vec3 specular = texture2D(u_specular, "+P+").rgb;\n":f+=" vec3 specular = u_specular.rgb;\n",f+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",a+=" color += specular * specularLight;\n"),defined(_.u_transparency)?" gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):defined(_.u_transparency)?" gl_FragColor = vec4(color * u_transparency, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",t&&(a+=" color *= v_vertexColor.rgb;\n"),defined(_.u_emission)&&(_.u_emission.type===WebGLConstants$1.SAMPLER_2D?f+=" vec3 emission = texture2D(u_emission, "+P+").rgb;\n":f+=" vec3 emission = u_emission.rgb;\n",a+=" color += emission;\n"),!defined(_.u_ambient)&&"CONSTANT"===u||(defined(_.u_ambient)?_.u_ambient.type===WebGLConstants$1.SAMPLER_2D?f+=" vec3 ambient = texture2D(u_ambient, "+P+").rgb;\n":f+=" vec3 ambient = u_ambient.rgb;\n":f+=" vec3 ambient = diffuse.rgb;\n",a+=" color += ambient * ambientLight;\n"),f+=" vec3 viewDir = -normalize(v_positionEC);\n",f+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",f+=N,f+=a,f+=r,f+="}\n";r=addToArray(l,{type:WebGLConstants$1.VERTEX_SHADER,extras:{_pipeline:{source:m,extension:".glsl"}}}),l=addToArray(l,{type:WebGLConstants$1.FRAGMENT_SHADER,extras:{_pipeline:{source:f,extension:".glsl"}}}),r=addToArray(c,{fragmentShader:l,vertexShader:r});return addToArray(s,{attributes:h,program:r,uniforms:_})}function getKHRMaterialsCommonValueType(e,t){var i=defined(t.value)?t.value:defined(t.index)?[t.index]:t;switch(e){case"ambient":case"diffuse":case"emission":case"specular":return 1===i.length?WebGLConstants$1.SAMPLER_2D:WebGLConstants$1.FLOAT_VEC4;case"shininess":case"transparency":return WebGLConstants$1.FLOAT;case"transparent":case"doubleSided":return WebGLConstants$1.BOOL}}function getTechniqueKey(e,t){var i="";i+="technique:"+e.technique+";";for(var r=e.values,n=Object.keys(r).sort(),a=n.length,o=0;o<a;++o){var s=n[o];r.hasOwnProperty(s)&&(i+=s+":"+getKHRMaterialsCommonValueType(s,r[s]),i+=";")}var l=defaultValue(e.jointCount,0);return i+=l.toString()+";",defined(t)&&(e=t.skinning,0<l&&(i+=e.type+";"),i+=t.hasVertexColors),i}function lightDefaults(e){e=e.extensions.KHR_materials_common;if(defined(e)&&defined(e.lights))for(var t=e.lights,i=t.length,r=0;r<i;r++){var n,a,o=t[r];"ambient"===o.type?(defined(o.ambient)||(o.ambient={}),defined((n=o.ambient).color)||(n.color=[1,1,1])):"directional"===o.type?(defined(o.directional)||(o.directional={}),defined((a=o.directional).color)||(a.color=[1,1,1])):"point"===o.type?(defined(o.point)||(o.point={}),defined((a=o.point).color)||(a.color=[1,1,1]),a.constantAttenuation=defaultValue(a.constantAttenuation,1),a.linearAttenuation=defaultValue(a.linearAttenuation,0),a.quadraticAttenuation=defaultValue(a.quadraticAttenuation,0)):"spot"===o.type&&(defined(o.spot)||(o.spot={}),defined((o=o.spot).color)||(o.color=[1,1,1]),o.constantAttenuation=defaultValue(o.constantAttenuation,1),o.fallOffAngle=defaultValue(o.fallOffAngle,3.14159265),o.fallOffExponent=defaultValue(o.fallOffExponent,0),o.linearAttenuation=defaultValue(o.linearAttenuation,0),o.quadraticAttenuation=defaultValue(o.quadraticAttenuation,0))}}function processPbrMaterials(r,n){if(n=defaultValue(n,defaultValue.EMPTY_OBJECT),hasExtension(r,"KHR_techniques_webgl"))return r;if(!defined(r.materials)||0===r.materials.length)return r;defined(r.extensions)||(r.extensions={}),defined(r.extensionsUsed)||(r.extensionsUsed=[]),defined(r.extensionsRequired)||(r.extensionsRequired=[]),r.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},r.extensionsUsed.push("KHR_techniques_webgl"),r.extensionsRequired.push("KHR_techniques_webgl");var a=ModelUtility.splitIncompatibleMaterials(r);return ForEach.material(r,function(e,t){var i={},t=generateTechnique(r,e,t,i,a,n);defined(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={values:i,technique:t}}),ModelUtility.ensureSemanticExistence(r),r}function isSpecularGlossinessMaterial(e){return defined(e.extensions)&&defined(e.extensions.KHR_materials_pbrSpecularGlossiness)}function addTextureCoordinates(e,t,i,r,n){var a,o=i[t];return defined(o)&&defined(o.texCoord)&&1===o.texCoord&&(r=r.replace("0","1")),defined(i[t+"Offset"])?n.fragmentShaderMain+=" vec2 "+(a=t+"Coord")+" = computeTexCoord("+r+", "+t+"Offset, "+t+"Rotation, "+t+"Scale);\n":a=r,a}ModelUtility.getGltfSemanticUniforms=function(){return gltfSemanticUniforms$1};var DEFAULT_TEXTURE_OFFSET=[0,0],DEFAULT_TEXTURE_ROTATION=[0],DEFAULT_TEXTURE_SCALE=[1,1];function handleKHRTextureTransform(e,t,i){var r;-1!==e.indexOf("Texture")&&defined(t.extensions)&&defined(t.extensions.KHR_texture_transform)&&(r=t.extensions.KHR_texture_transform,i[(e="u_"+e)+"Offset"]=defaultValue(r.offset,DEFAULT_TEXTURE_OFFSET),i[e+"Rotation"]=defaultValue(r.rotation,DEFAULT_TEXTURE_ROTATION),i[e+"Scale"]=defaultValue(r.scale,DEFAULT_TEXTURE_SCALE),defined(t.texCoord)&&defined(r.texCoord)&&(i[e].texCoord=r.texCoord))}function generateTechnique(e,t,i,r,n,a){var o,s,l,c,u=defaultValue(a.addBatchIdToGeneratedShaders,!1),d=e.extensions.KHR_techniques_webgl,h=d.techniques,p=d.shaders,m=d.programs,f=isSpecularGlossinessMaterial(t),g=t.pbrMetallicRoughness;if(defined(g)&&!f)for(s in g)g.hasOwnProperty(s)&&(l=g[s],handleKHRTextureTransform(s,r[o="u_"+s]=l,r));if(f){var _=t.extensions.KHR_materials_pbrSpecularGlossiness;for(s in _)_.hasOwnProperty(s)&&(l=_[s],handleKHRTextureTransform(s,r[o="u_"+s]=l,r))}for(c in t)t.hasOwnProperty(c)&&(0<=c.indexOf("Texture")||0<=c.indexOf("Factor"))&&(l=t[c],handleKHRTextureTransform(c,r[o="u_"+c]=l,r));var y="precision highp float;\n",C="precision highp float;\n";defined(e.skins)&&(D=e.skins[0]);var v,S=defined(D)?D.joints:[],T=S.length,x=n[i],b=!1,E=!1,P=!1,A=!1,w=!1,a=!1,d=!1,D=!1,n=!1;defined(x)&&(b=x.skinning.skinned&&0<S.length,E=x.hasVertexColors,P=x.hasMorphTargets,A=x.hasNormals,w=x.hasTangents,a=x.hasTexCoords,d=x.hasTexCoord1,D=x.hasOutline),P&&ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){e.material!==i||defined(e=e.targets)&&(v=e)})});var M={u_modelViewMatrix:{semantic:hasExtension(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:WebGLConstants$1.FLOAT_MAT4}};defined(t.extensions)&&defined(t.extensions.KHR_materials_unlit)&&(n=!0),A&&(M.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:WebGLConstants$1.FLOAT_MAT3}),b&&(M.u_jointMatrix={count:T,semantic:"JOINTMATRIX",type:WebGLConstants$1.FLOAT_MAT4}),P&&(M.u_morphWeights={count:v.length,semantic:"MORPHWEIGHTS",type:WebGLConstants$1.FLOAT});x=t.alphaMode;for(o in defined(x)&&"MASK"===x&&(M.u_alphaCutoff={semantic:"ALPHACUTOFF",type:WebGLConstants$1.FLOAT}),r)r.hasOwnProperty(o)&&(M[o]={type:getPBRValueType(o)});var I,R,T=defaultValue(M.u_baseColorTexture,M.u_baseColorFactor);for(o in defined(T)&&(T.semantic="_3DTILESDIFFUSE"),M)M.hasOwnProperty(o)&&(R=defined((I=M[o]).count)?"["+I.count+"]":"",I.type!==WebGLConstants$1.FLOAT_MAT3&&I.type!==WebGLConstants$1.FLOAT_MAT4&&"u_morphWeights"!==o||I.useInFragment?(C+="uniform "+webGLConstantToGlslType(I.type)+" "+o+R+";\n",delete I.useInFragment):y+="uniform "+webGLConstantToGlslType(I.type)+" "+o+R+";\n");D&&(C+="uniform sampler2D u_outlineTexture;\n");var O="";b&&(O+=" mat4 skinMatrix =\n a_weight.x * u_jointMatrix[int(a_joint.x)] +\n a_weight.y * u_jointMatrix[int(a_joint.y)] +\n a_weight.z * u_jointMatrix[int(a_joint.z)] +\n a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var L={a_position:{semantic:"POSITION"}};if(D&&(L.a_outlineCoordinates={semantic:"_OUTLINE_COORDINATES"}),y+="attribute vec3 a_position;\n",A&&(y+="varying vec3 v_positionEC;\n"),D&&(y+="attribute vec3 a_outlineCoordinates;\n",y+="varying vec3 v_outlineCoordinates;\n"),O+=" vec3 weightedPosition = a_position;\n",A&&(O+=" vec3 weightedNormal = a_normal;\n"),w&&(O+=" vec4 weightedTangent = a_tangent;\n"),P)for(var F=0;F<v.length;F++){var N,B,V=v[F];for(N in V)V.hasOwnProperty(N)&&"extras"!==N&&(L[B="a_"+N+"_"+F]={semantic:N+"_"+F},y+="attribute vec3 "+B+";\n","POSITION"===N?O+=" weightedPosition += u_morphWeights["+F+"] * "+B+";\n":"NORMAL"===N?O+=" weightedNormal += u_morphWeights["+F+"] * "+B+";\n":w&&"TANGENT"===N&&(O+=" weightedTangent.xyz += u_morphWeights["+F+"] * "+B+";\n"))}O+=b?" vec4 position = skinMatrix * vec4(weightedPosition, 1.0);\n":" vec4 position = vec4(weightedPosition, 1.0);\n",O+=" position = u_modelViewMatrix * position;\n",A&&(O+=" v_positionEC = position.xyz;\n"),O+=" gl_Position = u_projectionMatrix * position;\n",D&&(O+=" v_outlineCoordinates = a_outlineCoordinates;\n"),A&&(L.a_normal={semantic:"NORMAL"},y+="attribute vec3 a_normal;\n",n||(y+="varying vec3 v_normal;\n",O+=b?" v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal;\n":" v_normal = u_normalMatrix * weightedNormal;\n",C+="varying vec3 v_normal;\n"),C+="varying vec3 v_positionEC;\n"),w&&(L.a_tangent={semantic:"TANGENT"},y+="attribute vec4 a_tangent;\n",y+="varying vec4 v_tangent;\n",O+=" v_tangent.xyz = u_normalMatrix * weightedTangent.xyz;\n",O+=" v_tangent.w = weightedTangent.w;\n",C+="varying vec4 v_tangent;\n"),D&&(C+="varying vec3 v_outlineCoordinates;\n");var k,z,$,U,G,H,W,P="";a&&(L.a_texcoord_0={semantic:"TEXCOORD_0"},y+="attribute vec2 a_texcoord_0;\n",y+="varying vec2 "+(W="v_texcoord_0")+";\n",O+=" "+W+" = a_texcoord_0;\n",C+="varying vec2 "+W+";\n",d&&(L.a_texcoord_1={semantic:"TEXCOORD_1"},y+="attribute vec2 a_texcoord_1;\n",y+="varying vec2 "+(H=W.replace("0","1"))+";\n",O+=" "+H+" = a_texcoord_1;\n",C+="varying vec2 "+H+";\n"),k=addTextureCoordinates(e,"u_normalTexture",r,W,d={fragmentShaderMain:P}),z=addTextureCoordinates(e,"u_baseColorTexture",r,W,d),$=addTextureCoordinates(e,"u_specularGlossinessTexture",r,W,d),U=addTextureCoordinates(e,"u_diffuseTexture",r,W,d),G=addTextureCoordinates(e,"u_metallicRoughnessTexture",r,W,d),H=addTextureCoordinates(e,"u_occlusionTexture",r,W,d),W=addTextureCoordinates(e,"u_emissiveTexture",r,W,d),P=d.fragmentShaderMain),b&&(L.a_joint={semantic:"JOINTS_0"},L.a_weight={semantic:"WEIGHTS_0"},y+="attribute vec4 a_joint;\n",y+="attribute vec4 a_weight;\n"),E&&(L.a_vertexColor={semantic:"COLOR_0"},y+="attribute vec4 a_vertexColor;\n",y+="varying vec4 v_vertexColor;\n",O+=" v_vertexColor = a_vertexColor;\n",C+="varying vec4 v_vertexColor;\n"),u&&(L.a_batchId={semantic:"_BATCHID"},y+="attribute float a_batchId;\n"),y+="void main(void) \n{\n",y+=O,y+="}\n",A&&!n&&(C+="const float M_PI = 3.141592653589793;\n",C+="vec3 lambertianDiffuse(vec3 diffuseColor) \n{\n return diffuseColor / M_PI;\n}\n\n",C+="vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\n",C+="vec3 fresnelSchlick(float metalness, float VdotH) \n{\n return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n}\n\n",C+="float smithVisibilityG1(float NdotV, float roughness) \n{\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\n\n",C+="float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\n\n",C+="float GGX(float roughness, float NdotH) \n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (M_PI * f * f);\n}\n\n"),C+="vec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\n\n",C+="vec4 SRGBtoLINEAR4(vec4 srgbIn) \n{\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n\n",C+="vec3 applyTonemapping(vec3 linearIn) \n{\n#ifndef HDR \n return czm_acesTonemapping(linearIn);\n#else \n return linearIn;\n#endif \n}\n\n",C+="vec3 LINEARtoSRGB(vec3 linearIn) \n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else \n return linearIn;\n#endif \n}\n\n",C+="vec2 computeTexCoord(vec2 texCoords, vec2 offset, float rotation, vec2 scale) \n{\n rotation = -rotation; \n mat3 transform = mat3(\n cos(rotation) * scale.x, sin(rotation) * scale.x, 0.0, \n -sin(rotation) * scale.y, cos(rotation) * scale.y, 0.0, \n offset.x, offset.y, 1.0); \n vec2 transformedTexCoords = (transform * vec3(fract(texCoords), 1.0)).xy; \n return transformedTexCoords; \n}\n\n",C+="#ifdef USE_IBL_LIGHTING \n",C+="uniform vec2 gltf_iblFactor; \n",C+="#endif \n",C+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",C+="uniform vec3 gltf_lightColor; \n",C+="#endif \n",C+="void main(void) \n{\n",C+=P,A&&!n&&(C+=" vec3 ng = normalize(v_normal);\n",C+=" vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0));\n",defined(r.u_normalTexture)?w?(C+=" vec3 t = normalize(v_tangent.xyz);\n",C+=" vec3 b = normalize(cross(ng, t) * v_tangent.w);\n",C+=" mat3 tbn = mat3(t, b, ng);\n",C+=" vec3 n = texture2D(u_normalTexture, "+k+").rgb;\n",C+=" n = normalize(tbn * (2.0 * n - 1.0));\n"):(C="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"+C,C+="#ifdef GL_OES_standard_derivatives\n",C+=" vec3 pos_dx = dFdx(v_positionEC);\n",C+=" vec3 pos_dy = dFdy(v_positionEC);\n",C+=" vec3 tex_dx = dFdx(vec3("+k+",0.0));\n",C+=" vec3 tex_dy = dFdy(vec3("+k+",0.0));\n",C+=" vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n",C+=" t = normalize(t - ng * dot(ng, t));\n",C+=" vec3 b = normalize(cross(ng, t));\n",C+=" mat3 tbn = mat3(t, b, ng);\n",C+=" vec3 n = texture2D(u_normalTexture, "+k+").rgb;\n",C+=" n = normalize(tbn * (2.0 * n - 1.0));\n",C+="#else\n",C+=" vec3 n = ng;\n",C+="#endif\n"):C+=" vec3 n = ng;\n",t.doubleSided&&(C+=" if (czm_backFacing())\n",C+=" {\n",C+=" n = -n;\n",C+=" }\n")),defined(r.u_baseColorTexture)?(C+=" vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, "+z+"));\n",defined(r.u_baseColorFactor)&&(C+=" baseColorWithAlpha *= u_baseColorFactor;\n")):defined(r.u_baseColorFactor)?C+=" vec4 baseColorWithAlpha = u_baseColorFactor;\n":C+=" vec4 baseColorWithAlpha = vec4(1.0);\n",E&&(C+=" baseColorWithAlpha *= v_vertexColor;\n"),C+=" vec3 baseColor = baseColorWithAlpha.rgb;\n",A&&!n?(f?(defined(r.u_specularGlossinessTexture)?(C+=" vec4 specularGlossiness = SRGBtoLINEAR4(texture2D(u_specularGlossinessTexture, "+$+"));\n",C+=" vec3 specular = specularGlossiness.rgb;\n",C+=" float glossiness = specularGlossiness.a;\n",defined(r.u_specularFactor)&&(C+=" specular *= u_specularFactor;\n"),defined(r.u_glossinessFactor)&&(C+=" glossiness *= u_glossinessFactor;\n")):(defined(r.u_specularFactor)?C+=" vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\n":C+=" vec3 specular = vec3(1.0);\n",defined(r.u_glossinessFactor)?C+=" float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\n":C+=" float glossiness = 1.0;\n"),defined(r.u_diffuseTexture)?(C+=" vec4 diffuse = SRGBtoLINEAR4(texture2D(u_diffuseTexture, "+U+"));\n",defined(r.u_diffuseFactor)&&(C+=" diffuse *= u_diffuseFactor;\n")):defined(r.u_diffuseFactor)?C+=" vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\n":C+=" vec4 diffuse = vec4(1.0);\n"):defined(r.u_metallicRoughnessTexture)?(C+=" vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, "+G+").rgb;\n",C+=" float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n",C+=" float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n",defined(r.u_metallicFactor)&&(C+=" metalness *= u_metallicFactor;\n"),defined(r.u_roughnessFactor)&&(C+=" roughness *= u_roughnessFactor;\n")):(defined(r.u_metallicFactor)?C+=" float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n":C+=" float metalness = 1.0;\n",defined(r.u_roughnessFactor)?C+=" float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n":C+=" float roughness = 1.0;\n"),C+=" vec3 v = -normalize(v_positionEC);\n",C+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",C+=" vec3 lightColorHdr = czm_lightColorHdr;\n",C+="#else \n",C+=" vec3 lightColorHdr = gltf_lightColor;\n",C+="#endif \n",C+=" vec3 l = normalize(czm_lightDirectionEC);\n",C+=" vec3 h = normalize(v + l);\n",C+=" float NdotL = clamp(dot(n, l), 0.001, 1.0);\n",C+=" float NdotV = abs(dot(n, v)) + 0.001;\n",C+=" float NdotH = clamp(dot(n, h), 0.0, 1.0);\n",C+=" float LdotH = clamp(dot(l, h), 0.0, 1.0);\n",C+=" float VdotH = clamp(dot(v, h), 0.0, 1.0);\n",C+=" vec3 f0 = vec3(0.04);\n",f?(C+=" float roughness = 1.0 - glossiness;\n",C+=" vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b));\n",C+=" vec3 specularColor = specular;\n"):(C+=" vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n",C+=" vec3 specularColor = mix(f0, baseColor, metalness);\n"),C+=" float alpha = roughness * roughness;\n",C+=" float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n",C+=" vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n",C+=" vec3 r0 = specularColor.rgb;\n",C+=" vec3 F = fresnelSchlick2(r0, r90, VdotH);\n",C+=" float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n",C+=" float D = GGX(alpha, NdotH);\n",C+=" vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n",C+=" vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n",C+=" vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution);\n",C+="#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL) \n",C+=" vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n",C+=" float vertexRadius = length(positionWC);\n",C+=" float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n",C+=" float reflectionDotNadir = dot(r, normalize(positionWC));\n",C+=" r.x = -r.x;\n",C+=" r = -normalize(czm_temeToPseudoFixed * r);\n",C+=" r.x = -r.x;\n",C+=" float inverseRoughness = 1.04 - roughness;\n",C+=" inverseRoughness *= inverseRoughness;\n",C+=" vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n",C+=" float atmosphereHeight = 0.05;\n",C+=" float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n",C+=" float blendRegionOffset = roughness * -1.0;\n",C+=" float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n",C+=" float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",C+=" float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n",C+=" float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n",C+=" vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n",C+=" vec3 nadirColor = belowHorizonColor * 0.5;\n",C+=" vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n",C+=" vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n",C+=" vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n",C+=" vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n",C+=" float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n",C+=" float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n",C+=" vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n",C+=" float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n",C+=" vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n",C+=" specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n",C+=" specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n",C+="#ifdef USE_SUN_LUMINANCE \n",C+=" float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0);\n",C+=" float S = acos(LdotZenith);\n",C+=" float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n",C+=" float gamma = acos(NdotL);\n",C+=" float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n",C+=" float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n",C+=" float luminance = gltf_luminanceAtZenith * (numerator / denominator);\n",C+="#endif \n",C+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",C+=" vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y);\n",C+=" float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\n",C+=" vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\n",C+=" IBLColor *= lightColor;\n",C+="#ifdef USE_SUN_LUMINANCE \n",C+=" color += IBLColor * luminance;\n",C+="#else \n",C+=" color += IBLColor; \n",C+="#endif \n",C+="#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) \n",C+=" const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0); \n",C+=" vec3 cubeDir = normalize(yUpToZUp * gltf_iblReferenceFrameMatrix * normalize(reflect(-v, n))); \n",C+="#ifdef DIFFUSE_IBL \n",C+="#ifdef CUSTOM_SPHERICAL_HARMONICS \n",C+=" vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients); \n",C+="#else \n",C+=" vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \n",C+="#endif \n",C+="#else \n",C+=" vec3 diffuseIrradiance = vec3(0.0); \n",C+="#endif \n",C+="#ifdef SPECULAR_IBL \n",C+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",C+="#ifdef CUSTOM_SPECULAR_IBL \n",C+=" vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir, roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD);\n",C+="#else \n",C+=" vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n",C+="#endif \n",C+=" specularIBL *= F * brdfLut.x + brdfLut.y;\n",C+="#else \n",C+=" vec3 specularIBL = vec3(0.0); \n",C+="#endif \n",C+=" color += diffuseIrradiance * diffuseColor + specularColor * specularIBL;\n",C+="#endif \n"):C+=" vec3 color = baseColor;\n",n||(defined(r.u_occlusionTexture)&&(C+=" color *= texture2D(u_occlusionTexture, "+H+").r;\n"),defined(r.u_emissiveTexture)?(C+=" vec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, "+W+").rgb);\n",defined(r.u_emissiveFactor)&&(C+=" emissive *= u_emissiveFactor;\n"),C+=" color += emissive;\n"):defined(r.u_emissiveFactor)&&(C+=" color += u_emissiveFactor;\n")),n||(C+=" color = applyTonemapping(color);\n"),C+=" color = LINEARtoSRGB(color);\n",D&&(C+=" float outlineness = max(\n",C+=" texture2D(u_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r,\n",C+=" max(\n",C+=" texture2D(u_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r,\n",C+=" texture2D(u_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r));\n",C+=" color = mix(color, vec3(0.0, 0.0, 0.0), outlineness);\n"),defined(x)?"MASK"===x?(C+=" if (baseColorWithAlpha.a < u_alphaCutoff) {\n",C+=" discard;\n",C+=" }\n",C+=" gl_FragColor = vec4(color, 1.0);\n"):C+="BLEND"===x?" gl_FragColor = vec4(color, baseColorWithAlpha.a);\n":" gl_FragColor = vec4(color, 1.0);\n":C+=" gl_FragColor = vec4(color, 1.0);\n",C+="}\n";x=addToArray(p,{type:WebGLConstants$1.VERTEX_SHADER,extras:{_pipeline:{source:y,extension:".glsl"}}}),p=addToArray(p,{type:WebGLConstants$1.FRAGMENT_SHADER,extras:{_pipeline:{source:C,extension:".glsl"}}}),x=addToArray(m,{fragmentShader:p,vertexShader:x});return addToArray(h,{attributes:L,program:x,uniforms:M})}function getPBRValueType(e){if(-1!==e.indexOf("Offset"))return WebGLConstants$1.FLOAT_VEC2;if(-1!==e.indexOf("Rotation"))return WebGLConstants$1.FLOAT;if(-1!==e.indexOf("Scale"))return WebGLConstants$1.FLOAT_VEC2;if(-1!==e.indexOf("Texture"))return WebGLConstants$1.SAMPLER_2D;switch(e){case"u_baseColorFactor":return WebGLConstants$1.FLOAT_VEC4;case"u_metallicFactor":case"u_roughnessFactor":return WebGLConstants$1.FLOAT;case"u_emissiveFactor":return WebGLConstants$1.FLOAT_VEC3;case"u_diffuseFactor":return WebGLConstants$1.FLOAT_VEC4;case"u_specularFactor":return WebGLConstants$1.FLOAT_VEC3;case"u_glossinessFactor":return WebGLConstants$1.FLOAT}}function Vector3DTileBatch(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var VectorTileVS="attribute vec3 position;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelViewProjection;\nvoid main()\n{\ngl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));\n}\n",tmp$5={},i4d,l4d,m4d,H4d,I4d,K4d,L4d,M4d;function F4d(e,t){var i=new Error(e+" at character "+t);throw i.index=t,i.description=e,i}function J4d(e){var t,i,r=0;for(i in e)(t=i.length)>r&&e.hasOwnProperty(i)&&(r=t);return r}function O4d(e){return I4d[e]||0}function P4d(e,t,i){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:i}}function Q4d(e){return 48<=e&&e<=57}function R4d(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||128<=e&&!I4d[String.fromCharCode(e)]}function T4d(r){for(var e,l=0,t=r.charAt,i=r.charCodeAt,n=function(e){return t.call(r,e)},a=function(e){return i.call(r,e)},o=r.length,s=function(){for(var e=a(l);32===e||9===e;)e=a(++l)},c=function(){var e,t,i=d();return s(),63!==a(l)?i:(l++,(e=c())||F4d("Expected expression",l),s(),58===a(l)?(l++,(t=c())||F4d("Expected expression",l),{type:"ConditionalExpression",test:i,consequent:e,alternate:t}):void F4d("Expected :",l))},u=function(){s();for(var e=r.substr(l,L4d),t=e.length;0<t;){if(I4d.hasOwnProperty(e))return l+=t,e;e=e.substr(0,--t)}return!1},d=function(){var e,t,i,r,n,a,o=h(),s=u();if(!s)return o;for(r={value:s,prec:O4d(s)},(n=h())||F4d("Expected expression after "+s,l),i=[o,r,n];(s=u())&&0!==(t=O4d(s));){for(r={value:s,prec:t};2<i.length&&t<=i[i.length-2].prec;)n=i.pop(),s=i.pop().value,o=i.pop(),e=P4d(s,o,n),i.push(e);(e=h())||F4d("Expected expression after "+s,l),i.push(r,e)}for(e=i[a=i.length-1];1<a;)e=P4d(i[a-1].value,i[a-2],e),a-=2;return e},h=function(){var e,t,i;if(s(),e=a(l),Q4d(e)||46===e)return p();if(39===e||34===e)return m();if(R4d(e)||40===e)return _();if(91===e)return C();for(i=(t=r.substr(l,K4d)).length;0<i;){if(H4d.hasOwnProperty(t))return l+=i,{type:"UnaryExpression",operator:t,argument:h(),prefix:!0};t=t.substr(0,--i)}return!1},p=function(){for(var e,t="";Q4d(a(l));)t+=n(l++);if(46===a(l))for(t+=n(l++);Q4d(a(l));)t+=n(l++);if("e"===(e=n(l))||"E"===e){for(t+=n(l++),"+"!==(e=n(l))&&"-"!==e||(t+=n(l++));Q4d(a(l));)t+=n(l++);Q4d(a(l-1))||F4d("Expected exponent ("+t+n(l)+")",l)}return e=a(l),R4d(e)?F4d("Variable names cannot start with a number ("+t+n(l)+")",l):46===e&&F4d("Unexpected period",l),{type:m4d,value:parseFloat(t),raw:t}},m=function(){for(var e,t="",i=n(l++),r=!1;l<o;){if((e=n(l++))===i){r=!0;break}if("\\"===e)switch(e=n(l++)){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+="\\"+e}else t+=e}return r||F4d('Unclosed quote after "'+t+'"',l),{type:m4d,value:t,raw:i+t+i}},f=function(){var e,t=a(l),i=l;for(R4d(t)?l++:F4d("Unexpected "+n(l),l);l<o&&(t=a(l),36===(e=t)||95===e||65<=e&&e<=90||97<=e&&e<=122||48<=e&&e<=57||128<=e&&!I4d[String.fromCharCode(e)]);)l++;return i=r.slice(i,l),M4d.hasOwnProperty(i)?{type:m4d,value:M4d[i],raw:i}:"this"===i?{type:"ThisExpression"}:{type:"Identifier",name:i}},g=function(e){for(var t,i=[],r=!1;l<o;){if(s(),(t=a(l))===e){r=!0,l++;break}44===t?l++:((t=c())&&"Compound"!==t.type||F4d("Expected comma",l),i.push(t))}return r||F4d("Expected "+String.fromCharCode(e),l),i},_=function(){var e=a(l),t=(40===e?y:f)();for(s(),e=a(l);46===e||91===e||40===e;)l++,46===e?(s(),t={type:l4d,computed:!1,object:t,property:f()}):91===e?(t={type:l4d,computed:!0,object:t,property:c()},s(),93!==(e=a(l))&&F4d("Unclosed [",l),l++):40===e&&(t={type:"CallExpression",arguments:g(41),callee:t}),s(),e=a(l);return t},y=function(){l++;var e=c();if(s(),41===a(l))return l++,e;F4d("Unclosed (",l)},C=function(){return l++,{type:"ArrayExpression",elements:g(93)}},v=[];l<o;)59===(e=a(l))||44===e?l++:(e=c())?v.push(e):l<o&&F4d('Unexpected "'+n(l)+'"',l);return 1===v.length?v[0]:{type:"Compound",body:v}}i4d=tmp$5,l4d="MemberExpression",m4d="Literal",H4d={"-":!0,"!":!0,"~":!0,"+":!0},I4d={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},K4d=J4d(H4d),L4d=J4d(I4d),M4d={true:!0,false:!1,null:null},T4d.version="0.3.1",T4d.toString=function(){return"JavaScript Expression Parser (JSEP) v"+T4d.version},T4d.addUnaryOp=function(e){return K4d=Math.max(e.length,K4d),H4d[e]=!0,this},T4d.addBinaryOp=function(e,t){return L4d=Math.max(e.length,L4d),I4d[e]=t,this},T4d.addLiteral=function(e,t){return M4d[e]=t,this},T4d.removeUnaryOp=function(e){return delete H4d[e],e.length===K4d&&(K4d=J4d(H4d)),this},T4d.removeAllUnaryOps=function(){return H4d={},K4d=0,this},T4d.removeBinaryOp=function(e){return delete I4d[e],e.length===L4d&&(L4d=J4d(I4d)),this},T4d.removeAllBinaryOps=function(){return I4d={},L4d=0,this},T4d.removeLiteral=function(e){return delete M4d[e],this},T4d.removeAllLiterals=function(){return M4d={},this},i4d.jsep=T4d;var jsep=tmp$5.jsep,ExpressionNodeType={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},ExpressionNodeType$1=Object.freeze(ExpressionNodeType);function Expression(e,t){var i;e=replaceVariables(removeBackslashes(e=replaceDefines(this._expression=e,t))),jsep.addBinaryOp("=~",0),jsep.addBinaryOp("!~",0);try{i=jsep(e)}catch(e){throw new RuntimeError(e)}this._runtimeAst=createRuntimeAst(this,i)}Object.defineProperties(Expression.prototype,{expression:{get:function(){return this._expression}}});var scratchStorage={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new Cartesian2],cartesian3Array:[new Cartesian3],cartesian4Array:[new Cartesian4],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);var e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new Cartesian2),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new Cartesian3),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new Cartesian4),this.cartesian4Array[this.cartesian4Index++]}};Expression.prototype.evaluate=function(e,t){scratchStorage.reset();e=this._runtimeAst.evaluate(e);return t instanceof Color&&e instanceof Cartesian4?Color.fromCartesian4(e,t):e instanceof Cartesian2||e instanceof Cartesian3||e instanceof Cartesian4?e.clone(t):e},Expression.prototype.evaluateColor=function(e,t){scratchStorage.reset();e=this._runtimeAst.evaluate(e);return Color.fromCartesian4(e,t)},Expression.prototype.getShaderFunction=function(e,t,i,r){return r+" "+e+"() \n{ \n return "+this.getShaderExpression(t,i)+"; \n} \n"},Expression.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};var unaryOperators=["!","-","+"],binaryOperators=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],variableRegex=/\${(.*?)}/g,backslashRegex=/\\/g,backslashReplacement="@#%",replacementRegex=/@#%/g,scratchColor$l=new Color,unaryFunctions={abs:getEvaluateUnaryComponentwise(Math.abs),sqrt:getEvaluateUnaryComponentwise(Math.sqrt),cos:getEvaluateUnaryComponentwise(Math.cos),sin:getEvaluateUnaryComponentwise(Math.sin),tan:getEvaluateUnaryComponentwise(Math.tan),acos:getEvaluateUnaryComponentwise(Math.acos),asin:getEvaluateUnaryComponentwise(Math.asin),atan:getEvaluateUnaryComponentwise(Math.atan),radians:getEvaluateUnaryComponentwise(CesiumMath.toRadians),degrees:getEvaluateUnaryComponentwise(CesiumMath.toDegrees),sign:getEvaluateUnaryComponentwise(CesiumMath.sign),floor:getEvaluateUnaryComponentwise(Math.floor),ceil:getEvaluateUnaryComponentwise(Math.ceil),round:getEvaluateUnaryComponentwise(Math.round),exp:getEvaluateUnaryComponentwise(Math.exp),exp2:getEvaluateUnaryComponentwise(exp2),log:getEvaluateUnaryComponentwise(Math.log),log2:getEvaluateUnaryComponentwise(log2),fract:getEvaluateUnaryComponentwise(fract),length:length$1,normalize:normalize},binaryFunctions={atan2:getEvaluateBinaryComponentwise(Math.atan2,!1),pow:getEvaluateBinaryComponentwise(Math.pow,!1),min:getEvaluateBinaryComponentwise(Math.min,!0),max:getEvaluateBinaryComponentwise(Math.max,!0),distance:distance,dot:dot,cross:cross},ternaryFunctions={clamp:getEvaluateTernaryComponentwise(CesiumMath.clamp,!0),mix:getEvaluateTernaryComponentwise(CesiumMath.lerp,!0)};function fract(e){return e-Math.floor(e)}function exp2(e){return Math.pow(2,e)}function log2(e){return CesiumMath.log2(e)}function getEvaluateUnaryComponentwise(i){return function(e,t){if("number"==typeof t)return i(t);if(t instanceof Cartesian2)return Cartesian2.fromElements(i(t.x),i(t.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(i(t.x),i(t.y),i(t.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(i(t.x),i(t.y),i(t.z),i(t.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}}function getEvaluateBinaryComponentwise(r,n){return function(e,t,i){if(n&&"number"==typeof i){if("number"==typeof t)return r(t,i);if(t instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i),r(t.y,i),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i),r(t.y,i),r(t.z,i),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(r(t.x,i),r(t.y,i),r(t.z,i),r(t.w,i),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i)return r(t,i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i.x),r(t.y,i.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i.x),r(t.y,i.y),r(t.z,i.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(r(t.x,i.x),r(t.y,i.y),r(t.z,i.z),r(t.w,i.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}}function getEvaluateTernaryComponentwise(n,a){return function(e,t,i,r){if(a&&"number"==typeof r){if("number"==typeof t&&"number"==typeof i)return n(t,i,r);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),n(t.z,i.z,r),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),n(t.z,i.z,r),n(t.w,i.w,r),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i&&"number"==typeof r)return n(t,i,r);if(t instanceof Cartesian2&&i instanceof Cartesian2&&r instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3&&r instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),n(t.z,i.z,r.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4&&r instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),n(t.z,i.z,r.z),n(t.w,i.w,r.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+", "+i+", and "+r+".")}}function length$1(e,t){if("number"==typeof t)return Math.abs(t);if(t instanceof Cartesian2)return Cartesian2.magnitude(t);if(t instanceof Cartesian3)return Cartesian3.magnitude(t);if(t instanceof Cartesian4)return Cartesian4.magnitude(t);throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function normalize(e,t){if("number"==typeof t)return 1;if(t instanceof Cartesian2)return Cartesian2.normalize(t,scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.normalize(t,scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.normalize(t,scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function distance(e,t,i){if("number"==typeof t&&"number"==typeof i)return Math.abs(t-i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.distance(t,i);if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.distance(t,i);if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.distance(t,i);throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function dot(e,t,i){if("number"==typeof t&&"number"==typeof i)return t*i;if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.dot(t,i);if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.dot(t,i);if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.dot(t,i);throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function cross(e,t,i){if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.cross(t,i,scratchStorage.getCartesian3());throw new RuntimeError('Function "'+e+'" requires vec3 arguments. Arguments are '+t+" and "+i+".")}function Node$1(e,t,i,r,n){this._type=e,this._value=t,this._left=i,this._right=r,this._test=n,this.evaluate=void 0,setEvaluateFunction(this)}function replaceDefines(e,t){if(!defined(t))return e;for(var i in t){var r;t.hasOwnProperty(i)&&(r=new RegExp("\\$\\{"+i+"\\}","g"),defined(i="("+t[i]+")")&&(e=e.replace(r,i)))}return e}function removeBackslashes(e){return e.replace(backslashRegex,backslashReplacement)}function replaceBackslashes(e){return e.replace(replacementRegex,"\\")}function replaceVariables(e){for(var t=e,i="",r=t.indexOf("${");0<=r;){var n,a=t.indexOf("'"),o=t.indexOf('"');if(0<=a&&a<r)n=t.indexOf("'",a+1),i+=t.substr(0,n+1),r=(t=t.substr(n+1)).indexOf("${");else if(0<=o&&o<r)n=t.indexOf('"',o+1),i+=t.substr(0,n+1),r=(t=t.substr(n+1)).indexOf("${");else{i+=t.substr(0,r);o=t.indexOf("}");if(o<0)throw new RuntimeError("Unmatched {.");i+="czm_"+t.substr(r+2,o-(r+2)),r=(t=t.substr(o+1)).indexOf("${")}}return i+=t}function parseLiteral(e){var t=typeof e.value;return null===e.value?new Node$1(ExpressionNodeType$1.LITERAL_NULL,null):"boolean"==t?new Node$1(ExpressionNodeType$1.LITERAL_BOOLEAN,e.value):"number"==t?new Node$1(ExpressionNodeType$1.LITERAL_NUMBER,e.value):"string"==t?0<=e.value.indexOf("${")?new Node$1(ExpressionNodeType$1.VARIABLE_IN_STRING,e.value):new Node$1(ExpressionNodeType$1.LITERAL_STRING,replaceBackslashes(e.value)):void 0}function parseCall(e,t){var i=t.arguments,r=i.length;if("MemberExpression"===t.callee.type){var n=t.callee.property.name,a=t.callee.object;if("test"===n||"exec"===n){if("regExp"!==a.callee.name)throw new RuntimeError(n+" is not a function.");return 0===r?"test"===n?new Node$1(ExpressionNodeType$1.LITERAL_BOOLEAN,!1):new Node$1(ExpressionNodeType$1.LITERAL_NULL,null):(c=createRuntimeAst(e,a),u=createRuntimeAst(e,i[0]),new Node$1(ExpressionNodeType$1.FUNCTION_CALL,n,c,u))}if("toString"===n)return s=createRuntimeAst(e,a),new Node$1(ExpressionNodeType$1.FUNCTION_CALL,n,s);throw new RuntimeError('Unexpected function call "'+n+'".')}if("color"===(n=t.callee.name)){if(0===r)return new Node$1(ExpressionNodeType$1.LITERAL_COLOR,n);if(s=createRuntimeAst(e,i[0]),defined(i[1])){var o=createRuntimeAst(e,i[1]);return new Node$1(ExpressionNodeType$1.LITERAL_COLOR,n,[s,o])}return new Node$1(ExpressionNodeType$1.LITERAL_COLOR,n,[s])}if("rgb"===n||"hsl"===n){if(r<3)throw new RuntimeError(n+" requires three arguments.");return s=[createRuntimeAst(e,i[0]),createRuntimeAst(e,i[1]),createRuntimeAst(e,i[2])],new Node$1(ExpressionNodeType$1.LITERAL_COLOR,n,s)}if("rgba"===n||"hsla"===n){if(r<4)throw new RuntimeError(n+" requires four arguments.");return s=[createRuntimeAst(e,i[0]),createRuntimeAst(e,i[1]),createRuntimeAst(e,i[2]),createRuntimeAst(e,i[3])],new Node$1(ExpressionNodeType$1.LITERAL_COLOR,n,s)}if("vec2"===n||"vec3"===n||"vec4"===n){for(var s=new Array(r),l=0;l<r;++l)s[l]=createRuntimeAst(e,i[l]);return new Node$1(ExpressionNodeType$1.LITERAL_VECTOR,n,s)}if("isNaN"===n||"isFinite"===n)return 0===r?new Node$1(ExpressionNodeType$1.LITERAL_BOOLEAN,"isNaN"===n):(s=createRuntimeAst(e,i[0]),new Node$1(ExpressionNodeType$1.UNARY,n,s));if("isExactClass"===n||"isClass"===n){if(r<1||1<r)throw new RuntimeError(n+" requires exactly one argument.");return s=createRuntimeAst(e,i[0]),new Node$1(ExpressionNodeType$1.UNARY,n,s)}if("getExactClassName"===n){if(0<r)throw new RuntimeError(n+" does not take any argument.");return new Node$1(ExpressionNodeType$1.UNARY,n)}if(defined(unaryFunctions[n])){if(1!==r)throw new RuntimeError(n+" requires exactly one argument.");return s=createRuntimeAst(e,i[0]),new Node$1(ExpressionNodeType$1.UNARY,n,s)}if(defined(binaryFunctions[n])){if(2!==r)throw new RuntimeError(n+" requires exactly two arguments.");return c=createRuntimeAst(e,i[0]),u=createRuntimeAst(e,i[1]),new Node$1(ExpressionNodeType$1.BINARY,n,c,u)}if(defined(ternaryFunctions[n])){if(3!==r)throw new RuntimeError(n+" requires exactly three arguments.");var c=createRuntimeAst(e,i[0]),u=createRuntimeAst(e,i[1]),o=createRuntimeAst(e,i[2]);return new Node$1(ExpressionNodeType$1.TERNARY,n,c,u,o)}if("Boolean"===n)return 0===r?new Node$1(ExpressionNodeType$1.LITERAL_BOOLEAN,!1):(s=createRuntimeAst(e,i[0]),new Node$1(ExpressionNodeType$1.UNARY,n,s));if("Number"===n)return 0===r?new Node$1(ExpressionNodeType$1.LITERAL_NUMBER,0):(s=createRuntimeAst(e,i[0]),new Node$1(ExpressionNodeType$1.UNARY,n,s));if("String"===n)return 0===r?new Node$1(ExpressionNodeType$1.LITERAL_STRING,""):(s=createRuntimeAst(e,i[0]),new Node$1(ExpressionNodeType$1.UNARY,n,s));if("regExp"===n)return parseRegex(e,t);throw new RuntimeError('Unexpected function call "'+n+'".')}function parseRegex(e,t){var i=t.arguments;if(0===i.length)return new Node$1(ExpressionNodeType$1.LITERAL_REGEX,new RegExp);var r,t=createRuntimeAst(e,i[0]);if(1<i.length){i=createRuntimeAst(e,i[1]);if(isLiteralType(t)&&isLiteralType(i)){try{r=new RegExp(replaceBackslashes(String(t._value)),i._value)}catch(e){throw new RuntimeError(e)}return new Node$1(ExpressionNodeType$1.LITERAL_REGEX,r)}return new Node$1(ExpressionNodeType$1.REGEX,t,i)}if(isLiteralType(t)){try{r=new RegExp(replaceBackslashes(String(t._value)))}catch(e){throw new RuntimeError(e)}return new Node$1(ExpressionNodeType$1.LITERAL_REGEX,r)}return new Node$1(ExpressionNodeType$1.REGEX,t)}function parseKeywordsAndVariables(e){if(isVariable(e.name)){var t=getPropertyName(e.name);return"tiles3d_"===t.substr(0,8)?new Node$1(ExpressionNodeType$1.BUILTIN_VARIABLE,t):new Node$1(ExpressionNodeType$1.VARIABLE,t)}if("NaN"===e.name)return new Node$1(ExpressionNodeType$1.LITERAL_NUMBER,NaN);if("Infinity"===e.name)return new Node$1(ExpressionNodeType$1.LITERAL_NUMBER,1/0);if("undefined"===e.name)return new Node$1(ExpressionNodeType$1.LITERAL_UNDEFINED,void 0);throw new RuntimeError(e.name+" is not defined.")}function parseMathConstant(e){e=e.property.name;return"PI"===e?new Node$1(ExpressionNodeType$1.LITERAL_NUMBER,Math.PI):"E"===e?new Node$1(ExpressionNodeType$1.LITERAL_NUMBER,Math.E):void 0}function parseNumberConstant(e){if("POSITIVE_INFINITY"===e.property.name)return new Node$1(ExpressionNodeType$1.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function parseMemberExpression(e,t){if("Math"===t.object.name)return parseMathConstant(t);if("Number"===t.object.name)return parseNumberConstant(t);var i,r=createRuntimeAst(e,t.object);return t.computed?(i=createRuntimeAst(e,t.property),new Node$1(ExpressionNodeType$1.MEMBER,"brackets",r,i)):(i=new Node$1(ExpressionNodeType$1.LITERAL_STRING,t.property.name),new Node$1(ExpressionNodeType$1.MEMBER,"dot",r,i))}function isLiteralType(e){return e._type>=ExpressionNodeType$1.LITERAL_NULL}function isVariable(e){return"czm_"===e.substr(0,4)}function getPropertyName(e){return e.substr(4)}function createRuntimeAst(e,t){if("Literal"===t.type)o=parseLiteral(t);else if("CallExpression"===t.type)o=parseCall(e,t);else if("Identifier"===t.type)o=parseKeywordsAndVariables(t);else if("UnaryExpression"===t.type){var i=t.operator,r=createRuntimeAst(e,t.argument);if(!(-1<unaryOperators.indexOf(i)))throw new RuntimeError('Unexpected operator "'+i+'".');o=new Node$1(ExpressionNodeType$1.UNARY,i,r)}else if("BinaryExpression"===t.type){if(i=t.operator,n=createRuntimeAst(e,t.left),a=createRuntimeAst(e,t.right),!(-1<binaryOperators.indexOf(i)))throw new RuntimeError('Unexpected operator "'+i+'".');o=new Node$1(ExpressionNodeType$1.BINARY,i,n,a)}else if("LogicalExpression"===t.type)i=t.operator,n=createRuntimeAst(e,t.left),a=createRuntimeAst(e,t.right),-1<binaryOperators.indexOf(i)&&(o=new Node$1(ExpressionNodeType$1.BINARY,i,n,a));else if("ConditionalExpression"===t.type)var i=createRuntimeAst(e,t.test),n=createRuntimeAst(e,t.consequent),a=createRuntimeAst(e,t.alternate),o=new Node$1(ExpressionNodeType$1.CONDITIONAL,"?",n,a,i);else if("MemberExpression"===t.type)o=parseMemberExpression(e,t);else{if("ArrayExpression"!==t.type)throw"Compound"===t.type?new RuntimeError("Provide exactly one expression."):new RuntimeError("Cannot parse expression.");for(var s=[],l=0;l<t.elements.length;l++)s[l]=createRuntimeAst(e,t.elements[l]);o=new Node$1(ExpressionNodeType$1.ARRAY,s)}return o}function setEvaluateFunction(e){e._type===ExpressionNodeType$1.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===ExpressionNodeType$1.FUNCTION_CALL?"test"===e._value?e.evaluate=e._evaluateRegExpTest:"exec"===e._value?e.evaluate=e._evaluateRegExpExec:"toString"===e._value&&(e.evaluate=e._evaluateToString):e._type===ExpressionNodeType$1.UNARY?"!"===e._value?e.evaluate=e._evaluateNot:"-"===e._value?e.evaluate=e._evaluateNegative:"+"===e._value?e.evaluate=e._evaluatePositive:"isNaN"===e._value?e.evaluate=e._evaluateNaN:"isFinite"===e._value?e.evaluate=e._evaluateIsFinite:"isExactClass"===e._value?e.evaluate=e._evaluateIsExactClass:"isClass"===e._value?e.evaluate=e._evaluateIsClass:"getExactClassName"===e._value?e.evaluate=e._evaluateGetExactClassName:"Boolean"===e._value?e.evaluate=e._evaluateBooleanConversion:"Number"===e._value?e.evaluate=e._evaluateNumberConversion:"String"===e._value?e.evaluate=e._evaluateStringConversion:defined(unaryFunctions[e._value])&&(e.evaluate=getEvaluateUnaryFunction(e._value)):e._type===ExpressionNodeType$1.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:defined(binaryFunctions[e._value])&&(e.evaluate=getEvaluateBinaryFunction(e._value)):e._type===ExpressionNodeType$1.TERNARY?e.evaluate=getEvaluateTernaryFunction(e._value):e._type===ExpressionNodeType$1.MEMBER?"brackets"===e._value?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===ExpressionNodeType$1.ARRAY?e.evaluate=e._evaluateArray:e._type===ExpressionNodeType$1.VARIABLE?e.evaluate=e._evaluateVariable:e._type===ExpressionNodeType$1.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===ExpressionNodeType$1.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===ExpressionNodeType$1.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===ExpressionNodeType$1.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===ExpressionNodeType$1.REGEX?e.evaluate=e._evaluateRegExp:e._type===ExpressionNodeType$1.BUILTIN_VARIABLE?"tiles3d_tileset_time"===e._value&&(e.evaluate=evaluateTilesetTime):e.evaluate=e._evaluateLiteral}function evaluateTilesetTime(e){return defined(e)?e.content.tileset.timeSinceLoad:0}function getEvaluateUnaryFunction(t){var i=unaryFunctions[t];return function(e){e=this._left.evaluate(e);return i(t,e)}}function getEvaluateBinaryFunction(i){var r=binaryFunctions[i];return function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return r(i,t,e)}}function getEvaluateTernaryFunction(r){var n=ternaryFunctions[r];return function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e),e=this._test.evaluate(e);return n(r,t,i,e)}}function getFeatureProperty(e,t){if(defined(e))return e.getProperty(t)}function checkFeature(e){return"feature"===e._value}function convertHSLToRGB(e){for(var t=e._left,i=t.length,r=0;r<i;++r)if(t[r]._type!==ExpressionNodeType$1.LITERAL_NUMBER)return;var n=t[0]._value,a=t[1]._value,o=t[2]._value,e=4===i?t[3]._value:1;return Color.fromHsl(n,a,o,e,scratchColor$l)}function convertRGBToColor(e){for(var t=e._left,i=t.length,r=0;r<i;++r)if(t[r]._type!==ExpressionNodeType$1.LITERAL_NUMBER)return;e=scratchColor$l;return e.red=t[0]._value/255,e.green=t[1]._value/255,e.blue=t[2]._value/255,e.alpha=4===i?t[3]._value:1,e}function numberToString(e){return e%1==0?e.toFixed(1):e.toString()}function colorToVec3(e){return"vec3("+numberToString(e.red)+", "+numberToString(e.green)+", "+numberToString(e.blue)+")"}function colorToVec4(e){return"vec4("+numberToString(e.red)+", "+numberToString(e.green)+", "+numberToString(e.blue)+", "+numberToString(e.alpha)+")"}function getExpressionArray(e,t,i,r){for(var n=e.length,a=new Array(n),o=0;o<n;++o)a[o]=e[o].getShaderExpression(t,i,r);return a}function getVariableName(e,t){if(!defined(t[e]))throw new RuntimeError('Style references a property "'+e+'" that does not exist or is not styleable.');return t[e]}Node$1.prototype._evaluateLiteral=function(){return this._value},Node$1.prototype._evaluateLiteralColor=function(e){var t,i=scratchColor$l,r=this._left;return"color"===this._value?defined(r)?1<r.length?(Color.fromCssColorString(r[0].evaluate(e),i),i.alpha=r[1].evaluate(e)):Color.fromCssColorString(r[0].evaluate(e),i):Color.fromBytes(255,255,255,255,i):"rgb"===this._value?Color.fromBytes(r[0].evaluate(e),r[1].evaluate(e),r[2].evaluate(e),255,i):"rgba"===this._value?(t=255*r[3].evaluate(e),Color.fromBytes(r[0].evaluate(e),r[1].evaluate(e),r[2].evaluate(e),t,i)):"hsl"===this._value?Color.fromHsl(r[0].evaluate(e),r[1].evaluate(e),r[2].evaluate(e),1,i):"hsla"===this._value&&Color.fromHsl(r[0].evaluate(e),r[1].evaluate(e),r[2].evaluate(e),r[3].evaluate(e),i),Cartesian4.fromColor(i,scratchStorage.getCartesian4())},Node$1.prototype._evaluateLiteralVector=function(e){for(var t=scratchStorage.getArray(),i=this._value,r=this._left,n=r.length,a=0;a<n;++a){var o=r[a].evaluate(e);if("number"==typeof o)t.push(o);else if(o instanceof Cartesian2)t.push(o.x,o.y);else if(o instanceof Cartesian3)t.push(o.x,o.y,o.z);else{if(!(o instanceof Cartesian4))throw new RuntimeError(i+" argument must be a vector or number. Argument is "+o+".");t.push(o.x,o.y,o.z,o.w)}}var s=t.length,l=parseInt(i.charAt(3));if(0===s)throw new RuntimeError("Invalid "+i+" constructor. No valid arguments.");if(s<l&&1<s)throw new RuntimeError("Invalid "+i+" constructor. Not enough arguments.");if(l<s&&1<n)throw new RuntimeError("Invalid "+i+" constructor. Too many arguments.");return 1===s&&(s=t[0],t.push(s,s,s)),"vec2"===i?Cartesian2.fromArray(t,0,scratchStorage.getCartesian2()):"vec3"===i?Cartesian3.fromArray(t,0,scratchStorage.getCartesian3()):"vec4"===i?Cartesian4.fromArray(t,0,scratchStorage.getCartesian4()):void 0},Node$1.prototype._evaluateLiteralString=function(){return this._value},Node$1.prototype._evaluateVariableString=function(e){for(var t=this._value,i=variableRegex.exec(t);null!==i;){var r=i[0],n=getFeatureProperty(e,i[1]);defined(n)||(n=""),t=t.replace(r,n),i=variableRegex.exec(t)}return t},Node$1.prototype._evaluateVariable=function(e){return getFeatureProperty(e,this._value)},Node$1.prototype._evaluateMemberDot=function(e){if(checkFeature(this._left))return getFeatureProperty(e,this._right.evaluate(e));var t=this._left.evaluate(e);if(defined(t)){e=this._right.evaluate(e);if(t instanceof Cartesian2||t instanceof Cartesian3||t instanceof Cartesian4){if("r"===e)return t.x;if("g"===e)return t.y;if("b"===e)return t.z;if("a"===e)return t.w}return t[e]}},Node$1.prototype._evaluateMemberBrackets=function(e){if(checkFeature(this._left))return getFeatureProperty(e,this._right.evaluate(e));var t=this._left.evaluate(e);if(defined(t)){e=this._right.evaluate(e);if(t instanceof Cartesian2||t instanceof Cartesian3||t instanceof Cartesian4){if(0===e||"r"===e)return t.x;if(1===e||"g"===e)return t.y;if(2===e||"b"===e)return t.z;if(3===e||"a"===e)return t.w}return t[e]}},Node$1.prototype._evaluateArray=function(e){for(var t=[],i=0;i<this._value.length;i++)t[i]=this._value[i].evaluate(e);return t},Node$1.prototype._evaluateNot=function(e){e=this._left.evaluate(e);if("boolean"!=typeof e)throw new RuntimeError('Operator "!" requires a boolean argument. Argument is '+e+".");return!e},Node$1.prototype._evaluateNegative=function(e){e=this._left.evaluate(e);if(e instanceof Cartesian2)return Cartesian2.negate(e,scratchStorage.getCartesian2());if(e instanceof Cartesian3)return Cartesian3.negate(e,scratchStorage.getCartesian3());if(e instanceof Cartesian4)return Cartesian4.negate(e,scratchStorage.getCartesian4());if("number"==typeof e)return-e;throw new RuntimeError('Operator "-" requires a vector or number argument. Argument is '+e+".")},Node$1.prototype._evaluatePositive=function(e){e=this._left.evaluate(e);if(!(e instanceof Cartesian2||e instanceof Cartesian3||e instanceof Cartesian4||"number"==typeof e))throw new RuntimeError('Operator "+" requires a vector or number argument. Argument is '+e+".");return e},Node$1.prototype._evaluateLessThan=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof e)throw new RuntimeError('Operator "<" requires number arguments. Arguments are '+t+" and "+e+".");return t<e},Node$1.prototype._evaluateLessThanOrEquals=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof e)throw new RuntimeError('Operator "<=" requires number arguments. Arguments are '+t+" and "+e+".");return t<=e},Node$1.prototype._evaluateGreaterThan=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof e)throw new RuntimeError('Operator ">" requires number arguments. Arguments are '+t+" and "+e+".");return e<t},Node$1.prototype._evaluateGreaterThanOrEquals=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof e)throw new RuntimeError('Operator ">=" requires number arguments. Arguments are '+t+" and "+e+".");return e<=t},Node$1.prototype._evaluateOr=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "||" requires boolean arguments. First argument is '+t+".");if(t)return!0;e=this._right.evaluate(e);if("boolean"!=typeof e)throw new RuntimeError('Operator "||" requires boolean arguments. Second argument is '+e+".");return t||e},Node$1.prototype._evaluateAnd=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "&&" requires boolean arguments. First argument is '+t+".");if(!t)return!1;e=this._right.evaluate(e);if("boolean"!=typeof e)throw new RuntimeError('Operator "&&" requires boolean arguments. Second argument is '+e+".");return t&&e},Node$1.prototype._evaluatePlus=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.add(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.add(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.add(t,e,scratchStorage.getCartesian4());if("string"==typeof t||"string"==typeof e)return t+e;if("number"==typeof t&&"number"==typeof e)return t+e;throw new RuntimeError('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateMinus=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.subtract(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.subtract(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.subtract(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t-e;throw new RuntimeError('Operator "-" requires vector or number arguments of matching types. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateTimes=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.multiplyComponents(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian2&&"number"==typeof t)return Cartesian2.multiplyByScalar(e,t,scratchStorage.getCartesian2());if(t instanceof Cartesian2&&"number"==typeof e)return Cartesian2.multiplyByScalar(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.multiplyComponents(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian3&&"number"==typeof t)return Cartesian3.multiplyByScalar(e,t,scratchStorage.getCartesian3());if(t instanceof Cartesian3&&"number"==typeof e)return Cartesian3.multiplyByScalar(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.multiplyComponents(t,e,scratchStorage.getCartesian4());if(e instanceof Cartesian4&&"number"==typeof t)return Cartesian4.multiplyByScalar(e,t,scratchStorage.getCartesian4());if(t instanceof Cartesian4&&"number"==typeof e)return Cartesian4.multiplyByScalar(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t*e;throw new RuntimeError('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateDivide=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.divideComponents(t,e,scratchStorage.getCartesian2());if(t instanceof Cartesian2&&"number"==typeof e)return Cartesian2.divideByScalar(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.divideComponents(t,e,scratchStorage.getCartesian3());if(t instanceof Cartesian3&&"number"==typeof e)return Cartesian3.divideByScalar(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.divideComponents(t,e,scratchStorage.getCartesian4());if(t instanceof Cartesian4&&"number"==typeof e)return Cartesian4.divideByScalar(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t/e;throw new RuntimeError('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateMod=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.fromElements(t.x%e.x,t.y%e.y,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.fromElements(t.x%e.x,t.y%e.y,t.z%e.z,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.fromElements(t.x%e.x,t.y%e.y,t.z%e.z,t.w%e.w,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t%e;throw new RuntimeError('Operator "%" requires vector or number arguments of matching types. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateEqualsStrict=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return e instanceof Cartesian2&&t instanceof Cartesian2||e instanceof Cartesian3&&t instanceof Cartesian3||e instanceof Cartesian4&&t instanceof Cartesian4?t.equals(e):t===e},Node$1.prototype._evaluateNotEqualsStrict=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return e instanceof Cartesian2&&t instanceof Cartesian2||e instanceof Cartesian3&&t instanceof Cartesian3||e instanceof Cartesian4&&t instanceof Cartesian4?!t.equals(e):t!==e},Node$1.prototype._evaluateConditional=function(e){var t=this._test.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError("Conditional argument of conditional expression must be a boolean. Argument is "+t+".");return(t?this._left:this._right).evaluate(e)},Node$1.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))},Node$1.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))},Node$1.prototype._evaluateIsExactClass=function(e){return!!defined(e)&&e.isExactClass(this._left.evaluate(e))},Node$1.prototype._evaluateIsClass=function(e){return!!defined(e)&&e.isClass(this._left.evaluate(e))},Node$1.prototype._evaluateGetExactClassName=function(e){if(defined(e))return e.getExactClassName()},Node$1.prototype._evaluateBooleanConversion=function(e){return Boolean(this._left.evaluate(e))},Node$1.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))},Node$1.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))},Node$1.prototype._evaluateRegExp=function(e){var t,i=this._value.evaluate(e),r="";defined(this._left)&&(r=this._left.evaluate(e));try{t=new RegExp(i,r)}catch(e){throw new RuntimeError(e)}return t},Node$1.prototype._evaluateRegExpTest=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof e))throw new RuntimeError("RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+e+".");return t.test(e)},Node$1.prototype._evaluateRegExpMatch=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof e)return t.test(e);if(e instanceof RegExp&&"string"==typeof t)return e.test(t);throw new RuntimeError('Operator "=~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateRegExpNotMatch=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof e)return!t.test(e);if(e instanceof RegExp&&"string"==typeof t)return!e.test(t);throw new RuntimeError('Operator "!~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+e+".")},Node$1.prototype._evaluateRegExpExec=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof e))throw new RuntimeError("RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+e+".");e=t.exec(e);return defined(e)?e[1]:null},Node$1.prototype._evaluateToString=function(e){e=this._left.evaluate(e);if(e instanceof RegExp||e instanceof Cartesian2||e instanceof Cartesian3||e instanceof Cartesian4)return String(e);throw new RuntimeError('Unexpected function call "'+this._value+'".')};var nullSentinel="czm_infinity";function Vector3DTilePrimitive(e){e=defaultValue(e,defaultValue.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=defaultValue(e.center,Cartesian3.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=Color.clone(Color.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=defaultValue(e.classificationType,ClassificationType$1.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={};for(var t=this._batchIds.length,i=0;i<t;++i){var r=this._batchIds[i];this._batchIdLookUp[r]=i}}Node$1.prototype.getShaderExpression=function(e,t,i){var r,n,a,o,s=this._type,l=this._value;switch(defined(this._left)&&(n=Array.isArray(this._left)?getExpressionArray(this._left,e,t,this):this._left.getShaderExpression(e,t,this)),defined(this._right)&&(a=this._right.getShaderExpression(e,t,this)),defined(this._test)&&(o=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(l=getExpressionArray(this._value,e,t,this)),s){case ExpressionNodeType$1.VARIABLE:return checkFeature(this)?void 0:getVariableName(l,e);case ExpressionNodeType$1.UNARY:if("Boolean"===l)return"bool("+n+")";if("Number"===l)return"float("+n+")";if("round"===l)return"floor("+n+" + 0.5)";if(defined(unaryFunctions[l]))return l+"("+n+")";if("isNaN"===l)return"("+n+" != "+n+")";if("isFinite"===l)return"(abs("+n+") < czm_infinity)";if("String"===l||"isExactClass"===l||"isClass"===l||"getExactClassName"===l)throw new RuntimeError('Error generating style shader: "'+l+'" is not supported.');return l+n;case ExpressionNodeType$1.BINARY:return"%"===l?"mod("+n+", "+a+")":"==="===l?"("+n+" == "+a+")":"!=="===l?"("+n+" != "+a+")":"atan2"===l?"atan("+n+", "+a+")":defined(binaryFunctions[l])?l+"("+n+", "+a+")":"("+n+" "+l+" "+a+")";case ExpressionNodeType$1.TERNARY:if(defined(ternaryFunctions[l]))return l+"("+n+", "+a+", "+o+")";break;case ExpressionNodeType$1.CONDITIONAL:return"("+o+" ? "+n+" : "+a+")";case ExpressionNodeType$1.MEMBER:return checkFeature(this._left)?getVariableName(a,e):"r"===a||"x"===a||"0.0"===a?n+"[0]":"g"===a||"y"===a||"1.0"===a?n+"[1]":"b"===a||"z"===a||"2.0"===a?n+"[2]":"a"===a||"w"===a||"3.0"===a?n+"[3]":n+"[int("+a+")]";case ExpressionNodeType$1.FUNCTION_CALL:throw new RuntimeError('Error generating style shader: "'+l+'" is not supported.');case ExpressionNodeType$1.ARRAY:if(4===l.length)return"vec4("+l[0]+", "+l[1]+", "+l[2]+", "+l[3]+")";if(3===l.length)return"vec3("+l[0]+", "+l[1]+", "+l[2]+")";if(2===l.length)return"vec2("+l[0]+", "+l[1]+")";throw new RuntimeError("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case ExpressionNodeType$1.REGEX:throw new RuntimeError("Error generating style shader: Regular expressions are not supported.");case ExpressionNodeType$1.VARIABLE_IN_STRING:throw new RuntimeError("Error generating style shader: Converting a variable to a string is not supported.");case ExpressionNodeType$1.LITERAL_NULL:return nullSentinel;case ExpressionNodeType$1.LITERAL_BOOLEAN:return l?"true":"false";case ExpressionNodeType$1.LITERAL_NUMBER:return numberToString(l);case ExpressionNodeType$1.LITERAL_STRING:if(defined(i)&&i._type===ExpressionNodeType$1.MEMBER&&("r"===l||"g"===l||"b"===l||"a"===l||"x"===l||"y"===l||"z"===l||"w"===l||checkFeature(i._left)))return l;if(defined(r=Color.fromCssColorString(l,scratchColor$l)))return colorToVec3(r);throw new RuntimeError("Error generating style shader: String literals are not supported.");case ExpressionNodeType$1.LITERAL_COLOR:var c=n;if("color"===l){if(!defined(c))return"vec4(1.0)";if(1<c.length){var u=c[0],d=c[1];return"1.0"!==d&&(t.translucent=!0),"vec4("+u+", "+d+")"}return"vec4("+c[0]+", 1.0)"}if("rgb"===l)return defined(r=convertRGBToColor(this))?colorToVec4(r):"vec4("+c[0]+" / 255.0, "+c[1]+" / 255.0, "+c[2]+" / 255.0, 1.0)";if("rgba"===l)return"1.0"!==c[3]&&(t.translucent=!0),defined(r=convertRGBToColor(this))?colorToVec4(r):"vec4("+c[0]+" / 255.0, "+c[1]+" / 255.0, "+c[2]+" / 255.0, "+c[3]+")";if("hsl"===l)return defined(r=convertHSLToRGB(this))?colorToVec4(r):"vec4(czm_HSLToRGB(vec3("+c[0]+", "+c[1]+", "+c[2]+")), 1.0)";if("hsla"===l)return defined(r=convertHSLToRGB(this))?(1!==r.alpha&&(t.translucent=!0),colorToVec4(r)):("1.0"!==c[3]&&(t.translucent=!0),"vec4(czm_HSLToRGB(vec3("+c[0]+", "+c[1]+", "+c[2]+")), "+c[3]+")");break;case ExpressionNodeType$1.LITERAL_VECTOR:for(var h=n.length,p=l+"(",m=0;m<h;++m)p+=n[m],m<h-1&&(p+=", ");return p+=")";case ExpressionNodeType$1.LITERAL_REGEX:throw new RuntimeError("Error generating style shader: Regular expressions are not supported.");case ExpressionNodeType$1.LITERAL_UNDEFINED:return nullSentinel;case ExpressionNodeType$1.BUILTIN_VARIABLE:if("tiles3d_tileset_time"===l)return"u_time"}},Object.defineProperties(Vector3DTilePrimitive.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var defaultAttributeLocations={position:0,a_batchId:1};function createVertexArray$4(e,t){var i,r,n;defined(e._va)||(i=Buffer$1.createVertexBuffer({context:t,typedArray:e._positions,usage:BufferUsage$1.STATIC_DRAW}),n=Buffer$1.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:BufferUsage$1.STATIC_DRAW}),r=Buffer$1.createIndexBuffer({context:t,typedArray:e._indices,usage:BufferUsage$1.DYNAMIC_DRAW,indexDatatype:2===e._indices.BYTES_PER_ELEMENT?IndexDatatype$1.UNSIGNED_SHORT:IndexDatatype$1.UNSIGNED_INT}),n=[{index:0,vertexBuffer:i,componentDatatype:ComponentDatatype$1.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:n,componentDatatype:ComponentDatatype$1.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}],e._va=new VertexArray({context:t,attributes:n,indexBuffer:r}),t.webgl2&&(e._vaSwap=new VertexArray({context:t,attributes:n,indexBuffer:Buffer$1.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:BufferUsage$1.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._verticesPromise=void 0)}function createShaders$3(e,t){if(!defined(e._sp)){var i=e._batchTable,r=defaultValue(e._attributeLocations,defaultAttributeLocations),n=e._pickId,a=e._vertexShaderSource,o=e._fragmentShaderSource;if(defined(a))return e._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:r}),e._spStencil=e._sp,o=ShaderSource.replaceMain(o,"czm_non_pick_main"),void(e._spPick=ShaderProgram.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:o+"void main() \n{ \n czm_non_pick_main(); \n gl_FragColor = "+n+"; \n} \n",attributeLocations:r}));var s=i.getVertexShaderCallback(!1,"a_batchId",void 0)(VectorTileVS),a=i.getFragmentShaderCallback(!1,void 0,!0)(ShadowVolumeFS),n=i.getPickId(),o=new ShaderSource({sources:[s]}),i=new ShaderSource({defines:["VECTOR_TILE"],sources:[a]});e._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:i,attributeLocations:r}),o=new ShaderSource({sources:[VectorTileVS]}),i=new ShaderSource({defines:["VECTOR_TILE"],sources:[ShadowVolumeFS]}),e._spStencil=ShaderProgram.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:i,attributeLocations:r});a=ShaderSource.replaceMain(a,"czm_non_pick_main")+"\nvoid main() \n{ \n czm_non_pick_main(); \n gl_FragColor = "+n+"; \n} \n",s=new ShaderSource({sources:[s]}),a=new ShaderSource({defines:["VECTOR_TILE"],sources:[a]});e._spPick=ShaderProgram.fromCache({context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:r})}}function getStencilDepthRenderState(e){e=e?StencilFunction$1.EQUAL:StencilFunction$1.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.DECREMENT_WRAP,zPass:StencilOperation$1.KEEP},backFunction:e,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.INCREMENT_WRAP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},depthMask:!1}}var colorRenderState={stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND},pickRenderState={stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.ZERO,zFail:StencilOperation$1.ZERO,zPass:StencilOperation$1.ZERO},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function createRenderStates$4(e){defined(e._rsStencilDepthPass)||(e._rsStencilDepthPass=RenderState.fromCache(getStencilDepthRenderState(!1)),e._rsStencilDepthPass3DTiles=RenderState.fromCache(getStencilDepthRenderState(!0)),e._rsColorPass=RenderState.fromCache(colorRenderState),e._rsPickPass=RenderState.fromCache(pickRenderState))}var modifiedModelViewScratch$3=new Matrix4,rtcScratch$3=new Cartesian3;function createUniformMap$6(i,r){var e;defined(i._uniformMap)||(e={u_modifiedModelViewProjection:function(){var e=r.uniformState.view,t=r.uniformState.projection;return Matrix4.clone(e,modifiedModelViewScratch$3),Matrix4.multiplyByPoint(modifiedModelViewScratch$3,i._center,rtcScratch$3),Matrix4.setTranslation(modifiedModelViewScratch$3,rtcScratch$3,modifiedModelViewScratch$3),Matrix4.multiply(t,modifiedModelViewScratch$3,modifiedModelViewScratch$3),modifiedModelViewScratch$3},u_highlightColor:function(){return i._highlightColor}},i._uniformMap=i._batchTable.getUniformMapCallback()(e))}function copyIndicesCPU(e,t,i,r,n,a,o){for(var s=e.constructor.BYTES_PER_ELEMENT,l=a.length,c=0;c<l;++c){var u=o[a[c]],d=r[u],h=n[u],d=new e.constructor(e.buffer,s*d,h);t.set(d,i),r[u]=i,i+=h}return i}function rebatchCPU(e,t){var i=e._indices,r=e._indexOffsets,n=e._indexCounts,a=e._batchIdLookUp,o=new i.constructor(i.length),s=t.pop(),l=[s],c=copyIndicesCPU(i,o,0,r,n,s.batchIds,a);for(s.offset=0,s.count=c;0<t.length;){var u,d=t.pop();Color.equals(d.color,s.color)?(c=copyIndicesCPU(i,o,c,r,n,d.batchIds,a),s.batchIds=s.batchIds.concat(d.batchIds),s.count=c-s.offset):(c=copyIndicesCPU(i,o,u=c,r,n,d.batchIds,a),d.offset=u,d.count=c-u,l.push(d),s=d)}e._va.indexBuffer.copyFromArrayView(o),e._indices=o,e._batchedIndices=l}function copyIndicesGPU(e,t,i,r,n,a,o){for(var s=e.bytesPerIndex,l=a.length,c=0;c<l;++c){var u=o[a[c]],d=r[u],h=n[u];t.copyFromBuffer(e,d*s,i*s,h*s),r[u]=i,i+=h}return i}function rebatchGPU(e,t){var i=e._indexOffsets,r=e._indexCounts,n=e._batchIdLookUp,a=t.pop(),o=[a],s=e._va.indexBuffer,l=e._vaSwap.indexBuffer,c=copyIndicesGPU(s,l,0,i,r,a.batchIds,n);for(a.offset=0,a.count=c;0<t.length;){var u,d=t.pop();Color.equals(d.color,a.color)?(c=copyIndicesGPU(s,l,c,i,r,d.batchIds,n),a.batchIds=a.batchIds.concat(d.batchIds),a.count=c-a.offset):(c=copyIndicesGPU(s,l,u=c,i,r,d.batchIds,n),d.offset=u,d.count=c-u,o.push(d),a=d)}var h=e._va;e._va=e._vaSwap,e._vaSwap=h,e._batchedIndices=o}function compareColors(e,t){return t.color.toRgba()-e.color.toRgba()}function rebatchCommands(e,t){if(!e._batchDirty)return!1;for(var i=e._batchedIndices,r=i.length,n=!1,a={},o=0;o<r;++o){var s=i[o].color.toRgba();if(defined(a[s])){n=!0;break}a[s]=!0}return n?n&&!e.forceRebatch&&e._framesSinceLastRebatch<120?void++e._framesSinceLastRebatch:(i.sort(compareColors),(t.webgl2?rebatchGPU:rebatchCPU)(e,i),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0):e._batchDirty=!1}function createColorCommands(e,t){var i=rebatchCommands(e,t),r=e._commands,n=e._batchedIndices,a=n.length,t=2*a;if(!defined(r)||i||r.length!==t){r.length=t;for(var o=e._va,s=e._sp,l=defaultValue(e._modelMatrix,Matrix4.IDENTITY),c=e._uniformMap,u=e._boundingVolume,d=0;d<a;++d){var h=n[d].offset,p=n[d].count,m=r[2*d];(m=!defined(m)?r[2*d]=new DrawCommand({owner:e}):m).vertexArray=o,m.modelMatrix=l,m.offset=h,m.count=p,m.renderState=e._rsStencilDepthPass,m.shaderProgram=s,m.uniformMap=c,m.boundingVolume=u,m.cull=!1,m.pass=Pass$1.TERRAIN_CLASSIFICATION;var f=DrawCommand.shallowClone(m,m.derivedCommands.tileset);f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=f;f=r[2*d+1];(f=!defined(f)?r[2*d+1]=new DrawCommand({owner:e}):f).vertexArray=o,f.modelMatrix=l,f.offset=h,f.count=p,f.renderState=e._rsColorPass,f.shaderProgram=s,f.uniformMap=c,f.boundingVolume=u,f.cull=!1,f.pass=Pass$1.TERRAIN_CLASSIFICATION;p=DrawCommand.shallowClone(f,f.derivedCommands.tileset);p.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=p}e._commandsDirty=!0}}function createColorCommandsIgnoreShow(e,t){if(e.classificationType!==ClassificationType$1.TERRAIN&&t.invertClassification&&(!defined(e._commandsIgnoreShow)||e._commandsDirty)){for(var i=e._commands,r=e._commandsIgnoreShow,n=e._spStencil,t=i.length,a=r.length=t/2,o=0,s=0;s<a;++s){var l=r[s]=DrawCommand.shallowClone(i[o],r[s]);l.shaderProgram=n,l.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o+=2}e._commandsDirty=!1}}function createPickCommands(e){if(e._pickCommandsDirty){var t=e._indexOffsets.length,i=e._pickCommands;i.length=2*t;for(var r=e._va,n=e._spStencil,a=e._spPick,o=defaultValue(e._modelMatrix,Matrix4.IDENTITY),s=e._uniformMap,l=0;l<t;++l){var c=e._indexOffsets[l],u=e._indexCounts[l],d=defined(e._boundingVolumes)?e._boundingVolumes[l]:e.boundingVolume,h=i[2*l];(h=!defined(h)?i[2*l]=new DrawCommand({owner:e,pickOnly:!0}):h).vertexArray=r,h.modelMatrix=o,h.offset=c,h.count=u,h.renderState=e._rsStencilDepthPass,h.shaderProgram=n,h.uniformMap=s,h.boundingVolume=d,h.pass=Pass$1.TERRAIN_CLASSIFICATION;var p=DrawCommand.shallowClone(h,h.derivedCommands.tileset);p.renderState=e._rsStencilDepthPass3DTiles,p.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=p;p=i[2*l+1];(p=!defined(p)?i[2*l+1]=new DrawCommand({owner:e,pickOnly:!0}):p).vertexArray=r,p.modelMatrix=o,p.offset=c,p.count=u,p.renderState=e._rsPickPass,p.shaderProgram=a,p.uniformMap=s,p.boundingVolume=d,p.pass=Pass$1.TERRAIN_CLASSIFICATION;d=DrawCommand.shallowClone(p,p.derivedCommands.tileset);d.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=d}e._pickCommandsDirty=!1}}function clearStyle$3(e,t){e._updatingAllCommands=!0;for(var i=e._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.show=!0,a.color=Color.WHITE}var o=e._batchedIndices,r=o.length;for(n=0;n<r;++n)o[n].color=Color.clone(Color.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}Vector3DTilePrimitive.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=i[n];t[a]=new Cesium3DTileFeature(e,a)}},Vector3DTilePrimitive.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var scratchColor$k=new Color,DEFAULT_COLOR_VALUE$2=Color.WHITE,DEFAULT_SHOW_VALUE$2=!0,complexExpressionReg=/\$/;function queueCommands$2(e,t,i,r){for(var n,e=e.classificationType,a=e!==ClassificationType$1.CESIUM_3D_TILE,o=e!==ClassificationType$1.TERRAIN,s=t.commandList,l=i.length,c=0;c<l;++c)a&&((n=i[c]).pass=Pass$1.TERRAIN_CLASSIFICATION,s.push(n)),o&&((n=i[c].derivedCommands.tileset).pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,s.push(n));if(t.invertClassification&&defined(r))for(l=r.length,c=0;c<l;++c)s.push(r[c])}function queueWireframeCommands(e,t){for(var i=e.commandList,r=t.length,n=0;n<r;n+=2){var a=t[n+1];a.pass=Pass$1.OPAQUE,i.push(a)}}function updateWireframe$2(e){var t;if(!(e.debugWireframe===e._debugWireframe&&!(e.debugWireframe&&e._wireframeDirty))){defined(e._rsWireframe)||(e._rsWireframe=RenderState.fromCache({}));for(var i=e.debugWireframe?(t=e._rsWireframe,PrimitiveType$1.LINES):(t=e._rsColorPass,PrimitiveType$1.TRIANGLES),r=e._commands,n=r.length,a=0;a<n;a+=2){var o=r[a+1];o.renderState=t,o.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}}Vector3DTilePrimitive.prototype.applyStyle=function(e,t){if(defined(e)){var i=e.color,i=i instanceof Expression&&!complexExpressionReg.test(i.expression);this._updatingAllCommands=i;var r=this._batchIds,n=r.length;for(s=0;s<n;++s){var a=t[r[s]];a.color=defined(e.color)?e.color.evaluateColor(a,scratchColor$k):DEFAULT_COLOR_VALUE$2,a.show=defined(e.show)?e.show.evaluate(a):DEFAULT_SHOW_VALUE$2}if(i){for(var o=this._batchedIndices,n=o.length,s=0;s<n;++s)o[s].color=Color.clone(Color.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}}else clearStyle$3(this,t)},Vector3DTilePrimitive.prototype.updateCommands=function(e,t){if(!this._updatingAllCommands){var i=this._batchIdLookUp,r=i[e];if(defined(r)){for(var n=this._indexOffsets,a=this._indexCounts,o=n[r],r=a[r],s=this._batchedIndices,l=s.length,c=0;c<l;++c){var u=s[c].offset,d=s[c].count;if(u<=o&&o<u+d)break}s.push(new Vector3DTileBatch({color:Color.clone(t),offset:o,count:r,batchIds:[e]}));for(var h=[],p=[],m=s[c].batchIds,f=m.length,g=0;g<f;++g){var _=m[g];_!==e&&(n[i[_]]<o?h:p).push(_)}0!==p.length&&s.push(new Vector3DTileBatch({color:Color.clone(s[c].color),offset:o+r,count:s[c].offset+s[c].count-(o+r),batchIds:p})),0!==h.length?(s[c].count=o-s[c].offset,s[c].batchIds=h):s.splice(c,1),this._batchDirty=!0}}},Vector3DTilePrimitive.prototype.update=function(e){var t=e.context;createVertexArray$4(this,t),createShaders$3(this,t),createRenderStates$4(this),createUniformMap$6(this,t);var i=e.passes;i.render&&(createColorCommands(this,t),createColorCommandsIgnoreShow(this,e),updateWireframe$2(this),this._debugWireframe?queueWireframeCommands(e,this._commands):queueCommands$2(this,e,this._commands,this._commandsIgnoreShow)),i.pick&&(createPickCommands(this),queueCommands$2(this,e,this._pickCommands))},Vector3DTilePrimitive.prototype.isDestroyed=function(){return!1},Vector3DTilePrimitive.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(),destroyObject(this)};var boundingSphereCartesian3Scratch$1=new Cartesian3,ModelState$1=ModelUtility.ModelState;function ClassificationModel(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).gltf;if(!((t=t instanceof ArrayBuffer?new Uint8Array(t):t)instanceof Uint8Array))throw new RuntimeError("Only binary glTF is supported as a classifier.");updateVersion(t=parseGlb(t)),addDefaults(t),processModelMaterialsCommon(t),processPbrMaterials(t),ForEach.buffer(t,function(e){if(!defined(e.extras._pipeline.source))throw new RuntimeError("Buffer data must be embedded in the binary gltf.")});var i=t.nodes,r=t.meshes,n=i[0].mesh;if(1!==i.length||!defined(n))throw new RuntimeError("Only one node is supported for classification and it must have a mesh.");if(1!==r.length)throw new RuntimeError("Only one mesh is supported when using b3dm for classification.");r=r[0].primitives;if(1!==r.length)throw new RuntimeError("Only one primitive per mesh is supported when using b3dm for classification.");if(!defined(r[0].attributes.POSITION))throw new RuntimeError("The mesh must have a position attribute.");if(!defined(r[0].attributes._BATCHID))throw new RuntimeError("The mesh must have a batch id attribute.");this._gltf=t,this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=Matrix4.clone(this.modelMatrix),this._ready=!1,this._readyPromise=when.defer(),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=defaultValue(e.debugWireframe,!1),this._debugWireframe=!1,this._classificationType=e.classificationType,this._vertexShaderLoaded=e.vertexShaderLoaded,this._classificationShaderLoaded=e.classificationShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=defaultValue(e.ignoreCommands,!1),this._upAxis=defaultValue(e.upAxis,Axis$1.Y),this._batchTable=e.batchTable,this._computedModelMatrix=new Matrix4,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new BoundingSphere,this._state=ModelState$1.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._dirty=!1,this._nodeMatrix=new Matrix4,this._primitive=void 0,this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms=void 0,this._buffers={},this._vertexArray=void 0,this._shaderProgram=void 0,this._uniformMap=void 0,this._geometryByteLength=0,this._trianglesLength=0,this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function addBuffersToLoadResources$1(e){var t=e.gltf,i=e._loadResources;ForEach.buffer(t,function(e,t){i.buffers[t]=e.extras._pipeline.source})}function parseBufferViews$1(e){var i=e.gltf.bufferViews,r=e._loadResources.vertexBuffersToCreate;ForEach.bufferView(e.gltf,function(e,t){e.target===WebGLConstants$1.ARRAY_BUFFER&&r.enqueue(t)});var n=e._loadResources.indexBuffersToCreate,a={};ForEach.accessor(e.gltf,function(e){var t=e.bufferView;i[t].target!==WebGLConstants$1.ELEMENT_ARRAY_BUFFER||defined(a[t])||(a[t]=!0,n.enqueue({id:t,componentType:e.componentType}))})}function createVertexBuffer$2(e,t){var i=t._loadResources,r=t.gltf.bufferViews[e],r=i.getBuffer(r);t._buffers[e]=r,t._geometryByteLength+=r.byteLength}function createIndexBuffer$1(e,t,i){var r=i._loadResources,n=i.gltf.bufferViews[e],t={typedArray:r.getBuffer(n),indexDatatype:t};i._buffers[e]=t,i._geometryByteLength+=t.typedArray.byteLength}function createBuffers$1(e){var t=e._loadResources;if(0===t.pendingBufferLoads){for(var i=t.vertexBuffersToCreate,r=t.indexBuffersToCreate;0<i.length;)createVertexBuffer$2(i.dequeue(),e);for(;0<r.length;){var n=r.dequeue();createIndexBuffer$1(n.id,n.componentType,e)}}}function modifyShaderForQuantizedAttributes$1(e,t){var i=t.gltf.meshes[0].primitives[0],e=ModelUtility.modifyShaderForQuantizedAttributes(t.gltf,i,e);return t._quantizedUniforms=e.uniforms,e.shader}function modifyShader$1(e,t){return e=defined(t)?t(e):e}function createProgram$1(e){var t=e.gltf,i=ModelUtility.getAttributeOrUniformBySemantic(t,"POSITION"),r=ModelUtility.getAttributeOrUniformBySemantic(t,"_BATCHID"),n={};n[i]=0,n[r]=1;var a=ModelUtility.getAttributeOrUniformBySemantic(t,"MODELVIEWPROJECTION");s=defined(a)?(o="uniform mat4 "+a+";\n",a+" * vec4("+i+", 1.0)"):(a=ModelUtility.getAttributeOrUniformBySemantic(t,"PROJECTION"),o="uniform mat4 "+(s=!defined(s=ModelUtility.getAttributeOrUniformBySemantic(t,"MODELVIEW"))?ModelUtility.getAttributeOrUniformBySemantic(t,"CESIUM_RTC_MODELVIEW"):s)+";\nuniform mat4 "+a+";\n",a+" * "+s+" * vec4("+i+", 1.0)");var o="attribute vec3 "+i+";\nattribute float "+r+";\n"+o+"void main() {\n"+(" vec4 positionInClipCoords = "+s+";\n")+" gl_Position = czm_depthClamp(positionInClipCoords);\n}\n",s=modifyShader$1(o=e.extensionsUsed.WEB3D_quantized_attributes?modifyShaderForQuantizedAttributes$1(o,e):o,e._vertexShaderLoaded),o=modifyShader$1("#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeDepthClamp();\n}\n",e._classificationShaderLoaded);e._shaderProgram={vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:n}}function getAttributeLocations$2(){return{POSITION:0,_BATCHID:1}}function createVertexArray$3(e){var r,n,a,t,o,s,i;e._loadResources.finishedBuffersCreation()&&!defined(e._vertexArray)&&(r=e._buffers,n=e.gltf,a=n.accessors,t=n.meshes[0].primitives[0],o=getAttributeLocations$2(),s={},ForEach.meshPrimitiveAttribute(t,function(e,t){var i=o[t];defined(i)&&(e=a[e],s[t]={index:i,vertexBuffer:r[e.bufferView],componentsPerAttribute:numberOfComponentsForType(e.type),componentDatatype:e.componentType,offsetInBytes:e.byteOffset,strideInBytes:getAccessorByteStride(n,e)})}),defined(t.indices)&&(i=a[t.indices],i=r[i.bufferView]),e._vertexArray={attributes:s,indexBuffer:i})}Object.defineProperties(ClassificationModel.prototype,{gltf:{get:function(){return this._gltf}},boundingSphere:{get:function(){var e=this.modelMatrix,t=Matrix4.getScale(e,boundingSphereCartesian3Scratch$1),e=this._scaledBoundingSphere;return e.center=Cartesian3.multiplyComponents(this._boundingSphere.center,t,e.center),e.radius=Cartesian3.maximumComponent(t)*this._initialRadius,defined(this._rtcCenter)&&Cartesian3.add(this._rtcCenter,e.center,e.center),e}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},dirty:{get:function(){return this._dirty}},extensionsUsed:{get:function(){return defined(this._extensionsUsed)||(this._extensionsUsed=ModelUtility.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return defined(this._extensionsRequired)||(this._extensionsRequired=ModelUtility.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},classificationType:{get:function(){return this._classificationType}}});var gltfSemanticUniforms={PROJECTION:function(e,t){return ModelUtility.getGltfSemanticUniforms().PROJECTION(e,t)},MODELVIEW:function(e,t){return ModelUtility.getGltfSemanticUniforms().MODELVIEW(e,t)},CESIUM_RTC_MODELVIEW:function(e,t){return ModelUtility.getGltfSemanticUniforms().CESIUM_RTC_MODELVIEW(e,t)},MODELVIEWPROJECTION:function(e,t){return ModelUtility.getGltfSemanticUniforms().MODELVIEWPROJECTION(e,t)}};function createUniformMap$5(i,r){var n;defined(i._uniformMap)||(n={},ForEach.technique(i.gltf,function(e){ForEach.techniqueUniform(e,function(e,t){defined(e.semantic)&&defined(gltfSemanticUniforms[e.semantic])&&(n[t]=gltfSemanticUniforms[e.semantic](r.uniformState,i))})}),i._uniformMap=n)}function createUniformsForQuantizedAttributes$1(e,t){return ModelUtility.createUniformsForQuantizedAttributes(e.gltf,t,e._quantizedUniforms)}function triangleCountFromPrimitiveIndices$1(e,t){switch(e.mode){case PrimitiveType$1.TRIANGLES:return t/3;case PrimitiveType$1.TRIANGLE_STRIP:case PrimitiveType$1.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function createPrimitive$2(e){var t=e._batchTable,i=e._uniformMap,r=e._vertexArray,n=e.gltf,a=n.accessors,o=n.meshes[0].primitives[0],s=a[o.indices],l=o.attributes.POSITION,c=ModelUtility.getAccessorMinMax(n,l),u=BoundingSphere.fromCornerPoints(Cartesian3.fromArray(c.min),Cartesian3.fromArray(c.max));x=defined(s)?(b=s.count,s.byteOffset/IndexDatatype$1.getSizeInBytes(s.componentType)):(b=a[o.attributes.POSITION].count,0),e._trianglesLength+=triangleCountFromPrimitiveIndices$1(o,b),defined(e._uniformMapLoaded)&&(i=e._uniformMapLoaded(i)),e.extensionsUsed.WEB3D_quantized_attributes&&(i=combine$2(i,createUniformsForQuantizedAttributes$1(e,o)));var d,h,p,n=r.attributes.POSITION,l=n.componentDatatype,c=n.vertexBuffer,s=c.byteOffset,a=c.byteLength/ComponentDatatype$1.getSizeInBytes(l),o=ComponentDatatype$1.createArrayBufferView(l,c.buffer,s,a),l=(n=r.attributes._BATCHID).componentDatatype,s=(c=n.vertexBuffer).byteOffset,a=c.byteLength/ComponentDatatype$1.getSizeInBytes(l),m=ComponentDatatype$1.createArrayBufferView(l,c.buffer,s,a),a=r.indexBuffer.typedArray,f=r.indexBuffer.indexDatatype===IndexDatatype$1.UNSIGNED_SHORT?new Uint16Array(a.buffer,a.byteOffset,a.byteLength/Uint16Array.BYTES_PER_ELEMENT):new Uint32Array(a.buffer,a.byteOffset,a.byteLength/Uint32Array.BYTES_PER_ELEMENT),o=arraySlice(o),g=[],_=[],y=[],C=[],v=(m=arraySlice(m))[(f=arraySlice(f,x,x+b))[0]];g.push(v),y.push(0);for(var S=f.length,T=1;T<S;++T)(d=m[f[T]])!==v&&(p=T-(h=y[y.length-1]),g.push(d),_.push(p),y.push(T),C.push(new Vector3DTileBatch({offset:h,count:p,batchIds:[v],color:Color.WHITE})),v=d);h=y[y.length-1],_.push(p=S-h),C.push(new Vector3DTileBatch({offset:h,count:p,batchIds:[v],color:Color.WHITE}));var r=e._shaderProgram,a=r.vertexShaderSource,x=r.fragmentShaderSource,b=r.attributeLocations,r=defined(e._pickIdLoaded)?e._pickIdLoaded():void 0;e._primitive=new Vector3DTilePrimitive({classificationType:e._classificationType,positions:o,indices:f,indexOffsets:y,indexCounts:_,batchIds:g,vertexBatchIds:m,batchedIndices:C,batchTable:t,boundingVolume:new BoundingSphere,_vertexShaderSource:a,_fragmentShaderSource:x,_attributeLocations:b,_uniformMap:i,_pickId:r,_modelMatrix:new Matrix4,_boundingSphere:u}),e._buffers=void 0,e._vertexArray=void 0,e._shaderProgram=void 0,e._uniformMap=void 0}function createRuntimeNodes$1(e){var t;e._loadResources.finished()&&(defined(e._primitive)||(t=e.gltf.nodes[0],e._nodeMatrix=ModelUtility.getTransform(t,e._nodeMatrix),createPrimitive$2(e)))}function createResources$6(e,t){t=t.context;ModelUtility.checkSupportedGlExtensions(e.gltf.glExtensionsUsed,t),createBuffers$1(e),createProgram$1(e),createVertexArray$3(e),createUniformMap$5(e,t),createRuntimeNodes$1(e)}var scratchComputedTranslation$2=new Cartesian4,scratchComputedMatrixIn2D$1=new Matrix4;function updateNodeModelMatrix(e,t,i,r){var n,a=e._computedModelMatrix;e._mode===SceneMode$1.SCENE3D||e._ignoreCommands||(n=Matrix4.getColumn(a,3,scratchComputedTranslation$2),Cartesian4.equals(n,Cartesian4.UNIT_W)?(n=e.boundingSphere.center,n=Transforms.wgs84To2DModelMatrix(r,n,scratchComputedMatrixIn2D$1),a=Matrix4.multiply(n,a,scratchComputedMatrixIn2D$1),defined(e._rtcCenter)&&(Matrix4.setTranslation(a,Cartesian4.UNIT_W,a),e._rtcCenter=e._rtcCenter2D)):(a=Transforms.basisTo2D(r,a,scratchComputedMatrixIn2D$1),e._rtcCenter=e._rtcCenter3D));r=e._primitive;(t||i)&&(Matrix4.multiplyTransformation(a,e._nodeMatrix,r._modelMatrix),BoundingSphere.transform(r._boundingSphere,r._modelMatrix,r._boundingVolume),defined(e._rtcCenter)&&Cartesian3.add(e._rtcCenter,r._boundingVolume.center,r._boundingVolume.center))}function ClippingPlane(e,t){this._distance=t,this._normal=new UpdateChangedCartesian3(e,this),this.onChangeCallback=void 0,this.index=-1}function UpdateChangedCartesian3(e,t){this._clippingPlane=t,this._cartesian3=Cartesian3.clone(e)}function ClippingPlaneCollection(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=defaultValue(e.enabled,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this.edgeColor=Color.clone(defaultValue(e.edgeColor,Color.WHITE)),this.edgeWidth=defaultValue(e.edgeWidth,0),this.planeAdded=new Event,this.planeRemoved=new Event,this._owner=void 0;var t=defaultValue(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?unionIntersectFunction:defaultIntersectFunction,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;var i=e.planes;if(defined(i))for(var r=i.length,n=0;n<r;++n)this.add(i[n])}function unionIntersectFunction(e){return e===Intersect$1.OUTSIDE}function defaultIntersectFunction(e){return e===Intersect$1.INSIDE}function setIndexDirty(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||-1!==e._dirtyIndex&&e._dirtyIndex!==t,e._dirtyIndex=t}function indexOf(e,t){for(var i=e.length,r=0;r<i;++r)if(Plane.equals(e[r],t))return r;return-1}ClassificationModel.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},ClassificationModel.prototype.update=function(e){var t,i,r,n,a,o,s;e.mode!==SceneMode$1.MORPHING&&(FeatureDetection.supportsWebP.initialized?(o=FeatureDetection.supportsWebP(),this._state===ModelState$1.NEEDS_LOAD&&defined(this.gltf)&&(this._state=ModelState$1.LOADING,this._state!==ModelState$1.FAILED&&(defined(t=this.gltf.extensions)&&defined(t.CESIUM_RTC)&&(a=Cartesian3.fromArray(t.CESIUM_RTC.center),Cartesian3.equals(a,Cartesian3.ZERO)||(this._rtcCenter3D=a,r=(i=e.mapProjection).ellipsoid.cartesianToCartographic(this._rtcCenter3D),n=i.project(r),Cartesian3.fromElements(n.z,n.x,n.y,n),this._rtcCenter2D=n,this._rtcCenterEye=new Cartesian3,this._rtcCenter=this._rtcCenter3D)),this._loadResources=new ModelLoadResources,ModelUtility.parseBuffers(this))),a=this._loadResources,i=!1,this._state===ModelState$1.LOADING&&(0===a.pendingBufferLoads&&(ModelUtility.checkSupportedExtensions(this.extensionsRequired,o),addBuffersToLoadResources$1(this),parseBufferViews$1(this),this._boundingSphere=ModelUtility.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,createResources$6(this,e)),a.finished()&&(this._state=ModelState$1.LOADED,i=!0)),defined(a)&&this._state===ModelState$1.LOADED&&(i||createResources$6(this,e),a.finished()&&(this._loadResources=void 0)),((r=this.show)&&this._state===ModelState$1.LOADED||i)&&(this._dirty=!1,n=this.modelMatrix,o=e.mode!==this._mode,this._mode=e.mode,((a=!Matrix4.equals(this._modelMatrix,n)||o)||i)&&(Matrix4.clone(n,this._modelMatrix),o=this._computedModelMatrix,Matrix4.clone(n,o),this._upAxis===Axis$1.Y?Matrix4.multiplyTransformation(o,Axis$1.Y_UP_TO_Z_UP,o):this._upAxis===Axis$1.X&&Matrix4.multiplyTransformation(o,Axis$1.X_UP_TO_Z_UP,o)),(a||i)&&(updateNodeModelMatrix(this,a,i,e.mapProjection),this._dirty=!0)),i?(s=this,e.afterRender.push(function(){s._ready=!0,s._readyPromise.resolve(s)})):r&&!this._ignoreCommands&&(this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.debugWireframe=this.debugWireframe,this._primitive.update(e))):FeatureDetection.supportsWebP.initialize())},ClassificationModel.prototype.isDestroyed=function(){return!1},ClassificationModel.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)},Object.defineProperties(ClippingPlane.prototype,{distance:{get:function(){return this._distance},set:function(e){defined(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){defined(this.onChangeCallback)&&!Cartesian3.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),Cartesian3.clone(e,this._normal._cartesian3)}}}),ClippingPlane.fromPlane=function(e,t){return defined(t)?(t.normal=e.normal,t.distance=e.distance):t=new ClippingPlane(e.normal,e.distance),t},ClippingPlane.clone=function(e,t){return defined(t)?(t.normal=e.normal,t.distance=e.distance,t):new ClippingPlane(e.normal,e.distance)},Object.defineProperties(UpdateChangedCartesian3.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){defined(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){defined(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){defined(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}}),Object.defineProperties(ClippingPlaneCollection.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?unionIntersectFunction:defaultIntersectFunction)}},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}}}),ClippingPlaneCollection.prototype.add=function(e){var t=this._planes.length,i=this;e.onChangeCallback=function(e){setIndexDirty(i,e)},setIndexDirty(this,e.index=t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)},ClippingPlaneCollection.prototype.get=function(e){return this._planes[e]},ClippingPlaneCollection.prototype.contains=function(e){return-1!==indexOf(this._planes,e)},ClippingPlaneCollection.prototype.remove=function(e){var t=this._planes,i=indexOf(t,e);if(-1===i)return!1;e instanceof ClippingPlane&&(e.onChangeCallback=void 0,e.index=-1);for(var r=t.length-1,n=i;n<r;++n){var a=t[n+1];(t[n]=a)instanceof ClippingPlane&&(a.index=n)}return this._multipleDirtyPlanes=!0,t.length=r,this.planeRemoved.raiseEvent(e,i),!0},ClippingPlaneCollection.prototype.removeAll=function(){for(var e=this._planes,t=e.length,i=0;i<t;++i){var r=e[i];r instanceof ClippingPlane&&(r.onChangeCallback=void 0,r.index=-1),this.planeRemoved.raiseEvent(r,i)}this._multipleDirtyPlanes=!0,this._planes=[]};var distanceEncodeScratch=new Cartesian4,oct32EncodeScratch=new Cartesian4;function packPlanesAsUint8(e,t,i){for(var r=e._uint8View,n=e._planes,a=0,o=t;o<i;++o){var s=n[o],l=AttributeCompression.octEncodeToCartesian4(s.normal,oct32EncodeScratch);r[a]=l.x,r[a+1]=l.y,r[a+2]=l.z,r[a+3]=l.w;s=Cartesian4.packFloat(s.distance,distanceEncodeScratch);r[a+4]=s.x,r[a+5]=s.y,r[a+6]=s.z,r[a+7]=s.w,a+=8}}function packPlanesAsFloats(e,t,i){for(var r=e._float32View,n=e._planes,a=0,o=t;o<i;++o){var s=n[o],l=s.normal;r[a]=l.x,r[a+1]=l.y,r[a+2]=l.z,r[a+3]=s.distance,a+=4}}function computeTextureResolution(e,t){var i=ContextLimits.maximumTextureSize;return t.x=Math.min(e,i),t.y=Math.ceil(e/t.x),t}var textureResolutionScratch$1=new Cartesian2;ClippingPlaneCollection.prototype.update=function(e){var t,i=this._clippingPlanesTexture,r=e.context,n=ClippingPlaneCollection.useFloatTexture(r),a=n?this.length:2*this.length;!defined(i)||((e=i.width*i.height)<a||a<.25*e)&&(i.destroy(),this._clippingPlanesTexture=i=void 0),0!==this.length&&(defined(i)||((t=computeTextureResolution(a,textureResolutionScratch$1)).y*=2,n?(i=new Texture({context:r,width:t.x,height:t.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT,sampler:Sampler.NEAREST,flipY:!1}),this._float32View=new Float32Array(t.x*t.y*4)):(i=new Texture({context:r,width:t.x,height:t.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(t.x*t.y*4)),this._clippingPlanesTexture=i,this._multipleDirtyPlanes=!0),a=this._dirtyIndex,!this._multipleDirtyPlanes&&-1===a||(this._multipleDirtyPlanes?n?(packPlanesAsFloats(this,0,this._planes.length),i.copyFrom({width:i.width,height:i.height,arrayBufferView:this._float32View})):(packPlanesAsUint8(this,0,this._planes.length),i.copyFrom({width:i.width,height:i.height,arrayBufferView:this._uint8View})):(t=r=0,n?(t=Math.floor(a/i.width),r=Math.floor(a-t*i.width),packPlanesAsFloats(this,a,a+1),i.copyFrom({width:1,height:1,arrayBufferView:this._float32View},r,t)):(t=Math.floor(2*a/i.width),r=Math.floor(2*a-t*i.width),packPlanesAsUint8(this,a,a+1),i.copyFrom({width:2,height:1,arrayBufferView:this._uint8View},r,t))),this._multipleDirtyPlanes=!1,this._dirtyIndex=-1))};var scratchMatrix$4=new Matrix4,scratchPlane=new Plane(Cartesian3.UNIT_X,0);ClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume=function(e,t){var i=this._planes,r=i.length,n=this.modelMatrix;defined(t)&&(n=Matrix4.multiply(t,n,scratchMatrix$4));var a=Intersect$1.INSIDE;!this.unionClippingRegions&&0<r&&(a=Intersect$1.OUTSIDE);for(var o=0;o<r;++o){var s=i[o];Plane.transform(s,n,scratchPlane);s=e.intersectPlane(scratchPlane);if(s===Intersect$1.INTERSECTING)a=s;else if(this._testIntersection(s))return s}return a},ClippingPlaneCollection.setOwner=function(e,t,i){e!==t[i]&&(t[i]=t[i]&&t[i].destroy(),defined(e)&&((e._owner=t)[i]=e))},ClippingPlaneCollection.useFloatTexture=function(e){return e.floatingPointTexture},ClippingPlaneCollection.getTextureResolution=function(e,t,i){var r=e.texture;if(defined(r))return i.x=r.width,i.y=r.height,i;i=computeTextureResolution(ClippingPlaneCollection.useFloatTexture(t)?e.length:2*e.length,i);return i.y*=2,i},ClippingPlaneCollection.prototype.isDestroyed=function(){return!1},ClippingPlaneCollection.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),destroyObject(this)};var ColorBlendMode={HIGHLIGHT:0,REPLACE:1,MIX:2,getColorBlend:function(e,t){return e===ColorBlendMode.HIGHLIGHT?0:e===ColorBlendMode.REPLACE?1:e===ColorBlendMode.MIX?CesiumMath.clamp(t,CesiumMath.EPSILON4,1):void 0}},ColorBlendMode$1=Object.freeze(ColorBlendMode);function DracoLoader(){}function addBufferToLoadResources(e,t){var i="runtime."+Object.keys(e.createdBufferViews).length,r=e.buffers,n=Object.keys(r).length;return r[n]=t,e.createdBufferViews[i]={buffer:n,byteOffset:0,byteLength:t.byteLength},i}function addNewVertexBuffer(e,t,i){t=t._loadResources,e=addBufferToLoadResources(t,e);return t.vertexBuffersToCreate.enqueue(e),e}function addNewIndexBuffer(e,t,i){var r=e.typedArray,n=t._loadResources,t=addBufferToLoadResources(n,r);return n.indexBuffersToCreate.enqueue({id:t,componentType:ComponentDatatype$1.fromTypedArray(r)}),{bufferViewId:t,numberOfIndices:e.numberOfIndices}}function scheduleDecodingTask(e,s,l,t){if(DracoLoader._taskProcessorReady){var c=l.primitivesToDecode.peek();if(defined(c)){e=e.scheduleTask(c,[c.array.buffer]);if(defined(e))return l.activeDecodingTasks++,l.primitivesToDecode.dequeue(),e.then(function(e){l.activeDecodingTasks--;var t,i,r,n=addNewIndexBuffer(e.indexArray,s),a={},o=e.attributeData;for(t in o)o.hasOwnProperty(t)&&(i=addNewVertexBuffer((r=o[t]).array,s),(r=r.data).bufferView=i,a[t]=r);s._decodedData[c.mesh+".primitive."+c.primitive]={bufferView:n.bufferViewId,numberOfIndices:n.numberOfIndices,attributes:a}})}}}function getClipAndStyleCode(e,t,i){return" float clipDistance = clip(gl_FragCoord, "+e+", "+t+"); \n vec4 clippingPlanesEdgeColor = vec4(1.0); \n clippingPlanesEdgeColor.rgb = "+i+".rgb; \n float clippingPlanesEdgeWidth = "+i+".a; \n if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n { \n gl_FragColor = clippingPlanesEdgeColor;\n } \n"}DracoLoader._maxDecodingConcurrency=Math.max(FeatureDetection.hardwareConcurrency-1,1),DracoLoader._decoderTaskProcessor=void 0,DracoLoader._taskProcessorReady=!1,DracoLoader._getDecoderTaskProcessor=function(){var e;return defined(DracoLoader._decoderTaskProcessor)||((e=new TaskProcessor("decodeDraco",DracoLoader._maxDecodingConcurrency)).initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_wasm_wrapper.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm",fallbackModulePath:"ThirdParty/Workers/draco_decoder.js"}).then(function(){DracoLoader._taskProcessorReady=!0}),DracoLoader._decoderTaskProcessor=e),DracoLoader._decoderTaskProcessor},DracoLoader.hasExtension=function(e){return defined(e.extensionsRequired.KHR_draco_mesh_compression)||defined(e.extensionsUsed.KHR_draco_mesh_compression)},DracoLoader._decodedModelResourceCache=void 0,DracoLoader.parse=function(e,t){if(DracoLoader.hasExtension(e)){var a=e._loadResources,i=e.cacheKey;if(defined(i)){defined(DracoLoader._decodedModelResourceCache)||(defined(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),DracoLoader._decodedModelResourceCache=t.cache.modelDecodingCache);i=DracoLoader._decodedModelResourceCache[i];if(defined(i))return i.count++,void(a.pendingDecodingCache=!0)}var o=e._dequantizeInShader,s=e.gltf;ForEach.mesh(s,function(e,n){ForEach.meshPrimitive(e,function(e,t){var i,r;!defined(e.extensions)||defined(i=e.extensions.KHR_draco_mesh_compression)&&(r=s.bufferViews[i.bufferView],e=arraySlice(s.buffers[r.buffer].extras._pipeline.source,r.byteOffset,r.byteOffset+r.byteLength),a.primitivesToDecode.enqueue({mesh:n,primitive:t,array:e,bufferView:r,compressedAttributes:i.attributes,dequantizeInShader:o}))})})}},DracoLoader.decodeModel=function(e,t){if(!DracoLoader.hasExtension(e))return when.resolve();var i=e._loadResources,r=e.cacheKey;if(defined(r)&&defined(DracoLoader._decodedModelResourceCache)){var n=DracoLoader._decodedModelResourceCache[r];if(defined(n)&&i.pendingDecodingCache)return when(n.ready,function(){e._decodedData=n.data,i.pendingDecodingCache=!1});DracoLoader._decodedModelResourceCache[r]={ready:!1,count:1,data:void 0}}if(0===i.primitivesToDecode.length)return when.resolve();for(var a=DracoLoader._getDecoderTaskProcessor(),o=[],s=scheduleDecodingTask(a,e,i);defined(s);)o.push(s),s=scheduleDecodingTask(a,e,i);return when.all(o)},DracoLoader.decodePointCloud=function(e){var t=DracoLoader._getDecoderTaskProcessor();if(DracoLoader._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},DracoLoader.cacheDataForModel=function(e){var t=e.cacheKey;defined(t)&&defined(DracoLoader._decodedModelResourceCache)&&(defined(t=DracoLoader._decodedModelResourceCache[t])&&(t.ready=!0,t.data=e._decodedData))},DracoLoader.destroyCachedDataForModel=function(e){var t=e.cacheKey;defined(t)&&defined(DracoLoader._decodedModelResourceCache)&&(defined(e=DracoLoader._decodedModelResourceCache[t])&&0==--e.count&&delete DracoLoader._decodedModelResourceCache[t])};var textureResolutionScratch=new Cartesian2;function getClippingFunction(e,t){var i=e.unionClippingRegions,r=e.length,n=ClippingPlaneCollection.useFloatTexture(t),e=ClippingPlaneCollection.getTextureResolution(e,t,textureResolutionScratch),t=e.x,e=e.y,e=(n?getClippingPlaneFloat:getClippingPlaneUint8)(t,e);return e+="\n",e+=(i?clippingFunctionUnion:clippingFunctionIntersect)(r)}function clippingFunctionUnion(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount;\n float pixelWidth = czm_metersPerPixel(position);\n bool breakAndDiscard = false;\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n if (amount <= 0.0)\n {\n breakAndDiscard = true;\n break;\n }\n }\n if (breakAndDiscard) {\n discard;\n }\n return clipAmount;\n}\n"}function clippingFunctionIntersect(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n bool clipped = true;\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount = 0.0;\n float pixelWidth = czm_metersPerPixel(position);\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = max(amount, clipAmount);\n clipped = clipped && (amount <= 0.0);\n }\n if (clipped)\n {\n discard;\n }\n return clipAmount;\n}\n"}function getClippingPlaneFloat(e,t){var i=1/t,t=1/e+"";-1===t.indexOf(".")&&(t+=".0");i+="";return-1===i.indexOf(".")&&(i+=".0"),"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int pixY = clippingPlaneNumber / "+e+";\n int pixX = clippingPlaneNumber - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+t+";\n float v = (float(pixY) + 0.5) * "+i+";\n vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n return czm_transformPlane(plane, transform);\n}\n"}function getClippingPlaneUint8(e,t){var i=1/t,t=1/e+"";-1===t.indexOf(".")&&(t+=".0");i+="";return-1===i.indexOf(".")&&(i+=".0"),"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n int pixY = clippingPlaneStartIndex / "+e+";\n int pixX = clippingPlaneStartIndex - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+t+";\n float v = (float(pixY) + 0.5) * "+i+";\n vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n vec4 plane;\n plane.xyz = czm_octDecode(oct, 65535.0);\n plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + "+t+", v)));\n return czm_transformPlane(plane, transform);\n}\n"}var JobType={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},JobType$1=Object.freeze(JobType);function ModelAnimationCache(){}var dataUriRegex=/^data\:/i;function getAccessorKey(e,t){var i=e.gltf,r=i.buffers,i=i.bufferViews[t.bufferView],r=r[i.buffer],i=i.byteOffset+t.byteOffset,t=t.count*numberOfComponentsForType(t.type),r=dataUriRegex.test(r.uri)?"":r.uri;return e.cacheKey+"//"+r+"/"+i+"/"+t}var cachedAnimationParameters={};ModelAnimationCache.getAnimationParameterValues=function(e,t){var i=getAccessorKey(e,t);if(!defined(h=cachedAnimationParameters[i])){for(var r=e.gltf,n=r.buffers,a=r.bufferViews[t.bufferView],o=n[a.buffer].extras._pipeline.source,s=t.componentType,l=t.type,c=numberOfComponentsForType(l),u=t.count,d=getAccessorByteStride(r,t),h=new Array(u),t=defaultValue(t.byteOffset,0),p=a.byteOffset+t,m=0;m<u;m++){var f=ComponentDatatype$1.createArrayBufferView(s,o.buffer,o.byteOffset+p,c);"SCALAR"===l?h[m]=f[0]:"VEC3"===l?h[m]=Cartesian3.fromArray(f):"VEC4"===l&&(h[m]=Quaternion.unpack(f)),p+=d}defined(e.cacheKey)&&(cachedAnimationParameters[i]=h)}return h};var cachedAnimationSplines={};function getAnimationSplineKey(e,t,i){return e.cacheKey+"//"+t+"/"+i}function ConstantSpline(e){this._value=e}function SteppedSpline(e){this._spline=e,this._lastTimeIndex=0}ConstantSpline.prototype.evaluate=function(e,t){return this._value},ConstantSpline.prototype.wrapTime=function(e){return 0},ConstantSpline.prototype.clampTime=function(e){return 0},SteppedSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,SteppedSpline.prototype.evaluate=function(e,t){var i=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=this._spline.times,i=e>=r[i+1]?r[i+1]:r[i];return this._spline.evaluate(i,t)},Object.defineProperties(SteppedSpline.prototype,{times:{get:function(){return this._spline.times}}}),SteppedSpline.prototype.wrapTime=function(e){return this._spline.wrapTime(e)},SteppedSpline.prototype.clampTime=function(e){return this._spline.clampTime(e)},ModelAnimationCache.getAnimationSpline=function(e,t,i,r,n,a,o,s){t=getAnimationSplineKey(e,t,r),r=cachedAnimationSplines[t];return defined(r)||(s=s,1===(a=a).length&&1===s.length?r=new ConstantSpline(s[0]):"LINEAR"!==n.interpolation&&"STEP"!==n.interpolation||("translation"===o||"scale"===o?r=new LinearSpline({times:a,points:s}):"rotation"===o?r=new QuaternionSpline({times:a,points:s}):"weights"===o&&(r=new WeightSpline({times:a,weights:s})),defined(r)&&"STEP"===n.interpolation&&(r=new SteppedSpline(r))),defined(e.cacheKey)&&(cachedAnimationSplines[t]=r)),r};var cachedSkinInverseBindMatrices={};ModelAnimationCache.getSkinInverseBindMatrices=function(e,t){var i=getAccessorKey(e,t);if(!defined(d=cachedSkinInverseBindMatrices[i])){var r=e.gltf,n=r.buffers,e=r.bufferViews[t.bufferView],a=n[e.buffer].extras._pipeline.source,o=t.componentType,n=t.type,s=t.count,l=getAccessorByteStride(r,t),c=e.byteOffset+t.byteOffset,u=numberOfComponentsForType(n),d=new Array(s);if(o===WebGLConstants$1.FLOAT&&n===AttributeType$1.MAT4)for(var h=0;h<s;++h){var p=ComponentDatatype$1.createArrayBufferView(o,a.buffer,a.byteOffset+c,u);d[h]=Matrix4.fromArray(p),c+=l}cachedSkinInverseBindMatrices[i]=d}return d};var ModelAnimationLoop={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},ModelAnimationLoop$1=Object.freeze(ModelAnimationLoop),ModelAnimationState=Object.freeze({STOPPED:0,ANIMATING:1});function ModelAnimation(e,t,i){this._name=i.name,this._startTime=JulianDate.clone(e.startTime),this._delay=defaultValue(e.delay,0),this._stopTime=e.stopTime,this.removeOnStop=defaultValue(e.removeOnStop,!1),this._multiplier=defaultValue(e.multiplier,1),this._reverse=defaultValue(e.reverse,!1),this._loop=defaultValue(e.loop,ModelAnimationLoop$1.NONE),this.start=new Event,this.update=new Event,this.stop=new Event,this._state=ModelAnimationState.STOPPED,this._runtimeAnimation=i,this._computedStartTime=void 0,this._duration=void 0;var r=this;this._raiseStartEvent=function(){r.start.raiseEvent(t,r)},this._updateEventTime=0,this._raiseUpdateEvent=function(){r.update.raiseEvent(t,r,r._updateEventTime)},this._raiseStopEvent=function(){r.stop.raiseEvent(t,r)}}function ModelAnimationCollection(e){this.animationAdded=new Event,this.animationRemoved=new Event,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function add(e,t,i){var r=e._model,t=new ModelAnimation(i,r,r._runtime.animations[t]);return e._scheduledAnimations.push(t),e.animationAdded.raiseEvent(r,t),t}function animateChannels(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;n<r;++n)i[n](t)}Object.defineProperties(ModelAnimation.prototype,{name:{get:function(){return this._name}},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}}}),Object.defineProperties(ModelAnimationCollection.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),ModelAnimationCollection.prototype.add=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t,i=this._model._runtime.animations;if(defined(e.index))return add(this,e.index,e);for(var r=i.length,n=0;n<r;++n)if(i[n].name===e.name){t=n;break}return add(this,t,e)},ModelAnimationCollection.prototype.addAll=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);for(var t=[],i=this._model._runtime.animations.length,r=0;r<i;++r)t.push(add(this,r,e));return t},ModelAnimationCollection.prototype.remove=function(e){if(defined(e)){var t=this._scheduledAnimations,i=t.indexOf(e);if(-1!==i)return t.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},ModelAnimationCollection.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,i=t.length;this._scheduledAnimations=[];for(var r=0;r<i;++r)this.animationRemoved.raiseEvent(e,t[r])},ModelAnimationCollection.prototype.contains=function(e){return!!defined(e)&&-1!==this._scheduledAnimations.indexOf(e)},ModelAnimationCollection.prototype.get=function(e){return this._scheduledAnimations[e]};var animationsToRemove=[];function createAnimationRemovedFunction(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}function ModelMaterial(e,t,i){this._name=t.name,this._id=i,this._uniformMap=e._uniformMaps[i],this._technique=void 0,this._program=void 0,this._values=void 0}function ModelMesh(e,t,i){for(var r=[],n=e.primitives,a=n.length,o=0;o<a;++o){var s=n[o];r[o]=t[s.material]}this._name=e.name,this._materials=r,this._id=i}function ModelNode(e,t,i,r,n){this._model=e,this._runtimeNode=i,this._name=t.name,this._id=r,this.useMatrix=!1,this._show=!0,this._matrix=Matrix4.clone(n),this._originalMatrix=Matrix4.clone(n)}ModelAnimationCollection.prototype.update=function(e){var t=this._scheduledAnimations;if(0===(p=t.length))return this._previousTime=void 0,!1;if(JulianDate.equals(e.time,this._previousTime))return!1;this._previousTime=JulianDate.clone(e.time,this._previousTime);for(var i=!1,r=e.time,n=this._model,a=0;a<p;++a){var o=t[a],s=o._runtimeAnimation;defined(o._computedStartTime)||(o._computedStartTime=JulianDate.addSeconds(defaultValue(o.startTime,r),o.delay,new JulianDate)),defined(o._duration)||(o._duration=s.stopTime*(1/o.multiplier));var l=o._computedStartTime,c=o._duration,u=o.stopTime,d=0!==c?JulianDate.secondsDifference(r,l)/c:0;0!==c&&defined(u)&&JulianDate.greaterThan(r,u)&&(d=JulianDate.secondsDifference(u,l)/c);var h=o.loop===ModelAnimationLoop$1.REPEAT||o.loop===ModelAnimationLoop$1.MIRRORED_REPEAT,l=(0<=d||h&&!defined(o.startTime))&&(d<=1||h)&&(!defined(u)||JulianDate.lessThanOrEquals(r,u));!l&&o._state!==ModelAnimationState.ANIMATING||(l&&o._state===ModelAnimationState.STOPPED&&(o._state=ModelAnimationState.ANIMATING,0<o.start.numberOfListeners&&e.afterRender.push(o._raiseStartEvent)),o.loop===ModelAnimationLoop$1.REPEAT?d-=Math.floor(d):o.loop===ModelAnimationLoop$1.MIRRORED_REPEAT&&(u=d-(h=Math.floor(d)),d=h%2==1?1-u:u),c=(d=o.reverse?1-d:d)*c*o.multiplier,animateChannels(s,c=CesiumMath.clamp(c,s.startTime,s.stopTime)),0<o.update.numberOfListeners&&(o._updateEventTime=c,e.afterRender.push(o._raiseUpdateEvent)),i=!0,l||(o._state=ModelAnimationState.STOPPED,0<o.stop.numberOfListeners&&e.afterRender.push(o._raiseStopEvent),o.removeOnStop&&animationsToRemove.push(o)))}for(var p=animationsToRemove.length,m=0;m<p;++m){var f=animationsToRemove[m];t.splice(t.indexOf(f),1),e.afterRender.push(createAnimationRemovedFunction(this,n,f))}return animationsToRemove.length=0,i},Object.defineProperties(ModelMaterial.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),ModelMaterial.prototype.setValue=function(e,t){e=this._uniformMap.values["u_"+e];e.value=e.clone(t,e.value)},ModelMaterial.prototype.getValue=function(e){e=this._uniformMap.values["u_"+e];if(defined(e))return e.value},Object.defineProperties(ModelMesh.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),Object.defineProperties(ModelNode.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=Matrix4.clone(e,this._matrix),this.useMatrix=!0;e=this._model;e._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=e._maxDirtyNumber}},originalMatrix:{get:function(){return this._originalMatrix}}}),ModelNode.prototype.setMatrix=function(e){Matrix4.clone(e,this._matrix)};var MAX_GLTF_UINT16_INDEX=65534;function ModelOutlineLoader(){}function addOutline(e,t,i,r,n){var a,o,s=n.vertexCopies,l=n.extraVertices,c=n.outlineCoordinates,u=e.gltf,d=u.meshes[t].primitives[i],h=u.accessors,t=u.bufferViews;for(o in d.attributes)if(d.attributes.hasOwnProperty(o)){var p=h[d.attributes[o]];if(defined(p)){a=p.count;break}}if(defined(a)){for(var m=h[d.indices],f=t[m.bufferView],i=h[r],r=t[i.bufferView],g=e._loadResources,t=g.getBuffer(f),r=g.getBuffer(r),_=new(5123===m.componentType?Uint16Array:Uint32Array)(t.buffer,t.byteOffset+m.byteOffset,m.count),y=new(5123===i.componentType?Uint16Array:Uint32Array)(r.buffer,r.byteOffset+i.byteOffset,i.count),C=a,v=[C],S=0;S<y.length;S+=2){var T=y[S],x=y[S+1];v[Math.min(T,x)*C+Math.max(T,x)]=1}for(S=0;S<_.length;S+=3)for(var b=_[S],E=_[S+1],P=_[S+2],A=isHighlighted(v,b,E),w=isHighlighted(v,E,P),D=isHighlighted(v,P,b),M=matchAndStoreCoordinates(c,b,E,P,A,w,D);0<=M;){if(void 0===(I=M===b?s[b]:M===E?s[E]:s[P])){for(var I=a+l.length,R=M;a<=R;)R=l[R-a];l.push(R),s[M]=I}MAX_GLTF_UINT16_INDEX<I&&_ instanceof Uint16Array&&(_=new Uint32Array(_),m.componentType=5125,f.buffer=u.buffers.push({byteLength:_.byteLength,extras:{_pipeline:{source:_.buffer}}})-1,f.byteLength=_.byteLength,f.byteOffset=0,e._loadResources.buffers[f.buffer]=new Uint8Array(_.buffer,0,_.byteLength),g.indexBuffersToCreate._array.forEach(function(e){e.id===m.bufferView&&(e.componentType=m.componentType)})),M===b?_[S]=b=I:M===E?_[S+1]=E=I:_[S+2]=P=I,defined(m.max)&&(m.max[0]=Math.max(m.max[0],I)),M=matchAndStoreCoordinates(c,b,E,P,A,w,D)}}}function computeOrderMask(e,t,i,r,n){var a=3*t,o=e[a],t=e[1+a],a=e[2+a];return void 0===o?63:((o===i&&t===r&&a===n)<<0)+((o===i&&t===n&&a===r)<<1)+((o===r&&t===i&&a===n)<<2)+((o===r&&t===n&&a===i)<<3)+((o===n&&t===i&&a===r)<<4)+((o===n&&t===r&&a===i)<<5)}function popcount0to63(e){return(1&e)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function matchAndStoreCoordinates(e,t,i,r,n,a,o){var s=o?1:0,l=n?1:0,c=computeOrderMask(e,t,s,l,0);if(0===c)return t;var u=n?1:0,d=a?1:0,h=computeOrderMask(e,i,0,u,d);if(0===h)return i;var p=o?1:0,n=a?1:0,o=computeOrderMask(e,r,p,0,n);if(0===o)return r;var m,f,g,a=c&h&o;if(1&a)m=0,f=1,g=2;else if(2&a)m=0,g=1,f=2;else if(4&a)f=0,m=1,g=2;else if(8&a)f=0,g=1,m=2;else if(16&a)g=0,m=1,f=2;else{if(!(32&a)){c=popcount0to63(c),h=popcount0to63(h),o=popcount0to63(o);return c<h&&c<o?t:h<o?i:r}g=0,f=1,m=2}t*=3;e[t+m]=s,e[t+f]=l,e[t+g]=0;i*=3;e[i+m]=0,e[i+f]=u,e[i+g]=d;r*=3;return e[r+m]=p,e[r+f]=0,e[r+g]=n,-1}function isHighlighted(e,t,i){var r=e[0];return 1===e[Math.min(t,i)*r+Math.max(t,i)]}function createTexture$1(e){var t=new Uint8Array(e);return t[e-1]=192,8===e?t[e-1]=96:4===e?t[e-1]=48:2===e?t[e-1]=24:1===e&&(t[e-1]=12),t}function updateBufferViewsWithNewVertices(e,t){for(var i=e.gltf,r=e._loadResources,n=0;n<t.length;++n){var a=t[n],o=a.extras._pipeline.vertexNumberingScope;a.extras._pipeline.vertexNumberingScope=void 0;var s=o.extraVertices,l=r.getBuffer(a),c=a.byteStride||4,u=s.length,d=new Uint8Array(l.byteLength+u*c);for(d.set(l),v=0;v<u;++v)for(var h=s[v]*c,p=l.length+v*c,m=0;m<c;++m)d[p+m]=d[h+m];a.byteOffset=0,a.byteLength=d.byteLength;var f=i.buffers.push({byteLength:d.byteLength,extras:{_pipeline:{source:d.buffer}}})-1;a.buffer=f,r.buffers[f]=d;var g=o.accessors;for(v=0;v<g.length;++v){var _=g[v];i.accessors[_].count+=u}if(!o.createdOutlines){a=o.outlineCoordinates,f=new Float32Array(a),a=e.gltf.buffers.push({byteLength:f.byteLength,extras:{_pipeline:{source:f.buffer}}})-1;r.buffers[a]=new Uint8Array(f.buffer,0,f.byteLength);for(var a=e.gltf.bufferViews.push({buffer:a,byteLength:f.byteLength,byteOffset:0,byteStride:3*Float32Array.BYTES_PER_ELEMENT,target:34962})-1,y=e.gltf.accessors.push({bufferView:a,byteOffset:0,componentType:5126,count:f.length/3,type:"VEC3",min:[0,0,0],max:[1,1,1]})-1,C=o.primitives,v=0;v<C.length;++v)C[v].attributes._OUTLINE_COORDINATES=y;r.vertexBuffersToCreate.enqueue(a),o.createdOutlines=!0}}}function compactBuffers(e){for(var t=e.gltf,i=e._loadResources,r=0;r<t.buffers.length;++r){var n=t.buffers[r],a=t.bufferViews.filter(usesBuffer.bind(void 0,r)),o=a.reduce(function(e,t){return e+t.byteLength},0);if(o!==n.byteLength){for(var s=new Uint8Array(o),l=0,c=0;c<a.length;++c){var u=a[c],d=i.getBuffer(u);s.set(d,l),u.byteOffset=l,l+=d.byteLength}i.buffers[r]=s,n.extras._pipeline.source=s.buffer,n.byteLength=o}}}function usesBuffer(e,t){return t.buffer===e}function getVertexNumberingScope(e,t){var i=t.attributes;if(void 0!==i){var r,n,a=e.gltf;for(n in i)if(i.hasOwnProperty(n)){var o=i[n],s=a.accessors[o].bufferView,s=a.bufferViews[s];if(defined(s.extras)||(s.extras={}),defined(s.extras._pipeline)||(s.extras._pipeline={}),defined(s.extras._pipeline.vertexNumberingScope)){if(void 0!==r&&s.extras._pipeline.vertexNumberingScope!==r)return}else s.extras._pipeline.vertexNumberingScope=r||{vertexCopies:[],extraVertices:[],outlineCoordinates:[],accessors:[],bufferViews:[],primitives:[],createdOutlines:!1};(r=s.extras._pipeline.vertexNumberingScope).bufferViews.indexOf(s)<0&&r.bufferViews.push(s),r.accessors.indexOf(o)<0&&r.accessors.push(o)}return r.primitives.push(t),r}}function ComputeCommand(e){e=defaultValue(e,defaultValue.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=defaultValue(e.persists,!1),this.pass=Pass$1.COMPUTE,this.owner=e.owner}ModelOutlineLoader.hasExtension=function(e){return defined(e.extensionsRequired.CESIUM_primitive_outline)||defined(e.extensionsUsed.CESIUM_primitive_outline)},ModelOutlineLoader.outlinePrimitives=function(n){if(ModelOutlineLoader.hasExtension(n)){var e=n.gltf,a=[];ForEach.mesh(e,function(e,r){ForEach.meshPrimitive(e,function(e,t){var i;defined(e.extensions)&&(!defined(i=e.extensions.CESIUM_primitive_outline)||void 0!==(e=getVertexNumberingScope(n,e))&&(a.indexOf(e)<0&&a.push(e),addOutline(n,r,t,i.indices,e)))})});for(var t=0;t<a.length;++t)updateBufferViewsWithNewVertices(n,a[t].bufferViews);compactBuffers(n)}},ModelOutlineLoader.createTexture=function(e,t){var i=t.cache.modelOutliningCache;if(defined(i)||(i=t.cache.modelOutliningCache={}),defined(i.outlineTexture))return i.outlineTexture;for(var r=Math.min(4096,ContextLimits.maximumTextureSize),n=r,a=createTexture$1(n),o=[];1<n;)o.push(createTexture$1(n>>=1));r=new Texture({context:t,source:{arrayBufferView:a,mipLevels:o},width:r,height:1,pixelFormat:PixelFormat$1.LUMINANCE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})});return i.outlineTexture=r},ComputeCommand.prototype.execute=function(e){e.execute(this)};var OctahedralProjectionAtlasFS="varying vec2 v_textureCoordinates;\nuniform float originalSize;\nuniform sampler2D texture0;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\nvoid main()\n{\nvec2 uv = v_textureCoordinates;\nvec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\nvec2 pixel = 1.0 / textureSize;\nfloat mipLevel = 0.0;\nif (uv.x - pixel.x > (textureSize.y / textureSize.x))\n{\nmipLevel = 1.0;\nif (uv.y - pixel.y > yMipLevel1)\n{\nmipLevel = 2.0;\nif (uv.y - pixel.y * 3.0 > yMipLevel2)\n{\nmipLevel = 3.0;\nif (uv.y - pixel.y * 5.0 > yMipLevel3)\n{\nmipLevel = 4.0;\nif (uv.y - pixel.y * 7.0 > yMipLevel4)\n{\nmipLevel = 5.0;\n}\n}\n}\n}\n}\nif (mipLevel > 0.0)\n{\nfloat scale = pow(2.0, mipLevel);\nuv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\nuv.x *= ((textureSize.x - 2.0) / textureSize.y);\nuv.x -= 1.0 + pixel.x;\nuv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\nuv *= scale;\n}\nelse\n{\nuv.x *= (textureSize.x / textureSize.y);\n}\nif(mipLevel == 0.0)\n{\ngl_FragColor = texture2D(texture0, uv);\n}\nelse if(mipLevel == 1.0)\n{\ngl_FragColor = texture2D(texture1, uv);\n}\nelse if(mipLevel == 2.0)\n{\ngl_FragColor = texture2D(texture2, uv);\n}\nelse if(mipLevel == 3.0)\n{\ngl_FragColor = texture2D(texture3, uv);\n}\nelse if(mipLevel == 4.0)\n{\ngl_FragColor = texture2D(texture4, uv);\n}\nelse if(mipLevel == 5.0)\n{\ngl_FragColor = texture2D(texture5, uv);\n}\nelse\n{\ngl_FragColor = vec4(0.0);\n}\n}\n",OctahedralProjectionFS="varying vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\nvoid main()\n{\nvec4 rgbm = textureCube(cubeMap, v_cubeMapCoordinates);\nfloat m = rgbm.a * 16.0;\nvec3 r = rgbm.rgb * m;\ngl_FragColor = vec4(r * r, 1.0);\n}\n",OctahedralProjectionVS="attribute vec4 position;\nattribute vec3 cubeMapCoordinates;\nvarying vec3 v_cubeMapCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_cubeMapCoordinates = cubeMapCoordinates;\n}\n";function OctahedralProjectedCubeMap(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._readyPromise=when.defer()}Object.defineProperties(OctahedralProjectedCubeMap.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),OctahedralProjectedCubeMap.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};for(var v1=new Cartesian3(1,0,0),v2=new Cartesian3(0,0,1),v3=new Cartesian3(-1,0,0),v4=new Cartesian3(0,0,-1),v5=new Cartesian3(0,1,0),v6=new Cartesian3(0,-1,0),cubeMapCoordinates=[v5,v3,v2,v6,v1,v5,v4,v5,v5],length=cubeMapCoordinates.length,flatCubeMapCoordinates=new Float32Array(3*length),offset=0,i$3=0;i$3<length;++i$3,offset+=3)Cartesian3.pack(cubeMapCoordinates[i$3],flatCubeMapCoordinates,offset);var flatPositions=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),indices=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function createVertexArray$2(e){var t=Buffer$1.createVertexBuffer({context:e,typedArray:flatPositions,usage:BufferUsage$1.STATIC_DRAW}),i=Buffer$1.createVertexBuffer({context:e,typedArray:flatCubeMapCoordinates,usage:BufferUsage$1.STATIC_DRAW}),r=Buffer$1.createIndexBuffer({context:e,typedArray:indices,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT});return new VertexArray({context:e,attributes:[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:ComponentDatatype$1.FLOAT},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT}],indexBuffer:r})}function createUniformTexture(e){return function(){return e}}function cleanupResources(e){var t,i;e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();var r=e._cubeMaps;if(defined(r))for(i=r.length,t=0;t<i;++t)r[t].destroy();var n=e._mipTextures;if(defined(n))for(i=n.length,t=0;t<i;++t)n[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}OctahedralProjectedCubeMap.prototype.update=function(e){var t=e.context;if(OctahedralProjectedCubeMap.isSupported(t)&&(defined(this._texture)&&defined(this._va)&&cleanupResources(this),!defined(this._texture))){if(!defined(this._texture)&&!this._loading){var i=t.textureCache.getTexture(this._url);if(defined(i))return cleanupResources(this),this._texture=i,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,void this._readyPromise.resolve()}var r,n=this._cubeMapBuffers;if(defined(n)||this._loading||(loadKTX((r=this)._url).then(function(e){r._cubeMapBuffers=e,r._loading=!1}).otherwise(this._readyPromise.reject),this._loading=!0),defined(this._cubeMapBuffers)){this._va=createVertexArray$2(t),this._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:OctahedralProjectionVS,fragmentShaderSource:OctahedralProjectionFS,attributeLocations:{position:0,cubeMapCoordinates:1}});var a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;for(var o=this._cubeMaps=new Array(a),s=this._mipTextures=new Array(a),l=2*n[0].positiveX.width,c={originalSize:function(){return l}},u=t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT,d=PixelFormat$1.RGBA,h=0;h<a;++h){var p=n[h].positiveY;n[h].positiveY=n[h].negativeY,n[h].negativeY=p;var m=o[h]=new CubeMap({context:t,source:n[h]}),p=2*o[h].width,p=s[h]=new Texture({context:t,width:p,height:p,pixelDatatype:u,pixelFormat:d}),m=new ComputeCommand({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:createUniformTexture(m)},outputTexture:p,persists:!0,owner:this});e.commandList.push(m),c["texture"+h]=createUniformTexture(p)}this._texture=new Texture({context:t,width:1.5*l+2,height:l,pixelDatatype:u,pixelFormat:d}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);i=new ComputeCommand({fragmentShaderSource:OctahedralProjectionAtlasFS,uniformMap:c,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(i),this._ready=!0,this._readyPromise.resolve()}}},OctahedralProjectedCubeMap.prototype.isDestroyed=function(){return!1},OctahedralProjectedCubeMap.prototype.destroy=function(){return cleanupResources(this),this._texture=this._texture&&this._texture.destroy(),destroyObject(this)};var boundingSphereCartesian3Scratch=new Cartesian3,ModelState=ModelUtility.ModelState,defaultModelAccept="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01",articulationEpsilon=CesiumMath.EPSILON16;function setCachedGltf(e,t){e._cachedGltf=t}function CachedGltf(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}Object.defineProperties(CachedGltf.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}}),CachedGltf.prototype.makeReady=function(e){this.gltf=e;for(var t=this.modelsToLoad,i=t.length,r=0;r<i;++r){var n=t[r];n.isDestroyed()||setCachedGltf(n,this)}this.modelsToLoad=void 0,this.ready=!0};var gltfCache={},uriToGuid={};function Model(e){var t,i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).cacheKey;this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=defaultValue(e.releaseGltfJson,!1),defined(i)&&defined(gltfCache[i])&&gltfCache[i].ready?++(r=gltfCache[i]).count:defined(t=e.gltf)&&((r=(t=t instanceof ArrayBuffer?new Uint8Array(t):t)instanceof Uint8Array?new CachedGltf({gltf:parseGlb(t),ready:!0}):new CachedGltf({gltf:e.gltf,ready:!0})).count=1,defined(i)&&(gltfCache[i]=r)),setCachedGltf(this,r);var r=defaultValue(e.basePath,"");this._resource=Resource.createIfNeeded(r);r=e.credit;"string"==typeof r&&(r=new Credit(r)),this._credit=r,this._resourceCredits=[],this.show=defaultValue(e.show,!0),this.silhouetteColor=defaultValue(e.silhouetteColor,Color.RED),this._silhouetteColor=new Color,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=defaultValue(e.silhouetteSize,0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=Matrix4.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=defaultValue(e.scale,1),this._scale=this.scale,this.minimumPixelSize=defaultValue(e.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=e.maximumScale,this._maximumScale=this.maximumScale,this.id=e.id,this._id=e.id,this.heightReference=defaultValue(e.heightReference,HeightReference$1.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;r=e.scene;defined(this._scene=r)&&defined(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=e.pickObject,this._allowPicking=defaultValue(e.allowPicking,!0),this._ready=!1,this._readyPromise=when.defer(),this.activeAnimations=new ModelAnimationCollection(this),this.clampAnimations=defaultValue(e.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=defaultValue(e.incrementallyLoadTextures,!0),this._asynchronous=defaultValue(e.asynchronous,!0),this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this._shadows=this.shadows,this.color=Color.clone(defaultValue(e.color,Color.WHITE)),this._colorPreviousAlpha=1,this.colorBlendMode=defaultValue(e.colorBlendMode,ColorBlendMode$1.HIGHLIGHT),this.colorBlendAmount=defaultValue(e.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._clippingPlanesState=0,this.referenceMatrix=void 0,this.backFaceCulling=defaultValue(e.backFaceCulling,!0),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=defaultValue(e.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=e.addBatchIdToGeneratedShaders,this._precreatedAttributes=e.precreatedAttributes,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=defaultValue(e.ignoreCommands,!1),this._requestType=e.requestType,this._upAxis=defaultValue(e.upAxis,Axis$1.Y),this._gltfForwardAxis=Axis$1.Z,this._forwardAxis=e.forwardAxis,this.cull=defaultValue(e.cull,!0),this.opaquePass=defaultValue(e.opaquePass,Pass$1.OPAQUE),this._computedModelMatrix=new Matrix4,this._clippingPlanesMatrix=Matrix4.clone(Matrix4.IDENTITY),this._iblReferenceFrameMatrix=Matrix3.clone(Matrix3.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new BoundingSphere,this._state=ModelState.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,articulationsByName:void 0,articulationsByStageKey:void 0,stagesByKey:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._dequantizeInShader=defaultValue(e.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._imageBasedLightingFactor=new Cartesian2(1,1),Cartesian2.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this._lightColor=Cartesian3.clone(e.lightColor),this._luminanceAtZenith=void 0,this.luminanceAtZenith=defaultValue(e.luminanceAtZenith,.2),this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._shouldUpdateSpecularMapAtlas=!0,this._specularEnvironmentMapAtlas=void 0,this._useDefaultSphericalHarmonics=!1,this._useDefaultSpecularMaps=!1,this._shouldRegenerateShaders=!1}function silhouetteSupported(e){return e.stencilBuffer}function isColorShadingEnabled(e){return!Color.equals(e.color,Color.WHITE)||e.colorBlendMode!==ColorBlendMode$1.HIGHLIGHT}function isClippingEnabled(e){e=e._clippingPlanes;return defined(e)&&e.enabled&&0!==e.length}function containsGltfMagic(e){return"glTF"===getMagic(e)}function getRuntime(e,t,i){return e._runtime[t][i]}Object.defineProperties(Model.prototype,{gltf:{get:function(){return defined(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._resource.url}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==HeightReference$1.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=Matrix4.getScale(e,boundingSphereCartesian3Scratch),e=defined(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;Cartesian3.multiplyByScalar(t,e,t);e=this._scaledBoundingSphere;return e.center=Cartesian3.multiplyComponents(this._boundingSphere.center,t,e.center),e.radius=Cartesian3.maximumComponent(t)*this._initialRadius,defined(this._rtcCenter)&&Cartesian3.add(this._rtcCenter,e.center,e.center),e}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return defined(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return defined(this._extensionsUsed)||(this._extensionsUsed=ModelUtility.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return defined(this._extensionsRequired)||(this._extensionsRequired=ModelUtility.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return defined(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){var t=this._imageBasedLightingFactor;e===t||Cartesian2.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||0<this._imageBasedLightingFactor.x&&0===e.x||0===this._imageBasedLightingFactor.x&&0<e.x,this._shouldRegenerateShaders=this._shouldRegenerateShaders||0<this._imageBasedLightingFactor.y&&0===e.y||0===this._imageBasedLightingFactor.y&&0<e.y,Cartesian2.clone(e,this._imageBasedLightingFactor))}},lightColor:{get:function(){return this._lightColor},set:function(e){var t=this._lightColor;e===t||Cartesian3.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||defined(t)&&!defined(e)||defined(e)&&!defined(t),this._lightColor=Cartesian3.clone(e,t))}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){var t=this._luminanceAtZenith;e!==t&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||defined(t)&&!defined(e)||defined(e)&&!defined(t),this._luminanceAtZenith=e)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){e!==this._sphericalHarmonicCoefficients&&(this._sphericalHarmonicCoefficients=e,this._shouldRegenerateShaders=!0)}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){this._shouldUpdateSpecularMapAtlas=this._shouldUpdateSpecularMapAtlas||e!==this._specularEnvironmentMaps,this._specularEnvironmentMaps=e}},credit:{get:function(){return this._credit}}}),Model.silhouetteSupported=function(e){return silhouetteSupported(e.context)},Model.fromGltf=function(e){var t=e.url;e=clone$1(e);var o=Resource.createIfNeeded(t),i=defaultValue(e.basePath,o.clone()),t=Resource.createIfNeeded(i),i=defaultValue(e.cacheKey,uriToGuid[getAbsoluteUri(o.url)]);defined(i)||(i=createGuid(),uriToGuid[getAbsoluteUri(o.url)]=i),defined(e.basePath)&&!defined(e.cacheKey)&&(i+=t.url),e.cacheKey=i,e.basePath=t;var s=new Model(e),l=gltfCache[i];return defined(l)?l.ready||(++l.count,l.modelsToLoad.push(s)):((l=new CachedGltf({ready:!1})).count=1,l.modelsToLoad.push(s),setCachedGltf(s,l),gltfCache[i]=l,defined(o.headers.Accept)||(o.headers.Accept=defaultModelAccept),o.fetchArrayBuffer().then(function(e){var t=new Uint8Array(e);containsGltfMagic(t)?(e=parseGlb(t),l.makeReady(e)):(t=getJsonFromTypedArray(t),l.makeReady(t));var i=s._resourceCredits,r=o.credits;if(defined(r))for(var n=r.length,a=0;a<n;a++)i.push(r[a])}).otherwise(ModelUtility.getFailedLoadFunction(s,"model",o.url))),s},Model._gltfCache=gltfCache,Model.prototype.getNode=function(e){e=getRuntime(this,"nodesByName",e);return defined(e)?e.publicNode:void 0},Model.prototype.getMesh=function(e){return getRuntime(this,"meshesByName",e)},Model.prototype.getMaterial=function(e){return getRuntime(this,"materialsByName",e)},Model.prototype.setArticulationStage=function(e,t){var i=getRuntime(this,"stagesByKey",e),e=getRuntime(this,"articulationsByStageKey",e);defined(i)&&defined(e)&&(t=CesiumMath.clamp(t,i.minimumValue,i.maximumValue),CesiumMath.equalsEpsilon(i.currentValue,t,articulationEpsilon)||(i.currentValue=t,e.isDirty=!0))};var scratchArticulationCartesian=new Cartesian3,scratchArticulationRotation=new Matrix3;function applyArticulationStageMatrix(e,t){var i,r=e.currentValue,n=scratchArticulationCartesian;switch(e.type){case"xRotate":i=Matrix3.fromRotationX(CesiumMath.toRadians(r),scratchArticulationRotation),Matrix4.multiplyByMatrix3(t,i,t);break;case"yRotate":i=Matrix3.fromRotationY(CesiumMath.toRadians(r),scratchArticulationRotation),Matrix4.multiplyByMatrix3(t,i,t);break;case"zRotate":i=Matrix3.fromRotationZ(CesiumMath.toRadians(r),scratchArticulationRotation),Matrix4.multiplyByMatrix3(t,i,t);break;case"xTranslate":n.x=r,n.y=0,n.z=0,Matrix4.multiplyByTranslation(t,n,t);break;case"yTranslate":n.x=0,n.y=r,n.z=0,Matrix4.multiplyByTranslation(t,n,t);break;case"zTranslate":n.x=0,n.y=0,n.z=r,Matrix4.multiplyByTranslation(t,n,t);break;case"xScale":n.x=r,n.y=1,n.z=1,Matrix4.multiplyByScale(t,n,t);break;case"yScale":n.x=1,n.y=r,n.z=1,Matrix4.multiplyByScale(t,n,t);break;case"zScale":n.x=1,n.y=1,n.z=r,Matrix4.multiplyByScale(t,n,t);break;case"uniformScale":Matrix4.multiplyByUniformScale(t,r,t)}return t}var scratchApplyArticulationTransform=new Matrix4;function addBuffersToLoadResources(e){var t=e.gltf,i=e._loadResources;ForEach.buffer(t,function(e,t){i.buffers[t]=e.extras._pipeline.source})}function bufferLoad(i,r){return function(e){var t=i._loadResources,e=new Uint8Array(e);--t.pendingBufferLoads,i.gltf.buffers[r].extras._pipeline.source=e}}function parseBufferViews(e){var i=e.gltf.bufferViews,r=e._loadResources.vertexBuffersToCreate;ForEach.bufferView(e.gltf,function(e,t){e.target===WebGLConstants$1.ARRAY_BUFFER&&r.enqueue(t)});var n=e._loadResources.indexBuffersToCreate,a={};ForEach.accessor(e.gltf,function(e){var t=e.bufferView;defined(t)&&(i[t].target!==WebGLConstants$1.ELEMENT_ARRAY_BUFFER||defined(a[t])||(a[t]=!0,n.enqueue({id:t,componentType:e.componentType})))})}function parseTechniques(e){var i,r,n,t=e.gltf;hasExtension(t,"KHR_techniques_webgl")&&(i=e._sourcePrograms,r=e._sourceTechniques,n=t.extensions.KHR_techniques_webgl.programs,ForEach.technique(t,function(e,t){r[t]=clone$1(e);e=e.program;defined(i[e])||(i[e]=clone$1(n[e]))}))}function shaderLoad(i,r,n){return function(e){var t=i._loadResources;t.shaders[n]={source:e,type:r,bufferView:void 0},--t.pendingShaderLoads,i._rendererResources.sourceShaders[n]=e}}function parseShaders(n){var e=n.gltf,a=e.buffers,o=e.bufferViews,s=n._rendererResources.sourceShaders;ForEach.shader(e,function(e,t){var i,r;defined(e.bufferView)?(i=e.bufferView,i=(r=o[i]).buffer,r=getStringFromTypedArray(a[i].extras._pipeline.source,r.byteOffset,r.byteLength),s[t]=r):defined(e.extras._pipeline.source)?s[t]=e.extras._pipeline.source:(++n._loadResources.pendingShaderLoads,(r=n._resource.getDerivedResource({url:e.uri})).fetchText().then(shaderLoad(n,e.type,t)).otherwise(ModelUtility.getFailedLoadFunction(n,"shader",r.url)))})}function parsePrograms(e){var t,i,r=e._sourceTechniques;for(t in r)r.hasOwnProperty(t)&&(i=r[t],e._loadResources.programsToCreate.enqueue({programId:i.program,techniqueId:t}))}function parseArticulations(e){var t={},i={},r={};e._runtime.articulationsByName=t,e._runtime.articulationsByStageKey=i,e._runtime.stagesByKey=r;e=e.gltf;if(hasExtension(e,"AGI_articulations")&&defined(e.extensions)&&defined(e.extensions.AGI_articulations)){var n=e.extensions.AGI_articulations.articulations;if(defined(n))for(var a=n.length,o=0;o<a;++o){var s=clone$1(n[o]);s.nodes=[],s.isDirty=!0;for(var l=(t[s.name]=s).stages.length,c=0;c<l;++c){var u=s.stages[c];u.currentValue=u.initialValue;var d=s.name+" "+u.name;i[d]=s,r[d]=u}}}}function imageLoad(i,r){return function(e){var t=i._loadResources;--t.pendingTextureLoads,t.texturesToCreate.enqueue({id:r,image:e,bufferView:e.bufferView,width:e.width,height:e.height,internalFormat:e.internalFormat})}}Model.prototype.applyArticulations=function(){var e,t=this._runtime.articulationsByName;for(e in t)if(t.hasOwnProperty(e)){var i=t[e];if(i.isDirty){i.isDirty=!1;for(var r=i.nodes.length,n=0;n<r;++n){for(var a=i.nodes[n],o=Matrix4.clone(a.originalMatrix,scratchApplyArticulationTransform),s=i.stages.length,l=0;l<s;++l)o=applyArticulationStageMatrix(i.stages[l],o);a.matrix=o}}}};var ktxRegex$1=/(^data:image\/ktx)|(\.ktx$)/i,crnRegex$1=/(^data:image\/crn)|(\.crn$)/i;function parseTextures(s,l,c){var u,e=s.gltf,d=e.images;ForEach.texture(e,function(e,t){var i=e.source;defined(e.extensions)&&defined(e.extensions.EXT_texture_webp)&&c&&(i=e.extensions.EXT_texture_webp.source);var r=d[i],n=r.extras,a=r.bufferView,o=r.mimeType;u=r.uri,defined(n)&&defined(n.compressedImage3DTiles)&&(e=n.compressedImage3DTiles.crunch,i=n.compressedImage3DTiles.s3tc,r=n.compressedImage3DTiles.pvrtc1,n=n.compressedImage3DTiles.etc1,l.s3tc&&defined(e)?(o=e.mimeType,defined(e.bufferView)?a=e.bufferView:u=e.uri):l.s3tc&&defined(i)?(o=i.mimeType,defined(i.bufferView)?a=i.bufferView:u=i.uri):l.pvrtc&&defined(r)?(o=r.mimeType,defined(r.bufferView)?a=r.bufferView:u=r.uri):l.etc1&&defined(n)&&(o=n.mimeType,defined(n.bufferView)?a=n.bufferView:u=n.uri)),defined(a)?s._loadResources.texturesToCreateFromBufferView.enqueue({id:t,image:void 0,bufferView:a,mimeType:o}):(++s._loadResources.pendingTextureLoads,o=s._resource.getDerivedResource({url:u}),(ktxRegex$1.test(u)?loadKTX(o):crnRegex$1.test(u)?loadCRN(o):o.fetchImage()).then(imageLoad(s,t)).otherwise(ModelUtility.getFailedLoadFunction(s,"image",o.url)))})}var scratchArticulationStageInitialTransform=new Matrix4;function parseNodes(s){var l={},c={},u=[],d=s._loadResources.skinnedNodesIds,h=s._runtime.articulationsByName;ForEach.node(s.gltf,function(e,t){var i={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new Matrix4,computedMatrix:new Matrix4,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:e.jointName,weights:[],children:[],parents:[],publicNode:void 0};if(i.publicNode=new ModelNode(s,e,i,t,ModelUtility.getTransform(e)),l[t]=i,c[e.name]=i,defined(e.skin)&&(d.push(t),u.push(i)),defined(e.extensions)&&defined(e.extensions.AGI_articulations)){e=e.extensions.AGI_articulations.articulationName;if(defined(e)){var r=Matrix4.clone(i.publicNode.originalMatrix,scratchArticulationStageInitialTransform),n=h[e];n.nodes.push(i.publicNode);for(var a=n.stages.length,o=0;o<a;++o)r=applyArticulationStageMatrix(n.stages[o],r);i.publicNode.matrix=r}}}),s._runtime.nodes=l,s._runtime.nodesByName=c,s._runtime.skinnedNodes=u}function parseMaterials(n){var e=n.gltf,a=n._sourceTechniques,o={},s={},l=n._uniformMaps;ForEach.material(e,function(e,t){l[t]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};var i,r=new ModelMaterial(n,e,t);defined(e.extensions)&&defined(e.extensions.KHR_techniques_webgl)&&(i=e.extensions.KHR_techniques_webgl.technique,r._technique=i,r._program=a[i].program,ForEach.materialValue(e,function(e,t){defined(r._values)||(r._values={}),r._values[t]=clone$1(e)})),o[e.name]=r,s[t]=r}),n._runtime.materialsByName=o,n._runtime.materialsById=s}function parseMeshes(a){var t={},i=a._runtime.materialsById;ForEach.mesh(a.gltf,function(e,n){t[e.name]=new ModelMesh(e,i,n),(defined(a.extensionsUsed.WEB3D_quantized_attributes)||a._dequantizeInShader)&&ForEach.meshPrimitive(e,function(e,t){var i=getProgramForPrimitive(a,e),r=a._programPrimitives[i];defined(r)||(a._programPrimitives[i]=r={}),r[n+".primitive."+t]=e})}),a._runtime.meshesByName=t}var CreateVertexBufferJob=function(){this.id=void 0,this.model=void 0,this.context=void 0};function createVertexBuffer$1(e,t,i){var r=t._loadResources,n=t.gltf.bufferViews[e];defined(n)||(n=r.createdBufferViews[e]);n=Buffer$1.createVertexBuffer({context:i,typedArray:r.getBuffer(n),usage:BufferUsage$1.STATIC_DRAW});n.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=n,t._geometryByteLength+=n.sizeInBytes}CreateVertexBufferJob.prototype.set=function(e,t,i){this.id=e,this.model=t,this.context=i},CreateVertexBufferJob.prototype.execute=function(){createVertexBuffer$1(this.id,this.model,this.context)};var CreateIndexBufferJob=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};function createIndexBuffer(e,t,i,r){var n=i._loadResources,a=i.gltf.bufferViews[e];defined(a)||(a=n.createdBufferViews[e]);t=Buffer$1.createIndexBuffer({context:r,typedArray:n.getBuffer(a),usage:BufferUsage$1.STATIC_DRAW,indexDatatype:t});t.vertexArrayDestroyable=!1,i._rendererResources.buffers[e]=t,i._geometryByteLength+=t.sizeInBytes}CreateIndexBufferJob.prototype.set=function(e,t,i,r){this.id=e,this.componentType=t,this.model=i,this.context=r},CreateIndexBufferJob.prototype.execute=function(){createIndexBuffer(this.id,this.componentType,this.model,this.context)};var scratchVertexBufferJob=new CreateVertexBufferJob,scratchIndexBufferJob=new CreateIndexBufferJob;function createBuffers(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){var r,n=t.context,a=i.vertexBuffersToCreate,o=i.indexBuffersToCreate;if(e.asynchronous){for(;0<a.length&&(scratchVertexBufferJob.set(a.peek(),e,n),t.jobScheduler.execute(scratchVertexBufferJob,JobType$1.BUFFER));)a.dequeue();for(;0<o.length&&(r=o.peek(),scratchIndexBufferJob.set(r.id,r.componentType,e,n),t.jobScheduler.execute(scratchIndexBufferJob,JobType$1.BUFFER));)o.dequeue()}else{for(;0<a.length;)createVertexBuffer$1(a.dequeue(),e,n);for(;0<o.length;)createIndexBuffer((r=o.dequeue()).id,r.componentType,e,n)}}}function getProgramForPrimitive(e,t){t=e._runtime.materialsById[t.material];if(defined(t))return t._program}function modifyShaderForQuantizedAttributes(e,t,i){var r,n,a,o=i._programPrimitives[t];if(!defined(o))return e;for(n in o)if(o.hasOwnProperty(n)&&getProgramForPrimitive(i,r=o[n])===t)break;if(i._programPrimitives[t]=void 0,i.extensionsUsed.WEB3D_quantized_attributes)a=ModelUtility.modifyShaderForQuantizedAttributes(i.gltf,r,e),i._quantizedUniforms[t]=a.uniforms;else{var s=i._decodedData[n];if(!defined(s))return e;a=ModelUtility.modifyShaderForDracoQuantizedAttributes(i.gltf,r,e,s.attributes)}return a.shader}function modifyShaderForColor(e){return e=ShaderSource.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n float highlight = ceil(gltf_colorBlend); \n gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n gl_FragColor.a *= gltf_color.a; \n} \n"}function modifyShader(e,t,i){return e=defined(i)?i(e,t):e}var CreateProgramJob=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0};function createProgram(e,t,i){var r=e.programId,n=e.techniqueId,a=t._sourcePrograms[r],o=t._rendererResources.sourceShaders,s=o[a.vertexShader],e=o[a.fragmentShader],o=t._quantizedVertexShaders;(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(defined(l=o[r])||(l=modifyShaderForQuantizedAttributes(s,r,t),o[r]=l),s=l);a=modifyShader(s,r,t._vertexShaderLoaded),o=modifyShader(e,r,t._fragmentShaderLoaded);defined(t._uniformMapLoaded)||(o="uniform vec4 czm_pickColor;\n"+o);var l=0<t._imageBasedLightingFactor.x||0<t._imageBasedLightingFactor.y;l&&(o="#define USE_IBL_LIGHTING \n\n"+o),defined(t._lightColor)&&(o="#define USE_CUSTOM_LIGHT_COLOR \n\n"+o),"2.0"===t._sourceVersion&&!t._sourceKHRTechniquesWebGL||(o=ShaderSource.replaceMain(o,"non_gamma_corrected_main"),o+="\nvoid main() { \n non_gamma_corrected_main(); \n gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),OctahedralProjectedCubeMap.isSupported(i)&&(s=defined(t._sphericalHarmonicCoefficients)||t._useDefaultSphericalHarmonics,e=defined(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready||t._useDefaultSpecularMaps,(s||e||l)&&(o="uniform mat3 gltf_iblReferenceFrameMatrix; \n"+o),defined(t._sphericalHarmonicCoefficients)?o="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+o:t._useDefaultSphericalHarmonics&&(o="#define DIFFUSE_IBL \n"+o),defined(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready?o="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+o:t._useDefaultSpecularMaps&&(o="#define SPECULAR_IBL \n"+o)),createAttributesAndProgram(r,n,o=defined(t._luminanceAtZenith)?"#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+o:o,a,t,i)}function recreateProgram(e,t,i){var r=e.programId,n=e.techniqueId,a=t._sourcePrograms[r],o=t._rendererResources.sourceShaders,s=t._quantizedVertexShaders,l=t.clippingPlanes,c=isClippingEnabled(t),e=o[a.vertexShader],a=o[a.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(e=s[r]);s=a;isColorShadingEnabled(t)&&(s=Model._modifyShaderForColor(s)),c&&(s=modifyShaderForClippingPlanes(s,l,i));a=modifyShader(e,r,t._vertexShaderLoaded),c=modifyShader(s,r,t._fragmentShaderLoaded);defined(t._uniformMapLoaded)||(c="uniform vec4 czm_pickColor;\n"+c);l=0<t._imageBasedLightingFactor.x||0<t._imageBasedLightingFactor.y;l&&(c="#define USE_IBL_LIGHTING \n\n"+c),defined(t._lightColor)&&(c="#define USE_CUSTOM_LIGHT_COLOR \n\n"+c),"2.0"===t._sourceVersion&&!t._sourceKHRTechniquesWebGL||(c=ShaderSource.replaceMain(c,"non_gamma_corrected_main"),c+="\nvoid main() { \n non_gamma_corrected_main(); \n gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),OctahedralProjectedCubeMap.isSupported(i)&&(e=defined(t._sphericalHarmonicCoefficients)||t._useDefaultSphericalHarmonics,s=defined(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready||t._useDefaultSpecularMaps,(e||s||l)&&(c="uniform mat3 gltf_iblReferenceFrameMatrix; \n"+c),defined(t._sphericalHarmonicCoefficients)?c="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+c:t._useDefaultSphericalHarmonics&&(c="#define DIFFUSE_IBL \n"+c),defined(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready?c="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+c:t._useDefaultSpecularMaps&&(c="#define SPECULAR_IBL \n"+c)),createAttributesAndProgram(r,n,c=defined(t._luminanceAtZenith)?"#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+c:c,a,t,i)}function createAttributesAndProgram(e,t,i,r,n,a){t=n._sourceTechniques[t],t=ModelUtility.createAttributeLocations(t,n._precreatedAttributes);n._rendererResources.programs[e]=ShaderProgram.fromCache({context:a,vertexShaderSource:r,fragmentShaderSource:i,attributeLocations:t})}CreateProgramJob.prototype.set=function(e,t,i){this.programToCreate=e,this.model=t,this.context=i},CreateProgramJob.prototype.execute=function(){createProgram(this.programToCreate,this.model,this.context)};var scratchCreateProgramJob=new CreateProgramJob;function createPrograms(e,t){var i=e._loadResources,r=i.programsToCreate;if(0===i.pendingShaderLoads&&0===i.pendingBufferLoads){var n=t.context;if(e.asynchronous)for(;0<r.length&&(scratchCreateProgramJob.set(r.peek(),e,n),t.jobScheduler.execute(scratchCreateProgramJob,JobType$1.PROGRAM));)r.dequeue();else for(;0<r.length;)createProgram(r.dequeue(),e,n)}}function getOnImageCreatedFromTypedArray(t,i){return function(e){t.texturesToCreate.enqueue({id:i.id,image:e,bufferView:void 0}),--t.pendingBufferViewToImage}}function loadTexturesFromBufferViews(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;0<t.texturesToCreateFromBufferView.length;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView];r.textures[i.id].source;var a=ModelUtility.getFailedLoadFunction(e,"image","id: "+i.id+", bufferView: "+i.bufferView);"image/ktx"===i.mimeType?(loadKTX(t.getBuffer(n)).then(imageLoad(e,i.id)).otherwise(a),++e._loadResources.pendingTextureLoads):"image/crn"===i.mimeType?(loadCRN(t.getBuffer(n)).then(imageLoad(e,i.id)).otherwise(a),++e._loadResources.pendingTextureLoads):(r=getOnImageCreatedFromTypedArray(t,i),loadImageFromTypedArray({uint8Array:t.getBuffer(n),format:i.mimeType,flipY:!1}).then(r).otherwise(a),++t.pendingBufferViewToImage)}}function createSamplers(e){var i,t=e._loadResources;t.createSamplers&&(t.createSamplers=!1,i=e._rendererResources.samplers,ForEach.sampler(e.gltf,function(e,t){i[t]=new Sampler({wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minFilter,magnificationFilter:e.magFilter})}))}var CreateTextureJob=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};function createTexture(e,t,i){var r=t.gltf.textures[e.id],n=t._rendererResources.samplers[r.sampler];defined(n)||(n=new Sampler({wrapS:TextureWrap$1.REPEAT,wrapT:TextureWrap$1.REPEAT}));for(var a=!1,o=t.gltf.materials,s=o.length,l=0;l<s;++l){var c=o[l];if(defined(c.extensions)&&defined(c.extensions.KHR_techniques_webgl)){var u,d=c.extensions.KHR_techniques_webgl.values;for(u in d)if(d.hasOwnProperty(u)&&-1!==u.indexOf("Texture")){var h=d[u];if(h.index===e.id&&defined(h.extensions)&&defined(h.extensions.KHR_texture_transform)){a=!0;break}}}if(a)break}var p=n.wrapS,m=n.wrapT,f=n.minificationFilter;a&&f!==TextureMinificationFilter$1.LINEAR&&f!==TextureMinificationFilter$1.NEAREST&&(f=f===TextureMinificationFilter$1.NEAREST_MIPMAP_NEAREST||f===TextureMinificationFilter$1.NEAREST_MIPMAP_LINEAR?TextureMinificationFilter$1.NEAREST:TextureMinificationFilter$1.LINEAR,n=new Sampler({wrapS:n.wrapS,wrapT:n.wrapT,textureMinificationFilter:f,textureMagnificationFilter:n.magnificationFilter}));var g,_=e.internalFormat,f=!(defined(_)&&PixelFormat$1.isCompressedFormat(_)||f!==TextureMinificationFilter$1.NEAREST_MIPMAP_NEAREST&&f!==TextureMinificationFilter$1.NEAREST_MIPMAP_LINEAR&&f!==TextureMinificationFilter$1.LINEAR_MIPMAP_NEAREST&&f!==TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR),p=f||p===TextureWrap$1.REPEAT||p===TextureWrap$1.MIRRORED_REPEAT||m===TextureWrap$1.REPEAT||m===TextureWrap$1.MIRRORED_REPEAT,m=e.image;defined(_)?g=new Texture({context:i,source:{arrayBufferView:e.bufferView},width:e.width,height:e.height,pixelFormat:_,sampler:n}):defined(m)&&(_=!CesiumMath.isPowerOfTwo(m.width)||!CesiumMath.isPowerOfTwo(m.height),p&&_&&((_=document.createElement("canvas")).width=CesiumMath.nextPowerOfTwo(m.width),_.height=CesiumMath.nextPowerOfTwo(m.height),_.getContext("2d").drawImage(m,0,0,m.width,m.height,0,0,_.width,_.height),m=_),g=new Texture({context:i,source:m,pixelFormat:r.internalFormat,pixelDatatype:r.type,sampler:n,flipY:!1}),f&&g.generateMipmap()),defined(g)&&(t._rendererResources.textures[e.id]=g,t._texturesByteLength+=g.sizeInBytes)}CreateTextureJob.prototype.set=function(e,t,i){this.gltfTexture=e,this.model=t,this.context=i},CreateTextureJob.prototype.execute=function(){createTexture(this.gltfTexture,this.model,this.context)};var scratchCreateTextureJob=new CreateTextureJob;function createTextures$2(e,t){var i=t.context,r=e._loadResources.texturesToCreate;if(e.asynchronous)for(;0<r.length&&(scratchCreateTextureJob.set(r.peek(),e,i),t.jobScheduler.execute(scratchCreateTextureJob,JobType$1.TEXTURE));)r.dequeue();else for(;0<r.length;)createTexture(r.dequeue(),e,i)}function getAttributeLocations$1(e,t){var i,r,n=e._sourceTechniques,a={},t=e._runtime.materialsById[t.material];if(!defined(t))return a;t=n[t._technique];if(!defined(t))return a;var o,s=t.attributes,l=e._rendererResources.programs[t.program]._attributeLocations;for(i in l)!l.hasOwnProperty(i)||defined(o=s[i])&&(r=l[i],a[o.semantic]=r);var c=e._precreatedAttributes;if(defined(c))for(i in c)c.hasOwnProperty(i)&&(r=l[i],a[i]=r);return a}function createJoints(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,a=e._runtime.nodes,o=e._loadResources.skinnedNodesIds,s=o.length,l=0;l<s;++l){var c=o[l],u=a[c],d=n[c],c=t[d.skin];u.inverseBindMatrices=c.inverseBindMatrices,u.bindShapeMatrix=c.bindShapeMatrix;for(var h=r[d.skin].joints,p=h.length,m=0;m<p;++m){var f=a[h[m]];u.joints.push(f)}}}function createSkins(n){var a,o,e=n._loadResources;0===e.pendingBufferLoads&&e.createSkins&&(e.createSkins=!1,e=n.gltf,a=e.accessors,o={},ForEach.skin(e,function(e,t){var i,r=a[e.inverseBindMatrices];Matrix4.equals(e.bindShapeMatrix,Matrix4.IDENTITY)||(i=Matrix4.clone(e.bindShapeMatrix)),o[t]={inverseBindMatrices:ModelAnimationCache.getSkinInverseBindMatrices(n,r),bindShapeMatrix:i}}),createJoints(n,o))}function getChannelEvaluator(t,i,r,n){return function(e){defined(n)&&(e=t.clampAnimations?n.clampTime(e):n.wrapTime(e),i[r]=n.evaluate(e,i[r]),i.dirtyNumber=t._maxDirtyNumber)}}function createRuntimeAnimations(f){var g,_,e=f._loadResources;e.finishedPendingBufferLoads()&&e.createRuntimeAnimations&&(e.createRuntimeAnimations=!1,f._runtime.animations=[],g=f._runtime.nodes,_=f.gltf.accessors,ForEach.animation(f.gltf,function(e,t){for(var i=e.channels,r=e.samplers,n=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=i.length,s=new Array(o),l=0;l<o;++l){var c=i[l],u=c.target,d=u.path,h=r[c.sampler],p=ModelAnimationCache.getAnimationParameterValues(f,_[h.input]),m=ModelAnimationCache.getAnimationParameterValues(f,_[h.output]),n=Math.min(n,p[0]),a=Math.max(a,p[p.length-1]),m=ModelAnimationCache.getAnimationSpline(f,t,e,c.sampler,h,p,d,m);s[l]=getChannelEvaluator(f,g[u.node],u.path,m)}f._runtime.animations[t]={name:e.name,startTime:n,stopTime:a,channelEvaluators:s}}))}function createVertexArrays$1(d,h){var p,m,f,g,e=d._loadResources;e.finishedBuffersCreation()&&e.finishedProgramCreation()&&e.createVertexArrays&&(e.createVertexArrays=!1,p=d._rendererResources.buffers,m=d._rendererResources.vertexArrays,f=d.gltf,g=f.accessors,ForEach.mesh(f,function(e,u){ForEach.meshPrimitive(e,function(e,t){var n,i,r,a=[],o=getAttributeLocations$1(d,e),s=d._decodedData[u+".primitive."+t];ForEach.meshPrimitiveAttribute(e,function(e,t){if(defined(n=o[t])){if(defined(s)){var i=s.attributes;if(i.hasOwnProperty(t)){var r=i[t];return void a.push({index:n,vertexBuffer:p[r.bufferView],componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype,normalize:r.normalized,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride})}}r=g[e],e=defined(r.normalized)&&r.normalized;a.push({index:n,vertexBuffer:p[r.bufferView],componentsPerAttribute:numberOfComponentsForType(r.type),componentDatatype:r.componentType,normalize:e,offsetInBytes:r.byteOffset,strideInBytes:getAccessorByteStride(f,r)})}});var l,c=d._precreatedAttributes;if(defined(c))for(r in c)c.hasOwnProperty(r)&&defined(n=o[r])&&((i=c[r]).index=n,a.push(i));defined(e.indices)&&(l=g[e.indices].bufferView,defined(s)&&(l=s.bufferView),l=p[l]),m[u+".primitive."+t]=new VertexArray({context:h,attributes:a,indexBuffer:l})})}))}function createRenderStates$3(i){var e=i._loadResources;e.createRenderStates&&(e.createRenderStates=!1,ForEach.material(i.gltf,function(e,t){createRenderStateForMaterial(i,e,t)}))}function createRenderStateForMaterial(e,t,i){var r=e._rendererResources.renderStates,n=[WebGLConstants$1.FUNC_ADD,WebGLConstants$1.FUNC_ADD],a=[WebGLConstants$1.ONE,WebGLConstants$1.ONE_MINUS_SRC_ALPHA,WebGLConstants$1.ONE,WebGLConstants$1.ONE_MINUS_SRC_ALPHA];defined(t.extensions)&&defined(t.extensions.KHR_blend)&&(n=t.extensions.KHR_blend.blendEquation,a=t.extensions.KHR_blend.blendFactors);e=!t.doubleSided,t="BLEND"===t.alphaMode;r[i]=RenderState.fromCache({cull:{enabled:e},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},depthMask:!t,blending:{enabled:t,equationRgb:n[0],equationAlpha:n[1],functionSourceRgb:a[0],functionDestinationRgb:a[1],functionSourceAlpha:a[2],functionDestinationAlpha:a[3]}})}var gltfUniformsFromNode={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new Matrix4;return function(){return Matrix4.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new Matrix4,n=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new Matrix4,n=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.multiply(e._projection,r,r),Matrix4.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new Matrix4,n=new Matrix3;return function(){return Matrix4.inverse(i.computedMatrix,r),Matrix4.getMatrix3(r,n),Matrix3.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new Matrix4,n=new Matrix4,a=new Matrix3;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.inverse(r,n),Matrix4.getMatrix3(n,a),Matrix3.transpose(a,a)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}};function getUniformFunctionFromSource(e,t,i,r){e=t._runtime.nodes[e];return gltfUniformsFromNode[i](r,t,e)}function createUniformsForMaterial(n,a,e,o,s,l,c){var u,d,h={},p={};return ForEach.techniqueUniform(e,function(e,t){var i,r;defined(o)&&defined(o[t])?(r=ModelUtility.createUniformFunction(e.type,o[t],l,c),h[t]=r.func,p[t]=r):defined(e.node)?h[t]=getUniformFunctionFromSource(e.node,n,e.semantic,s.uniformState):defined(e.semantic)?"JOINTMATRIX"===e.semantic?u=t:"MORPHWEIGHTS"===e.semantic?d=t:"ALPHACUTOFF"===e.semantic?defined(i=a.alphaMode)&&"MASK"===i&&(i=defaultValue(a.alphaCutoff,.5),r=ModelUtility.createUniformFunction(e.type,i,l,c),h[t]=r.func,p[t]=r):h[t]=ModelUtility.getGltfSemanticUniforms()[e.semantic](s.uniformState,n):defined(e.value)&&(e=ModelUtility.createUniformFunction(e.type,e.value,l,c),h[t]=e.func,p[t]=e)}),{map:h,values:p,jointMatrixUniformName:u,morphWeightsUniformName:d}}function createUniformMaps(a,o){var s,l,c,u,e=a._loadResources;e.finishedProgramCreation()&&e.createUniformMaps&&(e.createUniformMaps=!1,e=a.gltf,s=a._sourceTechniques,l=a._uniformMaps,c=a._rendererResources.textures,u=a._defaultTexture,ForEach.material(e,function(e,t){var i,r=a._runtime.materialsById[t],n=s[r._technique],r=r._values,r=createUniformsForMaterial(a,e,n,r,o,c,u),t=l[t];t.uniformMap=r.map,t.values=r.values,t.jointMatrixUniformName=r.jointMatrixUniformName,t.morphWeightsUniformName=r.morphWeightsUniformName,defined(n.attributes.a_outlineCoordinates)&&(i=ModelOutlineLoader.createTexture(a,o),t.uniformMap.u_outlineTexture=function(){return i})}))}function createUniformsForDracoQuantizedAttributes(e){return ModelUtility.createUniformsForDracoQuantizedAttributes(e.attributes)}function createUniformsForQuantizedAttributes(e,t){var i=getProgramForPrimitive(e,t),i=e._quantizedUniforms[i];return ModelUtility.createUniformsForQuantizedAttributes(e.gltf,t,i)}function createPickColorFunction$1(e){return function(){return e}}function createJointMatricesFunction(e){return function(){return e.computedJointMatrices}}function createMorphWeightsFunction(e){return function(){return e.weights}}function createSilhouetteColorFunction(e){return function(){return e.silhouetteColor}}function createSilhouetteSizeFunction(e){return function(){return e.silhouetteSize}}function createColorFunction(e){return function(){return e.color}}function createClippingPlanesMatrixFunction(e){return function(){return e._clippingPlanesMatrix}}function createIBLReferenceFrameMatrixFunction(e){return function(){return e._iblReferenceFrameMatrix}}function createClippingPlanesFunction(t){return function(){var e=t.clippingPlanes;return defined(e)&&e.enabled?e.texture:t._defaultTexture}}function createClippingPlanesEdgeStyleFunction(i){return function(){var e=i.clippingPlanes;if(!defined(e))return Color.WHITE.withAlpha(0);var t=Color.clone(e.edgeColor);return t.alpha=e.edgeWidth,t}}function createColorBlendFunction(e){return function(){return ColorBlendMode$1.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function createIBLFactorFunction(e){return function(){return e._imageBasedLightingFactor}}function createLightColorFunction(e){return function(){return e._lightColor}}function createLuminanceAtZenithFunction(e){return function(){return e.luminanceAtZenith}}function createSphericalHarmonicCoefficientsFunction(e){return function(){return e._sphericalHarmonicCoefficients}}function createSpecularEnvironmentMapFunction(e){return function(){return e._specularEnvironmentMapAtlas.texture}}function createSpecularEnvironmentMapSizeFunction(e){return function(){return e._specularEnvironmentMapAtlas.texture.dimensions}}function createSpecularEnvironmentMapLOD(e){return function(){return e._specularEnvironmentMapAtlas.maximumMipmapLevel}}function triangleCountFromPrimitiveIndices(e,t){switch(e.mode){case PrimitiveType$1.TRIANGLES:return t/3;case PrimitiveType$1.TRIANGLE_STRIP:case PrimitiveType$1.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function createCommand$2(e,t,i,r,n){for(var a=e._nodeCommands,o=e._pickIds,s=e.allowPicking,l=e._runtime.meshesByName,c=e._rendererResources,u=c.vertexArrays,d=c.programs,h=c.renderStates,p=e._uniformMaps,m=e.gltf,f=m.accessors,c=m.meshes,g=t.mesh,_=c[g],y=_.primitives,C=y.length,v=0;v<C;++v){var S,T=y[v],x=f[T.indices],b=e._runtime.materialsById[T.material]._program,E=e._decodedData[g+".primitive."+v],P=T.attributes.POSITION;defined(P)&&(M=ModelUtility.getAccessorMinMax(m,P),S=BoundingSphere.fromCornerPoints(Cartesian3.fromArray(M.min),Cartesian3.fromArray(M.max)));var A,w,D=u[g+".primitive."+v];w=defined(E)?(A=E.numberOfIndices,0):defined(x)?(A=x.count,x.byteOffset/IndexDatatype$1.getSizeInBytes(x.componentType)):(A=f[T.attributes.POSITION].count,0),e._trianglesLength+=triangleCountFromPrimitiveIndices(T,A);var P=p[T.material],M=P.uniformMap;defined(P.jointMatrixUniformName)&&((I={})[P.jointMatrixUniformName]=createJointMatricesFunction(i),M=combine$2(M,I)),defined(P.morphWeightsUniformName)&&((R={})[P.morphWeightsUniformName]=createMorphWeightsFunction(i),M=combine$2(M,R)),M=combine$2(M,{gltf_color:createColorFunction(e),gltf_colorBlend:createColorBlendFunction(e),gltf_clippingPlanes:createClippingPlanesFunction(e),gltf_clippingPlanesEdgeStyle:createClippingPlanesEdgeStyleFunction(e),gltf_clippingPlanesMatrix:createClippingPlanesMatrixFunction(e),gltf_iblReferenceFrameMatrix:createIBLReferenceFrameMatrixFunction(e),gltf_iblFactor:createIBLFactorFunction(e),gltf_lightColor:createLightColorFunction(e),gltf_sphericalHarmonicCoefficients:createSphericalHarmonicCoefficientsFunction(e),gltf_specularMap:createSpecularEnvironmentMapFunction(e),gltf_specularMapSize:createSpecularEnvironmentMapSizeFunction(e),gltf_maxSpecularLOD:createSpecularEnvironmentMapLOD(e),gltf_luminanceAtZenith:createLuminanceAtZenithFunction(e)}),defined(e._uniformMapLoaded)&&(M=e._uniformMapLoaded(M,b,i));x={};e.extensionsUsed.WEB3D_quantized_attributes?x=createUniformsForQuantizedAttributes(e,T):e._dequantizeInShader&&defined(E)&&(x=createUniformsForDracoQuantizedAttributes(E)),M=combine$2(M,x);var I=h[T.material],P=I.blending.enabled,R=e._pickObject;defined(R)||(R={primitive:e,id:e.id,node:i.publicNode,mesh:l[_.name]});var O,E=ShadowMode$1.castShadows(e._shadows),x=ShadowMode$1.receiveShadows(e._shadows);s&&!defined(e._uniformMapLoaded)&&(O=r.createPickId(R),o.push(O),M=combine$2(M,{czm_pickColor:createPickColorFunction$1(O.color)})),s&&(O=defined(e._pickIdLoaded)&&defined(e._uniformMapLoaded)?e._pickIdLoaded():"czm_pickColor");var L,P=new DrawCommand({boundingVolume:new BoundingSphere,cull:e.cull,modelMatrix:new Matrix4,primitiveType:T.mode,vertexArray:D,count:A,offset:w,shaderProgram:d[b],castShadows:E,receiveShadows:x,uniformMap:M,renderState:I,owner:R,pass:P?Pass$1.TRANSLUCENT:e.opaquePass,pickId:O});n||((L=DrawCommand.shallowClone(P)).boundingVolume=new BoundingSphere,L.modelMatrix=new Matrix4);b={show:!0,boundingSphere:S,command:P,command2D:L,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,disableCullingCommand:void 0,disableCullingCommand2D:void 0,programId:b};i.commands.push(b),a.push(b)}}function createRuntimeNodes(e,t,i){var r=e._loadResources;if(r.finishedEverythingButTextureCreation()&&r.createRuntimeNodes){r.createRuntimeNodes=!1;for(var n=[],a=e._runtime.nodes,r=e.gltf,o=r.nodes,s=r.scenes[r.scene].nodes,l=s.length,c=[],u={},d=0;d<l;++d)for(c.push({parentRuntimeNode:void 0,gltfNode:o[s[d]],id:s[d]});0<c.length;){var h=c.pop();u[h.id]=!0;var p=h.parentRuntimeNode,m=h.gltfNode,f=a[h.id];0===f.parents.length&&(defined(m.matrix)?f.matrix=Matrix4.fromColumnMajorArray(m.matrix):(h=m.rotation,f.translation=Cartesian3.fromArray(m.translation),f.rotation=Quaternion.unpack(h),f.scale=Cartesian3.fromArray(m.scale))),defined(p)?(p.children.push(f),f.parents.push(p)):n.push(f),defined(m.mesh)&&createCommand$2(e,m,f,t,i);var g=m.children;if(defined(g))for(var _=g.length,y=0;y<_;y++){var C=g[y];u[C]||c.push({parentRuntimeNode:f,gltfNode:o[C],id:g[y]})}}e._runtime.rootNodes=n,e._runtime.nodes=a}}function getGeometryByteLength(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&(i+=e[t].sizeInBytes);return i}function getTexturesByteLength(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&(i+=e[t].sizeInBytes);return i}function createResources$5(e,t){var i,r,n,a,o,s=t.context,l=t.scene3DOnly,c=e._quantizedVertexShaders,u=e._sourceTechniques,d=e._sourcePrograms,h=e._rendererResources,p=h.sourceShaders;for(i in e._loadRendererResourcesFromCache&&(p=h.sourceShaders=e._cachedRendererResources.sourceShaders),u)u.hasOwnProperty(i)&&(n=p[(a=d[r=u[i].program]).vertexShader],ModelUtility.checkSupportedGlExtensions(a.glExtensions,s),(e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader)&&(defined(a=c[r])||(a=modifyShaderForQuantizedAttributes(n,r,e),c[r]=a),n=a),n=modifyShader(n,r,e._vertexShaderLoaded));e._loadRendererResourcesFromCache?(o=e._cachedRendererResources,h.buffers=o.buffers,h.vertexArrays=o.vertexArrays,h.programs=o.programs,h.silhouettePrograms=o.silhouettePrograms,h.textures=o.textures,h.samplers=o.samplers,h.renderStates=o.renderStates,defined(e._precreatedAttributes)&&createVertexArrays$1(e,s),e._cachedGeometryByteLength+=getGeometryByteLength(o.buffers),e._cachedTexturesByteLength+=getTexturesByteLength(o.textures)):(createBuffers(e,t),createPrograms(e,t),createSamplers(e),loadTexturesFromBufferViews(e),createTextures$2(e,t)),createSkins(e),createRuntimeAnimations(e),e._loadRendererResourcesFromCache||(createVertexArrays$1(e,s),createRenderStates$3(e)),createUniformMaps(e,s),createRuntimeNodes(e,s,l)}function getNodeMatrix(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&defined(r)?Matrix4.clone(r,t):defined(e.matrix)?Matrix4.clone(e.matrix,t):(Matrix4.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),i.setMatrix(t))}var scratchNodeStack=[],scratchComputedTranslation$1=new Cartesian4,scratchComputedMatrixIn2D=new Matrix4;function updateNodeHierarchyModelMatrix(e,t,i,r){var n,a=e._maxDirtyNumber,o=e._runtime.rootNodes,s=o.length,l=scratchNodeStack,c=e._computedModelMatrix;e._mode===SceneMode$1.SCENE3D||e._ignoreCommands||(n=Matrix4.getColumn(c,3,scratchComputedTranslation$1),Cartesian4.equals(n,Cartesian4.UNIT_W)?(n=e.boundingSphere.center,n=Transforms.wgs84To2DModelMatrix(r,n,scratchComputedMatrixIn2D),c=Matrix4.multiply(n,c,scratchComputedMatrixIn2D),defined(e._rtcCenter)&&(Matrix4.setTranslation(c,Cartesian4.UNIT_W,c),e._rtcCenter=e._rtcCenter2D)):(c=Transforms.basisTo2D(r,c,scratchComputedMatrixIn2D),e._rtcCenter=e._rtcCenter3D));for(var u=0;u<s;++u)for(getNodeMatrix(d=o[u],d.transformToRoot),l.push(d);0<l.length;){var d,h=(d=l.pop()).transformToRoot,p=d.commands;if(d.dirtyNumber===a||t||i){var m=Matrix4.multiplyTransformation(c,h,d.computedMatrix),f=p.length;if(0<f)for(var g=0;g<f;++g){var _=p[g],y=_.command;Matrix4.clone(m,y.modelMatrix),BoundingSphere.transform(_.boundingSphere,y.modelMatrix,y.boundingVolume),defined(e._rtcCenter)&&Cartesian3.add(e._rtcCenter,y.boundingVolume.center,y.boundingVolume.center),defined(y=_.command2D)&&e._mode===SceneMode$1.SCENE2D&&(Matrix4.clone(m,y.modelMatrix),y.modelMatrix[13]-=2*CesiumMath.sign(y.modelMatrix[13])*CesiumMath.PI*r.ellipsoid.maximumRadius,BoundingSphere.transform(_.boundingSphere,y.modelMatrix,y.boundingVolume))}}var C=d.children;if(defined(C))for(var v=C.length,S=0;S<v;++S){var T=C[S];T.dirtyNumber=Math.max(T.dirtyNumber,d.dirtyNumber),T.dirtyNumber!==a&&!i||(getNodeMatrix(T,T.transformToRoot),Matrix4.multiplyTransformation(h,T.transformToRoot,T.transformToRoot)),l.push(T)}}++e._maxDirtyNumber}var scratchObjectSpace=new Matrix4;function applySkins(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;r<i;++r){var n=t[r];scratchObjectSpace=Matrix4.inverseTransformation(n.transformToRoot,scratchObjectSpace);for(var a=n.computedJointMatrices,o=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,c=l.length,u=0;u<c;++u)defined(a[u])||(a[u]=new Matrix4),a[u]=Matrix4.multiplyTransformation(scratchObjectSpace,o[u].transformToRoot,a[u]),a[u]=Matrix4.multiplyTransformation(a[u],l[u],a[u]),defined(s)&&(a[u]=Matrix4.multiplyTransformation(a[u],s,a[u]))}}function updatePerNodeShow(e){for(var t=e._runtime.rootNodes,i=t.length,r=scratchNodeStack,n=0;n<i;++n)for((a=t[n]).computedShow=a.publicNode.show,r.push(a);0<r.length;){for(var a,o=(a=r.pop()).computedShow,s=a.commands,l=s.length,c=0;c<l;++c)s[c].show=o;var u=a.children;if(defined(u))for(var d=u.length,h=0;h<d;++h){var p=u[h];p.computedShow=o&&p.publicNode.show,r.push(p)}}}function updatePickIds(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,a=0;a<n;++a)r[a].object.id=i}}function updateWireframe$1(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?PrimitiveType$1.LINES:PrimitiveType$1.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.primitiveType=t}}function updateShowBoundingVolume$1(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.debugShowBoundingVolume=t}}function updateShadows$1(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=ShadowMode$1.castShadows(e.shadows),i=ShadowMode$1.receiveShadows(e.shadows),r=e._nodeCommands,n=r.length,a=0;a<n;a++){var o=r[a];o.command.castShadows=t,o.command.receiveShadows=i}}}function getTranslucentRenderState$1(e,t){t=clone$1(t,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=BlendingState$1.ALPHA_BLEND,e.opaquePass===Pass$1.CESIUM_3D_TILE&&(t.stencilTest=StencilConstants$1.setCesium3DTileBit(),t.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK),RenderState.fromCache(t)}function deriveTranslucentCommand(e,t){var i=DrawCommand.shallowClone(t);return i.pass=Pass$1.TRANSLUCENT,i.renderState=getTranslucentRenderState$1(e,t.renderState),i}function updateColor(e,t,i){var r=t.scene3DOnly,t=e.color.alpha;if(0<t&&t<1){var n=e._nodeCommands,a=n.length;if(0<a&&(!defined(n[0].translucentCommand)||i))for(var o=0;o<a;++o){var s=n[o],l=s.command;s.translucentCommand=deriveTranslucentCommand(e,l),r||(l=s.command2D,s.translucentCommand2D=deriveTranslucentCommand(e,l))}}}function getDisableCullingRenderState$1(e){e=clone$1(e,!0);return e.cull.enabled=!1,RenderState.fromCache(e)}function deriveDisableCullingCommand(e){var t=DrawCommand.shallowClone(e);return t.renderState=getDisableCullingRenderState$1(e.renderState),t}function updateBackFaceCulling$1(e,t,i){var r=t.scene3DOnly;if(!e.backFaceCulling){var n=e._nodeCommands,a=n.length;if(0<a&&(!defined(n[0].disableCullingCommand)||i))for(var o=0;o<a;++o){var s=n[o],l=s.command;s.disableCullingCommand=deriveDisableCullingCommand(l),r||(l=s.command2D,s.disableCullingCommand2D=deriveDisableCullingCommand(l))}}}function getProgramId(e,t){var i,r=e._rendererResources.programs;for(i in r)if(r.hasOwnProperty(i)&&r[i]===t)return i}function createSilhouetteProgram(e,t,i){var r=t.vertexShaderSource.sources[0],t=t._attributeLocations,e=e._normalAttributeName,r=ShaderSource.replaceMain(r,"gltf_silhouette_main");return ShaderProgram.fromCache({context:i.context,vertexShaderSource:r+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n gltf_silhouette_main(); \n vec3 n = normalize(czm_normal3D * "+e+"); \n n.x *= czm_projection[0][0]; \n n.y *= czm_projection[1][1]; \n vec4 clip = gl_Position; \n clip.xy += n.xy * clip.w * gltf_silhouetteSize * czm_pixelRatio / czm_viewport.z; \n gl_Position = clip; \n}",fragmentShaderSource:"uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n gl_FragColor = czm_gammaCorrect(gltf_silhouetteColor); \n}",attributeLocations:t})}function hasSilhouette(e,t){return silhouetteSupported(t.context)&&0<e.silhouetteSize&&0<e.silhouetteColor.alpha&&defined(e._normalAttributeName)}function hasTranslucentCommands(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;++r)if(t[r].command.pass===Pass$1.TRANSLUCENT)return!0;return!1}function isTranslucent(e){return 0<e.color.alpha&&e.color.alpha<1}function isInvisible(e){return 0===e.color.alpha}function alphaDirty(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}var silhouettesLength=0;function createSilhouetteCommands(e,t){for(var i=++silhouettesLength%255,r=hasTranslucentCommands(e)||isTranslucent(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,o=e._nodeCommands,s=o.length,l=0;l<s;++l){var c=o[l],u=c.command,d=isTranslucent(e)?c.translucentCommand:u,h=DrawCommand.shallowClone(d),p=clone$1(d.renderState);p.stencilTest={enabled:!0,frontFunction:WebGLConstants$1.ALWAYS,backFunction:WebGLConstants$1.ALWAYS,reference:i,mask:-1,frontOperation:{fail:WebGLConstants$1.KEEP,zFail:WebGLConstants$1.KEEP,zPass:WebGLConstants$1.REPLACE},backOperation:{fail:WebGLConstants$1.KEEP,zFail:WebGLConstants$1.KEEP,zPass:WebGLConstants$1.REPLACE}},isInvisible(e)&&(p.colorMask={red:!1,green:!1,blue:!1,alpha:!1},p.depthMask=!1),p=RenderState.fromCache(p),h.renderState=p,c.silhouetteModelCommand=h;var m=DrawCommand.shallowClone(u);(p=clone$1(u.renderState,!0)).depthTest.enabled=!0,p.cull.enabled=!1,r&&(m.pass=Pass$1.TRANSLUCENT,p.depthMask=!1,p.blending=BlendingState$1.ALPHA_BLEND),p.stencilTest={enabled:!0,frontFunction:WebGLConstants$1.NOTEQUAL,backFunction:WebGLConstants$1.NOTEQUAL,reference:i,mask:-1,frontOperation:{fail:WebGLConstants$1.KEEP,zFail:WebGLConstants$1.KEEP,zPass:WebGLConstants$1.KEEP},backOperation:{fail:WebGLConstants$1.KEEP,zFail:WebGLConstants$1.KEEP,zPass:WebGLConstants$1.KEEP}},p=RenderState.fromCache(p);var f=u.shaderProgram,g=getProgramId(e,f),d=n[g];defined(d)||(d=createSilhouetteProgram(e,f,t),n[g]=d);u=combine$2(u.uniformMap,{gltf_silhouetteColor:createSilhouetteColorFunction(e),gltf_silhouetteSize:createSilhouetteSizeFunction(e)});m.renderState=p,m.shaderProgram=d,m.uniformMap=u,m.castShadows=!1,m.receiveShadows=!1,c.silhouetteColorCommand=m,a||(u=c.command2D,(h=DrawCommand.shallowClone(h)).boundingVolume=u.boundingVolume,h.modelMatrix=u.modelMatrix,c.silhouetteModelCommand2D=h,m=DrawCommand.shallowClone(m),h.boundingVolume=u.boundingVolume,h.modelMatrix=u.modelMatrix,c.silhouetteColorCommand2D=m)}}function modifyShaderForClippingPlanes(e,t,i){return e=ShaderSource.replaceMain(e,"gltf_clip_main"),e+=Model._getClippingFunction(t,i)+"\n",e+="uniform highp sampler2D gltf_clippingPlanes; \nuniform mat4 gltf_clippingPlanesMatrix; \nuniform vec4 gltf_clippingPlanesEdgeStyle; \nvoid main() \n{ \n gltf_clip_main(); \n"+getClipAndStyleCode("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")+"} \n"}function updateSilhouette(e,t,i){var r;hasSilhouette(e,t)&&(r=0<(r=e._nodeCommands).length&&(alphaDirty(e.color.alpha,e._colorPreviousAlpha)||alphaDirty(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!defined(r[0].silhouetteModelCommand)),e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(r||i)&&createSilhouetteCommands(e,t))}function updateClippingPlanes$1(e,t){var i=e._clippingPlanes;defined(i)&&i.owner===e&&i.enabled&&i.update(t)}var scratchBoundingSphere$1=new BoundingSphere;function scaleInPixels(e,t,i){return scratchBoundingSphere$1.center=e,scratchBoundingSphere$1.radius=t,i.camera.getPixelSize(scratchBoundingSphere$1,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}var scratchPosition$6=new Cartesian3,scratchCartographic$c=new Cartographic;function getScale(e,t){var i,r,n,a=e.scale;return 0!==e.minimumPixelSize&&(r=t.context,i=Math.max(r.drawingBufferWidth,r.drawingBufferHeight),r=defined(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,scratchPosition$6.x=r[12],scratchPosition$6.y=r[13],scratchPosition$6.z=r[14],defined(e._rtcCenter)&&Cartesian3.add(e._rtcCenter,scratchPosition$6,scratchPosition$6),e._mode!==SceneMode$1.SCENE3D&&(n=(r=t.mapProjection).ellipsoid.cartesianToCartographic(scratchPosition$6,scratchCartographic$c),r.project(n,scratchPosition$6),Cartesian3.fromElements(scratchPosition$6.z,scratchPosition$6.x,scratchPosition$6.y,scratchPosition$6)),n=e.boundingSphere.radius,t=scaleInPixels(scratchPosition$6,n,t),Math.min(2*n*(1/t),i)<e.minimumPixelSize&&(a=e.minimumPixelSize*t/(2*e._initialRadius))),defined(e.maximumScale)?Math.min(e.maximumScale,a):a}function releaseCachedGltf(e){defined(e._cacheKey)&&defined(e._cachedGltf)&&0==--e._cachedGltf.count&&delete gltfCache[e._cacheKey],e._cachedGltf=void 0}function CachedRendererResources(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function destroy(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function destroyCachedRendererResources(e){destroy(e.buffers),destroy(e.vertexArrays),destroy(e.programs),destroy(e.silhouettePrograms),destroy(e.textures)}function getUpdateHeightCallback(i,r,n){return function(e){i.heightReference===HeightReference$1.RELATIVE_TO_GROUND&&((t=r.cartesianToCartographic(e,scratchCartographic$c)).height+=n.height,r.cartographicToCartesian(t,e));var t=i._clampedModelMatrix;Matrix4.clone(i.modelMatrix,t),t[12]=e.x,t[13]=e.y,t[14]=e.z,i._heightChanged=!0}}function updateClamping(e){defined(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t,i,r,n=e._scene;defined(n)&&defined(n.globe)&&e.heightReference!==HeightReference$1.NONE?(t=(r=n.globe).ellipsoid,i=e.modelMatrix,scratchPosition$6.x=i[12],scratchPosition$6.y=i[13],scratchPosition$6.z=i[14],n=t.cartesianToCartographic(scratchPosition$6),defined(e._clampedModelMatrix)||(e._clampedModelMatrix=Matrix4.clone(i,new Matrix4)),i=r._surface,e._removeUpdateHeightCallback=i.updateHeight(n,getUpdateHeightCallback(e,t,n)),defined(i=r.getHeight(n))&&(r=getUpdateHeightCallback(e,t,n),Cartographic.clone(n,scratchCartographic$c),scratchCartographic$c.height=i,t.cartographicToCartesian(scratchCartographic$c,scratchPosition$6),r(scratchPosition$6))):e._clampedModelMatrix=void 0}CachedRendererResources.prototype.release=function(){if(0==--this.count)return defined(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],destroyCachedRendererResources(this),destroyObject(this)};var scratchDisplayConditionCartesian=new Cartesian3,scratchDistanceDisplayConditionCartographic=new Cartographic;function distanceDisplayConditionVisible(e,t){var i,r,n=e.distanceDisplayCondition,a=n.near*n.near,o=n.far*n.far;return t.mode===SceneMode$1.SCENE2D?(i=.5*(t.camera.frustum.right-t.camera.frustum.left),i*=i):(r=Matrix4.getTranslation(e.modelMatrix,scratchDisplayConditionCartesian),t.mode===SceneMode$1.COLUMBUS_VIEW&&(e=(n=t.mapProjection).ellipsoid.cartesianToCartographic(r,scratchDistanceDisplayConditionCartographic),r=n.project(e,r),Cartesian3.fromElements(r.z,r.x,r.y,r)),i=Cartesian3.distanceSquared(r,t.camera.positionWC)),a<=i&&i<=o}var scratchClippingPlanesMatrix$2=new Matrix4,scratchIBLReferenceFrameMatrix4=new Matrix4,scratchIBLReferenceFrameMatrix3=new Matrix3;function destroyIfNotCached(e,t){e.programs!==t.programs&&destroy(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&destroy(e.silhouettePrograms)}function regenerateShaders(e,t){var i=e._rendererResources,r=e._cachedRendererResources;if(destroyIfNotCached(i,r),isClippingEnabled(e)||isColorShadingEnabled(e)||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,i.programs={},i.silhouettePrograms={};var n,a={},o=e._sourceTechniques;for(n in o)o.hasOwnProperty(n)&&(a[d=o[n].program]||(a[d]=!0,recreateProgram({programId:d,techniqueId:n},e,t.context)))}else i.programs=r.programs,i.silhouettePrograms=r.silhouettePrograms;for(var s=i.programs,l=e._nodeCommands,c=l.length,u=0;u<c;++u){var d,h=l[u],p=s[d=h.programId];h.command.shaderProgram=p,defined(h.command2D)&&(h.command2D.shaderProgram=p)}updateColor(e,t,!0),updateBackFaceCulling$1(e,t,!0),updateSilhouette(e,t,!0)}function Batched3DModel3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._model=void 0,this._batchTable=void 0,this._features=void 0,this._classificationType=e.vectorClassificationOnly?void 0:e.classificationType,this._batchIdAttributeName=void 0,this._diffuseAttributeOrUniformName={},this._rtcCenterTransform=void 0,this._contentModelMatrix=void 0,this.featurePropertiesDirty=!1,initialize$6(this,r,n)}Model.prototype.update=function(e){if(e.mode!==SceneMode$1.MORPHING)if(FeatureDetection.supportsWebP.initialized){var t=FeatureDetection.supportsWebP(),i=e.context;if(this._defaultTexture=i.defaultTexture,this._state===ModelState.NEEDS_LOAD&&defined(this.gltf)){var r=this.cacheKey;if(defined(r)){i.cache.modelRendererResourceCache=defaultValue(i.cache.modelRendererResourceCache,{});var n,a=i.cache.modelRendererResourceCache;if(defined(n=a[this.cacheKey])){if(!n.ready)return;++n.count,this._loadRendererResourcesFromCache=!0}else(n=new CachedRendererResources(i,r)).count=1,a[this.cacheKey]=n;this._cachedRendererResources=n}else(n=new CachedRendererResources(i)).count=1,this._cachedRendererResources=n;this._state=ModelState.LOADING,this._state!==ModelState.FAILED&&(defined(l=this.gltf.extensions)&&defined(l.CESIUM_RTC)&&(c=Cartesian3.fromArray(l.CESIUM_RTC.center),Cartesian3.equals(c,Cartesian3.ZERO)||(this._rtcCenter3D=c,o=(u=e.mapProjection).ellipsoid.cartesianToCartographic(this._rtcCenter3D),s=u.project(o),Cartesian3.fromElements(s.z,s.x,s.y,s),this._rtcCenter2D=s,this._rtcCenterEye=new Cartesian3,this._rtcCenter=this._rtcCenter3D)),addPipelineExtras(this.gltf),this._loadResources=new ModelLoadResources,this._loadRendererResourcesFromCache||ModelUtility.parseBuffers(this,bufferLoad))}var o,s,l=this._loadResources,c=this._incrementallyLoadTextures,u=!1;this._state===ModelState.LOADING&&(0===l.pendingBufferLoads&&(l.initialized||(e.brdfLutGenerator.update(e),ModelUtility.checkSupportedExtensions(this.extensionsRequired,t),ModelUtility.updateForwardAxis(this),defined(this.gltf.extras.sourceVersion)||((o=this.gltf).extras.sourceVersion=ModelUtility.getAssetVersion(o),o.extras.sourceKHRTechniquesWebGL=defined(ModelUtility.getUsedExtensions(o).KHR_techniques_webgl),this._sourceVersion=o.extras.sourceVersion,this._sourceKHRTechniquesWebGL=o.extras.sourceKHRTechniquesWebGL,updateVersion(o),addDefaults(o),processModelMaterialsCommon(o,s={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders}),processPbrMaterials(o,s)),this._sourceVersion=this.gltf.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltf.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&DracoLoader.hasExtension(this),addBuffersToLoadResources(this),parseArticulations(this),parseTechniques(this),this._loadRendererResourcesFromCache||(parseBufferViews(this),parseShaders(this),parsePrograms(this),parseTextures(this,i,t)),parseMaterials(this),parseMeshes(this),parseNodes(this),DracoLoader.parse(this,i),l.initialized=!0),l.finishedDecoding()||DracoLoader.decodeModel(this,i).otherwise(ModelUtility.getFailedLoadFunction(this,"model",this.basePath)),l.finishedDecoding()&&!l.resourcesParsed&&(this._boundingSphere=ModelUtility.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,DracoLoader.cacheDataForModel(this),l.resourcesParsed=!0),l.resourcesParsed&&0===l.pendingShaderLoads&&(ModelOutlineLoader.outlinePrimitives(this),createResources$5(this,e))),(l.finished()||c&&l.finishedEverythingButTextureCreation())&&(this._state=ModelState.LOADED,u=!0)),defined(l)&&this._state===ModelState.LOADED&&(c&&!u&&createResources$5(this,e),l.finished()&&(this._loadResources=void 0,h=this._rendererResources,(p=this._cachedRendererResources).buffers=h.buffers,p.vertexArrays=h.vertexArrays,p.programs=h.programs,p.sourceShaders=h.sourceShaders,p.silhouettePrograms=h.silhouettePrograms,p.textures=h.textures,p.samplers=h.samplers,p.renderStates=h.renderStates,p.ready=!0,this._normalAttributeName=ModelUtility.getAttributeOrUniformBySemantic(this.gltf,"NORMAL"),defined(this._precreatedAttributes)&&(p.vertexArrays={}),this.releaseGltfJson&&releaseCachedGltf(this)));var d,t=OctahedralProjectedCubeMap.isSupported(i);this._shouldUpdateSpecularMapAtlas&&t&&(this._shouldUpdateSpecularMapAtlas=!1,this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._specularEnvironmentMapAtlas=void 0,defined(this._specularEnvironmentMaps)&&(this._specularEnvironmentMapAtlas=new OctahedralProjectedCubeMap(this._specularEnvironmentMaps),(d=this)._specularEnvironmentMapAtlas.readyPromise.then(function(){d._shouldRegenerateShaders=!0}).otherwise(function(e){console.error("Error loading specularEnvironmentMaps: "+e)})),this._shouldRegenerateShaders=!0),defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);var c=!defined(this._specularEnvironmentMapAtlas)&&defined(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,l=!defined(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,h=!defined(this._sphericalHarmonicCoefficients)&&defined(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,p=!defined(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||c||l||h||p,this._useDefaultSpecularMaps=!defined(this._specularEnvironmentMapAtlas)&&defined(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!defined(this._sphericalHarmonicCoefficients)&&defined(e.sphericalHarmonicCoefficients);var m,f,g,_=hasSilhouette(this,e),y=isTranslucent(this),t=isInvisible(this),C=this.backFaceCulling,c=!defined(this.distanceDisplayCondition)||distanceDisplayConditionVisible(this,e),l=this.show&&c&&0!==this.scale&&(!t||_);if((l&&this._state===ModelState.LOADED||u)&&(h=this.activeAnimations.update(e)||this._cesiumAnimationsDirty,this._cesiumAnimationsDirty=!1,this._dirty=!1,p=this.modelMatrix,c=e.mode!==this._mode,this._mode=e.mode,((t=!Matrix4.equals(this._modelMatrix,p)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||c)||u)&&(Matrix4.clone(p,this._modelMatrix),updateClamping(this),defined(this._clampedModelMatrix)&&(p=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1,c=getScale(this,e),g=this._computedModelMatrix,Matrix4.multiplyByUniformScale(p,c,g),this._upAxis===Axis$1.Y?Matrix4.multiplyTransformation(g,Axis$1.Y_UP_TO_Z_UP,g):this._upAxis===Axis$1.X&&Matrix4.multiplyTransformation(g,Axis$1.X_UP_TO_Z_UP,g),this.forwardAxis===Axis$1.Z&&Matrix4.multiplyTransformation(g,Axis$1.Z_UP_TO_X_UP,g)),(h||t||u)&&(updateNodeHierarchyModelMatrix(this,t,u,e.mapProjection),this._dirty=!0,(h||u)&&applySkins(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,updatePerNodeShow(this)),updatePickIds(this),updateWireframe$1(this),updateShowBoundingVolume$1(this),updateShadows$1(this),updateClippingPlanes$1(this,e),g=0,h=defined(t=this._clippingPlanes)&&t.enabled&&0<t.length,p=defaultValue(this.referenceMatrix,p),h&&(m=Matrix4.multiply(i.uniformState.view3D,p,m=scratchClippingPlanesMatrix$2),m=Matrix4.multiply(m,t.modelMatrix,m),this._clippingPlanesMatrix=Matrix4.inverseTranspose(m,this._clippingPlanesMatrix),g=t.clippingPlanesState),m=defined(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics,t=defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps,(m||t)&&(f=scratchIBLReferenceFrameMatrix3,p=Matrix4.multiply(i.uniformState.view3D,p,p=scratchIBLReferenceFrameMatrix4),f=Matrix4.getMatrix3(p,f),f=Matrix3.getRotation(f,f),this._iblReferenceFrameMatrix=Matrix3.transpose(f,this._iblReferenceFrameMatrix)),f=(f=this._shouldRegenerateShaders)||this._clippingPlanesState!==g,this._clippingPlanesState=g,(g=isColorShadingEnabled(this))!==this._colorShadingEnabled&&(this._colorShadingEnabled=g,f=!0),f?regenerateShaders(this,e):(updateColor(this,e,!1),updateBackFaceCulling$1(this,e,!1),updateSilhouette(this,e,!1))),u){var v=this;e.afterRender.push(function(){v._ready=!0,v._readyPromise.resolve(v)})}else{if(l&&!this._ignoreCommands){var S,T,x,b,E=e.commandList,P=e.passes,A=this._nodeCommands,w=A.length,D=e.mapProjection.ellipsoid.maximumRadius*CesiumMath.PI;if(P.render||P.pick&&this.allowPicking){for(S=0;S<w;++S)(b=A[S]).show&&(x=b.command,_?x=b.silhouetteModelCommand:y?x=b.translucentCommand:C||(x=b.disableCullingCommand),E.push(x),T=b.command.boundingVolume,e.mode===SceneMode$1.SCENE2D&&(T.center.y+T.radius>D||T.center.y-T.radius<D)&&(x=b.command2D,_?x=b.silhouetteModelCommand2D:y?x=b.translucentCommand2D:C||(x=b.disableCullingCommand2D),E.push(x)));if(_&&!P.pick)for(S=0;S<w;++S)(b=A[S]).show&&(E.push(b.silhouetteColorCommand),T=b.command.boundingVolume,e.mode===SceneMode$1.SCENE2D&&(T.center.y+T.radius>D||T.center.y-T.radius<D)&&E.push(b.silhouetteColorCommand2D))}}P=this._credit;defined(P)&&e.creditDisplay.addCredit(P);for(var M=this._resourceCredits,I=M.length,R=0;R<I;R++)e.creditDisplay.addCredit(M[R])}}else FeatureDetection.supportsWebP.initialize()},Model.prototype.isDestroyed=function(){return!1},Model.prototype.destroy=function(){defined(this._precreatedAttributes)&&destroy(this._rendererResources.vertexArrays),defined(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),defined(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),defined(this._cachedRendererResources)&&destroyIfNotCached(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),DracoLoader.destroyCachedDataForModel(this);for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();releaseCachedGltf(this),this._quantizedVertexShaders=void 0;var r=this._clippingPlanes;return defined(r)&&!r.isDestroyed()&&r.owner===this&&r.destroy(),this._clippingPlanes=void 0,this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),destroyObject(this)},Model._getClippingFunction=getClippingFunction,Model._modifyShaderForColor=modifyShaderForColor,Batched3DModel3DTileContent._deprecationWarning=deprecationWarning,Object.defineProperties(Batched3DModel3DTileContent.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var sizeOfUint32$5=Uint32Array.BYTES_PER_ELEMENT;function getBatchIdAttributeName(e){var t=ModelUtility.getAttributeOrUniformBySemantic(e,"_BATCHID");return defined(t)||defined(t=ModelUtility.getAttributeOrUniformBySemantic(e,"BATCHID"))&&Batched3DModel3DTileContent._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`."),t}function getVertexShaderCallback$1(a){return function(e,t){var i=a._batchTable,r=!defined(a._classificationType),n=a._model.gltf;defined(n)&&(a._batchIdAttributeName=getBatchIdAttributeName(n),a._diffuseAttributeOrUniformName[t]=ModelUtility.getDiffuseAttributeOrUniform(n,t));t=i.getVertexShaderCallback(r,a._batchIdAttributeName,a._diffuseAttributeOrUniformName[t]);return defined(t)?t(e):e}}function getFragmentShaderCallback$1(a){return function(e,t){var i=a._batchTable,r=!defined(a._classificationType),n=a._model.gltf;defined(n)&&(a._diffuseAttributeOrUniformName[t]=ModelUtility.getDiffuseAttributeOrUniform(n,t));t=i.getFragmentShaderCallback(r,a._diffuseAttributeOrUniformName[t],!1);return defined(t)?t(e):e}}function getPickIdCallback$1(e){return function(){return e._batchTable.getPickId()}}function getClassificationFragmentShaderCallback(i){return function(e){var t=i._batchTable.getClassificationFragmentShaderCallback();return defined(t)?t(e):e}}function createColorChangedCallback$2(i){return function(e,t){i._model.updateCommands(e,t)}}function initialize$6(e,t,i){var r=e._tileset,n=e._tile,a=e._resource,o=defaultValue(i,0);i=o;var s=new Uint8Array(t),l=new DataView(t),c=l.getUint32(i+=sizeOfUint32$5,!0);if(1!==c)throw new RuntimeError("Only Batched 3D Model version 1 is supported. Version "+c+" is not.");var u,d=l.getUint32(i+=sizeOfUint32$5,!0),h=l.getUint32(i+=sizeOfUint32$5,!0),p=l.getUint32(i+=sizeOfUint32$5,!0),c=l.getUint32(i+=sizeOfUint32$5,!0),l=l.getUint32(i+=sizeOfUint32$5,!0);i+=sizeOfUint32$5,570425344<=c?(i-=2*sizeOfUint32$5,g=h,c=p,p=h=l=0,Batched3DModel3DTileContent._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/master/specification/TileFormats/Batched3DModel.")):570425344<=l&&(i-=sizeOfUint32$5,g=c,c=h,l=p,p=h=0,Batched3DModel3DTileContent._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/master/specification/TileFormats/Batched3DModel.")),0===h?u={BATCH_LENGTH:defaultValue(g,0)}:(u=getJsonFromTypedArray(s,i,h),i+=h);h=new Uint8Array(t,i,p);i+=p;var m,f,h=new Cesium3DTileFeatureTable(u,h),g=h.getGlobalProperty("BATCH_LENGTH");h.featuresLength=g,0<c&&(m=getJsonFromTypedArray(s,i,c),i+=c,0<l&&(f=new Uint8Array(t,i,l),f=new Uint8Array(f),i+=l));var _=new Cesium3DTileBatchTable(e,g,m,f,_=defined(e._classificationType)?createColorChangedCallback$2(e):_);e._batchTable=_;d=o+d-i;if(0==d)throw new RuntimeError("glTF byte length must be greater than 0.");i=i%4==0?new Uint8Array(t,i,d):(Batched3DModel3DTileContent._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),new Uint8Array(s.subarray(i,i+d))),d={content:e,primitive:r};e._rtcCenterTransform=Matrix4.IDENTITY;h=h.getGlobalProperty("RTC_CENTER",ComponentDatatype$1.FLOAT,3);defined(h)&&(e._rtcCenterTransform=Matrix4.fromTranslation(Cartesian3.fromArray(h))),e._contentModelMatrix=Matrix4.multiply(n.computedTransform,e._rtcCenterTransform,new Matrix4),defined(e._classificationType)?e._model=new ClassificationModel({gltf:i,cull:!1,basePath:a,requestType:RequestType$1.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:r._gltfUpAxis,forwardAxis:Axis$1.X,debugWireframe:r.debugWireframe,vertexShaderLoaded:getVertexShaderCallback$1(e),classificationShaderLoaded:getClassificationFragmentShaderCallback(e),uniformMapLoaded:_.getUniformMapCallback(),pickIdLoaded:getPickIdCallback$1(e),classificationType:e._classificationType,batchTable:_}):(e._model=new Model({gltf:i,cull:!1,releaseGltfJson:!0,opaquePass:Pass$1.CESIUM_3D_TILE,basePath:a,requestType:RequestType$1.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:r._gltfUpAxis,forwardAxis:Axis$1.X,shadows:r.shadows,debugWireframe:r.debugWireframe,incrementallyLoadTextures:!1,vertexShaderLoaded:getVertexShaderCallback$1(e),fragmentShaderLoaded:getFragmentShaderCallback$1(e),uniformMapLoaded:_.getUniformMapCallback(),pickIdLoaded:getPickIdCallback$1(e),addBatchIdToGeneratedShaders:0<g,pickObject:d,imageBasedLightingFactor:r.imageBasedLightingFactor,lightColor:r.lightColor,luminanceAtZenith:r.luminanceAtZenith,sphericalHarmonicCoefficients:r.sphericalHarmonicCoefficients,specularEnvironmentMaps:r.specularEnvironmentMaps,backFaceCulling:r.backFaceCulling}),e._model.readyPromise.then(function(e){e.activeAnimations.addAll({loop:ModelAnimationLoop$1.REPEAT})}))}function createFeatures$4(e){var t=e.featuresLength;if(!defined(e._features)&&0<t){for(var i=new Array(t),r=0;r<t;++r)i[r]=new Cesium3DTileFeature(e,r);e._features=i}}function Composite3DTileContent(e,t,i,r,n,a){this._tileset=e,this._tile=t,this._resource=i,this._contents=[],this._readyPromise=when.defer(),initialize$5(this,r,n,a)}Batched3DModel3DTileContent.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Batched3DModel3DTileContent.prototype.getFeature=function(e){return createFeatures$4(this),this._features[e]},Batched3DModel3DTileContent.prototype.applyDebugSettings=function(e,t){t=e?t:Color.WHITE,0===this.featuresLength?this._model.color=t:this._batchTable.setAllColor(t)},Batched3DModel3DTileContent.prototype.applyStyle=function(e){var t,i;0===this.featuresLength?(t=defined(e)&&defined(e.color),i=defined(e)&&defined(e.show),this._model.color=t?e.color.evaluateColor(void 0,this._model.color):Color.clone(Color.WHITE,this._model.color),this._model.show=!i||e.show.evaluate(void 0)):this._batchTable.applyStyle(e)},Batched3DModel3DTileContent.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._contentModelMatrix=Matrix4.multiply(this._tile.computedTransform,this._rtcCenterTransform,this._contentModelMatrix),this._model.modelMatrix=this._contentModelMatrix,this._model.shadows=this._tileset.shadows,this._model.imageBasedLightingFactor=this._tileset.imageBasedLightingFactor,this._model.lightColor=this._tileset.lightColor,this._model.luminanceAtZenith=this._tileset.luminanceAtZenith,this._model.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._model.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._model.backFaceCulling=this._tileset.backFaceCulling,this._model.debugWireframe=this._tileset.debugWireframe;e=this._tileset.clippingPlanes;this._model.referenceMatrix=this._tileset.clippingPlanesOriginMatrix,defined(e)&&this._tile.clippingPlanesDirty&&(this._model._clippingPlanes=e.enabled&&this._tile._isClipped?e:void 0),defined(e)&&defined(this._model._clippingPlanes)&&this._model._clippingPlanes!==e&&(this._model._clippingPlanes=e),this._model.update(t),i<t.commandList.length&&(t.passes.render||t.passes.pick)&&!defined(this._classificationType)&&this._batchTable.addDerivedCommands(t,i)},Batched3DModel3DTileContent.prototype.isDestroyed=function(){return!1},Batched3DModel3DTileContent.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)},Object.defineProperties(Composite3DTileContent.prototype,{featurePropertiesDirty:{get:function(){for(var e=this._contents,t=e.length,i=0;i<t;++i)if(e[i].featurePropertiesDirty)return!0;return!1},set:function(e){for(var t=this._contents,i=t.length,r=0;r<i;++r)t[r].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}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}});var sizeOfUint32$4=Uint32Array.BYTES_PER_ELEMENT;function initialize$5(t,e,i,r){i=defaultValue(i,0);var n=new Uint8Array(e),a=new DataView(e),o=a.getUint32(i+=sizeOfUint32$4,!0);if(1!==o)throw new RuntimeError("Only Composite Tile version 1 is supported. Version "+o+" is not.");i+=sizeOfUint32$4;var s=a.getUint32(i+=sizeOfUint32$4,!0);i+=sizeOfUint32$4;for(var l=[],c=0;c<s;++c){var u=getMagic(n,i),d=a.getUint32(i+2*sizeOfUint32$4,!0),h=r[u];if(!defined(h))throw new RuntimeError("Unknown tile content type, "+u+", inside Composite tile");h=h(t._tileset,t._tile,t._resource,e,i);t._contents.push(h),l.push(h.readyPromise),i+=d}when.all(l).then(function(){t._readyPromise.resolve(t)}).otherwise(function(e){t._readyPromise.reject(e)})}function Vector3DTileGeometry(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,defined(this._center)||(defined(this._boundingVolume)?this._center=Cartesian3.clone(this._boundingVolume.center):this._center=Cartesian3.clone(Cartesian3.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._readyPromise=when.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ClassificationType$1.BOTH}function packBuffer$4(e){var t=new Float64Array(Matrix4.packedLength+Cartesian3.packedLength),i=0;return Cartesian3.pack(e._center,t,0),i+=Cartesian3.packedLength,Matrix4.pack(e._modelMatrix,t,i),t}function unpackBuffer$1(e,t){for(var i=0,r=t[i++],n=t[i++],a=e._boundingVolumes=new Array(n),o=0;o<n;++o)a[o]=BoundingSphere.unpack(t,i),i+=BoundingSphere.packedLength;for(var s=t[i++],l=e._batchedIndices=new Array(s),c=0;c<s;++c){var u=Color.unpack(t,i);i+=Color.packedLength;for(var d=t[i++],h=t[i++],p=t[i++],m=new Array(p),f=0;f<p;++f)m[f]=t[i++];l[c]=new Vector3DTileBatch({color:u,offset:d,count:h,batchIds:m})}return r}Composite3DTileContent.prototype.hasProperty=function(e,t){return!1},Composite3DTileContent.prototype.getFeature=function(e){},Composite3DTileContent.prototype.applyDebugSettings=function(e,t){for(var i=this._contents,r=i.length,n=0;n<r;++n)i[n].applyDebugSettings(e,t)},Composite3DTileContent.prototype.applyStyle=function(e){for(var t=this._contents,i=t.length,r=0;r<i;++r)t[r].applyStyle(e)},Composite3DTileContent.prototype.update=function(e,t){for(var i=this._contents,r=i.length,n=0;n<r;++n)i[n].update(e,t)},Composite3DTileContent.prototype.isDestroyed=function(){return!1},Composite3DTileContent.prototype.destroy=function(){for(var e=this._contents,t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)},Object.defineProperties(Vector3DTileGeometry.prototype,{trianglesLength:{get:function(){return defined(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return defined(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}}),Vector3DTileGeometry.packedBoxLength=Matrix4.packedLength+Cartesian3.packedLength,Vector3DTileGeometry.packedCylinderLength=Matrix4.packedLength+2,Vector3DTileGeometry.packedEllipsoidLength=Matrix4.packedLength+Cartesian3.packedLength,Vector3DTileGeometry.packedSphereLength=Cartesian3.packedLength+1;var createVerticesTaskProcessor$4=new TaskProcessor("createVectorTileGeometries",5),scratchColor$j=new Color;function createPrimitive$1(i){if(!defined(i._primitive)){if(!defined(i._verticesPromise)){var e=i._boxes,t=i._boxBatchIds,r=i._cylinders,n=i._cylinderBatchIds,a=i._ellipsoids,o=i._ellipsoidBatchIds,s=i._spheres,l=i._sphereBatchIds,c=i._batchTableColors,u=i._packedBuffer;if(!defined(c)){var d=0;defined(i._boxes)&&(e=i._boxes=arraySlice(e),d+=(t=i._boxBatchIds=arraySlice(t)).length),defined(i._cylinders)&&(r=i._cylinders=arraySlice(r),d+=(n=i._cylinderBatchIds=arraySlice(n)).length),defined(i._ellipsoids)&&(a=i._ellipsoids=arraySlice(a),d+=(o=i._ellipsoidBatchIds=arraySlice(o)).length),defined(i._spheres)&&(s=i._sphere=arraySlice(s),d+=(l=i._sphereBatchIds=arraySlice(l)).length);for(var c=i._batchTableColors=new Uint32Array(d),h=i._batchTable,p=0;p<d;++p){var m=h.getColor(p,scratchColor$j);c[p]=m.toRgba()}u=i._packedBuffer=packBuffer$4(i)}var f=[];defined(e)&&f.push(e.buffer,t.buffer),defined(r)&&f.push(r.buffer,n.buffer),defined(a)&&f.push(a.buffer,o.buffer),defined(s)&&f.push(s.buffer,l.buffer),f.push(c.buffer,u.buffer);u={boxes:defined(e)?e.buffer:void 0,boxBatchIds:defined(e)?t.buffer:void 0,cylinders:defined(r)?r.buffer:void 0,cylinderBatchIds:defined(r)?n.buffer:void 0,ellipsoids:defined(a)?a.buffer:void 0,ellipsoidBatchIds:defined(a)?o.buffer:void 0,spheres:defined(s)?s.buffer:void 0,sphereBatchIds:defined(s)?l.buffer:void 0,batchTableColors:c.buffer,packedBuffer:u.buffer},f=i._verticesPromise=createVerticesTaskProcessor$4.scheduleTask(u,f);if(!defined(f))return;f.then(function(e){var t=new Float64Array(e.packedBuffer),t=unpackBuffer$1(i,t);i._indices=new(2===t?Uint16Array:Uint32Array)(e.indices),i._indexOffsets=new Uint32Array(e.indexOffsets),i._indexCounts=new Uint32Array(e.indexCounts),i._positions=new Float32Array(e.positions),i._vertexBatchIds=new Uint16Array(e.vertexBatchIds),i._batchIds=new Uint16Array(e.batchIds),i._ready=!0})}i._ready&&!defined(i._primitive)&&(i._primitive=new Vector3DTilePrimitive({batchTable:i._batchTable,positions:i._positions,batchIds:i._batchIds,vertexBatchIds:i._vertexBatchIds,indices:i._indices,indexOffsets:i._indexOffsets,indexCounts:i._indexCounts,batchedIndices:i._batchedIndices,boundingVolume:i._boundingVolume,boundingVolumes:i._boundingVolumes,center:i._center,pickObject:defaultValue(i._pickObject,i)}),i._boxes=void 0,i._boxBatchIds=void 0,i._cylinders=void 0,i._cylinderBatchIds=void 0,i._ellipsoids=void 0,i._ellipsoidBatchIds=void 0,i._spheres=void 0,i._sphereBatchIds=void 0,i._center=void 0,i._modelMatrix=void 0,i._batchTable=void 0,i._boundingVolume=void 0,i._boundingVolumes=void 0,i._batchedIndices=void 0,i._indices=void 0,i._indexOffsets=void 0,i._indexCounts=void 0,i._positions=void 0,i._vertexBatchIds=void 0,i._batchIds=void 0,i._batchTableColors=void 0,i._packedBuffer=void 0,i._verticesPromise=void 0,i._readyPromise.resolve())}}function Geometry3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._geometries=void 0,this._contentReadyPromise=void 0,this._readyPromise=when.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,initialize$4(this,r,n)}function createColorChangedCallback$1(i){return function(e,t){defined(i._geometries)&&i._geometries.updateCommands(e,t)}}function getBatchIds$1(e,t){var i,r,n,a,o,s,l,c=defaultValue(e.BOXES_LENGTH,0),u=defaultValue(e.CYLINDERS_LENGTH,0),d=defaultValue(e.ELLIPSOIDS_LENGTH,0),h=defaultValue(e.SPHERES_LENGTH,0);0<c&&defined(e.BOX_BATCH_IDS)&&(r=t.byteOffset+e.BOX_BATCH_IDS.byteOffset,n=new Uint16Array(t.buffer,r,c)),0<u&&defined(e.CYLINDER_BATCH_IDS)&&(o=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset,a=new Uint16Array(t.buffer,o,u)),0<d&&defined(e.ELLIPSOID_BATCH_IDS)&&(o=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset,s=new Uint16Array(t.buffer,o,d)),0<h&&defined(e.SPHERE_BATCH_IDS)&&(p=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset,l=new Uint16Array(t.buffer,p,h));var t=defined(n)||defined(a)||defined(s)||defined(l),p=0<c&&!defined(n)||0<u&&!defined(a)||0<d&&!defined(s)||0<h&&!defined(l);if(t&&p)throw new RuntimeError("If one group of batch ids is defined, then all batch ids must be defined.");if(!(defined(n)||defined(a)||defined(s)||defined(l))){var m=0;if(!defined(n)&&0<c)for(n=new Uint16Array(c),i=0;i<c;++i)n[i]=m++;if(!defined(a)&&0<u)for(a=new Uint16Array(u),i=0;i<u;++i)a[i]=m++;if(!defined(s)&&0<d)for(s=new Uint16Array(d),i=0;i<d;++i)s[i]=m++;if(!defined(l)&&0<h)for(l=new Uint16Array(h),i=0;i<h;++i)l[i]=m++}return{boxes:n,cylinders:a,ellipsoids:s,spheres:l}}Vector3DTileGeometry.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},Vector3DTileGeometry.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},Vector3DTileGeometry.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},Vector3DTileGeometry.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},Vector3DTileGeometry.prototype.update=function(e){createPrimitive$1(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},Vector3DTileGeometry.prototype.isDestroyed=function(){return!1},Vector3DTileGeometry.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)},Object.defineProperties(Geometry3DTileContent.prototype,{featuresLength:{get:function(){return defined(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return defined(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return defined(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return defined(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var sizeOfUint32$3=Uint32Array.BYTES_PER_ELEMENT;function initialize$4(e,t,i){i=defaultValue(i,0);var r=new Uint8Array(t),n=new DataView(t),a=n.getUint32(i+=sizeOfUint32$3,!0);if(1!==a)throw new RuntimeError("Only Geometry tile version 1 is supported. Version "+a+" is not.");var o=n.getUint32(i+=sizeOfUint32$3,!0);if(i+=sizeOfUint32$3,0!==o){var s=n.getUint32(i,!0);if(i+=sizeOfUint32$3,0===s)throw new RuntimeError("Feature table must have a byte length greater than zero");var l=n.getUint32(i,!0),a=n.getUint32(i+=sizeOfUint32$3,!0),o=n.getUint32(i+=sizeOfUint32$3,!0),n=getJsonFromTypedArray(r,i+=sizeOfUint32$3,s);i+=s;s=new Uint8Array(t,i,l);i+=l,0<a&&(f=getJsonFromTypedArray(r,i,a),i+=a,0<o&&(c=new Uint8Array(t,i,o),c=new Uint8Array(c)));var c,u,d,h,p,m,r=defaultValue(n.BOXES_LENGTH,0),a=defaultValue(n.CYLINDERS_LENGTH,0),t=defaultValue(n.ELLIPSOIDS_LENGTH,0),i=defaultValue(n.SPHERES_LENGTH,0),o=r+a+t+i,f=new Cesium3DTileBatchTable(e,o,f,c,createColorChangedCallback$1(e));e._batchTable=f,0!==o&&(c=e.tile.computedTransform,defined(n.RTC_CENTER)&&(u=Cartesian3.unpack(n.RTC_CENTER),Matrix4.multiplyByPoint(c,u,u)),o=getBatchIds$1(n,s),(0<r||0<a||0<t||0<i)&&(0<r&&(d=s.byteOffset+n.BOXES.byteOffset,d=new Float32Array(s.buffer,d,Vector3DTileGeometry.packedBoxLength*r)),0<a&&(h=s.byteOffset+n.CYLINDERS.byteOffset,h=new Float32Array(s.buffer,h,Vector3DTileGeometry.packedCylinderLength*a)),0<t&&(p=s.byteOffset+n.ELLIPSOIDS.byteOffset,p=new Float32Array(s.buffer,p,Vector3DTileGeometry.packedEllipsoidLength*t)),0<i&&(m=s.byteOffset+n.SPHERES.byteOffset,m=new Float32Array(s.buffer,m,Vector3DTileGeometry.packedSphereLength*i)),e._geometries=new Vector3DTileGeometry({boxes:d,boxBatchIds:o.boxes,cylinders:h,cylinderBatchIds:o.cylinders,ellipsoids:p,ellipsoidBatchIds:o.ellipsoids,spheres:m,sphereBatchIds:o.spheres,center:u,modelMatrix:c,batchTable:f,boundingVolume:e.tile.boundingVolume.boundingVolume})))}else e._readyPromise.resolve(e)}function createFeatures$3(e){var t=e.featuresLength;!defined(e._features)&&0<t&&(t=new Array(t),defined(e._geometries)&&e._geometries.createFeatures(e,t),e._features=t)}function ModelInstance(e,t,i){this.primitive=e,this._modelMatrix=Matrix4.clone(t),this._instanceId=i}Geometry3DTileContent.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Geometry3DTileContent.prototype.getFeature=function(e){return createFeatures$3(this),this._features[e]},Geometry3DTileContent.prototype.applyDebugSettings=function(e,t){defined(this._geometries)&&this._geometries.applyDebugSettings(e,t)},Geometry3DTileContent.prototype.applyStyle=function(e){createFeatures$3(this),defined(this._geometries)&&this._geometries.applyStyle(e,this._features)},Geometry3DTileContent.prototype.update=function(e,t){var i;defined(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),defined(this._batchTable)&&this._geometries._ready&&this._batchTable.update(e,t),defined(this._contentReadyPromise)||((i=this)._contentReadyPromise=this._geometries.readyPromise.then(function(){i._readyPromise.resolve(i)}))},Geometry3DTileContent.prototype.isDestroyed=function(){return!1},Geometry3DTileContent.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)},Object.defineProperties(ModelInstance.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return Matrix4.clone(this._modelMatrix)},set:function(e){Matrix4.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}});var LoadState={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};function ModelInstanceCollection(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this._instancingSupported=!1,this._dynamic=defaultValue(e.dynamic,!1),this._allowPicking=defaultValue(e.allowPicking,!0),this._ready=!1,this._readyPromise=when.defer(),this._state=LoadState.NEEDS_LOAD,this._dirty=!1,this._cull=defaultValue(e.cull,!0),this._opaquePass=defaultValue(e.opaquePass,Pass$1.OPAQUE),this._instances=createInstances(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._renderStates=void 0,this._disableCullingRenderStates=void 0,this._boundingSphere=createBoundingSphere(this),this._center=Cartesian3.clone(this._boundingSphere.center),this._rtcTransform=new Matrix4,this._rtcModelView=new Matrix4,this._mode=void 0,this.modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this._modelMatrix=Matrix4.clone(this.modelMatrix),this._url=Resource.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=Resource.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=defaultValue(e.debugWireframe,!1),this._debugWireframe=!1,this._imageBasedLightingFactor=new Cartesian2(1,1),Cartesian2.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this.lightColor=e.lightColor,this.luminanceAtZenith=e.luminanceAtZenith,this.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this.specularEnvironmentMaps=e.specularEnvironmentMaps,this.backFaceCulling=defaultValue(e.backFaceCulling,!0),this._backFaceCulling=this.backFaceCulling}function createInstances(e,t){for(var i=(t=defaultValue(t,[])).length,r=new Array(i),n=0;n<i;++n){var a=t[n],o=a.modelMatrix,a=defaultValue(a.batchId,n);r[n]=new ModelInstance(e,o,a)}return r}function createBoundingSphere(e){for(var t=e.length,i=new Array(t),r=0;r<t;++r)i[r]=Matrix4.getTranslation(e._instances[r]._modelMatrix,new Cartesian3);return BoundingSphere.fromPoints(i)}Object.defineProperties(ModelInstanceCollection.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){Cartesian2.clone(e,this._imageBasedLightingFactor)}}});var scratchCartesian$7=new Cartesian3,scratchMatrix$3=new Matrix4;function getCheckUniformSemanticFunction(i,r,n,a){return function(e,t){e=e.semantic;if(defined(e)&&-1<i.indexOf(e)){if(!(-1<r.indexOf(e)))throw new RuntimeError('Shader program cannot be optimized for instancing. Uniform "'+t+'" in program "'+n+'" uses unsupported semantic "'+e+'"');a[t]=e}}}function getInstancedUniforms(e,t){if(defined(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];var i={};e._instancedUniformsByProgram=i;var r,n,a,o=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],s=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],l=e._model._sourceTechniques;for(r in l)l.hasOwnProperty(r)&&(defined(i[a=(n=l[r]).program])||(i[a]=a={},ForEach.techniqueUniform(n,getCheckUniformSemanticFunction(o,s,t,a))));return i[t]}function getVertexShaderCallback(h){return function(e,t){var i,r,n,a=getInstancedUniforms(h,t),o=defined(h._batchTable),s=ShaderSource.replaceMain(e,"czm_instancing_main"),l="",c="";for(i in a)a.hasOwnProperty(i)&&("MODELVIEW"===(n=a[i])||"CESIUM_RTC_MODELVIEW"===n?r="czm_instanced_modelView":"MODELVIEWPROJECTION"===n?(r="czm_instanced_modelViewProjection",l+="mat4 czm_instanced_modelViewProjection;\n",c+="czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView;\n"):"MODELVIEWINVERSETRANSPOSE"===n&&(r="czm_instanced_modelViewInverseTranspose",l+="mat3 czm_instanced_modelViewInverseTranspose;\n",c+="czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView);\n"),n=new RegExp("uniform.*"+i+".*"),s=s.replace(n,""),n=new RegExp(i+"\\b","g"),s=s.replace(n,r));var u,d,e=o?(u="attribute float a_batchId;\n",d=""):(u="",d="attribute vec4 pickColor;\nvarying vec4 v_pickColor;\n"," v_pickColor = pickColor;\n"),e="uniform mat4 czm_instanced_modifiedModelView;\nuniform mat4 czm_instanced_nodeTransform;\n"+l+"mat4 czm_instanced_modelView;\nattribute vec4 czm_modelMatrixRow0;\nattribute vec4 czm_modelMatrixRow1;\nattribute vec4 czm_modelMatrixRow2;\n"+u+d+s+"void main()\n{\n mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0);\n czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform;\n"+c+" czm_instancing_main();\n"+e+"}\n";return o&&(o=h._model.gltf,t=ModelUtility.getDiffuseAttributeOrUniform(o,t),e=h._batchTable.getVertexShaderCallback(!0,"a_batchId",t)(e)),e}}function getFragmentShaderCallback(n){return function(e,t){var i,r=n._batchTable;return e=defined(r)?(i=n._model.gltf,t=ModelUtility.getDiffuseAttributeOrUniform(i,t),r.getFragmentShaderCallback(!0,t,!1)(e)):"varying vec4 v_pickColor;\n"+e}}function createModifiedModelView(e,t){return function(){return Matrix4.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function createNodeTransformFunction(e){return function(){return e.computedMatrix}}function getUniformMapCallback(a,o){return function(e,t,i){(e=clone$1(e)).czm_instanced_modifiedModelView=createModifiedModelView(a,o),e.czm_instanced_nodeTransform=createNodeTransformFunction(i);var r,n=getInstancedUniforms(a,t);for(r in n)n.hasOwnProperty(r)&&delete e[r];return e=defined(a._batchTable)?a._batchTable.getUniformMapCallback()(e):e}}function getVertexShaderNonInstancedCallback(r){return function(e,t){var i;return defined(r._batchTable)&&(i=r._model.gltf,t=ModelUtility.getDiffuseAttributeOrUniform(i,t),e="uniform float a_batchId\n;"+(e=r._batchTable.getVertexShaderCallback(!0,"a_batchId",t)(e))),e}}function getFragmentShaderNonInstancedCallback(n){return function(e,t){var i,r=n._batchTable;return e=defined(r)?(i=n._model.gltf,t=ModelUtility.getDiffuseAttributeOrUniform(i,t),r.getFragmentShaderCallback(!0,t,!1)(e)):"uniform vec4 czm_pickColor;\n"+e}}function getUniformMapNonInstancedCallback(t){return function(e){return e=defined(t._batchTable)?t._batchTable.getUniformMapCallback()(e):e}}function getVertexBufferTypedArray(e){var t=e._instances,i=e.length,r=e._center,n=e._vertexBufferTypedArray;defined(n)||(n=new Float32Array(12*i)),e._dynamic&&(e._vertexBufferTypedArray=n);for(var a=0;a<i;++a){var o=t[a]._modelMatrix,s=Matrix4.clone(o,scratchMatrix$3);s[12]-=r.x,s[13]-=r.y,s[14]-=r.z;o=12*a;n[0+o]=s[0],n[1+o]=s[4],n[2+o]=s[8],n[3+o]=s[12],n[4+o]=s[1],n[5+o]=s[5],n[6+o]=s[9],n[7+o]=s[13],n[8+o]=s[2],n[9+o]=s[6],n[10+o]=s[10],n[11+o]=s[14]}return n}function createVertexBuffer(e,t){var i=e._instances,r=e.length,n=e._dynamic,a=defined(e._batchTable);if(a){for(var o=new Uint16Array(r),s=0;s<r;++s)o[s]=i[s]._instanceId;e._batchIdBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:o,usage:BufferUsage$1.STATIC_DRAW})}if(!a){var l=new Uint8Array(4*r);for(s=0;s<r;++s){var c=e._pickIds[s].color,u=4*s;l[u]=Color.floatToByte(c.red),l[1+u]=Color.floatToByte(c.green),l[2+u]=Color.floatToByte(c.blue),l[3+u]=Color.floatToByte(c.alpha)}e._pickIdBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:l,usage:BufferUsage$1.STATIC_DRAW})}a=getVertexBufferTypedArray(e);e._vertexBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:a,usage:n?BufferUsage$1.STREAM_DRAW:BufferUsage$1.STATIC_DRAW})}function updateVertexBuffer(e){var t=getVertexBufferTypedArray(e);e._vertexBuffer.copyFromArrayView(t)}function createPickIds(e,t){for(var i=e._instances,r=i.length,n=new Array(r),a=0;a<r;++a)n[a]=t.createPickId(i[a]);return n}function createModel$1(e,t){var i=e._instancingSupported,r=defined(e._batchTable),n=e._allowPicking,n={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:n,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLightingFactor:e.imageBasedLightingFactor,lightColor:e.lightColor,luminanceAtZenith:e.luminanceAtZenith,sphericalHarmonicCoefficients:e.sphericalHarmonicCoefficients,specularEnvironmentMaps:e.specularEnvironmentMaps};r||(e._pickIds=createPickIds(e,t)),i?(createVertexBuffer(e,t),i=ComponentDatatype$1.getSizeInBytes(ComponentDatatype$1.FLOAT),i={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:12*i,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:4*i,strideInBytes:12*i,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:8*i,strideInBytes:12*i,instanceDivisor:1}},r&&(i.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:ComponentDatatype$1.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),r||(i.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),n.precreatedAttributes=i,n.vertexShaderLoaded=getVertexShaderCallback(e),n.fragmentShaderLoaded=getFragmentShaderCallback(e),n.uniformMapLoaded=getUniformMapCallback(e,t),defined(e._url)&&(n.cacheKey=e._url.getUrlComponent()+"#instanced")):(n.vertexShaderLoaded=getVertexShaderNonInstancedCallback(e),n.fragmentShaderLoaded=getFragmentShaderNonInstancedCallback(e),n.uniformMapLoaded=getUniformMapNonInstancedCallback(e)),defined(e._url)?e._model=Model.fromGltf(n):e._model=new Model(n)}function updateWireframe(e,t){if(e._debugWireframe!==e.debugWireframe||t){e._debugWireframe=e.debugWireframe;for(var i=e.debugWireframe?PrimitiveType$1.LINES:PrimitiveType$1.TRIANGLES,r=e._drawCommands,n=r.length,a=0;a<n;++a)r[a].primitiveType=i}}function getDisableCullingRenderState(e){e=clone$1(e,!0);return e.cull.enabled=!1,RenderState.fromCache(e)}function updateBackFaceCulling(e,t){if(e._backFaceCulling!==e.backFaceCulling||t){e._backFaceCulling=e.backFaceCulling;var i,r=e._drawCommands,n=r.length;if(!defined(e._disableCullingRenderStates))for(e._disableCullingRenderStates=new Array(n),e._renderStates=new Array(n),i=0;i<n;++i){var a=r[i].renderState,o=getDisableCullingRenderState(a);e._disableCullingRenderStates[i]=o,e._renderStates[i]=a}for(i=0;i<n;++i)r[i].renderState=(e._backFaceCulling?e._renderStates:e._disableCullingRenderStates)[i]}}function updateShowBoundingVolume(e,t){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume||t){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var i=e._drawCommands,r=i.length,n=0;n<r;++n)i[n].debugShowBoundingVolume=e.debugShowBoundingVolume}}function createCommands$2(e,t){for(var i=t.length,r=e.length,n=e._boundingSphere,a=e._cull,o=0;o<i;++o){var s=DrawCommand.shallowClone(t[o]);s.instanceCount=r,s.boundingVolume=n,s.cull=a,defined(e._batchTable)?s.pickId=e._batchTable.getPickId():s.pickId="v_pickColor",e._drawCommands.push(s)}}function createBatchIdFunction(e){return function(){return e}}function createPickColorFunction(e){return function(){return e}}function createCommandsNonInstanced(e,t){for(var i=e._instances,r=t.length,n=e.length,a=defined(e._batchTable),o=e._cull,s=0;s<r;++s)for(var l=0;l<n;++l){var c,u=DrawCommand.shallowClone(t[s]);u.modelMatrix=new Matrix4,u.boundingVolume=new BoundingSphere,u.cull=o,u.uniformMap=clone$1(u.uniformMap),a?u.uniformMap.a_batchId=createBatchIdFunction(i[l]._instanceId):(c=e._pickIds[l],u.uniformMap.czm_pickColor=createPickColorFunction(c.color)),e._drawCommands.push(u)}}function updateCommandsNonInstanced(e){for(var t=e._modelCommands,i=t.length,r=e.length,n=e._rtcTransform,a=e._center,o=0;o<i;++o)for(var s=t[o],l=0;l<r;++l){var c=e._drawCommands[o*r+l];(u=Matrix4.clone(e._instances[l]._modelMatrix,scratchMatrix$3))[12]-=a.x,u[13]-=a.y,u[14]-=a.z;var u=Matrix4.multiply(n,u,scratchMatrix$3),d=s.modelMatrix,h=c.modelMatrix;Matrix4.multiply(u,d,h);h=s.boundingVolume,c=c.boundingVolume;BoundingSphere.transform(h,u,c)}}function getModelCommands(e){for(var t=e._nodeCommands,i=t.length,r=[],n=0;n<i;++n){var a=t[n];a.show&&r.push(a.command)}return r}function commandsDirty(e){for(var t=e._nodeCommands,i=t.length,r=!1,n=0;n<i;n++){var a=t[n];a.command.dirty&&(r=!(a.command.dirty=!1))}return r}function generateModelCommands(e,t){e._drawCommands=[];var i=getModelCommands(e._model);t?createCommands$2(e,i):(createCommandsNonInstanced(e,i),updateCommandsNonInstanced(e))}function updateShadows(e,t){if(e.shadows!==e._shadows||t){e._shadows=e.shadows;for(var i=ShadowMode$1.castShadows(e.shadows),r=ShadowMode$1.receiveShadows(e.shadows),n=e._drawCommands,a=n.length,o=0;o<a;++o){var s=n[o];s.castShadows=i,s.receiveShadows=r}}}function Instanced3DModel3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._modelInstanceCollection=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,initialize$3(this,r,n)}function getPickIdCallback(e){return function(){return e._batchTable.getPickId()}}ModelInstanceCollection.prototype.expandBoundingSphere=function(e){e=Matrix4.getTranslation(e,scratchCartesian$7);BoundingSphere.expand(this._boundingSphere,e,this._boundingSphere)},ModelInstanceCollection.prototype.update=function(e){if(e.mode!==SceneMode$1.MORPHING&&this.show&&0!==this.length){var t,i=e.context;this._state===LoadState.NEEDS_LOAD&&(this._state=LoadState.LOADING,this._instancingSupported=i.instancedArrays,createModel$1(this,i),(t=this)._model.readyPromise.otherwise(function(e){t._state=LoadState.FAILED,t._readyPromise.reject(e)}));var r=this._instancingSupported,n=this._model;if(n.imageBasedLightingFactor=this.imageBasedLightingFactor,n.lightColor=this.lightColor,n.luminanceAtZenith=this.luminanceAtZenith,n.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,n.specularEnvironmentMaps=this.specularEnvironmentMaps,n.update(e),n.ready&&this._state===LoadState.LOADING){this._state=LoadState.LOADED,this._ready=!0;var a=n.boundingSphere.radius+Cartesian3.magnitude(n.boundingSphere.center);return this._boundingSphere.radius+=a,this._modelCommands=getModelCommands(n),generateModelCommands(this,r),void this._readyPromise.resolve(this)}if(this._state===LoadState.LOADED){var o=e.mode!==this._mode,i=this.modelMatrix,a=!Matrix4.equals(this._modelMatrix,i);(o||a)&&(this._mode=e.mode,Matrix4.clone(i,this._modelMatrix),s=Matrix4.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform),this._mode!==SceneMode$1.SCENE3D&&(s=Transforms.basisTo2D(e.mapProjection,s,s)),Matrix4.getTranslation(s,this._boundingSphere.center)),r&&this._dirty&&(this._dynamic=!0,this._dirty=!1,updateVertexBuffer(this));var s=commandsDirty(n);s&&generateModelCommands(this,r),!r&&(n.dirty||this._dirty||o||a)&&updateCommandsNonInstanced(this),updateShadows(this,s),updateWireframe(this,s),updateBackFaceCulling(this,s),updateShowBoundingVolume(this,s);s=e.passes;if(s.render||s.pick)for(var l=e.commandList,c=this._drawCommands,u=c.length,d=0;d<u;++d)l.push(c[d])}}},ModelInstanceCollection.prototype.isDestroyed=function(){return!1},ModelInstanceCollection.prototype.destroy=function(){this._model=this._model&&this._model.destroy();var e=this._pickIds;if(defined(e))for(var t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)},Instanced3DModel3DTileContent._deprecationWarning=deprecationWarning,Object.defineProperties(Instanced3DModel3DTileContent.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){var e=this._modelInstanceCollection._model;return defined(e)?e.trianglesLength:0}},geometryByteLength:{get:function(){var e=this._modelInstanceCollection._model;return defined(e)?e.geometryByteLength:0}},texturesByteLength:{get:function(){var e=this._modelInstanceCollection._model;return defined(e)?e.texturesByteLength:0}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._modelInstanceCollection.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var sizeOfUint32$2=Uint32Array.BYTES_PER_ELEMENT,propertyScratch1=new Array(4),propertyScratch2=new Array(4);function initialize$3(e,t,i){var r=defaultValue(i,0);i=r;var n=new Uint8Array(t),a=new DataView(t),o=a.getUint32(i+=sizeOfUint32$2,!0);if(1!==o)throw new RuntimeError("Only Instanced 3D Model version 1 is supported. Version "+o+" is not.");var s=a.getUint32(i+=sizeOfUint32$2,!0),l=a.getUint32(i+=sizeOfUint32$2,!0);if(0===l)throw new RuntimeError("featureTableJsonByteLength is zero, the feature table must be defined.");var c=a.getUint32(i+=sizeOfUint32$2,!0),u=a.getUint32(i+=sizeOfUint32$2,!0),d=a.getUint32(i+=sizeOfUint32$2,!0),o=a.getUint32(i+=sizeOfUint32$2,!0);if(1!==o&&0!==o)throw new RuntimeError("Only glTF format 0 (uri) or 1 (embedded) are supported. Format "+o+" is not.");a=getJsonFromTypedArray(n,i+=sizeOfUint32$2,l);i+=l;l=new Uint8Array(t,i,c);i+=c;var h,p,m=new Cesium3DTileFeatureTable(a,l),f=m.getGlobalProperty("INSTANCES_LENGTH");if(!defined(m.featuresLength=f))throw new RuntimeError("Feature table global property: INSTANCES_LENGTH must be defined");0<u&&(h=getJsonFromTypedArray(n,i,u),i+=u,0<d&&(p=new Uint8Array(t,i,d),p=new Uint8Array(p),i+=d)),e._batchTable=new Cesium3DTileBatchTable(e,f,h,p);s=r+s-i;if(0==s)throw new RuntimeError("glTF byte length is zero, i3dm must have a glTF to instance.");i=i%4==0?new Uint8Array(t,i,s):(Instanced3DModel3DTileContent._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),new Uint8Array(n.subarray(i,i+s))),s=e._tileset,s={instances:new Array(f),batchTable:e._batchTable,cull:!1,url:void 0,requestType:RequestType$1.TILES3D,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,upAxis:s._gltfUpAxis,forwardAxis:Axis$1.X,opaquePass:Pass$1.CESIUM_3D_TILE,pickIdLoaded:getPickIdCallback(e),imageBasedLightingFactor:s.imageBasedLightingFactor,lightColor:s.lightColor,luminanceAtZenith:s.luminanceAtZenith,sphericalHarmonicCoefficients:s.sphericalHarmonicCoefficients,specularEnvironmentMaps:s.specularEnvironmentMaps,backFaceCulling:s.backFaceCulling};0===o?(o=(o=getStringFromTypedArray(i)).replace(/[\s\0]+$/,""),s.url=e._resource.getDerivedResource({url:o})):(s.gltf=i,s.basePath=e._resource.clone());var g,_=m.getGlobalProperty("EAST_NORTH_UP"),i=m.getGlobalProperty("RTC_CENTER",ComponentDatatype$1.FLOAT,3);defined(i)&&(g=Cartesian3.unpack(i));for(var y=s.instances,C=new Cartesian3,v=new Array(3),S=new Cartesian3,T=new Cartesian3,x=new Cartesian3,b=new Matrix3,E=new Quaternion,P=new Cartesian3,A=new TranslationRotationScale,w=new Matrix4,D=0;D<f;D++){if(!defined(M=m.getProperty("POSITION",ComponentDatatype$1.FLOAT,3,D,propertyScratch1))){var M=v,I=m.getProperty("POSITION_QUANTIZED",ComponentDatatype$1.UNSIGNED_SHORT,3,D,propertyScratch1);if(!defined(I))throw new RuntimeError("Either POSITION or POSITION_QUANTIZED must be defined for each instance.");var R=m.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ComponentDatatype$1.FLOAT,3);if(!defined(R))throw new RuntimeError("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var O=m.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ComponentDatatype$1.FLOAT,3);if(!defined(O))throw new RuntimeError("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var L=0;L<3;L++)M[L]=I[L]/65535*O[L]+R[L]}Cartesian3.unpack(M,0,C),defined(g)&&Cartesian3.add(C,g,C),A.translation=C;var F=m.getProperty("NORMAL_UP",ComponentDatatype$1.FLOAT,3,D,propertyScratch1),N=m.getProperty("NORMAL_RIGHT",ComponentDatatype$1.FLOAT,3,D,propertyScratch2),B=!1;if(defined(F)){if(!defined(N))throw new RuntimeError("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");Cartesian3.unpack(F,0,T),Cartesian3.unpack(N,0,S),B=!0}else{var N=m.getProperty("NORMAL_UP_OCT32P",ComponentDatatype$1.UNSIGNED_SHORT,2,D,propertyScratch1),V=m.getProperty("NORMAL_RIGHT_OCT32P",ComponentDatatype$1.UNSIGNED_SHORT,2,D,propertyScratch2);if(defined(N)){if(!defined(V))throw new RuntimeError("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");AttributeCompression.octDecodeInRange(N[0],N[1],65535,T),AttributeCompression.octDecodeInRange(V[0],V[1],65535,S),B=!0}else _?(Transforms.eastNorthUpToFixedFrame(C,Ellipsoid.WGS84,w),Matrix4.getMatrix3(w,b)):Matrix3.clone(Matrix3.IDENTITY,b)}B&&(Cartesian3.cross(S,T,x),Cartesian3.normalize(x,x),Matrix3.setColumn(b,0,S,b),Matrix3.setColumn(b,1,T,b),Matrix3.setColumn(b,2,x,b)),Quaternion.fromRotationMatrix(b,E),A.rotation=E;P=Cartesian3.fromElements(1,1,1,P),V=m.getProperty("SCALE",ComponentDatatype$1.FLOAT,1,D);defined(V)&&Cartesian3.multiplyByScalar(P,V,P);B=m.getProperty("SCALE_NON_UNIFORM",ComponentDatatype$1.FLOAT,3,D,propertyScratch1);defined(B)&&(P.x*=B[0],P.y*=B[1],P.z*=B[2]),A.scale=P;V=m.getProperty("BATCH_ID",ComponentDatatype$1.UNSIGNED_SHORT,1,D);defined(V)||(V=D),Matrix4.fromTranslationRotationScale(A,w);B=w.clone();y[D]={modelMatrix:B,batchId:V}}e._modelInstanceCollection=new ModelInstanceCollection(s),e._modelInstanceCollection.readyPromise.then(function(e){e.activeAnimations.addAll({loop:ModelAnimationLoop$1.REPEAT})})}function createFeatures$2(e){var t=e.featuresLength;if(!defined(e._features)&&0<t){for(var i=new Array(t),r=0;r<t;++r)i[r]=new Cesium3DTileFeature(e,r);e._features=i}}Instanced3DModel3DTileContent.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Instanced3DModel3DTileContent.prototype.getFeature=function(e){return this.featuresLength,createFeatures$2(this),this._features[e]},Instanced3DModel3DTileContent.prototype.applyDebugSettings=function(e,t){t=e?t:Color.WHITE,this._batchTable.setAllColor(t)},Instanced3DModel3DTileContent.prototype.applyStyle=function(e){this._batchTable.applyStyle(e)},Instanced3DModel3DTileContent.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._modelInstanceCollection.modelMatrix=this._tile.computedTransform,this._modelInstanceCollection.shadows=this._tileset.shadows,this._modelInstanceCollection.lightColor=this._tileset.lightColor,this._modelInstanceCollection.luminanceAtZenith=this._tileset.luminanceAtZenith,this._modelInstanceCollection.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._modelInstanceCollection.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._modelInstanceCollection.backFaceCulling=this._tileset.backFaceCulling,this._modelInstanceCollection.debugWireframe=this._tileset.debugWireframe;var r=this._modelInstanceCollection._model;defined(r)&&(e=this._tileset.clippingPlanes,r.referenceMatrix=this._tileset.clippingPlanesOriginMatrix,defined(e)&&this._tile.clippingPlanesDirty&&(r._clippingPlanes=e.enabled&&this._tile._isClipped?e:void 0),defined(e)&&defined(r._clippingPlanes)&&r._clippingPlanes!==e&&(r._clippingPlanes=e)),this._modelInstanceCollection.update(t),i<t.commandList.length&&(t.passes.render||t.passes.pick)&&this._batchTable.addDerivedCommands(t,i,!1)},Instanced3DModel3DTileContent.prototype.isDestroyed=function(){return!1},Instanced3DModel3DTileContent.prototype.destroy=function(){return this._modelInstanceCollection=this._modelInstanceCollection&&this._modelInstanceCollection.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)};var Cesium3DTileRefine={ADD:0,REPLACE:1},Cesium3DTileRefine$1=Object.freeze(Cesium3DTileRefine),DecodingState={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function PointCloud(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=Color.clone(Color.DARKGRAY),this._highlightColor=Color.clone(Color.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=DecodingState.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._readyPromise=when.defer(),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=defaultValue(e.opaquePass,Pass$1.OPAQUE),this._cull=defaultValue(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this._modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this.time=0,this.shadows=ShadowMode$1.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,initialize$2(this,e)}Object.defineProperties(PointCloud.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},color:{get:function(){return Color.clone(this._highlightColor)},set:function(e){this._highlightColor=Color.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(defined(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=BoundingSphere.clone(e,this._boundingSphere)}}});var sizeOfUint32$1=Uint32Array.BYTES_PER_ELEMENT;function initialize$2(e,t){var i=t.arrayBuffer,r=defaultValue(t.byteOffset,0),n=new Uint8Array(i),a=new DataView(i),o=a.getUint32(r+=sizeOfUint32$1,!0);if(1!==o)throw new RuntimeError("Only Point Cloud tile version 1 is supported. Version "+o+" is not.");r+=sizeOfUint32$1;var s=a.getUint32(r+=sizeOfUint32$1,!0);if(0===s)throw new RuntimeError("Feature table must have a byte length greater than zero");var l=a.getUint32(r+=sizeOfUint32$1,!0),c=a.getUint32(r+=sizeOfUint32$1,!0),u=a.getUint32(r+=sizeOfUint32$1,!0),d=getJsonFromTypedArray(n,r+=sizeOfUint32$1,s);r+=s;var h,p,m=new Uint8Array(i,r,l);r+=l,0<c&&(h=getJsonFromTypedArray(n,r,c),r+=c,0<u&&(p=new Uint8Array(i,r,u)));var f=new Cesium3DTileFeatureTable(d,m),g=f.getGlobalProperty("POINTS_LENGTH");if(!defined(f.featuresLength=g))throw new RuntimeError("Feature table global property: POINTS_LENGTH must be defined");var _,y,C,t=f.getGlobalProperty("RTC_CENTER",ComponentDatatype$1.FLOAT,3);defined(t)&&(e._rtcCenter=Cartesian3.unpack(t));var v,S,o=!1,a=!1,s=!1,l=!1,n=!1,c=!1,i=!1,u=!1,r=defined(d.extensions)?d.extensions["3DTILES_draco_point_compression"]:void 0,t=defined(h)&&defined(h.extensions)?h.extensions["3DTILES_draco_point_compression"]:void 0;if(defined(t)&&(E=t.properties),defined(r)){var T=r.properties,t=r.byteOffset,x=r.byteLength;if(!defined(T)||!defined(t)||!defined(x))throw new RuntimeError("Draco properties, byteOffset, and byteLength must be defined");x=arraySlice(m,t,t+x),o=defined(T.POSITION),a=defined(T.RGB)||defined(T.RGBA),s=defined(T.NORMAL),l=defined(T.BATCH_ID),c=defined(T.RGBA),e._decodingState=DecodingState.NEEDS_DECODE}if(defined(x)&&(v={buffer:x,featureTableProperties:T,batchTableProperties:E,properties:combine$2(T,E),dequantizeInShader:e._dequantizeInShader}),!o)if(defined(d.POSITION))b=f.getPropertyArray("POSITION",ComponentDatatype$1.FLOAT,3),o=!0;else if(defined(d.POSITION_QUANTIZED)){var b=f.getPropertyArray("POSITION_QUANTIZED",ComponentDatatype$1.UNSIGNED_SHORT,3),n=!0,o=!0,E=f.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ComponentDatatype$1.FLOAT,3);if(!defined(E))throw new RuntimeError("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");e._quantizedVolumeScale=Cartesian3.unpack(E),e._quantizedRange=65535;E=f.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ComponentDatatype$1.FLOAT,3);if(!defined(E))throw new RuntimeError("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e._quantizedVolumeOffset=Cartesian3.unpack(E)}if(a||(defined(d.RGBA)?(_=f.getPropertyArray("RGBA",ComponentDatatype$1.UNSIGNED_BYTE,4),a=c=!0):defined(d.RGB)?(_=f.getPropertyArray("RGB",ComponentDatatype$1.UNSIGNED_BYTE,3),a=!0):defined(d.RGB565)&&(_=f.getPropertyArray("RGB565",ComponentDatatype$1.UNSIGNED_SHORT,1),a=i=!0)),s||(defined(d.NORMAL)?(y=f.getPropertyArray("NORMAL",ComponentDatatype$1.FLOAT,3),s=!0):defined(d.NORMAL_OCT16P)&&(y=f.getPropertyArray("NORMAL_OCT16P",ComponentDatatype$1.UNSIGNED_BYTE,2),s=u=!0)),l||defined(d.BATCH_ID)&&(C=f.getPropertyArray("BATCH_ID",ComponentDatatype$1.UNSIGNED_SHORT,1),l=!0),!o)throw new RuntimeError("Either POSITION or POSITION_QUANTIZED must be defined.");if(defined(d.CONSTANT_RGBA)&&(d=f.getGlobalProperty("CONSTANT_RGBA",ComponentDatatype$1.UNSIGNED_BYTE,4),e._constantColor=Color.fromBytes(d[0],d[1],d[2],d[3],e._constantColor)),l){f=f.getGlobalProperty("BATCH_LENGTH");if(!defined(f))throw new RuntimeError("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");defined(p)&&(p=new Uint8Array(p)),defined(e._batchTableLoaded)&&e._batchTableLoaded(f,h,p)}!l&&defined(p)&&(S=Cesium3DTileBatchTable.getBinaryProperties(g,h,p)),e._parsedContent={positions:b,colors:_,normals:y,batchIds:C,styleableProperties:S,draco:v},e._pointsLength=g,e._isQuantized=n,e._isOctEncoded16P=u,e._isRGB565=i,e._isTranslucent=c,e._hasColors=a,e._hasNormals=s,e._hasBatchIds=l}var scratchMin$1=new Cartesian3,scratchMax$1=new Cartesian3,scratchPosition$5=new Cartesian3,randomValues;function getRandomValues(e){if(!defined(randomValues)){CesiumMath.setRandomNumberSeed(0),randomValues=new Array(e);for(var t=0;t<e;++t)randomValues[t]=CesiumMath.nextRandomNumber()}return randomValues}function computeApproximateBoundingSphereFromPositions(e){for(var t=e.length/3,i=Math.min(t,20),r=getRandomValues(20),n=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Cartesian3.fromElements(n,n,n,scratchMin$1),s=Cartesian3.fromElements(a,a,a,scratchMax$1),l=0;l<i;++l){var c=Math.floor(r[l]*t),c=Cartesian3.unpack(e,3*c,scratchPosition$5);Cartesian3.minimumByComponent(o,c,o),Cartesian3.maximumByComponent(s,c,s)}a=BoundingSphere.fromCornerPoints(o,s);return a.radius+=CesiumMath.EPSILON2,a}function prepareVertexAttribute(e,t){var i=ComponentDatatype$1.fromTypedArray(e);return i===ComponentDatatype$1.INT||i===ComponentDatatype$1.UNSIGNED_INT||i===ComponentDatatype$1.DOUBLE?(oneTimeWarning("Cast pnts property to floats",'Point cloud property "'+t+'" will be casted 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 scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier=new Cartesian4,scratchQuantizedVolumeScaleAndOctEncodedRange=new Cartesian4,scratchColor$i=new Color,positionLocation=0,colorLocation=1,normalLocation=2,batchIdLocation=3,numberOfAttributes=4,scratchClippingPlanesMatrix$1=new Matrix4,scratchInverseTransposeClippingPlanesMatrix$1=new Matrix4;function createResources$4(e,t){var i=t.context,r=e._parsedContent,n=e._pointsLength,a=r.positions,o=r.colors,s=r.normals,l=r.batchIds,c=r.styleableProperties,u=defined(c),d=e._isQuantized,h=e._isQuantizedDraco,p=e._isOctEncoded16P,m=e._isOctEncodedDraco,f=e._quantizedRange,g=e._octEncodedRange,_=e._isRGB565,y=e._isTranslucent,C=e._hasColors,v=e._hasNormals,t=e._hasBatchIds,S=[],T={};if(e._styleableShaderAttributes=T,u){var x,b,E,P,A,w=numberOfAttributes;for(x in c)c.hasOwnProperty(x)&&(A=prepareVertexAttribute((b=c[x]).typedArray,x),E=b.componentCount,P=ComponentDatatype$1.fromTypedArray(A),A=Buffer$1.createVertexBuffer({context:i,typedArray:A,usage:BufferUsage$1.STATIC_DRAW}),e._geometryByteLength+=A.sizeInBytes,S.push({index:w,vertexBuffer:A,componentsPerAttribute:E,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0}),T[x]={location:w,componentCount:E},++w)}var D,M,I,r=Buffer$1.createVertexBuffer({context:i,typedArray:a,usage:BufferUsage$1.STATIC_DRAW});e._geometryByteLength+=r.sizeInBytes,C&&(D=Buffer$1.createVertexBuffer({context:i,typedArray:o,usage:BufferUsage$1.STATIC_DRAW}),e._geometryByteLength+=D.sizeInBytes),v&&(M=Buffer$1.createVertexBuffer({context:i,typedArray:s,usage:BufferUsage$1.STATIC_DRAW}),e._geometryByteLength+=M.sizeInBytes),t&&(l=prepareVertexAttribute(l,"batchIds"),I=Buffer$1.createVertexBuffer({context:i,typedArray:l,usage:BufferUsage$1.STATIC_DRAW}),e._geometryByteLength+=I.sizeInBytes);s=[];P=d?ComponentDatatype$1.UNSIGNED_SHORT:h?f<=255?ComponentDatatype$1.UNSIGNED_BYTE:ComponentDatatype$1.UNSIGNED_SHORT:ComponentDatatype$1.FLOAT,s.push({index:positionLocation,vertexBuffer:r,componentsPerAttribute:3,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(e._boundingSphere=d||h?BoundingSphere.fromCornerPoints(Cartesian3.ZERO,e._quantizedVolumeScale):computeApproximateBoundingSphereFromPositions(a)),C&&(_?s.push({index:colorLocation,vertexBuffer:D,componentsPerAttribute:1,componentDatatype:ComponentDatatype$1.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0}):s.push({index:colorLocation,vertexBuffer:D,componentsPerAttribute:y?4:3,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})),v&&(P=p?(E=2,ComponentDatatype$1.UNSIGNED_BYTE):m?(E=2,g<=255?ComponentDatatype$1.UNSIGNED_BYTE:ComponentDatatype$1.UNSIGNED_SHORT):(E=3,ComponentDatatype$1.FLOAT),s.push({index:normalLocation,vertexBuffer:M,componentsPerAttribute:E,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0})),t&&s.push({index:batchIdLocation,vertexBuffer:I,componentsPerAttribute:1,componentDatatype:ComponentDatatype$1.fromTypedArray(l),normalize:!1,offsetInBytes:0,strideInBytes:0});l=new VertexArray({context:i,attributes:s=u?s.concat(S):s}),u={depthTest:{enabled:!0}},s={depthTest:{enabled:!0},depthMask:!1,blending:BlendingState$1.ALPHA_BLEND};e._opaquePass===Pass$1.CESIUM_3D_TILE&&(u.stencilTest=StencilConstants$1.setCesium3DTileBit(),u.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK,s.stencilTest=StencilConstants$1.setCesium3DTileBit(),s.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK),e._opaqueRenderState=RenderState.fromCache(u),e._translucentRenderState=RenderState.fromCache(s),e._drawCommand=new DrawCommand({boundingVolume:new BoundingSphere,cull:e._cull,modelMatrix:new Matrix4,primitiveType:PrimitiveType$1.POINTS,vertexArray:l,count:n,shaderProgram:void 0,uniformMap:void 0,renderState:y?e._translucentRenderState:e._opaqueRenderState,pass:y?Pass$1.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function createUniformMap$4(i,r){var n=r.context,e=i._isQuantized,t=i._isQuantizedDraco,a=i._isOctEncodedDraco,o={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){var e,t=scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier;return t.x=i._attenuation?i.maximumAttenuation:i._pointSize,t.x*=r.pixelRatio,t.y=i.time,i._attenuation&&(e=r.camera.frustum,e=r.mode===SceneMode$1.SCENE2D||e instanceof OrthographicFrustum?Number.POSITIVE_INFINITY:n.drawingBufferHeight/r.camera.frustum.sseDenominator,t.z=i.geometricError*i.geometricErrorScale,t.w=e),t},u_highlightColor:function(){return i._highlightColor},u_constantColor:function(){return i._constantColor},u_clippingPlanes:function(){var e=i.clippingPlanes;return i.isClipped?e.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){var e=i.clippingPlanes;if(!defined(e))return Color.TRANSPARENT;var t=Color.clone(e.edgeColor,scratchColor$i);return t.alpha=e.edgeWidth,t},u_clippingPlanesMatrix:function(){var e=i.clippingPlanes;if(!defined(e))return Matrix4.IDENTITY;var t=defaultValue(i.clippingPlanesOriginMatrix,i._modelMatrix);Matrix4.multiply(n.uniformState.view3D,t,scratchClippingPlanesMatrix$1);e=Matrix4.multiply(scratchClippingPlanesMatrix$1,e.modelMatrix,scratchClippingPlanesMatrix$1);return Matrix4.inverseTranspose(e,scratchInverseTransposeClippingPlanesMatrix$1)}};(e||t||a)&&(o=combine$2(o,{u_quantizedVolumeScaleAndOctEncodedRange:function(){var e,t=scratchQuantizedVolumeScaleAndOctEncodedRange;return defined(i._quantizedVolumeScale)&&(e=Cartesian3.clone(i._quantizedVolumeScale,t),Cartesian3.divideByScalar(e,i._quantizedRange,t)),t.w=i._octEncodedRange,t}})),defined(i._uniformMapLoaded)&&(o=i._uniformMapLoaded(o)),i._drawCommand.uniformMap=o}function getStyleablePropertyIds(e,t){for(var i=/czm_3dtiles_property_(\d+)/g,r=i.exec(e);null!==r;){var n=parseInt(r[1]);-1===t.indexOf(n)&&t.push(n),r=i.exec(e)}}function getBuiltinPropertyNames(e,t){for(var i=/czm_3dtiles_builtin_property_(\w+)/g,r=i.exec(e);null!==r;){var n=r[1];-1===t.indexOf(n)&&t.push(n),r=i.exec(e)}}function getVertexAttribute(e,t){for(var i=e.numberOfAttributes,r=0;r<i;++r){var n=e.getAttribute(r);if(n.index===t)return n}}var builtinPropertyNameMap={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 modifyStyleFunction(e){return e.replace("()","(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)")}function createShaders$2(e,t,i){var r,n,a,o,s=t.context,l=defined(i),c=e._isQuantized,u=e._isQuantizedDraco,d=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,m=e._isTranslucent,f=e._hasColors,g=e._hasNormals,_=e._hasBatchIds,y=e._backFaceCulling,C=e._normalShading,v=e._drawCommand.vertexArray,S=e.clippingPlanes,T=e._attenuation,x=m,b=clone$1(builtinPropertyNameMap),E={},P=e._styleableShaderAttributes;for(r in P)P.hasOwnProperty(r)&&(I=P[r],b[r]="czm_3dtiles_property_"+I.location,E[I.location]=I);l&&(n=i.getColorShaderFunction("getColorFromStyle",b,M={translucent:!1}),a=i.getShowShaderFunction("getShowFromStyle",b,M),o=i.getPointSizeShaderFunction("getPointSizeFromStyle",b,M),defined(n)&&M.translucent&&(x=!0)),e._styleTranslucent=x;var A=defined(n),w=defined(a),l=defined(o),i=e.isClipped,D=[],M=[];A&&(getStyleablePropertyIds(n,D),getBuiltinPropertyNames(n,M),n=modifyStyleFunction(n)),w&&(getStyleablePropertyIds(a,D),getBuiltinPropertyNames(a,M),a=modifyStyleFunction(a)),l&&(getStyleablePropertyIds(o,D),getBuiltinPropertyNames(o,M),o=modifyStyleFunction(o));var I,R,x=0<=M.indexOf("COLOR"),M=0<=M.indexOf("NORMAL");if(M&&!g)throw new RuntimeError("Style references the NORMAL semantic but the point cloud does not have normals");for(r in P)P.hasOwnProperty(r)&&(I=P[r],R=0<=D.indexOf(I.location),getVertexAttribute(v,I.location).enabled=R);x=f&&(!A||x);f&&(getVertexAttribute(v,colorLocation).enabled=x);M=g&&(C||y||M);g&&(getVertexAttribute(v,normalLocation).enabled=M);var O={a_position:positionLocation};x&&(O.a_color=colorLocation),M&&(O.a_normal=normalLocation),_&&(O.a_batchId=batchIdLocation);for(var L="",F=D.length,N=0;N<F;++N){var B=D[N],V=(I=E[B]).componentCount,B="czm_3dtiles_property_"+B,V=1===V?"float":"vec"+V;L+="attribute "+V+" "+B+"; \n",O[B]=I.location}createUniformMap$4(e,t);t="attribute vec3 a_position; \nvarying vec4 v_color; \nuniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \nuniform vec4 u_constantColor; \nuniform vec4 u_highlightColor; \n";t+="float u_pointSize; \nfloat u_time; \n",T&&(t+="float u_geometricError; \nfloat u_depthMultiplier; \n"),t+=L,x&&(t+=m?"attribute vec4 a_color; \n":p?"attribute float a_color; \nconst float SHIFT_RIGHT_11 = 1.0 / 2048.0; \nconst float SHIFT_RIGHT_5 = 1.0 / 32.0; \nconst float SHIFT_LEFT_11 = 2048.0; \nconst float SHIFT_LEFT_5 = 32.0; \nconst float NORMALIZE_6 = 1.0 / 64.0; \nconst float NORMALIZE_5 = 1.0 / 32.0; \n":"attribute vec3 a_color; \n"),M&&(t+=d||h?"attribute vec2 a_normal; \n":"attribute vec3 a_normal; \n"),_&&(t+="attribute float a_batchId; \n"),(c||u||h)&&(t+="uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; \n"),A&&(t+=n),w&&(t+=a),l&&(t+=o),t+="void main() \n{ \n u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; \n u_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; \n",T&&(t+=" u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; \n u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; \n"),t+=x?m?" vec4 color = a_color; \n":p?" float compressed = a_color; \n float r = floor(compressed * SHIFT_RIGHT_11); \n compressed -= r * SHIFT_LEFT_11; \n float g = floor(compressed * SHIFT_RIGHT_5); \n compressed -= g * SHIFT_LEFT_5; \n float b = compressed; \n vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \n vec4 color = vec4(rgb, 1.0); \n":" vec4 color = vec4(a_color, 1.0); \n":" vec4 color = u_constantColor; \n",t+=c||u?" vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; \n":" vec3 position = a_position; \n",t+=" vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \n",M?(t+=d?" vec3 normal = czm_octDecode(a_normal); \n":h?" vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; \n":" vec3 normal = a_normal; \n",t+=" vec3 normalEC = czm_normal * normal; \n"):t+=" vec3 normal = vec3(1.0); \n",A&&(t+=" color = getColorFromStyle(position, position_absolute, color, normal); \n"),w&&(t+=" float show = float(getShowFromStyle(position, position_absolute, color, normal)); \n"),t+=l?" gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; \n":T?" vec4 positionEC = czm_modelView * vec4(position, 1.0); \n float depth = -positionEC.z; \n gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \n":" gl_PointSize = u_pointSize; \n",t+=" color = color * u_highlightColor; \n",M&&C&&(t+=" float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); \n diffuseStrength = max(diffuseStrength, 0.4); \n color.xyz *= diffuseStrength * czm_lightColor; \n"),t+=" v_color = color; \n gl_Position = czm_modelViewProjection * vec4(position, 1.0); \n",M&&y&&(t+=" float visible = step(-normalEC.z, 0.0); \n gl_Position *= visible; \n gl_PointSize *= visible; \n"),w&&(t+=" gl_Position.w *= float(show); \n gl_PointSize *= float(show); \n"),t+="} \n";w="varying vec4 v_color; \n";i&&(w+="uniform highp sampler2D u_clippingPlanes; \nuniform mat4 u_clippingPlanesMatrix; \nuniform vec4 u_clippingPlanesEdgeStyle; \n",w+="\n",w+=getClippingFunction(S,s),w+="\n"),w+="void main() \n{ \n gl_FragColor = czm_gammaCorrect(v_color); \n",i&&(w+=getClipAndStyleCode("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),w+="} \n",defined(e._vertexShaderLoaded)&&(t=e._vertexShaderLoaded(t)),defined(e._fragmentShaderLoaded)&&(w=e._fragmentShaderLoaded(w));e=e._drawCommand;defined(e.shaderProgram)&&e.shaderProgram.destroy(),e.shaderProgram=ShaderProgram.fromCache({context:s,vertexShaderSource:t,fragmentShaderSource:w,attributeLocations:O});try{e.shaderProgram._bind()}catch(e){throw new RuntimeError("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function decodeDraco(p,e){return p._decodingState!==DecodingState.READY&&(p._decodingState===DecodingState.NEEDS_DECODE&&(m=p._parsedContent,f=m.draco,defined(e=DracoLoader.decodePointCloud(f,e))&&(p._decodingState=DecodingState.DECODING,e.then(function(e){p._decodingState=DecodingState.READY;var t,i=defined(e.POSITION)?e.POSITION.array:void 0,r=defined(e.RGB)?e.RGB.array:void 0,n=defined(e.RGBA)?e.RGBA.array:void 0,a=defined(e.NORMAL)?e.NORMAL.array:void 0,o=defined(e.BATCH_ID)?e.BATCH_ID.array:void 0,s=defined(i)&&defined(e.POSITION.data.quantization),l=defined(a)&&defined(e.NORMAL.data.quantization);s&&(s=(t=e.POSITION.data.quantization).range,p._quantizedVolumeScale=Cartesian3.fromElements(s,s,s),p._quantizedVolumeOffset=Cartesian3.unpack(t.minValues),p._quantizedRange=(1<<t.quantizationBits)-1,p._isQuantizedDraco=!0),l&&(p._octEncodedRange=(1<<e.NORMAL.data.quantization.quantizationBits)-1,p._isOctEncodedDraco=!0);var c,u,d=m.styleableProperties,h=f.batchTableProperties;for(c in h)h.hasOwnProperty(c)&&(u=e[c],(d=!defined(d)?{}:d)[c]={typedArray:u.array,componentCount:u.data.componentsPerAttribute});m.positions=defaultValue(i,m.positions),m.colors=defaultValue(defaultValue(n,r),m.colors),m.normals=defaultValue(a,m.normals),m.batchIds=defaultValue(o,m.batchIds),m.styleableProperties=d}).otherwise(function(e){p._decodingState=DecodingState.FAILED,p._readyPromise.reject(e)}))),!0);var m,f}var scratchComputedTranslation=new Cartesian4,scratchScale$3=new Cartesian3;function attachTexture(e,t,i){e=e._gl;e.framebufferTexture2D(e.FRAMEBUFFER,t,i._target,i._texture,0)}function attachRenderbuffer(e,t,i){e=e._gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,i._getRenderbuffer())}function Framebuffer(e){var t,i,r,n=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context._gl;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=defaultValue(e.destroyAttachments,!0),defined(e.depthTexture)||defined(e.depthRenderbuffer),defined(e.depthStencilTexture)||defined(e.depthStencilRenderbuffer),this._bind(),defined(e.colorTextures))for(var a=e.colorTextures,o=this._colorTextures.length=this._activeColorAttachments.length=a.length,s=0;s<o;++s)t=a[s],attachTexture(this,r=this._gl.COLOR_ATTACHMENT0+s,t),this._activeColorAttachments[s]=r,this._colorTextures[s]=t;if(defined(e.colorRenderbuffers)){var l=e.colorRenderbuffers;for(o=this._colorRenderbuffers.length=this._activeColorAttachments.length=l.length,s=0;s<o;++s)i=l[s],attachRenderbuffer(this,r=this._gl.COLOR_ATTACHMENT0+s,i),this._activeColorAttachments[s]=r,this._colorRenderbuffers[s]=i}defined(e.depthTexture)&&(t=e.depthTexture,attachTexture(this,this._gl.DEPTH_ATTACHMENT,t),this._depthTexture=t),defined(e.depthRenderbuffer)&&(i=e.depthRenderbuffer,attachRenderbuffer(this,this._gl.DEPTH_ATTACHMENT,i),this._depthRenderbuffer=i),defined(e.stencilRenderbuffer)&&(i=e.stencilRenderbuffer,attachRenderbuffer(this,this._gl.STENCIL_ATTACHMENT,i),this._stencilRenderbuffer=i),defined(e.depthStencilTexture)&&(t=e.depthStencilTexture,attachTexture(this,this._gl.DEPTH_STENCIL_ATTACHMENT,t),this._depthStencilTexture=t),defined(e.depthStencilRenderbuffer)&&(i=e.depthStencilRenderbuffer,attachRenderbuffer(this,this._gl.DEPTH_STENCIL_ATTACHMENT,i),this._depthStencilRenderbuffer=i),this._unBind()}PointCloud.prototype.update=function(e){var t,i,r,n;decodeDraco(this,e.context)||(n=!1,r=!Matrix4.equals(this._modelMatrix,this.modelMatrix),this._mode!==e.mode&&(this._mode=e.mode,r=!0),defined(this._drawCommand)||(createResources$4(this,e),this._ready=n=r=!0,this._readyPromise.resolve(this),this._parsedContent=void 0),r&&(Matrix4.clone(this.modelMatrix,this._modelMatrix),r=this._drawCommand.modelMatrix,Matrix4.clone(this._modelMatrix,r),defined(this._rtcCenter)&&Matrix4.multiplyByTranslation(r,this._rtcCenter,r),defined(this._quantizedVolumeOffset)&&Matrix4.multiplyByTranslation(r,this._quantizedVolumeOffset,r),e.mode!==SceneMode$1.SCENE3D&&(i=e.mapProjection,t=Matrix4.getColumn(r,3,scratchComputedTranslation),Cartesian4.equals(t,Cartesian4.UNIT_W)||Transforms.basisTo2D(i,r,r)),t=this._drawCommand.boundingVolume,BoundingSphere.clone(this._boundingSphere,t),this._cull&&(i=t.center,Matrix4.multiplyByPoint(r,i,i),r=Matrix4.getScale(r,scratchScale$3),t.radius*=Cartesian3.maximumComponent(r))),this.clippingPlanesDirty&&(n=!(this.clippingPlanesDirty=!1)),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,n=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,n=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,n=!0),this._style===this.style&&!this.styleDirty||(this._style=this.style,n=!(this.styleDirty=!1)),n&&createShaders$2(this,e,this._style),this._drawCommand.castShadows=ShadowMode$1.castShadows(this.shadows),this._drawCommand.receiveShadows=ShadowMode$1.receiveShadows(this.shadows),n=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent,this._drawCommand.renderState=n?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=n?Pass$1.TRANSLUCENT:this._opaquePass,n=e.commandList,((e=e.passes).render||e.pick)&&n.push(this._drawCommand))},PointCloud.prototype.isDestroyed=function(){return!1},PointCloud.prototype.destroy=function(){var e=this._drawCommand;return defined(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),destroyObject(this)},Object.defineProperties(Framebuffer.prototype,{status:{get:function(){this._bind();var 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)}}}),Framebuffer.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},Framebuffer.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},Framebuffer.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},Framebuffer.prototype.getColorTexture=function(e){return this._colorTextures[e]},Framebuffer.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},Framebuffer.prototype.isDestroyed=function(){return!1},Framebuffer.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,t=this._colorTextures,i=t.length;e<i;++e){var r=t[e];defined(r)&&r.destroy()}for(var n=this._colorRenderbuffers,i=n.length,e=0;e<i;++e){var a=n[e];defined(a)&&a.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),destroyObject(this)};var PointCloudEyeDomeLightingShader="#extension GL_EXT_frag_depth : enable\nuniform sampler2D u_pointCloud_colorGBuffer;\nuniform sampler2D u_pointCloud_depthGBuffer;\nuniform vec2 u_distanceAndEdlStrength;\nvarying vec2 v_textureCoordinates;\nvec2 neighborContribution(float log2Depth, vec2 offset)\n{\nfloat dist = u_distanceAndEdlStrength.x;\nvec2 texCoordOrig = v_textureCoordinates + offset * dist;\nvec2 texCoord0 = v_textureCoordinates + offset * floor(dist);\nvec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);\nfloat depthOrLogDepth0 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord0));\nfloat depthOrLogDepth1 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord1));\nif (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {\nreturn vec2(0.0);\n}\nfloat depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);\nreturn vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\n}\nvoid main()\n{\nfloat depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat log2Depth = log2(-eyeCoordinate.z);\nif (depthOrLogDepth == 0.0)\n{\ndiscard;\n}\nvec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);\nvec2 texelSize = 1.0 / czm_viewport.zw;\nvec2 responseAndCount = vec2(0.0);\nresponseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));\nresponseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));\nresponseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));\nresponseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));\nfloat response = responseAndCount.x / responseAndCount.y;\nfloat strength = u_distanceAndEdlStrength.y;\nfloat shade = exp(-response * 300.0 * strength);\ncolor.rgb *= shade;\ngl_FragColor = vec4(color);\ngl_FragDepthEXT = depthOrLogDepth;\n}\n";function PointCloudEyeDomeLighting(){this._framebuffer=void 0,this._colorGBuffer=void 0,this._depthGBuffer=void 0,this._depthTexture=void 0,this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}function destroyFramebuffer$1(e){var t=e._framebuffer;defined(t)&&(e._colorGBuffer.destroy(),e._depthGBuffer.destroy(),e._depthTexture.destroy(),t.destroy(),e._framebuffer=void 0,e._colorGBuffer=void 0,e._depthGBuffer=void 0,e._depthTexture=void 0,e._drawCommand=void 0,e._clearCommand=void 0)}function createFramebuffer$3(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),a=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),r=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_COMPONENT,pixelDatatype:PixelDatatype$1.UNSIGNED_INT,sampler:Sampler.NEAREST});e._framebuffer=new Framebuffer({context:t,colorTextures:[n,a],depthTexture:r,destroyAttachments:!1}),e._colorGBuffer=n,e._depthGBuffer=a,e._depthTexture=r}var distanceAndEdlStrengthScratch=new Cartesian2;function createCommands$1(e,t){var i=new ShaderSource({defines:["LOG_DEPTH_WRITE"],sources:[PointCloudEyeDomeLightingShader]}),r={u_pointCloud_colorGBuffer:function(){return e._colorGBuffer},u_pointCloud_depthGBuffer:function(){return e._depthGBuffer},u_distanceAndEdlStrength:function(){return distanceAndEdlStrengthScratch.x=e._radius,distanceAndEdlStrengthScratch.y=e._strength,distanceAndEdlStrengthScratch}},n=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:StencilConstants$1.setCesium3DTileBit(),stencilMask:StencilConstants$1.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(i,{uniformMap:r,renderState:n,pass:Pass$1.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ClearCommand({framebuffer:e._framebuffer,color:new Color(0,0,0,0),depth:1,renderState:RenderState.fromCache(),pass:Pass$1.CESIUM_3D_TILE,owner:e})}function createResources$3(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=e._colorGBuffer,a=!1,r=defined(n)&&(n.width!==i||n.height!==r);return defined(n)&&!r||(destroyFramebuffer$1(e),createFramebuffer$3(e,t),createCommands$1(e,t),a=!0),a}function isSupported(e){return e.drawBuffers&&e.fragmentDepth}function getECShaderProgram(e,t){var i,r,n=e.shaderCache.getDerivedShaderProgram(t,"EC");return defined(n)||(i=t._attributeLocations,(r=t.fragmentShaderSource.clone()).sources=r.sources.map(function(e){return e=(e=ShaderSource.replaceMain(e,"czm_point_cloud_post_process_main")).replace(/gl_FragColor/g,"gl_FragData[0]")}),r.sources.unshift("#extension GL_EXT_draw_buffers : enable \n"),r.sources.push("void main() \n{ \n czm_point_cloud_post_process_main(); \n#ifdef LOG_DEPTH\n czm_writeLogDepth();\n gl_FragData[1] = czm_packDepth(gl_FragDepthEXT); \n#else\n gl_FragData[1] = czm_packDepth(gl_FragCoord.z);\n#endif\n}"),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})),n}function PointCloudShading(e){e=defaultValue(e,{});this.attenuation=defaultValue(e.attenuation,!1),this.geometricErrorScale=defaultValue(e.geometricErrorScale,1),this.maximumAttenuation=e.maximumAttenuation,this.baseResolution=e.baseResolution,this.eyeDomeLighting=defaultValue(e.eyeDomeLighting,!0),this.eyeDomeLightingStrength=defaultValue(e.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=defaultValue(e.eyeDomeLightingRadius,1),this.backFaceCulling=defaultValue(e.backFaceCulling,!1),this.normalShading=defaultValue(e.normalShading,!0)}function PointCloud3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._pickId=void 0,this._batchTable=void 0,this._styleDirty=!1,this._features=void 0,this.featurePropertiesDirty=!1,this._pointCloud=new PointCloud({arrayBuffer:r,byteOffset:n,cull:!1,opaquePass:Pass$1.CESIUM_3D_TILE,vertexShaderLoaded:getVertexShaderLoaded(this),fragmentShaderLoaded:getFragmentShaderLoaded$1(this),uniformMapLoaded:getUniformMapLoaded$1(this),batchTableLoaded:getBatchTableLoaded(this),pickIdLoaded:getPickIdLoaded$1(this)})}function getVertexShaderLoaded(t){return function(e){return defined(t._batchTable)?t._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(e):e}}function getFragmentShaderLoaded$1(t){return function(e){return defined(t._batchTable)?t._batchTable.getFragmentShaderCallback(!1,void 0,!1)(e):"uniform vec4 czm_pickColor;\n"+e}}function getUniformMapLoaded$1(t){return function(e){return defined(t._batchTable)?t._batchTable.getUniformMapCallback()(e):combine$2(e,{czm_pickColor:function(){return t._pickId.color}})}}function getBatchTableLoaded(r){return function(e,t,i){r._batchTable=new Cesium3DTileBatchTable(r,e,t,i)}}function getPickIdLoaded$1(e){return function(){return defined(e._batchTable)?e._batchTable.getPickId():"czm_pickColor"}}function getGeometricError$1(e){var t=e._tileset.pointCloudShading,i=e._tile.contentBoundingVolume.boundingSphere.volume(),i=CesiumMath.cbrt(i/e.pointsLength),e=e._tile.geometricError;return e=0===e?defined(t)&&defined(t.baseResolution)?t.baseResolution:i:e}function createFeatures$1(e){var t=e.featuresLength;if(!defined(e._features)&&0<t){for(var i=new Array(t),r=0;r<t;++r)i[r]=new Cesium3DTileFeature(e,r);e._features=i}}PointCloudEyeDomeLighting.isSupported=isSupported,PointCloudEyeDomeLighting.prototype.update=function(e,t,i,r){if(isSupported(e.context)){this._strength=i.eyeDomeLightingStrength,this._radius=i.eyeDomeLightingRadius*e.pixelRatio;for(var n=createResources$3(this,e.context),a=e.commandList,o=a.length,s=t;s<o;++s){var l,c=a[s];c.primitiveType===PrimitiveType$1.POINTS&&c.pass!==Pass$1.TRANSLUCENT&&(defined(l=c.derivedCommands.pointCloudProcessor)&&!c.dirty&&!n&&l.framebuffer===this._framebuffer||(l=DrawCommand.shallowClone(c),(c.derivedCommands.pointCloudProcessor=l).framebuffer=this._framebuffer,l.shaderProgram=getECShaderProgram(e.context,c.shaderProgram),l.castShadows=!1,l.receiveShadows=!1),a[s]=l)}i=this._clearCommand,t=this._drawCommand;t.boundingVolume=r,a.push(t),a.push(i)}},PointCloudEyeDomeLighting.prototype.isDestroyed=function(){return!1},PointCloudEyeDomeLighting.prototype.destroy=function(){return destroyFramebuffer$1(this),destroyObject(this)},PointCloudShading.isSupported=function(e){return PointCloudEyeDomeLighting.isSupported(e.context)},Object.defineProperties(PointCloud3DTileContent.prototype,{featuresLength:{get:function(){return defined(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointCloud.pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._pointCloud.geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return defined(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._pointCloud.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}}),PointCloud3DTileContent.prototype.hasProperty=function(e,t){return!!defined(this._batchTable)&&this._batchTable.hasProperty(e,t)},PointCloud3DTileContent.prototype.getFeature=function(e){if(defined(this._batchTable))return this.featuresLength,createFeatures$1(this),this._features[e]},PointCloud3DTileContent.prototype.applyDebugSettings=function(e,t){this._pointCloud.color=e?t:Color.WHITE},PointCloud3DTileContent.prototype.applyStyle=function(e){defined(this._batchTable)?this._batchTable.applyStyle(e):this._styleDirty=!0};var defaultShading$1=new PointCloudShading;function Tileset3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._readyPromise=when.defer(),this.featurePropertiesDirty=!1,initialize$1(this,r,n)}function initialize$1(t,e,i){i=defaultValue(i,0);var r,e=new Uint8Array(e);try{r=getJsonFromTypedArray(e,i)}catch(e){return void t._readyPromise.reject(new RuntimeError("Invalid tile content."))}t._tileset.loadTileset(t._resource,r,t._tile),t._readyPromise.resolve(t)}function VertexArrayFacade(e,t,i,r){var n=VertexArrayFacade._verifyAttributes(t);i=defaultValue(i,0);for(var a,o,s,l=[],c={},u=n.length,d=0;d<u;++d){var h=n[d];h.vertexBuffer?l.push(h):(a=!defined(a=c[o=h.usage])?c[o]=[]:a).push(h)}function p(e,t){return ComponentDatatype$1.getSizeInBytes(t.componentDatatype)-ComponentDatatype$1.getSizeInBytes(e.componentDatatype)}for(o in this._allBuffers=[],c)c.hasOwnProperty(o)&&((a=c[o]).sort(p),s={vertexSizeInBytes:s=VertexArrayFacade._vertexSizeInBytes(a),vertexBuffer:void 0,usage:a[0].usage,needsCommit:!1,arrayBuffer:void 0,arrayViews:VertexArrayFacade._createArrayViews(a,s)},this._allBuffers.push(s));this._size=0,this._instanced=defaultValue(r,!1),this._precreated=l,this._context=e,this.writers=void 0,this.va=void 0,this.resize(i)}PointCloud3DTileContent.prototype.update=function(e,t){var i=this._pointCloud,r=defaultValue(e.pointCloudShading,defaultShading$1),n=this._tile,a=this._batchTable,o=t.mode,s=e.clippingPlanes;defined(this._pickId)||defined(a)||(this._pickId=t.context.createPickId({primitive:e,content:this})),defined(a)&&a.update(e,t);var l=(defined(n._contentBoundingVolume)?o===SceneMode$1.SCENE3D?n._contentBoundingVolume:n._contentBoundingVolume2D:o===SceneMode$1.SCENE3D?n._boundingVolume:n._boundingVolume2D).boundingSphere,o=this._styleDirty;this._styleDirty=!1,i.clippingPlanesOriginMatrix=e.clippingPlanesOriginMatrix,i.style=defined(a)?void 0:e.style,i.styleDirty=o,i.modelMatrix=n.computedTransform,i.time=e.timeSinceLoad,i.shadows=e.shadows,i.boundingSphere=l,i.clippingPlanes=s,i.isClipped=defined(s)&&s.enabled&&n._isClipped,i.clippingPlanesDirty=n.clippingPlanesDirty,i.attenuation=r.attenuation,i.backFaceCulling=r.backFaceCulling,i.normalShading=r.normalShading,i.geometricError=getGeometricError$1(this),i.geometricErrorScale=r.geometricErrorScale,defined(r)&&defined(r.maximumAttenuation)?i.maximumAttenuation=r.maximumAttenuation:n.refine===Cesium3DTileRefine$1.ADD?i.maximumAttenuation=5:i.maximumAttenuation=e.maximumScreenSpaceError,i.update(t)},PointCloud3DTileContent.prototype.isDestroyed=function(){return!1},PointCloud3DTileContent.prototype.destroy=function(){return this._pickId=this._pickId&&this._pickId.destroy(),this._pointCloud=this._pointCloud&&this._pointCloud.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)},Object.defineProperties(Tileset3DTileContent.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(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}}),Tileset3DTileContent.prototype.hasProperty=function(e,t){return!1},Tileset3DTileContent.prototype.getFeature=function(e){},Tileset3DTileContent.prototype.applyDebugSettings=function(e,t){},Tileset3DTileContent.prototype.applyStyle=function(e){},Tileset3DTileContent.prototype.update=function(e,t){},Tileset3DTileContent.prototype.isDestroyed=function(){return!1},Tileset3DTileContent.prototype.destroy=function(){return destroyObject(this)},VertexArrayFacade._verifyAttributes=function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i],r={index:defaultValue(r.index,i),enabled:defaultValue(r.enabled,!0),componentsPerAttribute:r.componentsPerAttribute,componentDatatype:defaultValue(r.componentDatatype,ComponentDatatype$1.FLOAT),normalize:defaultValue(r.normalize,!1),vertexBuffer:r.vertexBuffer,usage:defaultValue(r.usage,BufferUsage$1.STATIC_DRAW)};t.push(r)}for(var n=new Array(t.length),a=0;a<t.length;++a)n[t[a].index]=!0;return t},VertexArrayFacade._vertexSizeInBytes=function(e){for(var t=0,i=e.length,r=0;r<i;++r){var n=e[r];t+=n.componentsPerAttribute*ComponentDatatype$1.getSizeInBytes(n.componentDatatype)}var a=0<i?ComponentDatatype$1.getSizeInBytes(e[0].componentDatatype):0,o=0<a?t%a:0;return t+=0==o?0:a-o},VertexArrayFacade._createArrayViews=function(e,t){for(var i=[],r=0,n=e.length,a=0;a<n;++a){var o=e[a],s=o.componentDatatype;i.push({index:o.index,enabled:o.enabled,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:s,normalize:o.normalize,offsetInBytes:r,vertexSizeInComponentType:t/ComponentDatatype$1.getSizeInBytes(s),view:void 0}),r+=o.componentsPerAttribute*ComponentDatatype$1.getSizeInBytes(s)}return i},VertexArrayFacade.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var i=0,r=t.length;i<r;++i){var n=t[i];VertexArrayFacade._resize(n,this._size),VertexArrayFacade._appendWriters(this.writers,n)}destroyVA(this)},VertexArrayFacade._resize=function(e,t){if(0<e.vertexSizeInBytes){var i=new ArrayBuffer(t*e.vertexSizeInBytes);if(defined(e.arrayBuffer))for(var r=new Uint8Array(i),n=new Uint8Array(e.arrayBuffer),a=n.length,o=0;o<a;++o)r[o]=n[o];for(var s=e.arrayViews,l=s.length,c=0;c<l;++c){var u=s[c];u.view=ComponentDatatype$1.createArrayBufferView(u.componentDatatype,i,u.offsetInBytes)}e.arrayBuffer=i}};var createWriters=[function(i,r,n){return function(e,t){r[e*n]=t,i.needsCommit=!0}},function(r,n,a){return function(e,t,i){e*=a;n[e]=t,n[1+e]=i,r.needsCommit=!0}},function(n,a,o){return function(e,t,i,r){e*=o;a[e]=t,a[1+e]=i,a[2+e]=r,n.needsCommit=!0}},function(a,o,s){return function(e,t,i,r,n){e*=s;o[e]=t,o[1+e]=i,o[2+e]=r,o[3+e]=n,a.needsCommit=!0}}];function commit(e,t){if(t.needsCommit&&0<t.vertexSizeInBytes){t.needsCommit=!1;var i=t.vertexBuffer,r=e._size*t.vertexSizeInBytes,n=defined(i);if(!n||i.sizeInBytes<r)return n&&i.destroy(),t.vertexBuffer=Buffer$1.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),!(t.vertexBuffer.vertexArrayDestroyable=!1);t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function subCommit(e,t,i){e.needsCommit&&0<e.vertexSizeInBytes&&(t=e.vertexSizeInBytes*t,i=e.vertexSizeInBytes*i,e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,t,i),t))}function destroyVA(e){var t=e.va;if(defined(t)){for(var i=t.length,r=0;r<i;++r)t[r].va.destroy();e.va=void 0}}VertexArrayFacade._appendWriters=function(e,t){for(var i=t.arrayViews,r=i.length,n=0;n<r;++n){var a=i[n];e[a.index]=createWriters[a.componentsPerAttribute-1](t,a.view,a.vertexSizeInComponentType)}},VertexArrayFacade.prototype.commit=function(e){var t=!1,i=this._allBuffers;for(l=0,c=i.length;l<c;++l)t=commit(this,u=i[l])||t;if(t||!defined(this.va)){destroyVA(this);for(var r=this.va=[],n=CesiumMath.SIXTY_FOUR_KILOBYTES-4,a=defined(e)&&!this._instanced?Math.ceil(this._size/n):1,o=0;o<a;++o){for(var s=[],l=0,c=i.length;l<c;++l){var u,d=o*((u=i[l]).vertexSizeInBytes*n);VertexArrayFacade._appendAttributes(s,u,d,this._instanced)}s=s.concat(this._precreated),r.push({va:new VertexArray({context:this._context,attributes:s,indexBuffer:e}),indicesCount:1.5*(o!==a-1?n:this._size%n)})}}},VertexArrayFacade._appendAttributes=function(e,t,i,r){for(var n=t.arrayViews,a=n.length,o=0;o<a;++o){var s=n[o];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:i+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:r?1:0})}},VertexArrayFacade.prototype.subCommit=function(e,t){for(var i=this._allBuffers,r=0,n=i.length;r<n;++r)subCommit(i[r],e,t)},VertexArrayFacade.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t)e[t].needsCommit=!1},VertexArrayFacade.prototype.isDestroyed=function(){return!1},VertexArrayFacade.prototype.destroy=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t){var r=e[t];r.vertexBuffer=r.vertexBuffer&&r.vertexBuffer.destroy()}return destroyVA(this),destroyObject(this)};var BillboardCollectionFS="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform sampler2D u_atlas;\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvarying vec2 v_textureCoordinates;\nvarying vec4 v_pickColor;\nvarying vec4 v_color;\n#ifdef SDF\nvarying vec4 v_outlineColor;\nvarying float v_outlineWidth;\n#endif\n#ifdef FRAGMENT_DEPTH_CHECK\nvarying vec4 v_textureCoordinateBounds;\nvarying vec4 v_originTextureCoordinateAndTranslate;\nvarying vec4 v_compressed;\nvarying mat2 v_rotationMatrix;\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nfloat getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)\n{\nvec2 lookupVector = imageSize * (depthLookupST - adjustedST);\nlookupVector = v_rotationMatrix * lookupVector;\nvec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y));\nvec2 translation = v_originTextureCoordinateAndTranslate.zw;\nif (applyTranslate)\n{\ntranslation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));\n}\nvec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st));\nif (logDepthOrDepth == 0.0)\n{\nreturn 0.0;\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\nreturn eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\n#ifdef SDF\nfloat getDistance(vec2 position)\n{\nreturn texture2D(u_atlas, position).r;\n}\nvec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)\n{\nfloat distance = getDistance(position);\nif (outlineWidth > 0.0)\n{\nfloat outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);\nfloat outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\nvec4 sdfColor = mix(outlineColor, v_color, outlineFactor);\nfloat alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);\nreturn vec4(sdfColor.rgb, sdfColor.a * alpha);\n}\nelse\n{\nfloat alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\nreturn vec4(v_color.rgb, v_color.a * alpha);\n}\n}\n#endif\nvoid main()\n{\nvec4 color = texture2D(u_atlas, v_textureCoordinates);\n#ifdef SDF\nfloat outlineWidth = v_outlineWidth;\nvec4 outlineColor = v_outlineColor;\nfloat distance = getDistance(v_textureCoordinates);\n#ifdef GL_OES_standard_derivatives\nfloat smoothing = fwidth(distance);\nvec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));\nvec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\nvec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\ncolor = (center + color1 + color2 + color3 + color4)/5.0;\n#else\nfloat smoothing = 1.0/32.0;\ncolor = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\n#endif\ncolor = czm_gammaCorrect(color);\n#else\ncolor = czm_gammaCorrect(color);\ncolor *= czm_gammaCorrect(v_color);\n#endif\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef VECTOR_TILE\ncolor *= u_highlightColor;\n#endif\ngl_FragColor = color;\n#ifdef LOG_DEPTH\nczm_writeLogDepth();\n#endif\n#ifdef FRAGMENT_DEPTH_CHECK\nfloat temp = v_compressed.y;\ntemp = temp * SHIFT_RIGHT1;\nfloat temp2 = (temp - floor(temp)) * SHIFT_LEFT1;\nbool enableDepthTest = temp2 != 0.0;\nbool applyTranslate = floor(temp) != 0.0;\nif (enableDepthTest) {\ntemp = v_compressed.z;\ntemp = temp * SHIFT_RIGHT12;\nvec2 dimensions;\ndimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\ndimensions.x = floor(temp);\ntemp = v_compressed.w;\ntemp = temp * SHIFT_RIGHT12;\nvec2 imageSize;\nimageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;\nimageSize.x = floor(temp);\nvec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;\nadjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);\nfloat epsilonEyeDepth = v_compressed.x + czm_epsilon1;\nfloat globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);\nif (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)\n{\nfloat globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize);\nif (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)\n{\nfloat globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize);\nif (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)\n{\ndiscard;\n}\n}\n}\n}\n#endif\n}\n",BillboardCollectionVS="#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec4 compressedAttribute3;\nattribute vec2 sdf;\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\nattribute vec4 textureCoordinateBoundsOrLabelTranslate;\n#endif\n#ifdef VECTOR_TILE\nattribute float a_batchId;\n#endif\nvarying vec2 v_textureCoordinates;\n#ifdef FRAGMENT_DEPTH_CHECK\nvarying vec4 v_textureCoordinateBounds;\nvarying vec4 v_originTextureCoordinateAndTranslate;\nvarying vec4 v_compressed;\nvarying mat2 v_rotationMatrix;\n#endif\nvarying vec4 v_pickColor;\nvarying vec4 v_color;\n#ifdef SDF\nvarying vec4 v_outlineColor;\nvarying float v_outlineWidth;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)\n{\nvec2 halfSize = imageSize * scale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\nangle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nrotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\nelse\n{\nrotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n}\n#endif\nmpp = czm_metersPerPixel(positionEC);\npositionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\npositionEC.xy += (translate + pixelOffset) * mpp;\nreturn positionEC;\n}\n#ifdef VERTEX_DEPTH_CHECK\nfloat getGlobeDepth(vec4 positionEC)\n{\nvec4 posWC = czm_eyeToWindowCoordinates(positionEC);\nfloat globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\nif (globeDepth == 0.0)\n{\nreturn 0.0;\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\nreturn eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\n#ifdef FRAGMENT_DEPTH_CHECK\nvec2 depthOrigin = origin.xy;\n#endif\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);\nvec2 imageSize = vec2(floor(temp), temp2);\n#ifdef FRAGMENT_DEPTH_CHECK\nfloat labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));\nfloat applyTranslate = 0.0;\nif (labelHorizontalOrigin != 0.0)\n{\napplyTranslate = 1.0;\nlabelHorizontalOrigin -= 2.0;\ndepthOrigin.x = labelHorizontalOrigin + 1.0;\n}\ndepthOrigin = vec2(1.0) - (depthOrigin * 0.5);\n#endif\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\ntemp = compressedAttribute3.w;\ntemp = temp * SHIFT_RIGHT12;\nvec2 dimensions;\ndimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\ndimensions.x = floor(temp);\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\nvec4 pickColor;\nvec4 color;\ntemp = compressedAttribute2.y;\ntemp = temp * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\ntemp = compressedAttribute2.x;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\n#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)\nfloat eyeDepth = positionEC.z;\n#endif\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\nscale *= distanceScale;\ntranslate *= distanceScale;\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = compressedAttribute3.x;\nfloat farSq = compressedAttribute3.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nmat2 rotationMatrix;\nfloat mpp;\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = compressedAttribute3.z;\n#endif\n#ifdef VERTEX_DEPTH_CHECK\nif (lengthSq < disableDepthTestDistance) {\nfloat depthsilon = 10.0;\nvec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;\nvec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth1 = getGlobeDepth(pEC1);\nif (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)\n{\nvec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth2 = getGlobeDepth(pEC2);\nif (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)\n{\nvec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth3 = getGlobeDepth(pEC3);\nif (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)\n{\npositionEC.xyz = vec3(0.0);\n}\n}\n}\n}\n#endif\npositionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\ngl_Position = czm_projection * positionEC;\nv_textureCoordinates = textureCoordinates;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth();\n#endif\n#ifdef DISABLE_DEPTH_DISTANCE\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\nv_depthFromNearPlusOne = 1.0;\n#endif\n}\n}\n#endif\n#ifdef FRAGMENT_DEPTH_CHECK\nif (sizeInMeters) {\ntranslate /= mpp;\ndimensions /= mpp;\nimageSize /= mpp;\n}\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nv_rotationMatrix = rotationMatrix;\n#else\nv_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n#endif\nfloat enableDepthCheck = 0.0;\nif (lengthSq < disableDepthTestDistance)\n{\nenableDepthCheck = 1.0;\n}\nfloat dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));\nfloat dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));\nfloat iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));\nfloat ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));\nv_compressed.x = eyeDepth;\nv_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;\nv_compressed.z = dw * SHIFT_LEFT12 + dh;\nv_compressed.w = iw * SHIFT_LEFT12 + ih;\nv_originTextureCoordinateAndTranslate.xy = depthOrigin;\nv_originTextureCoordinateAndTranslate.zw = translate;\nv_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;\n#endif\n#ifdef SDF\nvec4 outlineColor;\nfloat outlineWidth;\ntemp = sdf.x;\ntemp = temp * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\ntemp = sdf.y;\ntemp = temp * SHIFT_RIGHT8;\nfloat temp3 = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.a = floor(temp);\noutlineColor /= 255.0;\nv_outlineWidth = outlineWidth / 255.0;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\n#endif\nv_pickColor = pickColor;\nv_color = color;\nv_color.a *= translucency;\n}\n",SceneTransforms={},actualPositionScratch=new Cartesian4(0,0,0,1),positionCC=new Cartesian4,scratchViewport$1=new BoundingRectangle,scratchWindowCoord0=new Cartesian2,scratchWindowCoord1=new Cartesian2;SceneTransforms.wgs84ToWindowCoordinates=function(e,t,i){return SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(e,t,Cartesian3.ZERO,i)};var scratchCartesian4$3=new Cartesian4,scratchEyeOffset=new Cartesian3;function worldToClip(e,t,i,r){var n=i.viewMatrix,n=Matrix4.multiplyByVector(n,Cartesian4.fromElements(e.x,e.y,e.z,1,scratchCartesian4$3),scratchCartesian4$3),e=Cartesian3.multiplyComponents(t,Cartesian3.normalize(n,scratchEyeOffset),scratchEyeOffset);return n.x+=t.x+e.x,n.y+=t.y+e.y,n.z+=e.z,Matrix4.multiplyByVector(i.frustum.projectionMatrix,n,r)}var scratchMaxCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratchProjectedCartesian=new Cartesian3,scratchCameraPosition$1=new Cartesian3;SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,i,r){var n=e.frameState,a=SceneTransforms.computeActualWgs84Position(n,t,actualPositionScratch);if(defined(a)){var o=e.canvas,s=scratchViewport$1;s.x=0,s.y=0,s.width=o.clientWidth,s.height=o.clientHeight;var l,c,u,d,h,p=e.camera,m=!1;if(n.mode===SceneMode$1.SCENE2D&&(l=e.mapProjection.project(scratchMaxCartographic,scratchProjectedCartesian),c=Cartesian3.clone(p.position,scratchCameraPosition$1),u=p.frustum.clone(),h=Matrix4.computeViewportTransformation(s,0,1,new Matrix4),d=p.frustum.projectionMatrix,t=p.positionWC.y,e=Cartesian3.fromElements(CesiumMath.sign(t)*l.x-t,0,-p.positionWC.x),h=Transforms.pointToGLWindowCoordinates(d,h,e),0===t||h.x<=0||h.x>=o.clientWidth?m=!0:(positionCC=(h.x>.5*o.clientWidth?(s.width=h.x,p.frustum.right=l.x-t,positionCC=worldToClip(a,i,p,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord0),s.x+=h.x,p.position.x=-p.position.x,e=p.frustum.right,p.frustum.right=-p.frustum.left,p.frustum.left=-e):(s.x+=h.x,s.width-=h.x,p.frustum.left=-l.x-t,positionCC=worldToClip(a,i,p,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord0),s.x=s.x-s.width,p.position.x=-p.position.x,t=p.frustum.left,p.frustum.left=-p.frustum.right,p.frustum.right=-t),worldToClip(a,i,p,positionCC)),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord1),Cartesian3.clone(c,p.position),p.frustum=u.clone(),((r=Cartesian2.clone(scratchWindowCoord0,r)).x<0||r.x>o.clientWidth)&&(r.x=scratchWindowCoord1.x))),n.mode!==SceneMode$1.SCENE2D||m){if((positionCC=worldToClip(a,i,p,positionCC)).z<0&&!(p.frustum instanceof OrthographicFrustum)&&!(p.frustum instanceof OrthographicOffCenterFrustum))return;r=SceneTransforms.clipToGLWindowCoordinates(s,positionCC,r)}return r.y=o.clientHeight-r.y,r}},SceneTransforms.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(defined(i=SceneTransforms.wgs84ToWindowCoordinates(e,t,i)))return SceneTransforms.transformWindowToDrawingBuffer(e,i,i)};var projectedPosition=new Cartesian3,positionInCartographic=new Cartographic;SceneTransforms.computeActualWgs84Position=function(e,t,i){var r=e.mode;if(r===SceneMode$1.SCENE3D)return Cartesian3.clone(t,i);var n=e.mapProjection,a=n.ellipsoid.cartesianToCartographic(t,positionInCartographic);if(defined(a)){if(n.project(a,projectedPosition),r===SceneMode$1.COLUMBUS_VIEW)return Cartesian3.fromElements(projectedPosition.z,projectedPosition.x,projectedPosition.y,i);if(r===SceneMode$1.SCENE2D)return Cartesian3.fromElements(0,projectedPosition.x,projectedPosition.y,i);e=e.morphTime;return Cartesian3.fromElements(CesiumMath.lerp(projectedPosition.z,t.x,e),CesiumMath.lerp(projectedPosition.x,t.y,e),CesiumMath.lerp(projectedPosition.y,t.z,e),i)}};var positionNDC=new Cartesian3,positionWC=new Cartesian3,viewportTransform=new Matrix4;SceneTransforms.clipToGLWindowCoordinates=function(e,t,i){return Cartesian3.divideByScalar(t,t.w,positionNDC),Matrix4.computeViewportTransformation(e,0,1,viewportTransform),Matrix4.multiplyByPoint(viewportTransform,positionNDC,positionWC),Cartesian2.fromCartesian3(positionWC,i)},SceneTransforms.transformWindowToDrawingBuffer=function(e,t,i){var r=e.canvas,n=e.drawingBufferWidth/r.clientWidth,r=e.drawingBufferHeight/r.clientHeight;return Cartesian2.fromElements(t.x*n,t.y*r,i)};var scratchNDC=new Cartesian4,scratchWorldCoords=new Cartesian4;function Billboard(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucencyByDistance,r=e.pixelOffsetScaleByDistance,n=e.scaleByDistance,a=e.distanceDisplayCondition;defined(i)&&(i=NearFarScalar.clone(i)),defined(r)&&(r=NearFarScalar.clone(r)),defined(n)&&(n=NearFarScalar.clone(n)),defined(a)&&(a=DistanceDisplayCondition.clone(a)),this._show=defaultValue(e.show,!0),this._position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this._actualPosition=Cartesian3.clone(this._position),this._pixelOffset=Cartesian2.clone(defaultValue(e.pixelOffset,Cartesian2.ZERO)),this._translate=new Cartesian2(0,0),this._eyeOffset=Cartesian3.clone(defaultValue(e.eyeOffset,Cartesian3.ZERO)),this._heightReference=defaultValue(e.heightReference,HeightReference$1.NONE),this._verticalOrigin=defaultValue(e.verticalOrigin,VerticalOrigin$1.CENTER),this._horizontalOrigin=defaultValue(e.horizontalOrigin,HorizontalOrigin$1.CENTER),this._scale=defaultValue(e.scale,1),this._color=Color.clone(defaultValue(e.color,Color.WHITE)),this._rotation=defaultValue(e.rotation,0),this._alignedAxis=Cartesian3.clone(defaultValue(e.alignedAxis,Cartesian3.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=n,this._translucencyByDistance=i,this._pixelOffsetScaleByDistance=r,this._sizeInMeters=defaultValue(e.sizeInMeters,!1),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=defaultValue(e.collection,t),this._pickId=void 0,this._pickPrimitive=defaultValue(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;a=e.image,t=e.imageId;defined(a)&&(defined(t)||(t="string"==typeof a?a:defined(a.src)?a.src:createGuid()),this._imageId=t,this._image=a),defined(e.imageSubRegion)&&(this._imageId=t,this._imageSubRegion=e.imageSubRegion),defined(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=SceneMode$1.SCENE3D,this._clusterShow=!0,this._outlineColor=Color.clone(defaultValue(e.outlineColor,Color.BLACK)),this._outlineWidth=defaultValue(e.outlineWidth,0),this._updateClamping()}SceneTransforms.drawingBufferToWgs84Coordinates=function(e,t,i,r){var n=e.context.uniformState,a=n.currentFrustum,o=a.x,s=a.y;e.frameState.useLogDepth&&(l=i*n.log2FarDepthFromNearPlusOne,i=s*(1-o/(Math.pow(2,l)-1+o))/(s-o));var a=e.view.passState.viewport,l=Cartesian4.clone(Cartesian4.UNIT_W,scratchNDC);l.x=(t.x-a.x)/a.width*2-1,l.y=(t.y-a.y)/a.height*2-1,l.z=2*i-1,l.w=1;var c,i=e.camera.frustum;return defined(i.fovy)?(e=1/(c=Matrix4.multiplyByVector(n.inverseViewProjection,l,scratchWorldCoords)).w,Cartesian3.multiplyByScalar(c,e,c)):(defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),(c=scratchWorldCoords).x=.5*(l.x*(i.right-i.left)+i.left+i.right),c.y=.5*(l.y*(i.top-i.bottom)+i.bottom+i.top),c.z=.5*(l.z*(o-s)-o-s),c.w=1,c=Matrix4.multiplyByVector(n.inverseView,c,c)),Cartesian3.fromCartesian4(c,r)};var SHOW_INDEX$5=Billboard.SHOW_INDEX=0,POSITION_INDEX$5=Billboard.POSITION_INDEX=1,PIXEL_OFFSET_INDEX$1=Billboard.PIXEL_OFFSET_INDEX=2,EYE_OFFSET_INDEX$1=Billboard.EYE_OFFSET_INDEX=3,HORIZONTAL_ORIGIN_INDEX$1=Billboard.HORIZONTAL_ORIGIN_INDEX=4,VERTICAL_ORIGIN_INDEX$1=Billboard.VERTICAL_ORIGIN_INDEX=5,SCALE_INDEX$1=Billboard.SCALE_INDEX=6,IMAGE_INDEX_INDEX$1=Billboard.IMAGE_INDEX_INDEX=7,COLOR_INDEX$3=Billboard.COLOR_INDEX=8,ROTATION_INDEX$1=Billboard.ROTATION_INDEX=9,ALIGNED_AXIS_INDEX$1=Billboard.ALIGNED_AXIS_INDEX=10,SCALE_BY_DISTANCE_INDEX$3=Billboard.SCALE_BY_DISTANCE_INDEX=11,TRANSLUCENCY_BY_DISTANCE_INDEX$3=Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX=12,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX$1=Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,DISTANCE_DISPLAY_CONDITION$2=Billboard.DISTANCE_DISPLAY_CONDITION=14,DISABLE_DEPTH_DISTANCE$1=Billboard.DISABLE_DEPTH_DISTANCE=15;Billboard.TEXTURE_COORDINATE_BOUNDS=16;var SDF_INDEX$1=Billboard.SDF_INDEX=17;function makeDirty$2(e,t){var i=e._billboardCollection;defined(i)&&(i._updateBillboard(e,t),e._dirty=!0)}Billboard.NUMBER_OF_PROPERTIES=18,Object.defineProperties(Billboard.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,makeDirty$2(this,SHOW_INDEX$5))}},position:{get:function(){return this._position},set:function(e){var t=this._position;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),Cartesian3.clone(e,this._actualPosition),this._updateClamping(),makeDirty$2(this,POSITION_INDEX$5))}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),makeDirty$2(this,POSITION_INDEX$5))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var t=this._pixelOffset;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),makeDirty$2(this,PIXEL_OFFSET_INDEX$1))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;NearFarScalar.equals(t,e)||(this._scaleByDistance=NearFarScalar.clone(e,t),makeDirty$2(this,SCALE_BY_DISTANCE_INDEX$3))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;NearFarScalar.equals(t,e)||(this._translucencyByDistance=NearFarScalar.clone(e,t),makeDirty$2(this,TRANSLUCENCY_BY_DISTANCE_INDEX$3))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;NearFarScalar.equals(t,e)||(this._pixelOffsetScaleByDistance=NearFarScalar.clone(e,t),makeDirty$2(this,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX$1))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),makeDirty$2(this,EYE_OFFSET_INDEX$1))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,makeDirty$2(this,HORIZONTAL_ORIGIN_INDEX$1))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,makeDirty$2(this,VERTICAL_ORIGIN_INDEX$1))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,makeDirty$2(this,SCALE_INDEX$1))}},color:{get:function(){return this._color},set:function(e){var t=this._color;Color.equals(t,e)||(Color.clone(e,t),makeDirty$2(this,COLOR_INDEX$3))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,makeDirty$2(this,ROTATION_INDEX$1))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),makeDirty$2(this,ALIGNED_AXIS_INDEX$1))}},width:{get:function(){return defaultValue(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,makeDirty$2(this,IMAGE_INDEX_INDEX$1))}},height:{get:function(){return defaultValue(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,makeDirty$2(this,IMAGE_INDEX_INDEX$1))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,makeDirty$2(this,COLOR_INDEX$3))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){DistanceDisplayCondition.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition),makeDirty$2(this,DISTANCE_DISPLAY_CONDITION$2))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,makeDirty$2(this,DISABLE_DEPTH_DISTANCE$1))}},id:{get:function(){return this._id},set:function(e){this._id=e,defined(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,defined(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){defined(e)?"string"==typeof e?this.setImage(e,e):e instanceof Resource?this.setImage(e.url,e):defined(e.src)?this.setImage(e.src,e):this.setImage(createGuid(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,makeDirty$2(this,IMAGE_INDEX_INDEX$1))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Cartesian3.clone(e,this._actualClampedPosition),makeDirty$2(this,POSITION_INDEX$5)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,makeDirty$2(this,SHOW_INDEX$5))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;Color.equals(t,e)||(Color.clone(e,t),makeDirty$2(this,SDF_INDEX$1))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,makeDirty$2(this,SDF_INDEX$1))}}}),Billboard.prototype.getPickId=function(e){return defined(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},Billboard.prototype._updateClamping=function(){Billboard._updateClamping(this._billboardCollection,this)};var scratchCartographic$b=new Cartographic,scratchPosition$4=new Cartesian3;Billboard._updateClamping=function(e,i){var r,t,n,a,o=e._scene;function s(e){var t;i._heightReference===HeightReference$1.RELATIVE_TO_GROUND&&(i._mode===SceneMode$1.SCENE3D?((t=r.cartesianToCartographic(e,scratchCartographic$b)).height+=n.height,r.cartographicToCartesian(t,e)):e.x+=n.height),i._clampedPosition=Cartesian3.clone(e,i._clampedPosition)}defined(o)&&defined(o.globe)&&(a=o.globe,r=a.ellipsoid,t=a._surface,o=(e=o.frameState.mode)!==i._mode,i._mode=e,(i._heightReference===HeightReference$1.NONE||o)&&defined(i._removeCallbackFunc)&&(i._removeCallbackFunc(),i._removeCallbackFunc=void 0,i._clampedPosition=void 0),i._heightReference!==HeightReference$1.NONE&&defined(i._position)&&(defined(n=r.cartesianToCartographic(i._position))?(defined(i._removeCallbackFunc)&&i._removeCallbackFunc(),i._removeCallbackFunc=t.updateHeight(n,s),Cartographic.clone(n,scratchCartographic$b),defined(a=a.getHeight(n))&&(scratchCartographic$b.height=a),r.cartographicToCartesian(scratchCartographic$b,scratchPosition$4),s(scratchPosition$4)):i._actualClampedPosition=void 0))},Billboard.prototype._loadImage=function(){var e,i,r=this._billboardCollection._textureAtlas,n=this._imageId,a=this._image,o=this._imageSubRegion;defined(a)&&(e=r.addImage(n,a)),defined(o)&&(e=r.addSubRegion(n,o)),defined(this._imageIndexPromise=e)&&(i=this,e.then(function(e){var t;i._imageId===n&&i._image===a&&BoundingRectangle.equals(i._imageSubRegion,o)&&(t=r.textureCoordinates[e],i._imageWidth=r.texture.width*t.width,i._imageHeight=r.texture.height*t.height,i._imageIndex=e,i._ready=!0,i._image=void 0,i._imageIndexPromise=void 0,makeDirty$2(i,IMAGE_INDEX_INDEX$1))}).otherwise(function(e){console.error("Error loading image for billboard: "+e),i._imageIndexPromise=void 0}))},Billboard.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,defined(this._billboardCollection._textureAtlas)&&this._loadImage())},Billboard.prototype.setImageSubRegion=function(e,t){this._imageId===e&&BoundingRectangle.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=BoundingRectangle.clone(t),defined(this._billboardCollection._textureAtlas)&&this._loadImage())},Billboard.prototype._setTranslate=function(e){var t=this._translate;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),makeDirty$2(this,PIXEL_OFFSET_INDEX$1))},Billboard.prototype._getActualPosition=function(){return defined(this._clampedPosition)?this._clampedPosition:this._actualPosition},Billboard.prototype._setActualPosition=function(e){defined(this._clampedPosition)||Cartesian3.clone(e,this._actualPosition),makeDirty$2(this,POSITION_INDEX$5)};var tempCartesian3$1=new Cartesian4;Billboard._computeActualPosition=function(e,t,i,r){return defined(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===SceneMode$1.SCENE3D?t:(Matrix4.multiplyByPoint(r,t,tempCartesian3$1),SceneTransforms.computeActualWgs84Position(i,tempCartesian3$1))};var scratchCartesian3$4=new Cartesian3;Billboard._computeScreenSpacePosition=function(e,t,i,r,n,a){t=Matrix4.multiplyByPoint(e,t,scratchCartesian3$4),a=SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(n,t,i,a);if(defined(a))return Cartesian2.add(a,r,a),a};var scratchPixelOffset=new Cartesian2(0,0);Billboard.prototype.computeScreenSpacePosition=function(e,t){var i=this._billboardCollection;defined(t)||(t=new Cartesian2),Cartesian2.clone(this._pixelOffset,scratchPixelOffset),Cartesian2.add(scratchPixelOffset,this._translate,scratchPixelOffset);var r,n=i.modelMatrix,a=this._position;return defined(this._clampedPosition)&&(a=this._clampedPosition,e.mode!==SceneMode$1.SCENE3D&&(i=(r=e.mapProjection).ellipsoid,r=r.unproject(a,scratchCartographic$b),a=i.cartographicToCartesian(r,scratchCartesian3$4),n=Matrix4.IDENTITY)),Billboard._computeScreenSpacePosition(n,a,this._eyeOffset,scratchPixelOffset,e,t)},Billboard.getScreenSpaceBoundingBox=function(e,t,i){var r=e.width,n=e.height,a=e.scale;r*=a,n*=a;a=t.x;e.horizontalOrigin===HorizontalOrigin$1.RIGHT?a-=r:e.horizontalOrigin===HorizontalOrigin$1.CENTER&&(a-=.5*r);t=t.y;return e.verticalOrigin===VerticalOrigin$1.BOTTOM||e.verticalOrigin===VerticalOrigin$1.BASELINE?t-=n:e.verticalOrigin===VerticalOrigin$1.CENTER&&(t-=.5*n),(i=!defined(i)?new BoundingRectangle:i).x=a,i.y=t,i.width=r,i.height=n,i},Billboard.prototype.equals=function(e){return this===e||defined(e)&&this._id===e._id&&Cartesian3.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&&BoundingRectangle.equals(this._imageSubRegion,e._imageSubRegion)&&Color.equals(this._color,e._color)&&Cartesian2.equals(this._pixelOffset,e._pixelOffset)&&Cartesian2.equals(this._translate,e._translate)&&Cartesian3.equals(this._eyeOffset,e._eyeOffset)&&NearFarScalar.equals(this._scaleByDistance,e._scaleByDistance)&&NearFarScalar.equals(this._translucencyByDistance,e._translucencyByDistance)&&NearFarScalar.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&DistanceDisplayCondition.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},Billboard.prototype._destroy=function(){defined(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),defined(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var BlendOption={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},BlendOption$1=Object.freeze(BlendOption),SDFSettings={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},SDFSettings$1=Object.freeze(SDFSettings);function TextureAtlasNode(e,t,i,r,n){this.bottomLeft=defaultValue(e,Cartesian2.ZERO),this.topRight=defaultValue(t,Cartesian2.ZERO),this.childNode1=i,this.childNode2=r,this.imageIndex=n}var defaultInitialSize=new Cartesian2(16,16);function TextureAtlas(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.borderWidthInPixels,1),i=defaultValue(e.initialSize,defaultInitialSize);this._context=e.context,this._pixelFormat=defaultValue(e.pixelFormat,PixelFormat$1.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=createGuid(),this._idHash={},this._initialSize=i,this._root=void 0}function resizeAtlas(e,t){var i=e._context,r=e.numberOfImages,n=e._borderWidthInPixels;if(0<r){for(var a=e._texture.width,o=e._texture.height,s=2*(a+t.width+n),r=2*(o+t.height+n),l=a/s,c=o/r,a=new TextureAtlasNode(new Cartesian2(a+n,n),new Cartesian2(s,o)),a=new TextureAtlasNode(new Cartesian2,new Cartesian2(s,o),e._root,a),o=new TextureAtlasNode(new Cartesian2(n,o+n),new Cartesian2(s,r)),a=new TextureAtlasNode(new Cartesian2,new Cartesian2(s,r),a,o),u=0;u<e._textureCoordinates.length;u++){var d=e._textureCoordinates[u];defined(d)&&(d.x*=l,d.y*=c,d.width*=l,d.height*=c)}o=new Texture({context:e._context,width:s,height:r,pixelFormat:e._pixelFormat}),i=new Framebuffer({context:i,colorTextures:[e._texture],destroyAttachments:!1});i._bind(),o.copyFromFramebuffer(0,0,0,0,s,r),i._unBind(),i.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=o,e._root=a}else{a=2*(t.width+2*n),t=2*(t.height+2*n);a<e._initialSize.x&&(a=e._initialSize.x),t<e._initialSize.y&&(t=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Texture({context:e._context,width:a,height:t,pixelFormat:e._pixelFormat}),e._root=new TextureAtlasNode(new Cartesian2(n,n),new Cartesian2(a,t))}}function findNode(e,t,i){if(defined(t)){if(defined(t.childNode1)||defined(t.childNode2))return findNode(e,t.childNode1,i)||findNode(e,t.childNode2,i);if(!defined(t.imageIndex)){var r,n=t.topRight.x-t.bottomLeft.x,a=t.topRight.y-t.bottomLeft.y,n=n-i.width,a=a-i.height;return n<0||a<0?void 0:0==n&&0==a?t:(a<n?(t.childNode1=new TextureAtlasNode(new Cartesian2(t.bottomLeft.x,t.bottomLeft.y),new Cartesian2(t.bottomLeft.x+i.width,t.topRight.y)),(r=t.bottomLeft.x+i.width+e._borderWidthInPixels)<t.topRight.x&&(t.childNode2=new TextureAtlasNode(new Cartesian2(r,t.bottomLeft.y),new Cartesian2(t.topRight.x,t.topRight.y)))):(t.childNode1=new TextureAtlasNode(new Cartesian2(t.bottomLeft.x,t.bottomLeft.y),new Cartesian2(t.topRight.x,t.bottomLeft.y+i.height)),(r=t.bottomLeft.y+i.height+e._borderWidthInPixels)<t.topRight.y&&(t.childNode2=new TextureAtlasNode(new Cartesian2(t.bottomLeft.x,r),new Cartesian2(t.topRight.x,t.topRight.y)))),findNode(e,t.childNode1,i))}}}function addImage(e,t,i){var r,n,a,o,s,l,c=findNode(e,e._root,t);defined(c)?(c.imageIndex=i,r=e._texture.width,n=e._texture.height,a=c.topRight.x-c.bottomLeft.x,o=c.topRight.y-c.bottomLeft.y,s=c.bottomLeft.x/r,l=c.bottomLeft.y/n,e._textureCoordinates[i]=new BoundingRectangle(s,l,a/r,o/n),e._texture.copyFrom(t,c.bottomLeft.x,c.bottomLeft.y)):(resizeAtlas(e,t),addImage(e,t,i)),e._guid=createGuid()}Object.defineProperties(TextureAtlas.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return defined(this._texture)||(this._texture=new Texture({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}}}),TextureAtlas.prototype.addImage=function(e,t){if(defined(r=this._idHash[e]))return r;"function"==typeof t?t=t(e):("string"==typeof t||t instanceof Resource)&&(t=Resource.createIfNeeded(t).fetchImage());var i=this,r=when(t,function(e){if(i.isDestroyed())return-1;var t=i.numberOfImages;return addImage(i,e,t),t});return this._idHash[e]=r},TextureAtlas.prototype.addSubRegion=function(e,a){var t=this._idHash[e];if(!defined(t))throw new RuntimeError('image with id "'+e+'" not found in the atlas.');var o=this;return when(t,function(e){if(-1===e)return-1;var t=o._texture.width,i=o._texture.height,r=o.numberOfImages,n=o._textureCoordinates[e],e=n.x+a.x/t,n=n.y+a.y/i,t=a.width/t,i=a.height/i;return o._textureCoordinates.push(new BoundingRectangle(e,n,t,i)),o._guid=createGuid(),r})},TextureAtlas.prototype.isDestroyed=function(){return!1},TextureAtlas.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),destroyObject(this)};var SHOW_INDEX$4=Billboard.SHOW_INDEX,POSITION_INDEX$4=Billboard.POSITION_INDEX,PIXEL_OFFSET_INDEX=Billboard.PIXEL_OFFSET_INDEX,EYE_OFFSET_INDEX=Billboard.EYE_OFFSET_INDEX,HORIZONTAL_ORIGIN_INDEX=Billboard.HORIZONTAL_ORIGIN_INDEX,VERTICAL_ORIGIN_INDEX=Billboard.VERTICAL_ORIGIN_INDEX,SCALE_INDEX=Billboard.SCALE_INDEX,IMAGE_INDEX_INDEX=Billboard.IMAGE_INDEX_INDEX,COLOR_INDEX$2=Billboard.COLOR_INDEX,ROTATION_INDEX=Billboard.ROTATION_INDEX,ALIGNED_AXIS_INDEX=Billboard.ALIGNED_AXIS_INDEX,SCALE_BY_DISTANCE_INDEX$2=Billboard.SCALE_BY_DISTANCE_INDEX,TRANSLUCENCY_BY_DISTANCE_INDEX$2=Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,DISTANCE_DISPLAY_CONDITION_INDEX$2=Billboard.DISTANCE_DISPLAY_CONDITION,DISABLE_DEPTH_DISTANCE=Billboard.DISABLE_DEPTH_DISTANCE,TEXTURE_COORDINATE_BOUNDS=Billboard.TEXTURE_COORDINATE_BOUNDS,SDF_INDEX=Billboard.SDF_INDEX,NUMBER_OF_PROPERTIES$3=Billboard.NUMBER_OF_PROPERTIES,attributeLocations$5,attributeLocationsBatched={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},attributeLocationsInstanced={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},getIndexBuffer;function BillboardCollection(e){e=defaultValue(e,defaultValue.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(NUMBER_OF_PROPERTIES$3),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new BoundingSphere,this._baseVolumeWC=new BoundingSphere,this._baseVolume2D=new BoundingSphere,this._boundingVolume=new BoundingSphere,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=defaultValue(e.debugShowTextureAtlas,!1),this.blendOption=defaultValue(e.blendOption,BlendOption$1.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=SceneMode$1.SCENE3D,this._buffersUsage=[BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW],this._highlightColor=Color.clone(Color.WHITE);var t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};e=this._scene;defined(e)&&defined(e.terrainProviderChanged)&&(this._removeCallbackFunc=e.terrainProviderChanged.addEventListener(function(){for(var e=this._billboards,t=e.length,i=0;i<t;++i)defined(e[i])&&e[i]._updateClamping()},this))}function destroyBillboards(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function removeBillboards(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,a=0;n<r;++n){var o=i[n];o&&(o._index=a++,t.push(o))}e._billboards=t}}function getIndexBufferBatched(e){var t=e.cache.billboardCollection_indexBufferBatched;if(defined(t))return t;for(var i=new Uint16Array(98298),r=0,n=0;r<98298;r+=6,n+=4)i[r]=n,i[r+1]=n+1,i[r+2]=n+2,i[r+3]=n+0,i[r+4]=n+2,i[r+5]=n+3;return(t=Buffer$1.createIndexBuffer({context:e,typedArray:i,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT})).vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=t}function getIndexBufferInstanced(e){var t=e.cache.billboardCollection_indexBufferInstanced;return defined(t)?t:((t=Buffer$1.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT})).vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t)}function getVertexBufferInstanced(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return defined(t)?t:((t=Buffer$1.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:BufferUsage$1.STATIC_DRAW})).vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t)}function createVAF$1(e,t,i,r,n,a){var o=[{index:attributeLocations$5.positionHighAndScale,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[POSITION_INDEX$4]},{index:attributeLocations$5.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[POSITION_INDEX$4]},{index:attributeLocations$5.compressedAttribute0,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[PIXEL_OFFSET_INDEX]},{index:attributeLocations$5.compressedAttribute1,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[TRANSLUCENCY_BY_DISTANCE_INDEX$2]},{index:attributeLocations$5.compressedAttribute2,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[COLOR_INDEX$2]},{index:attributeLocations$5.eyeOffset,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[EYE_OFFSET_INDEX]},{index:attributeLocations$5.scaleByDistance,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[SCALE_BY_DISTANCE_INDEX$2]},{index:attributeLocations$5.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX]},{index:attributeLocations$5.compressedAttribute3,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[DISTANCE_DISPLAY_CONDITION_INDEX$2]},{index:attributeLocations$5.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[TEXTURE_COORDINATE_BOUNDS]}];return r&&o.push({index:attributeLocations$5.direction,componentsPerAttribute:2,componentDatatype:ComponentDatatype$1.FLOAT,vertexBuffer:getVertexBufferInstanced(e)}),defined(n)&&o.push({index:attributeLocations$5.a_batchId,componentsPerAttribute:1,componentDatatype:ComponentDatatype$1.FLOAT,bufferUsage:BufferUsage$1.STATIC_DRAW}),a&&o.push({index:attributeLocations$5.sdf,componentsPerAttribute:2,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[SDF_INDEX]}),new VertexArrayFacade(e,o,r?t:4*t,r)}Object.defineProperties(BillboardCollection.prototype,{length:{get:function(){return removeBillboards(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}}}),BillboardCollection.prototype.add=function(e){e=new Billboard(e,this);return e._index=this._billboards.length,this._billboards.push(e),this._createVertexArray=!0,e},BillboardCollection.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},BillboardCollection.prototype.removeAll=function(){destroyBillboards(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},BillboardCollection.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},BillboardCollection.prototype.contains=function(e){return defined(e)&&e._billboardCollection===this},BillboardCollection.prototype.get=function(e){return removeBillboards(this),this._billboards[e]},BillboardCollection.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<NUMBER_OF_PROPERTIES$3;++r){var n=0===i[r]?BufferUsage$1.STATIC_DRAW:BufferUsage$1.STREAM_DRAW,t=t||e[r]!==n;e[r]=n}return t};var writePositionScratch$1=new EncodedCartesian3;function writePositionScaleAndRotation(e,t,i,r,n){var a,o=r[attributeLocations$5.positionHighAndScale],s=r[attributeLocations$5.positionLowAndRotation],l=n._getActualPosition();e._mode===SceneMode$1.SCENE3D&&(BoundingSphere.expand(e._baseVolume,l,e._baseVolume),e._boundingVolumeDirty=!0),EncodedCartesian3.fromCartesian(l,writePositionScratch$1);var c=n.scale,u=n.rotation;0!==u&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);r=writePositionScratch$1.high,l=writePositionScratch$1.low;e._instanced?(o(a=n._index,r.x,r.y,r.z,c),s(a,l.x,l.y,l.z,u)):(o((a=4*n._index)+0,r.x,r.y,r.z,c),o(a+1,r.x,r.y,r.z,c),o(a+2,r.x,r.y,r.z,c),o(a+3,r.x,r.y,r.z,c),s(a+0,l.x,l.y,l.z,u),s(a+1,l.x,l.y,l.z,u),s(a+2,l.x,l.y,l.z,u),s(a+3,l.x,l.y,l.z,u))}var scratchCartesian2$3=new Cartesian2,UPPER_BOUND=32768,LEFT_SHIFT16$1=65536,LEFT_SHIFT12=4096,LEFT_SHIFT8$1=256,LEFT_SHIFT7=128,LEFT_SHIFT5=32,LEFT_SHIFT3=8,LEFT_SHIFT2=4,RIGHT_SHIFT8=1/256,LOWER_LEFT=0,LOWER_RIGHT=2,UPPER_RIGHT=3,UPPER_LEFT=1;function writeCompressedAttrib0$1(e,t,i,r,n){var a,o=r[attributeLocations$5.compressedAttribute0],s=n.pixelOffset,l=s.x,c=s.y,u=n._translate,d=u.x,h=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(l+d),Math.abs(-c+h));var p=n.horizontalOrigin,m=n._verticalOrigin,f=n.show&&n.clusterShow;0===n.color.alpha&&(f=!1),m===VerticalOrigin$1.BASELINE&&(m=VerticalOrigin$1.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===HorizontalOrigin$1.CENTER,e._allVerticalCenter=e._allVerticalCenter&&m===VerticalOrigin$1.CENTER;var g=0,_=0,r=0,s=0,u=n._imageIndex;-1!==u&&(g=(u=i[u]).x,_=u.y,r=u.width,s=u.height);r=g+r,s=_+s,l=Math.floor(CesiumMath.clamp(l,-UPPER_BOUND,UPPER_BOUND)+UPPER_BOUND)*LEFT_SHIFT7;l+=(p+1)*LEFT_SHIFT5,l+=(m+1)*LEFT_SHIFT3,l+=(f?1:0)*LEFT_SHIFT2;f=Math.floor(CesiumMath.clamp(c,-UPPER_BOUND,UPPER_BOUND)+UPPER_BOUND)*LEFT_SHIFT8$1,c=Math.floor(CesiumMath.clamp(d,-UPPER_BOUND,UPPER_BOUND)+UPPER_BOUND)*LEFT_SHIFT8$1,d=(CesiumMath.clamp(h,-UPPER_BOUND,UPPER_BOUND)+UPPER_BOUND)*RIGHT_SHIFT8,h=Math.floor(d);f+=h,c+=Math.floor((d-h)*LEFT_SHIFT8$1),scratchCartesian2$3.x=g,scratchCartesian2$3.y=_;_=AttributeCompression.compressTextureCoordinates(scratchCartesian2$3);scratchCartesian2$3.x=r;r=AttributeCompression.compressTextureCoordinates(scratchCartesian2$3);scratchCartesian2$3.y=s;s=AttributeCompression.compressTextureCoordinates(scratchCartesian2$3);scratchCartesian2$3.x=g;g=AttributeCompression.compressTextureCoordinates(scratchCartesian2$3);e._instanced?o(a=n._index,l,f,c,_):(o((a=4*n._index)+0,l+LOWER_LEFT,f,c,_),o(a+1,l+LOWER_RIGHT,f,c,r),o(a+2,l+UPPER_RIGHT,f,c,s),o(a+3,l+UPPER_LEFT,f,c,g))}function writeCompressedAttrib1$1(e,t,i,r,n){var a,o=r[attributeLocations$5.compressedAttribute1],s=n.alignedAxis;Cartesian3.equals(s,Cartesian3.ZERO)||(e._shaderAlignedAxis=!0);var l=0,c=1,u=1,d=1,h=n.translucencyByDistance;defined(h)&&(l=h.near,c=h.nearValue,u=h.far,d=h.farValue,1===c&&1===d||(e._shaderTranslucencyByDistance=!0));r=0,h=n._imageIndex;-1!==h&&(r=i[h].width);h=e._textureAtlas.texture.width,h=Math.round(defaultValue(n.width,h*r));e._maxSize=Math.max(e._maxSize,h);r=CesiumMath.clamp(h,0,LEFT_SHIFT16$1),h=0;Math.abs(Cartesian3.magnitudeSquared(s)-1)<CesiumMath.EPSILON6&&(h=AttributeCompression.octEncodeFloat(s)),c=CesiumMath.clamp(c,0,1),r=r*LEFT_SHIFT8$1+(c=1===c?255:255*c|0),d=CesiumMath.clamp(d,0,1),h=h*LEFT_SHIFT8$1+(d=1===d?255:255*d|0),e._instanced?o(a=n._index,r,h,l,u):(o((a=4*n._index)+0,r,h,l,u),o(a+1,r,h,l,u),o(a+2,r,h,l,u),o(a+3,r,h,l,u))}function writeCompressedAttrib2(e,t,i,r,n){var a,o=r[attributeLocations$5.compressedAttribute2],s=n.color,l=defined(e._batchTable)?Color.WHITE:n.getPickId(t.context).color,c=n.sizeInMeters?1:0,u=Math.abs(Cartesian3.magnitudeSquared(n.alignedAxis)-1)<CesiumMath.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1==c;var d=0,h=n._imageIndex;-1!==h&&(d=i[h].height);r=e._textureAtlas.texture.dimensions,t=Math.round(defaultValue(n.height,r.y*d));e._maxSize=Math.max(e._maxSize,t);i=defaultValue(n._labelHorizontalOrigin,-2),h=t*LEFT_SHIFT2+(i+=2),r=Color.floatToByte(s.red),d=Color.floatToByte(s.green),t=Color.floatToByte(s.blue),i=r*LEFT_SHIFT16$1+d*LEFT_SHIFT8$1+t,r=Color.floatToByte(l.red),d=Color.floatToByte(l.green),t=Color.floatToByte(l.blue),t=r*LEFT_SHIFT16$1+d*LEFT_SHIFT8$1+t,l=Color.floatToByte(s.alpha)*LEFT_SHIFT16$1+Color.floatToByte(l.alpha)*LEFT_SHIFT8$1;l+=2*c+u,e._instanced?o(a=n._index,i,t,l,h):(o((a=4*n._index)+0,i,t,l,h),o(a+1,i,t,l,h),o(a+2,i,t,l,h),o(a+3,i,t,l,h))}function writeEyeOffset(e,t,i,r,n){var a,o=r[attributeLocations$5.eyeOffset],s=n.eyeOffset,l=s.z;n._heightReference!==HeightReference$1.NONE&&(l*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(l)),e._instanced?(a=r=0,-1!==(e=n._imageIndex)&&(r=(e=i[e]).width,a=e.height),scratchCartesian2$3.x=r,scratchCartesian2$3.y=a,r=AttributeCompression.compressTextureCoordinates(scratchCartesian2$3),o(a=n._index,s.x,s.y,l,r)):(o((a=4*n._index)+0,s.x,s.y,l,0),o(a+1,s.x,s.y,l,0),o(a+2,s.x,s.y,l,0),o(a+3,s.x,s.y,l,0))}function writeScaleByDistance$1(e,t,i,r,n){var a,o=r[attributeLocations$5.scaleByDistance],s=0,l=1,c=1,u=1,r=n.scaleByDistance;defined(r)&&(s=r.near,l=r.nearValue,c=r.far,u=r.farValue,1===l&&1===u||(e._shaderScaleByDistance=!0)),e._instanced?o(a=n._index,s,l,c,u):(o((a=4*n._index)+0,s,l,c,u),o(a+1,s,l,c,u),o(a+2,s,l,c,u),o(a+3,s,l,c,u))}function writePixelOffsetScaleByDistance(e,t,i,r,n){var a,o=r[attributeLocations$5.pixelOffsetScaleByDistance],s=0,l=1,c=1,u=1,r=n.pixelOffsetScaleByDistance;defined(r)&&(s=r.near,l=r.nearValue,c=r.far,u=r.farValue,1===l&&1===u||(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?o(a=n._index,s,l,c,u):(o((a=4*n._index)+0,s,l,c,u),o(a+1,s,l,c,u),o(a+2,s,l,c,u),o(a+3,s,l,c,u))}function writeCompressedAttribute3(e,t,i,r,n){var a,o=r[attributeLocations$5.compressedAttribute3],s=0,l=Number.MAX_VALUE,c=n.distanceDisplayCondition;defined(c)&&(s=c.near,l=c.far,s*=s,l*=l,e._shaderDistanceDisplayCondition=!0);var u=n.disableDepthTestDistance,r=n.heightReference===HeightReference$1.CLAMP_TO_GROUND&&t.context.depthTexture;defined(u)||(u=r?5e3:0),u*=u,(r||0<u)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),defined(n._labelDimensions)?(d=n._labelDimensions.x,h=n._labelDimensions.y):(t=c=0,-1!==(r=n._imageIndex)&&(c=(r=i[r]).height,t=r.width),h=Math.round(defaultValue(n.height,e._textureAtlas.texture.dimensions.y*c)),c=e._textureAtlas.texture.width,d=Math.round(defaultValue(n.width,c*t)));var d=Math.floor(CesiumMath.clamp(d,0,LEFT_SHIFT12)),h=Math.floor(CesiumMath.clamp(h,0,LEFT_SHIFT12)),h=d*LEFT_SHIFT12+h;e._instanced?o(a=n._index,s,l,u,h):(o((a=4*n._index)+0,s,l,u,h),o(a+1,s,l,u,h),o(a+2,s,l,u,h),o(a+3,s,l,u,h))}function writeTextureCoordinateBoundsOrLabelTranslate(e,t,i,r,n){var a;n.heightReference===HeightReference$1.CLAMP_TO_GROUND&&(u=e._scene,o=t.context,c=t.globeTranslucencyState.translucent,u=defined(u.globe)&&u.globe.depthTestAgainstTerrain,e._shaderClampToGround=o.depthTexture&&!c&&u);var o=r[attributeLocations$5.textureCoordinateBoundsOrLabelTranslate];if(0<ContextLimits.maximumVertexTextureImageUnits){var s=0,l=0;return defined(n._labelTranslate)&&(s=n._labelTranslate.x,l=n._labelTranslate.y),void(e._instanced?o(a=n._index,s,l,0,0):(o((a=4*n._index)+0,s,l,0,0),o(a+1,s,l,0,0),o(a+2,s,l,0,0),o(a+3,s,l,0,0)))}var c=0,u=0,r=0,s=0,l=n._imageIndex;-1!==l&&(c=(l=i[l]).x,u=l.y,r=l.width,s=l.height);r=c+r,s=u+s;e._instanced?o(a=n._index,c,u,r,s):(o((a=4*n._index)+0,c,u,r,s),o(a+1,c,u,r,s),o(a+2,c,u,r,s),o(a+3,c,u,r,s))}function writeBatchId(e,t,i,r,n){var a,o;defined(e._batchTable)&&(a=r[attributeLocations$5.a_batchId],r=n._batchIndex,e._instanced?a(o=n._index,r):(a((o=4*n._index)+0,r),a(o+1,r),a(o+2,r),a(o+3,r)))}function writeSDF(e,t,i,r,n){var a,o,s,l,c,u;e._sdf&&(o=r[attributeLocations$5.sdf],s=n.outlineColor,u=n.outlineWidth,l=Color.floatToByte(s.red),c=Color.floatToByte(s.green),r=Color.floatToByte(s.blue),r=l*LEFT_SHIFT16$1+c*LEFT_SHIFT8$1+r,u=u/SDFSettings$1.RADIUS,u=Color.floatToByte(s.alpha)*LEFT_SHIFT16$1+Color.floatToByte(u)*LEFT_SHIFT8$1,e._instanced?o(a=n._index,r,u):(o((a=4*n._index)+0,r+LOWER_LEFT,u),o(a+1,r+LOWER_RIGHT,u),o(a+2,r+UPPER_RIGHT,u),o(a+3,r+UPPER_LEFT,u)))}function writeBillboard(e,t,i,r,n){writePositionScaleAndRotation(e,t,i,r,n),writeCompressedAttrib0$1(e,t,i,r,n),writeCompressedAttrib1$1(e,t,i,r,n),writeCompressedAttrib2(e,t,i,r,n),writeEyeOffset(e,t,i,r,n),writeScaleByDistance$1(e,t,i,r,n),writePixelOffsetScaleByDistance(e,t,i,r,n),writeCompressedAttribute3(e,t,i,r,n),writeTextureCoordinateBoundsOrLabelTranslate(e,t,i,r,n),writeBatchId(e,t,i,r,n),writeSDF(e,t,i,r,n)}function recomputeActualPositions$1(e,t,i,r,n,a){var o;r.mode===SceneMode$1.SCENE3D?(o=e._baseVolume,e._boundingVolumeDirty=!0):o=e._baseVolume2D;for(var s=[],l=0;l<i;++l){var c=t[l],u=c.position,u=Billboard._computeActualPosition(c,u,r,n);defined(u)&&(c._setActualPosition(u),a?s.push(u):BoundingSphere.expand(o,u,o))}a&&BoundingSphere.fromPoints(s,o)}function updateMode$2(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,a=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==SceneMode$1.SCENE3D&&!Matrix4.equals(a,e.modelMatrix)?(e._mode=i,Matrix4.clone(e.modelMatrix,a),e._createVertexArray=!0,i!==SceneMode$1.SCENE3D&&i!==SceneMode$1.SCENE2D&&i!==SceneMode$1.COLUMBUS_VIEW||recomputeActualPositions$1(e,r,r.length,t,a,!0)):i===SceneMode$1.MORPHING?recomputeActualPositions$1(e,r,r.length,t,a,!0):i!==SceneMode$1.SCENE2D&&i!==SceneMode$1.COLUMBUS_VIEW||recomputeActualPositions$1(e,n,e._billboardsToUpdateIndex,t,a,!1)}function updateBoundingVolume$1(e,t,i){var r=1,t=(r=!e._allSizedInMeters||0!==e._maxPixelOffset?t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight):r)*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(t*=.5);e=r*e._maxPixelOffset+e._maxEyeOffset;i.radius+=t+e}function createDebugCommand(e,t){t=t.createViewportQuadCommand("uniform sampler2D billboard_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n gl_FragColor = texture2D(billboard_texture, v_textureCoordinates); \n} \n",{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return t.pass=Pass$1.OVERLAY,t}var scratchWriterArray$1=[];function createBillboardPointCallback(r,n,a,o,s){return function(){var e=document.createElement("canvas"),t=s+2*o;e.height=e.width=t;var i=e.getContext("2d");return i.clearRect(0,0,t,t),0!==o&&(i.beginPath(),i.arc(t/2,t/2,t/2,0,2*Math.PI,!0),i.closePath(),i.fillStyle=a,i.fill(),r<1&&(i.save(),i.globalCompositeOperation="destination-out",i.beginPath(),i.arc(t/2,t/2,s/2,0,2*Math.PI,!0),i.closePath(),i.fillStyle="black",i.fill(),i.restore())),i.beginPath(),i.arc(t/2,t/2,s/2,0,2*Math.PI,!0),i.closePath(),i.fillStyle=n,i.fill(),e}}function Cesium3DTilePointFeature(e,t,i,r,n){this._content=e,this._billboard=i,this._label=r,this._polyline=n,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),setBillboardImage(this)}BillboardCollection.prototype.update=function(e){if(removeBillboards(this),this.show){var t=(o=this._billboards).length,i=e.context;if(this._instanced=i.instancedArrays,attributeLocations$5=this._instanced?attributeLocationsInstanced:attributeLocationsBatched,getIndexBuffer=this._instanced?getIndexBufferInstanced:getIndexBufferBatched,!defined(r=this._textureAtlas))for(var r=this._textureAtlas=new TextureAtlas({context:i}),n=0;n<t;++n)o[n]._loadImage();var a=r.textureCoordinates;if(0!==a.length){updateMode$2(this,e);var o,t=(o=this._billboards).length,s=this._billboardsToUpdate,l=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,d=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;var h=e.passes,p=h.pick;if(d||!p&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var m=0;m<NUMBER_OF_PROPERTIES$3;++m)c[m]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),0<t){this._vaf=createVAF$1(i,t,this._buffersUsage,this._instanced,this._batchTable,this._sdf);for(var f=this._vaf.writers,g=0;g<t;++g){var _=this._billboards[g];_._dirty=!1,writeBillboard(this,e,a,f,_)}this._vaf.commit(getIndexBuffer(i))}this._billboardsToUpdateIndex=0}else if(0<l){var y=scratchWriterArray$1;y.length=0,(c[POSITION_INDEX$4]||c[ROTATION_INDEX]||c[SCALE_INDEX])&&y.push(writePositionScaleAndRotation),(c[IMAGE_INDEX_INDEX]||c[PIXEL_OFFSET_INDEX]||c[HORIZONTAL_ORIGIN_INDEX]||c[VERTICAL_ORIGIN_INDEX]||c[SHOW_INDEX$4])&&(y.push(writeCompressedAttrib0$1),this._instanced&&y.push(writeEyeOffset)),(c[IMAGE_INDEX_INDEX]||c[ALIGNED_AXIS_INDEX]||c[TRANSLUCENCY_BY_DISTANCE_INDEX$2])&&(y.push(writeCompressedAttrib1$1),y.push(writeCompressedAttrib2)),(c[IMAGE_INDEX_INDEX]||c[COLOR_INDEX$2])&&y.push(writeCompressedAttrib2),c[EYE_OFFSET_INDEX]&&y.push(writeEyeOffset),c[SCALE_BY_DISTANCE_INDEX$2]&&y.push(writeScaleByDistance$1),c[PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX]&&y.push(writePixelOffsetScaleByDistance),(c[DISTANCE_DISPLAY_CONDITION_INDEX$2]||c[DISABLE_DEPTH_DISTANCE]||c[IMAGE_INDEX_INDEX]||c[POSITION_INDEX$4])&&y.push(writeCompressedAttribute3),(c[IMAGE_INDEX_INDEX]||c[POSITION_INDEX$4])&&y.push(writeTextureCoordinateBoundsOrLabelTranslate),c[SDF_INDEX]&&y.push(writeSDF);var C=y.length;if(f=this._vaf.writers,.1<l/t){for(var v=0;v<l;++v){var S=s[v];S._dirty=!1;for(var T=0;T<C;++T)y[T](this,e,a,f,S)}this._vaf.commit(getIndexBuffer(i))}else{for(var x=0;x<l;++x){var b=s[x];b._dirty=!1;for(var E=0;E<C;++E)y[E](this,e,a,f,b);this._instanced?this._vaf.subCommit(b._index,1):this._vaf.subCommit(4*b._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(1.5*t<l&&(s.length=t),defined(this._vaf)&&defined(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,BoundingSphere.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var P,A=Matrix4.IDENTITY;updateBoundingVolume$1(this,e,P=e.mode===SceneMode$1.SCENE3D?(A=this.modelMatrix,BoundingSphere.clone(this._baseVolumeWC,this._boundingVolume)):BoundingSphere.clone(this._baseVolume2D,this._boundingVolume));var w,r=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,r&&(this._blendOption===BlendOption$1.OPAQUE||this._blendOption===BlendOption$1.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=RenderState.fromCache({depthTest:{enabled:!0,func:WebGLConstants$1.LESS},depthMask:!0}):this._rsOpaque=void 0,D=this._blendOption===BlendOption$1.TRANSLUCENT,this._blendOption===BlendOption$1.TRANSLUCENT||this._blendOption===BlendOption$1.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=RenderState.fromCache({depthTest:{enabled:!0,func:D?WebGLConstants$1.LEQUAL:WebGLConstants$1.LESS},depthMask:D,blending:BlendingState$1.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance;var D,u=0<ContextLimits.maximumVertexTextureImageUnits;!r&&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||(d=BillboardCollectionVS,p=BillboardCollectionFS,D=[],defined(this._batchTable)&&(D.push("VECTOR_TILE"),d=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(d),p=this._batchTable.getFragmentShaderCallback(!1,void 0)(p)),r=new ShaderSource({defines:D,sources:[d]}),this._instanced&&r.defines.push("INSTANCED"),this._shaderRotation&&r.defines.push("ROTATION"),this._shaderAlignedAxis&&r.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&r.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&r.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&r.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&r.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&r.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(u?r.defines.push("VERTEX_DEPTH_CHECK"):r.defines.push("FRAGMENT_DEPTH_CHECK")),D=1-SDFSettings$1.CUTOFF,this._sdf&&r.defines.push("SDF"),d=defined(this._batchTable)?"VECTOR_TILE":"",this._blendOption===BlendOption$1.OPAQUE_AND_TRANSLUCENT&&(w=new ShaderSource({defines:["OPAQUE",d],sources:[p]}),this._shaderClampToGround&&(u?w.defines.push("VERTEX_DEPTH_CHECK"):w.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(w.defines.push("SDF"),w.defines.push("SDF_EDGE "+D)),this._sp=ShaderProgram.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:r,fragmentShaderSource:w,attributeLocations:attributeLocations$5}),w=new ShaderSource({defines:["TRANSLUCENT",d],sources:[p]}),this._shaderClampToGround&&(u?w.defines.push("VERTEX_DEPTH_CHECK"):w.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(w.defines.push("SDF"),w.defines.push("SDF_EDGE "+D)),this._spTranslucent=ShaderProgram.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:r,fragmentShaderSource:w,attributeLocations:attributeLocations$5})),this._blendOption===BlendOption$1.OPAQUE&&(w=new ShaderSource({defines:[d],sources:[p]}),this._shaderClampToGround&&(u?w.defines.push("VERTEX_DEPTH_CHECK"):w.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(w.defines.push("SDF"),w.defines.push("SDF_EDGE "+D)),this._sp=ShaderProgram.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:r,fragmentShaderSource:w,attributeLocations:attributeLocations$5})),this._blendOption===BlendOption$1.TRANSLUCENT&&(w=new ShaderSource({defines:[d],sources:[p]}),this._shaderClampToGround&&(u?w.defines.push("VERTEX_DEPTH_CHECK"):w.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(w.defines.push("SDF"),w.defines.push("SDF_EDGE "+D)),this._spTranslucent=ShaderProgram.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:r,fragmentShaderSource:w,attributeLocations:attributeLocations$5})),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);var M=e.commandList;if(h.render||h.pick){var I=this._colorCommands,R=this._blendOption===BlendOption$1.OPAQUE,O=this._blendOption===BlendOption$1.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,h=L.length,F=this._uniforms,N=defined(this._batchTable)?(F=this._batchTable.getUniformMapCallback()(F),this._batchTable.getPickId()):"v_pickColor";I.length=h;for(var B=O?2*h:h,V=0;V<B;++V){var k=I[V],z=R||O&&V%2==0;(k=!defined(k)?I[V]=new DrawCommand:k).pass=z||!O?Pass$1.OPAQUE:Pass$1.TRANSLUCENT,k.owner=this;var $=O?Math.floor(V/2):V;k.boundingVolume=P,k.modelMatrix=A,k.count=L[$].indicesCount,k.shaderProgram=z?this._sp:this._spTranslucent,k.uniformMap=F,k.vertexArray=L[$].va,k.renderState=z?this._rsOpaque:this._rsTranslucent,k.debugShowBoundingVolume=this.debugShowBoundingVolume,k.pickId=N,this._instanced&&(k.count=6,k.instanceCount=t),M.push(k)}this.debugShowTextureAtlas&&(defined(this.debugCommand)||(this.debugCommand=createDebugCommand(this,e.context)),M.push(this.debugCommand))}}}}},BillboardCollection.prototype.isDestroyed=function(){return!1},BillboardCollection.prototype.destroy=function(){return defined(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(),destroyBillboards(this._billboards),destroyObject(this)};var scratchCartographic$a=new Cartographic;function setBillboardImage(e){var t,i,r,n,a,o,s,l,c=e._billboard;defined(e._billboardImage)&&e._billboardImage!==c.image?c.image=e._billboardImage:defined(e._billboardImage)||(s=defaultValue(e._color,Cesium3DTilePointFeature.defaultColor),l=defaultValue(e._pointOutlineColor,Cesium3DTilePointFeature.defaultPointOutlineColor),t=defaultValue(e._pointOutlineWidth,Cesium3DTilePointFeature.defaultPointOutlineWidth),i=defaultValue(e._pointSize,Cesium3DTilePointFeature.defaultPointSize),r=e._billboardColor,n=e._billboardOutlineColor,a=e._billboardOutlineWidth,o=e._billboardSize,Color.equals(s,r)&&Color.equals(l,n)&&t===a&&i===o||(e._billboardColor=Color.clone(s,e._billboardColor),e._billboardOutlineColor=Color.clone(l,e._billboardOutlineColor),e._billboardOutlineWidth=t,e._billboardSize=i,o=s.alpha,e=s.toCssColorString(),s=l.toCssColorString(),l=JSON.stringify([e,i,s,t]),c.setImage(l,createBillboardPointCallback(o,e,s,t,i))))}Object.defineProperties(Cesium3DTilePointFeature.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=Color.clone(e,this._color),setBillboardImage(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,setBillboardImage(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Color.clone(e,this._pointOutlineColor),setBillboardImage(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,setBillboardImage(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&0<e.alpha}},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){defined(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){var t=defaultValue(this._heightOffset,0),i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,scratchCartographic$a);r.height=r.height-t+e;r=i.cartographicToCartesian(r);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],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=Color.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){var t=this._billboardImage!==e;this._billboardImage=e,t&&setBillboardImage(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(){var e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}}),Cesium3DTilePointFeature.defaultColor=Color.WHITE,Cesium3DTilePointFeature.defaultPointOutlineColor=Color.BLACK,Cesium3DTilePointFeature.defaultPointOutlineWidth=0,Cesium3DTilePointFeature.defaultPointSize=8,Cesium3DTilePointFeature.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},Cesium3DTilePointFeature.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},Cesium3DTilePointFeature.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},Cesium3DTilePointFeature.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},Cesium3DTilePointFeature.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},Cesium3DTilePointFeature.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},Cesium3DTilePointFeature.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var INF=1e20;function clamp(e,t,i){return t<i?e<t?t:i<e?i:e:e<i?i:t<e?t:e}function calcSDF(e,t){var i,r,n,a,o,s=null==(t=t||{}).cutoff?.25:t.cutoff,l=null==t.radius?8:t.radius,c=t.channel||0;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");i=t.width,r=t.height,n=e,o=t.stride||Math.floor(e.length/i/r)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(h=(m=e).getContext("2d"),i=m.width,r=m.height,n=(p=h.getImageData(0,0,i,r)).data,o=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(i=(m=e.canvas).width,r=m.height,n=(p=(h=e).getImageData(0,0,i,r)).data,o=4):window.ImageData&&e instanceof window.ImageData&&(i=(p=e).width,r=e.height,n=p.data,o=4);if(m=Math.max(i,r),window.Uint8ClampedArray&&n instanceof window.Uint8ClampedArray||window.Uint8Array&&n instanceof window.Uint8Array)for(a=n,n=Array(i*r),f=0,g=a.length;f<g;f++)n[f]=a[f*o+c]/255;else if(1!==o)throw Error("Raw data can have only 1 value per pixel");for(var u=Array(i*r),d=Array(i*r),h=Array(m),e=Array(m),p=Array(m+1),m=Array(m),f=0,g=i*r;f<g;f++){var _=n[f];u[f]=1===_?0:0===_?INF:Math.pow(Math.max(0,.5-_),2),d[f]=1===_?INF:0===_?0:Math.pow(Math.max(0,_-.5),2)}edt(u,i,r,h,e,m,p),edt(d,i,r,h,e,m,p);var y=new(window.Float32Array?Float32Array:Array)(i*r);for(f=0,g=i*r;f<g;f++)y[f]=clamp(1-((u[f]-d[f])/l+s),0,1);return y}function edt(e,t,i,r,n,a,o){for(var s=0;s<t;s++){for(var l=0;l<i;l++)r[l]=e[l*t+s];for(edt1d(r,n,a,o,i),l=0;l<i;l++)e[l*t+s]=n[l]}for(l=0;l<i;l++){for(s=0;s<t;s++)r[s]=e[l*t+s];for(edt1d(r,n,a,o,t),s=0;s<t;s++)e[l*t+s]=Math.sqrt(n[s])}}function edt1d(e,t,i,r,n){r[i[0]=0]=-INF,r[1]=+INF;for(var a=1,o=0;a<n;a++){for(var s=(e[a]+a*a-(e[i[o]]+i[o]*i[o]))/(2*a-2*i[o]);s<=r[o];)o--,s=(e[a]+a*a-(e[i[o]]+i[o]*i[o]))/(2*a-2*i[o]);i[++o]=a,r[o]=s,r[o+1]=+INF}for(o=a=0;a<n;a++){for(;r[o+1]<a;)o++;t[a]=(a-i[o])*(a-i[o])+e[i[o]]}}var LabelStyle={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},LabelStyle$1=Object.freeze(LabelStyle),fontInfoCache={},fontInfoCacheLength=0,fontInfoCacheMaxSize=256,defaultBackgroundColor$2=new Color(.165,.165,.165,.8),defaultBackgroundPadding$1=new Cartesian2(7,5),textTypes=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function rebindAllGlyphs$1(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function repositionAllGlyphs$1(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function getCSSValue(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function parseFont(e){var t,i,r=fontInfoCache[e._font];defined(r)||((t=document.createElement("div")).style.position="absolute",t.style.opacity=0,t.style.font=e._font,document.body.appendChild(t),i=parseFloat(getCSSValue(t,"line-height")),isNaN(i)&&(i=void 0),r={family:getCSSValue(t,"font-family"),size:getCSSValue(t,"font-size").replace("px",""),style:getCSSValue(t,"font-style"),weight:getCSSValue(t,"font-weight"),lineHeight:i},document.body.removeChild(t),fontInfoCacheLength<fontInfoCacheMaxSize&&(fontInfoCache[e._font]=r,fontInfoCacheLength++)),e._fontFamily=r.family,e._fontSize=r.size,e._fontStyle=r.style,e._fontWeight=r.weight,e._lineHeight=r.lineHeight}function Label(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucencyByDistance,r=e.pixelOffsetScaleByDistance,n=e.scaleByDistance,a=e.distanceDisplayCondition;defined(i)&&(i=NearFarScalar.clone(i)),defined(r)&&(r=NearFarScalar.clone(r)),defined(n)&&(n=NearFarScalar.clone(n)),defined(a)&&(a=DistanceDisplayCondition.clone(a)),this._renderedText=void 0,this._text=void 0,this._show=defaultValue(e.show,!0),this._font=defaultValue(e.font,"30px sans-serif"),this._fillColor=Color.clone(defaultValue(e.fillColor,Color.WHITE)),this._outlineColor=Color.clone(defaultValue(e.outlineColor,Color.BLACK)),this._outlineWidth=defaultValue(e.outlineWidth,1),this._showBackground=defaultValue(e.showBackground,!1),this._backgroundColor=Color.clone(defaultValue(e.backgroundColor,defaultBackgroundColor$2)),this._backgroundPadding=Cartesian2.clone(defaultValue(e.backgroundPadding,defaultBackgroundPadding$1)),this._style=defaultValue(e.style,LabelStyle$1.FILL),this._verticalOrigin=defaultValue(e.verticalOrigin,VerticalOrigin$1.BASELINE),this._horizontalOrigin=defaultValue(e.horizontalOrigin,HorizontalOrigin$1.LEFT),this._pixelOffset=Cartesian2.clone(defaultValue(e.pixelOffset,Cartesian2.ZERO)),this._eyeOffset=Cartesian3.clone(defaultValue(e.eyeOffset,Cartesian3.ZERO)),this._position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this._scale=defaultValue(e.scale,1),this._id=e.id,this._translucencyByDistance=i,this._pixelOffsetScaleByDistance=r,this._scaleByDistance=n,this._heightReference=defaultValue(e.heightReference,HeightReference$1.NONE),this._distanceDisplayCondition=a,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=defaultValue(e.text,""),this._relativeSize=1,parseFont(this),this._updateClamping()}function convertTextToTypes(e,t){for(var i=/[a-zA-Z0-9]/,r=/[()[\]{}<>]/,n=[],a="",o=textTypes.LTR,s="",l=e.length,c=0;c<l;++c){var u=e.charAt(c),s=t.test(u)?textTypes.RTL:i.test(u)?textTypes.LTR:r.test(u)?textTypes.BRACKETS:textTypes.WEAK;(o=0===c?s:o)===s&&s!==textTypes.BRACKETS?a+=u:(""!==a&&n.push({Type:o,Word:a}),o=s,a=u)}return n.push({Type:s,Word:a}),n}function reverseWord(e){return e.split("").reverse().join("")}function spliceWord(e,t,i){return e.slice(0,t)+i+e.slice(t)}function reverseBrackets(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}Object.defineProperties(Label.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;defined(n)&&(n.show=e)}var a=this._backgroundBillboard;defined(a)&&(a.show=e)}}},position:{get:function(){return this._position},set:function(e){var t=this._position;if(!Cartesian3.equals(t,e)){Cartesian3.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r].billboard;defined(a)&&(a.position=e)}t=this._backgroundBillboard;defined(t)&&(t.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;defined(n)&&(n.heightReference=e)}var a=this._backgroundBillboard;defined(a)&&(a.heightReference=e),repositionAllGlyphs$1(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._renderedText=Label.enableRightToLeftDetection?reverseRtl(e):e,rebindAllGlyphs$1(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,rebindAllGlyphs$1(this),parseFont(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;Color.equals(t,e)||(Color.clone(e,t),rebindAllGlyphs$1(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;Color.equals(t,e)||(Color.clone(e,t),rebindAllGlyphs$1(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,rebindAllGlyphs$1(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,rebindAllGlyphs$1(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){var t=this._backgroundColor;Color.equals(t,e)||(Color.clone(e,t),defined(e=this._backgroundBillboard)&&(e.color=t))}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){var t=this._backgroundPadding;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),repositionAllGlyphs$1(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,rebindAllGlyphs$1(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var t=this._pixelOffset;if(!Cartesian2.equals(t,e)){Cartesian2.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];defined(a.billboard)&&(a.billboard.pixelOffset=e)}t=this._backgroundBillboard;defined(t)&&(t.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!NearFarScalar.equals(t,e)){this._translucencyByDistance=NearFarScalar.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];defined(a.billboard)&&(a.billboard.translucencyByDistance=e)}t=this._backgroundBillboard;defined(t)&&(t.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!NearFarScalar.equals(t,e)){this._pixelOffsetScaleByDistance=NearFarScalar.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];defined(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}t=this._backgroundBillboard;defined(t)&&(t.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;if(!NearFarScalar.equals(t,e)){this._scaleByDistance=NearFarScalar.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];defined(a.billboard)&&(a.billboard.scaleByDistance=e)}t=this._backgroundBillboard;defined(t)&&(t.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;if(!Cartesian3.equals(t,e)){Cartesian3.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];defined(a.billboard)&&(a.billboard.eyeOffset=e)}t=this._backgroundBillboard;defined(t)&&(t.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,repositionAllGlyphs$1(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];defined(n.billboard)&&(n.billboard.verticalOrigin=e)}var a=this._backgroundBillboard;defined(a)&&(a.verticalOrigin=e),repositionAllGlyphs$1(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];defined(n.billboard)&&(n.billboard.scale=e*this._relativeSize)}var a=this._backgroundBillboard;defined(a)&&(a.scale=e*this._relativeSize),repositionAllGlyphs$1(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!DistanceDisplayCondition.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition);for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];defined(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}var a=this._backgroundBillboard;defined(a)&&(a.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];defined(n.billboard)&&(n.billboard.disableDepthTestDistance=e)}var a=this._backgroundBillboard;defined(a)&&(a.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];defined(n.billboard)&&(n.billboard.id=e)}var a=this._backgroundBillboard;defined(a)&&(a.id=e)}}},pickId:{get:function(){if(0!==this._glyphs.length&&defined(this._glyphs[0].billboard))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Cartesian3.clone(e,this._actualClampedPosition);for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];defined(n.billboard)&&(n.billboard._clampedPosition=e)}var a=this._backgroundBillboard;defined(a)&&(a._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];defined(n.billboard)&&(n.billboard.clusterShow=e)}var a=this._backgroundBillboard;defined(a)&&(a.clusterShow=e)}}}}),Label.prototype._updateClamping=function(){Billboard._updateClamping(this._labelCollection,this)},Label.prototype.computeScreenSpacePosition=function(e,t){defined(t)||(t=new Cartesian2);var i=this._labelCollection.modelMatrix,r=defined(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Billboard._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)},Label.getScreenSpaceBoundingBox=function(e,t,i){var r=0,n=0,a=0,o=0,s=e.totalScale,l=e._backgroundBillboard;if(defined(l))r=t.x+l._translate.x,n=t.y-l._translate.y,a=l.width*s,o=l.height*s,e.verticalOrigin===VerticalOrigin$1.BOTTOM||e.verticalOrigin===VerticalOrigin$1.BASELINE?n-=o:e.verticalOrigin===VerticalOrigin$1.CENTER&&(n-=.5*o);else{for(var r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,c=0,u=0,d=e._glyphs,h=d.length,p=0;p<h;++p){var m,f,g=d[p],_=g.billboard;defined(_)&&(m=t.x+_._translate.x,f=t.y-_._translate.y,_=g.dimensions.width*s,g=g.dimensions.height*s,e.verticalOrigin===VerticalOrigin$1.BOTTOM||e.verticalOrigin===VerticalOrigin$1.BASELINE?f-=g:e.verticalOrigin===VerticalOrigin$1.CENTER&&(f-=.5*g),e._verticalOrigin===VerticalOrigin$1.TOP?f+=SDFSettings$1.PADDING*s:e._verticalOrigin!==VerticalOrigin$1.BOTTOM&&e._verticalOrigin!==VerticalOrigin$1.BASELINE||(f-=SDFSettings$1.PADDING*s),r=Math.min(r,m),n=Math.min(n,f),c=Math.max(c,m+_),u=Math.max(u,f+g))}a=c-r,o=u-n}return(i=!defined(i)?new BoundingRectangle:i).x=r,i.y=n,i.width=a,i.height=o,i},Label.prototype.equals=function(e){return this===e||defined(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&&Cartesian3.equals(this._position,e._position)&&Color.equals(this._fillColor,e._fillColor)&&Color.equals(this._outlineColor,e._outlineColor)&&Color.equals(this._backgroundColor,e._backgroundColor)&&Cartesian2.equals(this._backgroundPadding,e._backgroundPadding)&&Cartesian2.equals(this._pixelOffset,e._pixelOffset)&&Cartesian3.equals(this._eyeOffset,e._eyeOffset)&&NearFarScalar.equals(this._translucencyByDistance,e._translucencyByDistance)&&NearFarScalar.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&NearFarScalar.equals(this._scaleByDistance,e._scaleByDistance)&&DistanceDisplayCondition.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},Label.prototype.isDestroyed=function(){return!1},Label.enableRightToLeftDetection=!1;var hebrew="א-ת",arabic="؀-ۿݐ-ݿࢠ-ࣿ",rtlChars=new RegExp("["+hebrew+arabic+"]");function reverseRtl(e){for(var t=e.split("\n"),i="",r=0;r<t.length;r++){for(var n=t[r],a=rtlChars.test(n.charAt(0)),o=convertTextToTypes(n,rtlChars),s=0,l="",c=0;c<o.length;++c){var u=o[c],d=(u.Type===textTypes.BRACKETS?reverseBrackets:reverseWord)(u.Word);a?u.Type===textTypes.RTL?(l=d+l,s=0):u.Type===textTypes.LTR?(l=spliceWord(l,s,u.Word),s+=u.Word.length):u.Type!==textTypes.WEAK&&u.Type!==textTypes.BRACKETS||(u.Type===textTypes.WEAK&&o[c-1].Type===textTypes.BRACKETS?l=d+l:o[c-1].Type===textTypes.RTL?(l=d+l,s=0):o.length>c+1?o[c+1].Type===textTypes.RTL?(l=d+l,s=0):(l=spliceWord(l,s,u.Word),s+=u.Word.length):l=spliceWord(l,0,d)):u.Type===textTypes.RTL?l=spliceWord(l,s,d):u.Type===textTypes.LTR?s=(l+=u.Word).length:u.Type!==textTypes.WEAK&&u.Type!==textTypes.BRACKETS||(0<c&&o[c-1].Type===textTypes.RTL?o.length>c+1?o[c+1].Type===textTypes.RTL?l=spliceWord(l,s,d):s=(l+=u.Word).length:l+=u.Word:s=(l+=u.Word).length)}i+=l,r<t.length-1&&(i+="\n")}return i}function GraphemeSplitter(){var h=0,p=1,m=2,f=3,g=4,_=5,y=6,C=7,v=8,S=9,T=10,x=12,b=13,E=14,P=15,A=16,w=17,D=0,M=1,I=2,R=3,O=4;function L(e,t){var i=e.charCodeAt(t=void 0===t?0:t);if(55296<=i&&i<=56319&&t<e.length-1){var r=i;return 56320<=(n=e.charCodeAt(t+1))&&n<=57343?1024*(r-55296)+(n-56320)+65536:r}if(56320<=i&&i<=57343&&1<=t){var n=i;return 55296<=(r=e.charCodeAt(t-1))&&r<=56319?1024*(r-55296)+(n-56320)+65536:n}return i}function F(e){return 1536<=e&&e<=1541||1757==e||1807==e||2274==e||3406==e||69821==e||70082<=e&&e<=70083||72250==e||72326<=e&&e<=72329||73030==e?x:13==e?h:10==e?p:0<=e&&e<=9||11<=e&&e<=12||14<=e&&e<=31||127<=e&&e<=159||173==e||1564==e||6158==e||8203==e||8206<=e&&e<=8207||8232==e||8233==e||8234<=e&&e<=8238||8288<=e&&e<=8292||8293==e||8294<=e&&e<=8303||55296<=e&&e<=57343||65279==e||65520<=e&&e<=65528||65529<=e&&e<=65531||113824<=e&&e<=113827||119155<=e&&e<=119162||917504==e||917505==e||917506<=e&&e<=917535||917632<=e&&e<=917759||918e3<=e&&e<=921599?m:768<=e&&e<=879||1155<=e&&e<=1159||1160<=e&&e<=1161||1425<=e&&e<=1469||1471==e||1473<=e&&e<=1474||1476<=e&&e<=1477||1479==e||1552<=e&&e<=1562||1611<=e&&e<=1631||1648==e||1750<=e&&e<=1756||1759<=e&&e<=1764||1767<=e&&e<=1768||1770<=e&&e<=1773||1809==e||1840<=e&&e<=1866||1958<=e&&e<=1968||2027<=e&&e<=2035||2070<=e&&e<=2073||2075<=e&&e<=2083||2085<=e&&e<=2087||2089<=e&&e<=2093||2137<=e&&e<=2139||2260<=e&&e<=2273||2275<=e&&e<=2306||2362==e||2364==e||2369<=e&&e<=2376||2381==e||2385<=e&&e<=2391||2402<=e&&e<=2403||2433==e||2492==e||2494==e||2497<=e&&e<=2500||2509==e||2519==e||2530<=e&&e<=2531||2561<=e&&e<=2562||2620==e||2625<=e&&e<=2626||2631<=e&&e<=2632||2635<=e&&e<=2637||2641==e||2672<=e&&e<=2673||2677==e||2689<=e&&e<=2690||2748==e||2753<=e&&e<=2757||2759<=e&&e<=2760||2765==e||2786<=e&&e<=2787||2810<=e&&e<=2815||2817==e||2876==e||2878==e||2879==e||2881<=e&&e<=2884||2893==e||2902==e||2903==e||2914<=e&&e<=2915||2946==e||3006==e||3008==e||3021==e||3031==e||3072==e||3134<=e&&e<=3136||3142<=e&&e<=3144||3146<=e&&e<=3149||3157<=e&&e<=3158||3170<=e&&e<=3171||3201==e||3260==e||3263==e||3266==e||3270==e||3276<=e&&e<=3277||3285<=e&&e<=3286||3298<=e&&e<=3299||3328<=e&&e<=3329||3387<=e&&e<=3388||3390==e||3393<=e&&e<=3396||3405==e||3415==e||3426<=e&&e<=3427||3530==e||3535==e||3538<=e&&e<=3540||3542==e||3551==e||3633==e||3636<=e&&e<=3642||3655<=e&&e<=3662||3761==e||3764<=e&&e<=3769||3771<=e&&e<=3772||3784<=e&&e<=3789||3864<=e&&e<=3865||3893==e||3895==e||3897==e||3953<=e&&e<=3966||3968<=e&&e<=3972||3974<=e&&e<=3975||3981<=e&&e<=3991||3993<=e&&e<=4028||4038==e||4141<=e&&e<=4144||4146<=e&&e<=4151||4153<=e&&e<=4154||4157<=e&&e<=4158||4184<=e&&e<=4185||4190<=e&&e<=4192||4209<=e&&e<=4212||4226==e||4229<=e&&e<=4230||4237==e||4253==e||4957<=e&&e<=4959||5906<=e&&e<=5908||5938<=e&&e<=5940||5970<=e&&e<=5971||6002<=e&&e<=6003||6068<=e&&e<=6069||6071<=e&&e<=6077||6086==e||6089<=e&&e<=6099||6109==e||6155<=e&&e<=6157||6277<=e&&e<=6278||6313==e||6432<=e&&e<=6434||6439<=e&&e<=6440||6450==e||6457<=e&&e<=6459||6679<=e&&e<=6680||6683==e||6742==e||6744<=e&&e<=6750||6752==e||6754==e||6757<=e&&e<=6764||6771<=e&&e<=6780||6783==e||6832<=e&&e<=6845||6846==e||6912<=e&&e<=6915||6964==e||6966<=e&&e<=6970||6972==e||6978==e||7019<=e&&e<=7027||7040<=e&&e<=7041||7074<=e&&e<=7077||7080<=e&&e<=7081||7083<=e&&e<=7085||7142==e||7144<=e&&e<=7145||7149==e||7151<=e&&e<=7153||7212<=e&&e<=7219||7222<=e&&e<=7223||7376<=e&&e<=7378||7380<=e&&e<=7392||7394<=e&&e<=7400||7405==e||7412==e||7416<=e&&e<=7417||7616<=e&&e<=7673||7675<=e&&e<=7679||8204==e||8400<=e&&e<=8412||8413<=e&&e<=8416||8417==e||8418<=e&&e<=8420||8421<=e&&e<=8432||11503<=e&&e<=11505||11647==e||11744<=e&&e<=11775||12330<=e&&e<=12333||12334<=e&&e<=12335||12441<=e&&e<=12442||42607==e||42608<=e&&e<=42610||42612<=e&&e<=42621||42654<=e&&e<=42655||42736<=e&&e<=42737||43010==e||43014==e||43019==e||43045<=e&&e<=43046||43204<=e&&e<=43205||43232<=e&&e<=43249||43302<=e&&e<=43309||43335<=e&&e<=43345||43392<=e&&e<=43394||43443==e||43446<=e&&e<=43449||43452==e||43493==e||43561<=e&&e<=43566||43569<=e&&e<=43570||43573<=e&&e<=43574||43587==e||43596==e||43644==e||43696==e||43698<=e&&e<=43700||43703<=e&&e<=43704||43710<=e&&e<=43711||43713==e||43756<=e&&e<=43757||43766==e||44005==e||44008==e||44013==e||64286==e||65024<=e&&e<=65039||65056<=e&&e<=65071||65438<=e&&e<=65439||66045==e||66272==e||66422<=e&&e<=66426||68097<=e&&e<=68099||68101<=e&&e<=68102||68108<=e&&e<=68111||68152<=e&&e<=68154||68159==e||68325<=e&&e<=68326||69633==e||69688<=e&&e<=69702||69759<=e&&e<=69761||69811<=e&&e<=69814||69817<=e&&e<=69818||69888<=e&&e<=69890||69927<=e&&e<=69931||69933<=e&&e<=69940||70003==e||70016<=e&&e<=70017||70070<=e&&e<=70078||70090<=e&&e<=70092||70191<=e&&e<=70193||70196==e||70198<=e&&e<=70199||70206==e||70367==e||70371<=e&&e<=70378||70400<=e&&e<=70401||70460==e||70462==e||70464==e||70487==e||70502<=e&&e<=70508||70512<=e&&e<=70516||70712<=e&&e<=70719||70722<=e&&e<=70724||70726==e||70832==e||70835<=e&&e<=70840||70842==e||70845==e||70847<=e&&e<=70848||70850<=e&&e<=70851||71087==e||71090<=e&&e<=71093||71100<=e&&e<=71101||71103<=e&&e<=71104||71132<=e&&e<=71133||71219<=e&&e<=71226||71229==e||71231<=e&&e<=71232||71339==e||71341==e||71344<=e&&e<=71349||71351==e||71453<=e&&e<=71455||71458<=e&&e<=71461||71463<=e&&e<=71467||72193<=e&&e<=72198||72201<=e&&e<=72202||72243<=e&&e<=72248||72251<=e&&e<=72254||72263==e||72273<=e&&e<=72278||72281<=e&&e<=72283||72330<=e&&e<=72342||72344<=e&&e<=72345||72752<=e&&e<=72758||72760<=e&&e<=72765||72767==e||72850<=e&&e<=72871||72874<=e&&e<=72880||72882<=e&&e<=72883||72885<=e&&e<=72886||73009<=e&&e<=73014||73018==e||73020<=e&&e<=73021||73023<=e&&e<=73029||73031==e||92912<=e&&e<=92916||92976<=e&&e<=92982||94095<=e&&e<=94098||113821<=e&&e<=113822||119141==e||119143<=e&&e<=119145||119150<=e&&e<=119154||119163<=e&&e<=119170||119173<=e&&e<=119179||119210<=e&&e<=119213||119362<=e&&e<=119364||121344<=e&&e<=121398||121403<=e&&e<=121452||121461==e||121476==e||121499<=e&&e<=121503||121505<=e&&e<=121519||122880<=e&&e<=122886||122888<=e&&e<=122904||122907<=e&&e<=122913||122915<=e&&e<=122916||122918<=e&&e<=122922||125136<=e&&e<=125142||125252<=e&&e<=125258||917536<=e&&e<=917631||917760<=e&&e<=917999?f:127462<=e&&e<=127487?g:2307==e||2363==e||2366<=e&&e<=2368||2377<=e&&e<=2380||2382<=e&&e<=2383||2434<=e&&e<=2435||2495<=e&&e<=2496||2503<=e&&e<=2504||2507<=e&&e<=2508||2563==e||2622<=e&&e<=2624||2691==e||2750<=e&&e<=2752||2761==e||2763<=e&&e<=2764||2818<=e&&e<=2819||2880==e||2887<=e&&e<=2888||2891<=e&&e<=2892||3007==e||3009<=e&&e<=3010||3014<=e&&e<=3016||3018<=e&&e<=3020||3073<=e&&e<=3075||3137<=e&&e<=3140||3202<=e&&e<=3203||3262==e||3264<=e&&e<=3265||3267<=e&&e<=3268||3271<=e&&e<=3272||3274<=e&&e<=3275||3330<=e&&e<=3331||3391<=e&&e<=3392||3398<=e&&e<=3400||3402<=e&&e<=3404||3458<=e&&e<=3459||3536<=e&&e<=3537||3544<=e&&e<=3550||3570<=e&&e<=3571||3635==e||3763==e||3902<=e&&e<=3903||3967==e||4145==e||4155<=e&&e<=4156||4182<=e&&e<=4183||4228==e||6070==e||6078<=e&&e<=6085||6087<=e&&e<=6088||6435<=e&&e<=6438||6441<=e&&e<=6443||6448<=e&&e<=6449||6451<=e&&e<=6456||6681<=e&&e<=6682||6741==e||6743==e||6765<=e&&e<=6770||6916==e||6965==e||6971==e||6973<=e&&e<=6977||6979<=e&&e<=6980||7042==e||7073==e||7078<=e&&e<=7079||7082==e||7143==e||7146<=e&&e<=7148||7150==e||7154<=e&&e<=7155||7204<=e&&e<=7211||7220<=e&&e<=7221||7393==e||7410<=e&&e<=7411||7415==e||43043<=e&&e<=43044||43047==e||43136<=e&&e<=43137||43188<=e&&e<=43203||43346<=e&&e<=43347||43395==e||43444<=e&&e<=43445||43450<=e&&e<=43451||43453<=e&&e<=43456||43567<=e&&e<=43568||43571<=e&&e<=43572||43597==e||43755==e||43758<=e&&e<=43759||43765==e||44003<=e&&e<=44004||44006<=e&&e<=44007||44009<=e&&e<=44010||44012==e||69632==e||69634==e||69762==e||69808<=e&&e<=69810||69815<=e&&e<=69816||69932==e||70018==e||70067<=e&&e<=70069||70079<=e&&e<=70080||70188<=e&&e<=70190||70194<=e&&e<=70195||70197==e||70368<=e&&e<=70370||70402<=e&&e<=70403||70463==e||70465<=e&&e<=70468||70471<=e&&e<=70472||70475<=e&&e<=70477||70498<=e&&e<=70499||70709<=e&&e<=70711||70720<=e&&e<=70721||70725==e||70833<=e&&e<=70834||70841==e||70843<=e&&e<=70844||70846==e||70849==e||71088<=e&&e<=71089||71096<=e&&e<=71099||71102==e||71216<=e&&e<=71218||71227<=e&&e<=71228||71230==e||71340==e||71342<=e&&e<=71343||71350==e||71456<=e&&e<=71457||71462==e||72199<=e&&e<=72200||72249==e||72279<=e&&e<=72280||72343==e||72751==e||72766==e||72873==e||72881==e||72884==e||94033<=e&&e<=94078||119142==e||119149==e?_:4352<=e&&e<=4447||43360<=e&&e<=43388?y:4448<=e&&e<=4519||55216<=e&&e<=55238?C:4520<=e&&e<=4607||55243<=e&&e<=55291?v:44032==e||44060==e||44088==e||44116==e||44144==e||44172==e||44200==e||44228==e||44256==e||44284==e||44312==e||44340==e||44368==e||44396==e||44424==e||44452==e||44480==e||44508==e||44536==e||44564==e||44592==e||44620==e||44648==e||44676==e||44704==e||44732==e||44760==e||44788==e||44816==e||44844==e||44872==e||44900==e||44928==e||44956==e||44984==e||45012==e||45040==e||45068==e||45096==e||45124==e||45152==e||45180==e||45208==e||45236==e||45264==e||45292==e||45320==e||45348==e||45376==e||45404==e||45432==e||45460==e||45488==e||45516==e||45544==e||45572==e||45600==e||45628==e||45656==e||45684==e||45712==e||45740==e||45768==e||45796==e||45824==e||45852==e||45880==e||45908==e||45936==e||45964==e||45992==e||46020==e||46048==e||46076==e||46104==e||46132==e||46160==e||46188==e||46216==e||46244==e||46272==e||46300==e||46328==e||46356==e||46384==e||46412==e||46440==e||46468==e||46496==e||46524==e||46552==e||46580==e||46608==e||46636==e||46664==e||46692==e||46720==e||46748==e||46776==e||46804==e||46832==e||46860==e||46888==e||46916==e||46944==e||46972==e||47e3==e||47028==e||47056==e||47084==e||47112==e||47140==e||47168==e||47196==e||47224==e||47252==e||47280==e||47308==e||47336==e||47364==e||47392==e||47420==e||47448==e||47476==e||47504==e||47532==e||47560==e||47588==e||47616==e||47644==e||47672==e||47700==e||47728==e||47756==e||47784==e||47812==e||47840==e||47868==e||47896==e||47924==e||47952==e||47980==e||48008==e||48036==e||48064==e||48092==e||48120==e||48148==e||48176==e||48204==e||48232==e||48260==e||48288==e||48316==e||48344==e||48372==e||48400==e||48428==e||48456==e||48484==e||48512==e||48540==e||48568==e||48596==e||48624==e||48652==e||48680==e||48708==e||48736==e||48764==e||48792==e||48820==e||48848==e||48876==e||48904==e||48932==e||48960==e||48988==e||49016==e||49044==e||49072==e||49100==e||49128==e||49156==e||49184==e||49212==e||49240==e||49268==e||49296==e||49324==e||49352==e||49380==e||49408==e||49436==e||49464==e||49492==e||49520==e||49548==e||49576==e||49604==e||49632==e||49660==e||49688==e||49716==e||49744==e||49772==e||49800==e||49828==e||49856==e||49884==e||49912==e||49940==e||49968==e||49996==e||50024==e||50052==e||50080==e||50108==e||50136==e||50164==e||50192==e||50220==e||50248==e||50276==e||50304==e||50332==e||50360==e||50388==e||50416==e||50444==e||50472==e||50500==e||50528==e||50556==e||50584==e||50612==e||50640==e||50668==e||50696==e||50724==e||50752==e||50780==e||50808==e||50836==e||50864==e||50892==e||50920==e||50948==e||50976==e||51004==e||51032==e||51060==e||51088==e||51116==e||51144==e||51172==e||51200==e||51228==e||51256==e||51284==e||51312==e||51340==e||51368==e||51396==e||51424==e||51452==e||51480==e||51508==e||51536==e||51564==e||51592==e||51620==e||51648==e||51676==e||51704==e||51732==e||51760==e||51788==e||51816==e||51844==e||51872==e||51900==e||51928==e||51956==e||51984==e||52012==e||52040==e||52068==e||52096==e||52124==e||52152==e||52180==e||52208==e||52236==e||52264==e||52292==e||52320==e||52348==e||52376==e||52404==e||52432==e||52460==e||52488==e||52516==e||52544==e||52572==e||52600==e||52628==e||52656==e||52684==e||52712==e||52740==e||52768==e||52796==e||52824==e||52852==e||52880==e||52908==e||52936==e||52964==e||52992==e||53020==e||53048==e||53076==e||53104==e||53132==e||53160==e||53188==e||53216==e||53244==e||53272==e||53300==e||53328==e||53356==e||53384==e||53412==e||53440==e||53468==e||53496==e||53524==e||53552==e||53580==e||53608==e||53636==e||53664==e||53692==e||53720==e||53748==e||53776==e||53804==e||53832==e||53860==e||53888==e||53916==e||53944==e||53972==e||54e3==e||54028==e||54056==e||54084==e||54112==e||54140==e||54168==e||54196==e||54224==e||54252==e||54280==e||54308==e||54336==e||54364==e||54392==e||54420==e||54448==e||54476==e||54504==e||54532==e||54560==e||54588==e||54616==e||54644==e||54672==e||54700==e||54728==e||54756==e||54784==e||54812==e||54840==e||54868==e||54896==e||54924==e||54952==e||54980==e||55008==e||55036==e||55064==e||55092==e||55120==e||55148==e||55176==e?S:44033<=e&&e<=44059||44061<=e&&e<=44087||44089<=e&&e<=44115||44117<=e&&e<=44143||44145<=e&&e<=44171||44173<=e&&e<=44199||44201<=e&&e<=44227||44229<=e&&e<=44255||44257<=e&&e<=44283||44285<=e&&e<=44311||44313<=e&&e<=44339||44341<=e&&e<=44367||44369<=e&&e<=44395||44397<=e&&e<=44423||44425<=e&&e<=44451||44453<=e&&e<=44479||44481<=e&&e<=44507||44509<=e&&e<=44535||44537<=e&&e<=44563||44565<=e&&e<=44591||44593<=e&&e<=44619||44621<=e&&e<=44647||44649<=e&&e<=44675||44677<=e&&e<=44703||44705<=e&&e<=44731||44733<=e&&e<=44759||44761<=e&&e<=44787||44789<=e&&e<=44815||44817<=e&&e<=44843||44845<=e&&e<=44871||44873<=e&&e<=44899||44901<=e&&e<=44927||44929<=e&&e<=44955||44957<=e&&e<=44983||44985<=e&&e<=45011||45013<=e&&e<=45039||45041<=e&&e<=45067||45069<=e&&e<=45095||45097<=e&&e<=45123||45125<=e&&e<=45151||45153<=e&&e<=45179||45181<=e&&e<=45207||45209<=e&&e<=45235||45237<=e&&e<=45263||45265<=e&&e<=45291||45293<=e&&e<=45319||45321<=e&&e<=45347||45349<=e&&e<=45375||45377<=e&&e<=45403||45405<=e&&e<=45431||45433<=e&&e<=45459||45461<=e&&e<=45487||45489<=e&&e<=45515||45517<=e&&e<=45543||45545<=e&&e<=45571||45573<=e&&e<=45599||45601<=e&&e<=45627||45629<=e&&e<=45655||45657<=e&&e<=45683||45685<=e&&e<=45711||45713<=e&&e<=45739||45741<=e&&e<=45767||45769<=e&&e<=45795||45797<=e&&e<=45823||45825<=e&&e<=45851||45853<=e&&e<=45879||45881<=e&&e<=45907||45909<=e&&e<=45935||45937<=e&&e<=45963||45965<=e&&e<=45991||45993<=e&&e<=46019||46021<=e&&e<=46047||46049<=e&&e<=46075||46077<=e&&e<=46103||46105<=e&&e<=46131||46133<=e&&e<=46159||46161<=e&&e<=46187||46189<=e&&e<=46215||46217<=e&&e<=46243||46245<=e&&e<=46271||46273<=e&&e<=46299||46301<=e&&e<=46327||46329<=e&&e<=46355||46357<=e&&e<=46383||46385<=e&&e<=46411||46413<=e&&e<=46439||46441<=e&&e<=46467||46469<=e&&e<=46495||46497<=e&&e<=46523||46525<=e&&e<=46551||46553<=e&&e<=46579||46581<=e&&e<=46607||46609<=e&&e<=46635||46637<=e&&e<=46663||46665<=e&&e<=46691||46693<=e&&e<=46719||46721<=e&&e<=46747||46749<=e&&e<=46775||46777<=e&&e<=46803||46805<=e&&e<=46831||46833<=e&&e<=46859||46861<=e&&e<=46887||46889<=e&&e<=46915||46917<=e&&e<=46943||46945<=e&&e<=46971||46973<=e&&e<=46999||47001<=e&&e<=47027||47029<=e&&e<=47055||47057<=e&&e<=47083||47085<=e&&e<=47111||47113<=e&&e<=47139||47141<=e&&e<=47167||47169<=e&&e<=47195||47197<=e&&e<=47223||47225<=e&&e<=47251||47253<=e&&e<=47279||47281<=e&&e<=47307||47309<=e&&e<=47335||47337<=e&&e<=47363||47365<=e&&e<=47391||47393<=e&&e<=47419||47421<=e&&e<=47447||47449<=e&&e<=47475||47477<=e&&e<=47503||47505<=e&&e<=47531||47533<=e&&e<=47559||47561<=e&&e<=47587||47589<=e&&e<=47615||47617<=e&&e<=47643||47645<=e&&e<=47671||47673<=e&&e<=47699||47701<=e&&e<=47727||47729<=e&&e<=47755||47757<=e&&e<=47783||47785<=e&&e<=47811||47813<=e&&e<=47839||47841<=e&&e<=47867||47869<=e&&e<=47895||47897<=e&&e<=47923||47925<=e&&e<=47951||47953<=e&&e<=47979||47981<=e&&e<=48007||48009<=e&&e<=48035||48037<=e&&e<=48063||48065<=e&&e<=48091||48093<=e&&e<=48119||48121<=e&&e<=48147||48149<=e&&e<=48175||48177<=e&&e<=48203||48205<=e&&e<=48231||48233<=e&&e<=48259||48261<=e&&e<=48287||48289<=e&&e<=48315||48317<=e&&e<=48343||48345<=e&&e<=48371||48373<=e&&e<=48399||48401<=e&&e<=48427||48429<=e&&e<=48455||48457<=e&&e<=48483||48485<=e&&e<=48511||48513<=e&&e<=48539||48541<=e&&e<=48567||48569<=e&&e<=48595||48597<=e&&e<=48623||48625<=e&&e<=48651||48653<=e&&e<=48679||48681<=e&&e<=48707||48709<=e&&e<=48735||48737<=e&&e<=48763||48765<=e&&e<=48791||48793<=e&&e<=48819||48821<=e&&e<=48847||48849<=e&&e<=48875||48877<=e&&e<=48903||48905<=e&&e<=48931||48933<=e&&e<=48959||48961<=e&&e<=48987||48989<=e&&e<=49015||49017<=e&&e<=49043||49045<=e&&e<=49071||49073<=e&&e<=49099||49101<=e&&e<=49127||49129<=e&&e<=49155||49157<=e&&e<=49183||49185<=e&&e<=49211||49213<=e&&e<=49239||49241<=e&&e<=49267||49269<=e&&e<=49295||49297<=e&&e<=49323||49325<=e&&e<=49351||49353<=e&&e<=49379||49381<=e&&e<=49407||49409<=e&&e<=49435||49437<=e&&e<=49463||49465<=e&&e<=49491||49493<=e&&e<=49519||49521<=e&&e<=49547||49549<=e&&e<=49575||49577<=e&&e<=49603||49605<=e&&e<=49631||49633<=e&&e<=49659||49661<=e&&e<=49687||49689<=e&&e<=49715||49717<=e&&e<=49743||49745<=e&&e<=49771||49773<=e&&e<=49799||49801<=e&&e<=49827||49829<=e&&e<=49855||49857<=e&&e<=49883||49885<=e&&e<=49911||49913<=e&&e<=49939||49941<=e&&e<=49967||49969<=e&&e<=49995||49997<=e&&e<=50023||50025<=e&&e<=50051||50053<=e&&e<=50079||50081<=e&&e<=50107||50109<=e&&e<=50135||50137<=e&&e<=50163||50165<=e&&e<=50191||50193<=e&&e<=50219||50221<=e&&e<=50247||50249<=e&&e<=50275||50277<=e&&e<=50303||50305<=e&&e<=50331||50333<=e&&e<=50359||50361<=e&&e<=50387||50389<=e&&e<=50415||50417<=e&&e<=50443||50445<=e&&e<=50471||50473<=e&&e<=50499||50501<=e&&e<=50527||50529<=e&&e<=50555||50557<=e&&e<=50583||50585<=e&&e<=50611||50613<=e&&e<=50639||50641<=e&&e<=50667||50669<=e&&e<=50695||50697<=e&&e<=50723||50725<=e&&e<=50751||50753<=e&&e<=50779||50781<=e&&e<=50807||50809<=e&&e<=50835||50837<=e&&e<=50863||50865<=e&&e<=50891||50893<=e&&e<=50919||50921<=e&&e<=50947||50949<=e&&e<=50975||50977<=e&&e<=51003||51005<=e&&e<=51031||51033<=e&&e<=51059||51061<=e&&e<=51087||51089<=e&&e<=51115||51117<=e&&e<=51143||51145<=e&&e<=51171||51173<=e&&e<=51199||51201<=e&&e<=51227||51229<=e&&e<=51255||51257<=e&&e<=51283||51285<=e&&e<=51311||51313<=e&&e<=51339||51341<=e&&e<=51367||51369<=e&&e<=51395||51397<=e&&e<=51423||51425<=e&&e<=51451||51453<=e&&e<=51479||51481<=e&&e<=51507||51509<=e&&e<=51535||51537<=e&&e<=51563||51565<=e&&e<=51591||51593<=e&&e<=51619||51621<=e&&e<=51647||51649<=e&&e<=51675||51677<=e&&e<=51703||51705<=e&&e<=51731||51733<=e&&e<=51759||51761<=e&&e<=51787||51789<=e&&e<=51815||51817<=e&&e<=51843||51845<=e&&e<=51871||51873<=e&&e<=51899||51901<=e&&e<=51927||51929<=e&&e<=51955||51957<=e&&e<=51983||51985<=e&&e<=52011||52013<=e&&e<=52039||52041<=e&&e<=52067||52069<=e&&e<=52095||52097<=e&&e<=52123||52125<=e&&e<=52151||52153<=e&&e<=52179||52181<=e&&e<=52207||52209<=e&&e<=52235||52237<=e&&e<=52263||52265<=e&&e<=52291||52293<=e&&e<=52319||52321<=e&&e<=52347||52349<=e&&e<=52375||52377<=e&&e<=52403||52405<=e&&e<=52431||52433<=e&&e<=52459||52461<=e&&e<=52487||52489<=e&&e<=52515||52517<=e&&e<=52543||52545<=e&&e<=52571||52573<=e&&e<=52599||52601<=e&&e<=52627||52629<=e&&e<=52655||52657<=e&&e<=52683||52685<=e&&e<=52711||52713<=e&&e<=52739||52741<=e&&e<=52767||52769<=e&&e<=52795||52797<=e&&e<=52823||52825<=e&&e<=52851||52853<=e&&e<=52879||52881<=e&&e<=52907||52909<=e&&e<=52935||52937<=e&&e<=52963||52965<=e&&e<=52991||52993<=e&&e<=53019||53021<=e&&e<=53047||53049<=e&&e<=53075||53077<=e&&e<=53103||53105<=e&&e<=53131||53133<=e&&e<=53159||53161<=e&&e<=53187||53189<=e&&e<=53215||53217<=e&&e<=53243||53245<=e&&e<=53271||53273<=e&&e<=53299||53301<=e&&e<=53327||53329<=e&&e<=53355||53357<=e&&e<=53383||53385<=e&&e<=53411||53413<=e&&e<=53439||53441<=e&&e<=53467||53469<=e&&e<=53495||53497<=e&&e<=53523||53525<=e&&e<=53551||53553<=e&&e<=53579||53581<=e&&e<=53607||53609<=e&&e<=53635||53637<=e&&e<=53663||53665<=e&&e<=53691||53693<=e&&e<=53719||53721<=e&&e<=53747||53749<=e&&e<=53775||53777<=e&&e<=53803||53805<=e&&e<=53831||53833<=e&&e<=53859||53861<=e&&e<=53887||53889<=e&&e<=53915||53917<=e&&e<=53943||53945<=e&&e<=53971||53973<=e&&e<=53999||54001<=e&&e<=54027||54029<=e&&e<=54055||54057<=e&&e<=54083||54085<=e&&e<=54111||54113<=e&&e<=54139||54141<=e&&e<=54167||54169<=e&&e<=54195||54197<=e&&e<=54223||54225<=e&&e<=54251||54253<=e&&e<=54279||54281<=e&&e<=54307||54309<=e&&e<=54335||54337<=e&&e<=54363||54365<=e&&e<=54391||54393<=e&&e<=54419||54421<=e&&e<=54447||54449<=e&&e<=54475||54477<=e&&e<=54503||54505<=e&&e<=54531||54533<=e&&e<=54559||54561<=e&&e<=54587||54589<=e&&e<=54615||54617<=e&&e<=54643||54645<=e&&e<=54671||54673<=e&&e<=54699||54701<=e&&e<=54727||54729<=e&&e<=54755||54757<=e&&e<=54783||54785<=e&&e<=54811||54813<=e&&e<=54839||54841<=e&&e<=54867||54869<=e&&e<=54895||54897<=e&&e<=54923||54925<=e&&e<=54951||54953<=e&&e<=54979||54981<=e&&e<=55007||55009<=e&&e<=55035||55037<=e&&e<=55063||55065<=e&&e<=55091||55093<=e&&e<=55119||55121<=e&&e<=55147||55149<=e&&e<=55175||55177<=e&&e<=55203?T:9757==e||9977==e||9994<=e&&e<=9997||127877==e||127938<=e&&e<=127940||127943==e||127946<=e&&e<=127948||128066<=e&&e<=128067||128070<=e&&e<=128080||128110==e||128112<=e&&e<=128120||128124==e||128129<=e&&e<=128131||128133<=e&&e<=128135||128170==e||128372<=e&&e<=128373||128378==e||128400==e||128405<=e&&e<=128406||128581<=e&&e<=128583||128587<=e&&e<=128591||128675==e||128692<=e&&e<=128694||128704==e||128716==e||129304<=e&&e<=129308||129310<=e&&e<=129311||129318==e||129328<=e&&e<=129337||129341<=e&&e<=129342||129489<=e&&e<=129501?b:127995<=e&&e<=127999?E:8205==e?P:9792==e||9794==e||9877<=e&&e<=9878||9992==e||10084==e||127752==e||127806==e||127859==e||127891==e||127908==e||127912==e||127979==e||127981==e||128139==e||128187<=e&&e<=128188||128295==e||128300==e||128488==e||128640==e||128658==e?A:128102<=e&&e<=128105?w:11}return this.nextBreak=function(e,t){if((t=void 0===t?0:t)<0)return 0;if(t>=e.length-1)return e.length;for(var i,r,n,a,o,s,l=F(L(e,t)),c=[],u=t+1;u<e.length;u++)if(s=u-1,!(55296<=(o=e).charCodeAt(s)&&o.charCodeAt(s)<=56319&&56320<=o.charCodeAt(s+1)&&o.charCodeAt(s+1)<=57343)){var d=F(L(e,u));if(i=d,a=n=r=void 0,r=[o=l].concat(s=c).concat([i]),n=r[r.length-2],a=i,1<(i=r.lastIndexOf(E))&&r.slice(1,i).every(function(e){return e==f})&&-1==[f,b,w].indexOf(o)?I:0<(o=r.lastIndexOf(g))&&r.slice(1,o).every(function(e){return e==g})&&-1==[x,g].indexOf(n)?r.filter(function(e){return e==g}).length%2==1?R:O:n==h&&a==p?D:n==m||n==h||n==p?a==E&&s.every(function(e){return e==f})?I:M:a==m||a==h||a==p?M:n==y&&(a==y||a==C||a==S||a==T)||!(n!=S&&n!=C||a!=C&&a!=v)||(n==T||n==v)&&a==v||a==f||a==P||a==_||n==x?D:(o=-1!=r.indexOf(f)?r.lastIndexOf(f)-1:r.length-2,-1!=[b,w].indexOf(r[o])&&r.slice(1+o,-1).every(function(e){return e==f})&&a==E||n==P&&-1!=[A,w].indexOf(a)?D:-1!=s.indexOf(g)?I:n==g&&a==g?D:M))return u;c.push(d)}return e.length},this.splitGraphemes=function(e){for(var t,i=[],r=0;(t=this.nextBreak(e,r))<e.length;)i.push(e.slice(r,t)),r=t;return r<e.length&&i.push(e.slice(r)),i},this.iterateGraphemes=function(i){var r=0,e={next:function(){var e,t;return(t=this.nextBreak(i,r))<i.length?(e=i.slice(r,t),r=t,{value:e,done:!1}):r<i.length?(e=i.slice(r),r=i.length,{value:e,done:!1}):{value:void 0,done:!0}}.bind(this)};return"undefined"!=typeof Symbol&&Symbol.iterator&&(e[Symbol.iterator]=function(){return e}),e},this.countGraphemes=function(e){for(var t,i=0,r=0;(t=this.nextBreak(e,r))<e.length;)r=t,i++;return r<e.length&&i++,i},this}function Glyph(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function GlyphTextureInfo(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}var defaultLineSpacingPercent=1.2,whitePixelCanvasId="ID_WHITE_PIXEL",whitePixelSize=new Cartesian2(4,4),whitePixelBoundingRegion=new BoundingRectangle(1,1,1,1);function addWhitePixelCanvas(e,t){var i=document.createElement("canvas");i.width=whitePixelSize.x,i.height=whitePixelSize.y;var r=i.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,i.width,i.height),e.addImage(whitePixelCanvasId,i).then(function(e){t._whitePixelIndex=e})}var writeTextToCanvasParameters={};function createGlyphCanvas(e,t,i,r,n,a,o){return writeTextToCanvasParameters.font=t,writeTextToCanvasParameters.fillColor=i,writeTextToCanvasParameters.strokeColor=r,writeTextToCanvasParameters.strokeWidth=n,writeTextToCanvasParameters.padding=SDFSettings$1.PADDING,o===VerticalOrigin$1.CENTER?writeTextToCanvasParameters.textBaseline="middle":o===VerticalOrigin$1.TOP?writeTextToCanvasParameters.textBaseline="top":writeTextToCanvasParameters.textBaseline="bottom",writeTextToCanvasParameters.fill=a===LabelStyle$1.FILL||a===LabelStyle$1.FILL_AND_OUTLINE,writeTextToCanvasParameters.stroke=a===LabelStyle$1.OUTLINE||a===LabelStyle$1.FILL_AND_OUTLINE,writeTextToCanvasParameters.backgroundColor=Color.BLACK,writeTextToCanvas(e,writeTextToCanvasParameters)}function unbindGlyph(e,t){t.textureInfo=void 0,t.dimensions=void 0;var i=t.billboard;defined(i)&&(i.show=!1,i.image=void 0,defined(i._removeCallbackFunc)&&(i._removeCallbackFunc(),i._removeCallbackFunc=void 0),e._spareBillboards.push(i),t.billboard=void 0)}function addGlyphToTextureAtlas(e,t,i,r){e.addImage(t,i).then(function(e){r.index=e})}var splitter=new GraphemeSplitter;function rebindAllGlyphs(e,t){var i,r=t._renderedText,n=splitter.splitGraphemes(r),a=n.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/SDFSettings$1.FONT_SIZE,a<s)for(i=a;i<s;++i)unbindGlyph(e,o[i]);o.length=a;var l=t._showBackground&&0<r.split("\n").join("").length,c=t._backgroundBillboard,r=e._backgroundBillboardCollection;l?(defined(c)||(c=r.add({collection:e,image:whitePixelCanvasId,imageSubRegion:whitePixelBoundingRegion}),t._backgroundBillboard=c),c.color=t._backgroundColor,c.show=t._show,c.position=t._position,c.eyeOffset=t._eyeOffset,c.pixelOffset=t._pixelOffset,c.horizontalOrigin=HorizontalOrigin$1.LEFT,c.verticalOrigin=t._verticalOrigin,c.heightReference=t._heightReference,c.scale=t.totalScale,c.pickPrimitive=t,c.id=t._id,c.translucencyByDistance=t._translucencyByDistance,c.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,c.scaleByDistance=t._scaleByDistance,c.distanceDisplayCondition=t._distanceDisplayCondition,c.disableDepthTestDistance=t._disableDepthTestDistance):defined(c)&&(r.remove(c),t._backgroundBillboard=c=void 0);for(var u=e._glyphTextureCache,d=0;d<a;++d){var h=n[d],p=t._verticalOrigin,m=JSON.stringify([h,t._fontFamily,t._fontStyle,t._fontWeight,+p]);if(!defined(g=u[m])){var f=createGlyphCanvas(h,t._fontStyle+" "+t._fontWeight+" "+SDFSettings$1.FONT_SIZE+"px "+t._fontFamily,Color.WHITE,Color.WHITE,0,LabelStyle$1.FILL,p),g=new GlyphTextureInfo(e,-1,f.dimensions);if(u[m]=g,0<f.width&&0<f.height){for(var _=calcSDF(f,{cutoff:SDFSettings$1.CUTOFF,radius:SDFSettings$1.RADIUS}),p=f.getContext("2d"),y=f.width,C=f.height,v=p.getImageData(0,0,y,C),S=0;S<y;S++)for(var T=0;T<C;T++){var x=T*y+S,b=255*_[x],x=4*x;v.data[0+x]=b,v.data[1+x]=b,v.data[2+x]=b,v.data[3+x]=b}p.putImageData(v,0,0)," "!==h&&addGlyphToTextureAtlas(e._textureAtlas,m,f,g)}}defined(h=o[d])?-1===g.index?unbindGlyph(e,h):defined(h.textureInfo)&&(h.textureInfo=void 0):(h=new Glyph,o[d]=h),h.textureInfo=g,h.dimensions=g.dimensions,-1!==g.index&&(f=h.billboard,g=e._spareBillboards,defined(f)||(0<g.length?f=g.pop():((f=e._billboardCollection.add({collection:e}))._labelDimensions=new Cartesian2,f._labelTranslate=new Cartesian2),h.billboard=f),f.show=t._show,f.position=t._position,f.eyeOffset=t._eyeOffset,f.pixelOffset=t._pixelOffset,f.horizontalOrigin=HorizontalOrigin$1.LEFT,f.verticalOrigin=t._verticalOrigin,f.heightReference=t._heightReference,f.scale=t.totalScale,f.pickPrimitive=t,f.id=t._id,f.image=m,f.translucencyByDistance=t._translucencyByDistance,f.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,f.scaleByDistance=t._scaleByDistance,f.distanceDisplayCondition=t._distanceDisplayCondition,f.disableDepthTestDistance=t._disableDepthTestDistance,f._batchIndex=t._batchIndex,f.outlineColor=t.outlineColor,t.style===LabelStyle$1.FILL_AND_OUTLINE?(f.color=t._fillColor,f.outlineWidth=t.outlineWidth):t.style===LabelStyle$1.FILL?(f.color=t._fillColor,f.outlineWidth=0):t.style===LabelStyle$1.OUTLINE&&(f.color=Color.TRANSPARENT,f.outlineWidth=t.outlineWidth))}t._repositionAllGlyphs=!0}function calculateWidthOffset(e,t,i){return t===HorizontalOrigin$1.CENTER?-e/2:t===HorizontalOrigin$1.RIGHT?-(e+i.x):i.x}var glyphPixelOffset=new Cartesian2,scratchBackgroundPadding=new Cartesian2;function repositionAllGlyphs(e){var t=e._glyphs,i=e._renderedText,r=0,n=0,a=[],o=Number.NEGATIVE_INFINITY,s=0,l=1,c=t.length,u=e._backgroundBillboard,d=Cartesian2.clone(defined(u)?e._backgroundPadding:Cartesian2.ZERO,scratchBackgroundPadding);for(d.x/=e._relativeSize,d.y/=e._relativeSize,w=0;w<c;++w)"\n"===i.charAt(w)?(a.push(r),++l,r=0):(E=(b=t[w]).dimensions,s=Math.max(s,E.height-E.descent),o=Math.max(o,E.descent),r+=E.width-E.bounds.minx,w<c-1&&(r+=t[w+1].dimensions.bounds.minx),n=Math.max(n,r));a.push(r);var h=s+o,p=e.totalScale,m=e._horizontalOrigin,f=e._verticalOrigin,g=0,_=a[g],y=calculateWidthOffset(_,m,d),C=(defined(e._lineHeight)?e._lineHeight:defaultLineSpacingPercent*e._fontSize)/e._relativeSize,v=C*(l-1),S=n,T=h+v;defined(u)&&(S+=2*d.x,T+=2*d.y,u._labelHorizontalOrigin=m),glyphPixelOffset.x=y*p;for(var x,b,E,P=!(glyphPixelOffset.y=0),A=0,w=0;w<c;++w)"\n"===i.charAt(w)?(A+=C,y=calculateWidthOffset(a[++g],m,d),glyphPixelOffset.x=y*p,P=!0):(E=(b=t[w]).dimensions,f===VerticalOrigin$1.TOP?(glyphPixelOffset.y=E.height-s-d.y,glyphPixelOffset.y+=SDFSettings$1.PADDING):f===VerticalOrigin$1.CENTER?glyphPixelOffset.y=(v+E.height-s)/2:(f===VerticalOrigin$1.BASELINE?glyphPixelOffset.y=v:glyphPixelOffset.y=v+o+d.y,glyphPixelOffset.y-=SDFSettings$1.PADDING),glyphPixelOffset.y=(glyphPixelOffset.y-E.descent-A)*p,P&&(glyphPixelOffset.x-=SDFSettings$1.PADDING*p,P=!1),defined(b.billboard)&&(b.billboard._setTranslate(glyphPixelOffset),b.billboard._labelDimensions.x=S,b.billboard._labelDimensions.y=T,b.billboard._labelHorizontalOrigin=m),w<c-1&&(x=t[w+1],glyphPixelOffset.x+=(E.width-E.bounds.minx+x.dimensions.bounds.minx)*p));if(defined(u)&&0<i.split("\n").join("").length&&(y=m===HorizontalOrigin$1.CENTER?-n/2-d.x:m===HorizontalOrigin$1.RIGHT?-(n+2*d.x):0,glyphPixelOffset.x=y*p,f===VerticalOrigin$1.TOP?glyphPixelOffset.y=h-s-o:f===VerticalOrigin$1.CENTER?glyphPixelOffset.y=(h-s)/2-o:f===VerticalOrigin$1.BASELINE?glyphPixelOffset.y=-d.y-o:glyphPixelOffset.y=0,glyphPixelOffset.y=glyphPixelOffset.y*p,u.width=S,u.height=T,u._setTranslate(glyphPixelOffset),u._labelTranslate=Cartesian2.clone(glyphPixelOffset,u._labelTranslate)),e.heightReference===HeightReference$1.CLAMP_TO_GROUND)for(w=0;w<c;++w){var D=(b=t[w]).billboard;defined(D)&&(D._labelTranslate=Cartesian2.clone(glyphPixelOffset,D._labelTranslate))}}function destroyLabel(e,t){for(var i=t._glyphs,r=0,n=i.length;r<n;++r)unbindGlyph(e,i[r]);defined(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,defined(t._removeCallbackFunc)&&t._removeCallbackFunc(),destroyObject(t)}function LabelCollection(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._whitePixelIndex=void 0,this._backgroundBillboardCollection=new BillboardCollection({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new BillboardCollection({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=Color.clone(Color.WHITE),this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.blendOption=defaultValue(e.blendOption,BlendOption$1.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(LabelCollection.prototype,{length:{get:function(){return this._labels.length}}}),LabelCollection.prototype.add=function(e){e=new Label(e,this);return this._labels.push(e),this._labelsToUpdate.push(e),e},LabelCollection.prototype.remove=function(e){if(defined(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),destroyLabel(this,e),!0}return!1},LabelCollection.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;t<i;++t)destroyLabel(this,e[t]);e.length=0},LabelCollection.prototype.contains=function(e){return defined(e)&&e._labelCollection===this},LabelCollection.prototype.get=function(e){return this._labels[e]},LabelCollection.prototype.update=function(e){if(this.show){var t=this._billboardCollection,i=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,i.modelMatrix=this.modelMatrix,i.debugShowBoundingVolume=this.debugShowBoundingVolume;var r=e.context;defined(this._textureAtlas)||(this._textureAtlas=new TextureAtlas({context:r}),t.textureAtlas=this._textureAtlas),defined(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new TextureAtlas({context:r,initialSize:whitePixelSize}),i.textureAtlas=this._backgroundTextureAtlas,addWhitePixelCanvas(this._backgroundTextureAtlas,this));for(var n=this._labelsToUpdate.length,a=0;a<n;++a){var o,s=this._labelsToUpdate[a];s.isDestroyed()||(o=s._glyphs.length,s._rebindAllGlyphs&&(rebindAllGlyphs(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(repositionAllGlyphs(s),s._repositionAllGlyphs=!1),o=s._glyphs.length-o,this._totalGlyphCount+=o)}r=0<i.length?BlendOption$1.TRANSLUCENT:this.blendOption;t.blendOption=r,i.blendOption=r,t._highlightColor=this._highlightColor,i._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,i.update(e),t.update(e)}},LabelCollection.prototype.isDestroyed=function(){return!1},LabelCollection.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(),destroyObject(this)};var PolylineVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 v_pickColor;\nvarying float v_polylineAngle;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nfloat polylineAngle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st.s = texCoord;\nv_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);\nv_width = width;\nv_pickColor = pickColor;\nv_polylineAngle = polylineAngle;\n}\n";function Polyline(e,t){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._show=defaultValue(e.show,!0),this._width=defaultValue(e.width,1),this._loop=defaultValue(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,defined(this._material)||(this._material=Material.fromType(Material.ColorType,{color:new Color(1,1,1,1)}));var i,r=e.positions;defined(r)||(r=[]),this._positions=r,this._actualPositions=arrayRemoveDuplicates(r,Cartesian3.equalsEpsilon),this._loop&&2<this._actualPositions.length&&(this._actualPositions===this._positions&&(this._actualPositions=r.slice()),this._actualPositions.push(Cartesian3.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id,defined(t)&&(i=Matrix4.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=PolylinePipeline.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(NUMBER_OF_PROPERTIES$2),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=BoundingSphere.fromPoints(this._actualPositions),this._boundingVolumeWC=BoundingSphere.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new BoundingSphere}var POSITION_INDEX$3=Polyline.POSITION_INDEX=0,SHOW_INDEX$3=Polyline.SHOW_INDEX=1,WIDTH_INDEX$1=Polyline.WIDTH_INDEX=2,MATERIAL_INDEX$1=Polyline.MATERIAL_INDEX=3,POSITION_SIZE_INDEX$1=Polyline.POSITION_SIZE_INDEX=4,DISTANCE_DISPLAY_CONDITION$1=Polyline.DISTANCE_DISPLAY_CONDITION=5,NUMBER_OF_PROPERTIES$2=Polyline.NUMBER_OF_PROPERTIES=6;function makeDirty$1(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;defined(i)&&(i._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Polyline.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,makeDirty$1(this,SHOW_INDEX$3))}},positions:{get:function(){return this._positions},set:function(e){var t=arrayRemoveDuplicates(e,Cartesian3.equalsEpsilon);this._loop&&2<t.length&&(t=t===e?e.slice():t).push(Cartesian3.clone(t[0])),this._actualPositions.length===t.length&&this._actualPositions.length===this._length||makeDirty$1(this,POSITION_SIZE_INDEX$1),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=BoundingSphere.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=BoundingSphere.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),makeDirty$1(this,POSITION_INDEX$3),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,makeDirty$1(this,MATERIAL_INDEX$1))}},width:{get:function(){return this._width},set:function(e){e!==this._width&&(this._width=e,makeDirty$1(this,WIDTH_INDEX$1))}},loop:{get:function(){return this._loop},set:function(e){var t;e!==this._loop&&(t=this._actualPositions,e?2<t.length&&!Cartesian3.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(Cartesian3.clone(t[0]))):2<t.length&&Cartesian3.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,makeDirty$1(this,POSITION_SIZE_INDEX$1))}},id:{get:function(){return this._id},set:function(e){this._id=e,defined(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!defined(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){DistanceDisplayCondition.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition),makeDirty$1(this,DISTANCE_DISPLAY_CONDITION$1))}}}),Polyline.prototype.update=function(){var e=Matrix4.IDENTITY;defined(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var t=this._segments.positions.length,i=this._segments.lengths,r=0<this._propertiesChanged[POSITION_INDEX$3]||0<this._propertiesChanged[POSITION_SIZE_INDEX$1];if(Matrix4.equals(e,this._modelMatrix)&&!r||(this._segments=PolylinePipeline.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=BoundingSphere.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=Matrix4.clone(e,this._modelMatrix),this._segments.positions.length!==t)makeDirty$1(this,POSITION_SIZE_INDEX$1);else for(var n=i.length,a=0;a<n;++a)if(i[a]!==this._segments.lengths[a]){makeDirty$1(this,POSITION_SIZE_INDEX$1);break}},Polyline.prototype.getPickId=function(e){return defined(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},Polyline.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;t<NUMBER_OF_PROPERTIES$2-1;++t)e[t]=0},Polyline.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var SHOW_INDEX$2=Polyline.SHOW_INDEX,WIDTH_INDEX=Polyline.WIDTH_INDEX,POSITION_INDEX$2=Polyline.POSITION_INDEX,MATERIAL_INDEX=Polyline.MATERIAL_INDEX,POSITION_SIZE_INDEX=Polyline.POSITION_SIZE_INDEX,DISTANCE_DISPLAY_CONDITION=Polyline.DISTANCE_DISPLAY_CONDITION,NUMBER_OF_PROPERTIES$1=Polyline.NUMBER_OF_PROPERTIES,attributeLocations$4={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 PolylineCollection(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this.debugShowBoundingVolume=defaultValue(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(NUMBER_OF_PROPERTIES$1),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:BufferUsage$1.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=Color.clone(Color.WHITE);var t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}function createBatchTable(e,t){defined(e._batchTable)&&e._batchTable.destroy();var i=[{functionName:"batchTable_getWidthAndShow",componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2}];e._batchTable=new BatchTable(t,i,e._polylines.length)}Object.defineProperties(PolylineCollection.prototype,{length:{get:function(){return removePolylines(this),this._polylines.length}}}),PolylineCollection.prototype.add=function(e){e=new Polyline(e,this);return e._index=this._polylines.length,this._polylines.push(e),this._createVertexArray=!0,this._createBatchTable=!0,e},PolylineCollection.prototype.remove=function(e){var t;return!!this.contains(e)&&(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,defined(e._bucket)&&((t=e._bucket).shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),e._destroy(),!0)},PolylineCollection.prototype.removeAll=function(){releaseShaders(this),destroyPolylines(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},PolylineCollection.prototype.contains=function(e){return defined(e)&&e._polylineCollection===this},PolylineCollection.prototype.get=function(e){return removePolylines(this),this._polylines[e]};var scratchUpdatePolylineEncodedCartesian=new EncodedCartesian3,scratchUpdatePolylineCartesian4=new Cartesian4,scratchNearFarCartesian2=new Cartesian2;PolylineCollection.prototype.update=function(e){if(removePolylines(this),0!==this._polylines.length&&this.show){updateMode$1(this,e);var t=e.context,i=e.mapProjection,r=this._propertiesChanged;if(this._createBatchTable){if(0===ContextLimits.maximumVertexTextureImageUnits)throw new RuntimeError("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");createBatchTable(this,t),this._createBatchTable=!1}if(this._createVertexArray||computeNewBuffersUsage(this))createVertexArrays(this,t,i);else if(this._polylinesUpdated){var n=this._polylinesToUpdate;if(this._mode!==SceneMode$1.SCENE3D)for(var a=n.length,o=0;o<a;++o)(u=n[o]).update();if(r[POSITION_SIZE_INDEX]||r[MATERIAL_INDEX])createVertexArrays(this,t,i);else for(var s=n.length,l=this._polylineBuckets,c=0;c<s;++c){var u,d,h,p,r=(u=n[c])._propertiesChanged,m=u._bucket,f=0;for(d in l)if(l.hasOwnProperty(d)){if(l[d]===m){r[POSITION_INDEX$2]&&m.writeUpdate(f,u,this._positionBuffer,i);break}f+=l[d].lengthOfPositions}(r[SHOW_INDEX$2]||r[WIDTH_INDEX])&&this._batchTable.setBatchedAttribute(u._index,0,new Cartesian2(u._width,u._show)),2<this._batchTable.attributes.length&&((r[POSITION_INDEX$2]||r[POSITION_SIZE_INDEX])&&(p=e.mode===SceneMode$1.SCENE2D?u._boundingVolume2D:u._boundingVolumeWC,h=EncodedCartesian3.fromCartesian(p.center,scratchUpdatePolylineEncodedCartesian),p=Cartesian4.fromElements(h.low.x,h.low.y,h.low.z,p.radius,scratchUpdatePolylineCartesian4),this._batchTable.setBatchedAttribute(u._index,2,h.high),this._batchTable.setBatchedAttribute(u._index,3,p)),r[DISTANCE_DISPLAY_CONDITION]&&((h=scratchNearFarCartesian2).x=0,h.y=Number.MAX_VALUE,defined(p=u.distanceDisplayCondition)&&(h.x=p.near,h.y=p.far),this._batchTable.setBatchedAttribute(u._index,4,h))),u._clean()}n.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(var g=0;g<NUMBER_OF_PROPERTIES$1;++g)r[g]=0;var _=Matrix4.IDENTITY;e.mode===SceneMode$1.SCENE3D&&(_=this.modelMatrix);var y=e.passes,t=0!==e.morphTime;defined(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===t||(this._opaqueRS=RenderState.fromCache({depthMask:t,depthTest:{enabled:t}})),defined(this._translucentRS)&&this._translucentRS.depthTest.enabled===t||(this._translucentRS=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,depthMask:!t,depthTest:{enabled:t}})),this._batchTable.update(e),(y.render||y.pick)&&createCommandLists(this,e,this._colorCommands,_)}};var boundingSphereScratch$2=new BoundingSphere,boundingSphereScratch2=new BoundingSphere;function createCommandLists(e,t,i,r){for(var n=t.context,a=t.commandList,o=i.length,s=0,l=!0,c=e._vertexArrays,u=e.debugShowBoundingVolume,d=e._batchTable.getUniformMapCallback(),h=c.length,p=0;p<h;++p)for(var m=c[p],f=m.buckets,g=f.length,_=0;_<g;++_){for(var y,C,v,S,T=f[_],x=T.offset,b=T.bucket.shaderProgram,E=T.bucket.polylines,P=E.length,A=0,w=0;w<P;++w){var D,M=E[w],I=createMaterialId(M._material);I!==y&&(defined(y)&&0<A&&(D=C.isTranslucent(),o<=s?(v=new DrawCommand({owner:e}),i.push(v)):v=i[s],++s,S=combine$2(d(C._uniforms),e._uniformMap),v.boundingVolume=BoundingSphere.clone(boundingSphereScratch$2,v.boundingVolume),v.modelMatrix=r,v.shaderProgram=b,v.vertexArray=m.va,v.renderState=D?e._translucentRS:e._opaqueRS,v.pass=D?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,v.debugShowBoundingVolume=u,v.pickId="v_pickColor",v.uniformMap=S,v.count=A,v.offset=x,x+=A,l=!(A=0),a.push(v)),(C=M._material).update(n),y=I);for(var R,O=M._locatorBuckets,L=O.length,F=0;F<L;++F){var N=O[F];N.locator===T&&(A+=N.count)}t.mode===SceneMode$1.SCENE3D?R=M._boundingVolumeWC:t.mode===SceneMode$1.COLUMBUS_VIEW?R=M._boundingVolume2D:t.mode===SceneMode$1.SCENE2D?defined(M._boundingVolume2D)&&((R=BoundingSphere.clone(M._boundingVolume2D,boundingSphereScratch2)).center.x=0):defined(M._boundingVolumeWC)&&defined(M._boundingVolume2D)&&(R=BoundingSphere.union(M._boundingVolumeWC,M._boundingVolume2D,boundingSphereScratch2)),l?(l=!1,BoundingSphere.clone(R,boundingSphereScratch$2)):BoundingSphere.union(R,boundingSphereScratch$2,boundingSphereScratch$2)}defined(y)&&0<A&&(o<=s?(v=new DrawCommand({owner:e}),i.push(v)):v=i[s],++s,S=combine$2(d(C._uniforms),e._uniformMap),v.boundingVolume=BoundingSphere.clone(boundingSphereScratch$2,v.boundingVolume),v.modelMatrix=r,v.shaderProgram=b,v.vertexArray=m.va,v.renderState=C.isTranslucent()?e._translucentRS:e._opaqueRS,v.pass=C.isTranslucent()?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,v.debugShowBoundingVolume=u,v.pickId="v_pickColor",v.uniformMap=S,v.count=A,v.offset=x,l=!0,a.push(v)),y=void 0}i.length=s}function computeNewBuffersUsage(e){var t=!1,i=e._propertiesChanged,e=e._positionBufferUsage;return i[POSITION_INDEX$2]?(e.bufferUsage!==BufferUsage$1.STREAM_DRAW&&(t=!0,e.bufferUsage=BufferUsage$1.STREAM_DRAW),e.frameCount=100):e.bufferUsage!==BufferUsage$1.STATIC_DRAW&&(0===e.frameCount?(t=!0,e.bufferUsage=BufferUsage$1.STATIC_DRAW):e.frameCount--),t}PolylineCollection.prototype.isDestroyed=function(){return!1},PolylineCollection.prototype.destroy=function(){return destroyVertexArrays(this),releaseShaders(this),destroyPolylines(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)};var emptyVertexBuffer=[0,0,0];function createVertexArrays(e,t,i){e._createVertexArray=!1,releaseShaders(e),destroyVertexArrays(e),sortPolylinesIntoBuckets(e);var r,n,a=[[]],o=a[0],s=e._batchTable,l=e._useHighlightColor,c=[0],u=0,d=[[]],h=0,p=e._polylineBuckets;for(r in p)p.hasOwnProperty(r)&&((n=p[r]).updateShader(t,s,l),h+=n.lengthOfPositions);if(0<h){var m,f,g=e._mode,_=new Float32Array(6*h*3),y=new Float32Array(4*h),C=0,v=0,S=0;for(r in p)p.hasOwnProperty(r)&&((n=p[r]).write(_,y,C,v,S,s,t,i),g===SceneMode$1.MORPHING&&(defined(m)||(m=new Float32Array(6*h*3)),n.writeForMorph(m,C)),C+=6*(f=n.lengthOfPositions)*3,v+=4*f,S+=4*f,u=n.updateIndices(a,c,d,u));var T,x=e._positionBufferUsage.bufferUsage,b=BufferUsage$1.STATIC_DRAW;e._positionBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:_,usage:x}),defined(m)&&(T=Buffer$1.createVertexBuffer({context:t,typedArray:m,usage:x})),e._texCoordExpandAndBatchIndexBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:y,usage:b});for(var E,P,A,w,D,M,I,R=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,F=a.length,N=0;N<F;++N)0<(o=a[N]).length&&(P=new Uint16Array(o),I=Buffer$1.createIndexBuffer({context:t,typedArray:P,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT}),L+=c[N],E=6*(N*(R*CesiumMath.SIXTY_FOUR_KILOBYTES)-L*R),M=N*(O*CesiumMath.SIXTY_FOUR_KILOBYTES)-L*O,P=[{index:attributeLocations$4.position3DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:E,strideInBytes:6*R},{index:attributeLocations$4.position3DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:P=R+E,strideInBytes:6*R},{index:attributeLocations$4.position2DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:E,strideInBytes:6*R},{index:attributeLocations$4.position2DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:P,strideInBytes:6*R},{index:attributeLocations$4.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:E=R+P,strideInBytes:6*R},{index:attributeLocations$4.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:P=R+E,strideInBytes:6*R},{index:attributeLocations$4.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:E,strideInBytes:6*R},{index:attributeLocations$4.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:P,strideInBytes:6*R},{index:attributeLocations$4.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:E=R+P,strideInBytes:6*R},{index:attributeLocations$4.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:P=R+E,strideInBytes:6*R},{index:attributeLocations$4.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:E,strideInBytes:6*R},{index:attributeLocations$4.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:P,strideInBytes:6*R},{index:attributeLocations$4.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:M}],M=g===SceneMode$1.SCENE3D?(A=e._positionBuffer,w="vertexBuffer",D=emptyVertexBuffer,"value"):g===SceneMode$1.SCENE2D||g===SceneMode$1.COLUMBUS_VIEW?(A=emptyVertexBuffer,w="value",D=e._positionBuffer,"vertexBuffer"):(A=T,D=e._positionBuffer,w="vertexBuffer"),P[0][w]=A,P[1][w]=A,P[2][M]=D,P[3][M]=D,P[4][w]=A,P[5][w]=A,P[6][M]=D,P[7][M]=D,P[8][w]=A,P[9][w]=A,P[10][M]=D,P[11][M]=D,I=new VertexArray({context:t,attributes:P,indexBuffer:I}),e._vertexArrays.push({va:I,buckets:d[N]}))}}function replacer(e,t){return t instanceof Texture?t.id:t}var scratchUniformArray=[];function createMaterialId(e){var t=Material._uniformList[e.type],i=t.length;scratchUniformArray.length=2*i;for(var r=0,n=0;n<i;++n){var a=t[n];scratchUniformArray[r]=a,scratchUniformArray[r+1]=e._uniforms[a](),r+=2}return e.type+":"+JSON.stringify(scratchUniformArray,replacer)}function sortPolylinesIntoBuckets(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,a=n.length,o=0;o<a;++o){var s,l,c=n[o];1<c._actualPositions.length&&(c.update(),(l=!defined(l=r[(s=c.material).type])?r[s.type]=new PolylineBucket(s,t,i):l).addPolyline(c))}}function updateMode$1(e,t){t=t.mode;e._mode===t&&Matrix4.equals(e._modelMatrix,e.modelMatrix)||(e._mode=t,e._modelMatrix=Matrix4.clone(e.modelMatrix),e._createVertexArray=!0)}function removePolylines(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t,i=[],r=[],n=0,a=e._polylines.length,o=0;o<a;++o)(t=e._polylines[o]).isDestroyed||(t._index=n++,r.push(t),i.push(t));e._polylines=i,e._polylinesToUpdate=r}}function releaseShaders(e){for(var t,i=e._polylines,r=i.length,n=0;n<r;++n)i[n].isDestroyed||defined(t=i[n]._bucket)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy())}function destroyVertexArrays(e){for(var t=e._vertexArrays.length,i=0;i<t;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function destroyPolylines(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)t[r].isDestroyed||t[r]._destroy()}function VertexArrayBucketLocator(e,t,i){this.count=e,this.offset=t,this.bucket=i}function PolylineBucket(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=i}function intersectsIDL(e){return Cartesian3.dot(Cartesian3.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(Plane.ORIGIN_ZX_PLANE)===Intersect$1.INTERSECTING}PolylineCollection.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},PolylineBucket.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},PolylineBucket.prototype.updateShader=function(e,t,i){var r;defined(this.shaderProgram)||(r=["DISTANCE_DISPLAY_CONDITION"],i&&r.push("VECTOR_TILE"),-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&r.push("POLYLINE_DASH"),FeatureDetection.isInternetExplorer()||r.push("CLIP_POLYLINE"),i=new ShaderSource({defines:r,sources:["varying vec4 v_pickColor;\n",this.material.shaderSource,PolylineFS$1]}),t=t.getVertexShaderCallback()(PolylineVS),t=new ShaderSource({defines:r,sources:[PolylineCommon,t]}),this.shaderProgram=ShaderProgram.fromCache({context:e,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:attributeLocations$4}))},PolylineBucket.prototype.getPolylinePositionsLength=function(e){if(this.mode===SceneMode$1.SCENE3D||!intersectsIDL(e))return 4*(r=e._actualPositions.length)-4;for(var t=0,i=e._segments.lengths,r=i.length,n=0;n<r;++n)t+=4*i[n]-4;return t};var scratchWritePosition=new Cartesian3,scratchWritePrevPosition=new Cartesian3,scratchWriteNextPosition=new Cartesian3,scratchWriteVector=new Cartesian3,scratchPickColorCartesian=new Cartesian4,scratchWidthShowCartesian=new Cartesian2;PolylineBucket.prototype.write=function(e,t,i,r,n,a,o,s){for(var l=this.mode,c=s.ellipsoid.maximumRadius*CesiumMath.PI,u=this.polylines,d=u.length,h=0;h<d;++h){for(var p,m=u[h],f=m.width,g=m.show&&0<f,_=m._index,y=this.getSegments(m,s),C=y.positions,v=y.lengths,S=C.length,T=m.getPickId(o).color,x=0,b=0,E=0;E<S;++E){0===E?m._loop?p=C[S-2]:(Cartesian3.subtract(C[0],C[1],p=scratchWriteVector),Cartesian3.add(C[0],p,p)):p=C[E-1],Cartesian3.clone(p,scratchWritePrevPosition),Cartesian3.clone(C[E],scratchWritePosition),E===S-1?m._loop?p=C[1]:(Cartesian3.subtract(C[S-1],C[S-2],p=scratchWriteVector),Cartesian3.add(C[S-1],p,p)):p=C[E+1],Cartesian3.clone(p,scratchWriteNextPosition);var P=v[x];E===b+P&&(b+=P,++x);var A=E-b==0,P=E===b+v[x]-1;l===SceneMode$1.SCENE2D&&(scratchWritePrevPosition.z=0,scratchWritePosition.z=0,scratchWriteNextPosition.z=0),l!==SceneMode$1.SCENE2D&&l!==SceneMode$1.MORPHING||(A||P)&&c-Math.abs(scratchWritePosition.x)<1&&((scratchWritePosition.x<0&&0<scratchWritePrevPosition.x||0<scratchWritePosition.x&&scratchWritePrevPosition.x<0)&&Cartesian3.clone(scratchWritePosition,scratchWritePrevPosition),(scratchWritePosition.x<0&&0<scratchWriteNextPosition.x||0<scratchWritePosition.x&&scratchWriteNextPosition.x<0)&&Cartesian3.clone(scratchWritePosition,scratchWriteNextPosition));for(var w=P?2:4,D=A?2:0;D<w;++D){EncodedCartesian3.writeElements(scratchWritePosition,e,i),EncodedCartesian3.writeElements(scratchWritePrevPosition,e,i+6),EncodedCartesian3.writeElements(scratchWriteNextPosition,e,i+12);var M=D-2<0?-1:1;t[n]=E/(S-1),t[n+1]=D%2*2-1,t[n+2]=M,t[n+3]=_,i+=18,n+=4}}var I=scratchPickColorCartesian;I.x=Color.floatToByte(T.red),I.y=Color.floatToByte(T.green),I.z=Color.floatToByte(T.blue),I.w=Color.floatToByte(T.alpha);var R=scratchWidthShowCartesian;R.x=f,R.y=g?1:0;y=l===SceneMode$1.SCENE2D?m._boundingVolume2D:m._boundingVolumeWC,T=EncodedCartesian3.fromCartesian(y.center,scratchUpdatePolylineEncodedCartesian),f=T.high,g=Cartesian4.fromElements(T.low.x,T.low.y,T.low.z,y.radius,scratchUpdatePolylineCartesian4),T=scratchNearFarCartesian2;T.x=0,T.y=Number.MAX_VALUE;y=m.distanceDisplayCondition;defined(y)&&(T.x=y.near,T.y=y.far),a.setBatchedAttribute(_,0,R),a.setBatchedAttribute(_,1,I),2<a.attributes.length&&(a.setBatchedAttribute(_,2,f),a.setBatchedAttribute(_,3,g),a.setBatchedAttribute(_,4,T))}};var morphPositionScratch=new Cartesian3,morphPrevPositionScratch=new Cartesian3,morphNextPositionScratch=new Cartesian3,morphVectorScratch=new Cartesian3;PolylineBucket.prototype.writeForMorph=function(e,t){for(var i=this.modelMatrix,r=this.polylines,n=r.length,a=0;a<n;++a)for(var o=r[a],s=o._segments.positions,l=o._segments.lengths,c=s.length,u=0,d=0,h=0;h<c;++h){0===h?o._loop?p=s[c-2]:(Cartesian3.subtract(s[0],s[1],p=morphVectorScratch),Cartesian3.add(s[0],p,p)):p=s[h-1];var p=Matrix4.multiplyByPoint(i,p,morphPrevPositionScratch),m=Matrix4.multiplyByPoint(i,s[h],morphPositionScratch);h===c-1?o._loop?f=s[1]:(Cartesian3.subtract(s[c-1],s[c-2],f=morphVectorScratch),Cartesian3.add(s[c-1],f,f)):f=s[h+1];var f=Matrix4.multiplyByPoint(i,f,morphNextPositionScratch),g=l[u];h===d+g&&(d+=g,++u);for(var _=h===d+l[u]-1?2:4,y=h-d==0?2:0;y<_;++y)EncodedCartesian3.writeElements(m,e,t),EncodedCartesian3.writeElements(p,e,t+6),EncodedCartesian3.writeElements(f,e,t+12),t+=18}};var scratchSegmentLengths=new Array(1);PolylineBucket.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,a=new VertexArrayBucketLocator(0,r,this);i[n].push(a);var o=0,s=e[e.length-1],l=0;0<s.length&&(l=s[s.length-1]+1);for(var c=this.polylines,u=c.length,d=0;d<u;++d){var h=c[d];if(h._locatorBuckets=[],this.mode===SceneMode$1.SCENE3D){var p=scratchSegmentLengths,m=h._actualPositions.length;if(!(0<m))continue;p[0]=m}else p=h._segments.lengths;var f=p.length;if(0<f){for(var g=0,_=0;_<f;++_)for(var y=p[_]-1,C=0;C<y;++C)l+4>CesiumMath.SIXTY_FOUR_KILOBYTES&&(h._locatorBuckets.push({locator:a,count:g}),g=0,t.push(4),e.push(s=[]),l=0,a.count=o,a=new VertexArrayBucketLocator(r=o=0,0,this),i[++n]=[a]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,o+=6,r+=6,l+=4;h._locatorBuckets.push({locator:a,count:g}),l+4>CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(0),e.push(s=[]),l=0,a.count=o,a=new VertexArrayBucketLocator(o=r=0,0,this),i[++n]=[a])}h._clean()}return a.count=o,r},PolylineBucket.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n<r;++n){var a=t[n];if(a===e)break;i+=a._actualLength}return i};var scratchSegments={positions:void 0,lengths:void 0},scratchLengths=new Array(1),pscratch=new Cartesian3,scratchCartographic$9=new Cartographic,scratchPositionsArray;function Vector3DTilePoints(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=void 0,this._labelCollection=void 0,this._polylineCollection=void 0,this._verticesPromise=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=when.defer(),this._resolvedPromise=!1}function packBuffer$3(e,t){var i=e._rectangle,r=e._minHeight,n=e._maxHeight,a=2+Rectangle.packedLength+Ellipsoid.packedLength,e=new Float64Array(a),a=0;return e[a++]=r,e[a++]=n,Rectangle.pack(i,e,2),a+=Rectangle.packedLength,Ellipsoid.pack(t,e,a),e}PolylineBucket.prototype.getSegments=function(e,t){var i=e._actualPositions;if(this.mode===SceneMode$1.SCENE3D)return scratchLengths[0]=i.length,scratchSegments.positions=i,scratchSegments.lengths=scratchLengths,scratchSegments;intersectsIDL(e)&&(i=e._segments.positions);for(var r,n,a=t.ellipsoid,o=[],s=this.modelMatrix,l=i.length,c=pscratch,u=0;u<l;++u)r=i[u],c=Matrix4.multiplyByPoint(s,r,c),o.push(t.project(a.cartesianToCartographic(c,scratchCartographic$9)));return 0<o.length&&(e._boundingVolume2D=BoundingSphere.fromPoints(o,e._boundingVolume2D),n=e._boundingVolume2D.center,e._boundingVolume2D.center=new Cartesian3(n.z,n.x,n.y)),scratchSegments.positions=o,scratchSegments.lengths=e._segments.lengths,scratchSegments},PolylineBucket.prototype.writeUpdate=function(e,t,i,r){var n=this.mode,a=r.ellipsoid.maximumRadius*CesiumMath.PI;if(m=t._actualLength){e+=this.getPolylineStartIndex(t);var o=scratchPositionsArray,s=6*m*3;!defined(o)||o.length<s?o=scratchPositionsArray=new Float32Array(s):o.length>s&&(o=new Float32Array(o.buffer,0,s));for(var l,r=this.getSegments(t,r),c=r.positions,u=r.lengths,d=0,h=0,p=0,m=c.length,f=0;f<m;++f){0===f?t._loop?l=c[m-2]:(Cartesian3.subtract(c[0],c[1],l=scratchWriteVector),Cartesian3.add(c[0],l,l)):l=c[f-1],Cartesian3.clone(l,scratchWritePrevPosition),Cartesian3.clone(c[f],scratchWritePosition),f===m-1?t._loop?l=c[1]:(Cartesian3.subtract(c[m-1],c[m-2],l=scratchWriteVector),Cartesian3.add(c[m-1],l,l)):l=c[f+1],Cartesian3.clone(l,scratchWriteNextPosition);var g=u[h];f===p+g&&(p+=g,++h);var _=f-p==0,g=f===p+u[h]-1;n===SceneMode$1.SCENE2D&&(scratchWritePrevPosition.z=0,scratchWritePosition.z=0,scratchWriteNextPosition.z=0),n!==SceneMode$1.SCENE2D&&n!==SceneMode$1.MORPHING||(_||g)&&a-Math.abs(scratchWritePosition.x)<1&&((scratchWritePosition.x<0&&0<scratchWritePrevPosition.x||0<scratchWritePosition.x&&scratchWritePrevPosition.x<0)&&Cartesian3.clone(scratchWritePosition,scratchWritePrevPosition),(scratchWritePosition.x<0&&0<scratchWriteNextPosition.x||0<scratchWritePosition.x&&scratchWriteNextPosition.x<0)&&Cartesian3.clone(scratchWritePosition,scratchWriteNextPosition));for(var y=g?2:4,C=_?2:0;C<y;++C)EncodedCartesian3.writeElements(scratchWritePosition,o,d),EncodedCartesian3.writeElements(scratchWritePrevPosition,o,d+6),EncodedCartesian3.writeElements(scratchWriteNextPosition,o,d+12),d+=18}i.copyFromArrayView(o,18*Float32Array.BYTES_PER_ELEMENT*e)}},Object.defineProperties(Vector3DTilePoints.prototype,{pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){return this._billboardCollection.textureAtlas.texture.sizeInBytes+this._labelCollection._textureAtlas.texture.sizeInBytes}},readyPromise:{get:function(){return this._readyPromise.promise}}});var createVerticesTaskProcessor$3=new TaskProcessor("createVectorTilePoints",5),scratchPosition$3=new Cartesian3;function createPoints(t,e){if(!defined(t._billboardCollection)){if(!defined(t._verticesPromise)){var i=t._positions,r=t._packedBuffer;defined(r)||(i=t._positions=arraySlice(i),t._batchIds=arraySlice(t._batchIds),r=t._packedBuffer=packBuffer$3(t,e));var n=[i.buffer,r.buffer],r={positions:i.buffer,packedBuffer:r.buffer},n=t._verticesPromise=createVerticesTaskProcessor$3.scheduleTask(r,n);if(!defined(n))return;n.then(function(e){t._positions=new Float64Array(e.positions),t._ready=!0})}if(t._ready&&!defined(t._billboardCollection)){i=t._positions;var n=t._batchTable,a=t._batchIds,o=t._billboardCollection=new BillboardCollection({batchTable:n}),s=t._labelCollection=new LabelCollection({batchTable:n}),l=t._polylineCollection=new PolylineCollection;l._useHighlightColor=!0;for(var c=i.length/3,u=0;u<c;++u){var d=a[u],h=Cartesian3.unpack(i,3*u,scratchPosition$3),p=o.add();p.position=h,p._batchIndex=d;p=s.add();p.text=" ",p.position=h,p._batchIndex=d,l.add().positions=[Cartesian3.clone(h),Cartesian3.clone(h)]}t._positions=void 0,t._packedBuffer=void 0}}}function clearStyle$2(e,t){for(var i=e._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.show=!0,a.pointSize=Cesium3DTilePointFeature.defaultPointSize,a.color=Cesium3DTilePointFeature.defaultColor,a.pointOutlineColor=Cesium3DTilePointFeature.defaultPointOutlineColor,a.pointOutlineWidth=Cesium3DTilePointFeature.defaultPointOutlineWidth,a.labelColor=Color.WHITE,a.labelOutlineColor=Color.WHITE,a.labelOutlineWidth=1,a.font="30px sans-serif",a.labelStyle=LabelStyle$1.FILL,a.labelText=void 0,a.backgroundColor=new Color(.165,.165,.165,.8),a.backgroundPadding=new Cartesian2(7,5),a.backgroundEnabled=!1,a.scaleByDistance=void 0,a.translucencyByDistance=void 0,a.distanceDisplayCondition=void 0,a.heightOffset=0,a.anchorLineEnabled=!1,a.anchorLineColor=Color.WHITE,a.image=void 0,a.disableDepthTestDistance=0,a.horizontalOrigin=HorizontalOrigin$1.CENTER,a.verticalOrigin=VerticalOrigin$1.CENTER,a.labelHorizontalOrigin=HorizontalOrigin$1.RIGHT,a.labelVerticalOrigin=VerticalOrigin$1.BASELINE}}Vector3DTilePoints.prototype.createFeatures=function(e,t){for(var i=this._billboardCollection,r=this._labelCollection,n=this._polylineCollection,a=this._batchIds,o=a.length,s=0;s<o;++s){var l=a[s],c=i.get(s),u=r.get(s),d=n.get(s);t[l]=new Cesium3DTilePointFeature(e,l,c,u,d)}},Vector3DTilePoints.prototype.applyDebugSettings=function(e,t){e?(Color.clone(t,this._billboardCollection._highlightColor),Color.clone(t,this._labelCollection._highlightColor),Color.clone(t,this._polylineCollection._highlightColor)):(Color.clone(Color.WHITE,this._billboardCollection._highlightColor),Color.clone(Color.WHITE,this._labelCollection._highlightColor),Color.clone(Color.WHITE,this._polylineCollection._highlightColor))};var scratchColor$h=new Color,scratchColor2=new Color,scratchColor3=new Color,scratchColor4=new Color,scratchColor5=new Color,scratchColor6=new Color,scratchScaleByDistance=new NearFarScalar,scratchTranslucencyByDistance=new NearFarScalar,scratchDistanceDisplayCondition=new DistanceDisplayCondition;function Vector3DTilePolygons(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=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=defaultValue(e.center,Cartesian3.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._readyPromise=when.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ClassificationType$1.BOTH}function packBuffer$2(e){var t=new Float64Array(3+Cartesian3.packedLength+Ellipsoid.packedLength+Rectangle.packedLength),i=0;return t[i++]=e._indices.BYTES_PER_ELEMENT,t[i++]=e._minimumHeight,t[i++]=e._maximumHeight,Cartesian3.pack(e._center,t,3),i+=Cartesian3.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,Rectangle.pack(e._rectangle,t,i),t}function unpackBuffer(e,t){for(var i=1,r=t[i++],n=e._boundingVolumes=new Array(r),a=0;a<r;++a)n[a]=OrientedBoundingBox.unpack(t,i),i+=OrientedBoundingBox.packedLength;for(var o=t[i++],s=e._batchedIndices=new Array(o),l=0;l<o;++l){var c=Color.unpack(t,i);i+=Color.packedLength;for(var u=t[i++],d=t[i++],h=t[i++],p=new Array(h),m=0;m<h;++m)p[m]=t[i++];s[l]=new Vector3DTileBatch({color:c,offset:u,count:d,batchIds:p})}}Vector3DTilePoints.prototype.applyStyle=function(e,t){if(defined(e))for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a,o,s=t[i[n]];defined(e.show)&&(s.show=e.show.evaluate(s)),defined(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),defined(e.color)&&(s.color=e.color.evaluateColor(s,scratchColor$h)),defined(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,scratchColor2)),defined(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),defined(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,scratchColor3)),defined(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,scratchColor4)),defined(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),defined(e.font)&&(s.font=e.font.evaluate(s)),defined(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),defined(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,defined(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,scratchColor5)),defined(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),defined(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),defined(e.scaleByDistance)?(a=e.scaleByDistance.evaluate(s),scratchScaleByDistance.near=a.x,scratchScaleByDistance.nearValue=a.y,scratchScaleByDistance.far=a.z,scratchScaleByDistance.farValue=a.w,s.scaleByDistance=scratchScaleByDistance):s.scaleByDistance=void 0,defined(e.translucencyByDistance)?(o=e.translucencyByDistance.evaluate(s),scratchTranslucencyByDistance.near=o.x,scratchTranslucencyByDistance.nearValue=o.y,scratchTranslucencyByDistance.far=o.z,scratchTranslucencyByDistance.farValue=o.w,s.translucencyByDistance=scratchTranslucencyByDistance):s.translucencyByDistance=void 0,defined(e.distanceDisplayCondition)?(o=e.distanceDisplayCondition.evaluate(s),scratchDistanceDisplayCondition.near=o.x,scratchDistanceDisplayCondition.far=o.y,s.distanceDisplayCondition=scratchDistanceDisplayCondition):s.distanceDisplayCondition=void 0,defined(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),defined(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),defined(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,scratchColor6)),defined(e.image)?s.image=e.image.evaluate(s):s.image=void 0,defined(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),defined(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),defined(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),defined(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),defined(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}else clearStyle$2(this,t)},Vector3DTilePoints.prototype.update=function(e){createPoints(this,e.mapProjection.ellipsoid),this._ready&&(this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e),this._resolvedPromise||(this._readyPromise.resolve(),this._resolvedPromise=!0))},Vector3DTilePoints.prototype.isDestroyed=function(){return!1},Vector3DTilePoints.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(),destroyObject(this)},Object.defineProperties(Vector3DTilePolygons.prototype,{trianglesLength:{get:function(){return defined(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return defined(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}});var createVerticesTaskProcessor$2=new TaskProcessor("createVectorTilePolygons",5),scratchColor$g=new Color;function createPrimitive(r){if(!defined(r._primitive)){if(!defined(r._verticesPromise)){var e=r._positions,t=r._counts,i=r._indexCounts,n=r._indices,a=r._transferrableBatchIds,o=r._batchTableColors,s=r._packedBuffer;if(!defined(o)){e=r._positions=arraySlice(r._positions),t=r._counts=arraySlice(r._counts),i=r._indexCounts=arraySlice(r._indexCounts),n=r._indices=arraySlice(r._indices),r._center=r._ellipsoid.cartographicToCartesian(Rectangle.center(r._rectangle));for(var a=r._transferrableBatchIds=new Uint32Array(r._batchIds),o=r._batchTableColors=new Uint32Array(a.length),l=r._batchTable,c=o.length,u=0;u<c;++u){var d=l.getColor(u,scratchColor$g);o[u]=d.toRgba()}s=r._packedBuffer=packBuffer$2(r)}var h=[e.buffer,t.buffer,i.buffer,n.buffer,a.buffer,o.buffer,s.buffer],i={packedBuffer:s.buffer,positions:e.buffer,counts:t.buffer,indexCounts:i.buffer,indices:n.buffer,batchIds:a.buffer,batchTableColors:o.buffer},n=r._polygonMinimumHeights,a=r._polygonMaximumHeights;defined(n)&&defined(a)&&(n=arraySlice(n),a=arraySlice(a),h.push(n.buffer,a.buffer),i.minimumHeights=n,i.maximumHeights=a);h=r._verticesPromise=createVerticesTaskProcessor$2.scheduleTask(i,h);if(!defined(h))return;when(h,function(e){r._positions=void 0,r._counts=void 0,r._polygonMinimumHeights=void 0,r._polygonMaximumHeights=void 0;var t=new Float64Array(e.packedBuffer),i=t[0];unpackBuffer(r,t),r._indices=new(2===IndexDatatype$1.getSizeInBytes(i)?Uint16Array:Uint32Array)(e.indices),r._indexOffsets=new Uint32Array(e.indexOffsets),r._indexCounts=new Uint32Array(e.indexCounts),r._batchedPositions=new Float32Array(e.positions),r._vertexBatchIds=new Uint16Array(e.batchIds),r._ready=!0})}r._ready&&!defined(r._primitive)&&(r._primitive=new Vector3DTilePrimitive({batchTable:r._batchTable,positions:r._batchedPositions,batchIds:r._batchIds,vertexBatchIds:r._vertexBatchIds,indices:r._indices,indexOffsets:r._indexOffsets,indexCounts:r._indexCounts,batchedIndices:r._batchedIndices,boundingVolume:r._boundingVolume,boundingVolumes:r._boundingVolumes,center:r._center}),r._batchTable=void 0,r._batchIds=void 0,r._positions=void 0,r._counts=void 0,r._indices=void 0,r._indexCounts=void 0,r._indexOffsets=void 0,r._batchTableColors=void 0,r._packedBuffer=void 0,r._batchedPositions=void 0,r._transferrableBatchIds=void 0,r._vertexBatchIds=void 0,r._ellipsoid=void 0,r._minimumHeight=void 0,r._maximumHeight=void 0,r._polygonMinimumHeights=void 0,r._polygonMaximumHeights=void 0,r._center=void 0,r._rectangle=void 0,r._boundingVolume=void 0,r._boundingVolumes=void 0,r._batchedIndices=void 0,r._verticesPromise=void 0,r._readyPromise.resolve())}}Vector3DTilePolygons.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},Vector3DTilePolygons.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},Vector3DTilePolygons.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},Vector3DTilePolygons.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},Vector3DTilePolygons.prototype.update=function(e){createPrimitive(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},Vector3DTilePolygons.prototype.isDestroyed=function(){return!1},Vector3DTilePolygons.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)};var Vector3DTilePolylinesVS="attribute vec4 currentPosition;\nattribute vec4 previousPosition;\nattribute vec4 nextPosition;\nattribute vec2 expandAndWidth;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelView;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = u_modifiedModelView * currentPosition;\nvec4 prev = u_modifiedModelView * previousPosition;\nvec4 next = u_modifiedModelView * nextPosition;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n";function Vector3DTilePolylines(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.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._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=Color.clone(Color.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._readyPromise=when.defer(),this._verticesPromise=void 0}function packBuffer$1(e){var t=e._rectangle,i=e._minimumHeight,r=e._maximumHeight,n=e._ellipsoid,a=e._center,o=2+Rectangle.packedLength+Ellipsoid.packedLength+Cartesian3.packedLength,e=new Float64Array(o),o=0;return e[o++]=i,e[o++]=r,Rectangle.pack(t,e,2),o+=Rectangle.packedLength,Ellipsoid.pack(n,e,o),o+=Ellipsoid.packedLength,Cartesian3.pack(a,e,o),e}Object.defineProperties(Vector3DTilePolylines.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise.promise}}});var createVerticesTaskProcessor$1=new TaskProcessor("createVectorTilePolylines",5),attributeLocations$3={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function createVertexArray$1(i,e){if(!defined(i._va)){if(!defined(i._verticesPromise)){var t=i._positions,r=i._widths,n=i._counts,a=i._transferrableBatchIds,o=i._packedBuffer;defined(o)||(t=i._positions=arraySlice(t),r=i._widths=arraySlice(r),n=i._counts=arraySlice(n),a=i._transferrableBatchIds=arraySlice(i._batchIds),o=i._packedBuffer=packBuffer$1(i));var s=[t.buffer,r.buffer,n.buffer,a.buffer,o.buffer],l={positions:t.buffer,widths:r.buffer,counts:n.buffer,batchIds:a.buffer,packedBuffer:o.buffer},t=i._verticesPromise=createVerticesTaskProcessor$1.scheduleTask(l,s);if(!defined(t))return;when(t).then(function(e){i._currentPositions=new Float32Array(e.currentPositions),i._previousPositions=new Float32Array(e.previousPositions),i._nextPositions=new Float32Array(e.nextPositions),i._expandAndWidth=new Float32Array(e.expandAndWidth),i._vertexBatchIds=new Uint16Array(e.batchIds);var t=e.indexDatatype;i._indices=new(t===IndexDatatype$1.UNSIGNED_SHORT?Uint16Array:Uint32Array)(e.indices),i._ready=!0}).otherwise(function(e){i._readyPromise.reject(e)})}i._ready&&!defined(i._va)&&(r=i._currentPositions,n=i._previousPositions,a=i._nextPositions,o=i._expandAndWidth,l=i._vertexBatchIds,s=i._indices,t=n.byteLength+r.byteLength+a.byteLength,t+=o.byteLength+l.byteLength+s.byteLength,i._trianglesLength=s.length/3,i._geometryByteLength=t,n=Buffer$1.createVertexBuffer({context:e,typedArray:n,usage:BufferUsage$1.STATIC_DRAW}),r=Buffer$1.createVertexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW}),a=Buffer$1.createVertexBuffer({context:e,typedArray:a,usage:BufferUsage$1.STATIC_DRAW}),o=Buffer$1.createVertexBuffer({context:e,typedArray:o,usage:BufferUsage$1.STATIC_DRAW}),l=Buffer$1.createVertexBuffer({context:e,typedArray:l,usage:BufferUsage$1.STATIC_DRAW}),s=Buffer$1.createIndexBuffer({context:e,typedArray:s,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:2===s.BYTES_PER_ELEMENT?IndexDatatype$1.UNSIGNED_SHORT:IndexDatatype$1.UNSIGNED_INT}),l=[{index:attributeLocations$3.previousPosition,vertexBuffer:n,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{index:attributeLocations$3.currentPosition,vertexBuffer:r,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{index:attributeLocations$3.nextPosition,vertexBuffer:a,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{index:attributeLocations$3.expandAndWidth,vertexBuffer:o,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2},{index:attributeLocations$3.a_batchId,vertexBuffer:l,componentDatatype:ComponentDatatype$1.UNSIGNED_SHORT,componentsPerAttribute:1}],i._va=new VertexArray({context:e,attributes:l,indexBuffer:s}),i._positions=void 0,i._widths=void 0,i._counts=void 0,i._ellipsoid=void 0,i._minimumHeight=void 0,i._maximumHeight=void 0,i._rectangle=void 0,i._transferrableBatchIds=void 0,i._packedBuffer=void 0,i._currentPositions=void 0,i._previousPositions=void 0,i._nextPositions=void 0,i._expandAndWidth=void 0,i._vertexBatchIds=void 0,i._indices=void 0,i._readyPromise.resolve())}}var modifiedModelViewScratch$2=new Matrix4,rtcScratch$2=new Cartesian3;function createUniformMap$3(t,i){defined(t._uniformMap)||(t._uniformMap={u_modifiedModelView:function(){var e=i.uniformState.view;return Matrix4.clone(e,modifiedModelViewScratch$2),Matrix4.multiplyByPoint(modifiedModelViewScratch$2,t._center,rtcScratch$2),Matrix4.setTranslation(modifiedModelViewScratch$2,rtcScratch$2,modifiedModelViewScratch$2),modifiedModelViewScratch$2},u_highlightColor:function(){return t._highlightColor}})}function createRenderStates$2(e){defined(e._rs)||(e._rs=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:{enabled:!0,factor:-5,units:-5}}))}var PolylineFS="uniform vec4 u_highlightColor; \nvoid main()\n{\n gl_FragColor = u_highlightColor;\n}\n";function createShaders$1(e,t){var i,r;defined(e._sp)||(i=(r=e._batchTable).getVertexShaderCallback(!1,"a_batchId",void 0)(Vector3DTilePolylinesVS),r=r.getFragmentShaderCallback(!1,void 0,!1)(PolylineFS),i=new ShaderSource({defines:["VECTOR_TILE",FeatureDetection.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[PolylineCommon,i]}),r=new ShaderSource({defines:["VECTOR_TILE"],sources:[r]}),e._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:i,fragmentShaderSource:r,attributeLocations:attributeLocations$3}))}function queueCommands$1(e,t){var i;defined(e._command)||(i=e._batchTable.getUniformMapCallback()(e._uniformMap),e._command=new DrawCommand({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:i,boundingVolume:e._boundingVolume,pass:Pass$1.TRANSLUCENT,pickId:e._batchTable.getPickId()})),t.commandList.push(e._command)}function clearStyle$1(e,t){for(var i=e._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.show=!0,a.color=Color.WHITE}}Vector3DTilePolylines.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=i[n];t[a]=new Cesium3DTileFeature(e,a)}},Vector3DTilePolylines.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var scratchColor$f=new Color,DEFAULT_COLOR_VALUE$1=Color.WHITE,DEFAULT_SHOW_VALUE$1=!0;Vector3DTilePolylines.prototype.applyStyle=function(e,t){if(defined(e))for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.color=defined(e.color)?e.color.evaluateColor(a,scratchColor$f):DEFAULT_COLOR_VALUE$1,a.show=defined(e.show)?e.show.evaluate(a):DEFAULT_SHOW_VALUE$1}else clearStyle$1(this,t)},Vector3DTilePolylines.prototype.update=function(e){var t=e.context;createVertexArray$1(this,t),createUniformMap$3(this,t),createShaders$1(this,t),createRenderStates$2(this),!this._ready||((t=e.passes).render||t.pick)&&queueCommands$1(this,e)},Vector3DTilePolylines.prototype.isDestroyed=function(){return!1},Vector3DTilePolylines.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),destroyObject(this)};var Vector3DTileClampedPolylinesVS="attribute vec3 startEllipsoidNormal;\nattribute vec3 endEllipsoidNormal;\nattribute vec4 startPositionAndHeight;\nattribute vec4 endPositionAndHeight;\nattribute vec4 startFaceNormalAndVertexCorner;\nattribute vec4 endFaceNormalAndHalfWidth;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelView;\nuniform vec2 u_minimumMaximumVectorHeights;\nvarying vec4 v_startPlaneEC;\nvarying vec4 v_endPlaneEC;\nvarying vec4 v_rightPlaneEC;\nvarying float v_halfWidth;\nvarying vec3 v_volumeUpEC;\nvoid main()\n{\nfloat isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251);\nfloat isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd));\nvec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;\nvec3 right = normalize(cross(forward, startEllipsoidNormal));\nvec4 position = vec4(startPositionAndHeight.xyz, 1.0);\nposition.xyz += forward * isEnd;\nv_volumeUpEC = czm_normal * normalize(cross(right, forward));\nfloat offset;\nvec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);\noffset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);\noffset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;\nposition.xyz += offset * ellipsoidNormal;\nposition = u_modifiedModelView * position;\nright = czm_normal * right;\nvec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);\nscratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));\nvec3 miterPushNormal = czm_normal * normalize(scratchNormal);\noffset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position));\noffset = offset / dot(miterPushNormal, right);\nposition.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));\ngl_Position = czm_depthClamp(czm_projection * position);\nposition = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);\nvec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;\nv_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));\nv_rightPlaneEC = vec4(right, -dot(right, position.xyz));\nposition = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);\nvec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;\nv_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));\nv_halfWidth = endFaceNormalAndHalfWidth.w;\n}\n",Vector3DTileClampedPolylinesFS="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying vec4 v_startPlaneEC;\nvarying vec4 v_endPlaneEC;\nvarying vec4 v_rightPlaneEC;\nvarying float v_halfWidth;\nvarying vec3 v_volumeUpEC;\nuniform vec4 u_highlightColor;\nvoid main()\n{\nfloat logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\nif (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\ngl_FragColor = vec4(0.0, 0.0, 1.0, 0.5);\nreturn;\n#else // DEBUG_SHOW_VOLUME\ndiscard;\n#endif // DEBUG_SHOW_VOLUME\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);\nhalfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));\nfloat widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\nfloat distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);\nfloat distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);\nif (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\ngl_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);\nreturn;\n#else // DEBUG_SHOW_VOLUME\ndiscard;\n#endif // DEBUG_SHOW_VOLUME\n}\ngl_FragColor = u_highlightColor;\nczm_writeDepthClamp();\n}\n";function Vector3DTileClampedPolylines(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.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._tileset=e.tileset,this._minimumMaximumVectorHeights=new Cartesian2(ApproximateTerrainHeights._defaultMinTerrainHeight,ApproximateTerrainHeights._defaultMaxTerrainHeight),this._boundingVolume=OrientedBoundingBox.fromRectangle(e.rectangle,ApproximateTerrainHeights._defaultMinTerrainHeight,ApproximateTerrainHeights._defaultMaxTerrainHeight,this._ellipsoid),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=Color.clone(Color.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._readyPromise=when.defer(),this._verticesPromise=void 0;var t=this;ApproximateTerrainHeights.initialize().then(function(){updateMinimumMaximumHeights(t,t._rectangle,t._ellipsoid)}).otherwise(function(e){this._readyPromise.reject(e)})}function updateMinimumMaximumHeights(e,t,i){var r=ApproximateTerrainHeights.getMinimumMaximumHeights(t,i),n=r.minimumTerrainHeight,t=r.maximumTerrainHeight,r=e._minimumMaximumVectorHeights;r.x=n,r.y=t;r=e._boundingVolume,e=e._rectangle;OrientedBoundingBox.fromRectangle(e,n,t,i,r)}function packBuffer(e){var t=e._rectangle,i=e._minimumHeight,r=e._maximumHeight,n=e._ellipsoid,a=e._center,o=2+Rectangle.packedLength+Ellipsoid.packedLength+Cartesian3.packedLength,e=new Float64Array(o),o=0;return e[o++]=i,e[o++]=r,Rectangle.pack(t,e,2),o+=Rectangle.packedLength,Ellipsoid.pack(n,e,o),o+=Ellipsoid.packedLength,Cartesian3.pack(a,e,o),e}Object.defineProperties(Vector3DTileClampedPolylines.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise.promise}}});var createVerticesTaskProcessor=new TaskProcessor("createVectorTileClampedPolylines"),attributeLocations$2={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function createVertexArray(i,e){if(!defined(i._va)){if(!defined(i._verticesPromise)){var t=i._positions,r=i._widths,n=i._counts,a=i._transferrableBatchIds,o=i._packedBuffer;defined(o)||(t=i._positions=arraySlice(t),r=i._widths=arraySlice(r),n=i._counts=arraySlice(n),a=i._transferrableBatchIds=arraySlice(i._batchIds),o=i._packedBuffer=packBuffer(i));var s=[t.buffer,r.buffer,n.buffer,a.buffer,o.buffer],l={positions:t.buffer,widths:r.buffer,counts:n.buffer,batchIds:a.buffer,packedBuffer:o.buffer},c=i._verticesPromise=createVerticesTaskProcessor.scheduleTask(l,s);if(!defined(c))return;when(c,function(e){i._startEllipsoidNormals=new Float32Array(e.startEllipsoidNormals),i._endEllipsoidNormals=new Float32Array(e.endEllipsoidNormals),i._startPositionAndHeights=new Float32Array(e.startPositionAndHeights),i._startFaceNormalAndVertexCornerIds=new Float32Array(e.startFaceNormalAndVertexCornerIds),i._endPositionAndHeights=new Float32Array(e.endPositionAndHeights),i._endFaceNormalAndHalfWidths=new Float32Array(e.endFaceNormalAndHalfWidths),i._vertexBatchIds=new Uint16Array(e.vertexBatchIds);var t=e.indexDatatype;i._indices=new(t===IndexDatatype$1.UNSIGNED_SHORT?Uint16Array:Uint32Array)(e.indices),i._ready=!0}).otherwise(function(e){i._readyPromise.reject(e)})}var u;i._ready&&!defined(i._va)&&(u=i._startEllipsoidNormals,t=i._endEllipsoidNormals,r=i._startPositionAndHeights,n=i._endPositionAndHeights,a=i._startFaceNormalAndVertexCornerIds,o=i._endFaceNormalAndHalfWidths,l=i._vertexBatchIds,s=i._indices,c=u.byteLength+t.byteLength,c+=r.byteLength+n.byteLength,c+=a.byteLength+o.byteLength,c+=l.byteLength+s.byteLength,i._trianglesLength=s.length/3,i._geometryByteLength=c,u=Buffer$1.createVertexBuffer({context:e,typedArray:u,usage:BufferUsage$1.STATIC_DRAW}),t=Buffer$1.createVertexBuffer({context:e,typedArray:t,usage:BufferUsage$1.STATIC_DRAW}),r=Buffer$1.createVertexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW}),n=Buffer$1.createVertexBuffer({context:e,typedArray:n,usage:BufferUsage$1.STATIC_DRAW}),a=Buffer$1.createVertexBuffer({context:e,typedArray:a,usage:BufferUsage$1.STATIC_DRAW}),o=Buffer$1.createVertexBuffer({context:e,typedArray:o,usage:BufferUsage$1.STATIC_DRAW}),l=Buffer$1.createVertexBuffer({context:e,typedArray:l,usage:BufferUsage$1.STATIC_DRAW}),s=Buffer$1.createIndexBuffer({context:e,typedArray:s,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:2===s.BYTES_PER_ELEMENT?IndexDatatype$1.UNSIGNED_SHORT:IndexDatatype$1.UNSIGNED_INT}),l=[{index:attributeLocations$2.startEllipsoidNormal,vertexBuffer:u,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{index:attributeLocations$2.endEllipsoidNormal,vertexBuffer:t,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{index:attributeLocations$2.startPositionAndHeight,vertexBuffer:r,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4},{index:attributeLocations$2.endPositionAndHeight,vertexBuffer:n,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4},{index:attributeLocations$2.startFaceNormalAndVertexCorner,vertexBuffer:a,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4},{index:attributeLocations$2.endFaceNormalAndHalfWidth,vertexBuffer:o,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4},{index:attributeLocations$2.a_batchId,vertexBuffer:l,componentDatatype:ComponentDatatype$1.UNSIGNED_SHORT,componentsPerAttribute:1}],i._va=new VertexArray({context:e,attributes:l,indexBuffer:s}),i._positions=void 0,i._widths=void 0,i._counts=void 0,i._ellipsoid=void 0,i._minimumHeight=void 0,i._maximumHeight=void 0,i._rectangle=void 0,i._transferrableBatchIds=void 0,i._packedBuffer=void 0,i._startEllipsoidNormals=void 0,i._endEllipsoidNormals=void 0,i._startPositionAndHeights=void 0,i._startFaceNormalAndVertexCornerIds=void 0,i._endPositionAndHeights=void 0,i._endFaceNormalAndHalfWidths=void 0,i._vertexBatchIds=void 0,i._indices=void 0,i._readyPromise.resolve())}}var modifiedModelViewScratch$1=new Matrix4,rtcScratch$1=new Cartesian3;function createUniformMap$2(t,i){defined(t._uniformMap)||(t._uniformMap={u_modifiedModelView:function(){var e=i.uniformState.view;return Matrix4.clone(e,modifiedModelViewScratch$1),Matrix4.multiplyByPoint(modifiedModelViewScratch$1,t._center,rtcScratch$1),Matrix4.setTranslation(modifiedModelViewScratch$1,rtcScratch$1,modifiedModelViewScratch$1),modifiedModelViewScratch$1},u_highlightColor:function(){return t._highlightColor},u_minimumMaximumVectorHeights:function(){return t._minimumMaximumVectorHeights}})}function getRenderState(e){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})}function createRenderStates$1(e){defined(e._rs)||(e._rs=getRenderState(!1),e._rs3DTiles=getRenderState(!0))}function createShaders(e,t){var i,r;defined(e._sp)||(i=(r=e._batchTable).getVertexShaderCallback(!1,"a_batchId",void 0)(Vector3DTileClampedPolylinesVS),r=r.getFragmentShaderCallback(!1,void 0,!0)(Vector3DTileClampedPolylinesFS),i=new ShaderSource({defines:["VECTOR_TILE",FeatureDetection.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[PolylineCommon,i]}),r=new ShaderSource({defines:["VECTOR_TILE"],sources:[r]}),e._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:i,fragmentShaderSource:r,attributeLocations:attributeLocations$2}))}function queueCommands(e,t){var i,r=e._command;defined(e._command)||(i=e._batchTable.getUniformMapCallback()(e._uniformMap),r=e._command=new DrawCommand({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:i,boundingVolume:e._boundingVolume,pass:Pass$1.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()}),(i=DrawCommand.shallowClone(r,r.derivedCommands.tileset)).renderState=e._rs3DTiles,i.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=i);e=e._tileset.classificationType;e!==ClassificationType$1.TERRAIN&&e!==ClassificationType$1.BOTH||t.commandList.push(r),e!==ClassificationType$1.CESIUM_3D_TILE&&e!==ClassificationType$1.BOTH||t.commandList.push(r.derivedCommands.tileset)}function clearStyle(e,t){for(var i=e._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.show=!0,a.color=Color.WHITE}}Vector3DTileClampedPolylines.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=i[n];t[a]=new Cesium3DTileFeature(e,a)}},Vector3DTileClampedPolylines.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var scratchColor$e=new Color,DEFAULT_COLOR_VALUE=Color.WHITE,DEFAULT_SHOW_VALUE=!0;function Vector3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._contentReadyPromise=void 0,this._readyPromise=when.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,initialize(this,r,n)}function createColorChangedCallback(i){return function(e,t){defined(i._polygons)&&i._polygons.updateCommands(e,t)}}function getBatchIds(e,t){var i,r,n,a,o,s=defaultValue(e.POLYGONS_LENGTH,0),l=defaultValue(e.POLYLINES_LENGTH,0),c=defaultValue(e.POINTS_LENGTH,0);0<s&&defined(e.POLYGON_BATCH_IDS)&&(n=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset,r=new Uint16Array(t.buffer,n,s)),0<l&&defined(e.POLYLINE_BATCH_IDS)&&(n=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset,a=new Uint16Array(t.buffer,n,l)),0<c&&defined(e.POINT_BATCH_IDS)&&(u=t.byteOffset+e.POINT_BATCH_IDS.byteOffset,o=new Uint16Array(t.buffer,u,c));var t=defined(r)||defined(a)||defined(o),u=0<s&&!defined(r)||0<l&&!defined(a)||0<c&&!defined(o);if(t&&u)throw new RuntimeError("If one group of batch ids is defined, then all batch ids must be defined.");if(!defined(r)&&!defined(a)&&!defined(o)){var d=0;if(!defined(r)&&0<s)for(r=new Uint16Array(s),i=0;i<s;++i)r[i]=d++;if(!defined(a)&&0<l)for(a=new Uint16Array(l),i=0;i<l;++i)a[i]=d++;if(!defined(o)&&0<c)for(o=new Uint16Array(c),i=0;i<c;++i)o[i]=d++}return{polygons:r,polylines:a,points:o}}Vector3DTileClampedPolylines.prototype.applyStyle=function(e,t){if(defined(e))for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.color=defined(e.color)?e.color.evaluateColor(a,scratchColor$e):DEFAULT_COLOR_VALUE,a.show=defined(e.show)?e.show.evaluate(a):DEFAULT_SHOW_VALUE}else clearStyle(this,t)},Vector3DTileClampedPolylines.prototype.update=function(e){var t=e.context;createVertexArray(this,t),createUniformMap$2(this,t),createShaders(this,t),createRenderStates$1(this),!this._ready||((t=e.passes).render||t.pick)&&queueCommands(this,e)},Vector3DTileClampedPolylines.prototype.isDestroyed=function(){return!1},Vector3DTileClampedPolylines.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),destroyObject(this)},Object.defineProperties(Vector3DTileContent.prototype,{featuresLength:{get:function(){return defined(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return defined(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){var e=0;return defined(this._polygons)&&(e+=this._polygons.trianglesLength),defined(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){var e=0;return defined(this._polygons)&&(e+=this._polygons.geometryByteLength),defined(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return defined(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return defined(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var sizeOfUint32=Uint32Array.BYTES_PER_ELEMENT;function createFloatingPolylines(e){return new Vector3DTilePolylines(e)}function createClampedPolylines(e){return new Vector3DTileClampedPolylines(e)}function initialize(e,t,i){i=defaultValue(i,0);var r=new Uint8Array(t),n=new DataView(t),a=n.getUint32(i+=sizeOfUint32,!0);if(1!==a)throw new RuntimeError("Only Vector tile version 1 is supported. Version "+a+" is not.");var o=n.getUint32(i+=sizeOfUint32,!0);if(i+=sizeOfUint32,0!==o){var s=n.getUint32(i,!0);if(i+=sizeOfUint32,0===s)throw new RuntimeError("Feature table must have a byte length greater than zero");var l=n.getUint32(i,!0),c=n.getUint32(i+=sizeOfUint32,!0),u=n.getUint32(i+=sizeOfUint32,!0),d=n.getUint32(i+=sizeOfUint32,!0),h=n.getUint32(i+=sizeOfUint32,!0),p=n.getUint32(i+=sizeOfUint32,!0),m=n.getUint32(i+=sizeOfUint32,!0),f=getJsonFromTypedArray(r,i+=sizeOfUint32,s);i+=s;var g=new Uint8Array(t,i,l);i+=l,0<c&&(v=getJsonFromTypedArray(r,i,c),i+=c,0<u&&(S=new Uint8Array(t,i,u),S=new Uint8Array(S),i+=u));var _=defaultValue(f.POLYGONS_LENGTH,0),y=defaultValue(f.POLYLINES_LENGTH,0),C=defaultValue(f.POINTS_LENGTH,0),a=_+y+C,o=new Cesium3DTileBatchTable(e,a,v,S,createColorChangedCallback(e));if(e._batchTable=o,0!==a){n=new Cesium3DTileFeatureTable(f,g),s=n.getGlobalProperty("REGION");if(!defined(s))throw new RuntimeError("Feature table global property: REGION must be defined");var l=Rectangle.unpack(s),r=s[4],c=s[5],u=e._tile.computedTransform,v=n.getGlobalProperty("RTC_CENTER",ComponentDatatype$1.FLOAT,3);defined(v)?(v=Cartesian3.unpack(v),Matrix4.multiplyByPoint(u,v,v)):((v=Rectangle.center(l)).height=CesiumMath.lerp(r,c,.5),v=Ellipsoid.WGS84.cartographicToCartesian(v));var S=getBatchIds(f,g);if(i+=i%4,0<_){n.featuresLength=_;a=defaultValue(n.getPropertyArray("POLYGON_COUNTS",ComponentDatatype$1.UNSIGNED_INT,1),n.getPropertyArray("POLYGON_COUNT",ComponentDatatype$1.UNSIGNED_INT,1));if(!defined(a))throw new RuntimeError("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");s=defaultValue(n.getPropertyArray("POLYGON_INDEX_COUNTS",ComponentDatatype$1.UNSIGNED_INT,1),n.getPropertyArray("POLYGON_INDEX_COUNT",ComponentDatatype$1.UNSIGNED_INT,1));if(!defined(s))throw new RuntimeError("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");g=a.reduce(function(e,t){return e+2*t},0),_=s.reduce(function(e,t){return e+t},0),_=new Uint32Array(t,i,_);i+=d;var T,g=new Uint16Array(t,i,g);i+=h,defined(f.POLYGON_MINIMUM_HEIGHTS)&&defined(f.POLYGON_MAXIMUM_HEIGHTS)&&(T=n.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",ComponentDatatype$1.FLOAT,1),x=n.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",ComponentDatatype$1.FLOAT,1)),e._polygons=new Vector3DTilePolygons({positions:g,counts:a,indexCounts:s,indices:_,minimumHeight:r,maximumHeight:c,polygonMinimumHeights:T,polygonMaximumHeights:x,center:v,rectangle:l,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:o,batchIds:S.polygons,modelMatrix:u})}if(0<y){n.featuresLength=y;var x=defaultValue(n.getPropertyArray("POLYLINE_COUNTS",ComponentDatatype$1.UNSIGNED_INT,1),n.getPropertyArray("POLYLINE_COUNT",ComponentDatatype$1.UNSIGNED_INT,1));if(!defined(x))throw new RuntimeError("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");if(!defined(b=n.getPropertyArray("POLYLINE_WIDTHS",ComponentDatatype$1.UNSIGNED_SHORT,1)))for(var b=new Uint16Array(y),E=0;E<y;++E)b[E]=2;u=x.reduce(function(e,t){return e+3*t},0),n=new Uint16Array(t,i,u);i+=p;u=e._tileset,p=u.examineVectorLinesFunction;defined(p)&&examineVectorLines(decodeVectorPolylinePositions(new Uint16Array(n),l,r,c,Ellipsoid.WGS84),x,S.polylines,o,e.url,p);p=createFloatingPolylines;defined(u.classificationType)&&(p=createClampedPolylines),e._polylines=p({positions:n,widths:b,counts:x,batchIds:S.polylines,minimumHeight:r,maximumHeight:c,center:v,rectangle:l,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:o,tileset:u})}0<C&&(C=new Uint16Array(t,i,3*C),i+=m,e._points=new Vector3DTilePoints({positions:C,batchIds:S.points,minimumHeight:r,maximumHeight:c,rectangle:l,batchTable:o}))}}else e._readyPromise.resolve(e)}function createFeatures(e){var t=e.featuresLength;!defined(e._features)&&0<t&&(t=new Array(t),defined(e._polygons)&&e._polygons.createFeatures(e,t),defined(e._polylines)&&e._polylines.createFeatures(e,t),defined(e._points)&&e._points.createFeatures(e,t),e._features=t)}function examineVectorLines(e,t,i,r,n,a){for(var o=t.length,s=0,l=0;l<o;l++){var c=3*t[l],u=e.slice(s,s+c);s+=c,a(u,i[l],n,r)}}Vector3DTileContent.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Vector3DTileContent.prototype.getFeature=function(e){return createFeatures(this),this._features[e]},Vector3DTileContent.prototype.applyDebugSettings=function(e,t){defined(this._polygons)&&this._polygons.applyDebugSettings(e,t),defined(this._polylines)&&this._polylines.applyDebugSettings(e,t),defined(this._points)&&this._points.applyDebugSettings(e,t)},Vector3DTileContent.prototype.applyStyle=function(e){createFeatures(this),defined(this._polygons)&&this._polygons.applyStyle(e,this._features),defined(this._polylines)&&this._polylines.applyStyle(e,this._features),defined(this._points)&&this._points.applyStyle(e,this._features)},Vector3DTileContent.prototype.update=function(e,t){var i,r=!0;defined(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),r=r&&this._polygons._ready),defined(this._polylines)&&(this._polylines.update(t),r=r&&this._polylines._ready),defined(this._points)&&(this._points.update(t),r=r&&this._points._ready),defined(this._batchTable)&&r&&this._batchTable.update(e,t),defined(this._contentReadyPromise)||(r=defined(this._points)?this._points.readyPromise:void 0,e=defined(this._polygons)?this._polygons.readyPromise:void 0,t=defined(this._polylines)?this._polylines.readyPromise:void 0,(i=this)._contentReadyPromise=when.all([r,e,t]).then(function(){i._readyPromise.resolve(i)}).otherwise(function(e){i._readyPromise.reject(e)}))},Vector3DTileContent.prototype.isDestroyed=function(){return!1},Vector3DTileContent.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(),destroyObject(this)};var Cesium3DTileContentFactory={b3dm:function(e,t,i,r,n){return new Batched3DModel3DTileContent(e,t,i,r,n)},pnts:function(e,t,i,r,n){return new PointCloud3DTileContent(e,t,i,r,n)},i3dm:function(e,t,i,r,n){return new Instanced3DModel3DTileContent(e,t,i,r,n)},cmpt:function(e,t,i,r,n){return new Composite3DTileContent(e,t,i,r,n,Cesium3DTileContentFactory)},json:function(e,t,i,r,n){return new Tileset3DTileContent(e,t,i,r,n)},geom:function(e,t,i,r,n){return new Geometry3DTileContent(e,t,i,r,n)},vctr:function(e,t,i,r,n){return new Vector3DTileContent(e,t,i,r,n)}},Cesium3DTileContentState={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Cesium3DTileContentState$1=Object.freeze(Cesium3DTileContentState),Cesium3DTileOptimizationHint={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Cesium3DTileOptimizationHint$1=Object.freeze(Cesium3DTileOptimizationHint);function Cesium3DTilesetMostDetailedTraversal(){}var traversal$1={stack:new ManagedArray,stackMaximumLength:0};function isVisible$1(e){return e._visible&&e._inRequestVolume}function hasEmptyContent$1(e){return e.hasEmptyContent||e.hasTilesetContent}function hasUnloadedContent$1(e){return!hasEmptyContent$1(e)&&e.contentUnloaded}function canTraverse$1(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:(t.hasEmptyContent,!0))}function updateAndPushChildren$1(e,t,i,r){for(var n=t.children,a=n.length,o=0;o<a;++o){var s=n[o];s.updateVisibility(r),isVisible$1(s)&&i.push(s)}}function loadTile$1(e,t){(hasUnloadedContent$1(t)||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function touchTile$1(e,t,i){t._touchedFrame!==i.frameNumber&&(e._cache.touch(t),t._touchedFrame=i.frameNumber)}function visitTile$3(e){++e.statistics.visited}function selectDesiredTile$1(e,t,i){t.contentAvailable&&t.contentVisibility(i)!==Intersect$1.OUTSIDE&&e._selectedTiles.push(t)}function Cesium3DTilesetTraversal(){}function isVisible(e){return e._visible&&e._inRequestVolume}Cesium3DTilesetMostDetailedTraversal.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0;var i=!(e._hasMixedContent=!1),r=e.root;if(r.updateVisibility(t),!isVisible$1(r))return i;var n=traversal$1.stack;for(n.push(e.root);0<n.length;){traversal$1.stackMaximumLength=Math.max(traversal$1.stackMaximumLength,n.length);var a=n.pop(),o=a.refine===Cesium3DTileRefine$1.ADD,s=a.refine===Cesium3DTileRefine$1.REPLACE,l=canTraverse$1(e,a);l&&updateAndPushChildren$1(e,a,n,t),(o||s&&!l)&&(loadTile$1(e,a),touchTile$1(e,a,t),selectDesiredTile$1(e,a,t),hasEmptyContent$1(a)||a.contentAvailable||(i=!1)),visitTile$3(e)}return traversal$1.stack.trim(traversal$1.stackMaximumLength),i};var traversal={stack:new ManagedArray,stackMaximumLength:0},emptyTraversal={stack:new ManagedArray,stackMaximumLength:0},descendantTraversal={stack:new ManagedArray,stackMaximumLength:0},selectionTraversal={stack:new ManagedArray,stackMaximumLength:0,ancestorStack:new ManagedArray,ancestorStackMaximumLength:0},descendantSelectionDepth=2;function executeBaseTraversal(e,t,i){executeTraversal(e,t,e._maximumScreenSpaceError,e._maximumScreenSpaceError,i)}function executeSkipTraversal(e,t,i){executeTraversal(e,t,Number.MAX_VALUE,e._maximumScreenSpaceError,i),traverseAndSelect(e,t,i)}function executeBaseAndSkipTraversal(e,t,i){executeTraversal(e,t,Math.max(e.baseScreenSpaceError,e.maximumScreenSpaceError),e.maximumScreenSpaceError,i),traverseAndSelect(e,t,i)}function skipLevelOfDetail(e){return e._skipLevelOfDetail}function addEmptyTile(e,t){e._emptyTiles.push(t)}function selectTile(e,t,i){var r;t.contentVisibility(i)!==Intersect$1.OUTSIDE&&((r=t.content).featurePropertiesDirty?(r.featurePropertiesDirty=!1,t.lastStyleTime=0,e._selectedTilesToStyle.push(t)):t._selectedFrame<i.frameNumber-1&&e._selectedTilesToStyle.push(t),t._selectedFrame=i.frameNumber,e._selectedTiles.push(t))}function selectDescendants(e,t,i){var r=descendantTraversal.stack;for(r.push(t);0<r.length;){descendantTraversal.stackMaximumLength=Math.max(descendantTraversal.stackMaximumLength,r.length);for(var n=r.pop().children,a=n.length,o=0;o<a;++o){var s=n[o];isVisible(s)&&(s.contentAvailable?(updateTile(e,s,i),touchTile(e,s,i),selectTile(e,s,i)):s._depth-t._depth<descendantSelectionDepth&&r.push(s))}}}function selectDesiredTile(e,t,i){var r;skipLevelOfDetail(e)?defined(r=t.contentAvailable?t:t._ancestorWithContentAvailable)?r._shouldSelect=!0:selectDescendants(e,t,i):t.contentAvailable&&selectTile(e,t,i)}function visitTile$2(e,t,i){++e._statistics.visited,t._visitedFrame=i.frameNumber}function touchTile(e,t,i){t._touchedFrame!==i.frameNumber&&(e._cache.touch(t),t._touchedFrame=i.frameNumber)}function updateMinimumMaximumPriority(e,t){e._maximumPriority.distance=Math.max(t._priorityHolder._distanceToCamera,e._maximumPriority.distance),e._minimumPriority.distance=Math.min(t._priorityHolder._distanceToCamera,e._minimumPriority.distance),e._maximumPriority.depth=Math.max(t._depth,e._maximumPriority.depth),e._minimumPriority.depth=Math.min(t._depth,e._minimumPriority.depth),e._maximumPriority.foveatedFactor=Math.max(t._priorityHolder._foveatedFactor,e._maximumPriority.foveatedFactor),e._minimumPriority.foveatedFactor=Math.min(t._priorityHolder._foveatedFactor,e._minimumPriority.foveatedFactor),e._maximumPriority.reverseScreenSpaceError=Math.max(t._priorityReverseScreenSpaceError,e._maximumPriority.reverseScreenSpaceError),e._minimumPriority.reverseScreenSpaceError=Math.min(t._priorityReverseScreenSpaceError,e._minimumPriority.reverseScreenSpaceError)}function isOnScreenLongEnough(e,t,i){if(!e._cullRequestsWhileMoving)return 1;t=t.boundingSphere,t=Math.max(2*t.radius,1),i=i.camera,i=0!==i.positionWCDeltaMagnitude?i.positionWCDeltaMagnitude:i.positionWCDeltaMagnitudeLastFrame;return e.cullRequestsWhileMovingMultiplier*i/t<1}function loadTile(e,t,i){var r;t._requestedFrame!==i.frameNumber&&(hasUnloadedContent(t)||t.contentExpired)&&isOnScreenLongEnough(e,t,i)&&(r=i.camera.timeSinceMoved<e.foveatedTimeDelay,t.priorityDeferred&&r||(t._requestedFrame=i.frameNumber,e._requestedTiles.push(t)))}function updateVisibility(e,t,i){t._updatedVisibilityFrame!==e._updatedVisibilityFrame&&(t.updateVisibility(i),t._updatedVisibilityFrame=e._updatedVisibilityFrame)}function anyChildrenVisible(e,t,i){for(var r=!1,n=t.children,a=n.length,o=0;o<a;++o){var s=n[o];updateVisibility(e,s,i),r=r||isVisible(s)}return r}function meetsScreenSpaceErrorEarly(e,t,i){var r=t.parent;return defined(r)&&!r.hasTilesetContent&&r.refine===Cesium3DTileRefine$1.ADD&&t.getScreenSpaceError(i,!0)<=e._maximumScreenSpaceError}function updateTileVisibility(e,t,i){if(updateVisibility(e,t,i),isVisible(t)){var r,n=0<t.children.length;if(t.hasTilesetContent&&n){var a=t.children[0];return updateTileVisibility(e,a,i),void(t._visible=a._visible)}meetsScreenSpaceErrorEarly(e,t,i)?t._visible=!1:(r=t.refine===Cesium3DTileRefine$1.REPLACE,a=t._optimChildrenWithinParent===Cesium3DTileOptimizationHint$1.USE_OPTIMIZATION,r&&a&&n&&(anyChildrenVisible(e,t,i)||(++e._statistics.numberOfTilesCulledWithChildrenUnion,t._visible=!1)))}}function updateTile(e,t,i){updateTileVisibility(e,t,i),t.updateExpiration(),t._wasMinPriorityChild=!1,updateMinimumMaximumPriority(e,t._priorityHolder=t),t._shouldSelect=!1,t._finalResolution=!0}function updateTileAncestorContentLinks(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;var i=e.parent;defined(i)&&(t=!hasUnloadedContent(i)||i._requestedFrame===t.frameNumber,e._ancestorWithContent=t?i:i._ancestorWithContent,e._ancestorWithContentAvailable=i.contentAvailable?i:i._ancestorWithContentAvailable)}function hasEmptyContent(e){return e.hasEmptyContent||e.hasTilesetContent}function hasUnloadedContent(e){return!hasEmptyContent(e)&&e.contentUnloaded}function reachedSkippingThreshold(e,t){var i=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||defined(i)&&t._screenSpaceError<i._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>i._depth+e.skipLevels)}function sortChildrenByDistanceToCamera(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function updateAndPushChildren(e,t,i,r){for(var n=t.refine===Cesium3DTileRefine$1.REPLACE,a=t.children,o=a.length,s=0;s<o;++s)updateTile(e,a[s],r);a.sort(sortChildrenByDistanceToCamera);var l,c,u=!skipLevelOfDetail(e)&&n&&!hasEmptyContent(t),d=!0,h=!1,p=-1,m=Number.MAX_VALUE;for(s=0;s<o;++s)isVisible(c=a[s])?(i.push(c),c._foveatedFactor<m&&(p=s,m=c._foveatedFactor),h=!0):(u||e.loadSiblings)&&(c._foveatedFactor<m&&(p=s,m=c._foveatedFactor),loadTile(e,c,r),touchTile(e,c,r)),u&&(l=!!c._inRequestVolume&&(hasEmptyContent(c)?executeEmptyTraversal(e,c,r):c.contentAvailable),d=d&&l);if(h||(d=!1),-1!==p&&!skipLevelOfDetail(e)&&n){n=a[p];n._wasMinPriorityChild=!0;var f=(t._wasMinPriorityChild||t===e.root)&&m<=t._priorityHolder._foveatedFactor?t._priorityHolder:t;for(f._foveatedFactor=Math.min(n._foveatedFactor,f._foveatedFactor),f._distanceToCamera=Math.min(n._distanceToCamera,f._distanceToCamera),s=0;s<o;++s)(c=a[s])._priorityHolder=f}return d}function inBaseTraversal(e,t,i){return!skipLevelOfDetail(e)||!e.immediatelyLoadDesiredLevelOfDetail&&(!defined(t._ancestorWithContent)||(0===t._screenSpaceError?t.parent._screenSpaceError>i:t._screenSpaceError>i))}function canTraverse(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:t._screenSpaceError>e._maximumScreenSpaceError)}function executeTraversal(e,t,i,r,n){var a=traversal.stack;for(a.push(t);0<a.length;){traversal.stackMaximumLength=Math.max(traversal.stackMaximumLength,a.length);var o=a.pop();updateTileAncestorContentLinks(o,n);var s=inBaseTraversal(e,o,i),l=o.refine===Cesium3DTileRefine$1.ADD,c=o.refine===Cesium3DTileRefine$1.REPLACE,u=o.parent,d=!defined(u)||u._refines,u=!1,d=!(u=canTraverse(e,o)?updateAndPushChildren(e,o,a,n)&&d:u)&&d;hasEmptyContent(o)?(addEmptyTile(e,o),loadTile(e,o,n),d&&selectDesiredTile(e,o,n)):l?(selectDesiredTile(e,o,n),loadTile(e,o,n)):c&&(s?(loadTile(e,o,n),d&&selectDesiredTile(e,o,n)):d?(selectDesiredTile(e,o,n),loadTile(e,o,n)):reachedSkippingThreshold(e,o)&&loadTile(e,o,n)),visitTile$2(e,o,n),touchTile(e,o,n),o._refines=u}}function executeEmptyTraversal(e,t,i){var r=!0,n=emptyTraversal.stack;for(n.push(t);0<n.length;){emptyTraversal.stackMaximumLength=Math.max(emptyTraversal.stackMaximumLength,n.length);var a=n.pop(),o=a.children,s=o.length,l=hasEmptyContent(a),c=l&&canTraverse(e,a),l=l&&0===a.children.length;if(c||a.contentAvailable||l||(r=!1),updateTile(e,a,i),isVisible(a)||(loadTile(e,a,i),touchTile(e,a,i)),c)for(var u=0;u<s;++u){var d=o[u];n.push(d)}}return r}function traverseAndSelect(e,t,i){var r,n=selectionTraversal.stack,a=selectionTraversal.ancestorStack;for(n.push(t);0<n.length||0<a.length;){if(selectionTraversal.stackMaximumLength=Math.max(selectionTraversal.stackMaximumLength,n.length),selectionTraversal.ancestorStackMaximumLength=Math.max(selectionTraversal.ancestorStackMaximumLength,a.length),0<a.length){var o=a.peek();if(o._stackLength===n.length){a.pop(),o!==r&&(o._finalResolution=!1),selectTile(e,o,i);continue}}var s=n.pop();if(defined(s)){var l=s.refine===Cesium3DTileRefine$1.ADD,c=s._shouldSelect,u=s.children,d=u.length,o=canTraverse(e,s);if(c)if(l)selectTile(e,s,i);else{if(s._selectionDepth=a.length,0<s._selectionDepth&&(e._hasMixedContent=!0),r=s,!o){selectTile(e,s,i);continue}a.push(s),s._stackLength=n.length}if(o)for(var h=0;h<d;++h){var p=u[h];isVisible(p)&&n.push(p)}}}}Cesium3DTilesetTraversal.selectTiles=function(e,t){if(e._requestedTiles.length=0,!e.debugFreezeFrame){e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e._hasMixedContent=!1;var i=e.root;if(updateTile(e,i,t),isVisible(i)&&!(i.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)){(skipLevelOfDetail(e)?e.immediatelyLoadDesiredLevelOfDetail?executeSkipTraversal:executeBaseAndSkipTraversal:executeBaseTraversal)(e,i,t),traversal.stack.trim(traversal.stackMaximumLength),emptyTraversal.stack.trim(emptyTraversal.stackMaximumLength),descendantTraversal.stack.trim(descendantTraversal.stackMaximumLength),selectionTraversal.stack.trim(selectionTraversal.stackMaximumLength),selectionTraversal.ancestorStack.trim(selectionTraversal.ancestorStackMaximumLength);for(var r=e._requestedTiles,n=r.length,a=0;a<n;++a)r[a].updatePriority()}}};var Cesium3DTilePass={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},passOptions=new Array(Cesium3DTilePass.NUMBER_OF_PASSES);passOptions[Cesium3DTilePass.RENDER]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!0,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PICK]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!1,ignoreCommands:!1}),passOptions[Cesium3DTilePass.SHADOW]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PRELOAD]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.PRELOAD_FLIGHT]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD]=Object.freeze({traversal:Cesium3DTilesetMostDetailedTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PICK]=Object.freeze({traversal:Cesium3DTilesetMostDetailedTraversal,isRender:!1,requestTiles:!1,ignoreCommands:!1}),Cesium3DTilePass.getPassOptions=function(e){return passOptions[e]};var Cesium3DTilePass$1=Object.freeze(Cesium3DTilePass);function Empty3DTileContent(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}function TileBoundingRegion(e){this.rectangle=Rectangle.clone(e.rectangle),this.minimumHeight=defaultValue(e.minimumHeight,0),this.maximumHeight=defaultValue(e.maximumHeight,0),this.southwestCornerCartesian=new Cartesian3,this.northeastCornerCartesian=new Cartesian3,this.westNormal=new Cartesian3,this.southNormal=new Cartesian3,this.eastNormal=new Cartesian3,this.northNormal=new Cartesian3;var t=defaultValue(e.ellipsoid,Ellipsoid.WGS84);computeBox(this,e.rectangle,t),defaultValue(e.computeBoundingVolumes,!0)&&(this._orientedBoundingBox=OrientedBoundingBox.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,t),this._boundingSphere=BoundingSphere.fromOrientedBoundingBox(this._orientedBoundingBox))}Object.defineProperties(Empty3DTileContent.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(){}},readyPromise:{get:function(){}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},batchTable:{get:function(){}}}),Empty3DTileContent.prototype.hasProperty=function(e,t){return!1},Empty3DTileContent.prototype.getFeature=function(e){},Empty3DTileContent.prototype.applyDebugSettings=function(e,t){},Empty3DTileContent.prototype.applyStyle=function(e){},Empty3DTileContent.prototype.update=function(e,t){},Empty3DTileContent.prototype.isDestroyed=function(){return!1},Empty3DTileContent.prototype.destroy=function(){return destroyObject(this)},Object.defineProperties(TileBoundingRegion.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});var cartesian3Scratch$1=new Cartesian3,cartesian3Scratch2=new Cartesian3,cartesian3Scratch3=new Cartesian3,eastWestNormalScratch=new Cartesian3,westernMidpointScratch=new Cartesian3,easternMidpointScratch=new Cartesian3,cartographicScratch$2=new Cartographic,planeScratch=new Plane(Cartesian3.UNIT_X,0),rayScratch=new Ray;function computeBox(e,t,i){i.cartographicToCartesian(Rectangle.southwest(t),e.southwestCornerCartesian),i.cartographicToCartesian(Rectangle.northeast(t),e.northeastCornerCartesian),cartographicScratch$2.longitude=t.west,cartographicScratch$2.latitude=.5*(t.south+t.north),cartographicScratch$2.height=0;var r=i.cartographicToCartesian(cartographicScratch$2,westernMidpointScratch),n=Cartesian3.cross(r,Cartesian3.UNIT_Z,cartesian3Scratch$1);Cartesian3.normalize(n,e.westNormal),cartographicScratch$2.longitude=t.east;var a=i.cartographicToCartesian(cartographicScratch$2,easternMidpointScratch),n=Cartesian3.cross(Cartesian3.UNIT_Z,a,cartesian3Scratch$1);Cartesian3.normalize(n,e.eastNormal);var n=Cartesian3.subtract(r,a,cartesian3Scratch$1),r=Cartesian3.normalize(n,eastWestNormalScratch),a=t.south,o=0<a?(cartographicScratch$2.longitude=.5*(t.west+t.east),cartographicScratch$2.latitude=a,o=i.cartographicToCartesian(cartographicScratch$2,rayScratch.origin),Cartesian3.clone(r,rayScratch.direction),a=Plane.fromPointNormal(e.southwestCornerCartesian,e.westNormal,planeScratch),IntersectionTests.rayPlane(rayScratch,a,e.southwestCornerCartesian),i.geodeticSurfaceNormal(o,cartesian3Scratch2)):i.geodeticSurfaceNormalCartographic(Rectangle.southeast(t),cartesian3Scratch2),o=Cartesian3.cross(o,n,cartesian3Scratch3);Cartesian3.normalize(o,e.southNormal);o=t.north,t=o<0?(cartographicScratch$2.longitude=.5*(t.west+t.east),cartographicScratch$2.latitude=o,o=i.cartographicToCartesian(cartographicScratch$2,rayScratch.origin),Cartesian3.negate(r,rayScratch.direction),r=Plane.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,planeScratch),IntersectionTests.rayPlane(rayScratch,r,e.northeastCornerCartesian),i.geodeticSurfaceNormal(o,cartesian3Scratch2)):i.geodeticSurfaceNormalCartographic(Rectangle.northwest(t),cartesian3Scratch2),t=Cartesian3.cross(n,t,cartesian3Scratch3);Cartesian3.normalize(t,e.northNormal)}var southwestCornerScratch=new Cartesian3,northeastCornerScratch=new Cartesian3,negativeUnitY=new Cartesian3(0,-1,0),negativeUnitZ=new Cartesian3(0,0,-1),vectorScratch=new Cartesian3;function TileBoundingSphere(e,t){0===t&&(t=CesiumMath.EPSILON7),this._boundingSphere=new BoundingSphere(e,t)}TileBoundingRegion.prototype.distanceToCamera=function(e){var t,i,r,n,a,o,s,l=e.camera,c=l.positionWC,u=l.positionCartographic,d=0;return Rectangle.contains(this.rectangle,u)||(t=this.southwestCornerCartesian,n=this.northeastCornerCartesian,i=this.westNormal,r=this.southNormal,a=this.eastNormal,l=this.northNormal,e.mode!==SceneMode$1.SCENE3D&&((t=e.mapProjection.project(Rectangle.southwest(this.rectangle),southwestCornerScratch)).z=t.y,t.y=t.x,t.x=0,(n=e.mapProjection.project(Rectangle.northeast(this.rectangle),northeastCornerScratch)).z=n.y,n.y=n.x,n.x=0,i=negativeUnitY,a=Cartesian3.UNIT_Y,r=negativeUnitZ,l=Cartesian3.UNIT_Z),t=Cartesian3.subtract(c,t,vectorScratch),i=Cartesian3.dot(t,i),r=Cartesian3.dot(t,r),n=Cartesian3.subtract(c,n,vectorScratch),a=Cartesian3.dot(n,a),l=Cartesian3.dot(n,l),0<i?d+=i*i:0<a&&(d+=a*a),0<r?d+=r*r:0<l&&(d+=l*l)),(c=e.mode===SceneMode$1.SCENE3D?(s=u.height,o=this.minimumHeight,this.maximumHeight):(s=c.x,o=0))<s?d+=(c=s-c)*c:s<o&&(d+=(s=o-s)*s),Math.sqrt(d)},TileBoundingRegion.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},TileBoundingRegion.prototype.createDebugVolume=function(e){var t=new Matrix4.clone(Matrix4.IDENTITY);return new Primitive({geometryInstances:new GeometryInstance({geometry:new RectangleOutlineGeometry({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),id:"outline",modelMatrix:t,attributes:{color:ColorGeometryInstanceAttribute.fromColor(e)}}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})},Object.defineProperties(TileBoundingSphere.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}}}),TileBoundingSphere.prototype.distanceToCamera=function(e){var t=this._boundingSphere;return Math.max(0,Cartesian3.distance(t.center,e.camera.positionWC)-t.radius)},TileBoundingSphere.prototype.intersectPlane=function(e){return BoundingSphere.intersectPlane(this._boundingSphere,e)},TileBoundingSphere.prototype.update=function(e,t){Cartesian3.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t},TileBoundingSphere.prototype.createDebugVolume=function(e){return new Primitive({geometryInstances:new GeometryInstance({geometry:new SphereOutlineGeometry({radius:this.radius}),id:"outline",modelMatrix:Matrix4.fromTranslation(this.center,new Matrix4.clone(Matrix4.IDENTITY)),attributes:{color:ColorGeometryInstanceAttribute.fromColor(e)}}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})};var scratchU=new Cartesian3,scratchV=new Cartesian3,scratchW=new Cartesian3,scratchCartesian$6=new Cartesian3;function computeMissingVector(e,t,i){i=Cartesian3.cross(e,t,i);t=Cartesian3.magnitude(i);return Cartesian3.multiplyByScalar(i,CesiumMath.EPSILON7/t,i)}function findOrthogonalVector(e,t){var i=Cartesian3.normalize(e,scratchCartesian$6);return computeMissingVector(e,Cartesian3.equalsEpsilon(i,Cartesian3.UNIT_X,CesiumMath.EPSILON6)?Cartesian3.UNIT_Y:Cartesian3.UNIT_X,t)}function checkHalfAxes(e){var t=Matrix3.getColumn(e,0,scratchU),i=Matrix3.getColumn(e,1,scratchV),r=Matrix3.getColumn(e,2,scratchW),n=Cartesian3.equals(t,Cartesian3.ZERO),a=Cartesian3.equals(i,Cartesian3.ZERO),o=Cartesian3.equals(r,Cartesian3.ZERO);return(n||a||o)&&(n&&a&&o?(e[0]=CesiumMath.EPSILON7,e[4]=CesiumMath.EPSILON7,e[8]=CesiumMath.EPSILON7):(!n||a||o?n||!a||o?n||a||!o?n?a?o||(i=computeMissingVector(r,t=findOrthogonalVector(r,t),i)):r=computeMissingVector(i,t=findOrthogonalVector(i,t),r):r=computeMissingVector(i=findOrthogonalVector(t,i),t,r):r=computeMissingVector(i,t,r):i=computeMissingVector(t,r,i):t=computeMissingVector(i,r,t),Matrix3.setColumn(e,0,t,e),Matrix3.setColumn(e,1,i,e),Matrix3.setColumn(e,2,r,e))),e}function TileOrientedBoundingBox(e,t){t=checkHalfAxes(t),this._orientedBoundingBox=new OrientedBoundingBox(e,t),this._boundingSphere=BoundingSphere.fromOrientedBoundingBox(this._orientedBoundingBox)}function Cesium3DTile(e,t,i,r){this._tileset=e;var n=(this._header=i).content;this.transform=defined(i.transform)?Matrix4.unpack(i.transform):Matrix4.clone(Matrix4.IDENTITY);var a,o,s,l,c,u,d,h=defined(r)?r.computedTransform:e.modelMatrix,p=Matrix4.multiply(h,this.transform,new Matrix4),h=defined(r)?r._initialTransform:Matrix4.IDENTITY;this._initialTransform=Matrix4.multiply(h,this.transform,new Matrix4),this.computedTransform=p,this._boundingVolume=this.createBoundingVolume(i.boundingVolume,p),this._boundingVolume2D=void 0,defined(n)&&defined(n.boundingVolume)&&(a=this.createBoundingVolume(n.boundingVolume,p)),this._contentBoundingVolume=a,this._contentBoundingVolume2D=void 0,defined(i.viewerRequestVolume)&&(o=this.createBoundingVolume(i.viewerRequestVolume,p)),this._viewerRequestVolume=o,this.geometricError=i.geometricError,this._geometricError=i.geometricError,defined(this._geometricError)||(this._geometricError=defined(r)?r.geometricError:e._geometricError,Cesium3DTile._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale(),o=defined(i.refine)?("replace"!==i.refine&&"add"!==i.refine||Cesium3DTile._deprecationWarning("lowercase-refine",'This tile uses a lowercase refine "'+i.refine+'". Instead use "'+i.refine.toUpperCase()+'".'),"REPLACE"===i.refine.toUpperCase()?Cesium3DTileRefine$1.REPLACE:Cesium3DTileRefine$1.ADD):defined(r)?r.refine:Cesium3DTileRefine$1.REPLACE,this.refine=o,this.children=[],this.parent=r,t=Resource.createIfNeeded(t),defined(n)?(d=n.uri,defined(n.url)&&(Cesium3DTile._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),d=n.url),l=!1,c=Cesium3DTileContentState$1.UNLOADED,u=t.getDerivedResource({url:d}),d=RequestScheduler.getServerKey(u.getUrlComponent())):(s=new Empty3DTileContent(e,this),l=!0,c=Cesium3DTileContentState$1.READY),this._content=s,this._contentResource=u,this._contentState=c,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this._expiredContent=void 0,this._serverKey=d,this.hasEmptyContent=l,this.hasTilesetContent=!1,this.cacheNode=void 0;var m,f,i=i.expire;defined(i)&&(m=i.duration,defined(i.date)&&(f=JulianDate.fromIso8601(i.date))),this.expireDuration=m,this.expireDate=f,this.lastStyleTime=0,this._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,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._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=Color.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,(this._priorityHolder=this)._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new JulianDate,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Object.defineProperties(TileOrientedBoundingBox.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),TileOrientedBoundingBox.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},TileOrientedBoundingBox.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},TileOrientedBoundingBox.prototype.update=function(e,t){Cartesian3.clone(e,this._orientedBoundingBox.center),t=checkHalfAxes(t),Matrix3.clone(t,this._orientedBoundingBox.halfAxes),BoundingSphere.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},TileOrientedBoundingBox.prototype.createDebugVolume=function(e){return new Primitive({geometryInstances:new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-1,-1,-1),maximum:new Cartesian3(1,1,1)}),id:"outline",modelMatrix:Matrix4.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),attributes:{color:ColorGeometryInstanceAttribute.fromColor(e)}}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})},Cesium3DTile._deprecationWarning=deprecationWarning,Object.defineProperties(Cesium3DTile.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return defaultValue(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},extras:{get:function(){return this._header.extras}},color:{get:function(){return defined(this._color)||(this._color=new Color),Color.clone(this._color)},set:function(e){this._color=Color.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&!this.hasEmptyContent&&!this.hasTilesetContent||defined(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Cesium3DTileContentState$1.READY}},contentUnloaded:{get:function(){return this._contentState===Cesium3DTileContentState$1.UNLOADED}},contentExpired:{get:function(){return this._contentState===Cesium3DTileContentState$1.EXPIRED}},contentFailed:{get:function(){return this._contentState===Cesium3DTileContentState$1.FAILED}},contentReadyToProcessPromise:{get:function(){if(defined(this._contentReadyToProcessPromise))return this._contentReadyToProcessPromise.promise}},contentReadyPromise:{get:function(){if(defined(this._contentReadyPromise))return this._contentReadyPromise.promise}},commandsLength:{get:function(){return this._commandsLength}}});var scratchCartesian$5=new Cartesian3;function isPriorityDeferred(e,t){var i=e._tileset,r=t.camera,n=e.boundingSphere,a=n.radius,t=Cartesian3.multiplyByScalar(r.directionWC,e._centerZDepth,scratchCartesian$5),t=Cartesian3.add(r.positionWC,t,scratchCartesian$5),t=Cartesian3.subtract(t,n.center,scratchCartesian$5);a<Cartesian3.magnitude(t)?(s=Cartesian3.normalize(t,scratchCartesian$5),o=Cartesian3.multiplyByScalar(s,a,scratchCartesian$5),s=Cartesian3.add(n.center,o,scratchCartesian$5),o=Cartesian3.subtract(s,r.positionWC,scratchCartesian$5),s=Cartesian3.normalize(o,scratchCartesian$5),e._foveatedFactor=1-Math.abs(Cartesian3.dot(r.directionWC,s))):e._foveatedFactor=0;var o=e.refine===Cesium3DTileRefine$1.REPLACE,s=i._skipLevelOfDetail;if(o&&!s||!i.foveatedScreenSpaceError||1===i.foveatedConeSize||e._priorityProgressiveResolution&&o&&s||i._pass===Cesium3DTilePass$1.PRELOAD_FLIGHT||i._pass===Cesium3DTilePass$1.PRELOAD)return!1;s=1-Math.cos(.5*r.frustum.fov),r=i.foveatedConeSize*s;if(e._foveatedFactor<=r)return!1;r=CesiumMath.clamp((e._foveatedFactor-r)/(s-r),0,1),r=i.foveatedInterpolationCallback(i.foveatedMinimumScreenSpaceErrorRelaxation,i.maximumScreenSpaceError,r),e=0===e._screenSpaceError&&defined(e.parent)?.5*e.parent._screenSpaceError:e._screenSpaceError;return i.maximumScreenSpaceError-r<=e}var scratchJulianDate$1=new JulianDate;function isPriorityProgressiveResolution(e,t){if(e.progressiveResolutionHeightFraction<=0||.5<e.progressiveResolutionHeightFraction)return!1;var i=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;var r=t.parent,n=e._maximumScreenSpaceError,e=t._screenSpaceErrorProgressiveResolution<=n,n=defined(r)&&r._screenSpaceErrorProgressiveResolution>n;return i=e&&n?t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0:i}function getPriorityReverseScreenSpaceError(e,t){var i=t.parent,t=(defined(i)&&(!e._skipLevelOfDetail||0===t._screenSpaceError||i.hasTilesetContent)?i:t)._screenSpaceError;return e.root._screenSpaceError-t}function updateExpireDate(e){var t;defined(e.expireDuration)&&(t=JulianDate.now(scratchJulianDate$1),JulianDate.addSeconds(t,e.expireDuration,t),defined(e.expireDate)?JulianDate.lessThan(e.expireDate,t)&&JulianDate.clone(t,e.expireDate):e.expireDate=JulianDate.clone(t))}function getContentFailedFunction(t,i){return function(e){t._contentState===Cesium3DTileContentState$1.PROCESSING?--i.statistics.numberOfTilesProcessing:--i.statistics.numberOfPendingRequests,t._contentState=Cesium3DTileContentState$1.FAILED,t._contentReadyPromise.reject(e),t._contentReadyToProcessPromise.reject(e)}}function createPriorityFunction(e){return function(){return e._priority}}Cesium3DTile.prototype.getScreenSpaceError=function(e,t,i){var r=this._tileset,n=defaultValue(i,1),a=defined(this.parent)?this.parent.geometricError:r._geometricError,o=t?a:this.geometricError;if(0===o)return 0;var s,l=e.camera,i=l.frustum,t=e.context,a=t.drawingBufferWidth,n=t.drawingBufferHeight*n;return e.mode===SceneMode$1.SCENE2D||i instanceof OrthographicFrustum?(defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),s=o/(Math.max(i.top-i.bottom,i.right-i.left)/Math.max(a,n))):(s=o*n/((n=Math.max(this._distanceToCamera,CesiumMath.EPSILON7))*l.frustum.sseDenominator),r.dynamicScreenSpaceError&&(l=r._dynamicScreenSpaceErrorComputedDensity,r=r.dynamicScreenSpaceErrorFactor,s-=CesiumMath.fog(n,l)*r)),s/=e.pixelRatio},Cesium3DTile.prototype.updateVisibility=function(e){var t=this.parent,i=this._tileset,r=defined(t)?t.computedTransform:i.modelMatrix,t=defined(t)?t._visibilityPlaneMask:CullingVolume.MASK_INDETERMINATE;this.updateTransform(r),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,i.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,t),this._visible=this._visibilityPlaneMask!==CullingVolume.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=getPriorityReverseScreenSpaceError(i,this),this._priorityProgressiveResolution=isPriorityProgressiveResolution(i,this),this.priorityDeferred=isPriorityDeferred(this,e)},Cesium3DTile.prototype.updateExpiration=function(){var e;defined(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&(e=JulianDate.now(scratchJulianDate$1),JulianDate.lessThan(this.expireDate,e)&&(this._contentState=Cesium3DTileContentState$1.EXPIRED,this._expiredContent=this._content))},Cesium3DTile.prototype.requestContent=function(){var n=this,a=this._tileset;if(this.hasEmptyContent)return!1;var e=this._contentResource.clone(),o=this.contentExpired;o&&e.setQueryParameters({expired:this.expireDate.toString()});var t=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.TILES3D,priorityFunction:createPriorityFunction(this),serverKey:this._serverKey});this._request=t,e.request=t;e=e.fetchArrayBuffer();if(!defined(e))return!1;var i=this._contentState;this._contentState=Cesium3DTileContentState$1.LOADING,this._contentReadyToProcessPromise=when.defer(),this._contentReadyPromise=when.defer();var s=getContentFailedFunction(this,a);return e.then(function(e){if(!n.isDestroyed()){var t,i=getMagic(new Uint8Array(e)),r=Cesium3DTileContentFactory[i];return a._disableSkipLevelOfDetail=a._disableSkipLevelOfDetail||"vctr"===i||"geom"===i,defined(r)?t=r(a,n,n._contentResource,e,0):(t=Cesium3DTileContentFactory.json(a,n,n._contentResource,e,0),n.hasTilesetContent=!0),o&&(n.expireDate=void 0),n._content=t,n._contentState=Cesium3DTileContentState$1.PROCESSING,n._contentReadyToProcessPromise.resolve(t),t.readyPromise.then(function(e){n.isDestroyed()?s():(updateExpireDate(n),n._selectedFrame=0,n.lastStyleTime=0,JulianDate.now(n._loadTimestamp),n._contentState=Cesium3DTileContentState$1.READY,n._contentReadyPromise.resolve(e))})}s()}).otherwise(function(e){return t.state===RequestState$1.CANCELLED?(n._contentState=i,--a.statistics.numberOfPendingRequests,void++a.statistics.numberOfAttemptedRequests):void s(e)}),!0},Cesium3DTile.prototype.unloadContent=function(){this.hasEmptyContent||this.hasTilesetContent||(this._content=this._content&&this._content.destroy(),this._contentState=Cesium3DTileContentState$1.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.lastStyleTime=0,this.clippingPlanesDirty=0===this._clippingPlanesState,this._clippingPlanesState=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 scratchProjectedBoundingSphere=new BoundingSphere;function getBoundingVolume(e,t){var i;return t.mode===SceneMode$1.SCENE3D||defined(e._boundingVolume2D)||(i=e._boundingVolume.boundingSphere,i=BoundingSphere.projectTo2D(i,t.mapProjection,scratchProjectedBoundingSphere),e._boundingVolume2D=new TileBoundingSphere(i.center,i.radius)),t.mode!==SceneMode$1.SCENE3D?e._boundingVolume2D:e._boundingVolume}function getContentBoundingVolume(e,t){var i;return t.mode===SceneMode$1.SCENE3D||defined(e._contentBoundingVolume2D)||(i=e._contentBoundingVolume.boundingSphere,i=BoundingSphere.projectTo2D(i,t.mapProjection,scratchProjectedBoundingSphere),e._contentBoundingVolume2D=new TileBoundingSphere(i.center,i.radius)),t.mode!==SceneMode$1.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Cesium3DTile.prototype.visibility=function(e,t){var i=e.cullingVolume,r=getBoundingVolume(this,e),n=this._tileset,e=n.clippingPlanes;if(defined(e)&&e.enabled){n=e.computeIntersectionWithBoundingVolume(r,n.clippingPlanesOriginMatrix);if(this._isClipped=n!==Intersect$1.INSIDE,n===Intersect$1.OUTSIDE)return CullingVolume.MASK_OUTSIDE}return i.computeVisibilityWithPlaneMask(r,t)},Cesium3DTile.prototype.contentVisibility=function(e){if(!defined(this._contentBoundingVolume))return Intersect$1.INSIDE;if(this._visibilityPlaneMask===CullingVolume.MASK_INSIDE)return Intersect$1.INSIDE;var t=e.cullingVolume,i=getContentBoundingVolume(this,e),r=this._tileset,e=r.clippingPlanes;if(defined(e)&&e.enabled){r=e.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=r!==Intersect$1.INSIDE,r===Intersect$1.OUTSIDE)return Intersect$1.OUTSIDE}return t.computeVisibility(i)},Cesium3DTile.prototype.distanceToTile=function(e){return getBoundingVolume(this,e).distanceToCamera(e)};var scratchToTileCenter=new Cartesian3;Cesium3DTile.prototype.distanceToTileCenter=function(e){var t=getBoundingVolume(this,e).boundingVolume,t=Cartesian3.subtract(t.center,e.camera.positionWC,scratchToTileCenter);return Cartesian3.dot(e.camera.directionWC,t)},Cesium3DTile.prototype.insideViewerRequestVolume=function(e){var t=this._viewerRequestVolume;return!defined(t)||0===t.distanceToCamera(e)};var scratchMatrix$2=new Matrix3,scratchScale$2=new Cartesian3,scratchHalfAxes=new Matrix3,scratchCenter$3=new Cartesian3,scratchRectangle$5=new Rectangle,scratchOrientedBoundingBox=new OrientedBoundingBox,scratchTransform=new Matrix4;function createBox(e,t,i){var r=Cartesian3.fromElements(e[0],e[1],e[2],scratchCenter$3),e=Matrix3.fromArray(e,3,scratchHalfAxes),r=Matrix4.multiplyByPoint(t,r,r),t=Matrix4.getMatrix3(t,scratchMatrix$2),e=Matrix3.multiply(t,e,e);return defined(i)?(i.update(r,e),i):new TileOrientedBoundingBox(r,e)}function createBoxFromTransformedRegion(e,t,i,r){var n=Rectangle.unpack(e,0,scratchRectangle$5),a=e[4],e=e[5],a=OrientedBoundingBox.fromRectangle(n,a,e,Ellipsoid.WGS84,scratchOrientedBoundingBox),e=a.center,a=a.halfAxes;t=Matrix4.multiplyTransformation(t,Matrix4.inverseTransformation(i,scratchTransform),scratchTransform);e=Matrix4.multiplyByPoint(t,e,e),t=Matrix4.getMatrix3(t,scratchMatrix$2),a=Matrix3.multiply(t,a,a);return defined(r)&&r instanceof TileOrientedBoundingBox?(r.update(e,a),r):new TileOrientedBoundingBox(e,a)}function createRegion(e,t,i,r){return Matrix4.equalsEpsilon(t,i,CesiumMath.EPSILON8)?defined(r)?r:new TileBoundingRegion({rectangle:Rectangle.unpack(e,0,scratchRectangle$5),minimumHeight:e[4],maximumHeight:e[5]}):createBoxFromTransformedRegion(e,t,i,r)}function createSphere(e,t,i){var r=Cartesian3.fromElements(e[0],e[1],e[2],scratchCenter$3),e=e[3],r=Matrix4.multiplyByPoint(t,r,r),t=Matrix4.getScale(t,scratchScale$2);return e*=Cartesian3.maximumComponent(t),defined(i)?(i.update(r,e),i):new TileBoundingSphere(r,e)}function applyDebugSettings$1(e,t,i,r){var n,a,o;r.isRender&&(o=defined(e._header.content)&&defined(e._header.content.boundingVolume),n=e.hasEmptyContent||e.hasTilesetContent,(a=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o)?(r=e._finalResolution?n?Color.DARKGRAY:Color.WHITE:Color.YELLOW,defined(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(r)),e._debugBoundingVolume.update(i),(n=e._debugBoundingVolume.getGeometryInstanceAttributes("outline")).color=ColorGeometryInstanceAttribute.toValue(r,n.color)):!a&&defined(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy()),t.debugShowContentBoundingVolume&&o?(defined(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(Color.BLUE)),e._debugContentBoundingVolume.update(i)):!t.debugShowContentBoundingVolume&&defined(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&defined(e._viewerRequestVolume)?(defined(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(Color.YELLOW)),e._debugViewerRequestVolume.update(i)):!t.debugShowViewerRequestVolume&&defined(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy()),a=t.debugColorizeTiles&&!e._debugColorizeTiles||defined(t._heatmap.tilePropertyName),o=!t.debugColorizeTiles&&e._debugColorizeTiles,a?(t._heatmap.colorize(e,i),e._debugColorizeTiles=!0,e.color=e._debugColor):o&&(e._debugColorizeTiles=!1,e.color=Color.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),o&&t.makeStyleDirty())}function updateContent(e,t,i){var r=e._content,n=e._expiredContent;if(defined(n)){if(!e.contentReady)return void n.update(t,i);e._expiredContent.destroy(),e._expiredContent=void 0}r.update(t,i)}function updateClippingPlanes(e,t){var i=t.clippingPlanes,t=0;(t=defined(i)&&e._isClipped&&i.enabled?i.clippingPlanesState:t)!==e._clippingPlanesState&&(e._clippingPlanesState=t,e.clippingPlanesDirty=!0)}Cesium3DTile.prototype.createBoundingVolume=function(e,t,i){if(!defined(e))throw new RuntimeError("boundingVolume must be defined");if(defined(e.box))return createBox(e.box,t,i);if(defined(e.region))return createRegion(e.region,t,this._initialTransform,i);if(defined(e.sphere))return createSphere(e.sphere,t,i);throw new RuntimeError("boundingVolume must contain a sphere, region, or box")},Cesium3DTile.prototype.updateTransform=function(e){e=defaultValue(e,Matrix4.IDENTITY);var t=Matrix4.multiply(e,this.transform,scratchTransform);Matrix4.equals(t,this.computedTransform)||(Matrix4.clone(t,this.computedTransform),e=this._header,t=this._header.content,this._boundingVolume=this.createBoundingVolume(e.boundingVolume,this.computedTransform,this._boundingVolume),defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(e.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())},Cesium3DTile.prototype.updateGeometricErrorScale=function(){var e=Matrix4.getScale(this.computedTransform,scratchScale$2),e=Cartesian3.maximumComponent(e);this.geometricError=this._geometricError*e},Cesium3DTile.prototype.update=function(e,t,i){var r=t.commandList.length;updateClippingPlanes(this,e),applyDebugSettings$1(this,e,t,i),updateContent(this,e,t);var n=t.commandList.length-r;this._commandsLength=n;for(var a=0;a<n;++a){var o=t.commandList[r+a],s=o.pass===Pass$1.TRANSLUCENT;o.depthForTranslucentClassification=s}this.clippingPlanesDirty=!1};var scratchCommandList$1=[];function isolateDigits(e,t,i){t=e*Math.pow(10,t);return parseInt(t)*Math.pow(10,i)}function priorityNormalizeAndClamp(e,t,i){return Math.max(CesiumMath.normalize(e,t,i)-CesiumMath.EPSILON7,0)}Cesium3DTile.prototype.process=function(e,t){var i=t.commandList;t.commandList=scratchCommandList$1,this._content.update(e,t),scratchCommandList$1.length=0,t.commandList=i},Cesium3DTile.prototype.updatePriority=function(){var e=this.tileset,t=e.preferLeaves,i=e._minimumPriority,r=e._maximumPriority,n=Math.pow(10,8),a=Math.pow(10,9),o=Math.pow(10,10),s=priorityNormalizeAndClamp(this._depth,i.depth,r.depth),s=t?1-s:s,t=isolateDigits(!e._skipLevelOfDetail&&this.refine===Cesium3DTileRefine$1.REPLACE?priorityNormalizeAndClamp(this._priorityHolder._distanceToCamera,i.distance,r.distance):priorityNormalizeAndClamp(this._priorityReverseScreenSpaceError,i.reverseScreenSpaceError,r.reverseScreenSpaceError),4,0),n=this._priorityProgressiveResolution?0:n,r=isolateDigits(priorityNormalizeAndClamp(this._priorityHolder._foveatedFactor,i.foveatedFactor,r.foveatedFactor),4,4),a=this.priorityDeferred?a:0,o=e._pass===Cesium3DTilePass$1.PRELOAD_FLIGHT?0:o;this._priority=s+t+n+r+a+o},Cesium3DTile.prototype.isDestroyed=function(){return!1},Cesium3DTile.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(),destroyObject(this)};var Cesium3DTileOptimizations={},scratchAxis$1=new Cartesian3;function Cesium3DTilesetCache(){this._list=new DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}function Cesium3DTilesetHeatmap(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 getHeatmapValue(e,t){e="_loadTimestamp"===t?JulianDate.toDate(e).getTime():e;return e}function getHeatmapValueAndUpdateMinimumMaximum(e,t){var i=e.tilePropertyName;if(defined(i)){i=getHeatmapValue(t[i],i);return defined(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}Cesium3DTileOptimizations.checkChildrenWithinParent=function(e){var t=e.children,i=t.length,r=e.boundingVolume;if(r instanceof TileOrientedBoundingBox||r instanceof TileBoundingRegion){var n=r._orientedBoundingBox;e._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.USE_OPTIMIZATION;for(var a=0;a<i;++a){var o=t[a].boundingVolume;if(!(o instanceof TileOrientedBoundingBox||o instanceof TileBoundingRegion)){e._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.SKIP_OPTIMIZATION;break}var s=o._orientedBoundingBox,l=Cartesian3.subtract(s.center,n.center,scratchAxis$1),o=Cartesian3.magnitude(l);if(Cartesian3.divideByScalar(l,o,l),Math.abs(n.halfAxes[0]*l.x)+Math.abs(n.halfAxes[1]*l.y)+Math.abs(n.halfAxes[2]*l.z)+Math.abs(n.halfAxes[3]*l.x)+Math.abs(n.halfAxes[4]*l.y)+Math.abs(n.halfAxes[5]*l.z)+Math.abs(n.halfAxes[6]*l.x)+Math.abs(n.halfAxes[7]*l.y)+Math.abs(n.halfAxes[8]*l.z)<=Math.abs(s.halfAxes[0]*l.x)+Math.abs(s.halfAxes[1]*l.y)+Math.abs(s.halfAxes[2]*l.z)+Math.abs(s.halfAxes[3]*l.x)+Math.abs(s.halfAxes[4]*l.y)+Math.abs(s.halfAxes[5]*l.z)+Math.abs(s.halfAxes[6]*l.x)+Math.abs(s.halfAxes[7]*l.y)+Math.abs(s.halfAxes[8]*l.z)+o){e._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Cesium3DTileOptimizationHint$1.USE_OPTIMIZATION},Cesium3DTilesetCache.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},Cesium3DTilesetCache.prototype.touch=function(e){e=e.cacheNode;defined(e)&&this._list.splice(this._sentinel,e)},Cesium3DTilesetCache.prototype.add=function(e){defined(e.cacheNode)||(e.cacheNode=this._list.add(e))},Cesium3DTilesetCache.prototype.unloadTile=function(e,t,i){var r=t.cacheNode;defined(r)&&(this._list.remove(r),t.cacheNode=void 0,i(e,t))},Cesium3DTilesetCache.prototype.unloadTiles=function(e,t){var i=this._trimTiles;this._trimTiles=!1;for(var r=this._list,n=1024*e.maximumMemoryUsage*1024,a=this._sentinel,o=r.head;o!==a&&(e.totalMemoryUsageInBytes>n||i);){var s=o.item,o=o.next;this.unloadTile(e,s,t)}},Cesium3DTilesetCache.prototype.trim=function(){this._trimTiles=!0},Cesium3DTilesetHeatmap.prototype.setReferenceMinimumMaximum=function(e,t,i){this._referenceMinimum[i]=getHeatmapValue(e,i),this._referenceMaximum[i]=getHeatmapValue(t,i)};var heatmapColors=[new Color(.1,.1,.1,1),new Color(.153,.278,.878,1),new Color(.827,.231,.49,1),new Color(.827,.188,.22,1),new Color(1,.592,.259,1),new Color(1,.843,0,1)];function Cesium3DTilesetStatistics(){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.batchTableByteLength=0}function updatePointAndFeatureCounts(e,t,i,r){var n=t.innerContents,a=t.pointsLength,o=t.trianglesLength,s=t.featuresLength,l=t.geometryByteLength,c=t.texturesByteLength,t=t.batchTableByteLength;if(r?(e.numberOfFeaturesLoaded+=i?-s:s,e.numberOfPointsLoaded+=i?-a:a,e.geometryByteLength+=i?-l:l,e.texturesByteLength+=i?-c:c,e.batchTableByteLength+=i?-t:t):(e.numberOfFeaturesSelected+=i?-s:s,e.numberOfPointsSelected+=i?-a:a,e.numberOfTrianglesSelected+=i?-o:o),defined(n))for(var u=n.length,d=0;d<u;++d)updatePointAndFeatureCounts(e,n[d],i,r)}function Cesium3DTileStyleEngine(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}function Cesium3DTileset(e){e=defaultValue(e,defaultValue.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._extensionsUsed=void 0,this._extensions=void 0,this._gltfUpAxis=void 0,this._cache=new Cesium3DTilesetCache,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._cullWithChildrenBounds=defaultValue(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new ManagedArray,this._maximumScreenSpaceError=defaultValue(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=defaultValue(e.maximumMemoryUsage,512),this._styleEngine=new Cesium3DTileStyleEngine,this._modelMatrix=defined(e.modelMatrix)?Matrix4.clone(e.modelMatrix):Matrix4.clone(Matrix4.IDENTITY),this._statistics=new Cesium3DTilesetStatistics,this._statisticsLast=new Cesium3DTilesetStatistics,this._statisticsPerPass=new Array(Cesium3DTilePass$1.NUMBER_OF_PASSES);for(var t=0;t<Cesium3DTilePass$1.NUMBER_OF_PASSES;++t)this._statisticsPerPass[t]=new Cesium3DTilesetStatistics;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 Cesium3DTilesetHeatmap(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=defaultValue(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=defaultValue(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=CesiumMath.clamp(defaultValue(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=defaultValue(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._readyPromise=when.defer(),this._classificationType=e.classificationType,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._initialClippingPlanesOriginMatrix=Matrix4.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=defaultValue(e.vectorClassificationOnly,!1),this.preloadWhenHidden=defaultValue(e.preloadWhenHidden,!1),this.preloadFlightDestinations=defaultValue(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=defaultValue(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=defaultValue(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=defaultValue(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=defaultValue(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=defaultValue(e.foveatedInterpolationCallback,CesiumMath.lerp),this.foveatedTimeDelay=defaultValue(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this.show=defaultValue(e.show,!0),this.colorBlendMode=Cesium3DTileColorBlendMode$1.HIGHLIGHT,this.colorBlendAmount=.5,this.pointCloudShading=new PointCloudShading(e.pointCloudShading),this._pointCloudEyeDomeLighting=new PointCloudEyeDomeLighting,this.loadProgress=new Event,this.allTilesLoaded=new Event,this.initialTilesLoaded=new Event,this.tileLoad=new Event,this.tileUnload=new Event,this.tileFailed=new Event,this.tileVisible=new Event,this.skipLevelOfDetail=defaultValue(e.skipLevelOfDetail,!1),this._skipLevelOfDetail=this.skipLevelOfDetail,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=defaultValue(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=defaultValue(e.skipScreenSpaceErrorFactor,16),this.skipLevels=defaultValue(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=defaultValue(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=defaultValue(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._imageBasedLightingFactor=new Cartesian2(1,1),Cartesian2.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this.lightColor=e.lightColor,this.luminanceAtZenith=defaultValue(e.luminanceAtZenith,.2),this.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this.specularEnvironmentMaps=e.specularEnvironmentMaps,this.backFaceCulling=defaultValue(e.backFaceCulling,!0),this.debugFreezeFrame=defaultValue(e.debugFreezeFrame,!1),this.debugColorizeTiles=defaultValue(e.debugColorizeTiles,!1),this.debugWireframe=defaultValue(e.debugWireframe,!1),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=defaultValue(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=defaultValue(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=defaultValue(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=defaultValue(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=defaultValue(e.debugShowMemoryUsage,!1),this.debugShowUrl=defaultValue(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0;var s,l=this;when(e.url).then(function(e){var t;return s=Resource.createIfNeeded(e),l._resource=s,l._credits=s.credits,"json"===s.extension?t=s.getBaseUri(!0):s.isDataUri&&(t=""),l._url=s.url,l._basePath=t,Cesium3DTileset.loadJson(s)}).then(function(e){l._root=l.loadTileset(s,e);var t=defined(e.asset.gltfUpAxis)?Axis$1.fromName(e.asset.gltfUpAxis):Axis$1.Y,i=e.asset;l._asset=i,l._properties=e.properties,l._geometricError=e.geometricError,l._extensionsUsed=e.extensionsUsed,l._extensions=e.extensions,l._gltfUpAxis=t,l._extras=e.extras;i=i.extras;if(defined(i)&&defined(i.cesium)&&defined(i.cesium.credits)){var r=i.cesium.credits,n=l._credits;defined(n)||(l._credits=n=[]);for(var a=0;a<r.length;++a){var o=r[a];n.push(new Credit(o.html,o.showOnScreen))}}i=l._root.createBoundingVolume(e.root.boundingVolume,Matrix4.IDENTITY).boundingSphere.center,e=l._ellipsoid.cartesianToCartographic(i);defined(e)&&e.height>ApproximateTerrainHeights._defaultMinTerrainHeight&&(l._initialClippingPlanesOriginMatrix=Transforms.eastNorthUpToFixedFrame(i)),l._clippingPlanesOriginMatrix=Matrix4.clone(l._initialClippingPlanesOriginMatrix),l._readyPromise.resolve(l)}).otherwise(function(e){l._readyPromise.reject(e)})}Cesium3DTilesetHeatmap.prototype.colorize=function(e,t){var i,r,n;defined(this.tilePropertyName)&&e.contentAvailable&&e._selectedFrame===t.frameNumber&&(r=getHeatmapValueAndUpdateMinimumMaximum(this,e),n=this._previousMinimum,i=this._previousMaximum,n!==Number.MAX_VALUE&&i!==-Number.MAX_VALUE&&(t=i-n+CesiumMath.EPSILON7,i=CesiumMath.clamp(r-n,0,t)/t*(heatmapColors.length-1),r=Math.floor(i),n=Math.ceil(i),t=i-r,i=heatmapColors[r],r=heatmapColors[n],(n=Color.clone(Color.WHITE)).red=CesiumMath.lerp(i.red,r.red,t),n.green=CesiumMath.lerp(i.green,r.green,t),n.blue=CesiumMath.lerp(i.blue,r.blue,t),e._debugColor=n))},Cesium3DTilesetHeatmap.prototype.resetMinimumMaximum=function(){var e,t,i=this.tilePropertyName;defined(i)&&(e=this._referenceMinimum[i],t=this._referenceMaximum[i],i=defined(e)&&defined(t),this._previousMinimum=i?e:this._minimum,this._previousMaximum=i?t:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE)},Cesium3DTilesetStatistics.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},Cesium3DTilesetStatistics.prototype.incrementSelectionCounts=function(e){updatePointAndFeatureCounts(this,e,!1,!1)},Cesium3DTilesetStatistics.prototype.incrementLoadCounts=function(e){updatePointAndFeatureCounts(this,e,!1,!0)},Cesium3DTilesetStatistics.prototype.decrementLoadCounts=function(e){updatePointAndFeatureCounts(this,e,!0,!0)},Cesium3DTilesetStatistics.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.batchTableByteLength=e.batchTableByteLength},Object.defineProperties(Cesium3DTileStyleEngine.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}}),Cesium3DTileStyleEngine.prototype.makeDirty=function(){this._styleDirty=!0},Cesium3DTileStyleEngine.prototype.resetDirty=function(){this._styleDirty=!1},Cesium3DTileStyleEngine.prototype.applyStyle=function(e){if(e.ready&&(!defined(this._style)||this._style.ready)){var t=this._styleDirty;t&&++this._lastStyleTime;for(var i=this._lastStyleTime,r=e._statistics,n=t?e._selectedTiles:e._selectedTilesToStyle,a=n.length,o=0;o<a;++o){var s,l=n[o];l.lastStyleTime!==i&&(s=l.content,l.lastStyleTime=i,s.applyStyle(this._style),r.numberOfFeaturesStyled+=s.featuresLength,++r.numberOfTilesStyled)}}},Object.defineProperties(Cesium3DTileset.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){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return defined(this._root)}},readyPromise:{get:function(){return this._readyPromise.promise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return deprecationWarning("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}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=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=Matrix4.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){var e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return defined(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(Matrix4.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):Matrix4.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}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){Cartesian2.clone(e,this._imageBasedLightingFactor)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}}}),Cesium3DTileset.loadJson=function(e){return Resource.createIfNeeded(e).fetchJson()},Cesium3DTileset.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()},Cesium3DTileset.prototype.loadTileset=function(e,t,i){var r=t.asset;if(!defined(r))throw new RuntimeError("Tileset must have an asset property.");if("0.0"!==r.version&&"1.0"!==r.version)throw new RuntimeError("The tileset must be 3D Tiles version 0.0 or 1.0.");var n=this._statistics,r=r.tilesetVersion;defined(r)&&(this._basePath+="?v="+r,(e=e.clone()).setQueryParameters({v:r}));t=new Cesium3DTile(this,e,t.root,i);defined(i)&&(i.children.push(t),t._depth=i._depth+1);var a=[];for(a.push(t);0<a.length;){var o=a.pop();++n.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&o.refine===Cesium3DTileRefine$1.ADD;var s=o._header.children;if(defined(s))for(var l=s.length,c=0;c<l;++c){var u=new Cesium3DTile(this,e,s[c],o);o.children.push(u),u._depth=o._depth+1,a.push(u)}this._cullWithChildrenBounds&&Cesium3DTileOptimizations.checkChildrenWithinParent(o)}return t};var scratchPositionNormal$2=new Cartesian3,scratchCartographic$8=new Cartographic,scratchMatrix$1=new Matrix4,scratchCenter$2=new Cartesian3,scratchPosition$2=new Cartesian3,scratchDirection$1=new Cartesian3;function updateDynamicScreenSpaceError(e,t){var i,r,n,a,o,s,l=t.camera,c=e._root,u=c.contentBoundingVolume;u instanceof TileBoundingRegion?(p=Cartesian3.normalize(l.positionWC,scratchPositionNormal$2),h=l.directionWC,n=l.positionCartographic.height,d=u.minimumHeight,a=u.maximumHeight):(i=Matrix4.inverseTransformation(c.computedTransform,scratchMatrix$1),r=t.mapProjection.ellipsoid,s=u.boundingVolume,t=Matrix4.multiplyByPoint(i,s.center,scratchCenter$2),Cartesian3.magnitude(t)>r.minimumRadius?(o=Cartographic.fromCartesian(t,r,scratchCartographic$8),p=Cartesian3.normalize(l.positionWC,scratchPositionNormal$2),h=l.directionWC,n=l.positionCartographic.height,d=0,a=2*o.height):(o=Matrix4.multiplyByPoint(i,l.positionWC,scratchPosition$2),p=Cartesian3.UNIT_Z,h=Matrix4.multiplyByPointAsVector(i,l.directionWC,scratchDirection$1),h=Cartesian3.normalize(h,h),n=o.z,u instanceof TileOrientedBoundingBox?(c=c._header.boundingVolume.box[11],d=t.z-c,a=t.z+c):u instanceof TileBoundingSphere&&(s=s.radius,d=t.z-s,a=t.z+s)));var d=d+(a-d)*e.dynamicScreenSpaceErrorHeightFalloff,d=CesiumMath.clamp((n-d)/(a-d),0,1),h=1-Math.abs(Cartesian3.dot(h,p)),p=e.dynamicScreenSpaceErrorDensity;e._dynamicScreenSpaceErrorComputedDensity=p*=h*=1-d}function requestContent(e,t){var i,r;t.hasEmptyContent||(i=e._statistics,r=t.contentExpired,t.requestContent()?(r&&(t.hasTilesetContent?destroySubtree(e,t):(i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady)),++i.numberOfPendingRequests,e._requestedTilesInFlight.push(t),t.contentReadyToProcessPromise.then(addToProcessingQueue(e,t)),t.contentReadyPromise.then(handleTileSuccess(e,t)).otherwise(handleTileFailure(e,t))):++i.numberOfAttemptedRequests)}function sortRequestByPriority(e,t){return e._priority-t._priority}function cancelOutOfViewRequests(e,t){for(var i=e._requestedTilesInFlight,r=0,n=i.length,a=0;a<n;++a){var o=i[a],s=1<=t.frameNumber-o._touchedFrame;o._contentState===Cesium3DTileContentState$1.LOADING?s?(o._request.cancel(),++r):0<r&&(i[a-r]=o):++r}i.length-=r}function requestTiles(e,t){var i=e._requestedTiles,r=i.length;i.sort(sortRequestByPriority);for(var n=0;n<r;++n)requestContent(e,i[n])}function addToProcessingQueue(e,t){return function(){e._processingQueue.push(t),--e._statistics.numberOfPendingRequests,++e._statistics.numberOfTilesProcessing}}function handleTileFailure(i,r){return function(e){var t=r._contentResource.url,e=defined(e.message)?e.message:e.toString();0<i.tileFailed.numberOfListeners?i.tileFailed.raiseEvent({url:t,message:e}):(console.log("A 3D tile failed to load: "+t),console.log("Error: "+e))}}function handleTileSuccess(e,t){return function(){--e._statistics.numberOfTilesProcessing,t.hasTilesetContent||(e._statistics.incrementLoadCounts(t.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(t)),e.tileLoad.raiseEvent(t)}}function filterProcessingQueue(e){for(var t=e._processingQueue,i=t.length,r=0,n=0;n<i;++n){var a=t[n];a._contentState===Cesium3DTileContentState$1.PROCESSING?0<r&&(t[n-r]=a):++r}t.length-=r}function processTiles(e,t){filterProcessingQueue(e);for(var i=e._processingQueue,r=i.length,n=0;n<r;++n)i[n].process(e,t)}Cesium3DTileset.prototype.postPassesUpdate=function(e){this.ready&&(cancelOutOfViewRequests(this,e),raiseLoadProgressEvent(this,e),this._cache.unloadTiles(this,unloadTile),this._styleEngine.resetDirty())},Cesium3DTileset.prototype.prePassesUpdate=function(e){var t;this.ready&&(processTiles(this,e),t=this._clippingPlanes,this._clippingPlanesOriginMatrixDirty=!0,defined(t)&&t.enabled&&t.update(e),defined(this._loadTimestamp)||(this._loadTimestamp=JulianDate.clone(e.time)),this._timeSinceLoad=Math.max(1e3*JulianDate.secondsDifference(e.time,this._loadTimestamp),0),this._skipLevelOfDetail=this.skipLevelOfDetail&&!defined(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive,this.dynamicScreenSpaceError&&updateDynamicScreenSpaceError(this,e),e.newFrame&&this._cache.reset())};var scratchCartesian$4=new Cartesian3,stringOptions$1={maximumFractionDigits:3};function formatMemoryString$1(e){e/=1048576;return e<1?e.toLocaleString(void 0,stringOptions$1):Math.round(e).toLocaleString()}function computeTileLabelPosition(e){var t=e.boundingVolume.boundingVolume,i=t.halfAxes,r=t.radius,e=Cartesian3.clone(t.center,scratchCartesian$4);return defined(i)?(e.x+=.75*(i[0]+i[3]+i[6]),e.y+=.75*(i[1]+i[4]+i[7]),e.z+=.75*(i[2]+i[5]+i[8])):defined(r)&&(i=Cartesian3.normalize(t.center,scratchCartesian$4),i=Cartesian3.multiplyByScalar(i,.75*r,scratchCartesian$4),e=Cartesian3.add(i,t.center,scratchCartesian$4)),e}function addTileDebugLabel(e,t,i){var r="",n=0;t.debugShowGeometricError&&(r+="\nGeometric error: "+e.geometricError,n++),t.debugShowRenderingStatistics&&(r+="\nCommands: "+e.commandsLength,n++,0<e.content.pointsLength&&(r+="\nPoints: "+e.content.pointsLength,n++),0<e.content.trianglesLength&&(r+="\nTriangles: "+e.content.trianglesLength,n++),r+="\nFeatures: "+e.content.featuresLength,n++),t.debugShowMemoryUsage&&(r+="\nTexture Memory: "+formatMemoryString$1(e.content.texturesByteLength),r+="\nGeometry Memory: "+formatMemoryString$1(e.content.geometryByteLength),n+=2),t.debugShowUrl&&(r+="\nUrl: "+e._header.content.uri,n++);n={text:r.substring(1),position:i,font:19-n+"px sans-serif",showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(n)}function updateTileDebugLabels(e,t){var i,r,n,a=e._selectedTiles,o=a.length,s=e._emptyTiles,l=s.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly)defined(e.debugPickedTile)&&(n=defined(e.debugPickPosition)?e.debugPickPosition:computeTileLabelPosition(e.debugPickedTile),addTileDebugLabel(e.debugPickedTile,e,n).pixelOffset=new Cartesian2(15,-15));else{for(i=0;i<o;++i)addTileDebugLabel(r=a[i],e,computeTileLabelPosition(r));for(i=0;i<l;++i)(r=s[i]).hasTilesetContent&&addTileDebugLabel(r,e,computeTileLabelPosition(r))}e._tileDebugLabels.update(t)}function updateTiles(e,t,i){e._styleEngine.applyStyle(e);var r,n=i.isRender,a=e._statistics,o=t.commandList,s=o.length,l=e._selectedTiles,c=l.length,u=e._emptyTiles,d=u.length,h=e.tileVisible,p=e._skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&0<c;e._backfaceCommands.length=0,p&&(defined(e._stencilClearCommand)||(e._stencilClearCommand=new ClearCommand({stencil:0,pass:Pass$1.CESIUM_3D_TILE,renderState:RenderState.fromCache({stencilMask:StencilConstants$1.SKIP_LOD_MASK})})),o.push(e._stencilClearCommand));for(var m=o.length,f=0;f<c;++f)r=l[f],n&&h.raiseEvent(r),r.update(e,t,i),a.incrementSelectionCounts(r.content),++a.selected;for(f=0;f<d;++f)(r=u[f]).update(e,t,i);var g=o.length-m;if(e._backfaceCommands.trim(),p){var _=e._backfaceCommands.values,y=_.length;for(o.length+=y,f=g-1;0<=f;--f)o[m+y+f]=o[m+f];for(f=0;f<y;++f)o[m+f]=_[f]}g=o.length-s,a.numberOfCommands=g,n&&e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&0<g&&e._pointCloudEyeDomeLighting.update(t,s,e.pointCloudShading,e.boundingSphere),n&&(e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(defined(e._tileDebugLabels)||(e._tileDebugLabels=new LabelCollection),updateTileDebugLabels(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var scratchStack=[];function destroySubtree(e,t){var i=t,r=scratchStack;for(r.push(t);0<r.length;){for(var n=(t=r.pop()).children,a=n.length,o=0;o<a;++o)r.push(n[o]);t!==i&&(destroyTile(e,t),--e._statistics.numberOfTilesTotal)}i.children=[]}function unloadTile(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function destroyTile(e,t){e._cache.unloadTile(e,t,unloadTile),t.destroy()}function raiseLoadProgressEvent(e,t){var i=e._statistics,r=e._statisticsLast,n=i.numberOfPendingRequests,a=i.numberOfTilesProcessing,o=r.numberOfPendingRequests,s=r.numberOfTilesProcessing;Cesium3DTilesetStatistics.clone(i,r);s=n!==o||a!==s;s&&t.afterRender.push(function(){e.loadProgress.raiseEvent(n,a)}),e._tilesLoaded=0===i.numberOfPendingRequests&&0===i.numberOfTilesProcessing&&0===i.numberOfAttemptedRequests,s&&e._tilesLoaded&&(t.afterRender.push(function(){e.allTilesLoaded.raiseEvent()}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){e.initialTilesLoaded.raiseEvent()})))}function resetMinimumMaximum(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 detectModelMatrixChanged(e,t){t.frameNumber===e._updatedModelMatrixFrame&&defined(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!Matrix4.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=Matrix4.clone(e.modelMatrix,e._previousModelMatrix)))}function update$1(e,t,i,r){if(t.mode===SceneMode$1.MORPHING)return!1;if(!e.ready)return!1;var n=e._statistics;n.clear();var a=r.isRender;++e._updatedVisibilityFrame,resetMinimumMaximum(e),detectModelMatrixChanged(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;var o=r.traversal.selectTiles(e,t);if(r.requestTiles&&requestTiles(e),updateTiles(e,t,r),Cesium3DTilesetStatistics.clone(n,i),a){var s=e._credits;if(defined(s)&&0!==n.selected)for(var l=s.length,c=0;c<l;++c)t.creditDisplay.addCredit(s[c])}return o}Cesium3DTileset.prototype.trimLoadedTiles=function(){this._cache.trim()},Cesium3DTileset.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)},Cesium3DTileset.prototype.updateForPass=function(e,t){var i,r,n,a,o,s,l,c,u=t.pass;u===Cesium3DTilePass$1.PRELOAD&&(!this.preloadWhenHidden||this.show)||!(u!==Cesium3DTilePass$1.PRELOAD_FLIGHT||this.preloadFlightDestinations&&(this.show||this.preloadWhenHidden))||u===Cesium3DTilePass$1.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show)||(i=e.commandList,r=e.camera,n=e.cullingVolume,t.ready=!1,o=(a=Cesium3DTilePass$1.getPassOptions(u)).ignoreCommands,l=(s=defaultValue(t.commandList,i)).length,e.commandList=s,e.camera=defaultValue(t.camera,r),e.cullingVolume=defaultValue(t.cullingVolume,n),c=this._statisticsPerPass[u],(this.show||o)&&(this._pass=u,t.ready=update$1(this,e,c,a)),o&&(s.length=l),e.commandList=i,e.camera=r,e.cullingVolume=n)},Cesium3DTileset.prototype.hasExtension=function(e){return!!defined(this._extensionsUsed)&&-1<this._extensionsUsed.indexOf(e)},Cesium3DTileset.prototype.isDestroyed=function(){return!1},Cesium3DTileset.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),defined(this._root)){var e=scratchStack;for(e.push(this._root);0<e.length;){var t=e.pop();t.destroy();for(var i=t.children,r=i.length,n=0;n<r;++n)e.push(i[n])}}return this._root=void 0,destroyObject(this)};var modelMatrixScratch$1=new Matrix4;function Cesium3DTilesetVisualizer(e,t){t.collectionChanged.addEventListener(Cesium3DTilesetVisualizer.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function removeTileset(e,t,i,r){var n=i[t.id];defined(n)&&(r.removeAndDestroy(n.tilesetPrimitive),delete i[t.id])}function checkLoad(e,t,i){e.readyPromise.otherwise(function(e){console.error(e),i[t.id].loadFail=!0})}Cesium3DTilesetVisualizer.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,i=this._tilesetHash,r=this._primitives,n=0,a=t.length;n<a;n++){var o,s,l=t[n],c=l._tileset,u=i[l.id],d=l.isShowing&&l.isAvailable(e)&&Property.getValueOrDefault(c._show,e,!0);d&&(s=l.computeModelMatrix(e,modelMatrixScratch$1),o=Resource.createIfNeeded(Property.getValueOrUndefined(c._uri,e))),d?(d=defined(u)?u.tilesetPrimitive:void 0,defined(d)&&o.url===u.url||(defined(d)&&(r.removeAndDestroy(d),delete i[l.id]),(d=new Cesium3DTileset({url:o})).id=l,r.add(d),u={tilesetPrimitive:d,url:o.url,loadFail:!1},i[l.id]=u,checkLoad(d,l,i)),d.show=!0,defined(s)&&(d.modelMatrix=s),d.maximumScreenSpaceError=Property.getValueOrDefault(c.maximumScreenSpaceError,e,d.maximumScreenSpaceError)):defined(u)&&(u.tilesetPrimitive.show=!1)}return!0},Cesium3DTilesetVisualizer.prototype.isDestroyed=function(){return!1},Cesium3DTilesetVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Cesium3DTilesetVisualizer.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._tilesetHash,i=this._primitives,r=e.length-1;-1<r;r--)removeTileset(this,e[r],t,i);return destroyObject(this)},Cesium3DTilesetVisualizer.prototype.getBoundingSphere=function(e,t){e=this._tilesetHash[e.id];if(!defined(e)||e.loadFail)return BoundingSphereState$1.FAILED;e=e.tilesetPrimitive;return defined(e)&&e.show?e.ready?(BoundingSphere.clone(e.boundingSphere,t),BoundingSphereState$1.DONE):BoundingSphereState$1.PENDING:BoundingSphereState$1.FAILED},Cesium3DTilesetVisualizer.prototype._onCollectionChanged=function(e,t,i,r){for(var n,a=this._entitiesToVisualize,o=this._tilesetHash,s=this._primitives,l=t.length-1;-1<l;l--)defined((n=t[l])._tileset)&&a.set(n.id,n);for(l=r.length-1;-1<l;l--)defined((n=r[l])._tileset)?a.set(n.id,n):(removeTileset(this,n,o,s),a.remove(n.id));for(l=i.length-1;-1<l;l--)removeTileset(this,n=i[l],o,s),a.remove(n.id)};var defaultEvenColor$1=Color.WHITE,defaultOddColor$1=Color.BLACK,defaultRepeat$1=new Cartesian2(2,2);function CheckerboardMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,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(CheckerboardMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._evenColor)&&Property.isConstant(this._oddColor)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:createPropertyDescriptor("evenColor"),oddColor:createPropertyDescriptor("oddColor"),repeat:createPropertyDescriptor("repeat")}),CheckerboardMaterialProperty.prototype.getType=function(e){return"Checkerboard"},CheckerboardMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).lightColor=Property.getValueOrClonedDefault(this._evenColor,e,defaultEvenColor$1,t.lightColor),t.darkColor=Property.getValueOrClonedDefault(this._oddColor,e,defaultOddColor$1,t.darkColor),t.repeat=Property.getValueOrDefault(this._repeat,e,defaultRepeat$1),t},CheckerboardMaterialProperty.prototype.equals=function(e){return this===e||e instanceof CheckerboardMaterialProperty&&Property.equals(this._evenColor,e._evenColor)&&Property.equals(this._oddColor,e._oddColor)&&Property.equals(this._repeat,e._repeat)};var entityOptionsScratch$1={id:void 0};function fireChangedEvent(e){if(e._firing)e._refire=!0;else if(0===e._suspendCount){var t=e._addedEntities,i=e._removedEntities,r=e._changedEntities;if(0!==r.length||0!==t.length||0!==i.length){e._firing=!0;do{e._refire=!1;var n=t.values.slice(0),a=i.values.slice(0),o=r.values.slice(0)}while(t.removeAll(),i.removeAll(),r.removeAll(),e._collectionChanged.raiseEvent(e,n,a,o),e._refire);e._firing=!1}}}function EntityCollection(e){this._owner=e,this._entities=new AssociativeArray,this._addedEntities=new AssociativeArray,this._removedEntities=new AssociativeArray,this._changedEntities=new AssociativeArray,this._suspendCount=0,this._collectionChanged=new Event,this._id=createGuid(),this._show=!0,this._firing=!1,this._refire=!1}EntityCollection.prototype.suspendEvents=function(){this._suspendCount++},EntityCollection.prototype.resumeEvents=function(){this._suspendCount--,fireChangedEvent(this)},EntityCollection.collectionChangedEventCallback=void 0,Object.defineProperties(EntityCollection.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){this.suspendEvents();for(var t=[],i=this._entities.values,r=i.length,n=0;n<r;n++)t.push(i[n].isShowing);for(this._show=e,n=0;n<r;n++){var a=t[n],o=i[n];a!==o.isShowing&&o.definitionChanged.raiseEvent(o,"isShowing",o.isShowing,a)}this.resumeEvents()}}},owner:{get:function(){return this._owner}}}),EntityCollection.prototype.computeAvailability=function(){for(var e=Iso8601.MAXIMUM_VALUE,t=Iso8601.MINIMUM_VALUE,i=this._entities.values,r=0,n=i.length;r<n;r++){var a,o=i[r].availability;defined(o)&&(a=o.start,o=o.stop,JulianDate.lessThan(a,e)&&!a.equals(Iso8601.MINIMUM_VALUE)&&(e=a),JulianDate.greaterThan(o,t)&&!o.equals(Iso8601.MAXIMUM_VALUE)&&(t=o))}return new TimeInterval({start:e=Iso8601.MAXIMUM_VALUE.equals(e)?Iso8601.MINIMUM_VALUE:e,stop:t=Iso8601.MINIMUM_VALUE.equals(t)?Iso8601.MAXIMUM_VALUE:t})},EntityCollection.prototype.add=function(e){var t=(e=!(e instanceof Entity)?new Entity(e):e).id,i=this._entities;if(i.contains(t))throw new RuntimeError("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,i.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(EntityCollection.prototype._onEntityDefinitionChanged,this),fireChangedEvent(this),e},EntityCollection.prototype.remove=function(e){return!!defined(e)&&this.removeById(e.id)},EntityCollection.prototype.contains=function(e){return this._entities.get(e.id)===e},EntityCollection.prototype.removeById=function(e){if(!defined(e))return!1;var t=this._entities.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,t),this._changedEntities.remove(e)),this._entities.remove(e),t.definitionChanged.removeEventListener(EntityCollection.prototype._onEntityDefinitionChanged,this),fireChangedEvent(this),!0)},EntityCollection.prototype.removeAll=function(){for(var e=this._entities,t=e.length,i=e.values,r=this._addedEntities,n=this._removedEntities,a=0;a<t;a++){var o=i[a],s=o.id;defined(r.get(s))||(o.definitionChanged.removeEventListener(EntityCollection.prototype._onEntityDefinitionChanged,this),n.set(s,o))}e.removeAll(),r.removeAll(),this._changedEntities.removeAll(),fireChangedEvent(this)},EntityCollection.prototype.getById=function(e){return this._entities.get(e)},EntityCollection.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return defined(t)||(entityOptionsScratch$1.id=e,t=new Entity(entityOptionsScratch$1),this.add(t)),t},EntityCollection.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),fireChangedEvent(this)};var entityOptionsScratch={id:void 0},entityIdScratch=new Array(2);function clean(e){for(var t=e.propertyNames,i=t.length,r=0;r<i;r++)e[t[r]]=void 0;e._name=void 0,e._availability=void 0}function subscribeToEntity(e,t,i,r){entityIdScratch[0]=i,entityIdScratch[1]=r.id,t[JSON.stringify(entityIdScratch)]=r.definitionChanged.addEventListener(CompositeEntityCollection.prototype._onDefinitionChanged,e)}function unsubscribeFromEntity(e,t,i,r){entityIdScratch[0]=i,entityIdScratch[1]=r.id;r=JSON.stringify(entityIdScratch);t[r](),t[r]=void 0}function recomposite(e){if(e._shouldRecomposite=!0,0===e._suspendCount){for(var t,i,r,n,a,o=e._collections,s=o.length,l=e._collectionsCopy,c=l.length,u=e._composite,d=new EntityCollection(e),h=e._eventHash,p=0;p<c;p++)for((n=l[p]).collectionChanged.removeEventListener(CompositeEntityCollection.prototype._onCollectionChanged,e),i=n.values,a=n.id,r=i.length-1;-1<r;r--)unsubscribeFromEntity(e,h,a,t=i[r]);for(p=s-1;0<=p;p--)for((n=o[p]).collectionChanged.addEventListener(CompositeEntityCollection.prototype._onCollectionChanged,e),i=n.values,a=n.id,r=i.length-1;-1<r;r--){subscribeToEntity(e,h,a,t=i[r]);var m=d.getById(t.id);defined(m)||(defined(m=u.getById(t.id))?clean(m):(entityOptionsScratch.id=t.id,m=new Entity(entityOptionsScratch)),d.add(m)),m.merge(t)}e._collectionsCopy=o.slice(0),u.suspendEvents(),u.removeAll();var f=d.values;for(p=0;p<f.length;p++)u.add(f[p]);u.resumeEvents()}}function CompositeEntityCollection(e,t){this._owner=t,this._composite=new EntityCollection(this),this._suspendCount=0,this._collections=defined(e)?e.slice():[],this._collectionsCopy=[],this._id=createGuid(),this._eventHash={},recomposite(this),this._shouldRecomposite=!1}function getCollectionIndex(e,t){return e.indexOf(t)}function swapCollections(e,t,i){var r,n=e._collections;(t=CesiumMath.clamp(t,0,n.length-1))!==(i=CesiumMath.clamp(i,0,n.length-1))&&(r=n[t],n[t]=n[i],n[i]=r,recomposite(e))}function subscribeAll(e,t,i,r){function n(){i.raiseEvent(e)}var a=[];t.removeAll();for(var o=r.length,s=0;s<o;s++){var l=r.get(s);defined(l.data)&&-1===a.indexOf(l.data)&&t.add(l.data.definitionChanged,n)}}function CompositeProperty(){this._eventHelper=new EventHelper,this._definitionChanged=new Event,this._intervals=new TimeIntervalCollection,this._intervals.changedEvent.addEventListener(CompositeProperty.prototype._intervalsChanged,this)}function CompositeMaterialProperty(){this._definitionChanged=new Event,this._composite=new CompositeProperty,this._composite.definitionChanged.addEventListener(CompositeMaterialProperty.prototype._raiseDefinitionChanged,this)}function CompositePositionProperty(e){this._referenceFrame=defaultValue(e,ReferenceFrame$1.FIXED),this._definitionChanged=new Event,this._composite=new CompositeProperty,this._composite.definitionChanged.addEventListener(CompositePositionProperty.prototype._raiseDefinitionChanged,this)}Object.defineProperties(CompositeEntityCollection.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}}}),CompositeEntityCollection.prototype.addCollection=function(e,t){defined(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),recomposite(this)},CompositeEntityCollection.prototype.removeCollection=function(e){e=this._collections.indexOf(e);return-1!==e&&(this._collections.splice(e,1),recomposite(this),!0)},CompositeEntityCollection.prototype.removeAllCollections=function(){this._collections.length=0,recomposite(this)},CompositeEntityCollection.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},CompositeEntityCollection.prototype.contains=function(e){return this._composite.contains(e)},CompositeEntityCollection.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},CompositeEntityCollection.prototype.getCollection=function(e){return this._collections[e]},CompositeEntityCollection.prototype.getCollectionsLength=function(){return this._collections.length},CompositeEntityCollection.prototype.raiseCollection=function(e){e=getCollectionIndex(this._collections,e);swapCollections(this,e,e+1)},CompositeEntityCollection.prototype.lowerCollection=function(e){e=getCollectionIndex(this._collections,e);swapCollections(this,e,e-1)},CompositeEntityCollection.prototype.raiseCollectionToTop=function(e){var t=getCollectionIndex(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),recomposite(this))},CompositeEntityCollection.prototype.lowerCollectionToBottom=function(e){var t=getCollectionIndex(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),recomposite(this))},CompositeEntityCollection.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},CompositeEntityCollection.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(recomposite(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},CompositeEntityCollection.prototype.computeAvailability=function(){return this._composite.computeAvailability()},CompositeEntityCollection.prototype.getById=function(e){return this._composite.getById(e)},CompositeEntityCollection.prototype._onCollectionChanged=function(e,t,i){var r,n,a=this._collectionsCopy,o=a.length,s=this._composite;s.suspendEvents();for(var l=i.length,c=this._eventHash,u=e.id,d=0;d<l;d++){var h=i[d];unsubscribeFromEntity(this,c,u,h);for(var p=h.id,m=o-1;0<=m;m--)defined(r=a[m].getById(p))&&(defined(n)||clean(n=s.getById(p)),n.merge(r));defined(n)||s.removeById(p),n=void 0}var f=t.length;for(d=0;d<f;d++){var g=t[d];subscribeToEntity(this,c,u,g);var _=g.id;for(m=o-1;0<=m;m--)defined(r=a[m].getById(_))&&(defined(n)||(defined(n=s.getById(_))?clean(n):(entityOptionsScratch.id=_,n=new Entity(entityOptionsScratch),s.add(n))),n.merge(r));n=void 0}s.resumeEvents()},CompositeEntityCollection.prototype._onDefinitionChanged=function(e,t,i,r){for(var n=this._collections,a=this._composite,o=n.length,s=e.id,a=a.getById(s),l=a[t],s=!defined(l),c=!0,u=o-1;0<=u;u--){var d=n[u].getById(e.id);if(defined(d)){d=d[t];if(defined(d)){if(c){if(c=!1,!defined(d.merge)||!defined(d.clone)){l=d;break}l=d.clone(l)}l.merge(d)}}}s&&-1===a.propertyNames.indexOf(t)&&a.addProperty(t),a[t]=l},Object.defineProperties(CompositeProperty.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),CompositeProperty.prototype.getValue=function(e,t){var i=this._intervals.findDataForIntervalContainingDate(e);if(defined(i))return i.getValue(e,t)},CompositeProperty.prototype.equals=function(e){return this===e||e instanceof CompositeProperty&&this._intervals.equals(e._intervals,Property.equals)},CompositeProperty.prototype._intervalsChanged=function(){subscribeAll(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},Object.defineProperties(CompositeMaterialProperty.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),CompositeMaterialProperty.prototype.getType=function(e){var t=this._composite._intervals.findDataForIntervalContainingDate(e);if(defined(t))return t.getType(e)},CompositeMaterialProperty.prototype.getValue=function(e,t){var i=this._composite._intervals.findDataForIntervalContainingDate(e);if(defined(i))return i.getValue(e,t)},CompositeMaterialProperty.prototype.equals=function(e){return this===e||e instanceof CompositeMaterialProperty&&this._composite.equals(e._composite,Property.equals)},CompositeMaterialProperty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(CompositePositionProperty.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}}}),CompositePositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},CompositePositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){var r=this._composite._intervals.findDataForIntervalContainingDate(e);if(defined(r))return r.getValueInReferenceFrame(e,t,i)},CompositePositionProperty.prototype.equals=function(e){return this===e||e instanceof CompositePositionProperty&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,Property.equals)},CompositePositionProperty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var defaultZIndex$1=new ConstantProperty(0);function GroundGeometryUpdater(e){GeometryUpdater.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}defined(Object.create)&&(GroundGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),GroundGeometryUpdater.prototype.constructor=GroundGeometryUpdater),Object.defineProperties(GroundGeometryUpdater.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),GroundGeometryUpdater.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!defined(t.height)&&!defined(t.extrudedHeight)&&GroundPrimitive.isSupported(this._scene)},GroundGeometryUpdater.prototype._getIsClosed=function(e){var t=e.height,e=e.extrudedHeight;return 0===t||defined(e)&&e!==t},GroundGeometryUpdater.prototype._computeCenter=DeveloperError.throwInstantiationError,GroundGeometryUpdater.prototype._onEntityPropertyChanged=function(e,t,i,r){GeometryUpdater.prototype._onEntityPropertyChanged.call(this,e,t,i,r),-1===this._observedPropertyNames.indexOf(t)||defined(i=this._entity[this._geometryPropertyName])&&(defined(i.zIndex)&&(defined(i.height)||defined(i.extrudedHeight))&&oneTimeWarning(oneTimeWarning.geometryZIndex),this._zIndex=defaultValue(i.zIndex,defaultZIndex$1),defined(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),r=i.heightReference,t=i.extrudedHeightReference,(defined(r)||defined(t))&&(i=new CallbackProperty(this._computeCenter.bind(this),!this._dynamic),this._terrainOffsetProperty=new TerrainOffsetProperty(this._scene,i,r,t)))},GroundGeometryUpdater.prototype.destroy=function(){defined(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),GeometryUpdater.prototype.destroy.call(this)},GroundGeometryUpdater.getGeometryHeight=function(e,t){if(defined(e))return t!==HeightReference$1.CLAMP_TO_GROUND?e:0;t!==HeightReference$1.NONE&&oneTimeWarning(oneTimeWarning.geometryHeightReference)},GroundGeometryUpdater.getGeometryExtrudedHeight=function(e,t){if(defined(e))return t!==HeightReference$1.CLAMP_TO_GROUND?e:GroundGeometryUpdater.CLAMP_TO_GROUND;t!==HeightReference$1.NONE&&oneTimeWarning(oneTimeWarning.geometryExtrudedHeightReference)},GroundGeometryUpdater.CLAMP_TO_GROUND="clamp",GroundGeometryUpdater.computeGeometryOffsetAttribute=function(e,t,i,r){defined(e)&&defined(t)||(t=HeightReference$1.NONE),defined(i)&&defined(r)||(r=HeightReference$1.NONE);i=0;return t!==HeightReference$1.NONE&&i++,r===HeightReference$1.RELATIVE_TO_GROUND&&i++,2===i?GeometryOffsetAttribute$1.ALL:1===i?GeometryOffsetAttribute$1.TOP:void 0};var scratchColor$d=new Color,defaultOffset$9=Cartesian3.ZERO,offsetScratch$8=new Cartesian3,scratchRectangle$4=new Rectangle;function CorridorGeometryOptions(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 CorridorGeometryUpdater(e,t){GroundGeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new CorridorGeometryOptions(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function DynamicCorridorGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}function DataSource(){DeveloperError.throwInstantiationError()}function PointPrimitive(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucencyByDistance,r=e.scaleByDistance,n=e.distanceDisplayCondition;defined(i)&&(i=NearFarScalar.clone(i)),defined(r)&&(r=NearFarScalar.clone(r)),defined(n)&&(n=DistanceDisplayCondition.clone(n)),this._show=defaultValue(e.show,!0),this._position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this._actualPosition=Cartesian3.clone(this._position),this._color=Color.clone(defaultValue(e.color,Color.WHITE)),this._outlineColor=Color.clone(defaultValue(e.outlineColor,Color.TRANSPARENT)),this._outlineWidth=defaultValue(e.outlineWidth,0),this._pixelSize=defaultValue(e.pixelSize,10),this._scaleByDistance=r,this._translucencyByDistance=i,this._distanceDisplayCondition=n,this._disableDepthTestDistance=defaultValue(e.disableDepthTestDistance,0),this._id=e.id,this._collection=defaultValue(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}defined(Object.create)&&(CorridorGeometryUpdater.prototype=Object.create(GroundGeometryUpdater.prototype),CorridorGeometryUpdater.prototype.constructor=CorridorGeometryUpdater),CorridorGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n={show:new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$d)),defined(t)||(t=Color.WHITE),n.color=ColorGeometryInstanceAttribute.fromColor(t)),defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$9,offsetScratch$8))),new GeometryInstance({id:i,geometry:new CorridorGeometry(this._options),attributes:n})},CorridorGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$d),r={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return defined(this._options.offsetAttribute)&&(r.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$9,offsetScratch$8))),new GeometryInstance({id:t,geometry:new CorridorOutlineGeometry(this._options),attributes:r})},CorridorGeometryUpdater.prototype._computeCenter=function(e,t){e=Property.getValueOrUndefined(this._entity.corridor.positions,e);if(defined(e)&&0!==e.length)return Cartesian3.clone(e[Math.floor(e.length/2)],t)},CorridorGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.positions)||!defined(t.width)||GeometryUpdater.prototype._isHidden.call(this,e,t)},CorridorGeometryUpdater.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Property.isConstant(t.height)||!Property.isConstant(t.extrudedHeight)||!Property.isConstant(t.granularity)||!Property.isConstant(t.width)||!Property.isConstant(t.outlineWidth)||!Property.isConstant(t.cornerType)||!Property.isConstant(t.zIndex)||this._onTerrain&&!Property.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ColorMaterialProperty)},CorridorGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrUndefined(t.height,Iso8601.MINIMUM_VALUE),r=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),n=Property.getValueOrUndefined(t.extrudedHeight,Iso8601.MINIMUM_VALUE),a=Property.getValueOrDefault(t.extrudedHeightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE);defined(n)&&!defined(i)&&(i=0);var o=this._options;o.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,o.positions=t.positions.getValue(Iso8601.MINIMUM_VALUE,o.positions),o.width=t.width.getValue(Iso8601.MINIMUM_VALUE),o.granularity=Property.getValueOrUndefined(t.granularity,Iso8601.MINIMUM_VALUE),o.cornerType=Property.getValueOrUndefined(t.cornerType,Iso8601.MINIMUM_VALUE),o.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(i,r,n,a),o.height=GroundGeometryUpdater.getGeometryHeight(i,r),(n=GroundGeometryUpdater.getGeometryExtrudedHeight(n,a))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(n=ApproximateTerrainHeights.getMinimumMaximumHeights(CorridorGeometry.computeRectangle(o,scratchRectangle$4)).minimumTerrainHeight),o.extrudedHeight=n},CorridorGeometryUpdater.DynamicGeometryUpdater=DynamicCorridorGeometryUpdater,defined(Object.create)&&(DynamicCorridorGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicCorridorGeometryUpdater.prototype.constructor=DynamicCorridorGeometryUpdater),DynamicCorridorGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(r.positions)||!defined(r.width)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DynamicCorridorGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options,n=Property.getValueOrUndefined(t.height,i),a=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),o=Property.getValueOrUndefined(t.extrudedHeight,i),s=Property.getValueOrDefault(t.extrudedHeightReference,i,HeightReference$1.NONE);defined(o)&&!defined(n)&&(n=0),r.positions=Property.getValueOrUndefined(t.positions,i),r.width=Property.getValueOrUndefined(t.width,i),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.cornerType=Property.getValueOrUndefined(t.cornerType,i),r.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(n,a,o,s),r.height=GroundGeometryUpdater.getGeometryHeight(n,a),(o=GroundGeometryUpdater.getGeometryExtrudedHeight(o,s))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(o=ApproximateTerrainHeights.getMinimumMaximumHeights(CorridorGeometry.computeRectangle(r,scratchRectangle$4)).minimumTerrainHeight),r.extrudedHeight=o},Object.defineProperties(DataSource.prototype,{name:{get:DeveloperError.throwInstantiationError},clock:{get:DeveloperError.throwInstantiationError},entities:{get:DeveloperError.throwInstantiationError},isLoading:{get:DeveloperError.throwInstantiationError},changedEvent:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError},loadingEvent:{get:DeveloperError.throwInstantiationError},show:{get:DeveloperError.throwInstantiationError},clustering:{get:DeveloperError.throwInstantiationError}}),DataSource.prototype.update=function(e){DeveloperError.throwInstantiationError()},DataSource.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var SHOW_INDEX$1=PointPrimitive.SHOW_INDEX=0,POSITION_INDEX$1=PointPrimitive.POSITION_INDEX=1,COLOR_INDEX$1=PointPrimitive.COLOR_INDEX=2,OUTLINE_COLOR_INDEX$1=PointPrimitive.OUTLINE_COLOR_INDEX=3,OUTLINE_WIDTH_INDEX$1=PointPrimitive.OUTLINE_WIDTH_INDEX=4,PIXEL_SIZE_INDEX$1=PointPrimitive.PIXEL_SIZE_INDEX=5,SCALE_BY_DISTANCE_INDEX$1=PointPrimitive.SCALE_BY_DISTANCE_INDEX=6,TRANSLUCENCY_BY_DISTANCE_INDEX$1=PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX=7,DISTANCE_DISPLAY_CONDITION_INDEX$1=PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX=8,DISABLE_DEPTH_DISTANCE_INDEX$1=PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX=9;function makeDirty(e,t){var i=e._pointPrimitiveCollection;defined(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}PointPrimitive.NUMBER_OF_PROPERTIES=10,Object.defineProperties(PointPrimitive.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,makeDirty(this,SHOW_INDEX$1))}},position:{get:function(){return this._position},set:function(e){var t=this._position;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),Cartesian3.clone(e,this._actualPosition),makeDirty(this,POSITION_INDEX$1))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;NearFarScalar.equals(t,e)||(this._scaleByDistance=NearFarScalar.clone(e,t),makeDirty(this,SCALE_BY_DISTANCE_INDEX$1))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;NearFarScalar.equals(t,e)||(this._translucencyByDistance=NearFarScalar.clone(e,t),makeDirty(this,TRANSLUCENCY_BY_DISTANCE_INDEX$1))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,makeDirty(this,PIXEL_SIZE_INDEX$1))}},color:{get:function(){return this._color},set:function(e){var t=this._color;Color.equals(t,e)||(Color.clone(e,t),makeDirty(this,COLOR_INDEX$1))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;Color.equals(t,e)||(Color.clone(e,t),makeDirty(this,OUTLINE_COLOR_INDEX$1))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,makeDirty(this,OUTLINE_WIDTH_INDEX$1))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){DistanceDisplayCondition.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition),makeDirty(this,DISTANCE_DISPLAY_CONDITION_INDEX$1))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,makeDirty(this,DISABLE_DEPTH_DISTANCE_INDEX$1))}},id:{get:function(){return this._id},set:function(e){this._id=e,defined(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,makeDirty(this,SHOW_INDEX$1))}}}),PointPrimitive.prototype.getPickId=function(e){return defined(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},PointPrimitive.prototype._getActualPosition=function(){return this._actualPosition},PointPrimitive.prototype._setActualPosition=function(e){Cartesian3.clone(e,this._actualPosition),makeDirty(this,POSITION_INDEX$1)};var tempCartesian3=new Cartesian4;PointPrimitive._computeActualPosition=function(e,t,i){return t.mode===SceneMode$1.SCENE3D?e:(Matrix4.multiplyByPoint(i,e,tempCartesian3),SceneTransforms.computeActualWgs84Position(t,tempCartesian3))};var scratchCartesian4$2=new Cartesian4;PointPrimitive._computeScreenSpacePosition=function(e,t,i,r){t=Matrix4.multiplyByVector(e,Cartesian4.fromElements(t.x,t.y,t.z,1,scratchCartesian4$2),scratchCartesian4$2);return SceneTransforms.wgs84ToWindowCoordinates(i,t,r)},PointPrimitive.prototype.computeScreenSpacePosition=function(e,t){var i=this._pointPrimitiveCollection;defined(t)||(t=new Cartesian2);i=i.modelMatrix,t=PointPrimitive._computeScreenSpacePosition(i,this._actualPosition,e,t);if(defined(t))return t.y=e.canvas.clientHeight-t.y,t},PointPrimitive.getScreenSpaceBoundingBox=function(e,t,i){var r=e.pixelSize,n=.5*r,e=t.x-n,t=t.y-n,n=r,r=r;return(i=!defined(i)?new BoundingRectangle:i).x=e,i.y=t,i.width=n,i.height=r,i},PointPrimitive.prototype.equals=function(e){return this===e||defined(e)&&this._id===e._id&&Cartesian3.equals(this._position,e._position)&&Color.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&Color.equals(this._outlineColor,e._outlineColor)&&NearFarScalar.equals(this._scaleByDistance,e._scaleByDistance)&&NearFarScalar.equals(this._translucencyByDistance,e._translucencyByDistance)&&DistanceDisplayCondition.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},PointPrimitive.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var PointPrimitiveCollectionFS="varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\nvarying vec4 v_pickColor;\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\ngl_FragColor = czm_gammaCorrect(color);\nczm_writeLogDepth();\n}\n",PointPrimitiveCollectionVS="uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nattribute vec3 distanceDisplayConditionAndDisableDepth;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\nvarying vec4 v_pickColor;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_pixelRatio;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0, 0.0, 1.0);\n}\n#endif\ngl_Position = czm_projection * positionEC;\nczm_vertexLogDepth();\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(vec4(czm_currentFrustum.x));\n#endif\n}\n}\n#endif\nv_color = color;\nv_color.a *= translucency * show;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency * show;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize * show;\ngl_Position *= show;\nv_pickColor = pickColor;\n}\n",SHOW_INDEX=PointPrimitive.SHOW_INDEX,POSITION_INDEX=PointPrimitive.POSITION_INDEX,COLOR_INDEX=PointPrimitive.COLOR_INDEX,OUTLINE_COLOR_INDEX=PointPrimitive.OUTLINE_COLOR_INDEX,OUTLINE_WIDTH_INDEX=PointPrimitive.OUTLINE_WIDTH_INDEX,PIXEL_SIZE_INDEX=PointPrimitive.PIXEL_SIZE_INDEX,SCALE_BY_DISTANCE_INDEX=PointPrimitive.SCALE_BY_DISTANCE_INDEX,TRANSLUCENCY_BY_DISTANCE_INDEX=PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX,DISTANCE_DISPLAY_CONDITION_INDEX=PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX,DISABLE_DEPTH_DISTANCE_INDEX=PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX,NUMBER_OF_PROPERTIES=PointPrimitive.NUMBER_OF_PROPERTIES,attributeLocations$1={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function PointPrimitiveCollection(e){e=defaultValue(e,defaultValue.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(NUMBER_OF_PROPERTIES),this._maxPixelSize=1,this._baseVolume=new BoundingSphere,this._baseVolumeWC=new BoundingSphere,this._baseVolume2D=new BoundingSphere,this._boundingVolume=new BoundingSphere,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.blendOption=defaultValue(e.blendOption,BlendOption$1.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=SceneMode$1.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW,BufferUsage$1.STATIC_DRAW];var t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}function destroyPointPrimitives(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function removePointPrimitives(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],i=e._pointPrimitives,r=i.length,n=0,a=0;n<r;++n){var o=i[n];o&&(o._index=a++,t.push(o))}e._pointPrimitives=t}}function createVAF(e,t,i){return new VertexArrayFacade(e,[{index:attributeLocations$1.positionHighAndSize,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[POSITION_INDEX]},{index:attributeLocations$1.positionLowAndShow,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[POSITION_INDEX]},{index:attributeLocations$1.compressedAttribute0,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[COLOR_INDEX]},{index:attributeLocations$1.compressedAttribute1,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[TRANSLUCENCY_BY_DISTANCE_INDEX]},{index:attributeLocations$1.scaleByDistance,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[SCALE_BY_DISTANCE_INDEX]},{index:attributeLocations$1.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,usage:i[DISTANCE_DISPLAY_CONDITION_INDEX]}],t)}Object.defineProperties(PointPrimitiveCollection.prototype,{length:{get:function(){return removePointPrimitives(this),this._pointPrimitives.length}}}),PointPrimitiveCollection.prototype.add=function(e){e=new PointPrimitive(e,this);return e._index=this._pointPrimitives.length,this._pointPrimitives.push(e),this._createVertexArray=!0,e},PointPrimitiveCollection.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},PointPrimitiveCollection.prototype.removeAll=function(){destroyPointPrimitives(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},PointPrimitiveCollection.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},PointPrimitiveCollection.prototype.contains=function(e){return defined(e)&&e._pointPrimitiveCollection===this},PointPrimitiveCollection.prototype.get=function(e){return removePointPrimitives(this),this._pointPrimitives[e]},PointPrimitiveCollection.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<NUMBER_OF_PROPERTIES;++r){var n=0===i[r]?BufferUsage$1.STATIC_DRAW:BufferUsage$1.STREAM_DRAW,t=t||e[r]!==n;e[r]=n}return t};var writePositionScratch=new EncodedCartesian3;function writePositionSizeAndOutline(e,t,i,r){var n=r._index,a=r._getActualPosition();e._mode===SceneMode$1.SCENE3D&&(BoundingSphere.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),EncodedCartesian3.fromCartesian(a,writePositionScratch);var o=r.pixelSize,a=r.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,o+a);r=i[attributeLocations$1.positionHighAndSize],e=writePositionScratch.high;r(n,e.x,e.y,e.z,o);o=i[attributeLocations$1.positionLowAndOutline],i=writePositionScratch.low;o(n,i.x,i.y,i.z,a)}var LEFT_SHIFT16=65536,LEFT_SHIFT8=256;function writeCompressedAttrib0(e,t,i,r){var n=r._index,a=r.color,o=r.getPickId(t).color,s=r.outlineColor,l=Color.floatToByte(a.red),c=Color.floatToByte(a.green),u=Color.floatToByte(a.blue),t=l*LEFT_SHIFT16+c*LEFT_SHIFT8+u,l=Color.floatToByte(s.red),c=Color.floatToByte(s.green),u=Color.floatToByte(s.blue),r=l*LEFT_SHIFT16+c*LEFT_SHIFT8+u;l=Color.floatToByte(o.red),c=Color.floatToByte(o.green),u=Color.floatToByte(o.blue);u=l*LEFT_SHIFT16+c*LEFT_SHIFT8+u,o=Color.floatToByte(a.alpha)*LEFT_SHIFT16+Color.floatToByte(s.alpha)*LEFT_SHIFT8+Color.floatToByte(o.alpha);(0,i[attributeLocations$1.compressedAttribute0])(n,t,r,u,o)}function writeCompressedAttrib1(e,t,i,r){var n=r._index,a=0,o=1,s=1,l=1,c=r.translucencyByDistance;defined(c)&&(a=c.near,o=c.nearValue,s=c.far,l=c.farValue,1===o&&1===l||(e._shaderTranslucencyByDistance=!0));e=r.show&&r.clusterShow;0===r.color.alpha&&0===r.outlineColor.alpha&&(e=!1),o=CesiumMath.clamp(o,0,1);o=(e?1:0)*LEFT_SHIFT8+(o=1===o?255:255*o|0),l=CesiumMath.clamp(l,0,1);(0,i[attributeLocations$1.compressedAttribute1])(n,o,l=1===l?255:255*l|0,a,s)}function writeScaleByDistance(e,t,i,r){var n=r._index,a=i[attributeLocations$1.scaleByDistance],o=0,s=1,l=1,i=1,r=r.scaleByDistance;defined(r)&&(o=r.near,s=r.nearValue,l=r.far,i=r.farValue,1===s&&1===i||(e._shaderScaleByDistance=!0)),a(n,o,s,l,i)}function writeDistanceDisplayConditionAndDepthDisable(e,t,i,r){var n=r._index,a=i[attributeLocations$1.distanceDisplayConditionAndDisableDepth],o=0,s=Number.MAX_VALUE,i=r.distanceDisplayCondition;defined(i)&&(o=i.near,s=i.far,o*=o,s*=s,e._shaderDistanceDisplayCondition=!0);r=r.disableDepthTestDistance;0<(r*=r)&&(e._shaderDisableDepthDistance=!0,r===Number.POSITIVE_INFINITY&&(r=-1)),a(n,o,s,r)}function writePointPrimitive(e,t,i,r){writePositionSizeAndOutline(e,t,i,r),writeCompressedAttrib0(e,t,i,r),writeCompressedAttrib1(e,t,i,r),writeScaleByDistance(e,t,i,r),writeDistanceDisplayConditionAndDepthDisable(e,t,i,r)}function recomputeActualPositions(e,t,i,r,n,a){var o;r.mode===SceneMode$1.SCENE3D?(o=e._baseVolume,e._boundingVolumeDirty=!0):o=e._baseVolume2D;for(var s=[],l=0;l<i;++l){var c=t[l],u=c.position,u=PointPrimitive._computeActualPosition(u,r,n);defined(u)&&(c._setActualPosition(u),a?s.push(u):BoundingSphere.expand(o,u,o))}a&&BoundingSphere.fromPoints(s,o)}function updateMode(e,t){var i=t.mode,r=e._pointPrimitives,n=e._pointPrimitivesToUpdate,a=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==SceneMode$1.SCENE3D&&!Matrix4.equals(a,e.modelMatrix)?(e._mode=i,Matrix4.clone(e.modelMatrix,a),e._createVertexArray=!0,i!==SceneMode$1.SCENE3D&&i!==SceneMode$1.SCENE2D&&i!==SceneMode$1.COLUMBUS_VIEW||recomputeActualPositions(e,r,r.length,t,a,!0)):i===SceneMode$1.MORPHING?recomputeActualPositions(e,r,r.length,t,a,!0):i!==SceneMode$1.SCENE2D&&i!==SceneMode$1.COLUMBUS_VIEW||recomputeActualPositions(e,n,e._pointPrimitivesToUpdateIndex,t,a,!1)}function updateBoundingVolume(e,t,i){e=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;i.radius+=e}var scratchWriterArray=[];function kdbush(e,t,i,r,n){return new KDBush(e,t,i,r,n)}function KDBush(e,t,i,r,n){t=t||defaultGetX,i=i||defaultGetY,n=n||Array,this.nodeSize=r||64,this.points=e,this.ids=new n(e.length),this.coords=new n(2*e.length);for(var a=0;a<e.length;a++)this.ids[a]=a,this.coords[2*a]=t(e[a]),this.coords[2*a+1]=i(e[a]);sort(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function defaultGetX(e){return e[0]}function defaultGetY(e){return e[1]}function range(e,t,i,r,n,a,o){for(var s=[0,e.length-1,0],l=[];s.length;){var c=s.pop(),u=s.pop(),d=s.pop();if(u-d<=o)for(var h=d;h<=u;h++)m=t[2*h],f=t[2*h+1],i<=m&&m<=n&&r<=f&&f<=a&&l.push(e[h]);else{var p=Math.floor((d+u)/2),m=t[2*p],f=t[2*p+1];i<=m&&m<=n&&r<=f&&f<=a&&l.push(e[p]);var g=(c+1)%2;(0===c?i<=m:r<=f)&&(s.push(d),s.push(p-1),s.push(g)),(0===c?m<=n:f<=a)&&(s.push(p+1),s.push(u),s.push(g))}}return l}function sort(e,t,i,r,n,a){var o;n-r<=i||(select(e,t,o=Math.floor((r+n)/2),r,n,a%2),sort(e,t,i,r,o-1,a+1),sort(e,t,i,o+1,n,a+1))}function select(e,t,i,r,n,a){for(;r<n;){var o,s,l,c;600<n-r&&(o=n-r+1,s=i-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),c=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1),select(e,t,i,Math.max(r,Math.floor(i-s*l/o+c)),Math.min(n,Math.floor(i+(o-s)*l/o+c)),a));var u=t[2*i+a],d=r,h=n;for(swapItem(e,t,r,i),t[2*n+a]>u&&swapItem(e,t,r,n);d<h;){for(swapItem(e,t,d,h),d++,h--;t[2*d+a]<u;)d++;for(;t[2*h+a]>u;)h--}t[2*r+a]===u?swapItem(e,t,r,h):swapItem(e,t,++h,n),h<=i&&(r=h+1),i<=h&&(n=h-1)}}function swapItem(e,t,i,r){swap$1(e,i,r),swap$1(t,2*i,2*r),swap$1(t,2*i+1,2*r+1)}function swap$1(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function within(e,t,i,r,n,a){for(var o=[0,e.length-1,0],s=[],l=n*n;o.length;){var c=o.pop(),u=o.pop(),d=o.pop();if(u-d<=a)for(var h=d;h<=u;h++)sqDist(t[2*h],t[2*h+1],i,r)<=l&&s.push(e[h]);else{var p=Math.floor((d+u)/2),m=t[2*p],f=t[2*p+1];sqDist(m,f,i,r)<=l&&s.push(e[p]);var g=(c+1)%2;(0===c?i-n<=m:r-n<=f)&&(o.push(d),o.push(p-1),o.push(g)),(0===c?m<=i+n:f<=r+n)&&(o.push(p+1),o.push(u),o.push(g))}}return s}function sqDist(e,t,i,r){i=e-i,r=t-r;return i*i+r*r}function EntityCluster(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._enabled=defaultValue(e.enabled,!1),this._pixelRange=defaultValue(e.pixelRange,80),this._minimumClusterSize=defaultValue(e.minimumClusterSize,2),this._clusterBillboards=defaultValue(e.clusterBillboards,!0),this._clusterLabels=defaultValue(e.clusterLabels,!0),this._clusterPoints=defaultValue(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 Event,this.show=defaultValue(e.show,!0)}function getX(e){return e.coord.x}function getY(e){return e.coord.y}function expandBoundingBox(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}PointPrimitiveCollection.prototype.update=function(e){if(removePointPrimitives(this),this.show){this._maxTotalPointSize=ContextLimits.maximumAliasedPointSize,updateMode(this,e);var t=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,n=this._propertiesChanged,a=this._createVertexArray,o=e.context,s=e.passes,l=s.pick;if(a||!l&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var c=0;c<NUMBER_OF_PROPERTIES;++c)n[c]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),0<t){this._vaf=createVAF(o,t,this._buffersUsage);for(var u=this._vaf.writers,d=0;d<t;++d){var h=this._pointPrimitives[d];h._dirty=!1,writePointPrimitive(this,o,u,h)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(0<r){var p=scratchWriterArray;p.length=0,(n[POSITION_INDEX]||n[OUTLINE_WIDTH_INDEX]||n[PIXEL_SIZE_INDEX])&&p.push(writePositionSizeAndOutline),(n[COLOR_INDEX]||n[OUTLINE_COLOR_INDEX])&&p.push(writeCompressedAttrib0),(n[SHOW_INDEX]||n[TRANSLUCENCY_BY_DISTANCE_INDEX])&&p.push(writeCompressedAttrib1),n[SCALE_BY_DISTANCE_INDEX]&&p.push(writeScaleByDistance),(n[DISTANCE_DISPLAY_CONDITION_INDEX]||n[DISABLE_DEPTH_DISTANCE_INDEX])&&p.push(writeDistanceDisplayConditionAndDepthDisable);var m=p.length;if(u=this._vaf.writers,.1<r/t){for(var f=0;f<r;++f){var g=i[f];g._dirty=!1;for(var _=0;_<m;++_)p[_](this,o,u,g)}this._vaf.commit()}else{for(var y=0;y<r;++y){var C=i[y];C._dirty=!1;for(var v=0;v<m;++v)p[v](this,o,u,C);this._vaf.subCommit(C._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(1.5*t<r&&(i.length=t),defined(this._vaf)&&defined(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,BoundingSphere.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var S,T=Matrix4.IDENTITY;updateBoundingVolume(this,e,S=e.mode===SceneMode$1.SCENE3D?(T=this.modelMatrix,BoundingSphere.clone(this._baseVolumeWC,this._boundingVolume)):BoundingSphere.clone(this._baseVolume2D,this._boundingVolume));var x,a=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,a&&(this._blendOption===BlendOption$1.OPAQUE||this._blendOption===BlendOption$1.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=RenderState.fromCache({depthTest:{enabled:!0,func:WebGLConstants$1.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===BlendOption$1.TRANSLUCENT||this._blendOption===BlendOption$1.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=RenderState.fromCache({depthTest:{enabled:!0,func:WebGLConstants$1.LEQUAL},depthMask:!1,blending:BlendingState$1.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance,(a||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(a=new ShaderSource({sources:[PointPrimitiveCollectionVS]}),this._shaderScaleByDistance&&a.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&a.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&a.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&a.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===BlendOption$1.OPAQUE_AND_TRANSLUCENT&&(x=new ShaderSource({defines:["OPAQUE"],sources:[PointPrimitiveCollectionFS]}),this._sp=ShaderProgram.replaceCache({context:o,shaderProgram:this._sp,vertexShaderSource:a,fragmentShaderSource:x,attributeLocations:attributeLocations$1}),x=new ShaderSource({defines:["TRANSLUCENT"],sources:[PointPrimitiveCollectionFS]}),this._spTranslucent=ShaderProgram.replaceCache({context:o,shaderProgram:this._spTranslucent,vertexShaderSource:a,fragmentShaderSource:x,attributeLocations:attributeLocations$1})),this._blendOption===BlendOption$1.OPAQUE&&(x=new ShaderSource({sources:[PointPrimitiveCollectionFS]}),this._sp=ShaderProgram.replaceCache({context:o,shaderProgram:this._sp,vertexShaderSource:a,fragmentShaderSource:x,attributeLocations:attributeLocations$1})),this._blendOption===BlendOption$1.TRANSLUCENT&&(x=new ShaderSource({sources:[PointPrimitiveCollectionFS]}),this._spTranslucent=ShaderProgram.replaceCache({context:o,shaderProgram:this._spTranslucent,vertexShaderSource:a,fragmentShaderSource:x,attributeLocations:attributeLocations$1})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);var b=e.commandList;if(s.render||l){var E,P=this._colorCommands,A=this._blendOption===BlendOption$1.OPAQUE,w=this._blendOption===BlendOption$1.OPAQUE_AND_TRANSLUCENT,l=(E=this._vaf.va).length;P.length=l;for(var D=w?2*l:l,M=0;M<D;++M){var I,R=A||w&&M%2==0;(I=!defined(I=P[M])?P[M]=new DrawCommand:I).primitiveType=PrimitiveType$1.POINTS,I.pass=R||!w?Pass$1.OPAQUE:Pass$1.TRANSLUCENT,I.owner=this;var O=w?Math.floor(M/2):M;I.boundingVolume=S,I.modelMatrix=T,I.shaderProgram=R?this._sp:this._spTranslucent,I.uniformMap=this._uniforms,I.vertexArray=E[O].va,I.renderState=R?this._rsOpaque:this._rsTranslucent,I.debugShowBoundingVolume=this.debugShowBoundingVolume,I.pickId="v_pickColor",b.push(I)}}}}},PointPrimitiveCollection.prototype.isDestroyed=function(){return!1},PointPrimitiveCollection.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(),destroyPointPrimitives(this._pointPrimitives),destroyObject(this)},KDBush.prototype={range:function(e,t,i,r){return range(this.ids,this.coords,e,t,i,r,this.nodeSize)},within:function(e,t,i){return within(this.ids,this.coords,e,t,i,this.nodeSize)}};var labelBoundingBoxScratch=new BoundingRectangle;function getBoundingBox(e,t,i,r,n){return defined(e._labelCollection)&&r._clusterLabels?n=Label.getScreenSpaceBoundingBox(e,t,n):defined(e._billboardCollection)&&r._clusterBillboards?n=Billboard.getScreenSpaceBoundingBox(e,t,n):defined(e._pointPrimitiveCollection)&&r._clusterPoints&&(n=PointPrimitive.getScreenSpaceBoundingBox(e,t,n)),expandBoundingBox(n,i),r._clusterLabels&&!defined(e._labelCollection)&&defined(e.id)&&hasLabelIndex(r,e.id.id)&&defined(e.id._label)&&(e=r._collectionIndicesByEntity[e.id.id].labelIndex,e=r._labelCollection.get(e),expandBoundingBox(t=Label.getScreenSpaceBoundingBox(e,t,labelBoundingBoxScratch),i),n=BoundingRectangle.union(n,t,n)),n}function addNonClusteredItem(e,t){e.clusterShow=!0,!defined(e._labelCollection)&&defined(e.id)&&hasLabelIndex(t,e.id.id)&&defined(e.id._label)&&(e=t._collectionIndicesByEntity[e.id.id].labelIndex,t._labelCollection.get(e).clusterShow=!0)}function addCluster(e,t,i,r){var n={billboard:r._clusterBillboardCollection.add(),label:r._clusterLabelCollection.add(),point:r._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.label.id=i,n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function hasLabelIndex(e,t){return defined(e)&&defined(e._collectionIndicesByEntity[t])&&defined(e._collectionIndicesByEntity[t].labelIndex)}function getScreenSpacePositions(e,t,i,r,n){if(defined(e))for(var a=e.length,o=0;o<a;++o){var s,l,c,u=e.get(o);u.clusterShow=!1,u.show&&(n._scene.mode!==SceneMode$1.SCENE3D||r.isPointVisible(u.position))&&(s=n._clusterLabels&&defined(u._labelCollection),l=n._clusterBillboards&&defined(u.id._billboard),c=n._clusterPoints&&defined(u.id._point),s&&(c||l)||defined(u=u.computeScreenSpacePosition(i))&&t.push({index:o,collection:e,clustered:!1,coord:u}))}}var pointBoundinRectangleScratch=new BoundingRectangle,totalBoundingRectangleScratch=new BoundingRectangle,neighborBoundingRectangleScratch=new BoundingRectangle;function createDeclutterCallback(k){return function(e){if(!(defined(e)&&e<.05)&&k.enabled){var t=k._scene,i=k._labelCollection,r=k._billboardCollection,n=k._pointCollection;if((defined(i)||defined(r)||defined(n))&&(k._clusterBillboards||k._clusterLabels||k._clusterPoints)){var a=k._clusterLabelCollection,o=k._clusterBillboardCollection,e=k._clusterPointCollection;defined(a)?a.removeAll():a=k._clusterLabelCollection=new LabelCollection({scene:t}),defined(o)?o.removeAll():o=k._clusterBillboardCollection=new BillboardCollection({scene:t}),defined(e)?e.removeAll():e=k._clusterPointCollection=new PointPrimitiveCollection;var s,l,c=k._pixelRange,u=k._minimumClusterSize,d=k._previousClusters,h=[],p=k._previousHeight,m=t.camera.positionCartographic.height,f=new EllipsoidalOccluder(t.mapProjection.ellipsoid,t.camera.positionWC),g=[];k._clusterLabels&&getScreenSpacePositions(i,g,t,f,k),k._clusterBillboards&&getScreenSpacePositions(r,g,t,f,k),k._clusterPoints&&getScreenSpacePositions(n,g,t,f,k);var _=kdbush(g,getX,getY,64,Int32Array);if(m<p)for(l=d.length,s=0;s<l;++s){var y=d[s];if(f.isPointVisible(y.position)){var C=Billboard._computeScreenSpacePosition(Matrix4.IDENTITY,y.position,Cartesian3.ZERO,Cartesian2.ZERO,t);if(defined(C)){for(var v,S=1-m/p,T=y.width=y.width*S,x=y.height=y.height*S,T=Math.max(T,y.minimumWidth),x=Math.max(x,y.minimumHeight),b=C.x-.5*T,S=C.y-.5*x,T=C.x+T,x=C.y+x,E=(v=_.range(b,S,T,x)).length,P=0,A=[],w=0;w<E;++w)(B=g[v[w]]).clustered||(++P,M=B.collection,I=B.index,A.push(M.get(I).id));if(u<=P)for(addCluster(y.position,P,A,k),h.push(y),w=0;w<E;++w)g[v[w]].clustered=!0}}}for(l=g.length,s=0;s<l;++s){var D=g[s];if(!D.clustered){D.clustered=!0;var M=D.collection,I=D.index,R=M.get(I),O=getBoundingBox(R,D.coord,c,k,pointBoundinRectangleScratch),L=BoundingRectangle.clone(O,totalBoundingRectangleScratch);E=(v=_.range(O.x,O.y,O.x+O.width,O.y+O.height)).length;var F,N,B,V=Cartesian3.clone(R.position);for(P=1,A=[R.id],w=0;w<E;++w)(B=g[v[w]]).clustered||(N=getBoundingBox(F=B.collection.get(B.index),B.coord,c,k,neighborBoundingRectangleScratch),Cartesian3.add(F.position,V,V),BoundingRectangle.union(L,N,L),++P,A.push(F.id));if(u<=P){D=Cartesian3.multiplyByScalar(V,1/P,V);for(addCluster(D,P,A,k),h.push({position:D,width:L.width,height:L.height,minimumWidth:O.width,minimumHeight:O.height}),w=0;w<E;++w)g[v[w]].clustered=!0}else addNonClusteredItem(R,k)}}0===a.length&&(a.destroy(),k._clusterLabelCollection=void 0),0===o.length&&(o.destroy(),k._clusterBillboardCollection=void 0),0===e.length&&(e.destroy(),k._clusterPointCollection=void 0),k._previousClusters=h,k._previousHeight=m}}}}function createGetEntity(a,o,s,l){return function(e){var t=this[a];defined(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});var i,r,n=this._collectionIndicesByEntity[e.id];if(defined(n)||(n=this._collectionIndicesByEntity[e.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),defined(t)&&defined(n[l]))return t.get(n[l]);defined(t)||(t=this[a]=new o({scene:this._scene}));e=this[s];return 0<e.length?(i=e.pop(),r=t.get(i)):(r=t.add(),i=t.length-1),n[l]=i,this._clusterDirty=!0,r}}function removeEntityIndicesIfUnused(e,t){var i=e._collectionIndicesByEntity[t];defined(i.billboardIndex)||defined(i.labelIndex)||defined(i.pointIndex)||delete e._collectionIndicesByEntity[t]}function disableCollectionClustering(e){if(defined(e))for(var t=e.length,i=0;i<t;++i)e.get(i).clusterShow=!0}function updateEnable(e){e.enabled||(defined(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),defined(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),defined(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,disableCollectionClustering(e._labelCollection),disableCollectionClustering(e._billboardCollection),disableCollectionClustering(e._pointCollection))}function CustomDataSource(e){this._name=e,this._clock=void 0,this._changed=new Event,this._error=new Event,this._isLoading=!1,this._loading=new Event,this._entityCollection=new EntityCollection(this),this._entityCluster=new EntityCluster}EntityCluster.prototype._initialize=function(e){this._scene=e;var t=createDeclutterCallback(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(EntityCluster.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}}}),EntityCluster.prototype.getLabel=createGetEntity("_labelCollection",LabelCollection,"_unusedLabelIndices","labelIndex"),EntityCluster.prototype.removeLabel=function(e){var t,i=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];defined(this._labelCollection)&&defined(i)&&defined(i.labelIndex)&&(t=i.labelIndex,i.labelIndex=void 0,removeEntityIndicesIfUnused(this,e.id),(e=this._labelCollection.get(t)).show=!1,e.text="",e.id=void 0,this._unusedLabelIndices.push(t),this._clusterDirty=!0)},EntityCluster.prototype.getBillboard=createGetEntity("_billboardCollection",BillboardCollection,"_unusedBillboardIndices","billboardIndex"),EntityCluster.prototype.removeBillboard=function(e){var t,i=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];defined(this._billboardCollection)&&defined(i)&&defined(i.billboardIndex)&&(t=i.billboardIndex,i.billboardIndex=void 0,removeEntityIndicesIfUnused(this,e.id),(e=this._billboardCollection.get(t)).id=void 0,e.show=!1,e.image=void 0,this._unusedBillboardIndices.push(t),this._clusterDirty=!0)},EntityCluster.prototype.getPoint=createGetEntity("_pointCollection",PointPrimitiveCollection,"_unusedPointIndices","pointIndex"),EntityCluster.prototype.removePoint=function(e){var t,i=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];defined(this._pointCollection)&&defined(i)&&defined(i.pointIndex)&&(t=i.pointIndex,i.pointIndex=void 0,removeEntityIndicesIfUnused(this,e.id),(e=this._pointCollection.get(t)).show=!1,e.id=void 0,this._unusedPointIndices.push(t),this._clusterDirty=!0)},EntityCluster.prototype.update=function(e){var t;this.show&&(defined(this._labelCollection)&&0<this._labelCollection.length&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),defined(this._billboardCollection)&&0<this._billboardCollection.length&&!defined(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,updateEnable(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),defined(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),defined(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),defined(this._clusterPointCollection)&&this._clusterPointCollection.update(e),defined(this._labelCollection)&&this._labelCollection.update(e),defined(this._billboardCollection)&&this._billboardCollection.update(e),defined(this._pointCollection)&&this._pointCollection.update(e))},EntityCluster.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(),defined(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},Object.defineProperties(CustomDataSource.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){DataSource.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}}}),CustomDataSource.prototype.update=function(e){return!0};var defaultOffset$8=Cartesian3.ZERO,offsetScratch$7=new Cartesian3,positionScratch$4=new Cartesian3,scratchColor$c=new Color;function CylinderGeometryOptions(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 CylinderGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new CylinderGeometryOptions(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function DynamicCylinderGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}function DataSourceClock(){this._definitionChanged=new Event,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}defined(Object.create)&&(CylinderGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),CylinderGeometryUpdater.prototype.constructor=CylinderGeometryUpdater),Object.defineProperties(CylinderGeometryUpdater.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),CylinderGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),a={show:n,distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a),color:void 0,offset:void 0};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$c)),defined(t)||(t=Color.WHITE),a.color=ColorGeometryInstanceAttribute.fromColor(t)),defined(this._options.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$8,offsetScratch$7))),new GeometryInstance({id:i,geometry:new CylinderGeometry(this._options),modelMatrix:i.computeModelMatrixForHeightReference(e,i.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:a})},CylinderGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$c),n=this._distanceDisplayConditionProperty.getValue(e),n={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),offset:void 0};return defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$8,offsetScratch$7))),new GeometryInstance({id:t,geometry:new CylinderOutlineGeometry(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:n})},CylinderGeometryUpdater.prototype._computeCenter=function(e,t){return Property.getValueOrUndefined(this._entity.position,e,t)},CylinderGeometryUpdater.prototype._isHidden=function(e,t){return!defined(e.position)||!defined(t.length)||!defined(t.topRadius)||!defined(t.bottomRadius)||GeometryUpdater.prototype._isHidden.call(this,e,t)},CylinderGeometryUpdater.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&Property.isConstant(e.orientation)&&t.length.isConstant&&t.topRadius.isConstant&&t.bottomRadius.isConstant&&Property.isConstant(t.slices)&&Property.isConstant(t.outlineWidth)&&Property.isConstant(t.numberOfVerticalLines))},CylinderGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,r.length=t.length.getValue(Iso8601.MINIMUM_VALUE),r.topRadius=t.topRadius.getValue(Iso8601.MINIMUM_VALUE),r.bottomRadius=t.bottomRadius.getValue(Iso8601.MINIMUM_VALUE),r.slices=Property.getValueOrUndefined(t.slices,Iso8601.MINIMUM_VALUE),r.numberOfVerticalLines=Property.getValueOrUndefined(t.numberOfVerticalLines,Iso8601.MINIMUM_VALUE),r.offsetAttribute=i!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0},CylinderGeometryUpdater.prototype._onEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,CylinderGeometryUpdater.DynamicGeometryUpdater=DynamicCylinderGeometryUpdater,defined(Object.create)&&(DynamicCylinderGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicCylinderGeometryUpdater.prototype.constructor=DynamicCylinderGeometryUpdater),DynamicCylinderGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(Property.getValueOrUndefined(e.position,i,positionScratch$4))||!defined(r.length)||!defined(r.topRadius)||!defined(r.bottomRadius)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DynamicCylinderGeometryUpdater.prototype._setOptions=function(e,t,i){var r=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),n=this._options;n.length=Property.getValueOrUndefined(t.length,i),n.topRadius=Property.getValueOrUndefined(t.topRadius,i),n.bottomRadius=Property.getValueOrUndefined(t.bottomRadius,i),n.slices=Property.getValueOrUndefined(t.slices,i),n.numberOfVerticalLines=Property.getValueOrUndefined(t.numberOfVerticalLines,i),n.offsetAttribute=r!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0},Object.defineProperties(DataSourceClock.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:createRawPropertyDescriptor("startTime"),stopTime:createRawPropertyDescriptor("stopTime"),currentTime:createRawPropertyDescriptor("currentTime"),clockRange:createRawPropertyDescriptor("clockRange"),clockStep:createRawPropertyDescriptor("clockStep"),multiplier:createRawPropertyDescriptor("multiplier")}),DataSourceClock.prototype.clone=function(e){return(e=!defined(e)?new DataSourceClock: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},DataSourceClock.prototype.equals=function(e){return this===e||defined(e)&&JulianDate.equals(this.startTime,e.startTime)&&JulianDate.equals(this.stopTime,e.stopTime)&&JulianDate.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},DataSourceClock.prototype.merge=function(e){this.startTime=defaultValue(this.startTime,e.startTime),this.stopTime=defaultValue(this.stopTime,e.stopTime),this.currentTime=defaultValue(this.currentTime,e.currentTime),this.clockRange=defaultValue(this.clockRange,e.clockRange),this.clockStep=defaultValue(this.clockStep,e.clockStep),this.multiplier=defaultValue(this.multiplier,e.multiplier)},DataSourceClock.prototype.getValue=function(e){return(e=!defined(e)?new Clock:e).startTime=defaultValue(this.startTime,e.startTime),e.stopTime=defaultValue(this.stopTime,e.stopTime),e.currentTime=defaultValue(this.currentTime,e.currentTime),e.clockRange=defaultValue(this.clockRange,e.clockRange),e.multiplier=defaultValue(this.multiplier,e.multiplier),e.clockStep=defaultValue(this.clockStep,e.clockStep),e};var defaultColor$6=Color.WHITE,defaultCellAlpha=.1,defaultLineCount=new Cartesian2(8,8),defaultLineOffset=new Cartesian2(0,0),defaultLineThickness=new Cartesian2(1,1);function GridMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,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}function PolylineArrowMaterialProperty(e){this._definitionChanged=new Event,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(GridMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._cellAlpha)&&Property.isConstant(this._lineCount)&&Property.isConstant(this._lineThickness)&&Property.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),cellAlpha:createPropertyDescriptor("cellAlpha"),lineCount:createPropertyDescriptor("lineCount"),lineThickness:createPropertyDescriptor("lineThickness"),lineOffset:createPropertyDescriptor("lineOffset")}),GridMaterialProperty.prototype.getType=function(e){return"Grid"},GridMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).color=Property.getValueOrClonedDefault(this._color,e,defaultColor$6,t.color),t.cellAlpha=Property.getValueOrDefault(this._cellAlpha,e,defaultCellAlpha),t.lineCount=Property.getValueOrClonedDefault(this._lineCount,e,defaultLineCount,t.lineCount),t.lineThickness=Property.getValueOrClonedDefault(this._lineThickness,e,defaultLineThickness,t.lineThickness),t.lineOffset=Property.getValueOrClonedDefault(this._lineOffset,e,defaultLineOffset,t.lineOffset),t},GridMaterialProperty.prototype.equals=function(e){return this===e||e instanceof GridMaterialProperty&&Property.equals(this._color,e._color)&&Property.equals(this._cellAlpha,e._cellAlpha)&&Property.equals(this._lineCount,e._lineCount)&&Property.equals(this._lineThickness,e._lineThickness)&&Property.equals(this._lineOffset,e._lineOffset)},Object.defineProperties(PolylineArrowMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color")}),PolylineArrowMaterialProperty.prototype.getType=function(e){return"PolylineArrow"},PolylineArrowMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).color=Property.getValueOrClonedDefault(this._color,e,Color.WHITE,t.color),t},PolylineArrowMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineArrowMaterialProperty&&Property.equals(this._color,e._color)};var defaultColor$5=Color.WHITE,defaultGapColor=Color.TRANSPARENT,defaultDashLength=16,defaultDashPattern=255;function PolylineDashMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,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(PolylineDashMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._gapColor)&&Property.isConstant(this._dashLength)&&Property.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),gapColor:createPropertyDescriptor("gapColor"),dashLength:createPropertyDescriptor("dashLength"),dashPattern:createPropertyDescriptor("dashPattern")}),PolylineDashMaterialProperty.prototype.getType=function(e){return"PolylineDash"},PolylineDashMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).color=Property.getValueOrClonedDefault(this._color,e,defaultColor$5,t.color),t.gapColor=Property.getValueOrClonedDefault(this._gapColor,e,defaultGapColor,t.gapColor),t.dashLength=Property.getValueOrDefault(this._dashLength,e,defaultDashLength,t.dashLength),t.dashPattern=Property.getValueOrDefault(this._dashPattern,e,defaultDashPattern,t.dashPattern),t},PolylineDashMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineDashMaterialProperty&&Property.equals(this._color,e._color)&&Property.equals(this._gapColor,e._gapColor)&&Property.equals(this._dashLength,e._dashLength)&&Property.equals(this._dashPattern,e._dashPattern)};var defaultColor$4=Color.WHITE,defaultGlowPower=.25,defaultTaperPower=1;function PolylineGlowMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,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(PolylineGlowMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),glowPower:createPropertyDescriptor("glowPower"),taperPower:createPropertyDescriptor("taperPower")}),PolylineGlowMaterialProperty.prototype.getType=function(e){return"PolylineGlow"},PolylineGlowMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).color=Property.getValueOrClonedDefault(this._color,e,defaultColor$4,t.color),t.glowPower=Property.getValueOrDefault(this._glowPower,e,defaultGlowPower,t.glowPower),t.taperPower=Property.getValueOrDefault(this._taperPower,e,defaultTaperPower,t.taperPower),t},PolylineGlowMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineGlowMaterialProperty&&Property.equals(this._color,e._color)&&Property.equals(this._glowPower,e._glowPower)&&Property.equals(this._taperPower,e._taperPower)};var defaultColor$3=Color.WHITE,defaultOutlineColor$2=Color.BLACK,defaultOutlineWidth$2=1;function PolylineOutlineMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,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}function PositionPropertyArray(e,t){this._value=void 0,this._definitionChanged=new Event,this._eventHelper=new EventHelper,this._referenceFrame=defaultValue(t,ReferenceFrame$1.FIXED),this.setValue(e)}function PropertyArray(e){this._value=void 0,this._definitionChanged=new Event,this._eventHelper=new EventHelper,this.setValue(e)}function resolve(e){if(!defined(r=e._targetProperty)){var t=e._targetEntity;if(!defined(t)){if(!defined(t=e._targetCollection.getById(e._targetId)))return void(e._targetEntity=e._targetProperty=void 0);t.definitionChanged.addEventListener(ReferenceProperty.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=t}for(var i=e._targetPropertyNames,r=e._targetEntity,n=0,a=i.length;n<a&&defined(r);++n)r=r[i[n]];e._targetProperty=r}return r}function ReferenceProperty(e,t,i){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new Event,e.collectionChanged.addEventListener(ReferenceProperty.prototype._onCollectionChanged,this)}Object.defineProperties(PolylineOutlineMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._outlineColor)&&Property.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth")}),PolylineOutlineMaterialProperty.prototype.getType=function(e){return"PolylineOutline"},PolylineOutlineMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).color=Property.getValueOrClonedDefault(this._color,e,defaultColor$3,t.color),t.outlineColor=Property.getValueOrClonedDefault(this._outlineColor,e,defaultOutlineColor$2,t.outlineColor),t.outlineWidth=Property.getValueOrDefault(this._outlineWidth,e,defaultOutlineWidth$2),t},PolylineOutlineMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineOutlineMaterialProperty&&Property.equals(this._color,e._color)&&Property.equals(this._outlineColor,e._outlineColor)&&Property.equals(this._outlineWidth,e._outlineWidth)},Object.defineProperties(PositionPropertyArray.prototype,{isConstant:{get:function(){var e=this._value;if(!defined(e))return!0;for(var t=e.length,i=0;i<t;i++)if(!Property.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),PositionPropertyArray.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},PositionPropertyArray.prototype.getValueInReferenceFrame=function(e,t,i){var r=this._value;if(defined(r)){var n=r.length;defined(i)||(i=new Array(n));for(var a=0,o=0;a<n;){var s=r[a].getValueInReferenceFrame(e,t,i[a]);defined(s)&&(i[o]=s,o++),a++}return i.length=o,i}},PositionPropertyArray.prototype.setValue=function(e){var t=this._eventHelper;if(t.removeAll(),defined(e)){this._value=e.slice();for(var i=e.length,r=0;r<i;r++){var n=e[r];defined(n)&&t.add(n.definitionChanged,PositionPropertyArray.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},PositionPropertyArray.prototype.equals=function(e){return this===e||e instanceof PositionPropertyArray&&this._referenceFrame===e._referenceFrame&&Property.arrayEquals(this._value,e._value)},PositionPropertyArray.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(PropertyArray.prototype,{isConstant:{get:function(){var e=this._value;if(!defined(e))return!0;for(var t=e.length,i=0;i<t;i++)if(!Property.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),PropertyArray.prototype.getValue=function(e,t){var i=this._value;if(defined(i)){var r=i.length;defined(t)||(t=new Array(r));for(var n=0,a=0;n<r;){var o=this._value[n].getValue(e,t[n]);defined(o)&&(t[a]=o,a++),n++}return t.length=a,t}},PropertyArray.prototype.setValue=function(e){var t=this._eventHelper;if(t.removeAll(),defined(e)){this._value=e.slice();for(var i=e.length,r=0;r<i;r++){var n=e[r];defined(n)&&t.add(n.definitionChanged,PropertyArray.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},PropertyArray.prototype.equals=function(e){return this===e||e instanceof PropertyArray&&Property.arrayEquals(this._value,e._value)},PropertyArray.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(ReferenceProperty.prototype,{isConstant:{get:function(){return Property.isConstant(resolve(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){var e=resolve(this);return defined(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 resolve(this)}}}),ReferenceProperty.fromString=function(e,t){for(var i,r=[],n=!0,a=!1,o="",s=0;s<t.length;++s){var l=t.charAt(s);a?(o+=l,a=!1):"\\"===l?a=!0:n&&"#"===l?(i=o,n=!1,o=""):n||"."!==l?o+=l:(r.push(o),o="")}return r.push(o),new ReferenceProperty(e,i,r)},ReferenceProperty.prototype.getValue=function(e,t){var i=resolve(this);return defined(i)?i.getValue(e,t):void 0},ReferenceProperty.prototype.getValueInReferenceFrame=function(e,t,i){var r=resolve(this);return defined(r)?r.getValueInReferenceFrame(e,t,i):void 0},ReferenceProperty.prototype.getType=function(e){var t=resolve(this);return defined(t)?t.getType(e):void 0},ReferenceProperty.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,i=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==i.length)return!1;for(var r=this._targetPropertyNames.length,n=0;n<r;n++)if(t[n]!==i[n])return!1;return!0},ReferenceProperty.prototype._onTargetEntityDefinitionChanged=function(e,t,i,r){defined(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))},ReferenceProperty.prototype._onCollectionChanged=function(e,t,i){var r=this._targetEntity;defined(r)&&-1!==i.indexOf(r)?(r.definitionChanged.removeEventListener(ReferenceProperty.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):defined(r)||defined(r=resolve(this))&&this._definitionChanged.raiseEvent(this)};var Rotation={packedLength:1,pack:function(e,t,i){return t[i=defaultValue(i,0)]=e,t},unpack:function(e,t,i){return e[t=defaultValue(t,0)]},convertPackedArrayForInterpolation:function(e,t,i,r){var n;defined(r)||(r=[]),t=defaultValue(t,0);for(var a=0,o=(i=defaultValue(i,e.length))-t+1;a<o;a++){var s=e[t+a];0===a||Math.abs(n-s)<Math.PI?r[a]=s:r[a]=s-CesiumMath.TWO_PI,n=s}},unpackInterpolationResult:function(e,t,i,r,n){return(n=e[0])<0?n+CesiumMath.TWO_PI:n}},PackableNumber={packedLength:1,pack:function(e,t,i){t[i=defaultValue(i,0)]=e},unpack:function(e,t,i){return e[t=defaultValue(t,0)]}};function arrayInsert(e,t,i){var r=e.length,n=i.length,a=r+n;if(e.length=a,r!==t)for(var o=r-1,s=a-1;t<=s;s--)e[s]=e[o--];for(s=0;s<n;s++)e[t++]=i[s]}function convertDate(e,t){return e instanceof JulianDate?e:"string"==typeof e?JulianDate.fromIso8601(e):JulianDate.addSeconds(t,e,new JulianDate)}var timesSpliceArgs=[],valuesSpliceArgs=[];function mergeNewSamples(e,t,i,r,n){for(var a,o,s,l,c=0;c<r.length;){var u,d,h=0,p=0;if((d=binarySearch(t,u=convertDate(r[c],e),JulianDate.compare))<0){for(s=(d=~d)*n,o=void 0,l=t[d];c<r.length&&(u=convertDate(r[c],e),!(defined(o)&&0<=JulianDate.compare(o,u)||defined(l)&&0<=JulianDate.compare(u,l)));){for(timesSpliceArgs[h++]=u,c+=1,a=0;a<n;a++)valuesSpliceArgs[p++]=r[c],c+=1;o=u}0<h&&(valuesSpliceArgs.length=p,arrayInsert(i,s,valuesSpliceArgs),timesSpliceArgs.length=h,arrayInsert(t,d,timesSpliceArgs))}else{for(a=0;a<n;a++)c++,i[d*n+a]=r[c];c++}}}function SampledProperty(e,t){var i=e,r=(i=i===Number?PackableNumber:i).packedLength,n=defaultValue(i.packedInterpolationLength,r),a=0;if(defined(t)){for(var o=t.length,s=new Array(o),l=0;l<o;l++){var c=t[l],u=(c=c===Number?PackableNumber:c).packedLength;r+=u,n+=defaultValue(c.packedInterpolationLength,u),s[l]=c}a=o}this._type=e,this._innerType=i,this._interpolationDegree=1,this._interpolationAlgorithm=LinearApproximation,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=r,this._packedInterpolationLength=n,this._updateTableLength=!0,this._interpolationResult=new Array(n),this._definitionChanged=new Event,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=a,this._forwardExtrapolationType=ExtrapolationType$1.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=ExtrapolationType$1.NONE,this._backwardExtrapolationDuration=0}function removeSamples(e,t,i){var r=e._packedLength;e._times.splice(t,i),e._values.splice(t*r,i*r),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}function SampledPositionProperty(e,t){if(0<(t=defaultValue(t,0)))for(var i=new Array(t),r=0;r<t;r++)i[r]=Cartesian3;this._numberOfDerivatives=t,this._property=new SampledProperty(Cartesian3,i),this._definitionChanged=new Event,this._referenceFrame=defaultValue(e,ReferenceFrame$1.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(SampledProperty.prototype,{isConstant:{get:function(){return 0===this._values.length}},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))}}}),SampledProperty.prototype.getValue=function(e,t){var i=this._times,r=i.length;if(0!==r){var n=this._innerType,a=this._values;if((l=binarySearch(i,e,JulianDate.compare))<0){if(0===(l=~l)){var o=i[l],s=this._backwardExtrapolationDuration;if(this._backwardExtrapolationType===ExtrapolationType$1.NONE||0!==s&&JulianDate.secondsDifference(o,e)>s)return;if(this._backwardExtrapolationType===ExtrapolationType$1.HOLD)return n.unpack(a,0,t)}if(r<=l){var l,c=i[l=r-1];if(s=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ExtrapolationType$1.NONE||0!==s&&JulianDate.secondsDifference(e,c)>s)return;if(this._forwardExtrapolationType===ExtrapolationType$1.HOLD)return n.unpack(a,(l=r-1)*n.packedLength,t)}var u=this._xTable,d=this._yTable,h=this._interpolationAlgorithm,o=this._packedInterpolationLength,c=this._inputOrder;this._updateTableLength&&(this._updateTableLength=!1,(p=Math.min(h.getRequiredDataPoints(this._interpolationDegree,c),r))!==this._numberOfPoints&&(this._numberOfPoints=p,u.length=p,d.length=p*o));s=this._numberOfPoints-1;if(s<1)return;var p,m=0,f=r-1;1+s<=f-m+1&&(m=p=f<(r=(p=(p=l-(s/2|0)-1)<m?m:p)+s)&&(p=(r=f)-s)<m?m:p,f=r);for(var g=f-m+1,_=0;_<g;++_)u[_]=JulianDate.secondsDifference(i[m+_],i[f]);if(defined(n.convertPackedArrayForInterpolation))n.convertPackedArrayForInterpolation(a,m,f,d);else for(var y=0,C=this._packedLength,v=m*C,S=(f+1)*C;v<S;)d[y]=a[v],v++,y++;C=JulianDate.secondsDifference(e,i[f]);return o=0!==c&&defined(h.interpolate)?(e=Math.floor(o/(c+1)),h.interpolate(C,u,d,e,c,c,this._interpolationResult)):h.interpolateOrderZero(C,u,d,o,this._interpolationResult),defined(n.unpackInterpolationResult)?n.unpackInterpolationResult(o,a,m,f,t):n.unpack(o,0,t)}return n.unpack(a,l*this._packedLength,t)}},SampledProperty.prototype.setInterpolationOptions=function(e){var t,i;defined(e)&&(t=!1,i=e.interpolationAlgorithm,e=e.interpolationDegree,defined(i)&&this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),defined(e)&&this._interpolationDegree!==e&&(this._interpolationDegree=e,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)))},SampledProperty.prototype.addSample=function(e,t,i){var r=this._innerDerivativeTypes,n=defined(r),a=this._innerType,o=[];if(o.push(e),a.pack(t,o,o.length),n)for(var s=r.length,l=0;l<s;l++)r[l].pack(i[l],o,o.length);mergeNewSamples(void 0,this._times,this._values,o,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},SampledProperty.prototype.addSamples=function(e,t,i){for(var r=this._innerDerivativeTypes,n=defined(r),a=this._innerType,o=e.length,s=[],l=0;l<o;l++)if(s.push(e[l]),a.pack(t[l],s,s.length),n)for(var c=i[l],u=r.length,d=0;d<u;d++)r[d].pack(c[d],s,s.length);mergeNewSamples(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},SampledProperty.prototype.addSamplesPackedArray=function(e,t){mergeNewSamples(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},SampledProperty.prototype.removeSample=function(e){e=binarySearch(this._times,e,JulianDate.compare);return!(e<0)&&(removeSamples(this,e,1),!0)},SampledProperty.prototype.removeSamples=function(e){var t=this._times,i=binarySearch(t,e.start,JulianDate.compare);i<0?i=~i:e.isStartIncluded||++i;t=binarySearch(t,e.stop,JulianDate.compare);t<0?t=~t:e.isStopIncluded&&++t,removeSamples(this,i,t-i)},SampledProperty.prototype.equals=function(e){if(this===e)return!0;if(!defined(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t,i=this._derivativeTypes,r=defined(i),n=e._derivativeTypes;if(r!==defined(n))return!1;if(r){if((a=i.length)!==n.length)return!1;for(t=0;t<a;t++)if(i[t]!==n[t])return!1}var a,o=this._times,s=e._times;if((a=o.length)!==s.length)return!1;for(t=0;t<a;t++)if(!JulianDate.equals(o[t],s[t]))return!1;var l=this._values,c=e._values;for(a=l.length,t=0;t<a;t++)if(l[t]!==c[t])return!1;return!0},SampledProperty._mergeNewSamples=mergeNewSamples,Object.defineProperties(SampledPositionProperty.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}}}),SampledPositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},SampledPositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){if(defined(i=this._property.getValue(e,i)))return PositionProperty.convertToReferenceFrame(e,i,this._referenceFrame,t,i)},SampledPositionProperty.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},SampledPositionProperty.prototype.addSample=function(e,t,i){this._numberOfDerivatives,this._property.addSample(e,t,i)},SampledPositionProperty.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},SampledPositionProperty.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},SampledPositionProperty.prototype.removeSample=function(e){return this._property.removeSample(e)},SampledPositionProperty.prototype.removeSamples=function(e){this._property.removeSamples(e)},SampledPositionProperty.prototype.equals=function(e){return this===e||e instanceof SampledPositionProperty&&Property.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var StripeOrientation={HORIZONTAL:0,VERTICAL:1},StripeOrientation$1=Object.freeze(StripeOrientation),defaultOrientation=StripeOrientation$1.HORIZONTAL,defaultEvenColor=Color.WHITE,defaultOddColor=Color.BLACK,defaultOffset$7=0,defaultRepeat=1;function StripeMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,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}function TimeIntervalCollectionPositionProperty(e){this._definitionChanged=new Event,this._intervals=new TimeIntervalCollection,this._intervals.changedEvent.addEventListener(TimeIntervalCollectionPositionProperty.prototype._intervalsChanged,this),this._referenceFrame=defaultValue(e,ReferenceFrame$1.FIXED)}function TimeIntervalCollectionProperty(){this._definitionChanged=new Event,this._intervals=new TimeIntervalCollection,this._intervals.changedEvent.addEventListener(TimeIntervalCollectionProperty.prototype._intervalsChanged,this)}function VelocityVectorProperty(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new Event,this._normalize=defaultValue(t,!0),this.position=e}Object.defineProperties(StripeMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._orientation)&&Property.isConstant(this._evenColor)&&Property.isConstant(this._oddColor)&&Property.isConstant(this._offset)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:createPropertyDescriptor("orientation"),evenColor:createPropertyDescriptor("evenColor"),oddColor:createPropertyDescriptor("oddColor"),offset:createPropertyDescriptor("offset"),repeat:createPropertyDescriptor("repeat")}),StripeMaterialProperty.prototype.getType=function(e){return"Stripe"},StripeMaterialProperty.prototype.getValue=function(e,t){return(t=!defined(t)?{}:t).horizontal=Property.getValueOrDefault(this._orientation,e,defaultOrientation)===StripeOrientation$1.HORIZONTAL,t.evenColor=Property.getValueOrClonedDefault(this._evenColor,e,defaultEvenColor,t.evenColor),t.oddColor=Property.getValueOrClonedDefault(this._oddColor,e,defaultOddColor,t.oddColor),t.offset=Property.getValueOrDefault(this._offset,e,defaultOffset$7),t.repeat=Property.getValueOrDefault(this._repeat,e,defaultRepeat),t},StripeMaterialProperty.prototype.equals=function(e){return this===e||e instanceof StripeMaterialProperty&&Property.equals(this._orientation,e._orientation)&&Property.equals(this._evenColor,e._evenColor)&&Property.equals(this._oddColor,e._oddColor)&&Property.equals(this._offset,e._offset)&&Property.equals(this._repeat,e._repeat)},Object.defineProperties(TimeIntervalCollectionPositionProperty.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}}}),TimeIntervalCollectionPositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},TimeIntervalCollectionPositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){var r=this._intervals.findDataForIntervalContainingDate(e);if(defined(r))return PositionProperty.convertToReferenceFrame(e,r,this._referenceFrame,t,i)},TimeIntervalCollectionPositionProperty.prototype.equals=function(e){return this===e||e instanceof TimeIntervalCollectionPositionProperty&&this._intervals.equals(e._intervals,Property.equals)&&this._referenceFrame===e._referenceFrame},TimeIntervalCollectionPositionProperty.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(TimeIntervalCollectionProperty.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),TimeIntervalCollectionProperty.prototype.getValue=function(e,t){e=this._intervals.findDataForIntervalContainingDate(e);return defined(e)&&"function"==typeof e.clone?e.clone(t):e},TimeIntervalCollectionProperty.prototype.equals=function(e){return this===e||e instanceof TimeIntervalCollectionProperty&&this._intervals.equals(e._intervals,Property.equals)},TimeIntervalCollectionProperty.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(VelocityVectorProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(defined(t)&&this._subscription(),defined(this._position=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 position1Scratch=new Cartesian3,position2Scratch=new Cartesian3,timeScratch=new JulianDate,step=1/60;function VelocityOrientationProperty(e,t){this._velocityVectorProperty=new VelocityVectorProperty(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new Event,this.ellipsoid=defaultValue(t,Ellipsoid.WGS84);var i=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){i._definitionChanged.raiseEvent(i)})}VelocityVectorProperty.prototype.getValue=function(e,t){return this._getValue(e,t)},VelocityVectorProperty.prototype._getValue=function(e,t,i){defined(t)||(t=new Cartesian3);var r=this._position;if(Property.isConstant(r))return this._normalize?void 0:Cartesian3.clone(Cartesian3.ZERO,t);var n=r.getValue(e,position1Scratch),a=r.getValue(JulianDate.addSeconds(e,step,timeScratch),position2Scratch);if(defined(n)&&(defined(a)||(a=n,defined(n=r.getValue(JulianDate.addSeconds(e,-step,timeScratch),position2Scratch))))){if(Cartesian3.equals(n,a))return this._normalize?void 0:Cartesian3.clone(Cartesian3.ZERO,t);defined(i)&&n.clone(i);n=Cartesian3.subtract(a,n,t);return this._normalize?Cartesian3.normalize(n,t):Cartesian3.divideByScalar(n,step,t)}},VelocityVectorProperty.prototype.equals=function(e){return this===e||e instanceof VelocityVectorProperty&&Property.equals(this._position,e._position)},Object.defineProperties(VelocityOrientationProperty.prototype,{isConstant:{get:function(){return Property.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 positionScratch$3=new Cartesian3,velocityScratch=new Cartesian3,rotationScratch$1=new Matrix3,currentId;function UnitCartesian3(){}function createReferenceProperty(e,t){return"#"===t[0]&&(t=currentId+t),ReferenceProperty.fromString(e,t)}function createSpecializedProperty(e,t,i){if(defined(i.reference))return createReferenceProperty(t,i.reference);if(defined(i.velocityReference)){var r=createReferenceProperty(t,i.velocityReference);switch(e){case Cartesian3:case UnitCartesian3:return new VelocityVectorProperty(r,e===UnitCartesian3);case Quaternion:return new VelocityOrientationProperty(r)}}throw new RuntimeError(JSON.stringify(i)+" is not valid CZML.")}function createAdapterProperty(i,r){return new CallbackProperty(function(e,t){return r(i.getValue(e,t))},i.isConstant)}VelocityOrientationProperty.prototype.getValue=function(e,t){e=this._velocityVectorProperty._getValue(e,velocityScratch,positionScratch$3);if(defined(e))return Transforms.rotationMatrixFromPositionVelocity(positionScratch$3,e,this._ellipsoid,rotationScratch$1),Quaternion.fromRotationMatrix(rotationScratch$1,t)},VelocityOrientationProperty.prototype.equals=function(e){return this===e||e instanceof VelocityOrientationProperty&&Property.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},UnitCartesian3.packedLength=Cartesian3.packedLength,UnitCartesian3.unpack=Cartesian3.unpack,UnitCartesian3.pack=Cartesian3.pack;var scratchCartesian$3=new Cartesian3,scratchSpherical=new Spherical,scratchCartographic$7=new Cartographic,scratchTimeInterval$1=new TimeInterval,scratchQuaternion=new Quaternion;function unwrapColorInterval(e){if(defined(r=e.rgbaf))return r;var t=e.rgba;if(defined(t)){var i=t.length;if(i===Color.packedLength)return[Color.byteToFloat(t[0]),Color.byteToFloat(t[1]),Color.byteToFloat(t[2]),Color.byteToFloat(t[3])];for(var r=new Array(i),n=0;n<i;n+=5)r[n]=t[n],r[n+1]=Color.byteToFloat(t[n+1]),r[n+2]=Color.byteToFloat(t[n+2]),r[n+3]=Color.byteToFloat(t[n+3]),r[n+4]=Color.byteToFloat(t[n+4]);return r}}function unwrapUriInterval(e,t){e=defaultValue(e.uri,e);return defined(t)?t.getDerivedResource({url:e}):Resource.createIfNeeded(e)}function unwrapRectangleInterval(e){if(defined(r=e.wsen))return r;var t=e.wsenDegrees;if(defined(t)){var i=t.length;if(i===Rectangle.packedLength)return[CesiumMath.toRadians(t[0]),CesiumMath.toRadians(t[1]),CesiumMath.toRadians(t[2]),CesiumMath.toRadians(t[3])];for(var r=new Array(i),n=0;n<i;n+=5)r[n]=t[n],r[n+1]=CesiumMath.toRadians(t[n+1]),r[n+2]=CesiumMath.toRadians(t[n+2]),r[n+3]=CesiumMath.toRadians(t[n+3]),r[n+4]=CesiumMath.toRadians(t[n+4]);return r}}function convertUnitSphericalToCartesian(e){var t=e.length;if(scratchSpherical.magnitude=1,2===t)return scratchSpherical.clock=e[0],scratchSpherical.cone=e[1],Cartesian3.fromSpherical(scratchSpherical,scratchCartesian$3),[scratchCartesian$3.x,scratchCartesian$3.y,scratchCartesian$3.z];for(var i=new Array(t/3*4),r=0,n=0;r<t;r+=3,n+=4)i[n]=e[r],scratchSpherical.clock=e[r+1],scratchSpherical.cone=e[r+2],Cartesian3.fromSpherical(scratchSpherical,scratchCartesian$3),i[n+1]=scratchCartesian$3.x,i[n+2]=scratchCartesian$3.y,i[n+3]=scratchCartesian$3.z;return i}function convertSphericalToCartesian(e){var t=e.length;if(3===t)return scratchSpherical.clock=e[0],scratchSpherical.cone=e[1],scratchSpherical.magnitude=e[2],Cartesian3.fromSpherical(scratchSpherical,scratchCartesian$3),[scratchCartesian$3.x,scratchCartesian$3.y,scratchCartesian$3.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],scratchSpherical.clock=e[r+1],scratchSpherical.cone=e[r+2],scratchSpherical.magnitude=e[r+3],Cartesian3.fromSpherical(scratchSpherical,scratchCartesian$3),i[r+1]=scratchCartesian$3.x,i[r+2]=scratchCartesian$3.y,i[r+3]=scratchCartesian$3.z;return i}function convertCartographicRadiansToCartesian(e){var t=e.length;if(3===t)return scratchCartographic$7.longitude=e[0],scratchCartographic$7.latitude=e[1],scratchCartographic$7.height=e[2],Ellipsoid.WGS84.cartographicToCartesian(scratchCartographic$7,scratchCartesian$3),[scratchCartesian$3.x,scratchCartesian$3.y,scratchCartesian$3.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],scratchCartographic$7.longitude=e[r+1],scratchCartographic$7.latitude=e[r+2],scratchCartographic$7.height=e[r+3],Ellipsoid.WGS84.cartographicToCartesian(scratchCartographic$7,scratchCartesian$3),i[r+1]=scratchCartesian$3.x,i[r+2]=scratchCartesian$3.y,i[r+3]=scratchCartesian$3.z;return i}function convertCartographicDegreesToCartesian(e){var t=e.length;if(3===t)return scratchCartographic$7.longitude=CesiumMath.toRadians(e[0]),scratchCartographic$7.latitude=CesiumMath.toRadians(e[1]),scratchCartographic$7.height=e[2],Ellipsoid.WGS84.cartographicToCartesian(scratchCartographic$7,scratchCartesian$3),[scratchCartesian$3.x,scratchCartesian$3.y,scratchCartesian$3.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],scratchCartographic$7.longitude=CesiumMath.toRadians(e[r+1]),scratchCartographic$7.latitude=CesiumMath.toRadians(e[r+2]),scratchCartographic$7.height=e[r+3],Ellipsoid.WGS84.cartographicToCartesian(scratchCartographic$7,scratchCartesian$3),i[r+1]=scratchCartesian$3.x,i[r+2]=scratchCartesian$3.y,i[r+3]=scratchCartesian$3.z;return i}function unwrapCartesianInterval(e){var t=e.cartesian;if(defined(t))return t;t=e.cartesianVelocity;if(defined(t))return t;t=e.unitCartesian;if(defined(t))return t;t=e.unitSpherical;if(defined(t))return convertUnitSphericalToCartesian(t);t=e.spherical;if(defined(t))return convertSphericalToCartesian(t);t=e.cartographicRadians;if(defined(t))return convertCartographicRadiansToCartesian(t);t=e.cartographicDegrees;if(defined(t))return convertCartographicDegreesToCartesian(t);throw new RuntimeError(JSON.stringify(e)+" is not a valid CZML interval.")}function normalizePackedCartesianArray(e,t){Cartesian3.unpack(e,t,scratchCartesian$3),Cartesian3.normalize(scratchCartesian$3,scratchCartesian$3),Cartesian3.pack(scratchCartesian$3,e,t)}function unwrapUnitCartesianInterval(e){var t=unwrapCartesianInterval(e);if(3===t.length)return normalizePackedCartesianArray(t,0),t;for(var i=1;i<t.length;i+=4)normalizePackedCartesianArray(t,i);return t}function normalizePackedQuaternionArray(e,t){Quaternion.unpack(e,t,scratchQuaternion),Quaternion.normalize(scratchQuaternion,scratchQuaternion),Quaternion.pack(scratchQuaternion,e,t)}function unwrapQuaternionInterval(e){var t=e.unitQuaternion;if(defined(t)){if(4===t.length)return normalizePackedQuaternionArray(t,0),t;for(var i=1;i<t.length;i+=5)normalizePackedQuaternionArray(t,i)}return t}function getPropertyType(e){return"boolean"==typeof e?Boolean:"number"==typeof e?Number:"string"==typeof e?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?BoundingRectangle:e.hasOwnProperty("cartesian2")?Cartesian2:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?Cartesian3:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?UnitCartesian3:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?Color:e.hasOwnProperty("arcType")?ArcType$1:e.hasOwnProperty("classificationType")?ClassificationType$1:e.hasOwnProperty("colorBlendMode")?ColorBlendMode$1:e.hasOwnProperty("cornerType")?CornerType$1:e.hasOwnProperty("heightReference")?HeightReference$1:e.hasOwnProperty("horizontalOrigin")?HorizontalOrigin$1:e.hasOwnProperty("date")?JulianDate:e.hasOwnProperty("labelStyle")?LabelStyle$1:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?NearFarScalar:e.hasOwnProperty("distanceDisplayCondition")?DistanceDisplayCondition:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Quaternion:e.hasOwnProperty("shadowMode")?ShadowMode$1:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?StripeOrientation$1:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?Rectangle:e.hasOwnProperty("uri")?URI:e.hasOwnProperty("verticalOrigin")?VerticalOrigin$1:Object}function unwrapInterval(e,t,i){switch(e){case ArcType$1:return ArcType$1[defaultValue(t.arcType,t)];case Array:return t.array;case Boolean:return defaultValue(t.boolean,t);case BoundingRectangle:return t.boundingRectangle;case Cartesian2:return t.cartesian2;case Cartesian3:return unwrapCartesianInterval(t);case UnitCartesian3:return unwrapUnitCartesianInterval(t);case Color:return unwrapColorInterval(t);case ClassificationType$1:return ClassificationType$1[defaultValue(t.classificationType,t)];case ColorBlendMode$1:return ColorBlendMode$1[defaultValue(t.colorBlendMode,t)];case CornerType$1:return CornerType$1[defaultValue(t.cornerType,t)];case HeightReference$1:return HeightReference$1[defaultValue(t.heightReference,t)];case HorizontalOrigin$1:return HorizontalOrigin$1[defaultValue(t.horizontalOrigin,t)];case Image:return unwrapUriInterval(t,i);case JulianDate:return JulianDate.fromIso8601(defaultValue(t.date,t));case LabelStyle$1:return LabelStyle$1[defaultValue(t.labelStyle,t)];case Number:return defaultValue(t.number,t);case NearFarScalar:return t.nearFarScalar;case DistanceDisplayCondition:return t.distanceDisplayCondition;case Object:return defaultValue(defaultValue(t.object,t.value),t);case Quaternion:return unwrapQuaternionInterval(t);case Rotation:return defaultValue(t.number,t);case ShadowMode$1:return ShadowMode$1[defaultValue(defaultValue(t.shadowMode,t.shadows),t)];case String:return defaultValue(t.string,t);case StripeOrientation$1:return StripeOrientation$1[defaultValue(t.stripeOrientation,t)];case Rectangle:return unwrapRectangleInterval(t);case URI:return unwrapUriInterval(t,i);case VerticalOrigin$1:return VerticalOrigin$1[defaultValue(t.verticalOrigin,t)];default:throw new RuntimeError(e)}}var interpolators={HERMITE:HermitePolynomialApproximation,LAGRANGE:LagrangePolynomialApproximation,LINEAR:LinearApproximation};function updateInterpolationSettings(e,t){var i=e.interpolationAlgorithm,r=e.interpolationDegree;(defined(i)||defined(r))&&t.setInterpolationOptions({interpolationAlgorithm:interpolators[i],interpolationDegree:r});r=e.forwardExtrapolationType;defined(r)&&(t.forwardExtrapolationType=ExtrapolationType$1[r]);r=e.forwardExtrapolationDuration;defined(r)&&(t.forwardExtrapolationDuration=r);r=e.backwardExtrapolationType;defined(r)&&(t.backwardExtrapolationType=ExtrapolationType$1[r]);e=e.backwardExtrapolationDuration;defined(e)&&(t.backwardExtrapolationDuration=e)}var iso8601Scratch={iso8601:void 0};function intervalFromString(e){if(defined(e))return iso8601Scratch.iso8601=e,TimeInterval.fromIso8601(iso8601Scratch)}function wrapPropertyInInfiniteInterval(e){var t=Iso8601.MAXIMUM_INTERVAL.clone();return t.data=e,t}function convertPropertyToComposite(e){var t=new CompositeProperty;return t.intervals.addInterval(wrapPropertyInInfiniteInterval(e)),t}function convertPositionPropertyToComposite(e){var t=new CompositePositionProperty(e.referenceFrame);return t.intervals.addInterval(wrapPropertyInInfiniteInterval(e)),t}function processProperty(e,t,i,r,n,a,o){var s,l=intervalFromString(r.interval);defined(n)&&(l=defined(l)?TimeInterval.intersect(l,n,scratchTimeInterval$1):n);var c=!defined(r.reference)&&!defined(r.velocityReference),u=defined(l)&&!l.equals(Iso8601.MAXIMUM_INTERVAL);if(!0===r.delete)return u?removePropertyData(t[i],l):void(t[i]=void 0);n=!1;if(c){if(!defined(s=unwrapInterval(e,r,a)))return;h=defaultValue(e.packedLength,1),p=defaultValue(s.length,1),n=!defined(r.array)&&"string"!=typeof s&&h<p&&e!==Object}a="function"==typeof e.unpack&&e!==Rotation;if(n||u){var d,h=t[i],p=r.epoch;if(defined(p)&&(d=JulianDate.fromIso8601(p)),n&&!u)return h instanceof SampledProperty||(t[i]=h=new SampledProperty(e)),h.addSamplesPackedArray(s,d),void updateInterpolationSettings(r,h);if(!n&&u)return(l=l.clone()).data=c?a?e.unpack(s,0):s:createSpecializedProperty(e,o,r),defined(h)||(t[i]=h=new(c?TimeIntervalCollectionProperty:CompositeProperty)),c&&h instanceof TimeIntervalCollectionProperty||(h instanceof CompositeProperty||(t[i]=h=convertPropertyToComposite(h)),c&&(l.data=new ConstantProperty(l.data))),void h.intervals.addInterval(l);defined(h)||(t[i]=h=new CompositeProperty),h instanceof CompositeProperty||(t[i]=h=convertPropertyToComposite(h));u=h.intervals;defined(h=u.findInterval(l))&&h.data instanceof SampledProperty||((h=l.clone()).data=new SampledProperty(e),u.addInterval(h)),h.data.addSamplesPackedArray(s,d),updateInterpolationSettings(r,h.data)}else t[i]=c?new ConstantProperty(a?e.unpack(s,0):s):createSpecializedProperty(e,o,r)}function removePropertyData(e,t){if(e instanceof SampledProperty)e.removeSamples(t);else if(e instanceof TimeIntervalCollectionProperty)e.intervals.removeInterval(t);else if(e instanceof CompositeProperty){for(var i=e.intervals,r=0;r<i.length;++r){var n=TimeInterval.intersect(i.get(r),t,scratchTimeInterval$1);n.isEmpty||removePropertyData(n.data,t)}i.removeInterval(t)}}function processPacketData(e,t,i,r,n,a,o){if(defined(r))if(Array.isArray(r))for(var s=0,l=r.length;s<l;++s)processProperty(e,t,i,r[s],n,a,o);else processProperty(e,t,i,r,n,a,o)}function processPositionProperty(e,t,i,r,n,a){var o=intervalFromString(i.interval);defined(r)&&(o=defined(o)?TimeInterval.intersect(o,r,scratchTimeInterval$1):r);var s,l,c=defined(i.cartesianVelocity)?1:0,u=Cartesian3.packedLength*(1+c),d=!defined(i.reference),h=defined(o)&&!o.equals(Iso8601.MAXIMUM_INTERVAL);if(!0===i.delete)return h?removePositionPropertyData(e[t],o):void(e[t]=void 0);var p=!1;if(d&&(l=defaultValue(l=defined(i.referenceFrame)?ReferenceFrame$1[i.referenceFrame]:l,ReferenceFrame$1.FIXED),p=u<defaultValue((s=unwrapCartesianInterval(i)).length,1)),p||h){var m,r=e[t],u=i.epoch;if(defined(u)&&(m=JulianDate.fromIso8601(u)),p&&!h)return r instanceof SampledPositionProperty&&(!defined(l)||r.referenceFrame===l)||(e[t]=r=new SampledPositionProperty(l,c)),r.addSamplesPackedArray(s,m),void updateInterpolationSettings(i,r);if(!p&&h)return(o=o.clone()).data=d?Cartesian3.unpack(s):createReferenceProperty(a,i.reference),defined(r)||(r=new(d?TimeIntervalCollectionPositionProperty:CompositePositionProperty)(l),e[t]=r),d&&r instanceof TimeIntervalCollectionPositionProperty&&defined(l)&&r.referenceFrame===l||(r instanceof CompositePositionProperty||(e[t]=r=convertPositionPropertyToComposite(r)),d&&(o.data=new ConstantPositionProperty(o.data,l))),void r.intervals.addInterval(o);defined(r)?r instanceof CompositePositionProperty||(e[t]=r=convertPositionPropertyToComposite(r)):e[t]=r=new CompositePositionProperty(l);h=r.intervals;defined(r=h.findInterval(o))&&r.data instanceof SampledPositionProperty&&(!defined(l)||r.data.referenceFrame===l)||((r=o.clone()).data=new SampledPositionProperty(l,c),h.addInterval(r)),r.data.addSamplesPackedArray(s,m),updateInterpolationSettings(i,r.data)}else e[t]=d?new ConstantPositionProperty(Cartesian3.unpack(s),l):createReferenceProperty(a,i.reference)}function removePositionPropertyData(e,t){if(e instanceof SampledPositionProperty)e.removeSamples(t);else if(e instanceof TimeIntervalCollectionPositionProperty)e.intervals.removeInterval(t);else if(e instanceof CompositePositionProperty){for(var i=e.intervals,r=0;r<i.length;++r){var n=TimeInterval.intersect(i.get(r),t,scratchTimeInterval$1);n.isEmpty||removePositionPropertyData(n.data,t)}i.removeInterval(t)}}function processPositionPacketData(e,t,i,r,n,a){if(defined(i))if(Array.isArray(i))for(var o=0,s=i.length;o<s;++o)processPositionProperty(e,t,i[o],r,n,a);else processPositionProperty(e,t,i,r,n,a)}function processShapePacketData(e,t,i,r){defined(i.references)?processReferencesArrayPacketData(e,t,i.references,i.interval,r,PropertyArray,CompositeProperty):(defined(i.cartesian2)?i.array=Cartesian2.unpackArray(i.cartesian2):defined(i.cartesian)&&(i.array=Cartesian2.unpackArray(i.cartesian)),defined(i.array)&&processPacketData(Array,e,t,i,void 0,void 0,r))}function processMaterialProperty(e,t,i,r,n,a){var o=intervalFromString(i.interval);defined(r)&&(o=defined(o)?TimeInterval.intersect(o,r,scratchTimeInterval$1):r);var s,l,c,u=e[t];defined(o)?(u instanceof CompositeMaterialProperty||(u=new CompositeMaterialProperty,e[t]=u),defined(l=(r=u.intervals).findInterval({start:o.start,stop:o.stop}))?s=l.data:(l=o.clone(),r.addInterval(l))):s=u,defined(i.solidColor)?processPacketData(Color,s=!(s instanceof ColorMaterialProperty)?new ColorMaterialProperty:s,"color",(c=i.solidColor).color,void 0,void 0,a):defined(i.grid)?(processPacketData(Color,s=!(s instanceof GridMaterialProperty)?new GridMaterialProperty:s,"color",(c=i.grid).color,void 0,n,a),processPacketData(Number,s,"cellAlpha",c.cellAlpha,void 0,n,a),processPacketData(Cartesian2,s,"lineCount",c.lineCount,void 0,n,a),processPacketData(Cartesian2,s,"lineThickness",c.lineThickness,void 0,n,a),processPacketData(Cartesian2,s,"lineOffset",c.lineOffset,void 0,n,a)):defined(i.image)?(s instanceof ImageMaterialProperty||(s=new ImageMaterialProperty),c=i.image,processPacketData(Image,s,"image",c.image,void 0,n,a),processPacketData(Cartesian2,s,"repeat",c.repeat,void 0,n,a),processPacketData(Color,s,"color",c.color,void 0,n,a),processPacketData(Boolean,s,"transparent",c.transparent,void 0,n,a)):defined(i.stripe)?(s instanceof StripeMaterialProperty||(s=new StripeMaterialProperty),c=i.stripe,processPacketData(StripeOrientation$1,s,"orientation",c.orientation,void 0,n,a),processPacketData(Color,s,"evenColor",c.evenColor,void 0,n,a),processPacketData(Color,s,"oddColor",c.oddColor,void 0,n,a),processPacketData(Number,s,"offset",c.offset,void 0,n,a),processPacketData(Number,s,"repeat",c.repeat,void 0,n,a)):defined(i.polylineOutline)?(processPacketData(Color,s=!(s instanceof PolylineOutlineMaterialProperty)?new PolylineOutlineMaterialProperty:s,"color",(c=i.polylineOutline).color,void 0,n,a),processPacketData(Color,s,"outlineColor",c.outlineColor,void 0,n,a),processPacketData(Number,s,"outlineWidth",c.outlineWidth,void 0,n,a)):defined(i.polylineGlow)?(processPacketData(Color,s=!(s instanceof PolylineGlowMaterialProperty)?new PolylineGlowMaterialProperty:s,"color",(c=i.polylineGlow).color,void 0,n,a),processPacketData(Number,s,"glowPower",c.glowPower,void 0,n,a),processPacketData(Number,s,"taperPower",c.taperPower,void 0,n,a)):defined(i.polylineArrow)?processPacketData(Color,s=!(s instanceof PolylineArrowMaterialProperty)?new PolylineArrowMaterialProperty:s,"color",(c=i.polylineArrow).color,void 0,void 0,a):defined(i.polylineDash)?(processPacketData(Color,s=!(s instanceof PolylineDashMaterialProperty)?new PolylineDashMaterialProperty:s,"color",(c=i.polylineDash).color,void 0,void 0,a),processPacketData(Color,s,"gapColor",c.gapColor,void 0,void 0,a),processPacketData(Number,s,"dashLength",c.dashLength,void 0,n,a),processPacketData(Number,s,"dashPattern",c.dashPattern,void 0,n,a)):defined(i.checkerboard)&&(processPacketData(Color,s=!(s instanceof CheckerboardMaterialProperty)?new CheckerboardMaterialProperty:s,"evenColor",(c=i.checkerboard).evenColor,void 0,n,a),processPacketData(Color,s,"oddColor",c.oddColor,void 0,n,a),processPacketData(Cartesian2,s,"repeat",c.repeat,void 0,n,a)),defined(l)?l.data=s:e[t]=s}function processMaterialPacketData(e,t,i,r,n,a){if(defined(i))if(Array.isArray(i))for(var o=0,s=i.length;o<s;++o)processMaterialProperty(e,t,i[o],r,n,a);else processMaterialProperty(e,t,i,r,n,a)}function processName(e,t,i,r){defined(t.name)&&(e.name=t.name)}function processDescription$1(e,t,i,r){t=t.description;defined(t)&&processPacketData(String,e,"description",t,void 0,r,i)}function processPosition(e,t,i,r){t=t.position;defined(t)&&processPositionPacketData(e,"position",t,void 0,r,i)}function processViewFrom(e,t,i,r){t=t.viewFrom;defined(t)&&processPacketData(Cartesian3,e,"viewFrom",t,void 0,r,i)}function processOrientation(e,t,i,r){t=t.orientation;defined(t)&&processPacketData(Quaternion,e,"orientation",t,void 0,r,i)}function processProperties(e,t,i,r){var n=t.properties;if(defined(n))for(var a in defined(e.properties)||(e.properties=new PropertyBag),n)if(n.hasOwnProperty(a)){e.properties.hasProperty(a)||e.properties.addProperty(a);var o=n[a];if(Array.isArray(o))for(var s=0,l=o.length;s<l;++s)processProperty(getPropertyType(o[s]),e.properties,a,o[s],void 0,r,i);else processProperty(getPropertyType(o),e.properties,a,o,void 0,r,i)}}function processReferencesArrayPacketData(e,t,i,r,n,a,o){var s=i.map(function(e){return createReferenceProperty(n,e)});defined(r)?(r=intervalFromString(r),(i=e[t])instanceof o||((o=new o).intervals.addInterval(wrapPropertyInInfiniteInterval(i)),e[t]=i=o),r.data=new a(s),i.intervals.addInterval(r)):e[t]=new a(s)}function processArrayPacketData(e,t,i,r){var n=i.references;defined(n)?processReferencesArrayPacketData(e,t,n,i.interval,r,PropertyArray,CompositeProperty):processPacketData(Array,e,t,i,void 0,void 0,r)}function processArray(e,t,i,r){if(defined(i))if(Array.isArray(i))for(var n=0,a=i.length;n<a;++n)processArrayPacketData(e,t,i[n],r);else processArrayPacketData(e,t,i,r)}function processPositionArrayPacketData(e,t,i,r){var n=i.references;defined(n)?processReferencesArrayPacketData(e,t,n,i.interval,r,PositionPropertyArray,CompositePositionProperty):(defined(i.cartesian)?i.array=Cartesian3.unpackArray(i.cartesian):defined(i.cartographicRadians)?i.array=Cartesian3.fromRadiansArrayHeights(i.cartographicRadians):defined(i.cartographicDegrees)&&(i.array=Cartesian3.fromDegreesArrayHeights(i.cartographicDegrees)),defined(i.array)&&processPacketData(Array,e,t,i,void 0,void 0,r))}function processPositionArray(e,t,i,r){if(defined(i))if(Array.isArray(i))for(var n=0,a=i.length;n<a;++n)processPositionArrayPacketData(e,t,i[n],r);else processPositionArrayPacketData(e,t,i,r)}function unpackCartesianArray(e){return Cartesian3.unpackArray(e)}function unpackCartographicRadiansArray(e){return Cartesian3.fromRadiansArrayHeights(e)}function unpackCartographicDegreesArray(e){return Cartesian3.fromDegreesArrayHeights(e)}function processPositionArrayOfArraysPacketData(e,t,i,r){var n=i.references;defined(n)?(n=n.map(function(e){var t={};return processReferencesArrayPacketData(t,"positions",e,i.interval,r,PositionPropertyArray,CompositePositionProperty),t.positions}),e[t]=new PositionPropertyArray(n)):(defined(i.cartesian)?i.array=i.cartesian.map(unpackCartesianArray):defined(i.cartographicRadians)?i.array=i.cartographicRadians.map(unpackCartographicRadiansArray):defined(i.cartographicDegrees)&&(i.array=i.cartographicDegrees.map(unpackCartographicDegreesArray)),defined(i.array)&&processPacketData(Array,e,t,i,void 0,void 0,r))}function processPositionArrayOfArrays(e,t,i,r){if(defined(i))if(Array.isArray(i))for(var n=0,a=i.length;n<a;++n)processPositionArrayOfArraysPacketData(e,t,i[n],r);else processPositionArrayOfArraysPacketData(e,t,i,r)}function processShape(e,t,i,r){if(defined(i))if(Array.isArray(i))for(var n=0,a=i.length;n<a;n++)processShapePacketData(e,t,i[n],r);else processShapePacketData(e,t,i,r)}function processAvailability(e,t,i,r){var n,a=t.availability;if(defined(a)){if(Array.isArray(a))for(var o=0,s=a.length;o<s;++o)(n=!defined(n)?new TimeIntervalCollection:n).addInterval(intervalFromString(a[o]));else(n=new TimeIntervalCollection).addInterval(intervalFromString(a));e.availability=n}}function processAlignedAxis(e,t,i,r,n){defined(t)&&processPacketData(UnitCartesian3,e,"alignedAxis",t,i,r,n)}function processBillboard(e,t,i,r){var n,a=t.billboard;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.billboard)||(e.billboard=t=new BillboardGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Image,t,"image",a.image,n,r,i),processPacketData(Number,t,"scale",a.scale,n,r,i),processPacketData(Cartesian2,t,"pixelOffset",a.pixelOffset,n,r,i),processPacketData(Cartesian3,t,"eyeOffset",a.eyeOffset,n,r,i),processPacketData(HorizontalOrigin$1,t,"horizontalOrigin",a.horizontalOrigin,n,r,i),processPacketData(VerticalOrigin$1,t,"verticalOrigin",a.verticalOrigin,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Color,t,"color",a.color,n,r,i),processPacketData(Rotation,t,"rotation",a.rotation,n,r,i),processAlignedAxis(t,a.alignedAxis,n,r,i),processPacketData(Boolean,t,"sizeInMeters",a.sizeInMeters,n,r,i),processPacketData(Number,t,"width",a.width,n,r,i),processPacketData(Number,t,"height",a.height,n,r,i),processPacketData(NearFarScalar,t,"scaleByDistance",a.scaleByDistance,n,r,i),processPacketData(NearFarScalar,t,"translucencyByDistance",a.translucencyByDistance,n,r,i),processPacketData(NearFarScalar,t,"pixelOffsetScaleByDistance",a.pixelOffsetScaleByDistance,n,r,i),processPacketData(BoundingRectangle,t,"imageSubRegion",a.imageSubRegion,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(Number,t,"disableDepthTestDistance",a.disableDepthTestDistance,n,r,i))}function processBox(e,t,i,r){var n,a=t.box;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.box)||(e.box=t=new BoxGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Cartesian3,t,"dimensions",a.dimensions,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i))}function processCorridor(e,t,i,r){var n,a=t.corridor;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.corridor)||(e.corridor=t=new CorridorGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPositionArray(t,"positions",a.positions,i),processPacketData(Number,t,"width",a.width,n,r,i),processPacketData(Number,t,"height",a.height,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Number,t,"extrudedHeight",a.extrudedHeight,n,r,i),processPacketData(HeightReference$1,t,"extrudedHeightReference",a.extrudedHeightReference,n,r,i),processPacketData(CornerType$1,t,"cornerType",a.cornerType,n,r,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(ClassificationType$1,t,"classificationType",a.classificationType,n,r,i),processPacketData(Number,t,"zIndex",a.zIndex,n,r,i))}function processCylinder(e,t,i,r){var n,a=t.cylinder;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.cylinder)||(e.cylinder=t=new CylinderGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Number,t,"length",a.length,n,r,i),processPacketData(Number,t,"topRadius",a.topRadius,n,r,i),processPacketData(Number,t,"bottomRadius",a.bottomRadius,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Number,t,"numberOfVerticalLines",a.numberOfVerticalLines,n,r,i),processPacketData(Number,t,"slices",a.slices,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i))}function processDocument$1(e,t){var i=e.version;if(defined(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new RuntimeError("Cesium only supports CZML version 1.");t._version=i}}if(!defined(t._version))throw new RuntimeError("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");i=t._documentPacket;defined(e.name)&&(i.name=e.name);t=e.clock;defined(t)&&(defined(e=i.clock)?(e.interval=defaultValue(t.interval,e.interval),e.currentTime=defaultValue(t.currentTime,e.currentTime),e.range=defaultValue(t.range,e.range),e.step=defaultValue(t.step,e.step),e.multiplier=defaultValue(t.multiplier,e.multiplier)):i.clock={interval:t.interval,currentTime:t.currentTime,range:t.range,step:t.step,multiplier:t.multiplier})}function processEllipse(e,t,i,r){var n,a=t.ellipse;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.ellipse)||(e.ellipse=t=new EllipseGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Number,t,"semiMajorAxis",a.semiMajorAxis,n,r,i),processPacketData(Number,t,"semiMinorAxis",a.semiMinorAxis,n,r,i),processPacketData(Number,t,"height",a.height,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Number,t,"extrudedHeight",a.extrudedHeight,n,r,i),processPacketData(HeightReference$1,t,"extrudedHeightReference",a.extrudedHeightReference,n,r,i),processPacketData(Rotation,t,"rotation",a.rotation,n,r,i),processPacketData(Rotation,t,"stRotation",a.stRotation,n,r,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Number,t,"numberOfVerticalLines",a.numberOfVerticalLines,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(ClassificationType$1,t,"classificationType",a.classificationType,n,r,i),processPacketData(Number,t,"zIndex",a.zIndex,n,r,i))}function processEllipsoid(e,t,i,r){var n,a=t.ellipsoid;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.ellipsoid)||(e.ellipsoid=t=new EllipsoidGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Cartesian3,t,"radii",a.radii,n,r,i),processPacketData(Cartesian3,t,"innerRadii",a.innerRadii,n,r,i),processPacketData(Number,t,"minimumClock",a.minimumClock,n,r,i),processPacketData(Number,t,"maximumClock",a.maximumClock,n,r,i),processPacketData(Number,t,"minimumCone",a.minimumCone,n,r,i),processPacketData(Number,t,"maximumCone",a.maximumCone,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Number,t,"stackPartitions",a.stackPartitions,n,r,i),processPacketData(Number,t,"slicePartitions",a.slicePartitions,n,r,i),processPacketData(Number,t,"subdivisions",a.subdivisions,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i))}function processLabel(e,t,i,r){var n,a=t.label;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.label)||(e.label=t=new LabelGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(String,t,"text",a.text,n,r,i),processPacketData(String,t,"font",a.font,n,r,i),processPacketData(LabelStyle$1,t,"style",a.style,n,r,i),processPacketData(Number,t,"scale",a.scale,n,r,i),processPacketData(Boolean,t,"showBackground",a.showBackground,n,r,i),processPacketData(Color,t,"backgroundColor",a.backgroundColor,n,r,i),processPacketData(Cartesian2,t,"backgroundPadding",a.backgroundPadding,n,r,i),processPacketData(Cartesian2,t,"pixelOffset",a.pixelOffset,n,r,i),processPacketData(Cartesian3,t,"eyeOffset",a.eyeOffset,n,r,i),processPacketData(HorizontalOrigin$1,t,"horizontalOrigin",a.horizontalOrigin,n,r,i),processPacketData(VerticalOrigin$1,t,"verticalOrigin",a.verticalOrigin,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Color,t,"fillColor",a.fillColor,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(NearFarScalar,t,"translucencyByDistance",a.translucencyByDistance,n,r,i),processPacketData(NearFarScalar,t,"pixelOffsetScaleByDistance",a.pixelOffsetScaleByDistance,n,r,i),processPacketData(NearFarScalar,t,"scaleByDistance",a.scaleByDistance,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(Number,t,"disableDepthTestDistance",a.disableDepthTestDistance,n,r,i))}function processModel(e,t,i,r){t=t.model;if(defined(t)){var n,a,o=intervalFromString(t.interval),s=e.model;defined(s)||(e.model=s=new ModelGraphics),processPacketData(Boolean,s,"show",t.show,o,r,i),processPacketData(URI,s,"uri",t.gltf,o,r,i),processPacketData(Number,s,"scale",t.scale,o,r,i),processPacketData(Number,s,"minimumPixelSize",t.minimumPixelSize,o,r,i),processPacketData(Number,s,"maximumScale",t.maximumScale,o,r,i),processPacketData(Boolean,s,"incrementallyLoadTextures",t.incrementallyLoadTextures,o,r,i),processPacketData(Boolean,s,"runAnimations",t.runAnimations,o,r,i),processPacketData(Boolean,s,"clampAnimations",t.clampAnimations,o,r,i),processPacketData(ShadowMode$1,s,"shadows",t.shadows,o,r,i),processPacketData(HeightReference$1,s,"heightReference",t.heightReference,o,r,i),processPacketData(Color,s,"silhouetteColor",t.silhouetteColor,o,r,i),processPacketData(Number,s,"silhouetteSize",t.silhouetteSize,o,r,i),processPacketData(Color,s,"color",t.color,o,r,i),processPacketData(ColorBlendMode$1,s,"colorBlendMode",t.colorBlendMode,o,r,i),processPacketData(Number,s,"colorBlendAmount",t.colorBlendAmount,o,r,i),processPacketData(DistanceDisplayCondition,s,"distanceDisplayCondition",t.distanceDisplayCondition,o,r,i);var l=t.nodeTransformations;if(defined(l))if(Array.isArray(l))for(n=0,a=l.length;n<a;++n)processNodeTransformations(s,l[n],o,r,i);else processNodeTransformations(s,l,o,r,i);var c=t.articulations;if(defined(c))if(Array.isArray(c))for(n=0,a=c.length;n<a;++n)processArticulations(s,c[n],o,r,i);else processArticulations(s,c,o,r,i)}}function processNodeTransformations(e,t,i,r,n){var a=intervalFromString(t.interval);defined(i)&&(a=defined(a)?TimeInterval.intersect(a,i,scratchTimeInterval$1):i);for(var o=e.nodeTransformations,s=Object.keys(t),l=0,c=s.length;l<c;++l){var u,d,h=s[l];"interval"!==h&&(defined(u=t[h])&&(defined(o)||(e.nodeTransformations=o=new PropertyBag),o.hasProperty(h)||o.addProperty(h),defined(d=o[h])||(o[h]=d=new NodeTransformationProperty),processPacketData(Cartesian3,d,"translation",u.translation,a,r,n),processPacketData(Quaternion,d,"rotation",u.rotation,a,r,n),processPacketData(Cartesian3,d,"scale",u.scale,a,r,n)))}}function processArticulations(e,t,i,r,n){var a=intervalFromString(t.interval);defined(i)&&(a=defined(a)?TimeInterval.intersect(a,i,scratchTimeInterval$1):i);for(var o=e.articulations,s=Object.keys(t),l=0,c=s.length;l<c;++l){var u,d=s[l];"interval"!==d&&(defined(u=t[d])&&(defined(o)||(e.articulations=o=new PropertyBag),o.hasProperty(d)||o.addProperty(d),processPacketData(Number,o,d,u,a,r,n)))}}function processPath(e,t,i,r){var n,a=t.path;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.path)||(e.path=t=new PathGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Number,t,"leadTime",a.leadTime,n,r,i),processPacketData(Number,t,"trailTime",a.trailTime,n,r,i),processPacketData(Number,t,"width",a.width,n,r,i),processPacketData(Number,t,"resolution",a.resolution,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i))}function processPoint$2(e,t,i,r){var n,a=t.point;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.point)||(e.point=t=new PointGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Number,t,"pixelSize",a.pixelSize,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Color,t,"color",a.color,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(NearFarScalar,t,"scaleByDistance",a.scaleByDistance,n,r,i),processPacketData(NearFarScalar,t,"translucencyByDistance",a.translucencyByDistance,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(Number,t,"disableDepthTestDistance",a.disableDepthTestDistance,n,r,i))}function PolygonHierarchyProperty(e){this.polygon=e,this._definitionChanged=new Event}function processPolygon$2(e,t,i,r){var n,a=t.polygon;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.polygon)||(e.polygon=t=new PolygonGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPositionArray(t,"_positions",a.positions,i),processPositionArrayOfArrays(t,"_holes",a.holes,i),(defined(t._positions)||defined(t._holes))&&(t.hierarchy=new PolygonHierarchyProperty(t)),processPacketData(Number,t,"height",a.height,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Number,t,"extrudedHeight",a.extrudedHeight,n,r,i),processPacketData(HeightReference$1,t,"extrudedHeightReference",a.extrudedHeightReference,n,r,i),processPacketData(Rotation,t,"stRotation",a.stRotation,n,r,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Boolean,t,"perPositionHeight",a.perPositionHeight,n,r,i),processPacketData(Boolean,t,"closeTop",a.closeTop,n,r,i),processPacketData(Boolean,t,"closeBottom",a.closeBottom,n,r,i),processPacketData(ArcType$1,t,"arcType",a.arcType,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(ClassificationType$1,t,"classificationType",a.classificationType,n,r,i),processPacketData(Number,t,"zIndex",a.zIndex,n,r,i))}function adaptFollowSurfaceToArcType(e){return e?ArcType$1.GEODESIC:ArcType$1.NONE}function processPolyline(e,t,i,r){var n,a=t.polyline;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.polyline)||(e.polyline=t=new PolylineGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPositionArray(t,"positions",a.positions,i),processPacketData(Number,t,"width",a.width,n,r,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processMaterialPacketData(t,"depthFailMaterial",a.depthFailMaterial,n,r,i),processPacketData(ArcType$1,t,"arcType",a.arcType,n,r,i),processPacketData(Boolean,t,"clampToGround",a.clampToGround,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(ClassificationType$1,t,"classificationType",a.classificationType,n,r,i),processPacketData(Number,t,"zIndex",a.zIndex,n,r,i),defined(a.followSurface)&&!defined(a.arcType)&&(e={},processPacketData(Boolean,e,"followSurface",a.followSurface,n,r,i),t.arcType=createAdapterProperty(e.followSurface,adaptFollowSurfaceToArcType)))}function processPolylineVolume(e,t,i,r){var n,a=t.polylineVolume;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.polylineVolume)||(e.polylineVolume=t=new PolylineVolumeGraphics),processPositionArray(t,"positions",a.positions,i),processShape(t,"shape",a.shape,i),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(CornerType$1,t,"cornerType",a.cornerType,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i))}function processRectangle(e,t,i,r){var n,a=t.rectangle;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.rectangle)||(e.rectangle=t=new RectangleGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Rectangle,t,"coordinates",a.coordinates,n,r,i),processPacketData(Number,t,"height",a.height,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Number,t,"extrudedHeight",a.extrudedHeight,n,r,i),processPacketData(HeightReference$1,t,"extrudedHeightReference",a.extrudedHeightReference,n,r,i),processPacketData(Rotation,t,"rotation",a.rotation,n,r,i),processPacketData(Rotation,t,"stRotation",a.stRotation,n,r,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(ClassificationType$1,t,"classificationType",a.classificationType,n,r,i),processPacketData(Number,t,"zIndex",a.zIndex,n,r,i))}function processTileset(e,t,i,r){var n,a=t.tileset;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.tileset)||(e.tileset=t=new Cesium3DTilesetGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(URI,t,"uri",a.uri,n,r,i),processPacketData(Number,t,"maximumScreenSpaceError",a.maximumScreenSpaceError,n,r,i))}function processWall(e,t,i,r){var n,a=t.wall;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.wall)||(e.wall=t=new WallGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPositionArray(t,"positions",a.positions,i),processArray(t,"minimumHeights",a.minimumHeights,i),processArray(t,"maximumHeights",a.maximumHeights,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i))}function processCzmlPacket(e,t,i,r,n){var a=e.id;if(defined(a)||(a=createGuid()),currentId=a,!defined(n._version)&&"document"!==a)throw new RuntimeError("The first CZML packet is required to be the document object.");if(!0===e.delete)t.removeById(a);else if("document"===a)processDocument$1(e,n);else{var o=t.getOrCreateEntity(a),a=e.parent;defined(a)&&(o.parent=t.getOrCreateEntity(a));for(var s=i.length-1;-1<s;s--)i[s](o,e,t,r)}currentId=void 0}function updateClock(e){var t=e._documentPacket.clock;if(!defined(t)){if(!defined(e._clock)){var i=e._entityCollection.computeAvailability();if(!i.start.equals(Iso8601.MINIMUM_VALUE)){var r=i.start,n=i.stop,a=JulianDate.secondsDifference(n,r),i=Math.round(a/120);return(a=new DataSourceClock).startTime=JulianDate.clone(r),a.stopTime=JulianDate.clone(n),a.clockRange=ClockRange$1.LOOP_STOP,a.multiplier=i,a.currentTime=JulianDate.clone(r),a.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,e._clock=a,!0}}return!1}defined(e._clock)?a=e._clock.clone():((a=new DataSourceClock).startTime=Iso8601.MINIMUM_VALUE.clone(),a.stopTime=Iso8601.MAXIMUM_VALUE.clone(),a.currentTime=Iso8601.MINIMUM_VALUE.clone(),a.clockRange=ClockRange$1.LOOP_STOP,a.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,a.multiplier=1);r=intervalFromString(t.interval);return defined(r)&&(a.startTime=r.start,a.stopTime=r.stop),defined(t.currentTime)&&(a.currentTime=JulianDate.fromIso8601(t.currentTime)),defined(t.range)&&(a.clockRange=defaultValue(ClockRange$1[t.range],ClockRange$1.LOOP_STOP)),defined(t.step)&&(a.clockStep=defaultValue(ClockStep$1[t.step],ClockStep$1.SYSTEM_CLOCK_MULTIPLIER)),defined(t.multiplier)&&(a.multiplier=t.multiplier),!a.equals(e._clock)&&(e._clock=a.clone(e._clock),!0)}function load$2(t,e,i,r){var n=e,a=(i=defaultValue(i,defaultValue.EMPTY_OBJECT)).sourceUri,i=i.credit;if("string"==typeof i&&(i=new Credit(i)),t._credit=i,"string"==typeof e||e instanceof Resource){var n=(e=Resource.createIfNeeded(e)).fetchJson(),a=defaultValue(a,e.clone()),o=t._resourceCredits,s=e.credits;if(defined(s))for(var l=s.length,c=0;c<l;c++)o.push(s[c])}return a=Resource.createIfNeeded(a),DataSource.setLoading(t,!0),when(n,function(e){return loadCzml(t,e,a,r)}).otherwise(function(e){return DataSource.setLoading(t,!1),t._error.raiseEvent(t,e),console.log(e),when.reject(e)})}function loadCzml(e,t,i,r){DataSource.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new DocumentPacket,n.removeAll()),CzmlDataSource._processCzml(t,n,i,void 0,e);t=updateClock(e),n=e._documentPacket;return defined(n.name)&&e._name!==n.name?(e._name=n.name,t=!0):!defined(e._name)&&defined(i)&&(e._name=getFilenameFromUri(i.getUrlComponent()),t=!0),DataSource.setLoading(e,!1),t&&e._changed.raiseEvent(e),e}function DocumentPacket(){this.name=void 0,this.clock=void 0}function CzmlDataSource(e){this._name=e,this._changed=new Event,this._error=new Event,this._isLoading=!1,this._loading=new Event,this._clock=void 0,this._documentPacket=new DocumentPacket,this._version=void 0,this._entityCollection=new EntityCollection(this),this._entityCluster=new EntityCluster,this._credit=void 0,this._resourceCredits=[]}function DataSourceCollection(){this._dataSources=[],this._dataSourceAdded=new Event,this._dataSourceRemoved=new Event,this._dataSourceMoved=new Event}function getIndex(e,t){return e.indexOf(t)}function swapDataSources(e,t,i){var r=e._dataSources,n=r.length-1;(t=CesiumMath.clamp(t,0,n))!==(i=CesiumMath.clamp(i,0,n))&&(n=r[t],r[t]=r[i],r[i]=n,e.dataSourceMoved.raiseEvent(n,i,t))}function PrimitiveCollection(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._primitives=[],this._guid=createGuid(),this._zIndex=void 0,this.show=defaultValue(e.show,!0),this.destroyPrimitives=defaultValue(e.destroyPrimitives,!0)}function getPrimitiveIndex(e,t){return e._primitives.indexOf(t)}function OrderedGroundPrimitiveCollection(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}function DynamicGeometryBatch(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new AssociativeArray}Object.defineProperties(PolygonHierarchyProperty.prototype,{isConstant:{get:function(){var e=this.polygon._positions,t=this.polygon._holes;return(!defined(e)||e.isConstant)&&(!defined(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}}),PolygonHierarchyProperty.prototype.getValue=function(e,t){var i,r;return defined(this.polygon._positions)&&(i=this.polygon._positions.getValue(e)),defined(this.polygon._holes)&&defined(r=this.polygon._holes.getValue(e))&&(r=r.map(function(e){return new PolygonHierarchy(e)})),defined(t)?(t.positions=i,t.holes=r,t):new PolygonHierarchy(i,r)},PolygonHierarchyProperty.prototype.equals=function(e){return this===e||e instanceof PolygonHierarchyProperty&&Property.equals(this.polygon._positions,e.polygon._positions)&&Property.equals(this.polygon._holes,e.polygon._holes)},CzmlDataSource.load=function(e,t){return(new CzmlDataSource).load(e,t)},Object.defineProperties(CzmlDataSource.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}}}),CzmlDataSource.updaters=[processBillboard,processBox,processCorridor,processCylinder,processEllipse,processEllipsoid,processLabel,processModel,processName,processDescription$1,processPath,processPoint$2,processPolygon$2,processPolyline,processPolylineVolume,processProperties,processRectangle,processPosition,processTileset,processViewFrom,processWall,processOrientation,processAvailability],CzmlDataSource.prototype.process=function(e,t){return load$2(this,e,t,!1)},CzmlDataSource.prototype.load=function(e,t){return load$2(this,e,t,!0)},CzmlDataSource.prototype.update=function(e){return!0},CzmlDataSource.processPacketData=processPacketData,CzmlDataSource.processPositionPacketData=processPositionPacketData,CzmlDataSource.processMaterialPacketData=processMaterialPacketData,CzmlDataSource._processCzml=function(e,t,i,r,n){if(r=defaultValue(r,CzmlDataSource.updaters),Array.isArray(e))for(var a=0,o=e.length;a<o;++a)processCzmlPacket(e[a],t,r,i,n);else processCzmlPacket(e,t,r,i,n)},Object.defineProperties(DataSourceCollection.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}}}),DataSourceCollection.prototype.add=function(e){var t=this,i=this._dataSources;return when(e,function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},DataSourceCollection.prototype.remove=function(e,t){t=defaultValue(t,!1);var i=this._dataSources.indexOf(e);return-1!==i&&(this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,e),t&&"function"==typeof e.destroy&&e.destroy(),!0)},DataSourceCollection.prototype.removeAll=function(e){e=defaultValue(e,!1);for(var t=this._dataSources,i=0,r=t.length;i<r;++i){var n=t[i];this._dataSourceRemoved.raiseEvent(this,n),e&&"function"==typeof n.destroy&&n.destroy()}this._dataSources=[]},DataSourceCollection.prototype.contains=function(e){return-1!==this.indexOf(e)},DataSourceCollection.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},DataSourceCollection.prototype.get=function(e){return this._dataSources[e]},DataSourceCollection.prototype.getByName=function(t){return this._dataSources.filter(function(e){return e.name===t})},DataSourceCollection.prototype.raise=function(e){e=getIndex(this._dataSources,e);swapDataSources(this,e,e+1)},DataSourceCollection.prototype.lower=function(e){e=getIndex(this._dataSources,e);swapDataSources(this,e,e-1)},DataSourceCollection.prototype.raiseToTop=function(e){var t=getIndex(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))},DataSourceCollection.prototype.lowerToBottom=function(e){var t=getIndex(this._dataSources,e);0!==t&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))},DataSourceCollection.prototype.isDestroyed=function(){return!1},DataSourceCollection.prototype.destroy=function(){return this.removeAll(!0),destroyObject(this)},Object.defineProperties(PrimitiveCollection.prototype,{length:{get:function(){return this._primitives.length}}}),PrimitiveCollection.prototype.add=function(e,t){var i=defined(t),r=e._external=e._external||{};return(r._composites=r._composites||{})[this._guid]={collection:this},i?this._primitives.splice(t,0,e):this._primitives.push(e),e},PrimitiveCollection.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},PrimitiveCollection.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},PrimitiveCollection.prototype.removeAll=function(){for(var e=this._primitives,t=e.length,i=0;i<t;++i)delete e[i]._external._composites[this._guid],this.destroyPrimitives&&e[i].destroy();this._primitives=[]},PrimitiveCollection.prototype.contains=function(e){return!!(defined(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},PrimitiveCollection.prototype.raise=function(e){var t,i;!defined(e)||(t=getPrimitiveIndex(this,e))!==(i=this._primitives).length-1&&(e=i[t],i[t]=i[t+1],i[t+1]=e)},PrimitiveCollection.prototype.raiseToTop=function(e){var t,i;!defined(e)||(t=getPrimitiveIndex(this,e))!==(i=this._primitives).length-1&&(i.splice(t,1),i.push(e))},PrimitiveCollection.prototype.lower=function(e){var t,i;defined(e)&&(t=getPrimitiveIndex(this,e),i=this._primitives,0!==t&&(e=i[t],i[t]=i[t-1],i[t-1]=e))},PrimitiveCollection.prototype.lowerToBottom=function(e){var t,i;defined(e)&&(t=getPrimitiveIndex(this,e),i=this._primitives,0!==t&&(i.splice(t,1),i.unshift(e)))},PrimitiveCollection.prototype.get=function(e){return this._primitives[e]},PrimitiveCollection.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},PrimitiveCollection.prototype.prePassesUpdate=function(e){for(var t=this._primitives,i=0;i<t.length;++i){var r=t[i];defined(r.prePassesUpdate)&&r.prePassesUpdate(e)}},PrimitiveCollection.prototype.updateForPass=function(e,t){for(var i=this._primitives,r=0;r<i.length;++r){var n=i[r];defined(n.updateForPass)&&n.updateForPass(e,t)}},PrimitiveCollection.prototype.postPassesUpdate=function(e){for(var t=this._primitives,i=0;i<t.length;++i){var r=t[i];defined(r.postPassesUpdate)&&r.postPassesUpdate(e)}},PrimitiveCollection.prototype.isDestroyed=function(){return!1},PrimitiveCollection.prototype.destroy=function(){return this.removeAll(),destroyObject(this)},Object.defineProperties(OrderedGroundPrimitiveCollection.prototype,{length:{get:function(){return this._length}}}),OrderedGroundPrimitiveCollection.prototype.add=function(e,t){t=defaultValue(t,0);var i=this._collections[t];if(!defined(i)){(i=new PrimitiveCollection({destroyPrimitives:!1}))._zIndex=t,this._collections[t]=i;for(var r=this._collectionsArray,n=0;n<r.length&&r[n]._zIndex<t;)n++;r.splice(n,0,i)}return i.add(e),this._length++,e._zIndex=t,e},OrderedGroundPrimitiveCollection.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e},OrderedGroundPrimitiveCollection.prototype.remove=function(e,t){if(this.contains(e)){var i=e._zIndex,r=this._collections[i],e=t?r.remove(e):r.removeAndDestroy(e);return e&&this._length--,0===r.length&&(this._collectionsArray.splice(this._collectionsArray.indexOf(r),1),this._collections[i]=void 0,r.destroy()),e}return!1},OrderedGroundPrimitiveCollection.prototype.removeAll=function(){for(var e=this._collectionsArray,t=0;t<e.length;t++){var i=e[t];i.destroyPrimitives=!0,i.destroy()}this._collections={},this._collectionsArray=[],this._length=0},OrderedGroundPrimitiveCollection.prototype.contains=function(e){if(!defined(e))return!1;var t=this._collections[e._zIndex];return defined(t)&&t.contains(e)},OrderedGroundPrimitiveCollection.prototype.update=function(e){if(this.show)for(var t=this._collectionsArray,i=0;i<t.length;i++)t[i].update(e)},OrderedGroundPrimitiveCollection.prototype.isDestroyed=function(){return!1},OrderedGroundPrimitiveCollection.prototype.destroy=function(){return this.removeAll(),destroyObject(this)},DynamicGeometryBatch.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))},DynamicGeometryBatch.prototype.remove=function(e){var t=e.id,e=this._dynamicUpdaters.get(t);defined(e)&&(this._dynamicUpdaters.remove(t),e.destroy())},DynamicGeometryBatch.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;i<r;i++)t[i].update(e);return!0},DynamicGeometryBatch.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;t<i;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},DynamicGeometryBatch.prototype.getBoundingSphere=function(e,t){return defined(e=this._dynamicUpdaters.get(e.id))&&defined(e.getBoundingSphere)?e.getBoundingSphere(t):BoundingSphereState$1.FAILED};var scratchColor$b=new Color,defaultOffset$6=Cartesian3.ZERO,offsetScratch$6=new Cartesian3,scratchRectangle$3=new Rectangle;function EllipseGeometryOptions(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 EllipseGeometryUpdater(e,t){GroundGeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new EllipseGeometryOptions(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function DynamicEllipseGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}defined(Object.create)&&(EllipseGeometryUpdater.prototype=Object.create(GroundGeometryUpdater.prototype),EllipseGeometryUpdater.prototype.constructor=EllipseGeometryUpdater),EllipseGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n={show:new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$b)),defined(t)||(t=Color.WHITE),n.color=ColorGeometryInstanceAttribute.fromColor(t)),defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$6,offsetScratch$6))),new GeometryInstance({id:i,geometry:new EllipseGeometry(this._options),attributes:n})},EllipseGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$b),n=this._distanceDisplayConditionProperty.getValue(e),n={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),offset:void 0};return defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$6,offsetScratch$6))),new GeometryInstance({id:t,geometry:new EllipseOutlineGeometry(this._options),attributes:n})},EllipseGeometryUpdater.prototype._computeCenter=function(e,t){return Property.getValueOrUndefined(this._entity.position,e,t)},EllipseGeometryUpdater.prototype._isHidden=function(e,t){return!defined(e.position)||!defined(t.semiMajorAxis)||!defined(t.semiMinorAxis)||GeometryUpdater.prototype._isHidden.call(this,e,t)},EllipseGeometryUpdater.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!Property.isConstant(t.rotation)||!Property.isConstant(t.height)||!Property.isConstant(t.extrudedHeight)||!Property.isConstant(t.granularity)||!Property.isConstant(t.stRotation)||!Property.isConstant(t.outlineWidth)||!Property.isConstant(t.numberOfVerticalLines)||!Property.isConstant(t.zIndex)||this._onTerrain&&!Property.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ColorMaterialProperty)},EllipseGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrUndefined(t.height,Iso8601.MINIMUM_VALUE),r=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),n=Property.getValueOrUndefined(t.extrudedHeight,Iso8601.MINIMUM_VALUE),a=Property.getValueOrDefault(t.extrudedHeightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE);defined(n)&&!defined(i)&&(i=0);var o=this._options;o.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,o.center=e.position.getValue(Iso8601.MINIMUM_VALUE,o.center),o.semiMajorAxis=t.semiMajorAxis.getValue(Iso8601.MINIMUM_VALUE,o.semiMajorAxis),o.semiMinorAxis=t.semiMinorAxis.getValue(Iso8601.MINIMUM_VALUE,o.semiMinorAxis),o.rotation=Property.getValueOrUndefined(t.rotation,Iso8601.MINIMUM_VALUE),o.granularity=Property.getValueOrUndefined(t.granularity,Iso8601.MINIMUM_VALUE),o.stRotation=Property.getValueOrUndefined(t.stRotation,Iso8601.MINIMUM_VALUE),o.numberOfVerticalLines=Property.getValueOrUndefined(t.numberOfVerticalLines,Iso8601.MINIMUM_VALUE),o.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(i,r,n,a),o.height=GroundGeometryUpdater.getGeometryHeight(i,r),(n=GroundGeometryUpdater.getGeometryExtrudedHeight(n,a))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(n=ApproximateTerrainHeights.getMinimumMaximumHeights(EllipseGeometry.computeRectangle(o,scratchRectangle$3)).minimumTerrainHeight),o.extrudedHeight=n},EllipseGeometryUpdater.DynamicGeometryUpdater=DynamicEllipseGeometryUpdater,defined(Object.create)&&(DynamicEllipseGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicEllipseGeometryUpdater.prototype.constructor=DynamicEllipseGeometryUpdater),DynamicEllipseGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(r.center)||!defined(r.semiMajorAxis)||!defined(r.semiMinorAxis)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DynamicEllipseGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options,n=Property.getValueOrUndefined(t.height,i),a=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),o=Property.getValueOrUndefined(t.extrudedHeight,i),s=Property.getValueOrDefault(t.extrudedHeightReference,i,HeightReference$1.NONE);defined(o)&&!defined(n)&&(n=0),r.center=Property.getValueOrUndefined(e.position,i,r.center),r.semiMajorAxis=Property.getValueOrUndefined(t.semiMajorAxis,i),r.semiMinorAxis=Property.getValueOrUndefined(t.semiMinorAxis,i),r.rotation=Property.getValueOrUndefined(t.rotation,i),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.stRotation=Property.getValueOrUndefined(t.stRotation,i),r.numberOfVerticalLines=Property.getValueOrUndefined(t.numberOfVerticalLines,i),r.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(n,a,o,s),r.height=GroundGeometryUpdater.getGeometryHeight(n,a),(o=GroundGeometryUpdater.getGeometryExtrudedHeight(o,s))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(o=ApproximateTerrainHeights.getMinimumMaximumHeights(EllipseGeometry.computeRectangle(r,scratchRectangle$3)).minimumTerrainHeight),r.extrudedHeight=o};var defaultMaterial$1=new ColorMaterialProperty(Color.WHITE),defaultOffset$5=Cartesian3.ZERO,offsetScratch$5=new Cartesian3,radiiScratch=new Cartesian3,innerRadiiScratch=new Cartesian3,scratchColor$a=new Color,unitSphere=new Cartesian3(1,1,1);function EllipsoidGeometryOptions(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 EllipsoidGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new EllipsoidGeometryOptions(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function DynamicEllipsoidGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i),this._scene=e._scene,this._modelMatrix=new Matrix4,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 Cartesian3,this._material={}}defined(Object.create)&&(EllipsoidGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),EllipsoidGeometryUpdater.prototype.constructor=EllipsoidGeometryUpdater),Object.defineProperties(EllipsoidGeometryUpdater.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),EllipsoidGeometryUpdater.prototype.createFillGeometryInstance=function(e,t,i){var r,n=this._entity,a=n.isAvailable(e),o=new ShowGeometryInstanceAttribute(a&&n.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),s={show:o,distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(s),color:void 0,offset:void 0};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||a)&&(r=this._materialProperty.color.getValue(e,scratchColor$a)),defined(r)||(r=Color.WHITE),r=ColorGeometryInstanceAttribute.fromColor(r),s.color=r),defined(this._options.offsetAttribute)&&(s.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$5,offsetScratch$5))),new GeometryInstance({id:n,geometry:new EllipsoidGeometry(this._options),modelMatrix:t?void 0:n.computeModelMatrixForHeightReference(e,n.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,i),attributes:s})},EllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance=function(e,t,i){var r=this._entity,n=r.isAvailable(e),a=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$a),o=this._distanceDisplayConditionProperty.getValue(e),o={show:new ShowGeometryInstanceAttribute(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(a),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(o),offset:void 0};return defined(this._options.offsetAttribute)&&(o.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$5,offsetScratch$5))),new GeometryInstance({id:r,geometry:new EllipsoidOutlineGeometry(this._options),modelMatrix:t?void 0:r.computeModelMatrixForHeightReference(e,r.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,i),attributes:o})},EllipsoidGeometryUpdater.prototype._computeCenter=function(e,t){return Property.getValueOrUndefined(this._entity.position,e,t)},EllipsoidGeometryUpdater.prototype._isHidden=function(e,t){return!defined(e.position)||!defined(t.radii)||GeometryUpdater.prototype._isHidden.call(this,e,t)},EllipsoidGeometryUpdater.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&Property.isConstant(e.orientation)&&t.radii.isConstant&&Property.isConstant(t.innerRadii)&&Property.isConstant(t.stackPartitions)&&Property.isConstant(t.slicePartitions)&&Property.isConstant(t.outlineWidth)&&Property.isConstant(t.minimumClock)&&Property.isConstant(t.maximumClock)&&Property.isConstant(t.minimumCone)&&Property.isConstant(t.maximumCone)&&Property.isConstant(t.subdivisions))},EllipsoidGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,r.radii=t.radii.getValue(Iso8601.MINIMUM_VALUE,r.radii),r.innerRadii=Property.getValueOrUndefined(t.innerRadii,r.radii),r.minimumClock=Property.getValueOrUndefined(t.minimumClock,Iso8601.MINIMUM_VALUE),r.maximumClock=Property.getValueOrUndefined(t.maximumClock,Iso8601.MINIMUM_VALUE),r.minimumCone=Property.getValueOrUndefined(t.minimumCone,Iso8601.MINIMUM_VALUE),r.maximumCone=Property.getValueOrUndefined(t.maximumCone,Iso8601.MINIMUM_VALUE),r.stackPartitions=Property.getValueOrUndefined(t.stackPartitions,Iso8601.MINIMUM_VALUE),r.slicePartitions=Property.getValueOrUndefined(t.slicePartitions,Iso8601.MINIMUM_VALUE),r.subdivisions=Property.getValueOrUndefined(t.subdivisions,Iso8601.MINIMUM_VALUE),r.offsetAttribute=i!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0},EllipsoidGeometryUpdater.prototype._onEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,EllipsoidGeometryUpdater.DynamicGeometryUpdater=DynamicEllipsoidGeometryUpdater,defined(Object.create)&&(DynamicEllipsoidGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicEllipsoidGeometryUpdater.prototype.constructor=DynamicEllipsoidGeometryUpdater),DynamicEllipsoidGeometryUpdater.prototype.update=function(e){var t=this._entity,i=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!Property.getValueOrDefault(i.show,e,!0))return defined(this._primitive)&&(this._primitive.show=!1),void(defined(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var r=Property.getValueOrUndefined(i.radii,e,radiiScratch),n=defined(r)?t.computeModelMatrixForHeightReference(e,i.heightReference,.5*r.z,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!defined(n)||!defined(r))return defined(this._primitive)&&(this._primitive.show=!1),void(defined(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var a=Property.getValueOrDefault(i.fill,e,!0),o=Property.getValueOrDefault(i.outline,e,!1),s=Property.getValueOrClonedDefault(i.outlineColor,e,Color.BLACK,scratchColor$a),l=MaterialProperty.getValue(e,defaultValue(i.material,defaultMaterial$1),this._material),c=Property.getValueOrUndefined(i.innerRadii,e,innerRadiiScratch),u=Property.getValueOrUndefined(i.minimumClock,e),d=Property.getValueOrUndefined(i.maximumClock,e),h=Property.getValueOrUndefined(i.minimumCone,e),p=Property.getValueOrUndefined(i.maximumCone,e),m=Property.getValueOrUndefined(i.stackPartitions,e),f=Property.getValueOrUndefined(i.slicePartitions,e),g=Property.getValueOrUndefined(i.subdivisions,e),_=Property.getValueOrDefault(i.outlineWidth,e,1),y=Property.getValueOrDefault(i.heightReference,e,HeightReference$1.NONE),C=y!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0,v=this._scene.mode,S=v===SceneMode$1.SCENE3D&&y===HeightReference$1.NONE,T=this._options,x=this._geometryUpdater.shadowsProperty.getValue(e),b=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),i=Property.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,defaultOffset$5,offsetScratch$5);!S||this._lastSceneMode!==v||!defined(this._primitive)||T.stackPartitions!==m||T.slicePartitions!==f||defined(c)&&!Cartesian3.equals(T.innerRadii!==c)||T.minimumClock!==u||T.maximumClock!==d||T.minimumCone!==h||T.maximumCone!==p||T.subdivisions!==g||this._lastOutlineWidth!==_||T.offsetAttribute!==C?((y=this._primitives).removeAndDestroy(this._primitive),y.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=v,this._lastOutlineWidth=_,T.stackPartitions=m,T.slicePartitions=f,T.subdivisions=g,T.offsetAttribute=C,T.radii=Cartesian3.clone(S?unitSphere:r,T.radii),defined(c)?S?(C=Cartesian3.magnitude(r),T.innerRadii=Cartesian3.fromElements(c.x/C,c.y/C,c.z/C,T.innerRadii)):T.innerRadii=Cartesian3.clone(c,T.innerRadii):T.innerRadii=void 0,T.minimumClock=u,T.maximumClock=d,T.minimumCone=h,T.maximumCone=p,p=new MaterialAppearance({material:l,translucent:l.isTranslucent(),closed:!0}),T.vertexFormat=p.vertexFormat,T=this._geometryUpdater.createFillGeometryInstance(e,S,this._modelMatrix),this._primitive=y.add(new Primitive({geometryInstances:T,appearance:p,asynchronous:!1,shadows:x})),e=this._geometryUpdater.createOutlineGeometryInstance(e,S,this._modelMatrix),this._outlinePrimitive=y.add(new Primitive({geometryInstances:e,appearance:new PerInstanceColorAppearance({flat:!0,translucent:255!==e.attributes.color.value[3],renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(_)}}),asynchronous:!1,shadows:x})),this._lastShow=a,this._lastOutlineShow=o,this._lastOutlineColor=Color.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=b,this._lastOffset=Cartesian3.clone(i,this._lastOffset)):this._primitive.ready&&(_=this._primitive,x=this._outlinePrimitive,_.show=!0,x.show=!0,_.appearance.material=l,defined(l=this._attributes)||(l=_.getGeometryInstanceAttributes(t),this._attributes=l),a!==this._lastShow&&(l.show=ShowGeometryInstanceAttribute.toValue(a,l.show),this._lastShow=a),defined(a=this._outlineAttributes)||(a=x.getGeometryInstanceAttributes(t),this._outlineAttributes=a),o!==this._lastOutlineShow&&(a.show=ShowGeometryInstanceAttribute.toValue(o,a.show),this._lastOutlineShow=o),Color.equals(s,this._lastOutlineColor)||(a.color=ColorGeometryInstanceAttribute.toValue(s,a.color),Color.clone(s,this._lastOutlineColor)),DistanceDisplayCondition.equals(b,this._lastDistanceDisplayCondition)||(l.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(b,l.distanceDisplayCondition),a.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(b,a.distanceDisplayCondition),DistanceDisplayCondition.clone(b,this._lastDistanceDisplayCondition)),Cartesian3.equals(i,this._lastOffset)||(l.offset=OffsetGeometryInstanceAttribute.toValue(i,l.offset),a.offset=OffsetGeometryInstanceAttribute.toValue(i,l.offset),Cartesian3.clone(i,this._lastOffset))),S&&(r.x=Math.max(r.x,.001),r.y=Math.max(r.y,.001),r.z=Math.max(r.z,.001),n=Matrix4.multiplyByScale(n,r,n),this._primitive.modelMatrix=n,this._outlinePrimitive.modelMatrix=n)};var positionScratch$2=new Cartesian3,scratchColor$9=new Color;function PlaneGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function PlaneGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new PlaneGeometryOptions(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}function DynamicPlaneGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}defined(Object.create)&&(PlaneGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),PlaneGeometryUpdater.prototype.constructor=PlaneGeometryUpdater),PlaneGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),n=this._distanceDisplayConditionProperty.getValue(e),a=DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),n=this._materialProperty instanceof ColorMaterialProperty?(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||i)&&(o=this._materialProperty.color.getValue(e,scratchColor$9)),defined(o)||(o=Color.WHITE),{show:r,distanceDisplayCondition:a,color:ColorGeometryInstanceAttribute.fromColor(o)}):{show:r,distanceDisplayCondition:a},i=t.plane,o=this._options,r=t.computeModelMatrix(e),a=Property.getValueOrDefault(i.plane,e,o.plane),e=Property.getValueOrUndefined(i.dimensions,e,o.dimensions),r=createPrimitiveMatrix(o.plane=a,o.dimensions=e,r,r);return new GeometryInstance({id:t,geometry:new PlaneGeometry(this._options),modelMatrix:r,attributes:n})},PlaneGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$9),n=this._distanceDisplayConditionProperty.getValue(e),a=t.plane,o=this._options,s=t.computeModelMatrix(e),l=Property.getValueOrDefault(a.plane,e,o.plane),a=Property.getValueOrUndefined(a.dimensions,e,o.dimensions),s=createPrimitiveMatrix(o.plane=l,o.dimensions=a,s,s);return new GeometryInstance({id:t,geometry:new PlaneOutlineGeometry,modelMatrix:s,attributes:{show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n)}})},PlaneGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.plane)||!defined(t.dimensions)||!defined(e.position)||GeometryUpdater.prototype._isHidden.call(this,e,t)},PlaneGeometryUpdater.prototype._getIsClosed=function(e){return!1},PlaneGeometryUpdater.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&Property.isConstant(e.orientation)&&t.plane.isConstant&&t.dimensions.isConstant&&Property.isConstant(t.outlineWidth))},PlaneGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof ColorMaterialProperty,r=this._options;r.vertexFormat=i?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,r.plane=t.plane.getValue(Iso8601.MINIMUM_VALUE,r.plane),r.dimensions=t.dimensions.getValue(Iso8601.MINIMUM_VALUE,r.dimensions)},PlaneGeometryUpdater.DynamicGeometryUpdater=DynamicPlaneGeometryUpdater,defined(Object.create)&&(DynamicPlaneGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicPlaneGeometryUpdater.prototype.constructor=DynamicPlaneGeometryUpdater),DynamicPlaneGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(Property.getValueOrUndefined(e.position,i,positionScratch$2))||!defined(r.plane)||!defined(r.dimensions)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DynamicPlaneGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options;r.plane=Property.getValueOrDefault(t.plane,i,r.plane),r.dimensions=Property.getValueOrUndefined(t.dimensions,i,r.dimensions)};var scratchAxis=new Cartesian3,scratchUp$2=new Cartesian3,scratchTranslation$1=new Cartesian3,scratchScale$1=new Cartesian3,scratchRotation$1=new Matrix3,scratchRotationScale=new Matrix3,scratchLocalTransform=new Matrix4;function createPrimitiveMatrix(e,t,i,r){var n=e.normal,a=e.distance,o=Cartesian3.multiplyByScalar(n,-a,scratchTranslation$1),s=Cartesian3.clone(Cartesian3.UNIT_Z,scratchUp$2);CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(s,n)),1,CesiumMath.EPSILON8)&&(s=Cartesian3.clone(Cartesian3.UNIT_Y,s));e=Cartesian3.cross(s,n,scratchAxis),s=Cartesian3.cross(n,e,s);Cartesian3.normalize(e,e),Cartesian3.normalize(s,s);a=scratchRotation$1;Matrix3.setColumn(a,0,e,a),Matrix3.setColumn(a,1,s,a),Matrix3.setColumn(a,2,n,a);t=Cartesian3.fromElements(t.x,t.y,1,scratchScale$1),t=Matrix3.multiplyByScale(a,t,scratchRotationScale),o=Matrix4.fromRotationTranslation(t,o,scratchLocalTransform);return Matrix4.multiplyTransformation(i,o,r)}PlaneGeometryUpdater.createPrimitiveMatrix=createPrimitiveMatrix;var heightAndPerPositionHeightWarning="Entity polygons cannot have both height and perPositionHeight. height will be ignored",heightReferenceAndPerPositionHeightWarning="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",scratchColor$8=new Color,defaultOffset$4=Cartesian3.ZERO,offsetScratch$4=new Cartesian3,scratchRectangle$2=new Rectangle,scratch2DPositions=[],cart2Scratch=new Cartesian2;function PolygonGeometryOptions(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}function PolygonGeometryUpdater(e,t){GroundGeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new PolygonGeometryOptions(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function DyanmicPolygonGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}defined(Object.create)&&(PolygonGeometryUpdater.prototype=Object.create(GroundGeometryUpdater.prototype),PolygonGeometryUpdater.prototype.constructor=PolygonGeometryUpdater),PolygonGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=this._options,a={show:new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$8)),defined(t)||(t=Color.WHITE),a.color=ColorGeometryInstanceAttribute.fromColor(t)),defined(n.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$4,offsetScratch$4))),new GeometryInstance({id:i,geometry:new(n.perPositionHeight&&!defined(n.extrudedHeight)?CoplanarPolygonGeometry:PolygonGeometry)(n),attributes:a})},PolygonGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=this._options,n=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$8),a=this._distanceDisplayConditionProperty.getValue(e),a={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(n),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a),offset:void 0};return defined(r.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$4,offsetScratch$4))),new GeometryInstance({id:t,geometry:new(r.perPositionHeight&&!defined(r.extrudedHeight)?CoplanarPolygonOutlineGeometry:PolygonOutlineGeometry)(r),attributes:a})},PolygonGeometryUpdater.prototype._computeCenter=function(e,t){var i=Property.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(defined(i)){e=i.positions;if(0!==e.length){for(var i=this._scene.mapProjection.ellipsoid,i=EllipsoidTangentPlane.fromPoints(e,i),r=i.projectPointsOntoPlane(e,scratch2DPositions),n=r.length,a=0,o=n-1,s=new Cartesian2,l=0;l<n;o=l++){var c=r[l],u=r[o],d=c.x*u.y-u.x*c.y,u=Cartesian2.add(c,u,cart2Scratch),u=Cartesian2.multiplyByScalar(u,d,u),s=Cartesian2.add(s,u,s);a+=d}return s=Cartesian2.multiplyByScalar(s,1/(3*a),s),i.projectPointOntoEllipsoid(s,t)}}},PolygonGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.hierarchy)||GeometryUpdater.prototype._isHidden.call(this,e,t)},PolygonGeometryUpdater.prototype._isOnTerrain=function(e,t){e=GroundGeometryUpdater.prototype._isOnTerrain.call(this,e,t),t=t.perPositionHeight,t=defined(t)&&(!t.isConstant||t.getValue(Iso8601.MINIMUM_VALUE));return e&&!t},PolygonGeometryUpdater.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!Property.isConstant(t.height)||!Property.isConstant(t.extrudedHeight)||!Property.isConstant(t.granularity)||!Property.isConstant(t.stRotation)||!Property.isConstant(t.outlineWidth)||!Property.isConstant(t.perPositionHeight)||!Property.isConstant(t.closeTop)||!Property.isConstant(t.closeBottom)||!Property.isConstant(t.zIndex)||!Property.isConstant(t.arcType)||this._onTerrain&&!Property.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ColorMaterialProperty)},PolygonGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof ColorMaterialProperty,r=this._options;r.vertexFormat=i?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;var n,a=t.hierarchy.getValue(Iso8601.MINIMUM_VALUE),o=Property.getValueOrUndefined(t.height,Iso8601.MINIMUM_VALUE),s=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),l=Property.getValueOrUndefined(t.extrudedHeight,Iso8601.MINIMUM_VALUE),c=Property.getValueOrDefault(t.extrudedHeightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),i=Property.getValueOrDefault(t.perPositionHeight,Iso8601.MINIMUM_VALUE,!1),o=GroundGeometryUpdater.getGeometryHeight(o,s);i?(defined(o)&&(o=void 0,oneTimeWarning(heightAndPerPositionHeightWarning)),s!==HeightReference$1.NONE&&i&&(o=void 0,oneTimeWarning(heightReferenceAndPerPositionHeightWarning))):(defined(l)&&!defined(o)&&(o=0),n=GroundGeometryUpdater.computeGeometryOffsetAttribute(o,s,l,c)),r.polygonHierarchy=a,r.granularity=Property.getValueOrUndefined(t.granularity,Iso8601.MINIMUM_VALUE),r.stRotation=Property.getValueOrUndefined(t.stRotation,Iso8601.MINIMUM_VALUE),r.perPositionHeight=i,r.closeTop=Property.getValueOrDefault(t.closeTop,Iso8601.MINIMUM_VALUE,!0),r.closeBottom=Property.getValueOrDefault(t.closeBottom,Iso8601.MINIMUM_VALUE,!0),r.offsetAttribute=n,r.height=o,r.arcType=Property.getValueOrDefault(t.arcType,Iso8601.MINIMUM_VALUE,ArcType$1.GEODESIC),(l=GroundGeometryUpdater.getGeometryExtrudedHeight(l,c))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(l=ApproximateTerrainHeights.getMinimumMaximumHeights(PolygonGeometry.computeRectangle(r,scratchRectangle$2)).minimumTerrainHeight),r.extrudedHeight=l},PolygonGeometryUpdater.prototype._getIsClosed=function(e){var t=e.height,i=e.extrudedHeight,i=defined(i)&&i!==t;return!e.perPositionHeight&&(!i&&0===t||i&&e.closeTop&&e.closeBottom)},PolygonGeometryUpdater.DynamicGeometryUpdater=DyanmicPolygonGeometryUpdater,defined(Object.create)&&(DyanmicPolygonGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DyanmicPolygonGeometryUpdater.prototype.constructor=DyanmicPolygonGeometryUpdater),DyanmicPolygonGeometryUpdater.prototype._isHidden=function(e,t,i){return!defined(this._options.polygonHierarchy)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DyanmicPolygonGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options;r.polygonHierarchy=Property.getValueOrUndefined(t.hierarchy,i);var n,a=Property.getValueOrUndefined(t.height,i),o=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),s=Property.getValueOrDefault(t.extrudedHeightReference,i,HeightReference$1.NONE),l=Property.getValueOrUndefined(t.extrudedHeight,i),c=Property.getValueOrUndefined(t.perPositionHeight,i),a=GroundGeometryUpdater.getGeometryHeight(a,s);c?(defined(a)&&(a=void 0,oneTimeWarning(heightAndPerPositionHeightWarning)),o!==HeightReference$1.NONE&&c&&(a=void 0,oneTimeWarning(heightReferenceAndPerPositionHeightWarning))):(defined(l)&&!defined(a)&&(a=0),n=GroundGeometryUpdater.computeGeometryOffsetAttribute(a,o,l,s)),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.stRotation=Property.getValueOrUndefined(t.stRotation,i),r.perPositionHeight=Property.getValueOrUndefined(t.perPositionHeight,i),r.closeTop=Property.getValueOrDefault(t.closeTop,i,!0),r.closeBottom=Property.getValueOrDefault(t.closeBottom,i,!0),r.offsetAttribute=n,r.height=a,r.arcType=Property.getValueOrDefault(t.arcType,i,ArcType$1.GEODESIC),(l=GroundGeometryUpdater.getGeometryExtrudedHeight(l,s))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(l=ApproximateTerrainHeights.getMinimumMaximumHeights(PolygonGeometry.computeRectangle(r,scratchRectangle$2)).minimumTerrainHeight),r.extrudedHeight=l};var scratchColor$7=new Color;function PolylineVolumeGeometryOptions(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 PolylineVolumeGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new PolylineVolumeGeometryOptions(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function DynamicPolylineVolumeGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}defined(Object.create)&&(PolylineVolumeGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),PolylineVolumeGeometryUpdater.prototype.constructor=PolylineVolumeGeometryUpdater),PolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),a=DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a),a=this._materialProperty instanceof ColorMaterialProperty?(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$7)),defined(t)||(t=Color.WHITE),{show:n,distanceDisplayCondition:a,color:ColorGeometryInstanceAttribute.fromColor(t)}):{show:n,distanceDisplayCondition:a};return new GeometryInstance({id:i,geometry:new PolylineVolumeGeometry(this._options),attributes:a})},PolylineVolumeGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$7),n=this._distanceDisplayConditionProperty.getValue(e);return new GeometryInstance({id:t,geometry:new PolylineVolumeOutlineGeometry(this._options),attributes:{show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n)}})},PolylineVolumeGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.positions)||!defined(t.shape)||GeometryUpdater.prototype._isHidden.call(this,e,t)},PolylineVolumeGeometryUpdater.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&t.shape.isConstant&&Property.isConstant(t.granularity)&&Property.isConstant(t.outlineWidth)&&Property.isConstant(t.cornerType))},PolylineVolumeGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=t.granularity,r=t.cornerType,n=this._options,a=this._materialProperty instanceof ColorMaterialProperty;n.vertexFormat=a?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,n.polylinePositions=t.positions.getValue(Iso8601.MINIMUM_VALUE,n.polylinePositions),n.shapePositions=t.shape.getValue(Iso8601.MINIMUM_VALUE,n.shape),n.granularity=defined(i)?i.getValue(Iso8601.MINIMUM_VALUE):void 0,n.cornerType=defined(r)?r.getValue(Iso8601.MINIMUM_VALUE):void 0},PolylineVolumeGeometryUpdater.DynamicGeometryUpdater=DynamicPolylineVolumeGeometryUpdater,defined(Object.create)&&(DynamicPolylineVolumeGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicPolylineVolumeGeometryUpdater.prototype.constructor=DynamicPolylineVolumeGeometryUpdater),DynamicPolylineVolumeGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(r.polylinePositions)||!defined(r.shapePositions)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DynamicPolylineVolumeGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options;r.polylinePositions=Property.getValueOrUndefined(t.positions,i,r.polylinePositions),r.shapePositions=Property.getValueOrUndefined(t.shape,i),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.cornerType=Property.getValueOrUndefined(t.cornerType,i)};var scratchColor$6=new Color,defaultOffset$3=Cartesian3.ZERO,offsetScratch$3=new Cartesian3,scratchRectangle$1=new Rectangle,scratchCenterRect=new Rectangle,scratchCarto=new Cartographic;function RectangleGeometryOptions(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 RectangleGeometryUpdater(e,t){GroundGeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new RectangleGeometryOptions(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function DynamicRectangleGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}defined(Object.create)&&(RectangleGeometryUpdater.prototype=Object.create(GroundGeometryUpdater.prototype),RectangleGeometryUpdater.prototype.constructor=RectangleGeometryUpdater),RectangleGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n={show:new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$6)),defined(t)||(t=Color.WHITE),n.color=ColorGeometryInstanceAttribute.fromColor(t)),defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$3,offsetScratch$3))),new GeometryInstance({id:i,geometry:new RectangleGeometry(this._options),attributes:n})},RectangleGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$6),n=this._distanceDisplayConditionProperty.getValue(e),n={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),offset:void 0};return defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$3,offsetScratch$3))),new GeometryInstance({id:t,geometry:new RectangleOutlineGeometry(this._options),attributes:n})},RectangleGeometryUpdater.prototype._computeCenter=function(e,t){e=Property.getValueOrUndefined(this._entity.rectangle.coordinates,e,scratchCenterRect);if(defined(e)){e=Rectangle.center(e,scratchCarto);return Cartographic.toCartesian(e,Ellipsoid.WGS84,t)}},RectangleGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.coordinates)||GeometryUpdater.prototype._isHidden.call(this,e,t)},RectangleGeometryUpdater.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!Property.isConstant(t.height)||!Property.isConstant(t.extrudedHeight)||!Property.isConstant(t.granularity)||!Property.isConstant(t.stRotation)||!Property.isConstant(t.rotation)||!Property.isConstant(t.outlineWidth)||!Property.isConstant(t.zIndex)||this._onTerrain&&!Property.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ColorMaterialProperty)},RectangleGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof ColorMaterialProperty,r=Property.getValueOrUndefined(t.height,Iso8601.MINIMUM_VALUE),n=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),a=Property.getValueOrUndefined(t.extrudedHeight,Iso8601.MINIMUM_VALUE),o=Property.getValueOrDefault(t.extrudedHeightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE);defined(a)&&!defined(r)&&(r=0);var s=this._options;s.vertexFormat=i?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(Iso8601.MINIMUM_VALUE,s.rectangle),s.granularity=Property.getValueOrUndefined(t.granularity,Iso8601.MINIMUM_VALUE),s.stRotation=Property.getValueOrUndefined(t.stRotation,Iso8601.MINIMUM_VALUE),s.rotation=Property.getValueOrUndefined(t.rotation,Iso8601.MINIMUM_VALUE),s.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(r,n,a,o),s.height=GroundGeometryUpdater.getGeometryHeight(r,n),(a=GroundGeometryUpdater.getGeometryExtrudedHeight(a,o))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(a=ApproximateTerrainHeights.getMinimumMaximumHeights(RectangleGeometry.computeRectangle(s,scratchRectangle$1)).minimumTerrainHeight),s.extrudedHeight=a},RectangleGeometryUpdater.DynamicGeometryUpdater=DynamicRectangleGeometryUpdater,defined(Object.create)&&(DynamicRectangleGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicRectangleGeometryUpdater.prototype.constructor=DynamicRectangleGeometryUpdater),DynamicRectangleGeometryUpdater.prototype._isHidden=function(e,t,i){return!defined(this._options.rectangle)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DynamicRectangleGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options,n=Property.getValueOrUndefined(t.height,i),a=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),o=Property.getValueOrUndefined(t.extrudedHeight,i),s=Property.getValueOrDefault(t.extrudedHeightReference,i,HeightReference$1.NONE);defined(o)&&!defined(n)&&(n=0),r.rectangle=Property.getValueOrUndefined(t.coordinates,i,r.rectangle),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.stRotation=Property.getValueOrUndefined(t.stRotation,i),r.rotation=Property.getValueOrUndefined(t.rotation,i),r.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(n,a,o,s),r.height=GroundGeometryUpdater.getGeometryHeight(n,a),(o=GroundGeometryUpdater.getGeometryExtrudedHeight(o,s))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(o=ApproximateTerrainHeights.getMinimumMaximumHeights(RectangleGeometry.computeRectangle(r,scratchRectangle$1)).minimumTerrainHeight),r.extrudedHeight=o};var colorScratch$5=new Color,distanceDisplayConditionScratch$7=new DistanceDisplayCondition,defaultDistanceDisplayCondition$6=new DistanceDisplayCondition,defaultOffset$2=Cartesian3.ZERO,offsetScratch$2=new Cartesian3;function Batch$5(e,t,i,r,n,a,o){var s;this.translucent=t,this.appearanceType=i,this.depthFailAppearanceType=r,this.depthFailMaterialProperty=n,this.depthFailMaterial=void 0,this.closed=a,this.shadows=o,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.updaters=new AssociativeArray,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray,this.itemsToRemove=[],this.invalidated=!1,defined(n)&&(s=n.definitionChanged.addEventListener(Batch$5.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}function StaticGeometryColorBatch(e,t,i,r,n){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=r,this._shadows=n}function removeItem(e,t){for(var i=e.length-1;0<=i;i--){var r=e[i];if(r.remove(t))return 0===r.updaters.length&&(e.splice(i,1),r.destroy()),1}}function moveItems(e,t,i){for(var r=!1,n=t.length,a=0;a<n;++a){var o=t[a],s=o.itemsToRemove,l=s.length;if(0<l)for(a=0;a<l;a++){var c=s[a];o.remove(c),e.add(i,c),r=!0}}return r}function updateItems(e,t,i,r){for(var n=t.length,a=n-1;0<=a;a--){var o=t[a];if(o.invalidated){t.splice(a,1);for(var s=o.updaters.values,l=s.length,c=0;c<l;c++)e.add(i,s[c]);o.destroy()}}for(n=t.length,a=0;a<n;++a)r=t[a].update(i)&&r;return r}function getBoundingSphere(e,t,i){for(var r=e.length,n=0;n<r;n++){var a=e[n];if(a.contains(t))return a.getBoundingSphere(t,i)}return BoundingSphereState$1.FAILED}function removeAllPrimitives(e){for(var t=e.length,i=0;i<t;i++)e[i].destroy();e.length=0}Batch$5.prototype.onMaterialChanged=function(){this.invalidated=!0},Batch$5.prototype.isMaterial=function(e){var t=this.depthFailMaterialProperty,e=e.depthFailMaterialProperty;return e===t||!!defined(t)&&t.equals(e)},Batch$5.prototype.add=function(n,e){var a,t=n.id;this.createPrimitive=!0,this.geometry.set(t,e),this.updaters.set(t,n),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)&&Property.isConstant(n.terrainOffsetProperty)?(a=this).subscriptions.set(t,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)})):this.updatersWithAttributes.set(t,n)},Batch$5.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);e=this.subscriptions.get(t);return defined(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},Batch$5.prototype.update=function(e){var t=!0,i=0,r=this.primitive,n=this.primitives;if(this.createPrimitive){var a,o=this.geometry.values;0<o.length?(defined(r)&&(defined(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),defined(this.depthFailAppearanceType)&&(defined(this.depthFailMaterialProperty)&&(this.depthFailMaterial=MaterialProperty.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),r=new Primitive({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),n.add(r),t=!1):(defined(r)&&(n.remove(r),r=void 0),defined(a=this.oldPrimitive)&&(n.remove(a),this.oldPrimitive=void 0)),this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(defined(r)&&r.ready){r.show=!0,defined(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0),!defined(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof ColorMaterialProperty||(this.depthFailMaterial=MaterialProperty.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);for(var s=this.updatersWithAttributes.values,l=s.length,c=this.waitingOnCreate,u=0;u<l;u++){var d=s[u],h=this.geometry.get(d.id),p=this.attributes.get(h.id.id);defined(p)||(p=r.getGeometryInstanceAttributes(h.id),this.attributes.set(h.id.id,p)),d.fillMaterialProperty.isConstant&&!c||(h=d.fillMaterialProperty.color,h=Property.getValueOrDefault(h,e,Color.WHITE,colorScratch$5),Color.equals(p._lastColor,h)||(p._lastColor=Color.clone(h,p._lastColor),p.color=ColorGeometryInstanceAttribute.toValue(h,p.color),(this.translucent&&255===p.color[3]||!this.translucent&&255!==p.color[3])&&(this.itemsToRemove[i++]=d))),defined(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof ColorMaterialProperty&&(!d.depthFailMaterialProperty.isConstant||c)&&(m=d.depthFailMaterialProperty.color,m=Property.getValueOrDefault(m,e,Color.WHITE,colorScratch$5),Color.equals(p._lastDepthFailColor,m)||(p._lastDepthFailColor=Color.clone(m,p._lastDepthFailColor),p.depthFailColor=ColorGeometryInstanceAttribute.toValue(m,p.depthFailColor)));var m=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e));m!==(1===p.show[0])&&(p.show=ShowGeometryInstanceAttribute.toValue(m,p.show));m=d.distanceDisplayConditionProperty;Property.isConstant(m)||(m=Property.getValueOrDefault(m,e,defaultDistanceDisplayCondition$6,distanceDisplayConditionScratch$7),DistanceDisplayCondition.equals(m,p._lastDistanceDisplayCondition)||(p._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(m,p._lastDistanceDisplayCondition),p.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(m,p.distanceDisplayCondition)));d=d.terrainOffsetProperty;Property.isConstant(d)||(d=Property.getValueOrDefault(d,e,defaultOffset$2,offsetScratch$2),Cartesian3.equals(d,p._lastOffset)||(p._lastOffset=Cartesian3.clone(d,p._lastOffset),p.offset=OffsetGeometryInstanceAttribute.toValue(d,p.offset)))}this.updateShows(r),this.waitingOnCreate=!1}else defined(r)&&!r.ready&&(t=!1);return this.itemsToRemove.length=i,t},Batch$5.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=this.geometry.get(n.id),o=this.attributes.get(a.id.id);defined(o)||(o=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,o));n=n.entity.isShowing;n!==(1===o.show[0])&&(o.show=ShowGeometryInstanceAttribute.toValue(n,o.show),a.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},Batch$5.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$5.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;e=i.getGeometryInstanceAttributes(e.entity);return!defined(e)||!defined(e.boundingSphere)||defined(e.show)&&0===e.show[0]?BoundingSphereState$1.FAILED:(e.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch$5.prototype.destroy=function(){var e=this.primitive,t=this.primitives;defined(e)&&t.remove(e);e=this.oldPrimitive;defined(e)&&t.remove(e),defined(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},StaticGeometryColorBatch.prototype.add=function(e,t){for(var i,r=t.createFillGeometryInstance(e),e=255===r.attributes.color.value[3]?(i=this._solidItems,!1):(i=this._translucentItems,!0),n=i.length,a=0;a<n;a++){var o=i[a];if(o.isMaterial(t))return void o.add(t,r)}e=new Batch$5(this._primitives,e,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);e.add(t,r),i.push(e)},StaticGeometryColorBatch.prototype.remove=function(e){removeItem(this._solidItems,e)||removeItem(this._translucentItems,e)},StaticGeometryColorBatch.prototype.update=function(e){var t=updateItems(this,this._solidItems,e,!0),t=updateItems(this,this._translucentItems,e,t)&&t,i=moveItems(this,this._solidItems,e),r=moveItems(this,this._translucentItems,e);return(i||r)&&(t=updateItems(this,this._solidItems,e,t)&&t,t=updateItems(this,this._translucentItems,e,t)&&t),t},StaticGeometryColorBatch.prototype.getBoundingSphere=function(e,t){var i=getBoundingSphere(this._solidItems,e,t);return i===BoundingSphereState$1.FAILED?getBoundingSphere(this._translucentItems,e,t):i},StaticGeometryColorBatch.prototype.removeAllPrimitives=function(){removeAllPrimitives(this._solidItems),removeAllPrimitives(this._translucentItems)};var distanceDisplayConditionScratch$6=new DistanceDisplayCondition,defaultDistanceDisplayCondition$5=new DistanceDisplayCondition,defaultOffset$1=Cartesian3.ZERO,offsetScratch$1=new Cartesian3;function Batch$4(e,t,i,r,n,a,o){this.primitives=e,this.appearanceType=t,this.materialProperty=i,this.depthFailAppearanceType=r,this.depthFailMaterialProperty=n,this.closed=a,this.shadows=o,this.updaters=new AssociativeArray,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Batch$4.prototype.onMaterialChanged,this),this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray}Batch$4.prototype.onMaterialChanged=function(){this.invalidated=!0},Batch$4.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty,r=this.depthFailMaterialProperty,e=e.depthFailMaterialProperty;if(i===t&&e===r)return!0;i=defined(t)&&t.equals(i);return i=(!defined(r)&&!defined(e)||defined(r)&&r.equals(e))&&i},Batch$4.prototype.add=function(e,n){var a,t=n.id;this.updaters.set(t,n),this.geometry.set(t,n.createFillGeometryInstance(e)),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)&&Property.isConstant(n.terrainOffsetProperty)?(a=this).subscriptions.set(t,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)})):this.updatersWithAttributes.set(t,n),this.createPrimitive=!0},Batch$4.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);e=this.subscriptions.get(t);return defined(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var colorScratch$4=new Color;function StaticGeometryPerMaterialBatch(e,t,i,r,n){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=r,this._shadows=n}Batch$4.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.primitives,a=this.geometry.values;if(this.createPrimitive)0<a.length?(defined(r)&&(defined(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),defined(this.depthFailMaterialProperty)&&(this.depthFailMaterial=MaterialProperty.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),t=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),r=new Primitive({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:t,shadows:this.shadows}),n.add(r),i=!1):(defined(r)&&(n.remove(r),r=void 0),defined(t=this.oldPrimitive)&&(n.remove(t),this.oldPrimitive=void 0)),this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1;else if(defined(r)&&r.ready){r.show=!0,defined(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,!defined(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof ColorMaterialProperty||(this.depthFailMaterial=MaterialProperty.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);for(var o=this.updatersWithAttributes.values,s=o.length,l=0;l<s;l++){var c=o[l],u=c.entity,d=this.geometry.get(c.id),h=this.attributes.get(d.id.id);defined(h)||(h=r.getGeometryInstanceAttributes(d.id),this.attributes.set(d.id.id,h)),defined(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof ColorMaterialProperty&&!c.depthFailMaterialProperty.isConstant&&(d=c.depthFailMaterialProperty.color,d=Property.getValueOrDefault(d,e,Color.WHITE,colorScratch$4),Color.equals(h._lastDepthFailColor,d)||(h._lastDepthFailColor=Color.clone(d,h._lastDepthFailColor),h.depthFailColor=ColorGeometryInstanceAttribute.toValue(d,h.depthFailColor)));u=u.isShowing&&(c.hasConstantFill||c.isFilled(e));u!==(1===h.show[0])&&(h.show=ShowGeometryInstanceAttribute.toValue(u,h.show));u=c.distanceDisplayConditionProperty;Property.isConstant(u)||(u=Property.getValueOrDefault(u,e,defaultDistanceDisplayCondition$5,distanceDisplayConditionScratch$6),DistanceDisplayCondition.equals(u,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(u,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(u,h.distanceDisplayCondition)));c=c.terrainOffsetProperty;Property.isConstant(c)||(c=Property.getValueOrDefault(c,e,defaultOffset$1,offsetScratch$1),Cartesian3.equals(c,h._lastOffset)||(h._lastOffset=Cartesian3.clone(c,h._lastOffset),h.offset=OffsetGeometryInstanceAttribute.toValue(c,h.offset)))}this.updateShows(r)}else defined(r)&&!r.ready&&(i=!1);return i},Batch$4.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=n.entity,o=this.geometry.get(n.id),n=this.attributes.get(o.id.id);defined(n)||(n=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,n));a=a.isShowing;a!==(1===n.show[0])&&(n.show=ShowGeometryInstanceAttribute.toValue(a,n.show),o.attributes.show.value[0]=n.show[0])}this.showsUpdated.removeAll()},Batch$4.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$4.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;e=i.getGeometryInstanceAttributes(e.entity);return!defined(e)||!defined(e.boundingSphere)||defined(e.show)&&0===e.show[0]?BoundingSphereState$1.FAILED:(e.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch$4.prototype.destroy=function(){var e=this.primitive,t=this.primitives;defined(e)&&t.remove(e);e=this.oldPrimitive;defined(e)&&t.remove(e),this.removeMaterialSubscription()},StaticGeometryPerMaterialBatch.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var a=i[n];if(a.isMaterial(t))return void a.add(e,t)}var o=new Batch$4(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),i.push(o)},StaticGeometryPerMaterialBatch.prototype.remove=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},StaticGeometryPerMaterialBatch.prototype.update=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.invalidated){t.splice(i,1);for(var n=r.updaters.values,a=n.length,o=0;o<a;o++)this.add(e,n[o]);r.destroy()}}var s=!0;for(i=0;i<t.length;i++)s=t[i].update(e)&&s;return s},StaticGeometryPerMaterialBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticGeometryPerMaterialBatch.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var colorScratch$3=new Color,distanceDisplayConditionScratch$5=new DistanceDisplayCondition,defaultDistanceDisplayCondition$4=new DistanceDisplayCondition;function Batch$3(e,t,i,r){this.primitives=e,this.zIndex=r,this.classificationType=t,this.color=i,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.updaters=new AssociativeArray,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new RectangleCollisionChecker}function StaticGroundGeometryColorBatch(e,t){this._batches=[],this._primitives=e,this._classificationType=t}Batch$3.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},Batch$3.prototype.add=function(n,e){var a,t=n.id;this.createPrimitive=!0,this.geometry.set(t,e),this.updaters.set(t,n),this.rectangleCollisionCheck.insert(t,e.geometry.rectangle),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)?(a=this).subscriptions.set(t,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)})):this.updatersWithAttributes.set(t,n)},Batch$3.prototype.remove=function(e){var t=e.id,e=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,e.geometry.rectangle),this.updatersWithAttributes.remove(t);e=this.subscriptions.get(t);return defined(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},Batch$3.prototype.update=function(e){var t=!0,i=this.primitive,r=this.primitives;if(this.createPrimitive){var n=this.geometry.values;0<n.length?(defined(i)&&(defined(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new GroundPrimitive({show:!1,asynchronous:!0,geometryInstances:n.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1):(defined(i)&&(r.remove(i),i=void 0),defined(n=this.oldPrimitive)&&(r.remove(n),this.oldPrimitive=void 0)),this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(defined(i)&&i.ready){i.show=!0,defined(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);for(var a=this.updatersWithAttributes.values,o=a.length,s=this.waitingOnCreate,l=0;l<o;l++){var c=a[l],u=this.geometry.get(c.id),d=this.attributes.get(u.id.id);defined(d)||(d=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,d)),c.fillMaterialProperty.isConstant&&!s||(h=c.fillMaterialProperty.color,h=Property.getValueOrDefault(h,e,Color.WHITE,colorScratch$3),Color.equals(d._lastColor,h)||(d._lastColor=Color.clone(h,d._lastColor),d.color=ColorGeometryInstanceAttribute.toValue(h,d.color)));var h=c.entity.isShowing&&(c.hasConstantFill||c.isFilled(e));h!==(1===d.show[0])&&(d.show=ShowGeometryInstanceAttribute.toValue(h,d.show));c=c.distanceDisplayConditionProperty;Property.isConstant(c)||(c=Property.getValueOrDefault(c,e,defaultDistanceDisplayCondition$4,distanceDisplayConditionScratch$5),DistanceDisplayCondition.equals(c,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(c,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(c,d.distanceDisplayCondition)))}this.updateShows(i),this.waitingOnCreate=!1}else defined(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=0,t},Batch$3.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=this.geometry.get(n.id),o=this.attributes.get(a.id.id);defined(o)||(o=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,o));n=n.entity.isShowing;n!==(1===o.show[0])&&(o.show=ShowGeometryInstanceAttribute.toValue(n,o.show),a.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},Batch$3.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$3.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;e=i.getBoundingSphere(e.entity);return defined(e)?(e.clone(t),BoundingSphereState$1.DONE):BoundingSphereState$1.FAILED},Batch$3.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;defined(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());t=this.oldPrimitive;defined(t)&&(e.remove(t),this.oldPrimitive=void 0)},StaticGroundGeometryColorBatch.prototype.add=function(e,t){for(var i,r=t.createFillGeometryInstance(e),n=this._batches,a=Property.getValueOrDefault(t.zIndex,0),o=n.length,s=0;s<o;++s){var l=n[s];if(l.zIndex===a&&!l.overlapping(r.geometry.rectangle)){i=l;break}}return defined(i)||(i=new Batch$3(this._primitives,this._classificationType,r.attributes.color.value,a),n.push(i)),i.add(t,r),i},StaticGroundGeometryColorBatch.prototype.remove=function(e){for(var t=this._batches,i=t.length,r=0;r<i;++r)if(t[r].remove(e))return},StaticGroundGeometryColorBatch.prototype.update=function(e){for(var t=!0,i=this._batches,r=i.length,n=0;n<r;++n)t=i[n].update(e)&&t;for(n=0;n<r;++n)for(var a=i[n],o=a.itemsToRemove,s=o.length,l=0;l<s;l++){c=o[l],a.remove(c);var c=this.add(e,c);a.isDirty=!0,c.isDirty=!0}for(n=r-1;0<=n;--n){var u=i[n];u.isDirty&&(t=i[n].update(e)&&t,u.isDirty=!1),0===u.geometry.length&&i.splice(n,1)}return t},StaticGroundGeometryColorBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._batches,r=i.length,n=0;n<r;++n){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticGroundGeometryColorBatch.prototype.removeAllPrimitives=function(){for(var e=this._batches,t=e.length,i=0;i<t;++i)e[i].removeAllPrimitives()};var distanceDisplayConditionScratch$4=new DistanceDisplayCondition,defaultDistanceDisplayCondition$3=new DistanceDisplayCondition;function Batch$2(e,t,i,r,n,a){this.primitives=e,this.classificationType=t,this.appearanceType=i,this.materialProperty=r,this.updaters=new AssociativeArray,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.material=void 0,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(Batch$2.prototype.onMaterialChanged,this),this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray,this.usingSphericalTextureCoordinates=n,this.zIndex=a,this.rectangleCollisionCheck=new RectangleCollisionChecker}function StaticGroundGeometryPerMaterialBatch(e,t,i){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=i}Batch$2.prototype.onMaterialChanged=function(){this.invalidated=!0},Batch$2.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},Batch$2.prototype.isMaterial=function(e){var t=this.materialProperty,e=e.fillMaterialProperty;return e===t||e instanceof ColorMaterialProperty&&t instanceof ColorMaterialProperty||defined(t)&&t.equals(e)},Batch$2.prototype.add=function(e,n,t){var a,i=n.id;this.updaters.set(i,n),this.geometry.set(i,t),this.rectangleCollisionCheck.insert(i,t.geometry.rectangle),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)?(a=this).subscriptions.set(i,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)})):this.updatersWithAttributes.set(i,n),this.createPrimitive=!0},Batch$2.prototype.remove=function(e){var t=e.id,e=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,e.geometry.rectangle),this.updatersWithAttributes.remove(t);e=this.subscriptions.get(t);return defined(e)&&(e(),this.subscriptions.remove(t)),!0}return!1},Batch$2.prototype.update=function(e){var t=!0,i=this.primitive,r=this.primitives,n=this.geometry.values;if(this.createPrimitive)0<n.length?(defined(i)&&(defined(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),i=new GroundPrimitive({show:!1,asynchronous:!0,geometryInstances:n.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1):(defined(i)&&(r.remove(i),i=void 0),defined(n=this.oldPrimitive)&&(r.remove(n),this.oldPrimitive=void 0)),this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1;else if(defined(i)&&i.ready){i.show=!0,defined(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;for(var a=this.updatersWithAttributes.values,o=a.length,s=0;s<o;s++){var l=a[s],c=l.entity,u=this.geometry.get(l.id),d=this.attributes.get(u.id.id);defined(d)||(d=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,d));c=c.isShowing&&(l.hasConstantFill||l.isFilled(e));c!==(1===d.show[0])&&(d.show=ShowGeometryInstanceAttribute.toValue(c,d.show));l=l.distanceDisplayConditionProperty;Property.isConstant(l)||(l=Property.getValueOrDefault(l,e,defaultDistanceDisplayCondition$3,distanceDisplayConditionScratch$4),DistanceDisplayCondition.equals(l,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(l,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(l,d.distanceDisplayCondition)))}this.updateShows(i)}else defined(i)&&!i.ready&&(t=!1);return t},Batch$2.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=n.entity,o=this.geometry.get(n.id),n=this.attributes.get(o.id.id);defined(n)||(n=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,n));a=a.isShowing;a!==(1===n.show[0])&&(n.show=ShowGeometryInstanceAttribute.toValue(a,n.show),o.attributes.show.value[0]=n.show[0])}this.showsUpdated.removeAll()},Batch$2.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$2.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;e=i.getGeometryInstanceAttributes(e.entity);return!defined(e)||!defined(e.boundingSphere)||defined(e.show)&&0===e.show[0]?BoundingSphereState$1.FAILED:(e.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch$2.prototype.destroy=function(){var e=this.primitive,t=this.primitives;defined(e)&&t.remove(e);e=this.oldPrimitive;defined(e)&&t.remove(e),this.removeMaterialSubscription()},StaticGroundGeometryPerMaterialBatch.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=t.createFillGeometryInstance(e),a=ShadowVolumeAppearance.shouldUseSphericalCoordinates(n.geometry.rectangle),o=Property.getValueOrDefault(t.zIndex,0),s=0;s<r;++s){var l=i[s];if(l.isMaterial(t)&&l.usingSphericalTextureCoordinates===a&&l.zIndex===o&&!l.overlapping(n.geometry.rectangle))return void l.add(e,t,n)}var c=new Batch$2(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,a,o);c.add(e,t,n),i.push(c)},StaticGroundGeometryPerMaterialBatch.prototype.remove=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},StaticGroundGeometryPerMaterialBatch.prototype.update=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.invalidated){t.splice(i,1);for(var n=r.updaters.values,a=n.length,o=0;o<a;o++)this.add(e,n[o]);r.destroy()}}var s=!0;for(i=0;i<t.length;i++)s=t[i].update(e)&&s;return s},StaticGroundGeometryPerMaterialBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticGroundGeometryPerMaterialBatch.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var colorScratch$2=new Color,distanceDisplayConditionScratch$3=new DistanceDisplayCondition,defaultDistanceDisplayCondition$2=new DistanceDisplayCondition,defaultOffset=Cartesian3.ZERO,offsetScratch=new Cartesian3;function Batch$1(e,t,i,r){this.translucent=t,this.width=i,this.shadows=r,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.updaters=new AssociativeArray,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.itemsToRemove=[],this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray}function StaticOutlineGeometryBatch(e,t,i){this._primitives=e,this._scene=t,this._shadows=i,this._solidBatches=new AssociativeArray,this._translucentBatches=new AssociativeArray}Batch$1.prototype.add=function(n,e){var a,t=n.id;this.createPrimitive=!0,this.geometry.set(t,e),this.updaters.set(t,n),n.hasConstantOutline&&n.outlineColorProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)&&Property.isConstant(n.terrainOffsetProperty)?(a=this).subscriptions.set(t,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)})):this.updatersWithAttributes.set(t,n)},Batch$1.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);e=this.subscriptions.get(t);return defined(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},Batch$1.prototype.update=function(e){var t=!0,i=0,r=this.primitive,n=this.primitives;if(this.createPrimitive){var a=this.geometry.values;0<a.length?(defined(r)&&(defined(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),r=new Primitive({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new PerInstanceColorAppearance({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),n.add(r),t=!1):(defined(r)&&(n.remove(r),r=void 0),defined(a=this.oldPrimitive)&&(n.remove(a),this.oldPrimitive=void 0)),this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(defined(r)&&r.ready){r.show=!0,defined(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0);for(var o=this.updatersWithAttributes.values,s=o.length,l=this.waitingOnCreate,c=0;c<s;c++){var u=o[c],d=this.geometry.get(u.id),h=this.attributes.get(d.id.id);defined(h)||(h=r.getGeometryInstanceAttributes(d.id),this.attributes.set(d.id.id,h)),u.outlineColorProperty.isConstant&&!l||(p=u.outlineColorProperty,p=Property.getValueOrDefault(p,e,Color.WHITE,colorScratch$2),Color.equals(h._lastColor,p)||(h._lastColor=Color.clone(p,h._lastColor),h.color=ColorGeometryInstanceAttribute.toValue(p,h.color),(this.translucent&&255===h.color[3]||!this.translucent&&255!==h.color[3])&&(this.itemsToRemove[i++]=u)));var p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e));p!==(1===h.show[0])&&(h.show=ShowGeometryInstanceAttribute.toValue(p,h.show));p=u.distanceDisplayConditionProperty;Property.isConstant(p)||(p=Property.getValueOrDefault(p,e,defaultDistanceDisplayCondition$2,distanceDisplayConditionScratch$3),DistanceDisplayCondition.equals(p,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(p,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(p,h.distanceDisplayCondition)));u=u.terrainOffsetProperty;Property.isConstant(u)||(u=Property.getValueOrDefault(u,e,defaultOffset,offsetScratch),Cartesian3.equals(u,h._lastOffset)||(h._lastOffset=Cartesian3.clone(u,h._lastOffset),h.offset=OffsetGeometryInstanceAttribute.toValue(u,h.offset)))}this.updateShows(r),this.waitingOnCreate=!1}else defined(r)&&!r.ready&&(t=!1);return this.itemsToRemove.length=i,t},Batch$1.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=this.geometry.get(n.id),o=this.attributes.get(a.id.id);defined(o)||(o=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,o));n=n.entity.isShowing;n!==(1===o.show[0])&&(o.show=ShowGeometryInstanceAttribute.toValue(n,o.show),a.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},Batch$1.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$1.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;e=i.getGeometryInstanceAttributes(e.entity);return!defined(e)||!defined(e.boundingSphere)||defined(e.show)&&0===e.show[0]?BoundingSphereState$1.FAILED:(e.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch$1.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;defined(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());t=this.oldPrimitive;defined(t)&&(e.remove(t),this.oldPrimitive=void 0)},StaticOutlineGeometryBatch.prototype.add=function(e,t){var i,r,n=t.createOutlineGeometryInstance(e),e=this._scene.clampLineWidth(t.outlineWidth);255===n.attributes.color.value[3]?defined(r=(i=this._solidBatches).get(e))||(r=new Batch$1(this._primitives,!1,e,this._shadows),i.set(e,r)):defined(r=(i=this._translucentBatches).get(e))||(r=new Batch$1(this._primitives,!0,e,this._shadows),i.set(e,r)),r.add(t,n)},StaticOutlineGeometryBatch.prototype.remove=function(e){for(var t=this._solidBatches.values,i=t.length,r=0;r<i;r++)if(t[r].remove(e))return;var n=this._translucentBatches.values,a=n.length;for(r=0;r<a;r++)if(n[r].remove(e))return},StaticOutlineGeometryBatch.prototype.update=function(e){var t,i,r,n=this._solidBatches.values,a=n.length,o=this._translucentBatches.values,s=o.length,l=!0,c=!1;do{for(c=!1,i=0;i<a;i++){var u,d,l=(u=n[i]).update(e),h=(d=u.itemsToRemove).length;if(0<h)for(c=!0,t=0;t<h;t++)r=d[t],u.remove(r),this.add(e,r)}for(i=0;i<s;i++){l=(u=o[i]).update(e);var p=(d=u.itemsToRemove).length;if(0<p)for(c=!0,t=0;t<p;t++)r=d[t],u.remove(r),this.add(e,r)}}while(c);return l},StaticOutlineGeometryBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._solidBatches.values,r=i.length,n=0;n<r;n++){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}var o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){var l=o[n];if(l.contains(e))return l.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticOutlineGeometryBatch.prototype.removeAllPrimitives=function(){for(var e=this._solidBatches.values,t=e.length,i=0;i<t;i++)e[i].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(i=0;i<n;i++)r[i].removeAllPrimitives()};var scratchColor$5=new Color;function WallGeometryOptions(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 WallGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new WallGeometryOptions(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function DynamicWallGeometryUpdater(e,t,i){DynamicGeometryUpdater$1.call(this,e,t,i)}defined(Object.create)&&(WallGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),WallGeometryUpdater.prototype.constructor=WallGeometryUpdater),WallGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),a=DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a),a=this._materialProperty instanceof ColorMaterialProperty?(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$5)),defined(t)||(t=Color.WHITE),{show:n,distanceDisplayCondition:a,color:ColorGeometryInstanceAttribute.fromColor(t)}):{show:n,distanceDisplayCondition:a};return new GeometryInstance({id:i,geometry:new WallGeometry(this._options),attributes:a})},WallGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$5),n=this._distanceDisplayConditionProperty.getValue(e);return new GeometryInstance({id:t,geometry:new WallOutlineGeometry(this._options),attributes:{show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n)}})},WallGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.positions)||GeometryUpdater.prototype._isHidden.call(this,e,t)},WallGeometryUpdater.prototype._getIsClosed=function(e){return!1},WallGeometryUpdater.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&Property.isConstant(t.minimumHeights)&&Property.isConstant(t.maximumHeights)&&Property.isConstant(t.outlineWidth)&&Property.isConstant(t.granularity))},WallGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=t.minimumHeights,r=t.maximumHeights,n=t.granularity,a=this._materialProperty instanceof ColorMaterialProperty,o=this._options;o.vertexFormat=a?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,o.positions=t.positions.getValue(Iso8601.MINIMUM_VALUE,o.positions),o.minimumHeights=defined(i)?i.getValue(Iso8601.MINIMUM_VALUE,o.minimumHeights):void 0,o.maximumHeights=defined(r)?r.getValue(Iso8601.MINIMUM_VALUE,o.maximumHeights):void 0,o.granularity=defined(n)?n.getValue(Iso8601.MINIMUM_VALUE):void 0},WallGeometryUpdater.DynamicGeometryUpdater=DynamicWallGeometryUpdater,defined(Object.create)&&(DynamicWallGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater$1.prototype),DynamicWallGeometryUpdater.prototype.constructor=DynamicWallGeometryUpdater),DynamicWallGeometryUpdater.prototype._isHidden=function(e,t,i){return!defined(this._options.positions)||DynamicGeometryUpdater$1.prototype._isHidden.call(this,e,t,i)},DynamicWallGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options;r.positions=Property.getValueOrUndefined(t.positions,i,r.positions),r.minimumHeights=Property.getValueOrUndefined(t.minimumHeights,i,r.minimumHeights),r.maximumHeights=Property.getValueOrUndefined(t.maximumHeights,i,r.maximumHeights),r.granularity=Property.getValueOrUndefined(t.granularity,i)};var emptyArray$1=[],geometryUpdaters=[BoxGeometryUpdater,CylinderGeometryUpdater,CorridorGeometryUpdater,EllipseGeometryUpdater,EllipsoidGeometryUpdater,PlaneGeometryUpdater,PolygonGeometryUpdater,PolylineVolumeGeometryUpdater,RectangleGeometryUpdater,WallGeometryUpdater];function GeometryUpdaterSet(e,t){this.entity=e,this.scene=t;var i=new Array(geometryUpdaters.length),r=new Event;function n(e){r.raiseEvent(e)}for(var a=new EventHelper,o=0;o<i.length;o++){var s=new geometryUpdaters[o](e,t);a.add(s.geometryChanged,n),i[o]=s}this.updaters=i,this.geometryChanged=r,this.eventHelper=a,this._removeEntitySubscription=e.definitionChanged.addEventListener(GeometryUpdaterSet.prototype._onEntityPropertyChanged,this)}function GeometryVisualizer(e,t,i,r){i=defaultValue(i,e.primitives),r=defaultValue(r,e.groundPrimitives),this._scene=e,this._primitives=i,this._groundPrimitives=r,this._entityCollection=void 0,this._addedObjects=new AssociativeArray,this._removedObjects=new AssociativeArray,this._changedObjects=new AssociativeArray;var n=ShadowMode$1.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(2*n),this._closedColorBatches=new Array(2*n),this._closedMaterialBatches=new Array(2*n),this._openColorBatches=new Array(2*n),this._openMaterialBatches=new Array(2*n);var a,o=Entity.supportsMaterialsforEntitiesOnTerrain(e);for(this._supportsMaterialsforEntitiesOnTerrain=o,a=0;a<n;++a)this._outlineBatches[a]=new StaticOutlineGeometryBatch(i,e,a,!1),this._outlineBatches[n+a]=new StaticOutlineGeometryBatch(i,e,a,!0),this._closedColorBatches[a]=new StaticGeometryColorBatch(i,PerInstanceColorAppearance,void 0,!0,a,!0),this._closedColorBatches[n+a]=new StaticGeometryColorBatch(i,PerInstanceColorAppearance,void 0,!0,a,!1),this._closedMaterialBatches[a]=new StaticGeometryPerMaterialBatch(i,MaterialAppearance,void 0,!0,a,!0),this._closedMaterialBatches[n+a]=new StaticGeometryPerMaterialBatch(i,MaterialAppearance,void 0,!0,a,!1),this._openColorBatches[a]=new StaticGeometryColorBatch(i,PerInstanceColorAppearance,void 0,!1,a,!0),this._openColorBatches[n+a]=new StaticGeometryColorBatch(i,PerInstanceColorAppearance,void 0,!1,a,!1),this._openMaterialBatches[a]=new StaticGeometryPerMaterialBatch(i,MaterialAppearance,void 0,!1,a,!0),this._openMaterialBatches[n+a]=new StaticGeometryPerMaterialBatch(i,MaterialAppearance,void 0,!1,a,!1);var s=ClassificationType$1.NUMBER_OF_CLASSIFICATION_TYPES,l=new Array(s),c=[];if(o)for(a=0;a<s;++a)c.push(new StaticGroundGeometryPerMaterialBatch(r,a,MaterialAppearance)),l[a]=new StaticGroundGeometryColorBatch(r,a);else for(a=0;a<s;++a)l[a]=new StaticGroundGeometryColorBatch(r,a);this._groundColorBatches=l,this._groundMaterialBatches=c,this._dynamicBatch=new DynamicGeometryBatch(i,r),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new AssociativeArray,this._updaterSets=new AssociativeArray,(this._entityCollection=t).collectionChanged.addEventListener(GeometryVisualizer.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,emptyArray$1)}GeometryUpdaterSet.prototype._onEntityPropertyChanged=function(e,t,i,r){for(var n=this.updaters,a=0;a<n.length;a++)n[a]._onEntityPropertyChanged(e,t,i,r)},GeometryUpdaterSet.prototype.forEach=function(e){for(var t=this.updaters,i=0;i<t.length;i++)e(t[i])},GeometryUpdaterSet.prototype.destroy=function(){this.eventHelper.removeAll();for(var e=this.updaters,t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),destroyObject(this)},GeometryVisualizer.prototype.update=function(t){for(var e,i,r,n=this._addedObjects,a=n.values,o=this._removedObjects,s=o.values,l=this._changedObjects,c=l.values,u=this,d=c.length-1;-1<d;d--)i=(e=c[d]).id,(r=this._updaterSets.get(i)).entity===e?r.forEach(function(e){u._removeUpdater(e),u._insertUpdaterIntoBatch(t,e)}):(s.push(e),a.push(e));for(d=s.length-1;-1<d;d--)i=(e=s[d]).id,(r=this._updaterSets.get(i)).forEach(this._removeUpdater.bind(this)),r.destroy(),this._updaterSets.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);for(d=a.length-1;-1<d;d--)i=(e=a[d]).id,r=new GeometryUpdaterSet(e,this._scene),this._updaterSets.set(i,r),r.forEach(function(e){u._insertUpdaterIntoBatch(t,e)}),this._subscriptions.set(i,r.geometryChanged.addEventListener(GeometryVisualizer._onGeometryChanged,this));n.removeAll(),o.removeAll(),l.removeAll();var h=!0,p=this._batches,m=p.length;for(d=0;d<m;d++)h=p[d].update(t)&&h;return h};var getBoundingSphereArrayScratch$2=[],getBoundingSphereBoundingSphereScratch$2=new BoundingSphere;GeometryVisualizer.prototype.getBoundingSphere=function(e,t){for(var i=getBoundingSphereArrayScratch$2,r=getBoundingSphereBoundingSphereScratch$2,n=0,a=BoundingSphereState$1.DONE,o=this._batches,s=o.length,e=e.id,l=this._updaterSets.get(e).updaters,c=0;c<l.length;c++)for(var u=l[c],d=0;d<s;d++){if((a=o[d].getBoundingSphere(u,r))===BoundingSphereState$1.PENDING)return BoundingSphereState$1.PENDING;a===BoundingSphereState$1.DONE&&(i[n]=BoundingSphere.clone(r,i[n]),n++)}return 0===n?BoundingSphereState$1.FAILED:(i.length=n,BoundingSphere.fromBoundingSpheres(i,t),BoundingSphereState$1.DONE)},GeometryVisualizer.prototype.isDestroyed=function(){return!1},GeometryVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(GeometryVisualizer.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();for(var e=this._batches,t=e.length,i=0;i<t;i++)e[i].removeAllPrimitives();var r=this._subscriptions.values,t=r.length;for(i=0;i<t;i++)r[i]();this._subscriptions.removeAll();var n=this._updaterSets.values;for(t=n.length,i=0;i<t;i++)n[i].destroy();return this._updaterSets.removeAll(),destroyObject(this)},GeometryVisualizer.prototype._removeUpdater=function(e){for(var t=this._batches,i=t.length,r=0;r<i;r++)t[r].remove(e)},GeometryVisualizer.prototype._insertUpdaterIntoBatch=function(e,t){var i,r,n;t.isDynamic?this._dynamicBatch.add(e,t):((t.outlineEnabled||t.fillEnabled)&&(i=t.shadowsProperty.getValue(e)),r=ShadowMode$1.NUMBER_OF_SHADOW_MODES,t.outlineEnabled&&(defined(t.terrainOffsetProperty)?this._outlineBatches[r+i]:this._outlineBatches[i]).add(e,t),t.fillEnabled&&(t.onTerrain?(n=t.classificationTypeProperty.getValue(e),(t.fillMaterialProperty instanceof ColorMaterialProperty?this._groundColorBatches:this._groundMaterialBatches)[n].add(e,t)):(t.isClosed?t.fillMaterialProperty instanceof ColorMaterialProperty?defined(t.terrainOffsetProperty)?this._closedColorBatches[r+i]:this._closedColorBatches[i]:defined(t.terrainOffsetProperty)?this._closedMaterialBatches[r+i]:this._closedMaterialBatches[i]:t.fillMaterialProperty instanceof ColorMaterialProperty?defined(t.terrainOffsetProperty)?this._openColorBatches[r+i]:this._openColorBatches[i]:defined(t.terrainOffsetProperty)?this._openMaterialBatches[r+i]:this._openMaterialBatches[i]).add(e,t)))},GeometryVisualizer._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,r=e.entity,e=r.id;defined(t.get(e))||defined(i.get(e))||i.set(e,r)},GeometryVisualizer.prototype._onCollectionChanged=function(e,t,i){for(var r,n,a=this._addedObjects,o=this._removedObjects,s=this._changedObjects,l=i.length-1;-1<l;l--)r=(n=i[l]).id,a.remove(r)||(o.set(r,n),s.remove(r));for(l=t.length-1;-1<l;l--)r=(n=t[l]).id,(o.remove(r)?s:a).set(r,n)};var defaultScale$1=1,defaultFont="30px sans-serif",defaultStyle=LabelStyle$1.FILL,defaultFillColor=Color.WHITE,defaultOutlineColor$1=Color.BLACK,defaultOutlineWidth$1=1,defaultShowBackground=!1,defaultBackgroundColor$1=new Color(.165,.165,.165,.8),defaultBackgroundPadding=new Cartesian2(7,5),defaultPixelOffset=Cartesian2.ZERO,defaultEyeOffset=Cartesian3.ZERO,defaultHeightReference$1=HeightReference$1.NONE,defaultHorizontalOrigin=HorizontalOrigin$1.CENTER,defaultVerticalOrigin=VerticalOrigin$1.CENTER,positionScratch$1=new Cartesian3,fillColorScratch=new Color,outlineColorScratch$1=new Color,backgroundColorScratch=new Color,backgroundPaddingScratch=new Cartesian2,eyeOffsetScratch=new Cartesian3,pixelOffsetScratch=new Cartesian2,translucencyByDistanceScratch$1=new NearFarScalar,pixelOffsetScaleByDistanceScratch=new NearFarScalar,scaleByDistanceScratch$1=new NearFarScalar,distanceDisplayConditionScratch$2=new DistanceDisplayCondition;function EntityData$2(e){this.entity=e,this.label=void 0,this.index=void 0}function LabelVisualizer(e,t){t.collectionChanged.addEventListener(LabelVisualizer.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function returnPrimitive$1(e,t,i){defined(e)&&(e.label=void 0,i.removeLabel(t))}LabelVisualizer.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,o,s,l=t[r],c=l.entity,u=c._label,d=l.label,h=c.isShowing&&c.isAvailable(e)&&Property.getValueOrDefault(u._show,e,!0);h&&(o=Property.getValueOrUndefined(c._position,e,positionScratch$1),a=Property.getValueOrUndefined(u._text,e),h=defined(o)&&defined(a)),h?(Property.isConstant(c._position)||(i._clusterDirty=!0),s=!1,h=Property.getValueOrDefault(u._heightReference,e,defaultHeightReference$1),defined(d)||((d=i.getLabel(c)).id=c,l.label=d,s=Cartesian3.equals(d.position,o)&&d.heightReference===h),d.show=!0,d.position=o,d.text=a,d.scale=Property.getValueOrDefault(u._scale,e,defaultScale$1),d.font=Property.getValueOrDefault(u._font,e,defaultFont),d.style=Property.getValueOrDefault(u._style,e,defaultStyle),d.fillColor=Property.getValueOrDefault(u._fillColor,e,defaultFillColor,fillColorScratch),d.outlineColor=Property.getValueOrDefault(u._outlineColor,e,defaultOutlineColor$1,outlineColorScratch$1),d.outlineWidth=Property.getValueOrDefault(u._outlineWidth,e,defaultOutlineWidth$1),d.showBackground=Property.getValueOrDefault(u._showBackground,e,defaultShowBackground),d.backgroundColor=Property.getValueOrDefault(u._backgroundColor,e,defaultBackgroundColor$1,backgroundColorScratch),d.backgroundPadding=Property.getValueOrDefault(u._backgroundPadding,e,defaultBackgroundPadding,backgroundPaddingScratch),d.pixelOffset=Property.getValueOrDefault(u._pixelOffset,e,defaultPixelOffset,pixelOffsetScratch),d.eyeOffset=Property.getValueOrDefault(u._eyeOffset,e,defaultEyeOffset,eyeOffsetScratch),d.heightReference=h,d.horizontalOrigin=Property.getValueOrDefault(u._horizontalOrigin,e,defaultHorizontalOrigin),d.verticalOrigin=Property.getValueOrDefault(u._verticalOrigin,e,defaultVerticalOrigin),d.translucencyByDistance=Property.getValueOrUndefined(u._translucencyByDistance,e,translucencyByDistanceScratch$1),d.pixelOffsetScaleByDistance=Property.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,pixelOffsetScaleByDistanceScratch),d.scaleByDistance=Property.getValueOrUndefined(u._scaleByDistance,e,scaleByDistanceScratch$1),d.distanceDisplayCondition=Property.getValueOrUndefined(u._distanceDisplayCondition,e,distanceDisplayConditionScratch$2),d.disableDepthTestDistance=Property.getValueOrUndefined(u._disableDepthTestDistance,e),s&&d._updateClamping()):returnPrimitive$1(l,c,i)}return!0},LabelVisualizer.prototype.getBoundingSphere=function(e,t){e=this._items.get(e.id);if(!defined(e)||!defined(e.label))return BoundingSphereState$1.FAILED;e=e.label;return t.center=Cartesian3.clone(defaultValue(e._clampedPosition,e.position),t.center),t.radius=0,BoundingSphereState$1.DONE},LabelVisualizer.prototype.isDestroyed=function(){return!1},LabelVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(LabelVisualizer.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return destroyObject(this)},LabelVisualizer.prototype._onCollectionChanged=function(e,t,i,r){for(var n,a=this._items,o=this._cluster,s=t.length-1;-1<s;s--)defined((n=t[s])._label)&&defined(n._position)&&a.set(n.id,new EntityData$2(n));for(s=r.length-1;-1<s;s--)defined((n=r[s])._label)&&defined(n._position)?a.contains(n.id)||a.set(n.id,new EntityData$2(n)):(returnPrimitive$1(a.get(n.id),n,o),a.remove(n.id));for(s=i.length-1;-1<s;s--)n=i[s],returnPrimitive$1(a.get(n.id),n,o),a.remove(n.id)};var defaultScale=1,defaultMinimumPixelSize=0,defaultIncrementallyLoadTextures=!0,defaultClampAnimations=!0,defaultShadows$1=ShadowMode$1.ENABLED,defaultHeightReference=HeightReference$1.NONE,defaultSilhouetteColor=Color.RED,defaultSilhouetteSize=0,defaultColor$2=Color.WHITE,defaultColorBlendMode=ColorBlendMode$1.HIGHLIGHT,defaultColorBlendAmount=.5,defaultImageBasedLightingFactor=new Cartesian2(1,1),modelMatrixScratch=new Matrix4,nodeMatrixScratch=new Matrix4;function ModelVisualizer(e,t){t.collectionChanged.addEventListener(ModelVisualizer.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function removeModel(e,t,i,r){var n=i[t.id];defined(n)&&(r.removeAndDestroy(n.modelPrimitive),delete i[t.id])}function clearNodeTransformationsArticulationsScratch(e,t){e=t[e.id];defined(e)&&(e.nodeTransformationsScratch={},e.articulationsScratch={})}function checkModelLoad(e,t,i){e.readyPromise.otherwise(function(e){console.error(e),i[t.id].loadFail=!0})}function ScaledPositionProperty(e){this._definitionChanged=new Event,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}ModelVisualizer.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,i=this._modelHash,r=this._primitives,n=0,a=t.length;n<a;n++){var o,s,l=t[n],c=l._model,u=i[l.id],d=l.isShowing&&l.isAvailable(e)&&Property.getValueOrDefault(c._show,e,!0);if(d&&(s=l.computeModelMatrix(e,modelMatrixScratch),o=Resource.createIfNeeded(Property.getValueOrUndefined(c._uri,e)),d=defined(s)&&defined(o)),d){var h=defined(u)?u.modelPrimitive:void 0;if(defined(h)&&o.url===u.url||(defined(h)&&(r.removeAndDestroy(h),delete i[l.id]),(h=Model.fromGltf({url:o,incrementallyLoadTextures:Property.getValueOrDefault(c._incrementallyLoadTextures,e,defaultIncrementallyLoadTextures),scene:this._scene})).id=l,r.add(h),u={modelPrimitive:h,url:o.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFail:!1},i[l.id]=u,checkModelLoad(h,l,i)),h.show=!0,h.scale=Property.getValueOrDefault(c._scale,e,defaultScale),h.minimumPixelSize=Property.getValueOrDefault(c._minimumPixelSize,e,defaultMinimumPixelSize),h.maximumScale=Property.getValueOrUndefined(c._maximumScale,e),h.modelMatrix=Matrix4.clone(s,h.modelMatrix),h.shadows=Property.getValueOrDefault(c._shadows,e,defaultShadows$1),h.heightReference=Property.getValueOrDefault(c._heightReference,e,defaultHeightReference),h.distanceDisplayCondition=Property.getValueOrUndefined(c._distanceDisplayCondition,e),h.silhouetteColor=Property.getValueOrDefault(c._silhouetteColor,e,defaultSilhouetteColor,h._silhouetteColor),h.silhouetteSize=Property.getValueOrDefault(c._silhouetteSize,e,defaultSilhouetteSize),h.color=Property.getValueOrDefault(c._color,e,defaultColor$2,h._color),h.colorBlendMode=Property.getValueOrDefault(c._colorBlendMode,e,defaultColorBlendMode),h.colorBlendAmount=Property.getValueOrDefault(c._colorBlendAmount,e,defaultColorBlendAmount),h.clippingPlanes=Property.getValueOrUndefined(c._clippingPlanes,e),h.clampAnimations=Property.getValueOrDefault(c._clampAnimations,e,defaultClampAnimations),h.imageBasedLightingFactor=Property.getValueOrDefault(c._imageBasedLightingFactor,e,defaultImageBasedLightingFactor),h.lightColor=Property.getValueOrUndefined(c._lightColor,e),h.ready){l=Property.getValueOrDefault(c._runAnimations,e,!0);u.animationsRunning!==l&&(l?h.activeAnimations.addAll({loop:ModelAnimationLoop$1.REPEAT}):h.activeAnimations.removeAll(),u.animationsRunning=l);var p=Property.getValueOrUndefined(c._nodeTransformations,e,u.nodeTransformationsScratch);if(defined(p))for(var m=Object.keys(p),f=0,g=m.length;f<g;++f){var _=m[f],y=p[_];defined(y)&&(defined(_=h.getNode(_))&&(y=Matrix4.fromTranslationRotationScale(y,nodeMatrixScratch),_.matrix=Matrix4.multiply(_.originalMatrix,y,y)))}var C=!1,v=Property.getValueOrUndefined(c._articulations,e,u.articulationsScratch);if(defined(v))for(var S=Object.keys(v),T=0,x=S.length;T<x;++T){var b=S[T],E=v[b];defined(E)&&(C=!0,h.setArticulationStage(b,E))}C&&h.applyArticulations()}}else defined(u)&&(u.modelPrimitive.show=!1)}return!0},ModelVisualizer.prototype.isDestroyed=function(){return!1},ModelVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ModelVisualizer.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,r=e.length-1;-1<r;r--)removeModel(this,e[r],t,i);return destroyObject(this)},ModelVisualizer.prototype.getBoundingSphere=function(e,t){e=this._modelHash[e.id];if(!defined(e)||e.loadFail)return BoundingSphereState$1.FAILED;e=e.modelPrimitive;if(!defined(e)||!e.show)return BoundingSphereState$1.FAILED;if(!e.ready)return BoundingSphereState$1.PENDING;if(e.heightReference===HeightReference$1.NONE)BoundingSphere.transform(e.boundingSphere,e.modelMatrix,t);else{if(!defined(e._clampedModelMatrix))return BoundingSphereState$1.PENDING;BoundingSphere.transform(e.boundingSphere,e._clampedModelMatrix,t)}return BoundingSphereState$1.DONE},ModelVisualizer.prototype._onCollectionChanged=function(e,t,i,r){for(var n,a=this._entitiesToVisualize,o=this._modelHash,s=this._primitives,l=t.length-1;-1<l;l--)defined((n=t[l])._model)&&defined(n._position)&&a.set(n.id,n);for(l=r.length-1;-1<l;l--)defined((n=r[l])._model)&&defined(n._position)?(clearNodeTransformationsArticulationsScratch(n,o),a.set(n.id,n)):(removeModel(this,n,o,s),a.remove(n.id));for(l=i.length-1;-1<l;l--)removeModel(this,n=i[l],o,s),a.remove(n.id)},Object.defineProperties(ScaledPositionProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return defined(this._value)?this._value.referenceFrame:ReferenceFrame$1.FIXED}}}),ScaledPositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},ScaledPositionProperty.prototype.setValue=function(e){this._value!==e&&(this._value=e,defined(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),defined(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},ScaledPositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){if(defined(this._value))return defined(i=this._value.getValueInReferenceFrame(e,t,i))?Ellipsoid.WGS84.scaleToGeodeticSurface(i,i):void 0},ScaledPositionProperty.prototype.equals=function(e){return this===e||e instanceof ScaledPositionProperty&&this._value===e._value},ScaledPositionProperty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var defaultResolution=60,defaultWidth=1,scratchTimeInterval=new TimeInterval,subSampleCompositePropertyScratch=new TimeInterval,subSampleIntervalPropertyScratch=new TimeInterval;function EntityData$1(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function subSampleSampledProperty(e,t,i,r,n,a,o,s,l){var c=s,u=e.getValueInReferenceFrame(t,a,l[c]);defined(u)&&(l[c++]=u);for(var d,h,p,m,f=!defined(n)||JulianDate.lessThanOrEquals(n,t)||JulianDate.greaterThanOrEquals(n,i),g=0,_=r.length,y=r[g],C=i,v=!1;g<_;){if(!f&&JulianDate.greaterThanOrEquals(y,n)&&(defined(u=e.getValueInReferenceFrame(n,a,l[c]))&&(l[c++]=u),f=!0),JulianDate.greaterThan(y,t)&&JulianDate.lessThan(y,C)&&!y.equals(n)&&defined(u=e.getValueInReferenceFrame(y,a,l[c]))&&(l[c++]=u),g<_-1)if(0<o&&!v&&(m=r[g+1],(v=o<(m=JulianDate.secondsDifference(m,y)))&&(d=Math.ceil(m/o),h=0,p=m/Math.max(d,2),d=Math.max(d-1,1))),v&&h<d){y=JulianDate.addSeconds(y,p,new JulianDate),h++;continue}v=!1,y=r[++g]}return defined(u=e.getValueInReferenceFrame(i,a,l[c]))&&(l[c++]=u),c}function subSampleGenericProperty(e,t,i,r,n,a,o,s){for(var l,c=0,u=o,d=t,h=Math.max(a,60),p=!defined(r)||JulianDate.lessThanOrEquals(r,t)||JulianDate.greaterThanOrEquals(r,i);JulianDate.lessThan(d,i);)!p&&JulianDate.greaterThanOrEquals(d,r)&&(p=!0,defined(l=e.getValueInReferenceFrame(r,n,s[u]))&&(s[u]=l,u++)),defined(l=e.getValueInReferenceFrame(d,n,s[u]))&&(s[u]=l,u++),d=JulianDate.addSeconds(t,h*++c,new JulianDate);return defined(l=e.getValueInReferenceFrame(i,n,s[u]))&&(s[u]=l,u++),u}function subSampleIntervalProperty(e,t,i,r,n,a,o,s){subSampleIntervalPropertyScratch.start=t,subSampleIntervalPropertyScratch.stop=i;for(var l=o,c=e.intervals,u=0;u<c.length;u++){var d,h=c.get(u);TimeInterval.intersect(h,subSampleIntervalPropertyScratch,scratchTimeInterval).isEmpty||(d=h.start,h.isStartIncluded||(d=h.isStopIncluded?h.stop:JulianDate.addSeconds(h.start,JulianDate.secondsDifference(h.stop,h.start)/2,new JulianDate)),defined(d=e.getValueInReferenceFrame(d,n,s[l]))&&(s[l]=d,l++))}return l}function subSampleConstantProperty(e,t,i,r,n,a,o,s){n=e.getValueInReferenceFrame(t,n,s[o]);return defined(n)&&(s[o++]=n),o}function subSampleCompositeProperty(e,t,i,r,n,a,o,s){subSampleCompositePropertyScratch.start=t,subSampleCompositePropertyScratch.stop=i;for(var l=o,c=e.intervals,u=0;u<c.length;u++){var d,h,p,m=c.get(u);TimeInterval.intersect(m,subSampleCompositePropertyScratch,scratchTimeInterval).isEmpty||(p=m.start,d=m.stop,JulianDate.greaterThan(p,h=t)&&(h=p),JulianDate.lessThan(d,p=i)&&(p=d),l=reallySubSample(m.data,h,p,r,n,a,l,s))}return l}function reallySubSample(e,t,i,r,n,a,o,s){for(;e instanceof ReferenceProperty;)e=e.resolvedProperty;return o=e instanceof SampledPositionProperty?subSampleSampledProperty(e,t,i,e._property._times,r,n,a,o,s):(e instanceof CompositePositionProperty?subSampleCompositeProperty:e instanceof TimeIntervalCollectionPositionProperty?subSampleIntervalProperty:e instanceof ConstantPositionProperty||e instanceof ScaledPositionProperty&&Property.isConstant(e)?subSampleConstantProperty:subSampleGenericProperty)(e,t,i,r,n,a,o,s)}function subSample(e,t,i,r,n,a,o){a=reallySubSample(e,t,i,r,n,a,0,o=!defined(o)?[]:o);return o.length=a,o}var toFixedScratch=new Matrix3;function PolylineUpdater(e,t){this._unusedIndexes=[],this._polylineCollection=new PolylineCollection,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function PathVisualizer(e,t){t.collectionChanged.addEventListener(PathVisualizer.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}PolylineUpdater.prototype.update=function(e){var t;this._referenceFrame===ReferenceFrame$1.INERTIAL&&(defined(t=Transforms.computeIcrfToFixedMatrix(e,toFixedScratch))||(t=Transforms.computeTemeToPseudoFixedMatrix(e,toFixedScratch)),Matrix4.fromRotationTranslation(t,Cartesian3.ZERO,this._polylineCollection.modelMatrix))},PolylineUpdater.prototype.updateObject=function(e,t){var i,r,n,a,o,s,l,c=t.entity,u=c._path,d=c._position,h=u._show,p=t.polyline,m=c.isShowing&&(!defined(h)||h.getValue(e));m&&(n=Property.getValueOrUndefined(u._leadTime,e),a=Property.getValueOrUndefined(u._trailTime,e),s=defined(l=c._availability),o=defined(n),h=defined(a),(m=s||o&&h)&&(h&&(i=JulianDate.addSeconds(e,-a,new JulianDate)),o&&(r=JulianDate.addSeconds(e,n,new JulianDate)),s&&(s=l.start,l=l.stop,h&&!JulianDate.greaterThan(s,i)||(i=s),o&&!JulianDate.lessThan(l,r)||(r=l)),m=JulianDate.lessThan(i,r))),m?(defined(p)||(0<(m=this._unusedIndexes).length?(m=m.pop(),p=this._polylineCollection.get(m),t.index=m):(t.index=this._polylineCollection.length,p=this._polylineCollection.add()),p.id=c,t.polyline=p),c=Property.getValueOrDefault(u._resolution,e,defaultResolution),p.show=!0,p.positions=subSample(d,i,r,e,this._referenceFrame,c,p.positions.slice()),p.material=MaterialProperty.getValue(e,u._material,p.material),p.width=Property.getValueOrDefault(u._width,e,defaultWidth),p.distanceDisplayCondition=Property.getValueOrUndefined(u._distanceDisplayCondition,e,p.distanceDisplayCondition)):defined(p)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,p.show=!1,t.index=void 0)},PolylineUpdater.prototype.removeObject=function(e){var t=e.polyline;defined(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},PolylineUpdater.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),destroyObject(this)},PathVisualizer.prototype.update=function(e){var t,i=this._updaters;for(t in i)i.hasOwnProperty(t)&&i[t].update(e);var r=this._items.values;if(0===r.length&&defined(this._updaters)&&0<Object.keys(this._updaters).length){for(var n in i)i.hasOwnProperty(n)&&i[n].destroy();this._updaters={}}for(var a=0,o=r.length;a<o;a++){var s=r[a],l=s.entity._position,c=s.updater,u=ReferenceFrame$1.FIXED;this._scene.mode===SceneMode$1.SCENE3D&&(u=l.referenceFrame);l=this._updaters[u];c===l&&defined(l)?l.updateObject(e,s):(defined(c)&&c.removeObject(s),defined(l)||((l=new PolylineUpdater(this._scene,u)).update(e),this._updaters[u]=l),defined(s.updater=l)&&l.updateObject(e,s))}return!0},PathVisualizer.prototype.isDestroyed=function(){return!1},PathVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(PathVisualizer.prototype._onCollectionChanged,this);var e,t=this._updaters;for(e in t)t.hasOwnProperty(e)&&t[e].destroy();return destroyObject(this)},PathVisualizer.prototype._onCollectionChanged=function(e,t,i,r){for(var n,a,o=this._items,s=t.length-1;-1<s;s--)defined((n=t[s])._path)&&defined(n._position)&&o.set(n.id,new EntityData$1(n));for(s=r.length-1;-1<s;s--)defined((n=r[s])._path)&&defined(n._position)?o.contains(n.id)||o.set(n.id,new EntityData$1(n)):defined(a=o.get(n.id))&&(defined(a.updater)&&a.updater.removeObject(a),o.remove(n.id));for(s=i.length-1;-1<s;s--)n=i[s],defined(a=o.get(n.id))&&(defined(a.updater)&&a.updater.removeObject(a),o.remove(n.id))},PathVisualizer._subSample=subSample;var defaultColor$1=Color.WHITE,defaultOutlineColor=Color.BLACK,defaultOutlineWidth=0,defaultPixelSize=1,defaultDisableDepthTestDistance=0,colorScratch$1=new Color,positionScratch=new Cartesian3,outlineColorScratch=new Color,scaleByDistanceScratch=new NearFarScalar,translucencyByDistanceScratch=new NearFarScalar,distanceDisplayConditionScratch$1=new DistanceDisplayCondition;function EntityData(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 PointVisualizer(e,t){t.collectionChanged.addEventListener(PointVisualizer.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function returnPrimitive(e,t,i){if(defined(e)){if(defined(e.pointPrimitive))return e.pointPrimitive=void 0,void i.removePoint(t);defined(e.billboard)&&(e.billboard=void 0,i.removeBillboard(t))}}PointVisualizer.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,o,s,l,c,u=t[r],d=u.entity,h=d._point,p=u.pointPrimitive,m=u.billboard,f=Property.getValueOrDefault(h._heightReference,e,HeightReference$1.NONE);d.isShowing&&d.isAvailable(e)&&Property.getValueOrDefault(h._show,e,!0)&&defined(a=Property.getValueOrUndefined(d._position,e,positionScratch))?(Property.isConstant(d._position)||(i._clusterDirty=!0),o=c=!1,f===HeightReference$1.NONE||defined(m)?f!==HeightReference$1.NONE||defined(p)||(defined(m)&&(returnPrimitive(u,d,i),m=void 0),(p=i.getPoint(d)).id=d,u.pointPrimitive=p):(defined(p)&&(returnPrimitive(u,d,i),p=void 0),(m=i.getBillboard(d)).id=d,m.image=void 0,u.billboard=m,c=!0,o=Cartesian3.equals(m.position,a)&&m.heightReference===f),defined(p)?(p.show=!0,p.position=a,p.scaleByDistance=Property.getValueOrUndefined(h._scaleByDistance,e,scaleByDistanceScratch),p.translucencyByDistance=Property.getValueOrUndefined(h._translucencyByDistance,e,translucencyByDistanceScratch),p.color=Property.getValueOrDefault(h._color,e,defaultColor$1,colorScratch$1),p.outlineColor=Property.getValueOrDefault(h._outlineColor,e,defaultOutlineColor,outlineColorScratch),p.outlineWidth=Property.getValueOrDefault(h._outlineWidth,e,defaultOutlineWidth),p.pixelSize=Property.getValueOrDefault(h._pixelSize,e,defaultPixelSize),p.distanceDisplayCondition=Property.getValueOrUndefined(h._distanceDisplayCondition,e,distanceDisplayConditionScratch$1),p.disableDepthTestDistance=Property.getValueOrDefault(h._disableDepthTestDistance,e,defaultDisableDepthTestDistance)):defined(m)&&(m.show=!0,m.position=a,m.scaleByDistance=Property.getValueOrUndefined(h._scaleByDistance,e,scaleByDistanceScratch),m.translucencyByDistance=Property.getValueOrUndefined(h._translucencyByDistance,e,translucencyByDistanceScratch),m.distanceDisplayCondition=Property.getValueOrUndefined(h._distanceDisplayCondition,e,distanceDisplayConditionScratch$1),m.disableDepthTestDistance=Property.getValueOrDefault(h._disableDepthTestDistance,e,defaultDisableDepthTestDistance),m.heightReference=f,s=Property.getValueOrDefault(h._color,e,defaultColor$1,colorScratch$1),l=Property.getValueOrDefault(h._outlineColor,e,defaultOutlineColor,outlineColorScratch),p=Math.round(Property.getValueOrDefault(h._outlineWidth,e,defaultOutlineWidth)),f=Math.max(1,Math.round(Property.getValueOrDefault(h._pixelSize,e,defaultPixelSize))),(c=0<p?(m.scale=1,c||p!==u.outlineWidth||f!==u.pixelSize||!Color.equals(s,u.color)||!Color.equals(l,u.outlineColor)):(m.scale=f/50,f=50,c||p!==u.outlineWidth||!Color.equals(s,u.color)||!Color.equals(l,u.outlineColor)))&&(u.color=Color.clone(s,u.color),u.outlineColor=Color.clone(l,u.outlineColor),u.pixelSize=f,u.outlineWidth=p,h=s.alpha,c=s.toCssColorString(),s=l.toCssColorString(),l=JSON.stringify([c,f,s,p]),m.setImage(l,createBillboardPointCallback(h,c,s,p,f))),o&&m._updateClamping())):returnPrimitive(u,d,i)}return!0},PointVisualizer.prototype.getBoundingSphere=function(e,t){e=this._items.get(e.id);if(!defined(e)||!defined(e.pointPrimitive)&&!defined(e.billboard))return BoundingSphereState$1.FAILED;if(defined(e.pointPrimitive))t.center=Cartesian3.clone(e.pointPrimitive.position,t.center);else{e=e.billboard;if(!defined(e._clampedPosition))return BoundingSphereState$1.PENDING;t.center=Cartesian3.clone(e._clampedPosition,t.center)}return t.radius=0,BoundingSphereState$1.DONE},PointVisualizer.prototype.isDestroyed=function(){return!1},PointVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(PointVisualizer.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return destroyObject(this)},PointVisualizer.prototype._onCollectionChanged=function(e,t,i,r){for(var n,a=this._items,o=this._cluster,s=t.length-1;-1<s;s--)defined((n=t[s])._point)&&defined(n._position)&&a.set(n.id,new EntityData(n));for(s=r.length-1;-1<s;s--)defined((n=r[s])._point)&&defined(n._position)?a.contains(n.id)||a.set(n.id,new EntityData(n)):(returnPrimitive(a.get(n.id),n,o),a.remove(n.id));for(s=i.length-1;-1<s;s--)n=i[s],returnPrimitive(a.get(n.id),n,o),a.remove(n.id)};var defaultZIndex=new ConstantProperty(0),polylineCollections={},scratchColor$4=new Color,defaultMaterial=new ColorMaterialProperty(Color.WHITE),defaultShow=new ConstantProperty(!0),defaultShadows=new ConstantProperty(ShadowMode$1.DISABLED),defaultDistanceDisplayCondition$1=new ConstantProperty(new DistanceDisplayCondition),defaultClassificationType=new ConstantProperty(ClassificationType$1.BOTH);function GeometryOptions(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function GroundGeometryOptions(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function PolylineGeometryUpdater(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(PolylineGeometryUpdater.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new Event,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 GeometryOptions,this._groundGeometryOptions=new GroundGeometryOptions,this._id="polyline-"+e.id,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Entity.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(PolylineGeometryUpdater.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||!defined(this._entity.availability)&&Property.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}}}),PolylineGeometryUpdater.prototype.isOutlineVisible=function(e){return!1},PolylineGeometryUpdater.prototype.isFilled=function(e){var t=this._entity;return defaultValue(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e),!1)},PolylineGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),a={show:n,distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a)};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$4)),defined(t)||(t=Color.WHITE),a.color=ColorGeometryInstanceAttribute.fromColor(t)),this.clampToGround?new GeometryInstance({id:i,geometry:new GroundPolylineGeometry(this._groundGeometryOptions),attributes:a}):(defined(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof ColorMaterialProperty&&(defined(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||r)&&(t=this._depthFailMaterialProperty.color.getValue(e,scratchColor$4)),defined(t)||(t=Color.WHITE),a.depthFailColor=ColorGeometryInstanceAttribute.fromColor(t)),new GeometryInstance({id:i,geometry:new PolylineGeometry(this._geometryOptions),attributes:a}))},PolylineGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){},PolylineGeometryUpdater.prototype.isDestroyed=function(){return!1},PolylineGeometryUpdater.prototype.destroy=function(){this._entitySubscription(),destroyObject(this)},PolylineGeometryUpdater.prototype._onEntityPropertyChanged=function(e,t,i,r){var n,a,o,s,l,c,u;"availability"!==t&&"polyline"!==t||(defined(s=this._entity.polyline)?(l=s.positions,defined(u=s.show)&&u.isConstant&&!u.getValue(Iso8601.MINIMUM_VALUE)||!defined(l)?this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)):(n=s.zIndex,c=(o=defaultValue(s.material,defaultMaterial))instanceof ColorMaterialProperty,this._materialProperty=o,this._depthFailMaterialProperty=s.depthFailMaterial,this._showProperty=defaultValue(u,defaultShow),this._shadowsProperty=defaultValue(s.shadows,defaultShadows),this._distanceDisplayConditionProperty=defaultValue(s.distanceDisplayCondition,defaultDistanceDisplayCondition$1),this._classificationTypeProperty=defaultValue(s.classificationType,defaultClassificationType),this._fillEnabled=!0,this._zIndex=defaultValue(n,defaultZIndex),a=s.width,t=s.arcType,o=s.clampToGround,u=s.granularity,l.isConstant&&Property.isConstant(a)&&Property.isConstant(t)&&Property.isConstant(u)&&Property.isConstant(o)&&Property.isConstant(n)?(s=this._geometryOptions,!defined(l=l.getValue(Iso8601.MINIMUM_VALUE,s.positions))||l.length<2?this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)):(c=(c&&(!defined(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof ColorMaterialProperty)?PolylineColorAppearance:PolylineMaterialAppearance).VERTEX_FORMAT,s.vertexFormat=c,s.positions=l,s.width=defined(a)?a.getValue(Iso8601.MINIMUM_VALUE):void 0,s.arcType=defined(t)?t.getValue(Iso8601.MINIMUM_VALUE):void 0,s.granularity=defined(u)?u.getValue(Iso8601.MINIMUM_VALUE):void 0,(u=this._groundGeometryOptions).positions=l,u.width=s.width,u.arcType=s.arcType,u.granularity=s.granularity,this._clampToGround=!!defined(o)&&o.getValue(Iso8601.MINIMUM_VALUE),!this._clampToGround&&defined(n)&&oneTimeWarning("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this))):this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this)))):this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)))},PolylineGeometryUpdater.prototype.createDynamicUpdater=function(e,t){return new DynamicGeometryUpdater(e,t,this)};var generateCartesianArcOptions={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function DynamicGeometryUpdater(e,t,i){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=i,this._positions=[]}function getLine(e){if(defined(e._line))return e._line;var t=e._geometryUpdater._scene.id,i=polylineCollections[t],r=e._primitives;!defined(i)||i.isDestroyed()?(i=new PolylineCollection,polylineCollections[t]=i,r.add(i)):r.contains(i)||r.add(i);i=i.add();return i.id=e._geometryUpdater._entity,e._line=i}DynamicGeometryUpdater.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,n=r.positions,a=Property.getValueOrUndefined(n,e,this._positions);t._clampToGround=Property.getValueOrDefault(r._clampToGround,e,!1),t._groundGeometryOptions.positions=a,t._groundGeometryOptions.width=Property.getValueOrDefault(r._width,e,1),t._groundGeometryOptions.arcType=Property.getValueOrDefault(r._arcType,e,ArcType$1.GEODESIC),t._groundGeometryOptions.granularity=Property.getValueOrDefault(r._granularity,e,9999);var o=this._groundPrimitives;if(defined(this._groundPolylinePrimitive)&&(o.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!i.isShowing||!i.isAvailable(e)||!Property.getValueOrDefault(r._show,e,!0))return;if(!defined(a)||a.length<2)return;n=t.fillMaterialProperty;return n instanceof ColorMaterialProperty?s=new PolylineColorAppearance:(s=new PolylineMaterialAppearance({material:n=MaterialProperty.getValue(e,n,this._material),translucent:n.isTranslucent()}),this._material=n),this._groundPolylinePrimitive=o.add(new GroundPolylinePrimitive({geometryInstances:t.createFillGeometryInstance(e),appearance:s,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),Property.getValueOrUndefined(t.zIndex,e)),void(defined(this._line)&&(this._line.show=!1))}var s,o=getLine(this);!(i.isShowing&&i.isAvailable(e)&&Property.getValueOrDefault(r._show,e,!0))||!defined(a)||a.length<2?o.show=!1:(s=ArcType$1.GEODESIC,s=Property.getValueOrDefault(r._arcType,e,s),i=t._scene.globe,s!==ArcType$1.NONE&&defined(i)&&(generateCartesianArcOptions.ellipsoid=i.ellipsoid,generateCartesianArcOptions.positions=a,generateCartesianArcOptions.granularity=Property.getValueOrUndefined(r._granularity,e),generateCartesianArcOptions.height=PolylinePipeline.extractHeights(a,i.ellipsoid),a=s===ArcType$1.GEODESIC?PolylinePipeline.generateCartesianArc(generateCartesianArcOptions):PolylinePipeline.generateCartesianRhumbArc(generateCartesianArcOptions)),o.show=!0,o.positions=a.slice(),o.material=MaterialProperty.getValue(e,t.fillMaterialProperty,o.material),o.width=Property.getValueOrDefault(r._width,e,1),o.distanceDisplayCondition=Property.getValueOrUndefined(r._distanceDisplayCondition,e,o.distanceDisplayCondition))},DynamicGeometryUpdater.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){var t=this._groundPolylinePrimitive;if(defined(t)&&t.show&&t.ready){var i=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(defined(i)&&defined(i.boundingSphere))return BoundingSphere.clone(i.boundingSphere,e),BoundingSphereState$1.DONE}return defined(t)&&!t.ready?BoundingSphereState$1.PENDING:BoundingSphereState$1.DONE}t=getLine(this);return t.show&&0<t.positions.length?(BoundingSphere.fromPoints(t.positions,e),BoundingSphereState$1.DONE):BoundingSphereState$1.FAILED},DynamicGeometryUpdater.prototype.isDestroyed=function(){return!1},DynamicGeometryUpdater.prototype.destroy=function(){var e=this._geometryUpdater._scene.id,t=polylineCollections[e];defined(t)&&(t.remove(this._line),0===t.length&&(this._primitives.removeAndDestroy(t),delete polylineCollections[e])),defined(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),destroyObject(this)};var scratchColor$3=new Color,distanceDisplayConditionScratch=new DistanceDisplayCondition,defaultDistanceDisplayCondition=new DistanceDisplayCondition;function Batch(e,t,i,r,n){var a=i instanceof ColorMaterialProperty?PolylineColorAppearance:PolylineMaterialAppearance;this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=a,this.materialProperty=i,this.updaters=new AssociativeArray,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.material=void 0,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Batch.prototype.onMaterialChanged,this),this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray,this.zIndex=r,this._asynchronous=n}function StaticGroundPolylinePerMaterialBatch(e,t,i){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=defaultValue(i,!0)}Batch.prototype.onMaterialChanged=function(){this.invalidated=!0},Batch.prototype.isMaterial=function(e){var t=this.materialProperty,e=e.fillMaterialProperty;return e===t||e instanceof ColorMaterialProperty&&t instanceof ColorMaterialProperty||defined(t)&&t.equals(e)},Batch.prototype.add=function(e,n,t){var a,i=n.id;this.updaters.set(i,n),this.geometry.set(i,t),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)?(a=this).subscriptions.set(i,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)})):this.updatersWithAttributes.set(i,n),this.createPrimitive=!0},Batch.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);e=this.subscriptions.get(t);return defined(e)&&(e(),this.subscriptions.remove(t)),!0}return!1},Batch.prototype.update=function(e){var t=!0,i=this.primitive,r=this.orderedGroundPrimitives,n=this.geometry.values;if(this.createPrimitive)0<n.length?(defined(i)&&(defined(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new GroundPolylinePrimitive({show:!1,asynchronous:this._asynchronous,geometryInstances:n.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===PolylineMaterialAppearance&&(this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),i.appearance.material=this.material),r.add(i,this.zIndex),t=!1):(defined(i)&&(r.remove(i),i=void 0),defined(n=this.oldPrimitive)&&(r.remove(n),this.oldPrimitive=void 0)),this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1;else if(defined(i)&&i.ready){i.show=!0,defined(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===PolylineMaterialAppearance&&(this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);for(var a=this.updatersWithAttributes.values,o=a.length,s=0;s<o;s++){var l=a[s],c=l.entity,u=this.geometry.get(l.id),d=this.attributes.get(u.id.id);defined(d)||(d=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,d)),l.fillMaterialProperty.isConstant||(u=l.fillMaterialProperty.color,u=Property.getValueOrDefault(u,e,Color.WHITE,scratchColor$3),Color.equals(d._lastColor,u)||(d._lastColor=Color.clone(u,d._lastColor),d.color=ColorGeometryInstanceAttribute.toValue(u,d.color)));c=c.isShowing&&(l.hasConstantFill||l.isFilled(e));c!==(1===d.show[0])&&(d.show=ShowGeometryInstanceAttribute.toValue(c,d.show));l=l.distanceDisplayConditionProperty;Property.isConstant(l)||(l=Property.getValueOrDefault(l,e,defaultDistanceDisplayCondition,distanceDisplayConditionScratch),DistanceDisplayCondition.equals(l,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(l,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(l,d.distanceDisplayCondition)))}this.updateShows(i)}else defined(i)&&!i.ready&&(t=!1);return t},Batch.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=n.entity,o=this.geometry.get(n.id),n=this.attributes.get(o.id.id);defined(n)||(n=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,n));a=a.isShowing;a!==(1===n.show[0])&&(n.show=ShowGeometryInstanceAttribute.toValue(a,n.show),o.attributes.show.value[0]=n.show[0])}this.showsUpdated.removeAll()},Batch.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;e=i.getGeometryInstanceAttributes(e.entity);return!defined(e)||!defined(e.boundingSphere)||defined(e.show)&&0===e.show[0]?BoundingSphereState$1.FAILED:(e.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch.prototype.destroy=function(){var e=this.primitive,t=this.orderedGroundPrimitives;defined(e)&&t.remove(e);e=this.oldPrimitive;defined(e)&&t.remove(e),this.removeMaterialSubscription()},StaticGroundPolylinePerMaterialBatch.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=t.createFillGeometryInstance(e),a=Property.getValueOrDefault(t.zIndex,0),o=0;o<r;++o){var s=i[o];if(s.isMaterial(t)&&s.zIndex===a)return void s.add(e,t,n)}var l=new Batch(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,a,this._asynchronous);l.add(e,t,n),i.push(l)},StaticGroundPolylinePerMaterialBatch.prototype.remove=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},StaticGroundPolylinePerMaterialBatch.prototype.update=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.invalidated){t.splice(i,1);for(var n=r.updaters.values,a=n.length,o=0;o<a;o++)this.add(e,n[o]);r.destroy()}}var s=!0;for(i=0;i<t.length;i++)s=t[i].update(e)&&s;return s},StaticGroundPolylinePerMaterialBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticGroundPolylinePerMaterialBatch.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var emptyArray=[];function removeUpdater(e,t){for(var i=e._batches,r=i.length,n=0;n<r;n++)i[n].remove(t)}function insertUpdaterIntoBatch(e,t,i){var r,n,a;i.isDynamic?e._dynamicBatch.add(t,i):i.clampToGround&&i.fillEnabled?(n=i.classificationTypeProperty.getValue(t),e._groundBatches[n].add(t,i)):(i.fillEnabled&&(r=i.shadowsProperty.getValue(t)),n=0,defined(i.depthFailMaterialProperty)&&(n=i.depthFailMaterialProperty instanceof ColorMaterialProperty?1:2),defined(r)&&(a=r+n*ShadowMode$1.NUMBER_OF_SHADOW_MODES),i.fillEnabled&&(i.fillMaterialProperty instanceof ColorMaterialProperty?e._colorBatches:e._materialBatches)[a].add(t,i))}function PolylineVisualizer(e,t,i,r){var n;r=defaultValue(r,e.groundPrimitives),i=defaultValue(i,e.primitives),this._scene=e,this._primitives=i,this._entityCollection=void 0,this._addedObjects=new AssociativeArray,this._removedObjects=new AssociativeArray,this._changedObjects=new AssociativeArray;var a=ShadowMode$1.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(3*a),this._materialBatches=new Array(3*a),n=0;n<a;++n)this._colorBatches[n]=new StaticGeometryColorBatch(i,PolylineColorAppearance,void 0,!1,n),this._materialBatches[n]=new StaticGeometryPerMaterialBatch(i,PolylineMaterialAppearance,void 0,!1,n),this._colorBatches[n+a]=new StaticGeometryColorBatch(i,PolylineColorAppearance,PolylineColorAppearance,!1,n),this._materialBatches[n+a]=new StaticGeometryPerMaterialBatch(i,PolylineMaterialAppearance,PolylineColorAppearance,!1,n),this._colorBatches[n+2*a]=new StaticGeometryColorBatch(i,PolylineColorAppearance,PolylineMaterialAppearance,!1,n),this._materialBatches[n+2*a]=new StaticGeometryPerMaterialBatch(i,PolylineMaterialAppearance,PolylineMaterialAppearance,!1,n);this._dynamicBatch=new DynamicGeometryBatch(i,r);var o=ClassificationType$1.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(o),n=0;n<o;++n)this._groundBatches[n]=new StaticGroundPolylinePerMaterialBatch(r,n);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new AssociativeArray,this._updaters=new AssociativeArray,(this._entityCollection=t).collectionChanged.addEventListener(PolylineVisualizer.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,emptyArray)}PolylineVisualizer.prototype.update=function(e){for(var t,i,r,n=this._addedObjects,a=n.values,o=this._removedObjects,s=o.values,l=this._changedObjects,c=l.values,u=c.length-1;-1<u;u--)i=(t=c[u]).id,(r=this._updaters.get(i)).entity===t?(removeUpdater(this,r),insertUpdaterIntoBatch(this,e,r)):(s.push(t),a.push(t));for(u=s.length-1;-1<u;u--)i=(t=s[u]).id,r=this._updaters.get(i),removeUpdater(this,r),r.destroy(),this._updaters.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);for(u=a.length-1;-1<u;u--)i=(t=a[u]).id,r=new PolylineGeometryUpdater(t,this._scene),this._updaters.set(i,r),insertUpdaterIntoBatch(this,e,r),this._subscriptions.set(i,r.geometryChanged.addEventListener(PolylineVisualizer._onGeometryChanged,this));n.removeAll(),o.removeAll(),l.removeAll();var d=!0,h=this._batches,p=h.length;for(u=0;u<p;u++)d=h[u].update(e)&&d;return d};var getBoundingSphereArrayScratch$1=[],getBoundingSphereBoundingSphereScratch$1=new BoundingSphere;function DataSourceDisplay(e){GroundPrimitive.initializeTerrainHeights(),GroundPolylinePrimitive.initializeTerrainHeights();var t=e.scene,i=e.dataSourceCollection;this._eventHelper=new EventHelper,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(i.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=i,this._scene=t,this._visualizersCallback=defaultValue(e.visualizersCallback,DataSourceDisplay.defaultVisualizersCallback);var r=!1,n=new PrimitiveCollection,a=new PrimitiveCollection;0<i.length&&(t.primitives.add(n),t.groundPrimitives.add(a),r=!0),this._primitives=n,this._groundPrimitives=a;for(var o=0,s=i.length;o<s;o++)this._onDataSourceAdded(i,i.get(o));var l,c,u,e=new CustomDataSource;this._onDataSourceAdded(void 0,e),this._defaultDataSource=e,r||(l=this,c=e.entities.collectionChanged.addEventListener(e=function(){t.primitives.add(n),t.groundPrimitives.add(a),c(),u(),l._removeDefaultDataSourceListener=void 0,l._removeDataSourceCollectionListener=void 0}),u=i.dataSourceAdded.addEventListener(e)),this._removeDefaultDataSourceListener=c,this._removeDataSourceCollectionListener=u,this._ready=!1}PolylineVisualizer.prototype.getBoundingSphere=function(e,t){for(var i=getBoundingSphereArrayScratch$1,r=getBoundingSphereBoundingSphereScratch$1,n=0,a=BoundingSphereState$1.DONE,o=this._batches,s=o.length,l=this._updaters.get(e.id),c=0;c<s;c++){if((a=o[c].getBoundingSphere(l,r))===BoundingSphereState$1.PENDING)return BoundingSphereState$1.PENDING;a===BoundingSphereState$1.DONE&&(i[n]=BoundingSphere.clone(r,i[n]),n++)}return 0===n?BoundingSphereState$1.FAILED:(i.length=n,BoundingSphere.fromBoundingSpheres(i,t),BoundingSphereState$1.DONE)},PolylineVisualizer.prototype.isDestroyed=function(){return!1},PolylineVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(PolylineVisualizer.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();for(var e=this._batches,t=e.length,i=0;i<t;i++)e[i].removeAllPrimitives();var r=this._subscriptions.values,t=r.length;for(i=0;i<t;i++)r[i]();return this._subscriptions.removeAll(),destroyObject(this)},PolylineVisualizer._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,r=e.entity,e=r.id;defined(t.get(e))||defined(i.get(e))||i.set(e,r)},PolylineVisualizer.prototype._onCollectionChanged=function(e,t,i){for(var r,n,a=this._addedObjects,o=this._removedObjects,s=this._changedObjects,l=i.length-1;-1<l;l--)r=(n=i[l]).id,a.remove(r)||(o.set(r,n),s.remove(r));for(l=t.length-1;-1<l;l--)r=(n=t[l]).id,(o.remove(r)?s:a).set(r,n)},DataSourceDisplay.defaultVisualizersCallback=function(e,t,i){var r=i.entities;return[new BillboardVisualizer(t,r),new GeometryVisualizer(e,r,i._primitives,i._groundPrimitives),new LabelVisualizer(t,r),new ModelVisualizer(e,r),new Cesium3DTilesetVisualizer(e,r),new PointVisualizer(t,r),new PathVisualizer(e,r),new PolylineVisualizer(e,r,i._primitives,i._groundPrimitives)]},Object.defineProperties(DataSourceDisplay.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}}}),DataSourceDisplay.prototype.isDestroyed=function(){return!1},DataSourceDisplay.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;t<i;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),defined(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),destroyObject(this)},DataSourceDisplay.prototype.update=function(e){if(!ApproximateTerrainHeights.initialized)return this._ready=!1;for(var t,i,r,n=!0,a=this._dataSourceCollection,o=a.length,s=0;s<o;s++){var l=a.get(s);for(defined(l.update)&&(n=l.update(e)&&n),r=(i=l._visualizers).length,t=0;t<r;t++)n=i[t].update(e)&&n}for(r=(i=this._defaultDataSource._visualizers).length,t=0;t<r;t++)n=i[t].update(e)&&n;return this._ready=n},DataSourceDisplay.prototype._postRender=function(){for(var e=this._scene.frameState,t=this._dataSourceCollection,i=t.length,r=0;r<i;r++){var n=t.get(r),a=n.credit;defined(a)&&e.creditDisplay.addCredit(a);var o=n._resourceCredits;if(defined(o))for(var s=o.length,l=0;l<s;l++)e.creditDisplay.addCredit(o[l])}};var getBoundingSphereArrayScratch=[],getBoundingSphereBoundingSphereScratch=new BoundingSphere;DataSourceDisplay.prototype.getBoundingSphere=function(e,t,i){if(!this._ready)return BoundingSphereState$1.PENDING;if(!(r=this._defaultDataSource).entities.contains(e))for(var r=void 0,n=this._dataSourceCollection,a=n.length,o=0;o<a;o++){var s=n.get(o);if(s.entities.contains(e)){r=s;break}}if(!defined(r))return BoundingSphereState$1.FAILED;var l=getBoundingSphereArrayScratch,c=getBoundingSphereBoundingSphereScratch,u=0,d=BoundingSphereState$1.DONE,h=r._visualizers,p=h.length;for(o=0;o<p;o++)if(defined(h[o].getBoundingSphere)){if(d=h[o].getBoundingSphere(e,c),!t&&d===BoundingSphereState$1.PENDING)return BoundingSphereState$1.PENDING;d===BoundingSphereState$1.DONE&&(l[u]=BoundingSphere.clone(c,l[u]),u++)}return 0===u?BoundingSphereState$1.FAILED:(l.length=u,BoundingSphere.fromBoundingSpheres(l,i),BoundingSphereState$1.DONE)},DataSourceDisplay.prototype._onDataSourceAdded=function(e,t){var i=this._scene,r=this._primitives,n=this._groundPrimitives,r=r.add(new PrimitiveCollection),n=n.add(new OrderedGroundPrimitiveCollection);t._primitives=r,t._groundPrimitives=n;n=t.clustering;n._initialize(i),r.add(n),t._visualizers=this._visualizersCallback(i,n,t)},DataSourceDisplay.prototype._onDataSourceRemoved=function(e,t){var i=this._primitives,r=this._groundPrimitives,n=t._primitives,a=t._groundPrimitives,o=t.clustering;n.remove(o);for(var s=t._visualizers,l=s.length,c=0;c<l;c++)s[c].destroy();i.remove(n),r.remove(a),t._visualizers=void 0},DataSourceDisplay.prototype._onDataSourceMoved=function(e,t,i){var r=this._primitives,n=this._groundPrimitives,a=e._primitives,e=e._groundPrimitives;t===i+1?(r.raise(a),n.raise(e)):t===i-1?(r.lower(a),n.lower(e)):0===t?(r.lowerToBottom(a),n.lowerToBottom(e),r.raise(a),n.raise(e)):(r.raiseToTop(a),n.raiseToTop(e))};var updateTransformMatrix3Scratch1=new Matrix3,updateTransformMatrix3Scratch2=new Matrix3,updateTransformMatrix3Scratch3=new Matrix3,updateTransformMatrix4Scratch=new Matrix4,updateTransformCartesian3Scratch1=new Cartesian3,updateTransformCartesian3Scratch2=new Cartesian3,updateTransformCartesian3Scratch3=new Cartesian3,updateTransformCartesian3Scratch4=new Cartesian3,updateTransformCartesian3Scratch5=new Cartesian3,updateTransformCartesian3Scratch6=new Cartesian3,deltaTime=new JulianDate,northUpAxisFactor=1.25;function updateTransform(e,t,i,r,n,a,o){var s,l,c,u,d,h,p,m,f,g,_,y,C=e.scene.mode,v=n.getValue(a,e._lastCartesian);defined(v)&&(l=s=!1,C===SceneMode$1.SCENE3D&&(JulianDate.addSeconds(a,.001,deltaTime),defined(h=n.getValue(deltaTime,updateTransformCartesian3Scratch1))||(JulianDate.addSeconds(a,-.001,deltaTime),h=n.getValue(deltaTime,updateTransformCartesian3Scratch1),l=!0),defined(h)&&(p=Transforms.computeFixedToIcrfMatrix(a,updateTransformMatrix3Scratch1),m=Transforms.computeFixedToIcrfMatrix(deltaTime,updateTransformMatrix3Scratch2),defined(p)&&defined(m)?y=Matrix3.transpose(p,updateTransformMatrix3Scratch3):(y=Transforms.computeTemeToPseudoFixedMatrix(a,updateTransformMatrix3Scratch3),p=Matrix3.transpose(y,updateTransformMatrix3Scratch1),m=Transforms.computeTemeToPseudoFixedMatrix(deltaTime,updateTransformMatrix3Scratch2),Matrix3.transpose(m,m)),n=Matrix3.multiplyByVector(p,v,updateTransformCartesian3Scratch5),a=Matrix3.multiplyByVector(m,h,updateTransformCartesian3Scratch6),Cartesian3.subtract(n,a,updateTransformCartesian3Scratch4),p=1e3*Cartesian3.magnitude(updateTransformCartesian3Scratch4),(m=-(m=CesiumMath.GRAVITATIONALPARAMETER)/(p*p-2*m/Cartesian3.magnitude(n)))<0||m>northUpAxisFactor*o.maximumRadius?(Cartesian3.normalize(v,c=updateTransformCartesian3Scratch2),Cartesian3.negate(c,c),d=Cartesian3.clone(Cartesian3.UNIT_Z,updateTransformCartesian3Scratch3),u=Cartesian3.cross(d,c,updateTransformCartesian3Scratch1),Cartesian3.magnitude(u)>CesiumMath.EPSILON7&&(Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),d=Cartesian3.cross(c,u,updateTransformCartesian3Scratch3),Cartesian3.normalize(d,d),s=!0)):Cartesian3.equalsEpsilon(v,h,CesiumMath.EPSILON7)||(Cartesian3.normalize(n,d=updateTransformCartesian3Scratch2),Cartesian3.normalize(a,a),u=Cartesian3.cross(d,a,updateTransformCartesian3Scratch3),l&&(u=Cartesian3.multiplyByScalar(u,-1,u)),Cartesian3.equalsEpsilon(u,Cartesian3.ZERO,CesiumMath.EPSILON7)||(c=Cartesian3.cross(u,d,updateTransformCartesian3Scratch1),Matrix3.multiplyByVector(y,c,c),Matrix3.multiplyByVector(y,u,u),Matrix3.multiplyByVector(y,d,d),Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),Cartesian3.normalize(d,d),s=!0)))),defined(e.boundingSphere)&&(v=e.boundingSphere.center),r&&(f=Cartesian3.clone(t.position,updateTransformCartesian3Scratch4),g=Cartesian3.clone(t.direction,updateTransformCartesian3Scratch5),_=Cartesian3.clone(t.up,updateTransformCartesian3Scratch6)),y=updateTransformMatrix4Scratch,s?(y[0]=c.x,y[1]=c.y,y[2]=c.z,y[3]=0,y[4]=u.x,y[5]=u.y,y[6]=u.z,y[7]=0,y[8]=d.x,y[9]=d.y,y[10]=d.z,y[11]=0,y[12]=v.x,y[13]=v.y,y[14]=v.z,y[15]=0):Transforms.eastNorthUpToFixedFrame(v,o,y),t._setTransform(y),r&&(Cartesian3.clone(f,t.position),Cartesian3.clone(g,t.direction),Cartesian3.clone(_,t.up),Cartesian3.cross(g,_,t.right))),i&&(e=C===SceneMode$1.SCENE2D||Cartesian3.equals(e._offset3D,Cartesian3.ZERO)?void 0:e._offset3D,t.lookAtTransform(t.transform,e))}function EntityView(e,t,i){this.entity=e,this.scene=t,this.ellipsoid=defaultValue(i,Ellipsoid.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new Cartesian3,this._defaultOffset3D=void 0,this._offset3D=new Cartesian3}Object.defineProperties(EntityView,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=Cartesian3.clone(e,new Cartesian3)}}}),EntityView.defaultOffset3D=new Cartesian3(-14e3,3500,3500);var scratchHeadingPitchRange=new HeadingPitchRange,scratchCartesian$2=new Cartesian3;EntityView.prototype.update=function(e,t){var i,r,n,a,o,s,l,c,u=this.scene,d=this.ellipsoid,h=u.mode;h===SceneMode$1.MORPHING||defined(r=(i=this.entity).position)&&(c=i!==this._lastEntity,n=h!==this._mode,a=u.camera,o=c||n,s=!0,c?!(u=defined(l=i.viewFrom))&&defined(t)?(scratchHeadingPitchRange.pitch=-CesiumMath.PI_OVER_FOUR,scratchHeadingPitchRange.range=0,defined(c=r.getValue(e,scratchCartesian$2))&&(c=2-1/Math.max(1,Cartesian3.magnitude(c)/d.maximumRadius),scratchHeadingPitchRange.pitch*=c),a.viewBoundingSphere(t,scratchHeadingPitchRange),this.boundingSphere=t,s=o=!1):u&&defined(l.getValue(e,this._offset3D))||Cartesian3.clone(EntityView._defaultOffset3D,this._offset3D):n||this._mode===SceneMode$1.SCENE2D||Cartesian3.clone(a.position,this._offset3D),this._lastEntity=i,this._mode=h,updateTransform(this,a,o,s,r,e,d))};var tmp$4={};!function(x){var a,e,d="File format is not recognized.",o="File contains encrypted entry.",s="File is using Zip64 (4gb+ file size).",n="Error while reading zip file.",t="Error while reading file data.",g=524288,b="inflate.js",h="deflate.js",l="text/plain",_="message";try{a=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}function E(){var r=-1,n=this;n.append=function(e){for(var t=n.table,i=0;i<e.length;i++)r=r>>>8^t[255&(r^e[i])]},n.get=function(){return~r}}function P(e,t){var i=new ArrayBuffer(e),e=new Uint8Array(i);return t&&e.set(t,0),{buffer:i,array:e,view:new DataView(i)}}function i(){}function r(r){var n,a=this;a.size=0,a.init=function(e,t){var i=new Blob([r],{type:l});(n=new u(i)).init(function(){a.size=n.size,e()},t)},a.readUint8Array=function(e,t,i,r){n.readUint8Array(e,t,i,r)}}function c(c){var u,i=this;i.size=0,i.init=function(e){for(var t=c.length;"="==c.charAt(t-1);)t--;u=c.indexOf(",")+1,i.size=Math.floor(.75*(t-u)),e()},i.readUint8Array=function(e,t,i){for(var r=P(t),n=4*Math.floor(e/3),a=4*Math.ceil((e+t)/3),o=window.atob(c.substring(n+u,a+u)),s=e-3*Math.floor(n/4),l=s;l<s+t;l++)r.array[l-s]=o.charCodeAt(l);i(r.array)}}function u(a){this.size=0,this.init=function(e){this.size=a.size,e()},this.readUint8Array=function(e,t,i,r){var n;(n=new FileReader).onload=function(e){i(new Uint8Array(e.target.result))},n.onerror=r,n.readAsArrayBuffer((n=e,e=t,(t=a).slice?t.slice(n,n+e):t.webkitSlice?t.webkitSlice(n,n+e):t.mozSlice?t.mozSlice(n,n+e):t.msSlice?t.msSlice(n,n+e):void 0))}}function p(){}function m(r){var n;this.init=function(e){n=new Blob([],{type:l}),e()},this.writeUint8Array=function(e,t){n=new Blob([n,a?e:e.buffer],{type:l}),t()},this.getData=function(t,e){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=e,i.readAsText(n,r)}}function f(t){var a="",o="";this.init=function(e){a+="data:"+(t||"")+";base64,",e()},this.writeUint8Array=function(e,t){var i,r=o.length,n=o;for(o="",i=0;i<3*Math.floor((r+e.length)/3)-r;i++)n+=String.fromCharCode(e[i]);for(;i<e.length;i++)o+=String.fromCharCode(e[i]);2<n.length?a+=window.btoa(n):o=n,t()},this.getData=function(e){e(a+window.btoa(o))}}function y(i){var r;this.init=function(e){r=new Blob([],{type:i}),e()},this.writeUint8Array=function(e,t){r=new Blob([r,a?e:e.buffer],{type:i}),t()},this.getData=function(e){e(r)}}function A(t,e,i,r,n,a,o,s,l,c){var u,d,h=0;function p(){t.removeEventListener(_,m,!1),s(d)}function m(e){var e=e.data,t=e.data;e.onappend&&(d+=t.length,i.writeUint8Array(t,function(){a(!1,t),f()},c)),e.onflush&&(t?(d+=t.length,i.writeUint8Array(t,function(){a(!1,t),p()},c)):p()),e.progress&&o&&o(u+e.current,n)}function f(){(u=h*g)<n?e.readUint8Array(r+u,Math.min(g,n-u),function(e){t.postMessage({append:!0,data:e}),h++,o&&o(u,n),a(!0,e)},l):t.postMessage({flush:!0})}d=0,t.addEventListener(_,m,!1),f()}function w(r,t,n,a,o,s,l,c,u,d){var h,p=0,m=0;!function i(){var e;(h=p*g)<o?t.readUint8Array(a+h,Math.min(g,o-h),function(e){var t=r.append(e,function(){l&&l(a+h,o)});m+=t.length,s(!0,e),n.writeUint8Array(t,function(){s(!1,t),p++,setTimeout(i,1)},d),l&&l(h,o)},u):(e=r.flush())?(m+=e.length,n.writeUint8Array(e,function(){s(!1,e),c(m)},d)):c(m)}()}function S(t,i,e,r,n,a,o){var s,l=new E;function c(e,t){e&&l.append(t)}function u(e){r(e,l.get())}return x.zip.useWebWorkers?((s=new Worker(x.zip.workerScriptsPath+h)).addEventListener(_,function e(){s.removeEventListener(_,e,!1),A(s,t,i,0,t.size,c,n,u,a,o)},!1),s.postMessage({init:!0,level:e})):w(new x.zip.Deflater,t,i,0,t.size,c,n,u,a,o),s}function D(e,r,n,a,o,s,l,c,u){var d=0,h=new E;!function t(){var i=d*g;i<a?e.readUint8Array(n+i,Math.min(g,a-i),function(e){o&&h.append(e),l&&l(i,a,e),r.writeUint8Array(e,function(){d++,t()},u)},c):s(a,h.get())}()}function C(e){for(var t,i="",r=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "],n=0;n<e.length;n++)i+=127<(t=255&e.charCodeAt(n))?r[t-128]:String.fromCharCode(t);return i}function v(e){return decodeURIComponent(escape(e))}function M(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t}function I(e,t,i,r,n){e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=function(e){var t=(4294901760&e)>>16,e=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&e)>>11,(2016&e)>>5,2*(31&e),0)}catch(e){}}(e.lastModDateRaw),1!=(1&e.bitFlag)?(!r&&8==(8&e.bitFlag)||(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295!==e.compressedSize&&4294967295!==e.uncompressedSize?(e.filenameLength=t.view.getUint16(i+22,!0),e.extraFieldLength=t.view.getUint16(i+24,!0)):n(s)):n(o)}function T(T,c){function u(){}return u.prototype.getData=function(m,r,f,g){var _,y=this;function n(e,t){_&&_.terminate(),_=null,e&&e(t)}function C(e,t){var i;g&&(i=t,(t=P(4)).view.setUint32(0,i),y.crc32!=t.view.getUint32(0))?v():m.getData(function(e){n(r,e)})}function v(){n(c,t)}function S(){n(c,"Error while writing file data.")}T.readUint8Array(y.offset,30,function(e){var p,e=P(e.length,e);1347093252==e.view.getUint32(0)?(I(y,e,4,!1,c),p=y.offset+30+y.filenameLength+y.extraFieldLength,m.init(function(){function e(e,t){o&&!e&&h.append(t)}function t(e){s(e,h.get())}var i,r,n,a,o,s,l,c,u,d,h;0===y.compressionMethod?D(T,m,p,y.compressedSize,g,C,f,v,S):(i=T,r=m,n=p,a=y.compressedSize,o=g,s=C,l=f,c=v,u=S,h=new E,x.zip.useWebWorkers?A(d=new Worker(x.zip.workerScriptsPath+b),i,r,n,a,e,l,t,c,u):w(new x.zip.Inflater,i,r,n,a,e,l,t,c,u),_=d)},S)):c(d)},v)},{getEntries:function(l){T.size<22?c(d):function t(i,r){T.readUint8Array(T.size-i,i,function(e){1347093766!=(e=P(e.length,e).view).getUint32(0)?t(i+1,r):r(e)},function(){c(n)})}(22,function(e){var t=e.getUint32(16,!0),s=e.getUint16(8,!0);T.readUint8Array(t,T.size-t,function(e){for(var t,i,r=0,n=[],a=P(e.length,e),o=0;o<s;o++){if(t=new u,1347092738!=a.view.getUint32(r))return void c(d);I(t,a,r+6,!0,c),t.commentLength=a.view.getUint16(r+32,!0),t.directory=16==(16&a.view.getUint8(r+38)),t.offset=a.view.getUint32(r+42,!0),i=M(a.array.subarray(r+46,r+46+t.filenameLength)),t.filename=(2048==(2048&t.bitFlag)?v:C)(i),t.directory||"/"!=t.filename.charAt(t.filename.length-1)||(t.directory=!0),i=M(a.array.subarray(r+46+t.filenameLength+t.extraFieldLength,r+46+t.filenameLength+t.extraFieldLength+t.commentLength)),t.comment=(2048==(2048&t.bitFlag)?v:C)(i),n.push(t),r+=46+t.filenameLength+t.extraFieldLength+t.commentLength}l(n)},function(){c(n)})})},close:function(e){e&&e()}}}function R(e){return unescape(encodeURIComponent(e))}function O(e){for(var t=[],i=0;i<e.length;i++)t.push(e.charCodeAt(i));return t}function L(d,h,p){var m,f={},g=[],_=0;function y(e,t){m&&m.terminate(),m=null,e&&e(t)}function C(){y(h,"Error while writing zip file.")}function v(){y(h,t)}return{add:function(i,r,n,a,o){var s,l,c;function u(e,t){var i=P(16);_+=e||0,i.view.setUint32(0,1347094280),void 0!==t&&(s.view.setUint32(10,t,!0),i.view.setUint32(4,t,!0)),r&&(i.view.setUint32(8,e,!0),s.view.setUint32(14,e,!0),i.view.setUint32(12,r.size,!0),s.view.setUint32(18,r.size,!0)),d.writeUint8Array(i.array,function(){_+=16,y(n)},C)}function e(){var e,t;o=o||{},i=i.trim(),o.directory&&"/"!=i.charAt(i.length-1)&&(i+="/"),f.hasOwnProperty(i)?h("File already exists."):(l=O(R(i)),g.push(i),e=function(){r?p||0===o.level?D(r,d,0,r.size,!0,u,a,v,C):m=S(r,d,o.level,u,a,v,C):u()},c=o.lastModDate||new Date,s=P(26),f[i]={headerArray:s.array,directory:o.directory,filename:l,offset:_,comment:O(R(o.comment||""))},s.view.setUint32(0,335546376),o.version&&s.view.setUint8(0,o.version),p||0===o.level||o.directory||s.view.setUint16(4,2048),s.view.setUint16(6,(c.getHours()<<6|c.getMinutes())<<5|c.getSeconds()/2,!0),s.view.setUint16(8,(c.getFullYear()-1980<<4|c.getMonth()+1)<<5|c.getDate(),!0),s.view.setUint16(22,l.length,!0),(t=P(30+l.length)).view.setUint32(0,1347093252),t.array.set(s.array,4),t.array.set(l,30),_+=t.array.length,d.writeUint8Array(t.array,e,C))}r?r.init(e,v):e()},close:function(e){for(var t,i,r=0,n=0,a=0;a<g.length;a++)r+=46+(i=f[g[a]]).filename.length+i.comment.length;for(t=P(r+22),a=0;a<g.length;a++)i=f[g[a]],t.view.setUint32(n,1347092738),t.view.setUint16(n+4,5120),t.array.set(i.headerArray,n+6),t.view.setUint16(n+32,i.comment.length,!0),i.directory&&t.view.setUint8(n+38,16),t.view.setUint32(n+42,i.offset,!0),t.array.set(i.filename,n+46),t.array.set(i.comment,n+46+i.filename.length),n+=46+i.filename.length+i.comment.length;t.view.setUint32(n,1347093766),t.view.setUint16(n+8,g.length,!0),t.view.setUint16(n+10,g.length,!0),t.view.setUint32(n+12,r,!0),t.view.setUint32(n+16,_,!0),d.writeUint8Array(t.array,function(){y(function(){d.getData(e)})},C)}}}E.prototype.table=function(){for(var e,t,i=[],r=0;r<256;r++){for(t=r,e=0;e<8;e++)1&t?t=t>>>1^3988292384:t>>>=1;i[r]=t}return i}(),(r.prototype=new i).constructor=r,(c.prototype=new i).constructor=c,(u.prototype=new i).constructor=u,p.prototype.getData=function(e){e(this.data)},(m.prototype=new p).constructor=m,(f.prototype=new p).constructor=f,y.prototype=new p,x.zip={Reader:i,Writer:p,BlobReader:u,Data64URIReader:c,TextReader:r,BlobWriter:y.prototype.constructor=y,Data64URIWriter:f,TextWriter:m,createReader:function(e,t,i){e.init(function(){t(T(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(L(e,i,r))},i)},useWebWorkers:!0},Object.defineProperties(x.zip,{workerScriptsPath:{get:function(){return e=void 0===e?buildModuleUrl("ThirdParty/Workers/"):e}}})}(tmp$4);var zip=tmp$4.zip,BILLBOARD_SIZE$1=32,kmlNamespace="http://www.opengis.net/kml/2.2",gxNamespace="http://www.google.com/kml/ext/2.2",xmlnsNamespace="http://www.w3.org/2000/xmlns/";function ExternalFileHandler(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var imageTypeRegex=/^data:image\/([^,;]+)/;function getModelBlobHander(t,i){return function(e){t._files[i]=e}}function ValueGetter(e){this._time=e}function StyleCache(){this._ids={},this._styles={},this._count=0}function IdManager(){this._ids={}}function exportKml(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).entities,i=defaultValue(e.kmz,!1),r=exportKml._createState(e),n=t.values.filter(function(e){return!defined(e.parent)}),e=r.kmlDoc,t=e.documentElement;t.setAttributeNS(xmlnsNamespace,"xmlns:gx",gxNamespace);e=e.createElement("Document");t.appendChild(e),recurseEntities(r,e,n),r.styleCache.save(e);var a=r.externalFileHandler;return a.promise.then(function(){var e=(new XMLSerializer).serializeToString(r.kmlDoc);return i?createKmz(e,a.files):{kml:e,externalFiles:a.files}})}function createKmz(e,i){var r=when.defer();return zip.createWriter(new zip.BlobWriter,function(t){addKmlToZip(t,e).then(function(){var e=Object.keys(i);return addExternalFilesToZip(t,e,i,0)}).then(function(){t.close(function(e){r.resolve({kmz:e})})})}),r.promise}function addKmlToZip(e,t){var i=when.defer();return e.add("doc.kml",new zip.TextReader(t),function(){i.resolve()}),i.promise}function addExternalFilesToZip(e,t,i,r){if(t.length!==r){var n=t[r],a=when.defer();return e.add(n,new zip.BlobReader(i[n]),function(){a.resolve()}),a.promise.then(function(){return addExternalFilesToZip(e,t,i,r+1)})}}function recurseEntities(e,t,i){for(var r=e.kmlDoc,n=e.styleCache,a=e.valueGetter,o=e.idManager,s=i.length,l=0;l<s;++l){var c,u,d,h=i[l],p=[];createPoint$1(e,h,u=[],d=[]),createLineString$1(e,h.polyline,u,d),createPolygon$1(e,h.rectangle,u,d,p),createPolygon$1(e,h.polygon,u,d,p),createModel(e,h,h.model,u,d);var m=h.availability;defined(m)&&(c=r.createElement("TimeSpan"),JulianDate.equals(m.start,Iso8601.MINIMUM_VALUE)||c.appendChild(createBasicElementWithText(r,"begin",JulianDate.toIso8601(m.start))),JulianDate.equals(m.stop,Iso8601.MAXIMUM_VALUE)||c.appendChild(createBasicElementWithText(r,"end",JulianDate.toIso8601(m.stop))));for(var f=0;f<p.length;++f){var g=p[f];g.setAttribute("id",o.get(h.id)),g.appendChild(createBasicElementWithText(r,"name",h.name)),g.appendChild(createBasicElementWithText(r,"visibility",h.show)),g.appendChild(createBasicElementWithText(r,"description",h.description)),defined(c)&&g.appendChild(c),t.appendChild(g)}var _=u.length;if(0<_){var y=r.createElement("Placemark");y.setAttribute("id",o.get(h.id));var C,v=h.name,S=h.label;defined(S)&&(C=r.createElement("LabelStyle"),v=defined(m=a.get(S.text))&&0<m.length?m:v,defined(m=a.getColor(S.fillColor))&&(C.appendChild(createBasicElementWithText(r,"color",m)),C.appendChild(createBasicElementWithText(r,"colorMode","normal"))),defined(S=a.get(S.scale))&&C.appendChild(createBasicElementWithText(r,"scale",S)),d.push(C)),y.appendChild(createBasicElementWithText(r,"name",v)),y.appendChild(createBasicElementWithText(r,"visibility",h.show)),y.appendChild(createBasicElementWithText(r,"description",h.description)),defined(c)&&y.appendChild(c),t.appendChild(y);var T=d.length;if(0<T){for(var x=r.createElement("Style"),b=0;b<T;++b)x.appendChild(d[b]);y.appendChild(createBasicElementWithText(r,"styleUrl",n.get(x)))}if(1===u.length)y.appendChild(u[0]);else if(1<u.length){for(var E=r.createElement("MultiGeometry"),P=0;P<_;++P)E.appendChild(u[P]);y.appendChild(E)}}v=h._children;0<v.length&&((y=r.createElement("Folder")).setAttribute("id",o.get(h.id)),y.appendChild(createBasicElementWithText(r,"name",h.name)),y.appendChild(createBasicElementWithText(r,"visibility",h.show)),y.appendChild(createBasicElementWithText(r,"description",h.description)),t.appendChild(y),recurseEntities(e,y,v))}}ExternalFileHandler.prototype.texture=function(e){var t=this;if("string"==typeof e||e instanceof Resource){if(!(e=Resource.createIfNeeded(e)).isDataUri)return e.url;var i=e.url.match(imageTypeRegex),r="texture_"+ ++this._count;defined(i)&&(r+="."+i[1]);i=e.fetchBlob().then(function(e){t._files[r]=e});return this._promises.push(i),r}if(e instanceof HTMLCanvasElement){var n=when.defer();return this._promises.push(n.promise),r="texture_"+ ++this._count+".png",e.toBlob(function(e){t._files[r]=e,n.resolve()}),r}return""},ExternalFileHandler.prototype.model=function(e,t){var i=this._modelCallback;if(!defined(i))throw new RuntimeError("Encountered a model entity while exporting to KML, but no model callback was supplied.");var r,n,a={},t=i(e,t,a);for(r in a)a.hasOwnProperty(r)&&(n=when(a[r]),this._promises.push(n),n.then(getModelBlobHander(this,r)));return t},Object.defineProperties(ExternalFileHandler.prototype,{promise:{get:function(){return when.all(this._promises)}},files:{get:function(){return this._files}}}),ValueGetter.prototype.get=function(e,t,i){var r;return defaultValue(r=defined(e)?defined(e.getValue)?e.getValue(this._time,i):e:r,t)},ValueGetter.prototype.getColor=function(e,t){t=this.get(e,t);if(defined(t))return colorToString(t)},ValueGetter.prototype.getMaterialType=function(e){if(defined(e))return e.getType(this._time)},StyleCache.prototype.get=function(e){var t=this._ids,i=e.innerHTML;if(defined(t[i]))return t[i];var r="style-"+ ++this._count;return e.setAttribute("id",r),t[i]=r="#"+r,this._styles[i]=e,r},StyleCache.prototype.save=function(e){var t,i=this._styles,r=e.childNodes[0];for(t in i)i.hasOwnProperty(t)&&e.insertBefore(i[t],r)},IdManager.prototype.get=function(e){if(!defined(e))return this.get(createGuid());var t=this._ids;return defined(t[e])?e.toString()+"-"+ ++t[e]:(t[e]=0,e)},exportKml._createState=function(e){var t=e.entities,i=new StyleCache,r=t.computeAvailability(),n=defined(e.time)?e.time:r.start,a=defaultValue(e.defaultAvailability,r),t=defaultValue(e.sampleDuration,60);a.start===Iso8601.MINIMUM_VALUE?a.stop===Iso8601.MAXIMUM_VALUE?a=new TimeInterval:JulianDate.addSeconds(a.stop,-10*t,a.start):a.stop===Iso8601.MAXIMUM_VALUE&&JulianDate.addSeconds(a.start,10*t,a.stop);r=new ExternalFileHandler(e.modelCallback);return{kmlDoc:document.implementation.createDocument(kmlNamespace,"kml"),ellipsoid:defaultValue(e.ellipsoid,Ellipsoid.WGS84),idManager:new IdManager,styleCache:i,externalFileHandler:r,time:n,valueGetter:new ValueGetter(n),sampleDuration:t,defaultAvailability:new TimeIntervalCollection([a])}};var scratchCartesian3$3=new Cartesian3,scratchCartographic$6=new Cartographic,scratchJulianDate=new JulianDate;function createPoint$1(e,t,i,r){var n,a=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,l=defaultValue(t.billboard,t.point);(defined(l)||defined(t.path))&&((n=t.position).isConstant?(s.get(n,void 0,scratchCartesian3$3),n=createBasicElementWithText(a,"coordinates",getCoordinates(scratchCartesian3$3,o)),o=a.createElement("Point"),(a=a.createElement("altitudeMode")).appendChild(getAltitudeMode(e,l.heightReference)),o.appendChild(a),o.appendChild(n),i.push(o),o=(l instanceof BillboardGraphics?createIconStyleFromBillboard:createIconStyleFromPoint)(e,l),r.push(o)):createTracks(e,t,l,i,r))}function createTracks(e,t,i,r,n){var a,o=e.kmlDoc,s=e.ellipsoid,l=e.valueGetter,c=t.position,u=!0;c instanceof CompositePositionProperty?(a=c.intervals,u=!1):a=defaultValue(t.availability,e.defaultAvailability);var d=i instanceof ModelGraphics,h=[];for(D=0;D<a.length;++D){var p=a.get(D),m=u?c:p.data,f=o.createElement("altitudeMode");m instanceof ScaledPositionProperty?(m=m._value,f.appendChild(getAltitudeMode(e,HeightReference$1.CLAMP_TO_GROUND))):defined(i)?f.appendChild(getAltitudeMode(e,i.heightReference)):f.appendChild(getAltitudeMode(e,HeightReference$1.NONE));var g=[],_=[];if(m.isConstant){l.get(m,void 0,scratchCartesian3$3);var y=createBasicElementWithText(o,"coordinates",getCoordinates(scratchCartesian3$3,s));g.push(JulianDate.toIso8601(p.start)),_.push(y),g.push(JulianDate.toIso8601(p.stop)),_.push(y)}else if(m instanceof SampledPositionProperty)for(C=m._property._times,S=0;S<C.length;++S)g.push(JulianDate.toIso8601(C[S])),m.getValueInReferenceFrame(C[S],ReferenceFrame$1.FIXED,scratchCartesian3$3),_.push(getCoordinates(scratchCartesian3$3,s));else if(m instanceof SampledProperty)for(var C=m._times,v=m._values,S=0;S<C.length;++S)g.push(JulianDate.toIso8601(C[S])),Cartesian3.fromArray(v,3*S,scratchCartesian3$3),_.push(getCoordinates(scratchCartesian3$3,s));else{var T=e.sampleDuration;p.start.clone(scratchJulianDate),p.isStartIncluded||JulianDate.addSeconds(scratchJulianDate,T,scratchJulianDate);for(var x=p.stop;JulianDate.lessThan(scratchJulianDate,x);)m.getValue(scratchJulianDate,scratchCartesian3$3),g.push(JulianDate.toIso8601(scratchJulianDate)),_.push(getCoordinates(scratchCartesian3$3,s)),JulianDate.addSeconds(scratchJulianDate,T,scratchJulianDate);p.isStopIncluded&&JulianDate.equals(scratchJulianDate,x)&&(m.getValue(scratchJulianDate,scratchCartesian3$3),g.push(JulianDate.toIso8601(scratchJulianDate)),_.push(getCoordinates(scratchCartesian3$3,s)))}var b=o.createElementNS(gxNamespace,"Track");b.appendChild(f);for(var E=0;E<g.length;++E){var P=createBasicElementWithText(o,"when",g[E]),A=createBasicElementWithText(o,"coord",_[E],gxNamespace);b.appendChild(P),b.appendChild(A)}d&&b.appendChild(createModelGeometry(e,i)),h.push(b)}if(1===h.length)r.push(h[0]);else if(1<h.length){for(var w=o.createElementNS(gxNamespace,"MultiTrack"),D=0;D<h.length;++D)w.appendChild(h[D]);r.push(w)}defined(i)&&!d&&(M=(i instanceof BillboardGraphics?createIconStyleFromBillboard:createIconStyleFromPoint)(e,i),n.push(M));var M,r=t.path;defined(r)&&(M=l.get(r.width),(defined(t=r.material)||defined(M))&&(r=o.createElement("LineStyle"),defined(M)&&r.appendChild(createBasicElementWithText(o,"width",M)),processMaterial(e,t,r),n.push(r)))}function createIconStyleFromPoint(e,t){var i=e.kmlDoc,r=e.valueGetter,n=i.createElement("IconStyle"),e=r.getColor(t.color);defined(e)&&(n.appendChild(createBasicElementWithText(i,"color",e)),n.appendChild(createBasicElementWithText(i,"colorMode","normal")));t=r.get(t.pixelSize);return defined(t)&&n.appendChild(createBasicElementWithText(i,"scale",t/BILLBOARD_SIZE$1)),n}function createIconStyleFromBillboard(e,t){var i=e.kmlDoc,r=e.valueGetter,n=e.externalFileHandler,a=i.createElement("IconStyle"),e=r.get(t.image);defined(e)&&(e=n.texture(e),(s=i.createElement("Icon")).appendChild(createBasicElementWithText(i,"href",e)),defined(o=r.get(t.imageSubRegion))&&(s.appendChild(createBasicElementWithText(i,"x",o.x,gxNamespace)),s.appendChild(createBasicElementWithText(i,"y",o.y,gxNamespace)),s.appendChild(createBasicElementWithText(i,"w",o.width,gxNamespace)),s.appendChild(createBasicElementWithText(i,"h",o.height,gxNamespace))),a.appendChild(s));e=r.getColor(t.color);defined(e)&&(a.appendChild(createBasicElementWithText(i,"color",e)),a.appendChild(createBasicElementWithText(i,"colorMode","normal")));var o=r.get(t.scale);defined(o)&&a.appendChild(createBasicElementWithText(i,"scale",o));var s=r.get(t.pixelOffset);defined(s)&&(o=defaultValue(o,1),Cartesian2.divideByScalar(s,o,s),e=r.get(t.width,BILLBOARD_SIZE$1),l=r.get(t.height,BILLBOARD_SIZE$1),(o=r.get(t.horizontalOrigin,HorizontalOrigin$1.CENTER))===HorizontalOrigin$1.CENTER?s.x-=.5*e:o===HorizontalOrigin$1.RIGHT&&(s.x-=e),(e=r.get(t.verticalOrigin,VerticalOrigin$1.CENTER))===VerticalOrigin$1.TOP?s.y+=l:e===VerticalOrigin$1.CENTER&&(s.y+=.5*l),(l=i.createElement("hotSpot")).setAttribute("x",-s.x),l.setAttribute("y",s.y),l.setAttribute("xunits","pixels"),l.setAttribute("yunits","pixels"),a.appendChild(l));var l=r.get(t.rotation),t=r.get(t.alignedAxis);return defined(l)&&Cartesian3.equals(Cartesian3.UNIT_Z,t)&&(l=CesiumMath.toDegrees(-l),a.appendChild(createBasicElementWithText(i,"heading",l=0===l?360:l))),a}function createLineString$1(e,t,i,r){var n,a,o,s,l=e.kmlDoc,c=e.ellipsoid,u=e.valueGetter;defined(t)&&(s=l.createElement("LineString"),o=l.createElement("altitudeMode"),a=(n=u.get(t.clampToGround,!1))?(s.appendChild(createBasicElementWithText(l,"tessellate",!0)),l.createTextNode("clampToGround")):l.createTextNode("absolute"),o.appendChild(a),s.appendChild(o),o=t.positions,c=createBasicElementWithText(l,"coordinates",getCoordinates(u.get(o),c)),s.appendChild(c),c=u.get(t.zIndex),n&&defined(c)&&s.appendChild(createBasicElementWithText(l,"drawOrder",c,gxNamespace)),i.push(s),s=l.createElement("LineStyle"),defined(u=u.get(t.width))&&s.appendChild(createBasicElementWithText(l,"width",u)),processMaterial(e,t.material,s),r.push(s))}function getRectangleBoundaries(e,t,i){var r=e.kmlDoc,e=e.valueGetter,n=e.get(t.height,0);0<i&&(n=i);for(var t=t.coordinates,a=e.get(t),o=[],s=[Rectangle.northeast,Rectangle.southeast,Rectangle.southwest,Rectangle.northwest],l=0;l<4;++l)s[l](a,scratchCartographic$6),o.push(CesiumMath.toDegrees(scratchCartographic$6.longitude)+","+CesiumMath.toDegrees(scratchCartographic$6.latitude)+","+n);e=createBasicElementWithText(r,"coordinates",o.join(" ")),t=r.createElement("outerBoundaryIs"),r=r.createElement("LinearRing");return r.appendChild(e),t.appendChild(r),[t]}function getLinearRing(e,t,i,r){for(var n=e.kmlDoc,a=e.ellipsoid,o=[],s=t.length,l=0;l<s;++l)Cartographic.fromCartesian(t[l],a,scratchCartographic$6),o.push(CesiumMath.toDegrees(scratchCartographic$6.longitude)+","+CesiumMath.toDegrees(scratchCartographic$6.latitude)+","+(r?scratchCartographic$6.height:i));e=createBasicElementWithText(n,"coordinates",o.join(" ")),n=n.createElement("LinearRing");return n.appendChild(e),n}function getPolygonBoundaries(e,t,i){var r=e.kmlDoc,n=e.valueGetter,a=n.get(t.height,0),o=n.get(t.perPositionHeight,!1);!o&&0<i&&(a=i);var s=[],i=t.hierarchy,t=n.get(i),n=Array.isArray(t)?t:t.positions,i=r.createElement("outerBoundaryIs");i.appendChild(getLinearRing(e,n,a,o)),s.push(i);var l=t.holes;if(defined(l))for(var c=l.length,u=0;u<c;++u){var d=r.createElement("innerBoundaryIs");d.appendChild(getLinearRing(e,l[u].positions,a,o)),s.push(d)}return s}function createPolygon$1(e,t,i,r,n){var a=e.kmlDoc,o=e.valueGetter;if(defined(t)){var s=t instanceof RectangleGraphics;if(s&&"Image"===o.getMaterialType(t.material))createGroundOverlay(e,t,n);else{var l=a.createElement("Polygon"),n=o.get(t.extrudedHeight,0);0<n&&l.appendChild(createBasicElementWithText(a,"extrude",!0));for(var c=(s?getRectangleBoundaries:getPolygonBoundaries)(e,t,n),u=c.length,d=0;d<u;++d)l.appendChild(c[d]);n=a.createElement("altitudeMode");n.appendChild(getAltitudeMode(e,t.heightReference)),l.appendChild(n),i.push(l);n=a.createElement("PolyStyle"),i=o.get(t.fill,!1);i&&n.appendChild(createBasicElementWithText(a,"fill",i)),processMaterial(e,t.material,n);i=o.get(t.outline,!1);i&&(n.appendChild(createBasicElementWithText(a,"outline",i)),e=a.createElement("LineStyle"),i=o.get(t.outlineWidth,1),e.appendChild(createBasicElementWithText(a,"width",i)),t=o.getColor(t.outlineColor,Color.BLACK),e.appendChild(createBasicElementWithText(a,"color",t)),e.appendChild(createBasicElementWithText(a,"colorMode","normal")),r.push(e)),r.push(n)}}}function createGroundOverlay(e,t,i){var r=e.kmlDoc,n=e.valueGetter,a=e.externalFileHandler,o=r.createElement("GroundOverlay"),s=r.createElement("altitudeMode");s.appendChild(getAltitudeMode(e,t.heightReference)),o.appendChild(s);e=n.get(t.height);defined(e)&&o.appendChild(createBasicElementWithText(r,"altitude",e));s=n.get(t.coordinates),e=r.createElement("LatLonBox");e.appendChild(createBasicElementWithText(r,"north",CesiumMath.toDegrees(s.north))),e.appendChild(createBasicElementWithText(r,"south",CesiumMath.toDegrees(s.south))),e.appendChild(createBasicElementWithText(r,"east",CesiumMath.toDegrees(s.east))),e.appendChild(createBasicElementWithText(r,"west",CesiumMath.toDegrees(s.west))),o.appendChild(e);n=n.get(t.material),t=a.texture(n.image),a=r.createElement("Icon");a.appendChild(createBasicElementWithText(r,"href",t)),o.appendChild(a),defined(n.color)&&o.appendChild(createBasicElementWithText(r,"color",colorToString(n.color))),i.push(o)}function createModelGeometry(e,t){var i=e.kmlDoc,r=e.valueGetter,n=e.externalFileHandler,a=i.createElement("Model"),r=r.get(t.scale);defined(r)&&((o=i.createElement("scale")).appendChild(createBasicElementWithText(i,"x",r)),o.appendChild(createBasicElementWithText(i,"y",r)),o.appendChild(createBasicElementWithText(i,"z",r)),a.appendChild(o));var o=i.createElement("Link"),e=n.model(t,e.time);return o.appendChild(createBasicElementWithText(i,"href",e)),a.appendChild(o),a}function createModel(e,t,i,r,n){var a,o,s,l=e.kmlDoc,c=e.ellipsoid,u=e.valueGetter;defined(i)&&((a=t.position).isConstant?(o=createModelGeometry(e,i),(s=l.createElement("altitudeMode")).appendChild(getAltitudeMode(e,i.heightReference)),o.appendChild(s),u.get(a,void 0,scratchCartesian3$3),Cartographic.fromCartesian(scratchCartesian3$3,c,scratchCartographic$6),(c=l.createElement("Location")).appendChild(createBasicElementWithText(l,"longitude",CesiumMath.toDegrees(scratchCartographic$6.longitude))),c.appendChild(createBasicElementWithText(l,"latitude",CesiumMath.toDegrees(scratchCartographic$6.latitude))),c.appendChild(createBasicElementWithText(l,"altitude",scratchCartographic$6.height)),o.appendChild(c),r.push(o)):createTracks(e,t,i,r,n))}function processMaterial(e,t,i){var r=e.kmlDoc,e=e.valueGetter;if(defined(t)){var n=e.get(t);if(defined(n)){switch(e.getMaterialType(t)){case"Image":a=colorToString(Color.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=colorToString(n.color);break;case"PolylineOutline":var a=colorToString(n.color),o=colorToString(n.outlineColor),s=n.outlineWidth;i.appendChild(createBasicElementWithText(r,"outerColor",o,gxNamespace)),i.appendChild(createBasicElementWithText(r,"outerWidth",s,gxNamespace));break;case"Stripe":a=colorToString(n.oddColor)}defined(a)&&(i.appendChild(createBasicElementWithText(r,"color",a)),i.appendChild(createBasicElementWithText(r,"colorMode","normal")))}}}function getAltitudeMode(e,t){var i,r=e.kmlDoc;switch(e.valueGetter.get(t,HeightReference$1.NONE)){case HeightReference$1.NONE:i=r.createTextNode("absolute");break;case HeightReference$1.CLAMP_TO_GROUND:i=r.createTextNode("clampToGround");break;case HeightReference$1.RELATIVE_TO_GROUND:i=r.createTextNode("relativeToGround")}return i}function getCoordinates(e,t){for(var i=(e=!Array.isArray(e)?[e]:e).length,r=[],n=0;n<i;++n)Cartographic.fromCartesian(e[n],t,scratchCartographic$6),r.push(CesiumMath.toDegrees(scratchCartographic$6.longitude)+","+CesiumMath.toDegrees(scratchCartographic$6.latitude)+","+scratchCartographic$6.height);return r.join(" ")}function createBasicElementWithText(e,t,i,r){"boolean"==typeof(i=defaultValue(i,""))&&(i=i?"1":"0");t=defined(r)?e.createElementNS(r,t):e.createElement(t),i="string"===i&&-1!==i.indexOf("<")?e.createCDATASection(i):e.createTextNode(i);return t.appendChild(i),t}function colorToString(e){for(var t="",i=e.toBytes(),r=3;0<=r;--r)t+=i[r]<16?"0"+i[r].toString(16):i[r].toString(16);return t}var tmp$3={},IXg,JXg;IXg=tmp$3,JXg=function(e){function t(e){return e}function m(e){var t,n=h(e.transform),a=1/0,o=a,s=-a,l=-a;function i(e){(e=n(e))[0]<a&&(a=e[0]),e[0]>s&&(s=e[0]),e[1]<o&&(o=e[1]),e[1]>l&&(l=e[1])}function r(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(r);break;case"Point":i(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(i)}}for(t in e.arcs.forEach(function(e){for(var t,i=-1,r=e.length;++i<r;)(t=n(e[i],i))[0]<a&&(a=t[0]),t[0]>s&&(s=t[0]),t[1]<o&&(o=t[1]),t[1]>l&&(l=t[1])}),e.objects)r(e.objects[t]);return[a,o,s,l]}function a(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return i(t,e)})}:i(t,e)}var h=function(e){if(null==e)return t;var a,o,s=e.scale[0],l=e.scale[1],c=e.translate[0],u=e.translate[1];return function(e,t){t||(a=o=0);var i=2,r=e.length,n=new Array(r);for(n[0]=(a+=e[0])*s+c,n[1]=(o+=e[1])*l+u;i<r;)n[i]=e[i],++i;return n}},c=function(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i};function i(e,t){var i=t.id,r=t.bbox,n=null==t.properties?{}:t.properties,t=o(e,t);return null==i&&null==r?{type:"Feature",properties:n,geometry:t}:null==r?{type:"Feature",id:i,properties:n,geometry:t}:{type:"Feature",id:i,bbox:r,properties:n,geometry:t}}function o(e,t){var a=h(e.transform),o=e.arcs;function n(e){return a(e)}function s(e){for(var t=[],i=0,r=e.length;i<r;++i)!function(e,t){t.length&&t.pop();for(var i=o[e<0?~e:e],r=0,n=i.length;r<n;++r)t.push(a(i[r],r));e<0&&c(t,n)}(e[i],t);return t.length<2&&t.push(t[0]),t}function i(e){for(var t=s(e);t.length<4;)t.push(t[0]);return t}function l(e){return e.map(i)}return function e(t){var i,r=t.type;switch(r){case"GeometryCollection":return{type:r,geometries:t.geometries.map(e)};case"Point":i=n(t.coordinates);break;case"MultiPoint":i=t.coordinates.map(n);break;case"LineString":i=s(t.arcs);break;case"MultiLineString":i=t.arcs.map(s);break;case"Polygon":i=l(t.arcs);break;case"MultiPolygon":i=t.arcs.map(l);break;default:return null}return{type:r,coordinates:i}}(t)}function p(o,r){var n={},s={},l={},a=[],c=-1;function e(e,t){for(var i in e){i=e[i];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[e<0?~e:e]=1}),a.push(i)}}return r.forEach(function(e,t){var i=o.arcs[e<0?~e:e];i.length<3&&!i[1][0]&&!i[1][1]&&(i=r[++c],r[c]=e,r[t]=i)}),r.forEach(function(e){var t,i,r=function(e){var t,i=o.arcs[e<0?~e:e],r=i[0];o.transform?(t=[0,0],i.forEach(function(e){t[0]+=e[0],t[1]+=e[1]})):t=i[i.length-1];return e<0?[t,r]:[r,t]}(e),n=r[0],a=r[1];(r=l[n])?(delete l[r.end],r.push(e),r.end=a,(t=s[a])?(delete s[t.start],i=t===r?r:r.concat(t),s[i.start=r.start]=l[i.end=t.end]=i):s[r.start]=l[r.end]=r):(r=s[a])?(delete s[r.start],r.unshift(e),r.start=n,(t=l[n])?(delete l[t.end],i=t===r?r:t.concat(r),s[i.start=t.start]=l[i.end=r.end]=i):s[r.start]=l[r.end]=r):s[(r=[e]).start=n]=l[r.end=a]=r}),e(l,s),e(s,l),r.forEach(function(e){n[e<0?~e:e]||a.push([e])}),a}function r(e,t,i){var r,n,a,o,s,l,c;if(1<arguments.length)o=i,l=[],c=[],function e(t){switch((s=t).type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":d(t.arcs);break;case"MultiLineString":case"Polygon":h(t.arcs);break;case"MultiPolygon":t.arcs.forEach(h)}}(t),c.forEach(null==o?function(e){l.push(e[0].i)}:function(e){o(e[0].g,e[e.length-1].g)&&l.push(e[0].i)}),r=l;else for(n=0,r=new Array(a=e.arcs.length);n<a;++n)r[n]=n;function u(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:s})}function d(e){e.forEach(u)}function h(e){e.forEach(d)}return{type:"MultiLineString",arcs:p(e,r)}}function n(s,e){var l={},i=[],r=[];function n(t){t.forEach(function(e){e.forEach(function(e){(l[e=e<0?~e:e]||(l[e]=[])).push(t)})}),i.push(t)}function c(e){return function(e){for(var t,i=-1,r=e.length,n=e[r-1],a=0;++i<r;)t=n,n=e[i],a+=t[0]*n[1]-t[1]*n[0];return Math.abs(a)}(o(s,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach(function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Polygon":n(t.arcs);break;case"MultiPolygon":t.arcs.forEach(n)}}),i.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,r.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){l[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),i.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:r.map(function(e){var t,i=[];if(e.forEach(function(e){e.forEach(function(e){e.forEach(function(e){l[e<0?~e:e].length<2&&i.push(e)})})}),1<(t=(i=p(s,i)).length))for(var r,n,a=1,o=c(i[0]);a<t;++a)(r=c(i[a]))>o&&(n=i[0],i[0]=i[a],i[a]=n,o=r);return i})}}function f(e,t){for(var i=0,r=e.length;i<r;){var n=i+r>>>1;e[n]<t?i=1+n:r=n}return i}function g(e){if(null==e)return t;var o,s,l=e.scale[0],c=e.scale[1],u=e.translate[0],d=e.translate[1];return function(e,t){t||(o=s=0);var i=2,r=e.length,n=new Array(r),a=Math.round((e[0]-u)/l),t=Math.round((e[1]-d)/c);for(n[0]=a-o,o=a,n[1]=t-s,s=t;i<r;)n[i]=e[i],++i;return n}}function E(n,a,o,e,s){3===arguments.length&&(e=Array,s=null);for(var l=new e(n=1<<Math.max(4,Math.ceil(Math.log(n)/Math.LN2))),c=n-1,t=0;t<n;++t)l[t]=s;return{add:function(e){for(var t=a(e)&c,i=l[t],r=0;i!=s;){if(o(i,e))return!0;if(++r>=n)throw new Error("full hashset");i=l[t=t+1&c]}return l[t]=e,!0},has:function(e){for(var t=a(e)&c,i=l[t],r=0;i!=s;){if(o(i,e))return!0;if(++r>=n)break;i=l[t=t+1&c]}return!1},values:function(){for(var e=[],t=0,i=l.length;t<i;++t){var r=l[t];r!=s&&e.push(r)}return e}}}function P(a,o,s,e,l,t){3===arguments.length&&(e=t=Array,l=null);for(var c=new e(a=1<<Math.max(4,Math.ceil(Math.log(a)/Math.LN2))),u=new t(a),d=a-1,i=0;i<a;++i)c[i]=l;return{set:function(e,t){for(var i=o(e)&d,r=c[i],n=0;r!=l;){if(s(r,e))return u[i]=t;if(++n>=a)throw new Error("full hashmap");r=c[i=i+1&d]}return c[i]=e,u[i]=t},maybeSet:function(e,t){for(var i=o(e)&d,r=c[i],n=0;r!=l;){if(s(r,e))return u[i];if(++n>=a)throw new Error("full hashmap");r=c[i=i+1&d]}return c[i]=e,u[i]=t},get:function(e,t){for(var i=o(e)&d,r=c[i],n=0;r!=l;){if(s(r,e))return u[i];if(++n>=a)break;r=c[i=i+1&d]}return t},keys:function(){for(var e=[],t=0,i=c.length;t<i;++t){var r=c[t];r!=l&&e.push(r)}return e}}}function A(e,t){return e[0]===t[0]&&e[1]===t[1]}function w(e){var t=l[0]^l[1];return 2147483647&(t=t<<5^t>>7^l[2]^l[3])}function v(e){for(var n=e.coordinates,t=e.lines,i=e.rings,r=function(){for(var e=P(1.4*n.length,S,T,Int32Array,-1,Int32Array),t=new Int32Array(n.length),i=0,r=n.length;i<r;++i)t[i]=e.maybeSet(i,i);return t}(),a=new Int32Array(n.length),o=new Int32Array(n.length),s=new Int32Array(n.length),l=new Int8Array(n.length),c=0,u=0,d=n.length;u<d;++u)a[u]=o[u]=s[u]=-1;for(u=0,d=t.length;u<d;++u){var h=t[u],p=h[0],m=h[1],f=r[p],g=r[++p];for(++c,l[f]=1;++p<=m;)v(u,f,f=g,g=r[p]);++c,l[g]=1}for(u=0,d=n.length;u<d;++u)a[u]=-1;for(u=0,d=i.length;u<d;++u){var _=i[u],y=_[0]+1,C=_[1];for(v(u,r[C-1],f=r[y-1],g=r[y]);++y<=C;)v(u,f,f=g,g=r[y])}function v(e,t,i,r){var n;a[i]!==e&&(a[i]=e,0<=(n=o[i])?(e=s[i],n===t&&e===r||n===r&&e===t||(++c,l[i]=1)):(o[i]=t,s[i]=r))}function S(e){return w(n[e])}function T(e,t){return A(n[e],n[t])}var x,a=o=s=null,b=E(1.4*c,w,A);for(u=0,d=n.length;u<d;++u)l[x=r[u]]&&b.add(n[x]);return b}function d(e){for(var t,i,r,n,a,o=v(e),s=e.coordinates,l=e.lines,c=e.rings,u=0,d=l.length;u<d;++u)for(var h=l[u],p=h[0],m=h[1];++p<m;)o.has(s[p])&&(t={0:p,1:h[1]},h[1]=p,h=h.next=t);for(u=0,d=c.length;u<d;++u)for(var f=c[u],g=f[0],_=g,y=f[1],C=o.has(s[g]);++_<y;)o.has(s[_])&&(C?(t={0:_,1:f[1]},f[1]=_,f=f.next=t):(a=(n=y)-_,S(i=s,r=g,n),S(i,r,r+a),S(i,r+a,n),s[y]=s[g],C=!0,_=g));return e}var s=new ArrayBuffer(16),l=new Uint32Array(s);function S(e,t,i){for(var r,n=t+(i---t>>1);t<n;++t,--i)r=e[t],e[t]=e[i],e[i]=r}function _(e){var t,i,u=e.coordinates,r=e.lines,n=e.rings,a=r.length+n.length;for(delete e.lines,delete e.rings,o=0,s=r.length;o<s;++o)for(t=r[o];t=t.next;)++a;for(o=0,s=n.length;o<s;++o)for(i=n[o];i=i.next;)++a;for(var c=P(2*a*1.4,w,A),d=e.arcs=[],o=0,s=r.length;o<s;++o)for(t=r[o];l(t),t=t.next;);for(o=0,s=n.length;o<s;++o)if((i=n[o]).next)for(;l(i),i=i.next;);else!function(e){var t,i,r,n,a;if(i=c.get(t=u[e[0]]))for(n=0,a=i.length;n<a;++n){if(h(r=i[n],e))return e[0]=r[0],e[1]=r[1];if(p(r,e))return e[0]=r[1],e[1]=r[0]}if(i=c.get(t=u[e[0]+m(e)]))for(n=0,a=i.length;n<a;++n){if(h(r=i[n],e))return e[0]=r[0],e[1]=r[1];if(p(r,e))return e[0]=r[1],e[1]=r[0]}i?i.push(e):c.set(t,[e]);d.push(e)}(i);function l(e){var t,i,r,n,a,o,s,l;if(r=c.get(t=u[e[0]]))for(s=0,l=r.length;s<l;++s)if(function(e,t){var i=e[0],r=t[0],n=e[1],t=t[1];if(i-n!=r-t)return!1;for(;i<=n;++i,++r)if(!A(u[i],u[r]))return!1;return!0}(n=r[s],e))return e[0]=n[0],void(e[1]=n[1]);if(a=c.get(i=u[e[1]]))for(s=0,l=a.length;s<l;++s)if(function(e,t){var i=e[0],r=t[0],n=e[1],a=t[1];if(i-n!=r-a)return!1;for(;i<=n;++i,--a)if(!A(u[i],u[a]))return!1;return!0}(o=a[s],e))return e[1]=o[0],void(e[0]=o[1]);r?r.push(e):c.set(t,[e]),a?a.push(e):c.set(i,[e]),d.push(e)}function h(e,t){var i=e[0],r=t[0],n=e[1]-i;if(n==t[1]-r){for(var a=m(e),o=m(t),s=0;s<n;++s)if(!A(u[i+(s+a)%n],u[r+(s+o)%n]))return;return 1}}function p(e,t){var i=e[0],r=t[0],n=e[1],a=t[1],o=n-i;if(o==a-r){for(var s=m(e),l=o-m(t),c=0;c<o;++c)if(!A(u[i+(c+s)%o],u[a-(c+l)%o]))return;return 1}}function m(e){for(var t=e[0],i=e[1],r=t,n=r,a=u[r];++r<i;){var o=u[r];(o[0]<a[0]||o[0]===a[0]&&o[1]<a[1])&&(n=r,a=o)}return n-t}return e}function y(e){var t,i,r={};for(t in e)r[t]=(i=e[t],null==i?{type:null}:("FeatureCollection"===i.type?function(e){var t={type:"GeometryCollection",geometries:e.features.map(u)};null!=e.bbox&&(t.bbox=e.bbox);return t}:"Feature"===i.type?u:C)(i));return r}function u(e){var t,i=C(e.geometry);for(t in null!=e.id&&(i.id=e.id),null!=e.bbox&&(i.bbox=e.bbox),e.properties){i.properties=e.properties;break}return i}function C(e){if(null==e)return{type:null};var t="GeometryCollection"===e.type?{type:"GeometryCollection",geometries:e.geometries.map(C)}:"Point"===e.type||"MultiPoint"===e.type?{type:e.type,coordinates:e.coordinates}:{type:e.type,arcs:e.coordinates};return null!=e.bbox&&(t.bbox=e.bbox),t}function T(e){var t=e[0],i=e[1];return i<t&&(e=t,t=i,i=e),t+31*i}function x(e,t){var i,r=e[0],n=e[1],e=t[0],t=t[1];return n<r&&(i=r,r=n,n=i),t<e&&(i=e,e=t,t=i),r===e&&n===t}function b(){return!0}function D(e){return e}function M(e){return null!=e.type}function I(e){var t,l=new Array(e.arcs.length),c=0;function i(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(i);break;case"Polygon":r(e.arcs);break;case"MultiPolygon":e.arcs.forEach(r)}}function r(e){for(var t=0,i=e.length;t<i;++t,++c)for(var r=e[t],n=0,a=r.length;n<a;++n){var o=r[n],s=l[o=o<0?~o:o];null==s?l[o]=c:s!==c&&(l[o]=-1)}}for(t in e.objects)i(e.objects[t]);return function(e){for(var t,i=0,r=e.length;i<r;++i)if(-1===l[(t=e[i])<0?~t:t])return!0;return!1}}function R(e){var t=e[0],i=e[1],e=e[2];return Math.abs((t[0]-e[0])*(i[1]-t[1])-(t[0]-i[0])*(e[1]-t[1]))/2}function O(e){for(var t,i=-1,r=e.length,n=e[r-1],a=0;++i<r;)t=n,n=e[i],a+=t[0]*n[1]-t[1]*n[0];return Math.abs(a)/2}function L(i,r,n){return r=null==r?Number.MIN_VALUE:+r,null==n&&(n=O),function(e,t){return n(a(i,{type:"Polygon",arcs:[e]}).geometry.coordinates[0],t)>=r}}function F(e,t){return e[1][2]-t[1][2]}function N(e){return[e[0],e[1],0]}function B(e,t){return t-e}var s=Math.PI,V=2*s,k=s/4,z=s/180,$=Math.abs,U=Math.atan2,G=Math.cos,H=Math.sin;function W(e,t){for(var i=0,r=e.length,n=0,a=(c=e[t?i++:r-1])[0]*z,o=c[1]*z/2+k,s=G(o),l=H(o);i<r;++i){var c,u=a,a=(c=e[i])[0]*z,o=c[1]*z/2+k,d=s,s=G(o),h=a-u,p=0<=h?1:-1,u=p*h,h=l*(l=H(o)),d=d*s+h*G(u),u=h*p*H(u);n+=U(u,d)}return n}e.bbox=m,e.feature=a,e.mesh=function(e){return o(e,r.apply(this,arguments))},e.meshArcs=r,e.merge=function(e){return o(e,n.apply(this,arguments))},e.mergeArcs=n,e.neighbors=function(e){var r={},t=e.map(function(){return[]});function i(e,i){e.forEach(function(e){var t=r[e=e<0?~e:e];t?t.push(i):r[e]=[i]})}function n(e,t){e.forEach(function(e){i(e,t)})}var a,o={LineString:i,MultiLineString:n,Polygon:n,MultiPolygon:function(e,t){e.forEach(function(e){n(e,t)})}};for(a in e.forEach(function t(e,i){"GeometryCollection"===e.type?e.geometries.forEach(function(e){t(e,i)}):e.type in o&&o[e.type](e.arcs,i)}),r)for(var s=r[a],l=s.length,c=0;c<l;++c)for(var u=c+1;u<l;++u){var d,h=s[c],p=s[u];(d=t[h])[a=f(d,p)]!==p&&d.splice(a,0,p),(d=t[p])[a=f(d,h)]!==h&&d.splice(a,0,h)}return t},e.quantize=function(e,t){if(e.transform)throw new Error("already quantized");if(t&&t.scale)s=e.bbox;else{if(!(2<=(i=Math.floor(t))))throw new Error("n must be ≥2");var i,r=(s=e.bbox||m(e))[0],n=s[1],a=s[2],o=s[3];t={scale:[a-r?(a-r)/(i-1):1,o-n?(o-n)/(i-1):1],translate:[r,n]}}var s,l,c=g(t),u=e.objects,d={};function h(e){return c(e)}function p(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(p)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(l in u)d[l]=p(u[l]);return{type:"Topology",bbox:s,transform:t,objects:d,arcs:e.arcs.map(function(e){var t,i=0,r=1,n=e.length,a=new Array(n);for(a[0]=c(e[0],0);++i<n;)((t=c(e[i],i))[0]||t[1])&&(a[r++]=t);return 1===r&&(a[r++]=[0,0]),a.length=r,a})}},e.transform=h,e.untransform=g,e.topology=function(e,t){var i=function(e){var i=1/0,r=1/0,n=-1/0,a=-1/0;function t(e){null!=e&&s.hasOwnProperty(e.type)&&s[e.type](e)}var o,s={GeometryCollection:function(e){e.geometries.forEach(t)},Point:function(e){l(e.coordinates)},MultiPoint:function(e){e.coordinates.forEach(l)},LineString:function(e){c(e.arcs)},MultiLineString:function(e){e.arcs.forEach(c)},Polygon:function(e){e.arcs.forEach(c)},MultiPolygon:function(e){e.arcs.forEach(u)}};function l(e){var t=e[0],e=e[1];t<i&&(i=t),n<t&&(n=t),e<r&&(r=e),a<e&&(a=e)}function c(e){e.forEach(l)}function u(e){e.forEach(c)}for(o in e)t(e[o]);return i<=n&&r<=a?[i,r,n,a]:void 0}(e=y(e)),r=0<t&&i&&function(e,t,i){var u=t[0],d=t[1],r=t[2],t=t[3],h=r-u?(i-1)/(r-u):1,p=t-d?(i-1)/(t-d):1;function n(e){return[Math.round((e[0]-u)*h),Math.round((e[1]-d)*p)]}function a(e,t){for(var i,r,n,a,o=-1,s=0,l=e.length,c=new Array(l);++o<l;)a=e[o],n=Math.round((a[0]-u)*h),a=Math.round((a[1]-d)*p),n===i&&a===r||(c[s++]=[i=n,r=a]);for(c.length=s;s<t;)s=c.push([c[0][0],c[0][1]]);return c}function o(e){return a(e,2)}function s(e){return a(e,4)}function l(e){return e.map(s)}function c(e){null!=e&&f.hasOwnProperty(e.type)&&f[e.type](e)}var m,f={GeometryCollection:function(e){e.geometries.forEach(c)},Point:function(e){e.coordinates=n(e.coordinates)},MultiPoint:function(e){e.coordinates=e.coordinates.map(n)},LineString:function(e){e.arcs=o(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(o)},Polygon:function(e){e.arcs=l(e.arcs)},MultiPolygon:function(e){e.arcs=e.arcs.map(l)}};for(m in e)c(e[m]);return{scale:[1/h,1/p],translate:[u,d]}}(e,i,t),t=_(d(function(e){var n=-1,a=[],o=[],s=[];function t(e){e&&r.hasOwnProperty(e.type)&&r[e.type](e)}var i,r={GeometryCollection:function(e){e.geometries.forEach(t)},LineString:function(e){e.arcs=l(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(l)},Polygon:function(e){e.arcs=e.arcs.map(c)},MultiPolygon:function(e){e.arcs=e.arcs.map(u)}};function l(e){for(var t=0,i=e.length;t<i;++t)s[++n]=e[t];var r={0:n-i+1,1:n};return a.push(r),r}function c(e){for(var t=0,i=e.length;t<i;++t)s[++n]=e[t];var r={0:n-i+1,1:n};return o.push(r),r}function u(e){return e.map(c)}for(i in e)t(e[i]);return{type:"Topology",coordinates:s,lines:a,rings:o,objects:e}}(e))),n=t.coordinates,a=P(1.4*t.arcs.length,T,x);function o(e){e&&l.hasOwnProperty(e.type)&&l[e.type](e)}e=t.objects,t.bbox=i,t.arcs=t.arcs.map(function(e,t){return a.set(e,t),n.slice(e[0],e[1]+1)}),delete t.coordinates;var s,n=null,l={GeometryCollection:function(e){e.geometries.forEach(o)},LineString:function(e){e.arcs=c(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(c)},Polygon:function(e){e.arcs=e.arcs.map(c)},MultiPolygon:function(e){e.arcs=e.arcs.map(u)}};function c(e){var t=[];do{var i=a.get(e)}while(t.push(e[0]<e[1]?i:~i),e=e.next);return t}function u(e){return e.map(c)}for(s in e)o(e[s]);return r&&(t.transform=r,t.arcs=function(e){for(var t=-1,i=e.length;++t<i;){for(var r,n,a=e[t],o=0,s=1,l=a.length,c=a[0],u=c[0],d=c[1];++o<l;)r=(c=a[o])[0],n=c[1],r===u&&n===d||(a[s++]=[r-u,n-d],u=r,d=n);1===s&&(a[s++]=[0,0]),a.length=s}return e}(t.arcs)),t},e.filter=function(e,i){var t,r=e.objects,n={};function a(e){var t,i;switch(e.type){case"Polygon":t=(i=o(e.arcs))?{type:"Polygon",arcs:i}:{type:null};break;case"MultiPolygon":t=(i=e.arcs.map(o).filter(D)).length?{type:"MultiPolygon",arcs:i}:{type:null};break;case"GeometryCollection":t=(i=e.geometries.map(a).filter(M)).length?{type:"GeometryCollection",geometries:i}:{type:null};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function o(e){return e.length&&(t=e[0],i(t,!1))?[e[0]].concat(e.slice(1).filter(s)):null;var t}function s(e){return i(e,!0)}for(t in null==i&&(i=b),r)n[t]=a(r[t]);return function(e){var t,i,r=e.objects,n={},a=e.arcs,o=a.length,s=-1,l=new Array(o),c=0,u=-1;function d(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(d);break;case"LineString":p(e.arcs);break;case"MultiLineString":case"Polygon":e.arcs.forEach(p);break;case"MultiPolygon":e.arcs.forEach(m)}}function h(e){l[e=e<0?~e:e]||(l[e]=1,++c)}function p(e){e.forEach(h)}function m(e){e.forEach(p)}function f(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(f)};break;case"LineString":t={type:"LineString",arcs:_(e.arcs)};break;case"MultiLineString":t={type:"MultiLineString",arcs:e.arcs.map(_)};break;case"Polygon":t={type:"Polygon",arcs:e.arcs.map(_)};break;case"MultiPolygon":t={type:"MultiPolygon",arcs:e.arcs.map(y)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function g(e){return e<0?~l[~e]:l[e]}function _(e){return e.map(g)}function y(e){return e.map(_)}for(i in r)d(r[i]);for(t=new Array(c);++s<o;)l[s]&&(l[s]=++u,t[u]=a[s]);for(i in r)n[i]=f(r[i]);return{type:"Topology",bbox:e.bbox,transform:e.transform,objects:n,arcs:t}}({type:"Topology",bbox:e.bbox,transform:e.transform,objects:n,arcs:e.arcs})},e.filterAttached=I,e.filterAttachedWeight=function(e,t,i){var r=I(e),n=L(e,t,i);return function(e,t){return r(e,t)||n(e,t)}},e.filterWeight=L,e.planarRingArea=O,e.planarTriangleArea=R,e.presimplify=function(e,l){var o,s,c=e.transform?h(e.transform):N,u=(o=[],s=0,(t={}).push=function(e){return r(o[e._=s]=e,s++),s},t.pop=function(){if(!(s<=0)){var e,t=o[0];return 0<--s&&(e=o[s],n(o[e._=0]=e,0)),t}},t.remove=function(e){var t,i=e._;if(o[i]===e)return i!==--s&&(F(t=o[s],e)<0?r:n)(o[t._=i]=t,i),i},t);function r(e,t){for(;0<t;){var i=(t+1>>1)-1,r=o[i];if(0<=F(e,r))break;o[r._=t]=r,o[e._=t=i]=e}}function n(e,t){for(;;){var i=t+1<<1,r=i-1,n=t,a=o[n];if(r<s&&F(o[r],a)<0&&(a=o[n=r]),i<s&&F(o[i],a)<0&&(a=o[n=i]),n===t)break;o[a._=t]=a,o[e._=t=n]=e}}null==l&&(l=R);var t=e.arcs.map(function(e){for(var t,i,r=[],n=0,a=(e=e.map(c)).length-(i=1);i<a;++i)(t=[e[i-1],e[i],e[i+1]])[1][2]=l(t),r.push(t),u.push(t);for(e[0][2]=e[a][2]=1/0,i=0,a=r.length;i<a;++i)(t=r[i]).previous=r[i-1],t.next=r[i+1];for(;t=u.pop();){var o=t.previous,s=t.next;t[1][2]<n?t[1][2]=n:n=t[1][2],o&&(o.next=s,o[2]=t[2],d(o)),s&&(s.previous=o,s[0]=t[0],d(s))}return e});function d(e){u.remove(e),e[1][2]=l(e),u.push(e)}return{type:"Topology",bbox:e.bbox,objects:e.objects,arcs:t}},e.quantile=function(e,t){var i=[];return e.arcs.forEach(function(e){e.forEach(function(e){isFinite(e[2])&&i.push(e[2])})}),i.length&&function(e,t){if(r=e.length){if((t=+t)<=0||r<2)return e[0];if(1<=t)return e[r-1];var i=(r-1)*t,r=Math.floor(i),t=e[r],e=e[r+1];return t+(e-t)*(i-r)}}(i.sort(B),t)},e.simplify=function(e,o){o=null==o?Number.MIN_VALUE:+o;var t=e.arcs.map(function(e){for(var t,i=-1,r=0,n=e.length,a=new Array(n);++i<n;)(t=e[i])[2]>=o&&(a[r++]=[t[0],t[1]]);return a.length=r,a});return{type:"Topology",transform:e.transform,bbox:e.bbox,objects:e.objects,arcs:t}},e.sphericalRingArea=function(e,t){return e=W(e,!0),t&&(e*=-1),2*(e<0?V+e:e)},e.sphericalTriangleArea=function(e){return 2*$(W(e,!1))},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?JXg(exports):JXg(IXg.topojson=IXg.topojson||{});var topojson=tmp$3.topojson;function defaultCrsFunction(e){return Cartesian3.fromDegrees(e[0],e[1],e[2])}var crsNames={"urn:ogc:def:crs:OGC:1.3:CRS84":defaultCrsFunction,"EPSG:4326":defaultCrsFunction,"urn:ogc:def:crs:EPSG::4326":defaultCrsFunction},crsLinkHrefs={},crsLinkTypes={},defaultMarkerSize=48,defaultMarkerSymbol,defaultMarkerColor=Color.ROYALBLUE,defaultStroke=Color.YELLOW,defaultStrokeWidth=2,defaultFill=Color.fromBytes(255,255,0,100),defaultClampToGround=!1,sizes={small:24,medium:48,large:64},simpleStyleIdentifiers=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function defaultDescribe(e,t){var i,r,n="";for(i in e)!e.hasOwnProperty(i)||i===t||-1!==simpleStyleIdentifiers.indexOf(i)||defined(r=e[i])&&(n+="object"==typeof r?"<tr><th>"+i+"</th><td>"+defaultDescribe(r)+"</td></tr>":"<tr><th>"+i+"</th><td>"+r+"</td></tr>");return n=0<n.length?'<table class="cesium-infoBox-defaultTable"><tbody>'+n+"</tbody></table>":n}function createDescriptionCallback(i,r,n){var a;return function(e,t){return a=!defined(a)?i(r,n):a}}function defaultDescribeProperty(e,t){return new CallbackProperty(createDescriptionCallback(defaultDescribe,e,t),!0)}function createObject(e,t,i){var r=e.id;if(defined(r)&&"Feature"===e.type){for(var n=2,a=r;defined(t.getById(a));)a=r+"_"+n,n++;r=a}else r=createGuid();var o=t.getOrCreateEntity(r),s=e.properties;if(defined(s)){var l,e=(o.properties=s).title;if(defined(e))o.name=e,l="title";else{var c,u=Number.MAX_VALUE;for(c in s)if(s.hasOwnProperty(c)&&s[c]){var d=c.toLowerCase();if(1<u&&"title"===d){u=1,l=c;break}2<u&&"name"===d?(u=2,l=c):3<u&&/title/i.test(c)?(u=3,l=c):4<u&&/name/i.test(c)&&(u=4,l=c)}defined(l)&&(o.name=s[l])}e=s.description;null!==e&&(o.description=defined(e)?new ConstantProperty(e):i(s,l))}return o}function coordinatesArrayToCartesianArray(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++)i[r]=t(e[r]);return i}var geoJsonObjectTypes={Feature:processFeature$1,FeatureCollection:processFeatureCollection,GeometryCollection:processGeometryCollection,LineString:processLineString,MultiLineString:processMultiLineString,MultiPoint:processMultiPoint,MultiPolygon:processMultiPolygon,Point:processPoint$1,Polygon:processPolygon$1,Topology:processTopology},geometryTypes$1={GeometryCollection:processGeometryCollection,LineString:processLineString,MultiLineString:processMultiLineString,MultiPoint:processMultiPoint,MultiPolygon:processMultiPolygon,Point:processPoint$1,Polygon:processPolygon$1,Topology:processTopology};function processFeature$1(e,t,i,r,n){if(null!==t.geometry){if(!defined(t.geometry))throw new RuntimeError("feature.geometry is required.");var a=t.geometry.type,o=geometryTypes$1[a];if(!defined(o))throw new RuntimeError("Unknown geometry type: "+a);o(e,t,t.geometry,r,n)}else createObject(t,e._entityCollection,n.describe)}function processFeatureCollection(e,t,i,r,n){for(var a=t.features,o=0,s=a.length;o<s;o++)processFeature$1(e,a[o],void 0,r,n)}function processGeometryCollection(e,t,i,r,n){for(var a=i.geometries,o=0,s=a.length;o<s;o++){var l=a[o],c=l.type,u=geometryTypes$1[c];if(!defined(u))throw new RuntimeError("Unknown geometry type: "+c);u(e,t,l,r,n)}}function createPoint(e,t,i,r,n){var a,o=n.markerSymbol,s=n.markerColor,l=n.markerSize,c=t.properties;defined(c)&&(defined(a=c["marker-color"])&&(s=Color.fromCssColorString(a)),l=defaultValue(sizes[c["marker-size"]],l),defined(c=c["marker-symbol"])&&(o=c));var o=defined(o)?1===o.length?e._pinBuilder.fromText(o.toUpperCase(),s,l):e._pinBuilder.fromMakiIconId(o,s,l):e._pinBuilder.fromColor(s,l),u=new BillboardGraphics;u.verticalOrigin=new ConstantProperty(VerticalOrigin$1.BOTTOM),2===r.length&&n.clampToGround&&(u.heightReference=HeightReference$1.CLAMP_TO_GROUND);n=createObject(t,e._entityCollection,n.describe);n.billboard=u,n.position=new ConstantPositionProperty(i(r));o=when(o).then(function(e){u.image=new ConstantProperty(e)}).otherwise(function(){u.image=new ConstantProperty(e._pinBuilder.fromColor(s,l))});e._promises.push(o)}function processPoint$1(e,t,i,r,n){createPoint(e,t,r,i.coordinates,n)}function processMultiPoint(e,t,i,r,n){for(var a=i.coordinates,o=0;o<a.length;o++)createPoint(e,t,r,a[o],n)}function createLineString(e,t,i,r,n){var a,o,s=n.strokeMaterialProperty,l=n.strokeWidthProperty,c=t.properties;defined(c)&&(defined(o=c["stroke-width"])&&(l=new ConstantProperty(o)),defined(o=c.stroke)&&(a=Color.fromCssColorString(o)),defined(c=c["stroke-opacity"])&&1!==c&&((a=!defined(a)?s.color.clone():a).alpha=c),defined(a)&&(s=new ColorMaterialProperty(a)));t=createObject(t,e._entityCollection,n.describe),e=new PolylineGraphics;(t.polyline=e).clampToGround=n.clampToGround,e.material=s,e.width=l,e.positions=new ConstantProperty(coordinatesArrayToCartesianArray(r,i)),e.arcType=ArcType$1.RHUMB}function processLineString(e,t,i,r,n){createLineString(e,t,r,i.coordinates,n)}function processMultiLineString(e,t,i,r,n){for(var a=i.coordinates,o=0;o<a.length;o++)createLineString(e,t,r,a[o],n)}function createPolygon(e,t,i,r,n){if(0!==r.length&&0!==r[0].length){var a,o,s=n.strokeMaterialProperty.color,l=n.fillMaterialProperty,c=n.strokeWidthProperty,u=t.properties;defined(u)&&(defined(a=u["stroke-width"])&&(c=new ConstantProperty(a)),defined(a=u.stroke)&&(o=Color.fromCssColorString(a)),defined(a=u["stroke-opacity"])&&1!==a&&((o=!defined(o)?n.strokeMaterialProperty.color.clone():o).alpha=a),defined(o)&&(s=new ConstantProperty(o)),defined(o=u.fill)&&((d=Color.fromCssColorString(o)).alpha=l.color.alpha),defined(a=u["fill-opacity"])&&a!==l.color.alpha&&((d=!defined(d)?l.color.clone():d).alpha=a),defined(d)&&(l=new ColorMaterialProperty(d)));var d=new PolygonGraphics;d.outline=new ConstantProperty(!0),d.outlineColor=s,d.outlineWidth=c,d.material=l,d.arcType=ArcType$1.RHUMB;for(var h=[],p=1,m=r.length;p<m;p++)h.push(new PolygonHierarchy(coordinatesArrayToCartesianArray(r[p],i)));l=r[0];d.hierarchy=new ConstantProperty(new PolygonHierarchy(coordinatesArrayToCartesianArray(l,i),h)),2<l[0].length?d.perPositionHeight=new ConstantProperty(!0):n.clampToGround||(d.height=0),createObject(t,e._entityCollection,n.describe).polygon=d}}function processPolygon$1(e,t,i,r,n){createPolygon(e,t,r,i.coordinates,n)}function processMultiPolygon(e,t,i,r,n){for(var a=i.coordinates,o=0;o<a.length;o++)createPolygon(e,t,r,a[o],n)}function processTopology(e,t,i,r,n){for(var a in i.objects)i.objects.hasOwnProperty(a)&&(a=topojson.feature(i,i.objects[a]),(0,geoJsonObjectTypes[a.type])(e,a,a,r,n))}function GeoJsonDataSource(e){this._name=e,this._changed=new Event,this._error=new Event,this._isLoading=!1,this._loading=new Event,this._entityCollection=new EntityCollection(this),this._promises=[],this._pinBuilder=new PinBuilder,this._entityCluster=new EntityCluster,this._credit=void 0,this._resourceCredits=[]}function load$1(t,i,r,e){defined(e)&&(s=getFilenameFromUri(e)),defined(s)&&t._name!==s&&(t._name=s,t._changed.raiseEvent(t));var n=geoJsonObjectTypes[i.type];if(!defined(n))throw new RuntimeError("Unsupported GeoJSON object type: "+i.type);var a=i.crs,o=null!==a?defaultCrsFunction:null;if(defined(a)){if(!defined(a.properties))throw new RuntimeError("crs.properties is undefined.");e=a.properties;if("name"===a.type){if(!defined(o=crsNames[e.name]))throw new RuntimeError("Unknown crs name: "+e.name)}else if("link"===a.type){var s=crsLinkHrefs[e.href];if(defined(s)||(s=crsLinkTypes[e.type]),!defined(s))throw new RuntimeError("Unable to resolve crs link: "+JSON.stringify(e));o=s(e)}else{if("EPSG"!==a.type)throw new RuntimeError("Unknown crs type: "+a.type);if(!defined(o=crsNames["EPSG:"+e.code]))throw new RuntimeError("Unknown crs EPSG code: "+e.code)}}return when(o,function(e){return t._entityCollection.removeAll(),null!==e&&n(t,i,i,e,r),when.all(t._promises,function(){return t._promises.length=0,DataSource.setLoading(t,!1),t})})}function KmlCamera(e,t){this.position=e,this.headingPitchRoll=t}GeoJsonDataSource.load=function(e,t){return(new GeoJsonDataSource).load(e,t)},Object.defineProperties(GeoJsonDataSource,{markerSize:{get:function(){return defaultMarkerSize},set:function(e){defaultMarkerSize=e}},markerSymbol:{get:function(){return defaultMarkerSymbol},set:function(e){defaultMarkerSymbol=e}},markerColor:{get:function(){return defaultMarkerColor},set:function(e){defaultMarkerColor=e}},stroke:{get:function(){return defaultStroke},set:function(e){defaultStroke=e}},strokeWidth:{get:function(){return defaultStrokeWidth},set:function(e){defaultStrokeWidth=e}},fill:{get:function(){return defaultFill},set:function(e){defaultFill=e}},clampToGround:{get:function(){return defaultClampToGround},set:function(e){defaultClampToGround=e}},crsNames:{get:function(){return crsNames}},crsLinkHrefs:{get:function(){return crsLinkHrefs}},crsLinkTypes:{get:function(){return crsLinkTypes}}}),Object.defineProperties(GeoJsonDataSource.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}}}),GeoJsonDataSource.prototype.load=function(e,t){DataSource.setLoading(this,!0);var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).credit;"string"==typeof i&&(i=new Credit(i)),this._credit=i;var i=e,r=t.sourceUri;if("string"==typeof e||e instanceof Resource){var i=(e=Resource.createIfNeeded(e)).fetchJson(),r=defaultValue(r,e.getUrlComponent()),n=this._resourceCredits,a=e.credits;if(defined(a))for(var o=a.length,s=0;s<o;s++)n.push(a[s])}t={describe:defaultValue(t.describe,defaultDescribeProperty),markerSize:defaultValue(t.markerSize,defaultMarkerSize),markerSymbol:defaultValue(t.markerSymbol,defaultMarkerSymbol),markerColor:defaultValue(t.markerColor,defaultMarkerColor),strokeWidthProperty:new ConstantProperty(defaultValue(t.strokeWidth,defaultStrokeWidth)),strokeMaterialProperty:new ColorMaterialProperty(defaultValue(t.stroke,defaultStroke)),fillMaterialProperty:new ColorMaterialProperty(defaultValue(t.fill,defaultFill)),clampToGround:defaultValue(t.clampToGround,defaultClampToGround)};var l=this;return when(i,function(e){return load$1(l,e,t,r)}).otherwise(function(e){return DataSource.setLoading(l,!1),l._error.raiseEvent(l,e),console.log(e),when.reject(e)})},GeoJsonDataSource.prototype.update=function(e){return!0};var tmp$2={},Feh,Jeh,Keh,Leh,Neh,Oeh,Peh,Qeh,Reh,Seh,Teh,Ueh,Veh,Weh,Xeh,Yeh,Zeh,bfh,cfh,dfh,efh,ffh,gfh,hfh,ifh,jfh,kfh,lfh,mfh,nfh,ofh,pfh,qfh,sfh;function Aeh(e,t,i){var r;return e.length>t&&(r=null==i?(i="…",3):i.length,e=e.substring(0,t-r)+i),e}function Beh(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1}function Ceh(e,t){for(var i=e.length-1;0<=i;i--)!0===t(e[i])&&e.splice(i,1)}function Eeh(e){throw new Error("Unhandled case for value: '"+e+"'")}function Meh(e,t){function i(){this.constructor=e}Leh(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}tmp$2.Autolinker=(Feh=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,i=this.getClass(),r=this.whitespaceRegex,n=i?i.split(r):[],a=e.split(r);t=a.shift();)-1===Beh(n,t)&&n.push(t);return this.getAttrs().class=n.join(" "),this},e.prototype.removeClass=function(e){for(var t,i=this.getClass(),r=this.whitespaceRegex,n=i?i.split(r):[],a=e.split(r);n.length&&(t=a.shift());){var o=Beh(n,t);-1!==o&&n.splice(o,1)}return this.getAttrs().class=n.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e,t=this.getAttrs(),i=[];for(e in t)t.hasOwnProperty(e)&&i.push(e+'="'+t[e]+'"');return i.join(" ")},e}(),Jeh=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new Feh({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},i=this.createCssClass(e);return i&&(t.class=i),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var i=[t],r=e.getCssClassSuffixes(),n=0,a=r.length;n<a;n++)i.push(t+"-"+r[n]);return i.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var i=t.length,t=t.location;return("smart"===t?function(e,t,n){var i;i=null==n?(n="…",c=3,8):(c=n.length,n.length);function r(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function a(e,t){var i=t/2,r=Math.ceil(i),t=-1*Math.floor(i),i="";return t<0&&(i=e.substr(t)),e.substr(0,r)+n+i}if(e.length<=t)return e;var o=t-c,s=function(e){var t={},i=e,e=i.match(/^([a-z]+):\/\//i);return e&&(t.scheme=e[1],i=i.substr(e[0].length)),(e=i.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=e[1],i=i.substr(e[0].length)),(e=i.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=e[1],i=i.substr(e[0].length)),(e=i.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=e[1],i=i.substr(e[0].length)),(e=i.match(/^#(.*?)$/i))&&(t.fragment=e[1]),t}(e);{var l;!s.query||(l=s.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i))&&(s.query=s.query.substr(0,l[1].length),e=r(s))}if(e.length<=t)return e;s.host&&(s.host=s.host.replace(/^www\./,""),e=r(s));if(e.length<=t)return e;e="";s.host&&(e+=s.host);if(e.length>=o)return(s.host.length==t?s.host.substr(0,t-c)+n:a(e,o)).substr(0,o+i);var c="";s.path&&(c+="/"+s.path);s.query&&(c+="?"+s.query);if(c){if(o<=(e+c).length){if((e+c).length==t)return(e+c).substr(0,t);var u=o-e.length;return(e+a(c,u)).substr(0,o+i)}e+=c}if(s.fragment){u="#"+s.fragment;if(o<=(e+u).length){if((e+u).length==t)return(e+u).substr(0,t);c=o-e.length;return(e+a(u,c)).substr(0,o+i)}e+=u}if(s.scheme&&s.host){s=s.scheme+"://";if((e+s).length<o)return(s+e).substr(0,t)}if(e.length<=t)return e;t="";0<o&&(t=e.substr(-1*Math.floor(o/2)));return(e.substr(0,Math.ceil(o/2))+n+t).substr(0,o+i)}:"middle"===t?function(e,t,i){if(e.length<=t)return e;var r;n=null==i?(i="…",r=8,3):(r=i.length,i.length);var t=t-n,n="";0<t&&(n=e.substr(-1*Math.floor(t/2)));return(e.substr(0,Math.ceil(t/2))+i+n).substr(0,t+r)}:Aeh)(e,i)},e}(),Keh=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),Leh=function(e,t){return(Leh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},Neh=function(){return(Neh=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Oeh=function(i){function e(e){var t=i.call(this,e)||this;return t.email="",t.email=e.email,t}return Meh(e,i),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(Keh),Peh=function(i){function e(e){var t=i.call(this,e)||this;return t.serviceName="",t.hashtag="",t.serviceName=e.serviceName,t.hashtag=e.hashtag,t}return Meh(e,i),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e}(Keh),Qeh=function(i){function e(e){var t=i.call(this,e)||this;return t.serviceName="twitter",t.mention="",t.mention=e.mention,t.serviceName=e.serviceName,t}return Meh(e,i),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.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;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var e=i.prototype.getCssClassSuffixes.call(this),t=this.getServiceName();return t&&e.push(t),e},e}(Keh),Reh=function(i){function e(e){var t=i.call(this,e)||this;return t.number="",t.plusSign=!1,t.number=e.number,t.plusSign=e.plusSign,t}return Meh(e,i),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(Keh),Seh=function(i){function e(e){var t=i.call(this,e)||this;return t.url="",t.urlMatchType="scheme",t.protocolUrlMatch=!1,t.protocolRelativeMatch=!1,t.stripPrefix={scheme:!0,www:!0},t.stripTrailingSlash=!0,t.decodePercentEncoding=!0,t.schemePrefixRegex=/^(https?:\/\/)?/i,t.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,t.protocolRelativeRegex=/^\/\//,t.protocolPrepended=!1,t.urlMatchType=e.urlMatchType,t.url=e.url,t.protocolUrlMatch=e.protocolUrlMatch,t.protocolRelativeMatch=e.protocolRelativeMatch,t.stripPrefix=e.stripPrefix,t.stripTrailingSlash=e.stripTrailingSlash,t.decodePercentEncoding=e.decodePercentEncoding,t}return Meh(e,i),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},e.prototype.getAnchorHref=function(){return this.getUrl().replace(/&/g,"&")},e.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),e=this.decodePercentEncoding?this.removePercentEncoding(e):e},e.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},e.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},e.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},e.prototype.removeTrailingSlash=function(e){return e="/"===e.charAt(e.length-1)?e.slice(0,-1):e},e.prototype.removePercentEncoding=function(t){t=t.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch(e){return t}},e}(Keh),Teh=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},Ueh=/[A-Za-z]/,Veh=/[0-9]/,Weh=/\s/,Xeh=/['"]/,Yeh=/[\x00-\x1F\x7F]/,efh="(?:["+(bfh=/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)+"]{1,3}\\.){3}["+bfh+"]{1,3}",ffh="["+(dfh=cfh=(Zeh=/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)+/\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff/.source+/\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+bfh)+"](?:["+dfh+"\\-]{0,61}["+dfh+"])?",gfh=function(e){return"(?=("+ffh+"))\\"+e},hfh=function(e){return"(?:"+gfh(e)+"(?:\\."+gfh(e+1)+"){0,126}|"+efh+")"},ifh=new RegExp("["+dfh+"]"),jfh=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|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|rightathome|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--estv75g|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--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|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--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|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|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--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|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|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|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|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|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|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|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|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|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|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|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|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|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|doha|duck|duns|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|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|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|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|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|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|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|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|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|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|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|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|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|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|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|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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,kfh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.localPartCharRegex=new RegExp("["+dfh+"!#$%&'*+/=?^_`{|}~-]"),e.strictTldRegex=new RegExp("^"+jfh.source+"$"),e}return Meh(e,t),e.prototype.parseMatches=function(i){for(var e,t,r,n,a,o,s,l,c,u=this.tagBuilder,d=this.localPartCharRegex,h=this.strictTldRegex,p=[],m=i.length,f=new lfh,g={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},_=0,y=0,C=f;_<m;){var v=i.charAt(_);switch(y){case 0:"m"===(c=v)?S(1):d.test(c)&&S();break;case 1:s=i.charAt(_-1),l=v,":"===s?d.test(l)?(y=2,C=new lfh(Neh({},C,{hasMailtoPrefix:!0}))):T():g[s]===l||(d.test(l)?y=2:"."===l?y=3:"@"===l?y=4:T());break;case 2:"."===(o=v)?y=3:"@"===o?y=4:d.test(o)||T();break;case 3:"."!==(a=v)&&"@"!==a&&d.test(a)?y=2:T();break;case 4:n=v,ifh.test(n)?y=5:T();break;case 5:"."===(r=v)?y=7:"-"===r?y=6:ifh.test(r)||x();break;case 6:"-"!==(t=v)&&"."!==t&&ifh.test(t)?y=5:x();break;case 7:"."!==(e=v)&&"-"!==e&&ifh.test(e)?(y=5,C=new lfh(Neh({},C,{hasDomainDot:!0}))):x();break;default:Eeh(y)}_++}return x(),p;function S(e){y=e=void 0===e?2:e,C=new lfh({idx:_})}function T(){y=0,C=f}function x(){var e,t;C.hasDomainDot&&(e=i.slice(C.idx,_),/[-.]$/.test(e)&&(e=e.slice(0,-1)),function(e){e=(e.split(".").pop()||"").toLowerCase();return h.test(e)}(t=C.hasMailtoPrefix?e.slice("mailto:".length):e)&&p.push(new Oeh({tagBuilder:u,matchedText:e,offset:C.idx,email:t}))),T()}},e}(Teh),lfh=function(e){this.idx=void 0!==(e=void 0===e?{}:e).idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},mfh=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return-1<(t=this.hasFullProtocolRegex.test(e)?e.split("://")[1]:t).split("/")[0].indexOf("..")},e.isValidUriScheme=function(e){e=e.match(this.uriSchemeRegex),e=e&&e[0].toLowerCase();return"javascript:"!==e&&"vbscript:"!==e},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+Zeh+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),nfh=function(r){function e(e){var t,i=r.call(this,e)||this;return i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.matcherRegex=(t=new RegExp("[/?#](?:["+dfh+"\\-+&@#/%=~_()|'$*\\[\\]?!:,.;✓]*["+dfh+"\\-+&@#/%=~_()|'$*\\[\\]✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,hfh(2),")","|","(","(//)?",/(?:www\.)/.source,hfh(6),")","|","(","(//)?",hfh(10)+"\\.",jfh.source,"(?![-"+cfh+"])",")",")","(?::[0-9]+)?","(?:"+t.source+")?"].join(""),"gi")),i.wordCharRegExp=new RegExp("["+dfh+"]"),i.stripPrefix=e.stripPrefix,i.stripTrailingSlash=e.stripTrailingSlash,i.decodePercentEncoding=e.decodePercentEncoding,i}return Meh(e,r),e.prototype.parseMatches=function(s){for(var l,e=this.matcherRegex,c=this.stripPrefix,u=this.stripTrailingSlash,d=this.decodePercentEncoding,h=this.tagBuilder,p=[],m=this;null!==(l=e.exec(s));)!function(){var e=l[0],t=l[1],i=l[4],r=l[5],n=l[9],a=l.index,r=r||n,n=s.charAt(a-1);if(!mfh.isValid(e,t))return;if(0<a&&"@"===n)return;if(0<a&&r&&m.wordCharRegExp.test(n))return;/\?$/.test(e)&&(e=e.substr(0,e.length-1)),m.matchHasUnbalancedClosingParen(e)?e=e.substr(0,e.length-1):-1<(o=m.matchHasInvalidCharAfterTld(e,t))&&(e=e.substr(0,o));var o=["http://","https://"].find(function(e){return!!t&&-1!==t.indexOf(e)});o&&(o=e.indexOf(o),e=e.substr(o),t=t.substr(o),a+=o),p.push(new Seh({tagBuilder:h,matchedText:e,offset:a,urlMatchType:t?"scheme":i?"www":"tld",url:e,protocolUrlMatch:!!t,protocolRelativeMatch:!!r,stripPrefix:c,stripTrailingSlash:u,decodePercentEncoding:d}))}();return p},e.prototype.matchHasUnbalancedClosingParen=function(e){var t,i=e.charAt(e.length-1);if(")"===i)t="(";else{if("]"!==i)return!1;t="["}for(var r=0,n=0,a=e.length-1;n<a;n++){var o=e.charAt(n);o===t?r++:o===i&&(r=Math.max(r-1,0))}return 0===r},e.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var i=0;t&&(i=e.indexOf(":"),e=e.slice(i));t=new RegExp("^((.?//)?[-."+dfh+"]*[-"+dfh+"]\\.[-"+dfh+"]+)").exec(e);return null===t?-1:(i+=t[1].length,e=e.slice(t[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?i:-1)},e}(Teh),ofh=function(i){function e(e){var t=i.call(this,e)||this;return t.serviceName="twitter",t.matcherRegex=new RegExp("#[_"+dfh+"]{1,139}(?![_"+dfh+"])","g"),t.nonWordCharRegex=new RegExp("[^"+dfh+"]"),t.serviceName=e.serviceName,t}return Meh(e,i),e.prototype.parseMatches=function(e){for(var t=this.matcherRegex,i=this.nonWordCharRegex,r=this.serviceName,n=this.tagBuilder,a=[];null!==(o=t.exec(e));){var o,s=o.index,l=e.charAt(s-1);0!==s&&!i.test(l)||(l=o[0],o=o[0].slice(1),a.push(new Peh({tagBuilder:n,matchedText:l,offset:s,serviceName:r,hashtag:o})))}return a},e}(Teh),pfh=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.matcherRegex=/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\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)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/g,e}return Meh(e,t),e.prototype.parseMatches=function(e){for(var t,i=this.matcherRegex,r=this.tagBuilder,n=[];null!==(t=i.exec(e));){var a=t[0],o=a.replace(/[^0-9,;#]/g,""),s=!(!t[1]&&!t[2]),l=0==t.index?"":e.substr(t.index-1,1),c=e.substr(t.index+a.length,1),c=!l.match(/\d/)&&!c.match(/\d/);this.testMatch(t[3])&&this.testMatch(a)&&c&&n.push(new Reh({tagBuilder:r,matchedText:a,offset:t.index,number:o,plusSign:s}))}return n},e.prototype.testMatch=function(e){return/\D/.test(e)},e}(Teh),qfh=function(i){function e(e){var t=i.call(this,e)||this;return t.serviceName="twitter",t.matcherRegexes={twitter:new RegExp("@[_"+dfh+"]{1,50}(?![_"+dfh+"])","g"),instagram:new RegExp("@[_."+dfh+"]{1,30}(?![_"+dfh+"])","g"),soundcloud:new RegExp("@[-_."+dfh+"]{1,50}(?![-_"+dfh+"])","g")},t.nonWordCharRegex=new RegExp("[^"+dfh+"]"),t.serviceName=e.serviceName,t}return Meh(e,i),e.prototype.parseMatches=function(e){var t=this.serviceName,i=this.matcherRegexes[this.serviceName],r=this.nonWordCharRegex,n=this.tagBuilder,a=[];if(!i)return a;for(;null!==(o=i.exec(e));){var o,s=o.index,l=e.charAt(s-1);0!==s&&!r.test(l)||(o=(l=o[0].replace(/\.+$/g,"")).slice(1),a.push(new Qeh({tagBuilder:n,matchedText:l,offset:s,serviceName:t,mention:o})))}return a},e}(Teh),sfh=function(e){this.idx=void 0!==(e=void 0===e?{}:e).idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},function(){function i(e){void 0===e&&(e={}),this.version=i.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.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(e.urls),this.email=("boolean"==typeof e.email?e:this).email,this.phone=("boolean"==typeof e.phone?e:this).phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow=("boolean"==typeof e.newWindow?e:this).newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash=("boolean"==typeof e.stripTrailingSlash?e:this).stripTrailingSlash,this.decodePercentEncoding=("boolean"==typeof e.decodePercentEncoding?e:this).decodePercentEncoding;var t=this.mention;if(!1!==t&&"twitter"!==t&&"instagram"!==t&&"soundcloud"!==t)throw new Error("invalid `mention` cfg - see docs");t=this.hashtag;if(!1!==t&&"twitter"!==t&&"facebook"!==t&&"instagram"!==t)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return i.link=function(e,t){return new i(t).link(e)},i.parse=function(e,t){return new i(t).parse(e)},i.prototype.normalizeUrlsCfg=function(e){return"boolean"==typeof(e=null==e?!0:e)?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},i.prototype.normalizeStripPrefixCfg=function(e){return"boolean"==typeof(e=null==e?!0:e)?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},i.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&void 0===e[i]&&(e[i]=t[i]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},i.prototype.parse=function(e){var r=this,t=["a","style","script"],n=0,a=[];return function(t,e){var i=e.onOpenTag,r=e.onCloseTag,n=e.onText,a=e.onComment,o=e.onDoctype,s=new sfh,l=0,c=t.length,u=0,d=0,h=s;for(;l<c;){var p=t.charAt(l);switch(u){case 0:!function(e){"<"===e&&f()}(p);break;case 1:!function(e){"!"===e?u=13:"/"===e?(u=2,h=new sfh(Neh({},h,{isClosing:!0}))):"<"===e?f():h=Ueh.test(e)?(u=3,new sfh(Neh({},h,{isOpening:!0}))):(u=0,s)}(p);break;case 2:!function(e){">"!==e&&Ueh.test(e)?u=3:m()}(p);break;case 3:!function(e){Weh.test(e)?(h=new sfh(Neh({},h,{name:_()})),u=4):"<"===e?f():"/"===e?(h=new sfh(Neh({},h,{name:_()})),u=12):">"===e?(h=new sfh(Neh({},h,{name:_()})),g()):Ueh.test(e)||Veh.test(e)||":"===e||m()}(p);break;case 4:!function(e){Weh.test(e)||("/"===e?u=12:">"===e?g():"<"===e?f():"="===e||Xeh.test(e)||Yeh.test(e)?m():u=5)}(p);break;case 5:!function(e){Weh.test(e)?u=6:"/"===e?u=12:"="===e?u=7:">"===e?g():"<"===e?f():Xeh.test(e)&&m()}(p);break;case 6:!function(e){Weh.test(e)||("/"===e?u=12:"="===e?u=7:">"===e?g():"<"===e?f():Xeh.test(e)?m():u=5)}(p);break;case 7:!function(e){Weh.test(e)||('"'===e?u=8:"'"===e?u=9:/[>=`]/.test(e)?m():"<"===e?f():u=10)}(p);break;case 8:!function(e){'"'===e&&(u=11)}(p);break;case 9:!function(e){"'"===e&&(u=11)}(p);break;case 10:!function(e){Weh.test(e)?u=4:">"===e?g():"<"===e&&f()}(p);break;case 11:!function(e){Weh.test(e)?u=4:"/"===e?u=12:">"===e?g():"<"===e?f():(u=4,l--)}(p);break;case 12:!function(e){">"===e?(h=new sfh(Neh({},h,{isClosing:!0})),g()):u=4}(p);break;case 13:"--"===t.substr(l,2)?(l+=2,h=new sfh(Neh({},h,{type:"comment"})),u=14):"DOCTYPE"===t.substr(l,7).toUpperCase()?(l+=7,h=new sfh(Neh({},h,{type:"doctype"})),u=20):m();break;case 14:!function(e){"-"===e?u=15:">"===e?m():u=16}(p);break;case 15:!function(e){"-"===e?u=18:">"===e?m():u=16}(p);break;case 16:!function(e){"-"===e&&(u=17)}(p);break;case 17:!function(e){u="-"===e?18:16}(p);break;case 18:!function(e){">"===e?g():"!"===e?u=19:"-"===e||(u=16)}(p);break;case 19:!function(e){"-"===e?u=17:">"===e?g():u=16}(p);break;case 20:!function(e){">"===e?g():"<"===e&&f()}(p);break;default:Eeh(u)}l++}d<l&&function(){var e=t.slice(d,l);n(e,d),d=l+1}();function m(){u=0,h=s}function f(){u=1,h=new sfh({idx:l})}function g(){var e=t.slice(d,h.idx);e&&n(e,d),"comment"===h.type?a(h.idx):"doctype"===h.type?o(h.idx):(h.isOpening&&i(h.name,h.idx),h.isClosing&&r(h.name,h.idx)),m(),d=l+1}function _(){var e=h.idx+(h.isClosing?2:1);return t.slice(e,l).toLowerCase()}}(e,{onOpenTag:function(e){0<=t.indexOf(e)&&n++},onText:function(e,t){var i;0===n&&(e=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");var i,r=[],n=0;for(;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r}(e,/( | |<|<|>|>|"|"|')/gi),i=t,e.forEach(function(e,t){t%2==0&&(t=r.parseText(e,i),a.push.apply(a,t)),i+=e.length}))},onCloseTag:function(e){0<=t.indexOf(e)&&(n=Math.max(n-1,0))},onComment:function(e){},onDoctype:function(e){}}),a=this.compactMatches(a),a=this.removeUnwantedMatches(a)},i.prototype.compactMatches=function(e){e.sort(function(e,t){return e.getOffset()-t.getOffset()});for(var t=0;t<e.length-1;t++){var i=e[t],r=i.getOffset(),n=i.getMatchedText().length,i=r+n;t+1<e.length&&(e[t+1].getOffset()!==r?e[t+1].getOffset()<i&&e.splice(t+1,1):(n=e[t+1].getMatchedText().length>n?t:t+1,e.splice(n,1)))}return e},i.prototype.removeUnwantedMatches=function(e){return this.hashtag||Ceh(e,function(e){return"hashtag"===e.getType()}),this.email||Ceh(e,function(e){return"email"===e.getType()}),this.phone||Ceh(e,function(e){return"phone"===e.getType()}),this.mention||Ceh(e,function(e){return"mention"===e.getType()}),this.urls.schemeMatches||Ceh(e,function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()}),this.urls.wwwMatches||Ceh(e,function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()}),this.urls.tldMatches||Ceh(e,function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()}),e},i.prototype.parseText=function(e,t){t=(t=void 0===t?0:t)||0;for(var i=this.getMatchers(),r=[],n=0,a=i.length;n<a;n++){for(var o=i[n].parseMatches(e),s=0,l=o.length;s<l;s++)o[s].setOffset(t+o[s].getOffset());r.push.apply(r,o)}return r},i.prototype.link=function(e){if(!e)return"";for(var t=this.parse(e),i=[],r=0,n=0,a=t.length;n<a;n++){var o=t[n];i.push(e.substring(r,o.getOffset())),i.push(this.createMatchReturnVal(o)),r=o.getOffset()+o.getMatchedText().length}return i.push(e.substring(r)),i.join("")},i.prototype.createMatchReturnVal=function(e){var t;return"string"==typeof(t=this.replaceFn?this.replaceFn.call(this.context,e):t)?t:!1===t?e.getMatchedText():(t instanceof Feh?t:e.buildTag()).toAnchorString()},i.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),e=[new ofh({tagBuilder:e,serviceName:this.hashtag}),new kfh({tagBuilder:e}),new pfh({tagBuilder:e}),new qfh({tagBuilder:e,serviceName:this.mention}),new nfh({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=e},i.prototype.getTagBuilder=function(){return this.tagBuilder||(this.tagBuilder=new Jeh({newWindow:this.newWindow,truncate:this.truncate,className:this.className}))},i.version="3.11.0",i.AnchorTagBuilder=Jeh,i.HtmlTag=Feh,i.matcher={Email:kfh,Hashtag:ofh,Matcher:Teh,Mention:qfh,Phone:pfh,Url:nfh},i.match={Email:Oeh,Hashtag:Peh,Match:Keh,Mention:Qeh,Phone:Reh,Url:Seh},i}());var Autolinker=tmp$2.Autolinker;function KmlLookAt(e,t){this.position=e,this.headingPitchRange=t}function KmlTour(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new Event,this.tourEnd=new Event,this.entryStart=new Event,this.entryEnd=new Event,this._activeEntries=[]}function cancelAllEntries(e){for(var t=e.pop();void 0!==t;t=e.pop())t.stop()}function playEntry(e,t,i){var r,n,a=this.playlist[this.playlistIndex];a?(r=playNext.bind(this,e,t,i),this._activeEntries.push(a),this.entryStart.raiseEvent(a),a.blocking?a.play(r,e.scene.camera,t):(n=this,a.play(function(){n.entryEnd.raiseEvent(a);var e=n._activeEntries.indexOf(a);0<=e&&n._activeEntries.splice(e,1)}),r(e,t,i))):defined(i)&&i(!1)}function playNext(e,t,i,r){var n=this.playlist[this.playlistIndex];this.entryEnd.raiseEvent(n,r),r?i(r):(0<=(n=this._activeEntries.indexOf(n))&&this._activeEntries.splice(n,1),this.playlistIndex++,playEntry.call(this,e,t,i))}function KmlTourFlyTo(e,t,i){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=i,this.flyToMode=t}function KmlTourWait(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}KmlTour.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},KmlTour.prototype.play=function(e,t){this.tourStart.raiseEvent();var i=this;playEntry.call(this,e,t,function(e){i.playlistIndex=0,e||cancelAllEntries(i._activeEntries),i.tourEnd.raiseEvent(e)})},KmlTour.prototype.stop=function(){cancelAllEntries(this._activeEntries)},KmlTourFlyTo.prototype.play=function(t,e,i){var r;this.activeCamera=e,defined(t)&&null!==t&&((r=this).activeCallback=function(e){delete r.activeCallback,delete r.activeCamera,t(!defined(e)&&e)});var n=this.getCameraOptions(i);this.view.headingPitchRoll?e.flyTo(n):this.view.headingPitchRange&&(i=new BoundingSphere(this.view.position),e.flyToBoundingSphere(i,n))},KmlTourFlyTo.prototype.stop=function(){defined(this.activeCamera)&&this.activeCamera.cancelFlight(),defined(this.activeCallback)&&this.activeCallback(!0)},KmlTourFlyTo.prototype.getCameraOptions=function(e){var t={duration:this.duration};return defined(this.activeCallback)&&(t.complete=this.activeCallback),"smooth"===this.flyToMode&&(t.easingFunction=EasingFunction$1.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),t=defined(e)?combine$2(t,e):t},KmlTourWait.prototype.play=function(e){var t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},1e3*this.duration)},KmlTourWait.prototype.stop=function(){clearTimeout(this.timeout),defined(this.activeCallback)&&this.activeCallback(!0)};var MimeTypes={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){e=getExtensionFromUri(e=e.toLowerCase());return MimeTypes[e]}},parser;"undefined"!=typeof DOMParser&&(parser=new DOMParser);var autolinker=new Autolinker({stripPrefix:!1,email:!1,replaceFn:function(e){if(!e.protocolUrlMatch)return!1}}),BILLBOARD_SIZE=32,BILLBOARD_NEAR_DISTANCE=2414016,BILLBOARD_NEAR_RATIO=1,BILLBOARD_FAR_DISTANCE=16093e3,BILLBOARD_FAR_RATIO=.1,kmlNamespaces=[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"],gxNamespaces=["http://www.google.com/kml/ext/2.2"],atomNamespaces=["http://www.w3.org/2005/Atom"],namespaces={kml:kmlNamespaces,gx:gxNamespaces,atom:atomNamespaces,kmlgx:kmlNamespaces.concat(gxNamespaces)},featureTypes={Document:processDocument,Folder:processFolder,Placemark:processPlacemark,NetworkLink:processNetworkLink,GroundOverlay:processGroundOverlay,PhotoOverlay:processUnsupportedFeature,ScreenOverlay:processUnsupportedFeature,Tour:processTour};function DeferredLoading(e){this._dataSource=e,this._deferred=when.defer(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}function isZipFile(e){var e=e.slice(0,Math.min(4,e.size)),t=when.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(1347093252===new DataView(i.result).getUint32(0,!1))}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsArrayBuffer(e),t.promise}function readBlobAsText(e){var t=when.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function insertNamespaces(e){var t,i,r,n,a={xsi:"http://www.w3.org/2001/XMLSchema-instance"};for(n in a)a.hasOwnProperty(n)&&(r="xmlns:"+n+"=",RegExp("[< ]"+n+":").test(e)&&-1===e.indexOf(r)&&(defined(t)||(t=e.substr(0,e.indexOf("<kml")+4),i=e.substr(t.length)),t+=" "+r+'"'+a[n]+'"'));return e=defined(t)?t+i:e}function removeDuplicateNamespaces(e){for(var t,i,r=e.indexOf("xmlns:"),n=e.indexOf(">",r);-1!==r&&r<n;)i=e.slice(r,e.indexOf('"',r)),r=-1!==(r=e.indexOf(i,(t=r)+1))?(i=e.indexOf('"',e.indexOf('"',r)+1),(e=e.slice(0,r-1)+e.slice(i+1,e.length)).indexOf("xmlns:",t-1)):e.indexOf("xmlns:",t+1);return e}function loadXmlFromZip(e,t,i){e.getData(new zip.TextWriter,function(e){e=removeDuplicateNamespaces(e=insertNamespaces(e)),t.kml=parser.parseFromString(e,"application/xml"),i.resolve()})}function loadDataUriFromZip(t,i,r){var e=defaultValue(MimeTypes.detectFromFilename(t.filename),"application/octet-stream");t.getData(new zip.Data64URIWriter(e),function(e){i[t.filename]=e,r.resolve()})}function embedDataUris(e,t,i,r){for(var n=r.keys,a=new URI("."),o=e.querySelectorAll(t),s=0;s<o.length;s++){var l=o[s],c=new URI(l.getAttribute(i)).resolve(a).toString(),c=n.indexOf(c);-1!==c&&(c=n[c],l.setAttribute(i,r[c]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",c))}}function applyBasePath(e,t,i,r){for(var n=e.querySelectorAll(t),a=0;a<n.length;a++){var o=n[a],s=resolveHref(o.getAttribute(i),r);o.setAttribute(i,s.url)}}function createEntity(e,t,i){var r=defined(r=queryStringAttribute(e,"id"))&&0!==r.length?r:createGuid();defined(i)&&(r=i+r);e=t.getById(r);return defined(e)&&(r=createGuid(),defined(i)&&(r=i+r)),defined((e=t.add(new Entity({id:r}))).kml)||(e.addProperty("kml"),e.kml=new KmlFeatureData),e}function isExtrudable(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function readCoordinate(e,t){if(!defined(e))return Cartesian3.fromDegrees(0,0,0,t);var i=e.match(/[^\s,\n]+/g);if(!defined(i))return Cartesian3.fromDegrees(0,0,0,t);var r=parseFloat(i[0]),e=parseFloat(i[1]),i=parseFloat(i[2]),r=isNaN(r)?0:r,e=isNaN(e)?0:e,i=isNaN(i)?0:i;return Cartesian3.fromDegrees(r,e,i,t)}function readCoordinates(e,t){if(defined(e)){var i=e.textContent.match(/[^\s\n]+/g);if(defined(i)){for(var r=i.length,n=new Array(r),a=0,o=0;o<r;o++)n[a++]=readCoordinate(i[o],t);return n}}}function queryNumericAttribute(e,t){if(defined(e)){t=e.getAttribute(t);if(null!==t){t=parseFloat(t);return isNaN(t)?void 0:t}}}function queryStringAttribute(e,t){if(defined(e)){t=e.getAttribute(t);return null!==t?t:void 0}}function queryFirstNode(e,t,i){if(defined(e))for(var r=e.childNodes,n=r.length,a=0;a<n;a++){var o=r[a];if(o.localName===t&&-1!==i.indexOf(o.namespaceURI))return o}}function queryNodes(e,t,i){if(defined(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),a=n.length,o=0;o<a;o++){var s=n[o];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function queryChildNodes(e,t,i){if(!defined(e))return[];for(var r=[],n=e.childNodes,a=n.length,o=0;o<a;o++){var s=n[o];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}function queryNumericValue(e,t,i){i=queryFirstNode(e,t,i);if(defined(i)){i=parseFloat(i.textContent);return isNaN(i)?void 0:i}}function queryStringValue(e,t,i){i=queryFirstNode(e,t,i);if(defined(i))return i.textContent.trim()}function queryBooleanValue(e,t,i){i=queryFirstNode(e,t,i);if(defined(i)){i=i.textContent.trim();return"1"===i||/^true$/i.test(i)}}function resolveHref(e,t,i){var r,n,a;if(defined(e))return defined(i)&&(defined(a=i[e=e.replace(/\\/g,"/")])?r=new Resource({url:a}):(n=new URI(t.getUrlComponent()),defined(a=i[new URI(e).resolve(n)])&&(r=new Resource({url:a})))),r=!defined(r)?t.getDerivedResource({url:e}):r}Object.defineProperties(DeferredLoading.prototype,{dataSource:{get:function(){return this._dataSource}}}),DeferredLoading.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0},DeferredLoading.prototype.addPromise=function(e){this._promises.push(e)},DeferredLoading.prototype.wait=function(){var e=this._deferred;return this._used||e.resolve(),when.join(e.promise,when.all(this._promises))},DeferredLoading.prototype.process=function(){var e=1===this._stack.length;return e&&(this._started=KmlDataSource._getTimestamp()),this._process(e)},DeferredLoading.prototype._giveUpTime=function(){var e;this._timeoutSet||(this._timeoutSet=!0,this._timeThreshold=50,e=this,setTimeout(function(){e._timeoutSet=!1,e._started=KmlDataSource._getTimestamp(),e._process(!0)},0))},DeferredLoading.prototype._nextNode=function(){var e=this._stack,t=e[e.length-1],i=t.index,e=t.nodes;if(i!==e.length)return++t.index,e[i]},DeferredLoading.prototype._pop=function(){var e=this._stack;return e.pop(),0!==e.length||(this._deferred.resolve(),!1)},DeferredLoading.prototype._process=function(e){for(var t=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();defined(r);){var n=featureTypes[r.localName];if(defined(n)&&(-1!==namespaces.kml.indexOf(r.namespaceURI)||-1!==namespaces.gx.indexOf(r.namespaceURI))&&(n(t,r,i,this),this._timeoutSet||KmlDataSource._getTimestamp()>this._started+this._timeThreshold))return void this._giveUpTime();r=this._nextNode()}this._pop()&&e&&this._process(!0)};var colorOptions={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function parseColorString(e,t){if(defined(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,e=parseInt(e.substring(6,8),16)/255;return t?(0<e?(colorOptions.maximumRed=e,colorOptions.red=void 0):(colorOptions.maximumRed=void 0,colorOptions.red=0),0<n?(colorOptions.maximumGreen=n,colorOptions.green=void 0):(colorOptions.maximumGreen=void 0,colorOptions.green=0),0<r?(colorOptions.maximumBlue=r,colorOptions.blue=void 0):(colorOptions.maximumBlue=void 0,colorOptions.blue=0),colorOptions.alpha=i,Color.fromRandom(colorOptions)):new Color(e,n,r,i)}}function queryColorValue(e,t,i){t=queryStringValue(e,t,i);if(defined(t))return parseColorString(t,"random"===queryStringValue(e,"colorMode",i))}function processTimeStamp(e){var t=queryFirstNode(e,"TimeStamp",namespaces.kmlgx),e=queryStringValue(t,"when",namespaces.kmlgx);if(defined(t)&&defined(e)&&0!==e.length){t=JulianDate.fromIso8601(e),e=new TimeIntervalCollection;return e.addInterval(new TimeInterval({start:t,stop:Iso8601.MAXIMUM_VALUE})),e}}function processTimeSpan(e){var t=queryFirstNode(e,"TimeSpan",namespaces.kmlgx);if(defined(t)){var i,e=queryFirstNode(t,"begin",namespaces.kmlgx),e=defined(e)?JulianDate.fromIso8601(e.textContent):void 0,t=queryFirstNode(t,"end",namespaces.kmlgx),t=defined(t)?JulianDate.fromIso8601(t.textContent):void 0;return defined(e)&&defined(t)?(JulianDate.lessThan(t,e)&&(i=e,e=t,t=i),(i=new TimeIntervalCollection).addInterval(new TimeInterval({start:e,stop:t}))):defined(e)?(i=new TimeIntervalCollection).addInterval(new TimeInterval({start:e,stop:Iso8601.MAXIMUM_VALUE})):defined(t)&&(i=new TimeIntervalCollection).addInterval(new TimeInterval({start:Iso8601.MINIMUM_VALUE,stop:t})),i}}function createDefaultBillboard(){var e=new BillboardGraphics;return e.width=BILLBOARD_SIZE,e.height=BILLBOARD_SIZE,e.scaleByDistance=new NearFarScalar(BILLBOARD_NEAR_DISTANCE,BILLBOARD_NEAR_RATIO,BILLBOARD_FAR_DISTANCE,BILLBOARD_FAR_RATIO),e.pixelOffsetScaleByDistance=new NearFarScalar(BILLBOARD_NEAR_DISTANCE,BILLBOARD_NEAR_RATIO,BILLBOARD_FAR_DISTANCE,BILLBOARD_FAR_RATIO),e}function createDefaultPolygon(){var e=new PolygonGraphics;return e.outline=!0,e.outlineColor=Color.WHITE,e}function createDefaultLabel(){var e=new LabelGraphics;return e.translucencyByDistance=new NearFarScalar(3e6,1,5e6,0),e.pixelOffset=new Cartesian2(17,0),e.horizontalOrigin=HorizontalOrigin$1.LEFT,e.font="16px sans-serif",e.style=LabelStyle$1.FILL_AND_OUTLINE,e}function getIconHref(e,t,i,r,n){var a,o,s,l=queryStringValue(e,"href",namespaces.kml);if(defined(l)&&0!==l.length){0===l.indexOf("root://icons/palette-")&&(a=l.charAt(21),o=defaultValue(queryNumericValue(e,"x",namespaces.gx),0),s=defaultValue(queryNumericValue(e,"y",namespaces.gx),0),o=Math.min(o/32,7),l="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+(8*(s=7-Math.min(s/32,7))+o)+".png");i=resolveHref(l,i,r);if(n){r=queryStringValue(e,"refreshMode",namespaces.kml),n=queryStringValue(e,"viewRefreshMode",namespaces.kml);"onInterval"===r||"onExpire"===r?oneTimeWarning("kml-refreshMode-"+r,"KML - Unsupported Icon refreshMode: "+r):"onStop"!==n&&"onRegion"!==n||oneTimeWarning("kml-refreshMode-"+n,"KML - Unsupported Icon viewRefreshMode: "+n);r=defaultValue(queryStringValue(e,"viewBoundScale",namespaces.kml),1),n="onStop"===n?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",n=defaultValue(queryStringValue(e,"viewFormat",namespaces.kml),n),e=queryStringValue(e,"httpQuery",namespaces.kml);defined(n)&&i.setQueryParameters(queryToObject(cleanupString(n))),defined(e)&&i.setQueryParameters(queryToObject(cleanupString(e)));e=t._ellipsoid;return processNetworkLinkQueryString(i,t._camera,t._canvas,r,t._lastCameraView.bbox,e),i}return i}}function processBillboardIcon(e,t,i,r,n){var a=queryNumericValue(t,"scale",namespaces.kml),o=queryNumericValue(t,"heading",namespaces.kml),s=queryColorValue(t,"color",namespaces.kml),l=queryFirstNode(t,"Icon",namespaces.kml),c=getIconHref(l,e,r,n,!1);defined(l)&&!defined(c)&&(c=!1);var u,d,h=queryNumericValue(l,"x",namespaces.gx),p=queryNumericValue(l,"y",namespaces.gx),m=queryNumericValue(l,"w",namespaces.gx),f=queryNumericValue(l,"h",namespaces.gx),e=queryFirstNode(t,"hotSpot",namespaces.kml),r=queryNumericAttribute(e,"x"),n=queryNumericAttribute(e,"y"),l=queryStringAttribute(e,"xunits"),t=queryStringAttribute(e,"yunits"),e=i.billboard;defined(e)||(e=createDefaultBillboard(),i.billboard=e),e.image=c,e.scale=a,e.color=s,(defined(h)||defined(p)||defined(m)||defined(f))&&(e.imageSubRegion=new BoundingRectangle(h,p,m,f)),defined(o)&&0!==o&&(e.rotation=CesiumMath.toRadians(-o),e.alignedAxis=Cartesian3.UNIT_Z),a=defaultValue(a,1),defined(r)&&("pixels"===l?u=-r*a:"insetPixels"===l?u=(r-BILLBOARD_SIZE)*a:"fraction"===l&&(u=-r*BILLBOARD_SIZE*a),u+=.5*BILLBOARD_SIZE*a),defined(n)&&("pixels"===t?d=n*a:"insetPixels"===t?d=(-n+BILLBOARD_SIZE)*a:"fraction"===t&&(d=n*BILLBOARD_SIZE*a),d-=.5*BILLBOARD_SIZE*a),(defined(u)||defined(d))&&(e.pixelOffset=new Cartesian2(u,d))}function applyStyle(e,t,i,r,n){for(var a=0,o=t.childNodes.length;a<o;a++){var s,l,c,u=t.childNodes.item(a);"IconStyle"===u.localName?processBillboardIcon(e,u,i,r,n):"LabelStyle"===u.localName?(defined(s=i.label)||(s=createDefaultLabel(),i.label=s),s.scale=defaultValue(queryNumericValue(u,"scale",namespaces.kml),s.scale),s.fillColor=defaultValue(queryColorValue(u,"color",namespaces.kml),s.fillColor),s.text=i.name):"LineStyle"===u.localName?(defined(l=i.polyline)||(l=new PolylineGraphics,i.polyline=l),l.width=queryNumericValue(u,"width",namespaces.kml),l.material=queryColorValue(u,"color",namespaces.kml),defined(queryColorValue(u,"outerColor",namespaces.gx))&&oneTimeWarning("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),defined(queryNumericValue(u,"outerWidth",namespaces.gx))&&oneTimeWarning("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),defined(queryNumericValue(u,"physicalWidth",namespaces.gx))&&oneTimeWarning("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),defined(queryBooleanValue(u,"labelVisibility",namespaces.gx))&&oneTimeWarning("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")):"PolyStyle"===u.localName?(defined(c=i.polygon)||(c=createDefaultPolygon(),i.polygon=c),c.material=defaultValue(queryColorValue(u,"color",namespaces.kml),c.material),c.fill=defaultValue(queryBooleanValue(u,"fill",namespaces.kml),c.fill),c.outline=defaultValue(queryBooleanValue(u,"outline",namespaces.kml),c.outline)):"BalloonStyle"===u.localName?(s=defaultValue(parseColorString(queryStringValue(u,"bgColor",namespaces.kml)),Color.WHITE),l=defaultValue(parseColorString(queryStringValue(u,"textColor",namespaces.kml)),Color.BLACK),c=queryStringValue(u,"text",namespaces.kml),i.addProperty("balloonStyle"),i.balloonStyle={bgColor:s,textColor:l,text:c}):"ListStyle"===u.localName&&("radioFolder"!==(u=queryStringValue(u,"listItemType",namespaces.kml))&&"checkOffOnly"!==u||oneTimeWarning("kml-listStyle-"+u,"KML - Unsupported ListStyle with listItemType: "+u))}}function computeFinalStyle(e,t,i,r,n){for(var a,o=new Entity,s=-1,l=t.childNodes,c=l.length,u=0;u<c;u++){var d=l[u];"Style"!==d.localName&&"StyleMap"!==d.localName||(s=u)}if(-1!==s){var h=l[s];if("Style"===h.localName)applyStyle(e,h,o,r,n);else for(var p=queryChildNodes(h,"Pair",namespaces.kml),m=0;m<p.length;m++){var f,g=p[m],_=queryStringValue(g,"key",namespaces.kml);"normal"===_?defined(f=queryStringValue(g,"styleUrl",namespaces.kml))?(defined(a=i.getById(f))||(a=i.getById("#"+f)),defined(a)&&o.merge(a)):applyStyle(e,queryFirstNode(g,"Style",namespaces.kml),o,r,n):oneTimeWarning("kml-styleMap-"+_,"KML - Unsupported StyleMap key: "+_)}}var y=queryStringValue(t,"styleUrl",namespaces.kml);return defined(y)&&("#"!==(h=y)[0]&&-1!==y.indexOf("#")&&(y=(t=y.split("#"))[0],h=r.getDerivedResource({url:y}).getUrlComponent()+"#"+t[1]),defined(a=i.getById(h))||(a=i.getById("#"+h)),defined(a)&&o.merge(a)),o}function processExternalStyles(t,i,r){return i.fetchXML().then(function(e){return processStyles(t,e,r,i,!0)})}function processStyles(e,t,i,r,n,a){var o,s=queryNodes(t,"Style",namespaces.kml);if(defined(s))for(var l=s.length,c=0;c<l;c++)defined(_=queryStringAttribute(o=s[c],"id"))&&(_="#"+_,n&&defined(r)&&(_=r.getUrlComponent()+_),defined(i.getById(_))||(f=new Entity({id:_}),i.add(f),applyStyle(e,o,f,r,a)));var u=queryNodes(t,"StyleMap",namespaces.kml);if(defined(u)){var d=u.length;for(c=0;c<d;c++){var h=u[c];if(defined(_=queryStringAttribute(h,"id")))for(var p=queryChildNodes(h,"Pair",namespaces.kml),m=0;m<p.length;m++){var f,g,_,y=p[m],C=queryStringValue(y,"key",namespaces.kml);"normal"===C?(_="#"+_,n&&defined(r)&&(_=r.getUrlComponent()+_),defined(i.getById(_))||(f=i.getOrCreateEntity(_),defined(g=queryStringValue(y,"styleUrl",namespaces.kml))?("#"!==g[0]&&(g="#"+g),n&&defined(r)&&(g=r.getUrlComponent()+g),defined(g=i.getById(g))&&f.merge(g)):applyStyle(e,o=queryFirstNode(y,"Style",namespaces.kml),f,r,a))):oneTimeWarning("kml-styleMap-"+C,"KML - Unsupported StyleMap key: "+C)}}}var v=[],S=t.getElementsByTagName("styleUrl"),T=S.length;for(c=0;c<T;c++){var x=S[c].textContent;"#"===x[0]||2===(x=x.split("#")).length&&(x=x[0],x=r.getDerivedResource({url:x}),v.push(processExternalStyles(e,x,i)))}return v}function createDropLine(e,t,i){var r=new ReferenceProperty(e,t.id,["position"]),e=new ScaledPositionProperty(t.position);t.polyline=defined(i.polyline)?i.polyline.clone():new PolylineGraphics,t.polyline.positions=new PositionPropertyArray([r,e])}function heightReferenceFromAltitudeMode(e,t){return!defined(e)&&!defined(t)||"clampToGround"===e?HeightReference$1.CLAMP_TO_GROUND:"relativeToGround"===e?HeightReference$1.RELATIVE_TO_GROUND:"absolute"===e?HeightReference$1.NONE:"clampToSeaFloor"===t?(oneTimeWarning("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),HeightReference$1.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(oneTimeWarning("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),HeightReference$1.RELATIVE_TO_GROUND):(defined(e)?oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):oneTimeWarning("kml-gx:altitudeMode-unknown","KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),HeightReference$1.CLAMP_TO_GROUND)}function createPositionPropertyFromAltitudeMode(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((defined(t)&&"clampToGround"!==t||defined(i)&&"clampToSeaFloor"!==i)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+defaultValue(t,i)),new ScaledPositionProperty(e))}function createPositionPropertyArrayFromAltitudeMode(e,t,i,r){if(defined(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(defined(t)&&"clampToGround"!==t||defined(i)&&"clampToSeaFloor"!==i)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+defaultValue(t,i));for(var n=e.length,a=0;a<n;a++){var o=e[a];r.scaleToGeodeticSurface(o,o)}return e}}function processPositionGraphics(e,t,i,r){var n=t.label;defined(n)||(n=defined(i.label)?i.label.clone():createDefaultLabel(),t.label=n),n.text=t.name;var a=t.billboard;defined(a)||(a=defined(i.billboard)?i.billboard.clone():createDefaultBillboard(),t.billboard=a),defined(a.image)?a.image.getValue()||(a.image=void 0):a.image=e._pinBuilder.fromColor(Color.YELLOW,64);t=1;defined(a.scale)&&(0!==(t=a.scale.getValue())?n.pixelOffset=new Cartesian2(16*t+1,0):(n.pixelOffset=void 0,n.horizontalOrigin=void 0)),defined(r)&&e._clampToGround&&(a.heightReference=r,n.heightReference=r)}function processPathGraphics(e,t){var i=e.path;defined(i)||((i=new PathGraphics).leadTime=0,e.path=i);t=t.polyline;defined(t)&&(i.material=t.material,i.width=t.width)}function processPoint(e,t,i,r,n){var a=queryStringValue(i,"coordinates",namespaces.kml),o=queryStringValue(i,"altitudeMode",namespaces.kml),s=queryStringValue(i,"altitudeMode",namespaces.gx),i=queryBooleanValue(i,"extrude",namespaces.kml),a=readCoordinate(a,e._ellipsoid);return r.position=a,processPositionGraphics(e,r,n,heightReferenceFromAltitudeMode(o,s)),i&&isExtrudable(o,s)&&createDropLine(t,r,n),!0}function processLineStringOrLinearRing(e,t,i,r,n){var a,o=queryFirstNode(i,"coordinates",namespaces.kml),s=queryStringValue(i,"altitudeMode",namespaces.kml),l=queryStringValue(i,"altitudeMode",namespaces.gx),c=queryBooleanValue(i,"extrude",namespaces.kml),u=queryBooleanValue(i,"tessellate",namespaces.kml),d=isExtrudable(s,l),h=queryNumericValue(i,"drawOrder",namespaces.gx),p=e._ellipsoid,i=readCoordinates(o,p),o=n.polyline;return d&&c?(c=new WallGraphics,(r.wall=c).positions=i,defined(a=n.polygon)&&(c.fill=a.fill,c.material=a.material),c.outline=!0,defined(o)?(c.outlineColor=defined(o.material)?o.material.color:Color.WHITE,c.outlineWidth=o.width):defined(a)&&(c.outlineColor=defined(a.material)?a.material.color:Color.WHITE)):e._clampToGround&&!d&&u?((a=new PolylineGraphics).clampToGround=!0,(r.polyline=a).positions=i,defined(o)?(a.material=defined(o.material)?o.material.color.getValue(Iso8601.MINIMUM_VALUE):Color.WHITE,a.width=defaultValue(o.width,1)):(a.material=Color.WHITE,a.width=1),a.zIndex=h):(defined(h)&&oneTimeWarning("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&oneTimeWarning("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),o=defined(o)?o.clone():new PolylineGraphics,(r.polyline=o).positions=createPositionPropertyArrayFromAltitudeMode(i,s,l,p),u&&!d||(o.arcType=ArcType$1.NONE)),!0}function processPolygon(e,t,i,r,n){var a=queryFirstNode(i,"outerBoundaryIs",namespaces.kml),o=queryFirstNode(a,"LinearRing",namespaces.kml),s=queryFirstNode(o,"coordinates",namespaces.kml),l=e._ellipsoid,c=readCoordinates(s,l),u=queryBooleanValue(i,"extrude",namespaces.kml),d=isExtrudable(queryStringValue(i,"altitudeMode",namespaces.kml),queryStringValue(i,"altitudeMode",namespaces.gx)),a=defined(n.polygon)?n.polygon.clone():createDefaultPolygon(),n=n.polyline;if(defined(n)&&(a.outlineColor=defined(n.material)?n.material.color:Color.WHITE,a.outlineWidth=n.width),r.polygon=a,d?(a.perPositionHeight=!0,a.extrudedHeight=u?0:void 0):e._clampToGround||(a.height=0),defined(c)){for(var h=new PolygonHierarchy(c),p=queryChildNodes(i,"innerBoundaryIs",namespaces.kml),m=0;m<p.length;m++)for(var o=queryChildNodes(p[m],"LinearRing",namespaces.kml),f=0;f<o.length;f++)defined(c=readCoordinates(queryFirstNode(o[f],"coordinates",namespaces.kml),l))&&h.holes.push(new PolygonHierarchy(c));a.hierarchy=h}return!0}function processTrack(e,t,i,r,n){var a=queryStringValue(i,"altitudeMode",namespaces.kml),o=queryStringValue(i,"altitudeMode",namespaces.gx),s=queryChildNodes(i,"coord",namespaces.gx),l=queryChildNodes(i,"angles",namespaces.gx),c=queryChildNodes(i,"when",namespaces.kml),u=queryBooleanValue(i,"extrude",namespaces.kml),i=isExtrudable(a,o),d=e._ellipsoid;0<l.length&&oneTimeWarning("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");for(var h=Math.min(s.length,c.length),p=[],m=[],f=0;f<h;f++){var g=readCoordinate(s[f].textContent,d);p.push(g),m.push(JulianDate.fromIso8601(c[f].textContent))}l=new SampledPositionProperty;return l.addSamples(m,p),r.position=l,processPositionGraphics(e,r,n,heightReferenceFromAltitudeMode(a,o)),processPathGraphics(r,n),r.availability=new TimeIntervalCollection,0<c.length&&r.availability.addInterval(new TimeInterval({start:m[0],stop:m[m.length-1]})),i&&u&&createDropLine(t,r,n),!0}function addToMultiTrack(e,t,i,r,n,a,o,s,l){var c=e[0],u=e[e.length-1],d=new SampledPositionProperty;d.addSamples(e,t),i.intervals.addInterval(new TimeInterval({start:c,stop:u,isStartIncluded:l,isStopIncluded:l,data:createPositionPropertyFromAltitudeMode(d,o,s)})),r.addInterval(new TimeInterval({start:c,stop:u,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new TimeInterval({start:c,stop:u,isStartIncluded:l,isStopIncluded:l,data:a}))}function processMultiTrack(e,t,i,r,n){for(var a,o,s=queryBooleanValue(i,"interpolate",namespaces.gx),l=queryChildNodes(i,"Track",namespaces.gx),c=!1,u=new TimeIntervalCollectionProperty,d=new TimeIntervalCollection,h=new CompositePositionProperty,p=e._ellipsoid,m=0,f=l.length;m<f;m++){for(var g=l[m],_=queryChildNodes(g,"when",namespaces.kml),y=queryChildNodes(g,"coord",namespaces.gx),C=queryStringValue(g,"altitudeMode",namespaces.kml),v=queryStringValue(g,"altitudeMode",namespaces.gx),S=isExtrudable(C,v),g=queryBooleanValue(g,"extrude",namespaces.kml),T=Math.min(y.length,_.length),x=[],b=[],E=0;E<T;E++){var P=readCoordinate(y[E].textContent,p);x.push(P),b.push(JulianDate.fromIso8601(_[E].textContent))}s&&(defined(a)&&addToMultiTrack([a,b[0]],[o,x[0]],h,d,u,!1,"absolute",void 0,!1),a=b[T-1],o=x[x.length-1]),addToMultiTrack(b,x,h,d,u,S&&g,C,v,!0),c=c||S&&g}return r.availability=d,r.position=h,processPositionGraphics(e,r,n),processPathGraphics(r,n),c&&(createDropLine(t,r,n),r.polyline.show=u),!0}var geometryTypes={Point:processPoint,LineString:processLineStringOrLinearRing,LinearRing:processLineStringOrLinearRing,Polygon:processPolygon,Track:processTrack,MultiTrack:processMultiTrack,MultiGeometry:processMultiGeometry,Model:processUnsupportedGeometry},scratchDiv;function processMultiGeometry(e,t,i,r,n,a){for(var o=i.childNodes,s=!1,l=0,c=o.length;l<c;l++){var u,d=o.item(l),h=geometryTypes[d.localName];defined(h)&&((u=createEntity(d,t,a)).parent=r,u.name=r.name,u.availability=r.availability,u.description=r.description,u.kml=r.kml,h(e,t,d,u,n)&&(s=!0))}return s}function processUnsupportedGeometry(e,t,i,r,n){return oneTimeWarning("kml-unsupportedGeometry","KML - Unsupported geometry: "+i.localName),!1}function processExtendedData(e,t){e=queryFirstNode(e,"ExtendedData",namespaces.kml);if(defined(e)){defined(queryFirstNode(e,"SchemaData",namespaces.kml))&&oneTimeWarning("kml-schemaData","KML - SchemaData is unsupported"),defined(queryStringAttribute(e,"xmlns:prefix"))&&oneTimeWarning("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");var i={},r=queryChildNodes(e,"Data",namespaces.kml);if(defined(r))for(var n=r.length,a=0;a<n;a++){var o=r[a],s=queryStringAttribute(o,"name");defined(s)&&(i[s]={displayName:queryStringValue(o,"displayName",namespaces.kml),value:queryStringValue(o,"value",namespaces.kml)})}t.kml.extendedData=i}}function processDescription(e,t,i,r,n){var a,o,s=t.kml,l=s.extendedData,c=queryStringValue(e,"description",namespaces.kml),u=defaultValue(t.balloonStyle,i.balloonStyle),e=Color.WHITE,i=Color.BLACK,d=c;if(defined(u)&&(e=defaultValue(u.bgColor,Color.WHITE),i=defaultValue(u.textColor,Color.BLACK),d=defaultValue(u.text,c)),defined(d)){if(d=(d=(d=(d=(d=(d=d.replace("$[name]",defaultValue(t.name,""))).replace("$[description]",defaultValue(c,""))).replace("$[address]",defaultValue(s.address,""))).replace("$[Snippet]",defaultValue(s.snippet,""))).replace("$[id]",t.id)).replace("$[geDirections]",""),defined(l)){var h=d.match(/\$\[.+?\]/g);if(null!==h)for(y=0;y<h.length;y++){var p,m=h[y],f=m.substr(2,m.length-3),g=/\/displayName$/.test(f);defined(p=l[f=f.replace(/\/displayName$/,"")])&&(p=g?p.displayName:p.value),defined(p)&&(d=d.replace(m,defaultValue(p,"")))}}}else if(defined(l)&&0<(o=Object.keys(l)).length){for(d='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',y=0;y<o.length;y++)d+="<tr><th>"+defaultValue((p=l[a=o[y]]).displayName,a)+"</th><td>"+defaultValue(p.value,"")+"</td></tr>";d+="</tbody></table>"}if(defined(d)){d=autolinker.link(d),scratchDiv.innerHTML=d;for(var _=scratchDiv.querySelectorAll("a"),y=0;y<_.length;y++)_[y].setAttribute("target","_blank");defined(r)&&1<r.keys.length&&(embedDataUris(scratchDiv,"a","href",r),embedDataUris(scratchDiv,"img","src",r)),applyBasePath(scratchDiv,"a","href",n),applyBasePath(scratchDiv,"img","src",n);n='<div class="cesium-infoBox-description-lighter" style="';n+="overflow:auto;",n+="word-wrap:break-word;",n+="background-color:"+e.toCssColorString()+";",n+="color:"+i.toCssColorString()+";",n+='">',n+=scratchDiv.innerHTML+"</div>",scratchDiv.innerHTML="",t.description=n}}function processFeature(e,t,i){var r=i.entityCollection,n=i.parentEntity,a=i.sourceResource,o=i.uriResolver,s=createEntity(t,r,i.context),l=s.kml,r=computeFinalStyle(e,t,i.styleCollection,a,o),i=queryStringValue(t,"name",namespaces.kml);s.name=i,s.parent=n;i=processTimeSpan(t);defined(i)||(i=processTimeStamp(t)),s.availability=i,mergeAvailabilityWithParent(s);i=queryBooleanValue(t,"visibility",namespaces.kml);s.show=function e(t){return!t||t.show&&e(t.parent)}(n)&&defaultValue(i,!0);n=queryFirstNode(t,"author",namespaces.atom),i=l.author;i.name=queryStringValue(n,"name",namespaces.atom),i.uri=queryStringValue(n,"uri",namespaces.atom),i.email=queryStringValue(n,"email",namespaces.atom);i=queryFirstNode(t,"link",namespaces.atom),n=l.link;n.href=queryStringAttribute(i,"href"),n.hreflang=queryStringAttribute(i,"hreflang"),n.rel=queryStringAttribute(i,"rel"),n.type=queryStringAttribute(i,"type"),n.title=queryStringAttribute(i,"title"),n.length=queryStringAttribute(i,"length"),l.address=queryStringValue(t,"address",namespaces.kml),l.phoneNumber=queryStringValue(t,"phoneNumber",namespaces.kml),l.snippet=queryStringValue(t,"Snippet",namespaces.kml),processExtendedData(t,s),processDescription(t,s,r,o,a);e=e._ellipsoid;return processLookAt(t,s,e),processCamera(t,s,e),defined(queryFirstNode(t,"Region",namespaces.kml))&&oneTimeWarning("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:r}}function processDocument(e,t,i,r){r.addNodes(t.childNodes,i),r.process()}function processFolder(e,t,i,r){var n=processFeature(e,t,i),i=clone$1(i);i.parentEntity=n.entity,processDocument(e,t,i,r)}function processPlacemark(e,t,i,r){for(var n=processFeature(e,t,i),a=n.entity,o=n.styleEntity,s=!1,l=t.childNodes,c=0,u=l.length;c<u&&!s;c++){var d=l.item(c),h=geometryTypes[d.localName];defined(h)&&(h(e,i.entityCollection,d,a,o,a.id),s=!0)}s||(a.merge(o),processPositionGraphics(e,a,o))}"undefined"!=typeof document&&(scratchDiv=document.createElement("div"));var playlistNodeProcessors={FlyTo:processTourFlyTo,Wait:processTourWait,SoundCue:processTourUnsupportedNode,AnimatedUpdate:processTourUnsupportedNode,TourControl:processTourUnsupportedNode};function processTour(e,t,i,r){var n=new KmlTour(queryStringValue(t,"name",namespaces.kml),queryStringAttribute(t,"id")),t=queryFirstNode(t,"Playlist",namespaces.gx);if(t)for(var a=e._ellipsoid,o=t.childNodes,s=0;s<o.length;s++){var l,c=o[s];c.localName&&((l=playlistNodeProcessors[c.localName])?l(n,c,a):console.log("Unknown KML Tour playlist entry type "+c.localName))}defined(e.kmlTours)||(e.kmlTours=[]),e.kmlTours.push(n)}function processTourUnsupportedNode(e,t){oneTimeWarning("KML Tour unsupported node "+t.localName)}function processTourWait(e,t){t=queryNumericValue(t,"duration",namespaces.gx);e.addPlaylistEntry(new KmlTourWait(t))}function processTourFlyTo(e,t,i){var r=queryNumericValue(t,"duration",namespaces.gx),n=queryStringValue(t,"flyToMode",namespaces.gx),a={kml:{}};processLookAt(t,a,i),processCamera(t,a,i);a=new KmlTourFlyTo(r,n,a.kml.lookAt||a.kml.camera);e.addPlaylistEntry(a)}function processCamera(e,t,i){var r,n,a,o,s=queryFirstNode(e,"Camera",namespaces.kml);defined(s)&&(r=defaultValue(queryNumericValue(s,"longitude",namespaces.kml),0),n=defaultValue(queryNumericValue(s,"latitude",namespaces.kml),0),a=defaultValue(queryNumericValue(s,"altitude",namespaces.kml),0),o=defaultValue(queryNumericValue(s,"heading",namespaces.kml),0),e=defaultValue(queryNumericValue(s,"tilt",namespaces.kml),0),s=defaultValue(queryNumericValue(s,"roll",namespaces.kml),0),i=Cartesian3.fromDegrees(r,n,a,i),s=HeadingPitchRoll.fromDegrees(o,e-90,s),t.kml.camera=new KmlCamera(i,s))}function processLookAt(e,t,i){var r,n,a,o,s=queryFirstNode(e,"LookAt",namespaces.kml);defined(s)&&(r=defaultValue(queryNumericValue(s,"longitude",namespaces.kml),0),n=defaultValue(queryNumericValue(s,"latitude",namespaces.kml),0),a=defaultValue(queryNumericValue(s,"altitude",namespaces.kml),0),o=queryNumericValue(s,"heading",namespaces.kml),e=queryNumericValue(s,"tilt",namespaces.kml),s=defaultValue(queryNumericValue(s,"range",namespaces.kml),0),e=CesiumMath.toRadians(defaultValue(e,0)),s=new HeadingPitchRange(o=CesiumMath.toRadians(defaultValue(o,0)),e-CesiumMath.PI_OVER_TWO,s),i=Cartesian3.fromDegrees(r,n,a,i),t.kml.lookAt=new KmlLookAt(i,s))}function processGroundOverlay(e,t,i,r){var n,a=processFeature(e,t,i).entity,o=!1,s=e._ellipsoid,l=readCoordinates(queryFirstNode(t,"LatLonQuad",namespaces.gx),s),c=queryNumericValue(t,"drawOrder",namespaces.kml);defined(l)?((n=createDefaultPolygon()).hierarchy=new PolygonHierarchy(l),n.zIndex=c,a.polygon=n,o=!0):((n=new RectangleGraphics).zIndex=c,a.rectangle=n,defined(s=queryFirstNode(t,"LatLonBox",namespaces.kml))&&(l=queryNumericValue(s,"west",namespaces.kml),c=queryNumericValue(s,"south",namespaces.kml),a=queryNumericValue(s,"east",namespaces.kml),u=queryNumericValue(s,"north",namespaces.kml),defined(l)&&(l=CesiumMath.negativePiToPi(CesiumMath.toRadians(l))),defined(c)&&(c=CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(c))),defined(a)&&(a=CesiumMath.negativePiToPi(CesiumMath.toRadians(a))),defined(u)&&(u=CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(u))),n.coordinates=new Rectangle(l,c,a,u),defined(u=queryNumericValue(s,"rotation",namespaces.kml))&&(d=CesiumMath.toRadians(u),n.rotation=d,n.stRotation=d)));var u=queryFirstNode(t,"Icon",namespaces.kml),d=getIconHref(u,e,i.sourceResource,i.uriResolver,!0);defined(d)?(o&&oneTimeWarning("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection."),e=queryNumericValue(u,"x",namespaces.gx),i=queryNumericValue(u,"y",namespaces.gx),o=queryNumericValue(u,"w",namespaces.gx),u=queryNumericValue(u,"h",namespaces.gx),(defined(e)||defined(i)||defined(o)||defined(u))&&oneTimeWarning("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),n.material=d,n.material.color=queryColorValue(t,"color",namespaces.kml),n.material.transparent=!0):n.material=queryColorValue(t,"color",namespaces.kml);d=queryStringValue(t,"altitudeMode",namespaces.kml);defined(d)?"absolute"===d?(n.height=queryNumericValue(t,"altitude",namespaces.kml),n.zIndex=void 0):"clampToGround"!==d&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+d):"relativeToSeaFloor"===(d=queryStringValue(t,"altitudeMode",namespaces.gx))?(oneTimeWarning("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),n.height=queryNumericValue(t,"altitude",namespaces.kml),n.zIndex=void 0):"clampToSeaFloor"===d?oneTimeWarning("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):defined(d)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+d)}function processUnsupportedFeature(e,t,i,r){e._unsupportedNode.raiseEvent(e,i.parentEntity,t,i.entityCollection,i.styleCollection,i.sourceResource,i.uriResolver),oneTimeWarning("kml-unsupportedFeature-"+t.nodeName,"KML - Unsupported feature: "+t.nodeName)}var RefreshMode={INTERVAL:0,EXPIRE:1,STOP:2};function cleanupString(e){if(!defined(e)||0===e.length)return"";var t=e[0];return e="&"===t||"?"===t?e.substring(1):e}var zeroRectangle=new Rectangle,scratchCartographic$5=new Cartographic,scratchCartesian2$2=new Cartesian2,scratchCartesian3$2=new Cartesian3;function processNetworkLinkQueryString(e,t,i,r,n,a){function o(e){return e<-CesiumMath.PI_OVER_TWO?-CesiumMath.PI_OVER_TWO:e>CesiumMath.PI_OVER_TWO?CesiumMath.PI_OVER_TWO:e}function s(e){return e>CesiumMath.PI?e-CesiumMath.TWO_PI:e<-CesiumMath.PI?e+CesiumMath.TWO_PI:e}var l,c,u,d,h=objectToQuery(e.queryParameters);h=h.replace(/%5B/g,"[").replace(/%5D/g,"]"),h=defined(t)&&t._mode!==SceneMode$1.MORPHING?(n=defaultValue(n,zeroRectangle),defined(i)&&(scratchCartesian2$2.x=.5*i.clientWidth,scratchCartesian2$2.y=.5*i.clientHeight,l=t.pickEllipsoid(scratchCartesian2$2,a,scratchCartesian3$2)),defined(l)?d=a.cartesianToCartographic(l,scratchCartographic$5):(d=Rectangle.center(n,scratchCartographic$5),l=a.cartographicToCartesian(d)),defined(r)&&!CesiumMath.equalsEpsilon(r,1,CesiumMath.EPSILON9)&&(c=n.width*r*.5,u=n.height*r*.5,n=new Rectangle(s(d.longitude-c),o(d.latitude-u),s(d.longitude+c),o(d.latitude+u))),h=(h=(h=(h=h.replace("[bboxWest]",CesiumMath.toDegrees(n.west).toString())).replace("[bboxSouth]",CesiumMath.toDegrees(n.south).toString())).replace("[bboxEast]",CesiumMath.toDegrees(n.east).toString())).replace("[bboxNorth]",CesiumMath.toDegrees(n.north).toString()),u=CesiumMath.toDegrees(d.longitude).toString(),n=CesiumMath.toDegrees(d.latitude).toString(),h=(h=(h=(h=(h=(h=(h=(h=h.replace("[lookatLon]",u)).replace("[lookatLat]",n)).replace("[lookatTilt]",CesiumMath.toDegrees(t.pitch).toString())).replace("[lookatHeading]",CesiumMath.toDegrees(t.heading).toString())).replace("[lookatRange]",Cartesian3.distance(t.positionWC,l))).replace("[lookatTerrainLon]",u)).replace("[lookatTerrainLat]",n)).replace("[lookatTerrainAlt]",d.height.toString()),a.cartesianToCartographic(t.positionWC,scratchCartographic$5),h=(h=(h=h.replace("[cameraLon]",CesiumMath.toDegrees(scratchCartographic$5.longitude).toString())).replace("[cameraLat]",CesiumMath.toDegrees(scratchCartographic$5.latitude).toString())).replace("[cameraAlt]",CesiumMath.toDegrees(scratchCartographic$5.height).toString()),d=n="",defined(t=(a=t.frustum).aspectRatio)&&(a=CesiumMath.toDegrees(a.fov),1<t?d=(n=a)/t:n=(d=a)*t),(h=h.replace("[horizFov]",n.toString())).replace("[vertFov]",d.toString())):(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=(h=h.replace("[bboxWest]","-180")).replace("[bboxSouth]","-90")).replace("[bboxEast]","180")).replace("[bboxNorth]","90")).replace("[lookatLon]","")).replace("[lookatLat]","")).replace("[lookatRange]","")).replace("[lookatTilt]","")).replace("[lookatHeading]","")).replace("[lookatTerrainLon]","")).replace("[lookatTerrainLat]","")).replace("[lookatTerrainAlt]","")).replace("[cameraLon]","")).replace("[cameraLat]","")).replace("[cameraAlt]","")).replace("[horizFov]","")).replace("[vertFov]",""),h=(h=(h=(h=(h=(h=defined(i)?(h=h.replace("[horizPixels]",i.clientWidth)).replace("[vertPixels]",i.clientHeight):(h=h.replace("[horizPixels]","")).replace("[vertPixels]","")).replace("[terrainEnabled]","1")).replace("[clientVersion]","1")).replace("[kmlVersion]","2.2")).replace("[clientName]","Cesium")).replace("[language]","English"),e.setQueryParameters(queryToObject(h))}function processNetworkLink(m,e,t,i){var f,g,_,y,C=processFeature(m,e,t).entity,r=t.sourceResource,n=t.uriResolver,v=queryFirstNode(e,"Link",namespaces.kml);defined(v)||(v=queryFirstNode(e,"Url",namespaces.kml)),!defined(v)||defined(_=queryStringValue(v,"href",namespaces.kml))&&(_=resolveHref(e=_,r,t.uriResolver),/^data:/.test(_.getUrlComponent())?/\.kmz/i.test(r.getUrlComponent())||(e=r.getDerivedResource({url:e})):(e=_.clone(),f=queryStringValue(v,"viewRefreshMode",namespaces.kml),g=defaultValue(queryStringValue(v,"viewBoundScale",namespaces.kml),1),t="onStop"===f?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",r=defaultValue(queryStringValue(v,"viewFormat",namespaces.kml),t),t=queryStringValue(v,"httpQuery",namespaces.kml),defined(r)&&_.setQueryParameters(queryToObject(cleanupString(r))),defined(t)&&_.setQueryParameters(queryToObject(cleanupString(t))),t=m._ellipsoid,processNetworkLinkQueryString(_,m._camera,m._canvas,g,m._lastCameraView.bbox,t)),n={sourceUri:e,uriResolver:n,context:C.id},y=new EntityCollection,n=load(m,y,_,n).then(function(e){var t=m._entityCollection,i=y.values;t.suspendEvents();for(var r=0;r<i.length;r++){var n=i[r];defined(n.parent)||(n.parent=C,mergeAvailabilityWithParent(n)),t.add(n)}t.resumeEvents();var a=queryStringValue(v,"refreshMode",namespaces.kml),o=defaultValue(queryNumericValue(v,"refreshInterval",namespaces.kml),0);if("onInterval"===a&&0<o||"onExpire"===a||"onStop"===f){var s,l=queryFirstNode(e,"NetworkLinkControl",namespaces.kml),c=defined(l),u=JulianDate.now(),d={id:createGuid(),href:_,cookie:{},lastUpdated:u,updating:!1,entity:C,viewBoundScale:g,needsUpdate:!1,cameraUpdateTime:u},e=0;if(c&&(d.cookie=queryToObject(defaultValue(queryStringValue(l,"cookie",namespaces.kml),"")),e=defaultValue(queryNumericValue(l,"minRefreshPeriod",namespaces.kml),0)),"onInterval"===a)c&&(o=Math.max(e,o)),d.refreshMode=RefreshMode.INTERVAL,d.time=o;else if("onExpire"===a)if(defined(s=c?queryStringValue(l,"expires",namespaces.kml):s))try{var h=JulianDate.fromIso8601(s),p=JulianDate.secondsDifference(h,u);0<p&&p<e&&JulianDate.addSeconds(u,e,h),d.refreshMode=RefreshMode.EXPIRE,d.time=h}catch(e){oneTimeWarning("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else oneTimeWarning("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element");else m._camera?(d.refreshMode=RefreshMode.STOP,d.time=defaultValue(queryNumericValue(v,"viewRefreshTime",namespaces.kml),0)):oneTimeWarning("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");defined(d.refreshMode)&&m._networkLinks.set(d.id,d)}else"onRegion"===f&&oneTimeWarning("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion")}).otherwise(function(e){oneTimeWarning("An error occured during loading "+_.url),m._error.raiseEvent(m,e)}),i.addPromise(n))}function processFeatureNode(e,t,i,r){var n=featureTypes[t.localName];return defined(n)?n(e,t,i,r):processUnsupportedFeature(e,t,i)}function loadKml(a,o,s,l,c,u){o.removeAll();var e=s.documentElement,e=queryStringValue("Document"===e.localName?e:queryFirstNode(e,"Document",namespaces.kml),"name",namespaces.kml);defined(e)||(e=getFilenameFromUri(l.getUrlComponent())),defined(a._name)||(a._name=e);var d=new KmlDataSource._DeferredLoading(a),h=new EntityCollection(a);return when.all(processStyles(a,s,h,l,!1,c)).then(function(){var e=s.documentElement;if("kml"===e.localName)for(var t=e.childNodes,i=0;i<t.length;i++){var r=t[i];if(defined(featureTypes[r.localName])){e=r;break}}var n={parentEntity:void 0,entityCollection:o,styleCollection:h,sourceResource:l,uriResolver:c,context:u};return o.suspendEvents(),processFeatureNode(a,e,n,d),o.resumeEvents(),d.wait().then(function(){return s.documentElement})})}function loadKmz(c,u,e,d){var h=when.defer();return zip.createReader(new zip.BlobReader(e),function(l){l.getEntries(function(e){for(var t,i,r=[],n={},a=0;a<e.length;a++){var o,s=e[a];s.directory||(o=when.defer(),r.push(o.promise),!/\.kml$/i.test(s.filename)||defined(t)&&/\//i.test(s.filename)?loadDataUriFromZip(s,n,o):(defined(t)&&loadDataUriFromZip(t,n,i),t=s,i=o))}defined(t)&&loadXmlFromZip(t,n,i),when.all(r).then(function(){return l.close(),defined(n.kml)?(n.keys=Object.keys(n),loadKml(c,u,n.kml,d,n)):void h.reject(new RuntimeError("KMZ file does not contain a KML document."))}).then(h.resolve).otherwise(h.reject)})},function(e){h.reject(e)}),h.promise}function load(r,n,e,t){var a=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).sourceUri,o=t.uriResolver,s=t.context,t=e;if("string"==typeof e||e instanceof Resource){var t=(e=Resource.createIfNeeded(e)).fetchBlob(),a=defaultValue(a,e.clone()),i=r._resourceCredits,l=e.credits;if(defined(l))for(var c=l.length,u=0;u<c;u++)i.push(l[u])}else a=defaultValue(a,Resource.DEFAULT.clone());return a=Resource.createIfNeeded(a),when(t).then(function(t){return t instanceof Blob?isZipFile(t).then(function(e){return e?loadKmz(r,n,t,a):readBlobAsText(t).then(function(e){var t,i;e=removeDuplicateNamespaces(e=insertNamespaces(e));try{t=parser.parseFromString(e,"application/xml")}catch(e){i=e.toString()}if(defined(i)||t.body||"parsererror"===t.documentElement.tagName)throw new RuntimeError((defined(i)?i:t.documentElement.firstChild.nodeValue)||t.body.innerText);return loadKml(r,n,t,a,o,s)})}):loadKml(r,n,t,a,o,s)}).otherwise(function(e){return r._error.raiseEvent(r,e),console.log(e),when.reject(e)})}function KmlDataSource(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).camera,i=e.canvas;this._changed=new Event,this._error=new Event,this._loading=new Event,this._refresh=new Event,this._unsupportedNode=new Event,this._clock=void 0,this._entityCollection=new EntityCollection(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new PinBuilder,this._networkLinks=new AssociativeArray,this._entityCluster=new EntityCluster,this._canvas=i,this._camera=t,this._lastCameraView={position:defined(t)?Cartesian3.clone(t.positionWC):void 0,direction:defined(t)?Cartesian3.clone(t.directionWC):void 0,up:defined(t)?Cartesian3.clone(t.upWC):void 0,bbox:defined(t)?t.computeViewRectangle():Rectangle.clone(Rectangle.MAX_VALUE)},this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84);e=e.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e,this._resourceCredits=[]}function mergeAvailabilityWithParent(e){var t,i=e.parent;!defined(i)||defined(t=i.availability)&&(defined(i=e.availability)?i.intersect(t):e.availability=t)}function getNetworkLinkUpdateCallback(f,g,_,y,C){return function(e){if(y.contains(g.id)){var t=!1,i=queryFirstNode(e,"NetworkLinkControl",namespaces.kml),r=0;if(defined(i)){if(defined(queryFirstNode(i,"Update",namespaces.kml)))return oneTimeWarning("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),g.updating=!1,void y.remove(g.id);g.cookie=queryToObject(defaultValue(queryStringValue(i,"cookie",namespaces.kml),"")),r=defaultValue(queryNumericValue(i,"minRefreshPeriod",namespaces.kml),0)}var n,a=JulianDate.now(),e=g.refreshMode;if(e===RefreshMode.INTERVAL)defined(i)&&(g.time=Math.max(r,g.time));else if(e===RefreshMode.EXPIRE)if(defined(i)&&(n=queryStringValue(i,"expires",namespaces.kml)),defined(n))try{var o=JulianDate.fromIso8601(n),s=JulianDate.secondsDifference(o,a);0<s&&s<r&&JulianDate.addSeconds(a,r,o),g.time=o}catch(e){oneTimeWarning("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),t=!0}else oneTimeWarning("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),t=!0;var l=g.entity,c=f._entityCollection,u=_.values;c.suspendEvents();for(var d=c.values.slice(),h=0;h<d.length;++h){var p=d[h];p.parent===l&&(p.parent=void 0,function e(t){c.remove(t);for(var i=t._children,r=i.length,n=0;n<r;++n)e(i[n])}(p))}for(c.resumeEvents(),c.suspendEvents(),h=0;h<u.length;h++){var m=u[h];defined(m.parent)||(m.parent=l,mergeAvailabilityWithParent(m)),c.add(m)}c.resumeEvents(),t?y.remove(g.id):g.lastUpdated=a;r=c.computeAvailability(),o=r.start,t=r.stop,a=JulianDate.equals(o,Iso8601.MINIMUM_VALUE),r=JulianDate.equals(t,Iso8601.MAXIMUM_VALUE);a&&r||((r=f._clock).startTime===o&&r.stopTime===t||(r.startTime=o,r.stopTime=t,f._changed.raiseEvent(f))),g.updating=!1,g.needsUpdate=!1,f._refresh.raiseEvent(f,C.getUrlComponent(!0))}}}KmlDataSource.load=function(e,t){return new KmlDataSource(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).load(e,t)},Object.defineProperties(KmlDataSource.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}}}),KmlDataSource.prototype.load=function(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),DataSource.setLoading(this,!0);var a=this._name;this._name=void 0,this._clampToGround=defaultValue(t.clampToGround,!1);var o=this;return load(this,this._entityCollection,e,t).then(function(){var e,t=o._entityCollection.computeAvailability(),i=t.start,r=t.stop,n=JulianDate.equals(i,Iso8601.MINIMUM_VALUE),t=JulianDate.equals(r,Iso8601.MAXIMUM_VALUE);n&&t||(n&&((e=new Date).setHours(0,0,0,0),i=JulianDate.fromDate(e)),t&&((e=new Date).setHours(24,0,0,0),r=JulianDate.fromDate(e)),(e=new DataSourceClock).startTime=i,e.stopTime=r,e.currentTime=JulianDate.clone(i),e.clockRange=ClockRange$1.LOOP_STOP,e.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(JulianDate.secondsDifference(r,i)/60,1),31556900)));i=!1;return e!==o._clock&&(o._clock=e,i=!0),(i=a!==o._name?!0:i)&&o._changed.raiseEvent(o),DataSource.setLoading(o,!1),o}).otherwise(function(e){return DataSource.setLoading(o,!1),o._error.raiseEvent(o,e),console.log(e),when.reject(e)})};var entitiesToIgnore=new AssociativeArray;function KmlFeatureData(){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}function Visualizer(){DeveloperError.throwInstantiationError()}KmlDataSource.prototype.update=function(e){var t=this._networkLinks;if(0===t.length)return!0;var a=JulianDate.now(),o=this;entitiesToIgnore.removeAll();var s=!1,l=this._lastCameraView,i=this._camera;!defined(i)||i.positionWC.equalsEpsilon(l.position,CesiumMath.EPSILON7)&&i.directionWC.equalsEpsilon(l.direction,CesiumMath.EPSILON7)&&i.upWC.equalsEpsilon(l.up,CesiumMath.EPSILON7)||(l.position=Cartesian3.clone(i.positionWC),l.direction=Cartesian3.clone(i.directionWC),l.up=Cartesian3.clone(i.upWC),l.bbox=i.computeViewRectangle(),s=!0);var c=new AssociativeArray,u=!1;return t.values.forEach(function(t){var e,i,r,n=t.entity;entitiesToIgnore.contains(n.id)||(t.updating||(r=!1,t.refreshMode===RefreshMode.INTERVAL?JulianDate.secondsDifference(a,t.lastUpdated)>t.time&&(r=!0):t.refreshMode===RefreshMode.EXPIRE?JulianDate.greaterThan(a,t.time)&&(r=!0):t.refreshMode===RefreshMode.STOP&&(s&&(t.needsUpdate=!0,t.cameraUpdateTime=a),t.needsUpdate&&JulianDate.secondsDifference(a,t.cameraUpdateTime)>=t.time&&(r=!0)),r&&(function e(t){for(var i=t._children,r=i.length,n=0;n<r;++n){var a=i[n];entitiesToIgnore.set(a.id,a),e(a)}}(n),t.updating=!0,e=new EntityCollection,(i=t.href.clone()).setQueryParameters(t.cookie),r=defaultValue(o._ellipsoid,Ellipsoid.WGS84),processNetworkLinkQueryString(i,o._camera,o._canvas,t.viewBoundScale,l.bbox,r),load(o,e,i,{context:n.id}).then(getNetworkLinkUpdateCallback(o,t,e,c,i)).otherwise(function(e){e="NetworkLink "+t.href+" refresh failed: "+e;console.log(e),o._error.raiseEvent(o,e)}),u=!0)),c.set(t.id,t))}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0},KmlDataSource._DeferredLoading=DeferredLoading,KmlDataSource._getTimestamp=getTimestamp$1,Visualizer.prototype.update=DeveloperError.throwInstantiationError,Visualizer.prototype.getBoundingSphere=DeveloperError.throwInstantiationError,Visualizer.prototype.isDestroyed=DeveloperError.throwInstantiationError,Visualizer.prototype.destroy=DeveloperError.throwInstantiationError;var ViewportQuadVS="attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n",renderStateScratch;function ComputeEngine(e){this._context=e}var drawCommandScratch=new DrawCommand({primitiveType:PrimitiveType$1.TRIANGLES}),clearCommandScratch=new ClearCommand({color:new Color(0,0,0,0)});function createFramebuffer$2(e,t){return new Framebuffer({context:e,colorTextures:[t],destroyAttachments:!1})}function createViewportQuadShader(e,t){return ShaderProgram.fromCache({context:e,vertexShaderSource:ViewportQuadVS,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function createRenderState$1(e,t){return renderStateScratch=!defined(renderStateScratch)||renderStateScratch.viewport.width!==e||renderStateScratch.viewport.height!==t?RenderState.fromCache({viewport:new BoundingRectangle(0,0,e,t)}):renderStateScratch}function PassState(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}function ShaderCache(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function destroyShader(e,t){for(var i=t.derivedKeywords,r=i.length,n=0;n<r;++n){var a=i[n]+t.keyword;destroyShader(e,e._shaders[a])}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}function TextureCache(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}function SunLight(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.color=Color.clone(defaultValue(e.color,Color.WHITE)),this.intensity=defaultValue(e.intensity,2)}function UniformState(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new BoundingRectangle,this._viewportCartesian4=new Cartesian4,this._viewportDirty=!1,this._viewportOrthographicMatrix=Matrix4.clone(Matrix4.IDENTITY),this._viewportTransformation=Matrix4.clone(Matrix4.IDENTITY),this._model=Matrix4.clone(Matrix4.IDENTITY),this._view=Matrix4.clone(Matrix4.IDENTITY),this._inverseView=Matrix4.clone(Matrix4.IDENTITY),this._projection=Matrix4.clone(Matrix4.IDENTITY),this._infiniteProjection=Matrix4.clone(Matrix4.IDENTITY),this._entireFrustum=new Cartesian2,this._currentFrustum=new Cartesian2,this._frustumPlanes=new Cartesian4,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Matrix3.clone(Matrix4.IDENTITY),this._view3DDirty=!0,this._view3D=new Matrix4,this._inverseView3DDirty=!0,this._inverseView3D=new Matrix4,this._inverseModelDirty=!0,this._inverseModel=new Matrix4,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Matrix3,this._viewRotation=new Matrix3,this._inverseViewRotation=new Matrix3,this._viewRotation3D=new Matrix3,this._inverseViewRotation3D=new Matrix3,this._inverseProjectionDirty=!0,this._inverseProjection=new Matrix4,this._modelViewDirty=!0,this._modelView=new Matrix4,this._modelView3DDirty=!0,this._modelView3D=new Matrix4,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new Matrix4,this._inverseModelViewDirty=!0,this._inverseModelView=new Matrix4,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new Matrix4,this._viewProjectionDirty=!0,this._viewProjection=new Matrix4,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new Matrix4,this._modelViewProjectionDirty=!0,this._modelViewProjection=new Matrix4,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new Matrix4,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new Matrix4,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new Matrix4,this._normalDirty=!0,this._normal=new Matrix3,this._normal3DDirty=!0,this._normal3D=new Matrix3,this._inverseNormalDirty=!0,this._inverseNormal=new Matrix3,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Matrix3,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new EncodedCartesian3,this._cameraPosition=new Cartesian3,this._sunPositionWC=new Cartesian3,this._sunPositionColumbusView=new Cartesian3,this._sunDirectionWC=new Cartesian3,this._sunDirectionEC=new Cartesian3,this._moonDirectionEC=new Cartesian3,this._lightDirectionWC=new Cartesian3,this._lightDirectionEC=new Cartesian3,this._lightColor=new Cartesian3,this._lightColorHdr=new Cartesian3,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new Cartesian3,this._cameraRight=new Cartesian3,this._cameraUp=new Cartesian3,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new Cartesian2,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new Color,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new Cartesian2,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._imagerySplitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}function setView(e,t){Matrix4.clone(t,e._view),Matrix4.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 setInverseView(e,t){Matrix4.clone(t,e._inverseView),Matrix4.getMatrix3(t,e._inverseViewRotation)}function setProjection(e,t){Matrix4.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function setInfiniteProjection(e,t){Matrix4.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function setCamera(e,t){Cartesian3.clone(t.positionWC,e._cameraPosition),Cartesian3.clone(t.directionWC,e._cameraDirection),Cartesian3.clone(t.rightWC,e._cameraRight),Cartesian3.clone(t.upWC,e._cameraUp);t=t.positionCartographic;defined(t)?e._eyeHeight=t.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}ComputeEngine.prototype.execute=function(e){defined(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,i=t.width,r=t.height,n=this._context,a=defined(e.vertexArray)?e.vertexArray:n.getViewportQuadVertexArray(),o=defined(e.shaderProgram)?e.shaderProgram:createViewportQuadShader(n,e.fragmentShaderSource),s=createFramebuffer$2(n,t),l=createRenderState$1(i,r),i=e.uniformMap,r=clearCommandScratch;r.framebuffer=s,r.renderState=l,r.execute(n);r=drawCommandScratch;r.vertexArray=a,r.renderState=l,r.shaderProgram=o,r.uniformMap=i,r.framebuffer=s,r.execute(n),s.destroy(),e.persists||(o.destroy(),defined(e.vertexArray)&&a.destroy()),defined(e.postExecute)&&e.postExecute(t)},ComputeEngine.prototype.isDestroyed=function(){return!1},ComputeEngine.prototype.destroy=function(){return destroyObject(this)},Object.defineProperties(ShaderCache.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),ShaderCache.prototype.replaceShaderProgram=function(e){return defined(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)},ShaderCache.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,r=e.attributeLocations;"string"==typeof t&&(t=new ShaderSource({sources:[t]})),"string"==typeof i&&(i=new ShaderSource({sources:[i]}));var n,a=t.createCombinedVertexShader(this._context),o=i.createCombinedFragmentShader(this._context),s=a+o+JSON.stringify(r);return defined(this._shaders[s])?(n=this._shaders[s],delete this._shadersToRelease[s]):((r=new ShaderProgram({gl:(e=this._context)._gl,logShaderCompilation:e.logShaderCompilation,debugShaders:e.debugShaders,vertexShaderSource:t,vertexShaderText:a,fragmentShaderSource:i,fragmentShaderText:o,attributeLocations:r}))._cachedShader=n={cache:this,shaderProgram:r,keyword:s,derivedKeywords:[],count:0},this._shaders[s]=n,++this._numberOfShaders),++n.count,n.shaderProgram},ShaderCache.prototype.replaceDerivedShaderProgram=function(e,t,i){var r=e._cachedShader,n=t+r.keyword,n=this._shaders[n];return defined(n)&&(destroyShader(this,n),-1<(n=r.derivedKeywords.indexOf(t))&&r.derivedKeywords.splice(n,1)),this.createDerivedShaderProgram(e,t,i)},ShaderCache.prototype.getDerivedShaderProgram=function(e,t){e=t+e._cachedShader.keyword,e=this._shaders[e];if(defined(e))return e.shaderProgram},ShaderCache.prototype.createDerivedShaderProgram=function(e,t,i){var r=e._cachedShader,n=t+r.keyword,a=i.vertexShaderSource,o=i.fragmentShaderSource,s=i.attributeLocations;"string"==typeof a&&(a=new ShaderSource({sources:[a]})),"string"==typeof o&&(o=new ShaderSource({sources:[o]}));var l=this._context,e=a.createCombinedVertexShader(l),i=o.createCombinedFragmentShader(l),i=new ShaderProgram({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:a,vertexShaderText:e,fragmentShaderSource:o,fragmentShaderText:i,attributeLocations:s}),s={cache:this,shaderProgram:i,keyword:n,derivedKeywords:[],count:0};return r.derivedKeywords.push(t),i._cachedShader=s,this._shaders[n]=s,i},ShaderCache.prototype.destroyReleasedShaderPrograms=function(){var e,t=this._shadersToRelease;for(e in t)t.hasOwnProperty(e)&&(destroyShader(this,t[e]),--this._numberOfShaders);this._shadersToRelease={}},ShaderCache.prototype.releaseShaderProgram=function(e){!defined(e)||(e=e._cachedShader)&&0==--e.count&&(this._shadersToRelease[e.keyword]=e)},ShaderCache.prototype.isDestroyed=function(){return!1},ShaderCache.prototype.destroy=function(){var e,t=this._shaders;for(e in t)t.hasOwnProperty(e)&&t[e].shaderProgram.finalDestroy();return destroyObject(this)},Object.defineProperties(TextureCache.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}}),TextureCache.prototype.getTexture=function(e){var t=this._textures[e];if(defined(t))return delete this._texturesToRelease[e],++t.count,t.texture},TextureCache.prototype.addTexture=function(e,t){var i={texture:t,count:1};t.finalDestroy=t.destroy;var r=this;t.destroy=function(){0==--i.count&&(r._texturesToRelease[e]=i)},this._textures[e]=i,++this._numberOfTextures},TextureCache.prototype.destroyReleasedTextures=function(){var e,t,i=this._texturesToRelease;for(e in i)i.hasOwnProperty(e)&&(t=i[e],delete this._textures[e],t.texture.finalDestroy(),--this._numberOfTextures);this._texturesToRelease={}},TextureCache.prototype.isDestroyed=function(){return!1},TextureCache.prototype.destroy=function(){var e,t=this._textures;for(e in t)t.hasOwnProperty(e)&&t[e].texture.finalDestroy();return destroyObject(this)},Object.defineProperties(UniformState.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){var t;BoundingRectangle.equals(e,this._viewport)||(BoundingRectangle.clone(e,this._viewport),t=this._viewport,(e=this._viewportCartesian4).x=t.x,e.y=t.y,e.z=t.width,e.w=t.height,this._viewportDirty=!0)}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return cleanViewport(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return cleanViewport(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){Matrix4.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,Matrix4.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,Matrix4.getMatrix3(this.inverseModel,e),Matrix3.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return updateView3D(this),this._view3D}},viewRotation:{get:function(){return updateView3D(this),this._viewRotation}},viewRotation3D:{get:function(){return updateView3D(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return updateInverseView3D(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return updateInverseView3D(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return cleanInverseProjection(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return cleanModelView(this),this._modelView}},modelView3D:{get:function(){return cleanModelView3D(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return cleanModelViewRelativeToEye(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return cleanInverseModelView(this),this._inverseModelView}},inverseModelView3D:{get:function(){return cleanInverseModelView3D(this),this._inverseModelView3D}},viewProjection:{get:function(){return cleanViewProjection(this),this._viewProjection}},inverseViewProjection:{get:function(){return cleanInverseViewProjection(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return cleanModelViewProjection(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return cleanInverseModelViewProjection(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return cleanModelViewProjectionRelativeToEye(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return cleanModelViewInfiniteProjection(this),this._modelViewInfiniteProjection}},normal:{get:function(){return cleanNormal(this),this._normal}},normal3D:{get:function(){return cleanNormal3D(this),this._normal3D}},inverseNormal:{get:function(){return cleanInverseNormal(this),this._inverseNormal}},inverseNormal3D:{get:function(){return cleanInverseNormal3D(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}},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 cleanEncodedCameraPositionMC(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return cleanEncodedCameraPositionMC(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},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}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return defaultValue(this._ellipsoid,Ellipsoid.WGS84)}}});var transformMatrix=new Matrix3,sunCartographicScratch=new Cartographic;function setSunAndMoonDirections(e,t){defined(Transforms.computeIcrfToFixedMatrix(t.time,transformMatrix))||(transformMatrix=Transforms.computeTemeToPseudoFixedMatrix(t.time,transformMatrix));var i=Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Matrix3.multiplyByVector(transformMatrix,i,i),Cartesian3.normalize(i,e._sunDirectionWC),i=Matrix3.multiplyByVector(e.viewRotation3D,i,e._sunDirectionEC),Cartesian3.normalize(i,i),i=Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Matrix3.multiplyByVector(transformMatrix,i,i),Matrix3.multiplyByVector(e.viewRotation3D,i,i),Cartesian3.normalize(i,i);i=t.mapProjection,t=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,sunCartographicScratch);i.project(t,e._sunPositionColumbusView)}UniformState.prototype.updateCamera=function(e){setView(this,e.viewMatrix),setInverseView(this,e.inverseViewMatrix),setCamera(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==SceneMode$1.SCENE2D&&e.frustum instanceof OrthographicFrustum},UniformState.prototype.updateFrustum=function(e){setProjection(this,e.projectionMatrix),defined(e.infiniteProjectionMatrix)&&setInfiniteProjection(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=CesiumMath.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne,defined(e._offCenterFrustum)&&(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},UniformState.prototype.updatePass=function(e){this._pass=e};var EMPTY_ARRAY=[],defaultLight=new SunLight;function cleanViewport(e){var t;e._viewportDirty&&(t=e._viewport,Matrix4.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),Matrix4.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1)}function cleanInverseProjection(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===SceneMode$1.SCENE2D||e._mode===SceneMode$1.MORPHING||e._orthographicIn3D?Matrix4.clone(Matrix4.ZERO,e._inverseProjection):Matrix4.inverse(e._projection,e._inverseProjection))}function cleanModelView(e){e._modelViewDirty&&(e._modelViewDirty=!1,Matrix4.multiplyTransformation(e._view,e._model,e._modelView))}function cleanModelView3D(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,Matrix4.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function cleanInverseModelView(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,Matrix4.inverse(e.modelView,e._inverseModelView))}function cleanInverseModelView3D(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,Matrix4.inverse(e.modelView3D,e._inverseModelView3D))}function cleanViewProjection(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,Matrix4.multiply(e._projection,e._view,e._viewProjection))}function cleanInverseViewProjection(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,Matrix4.inverse(e.viewProjection,e._inverseViewProjection))}function cleanModelViewProjection(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,Matrix4.multiply(e._projection,e.modelView,e._modelViewProjection))}function cleanModelViewRelativeToEye(e){var t;e._modelViewRelativeToEyeDirty&&(e._modelViewRelativeToEyeDirty=!1,t=e.modelView,(e=e._modelViewRelativeToEye)[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=0,e[13]=0,e[14]=0,e[15]=t[15])}function cleanInverseModelViewProjection(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,Matrix4.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function cleanModelViewProjectionRelativeToEye(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,Matrix4.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function cleanModelViewInfiniteProjection(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,Matrix4.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function cleanNormal(e){var t;e._normalDirty&&(e._normalDirty=!1,t=e._normal,Matrix4.getMatrix3(e.inverseModelView,t),Matrix3.getRotation(t,t),Matrix3.transpose(t,t))}function cleanNormal3D(e){var t;e._normal3DDirty&&(e._normal3DDirty=!1,t=e._normal3D,Matrix4.getMatrix3(e.inverseModelView3D,t),Matrix3.getRotation(t,t),Matrix3.transpose(t,t))}function cleanInverseNormal(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,Matrix4.getMatrix3(e.inverseModelView,e._inverseNormal),Matrix3.getRotation(e._inverseNormal,e._inverseNormal))}function cleanInverseNormal3D(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,Matrix4.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Matrix3.getRotation(e._inverseNormal3D,e._inverseNormal3D))}UniformState.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;var t=e.camera;this.updateCamera(t),e.mode===SceneMode$1.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),setSunAndMoonDirections(this,e);var i=defaultValue(e.light,defaultLight);i instanceof SunLight?(this._lightDirectionWC=Cartesian3.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=Cartesian3.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=Cartesian3.normalize(Cartesian3.negate(i.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Matrix3.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));var r=i.color,r=Cartesian3.fromElements(r.red,r.green,r.blue,this._lightColorHdr),r=Cartesian3.multiplyByScalar(r,i.intensity,r),i=Cartesian3.maximumComponent(r);1<i?Cartesian3.divideByScalar(r,i,this._lightColor):Cartesian3.clone(r,this._lightColor);r=e.brdfLutGenerator,r=defined(r)?r.colorTexture:void 0;this._brdfLut=r,this._environmentMap=defaultValue(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=defaultValue(e.sphericalHarmonicCoefficients,EMPTY_ARRAY),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,defined(this._specularEnvironmentMaps)&&Cartesian2.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Transforms.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition=e.imagerySplitPosition*e.context.drawingBufferWidth;r=t.frustum.fov,t=this._viewport,t=defined(r)?t.height>t.width?2*Math.tan(.5*r)/t.height:2*Math.tan(.5*r)/t.width:1/Math.max(t.width,t.height);this._geometricToleranceOverMeter=t*e.maximumScreenSpaceError,Color.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};var cameraPositionMC=new Cartesian3;function cleanEncodedCameraPositionMC(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,Matrix4.multiplyByPoint(e.inverseModel,e._cameraPosition,cameraPositionMC),EncodedCartesian3.fromCartesian(cameraPositionMC,e._encodedCameraPositionMC))}var view2Dto3DPScratch=new Cartesian3,view2Dto3DRScratch=new Cartesian3,view2Dto3DUScratch=new Cartesian3,view2Dto3DDScratch=new Cartesian3,view2Dto3DCartographicScratch=new Cartographic,view2Dto3DCartesian3Scratch=new Cartesian3,view2Dto3DMatrix4Scratch=new Matrix4;function view2Dto3D(e,t,i,r,n,a,o,s){var l=view2Dto3DPScratch;l.x=e.y,l.y=e.z,l.z=e.x;e=view2Dto3DRScratch;e.x=i.y,e.y=i.z,e.z=i.x;i=view2Dto3DUScratch;i.x=r.y,i.y=r.z,i.z=r.x;r=view2Dto3DDScratch;r.x=t.y,r.y=t.z,r.z=t.x,a===SceneMode$1.SCENE2D&&(l.z=.5*n);l=o.unproject(l,view2Dto3DCartographicScratch);l.longitude=CesiumMath.clamp(l.longitude,-Math.PI,Math.PI),l.latitude=CesiumMath.clamp(l.latitude,-CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO);o=o.ellipsoid,l=o.cartographicToCartesian(l,view2Dto3DCartesian3Scratch),o=Transforms.eastNorthUpToFixedFrame(l,o,view2Dto3DMatrix4Scratch);return Matrix4.multiplyByPointAsVector(o,e,e),Matrix4.multiplyByPointAsVector(o,i,i),Matrix4.multiplyByPointAsVector(o,r,r),(s=!defined(s)?new Matrix4:s)[0]=e.x,s[1]=i.x,s[2]=-r.x,s[3]=0,s[4]=e.y,s[5]=i.y,s[6]=-r.y,s[7]=0,s[8]=e.z,s[9]=i.z,s[10]=-r.z,s[11]=0,s[12]=-Cartesian3.dot(e,l),s[13]=-Cartesian3.dot(i,l),s[14]=Cartesian3.dot(r,l),s[15]=1,s}function updateView3D(e){e._view3DDirty&&(e._mode===SceneMode$1.SCENE3D?Matrix4.clone(e._view,e._view3D):view2Dto3D(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),Matrix4.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function updateInverseView3D(e){e._inverseView3DDirty&&(Matrix4.inverseTransformation(e.view3D,e._inverseView3D),Matrix4.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}function errorToString(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function createErrorMessage(e,t,i,r){for(var n=errorToString(e,r)+": "+t.name+"(",a=0;a<i.length;++a)0!==a&&(n+=", "),n+=i[a];return n+=");"}function throwOnError(e,t,i){var r=e.getError();if(r!==e.NO_ERROR)throw new RuntimeError(createErrorMessage(e,t,i,r))}function makeGetterSetter(t,i,r){return{get:function(){var e=t[i];return r(t,"get: "+i,e),t[i]},set:function(e){t[i]=e,r(t,"set: "+i,e)}}}function wrapGL(i,r){if(!defined(r))return i;var e,t={};for(e in i){var n=i[e];n instanceof Function?t[e]=function(t){return function(){var e=t.apply(i,arguments);return r(i,t,arguments),e}}(n):Object.defineProperty(t,e,makeGetterSetter(i,e,r))}return t}function getExtension(e,t){for(var i=t.length,r=0;r<i;++r){var n=e.getExtension(t[r]);if(n)return n}}function Context(e,t){if("undefined"==typeof WebGLRenderingContext)throw new RuntimeError("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=e,(t=defaultValue(t=clone$1(t,!0),{})).allowTextureFilterAnisotropic=defaultValue(t.allowTextureFilterAnisotropic,!0);var i=defaultValue(t.webgl,{});i.alpha=defaultValue(i.alpha,!1),i.stencil=defaultValue(i.stencil,!0);var r=defaultValue(t.requestWebgl2,!1)&&"undefined"!=typeof WebGL2RenderingContext,n=!1,a=t.getWebGLStub;if(defined(a))s=a(e,i);else if(r&&defined(s=e.getContext("webgl2",i)||e.getContext("experimental-webgl2",i)||void 0)&&(n=!0),defined(s)||(s=e.getContext("webgl",i)||e.getContext("experimental-webgl",i)||void 0),!defined(s))throw new RuntimeError("The browser supports WebGL, but initialization failed.");this._originalGLContext=s,this._gl=s,this._webgl2=n,this._id=createGuid(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new ShaderCache(this),this._textureCache=new TextureCache;var o=s;this._stencilBits=o.getParameter(o.STENCIL_BITS),ContextLimits._maximumCombinedTextureImageUnits=o.getParameter(o.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ContextLimits._maximumCubeMapSize=o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE),ContextLimits._maximumFragmentUniformVectors=o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS),ContextLimits._maximumTextureImageUnits=o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS),ContextLimits._maximumRenderbufferSize=o.getParameter(o.MAX_RENDERBUFFER_SIZE),ContextLimits._maximumTextureSize=o.getParameter(o.MAX_TEXTURE_SIZE),ContextLimits._maximumVaryingVectors=o.getParameter(o.MAX_VARYING_VECTORS),ContextLimits._maximumVertexAttributes=o.getParameter(o.MAX_VERTEX_ATTRIBS),ContextLimits._maximumVertexTextureImageUnits=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ContextLimits._maximumVertexUniformVectors=o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS);var s=o.getParameter(o.ALIASED_LINE_WIDTH_RANGE);ContextLimits._minimumAliasedLineWidth=s[0],ContextLimits._maximumAliasedLineWidth=s[1];s=o.getParameter(o.ALIASED_POINT_SIZE_RANGE);ContextLimits._minimumAliasedPointSize=s[0],ContextLimits._maximumAliasedPointSize=s[1];s=o.getParameter(o.MAX_VIEWPORT_DIMS);ContextLimits._maximumViewportWidth=s[0],ContextLimits._maximumViewportHeight=s[1];s=o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT);ContextLimits._highpFloatSupported=0!==s.precision;s=o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_INT);ContextLimits._highpIntSupported=0!==s.rangeMax,this._antialias=o.getContextAttributes().antialias,this._standardDerivatives=!!getExtension(o,["OES_standard_derivatives"]),this._blendMinmax=!!getExtension(o,["EXT_blend_minmax"]),this._elementIndexUint=!!getExtension(o,["OES_element_index_uint"]),this._depthTexture=!!getExtension(o,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!getExtension(o,["EXT_frag_depth"]),this._debugShaders=getExtension(o,["WEBGL_debug_shaders"]),this._textureFloat=!!getExtension(o,["OES_texture_float"]),this._textureHalfFloat=!!getExtension(o,["OES_texture_half_float"]),this._textureFloatLinear=!!getExtension(o,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!getExtension(o,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!getExtension(o,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!getExtension(o,["EXT_float_blend"]),this._colorBufferHalfFloat=!!getExtension(o,["EXT_color_buffer_half_float"]),this._s3tc=!!getExtension(o,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!getExtension(o,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._etc1=!!getExtension(o,["WEBGL_compressed_texture_etc1"]);var l,c,u,d,h,p,m,f,s=t.allowTextureFilterAnisotropic?getExtension(o,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=s,ContextLimits._maximumTextureFilterAnisotropy=defined(s)?o.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,n?(d=this,h=function(){return d._gl.createVertexArray()},p=function(e){d._gl.bindVertexArray(e)},m=function(e){d._gl.deleteVertexArray(e)},f=function(e,t,i,r,n){o.drawElementsInstanced(e,t,i,r,n)},g=function(e,t,i,r){o.drawArraysInstanced(e,t,i,r)},_=function(e,t){o.vertexAttribDivisor(e,t)},y=function(e){o.drawBuffers(e)}):(defined(l=getExtension(o,["OES_vertex_array_object"]))&&(h=function(){return l.createVertexArrayOES()},p=function(e){l.bindVertexArrayOES(e)},m=function(e){l.deleteVertexArrayOES(e)}),defined(c=getExtension(o,["ANGLE_instanced_arrays"]))&&(f=function(e,t,i,r,n){c.drawElementsInstancedANGLE(e,t,i,r,n)},g=function(e,t,i,r){c.drawArraysInstancedANGLE(e,t,i,r)},_=function(e,t){c.vertexAttribDivisorANGLE(e,t)}),defined(u=getExtension(o,["WEBGL_draw_buffers"]))&&(y=function(e){u.drawBuffersWEBGL(e)})),this.glCreateVertexArray=h,this.glBindVertexArray=p,this.glDeleteVertexArray=m,this.glDrawElementsInstanced=f,this.glDrawArraysInstanced=g,this.glVertexAttribDivisor=_,this.glDrawBuffers=y,this._vertexArrayObject=!!l,this._instancedArrays=!!c,this._drawBuffers=!!u,ContextLimits._maximumDrawBuffers=this.drawBuffers?o.getParameter(WebGLConstants$1.MAX_DRAW_BUFFERS):1,ContextLimits._maximumColorAttachments=this.drawBuffers?o.getParameter(WebGLConstants$1.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new Color(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var g=new UniformState,_=new PassState(this),y=RenderState.fromCache();this._defaultPassState=_,this._defaultRenderState=y,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=g,this._currentRenderState=y,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var C=0;C<ContextLimits._maximumVertexAttributes;C++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=t,this.cache={},RenderState.apply(o,y,_)}var defaultFramebufferMarker={},scratchBackBufferArray;function applyRenderState(e,t,i,r){var n=e._currentRenderState,a=e._currentPassState;e._currentRenderState=t,e._currentPassState=i,RenderState.partialApply(e._gl,n,t,a,i,r)}function bindFramebuffer(e,t){var i;t!==e._currentFramebuffer&&(e._currentFramebuffer=t,i=scratchBackBufferArray,defined(t)?(t._bind(),i=t._getActiveColorAttachments()):(t=e._gl).bindFramebuffer(t.FRAMEBUFFER,null),e.drawBuffers&&e.glDrawBuffers(i))}Object.defineProperties(Context.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 8<=this._stencilBits}},antialias:{get:function(){return this._antialias}},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}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},etc1:{get:function(){return this._etc1}},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=wrapGL(this._originalGLContext,e?throwOnError:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new Texture({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultCubeMap:{get:function(){var e;return void 0===this._defaultCubeMap&&(e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},this._defaultCubeMap=new CubeMap({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})),this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return defaultFramebufferMarker}}}),"undefined"!=typeof WebGLRenderingContext&&(scratchBackBufferArray=[WebGLConstants$1.BACK]);var defaultClearCommand=new ClearCommand;function beginDraw(e,t,i,r,n){bindFramebuffer(e,t),applyRenderState(e,n,i,!1),r._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,r.maximumTextureUnitIndex)}function continueDraw(e,t,i,r){var n=t._primitiveType,a=t._vertexArray,o=t._offset,s=t._count,l=t.instanceCount;e._us.model=defaultValue(t._modelMatrix,Matrix4.IDENTITY),i._setUniforms(r,e._us,e.validateShaderProgram),a._bind();r=a.indexBuffer;defined(r)?(o*=r.bytesPerIndex,s=defaultValue(s,r.numberOfIndices),0===l?e._gl.drawElements(n,s,r.indexDatatype,o):e.glDrawElementsInstanced(n,s,r.indexDatatype,o,l)):(s=defaultValue(s,a.numberOfVertices),0===l?e._gl.drawArrays(n,o,s):e.glDrawArraysInstanced(n,o,s,l)),a._unBind()}Context.prototype.clear=function(e,t){e=defaultValue(e,defaultClearCommand),t=defaultValue(t,this._defaultPassState);var i=this._gl,r=0,n=e.color,a=e.depth,o=e.stencil;defined(n)&&(Color.equals(this._clearColor,n)||(Color.clone(n,this._clearColor),i.clearColor(n.red,n.green,n.blue,n.alpha)),r|=i.COLOR_BUFFER_BIT),defined(a)&&(a!==this._clearDepth&&(this._clearDepth=a,i.clearDepth(a)),r|=i.DEPTH_BUFFER_BIT),defined(o)&&(o!==this._clearStencil&&(this._clearStencil=o,i.clearStencil(o)),r|=i.STENCIL_BUFFER_BIT),applyRenderState(this,defaultValue(e.renderState,this._defaultRenderState),t,!0),bindFramebuffer(this,defaultValue(e.framebuffer,t.framebuffer)),i.clear(r)},Context.prototype.draw=function(e,t,i,r){t=defaultValue(t,this._defaultPassState);var n=defaultValue(e._framebuffer,t.framebuffer),a=defaultValue(e._renderState,this._defaultRenderState);i=defaultValue(i,e._shaderProgram),r=defaultValue(r,e._uniformMap),beginDraw(this,n,t,i,a),continueDraw(this,e,i,r)},Context.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null),this.drawBuffers&&this.glDrawBuffers(scratchBackBufferArray);for(var t=this._maxFrameTextureUnitIndex,i=this._maxFrameTextureUnitIndex=0;i<t;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},Context.prototype.readPixels=function(e){var t=this._gl;e=defaultValue(e,defaultValue.EMPTY_OBJECT);var i=Math.max(defaultValue(e.x,0),0),r=Math.max(defaultValue(e.y,0),0),n=defaultValue(e.width,t.drawingBufferWidth),a=defaultValue(e.height,t.drawingBufferHeight),o=e.framebuffer,s=PixelDatatype$1.UNSIGNED_BYTE;defined(o)&&0<o.numberOfColorAttachments&&(s=o.getColorTexture(0).pixelDatatype);e=PixelFormat$1.createTypedArray(PixelFormat$1.RGBA,s,n,a);return bindFramebuffer(this,o),t.readPixels(i,r,n,a,PixelFormat$1.RGBA,PixelDatatype$1.toWebGLConstant(s,this),e),e};var viewportQuadAttributeLocations={position:0,textureCoordinates:1};function PickId(e,t,i){this._pickObjects=e,this.key=t,this.color=i}function loadCubeMap(t,e){var i={flipY:!0,preferImageBitmap:!0},i=[Resource.createIfNeeded(e.positiveX).fetchImage(i),Resource.createIfNeeded(e.negativeX).fetchImage(i),Resource.createIfNeeded(e.positiveY).fetchImage(i),Resource.createIfNeeded(e.negativeY).fetchImage(i),Resource.createIfNeeded(e.positiveZ).fetchImage(i),Resource.createIfNeeded(e.negativeZ).fetchImage(i)];return when.all(i,function(e){return new CubeMap({context:t,source:{positiveX:e[0],negativeX:e[1],positiveY:e[2],negativeY:e[3],positiveZ:e[4],negativeZ:e[5]}})})}Context.prototype.getViewportQuadVertexArray=function(){var e,t=this.cache.viewportQuad_vertexArray;return defined(t)||(e=new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:PrimitiveType$1.TRIANGLES}),t=VertexArray.fromGeometry({context:this,geometry:e,attributeLocations:viewportQuadAttributeLocations,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=t),t},Context.prototype.createViewportQuadCommand=function(e,t){return t=defaultValue(t,defaultValue.EMPTY_OBJECT),new DrawCommand({vertexArray:this.getViewportQuadVertexArray(),primitiveType:PrimitiveType$1.TRIANGLES,renderState:t.renderState,shaderProgram:ShaderProgram.fromCache({context:this,vertexShaderSource:ViewportQuadVS,fragmentShaderSource:e,attributeLocations:viewportQuadAttributeLocations}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})},Context.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},Object.defineProperties(PickId.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),PickId.prototype.destroy=function(){delete this._pickObjects[this.key]},Context.prototype.createPickId=function(e){++this._nextPickColor[0];var t=this._nextPickColor[0];if(0===t)throw new RuntimeError("Out of unique Pick IDs.");return this._pickObjects[t]=e,new PickId(this._pickObjects,t,Color.fromRgba(t))},Context.prototype.isDestroyed=function(){return!1},Context.prototype.destroy=function(){var e,t,i=this.cache;for(e in i)!i.hasOwnProperty(e)||defined((t=i[e]).destroy)&&t.destroy();return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),destroyObject(this)};var RenderbufferFormat={RGBA4:WebGLConstants$1.RGBA4,RGB5_A1:WebGLConstants$1.RGB5_A1,RGB565:WebGLConstants$1.RGB565,DEPTH_COMPONENT16:WebGLConstants$1.DEPTH_COMPONENT16,STENCIL_INDEX8:WebGLConstants$1.STENCIL_INDEX8,DEPTH_STENCIL:WebGLConstants$1.DEPTH_STENCIL,validate:function(e){return e===RenderbufferFormat.RGBA4||e===RenderbufferFormat.RGB5_A1||e===RenderbufferFormat.RGB565||e===RenderbufferFormat.DEPTH_COMPONENT16||e===RenderbufferFormat.STENCIL_INDEX8||e===RenderbufferFormat.DEPTH_STENCIL}},RenderbufferFormat$1=Object.freeze(RenderbufferFormat);function Renderbuffer(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context._gl,i=defaultValue(e.format,RenderbufferFormat$1.RGBA4),r=defined(e.width)?e.width:t.drawingBufferWidth,e=defined(e.height)?e.height:t.drawingBufferHeight;this._gl=t,this._format=i,this._width=r,this._height=e,this._renderbuffer=this._gl.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this._renderbuffer),t.renderbufferStorage(t.RENDERBUFFER,i,r,e),t.bindRenderbuffer(t.RENDERBUFFER,null)}function DiscardMissingTileImagePolicy(l){l=defaultValue(l,defaultValue.EMPTY_OBJECT),this._pixelsToCheck=l.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var e=Resource.createIfNeeded(l.missingImageUrl),c=this;e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(function(e){defined(e.blob)&&(c._missingImageByteLength=e.blob.size);var t=getImagePixels(e);if(l.disableCheckIfAllPixelsAreTransparent){for(var i=!0,r=e.width,n=l.pixelsToCheck,a=0,o=n.length;i&&a<o;++a){var s=n[a];0<t[3+(4*s.x+s.y*r)]&&(i=!1)}i&&(t=void 0)}c._missingImagePixels=t,c._isReady=!0}).otherwise(function(){c._missingImagePixels=void 0,c._isReady=!0})}function ImageryLayerFeatureInfo(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}function ImageryProvider(){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,DeveloperError.throwInstantiationError()}Object.defineProperties(Renderbuffer.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),Renderbuffer.prototype._getRenderbuffer=function(){return this._renderbuffer},Renderbuffer.prototype.isDestroyed=function(){return!1},Renderbuffer.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),destroyObject(this)},DiscardMissingTileImagePolicy.prototype.isReady=function(){return this._isReady},DiscardMissingTileImagePolicy.prototype.shouldDiscardImage=function(e){var t=this._pixelsToCheck,i=this._missingImagePixels;if(!defined(i))return!1;if(defined(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var r=getImagePixels(e),n=e.width,a=0,o=t.length;a<o;++a)for(var s=t[a],l=4*s.x+s.y*n,c=0;c<4;++c){var u=l+c;if(r[u]!==i[u])return!1}return!0},ImageryLayerFeatureInfo.prototype.configureNameFromProperties=function(e){var t,i,r,n=10;for(i in e)e.hasOwnProperty(i)&&e[i]&&(r=i.toLowerCase(),1<n&&"name"===r?(n=1,t=i):2<n&&"title"===r?(n=2,t=i):3<n&&/name/i.test(i)?(n=3,t=i):4<n&&/title/i.test(i)&&(n=4,t=i));defined(t)&&(this.name=e[t])},ImageryLayerFeatureInfo.prototype.configureDescriptionFromProperties=function(e){this.description=function e(t){var i,r,n='<table class="cesium-infoBox-defaultTable">';for(i in t)!t.hasOwnProperty(i)||defined(r=t[i])&&(n+="object"==typeof r?"<tr><td>"+i+"</td><td>"+e(r)+"</td></tr>":"<tr><td>"+i+"</td><td>"+r+"</td></tr>");return n+="</table>"}(e)},Object.defineProperties(ImageryProvider.prototype,{ready:{get:DeveloperError.throwInstantiationError},readyPromise:{get:DeveloperError.throwInstantiationError},rectangle:{get:DeveloperError.throwInstantiationError},tileWidth:{get:DeveloperError.throwInstantiationError},tileHeight:{get:DeveloperError.throwInstantiationError},maximumLevel:{get:DeveloperError.throwInstantiationError},minimumLevel:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},tileDiscardPolicy:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError},credit:{get:DeveloperError.throwInstantiationError},proxy:{get:DeveloperError.throwInstantiationError},hasAlphaChannel:{get:DeveloperError.throwInstantiationError}}),ImageryProvider.prototype.getTileCredits=function(e,t,i){DeveloperError.throwInstantiationError()},ImageryProvider.prototype.requestImage=function(e,t,i,r){DeveloperError.throwInstantiationError()},ImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){DeveloperError.throwInstantiationError()};var ktxRegex=/\.ktx$/i,crnRegex=/\.crn$/i;function ArcGisMapServerImageryProvider(n){n=defaultValue(n,defaultValue.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;var e=Resource.createIfNeeded(n.url);e.appendForwardSlash(),defined(n.token)&&e.setQueryParameters({token:n.token}),this._resource=e,this._tileDiscardPolicy=n.tileDiscardPolicy,this._tileWidth=defaultValue(n.tileWidth,256),this._tileHeight=defaultValue(n.tileHeight,256),this._maximumLevel=n.maximumLevel,this._tilingScheme=defaultValue(n.tilingScheme,new GeographicTilingScheme({ellipsoid:n.ellipsoid})),this._useTiles=defaultValue(n.usePreCachedTilesIfAvailable,!0),this._rectangle=defaultValue(n.rectangle,this._tilingScheme.rectangle),this._layers=n.layers;e=n.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e,this.enablePickFeatures=defaultValue(n.enablePickFeatures,!0),this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var a,o=this;function t(e){var t=e.tileInfo;if(defined(t)){if(o._tileWidth=t.rows,o._tileHeight=t.cols,102100===t.spatialReference.wkid||102113===t.spatialReference.wkid)o._tilingScheme=new WebMercatorTilingScheme({ellipsoid:n.ellipsoid});else{if(4326!==e.tileInfo.spatialReference.wkid){var i="Tile spatial reference WKID "+e.tileInfo.spatialReference.wkid+" is not supported.";return void(a=TileProviderError.handleError(a,o,o._errorEvent,i,void 0,void 0,void 0,s))}o._tilingScheme=new GeographicTilingScheme({ellipsoid:n.ellipsoid})}if(o._maximumLevel=e.tileInfo.lods.length-1,defined(e.fullExtent)){if(defined(e.fullExtent.spatialReference)&&defined(e.fullExtent.spatialReference.wkid))if(102100===e.fullExtent.spatialReference.wkid||102113===e.fullExtent.spatialReference.wkid){var t=new WebMercatorProjection,r=e.fullExtent,i=t.unproject(new Cartesian3(Math.max(r.xmin,-o._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-o._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),r=t.unproject(new Cartesian3(Math.min(r.xmax,o._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,o._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));o._rectangle=new Rectangle(i.longitude,i.latitude,r.longitude,r.latitude)}else{if(4326!==e.fullExtent.spatialReference.wkid){r="fullExtent.spatialReference WKID "+e.fullExtent.spatialReference.wkid+" is not supported.";return void(a=TileProviderError.handleError(a,o,o._errorEvent,r,void 0,void 0,void 0,s))}o._rectangle=Rectangle.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax)}}else o._rectangle=o._tilingScheme.rectangle;defined(o._tileDiscardPolicy)||(o._tileDiscardPolicy=new DiscardMissingTileImagePolicy({missingImageUrl:buildImageResource$3(o,0,0,o._maximumLevel).url,pixelsToCheck:[new Cartesian2(0,0),new Cartesian2(200,20),new Cartesian2(20,200),new Cartesian2(80,110),new Cartesian2(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),o._useTiles=!0}else o._useTiles=!1;defined(e.copyrightText)&&0<e.copyrightText.length&&(o._credit=new Credit(e.copyrightText)),o._ready=!0,o._readyPromise.resolve(!0),TileProviderError.handleSuccess(a)}function i(e){var t="An error occurred while accessing "+o._resource.url+".";a=TileProviderError.handleError(a,o,o._errorEvent,t,void 0,void 0,void 0,s),o._readyPromise.reject(new RuntimeError(t))}function s(){when(o._resource.getDerivedResource({queryParameters:{f:"json"}}).fetchJsonp(),t,i)}this._useTiles?s():(this._ready=!0,this._readyPromise.resolve(!0))}function buildImageResource$3(e,t,i,r,n){var a=e._useTiles?e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n}):(a={bbox:(a=e._tilingScheme.tileXYToNativeRectangle(t,i,r)).west+","+a.south+","+a.east+","+a.north,size:e._tileWidth+","+e._tileHeight,format:"png32",transparent:!0,f:"image"},e._tilingScheme.projection instanceof GeographicProjection?(a.bboxSR=4326,a.imageSR=4326):(a.bboxSR=3857,a.imageSR=3857),e.layers&&(a.layers="show:"+e.layers),e._resource.getDerivedResource({url:"export",request:n,queryParameters:a}));return a}function AutoExposure(){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=void 0,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new Cartesian2,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}function destroyFramebuffers$4(e){var t=e._framebuffers;if(defined(t)){for(var i=t.length,r=0;r<i;++r)t[r].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}}function createFramebuffers$3(e,t){destroyFramebuffers$4(e);for(var i=e._width,r=e._height,n=PixelFormat$1.RGBA,a=t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT,o=Math.ceil(Math.log(Math.max(i,r))/Math.log(3)),s=new Array(o),l=0;l<o;++l)i=Math.max(Math.ceil(i/3),1),r=Math.max(Math.ceil(r/3),1),s[l]=new Framebuffer({context:t,colorTextures:[new Texture({context:t,width:i,height:r,pixelFormat:n,pixelDatatype:a,sampler:Sampler.NEAREST})]});var c=s[o-1].getColorTexture(0);e._previousLuminance=new Framebuffer({context:t,colorTextures:[new Texture({context:t,width:c.width,height:c.height,pixelFormat:n,pixelDatatype:a,sampler:Sampler.NEAREST})]}),e._framebuffers=s}function destroyCommands(e){var t=e._commands;if(defined(t)){for(var i=t.length,r=0;r<i;++r)t[r].shaderProgram.destroy();e._commands=void 0}}function createUniformMap$1(e,t){var i;return(t=0===t?{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}}:(i=e._framebuffers[t-1].getColorTexture(0),{colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}})).minMaxLuminance=function(){return e._minMaxLuminance},t.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},t}function getShaderSource(e,t){var i="uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates; \nfloat sampleTexture(vec2 offset) { \n";return i+=0===e?" vec4 color = texture2D(colorTexture, v_textureCoordinates + offset); \n return czm_luminance(color.rgb); \n":" return texture2D(colorTexture, v_textureCoordinates + offset).r; \n",i+="}\n\n",i+="uniform vec2 colorTextureDimensions; \nuniform vec2 minMaxLuminance; \nuniform sampler2D previousLuminance; \nvoid main() { \n float color = 0.0; \n float xStep = 1.0 / colorTextureDimensions.x; \n float yStep = 1.0 / colorTextureDimensions.y; \n int count = 0; \n for (int i = 0; i < 3; ++i) { \n for (int j = 0; j < 3; ++j) { \n vec2 offset; \n offset.x = -xStep + float(i) * xStep; \n offset.y = -yStep + float(j) * yStep; \n if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { \n continue; \n } \n color += sampleTexture(offset); \n ++count; \n } \n } \n if (count > 0) { \n color /= float(count); \n } \n",e===t-1&&(i+=" float previous = texture2D(previousLuminance, vec2(0.5)).r; \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n color = previous + (color - previous) / (60.0 * 1.5); \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n"),i+=" gl_FragColor = vec4(color); \n} \n"}function createCommands(e,t){destroyCommands(e);for(var i=e._framebuffers,r=i.length,n=new Array(r),a=0;a<r;++a)n[a]=t.createViewportQuadCommand(getShaderSource(a,r),{framebuffer:i[a],uniformMap:createUniformMap$1(e,a)});e._commands=n}ImageryProvider.loadImage=function(e,t){t=Resource.createIfNeeded(t);return ktxRegex.test(t.url)?loadKTX(t):crnRegex.test(t.url)?loadCRN(t):defined(e)&&defined(e.tileDiscardPolicy)?t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):t.fetchImage({preferImageBitmap:!0,flipY:!0})},Object.defineProperties(ArcGisMapServerImageryProvider.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),ArcGisMapServerImageryProvider.prototype.getTileCredits=function(e,t,i){},ArcGisMapServerImageryProvider.prototype.requestImage=function(e,t,i,r){return ImageryProvider.loadImage(this,buildImageResource$3(this,e,t,i,r))},ArcGisMapServerImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){if(this.enablePickFeatures){var a,o,i=this._tilingScheme.tileXYToNativeRectangle(e,t,i);n=this._tilingScheme.projection instanceof GeographicProjection?(a=CesiumMath.toDegrees(r),o=CesiumMath.toDegrees(n),"4326"):(a=(s=this._tilingScheme.projection.project(new Cartographic(r,n,0))).x,o=s.y,"3857");var s="visible";defined(this._layers)&&(s+=":"+this._layers);s={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:a+","+o,mapExtent:i.west+","+i.south+","+i.east+","+i.north,imageDisplay:this._tileWidth+","+this._tileHeight+",96",sr:n,layers:s};return this._resource.getDerivedResource({url:"identify",queryParameters:s}).fetchJson().then(function(e){var t=[],i=e.results;if(!defined(i))return t;for(var r=0;r<i.length;++r){var n,a=i[r],o=new ImageryLayerFeatureInfo;o.data=a,o.name=a.value,o.properties=a.attributes,o.configureDescriptionFromProperties(a.attributes),"esriGeometryPoint"===a.geometryType&&a.geometry&&(4326===(n=a.geometry.spatialReference&&a.geometry.spatialReference.wkid?a.geometry.spatialReference.wkid:4326)||4283===n?o.position=Cartographic.fromDegrees(a.geometry.x,a.geometry.y,a.geometry.z):102100!==n&&900913!==n&&3857!==n||(n=new WebMercatorProjection,o.position=n.unproject(new Cartesian3(a.geometry.x,a.geometry.y,a.geometry.z)))),t.push(o)}return t})}},Object.defineProperties(AutoExposure.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){var e=this._framebuffers;if(defined(e))return e[e.length-1].getColorTexture(0)}}}),AutoExposure.prototype.clear=function(e){var t=this._framebuffers;if(defined(t)){var i=this._clearCommand;defined(i)||(i=this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),framebuffer:void 0}));for(var r=t.length,n=0;n<r;++n)i.framebuffer=t[n],i.execute(e)}},AutoExposure.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;t===this._width&&i===this._height||(this._width=t,this._height=i,createFramebuffers$3(this,e),createCommands(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;i=this._framebuffers,e=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance,this._previousLuminance=e},AutoExposure.prototype.execute=function(e,t){this._colorTexture=t;var i=this._commands;if(defined(i))for(var r=i.length,n=0;n<r;++n)i[n].execute(e)},AutoExposure.prototype.isDestroyed=function(){return!1},AutoExposure.prototype.destroy=function(){return destroyFramebuffers$4(this),destroyCommands(this),destroyObject(this)};var BingMapsStyle={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"},BingMapsStyle$1=Object.freeze(BingMapsStyle),emptyImage;function DiscardEmptyTileImagePolicy(e){}function BingMapsImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).key;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._key=t,this._resource=Resource.createIfNeeded(e.url),this._resource.appendForwardSlash(),this._tileProtocol=e.tileProtocol,this._mapStyle=defaultValue(e.mapStyle,BingMapsStyle$1.AERIAL),this._culture=defaultValue(e.culture,""),this._tileDiscardPolicy=e.tileDiscardPolicy,defined(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new DiscardEmptyTileImagePolicy),this._proxy=e.proxy,this._credit=new Credit('<a href="http://www.bing.com"><img src="'+BingMapsImageryProvider.logoUrl+'" title="Bing Imagery"/></a>'),this._tilingScheme=new WebMercatorTilingScheme({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._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();e=this._tileProtocol;defined(e)?0<e.length&&":"===e[e.length-1]&&(e=e.substr(0,e.length-1)):e="http:"===document.location.protocol?"http":"https";var u,i=this._resource.getDerivedResource({url:"REST/v1/Imagery/Metadata/"+this._mapStyle,queryParameters:{incl:"ImageryProviders",key:this._key,uriScheme:e}}),d=this;function r(e){if(1===e.resourceSets.length){e=e.resourceSets[0].resources[0];d._tileWidth=e.imageWidth,d._tileHeight=e.imageHeight,d._maximumLevel=e.zoomMax-1,d._imageUrlSubdomains=e.imageUrlSubdomains,d._imageUrlTemplate=e.imageUrl;for(var t=d._attributionList=e.imageryProviders,i=0,r=(t=t||(d._attributionList=[])).length;i<r;++i){var n=t[i];if(n.credit instanceof Credit)break;n.credit=new Credit(n.attribution);for(var a=n.coverageAreas,o=0,s=n.coverageAreas.length;o<s;++o){var l=a[o],c=l.bbox;l.bbox=new Rectangle(CesiumMath.toRadians(c[1]),CesiumMath.toRadians(c[0]),CesiumMath.toRadians(c[3]),CesiumMath.toRadians(c[2]))}}d._ready=!0,d._readyPromise.resolve(!0),TileProviderError.handleSuccess(u)}else h()}function h(e){var t="An error occurred while accessing "+i.url+".";u=TileProviderError.handleError(u,d,d._errorEvent,t,void 0,void 0,void 0,a),d._readyPromise.reject(new RuntimeError(t))}var n=i.url;function a(){var e=i.fetchJsonp("jsonp");(BingMapsImageryProvider._metadataCache[n]=e).then(r).otherwise(h)}e=BingMapsImageryProvider._metadataCache[n];defined(e)?e.then(r).otherwise(h):a()}DiscardEmptyTileImagePolicy.prototype.isReady=function(){return!0},DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage=function(e){return DiscardEmptyTileImagePolicy.EMPTY_IMAGE===e},Object.defineProperties(DiscardEmptyTileImagePolicy,{EMPTY_IMAGE:{get:function(){return defined(emptyImage)||((emptyImage=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),emptyImage}}}),Object.defineProperties(BingMapsImageryProvider.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}},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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var rectangleScratch$1=new Rectangle;function buildImageResource$2(e,t,i,r,n){var a=e._imageUrlTemplate,o=e._imageUrlSubdomains,s=(t+i+r)%o.length;return e._resource.getDerivedResource({url:a,request:n,templateValues:{quadkey:BingMapsImageryProvider.tileXYToQuadKey(t,i,r),subdomain:o[s],culture:e._culture},queryParameters:{n:"z"}})}BingMapsImageryProvider.prototype.getTileCredits=function(e,t,i){t=this._tilingScheme.tileXYToRectangle(e,t,i,rectangleScratch$1);return getRectangleAttribution(this._attributionList,i,t)},BingMapsImageryProvider.prototype.requestImage=function(e,t,i,r){r=ImageryProvider.loadImage(this,buildImageResource$2(this,e,t,i,r));if(defined(r))return r.otherwise(function(e){return defined(e.blob)&&0===e.blob.size?DiscardEmptyTileImagePolicy.EMPTY_IMAGE:when.reject(e)})},BingMapsImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},BingMapsImageryProvider.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;0<=n;--n){var a=1<<n,o=0;0!=(e&a)&&(o|=1),0!=(t&a)&&(o|=2),r+=o}return r},BingMapsImageryProvider.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;0<=n;--n){var a=1<<n,o=+e[r-n];0!=(1&o)&&(t|=a),0!=(2&o)&&(i|=a)}return{x:t,y:i,level:r}},BingMapsImageryProvider._logoUrl=void 0,Object.defineProperties(BingMapsImageryProvider,{logoUrl:{get:function(){return defined(BingMapsImageryProvider._logoUrl)||(BingMapsImageryProvider._logoUrl=buildModuleUrl("Assets/Images/bing_maps_credit.png")),BingMapsImageryProvider._logoUrl},set:function(e){BingMapsImageryProvider._logoUrl=e}}});var intersectionScratch=new Rectangle;function getRectangleAttribution(e,t,i){++t;for(var r=[],n=0,a=e.length;n<a;++n){for(var o=e[n],s=o.coverageAreas,l=!1,c=0,u=o.coverageAreas.length;!l&&c<u;++c){var d=s[c];t>=d.zoomMin&&t<=d.zoomMax&&defined(Rectangle.intersection(i,d.bbox,intersectionScratch))&&(l=!0)}l&&r.push(o.credit)}return r}BingMapsImageryProvider._metadataCache={};var defaultDimensions=new Cartesian3(1,1,1);function BoxEmitter(e){e=defaultValue(e,defaultDimensions),this._dimensions=Cartesian3.clone(e)}Object.defineProperties(BoxEmitter.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){Cartesian3.clone(e,this._dimensions)}}});var scratchHalfDim=new Cartesian3;BoxEmitter.prototype.emit=function(e){var t=this._dimensions,i=Cartesian3.multiplyByScalar(t,.5,scratchHalfDim),r=CesiumMath.randomBetween(-i.x,i.x),t=CesiumMath.randomBetween(-i.y,i.y),i=CesiumMath.randomBetween(-i.z,i.z);e.position=Cartesian3.fromElements(r,t,i,e.position),e.velocity=Cartesian3.normalize(e.position,e.velocity)};var BrdfLutGeneratorFS="varying vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\nfloat vdcRadicalInverse(int i)\n{\nfloat r;\nfloat base = 2.0;\nfloat value = 0.0;\nfloat invBase = 1.0 / base;\nfloat invBi = invBase;\nfor (int x = 0; x < 100; x++)\n{\nif (i <= 0)\n{\nbreak;\n}\nr = mod(float(i), base);\nvalue += r * invBi;\ninvBi *= invBase;\ni = int(float(i) * invBase);\n}\nreturn value;\n}\nvec2 hammersley2D(int i, int N)\n{\nreturn vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\nfloat a = roughness * roughness;\nfloat phi = 2.0 * M_PI * xi.x;\nfloat cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\nfloat sinTheta = sqrt(1.0 - cosTheta * cosTheta);\nvec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\nvec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\nvec3 tangentX = normalize(cross(upVector, N));\nvec3 tangentY = cross(N, tangentX);\nreturn tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G1_Smith(float NdotV, float k)\n{\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\nfloat k = roughness * roughness / 2.0;\nreturn G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\nvec2 integrateBrdf(float roughness, float NdotV)\n{\nvec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\nfloat A = 0.0;\nfloat B = 0.0;\nconst int NumSamples = 1024;\nfor (int i = 0; i < NumSamples; i++)\n{\nvec2 xi = hammersley2D(i, NumSamples);\nvec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\nvec3 L = 2.0 * dot(V, H) * H - V;\nfloat NdotL = clamp(L.z, 0.0, 1.0);\nfloat NdotH = clamp(H.z, 0.0, 1.0);\nfloat VdotH = clamp(dot(V, H), 0.0, 1.0);\nif (NdotL > 0.0)\n{\nfloat G = G_Smith(roughness, NdotV, NdotL);\nfloat G_Vis = G * VdotH / (NdotH * NdotV);\nfloat Fc = pow(1.0 - VdotH, 5.0);\nA += (1.0 - Fc) * G_Vis;\nB += Fc * G_Vis;\n}\n}\nreturn vec2(A, B) / float(NumSamples);\n}\nvoid main()\n{\ngl_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n";function BrdfLutGenerator(){this._framebuffer=void 0,this._colorTexture=void 0,this._drawCommand=void 0}function createCommand$1(e,t){var i=e._framebuffer,i=t.createViewportQuadCommand(BrdfLutGeneratorFS,{framebuffer:i,renderState:RenderState.fromCache({viewport:new BoundingRectangle(0,0,256,256)})});e._drawCommand=i}function createFramebuffer$1(e,t){var i=new Texture({context:t,width:256,height:256,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),i=new Framebuffer({context:t,colorTextures:[e._colorTexture=i],destroyAttachments:!1});e._framebuffer=i}Object.defineProperties(BrdfLutGenerator.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),BrdfLutGenerator.prototype.update=function(e){defined(this._colorTexture)||(createFramebuffer$1(this,e=e.context),createCommand$1(this,e),this._drawCommand.execute(e),this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy())},BrdfLutGenerator.prototype.isDestroyed=function(){return!1},BrdfLutGenerator.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),destroyObject(this)};var CameraFlightPath={};function getAltitude(e,t,i){if(e instanceof PerspectiveFrustum){var r=Math.tan(.5*e.fovy),n=e.near,a=e.near*r,r=e.aspectRatio*a;return Math.max(t*n/r,i*n/a)}return e instanceof PerspectiveOffCenterFrustum?(n=e.near,a=e.top,r=e.right,Math.max(t*n/r,i*n/a)):Math.max(t,i)}var scratchCart=new Cartesian3,scratchCart2=new Cartesian3;function createPitchFunction(i,r,n,e){if(defined(e)&&n(.5)>e){var a=n(0),o=n(1),e=n(.5),s=e-a,l=e-o;return function(e){var t=n(e);return e<=.5?CesiumMath.lerp(i,-CesiumMath.PI_OVER_TWO,(t-a)/s):CesiumMath.lerp(-CesiumMath.PI_OVER_TWO,r,1-(t-o)/l)}}return function(e){return CesiumMath.lerp(i,r,e)}}function createHeightFunction(e,t,i,r,n){var a,o,s=n,l=Math.max(i,r);if(defined(s)||(a=e.position,o=e.up,n=e.right,e=e.frustum,t=Cartesian3.subtract(a,t,scratchCart),o=Cartesian3.magnitude(Cartesian3.multiplyByScalar(o,Cartesian3.dot(t,o),scratchCart2)),n=Cartesian3.magnitude(Cartesian3.multiplyByScalar(n,Cartesian3.dot(t,n),scratchCart2)),s=Math.min(.2*getAltitude(e,o,n),1e9)),l<s){var c=-Math.pow(1e6*(s-i),1/8),u=Math.pow(1e6*(s-r),1/8);return function(e){return-Math.pow(e*(u-c)+c,8)/1e6+s}}return function(e){return CesiumMath.lerp(i,r,e)}}function adjustAngleForLERP(e,t){return t>(e=CesiumMath.equalsEpsilon(e,CesiumMath.TWO_PI,CesiumMath.EPSILON11)?0:e)+Math.PI?e+=CesiumMath.TWO_PI:t<e-Math.PI&&(e-=CesiumMath.TWO_PI),e}var scratchStart=new Cartesian3;function createUpdateCV(e,t,i,r,n,a,o){var s=e.camera,l=Cartesian3.clone(s.position,scratchStart),c=s.pitch,u=adjustAngleForLERP(s.heading,r),d=adjustAngleForLERP(s.roll,a),h=createHeightFunction(s,i,l.z,i.z,o);return function(e){e=e.time/t,s.setView({orientation:{heading:CesiumMath.lerp(u,r,e),pitch:CesiumMath.lerp(c,n,e),roll:CesiumMath.lerp(d,a,e)}}),Cartesian2.lerp(l,i,e,s.position),s.position.z=h(e)}}function useLongestFlight(e,t){e.longitude<t.longitude?e.longitude+=CesiumMath.TWO_PI:t.longitude+=CesiumMath.TWO_PI}function useShortestFlight(e,t){var i=e.longitude-t.longitude;i<-CesiumMath.PI?e.longitude+=CesiumMath.TWO_PI:i>CesiumMath.PI&&(t.longitude+=CesiumMath.TWO_PI)}var scratchStartCart=new Cartographic,scratchEndCart=new Cartographic;function createUpdate3D(e,i,t,r,n,a,o,s,l,c){var u=e.camera,d=e.mapProjection.ellipsoid,h=Cartographic.clone(u.positionCartographic,scratchStartCart),p=u.pitch,m=adjustAngleForLERP(u.heading,r),f=adjustAngleForLERP(u.roll,a),g=d.cartesianToCartographic(t,scratchEndCart);h.longitude=CesiumMath.zeroToTwoPi(h.longitude),g.longitude=CesiumMath.zeroToTwoPi(g.longitude);var _=!1;defined(s)&&(e=CesiumMath.zeroToTwoPi(s),d=Math.min(h.longitude,g.longitude),s=Math.max(h.longitude,g.longitude),d=d<=e&&e<=s,defined(l)?(e=Math.abs(h.longitude-g.longitude),s=CesiumMath.TWO_PI-e,(d?e:s)<(d?s:e)*l&&!d&&(_=!0)):d||(_=!0)),(_?useLongestFlight:useShortestFlight)(h,g);var y,C,v,S,T=createHeightFunction(u,t,h.height,g.height,o),x=createPitchFunction(p,n,T,c);return y=h.longitude,C=g.longitude,v=h.latitude,S=g.latitude,function(e){var t=e.time/i,e=Cartesian3.fromRadians(CesiumMath.lerp(y,C,t),CesiumMath.lerp(v,S,t),T(t));u.setView({destination:e,orientation:{heading:CesiumMath.lerp(m,r,t),pitch:x(t),roll:CesiumMath.lerp(f,a,t)}})}}function createUpdate2D(e,r,n,a,t,i,o){var s=e.camera,l=Cartesian3.clone(s.position,scratchStart),c=adjustAngleForLERP(s.heading,a),e=s.frustum.right-s.frustum.left,u=createHeightFunction(s,n,e,n.z,o);return function(e){var t=e.time/r;s.setView({orientation:{heading:CesiumMath.lerp(c,a,t)}}),Cartesian2.lerp(l,n,t,s.position);var i=u(t),t=(e=s.frustum).top/e.right,i=.5*(i-(e.right-e.left));e.right+=i,e.left-=i,e.top=t*e.right,e.bottom=-e.top}}var scratchCartographic$4=new Cartographic,scratchDestination=new Cartesian3;function emptyFlight(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function wrapCallback(e,t){return function(){"function"==typeof t&&t(),e.enableInputs=!0}}CameraFlightPath.createTween=function(e,t){var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).destination,r=e.mode;if(r===SceneMode$1.MORPHING)return emptyFlight();var n=defaultValue(t.convert,!0),a=e.mapProjection,o=a.ellipsoid,s=t.maximumHeight,l=t.flyOverLongitude,c=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,d=t.easingFunction;n&&r!==SceneMode$1.SCENE3D&&(o.cartesianToCartographic(i,scratchCartographic$4),i=a.project(scratchCartographic$4,scratchDestination));var h=e.camera,p=t.endTransform;defined(p)&&h._setTransform(p);n=t.duration;defined(n)||(n=Math.ceil(Cartesian3.distance(h.position,i)/1e6)+2,n=Math.min(n,3));var m=defaultValue(t.heading,0),f=defaultValue(t.pitch,-CesiumMath.PI_OVER_TWO),g=defaultValue(t.roll,0),a=e.screenSpaceCameraController;a.enableInputs=!1;var _=wrapCallback(a,t.complete),p=wrapCallback(a,t.cancel),a=h.frustum,t=e.mode===SceneMode$1.SCENE2D;if(t=(t=(t=(t=t&&Cartesian2.equalsEpsilon(h.position,i,CesiumMath.EPSILON6))&&CesiumMath.equalsEpsilon(Math.max(a.right-a.left,a.top-a.bottom),i.z,CesiumMath.EPSILON6))||e.mode!==SceneMode$1.SCENE2D&&Cartesian3.equalsEpsilon(i,h.position,CesiumMath.EPSILON10))&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(m),CesiumMath.negativePiToPi(h.heading),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(f),CesiumMath.negativePiToPi(h.pitch),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(g),CesiumMath.negativePiToPi(h.roll),CesiumMath.EPSILON10))return emptyFlight(_,p);var y=new Array(4);if(y[SceneMode$1.SCENE2D]=createUpdate2D,y[SceneMode$1.SCENE3D]=createUpdate3D,y[SceneMode$1.COLUMBUS_VIEW]=createUpdateCV,n<=0)return emptyFlight(function(){y[r](e,1,i,m,f,g,s,l,c,u)({time:1}),"function"==typeof _&&_()},p);t=y[r](e,n,i,m,f,g,s,l,c,u);return defined(d)||(h=h.positionCartographic.height,d=(r===SceneMode$1.SCENE3D?o.cartesianToCartographic(i).height:i.z)<h&&11500<h?EasingFunction$1.CUBIC_OUT:EasingFunction$1.QUINTIC_IN_OUT),{duration:n,easingFunction:d,startObject:{time:0},stopObject:{time:n},update:t,complete:_,cancel:p}};var MapMode2D={ROTATE:0,INFINITE_SCROLL:1},MapMode2D$1=Object.freeze(MapMode2D);function Camera(e){this._scene=e,this._transform=Matrix4.clone(Matrix4.IDENTITY),this._invTransform=Matrix4.clone(Matrix4.IDENTITY),this._actualTransform=Matrix4.clone(Matrix4.IDENTITY),this._actualInvTransform=Matrix4.clone(Matrix4.IDENTITY),this._transformChanged=!1,this.position=new Cartesian3,this._position=new Cartesian3,this._positionWC=new Cartesian3,this._positionCartographic=new Cartographic,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new Cartesian3,this._direction=new Cartesian3,this._directionWC=new Cartesian3,this.up=new Cartesian3,this._up=new Cartesian3,this._upWC=new Cartesian3,this.right=new Cartesian3,this._right=new Cartesian3,this._rightWC=new Cartesian3,this.frustum=new PerspectiveFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=CesiumMath.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 Event,this._moveEnd=new Event,this._changed=new Event,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new Matrix4,this._invViewMatrix=new Matrix4,updateViewMatrix(this),this._mode=SceneMode$1.SCENE3D,this._modeChanged=!0;e=e.mapProjection;this._projection=e,this._maxCoord=e.project(new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO)),this._max2Dfrustum=void 0,rectangleCameraPosition3D(this,Camera.DEFAULT_VIEW_RECTANGLE,this.position,!0);e=Cartesian3.magnitude(this.position);e+=e*Camera.DEFAULT_VIEW_FACTOR,Cartesian3.normalize(this.position,this.position),Cartesian3.multiplyByScalar(this.position,e,this.position)}function updateViewMatrix(e){Matrix4.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),Matrix4.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),Matrix4.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function updateCameraDeltas(e){var t;defined(e._oldPositionWC)?(e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude,t=Cartesian3.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC),e.positionWCDeltaMagnitude=Cartesian3.magnitude(t),e._oldPositionWC=Cartesian3.clone(e.positionWC,e._oldPositionWC),0<e.positionWCDeltaMagnitude?(e.timeSinceMoved=0,e._lastMovedTimestamp=getTimestamp$1()):e.timeSinceMoved=Math.max(getTimestamp$1()-e._lastMovedTimestamp,0)/1e3):e._oldPositionWC=Cartesian3.clone(e.positionWC,e._oldPositionWC)}function convertTransformForColumbusView(e){Transforms.basisTo2D(e._projection,e._transform,e._actualTransform)}Camera.TRANSFORM_2D=new Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Camera.TRANSFORM_2D_INVERSE=Matrix4.inverseTransformation(Camera.TRANSFORM_2D,new Matrix4),Camera.DEFAULT_VIEW_RECTANGLE=Rectangle.fromDegrees(-95,-20,-70,90),Camera.DEFAULT_VIEW_FACTOR=.5,Camera.DEFAULT_OFFSET=new HeadingPitchRange(0,-CesiumMath.PI_OVER_FOUR,0),Camera.prototype.canPreloadFlight=function(){return defined(this._currentFlight)&&this._mode!==SceneMode$1.SCENE2D},Camera.prototype._updateCameraChanged=function(){var e=this;if(updateCameraDeltas(e),0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode!==SceneMode$1.SCENE2D){if(!defined(e._changedDirection))return e._changedPosition=Cartesian3.clone(e.positionWC,e._changedPosition),void(e._changedDirection=Cartesian3.clone(e.directionWC,e._changedDirection));var i=CesiumMath.acosClamped(Cartesian3.dot(e.directionWC,e._changedDirection)),r=defined(e.frustum.fovy)?i/(.5*e.frustum.fovy):i,n=Cartesian3.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(t<r||t<n)&&(e._changed.raiseEvent(Math.max(r,n)),e._changedPosition=Cartesian3.clone(e.positionWC,e._changedPosition),e._changedDirection=Cartesian3.clone(e.directionWC,e._changedDirection))}else{if(!defined(e._changedFrustum))return e._changedPosition=Cartesian3.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var a,o=e.position,s=e._changedPosition,l=e.frustum,c=e._changedFrustum,u=o.x+l.left,d=o.x+l.right,h=s.x+c.left,p=s.x+c.right,m=o.y+l.bottom,f=o.y+l.top,g=s.y+c.bottom,i=s.y+c.top,r=Math.max(u,h),n=Math.min(d,p),o=Math.max(m,g),s=Math.min(f,i);t<(a=n<=r||f<=o?1:1-(n-r)*(s-o)/(((a=u<h&&p<d&&m<g&&i<f?l:c).right-a.left)*(a.top-a.bottom)))&&(e._changed.raiseEvent(a),e._changedPosition=Cartesian3.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum))}}};var scratchCartographic$3=new Cartographic,scratchCartesian3Projection=new Cartesian3,scratchCartesian3$1=new Cartesian3,scratchCartesian4Origin=new Cartesian4,scratchCartesian4NewOrigin=new Cartesian4,scratchCartesian4NewXAxis=new Cartesian4,scratchCartesian4NewYAxis=new Cartesian4,scratchCartesian4NewZAxis=new Cartesian4;function convertTransformFor2D(e){var t=e._projection,i=t.ellipsoid,r=Matrix4.getColumn(e._transform,3,scratchCartesian4Origin),n=i.cartesianToCartographic(r,scratchCartographic$3),a=t.project(n,scratchCartesian3Projection),o=scratchCartesian4NewOrigin;o.x=a.z,o.y=a.x,o.z=a.y,o.w=1;var s=Cartesian4.clone(Cartesian4.UNIT_X,scratchCartesian4NewZAxis),l=Cartesian4.add(Matrix4.getColumn(e._transform,0,scratchCartesian3$1),r,scratchCartesian3$1);i.cartesianToCartographic(l,n),t.project(n,a);var c=scratchCartesian4NewXAxis;c.x=a.z,c.y=a.x,c.z=a.y,c.w=0,Cartesian3.subtract(c,o,c),c.x=0;l=scratchCartesian4NewYAxis;Cartesian3.magnitudeSquared(c)>CesiumMath.EPSILON10?Cartesian3.cross(s,c,l):(r=Cartesian4.add(Matrix4.getColumn(e._transform,1,scratchCartesian3$1),r,scratchCartesian3$1),i.cartesianToCartographic(r,n),t.project(n,a),l.x=a.z,l.y=a.x,l.z=a.y,l.w=0,Cartesian3.subtract(l,o,l),l.x=0,Cartesian3.magnitudeSquared(l)<CesiumMath.EPSILON10&&(Cartesian4.clone(Cartesian4.UNIT_Y,c),Cartesian4.clone(Cartesian4.UNIT_Z,l))),Cartesian3.cross(l,s,c),Cartesian3.normalize(c,c),Cartesian3.cross(s,c,l),Cartesian3.normalize(l,l),Matrix4.setColumn(e._actualTransform,0,c,e._actualTransform),Matrix4.setColumn(e._actualTransform,1,l,e._actualTransform),Matrix4.setColumn(e._actualTransform,2,s,e._actualTransform),Matrix4.setColumn(e._actualTransform,3,o,e._actualTransform)}var scratchCartesian$1=new Cartesian3;function updateMembers(e){var t=e._mode,i=!1,r=0;t===SceneMode$1.SCENE2D&&(i=(r=e.frustum.right-e.frustum.left)!==e._positionCartographic.height);var n=e._position,a=!Cartesian3.equals(n,e.position)||i;a&&(n=Cartesian3.clone(e.position,e._position));var o=e._direction,s=!Cartesian3.equals(o,e.direction);s&&(Cartesian3.normalize(e.direction,e.direction),o=Cartesian3.clone(e.direction,e._direction));var l=e._up,c=!Cartesian3.equals(l,e.up);c&&(Cartesian3.normalize(e.up,e.up),l=Cartesian3.clone(e.up,e._up));var u=e._right,d=!Cartesian3.equals(u,e.right);d&&(Cartesian3.normalize(e.right,e.right),u=Cartesian3.clone(e.right,e._right));var h=e._transformChanged||e._modeChanged;e._transformChanged=!1,h&&(Matrix4.inverseTransformation(e._transform,e._invTransform),e._mode===SceneMode$1.COLUMBUS_VIEW||e._mode===SceneMode$1.SCENE2D?Matrix4.equals(Matrix4.IDENTITY,e._transform)?Matrix4.clone(Camera.TRANSFORM_2D,e._actualTransform):(e._mode===SceneMode$1.COLUMBUS_VIEW?convertTransformForColumbusView:convertTransformFor2D)(e):Matrix4.clone(e._transform,e._actualTransform),Matrix4.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var p,i=e._actualTransform;(a||h)&&(e._positionWC=Matrix4.multiplyByPoint(i,n,e._positionWC),t===SceneMode$1.SCENE3D||t===SceneMode$1.MORPHING?e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic):((p=scratchCartesian$1).x=e._positionWC.y,p.y=e._positionWC.z,p.z=e._positionWC.x,t===SceneMode$1.SCENE2D&&(p.z=r),e._projection.unproject(p,e._positionCartographic))),(s||c||d)&&(p=Cartesian3.dot(o,Cartesian3.cross(l,u,scratchCartesian$1)),Math.abs(1-p)>CesiumMath.EPSILON2&&(p=1/Cartesian3.magnitudeSquared(l),p=Cartesian3.dot(l,o)*p,p=Cartesian3.multiplyByScalar(o,p,scratchCartesian$1),l=Cartesian3.normalize(Cartesian3.subtract(l,p,e._up),e._up),Cartesian3.clone(l,e.up),u=Cartesian3.cross(o,l,e._right),Cartesian3.clone(u,e.right))),(s||h)&&(e._directionWC=Matrix4.multiplyByPointAsVector(i,o,e._directionWC),Cartesian3.normalize(e._directionWC,e._directionWC)),(c||h)&&(e._upWC=Matrix4.multiplyByPointAsVector(i,l,e._upWC),Cartesian3.normalize(e._upWC,e._upWC)),(d||h)&&(e._rightWC=Matrix4.multiplyByPointAsVector(i,u,e._rightWC),Cartesian3.normalize(e._rightWC,e._rightWC)),(a||s||c||d||h)&&updateViewMatrix(e)}function getHeading(e,t){e=CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)?Math.atan2(t.y,t.x)-CesiumMath.PI_OVER_TWO:Math.atan2(e.y,e.x)-CesiumMath.PI_OVER_TWO;return CesiumMath.TWO_PI-CesiumMath.zeroToTwoPi(e)}function getPitch(e){return CesiumMath.PI_OVER_TWO-CesiumMath.acosClamped(e.z)}function getRoll(e,t,i){var r=0;return CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=CesiumMath.zeroToTwoPi(r+CesiumMath.TWO_PI)),r}var scratchHPRMatrix1=new Matrix4,scratchHPRMatrix2=new Matrix4;Object.defineProperties(Camera.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return updateMembers(this),this._invTransform}},viewMatrix:{get:function(){return updateMembers(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return updateMembers(this),this._invViewMatrix}},positionCartographic:{get:function(){return updateMembers(this),this._positionCartographic}},positionWC:{get:function(){return updateMembers(this),this._positionWC}},directionWC:{get:function(){return updateMembers(this),this._directionWC}},upWC:{get:function(){return updateMembers(this),this._upWC}},rightWC:{get:function(){return updateMembers(this),this._rightWC}},heading:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getHeading(this.direction,this.up);return this._setTransform(t),e}}},pitch:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getPitch(this.direction);return this._setTransform(t),e}}},roll:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getRoll(this.direction,this.up,this.right);return this._setTransform(t),e}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),Camera.prototype.update=function(e){var t=!1;e!==this._mode&&(this._mode=e,this._modeChanged=e!==SceneMode$1.MORPHING,t=this._mode===SceneMode$1.SCENE2D),t&&(t=(e=this._max2Dfrustum=this.frustum.clone()).top/e.right,e.right=2*this._maxCoord.x,e.left=-e.right,e.top=t*e.right,e.bottom=-e.top),this._mode===SceneMode$1.SCENE2D&&clampMove2D(this,this.position)};var setTransformPosition=new Cartesian3,setTransformUp=new Cartesian3,setTransformDirection=new Cartesian3;Camera.prototype._setTransform=function(e){var t=Cartesian3.clone(this.positionWC,setTransformPosition),i=Cartesian3.clone(this.upWC,setTransformUp),r=Cartesian3.clone(this.directionWC,setTransformDirection);Matrix4.clone(e,this._transform),this._transformChanged=!0,updateMembers(this);e=this._actualInvTransform;Matrix4.multiplyByPoint(e,t,this.position),Matrix4.multiplyByPointAsVector(e,r,this.direction),Matrix4.multiplyByPointAsVector(e,i,this.up),Cartesian3.cross(this.direction,this.up,this.right),updateMembers(this)};var scratchAdjustOrthographicFrustumMousePosition=new Cartesian2,scratchPickRay$1=new Ray,scratchRayIntersection$1=new Cartesian3,scratchDepthIntersection$1=new Cartesian3;function calculateOrthographicFrustumWidth(e){if(!Matrix4.equals(Matrix4.IDENTITY,e.transform))return Cartesian3.magnitude(e.position);var t,i,r=e._scene,n=r.globe,a=scratchAdjustOrthographicFrustumMousePosition;return a.x=r.drawingBufferWidth/2,a.y=r.drawingBufferHeight/2,defined(n)&&(i=e.getPickRay(a,scratchPickRay$1),i=n.pickWorldCoordinates(i,r,!0,scratchRayIntersection$1)),r.pickPositionSupported&&(t=r.pickPositionWorldCoordinates(a,scratchDepthIntersection$1)),defined(i)||defined(t)?(t=defined(t)?Cartesian3.distance(t,e.positionWC):Number.POSITIVE_INFINITY,i=defined(i)?Cartesian3.distance(i,e.positionWC):Number.POSITIVE_INFINITY,Math.min(t,i)):Math.max(e.positionCartographic.height,0)}Camera.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof OrthographicFrustum&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=calculateOrthographicFrustumWidth(this)))};var scratchSetViewCartesian=new Cartesian3,scratchSetViewTransform1=new Matrix4,scratchSetViewTransform2=new Matrix4,scratchSetViewQuaternion=new Quaternion,scratchSetViewMatrix3=new Matrix3,scratchSetViewCartographic=new Cartographic;function setView3D(e,t,i){var r=Matrix4.clone(e.transform,scratchSetViewTransform1),t=Transforms.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,scratchSetViewTransform2);e._setTransform(t),Cartesian3.clone(Cartesian3.ZERO,e.position),i.heading=i.heading-CesiumMath.PI_OVER_TWO;i=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),i=Matrix3.fromQuaternion(i,scratchSetViewMatrix3);Matrix3.getColumn(i,0,e.direction),Matrix3.getColumn(i,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function setViewCV(e,t,i,r){var n,a=Matrix4.clone(e.transform,scratchSetViewTransform1);e._setTransform(Matrix4.IDENTITY),Cartesian3.equals(t,e.positionWC)||(r&&(r=(n=e._projection).ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic),t=n.project(r,scratchSetViewCartesian)),Cartesian3.clone(t,e.position)),i.heading=i.heading-CesiumMath.PI_OVER_TWO;i=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),i=Matrix3.fromQuaternion(i,scratchSetViewMatrix3);Matrix3.getColumn(i,0,e.direction),Matrix3.getColumn(i,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(a),e._adjustOrthographicFrustum(!0)}function setView2D(e,t,i,r){var n,a,o=Matrix4.clone(e.transform,scratchSetViewTransform1);e._setTransform(Matrix4.IDENTITY),Cartesian3.equals(t,e.positionWC)||(r&&(n=(a=e._projection).ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic),t=a.project(n,scratchSetViewCartesian)),Cartesian2.clone(t,e.position),r=.5*-t.z,a=e.frustum,r<(n=-r)&&(t=a.top/a.right,a.right=n,a.left=r,a.top=a.right*t,a.bottom=-a.top)),e._scene.mapMode2D===MapMode2D$1.ROTATE&&(i.heading=i.heading-CesiumMath.PI_OVER_TWO,i.pitch=-CesiumMath.PI_OVER_TWO,i.roll=0,i=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),i=Matrix3.fromQuaternion(i,scratchSetViewMatrix3),Matrix3.getColumn(i,2,e.up),Cartesian3.cross(e.direction,e.up,e.right)),e._setTransform(o)}var scratchToHPRDirection=new Cartesian3,scratchToHPRUp=new Cartesian3,scratchToHPRRight=new Cartesian3;function directionUpToHeadingPitchRoll(e,t,i,r){var n=Cartesian3.clone(i.direction,scratchToHPRDirection),i=Cartesian3.clone(i.up,scratchToHPRUp);e._scene.mode===SceneMode$1.SCENE3D&&(a=e._projection.ellipsoid,a=Transforms.eastNorthUpToFixedFrame(t,a,scratchHPRMatrix1),a=Matrix4.inverseTransformation(a,scratchHPRMatrix2),Matrix4.multiplyByPointAsVector(a,n,n),Matrix4.multiplyByPointAsVector(a,i,i));var a=Cartesian3.cross(n,i,scratchToHPRRight);return r.heading=getHeading(n,i),r.pitch=getPitch(n),r.roll=getRoll(n,i,a),r}var scratchSetViewOptions={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},scratchHpr=new HeadingPitchRoll;Camera.prototype.setView=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t,i=defaultValue(e.orientation,defaultValue.EMPTY_OBJECT),r=this._mode;r!==SceneMode$1.MORPHING&&(defined(e.endTransform)&&this._setTransform(e.endTransform),t=defaultValue(e.convert,!0),defined(e=defaultValue(e.destination,Cartesian3.clone(this.positionWC,scratchSetViewCartesian)))&&defined(e.west)&&(e=this.getRectangleCameraCoordinates(e,scratchSetViewCartesian),t=!1),defined(i.direction)&&(i=directionUpToHeadingPitchRoll(this,e,i,scratchSetViewOptions.orientation)),scratchHpr.heading=defaultValue(i.heading,0),scratchHpr.pitch=defaultValue(i.pitch,-CesiumMath.PI_OVER_TWO),scratchHpr.roll=defaultValue(i.roll,0),r===SceneMode$1.SCENE3D?setView3D(this,e,scratchHpr):(r===SceneMode$1.SCENE2D?setView2D:setViewCV)(this,e,scratchHpr,t))};var pitchScratch=new Cartesian3;function clampMove2D(e,t){var i,r=e._scene.mapMode2D===MapMode2D$1.ROTATE,n=e._maxCoord.x,e=e._maxCoord.y,r=r?-(i=n):(i=t.x-2*n,t.x+2*n);t.x>n&&(t.x=i),t.x<-n&&(t.x=r),t.y>e&&(t.y=e),t.y<-e&&(t.y=-e)}Camera.prototype.flyHome=function(e){var t,i,r=this._mode;r===SceneMode$1.MORPHING&&this._scene.completeMorph(),r===SceneMode$1.SCENE2D?this.flyTo({destination:Camera.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:Matrix4.IDENTITY}):r===SceneMode$1.SCENE3D?(i=this.getRectangleCameraCoordinates(Camera.DEFAULT_VIEW_RECTANGLE),t=Cartesian3.magnitude(i),t+=t*Camera.DEFAULT_VIEW_FACTOR,Cartesian3.normalize(i,i),Cartesian3.multiplyByScalar(i,t,i),this.flyTo({destination:i,duration:e,endTransform:Matrix4.IDENTITY})):r===SceneMode$1.COLUMBUS_VIEW&&(i=this._projection.ellipsoid.maximumRadius,r=new Cartesian3(0,-1,1),r=Cartesian3.multiplyByScalar(Cartesian3.normalize(r,r),5*i,r),this.flyTo({destination:r,duration:e,orientation:{heading:0,pitch:-Math.acos(Cartesian3.normalize(r,pitchScratch).z),roll:0},endTransform:Matrix4.IDENTITY,convert:!1}))},Camera.prototype.worldToCameraCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers(this),Matrix4.multiplyByVector(this._actualInvTransform,e,t)},Camera.prototype.worldToCameraCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPoint(this._actualInvTransform,e,t)},Camera.prototype.worldToCameraCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPointAsVector(this._actualInvTransform,e,t)},Camera.prototype.cameraToWorldCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers(this),Matrix4.multiplyByVector(this._actualTransform,e,t)},Camera.prototype.cameraToWorldCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPoint(this._actualTransform,e,t)},Camera.prototype.cameraToWorldCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPointAsVector(this._actualTransform,e,t)};var moveScratch=new Cartesian3;Camera.prototype.move=function(e,t){var i=this.position;Cartesian3.multiplyByScalar(e,t,moveScratch),Cartesian3.add(i,moveScratch,i),this._mode===SceneMode$1.SCENE2D&&clampMove2D(this,i),this._adjustOrthographicFrustum(!0)},Camera.prototype.moveForward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$1.SCENE2D?zoom2D$1(this,e):this.move(this.direction,e)},Camera.prototype.moveBackward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$1.SCENE2D?zoom2D$1(this,-e):this.move(this.direction,-e)},Camera.prototype.moveUp=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,e)},Camera.prototype.moveDown=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,-e)},Camera.prototype.moveRight=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,e)},Camera.prototype.moveLeft=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,-e)},Camera.prototype.lookLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.up,-e)},Camera.prototype.lookRight=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.up,e)},Camera.prototype.lookUp=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.right,-e)},Camera.prototype.lookDown=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.right,e)};var lookScratchQuaternion=new Quaternion,lookScratchMatrix=new Matrix3;Camera.prototype.look=function(e,t){var i=defaultValue(t,this.defaultLookAmount),r=Quaternion.fromAxisAngle(e,-i,lookScratchQuaternion),t=Matrix3.fromQuaternion(r,lookScratchMatrix),e=this.direction,i=this.up,r=this.right;Matrix3.multiplyByVector(t,e,e),Matrix3.multiplyByVector(t,i,i),Matrix3.multiplyByVector(t,r,r)},Camera.prototype.twistLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,e)},Camera.prototype.twistRight=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,-e)};var rotateScratchQuaternion=new Quaternion,rotateScratchMatrix=new Matrix3;Camera.prototype.rotate=function(e,t){t=defaultValue(t,this.defaultRotateAmount),t=Quaternion.fromAxisAngle(e,-t,rotateScratchQuaternion),t=Matrix3.fromQuaternion(t,rotateScratchMatrix);Matrix3.multiplyByVector(t,this.position,this.position),Matrix3.multiplyByVector(t,this.direction,this.direction),Matrix3.multiplyByVector(t,this.up,this.up),Cartesian3.cross(this.direction,this.up,this.right),Cartesian3.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},Camera.prototype.rotateDown=function(e){rotateVertical(this,e=defaultValue(e,this.defaultRotateAmount))},Camera.prototype.rotateUp=function(e){rotateVertical(this,-(e=defaultValue(e,this.defaultRotateAmount)))};var rotateVertScratchP=new Cartesian3,rotateVertScratchA=new Cartesian3,rotateVertScratchTan=new Cartesian3,rotateVertScratchNegate=new Cartesian3;function rotateVertical(e,t){var i,r,n,a=e.position;defined(e.constrainedAxis)&&!Cartesian3.equalsEpsilon(e.position,Cartesian3.ZERO,CesiumMath.EPSILON2)?(n=Cartesian3.normalize(a,rotateVertScratchP),i=Cartesian3.equalsEpsilon(n,e.constrainedAxis,CesiumMath.EPSILON2),r=Cartesian3.equalsEpsilon(n,Cartesian3.negate(e.constrainedAxis,rotateVertScratchNegate),CesiumMath.EPSILON2),i||r?(i&&t<0||r&&0<t)&&e.rotate(e.right,t):(a=Cartesian3.normalize(e.constrainedAxis,rotateVertScratchA),i=Cartesian3.dot(n,a),r=CesiumMath.acosClamped(i),0<t&&r<t&&(t=r-CesiumMath.EPSILON4),i=Cartesian3.dot(n,Cartesian3.negate(a,rotateVertScratchNegate)),r=CesiumMath.acosClamped(i),t<0&&r<-t&&(t=-r+CesiumMath.EPSILON4),n=Cartesian3.cross(a,n,rotateVertScratchTan),e.rotate(n,t))):e.rotate(e.right,t)}function rotateHorizontal(e,t){defined(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function zoom2D$1(e,t){var i,r,n,a=e.frustum;t*=.5,Math.abs(a.top)+Math.abs(a.bottom)>Math.abs(a.left)+Math.abs(a.right)?(r=a.top-t,n=a.bottom+t,i=e._maxCoord.y,e._scene.mapMode2D===MapMode2D$1.ROTATE&&(i*=e.maximumZoomFactor),(r=i<n?-(n=i):r)<=n&&(n=-(r=1)),i=a.right/a.top,a.top=r,a.bottom=n,a.right=a.top*i,a.left=-a.right):(r=a.right-t,n=a.left+t,t=e._maxCoord.x,e._scene.mapMode2D===MapMode2D$1.ROTATE&&(t*=e.maximumZoomFactor),t<r&&(n=-(r=t)),r<=n&&(n=-(r=1)),i=a.top/a.right,a.right=r,a.left=n,a.top=a.right*i,a.bottom=-a.top)}function zoom3D$1(e,t){e.move(e.direction,t)}Camera.prototype.rotateRight=function(e){rotateHorizontal(this,-(e=defaultValue(e,this.defaultRotateAmount)))},Camera.prototype.rotateLeft=function(e){rotateHorizontal(this,e=defaultValue(e,this.defaultRotateAmount))},Camera.prototype.zoomIn=function(e){e=defaultValue(e,this.defaultZoomAmount),(this._mode===SceneMode$1.SCENE2D?zoom2D$1:zoom3D$1)(this,e)},Camera.prototype.zoomOut=function(e){e=defaultValue(e,this.defaultZoomAmount),(this._mode===SceneMode$1.SCENE2D?zoom2D$1:zoom3D$1)(this,-e)},Camera.prototype.getMagnitude=function(){return this._mode===SceneMode$1.SCENE3D?Cartesian3.magnitude(this.position):this._mode===SceneMode$1.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===SceneMode$1.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var scratchLookAtMatrix4=new Matrix4;Camera.prototype.lookAt=function(e,t){e=Transforms.eastNorthUpToFixedFrame(e,Ellipsoid.WGS84,scratchLookAtMatrix4);this.lookAtTransform(e,t)};var scratchLookAtHeadingPitchRangeOffset=new Cartesian3,scratchLookAtHeadingPitchRangeQuaternion1=new Quaternion,scratchLookAtHeadingPitchRangeQuaternion2=new Quaternion,scratchHeadingPitchRangeMatrix3=new Matrix3;function offsetFromHeadingPitchRange(e,t,i){t=CesiumMath.clamp(t,-CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO),e=CesiumMath.zeroToTwoPi(e)-CesiumMath.PI_OVER_TWO;t=Quaternion.fromAxisAngle(Cartesian3.UNIT_Y,-t,scratchLookAtHeadingPitchRangeQuaternion1),e=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,-e,scratchLookAtHeadingPitchRangeQuaternion2),t=Quaternion.multiply(e,t,e),e=Matrix3.fromQuaternion(t,scratchHeadingPitchRangeMatrix3),t=Cartesian3.clone(Cartesian3.UNIT_X,scratchLookAtHeadingPitchRangeOffset);return Matrix3.multiplyByVector(e,t,t),Cartesian3.negate(t,t),Cartesian3.multiplyByScalar(t,i,t),t}Camera.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),defined(t)){var i=defined(t.heading)?offsetFromHeadingPitchRange(t.heading,t.pitch,t.range):t;if(this._mode===SceneMode$1.SCENE2D){Cartesian2.clone(Cartesian2.ZERO,this.position),Cartesian3.negate(i,this.up),this.up.z=0,Cartesian3.magnitudeSquared(this.up)<CesiumMath.EPSILON10&&Cartesian3.clone(Cartesian3.UNIT_Y,this.up),Cartesian3.normalize(this.up,this.up),this._setTransform(Matrix4.IDENTITY),Cartesian3.negate(Cartesian3.UNIT_Z,this.direction),Cartesian3.cross(this.direction,this.up,this.right),Cartesian3.normalize(this.right,this.right);var r=this.frustum,t=r.top/r.right;return r.right=.5*Cartesian3.magnitude(i),r.left=-r.right,r.top=t*r.right,r.bottom=-r.top,void this._setTransform(e)}Cartesian3.clone(i,this.position),Cartesian3.negate(this.position,this.direction),Cartesian3.normalize(this.direction,this.direction),Cartesian3.cross(this.direction,Cartesian3.UNIT_Z,this.right),Cartesian3.magnitudeSquared(this.right)<CesiumMath.EPSILON10&&Cartesian3.clone(Cartesian3.UNIT_X,this.right),Cartesian3.normalize(this.right,this.right),Cartesian3.cross(this.right,this.direction,this.up),Cartesian3.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};var viewRectangle3DCartographic1=new Cartographic,viewRectangle3DCartographic2=new Cartographic,viewRectangle3DNorthEast=new Cartesian3,viewRectangle3DSouthWest=new Cartesian3,viewRectangle3DNorthWest=new Cartesian3,viewRectangle3DSouthEast=new Cartesian3,viewRectangle3DNorthCenter=new Cartesian3,viewRectangle3DSouthCenter=new Cartesian3,viewRectangle3DCenter=new Cartesian3,viewRectangle3DEquator=new Cartesian3,defaultRF={direction:new Cartesian3,right:new Cartesian3,up:new Cartesian3},viewRectangle3DEllipsoidGeodesic;function computeD(e,t,i,r){return Math.abs(Cartesian3.dot(t,i))/r-Cartesian3.dot(e,i)}function rectangleCameraPosition3D(e,t,i,r){var n=e._projection.ellipsoid,a=r?e:defaultRF,o=t.north,s=t.south,l=t.east,c=t.west;l<c&&(l+=CesiumMath.TWO_PI);var u=.5*(c+l),d=s<-CesiumMath.PI_OVER_TWO+CesiumMath.RADIANS_PER_DEGREE&&o>CesiumMath.PI_OVER_TWO-CesiumMath.RADIANS_PER_DEGREE?0:((y=viewRectangle3DCartographic1).longitude=u,y.latitude=o,y.height=0,(C=viewRectangle3DCartographic2).longitude=u,C.latitude=s,C.height=0,defined(v=viewRectangle3DEllipsoidGeodesic)&&v.ellipsoid===n||(viewRectangle3DEllipsoidGeodesic=v=new EllipsoidGeodesic(void 0,void 0,n)),v.setEndPoints(y,C),v.interpolateUsingFraction(.5,viewRectangle3DCartographic1).latitude),h=viewRectangle3DCartographic1;h.longitude=u,h.latitude=d,h.height=0;var p=n.cartographicToCartesian(h,viewRectangle3DCenter),m=viewRectangle3DCartographic1;m.longitude=l,m.latitude=o;var f=n.cartographicToCartesian(m,viewRectangle3DNorthEast);m.longitude=c;var g=n.cartographicToCartesian(m,viewRectangle3DNorthWest);m.longitude=u;var _=n.cartographicToCartesian(m,viewRectangle3DNorthCenter);m.latitude=s;r=n.cartographicToCartesian(m,viewRectangle3DSouthCenter);m.longitude=l;t=n.cartographicToCartesian(m,viewRectangle3DSouthEast);m.longitude=c;var y=n.cartographicToCartesian(m,viewRectangle3DSouthWest);Cartesian3.subtract(g,p,g),Cartesian3.subtract(t,p,t),Cartesian3.subtract(f,p,f),Cartesian3.subtract(y,p,y),Cartesian3.subtract(_,p,_),Cartesian3.subtract(r,p,r);var C=n.geodeticSurfaceNormal(p,a.direction);Cartesian3.negate(C,C);var v=Cartesian3.cross(C,Cartesian3.UNIT_Z,a.right);Cartesian3.normalize(v,v);var S,T,d=Cartesian3.cross(v,C,a.up);return e.frustum instanceof OrthographicFrustum?(h=Math.max(Cartesian3.distance(f,g),Cartesian3.distance(t,y)),(a=(u=Math.max(Cartesian3.distance(f,t),Cartesian3.distance(g,y)))*(m=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top))<h?S=(T=h)/m:(S=u,T=a),T=Math.max(T,S)):(S=Math.tan(.5*e.frustum.fovy),e=e.frustum.aspectRatio*S,T=Math.max(computeD(C,d,g,S),computeD(C,d,t,S),computeD(C,d,f,S),computeD(C,d,y,S),computeD(C,d,_,S),computeD(C,d,r,S),computeD(C,v,g,e),computeD(C,v,t,e),computeD(C,v,f,e),computeD(C,v,y,e),computeD(C,v,_,e),computeD(C,v,r,e)),s<0&&0<o&&((o=viewRectangle3DCartographic1).longitude=c,o.latitude=0,o.height=0,c=n.cartographicToCartesian(o,viewRectangle3DEquator),Cartesian3.subtract(c,p,c),T=Math.max(T,computeD(C,d,c,S),computeD(C,v,c,e)),o.longitude=l,c=n.cartographicToCartesian(o,viewRectangle3DEquator),Cartesian3.subtract(c,p,c),T=Math.max(T,computeD(C,d,c,S),computeD(C,v,c,e)))),Cartesian3.add(p,Cartesian3.multiplyByScalar(C,-T,viewRectangle3DEquator),i)}var viewRectangleCVCartographic=new Cartographic,viewRectangleCVNorthEast=new Cartesian3,viewRectangleCVSouthWest=new Cartesian3;function rectangleCameraPositionColumbusView(e,t,i){var r=e._projection;t.west>t.east&&(t=Rectangle.MAX_VALUE);var n=e._actualTransform,a=e._actualInvTransform,o=viewRectangleCVCartographic;o.longitude=t.east,o.latitude=t.north;var s=r.project(o,viewRectangleCVNorthEast);Matrix4.multiplyByPoint(n,s,s),Matrix4.multiplyByPoint(a,s,s),o.longitude=t.west,o.latitude=t.south;var l,o=r.project(o,viewRectangleCVSouthWest);return Matrix4.multiplyByPoint(n,o,o),Matrix4.multiplyByPoint(a,o,o),i.x=.5*(s.x-o.x)+o.x,i.y=.5*(s.y-o.y)+o.y,defined(e.frustum.fovy)?(l=Math.tan(.5*e.frustum.fovy),e=e.frustum.aspectRatio*l,i.z=.5*Math.max((s.x-o.x)/e,(s.y-o.y)/l)):(l=s.x-o.x,o=s.y-o.y,i.z=Math.max(l,o)),i}var viewRectangle2DCartographic=new Cartographic,viewRectangle2DNorthEast=new Cartesian3,viewRectangle2DSouthWest=new Cartesian3;function rectangleCameraPosition2D(e,t,i){var r=e._projection,n=t.east;t.west>t.east&&(e._scene.mapMode2D===MapMode2D$1.INFINITE_SCROLL?n+=CesiumMath.TWO_PI:n=(t=Rectangle.MAX_VALUE).east);var a=viewRectangle2DCartographic;a.longitude=n,a.latitude=t.north;var o=r.project(a,viewRectangle2DNorthEast);a.longitude=t.west,a.latitude=t.south;var s,l,c=r.project(a,viewRectangle2DSouthWest),u=.5*Math.abs(o.x-c.x),n=.5*Math.abs(o.y-c.y),t=e.frustum.right/e.frustum.top,e=n*t;return e<u?l=(s=u)/t:(l=n,s=e),n=Math.max(2*s,2*l),i.x=.5*(o.x-c.x)+c.x,i.y=.5*(o.y-c.y)+c.y,(a=r.unproject(i,a)).height=n,i=r.project(a,i)}Camera.prototype.getRectangleCameraCoordinates=function(e,t){var i=this._mode;return defined(t)||(t=new Cartesian3),i===SceneMode$1.SCENE3D?rectangleCameraPosition3D(this,e,t):i===SceneMode$1.COLUMBUS_VIEW?rectangleCameraPositionColumbusView(this,e,t):i===SceneMode$1.SCENE2D?rectangleCameraPosition2D(this,e,t):void 0};var pickEllipsoid3DRay=new Ray;function pickEllipsoid3D(e,t,i,r){i=defaultValue(i,Ellipsoid.WGS84);t=e.getPickRay(t,pickEllipsoid3DRay),i=IntersectionTests.rayEllipsoid(t,i);if(i){i=0<i.start?i.start:i.stop;return Ray.getPoint(t,i,r)}}var pickEllipsoid2DRay=new Ray;function pickMap2D(e,t,i,r){t=e.getPickRay(t,pickEllipsoid2DRay).origin,t=Cartesian3.fromElements(t.y,t.z,0,t),t=i.unproject(t);if(!(t.latitude<-CesiumMath.PI_OVER_TWO||t.latitude>CesiumMath.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(t,r)}var pickEllipsoidCVRay=new Ray;function pickMapColumbusView(e,t,i,r){e=e.getPickRay(t,pickEllipsoidCVRay),t=-e.origin.x/e.direction.x;Ray.getPoint(e,t,r);t=i.unproject(new Cartesian3(r.y,r.z,0));if(!(t.latitude<-CesiumMath.PI_OVER_TWO||t.latitude>CesiumMath.PI_OVER_TWO||t.longitude<-Math.PI||t.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(t,r)}Camera.prototype.pickEllipsoid=function(e,t,i){var r=this._scene.canvas;if(0!==r.clientWidth&&0!==r.clientHeight){if(defined(i)||(i=new Cartesian3),t=defaultValue(t,Ellipsoid.WGS84),this._mode===SceneMode$1.SCENE3D)i=pickEllipsoid3D(this,e,t,i);else if(this._mode===SceneMode$1.SCENE2D)i=pickMap2D(this,e,this._projection,i);else{if(this._mode!==SceneMode$1.COLUMBUS_VIEW)return;i=pickMapColumbusView(this,e,this._projection,i)}return i}};var pickPerspCenter=new Cartesian3,pickPerspXDir=new Cartesian3,pickPerspYDir=new Cartesian3;function getPickRayPerspective(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,o=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*o,l=e.frustum.near,r=2/n*t.x-1,n=2/a*(a-t.y)-1,a=e.positionWC;Cartesian3.clone(a,i.origin);t=Cartesian3.multiplyByScalar(e.directionWC,l,pickPerspCenter);Cartesian3.add(a,t,t);s=Cartesian3.multiplyByScalar(e.rightWC,r*l*s,pickPerspXDir),o=Cartesian3.multiplyByScalar(e.upWC,n*l*o,pickPerspYDir),s=Cartesian3.add(t,s,i.direction);return Cartesian3.add(s,o,s),Cartesian3.subtract(s,a,s),Cartesian3.normalize(s,s),i}var scratchDirection=new Cartesian3;function getPickRayOrthographic(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,r=e.frustum;defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);n=2/n*t.x-1;n*=.5*(r.right-r.left);t=2/a*(a-t.y)-1;t*=.5*(r.top-r.bottom);r=i.origin;return Cartesian3.clone(e.position,r),Cartesian3.multiplyByScalar(e.right,n,scratchDirection),Cartesian3.add(scratchDirection,r,r),Cartesian3.multiplyByScalar(e.up,t,scratchDirection),Cartesian3.add(scratchDirection,r,r),Cartesian3.clone(e.directionWC,i.direction),e._mode!==SceneMode$1.COLUMBUS_VIEW&&e._mode!==SceneMode$1.SCENE2D||Cartesian3.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}Camera.prototype.getPickRay=function(e,t){defined(t)||(t=new Ray);var i=this.frustum;return(defined(i.aspectRatio)&&defined(i.fov)&&defined(i.near)?getPickRayPerspective:getPickRayOrthographic)(this,e,t)};var scratchToCenter=new Cartesian3,scratchProj=new Cartesian3;Camera.prototype.distanceToBoundingSphere=function(e){var t=Cartesian3.subtract(this.positionWC,e.center,scratchToCenter),t=Cartesian3.multiplyByScalar(this.directionWC,Cartesian3.dot(t,this.directionWC),scratchProj);return Math.max(0,Cartesian3.magnitude(t)-e.radius)};var scratchPixelSize=new Cartesian2;function createAnimationTemplateCV(t,i,e,r,n,a){var o=Cartesian3.clone(i);return e.y>r?o.y-=e.y-r:e.y<-r&&(o.y+=-r-e.y),e.z>n?o.z-=e.z-n:e.z<-n&&(o.z+=-n-e.z),{easingFunction:EasingFunction$1.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:function(e){e=Cartesian3.lerp(i,o,e.time,new Cartesian3),t.worldToCameraCoordinatesPoint(e,t.position)}}}Camera.prototype.getPixelSize=function(e,t,i){e=this.distanceToBoundingSphere(e),e=this.frustum.getPixelDimensions(t,i,e,this._scene.pixelRatio,scratchPixelSize);return Math.max(e.x,e.y)};var normalScratch$1=new Cartesian3,centerScratch$1=new Cartesian3,posScratch=new Cartesian3,scratchCartesian3Subtract=new Cartesian3;function createAnimationCV(e,t){var i=e.position,r=e.direction,n=e.worldToCameraCoordinatesVector(Cartesian3.UNIT_X,normalScratch$1),a=-Cartesian3.dot(n,i)/Cartesian3.dot(n,r),o=Cartesian3.add(i,Cartesian3.multiplyByScalar(r,a,centerScratch$1),centerScratch$1);e.cameraToWorldCoordinatesPoint(o,o);var i=e.cameraToWorldCoordinatesPoint(e.position,posScratch),s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,n=Cartesian3.magnitude(Cartesian3.subtract(i,o,scratchCartesian3Subtract)),r=s*n,a=e._maxCoord.x,s=e._maxCoord.y,n=Math.max(l*n-a,a),a=Math.max(r-s,s);if(i.z<-n||i.z>n||i.y<-a||i.y>a){r=o.y<-n||o.y>n,s=o.z<-a||o.z>a;if(r||s)return createAnimationTemplateCV(e,i,o,n,a,t)}}Camera.prototype.createCorrectPositionTween=function(e){if(this._mode===SceneMode$1.COLUMBUS_VIEW)return createAnimationCV(this,e)};var scratchFlyToDestination=new Cartesian3,newOptions={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};function distanceToBoundingSphere3D(e,t){var i=e.frustum,e=Math.tan(.5*i.fovy),i=i.aspectRatio*e;return Math.max(t/i,t/e)}function distanceToBoundingSphere2D(e,t){var i,r,n=e.frustum,e=(n=defined(n._offCenterFrustum)?n._offCenterFrustum:n).right/n.top,n=t*e;return n<t?r=(i=t)/e:(r=t,i=n),1.5*Math.max(i,r)}Camera.prototype.cancelFlight=function(){defined(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},Camera.prototype.completeFlight=function(){var e;defined(this._currentFlight)&&(this._currentFlight.cancelTween(),(e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}}).destination=newOptions.destination,e.orientation.heading=newOptions.heading,e.orientation.pitch=newOptions.pitch,e.orientation.roll=newOptions.roll,this.setView(e),defined(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0)},Camera.prototype.flyTo=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).destination;if(this._mode!==SceneMode$1.MORPHING){this.cancelFlight();var i=defaultValue(e.orientation,defaultValue.EMPTY_OBJECT);if(defined(i.direction)&&(i=directionUpToHeadingPitchRoll(this,t,i,scratchSetViewOptions.orientation)),defined(e.duration)&&e.duration<=0){var r=scratchSetViewOptions;return r.destination=e.destination,r.orientation.heading=i.heading,r.orientation.pitch=i.pitch,r.orientation.roll=i.roll,r.convert=e.convert,r.endTransform=e.endTransform,this.setView(r),void("function"==typeof e.complete&&e.complete())}var n=defined(t.west);n&&(t=this.getRectangleCameraCoordinates(t,scratchFlyToDestination));var a,o=this;newOptions.destination=t,newOptions.heading=i.heading,newOptions.pitch=i.pitch,newOptions.roll=i.roll,newOptions.duration=e.duration,newOptions.complete=function(){a===o._currentFlight&&(o._currentFlight=void 0),defined(e.complete)&&e.complete()},newOptions.cancel=e.cancel,newOptions.endTransform=e.endTransform,newOptions.convert=!n&&e.convert,newOptions.maximumHeight=e.maximumHeight,newOptions.pitchAdjustHeight=e.pitchAdjustHeight,newOptions.flyOverLongitude=e.flyOverLongitude,newOptions.flyOverLongitudeWeight=e.flyOverLongitudeWeight,newOptions.easingFunction=e.easingFunction;r=this._scene,n=CameraFlightPath.createTween(r,newOptions);0!==n.duration?(a=r.tweens.add(n),this._currentFlight=a,r=this._scene.preloadFlightCamera,this._mode!==SceneMode$1.SCENE2D&&((r=!defined(r)?Camera.clone(this):r).setView({destination:t,orientation:i}),this._scene.preloadFlightCullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC))):"function"==typeof n.complete&&n.complete()}};var MINIMUM_ZOOM=100;function adjustBoundingSphereOffset(e,t,i){i=HeadingPitchRange.clone(defined(i)?i:Camera.DEFAULT_OFFSET);var r=e._scene.screenSpaceCameraController.minimumZoomDistance,n=e._scene.screenSpaceCameraController.maximumZoomDistance,a=i.range;return defined(a)&&0!==a||(0===(t=t.radius)?i.range=MINIMUM_ZOOM:e.frustum instanceof OrthographicFrustum||e._mode===SceneMode$1.SCENE2D?i.range=distanceToBoundingSphere2D(e,t):i.range=distanceToBoundingSphere3D(e,t),i.range=CesiumMath.clamp(i.range,r,n)),i}Camera.prototype.viewBoundingSphere=function(e,t){t=adjustBoundingSphereOffset(this,e,t),this.lookAt(e.center,t)};var scratchflyToBoundingSphereTransform=new Matrix4,scratchflyToBoundingSphereDestination=new Cartesian3,scratchflyToBoundingSphereDirection=new Cartesian3,scratchflyToBoundingSphereUp=new Cartesian3,scratchflyToBoundingSphereRight=new Cartesian3,scratchFlyToBoundingSphereCart4=new Cartesian4,scratchFlyToBoundingSphereQuaternion=new Quaternion,scratchFlyToBoundingSphereMatrix3=new Matrix3;Camera.prototype.flyToBoundingSphere=function(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=this._mode===SceneMode$1.SCENE2D||this._mode===SceneMode$1.COLUMBUS_VIEW;this._setTransform(Matrix4.IDENTITY);var r,n,a,o=adjustBoundingSphereOffset(this,e,t.offset),s=i?Cartesian3.multiplyByScalar(Cartesian3.UNIT_Z,o.range,scratchflyToBoundingSphereDestination):offsetFromHeadingPitchRange(o.heading,o.pitch,o.range),l=Transforms.eastNorthUpToFixedFrame(e.center,Ellipsoid.WGS84,scratchflyToBoundingSphereTransform);Matrix4.multiplyByPoint(l,s,s),i||(n=Cartesian3.subtract(e.center,s,scratchflyToBoundingSphereDirection),Cartesian3.normalize(n,n),r=Matrix4.multiplyByPointAsVector(l,Cartesian3.UNIT_Z,scratchflyToBoundingSphereUp),1-Math.abs(Cartesian3.dot(n,r))<CesiumMath.EPSILON6&&(a=Quaternion.fromAxisAngle(n,o.heading,scratchFlyToBoundingSphereQuaternion),a=Matrix3.fromQuaternion(a,scratchFlyToBoundingSphereMatrix3),Cartesian3.fromCartesian4(Matrix4.getColumn(l,1,scratchFlyToBoundingSphereCart4),r),Matrix3.multiplyByVector(a,r,r)),a=Cartesian3.cross(n,r,scratchflyToBoundingSphereRight),Cartesian3.cross(a,n,r),Cartesian3.normalize(r,r)),this.flyTo({destination:s,orientation:{direction:n,up:r},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 scratchCartesian3_1=new Cartesian3,scratchCartesian3_2=new Cartesian3,scratchCartesian3_3=new Cartesian3,scratchCartesian3_4=new Cartesian3,horizonPoints=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeHorizonQuad(e,t){var i=t.radii,r=e.positionWC,n=Cartesian3.multiplyComponents(t.oneOverRadii,r,scratchCartesian3_1),e=Cartesian3.magnitude(n),t=Cartesian3.normalize(n,scratchCartesian3_2),r=Cartesian3.equalsEpsilon(t,Cartesian3.UNIT_Z,CesiumMath.EPSILON10)?(a=new Cartesian3(0,1,0),new Cartesian3(0,0,1)):(a=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,t,scratchCartesian3_3),scratchCartesian3_3),Cartesian3.normalize(Cartesian3.cross(t,a,scratchCartesian3_4),scratchCartesian3_4)),n=Math.sqrt(Cartesian3.magnitudeSquared(n)-1),t=Cartesian3.multiplyByScalar(t,1/e,scratchCartesian3_1),e=n/e,a=Cartesian3.multiplyByScalar(a,e,scratchCartesian3_2),r=Cartesian3.multiplyByScalar(r,e,scratchCartesian3_3),e=Cartesian3.add(t,r,horizonPoints[0]);Cartesian3.subtract(e,a,e),Cartesian3.multiplyComponents(i,e,e);e=Cartesian3.subtract(t,r,horizonPoints[1]);Cartesian3.subtract(e,a,e),Cartesian3.multiplyComponents(i,e,e);e=Cartesian3.subtract(t,r,horizonPoints[2]);Cartesian3.add(e,a,e),Cartesian3.multiplyComponents(i,e,e);r=Cartesian3.add(t,r,horizonPoints[3]);return Cartesian3.add(r,a,r),Cartesian3.multiplyComponents(i,r,r),horizonPoints}var scratchPickCartesian2=new Cartesian2,scratchRectCartesian=new Cartesian3,cartoArray=[new Cartographic,new Cartographic,new Cartographic,new Cartographic];function addToResult(e,t,i,r,n,a){scratchPickCartesian2.x=e,scratchPickCartesian2.y=t;r=r.pickEllipsoid(scratchPickCartesian2,n,scratchRectCartesian);return defined(r)?(cartoArray[i]=n.cartesianToCartographic(r,cartoArray[i]),1):(cartoArray[i]=n.cartesianToCartographic(a[i],cartoArray[i]),0)}Camera.prototype.computeViewRectangle=function(e,t){e=defaultValue(e,Ellipsoid.WGS84);var i=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),r=new BoundingSphere(Cartesian3.ZERO,e.maximumRadius);if(i.computeVisibility(r)!==Intersect$1.OUTSIDE){var n=this._scene.canvas,a=n.clientWidth,i=n.clientHeight,r=0,n=computeHorizonQuad(this,e);if(r+=addToResult(0,0,0,this,e,n),r+=addToResult(0,i,1,this,e,n),r+=addToResult(a,i,2,this,e,n),(r+=addToResult(a,0,3,this,e,n))<2)return Rectangle.MAX_VALUE;t=Rectangle.fromCartographicArray(cartoArray,t);for(var o=0,s=cartoArray[3].longitude,l=0;l<4;++l){var c=cartoArray[l].longitude,u=Math.abs(c-s);u>CesiumMath.PI?o+=CesiumMath.TWO_PI-u:o+=u,s=c}return CesiumMath.equalsEpsilon(Math.abs(o),CesiumMath.TWO_PI,CesiumMath.EPSILON9)&&(t.west=-CesiumMath.PI,t.east=CesiumMath.PI,0<=cartoArray[0].latitude?t.north=CesiumMath.PI_OVER_TWO:t.south=-CesiumMath.PI_OVER_TWO),t}},Camera.prototype.switchToPerspectiveFrustum=function(){var e;this._mode===SceneMode$1.SCENE2D||this.frustum instanceof PerspectiveFrustum||(e=this._scene,this.frustum=new PerspectiveFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=CesiumMath.toRadians(60))},Camera.prototype.switchToOrthographicFrustum=function(){var e,t;this._mode===SceneMode$1.SCENE2D||this.frustum instanceof OrthographicFrustum||(e=calculateOrthographicFrustumWidth(this),t=this._scene,this.frustum=new OrthographicFrustum,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e)},Camera.clone=function(e,t){return defined(t)||(t=new Camera(e._scene)),Cartesian3.clone(e.position,t.position),Cartesian3.clone(e.direction,t.direction),Cartesian3.clone(e.up,t.up),Cartesian3.clone(e.right,t.right),Matrix4.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var CameraEventType={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},CameraEventType$1=Object.freeze(CameraEventType);function getKey$1(e,t){return defined(t)&&(e+="+"+t),e}function clonePinchMovement(e,t){Cartesian2.clone(e.distance.startPosition,t.distance.startPosition),Cartesian2.clone(e.distance.endPosition,t.distance.endPosition),Cartesian2.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),Cartesian2.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function listenToPinch(t,e,n){var a=getKey$1(CameraEventType$1.PINCH,e),o=t._update,s=t._isDown,i=t._eventStartPosition,r=t._pressTime,l=t._releaseTime;o[a]=!0,s[a]=!1,i[a]=new Cartesian2;var c=t._movement[a];(c=!defined(c)?t._movement[a]={}:c).distance={startPosition:new Cartesian2,endPosition:new Cartesian2},c.angleAndHeight={startPosition:new Cartesian2,endPosition:new Cartesian2},c.prevAngle=0,t._eventHandler.setInputAction(function(e){t._buttonsDown++,s[a]=!0,r[a]=new Date,Cartesian2.lerp(e.position1,e.position2,.5,i[a])},ScreenSpaceEventType$1.PINCH_START,e),t._eventHandler.setInputAction(function(){t._buttonsDown=Math.max(t._buttonsDown-1,0),s[a]=!1,l[a]=new Date},ScreenSpaceEventType$1.PINCH_END,e),t._eventHandler.setInputAction(function(e){if(s[a]){o[a]?(clonePinchMovement(e,c),o[a]=!1,c.prevAngle=c.angleAndHeight.startPosition.x):(Cartesian2.clone(e.distance.endPosition,c.distance.endPosition),Cartesian2.clone(e.angleAndHeight.endPosition,c.angleAndHeight.endPosition));for(var t=c.angleAndHeight.endPosition.x,i=c.prevAngle,r=2*Math.PI;t>=i+Math.PI;)t-=r;for(;t<i-Math.PI;)t+=r;c.angleAndHeight.endPosition.x=-t*n.clientWidth/12,c.angleAndHeight.startPosition.x=-i*n.clientWidth/12}},ScreenSpaceEventType$1.PINCH_MOVE,e)}function listenToWheel(e,t){var i=getKey$1(CameraEventType$1.WHEEL,t),r=e._update;r[i]=!0;var n=e._movement[i];(n=!defined(n)?e._movement[i]={}:n).startPosition=new Cartesian2,n.endPosition=new Cartesian2,e._eventHandler.setInputAction(function(e){e=15*CesiumMath.toRadians(e);r[i]?(Cartesian2.clone(Cartesian2.ZERO,n.startPosition),n.endPosition.x=0,n.endPosition.y=e,r[i]=!1):n.endPosition.y=n.endPosition.y+e},ScreenSpaceEventType$1.WHEEL,t)}function listenMouseButtonDownUp(t,e,i){var r=getKey$1(i,e),n=t._isDown,a=t._eventStartPosition,o=t._pressTime,s=t._releaseTime;n[r]=!1,a[r]=new Cartesian2;var l,c,u=t._lastMovement[r];defined(u)||(u=t._lastMovement[r]={startPosition:new Cartesian2,endPosition:new Cartesian2,valid:!1}),i===CameraEventType$1.LEFT_DRAG?(l=ScreenSpaceEventType$1.LEFT_DOWN,c=ScreenSpaceEventType$1.LEFT_UP):i===CameraEventType$1.RIGHT_DRAG?(l=ScreenSpaceEventType$1.RIGHT_DOWN,c=ScreenSpaceEventType$1.RIGHT_UP):i===CameraEventType$1.MIDDLE_DRAG&&(l=ScreenSpaceEventType$1.MIDDLE_DOWN,c=ScreenSpaceEventType$1.MIDDLE_UP),t._eventHandler.setInputAction(function(e){t._buttonsDown++,u.valid=!1,n[r]=!0,o[r]=new Date,Cartesian2.clone(e.position,a[r])},l,e),t._eventHandler.setInputAction(function(){t._buttonsDown=Math.max(t._buttonsDown-1,0),n[r]=!1,s[r]=new Date},c,e)}function cloneMouseMovement(e,t){Cartesian2.clone(e.startPosition,t.startPosition),Cartesian2.clone(e.endPosition,t.endPosition)}function listenMouseMove(i,r){var e,t,n=i._update,a=i._movement,o=i._lastMovement,s=i._isDown;for(e in CameraEventType$1)!CameraEventType$1.hasOwnProperty(e)||defined(t=CameraEventType$1[e])&&(t=getKey$1(t,r),n[t]=!0,defined(i._lastMovement[t])||(i._lastMovement[t]={startPosition:new Cartesian2,endPosition:new Cartesian2,valid:!1}),defined(i._movement[t])||(i._movement[t]={startPosition:new Cartesian2,endPosition:new Cartesian2}));i._eventHandler.setInputAction(function(e){for(var t in CameraEventType$1)!CameraEventType$1.hasOwnProperty(t)||defined(t=CameraEventType$1[t])&&(t=getKey$1(t,r),s[t]&&(n[t]?(cloneMouseMovement(a[t],o[t]),o[t].valid=!0,cloneMouseMovement(e,a[t]),n[t]=!1):Cartesian2.clone(e.endPosition,a[t].endPosition)));Cartesian2.clone(e.endPosition,i._currentMousePosition)},ScreenSpaceEventType$1.MOUSE_MOVE,r)}function CameraEventAggregator(e){for(var t in this._eventHandler=new ScreenSpaceEventHandler(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new Cartesian2,listenToWheel(this,void 0),listenToPinch(this,void 0,e),listenMouseButtonDownUp(this,void 0,CameraEventType$1.LEFT_DRAG),listenMouseButtonDownUp(this,void 0,CameraEventType$1.RIGHT_DRAG),listenMouseButtonDownUp(this,void 0,CameraEventType$1.MIDDLE_DRAG),listenMouseMove(this,void 0),KeyboardEventModifier$1)!KeyboardEventModifier$1.hasOwnProperty(t)||defined(t=KeyboardEventModifier$1[t])&&(listenToWheel(this,t),listenToPinch(this,t,e),listenMouseButtonDownUp(this,t,CameraEventType$1.LEFT_DRAG),listenMouseButtonDownUp(this,t,CameraEventType$1.RIGHT_DRAG),listenMouseButtonDownUp(this,t,CameraEventType$1.MIDDLE_DRAG),listenMouseMove(this,t))}function Cesium3DTileContent(e,t,i,r,n){this.featurePropertiesDirty=!1}function Cesium3DTilePassState(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}function ConditionsExpression(e,t){this._conditionsExpression=clone$1(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,setRuntime(this,t)}function Statement(e,t){this.condition=e,this.expression=t}function setRuntime(e,t){var i=[],r=e._conditions;if(defined(r)){for(var n=r.length,a=0;a<n;++a){var o=r[a],s=String(o[0]),o=String(o[1]);i.push(new Statement(new Expression(s,t),new Expression(o,t)))}e._runtimeConditions=i}}function Cesium3DTileStyle(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,e="string"==typeof e||e instanceof Resource?Resource.createIfNeeded(e).fetchJson(e):when.resolve(e);var t=this;this._readyPromise=e.then(function(e){return setup(t,e),t})}function setup(e,t){t=defaultValue(clone$1(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;var i={};if(defined(t.meta)){var r,n=t.defines,a=defaultValue(t.meta,defaultValue.EMPTY_OBJECT);for(r in a)a.hasOwnProperty(r)&&(i[r]=new Expression(a[r],n))}e._meta=i,e._ready=!0}function getExpression(e,t){e=defaultValue(e._style,defaultValue.EMPTY_OBJECT).defines;if(defined(t))return"boolean"==typeof t||"number"==typeof t?new Expression(String(t)):"string"==typeof t?new Expression(t,e):defined(t.conditions)?new ConditionsExpression(t,e):t}function getJsonFromExpression(e){if(defined(e))return defined(e.expression)?e.expression:defined(e.conditionsExpression)?clone$1(e.conditionsExpression,!0):e}function CircleEmitter(e){e=defaultValue(e,1),this._radius=defaultValue(e,1)}function computeFlyToLocationForRectangle(t,i){var r=i.terrainProvider,e=i.mapProjection,n=e.ellipsoid,a=i.camera.getRectangleCameraCoordinates(t),o=i.mode===SceneMode$1.SCENE3D?n.cartesianToCartographic(a):e.unproject(a);return defined(r)?r.readyPromise.then(function(){if(!defined(r.availability)||i.mode===SceneMode$1.SCENE2D)return o;var e=[Rectangle.center(t),Rectangle.southeast(t),Rectangle.southwest(t),Rectangle.northeast(t),Rectangle.northwest(t)];return computeFlyToLocationForRectangle._sampleTerrainMostDetailed(r,e).then(function(e){var t=e.reduce(function(e,t){return Math.max(t.height,e)},-Number.MAX_VALUE),e=o;return e.height+=t,e})}):when.resolve(o)}Object.defineProperties(CameraEventAggregator.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[getKey$1(CameraEventType$1.WHEEL)]&&this._update[getKey$1(CameraEventType$1.WHEEL,KeyboardEventModifier$1.SHIFT)]&&this._update[getKey$1(CameraEventType$1.WHEEL,KeyboardEventModifier$1.CTRL)]&&this._update[getKey$1(CameraEventType$1.WHEEL,KeyboardEventModifier$1.ALT)]);return 0<this._buttonsDown||e}}}),CameraEventAggregator.prototype.isMoving=function(e,t){t=getKey$1(e,t);return!this._update[t]},CameraEventAggregator.prototype.getMovement=function(e,t){t=getKey$1(e,t);return this._movement[t]},CameraEventAggregator.prototype.getLastMovement=function(e,t){t=getKey$1(e,t),t=this._lastMovement[t];if(t.valid)return t},CameraEventAggregator.prototype.isButtonDown=function(e,t){t=getKey$1(e,t);return this._isDown[t]},CameraEventAggregator.prototype.getStartMousePosition=function(e,t){if(e===CameraEventType$1.WHEEL)return this._currentMousePosition;t=getKey$1(e,t);return this._eventStartPosition[t]},CameraEventAggregator.prototype.getButtonPressTime=function(e,t){t=getKey$1(e,t);return this._pressTime[t]},CameraEventAggregator.prototype.getButtonReleaseTime=function(e,t){t=getKey$1(e,t);return this._releaseTime[t]},CameraEventAggregator.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},CameraEventAggregator.prototype.isDestroyed=function(){return!1},CameraEventAggregator.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),destroyObject(this)},Object.defineProperties(Cesium3DTileContent.prototype,{featuresLength:{get:function(){DeveloperError.throwInstantiationError()}},pointsLength:{get:function(){DeveloperError.throwInstantiationError()}},trianglesLength:{get:function(){DeveloperError.throwInstantiationError()}},geometryByteLength:{get:function(){DeveloperError.throwInstantiationError()}},texturesByteLength:{get:function(){DeveloperError.throwInstantiationError()}},batchTableByteLength:{get:function(){DeveloperError.throwInstantiationError()}},innerContents:{get:function(){DeveloperError.throwInstantiationError()}},readyPromise:{get:function(){DeveloperError.throwInstantiationError()}},tileset:{get:function(){DeveloperError.throwInstantiationError()}},tile:{get:function(){DeveloperError.throwInstantiationError()}},url:{get:function(){DeveloperError.throwInstantiationError()}},batchTable:{get:function(){DeveloperError.throwInstantiationError()}}}),Cesium3DTileContent.prototype.hasProperty=function(e,t){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.getFeature=function(e){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.applyDebugSettings=function(e,t){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.applyStyle=function(e){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.update=function(e,t){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.isDestroyed=function(){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.destroy=function(){DeveloperError.throwInstantiationError()},Object.defineProperties(ConditionsExpression.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}}),ConditionsExpression.prototype.evaluate=function(e,t){var i=this._runtimeConditions;if(defined(i))for(var r=i.length,n=0;n<r;++n){var a=i[n];if(a.condition.evaluate(e))return a.expression.evaluate(e,t)}},ConditionsExpression.prototype.evaluateColor=function(e,t){var i=this._runtimeConditions;if(defined(i))for(var r=i.length,n=0;n<r;++n){var a=i[n];if(a.condition.evaluate(e))return a.expression.evaluateColor(e,t)}},ConditionsExpression.prototype.getShaderFunction=function(e,t,i,r){var n=this._runtimeConditions;if(defined(n)&&0!==n.length){for(var a="",o=n.length,s=0;s<o;++s){var l=n[s];a+=" "+(0===s?"if":"else if")+" ("+l.condition.getShaderExpression(t,i)+") \n { \n return "+l.expression.getShaderExpression(t,i)+"; \n } \n"}return a=r+" "+e+"() \n{ \n"+a+" return "+r+"(1.0); \n} \n"}},Object.defineProperties(Cesium3DTileStyle.prototype,{style:{get:function(){return this._style}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},show:{get:function(){return this._show},set:function(e){this._show=getExpression(this,e),this._style.show=getJsonFromExpression(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=getExpression(this,e),this._style.color=getJsonFromExpression(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=getExpression(this,e),this._style.pointSize=getJsonFromExpression(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=getExpression(this,e),this._style.pointOutlineColor=getJsonFromExpression(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=getExpression(this,e),this._style.pointOutlineWidth=getJsonFromExpression(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=getExpression(this,e),this._style.labelColor=getJsonFromExpression(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=getExpression(this,e),this._style.labelOutlineColor=getJsonFromExpression(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=getExpression(this,e),this._style.labelOutlineWidth=getJsonFromExpression(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=getExpression(this,e),this._style.font=getJsonFromExpression(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=getExpression(this,e),this._style.labelStyle=getJsonFromExpression(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=getExpression(this,e),this._style.labelText=getJsonFromExpression(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=getExpression(this,e),this._style.backgroundColor=getJsonFromExpression(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=getExpression(this,e),this._style.backgroundPadding=getJsonFromExpression(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=getExpression(this,e),this._style.backgroundEnabled=getJsonFromExpression(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=getExpression(this,e),this._style.scaleByDistance=getJsonFromExpression(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=getExpression(this,e),this._style.translucencyByDistance=getJsonFromExpression(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=getExpression(this,e),this._style.distanceDisplayCondition=getJsonFromExpression(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=getExpression(this,e),this._style.heightOffset=getJsonFromExpression(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=getExpression(this,e),this._style.anchorLineEnabled=getJsonFromExpression(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=getExpression(this,e),this._style.anchorLineColor=getJsonFromExpression(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=getExpression(this,e),this._style.image=getJsonFromExpression(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=getExpression(this,e),this._style.disableDepthTestDistance=getJsonFromExpression(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=getExpression(this,e),this._style.horizontalOrigin=getJsonFromExpression(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=getExpression(this,e),this._style.verticalOrigin=getJsonFromExpression(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=getExpression(this,e),this._style.labelHorizontalOrigin=getJsonFromExpression(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=getExpression(this,e),this._style.labelVerticalOrigin=getJsonFromExpression(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}}),Cesium3DTileStyle.prototype.getColorShaderFunction=function(e,t,i){return this._colorShaderFunctionReady?i.translucent=this._colorShaderTranslucent:(this._colorShaderFunctionReady=!0,this._colorShaderFunction=defined(this.color)?this.color.getShaderFunction(e,t,i,"vec4"):void 0,this._colorShaderTranslucent=i.translucent),this._colorShaderFunction},Cesium3DTileStyle.prototype.getShowShaderFunction=function(e,t,i){return this._showShaderFunctionReady||(this._showShaderFunctionReady=!0,this._showShaderFunction=defined(this.show)?this.show.getShaderFunction(e,t,i,"bool"):void 0),this._showShaderFunction},Cesium3DTileStyle.prototype.getPointSizeShaderFunction=function(e,t,i){return this._pointSizeShaderFunctionReady||(this._pointSizeShaderFunctionReady=!0,this._pointSizeShaderFunction=defined(this.pointSize)?this.pointSize.getShaderFunction(e,t,i,"float"):void 0),this._pointSizeShaderFunction},Object.defineProperties(CircleEmitter.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),CircleEmitter.prototype.emit=function(e){var t=CesiumMath.randomBetween(0,CesiumMath.TWO_PI),i=CesiumMath.randomBetween(0,this._radius),r=i*Math.cos(t),t=i*Math.sin(t);e.position=Cartesian3.fromElements(r,t,0,e.position),e.velocity=Cartesian3.clone(Cartesian3.UNIT_Z,e.velocity)},computeFlyToLocationForRectangle._sampleTerrainMostDetailed=sampleTerrainMostDetailed;var defaultAngle=CesiumMath.toRadians(30);function ConeEmitter(e){this._angle=defaultValue(e,defaultAngle)}Object.defineProperties(ConeEmitter.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}}),ConeEmitter.prototype.emit=function(e){var t=Math.tan(this._angle),i=CesiumMath.randomBetween(0,CesiumMath.TWO_PI),r=CesiumMath.randomBetween(0,t),t=r*Math.cos(i),i=r*Math.sin(i);e.velocity=Cartesian3.fromElements(t,i,1,e.velocity),Cartesian3.normalize(e.velocity,e.velocity),e.position=Cartesian3.clone(Cartesian3.ZERO,e.position)};var scratchColor$2=new Color,scratchColorAbove=new Color,scratchColorBelow=new Color,scratchColorBlend=new Color,scratchPackedFloat=new Cartesian4,scratchColorBytes=new Uint8Array(4);function lerpEntryColor(e,t,i,r){e=t.height===i.height?0:(e-t.height)/(i.height-t.height);return Color.lerp(t.color,i.color,e,r)}function createNewEntry(e,t){return{height:e,color:Color.clone(t)}}function removeDuplicates(e){return e=(e=(e=e.filter(function(e,t,i){var r=t<i.length-1,n=!(0<t)||e.height===i[t-1].height,t=!r||e.height===i[t+1].height;return!n||!t})).filter(function(e,t,i){var r=t<i.length-1,n=0<t&&Color.equals(e.color,i[t-1].color),t=r&&Color.equals(e.color,i[t+1].color);return!n||!t})).filter(function(e,t,i){var r=0<t,n=r&&Color.equals(e.color,i[t-1].color),t=!r||e.height===i[t-1].height;return!n||!t})}function preprocess(e){for(var t=[],i=e.length,r=0;r<i;r++){for(var n=e[r],a=n.entries,o=a.length,s=[],l=0;l<o;l++){var c=a[l],u=CesiumMath.clamp(c.height,createElevationBandMaterial._minimumHeight,createElevationBandMaterial._maximumHeight),c=Color.clone(c.color,scratchColor$2);c.red*=c.alpha,c.green*=c.alpha,c.blue*=c.alpha,s.push(createNewEntry(u,c))}var d=!0,h=!0;for(l=0;l<o-1;l++)var p=s[l+0],m=s[l+1],d=d&&p.height<=m.height,h=h&&p.height>=m.height;h?s=s.reverse():d||mergeSort(s,function(e,t){return CesiumMath.sign(e.height-t.height)});var f=defaultValue(n.extendDownwards,!1),n=defaultValue(n.extendUpwards,!1);1!==s.length||f||n||(n=f=!0),f&&s.splice(0,0,createNewEntry(createElevationBandMaterial._minimumHeight,s[0].color)),n&&s.splice(s.length,0,createNewEntry(createElevationBandMaterial._maximumHeight,s[s.length-1].color)),s=removeDuplicates(s),t.push(s)}return t}function createLayeredEntries(e){var t=preprocess(e),i=[];function r(e,t){i.push(createNewEntry(e,t))}function n(e,t,i){i=Color.multiplyByScalar(i,1-t.alpha,scratchColorBlend);r(e,i=Color.add(i,t,i))}for(var a=t.length,o=0;o<a;o++)for(var s=t[o],l=0,c=0,u=i,i=[],d=s.length,h=u.length;l<d||c<h;){var p,m,f,g,_,y,C,v=l<d?s[l]:void 0,S=0<l?s[l-1]:void 0,T=l<d-1?s[l+1]:void 0,x=c<h?u[c]:void 0,b=0<c?u[c-1]:void 0,E=c<h-1?u[c+1]:void 0;defined(v)&&defined(x)&&v.height===x.height?(p=defined(E)&&x.height===E.height,m=!defined(b),f=!defined(E),g=defined(T)&&v.height===T.height,_=!defined(S),y=!defined(T),p?g?(n(v.height,v.color,x.color),n(v.height,T.color,E.color)):_?(r(v.height,x.color),n(v.height,v.color,E.color)):y?(n(v.height,v.color,x.color),r(v.height,E.color)):(n(v.height,v.color,x.color),n(v.height,v.color,E.color)):m?g?(r(v.height,v.color),n(v.height,T.color,x.color)):y?(r(v.height,v.color),r(v.height,x.color)):(_||r(v.height,v.color),n(v.height,v.color,x.color)):f?g?(n(v.height,v.color,x.color),r(v.height,T.color)):_?(r(v.height,x.color),r(v.height,v.color)):y?n(v.height,v.color,x.color):(n(v.height,v.color,x.color),r(v.height,v.color)):g?(n(v.height,v.color,x.color),n(v.height,T.color,x.color)):_?(r(v.height,x.color),n(v.height,v.color,x.color)):y?(n(v.height,v.color,x.color),r(v.height,x.color)):n(v.height,v.color,x.color),l+=g?2:1,c+=p?2:1):defined(v)&&defined(x)&&defined(b)&&v.height<x.height?(C=lerpEntryColor(v.height,b,x,scratchColorBelow),defined(S)?defined(T)?n(v.height,v.color,C):(n(v.height,v.color,C),r(v.height,C)):(r(v.height,C),n(v.height,v.color,C)),l++):defined(x)&&defined(v)&&defined(S)&&x.height<v.height?(C=lerpEntryColor(x.height,S,v,scratchColorAbove),defined(b)?defined(E)?n(x.height,C,x.color):(n(x.height,C,x.color),r(x.height,C)):(r(x.height,C),n(x.height,C,x.color)),c++):defined(v)&&(!defined(x)||v.height<x.height)?(!defined(x)||defined(b)||defined(T)?(defined(x)||!defined(b)||defined(S)||(r(b.height,createElevationBandMaterial._emptyColor),r(v.height,createElevationBandMaterial._emptyColor)),r(v.height,v.color)):(r(v.height,v.color),r(v.height,createElevationBandMaterial._emptyColor),r(x.height,createElevationBandMaterial._emptyColor)),l++):defined(x)&&(!defined(v)||x.height<v.height)&&(r(x.height,x.color),c++)}return removeDuplicates(i)}function createElevationBandMaterial(e){var t,i,r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).scene,n=createLayeredEntries(e.layers),a=n.length;if(!createElevationBandMaterial._useFloatTexture(r.context))for(o=PixelDatatype$1.UNSIGNED_BYTE,i=PixelFormat$1.RGBA,t=new Uint8Array(4*a),l=0;l<a;l++)Cartesian4.packFloat(n[l].height,scratchPackedFloat),Cartesian4.pack(scratchPackedFloat,t,4*l);else for(o=PixelDatatype$1.FLOAT,i=PixelFormat$1.LUMINANCE,t=new Float32Array(a),l=0;l<a;l++)t[l]=n[l].height;for(var o=Texture.create({context:r.context,pixelFormat:i,pixelDatatype:o,source:{arrayBufferView:t,width:a,height:1},sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.NEAREST,magnificationFilter:TextureMagnificationFilter$1.NEAREST})}),s=new Uint8Array(4*a),l=0;l<a;l++)n[l].color.toBytes(scratchColorBytes),s[4*l+0]=scratchColorBytes[0],s[4*l+1]=scratchColorBytes[1],s[4*l+2]=scratchColorBytes[2],s[4*l+3]=scratchColorBytes[3];r=Texture.create({context:r.context,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:s,width:a,height:1},sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})});return Material.fromType("ElevationBand",{heights:o,colors:r})}function createOsmBuildings(e){var t=new Cesium3DTileset(e=combine$2(e,{url:IonResource.fromAssetId(96188)})),i=e.style;return defined(i)||(i=new Cesium3DTileStyle({color:"Boolean(${feature['cesium#color']}) ? color(${feature['cesium#color']}) : "+defaultValue(e.defaultColor,Color.WHITE).toCssColorString()})),t.style=i,t}function createTangentSpaceDebugPrimitive(e){var t=[],i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).geometry,r=(i=!defined(i.attributes)||!defined(i.primitiveType)?i.constructor.createGeometry(i):i).attributes,n=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),e=defaultValue(e.length,1e4);if(defined(r.normal)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"normal",e),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)},modelMatrix:n})),defined(r.tangent)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"tangent",e),attributes:{color:new ColorGeometryInstanceAttribute(0,1,0,1)},modelMatrix:n})),defined(r.bitangent)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"bitangent",e),attributes:{color:new ColorGeometryInstanceAttribute(0,0,1,1)},modelMatrix:n})),0<t.length)return new Primitive({asynchronous:!1,geometryInstances:t,appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1})})}createElevationBandMaterial._useFloatTexture=function(e){return e.floatingPointTexture},createElevationBandMaterial._maximumHeight=5906376425472,createElevationBandMaterial._minimumHeight=-5906376425472,createElevationBandMaterial._emptyColor=new Color(0,0,0,0);var templateRegex=/{[^}]+}/g,tags={x:xTag,y:yTag,z:zTag,s:sTag,reverseX:reverseXTag,reverseY:reverseYTag,reverseZ:reverseZTag,westDegrees:westDegreesTag,southDegrees:southDegreesTag,eastDegrees:eastDegreesTag,northDegrees:northDegreesTag,westProjected:westProjectedTag,southProjected:southProjectedTag,eastProjected:eastProjectedTag,northProjected:northProjectedTag,width:widthTag,height:heightTag},pickFeaturesTags=combine$2(tags,{i:iTag,j:jTag,reverseI:reverseITag,reverseJ:reverseJTag,longitudeDegrees:longitudeDegreesTag,latitudeDegrees:latitudeDegreesTag,longitudeProjected:longitudeProjectedTag,latitudeProjected:latitudeProjectedTag,format:formatTag});function UrlTemplateImageryProvider(e){this._errorEvent=new Event,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._tags=void 0,this._pickFeaturesTags=void 0,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=!0,this.reinitialize(e)}Object.defineProperties(UrlTemplateImageryProvider.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}},ready:{get:function(){return defined(this._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),UrlTemplateImageryProvider.prototype.reinitialize=function(e){var a=this;a._readyPromise=when(e).then(function(e){var t=e.customTags,i=combine$2(tags,t),r=combine$2(pickFeaturesTags,t),n=Resource.createIfNeeded(e.url),t=Resource.createIfNeeded(e.pickFeaturesUrl);a.enablePickFeatures=defaultValue(e.enablePickFeatures,a.enablePickFeatures),a._urlSchemeZeroPadding=defaultValue(e.urlSchemeZeroPadding,a.urlSchemeZeroPadding),a._tileDiscardPolicy=e.tileDiscardPolicy,a._getFeatureInfoFormats=e.getFeatureInfoFormats,a._subdomains=e.subdomains,Array.isArray(a._subdomains)?a._subdomains=a._subdomains.slice():defined(a._subdomains)&&0<a._subdomains.length?a._subdomains=a._subdomains.split(""):a._subdomains=["a","b","c"],a._tileWidth=defaultValue(e.tileWidth,256),a._tileHeight=defaultValue(e.tileHeight,256),a._minimumLevel=defaultValue(e.minimumLevel,0),a._maximumLevel=e.maximumLevel,a._tilingScheme=defaultValue(e.tilingScheme,new WebMercatorTilingScheme({ellipsoid:e.ellipsoid})),a._rectangle=defaultValue(e.rectangle,a._tilingScheme.rectangle),a._rectangle=Rectangle.intersection(a._rectangle,a._tilingScheme.rectangle),a._hasAlphaChannel=defaultValue(e.hasAlphaChannel,!0);e=e.credit;return"string"==typeof e&&(e=new Credit(e)),a._credit=e,a._resource=n,a._tags=i,a._pickFeaturesResource=t,a._pickFeaturesTags=r,!0})},UrlTemplateImageryProvider.prototype.getTileCredits=function(e,t,i){},UrlTemplateImageryProvider.prototype.requestImage=function(e,t,i,r){return ImageryProvider.loadImage(this,buildImageResource$1(this,e,t,i,r))},UrlTemplateImageryProvider.prototype.pickFeatures=function(r,n,a,o,s){if(this.enablePickFeatures&&defined(this._pickFeaturesResource)&&0!==this._getFeatureInfoFormats.length){var l=0,c=this;return function e(){if(l>=c._getFeatureInfoFormats.length)return when([]);var t=c._getFeatureInfoFormats[l],i=buildPickFeaturesResource(c,r,n,a,o,s,t.format);return++l,("json"===t.type?i.fetchJson().then(t.callback):"xml"===t.type?i.fetchXML().then(t.callback):"text"===t.type||"html"===t.type?i.fetchText().then(t.callback):i.fetch({responseType:t.format}).then(function(e,t){return e.callback(t)}.bind(void 0,t))).otherwise(e)}()}};var degreesScratchComputed=!1,degreesScratch=new Rectangle,projectedScratchComputed=!1,projectedScratch=new Rectangle;function buildImageResource$1(t,i,r,n,e){projectedScratchComputed=degreesScratchComputed=!1;var a=t._resource,o=a.getUrlComponent(!0),s=t._tags,l={},o=o.match(templateRegex);return defined(o)&&o.forEach(function(e){e=e.substring(1,e.length-1);defined(s[e])&&(l[e]=s[e](t,i,r,n))}),a.getDerivedResource({request:e,templateValues:l})}var ijScratchComputed=!1,ijScratch=new Cartesian2,longitudeLatitudeProjectedScratchComputed=!1;function buildPickFeaturesResource(t,i,r,n,a,o,s){longitudeLatitudeProjectedScratchComputed=ijScratchComputed=projectedScratchComputed=degreesScratchComputed=!1;var e=t._pickFeaturesResource,l=e.getUrlComponent(!0),c=t._pickFeaturesTags,u={},l=l.match(templateRegex);return defined(l)&&l.forEach(function(e){e=e.substring(1,e.length-1);defined(c[e])&&(u[e]=c[e](t,i,r,n,a,o,s))}),e.getDerivedResource({templateValues:u})}function padWithZerosIfNecessary(e,t,i){return e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)&&("string"!=typeof(t=e.urlSchemeZeroPadding[t])||1<(t=t.length)&&(i=i.length>=t?i:new Array(t-i.toString().length+1).join("0")+i)),i}function xTag(e,t,i,r){return padWithZerosIfNecessary(e,"{x}",t)}function reverseXTag(e,t,i,r){t=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return padWithZerosIfNecessary(e,"{reverseX}",t)}function yTag(e,t,i,r){return padWithZerosIfNecessary(e,"{y}",i)}function reverseYTag(e,t,i,r){i=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return padWithZerosIfNecessary(e,"{reverseY}",i)}function reverseZTag(e,t,i,r){var n=e.maximumLevel;return padWithZerosIfNecessary(e,"{reverseZ}",defined(n)&&r<n?n-r-1:r)}function zTag(e,t,i,r){return padWithZerosIfNecessary(e,"{z}",r)}function sTag(e,t,i,r){r=(t+i+r)%e._subdomains.length;return e._subdomains[r]}function computeDegrees(e,t,i,r){degreesScratchComputed||(e.tilingScheme.tileXYToRectangle(t,i,r,degreesScratch),degreesScratch.west=CesiumMath.toDegrees(degreesScratch.west),degreesScratch.south=CesiumMath.toDegrees(degreesScratch.south),degreesScratch.east=CesiumMath.toDegrees(degreesScratch.east),degreesScratch.north=CesiumMath.toDegrees(degreesScratch.north),degreesScratchComputed=!0)}function westDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.west}function southDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.south}function eastDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.east}function northDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.north}function computeProjected(e,t,i,r){projectedScratchComputed||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,projectedScratch),projectedScratchComputed=!0)}function westProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.west}function southProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.south}function eastProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.east}function northProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.north}function widthTag(e,t,i,r){return e.tileWidth}function heightTag(e,t,i,r){return e.tileHeight}function iTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),ijScratch.x}function jTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),ijScratch.y}function reverseITag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),e.tileWidth-ijScratch.x-1}function reverseJTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),e.tileHeight-ijScratch.y-1}var rectangleScratch=new Rectangle,longitudeLatitudeProjectedScratch=new Cartesian3;function computeIJ(e,t,i,r,n,a,o){ijScratchComputed||(computeLongitudeLatitudeProjected(e,t,i,r,n,a),a=longitudeLatitudeProjectedScratch,r=e.tilingScheme.tileXYToNativeRectangle(t,i,r,rectangleScratch),ijScratch.x=e.tileWidth*(a.x-r.west)/r.width|0,ijScratch.y=e.tileHeight*(r.north-a.y)/r.height|0,ijScratchComputed=!0)}function longitudeDegreesTag(e,t,i,r,n,a,o){return CesiumMath.toDegrees(n)}function latitudeDegreesTag(e,t,i,r,n,a,o){return CesiumMath.toDegrees(a)}function longitudeProjectedTag(e,t,i,r,n,a,o){return computeLongitudeLatitudeProjected(e,t,i,r,n,a),longitudeLatitudeProjectedScratch.x}function latitudeProjectedTag(e,t,i,r,n,a,o){return computeLongitudeLatitudeProjected(e,t,i,r,n,a),longitudeLatitudeProjectedScratch.y}var cartographicScratch$1=new Cartographic;function computeLongitudeLatitudeProjected(e,t,i,r,n,a,o){var s;longitudeLatitudeProjectedScratchComputed||(e.tilingScheme.projection instanceof GeographicProjection?(longitudeLatitudeProjectedScratch.x=CesiumMath.toDegrees(n),longitudeLatitudeProjectedScratch.y=CesiumMath.toDegrees(a)):((s=cartographicScratch$1).longitude=n,s.latitude=a,e.tilingScheme.projection.project(s,longitudeLatitudeProjectedScratch)),longitudeLatitudeProjectedScratchComputed=!0)}function formatTag(e,t,i,r,n,a,o){return o}function TileMapServiceImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t,i=when.defer();UrlTemplateImageryProvider.call(this,i.promise),this._tmsResource=void 0,this._xmlResource=void 0,this._options=e,this._deferred=i,this._metadataError=void 0,this._metadataSuccess=this._metadataSuccess.bind(this),this._metadataFailure=this._metadataFailure.bind(this),this._requestMetadata=this._requestMetadata.bind(this);var r=this;when(e.url).then(function(e){(t=Resource.createIfNeeded(e)).appendForwardSlash(),r._tmsResource=t,r._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),r._requestMetadata()}).otherwise(function(e){i.reject(e)})}function confineRectangleToTilingScheme(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 calculateSafeMinimumDetailLevel(e,t,i){var r=e.positionToTileXY(Rectangle.southwest(t),i),t=e.positionToTileXY(Rectangle.northeast(t),i);return 4<(Math.abs(t.x-r.x)+1)*(Math.abs(t.y-r.y)+1)?0:i}function GoogleEarthEnterpriseMapsProvider(a){a=defaultValue(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=1.9,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var e=a.url,t=defaultValue(a.path,"/default_map"),i=Resource.createIfNeeded(e).getDerivedResource({url:"/"===t[0]?t.substring(1):t});i.appendForwardSlash(),this._resource=i,this._url=e,this._path=t,this._tileDiscardPolicy=a.tileDiscardPolicy,this._channel=a.channel,this._requestType="ImageryMaps",this._credit=new Credit('<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="'+GoogleEarthEnterpriseMapsProvider.logoUrl+'" title="Google Imagery"/></a>'),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=a.maximumLevel,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var o,r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=this;function n(t){var i,e;try{i=JSON.parse(t)}catch(e){i=JSON.parse(t.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var r,n=0;n<i.layers.length;n++)if(i.layers[n].id===s._channel){e=i.layers[n];break}if(!defined(e))throw r="Could not find layer with channel (id) of "+s._channel+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);if(!defined(e.version))throw r="Could not find a version in channel (id) "+s._channel+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);if(s._version=e.version,defined(i.projection)&&"flat"===i.projection)s._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:a.ellipsoid});else{if(defined(i.projection)&&"mercator"!==i.projection)throw r="Unsupported projection "+i.projection+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);s._tilingScheme=new WebMercatorTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:a.ellipsoid})}s._ready=!0,s._readyPromise.resolve(!0),TileProviderError.handleSuccess(o)}function l(e){var t="An error occurred while accessing "+r.url+".";o=TileProviderError.handleError(o,s,s._errorEvent,t,void 0,void 0,void 0,c),s._readyPromise.reject(new RuntimeError(t))}function c(){when(r.fetchText(),n,l)}c()}defined(Object.create)&&(TileMapServiceImageryProvider.prototype=Object.create(UrlTemplateImageryProvider.prototype),TileMapServiceImageryProvider.prototype.constructor=TileMapServiceImageryProvider),TileMapServiceImageryProvider.prototype._requestMetadata=function(){this._xmlResource.fetchXML().then(this._metadataSuccess).otherwise(this._metadataFailure)},TileMapServiceImageryProvider.prototype._metadataSuccess=function(e){for(var t,i,r=/tileformat/i,n=/tileset/i,a=/tilesets/i,o=/boundingbox/i,s=[],l=this._xmlResource,c=this._metadataError,u=this._deferred,d=this._requestMetadata,h=e.childNodes[0].childNodes,p=0;p<h.length;p++)if(r.test(h.item(p).nodeName))t=h.item(p);else if(a.test(h.item(p).nodeName))for(var m=h.item(p),f=h.item(p).childNodes,g=0;g<f.length;g++)n.test(f.item(g).nodeName)&&s.push(f.item(g));else o.test(h.item(p).nodeName)&&(i=h.item(p));if(!defined(m)||!defined(i))return P="Unable to find expected tilesets or bbox attributes in "+l.url+".",(c=TileProviderError.handleError(c,this,this.errorEvent,P,void 0,void 0,void 0,d)).retry||u.reject(new RuntimeError(P)),void(this._metadataError=c);var _=this._options,y=defaultValue(_.fileExtension,t.getAttribute("extension")),C=defaultValue(_.tileWidth,parseInt(t.getAttribute("width"),10)),v=defaultValue(_.tileHeight,parseInt(t.getAttribute("height"),10)),S=defaultValue(_.minimumLevel,parseInt(s[0].getAttribute("order"),10)),T=defaultValue(_.maximumLevel,parseInt(s[s.length-1].getAttribute("order"),10)),x=m.getAttribute("profile"),e=_.tilingScheme;if(!defined(e))if("geodetic"===x||"global-geodetic"===x)e=new GeographicTilingScheme({ellipsoid:_.ellipsoid});else{if("mercator"!==x&&"global-mercator"!==x)return P=l.url+"specifies an unsupported profile attribute, "+x+".",(c=TileProviderError.handleError(c,this,this.errorEvent,P,void 0,void 0,void 0,d)).retry||u.reject(new RuntimeError(P)),void(this._metadataError=c);e=new WebMercatorTilingScheme({ellipsoid:_.ellipsoid})}var b,E,P=Rectangle.clone(_.rectangle);defined(P)||(c=defaultValue(_.flipXY,!1)?(b=new Cartesian2(parseFloat(i.getAttribute("miny")),parseFloat(i.getAttribute("minx"))),new Cartesian2(parseFloat(i.getAttribute("maxy")),parseFloat(i.getAttribute("maxx")))):(b=new Cartesian2(parseFloat(i.getAttribute("minx")),parseFloat(i.getAttribute("miny"))),new Cartesian2(parseFloat(i.getAttribute("maxx")),parseFloat(i.getAttribute("maxy")))),c=e.projection instanceof GeographicProjection||("geodetic"===x||"mercator"===x)?(E=Cartographic.fromDegrees(b.x,b.y),Cartographic.fromDegrees(c.x,c.y)):(E=(x=e.projection).unproject(b),x.unproject(c)),P=new Rectangle(E.longitude,E.latitude,c.longitude,c.latitude));S=calculateSafeMinimumDetailLevel(e,P=confineRectangleToTilingScheme(P,e),S),y=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+y});u.resolve({url:y,tilingScheme:e,rectangle:P,tileWidth:C,tileHeight:v,minimumLevel:S,maximumLevel:T,tileDiscardPolicy:_.tileDiscardPolicy,credit:_.credit})},TileMapServiceImageryProvider.prototype._metadataFailure=function(e){var t=this._options,i=defaultValue(t.fileExtension,"png"),r=defaultValue(t.tileWidth,256),n=defaultValue(t.tileHeight,256),a=t.maximumLevel,o=defined(t.tilingScheme)?t.tilingScheme:new WebMercatorTilingScheme({ellipsoid:t.ellipsoid}),s=defaultValue(t.rectangle,o.rectangle),l=calculateSafeMinimumDetailLevel(o,s=confineRectangleToTilingScheme(s,o),t.maximumLevel),i=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+i});this._deferred.resolve({url:i,tilingScheme:o,rectangle:s,tileWidth:r,tileHeight:n,minimumLevel:l,maximumLevel:a,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit})},Object.defineProperties(GoogleEarthEnterpriseMapsProvider.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),GoogleEarthEnterpriseMapsProvider.prototype.getTileCredits=function(e,t,i){},GoogleEarthEnterpriseMapsProvider.prototype.requestImage=function(e,t,i,r){i=this._resource.getDerivedResource({url:"query",request:r,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:i+1}});return ImageryProvider.loadImage(this,i)},GoogleEarthEnterpriseMapsProvider.prototype.pickFeatures=function(e,t,i,r,n){},GoogleEarthEnterpriseMapsProvider._logoUrl=void 0,Object.defineProperties(GoogleEarthEnterpriseMapsProvider,{logoUrl:{get:function(){return defined(GoogleEarthEnterpriseMapsProvider._logoUrl)||(GoogleEarthEnterpriseMapsProvider._logoUrl=buildModuleUrl("Assets/Images/google_earth_credit.png")),GoogleEarthEnterpriseMapsProvider._logoUrl},set:function(e){GoogleEarthEnterpriseMapsProvider._logoUrl=e}}});var trailingSlashRegex$1=/\/$/,defaultCredit$3=new Credit('© <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 MapboxImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).mapId,i=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;var r=Resource.createIfNeeded(defaultValue(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=i;var n=defaultValue(e.format,"png");/\./.test(n)||(n="."+n),this._format=n;var a,n=r.getUrlComponent();trailingSlashRegex$1.test(n)||(n+="/"),n+=t+"/{z}/{x}/{y}"+this._format,r.url=n,r.setQueryParameters({access_token:i}),defined(e.credit)?"string"==typeof(a=e.credit)&&(a=new Credit(a)):a=defaultCredit$3,this._resource=r,this._imageryProvider=new UrlTemplateImageryProvider({url:r,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function SingleTileImageryProvider(e){e=defaultValue(e,defaultValue.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;var i=Resource.createIfNeeded(e.url),t=new GeographicTilingScheme({rectangle:defaultValue(e.rectangle,Rectangle.MAX_VALUE),numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=t,this._resource=i,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();e=e.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e;var r,n=this;function a(e){n._image=e,n._tileWidth=e.width,n._tileHeight=e.height,n._ready=!0,n._readyPromise.resolve(!0),TileProviderError.handleSuccess(n._errorEvent)}function o(e){var t="Failed to load image "+i.url+".";r=TileProviderError.handleError(r,n,n._errorEvent,t,0,0,0,s,e),n._readyPromise.reject(new RuntimeError(t))}function s(){ImageryProvider.loadImage(null,i).then(a).otherwise(o)}s()}function GetFeatureInfoFormat(e,t,i){this.type=e,defined(t)||("json"===e?t="application/json":"xml"===e?t="text/xml":"html"===e?t="text/html":"text"===e&&(t="text/plain")),this.format=t,defined(i)||("json"===e?i=geoJsonToFeatureInfo:"xml"===e?i=xmlToFeatureInfo:"html"!==e&&"text"!==e||(i=textToFeatureInfo)),this.callback=i}function geoJsonToFeatureInfo(e){for(var t=[],i=e.features,r=0;r<i.length;++r){var n,a=i[r],o=new ImageryLayerFeatureInfo;o.data=a,o.properties=a.properties,o.configureNameFromProperties(a.properties),o.configureDescriptionFromProperties(a.properties),defined(a.geometry)&&"Point"===a.geometry.type&&(n=a.geometry.coordinates[0],a=a.geometry.coordinates[1],o.position=Cartographic.fromDegrees(n,a)),t.push(o)}return t}Object.defineProperties(MapboxImageryProvider.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},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}}}),MapboxImageryProvider.prototype.getTileCredits=function(e,t,i){},MapboxImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},MapboxImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},MapboxImageryProvider._defaultCredit=defaultCredit$3,Object.defineProperties(SingleTileImageryProvider.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),SingleTileImageryProvider.prototype.getTileCredits=function(e,t,i){},SingleTileImageryProvider.prototype.requestImage=function(e,t,i,r){return this._image},SingleTileImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){};var mapInfoMxpNamespace="http://www.mapinfo.com/mxp",esriWmsNamespace="http://www.esri.com/wms",wfsNamespace="http://www.opengis.net/wfs",gmlNamespace="http://www.opengis.net/gml";function xmlToFeatureInfo(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===mapInfoMxpNamespace)return mapInfoXmlToFeatureInfo(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===esriWmsNamespace)return esriXmlToFeatureInfo(e);if("FeatureCollection"===t.localName&&t.namespaceURI===wfsNamespace)return gmlToFeatureInfo(e);if("ServiceExceptionReport"===t.localName)throw new RuntimeError((new XMLSerializer).serializeToString(t));return("msGMLOutput"===t.localName?msGmlToFeatureInfo:unknownXmlToFeatureInfo)(e)}function mapInfoXmlToFeatureInfo(e){for(var t=[],i=e.documentElement.getElementsByTagNameNS(mapInfoMxpNamespace,"Feature"),r=0;r<i.length;++r){for(var n=i[r],a={},o=n.getElementsByTagNameNS(mapInfoMxpNamespace,"Val"),s=0;s<o.length;++s){var l,c=o[s];c.hasAttribute("ref")&&(l=c.getAttribute("ref"),c=c.textContent.trim(),a[l]=c)}var u=new ImageryLayerFeatureInfo;u.data=n,u.properties=a,u.configureNameFromProperties(a),u.configureDescriptionFromProperties(a),t.push(u)}return t}function esriXmlToFeatureInfo(e){var e=e.documentElement,t=[],i=e.getElementsByTagNameNS("*","FIELDS");if(0<i.length)for(var r=0;r<i.length;++r){for(var n=i[r],a={},o=n.attributes,s=0;s<o.length;++s){var l=o[s];a[l.name]=l.value}t.push(imageryLayerFeatureInfoFromDataAndProperties(n,a))}else for(var c=e.getElementsByTagNameNS("*","FeatureInfo"),u=0;u<c.length;++u){var d=c[u];a={};for(var h=d.childNodes,p=0;p<h.length;++p){var m=h[p];m.nodeType===Node.ELEMENT_NODE&&(a[m.localName]=m.textContent)}t.push(imageryLayerFeatureInfoFromDataAndProperties(d,a))}return t}function gmlToFeatureInfo(e){for(var t=[],i=e.documentElement.getElementsByTagNameNS(gmlNamespace,"featureMember"),r=0;r<i.length;++r){var n=i[r],a={};getGmlPropertiesRecursively(n,a),t.push(imageryLayerFeatureInfoFromDataAndProperties(n,a))}return t}function msGmlToFeatureInfo(e){for(var t,i=[],r=e.documentElement.childNodes,n=0;n<r.length;n++)if(r[n].nodeType===Node.ELEMENT_NODE){t=r[n];break}if(!defined(t))throw new RuntimeError("Unable to find first child of the feature info xml document");for(var a=t.childNodes,o=0;o<a.length;++o){var s,l=a[o];l.nodeType===Node.ELEMENT_NODE&&(getGmlPropertiesRecursively(l,s={}),i.push(imageryLayerFeatureInfoFromDataAndProperties(l,s)))}return i}function getGmlPropertiesRecursively(e,t){for(var i=!0,r=0;r<e.childNodes.length;++r){var n=e.childNodes[r];n.nodeType===Node.ELEMENT_NODE&&(i=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&n.hasChildNodes()&&getGmlPropertiesRecursively(n,t)&&(t[n.localName]=n.textContent)}return i}function imageryLayerFeatureInfoFromDataAndProperties(e,t){var i=new ImageryLayerFeatureInfo;return i.data=e,i.properties=t,i.configureNameFromProperties(t),i.configureDescriptionFromProperties(t),i}function unknownXmlToFeatureInfo(e){var t=(new XMLSerializer).serializeToString(e),i=document.createElement("div"),r=document.createElement("pre");r.textContent=t,i.appendChild(r);r=new ImageryLayerFeatureInfo;return r.data=e,r.description=i.innerHTML,[r]}var emptyBodyRegex=/<body>\s*<\/body>/im,wmsServiceExceptionReportRegex=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,titleRegex=/<title>([\s\S]*)<\/title>/im;function textToFeatureInfo(e){if(!emptyBodyRegex.test(e)&&!wmsServiceExceptionReportRegex.test(e)){var t,i=titleRegex.exec(e);i&&1<i.length&&(t=i[1]);i=new ImageryLayerFeatureInfo;return i.name=t,i.description=e,i.data=e,[i]}}function TimeDynamicImagery(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];var 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)}function getKey(e,t,i){return e+"-"+t+"-"+i}function getKeyElements(e){e=e.split("-");if(3===e.length)return{x:Number(e[0]),y:Number(e[1]),level:Number(e[2])}}function getApproachingInterval(e){var t=e._times;if(defined(t)){var i=e._clock,r=i.currentTime,n=i.canAnimate&&i.shouldAnimate,e=i.multiplier;if(n||0===e){var a,i=t.indexOf(r);if(!(i<0)){n=t.get(i);return 0<e?(a=JulianDate.secondsDifference(n.stop,r),++i):(a=JulianDate.secondsDifference(n.start,r),--i),a/=e,0<=i&&a<=5?t.get(i):void 0}}}}function addToCache(e,t,i){var r=e._times.indexOf(i.start),n=e._tileCache,a=n[r];defined(a)||(a=n[r]={});n=t.key;if(defined(a[n]))return!0;r=getKeyElements(n),t=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.IMAGERY,priorityFunction:t.priorityFunction}),i=e._requestImageFunction(r.x,r.y,r.level,t,i);return!!defined(i)&&(a[n]={promise:i,request:t},!0)}function WebMapServiceImageryProvider(e){if(defined((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times)&&!defined(e.clock))throw new DeveloperError("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;var t=Resource.createIfNeeded(e.url),i=t.clone();t.setQueryParameters(WebMapServiceImageryProvider.DefaultParameters,!0),i.setQueryParameters(WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters,!0),defined(e.parameters)&&t.setQueryParameters(objectToLowercase(e.parameters)),defined(e.getFeatureInfoParameters)&&i.setQueryParameters(objectToLowercase(e.getFeatureInfoParameters));var a=this;this._reload=void 0,defined(e.times)&&(this._timeDynamicImagery=new TimeDynamicImagery({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return requestImage$1(a,e,t,i,r,n)},reloadFunction:function(){defined(a._reload)&&a._reload()}}));var r={};r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",1.3<=parseFloat(t.queryParameters.version)?r.crs=defaultValue(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof WebMercatorProjection?"EPSG:3857":"CRS:84"):r.srs=defaultValue(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof WebMercatorProjection?"EPSG:3857":"EPSG:4326"),t.setQueryParameters(r,!0),i.setQueryParameters(r,!0);r={query_layers:e.layers,info_format:"{format}"};1.3<=parseFloat(i.queryParameters.version)?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),i.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=i,this._layers=e.layers,this._tileProvider=new UrlTemplateImageryProvider({url:t,pickFeaturesUrl:i,tilingScheme:defaultValue(e.tilingScheme,new GeographicTilingScheme({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:defaultValue(e.getFeatureInfoFormats,WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function requestImage$1(e,t,i,r,n,a){a=defined(a)?a.data:void 0,e=e._tileProvider;return defined(a)&&e._resource.setQueryParameters(a),e.requestImage(t,i,r,n)}function pickFeatures(e,t,i,r,n,a,o){o=defined(o)?o.data:void 0,e=e._tileProvider;return defined(o)&&e._pickFeaturesResource.setQueryParameters(o),e.pickFeatures(t,i,r,n,a)}function objectToLowercase(e){var t,i={};for(t in e)e.hasOwnProperty(t)&&(i[t.toLowerCase()]=e[t]);return i}Object.defineProperties(TimeDynamicImagery.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)}}}),TimeDynamicImagery.prototype.getFromCache=function(e,t,i,r){var n,a,t=getKey(e,t,i),i=this._tileCache[this._currentIntervalIndex];return defined(i)&&defined(i[t])&&(a=(n=i[t]).promise.otherwise(function(e){throw r.state=n.request.state,e}),delete i[t]),a},TimeDynamicImagery.prototype.checkApproachingInterval=function(e,t,i,r){e=getKey(e,t,i),t=this._tilesRequestedForInterval,i=getApproachingInterval(this),r={key:e,priorityFunction:r.priorityFunction};defined(i)&&addToCache(this,r,i)||t.push(r),512<=t.length&&t.splice(0,256)},TimeDynamicImagery.prototype._clockOnTick=function(e){var t=e.currentTime,e=this._times.indexOf(t),t=this._currentIntervalIndex;if(e!==t){var i,r=this._tileCache[t];for(i in r)r.hasOwnProperty(i)&&r[i].request.cancel();return delete this._tileCache[t],this._tilesRequestedForInterval=[],this._currentIntervalIndex=e,void this._reloadFunction()}var n=getApproachingInterval(this);if(defined(n))for(var a=this._tilesRequestedForInterval,o=!0;o&&0!==a.length;){var s=a.pop();(o=addToCache(this,s,n))||a.push(s)}},Object.defineProperties(WebMapServiceImageryProvider.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}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},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}}}),WebMapServiceImageryProvider.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},WebMapServiceImageryProvider.prototype.requestImage=function(e,t,i,r){var n,a,o=this._timeDynamicImagery;return defined(o)&&(a=o.currentInterval,n=o.getFromCache(e,t,i,r)),defined(n)||(n=requestImage$1(this,e,t,i,r,a)),defined(n)&&defined(o)&&o.checkApproachingInterval(e,t,i,r),n},WebMapServiceImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){var a=this._timeDynamicImagery;return pickFeatures(this,e,t,i,r,n,defined(a)?a.currentInterval:void 0)},WebMapServiceImageryProvider.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new GetFeatureInfoFormat("json","application/json")),Object.freeze(new GetFeatureInfoFormat("xml","text/xml")),Object.freeze(new GetFeatureInfoFormat("text","text/html"))]);var defaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function WebMapTileServiceImageryProvider(e){e=defaultValue(e,defaultValue.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;var t=Resource.createIfNeeded(e.url),i=e.style,r=e.tileMatrixSetID;0<=t.url.indexOf("{")?(t.setTemplateValues({style:i,Style:i,TileMatrixSet:r}),this._useKvp=!1):(t.setQueryParameters(defaultParameters),this._useKvp=!0),this._resource=t,this._layer=e.layer,this._style=i,this._tileMatrixSetID=r,this._tileMatrixLabels=e.tileMatrixLabels,this._format=defaultValue(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._minimumLevel=defaultValue(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=defaultValue(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;var a=this;this._reload=void 0,defined(e.times)&&(this._timeDynamicImagery=new TimeDynamicImagery({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return requestImage(a,e,t,i,r,n)},reloadFunction:function(){defined(a._reload)&&a._reload()}})),this._readyPromise=when.resolve(!0);i=this._tilingScheme.positionToTileXY(Rectangle.southwest(this._rectangle),this._minimumLevel),r=this._tilingScheme.positionToTileXY(Rectangle.northeast(this._rectangle),this._minimumLevel);Math.abs(r.x-i.x),Math.abs(r.y-i.y),this._errorEvent=new Event;i=e.credit;this._credit="string"==typeof i?new Credit(i):i,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():defined(this._subdomains)&&0<this._subdomains.length?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function requestImage(e,t,i,r,n,a){var o,s=e._tileMatrixLabels,l=defined(s)?s[r]:r.toString(),c=e._subdomains,s=e._dimensions,a=defined(a)?a.data:void 0;return e._useKvp?((o={}).tilematrix=l,o.layer=e._layer,o.style=e._style,o.tilerow=i,o.tilecol=t,o.tilematrixset=e._tileMatrixSetID,o.format=e._format,defined(s)&&(o=combine$2(o,s)),defined(a)&&(o=combine$2(o,a)),o=e._resource.getDerivedResource({queryParameters:o,request:n})):(c={TileMatrix:l,TileRow:i.toString(),TileCol:t.toString(),s:c[(t+i+r)%c.length]},(o=e._resource.getDerivedResource({request:n})).setTemplateValues(c),defined(s)&&o.setTemplateValues(s),defined(a)&&o.setTemplateValues(a)),ImageryProvider.loadImage(e,o)}function createFactory(t){return function(e){return new t(e)}}Object.defineProperties(WebMapTileServiceImageryProvider.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}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},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,defined(this._reload)&&this._reload())}}}),WebMapTileServiceImageryProvider.prototype.getTileCredits=function(e,t,i){},WebMapTileServiceImageryProvider.prototype.requestImage=function(e,t,i,r){var n,a,o=this._timeDynamicImagery;return defined(o)&&(a=o.currentInterval,n=o.getFromCache(e,t,i,r)),defined(n)||(n=requestImage(this,e,t,i,r,a)),defined(n)&&defined(o)&&o.checkApproachingInterval(e,t,i,r),n},WebMapTileServiceImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){};var ImageryProviderMapping={ARCGIS_MAPSERVER:createFactory(ArcGisMapServerImageryProvider),BING:createFactory(BingMapsImageryProvider),GOOGLE_EARTH:createFactory(GoogleEarthEnterpriseMapsProvider),MAPBOX:createFactory(MapboxImageryProvider),SINGLE_TILE:createFactory(SingleTileImageryProvider),TMS:createFactory(TileMapServiceImageryProvider),URL_TEMPLATE:createFactory(UrlTemplateImageryProvider),WMS:createFactory(WebMapServiceImageryProvider),WMTS:createFactory(WebMapTileServiceImageryProvider)};function IonImageryProvider(e){var r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).assetId;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._ready=!1,this._tileCredits=void 0,this._errorEvent=new Event;var n=this,a=IonResource._createEndpointResource(r,e),t=e.assetId.toString()+e.accessToken+e.server,e=IonImageryProvider._endpointCache[t];defined(e)||(e=a.fetchJson(),IonImageryProvider._endpointCache[t]=e),this._readyPromise=e.then(function(e){if("IMAGERY"!==e.type)return when.reject(new RuntimeError("Cesium ion asset "+r+" is not an imagery asset."));var t=e.externalType;if(defined(t)){var i=ImageryProviderMapping[t];if(!defined(i))return when.reject(new RuntimeError("Unrecognized Cesium ion imagery type: "+t));i=i(e.options)}else i=new TileMapServiceImageryProvider({url:new IonResource(e,a)});return n._tileCredits=IonResource.getCreditsFromEndpoint(e,a),i.errorEvent.addEventListener(function(e){(e.provider=n)._errorEvent.raiseEvent(e)}),(n._imageryProvider=i).readyPromise.then(function(){return n._ready=!0})})}Object.defineProperties(IonImageryProvider.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},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(){}}}}),IonImageryProvider.prototype.getTileCredits=function(e,t,i){i=this._imageryProvider.getTileCredits(e,t,i);return defined(i)?this._tileCredits.concat(i):this._tileCredits},IonImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},IonImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},IonImageryProvider._endpointCache={};var IonWorldImageryStyle={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},IonWorldImageryStyle$1=Object.freeze(IonWorldImageryStyle);function createWorldImagery(e){return e=defaultValue(e,defaultValue.EMPTY_OBJECT),new IonImageryProvider({assetId:defaultValue(e.style,IonWorldImageryStyle$1.AERIAL)})}var mobileWidth=576,lightboxHeight=100,textColor="#ffffff",highlightColor$1="#48b";function contains(e,t){for(var i=e.length,r=0;r<i;r++){var n=e[r];if(Credit.equals(n,t))return 1}}function swapCesiumCredit(e){var t=e._previousCesiumCredit,i=e._currentCesiumCredit;Credit.equals(i,t)||(defined(t)&&e._cesiumCreditContainer.removeChild(t.element),defined(i)&&e._cesiumCreditContainer.appendChild(i.element),e._previousCesiumCredit=i)}var delimiterClassName="cesium-credit-delimiter",defaultCredit$2;function createDelimiterElement(e){var t=document.createElement("span");return t.textContent=e,t.className=delimiterClassName,t}function createCreditElement(e,t){return defined(t)&&((t=document.createElement(t))._creditId=e._creditId,t.appendChild(e),e=t),e}function displayCredits(e,t,i,r){for(var n=e.childNodes,a=-1,o=0;o<t.length;++o){var s,l,c=t[o];defined(c)&&(a=o,defined(i)&&(a*=2,0<o&&(n.length<=(s=a-1)?e.appendChild(createDelimiterElement(i)):(l=n[s]).className!==delimiterClassName&&e.replaceChild(createDelimiterElement(i),l))),s=c.element,n.length<=a?e.appendChild(createCreditElement(s,r)):(l=n[a])._creditId!==c._id&&e.replaceChild(createCreditElement(s,r),l))}for(++a;a<n.length;)e.removeChild(n[a])}function styleLightboxContainer(e){var t=e._lightboxCredits,i=e.viewport.clientWidth,r=e.viewport.clientHeight;i!==e._lastViewportWidth&&(i<mobileWidth?(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(.5*(r-t.clientHeight))+"px"),e._lastViewportWidth=i),mobileWidth<=i&&r!==e._lastViewportHeight&&(t.style.marginTop=Math.floor(.5*(r-t.clientHeight))+"px",e._lastViewportHeight=r)}function addStyle(e,t){var i,r=e+" {";for(i in t)t.hasOwnProperty(i)&&(r+=i+": "+t[i]+"; ");return r+=" }\n"}function appendCss(){var e="";e+=addStyle(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),e+=addStyle(".cesium-credit-lightbox",{"background-color":"#303336",color:textColor,position:"relative","min-height":lightboxHeight+"px",margin:"auto"}),e+=addStyle(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:textColor}),e+=addStyle(".cesium-credit-lightbox > ul > li a:hover",{color:highlightColor$1}),e+=addStyle(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),e+=addStyle(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),e+=addStyle(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),e+=addStyle(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:textColor}),e+=addStyle(".cesium-credit-lightbox-close:hover",{color:highlightColor$1}),e+=addStyle(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),e+=addStyle(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),e+=addStyle(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),e+=addStyle(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:textColor}),e+=addStyle(".cesium-credit-expand-link:hover",{color:highlightColor$1}),e+=addStyle(".cesium-credit-text",{color:textColor}),e+=addStyle(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});var t=document.head,i=document.createElement("style");i.innerHTML=e,t.insertBefore(i,t.firstChild)}function CreditDisplay(e,t,i){var r=this;i=defaultValue(i,document.body);var n=document.createElement("div");n.className="cesium-credit-lightbox-overlay",i.appendChild(n);var a=document.createElement("div");function o(e){a.contains(e.target)||r.hideLightbox()}a.className="cesium-credit-lightbox",n.appendChild(a),n.addEventListener("click",o,!1);var s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",a.appendChild(s);var l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",a.appendChild(l);var c=document.createElement("ul");a.appendChild(c);var u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);var d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);s=document.createElement("a");s.className="cesium-credit-expand-link",s.onclick=this.showLightbox.bind(this),s.textContent="Data attribution",e.appendChild(s),appendCss();l=Credit.clone(CreditDisplay.cesiumCredit);this._delimiter=defaultValue(t," • "),this._screenContainer=d,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=a,this._creditList=c,this._lightbox=n,this._hideLightbox=o,this._expandLink=s,this._expanded=!1,this._defaultCredits=[],this._cesiumCredit=l,this._previousCesiumCredit=void 0,this._currentCesiumCredit=l,this._currentFrameCredits={screenCredits:new AssociativeArray,lightboxCredits:new AssociativeArray},this._defaultCredit=void 0,this.viewport=i,this.container=e}function getDefaultCredit(){var e;return defined(defaultCredit$2)||(0!==(e=buildModuleUrl("Assets/Images/ion-credit.png")).indexOf("http://")&&0!==e.indexOf("https://")&&0!==e.indexOf("data:")&&(e=new URI(e).getPath()),defaultCredit$2=new Credit('<a href="https://cesium.com/" target="_blank"><img src="'+e+'" title="Cesium ion"/></a>',!0)),CreditDisplay._cesiumCreditInitialized||(CreditDisplay._cesiumCredit=defaultCredit$2,CreditDisplay._cesiumCreditInitialized=!0),defaultCredit$2}function DebugAppearance(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).attributeName,i=e.perInstanceAttribute;defined(i)||(i=!1);var r,n=defaultValue(e.glslDatatype,"vec3"),a="v_"+t;if("normal"===t||"tangent"===t||"bitangent"===t)r="vec4 getColor() { return vec4(("+a+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch(n="st"===t?"vec2":n){case"float":r="vec4 getColor() { return vec4(vec3("+a+"), 1.0); }\n";break;case"vec2":r="vec4 getColor() { return vec4("+a+", 0.0, 1.0); }\n";break;case"vec3":r="vec4 getColor() { return vec4("+a+", 1.0); }\n";break;case"vec4":r="vec4 getColor() { return "+a+"; }\n"}var o="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(i?"":"attribute "+n+" "+t+";\n")+"varying "+n+" "+a+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(i?a+" = czm_batchTable_"+t+"(batchId);\n":a+" = "+t+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",i="varying "+n+" "+a+";\n"+r+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=defaultValue(e.translucent,!1),this._vertexShaderSource=defaultValue(e.vertexShaderSource,o),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,i),this._renderState=Appearance.getDefaultRenderState(!1,!1,e.renderState),this._closed=defaultValue(e.closed,!1),this._attributeName=t,this._glslDatatype=n}function DebugCameraPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=defaultValue(e.color,Color.CYAN),this._updateOnChange=defaultValue(e.updateOnChange,!0),this.show=defaultValue(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}CreditDisplay.prototype.addCredit=function(e){if(e._isIon)return defined(this._defaultCredit)||(this._defaultCredit=Credit.clone(getDefaultCredit())),void(this._currentCesiumCredit=this._defaultCredit);(e.showOnScreen?this._currentFrameCredits.screenCredits:this._currentFrameCredits.lightboxCredits).set(e.id,e)},CreditDisplay.prototype.addDefaultCredit=function(e){var t=this._defaultCredits;contains(t,e)||t.push(e)},CreditDisplay.prototype.removeDefaultCredit=function(e){var t=this._defaultCredits,e=t.indexOf(e);-1!==e&&t.splice(e,1)},CreditDisplay.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},CreditDisplay.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},CreditDisplay.prototype.update=function(){this._expanded&&styleLightboxContainer(this)},CreditDisplay.prototype.beginFrame=function(){var e=this._currentFrameCredits,t=e.screenCredits;t.removeAll();for(var i=this._defaultCredits,r=0;r<i.length;++r){var n=i[r];t.set(n.id,n)}e.lightboxCredits.removeAll(),Credit.equals(CreditDisplay.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Credit.clone(CreditDisplay.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit},CreditDisplay.prototype.endFrame=function(){var e=this._currentFrameCredits.screenCredits.values;displayCredits(this._screenContainer,e,this._delimiter,void 0);e=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=0<e.length?"inline":"none",displayCredits(this._creditList,e,void 0,"li"),swapCesiumCredit(this)},CreditDisplay.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),destroyObject(this)},CreditDisplay.prototype.isDestroyed=function(){return!1},CreditDisplay._cesiumCredit=void 0,CreditDisplay._cesiumCreditInitialized=!1,Object.defineProperties(CreditDisplay,{cesiumCredit:{get:function(){return getDefaultCredit(),CreditDisplay._cesiumCredit},set:function(e){CreditDisplay._cesiumCredit=e,CreditDisplay._cesiumCreditInitialized=!0}}}),Object.defineProperties(DebugAppearance.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}}}),DebugAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,DebugAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,DebugAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;var scratchRight$2=new Cartesian3,scratchRotation=new Matrix3,scratchOrientation=new Quaternion,scratchPerspective=new PerspectiveFrustum,scratchPerspectiveOffCenter=new PerspectiveOffCenterFrustum,scratchOrthographic=new OrthographicFrustum,scratchOrthographicOffCenter=new OrthographicOffCenterFrustum,scratchColor$1=new Color,scratchSplits$1=[1,1e5];function DebugInspector(){this._cachedShowFrustumsShaders={}}function getAttributeLocations(e){var t,i={},r=e.vertexAttributes;for(t in r)r.hasOwnProperty(t)&&(i[t]=r[t].index);return i}function createDebugShowFrustumsShaderProgram(e,t){var i=e.context,r=t,e=r.fragmentShaderSource.clone(),n=[];e.sources=e.sources.map(function(e){e=ShaderSource.replaceMain(e,"czm_Debug_main");for(var t,i=/gl_FragData\[(\d+)\]/g;null!==(t=i.exec(e));)-1===n.indexOf(t[1])&&n.push(t[1]);return e});var a,o=n.length,s="";if(s+="uniform vec3 debugShowCommandsColor;\n",s+="uniform vec3 debugShowFrustumsColor;\n",s+="void main() \n{ \n czm_Debug_main(); \n",0<o)for(a=0;a<o;++a)s+=" gl_FragData["+n[a]+"].rgb *= debugShowCommandsColor;\n",s+=" gl_FragData["+n[a]+"].rgb *= debugShowFrustumsColor;\n";else s+=" gl_FragColor.rgb *= debugShowCommandsColor;\n",s+=" gl_FragColor.rgb *= debugShowFrustumsColor;\n";e.sources.push(s+="}");t=getAttributeLocations(r);return ShaderProgram.fromCache({context:i,vertexShaderSource:r.vertexShaderSource,fragmentShaderSource:e,attributeLocations:t})}DebugCameraPrimitive.prototype.update=function(e){if(this.show){var t,i,r=this._planesPrimitives,n=this._outlinePrimitives;if(this._updateOnChange){for(i=r.length,t=0;t<i;++t)n[t]=n[t]&&n[t].destroy(),r[t]=r[t]&&r[t].destroy();r.length=0,n.length=0}if(0===r.length){var a=this._camera,o=a.frustum,s=o instanceof PerspectiveFrustum?scratchPerspective:o instanceof PerspectiveOffCenterFrustum?scratchPerspectiveOffCenter:o instanceof OrthographicFrustum?scratchOrthographic:scratchOrthographicOffCenter;s=o.clone(s);var l=this._frustumSplits,c=!defined(l)||l.length<=1?((l=scratchSplits$1)[0]=this._camera.frustum.near,l[1]=this._camera.frustum.far,1):l.length-1,u=a.positionWC,d=a.directionWC,h=a.upWC,o=a.rightWC,o=Cartesian3.negate(o,scratchRight$2),a=scratchRotation;Matrix3.setColumn(a,0,o,a),Matrix3.setColumn(a,1,h,a),Matrix3.setColumn(a,2,d,a);var p=Quaternion.fromRotationMatrix(a,scratchOrientation);for(r.length=n.length=c,t=0;t<c;++t)s.near=l[t],s.far=l[t+1],r[t]=new Primitive({geometryInstances:new GeometryInstance({geometry:new FrustumGeometry({origin:u,orientation:p,frustum:s,_drawNearPlane:0===t}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(Color.fromAlpha(this._color,.1,scratchColor$1))},id:this.id,pickPrimitive:this}),appearance:new PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1}),n[t]=new Primitive({geometryInstances:new GeometryInstance({geometry:new FrustumOutlineGeometry({origin:u,orientation:p,frustum:s,_drawNearPlane:0===t}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}for(i=r.length,t=0;t<i;++t)n[t].update(e),r[t].update(e)}},DebugCameraPrimitive.prototype.isDestroyed=function(){return!1},DebugCameraPrimitive.prototype.destroy=function(){for(var e=this._planesPrimitives.length,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 destroyObject(this)};var scratchFrustumColor=new Color;function createDebugShowFrustumsUniformMap(e,t){var i=defined(t.uniformMap)?t.uniformMap:{};return defined(i.debugShowCommandsColor)||defined(i.debugShowFrustumsColor)||(i.debugShowCommandsColor=function(){return e.debugShowCommands?(defined(t._debugColor)||(t._debugColor=Color.fromRandom()),t._debugColor):Color.WHITE},i.debugShowFrustumsColor=function(){return e.debugShowFrustums?(scratchFrustumColor.red=1&t.debugOverlappingFrustums?1:0,scratchFrustumColor.green=2&t.debugOverlappingFrustums?1:0,scratchFrustumColor.blue=4&t.debugOverlappingFrustums?1:0,scratchFrustumColor.alpha=1,scratchFrustumColor):Color.WHITE}),i}var scratchShowFrustumCommand=new DrawCommand;function DebugModelMatrixPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.length=defaultValue(e.length,1e7),this._length=void 0,this.width=defaultValue(e.width,2),this._width=void 0,this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=new Matrix4,this.id=e.id,this._id=void 0,this._primitive=void 0}DebugInspector.prototype.executeDebugShowFrustumsCommand=function(e,t,i){var r=t.shaderProgram.id,n=this._cachedShowFrustumsShaders[r];defined(n)||(n=createDebugShowFrustumsShaderProgram(e,t.shaderProgram),this._cachedShowFrustumsShaders[r]=n);r=DrawCommand.shallowClone(t,scratchShowFrustumCommand);r.shaderProgram=n,r.uniformMap=createDebugShowFrustumsUniformMap(e,t),r.execute(e.context,i)},DebugModelMatrixPrimitive.prototype.update=function(e){var t,i,r;this.show&&(defined(this._primitive)&&Matrix4.equals(this._modelMatrix,this.modelMatrix)&&this._length===this.length&&this._width===this.width&&this._id===this.id||(this._modelMatrix=Matrix4.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,defined(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01),t=new GeometryInstance({geometry:new PolylineGeometry({positions:[Cartesian3.ZERO,Cartesian3.UNIT_X],width:this.width,vertexFormat:PolylineColorAppearance.VERTEX_FORMAT,colors:[Color.RED,Color.RED],arcType:ArcType$1.NONE}),modelMatrix:Matrix4.multiplyByUniformScale(this.modelMatrix,this.length,new Matrix4),id:this.id,pickPrimitive:this}),i=new GeometryInstance({geometry:new PolylineGeometry({positions:[Cartesian3.ZERO,Cartesian3.UNIT_Y],width:this.width,vertexFormat:PolylineColorAppearance.VERTEX_FORMAT,colors:[Color.GREEN,Color.GREEN],arcType:ArcType$1.NONE}),modelMatrix:Matrix4.multiplyByUniformScale(this.modelMatrix,this.length,new Matrix4),id:this.id,pickPrimitive:this}),r=new GeometryInstance({geometry:new PolylineGeometry({positions:[Cartesian3.ZERO,Cartesian3.UNIT_Z],width:this.width,vertexFormat:PolylineColorAppearance.VERTEX_FORMAT,colors:[Color.BLUE,Color.BLUE],arcType:ArcType$1.NONE}),modelMatrix:Matrix4.multiplyByUniformScale(this.modelMatrix,this.length,new Matrix4),id:this.id,pickPrimitive:this}),this._primitive=new Primitive({geometryInstances:[t,i,r],appearance:new PolylineColorAppearance,asynchronous:!1})),this._primitive.update(e))},DebugModelMatrixPrimitive.prototype.isDestroyed=function(){return!1},DebugModelMatrixPrimitive.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)};var DepthPlaneFS="varying vec4 positionEC;\nvoid main()\n{\nvec3 position;\nvec3 direction;\nif (czm_orthographicIn3D == 1.0)\n{\nvec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;\nvec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y);\nvec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x);\nposition = vec3(mix(minPlane, maxPlane, uv), 0.0);\ndirection = vec3(0.0, 0.0, -1.0);\n}\nelse\n{\nposition = vec3(0.0);\ndirection = normalize(positionEC.xyz);\n}\nczm_ray ray = czm_ray(position, direction);\nvec3 ellipsoid_center = czm_view[3].xyz;\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\nczm_writeLogDepth();\n}\n",DepthPlaneVS="attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\nczm_vertexLogDepth();\n}\n";function DepthPlane(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1}var depthQuadScratch=FeatureDetection.supportsTypedArrays()?new Float32Array(12):[],scratchCartesian1$1=new Cartesian3,scratchCartesian2$1=new Cartesian3,scratchCartesian3=new Cartesian3,scratchCartesian4$1=new Cartesian3,scratchCartesian5=new Cartesian3;function computeDepthQuad(e,t){var i,r,n=e.radii,a=t.camera;s=a.frustum instanceof OrthographicFrustum?(i=Cartesian3.ZERO,r=a.rightWC,a.upWC):(o=a.positionWC,t=Cartesian3.multiplyComponents(e.oneOverRadii,o,scratchCartesian1$1),a=Cartesian3.normalize(t,scratchCartesian2$1),e=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,t,scratchCartesian3),scratchCartesian3),s=Cartesian3.normalize(Cartesian3.cross(a,e,scratchCartesian4$1),scratchCartesian4$1),o=Cartesian3.magnitude(t),t=Math.sqrt(o*o-1),i=Cartesian3.multiplyByScalar(a,1/o,scratchCartesian1$1),r=Cartesian3.multiplyByScalar(e,o=t/o,scratchCartesian2$1),Cartesian3.multiplyByScalar(s,o,scratchCartesian3));var o=Cartesian3.add(i,s,scratchCartesian5);Cartesian3.subtract(o,r,o),Cartesian3.multiplyComponents(n,o,o),Cartesian3.pack(o,depthQuadScratch,0);o=Cartesian3.subtract(i,s,scratchCartesian5);Cartesian3.subtract(o,r,o),Cartesian3.multiplyComponents(n,o,o),Cartesian3.pack(o,depthQuadScratch,3);o=Cartesian3.add(i,s,scratchCartesian5);Cartesian3.add(o,r,o),Cartesian3.multiplyComponents(n,o,o),Cartesian3.pack(o,depthQuadScratch,6);var s=Cartesian3.subtract(i,s,scratchCartesian5);return Cartesian3.add(s,r,s),Cartesian3.multiplyComponents(n,s,s),Cartesian3.pack(s,depthQuadScratch,9),depthQuadScratch}function DerivedCommand(){}DepthPlane.prototype.update=function(e){var t,i,r,n,a;this._mode=e.mode,e.mode===SceneMode$1.SCENE3D&&(t=e.context,i=e.mapProjection.ellipsoid,r=e.useLogDepth,defined(this._command)||(this._rs=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new DrawCommand({renderState:this._rs,boundingVolume:new BoundingSphere(Cartesian3.ZERO,i.maximumRadius),pass:Pass$1.OPAQUE,owner:this})),defined(this._sp)&&this._useLogDepth===r||(this._useLogDepth=r,n=new ShaderSource({sources:[DepthPlaneVS]}),a=new ShaderSource({sources:[DepthPlaneFS]}),r&&(a.sources.push("#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),a.defines.push("LOG_DEPTH"),n.defines.push("LOG_DEPTH")),this._sp=ShaderProgram.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp),e=computeDepthQuad(i,e),defined(this._va)?this._va.getAttribute(0).vertexBuffer.copyFromArrayView(e):(e=new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:e})},indices:[0,1,2,2,1,3],primitiveType:PrimitiveType$1.TRIANGLES}),this._va=VertexArray.fromGeometry({context:t,geometry:e,attributeLocations:{position:0},bufferUsage:BufferUsage$1.DYNAMIC_DRAW}),this._command.vertexArray=this._va))},DepthPlane.prototype.execute=function(e,t){this._mode===SceneMode$1.SCENE3D&&this._command.execute(e,t)},DepthPlane.prototype.isDestroyed=function(){return!1},DepthPlane.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var fragDepthRegex=/\bgl_FragDepthEXT\b/,discardRegex=/\bdiscard\b/;function getDepthOnlyShaderProgram$1(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!defined(i)){for(var r=t._attributeLocations,n=t.fragmentShaderSource,a=!1,o=n.sources,s=o.length,l=0;l<s;++l)if(fragDepthRegex.test(o[l])||discardRegex.test(o[l])){a=!0;break}var c=!1,u=n.defines,s=u.length;for(l=0;l<s;++l)if("LOG_DEPTH"===u[l]){c=!0;break}a||c?!a&&c&&(n=new ShaderSource({defines:["LOG_DEPTH"],sources:["#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeLogDepth(); \n} \n"]})):n=new ShaderSource({sources:["void main() \n{ \n gl_FragColor = vec4(1.0); \n} \n"]}),i=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:r})}return i}function getDepthOnlyRenderState(e,t){var i=e._depthOnlyRenderStateCache,r=i[t.id];return defined(r)||((e=RenderState.getState(t)).depthMask=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r=RenderState.fromCache(e),i[t.id]=r),r}DerivedCommand.createDepthOnlyDerivedCommand=function(e,t,i,r){var n,a;return defined(r)||(r={}),defined(r.depthOnlyCommand)&&(n=r.depthOnlyCommand.shaderProgram,a=r.depthOnlyCommand.renderState),r.depthOnlyCommand=DrawCommand.shallowClone(t,r.depthOnlyCommand),defined(n)&&r.shaderProgramId===t.shaderProgram.id?(r.depthOnlyCommand.shaderProgram=n,r.depthOnlyCommand.renderState=a):(r.depthOnlyCommand.shaderProgram=getDepthOnlyShaderProgram$1(i,t.shaderProgram),r.depthOnlyCommand.renderState=getDepthOnlyRenderState(e,t.renderState),r.shaderProgramId=t.shaderProgram.id),r};var writeLogDepthRegex=/\s+czm_writeLogDepth\(/,vertexlogDepthRegex=/\s+czm_vertexLogDepth\(/,extensionRegex=/\s*#extension\s+GL_EXT_frag_depth\s*:\s*enable/;function getLogDepthShaderProgram(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!defined(i)){var r=t._attributeLocations,n=t.vertexShaderSource.clone(),a=t.fragmentShaderSource.clone();n.defines=defined(n.defines)?n.defines.slice(0):[],n.defines.push("LOG_DEPTH"),a.defines=defined(a.defines)?a.defines.slice(0):[],a.defines.push("LOG_DEPTH");for(var o=!1,s=n.sources,l=s.length,c=0;c<l;++c)if(vertexlogDepthRegex.test(s[c])){o=!0;break}if(!o){for(c=0;c<l;++c)s[c]=ShaderSource.replaceMain(s[c],"czm_log_depth_main");s.push("\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n")}for(l=(s=a.sources).length,o=!1,c=0;c<l;++c)writeLogDepthRegex.test(s[c])&&(o=!0);-1!==a.defines.indexOf("LOG_DEPTH_WRITE")&&(o=!0);var u=!0;for(c=0;c<l;++c)extensionRegex.test(s[c])&&(u=!1);var d="";if(u&&(d+="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),!o){for(c=0;c<l;c++)s[c]=ShaderSource.replaceMain(s[c],"czm_log_depth_main");d+="\nvoid main() \n{ \n czm_log_depth_main(); \n czm_writeLogDepth(); \n} \n"}s.push(d),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:r})}return i}function getPickShaderProgram$1(e,t,i){var r=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!defined(r)){for(var n=t._attributeLocations,a=t.fragmentShaderSource,o=a.sources,s=o.length,i="void main() \n{ \n czm_non_pick_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = "+i+"; \n} \n",l=new Array(s+1),c=0;c<s;++c)l[c]=ShaderSource.replaceMain(o[c],"czm_non_pick_main");l[s]=i,a=new ShaderSource({sources:l,defines:a.defines}),r=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:n})}return r}function getPickRenderState(e,t){var i=e.picking.pickRenderStateCache,r=i[t.id];return defined(r)||((e=RenderState.getState(t)).blending.enabled=!1,e.depthMask=!0,r=RenderState.fromCache(e),i[t.id]=r),r}function getHdrShaderProgram(e,t){var i,r,n,a=e.shaderCache.getDerivedShaderProgram(t,"HDR");return defined(a)||(i=t._attributeLocations,r=t.vertexShaderSource.clone(),n=t.fragmentShaderSource.clone(),r.defines=defined(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),n.defines=defined(n.defines)?n.defines.slice(0):[],n.defines.push("HDR"),a=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:n,attributeLocations:i})),a}function DeviceOrientationCameraController(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;var i=this;function t(e){var t=e.alpha;if(!defined(t))return i._alpha=void 0,i._beta=void 0,void(i._gamma=void 0);i._alpha=CesiumMath.toRadians(t),i._beta=CesiumMath.toRadians(e.beta),i._gamma=CesiumMath.toRadians(e.gamma)}window.addEventListener("deviceorientation",t,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",t,!1)}}DerivedCommand.createLogDepthCommand=function(e,t,i){var r;return defined(i)||(i={}),defined(i.command)&&(r=i.command.shaderProgram),i.command=DrawCommand.shallowClone(e,i.command),defined(r)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=r:(i.command.shaderProgram=getLogDepthShaderProgram(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i},DerivedCommand.createPickDerivedCommand=function(e,t,i,r){var n,a;return defined(r)||(r={}),defined(r.pickCommand)&&(n=r.pickCommand.shaderProgram,a=r.pickCommand.renderState),r.pickCommand=DrawCommand.shallowClone(t,r.pickCommand),defined(n)&&r.shaderProgramId===t.shaderProgram.id?(r.pickCommand.shaderProgram=n,r.pickCommand.renderState=a):(r.pickCommand.shaderProgram=getPickShaderProgram$1(i,t.shaderProgram,t.pickId),r.pickCommand.renderState=getPickRenderState(e,t.renderState),r.shaderProgramId=t.shaderProgram.id),r},DerivedCommand.createHdrCommand=function(e,t,i){var r;return defined(i)||(i={}),defined(i.command)&&(r=i.command.shaderProgram),i.command=DrawCommand.shallowClone(e,i.command),defined(r)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=r:(i.command.shaderProgram=getHdrShaderProgram(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i};var scratchQuaternion1=new Quaternion,scratchQuaternion2=new Quaternion,scratchMatrix3=new Matrix3;function rotate(e,t,i,r){var n=e.direction,a=e.right,e=e.up,i=Quaternion.fromAxisAngle(n,i,scratchQuaternion2),r=Quaternion.fromAxisAngle(a,r,scratchQuaternion1),r=Quaternion.multiply(r,i,r),t=Quaternion.fromAxisAngle(e,t,scratchQuaternion2);Quaternion.multiply(t,r,r);r=Matrix3.fromQuaternion(r,scratchMatrix3);Matrix3.multiplyByVector(r,a,a),Matrix3.multiplyByVector(r,e,e),Matrix3.multiplyByVector(r,n,n)}function DirectionalLight(e){this.direction=Cartesian3.clone(e.direction),this.color=Color.clone(defaultValue(e.color,Color.WHITE)),this.intensity=defaultValue(e.intensity,1)}DeviceOrientationCameraController.prototype.update=function(){var e,t,i;defined(this._alpha)&&(defined(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma),e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,i=this._lastGamma-this._gamma,rotate(this._scene.camera,-e,t,i),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma)},DeviceOrientationCameraController.prototype.isDestroyed=function(){return!1},DeviceOrientationCameraController.prototype.destroy=function(){return this._removeListener(),destroyObject(this)};var EllipsoidFS="#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef ONLY_SUN_LIGHTING\nreturn czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ray ray = czm_ray(t * direction, direction);\nvec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\n#ifdef LOG_DEPTH\nczm_writeLogDepth(1.0 + positionCC.w);\n#else\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n#endif\n}\n",EllipsoidVS="attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\nczm_vertexLogDepth();\n}\n",attributeLocations={position:0};function EllipsoidPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.center=Cartesian3.clone(defaultValue(e.center,Cartesian3.ZERO)),this._center=new Cartesian3,this.radii=Cartesian3.clone(e.radii),this._radii=new Cartesian3,this._oneOverEllipsoidRadiiSquared=new Cartesian3,this._boundingSphere=new BoundingSphere,this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=new Matrix4,this._computedModelMatrix=new Matrix4,this.show=defaultValue(e.show,!0),this.material=defaultValue(e.material,Material.fromType(Material.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.onlySunLighting=defaultValue(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=defaultValue(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 DrawCommand({owner:defaultValue(e._owner,this)}),this._pickCommand=new DrawCommand({owner:defaultValue(e._owner,this),pickOnly:!0});var 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 getVertexArray(e){if(defined(i=e.cache.ellipsoidPrimitive_vertexArray))return i;var t=BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:VertexFormat.POSITION_ONLY})),i=VertexArray.fromGeometry({context:e,geometry:t,attributeLocations:attributeLocations,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:!0});return e.cache.ellipsoidPrimitive_vertexArray=i}var logDepthExtension="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n";EllipsoidPrimitive.prototype.update=function(e){var t,i,r,n,a,o,s,l,c;this.show&&e.mode===SceneMode$1.SCENE3D&&defined(this.center)&&defined(this.radii)&&(t=e.context,i=this.material.isTranslucent(),c=this._translucent!==i,defined(this._rs)&&!c||(this._translucent=i,this._rs=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!i&&t.fragmentDepth,blending:i?BlendingState$1.ALPHA_BLEND:void 0})),defined(this._va)||(this._va=getVertexArray(t)),o=!1,a=this.radii,Cartesian3.equals(this._radii,a)||(Cartesian3.clone(a,this._radii),(n=this._oneOverEllipsoidRadiiSquared).x=1/(a.x*a.x),n.y=1/(a.y*a.y),n.z=1/(a.z*a.z),o=!0),Matrix4.equals(this.modelMatrix,this._modelMatrix)&&Cartesian3.equals(this.center,this._center)||(Matrix4.clone(this.modelMatrix,this._modelMatrix),Cartesian3.clone(this.center,this._center),Matrix4.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(Cartesian3.clone(Cartesian3.ZERO,this._boundingSphere.center),this._boundingSphere.radius=Cartesian3.maximumComponent(a),BoundingSphere.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere)),r=this._material!==this.material,this._material=this.material,this._material.update(t),n=this.onlySunLighting!==this._onlySunLighting,this._onlySunLighting=this.onlySunLighting,o=e.useLogDepth,a=this._useLogDepth!==o,this._useLogDepth=o,o=this._colorCommand,(r||n||c||a)&&(s=new ShaderSource({sources:[EllipsoidVS]}),l=new ShaderSource({sources:[this.material.shaderSource,EllipsoidFS]}),this.onlySunLighting&&l.defines.push("ONLY_SUN_LIGHTING"),!i&&t.fragmentDepth&&l.defines.push("WRITE_DEPTH"),this._useLogDepth&&(s.defines.push("LOG_DEPTH"),l.defines.push("LOG_DEPTH"),l.sources.push(logDepthExtension)),this._sp=ShaderProgram.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:attributeLocations}),o.vertexArray=this._va,o.renderState=this._rs,o.shaderProgram=this._sp,o.uniformMap=combine$2(this._uniforms,this.material._uniforms),o.executeInClosestFrustum=i),c=e.commandList,(e=e.passes).render&&(o.boundingVolume=this._boundingSphere,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.modelMatrix=this._computedModelMatrix,o.pass=i?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,c.push(o)),e.pick&&(e=this._pickCommand,defined(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})),(r||n||!defined(this._pickSP)||a)&&(s=new ShaderSource({sources:[EllipsoidVS]}),l=new ShaderSource({sources:[this.material.shaderSource,EllipsoidFS],pickColorQualifier:"uniform"}),this.onlySunLighting&&l.defines.push("ONLY_SUN_LIGHTING"),!i&&t.fragmentDepth&&l.defines.push("WRITE_DEPTH"),this._useLogDepth&&(s.defines.push("LOG_DEPTH"),l.defines.push("LOG_DEPTH"),l.sources.push(logDepthExtension)),this._pickSP=ShaderProgram.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:attributeLocations}),e.vertexArray=this._va,e.renderState=this._rs,e.shaderProgram=this._pickSP,e.uniformMap=combine$2(combine$2(this._uniforms,this._pickUniforms),this.material._uniforms),e.executeInClosestFrustum=i),e.boundingVolume=this._boundingSphere,e.modelMatrix=this._computedModelMatrix,e.pass=i?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,c.push(e)))},EllipsoidPrimitive.prototype.isDestroyed=function(){return!1},EllipsoidPrimitive.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(),destroyObject(this)};var EllipsoidSurfaceAppearanceFS="varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",EllipsoidSurfaceAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";function EllipsoidSurfaceAppearance(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.translucent,!0),i=defaultValue(e.aboveGround,!1);this.material=defined(e.material)?e.material:Material.fromType(Material.ColorType),this.translucent=defaultValue(e.translucent,!0),this._vertexShaderSource=defaultValue(e.vertexShaderSource,EllipsoidSurfaceAppearanceVS),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,EllipsoidSurfaceAppearanceFS),this._renderState=Appearance.getDefaultRenderState(t,!i,e.renderState),this._closed=!1,this._flat=defaultValue(e.flat,!1),this._faceForward=defaultValue(e.faceForward,i),this._aboveGround=i}function Fog(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(EllipsoidSurfaceAppearance.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 EllipsoidSurfaceAppearance.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),EllipsoidSurfaceAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_ST,EllipsoidSurfaceAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,EllipsoidSurfaceAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,EllipsoidSurfaceAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;for(var heightsTable=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],densityTable=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7],i$2=0;i$2<densityTable.length;++i$2)densityTable[i$2]*=1e6;for(var tableStartDensity=densityTable[1],tableEndDensity=densityTable[densityTable.length-1],j=0;j<densityTable.length;++j)densityTable[j]=(densityTable[j]-tableEndDensity)/(tableStartDensity-tableEndDensity);var tableLastIndex=0;function findInterval(e){var t,i=heightsTable,r=i.length;if(e<i[0])return tableLastIndex=0;if(e>i[r-1])return tableLastIndex=r-2;if(e>=i[tableLastIndex]){if(tableLastIndex+1<r&&e<i[tableLastIndex+1])return tableLastIndex;if(tableLastIndex+2<r&&e<i[tableLastIndex+2])return++tableLastIndex}else if(0<=tableLastIndex-1&&e>=i[tableLastIndex-1])return--tableLastIndex;for(t=0;t<r-2&&!(e>=i[t]&&e<i[t+1]);++t);return tableLastIndex=t}var scratchPositionNormal$1=new Cartesian3;function FrameRateMonitor(e){this._scene=e.scene,this.samplingWindow=defaultValue(e.samplingWindow,FrameRateMonitor.defaultSettings.samplingWindow),this.quietPeriod=defaultValue(e.quietPeriod,FrameRateMonitor.defaultSettings.quietPeriod),this.warmupPeriod=defaultValue(e.warmupPeriod,FrameRateMonitor.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=defaultValue(e.minimumFrameRateDuringWarmup,FrameRateMonitor.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=defaultValue(e.minimumFrameRateAfterWarmup,FrameRateMonitor.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new Event,this._nominalFrameRate=new Event,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var i=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(e,t){update(i)}),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var t=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;function r(){visibilityChanged(i)}this._visibilityChangeRemoveListener=void 0,defined(t)&&(document.addEventListener(t,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(t,r,!1)})}function update(e,t){if(!(0<e._pauseCount)){var i=getTimestamp$1();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/TimeConstants$1.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/TimeConstants$1.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/TimeConstants$1.SECONDS_PER_MILLISECOND;if(2<=e._frameTimes.length&&e._frameTimes[0]<=r){for(;2<=e._frameTimes.length&&e._frameTimes[1]<r;)e._frameTimes.shift();var n=(i-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n,1e3/(i>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup)<n?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 visibilityChanged(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}function FrameState(e,t,i){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=SceneMode$1.SCENE3D,this.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=i,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,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=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}function FrustumCommands(e,t){this.near=defaultValue(e,0),this.far=defaultValue(t,0);for(var i=Pass$1.NUMBER_OF_PASSES,r=new Array(i),n=new Array(i),a=0;a<i;++a)r[a]=[],n[a]=0;this.commands=r,this.indices=n}Fog.prototype.update=function(e){var t,i,r;(e.fog.enabled=this.enabled)&&(!defined(i=(t=e.camera).positionCartographic)||8e5<i.height||e.mode!==SceneMode$1.SCENE3D?e.fog.enabled=!1:(i=findInterval(r=i.height),r=CesiumMath.clamp((r-heightsTable[i])/(heightsTable[i+1]-heightsTable[i]),0,1),i=(i=CesiumMath.lerp(densityTable[i],densityTable[i+1],r))*((r=1e6*this.density)-r/tableStartDensity*tableEndDensity)*1e-6,r=Cartesian3.normalize(t.positionWC,scratchPositionNormal$1),r=Math.abs(Cartesian3.dot(t.directionWC,r)),e.fog.density=i*=1-r,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness))},FrameRateMonitor.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},FrameRateMonitor.fromScene=function(e){return defined(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new FrameRateMonitor({scene:e})),e._frameRateMonitor},Object.defineProperties(FrameRateMonitor.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}}}),FrameRateMonitor.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},FrameRateMonitor.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},FrameRateMonitor.prototype.isDestroyed=function(){return!1},FrameRateMonitor.prototype.destroy=function(){return this._preUpdateRemoveListener(),defined(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),destroyObject(this)};var GlobeFS="uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_DAY_NIGHT_ALPHA\nuniform float u_dayTextureNightAlpha[TEXTURE_UNITS];\nuniform float u_dayTextureDayAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_COLOR_TO_ALPHA\nuniform vec4 u_colorsToAlpha[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nuniform vec2 u_lightingFadeDistance;\n#endif\n#ifdef TILE_LIMIT_RECTANGLE\nuniform vec4 u_cartographicLimitRectangle;\n#endif\n#ifdef GROUND_ATMOSPHERE\nuniform vec2 u_nightFadeDistance;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nuniform highp sampler2D u_clippingPlanes;\nuniform mat4 u_clippingPlanesMatrix;\nuniform vec4 u_clippingPlanesEdgeStyle;\n#endif\n#if defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nuniform float u_minimumBrightness;\n#endif\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nuniform vec4 u_fillHighlightColor;\n#endif\n#ifdef TRANSLUCENT\nuniform vec4 u_frontFaceAlphaByDistance;\nuniform vec4 u_backFaceAlphaByDistance;\nuniform vec4 u_translucencyRectangle;\n#endif\n#ifdef UNDERGROUND_COLOR\nuniform vec4 u_undergroundColor;\nuniform vec4 u_undergroundColorAlphaByDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_height;\nvarying float v_slope;\nvarying float v_aspect;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nvarying float v_distance;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying vec3 v_fogRayleighColor;\nvarying vec3 v_fogMieColor;\n#endif\n#ifdef GROUND_ATMOSPHERE\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nfloat interpolateByDistance(vec4 nearFarScalar, float distance)\n{\nfloat startDistance = nearFarScalar.x;\nfloat startValue = nearFarScalar.y;\nfloat endDistance = nearFarScalar.z;\nfloat endValue = nearFarScalar.w;\nfloat t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\nreturn mix(startValue, endValue, t);\n}\n#endif\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)\n{\nreturn sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\n}\n#endif\n#ifdef TRANSLUCENT\nbool inTranslucencyRectangle()\n{\nreturn\nv_textureCoordinates.x > u_translucencyRectangle.x &&\nv_textureCoordinates.x < u_translucencyRectangle.z &&\nv_textureCoordinates.y > u_translucencyRectangle.y &&\nv_textureCoordinates.y < u_translucencyRectangle.w;\n}\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureNightAlpha,\nfloat textureDayAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split,\nvec4 colorToAlpha,\nfloat nightBlend)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\ntextureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);\n#endif\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_COLOR_TO_ALPHA\nvec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\ncolorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);\nalpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\n#endif\n#if !defined(APPLY_GAMMA)\nvec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\ncolor = tempColor.rgb;\nalpha = tempColor.a;\n#else\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition;\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\nalpha = 0.0;\n}\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\nalpha = 0.0;\n}\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\noutAlpha += sign(outAlpha) - 1.0;\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, max(outAlpha, 0.0));\n}\nvec3 colorCorrect(vec3 rgb) {\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\n#endif\nreturn rgb;\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\n#ifdef GROUND_ATMOSPHERE\nvec3 computeGroundAtmosphereColor(vec3 fogColor, vec4 finalColor, vec3 atmosphereLightDirection, float cameraDist);\n#endif\nconst float fExposure = 2.0;\nvoid main()\n{\n#ifdef TILE_LIMIT_RECTANGLE\nif (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\nv_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\n{\ndiscard;\n}\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nfloat clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\nfloat nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);\n#else\nfloat nightBlend = 0.0;\n#endif\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nfloat cameraDist;\nif (czm_sceneMode == czm_sceneMode2D)\n{\ncameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\n}\nelse if (czm_sceneMode == czm_sceneModeColumbusView)\n{\ncameraDist = -czm_view[3].z;\n}\nelse\n{\ncameraDist = length(czm_view[3]);\n}\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nif (czm_sceneMode != czm_sceneMode3D) {\nvec3 radii = czm_ellipsoidRadii;\nfloat maxRadii = max(radii.x, max(radii.y, radii.z));\nfadeOutDist -= maxRadii;\nfadeInDist -= maxRadii;\n}\nfloat fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#else\nfloat fade = 0.0;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nwaterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);\n}\n#endif\n#ifdef APPLY_MATERIAL\nczm_materialInput materialInput;\nmaterialInput.st = v_textureCoordinates.st;\nmaterialInput.normalEC = normalize(v_normalEC);\nmaterialInput.slope = v_slope;\nmaterialInput.height = v_height;\nmaterialInput.aspect = v_aspect;\nczm_material material = czm_getMaterial(materialInput);\nvec4 materialColor = vec4(material.diffuse, material.alpha);\ncolor = alphaBlend(materialColor, color);\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, fade);\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nvec4 clippingPlanesEdgeColor = vec4(1.0);\nclippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\nfloat clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\nif (clipDistance < clippingPlanesEdgeWidth)\n{\nfinalColor = clippingPlanesEdgeColor;\n}\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nfinalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvec3 fogColor = colorCorrect(v_fogMieColor) + finalColor.rgb * colorCorrect(v_fogRayleighColor);\n#ifndef HDR\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\n#endif\n#endif\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\nvec3 atmosphereLightDirection = czm_sunDirectionWC;\n#else\nvec3 atmosphereLightDirection = czm_lightDirectionWC;\n#endif\n#ifdef FOG\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nfloat darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);\nfogColor *= darken;\n#endif\n#ifdef HDR\nconst float modifier = 0.15;\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor, modifier), finalColor.a);\n#else\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#endif\n#endif\n#ifdef GROUND_ATMOSPHERE\nif (!czm_backFacing())\n{\nvec3 groundAtmosphereColor = computeGroundAtmosphereColor(fogColor, finalColor, atmosphereLightDirection, cameraDist);\nfinalColor = vec4(mix(finalColor.rgb, groundAtmosphereColor, fade), finalColor.a);\n}\n#endif\n#ifdef UNDERGROUND_COLOR\nif (czm_backFacing())\n{\nfloat distanceFromEllipsoid = max(czm_eyeHeight, 0.0);\nfloat distance = max(v_distance - distanceFromEllipsoid, 0.0);\nfloat blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);\nvec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);\nfinalColor = alphaBlend(undergroundColor, finalColor);\n}\n#endif\n#ifdef TRANSLUCENT\nif (inTranslucencyRectangle())\n{\nvec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\nfinalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\n}\n#endif\ngl_FragColor = finalColor;\n}\n#ifdef GROUND_ATMOSPHERE\nvec3 computeGroundAtmosphereColor(vec3 fogColor, vec4 finalColor, vec3 atmosphereLightDirection, float cameraDist)\n{\n#if defined(PER_FRAGMENT_GROUND_ATMOSPHERE) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\nfloat mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);\nvec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\nxy *= czm_viewport.zw * mpp * 0.5;\nvec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\nczm_ray ray = czm_ray(vec3(0.0), direction);\nvec3 ellipsoid_center = czm_view[3].xyz;\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\nvec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\nellipsoidPosition = (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(ellipsoidPosition, true, atmosphereLightDirection);\nvec3 groundAtmosphereColor = colorCorrect(atmosColor.mie) + finalColor.rgb * colorCorrect(atmosColor.rayleigh);\n#ifndef HDR\ngroundAtmosphereColor = vec3(1.0) - exp(-fExposure * groundAtmosphereColor);\n#endif\nfloat fadeInDist = u_nightFadeDistance.x;\nfloat fadeOutDist = u_nightFadeDistance.y;\nfloat sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#ifdef HDR\nsunlitAtmosphereIntensity = max(sunlitAtmosphereIntensity * sunlitAtmosphereIntensity, 0.03);\n#endif\ngroundAtmosphereColor = mix(groundAtmosphereColor, fogColor, sunlitAtmosphereIntensity);\n#else\nvec3 groundAtmosphereColor = fogColor;\n#endif\n#ifdef HDR\ngroundAtmosphereColor = czm_saturation(groundAtmosphereColor, 1.6);\n#endif\nreturn groundAtmosphereColor;\n}\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\n#ifdef HDR\nspecular *= 1.4;\nfloat e = 0.2;\nfloat d = 3.3;\nfloat c = 1.7;\nvec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\n#else\nvec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\n#endif\nreturn vec4(color, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n",GlobeVS="#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_slope;\nvarying float v_aspect;\nvarying float v_height;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nvarying float v_distance;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying vec3 v_fogMieColor;\nvarying vec3 v_fogRayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nvec3 normalMC = czm_octDecode(encodedNormal);\nv_normalMC = normalMC;\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION) || defined(HDR)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nAtmosphereColor atmosFogColor = computeGroundAtmosphereFromSpace(position3DWC, false, vec3(0.0));\nv_fogMieColor = atmosFogColor.mie;\nv_fogRayleighColor = atmosFogColor.rayleigh;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n#ifdef APPLY_MATERIAL\nfloat northPoleZ = czm_ellipsoidRadii.z;\nvec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\nvec3 ellipsoidNormal = normalize(v_positionMC);\nvec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\nfloat dotProd = abs(dot(ellipsoidNormal, v_normalMC));\nv_slope = acos(dotProd);\nvec3 normalRejected = ellipsoidNormal * dotProd;\nvec3 normalProjected = v_normalMC - normalRejected;\nvec3 aspectVector = normalize(normalProjected);\nv_aspect = acos(dot(aspectVector, vectorEastMC));\nfloat determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\nv_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\nv_height = height;\n#endif\n}\n",GroundAtmosphere="const float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst vec3 v3InvWavelength = vec3(5.60204474633241, 9.473284437923038, 19.64380261047721);\nconst float fScaleDepth = 0.25;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos, bool dynamicLighting, vec3 lightDirectionWC)\n{\nfloat fInnerRadius = czm_ellipsoidRadii.x;\nfloat fOuterRadius = czm_ellipsoidRadii.x * 1.025;\nfloat fOuterRadius2 = fOuterRadius * fOuterRadius;\nfloat fScale = 1.0 / (fOuterRadius - fInnerRadius);\nfloat fScaleOverScaleDepth = fScale / fScaleDepth;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = czm_branchFreeTernary(dynamicLighting, dot(lightDirectionWC, v3Pos) / length(v3Pos), 1.0);\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n";function GlobeSurfaceShader(e,t,i,r,n){this.numberOfDayTextures=e,this.flags=t,this.material=i,this.shaderProgram=r,this.clippingShaderState=n}function GlobeSurfaceShaderSet(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function getPositionMode(e){var t;switch(e){case SceneMode$1.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case SceneMode$1.SCENE2D:case SceneMode$1.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case SceneMode$1.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}function get2DYPositionFraction(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}GlobeSurfaceShaderSet.prototype.getShaderProgram=function(e){var t=e.frameState,i=e.surfaceTile,r=e.numberOfDayTextures,n=e.applyBrightness,a=e.applyContrast,o=e.applyHue,s=e.applySaturation,l=e.applyGamma,c=e.applyAlpha,u=e.applyDayNightAlpha,d=e.applySplit,h=e.showReflectiveOcean,p=e.showOceanWaves,m=e.enableLighting,f=e.dynamicAtmosphereLighting,g=e.dynamicAtmosphereLightingFromSun,_=e.showGroundAtmosphere,y=e.perFragmentGroundAtmosphere,C=e.hasVertexNormals,v=e.useWebMercatorProjection,S=e.enableFog,T=e.enableClippingPlanes,x=e.clippingPlanes,b=e.clippedByBoundaries,E=e.hasImageryLayerCutout,P=e.colorCorrect,A=e.highlightFillTile,w=e.colorToAlpha,D=e.showUndergroundColor,M=e.translucent,I=0,R="",O=i.renderedMesh.encoding;O.quantization===TerrainQuantization$1.BITS12&&(I=1,R="QUANTIZATION_BITS12");var L=0,F="";b&&(L=1,F="TILE_LIMIT_RECTANGLE");var N=0,B="";E&&(N=1,B="APPLY_IMAGERY_CUTOUT");var V=t.mode,k=V|n<<2|a<<3|o<<4|s<<5|l<<6|c<<7|h<<8|p<<9|m<<10|f<<11|g<<12|_<<13|y<<14|C<<15|v<<16|S<<17|I<<18|d<<19|T<<20|L<<21|N<<22|P<<23|A<<24|w<<25|D<<26|M<<27|u<<28,e=0;if(defined(x)&&0<x.length&&(e=T?x.clippingPlanesState:0),defined(b=i.surfaceShader)&&b.numberOfDayTextures===r&&b.flags===k&&b.material===this.material&&b.clippingShaderState===e)return b.shaderProgram;I=this._shadersByTexturesFlags[r];if(defined(I)||(I=this._shadersByTexturesFlags[r]=[]),!defined(b=I[k])||b.material!==this.material||b.clippingShaderState!==e){L=this.baseVertexShaderSource.clone(),N=this.baseFragmentShaderSource.clone();0!==e&&N.sources.unshift(getClippingFunction(x,t.context)),L.defines.push(R),N.defines.push("TEXTURE_UNITS "+r,F,B),n&&N.defines.push("APPLY_BRIGHTNESS"),a&&N.defines.push("APPLY_CONTRAST"),o&&N.defines.push("APPLY_HUE"),s&&N.defines.push("APPLY_SATURATION"),l&&N.defines.push("APPLY_GAMMA"),c&&N.defines.push("APPLY_ALPHA"),u&&N.defines.push("APPLY_DAY_NIGHT_ALPHA"),h&&(N.defines.push("SHOW_REFLECTIVE_OCEAN"),L.defines.push("SHOW_REFLECTIVE_OCEAN")),p&&N.defines.push("SHOW_OCEAN_WAVES"),w&&N.defines.push("APPLY_COLOR_TO_ALPHA"),D&&(L.defines.push("UNDERGROUND_COLOR"),N.defines.push("UNDERGROUND_COLOR")),M&&(L.defines.push("TRANSLUCENT"),N.defines.push("TRANSLUCENT")),m&&(C?(L.defines.push("ENABLE_VERTEX_LIGHTING"),N.defines.push("ENABLE_VERTEX_LIGHTING")):(L.defines.push("ENABLE_DAYNIGHT_SHADING"),N.defines.push("ENABLE_DAYNIGHT_SHADING"))),f&&(N.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),g&&N.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN")),_&&(L.defines.push("GROUND_ATMOSPHERE"),N.defines.push("GROUND_ATMOSPHERE"),y&&N.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE")),L.defines.push("INCLUDE_WEB_MERCATOR_Y"),N.defines.push("INCLUDE_WEB_MERCATOR_Y"),S&&(L.defines.push("FOG"),N.defines.push("FOG")),d&&N.defines.push("APPLY_SPLIT"),T&&N.defines.push("ENABLE_CLIPPING_PLANES"),P&&N.defines.push("COLOR_CORRECT"),A&&N.defines.push("HIGHLIGHT_FILL_TILE");var z=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)\n {\n vec4 color = initialColor;\n";E&&(z+=" vec4 cutoutAndColorResult;\n bool texelUnclipped;\n");for(var $=0;$<r;++$)z+=E?" cutoutAndColorResult = u_dayTextureCutoutRectangles["+$+"];\n texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\n cutoutAndColorResult = sampleAndBlend(\n":" color = sampleAndBlend(\n",z+=" color,\n u_dayTextures["+$+"],\n u_dayTextureUseWebMercatorT["+$+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+$+"],\n u_dayTextureTranslationAndScale["+$+"],\n "+(c?"u_dayTextureAlpha["+$+"]":"1.0")+",\n "+(u?"u_dayTextureNightAlpha["+$+"]":"1.0")+",\n"+(u?"u_dayTextureDayAlpha["+$+"]":"1.0")+",\n"+(n?"u_dayTextureBrightness["+$+"]":"0.0")+",\n "+(a?"u_dayTextureContrast["+$+"]":"0.0")+",\n "+(o?"u_dayTextureHue["+$+"]":"0.0")+",\n "+(s?"u_dayTextureSaturation["+$+"]":"0.0")+",\n "+(l?"u_dayTextureOneOverGamma["+$+"]":"0.0")+",\n "+(d?"u_dayTextureSplit["+$+"]":"0.0")+",\n "+(w?"u_colorsToAlpha["+$+"]":"vec4(0.0)")+",\n nightBlend );\n",E&&(z+=" color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n");N.sources.push(z+=" return color;\n }"),L.sources.push(getPositionMode(V)),L.sources.push(get2DYPositionFraction(v));O=ShaderProgram.fromCache({context:t.context,vertexShaderSource:L,fragmentShaderSource:N,attributeLocations:O.getAttributeLocations()}),b=I[k]=new GlobeSurfaceShader(r,k,this.material,O,e)}return(i.surfaceShader=b).shaderProgram},GlobeSurfaceShaderSet.prototype.destroy=function(){var e,t,i,r=this._shadersByTexturesFlags;for(i in r)if(r.hasOwnProperty(i)){var n=r[i];if(defined(n))for(e in n)n.hasOwnProperty(e)&&defined(t=n[e])&&t.shaderProgram.destroy()}return destroyObject(this)};var ImageryState={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ImageryState$1=Object.freeze(ImageryState),QuadtreeTileLoadState={START:0,LOADING:1,DONE:2,FAILED:3},QuadtreeTileLoadState$1=Object.freeze(QuadtreeTileLoadState),TerrainState={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},TerrainState$1=Object.freeze(TerrainState);function GlobeSurfaceTile(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new Cartesian4(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.orientedBoundingBox=void 0,this.boundingVolumeSourceTile=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new Cartesian3,this.terrainState=TerrainState$1.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new BoundingSphere,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}function getPosition(e,t,i,r,n,a){return e.decodePosition(r,n,a),defined(t)&&t!==SceneMode$1.SCENE3D&&(t=i.ellipsoid.cartesianToCartographic(a),i.project(t,a),Cartesian3.fromElements(a.z,a.x,a.y,a)),a}Object.defineProperties(GlobeSurfaceTile.prototype,{eligibleForUnloading:{get:function(){for(var e=this.terrainState,t=!(e===TerrainState$1.RECEIVING||e===TerrainState$1.TRANSFORMING),i=this.imagery,r=0,n=i.length;t&&r<n;++r)var a=i[r],t=!defined(a.loadingImagery)||a.loadingImagery.state!==ImageryState$1.TRANSITIONING;return t}},renderedMesh:{get:function(){return defined(this.vertexArray)?this.mesh:defined(this.fill)?this.fill.mesh:void 0}}});var scratchV0=new Cartesian3,scratchV1=new Cartesian3,scratchV2=new Cartesian3;function prepareNewTile(e,t,i){var r,n,a=t.getTileDataAvailable(e.x,e.y,e.level);defined(a)||!defined(e.parent)||defined(n=(r=e.parent).data)&&defined(n.terrainData)&&(a=n.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)),!1===a&&(e.data.terrainState=TerrainState$1.FAILED);for(var o=0,s=i.length;o<s;++o){var l=i.get(o);l.show&&l._createTileImagerySkeletons(e,t)}}function processTerrainStateMachine(e,t,i,r,n){var a=e.data,o=e.parent;a.terrainState===TerrainState$1.FAILED&&void 0!==o&&(void 0!==o.data&&void 0!==o.data.terrainData&&!1!==o.data.terrainData.canUpsample||GlobeSurfaceTile.processStateMachine(o,t,i,r,!0)),a.terrainState===TerrainState$1.FAILED&&upsample(a,e,t,i,e.x,e.y,e.level),a.terrainState===TerrainState$1.UNLOADED&&requestTileGeometry(a,i,e.x,e.y,e.level),a.terrainState===TerrainState$1.RECEIVED&&transform(a,t,i,e.x,e.y,e.level),a.terrainState===TerrainState$1.TRANSFORMED&&createResources$2(a,t.context,i,e.x,e.y,e.level,n),a.terrainState>=TerrainState$1.RECEIVED&&void 0===a.waterMaskTexture&&i.hasWaterMask&&(void 0!==a.terrainData.waterMask?createWaterMaskTextureIfNeeded(t.context,a):defined(t=a._findAncestorTileWithTerrainData(e))&&defined(t.data.waterMaskTexture)&&(a.waterMaskTexture=t.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,t,a.waterMaskTranslationAndScale)))}function upsample(t,e,i,r,n,a,o){var s,l,c,u=e.parent;u?(s=u.data.terrainData,l=u.x,c=u.y,u=u.level,!defined(s)||defined(o=s.upsample(r.tilingScheme,l,c,u,n,a,o))&&(t.terrainState=TerrainState$1.RECEIVING,when(o,function(e){t.terrainData=e,t.terrainState=TerrainState$1.RECEIVED},function(){t.terrainState=TerrainState$1.FAILED}))):e.state=QuadtreeTileLoadState$1.FAILED}function requestTileGeometry(t,i,r,n,a){function o(e){t.terrainData=e,t.terrainState=TerrainState$1.RECEIVED,t.request=void 0}function s(){if(t.request.state===RequestState$1.CANCELLED)return t.terrainData=void 0,t.terrainState=TerrainState$1.UNLOADED,void(t.request=void 0);t.terrainState=TerrainState$1.FAILED,t.request=void 0,i._requestError=TileProviderError.handleError(i._requestError,i,i.errorEvent,"Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+a+".",r,n,a,e)}function e(){var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.TERRAIN});t.request=e;e=i.requestTileGeometry(r,n,a,e);defined(e)?(t.terrainState=TerrainState$1.RECEIVING,when(e,o,s)):(t.terrainState=TerrainState$1.UNLOADED,t.request=void 0)}e()}GlobeSurfaceTile.prototype.pick=function(e,t,i,r,n){var a=this.renderedMesh;if(defined(a)){for(var o=a.vertices,s=a.indices,l=a.encoding,c=s.length,u=Number.MAX_VALUE,d=0;d<c;d+=3){var h=s[d],p=s[d+1],m=s[d+2],h=getPosition(l,t,i,o,h,scratchV0),p=getPosition(l,t,i,o,p,scratchV1),m=getPosition(l,t,i,o,m,scratchV2),m=IntersectionTests.rayTriangleParametric(e,h,p,m,r);defined(m)&&m<u&&0<=m&&(u=m)}return u!==Number.MAX_VALUE?Ray.getPoint(e,u,n):void 0}},GlobeSurfaceTile.prototype.freeResources=function(){defined(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=TerrainState$1.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();for(var e=this.imagery,t=0,i=e.length;t<i;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()},GlobeSurfaceTile.prototype.freeVertexArray=function(){GlobeSurfaceTile._freeVertexArray(this.vertexArray),this.vertexArray=void 0,GlobeSurfaceTile._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0},GlobeSurfaceTile.initialize=function(e,t,i){defined(e.data)||(e.data=new GlobeSurfaceTile),e.state===QuadtreeTileLoadState$1.START&&(prepareNewTile(e,t,i),e.state=QuadtreeTileLoadState$1.LOADING)},GlobeSurfaceTile.processStateMachine=function(e,t,i,r,n,a){GlobeSurfaceTile.initialize(e,i,r);var o=e.data;if(e.state===QuadtreeTileLoadState$1.LOADING&&processTerrainStateMachine(e,t,i,r,n),!a){n=e.renderable;e.renderable=defined(o.vertexArray);a=o.terrainState===TerrainState$1.READY;e.upsampledFromParent=defined(o.terrainData)&&o.terrainData.wasCreatedByUpsampling();t=o.processImagery(e,i,t);if(a&&t){var s,l=e._loadedCallbacks,c={};for(s in l)l.hasOwnProperty(s)&&(l[s](e)||(c[s]=l[s]));e._loadedCallbacks=c,e.state=QuadtreeTileLoadState$1.DONE}n&&(e.renderable=!0)}},GlobeSurfaceTile.prototype.processImagery=function(e,t,i,r){for(var n=e.data,a=e.upsampledFromParent,o=!1,s=!0,l=n.imagery,c=0,u=l.length;c<u;++c){var d=l[c];if(defined(d.loadingImagery)){if(d.loadingImagery.state===ImageryState$1.PLACEHOLDER){var h=d.loadingImagery.imageryLayer;if(h.imageryProvider.ready){d.freeResources(),l.splice(c,1),h._createTileImagerySkeletons(e,t,c),--c,u=l.length;continue}a=!1}h=d.processStateMachine(e,i,r),s=s&&h,o=o||h||defined(d.readyImagery),a=a&&defined(d.loadingImagery)&&(d.loadingImagery.state===ImageryState$1.FAILED||d.loadingImagery.state===ImageryState$1.INVALID)}else a=!1}return e.upsampledFromParent=a,e.renderable=e.renderable&&(o||s),s};var scratchCreateMeshOptions={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,throttle:!0};function transform(t,e,i,r,n,a){var o=i.tilingScheme,i=scratchCreateMeshOptions;i.tilingScheme=o,i.x=r,i.y=n,i.level=a,i.exaggeration=e.terrainExaggeration,i.throttle=!0;i=t.terrainData.createMesh(i);defined(i)&&(t.terrainState=TerrainState$1.TRANSFORMING,when(i,function(e){t.mesh=e,t.orientedBoundingBox=OrientedBoundingBox.clone(e.orientedBoundingBox,t.orientedBoundingBox),t.occludeePointInScaledSpace=Cartesian3.clone(e.occludeePointInScaledSpace,t.occludeePointInScaledSpace),t.terrainState=TerrainState$1.TRANSFORMED},function(){t.terrainState=TerrainState$1.FAILED}))}function createResources$2(e,t,i,r,n,a,o){e.vertexArray=GlobeSurfaceTile._createVertexArrayForMesh(t,e.mesh),e.terrainState=TerrainState$1.READY,e.fill=e.fill&&e.fill.destroy(o)}function getContextWaterMaskData(e){var t,i,r=e.cache.tile_waterMaskData;return defined(r)||((t=Texture.create({context:e,pixelFormat:PixelFormat$1.LUMINANCE,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}})).referenceCount=1,i=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR}),e.cache.tile_waterMaskData=r={allWaterTexture:t,sampler:i,destroy:function(){this.allWaterTexture.destroy()}}),r}function createWaterMaskTextureIfNeeded(e,t){var i=t.terrainData.waterMask,r=getContextWaterMaskData(e),n=i.length;if(1===n){if(0===i[0])return;a=r.allWaterTexture}else{var a,n=Math.sqrt(n);(a=Texture.create({context:e,pixelFormat:PixelFormat$1.LUMINANCE,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{width:n,height:n,arrayBufferView:i},sampler:r.sampler,flipY:!1})).referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,Cartesian4.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}GlobeSurfaceTile._createVertexArrayForMesh=function(e,t){var i=t.vertices,r=Buffer$1.createVertexBuffer({context:e,typedArray:i,usage:BufferUsage$1.STATIC_DRAW}),n=t.encoding.getAttributes(r),a=t.indices.indexBuffers||{},i=a[e.id];return!defined(i)||i.isDestroyed()?(r=t.indices,(i=Buffer$1.createIndexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.fromSizeInBytes(r.BYTES_PER_ELEMENT)})).vertexArrayDestroyable=!1,i.referenceCount=1,a[e.id]=i,t.indices.indexBuffers=a):++i.referenceCount,new VertexArray({context:e,attributes:n,indexBuffer:i})},GlobeSurfaceTile._freeVertexArray=function(e){var t;defined(e)&&(t=e.indexBuffer,e.destroy(),defined(t)&&!t.isDestroyed()&&defined(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy()))},GlobeSurfaceTile.prototype._findAncestorTileWithTerrainData=function(e){for(var t=e.parent;defined(t)&&(!defined(t.data)||!defined(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t},GlobeSurfaceTile.prototype._computeWaterMaskTranslationAndScale=function(e,t,i){var r=t.rectangle,n=e.rectangle,a=n.width,o=n.height,t=a/r.width,e=o/r.height;return i.x=t*(n.west-r.west)/a,i.y=e*(n.south-r.south)/o,i.z=t,i.w=e,i};var ReprojectWebMercatorFS="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n",ReprojectWebMercatorVS="attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n";function Imagery(e,t,i,r,n){this.imageryLayer=e,this.x=t,this.y=i,this.level=r,this.request=void 0,0!==r&&(this.parent=e.getImageryFromCache(t/2|0,i/2|0,r-1)),this.state=ImageryState$1.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!defined(n)&&e.imageryProvider.ready&&(n=e.imageryProvider.tilingScheme.tileXYToRectangle(t,i,r)),this.rectangle=n}Imagery.createPlaceholder=function(e){e=new Imagery(e,0,0,0);return e.addReference(),e.state=ImageryState$1.PLACEHOLDER,e},Imagery.prototype.addReference=function(){++this.referenceCount},Imagery.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),defined(this.parent)&&this.parent.releaseReference(),defined(this.image)&&defined(this.image.destroy)&&this.image.destroy(),defined(this.texture)&&this.texture.destroy(),defined(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),destroyObject(this),0):this.referenceCount},Imagery.prototype.processStateMachine=function(e,t,i){this.state!==ImageryState$1.UNLOADED||i||(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ImageryState$1.RECEIVED&&(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));i=this.state===ImageryState$1.READY&&t&&!this.texture;this.state!==ImageryState$1.TEXTURE_LOADED&&!i||(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var ImagerySplitDirection={LEFT:-1,NONE:0,RIGHT:1},ImagerySplitDirection$1=Object.freeze(ImagerySplitDirection);function TileImagery(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}function ImageryLayer(e,t){this._imageryProvider=e,t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.alpha=defaultValue(t.alpha,defaultValue(e.defaultAlpha,1)),this.nightAlpha=defaultValue(t.nightAlpha,defaultValue(e.defaultNightAlpha,1)),this.dayAlpha=defaultValue(t.dayAlpha,defaultValue(e.defaultDayAlpha,1)),this.brightness=defaultValue(t.brightness,defaultValue(e.defaultBrightness,ImageryLayer.DEFAULT_BRIGHTNESS)),this.contrast=defaultValue(t.contrast,defaultValue(e.defaultContrast,ImageryLayer.DEFAULT_CONTRAST)),this.hue=defaultValue(t.hue,defaultValue(e.defaultHue,ImageryLayer.DEFAULT_HUE)),this.saturation=defaultValue(t.saturation,defaultValue(e.defaultSaturation,ImageryLayer.DEFAULT_SATURATION)),this.gamma=defaultValue(t.gamma,defaultValue(e.defaultGamma,ImageryLayer.DEFAULT_GAMMA)),this.splitDirection=defaultValue(t.splitDirection,defaultValue(e.defaultSplit,ImageryLayer.DEFAULT_SPLIT)),this.minificationFilter=defaultValue(t.minificationFilter,defaultValue(e.defaultMinificationFilter,ImageryLayer.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=defaultValue(t.magnificationFilter,defaultValue(e.defaultMagnificationFilter,ImageryLayer.DEFAULT_MAGNIFICATION_FILTER)),this.show=defaultValue(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=defaultValue(t.rectangle,Rectangle.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new TileImagery(Imagery.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=defaultValue(t.colorToAlphaThreshold,ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}TileImagery.prototype.freeResources=function(){defined(this.readyImagery)&&this.readyImagery.releaseReference(),defined(this.loadingImagery)&&this.loadingImagery.releaseReference()},TileImagery.prototype.processStateMachine=function(e,t,i){var r=this.loadingImagery,n=r.imageryLayer;if(r.processStateMachine(t,!this.useWebMercatorT,i),r.state===ImageryState$1.READY)return defined(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this),!0;for(var a,o=r.parent;defined(o)&&(o.state!==ImageryState$1.READY||!this.useWebMercatorT&&!defined(o.texture));)o.state!==ImageryState$1.FAILED&&o.state!==ImageryState$1.INVALID&&(a=a||o),o=o.parent;return this.readyImagery!==o&&(defined(this.readyImagery)&&this.readyImagery.releaseReference(),defined(this.readyImagery=o)&&(o.addReference(),this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this))),(r.state===ImageryState$1.FAILED||r.state===ImageryState$1.INVALID)&&(!defined(a)||(a.processStateMachine(t,!this.useWebMercatorT,i),!1))},Object.defineProperties(ImageryLayer.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),ImageryLayer.DEFAULT_BRIGHTNESS=1,ImageryLayer.DEFAULT_CONTRAST=1,ImageryLayer.DEFAULT_HUE=0,ImageryLayer.DEFAULT_SATURATION=1,ImageryLayer.DEFAULT_GAMMA=1,ImageryLayer.DEFAULT_SPLIT=ImagerySplitDirection$1.NONE,ImageryLayer.DEFAULT_MINIFICATION_FILTER=TextureMinificationFilter$1.LINEAR,ImageryLayer.DEFAULT_MAGNIFICATION_FILTER=TextureMagnificationFilter$1.LINEAR,ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004,ImageryLayer.prototype.isBaseLayer=function(){return this._isBaseLayer},ImageryLayer.prototype.isDestroyed=function(){return!1},ImageryLayer.prototype.destroy=function(){return destroyObject(this)};var imageryBoundsScratch=new Rectangle,tileImageryBoundsScratch=new Rectangle,clippedRectangleScratch=new Rectangle,terrainRectangleScratch=new Rectangle;function getSamplerKey(e,t,i){return e+":"+t+":"+i}function getImageryCacheKey(e,t,i){return JSON.stringify([e,t,i])}ImageryLayer.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return Rectangle.intersection(e.rectangle,t)})},ImageryLayer.prototype._createTileImagerySkeletons=function(e,t,i){var r=e.data;if(defined(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(defined(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var n=this._imageryProvider;if(defined(i)||(i=r.imagery.length),!n.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;var a=n.tilingScheme.projection instanceof WebMercatorProjection&&e.rectangle.north<WebMercatorProjection.MaximumLatitude&&e.rectangle.south>-WebMercatorProjection.MaximumLatitude,o=Rectangle.intersection(n.rectangle,this._rectangle,imageryBoundsScratch);if(!defined(c=Rectangle.intersection(e.rectangle,o,tileImageryBoundsScratch))){if(!this.isBaseLayer())return!1;var s=o,l=e.rectangle,c=tileImageryBoundsScratch;l.south>=s.north?c.north=c.south=s.north:l.north<=s.south?c.north=c.south=s.south:(c.south=Math.max(l.south,s.south),c.north=Math.min(l.north,s.north)),l.west>=s.east?c.west=c.east=s.east:l.east<=s.west?c.west=c.east=s.west:(c.west=Math.max(l.west,s.west),c.east=Math.min(l.east,s.east))}s=0;0<c.south?s=c.south:c.north<0&&(s=c.north);var u=getLevelWithMaximumTexelSpacing(this,+t.getLevelMaximumGeometricError(e.level),s),u=Math.max(0,u),s=n.maximumLevel;s<u&&(u=s),!defined(n.minimumLevel)||u<(s=n.minimumLevel)&&(u=s);var n=n.tilingScheme,d=n.positionToTileXY(Rectangle.northwest(c),u),h=n.positionToTileXY(Rectangle.southeast(c),u),p=e.rectangle.width/512,m=e.rectangle.height/512,c=n.tileXYToRectangle(d.x,d.y,u);Math.abs(c.south-e.rectangle.north)<m&&d.y<h.y&&++d.y,Math.abs(c.east-e.rectangle.west)<p&&d.x<h.x&&++d.x;c=n.tileXYToRectangle(h.x,h.y,u);Math.abs(c.north-e.rectangle.south)<m&&h.y>d.y&&--h.y,Math.abs(c.west-e.rectangle.east)<p&&h.x>d.x&&--h.x;var f,g,_=Rectangle.clone(e.rectangle,terrainRectangleScratch),y=n.tileXYToRectangle(d.x,d.y,u),C=Rectangle.intersection(y,o,clippedRectangleScratch);a?(n.rectangleToNativeRectangle(_,_),n.rectangleToNativeRectangle(y,y),n.rectangleToNativeRectangle(C,C),n.rectangleToNativeRectangle(o,o),f=n.tileXYToNativeRectangle.bind(n),p=_.width/512,m=_.height/512):f=n.tileXYToRectangle.bind(n);var v=0,S=1;!this.isBaseLayer()&&Math.abs(C.west-_.west)>=p&&(v=Math.min(1,(C.west-_.west)/_.width));for(var T=S=!this.isBaseLayer()&&Math.abs(C.north-_.north)>=m?Math.max(0,(C.north-_.south)/_.height):S,x=d.x;x<=h.x;x++)if(g=v,y=f(x,d.y,u),defined(C=Rectangle.simpleIntersection(y,o,clippedRectangleScratch))){v=Math.min(1,(C.east-_.west)/_.width),x===h.x&&(this.isBaseLayer()||Math.abs(C.east-_.east)<p)&&(v=1),S=T;for(var b=d.y;b<=h.y;b++){var E,P=S,y=f(x,b,u);defined(C=Rectangle.simpleIntersection(y,o,clippedRectangleScratch))&&(S=Math.max(0,(C.south-_.south)/_.height),E=new Cartesian4(g,S=b===h.y&&(this.isBaseLayer()||Math.abs(C.south-_.south)<m)?0:S,v,P),P=this.getImageryFromCache(x,b,u),r.imagery.splice(i,0,new TileImagery(P,E,a)),++i)}}return!0},ImageryLayer.prototype._calculateTextureTranslationAndScale=function(e,t){var i=t.readyImagery.rectangle,r=e.rectangle;t.useWebMercatorT&&(i=(a=t.readyImagery.imageryLayer.imageryProvider.tilingScheme).rectangleToNativeRectangle(i,imageryBoundsScratch),r=a.rectangleToNativeRectangle(r,terrainRectangleScratch));var n=r.width,e=r.height,t=n/i.width,a=e/i.height;return new Cartesian4(t*(r.west-i.west)/n,a*(r.south-i.south)/e,t,a)},ImageryLayer.prototype._requestImagery=function(i){var r=this._imageryProvider,n=this;function t(e){if(!defined(e))return a();i.image=e,i.state=ImageryState$1.RECEIVED,i.request=void 0,TileProviderError.handleSuccess(n._requestImageError)}function a(e){if(i.request.state===RequestState$1.CANCELLED)return i.state=ImageryState$1.UNLOADED,void(i.request=void 0);i.state=ImageryState$1.FAILED,i.request=void 0;var t="Failed to obtain image tile X: "+i.x+" Y: "+i.y+" Level: "+i.level+".";n._requestImageError=TileProviderError.handleError(n._requestImageError,r,r.errorEvent,t,i.x,i.y,i.level,o,e)}function o(){var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.IMAGERY});i.request=e,i.state=ImageryState$1.TRANSITIONING;e=r.requestImage(i.x,i.y,i.level,e);if(!defined(e))return i.state=ImageryState$1.UNLOADED,void(i.request=void 0);defined(r.getTileCredits)&&(i.credits=r.getTileCredits(i.x,i.y,i.level)),when(e,t,a)}o()},ImageryLayer.prototype._createTextureWebGL=function(e,t){var i=new Sampler({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),t=t.image;return defined(t.internalFormat)?new Texture({context:e,pixelFormat:t.internalFormat,width:t.width,height:t.height,source:{arrayBufferView:t.bufferView},sampler:i}):new Texture({context:e,source:t,pixelFormat:this._imageryProvider.hasAlphaChannel?PixelFormat$1.RGBA:PixelFormat$1.RGB,sampler:i})},ImageryLayer.prototype._createTexture=function(e,t){var i=this._imageryProvider,r=t.image;if(defined(i.tileDiscardPolicy)){var n=i.tileDiscardPolicy;if(defined(n)){if(!n.isReady())return void(t.state=ImageryState$1.RECEIVED);if(n.shouldDiscardImage(r))return void(t.state=ImageryState$1.INVALID)}}e=this._createTextureWebGL(e,t);i.tilingScheme.projection instanceof WebMercatorProjection?t.textureWebMercator=e:t.texture=e,t.image=void 0,t.state=ImageryState$1.TEXTURE_LOADED},ImageryLayer.prototype._finalizeReprojectTexture=function(e,t){var i,r,n,a,o=this.minificationFilter,s=this.magnificationFilter;o===TextureMinificationFilter$1.LINEAR&&s===TextureMagnificationFilter$1.LINEAR&&!PixelFormat$1.isCompressedFormat(t.pixelFormat)&&CesiumMath.isPowerOfTwo(t.width)&&CesiumMath.isPowerOfTwo(t.height)?(o=TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR,a=ContextLimits.maximumTextureFilterAnisotropy,i=getSamplerKey(o,s,n=Math.min(a,defaultValue(this._maximumAnisotropy,a))),defined(r=e.cache.imageryLayerMipmapSamplers)||(e.cache.imageryLayerMipmapSamplers=r={}),defined(a=r[i])||(a=r[i]=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:o,magnificationFilter:s,maximumAnisotropy:n})),t.generateMipmap(MipmapHint$1.NICEST),t.sampler=a):(n=getSamplerKey(o,s,0),defined(a=e.cache.imageryLayerNonMipmapSamplers)||(e.cache.imageryLayerNonMipmapSamplers=a={}),defined(e=a[n])||(e=a[n]=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:o,magnificationFilter:s})),t.sampler=e)},ImageryLayer.prototype._reprojectTexture=function(e,t,i){var r,n=t.textureWebMercator||t.texture,a=t.rectangle,o=e.context;(i=defaultValue(i,!0))&&!(this._imageryProvider.tilingScheme.projection instanceof GeographicProjection)&&1e-5<a.width/n.width?(r=this,t.addReference(),a=new ComputeCommand({persists:!0,owner:this,preExecute:function(e){reprojectToGeographic(e,o,n,t.rectangle)},postExecute:function(e){t.texture=e,r._finalizeReprojectTexture(o,e),t.state=ImageryState$1.READY,t.releaseReference()},canceled:function(){t.state=ImageryState$1.TEXTURE_LOADED,t.releaseReference()}}),this._reprojectComputeCommands.push(a)):(i&&(t.texture=n),this._finalizeReprojectTexture(o,n),t.state=ImageryState$1.READY)},ImageryLayer.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},ImageryLayer.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){defined(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0},ImageryLayer.prototype.getImageryFromCache=function(e,t,i,r){var n=getImageryCacheKey(e,t,i),a=this._imageryCache[n];return defined(a)||(a=new Imagery(this,e,t,i,r),this._imageryCache[n]=a),a.addReference(),a},ImageryLayer.prototype.removeImageryFromCache=function(e){e=getImageryCacheKey(e.x,e.y,e.level);delete this._imageryCache[e]};var uniformMap={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new Cartesian2,texture:void 0},float32ArrayScratch=FeatureDetection.supportsTypedArrays()?new Float32Array(128):void 0;function reprojectToGeographic(e,t,i,r){if(!defined(n=t.cache.imageryLayer_reproject)){for(var n=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){defined(this.framebuffer)&&this.framebuffer.destroy(),defined(this.vertexArray)&&this.vertexArray.destroy(),defined(this.shaderProgram)&&this.shaderProgram.destroy()}},a=new Float32Array(256),o=0,s=0;s<64;++s){var l=s/63;a[o++]=0,a[o++]=l,a[o++]=1,a[o++]=l}var c={position:0,webMercatorT:1},u=TerrainProvider.getRegularGridIndices(2,64),u=Buffer$1.createIndexBuffer({context:t,typedArray:u,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT});n.vertexArray=new VertexArray({context:t,attributes:[{index:c.position,vertexBuffer:Buffer$1.createVertexBuffer({context:t,typedArray:a,usage:BufferUsage$1.STATIC_DRAW}),componentsPerAttribute:2},{index:c.webMercatorT,vertexBuffer:Buffer$1.createVertexBuffer({context:t,sizeInBytes:512,usage:BufferUsage$1.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:u});u=new ShaderSource({sources:[ReprojectWebMercatorVS]});n.shaderProgram=ShaderProgram.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:ReprojectWebMercatorFS,attributeLocations:c}),n.sampler=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}i.sampler=n.sampler;u=i.width,c=i.height;uniformMap.textureDimensions.x=u,uniformMap.textureDimensions.y=c,uniformMap.texture=i;var d=Math.sin(r.south),h=.5*Math.log((1+d)/(1-d));d=Math.sin(r.north);var p=1/(.5*Math.log((1+d)/(1-d))-h),i=new Texture({context:t,width:u,height:c,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});CesiumMath.isPowerOfTwo(u)&&CesiumMath.isPowerOfTwo(c)&&i.generateMipmap(MipmapHint$1.NICEST);for(var m=r.south,f=r.north,g=float32ArrayScratch,_=0,y=0;y<64;++y){var C=CesiumMath.lerp(m,f,y/63),d=Math.sin(C),C=(.5*Math.log((1+d)/(1-d))-h)*p;g[_++]=C,g[_++]=C}n.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(g),e.shaderProgram=n.shaderProgram,e.outputTexture=i,e.uniformMap=uniformMap,e.vertexArray=n.vertexArray}function getLevelWithMaximumTexelSpacing(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,a=n.ellipsoid,e=e._imageryProvider.tilingScheme.projection instanceof GeographicProjection?1:Math.cos(i),i=n.rectangle,n=a.maximumRadius*i.width*e/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),t=Math.log(n/t)/Math.log(2);return 0|Math.round(t)}var TileSelectionResult={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>=TileSelectionResult.RENDERED_AND_KICKED},originalResult:function(e){return 3&e},kick:function(e){return 4|e}};function TerrainFillMesh(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 Cartesian4}TerrainFillMesh.prototype.update=function(e,t,i){this.changedThisFrame&&(createFillMesh(e,t,this.tile,i),this.changedThisFrame=!1)},TerrainFillMesh.prototype.destroy=function(e){defined(this.vertexArray)&&(defined(e)?e.push(this.vertexArray):GlobeSurfaceTile._freeVertexArray(this.vertexArray,e),this.vertexArray=void 0),defined(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};var traversalQueueScratch=new Queue;function visitRenderedTiles(e,t,i,r,n,a,o,s,l){if(void 0!==r){for(var c=r;c&&(c._lastSelectionResultFrame!==n||TileSelectionResult.wasKicked(c._lastSelectionResult)||TileSelectionResult.originalResult(c._lastSelectionResult)===TileSelectionResult.CULLED);){if(o)return;var u=c.parent;if(a>=TileEdge.NORTHWEST&&void 0!==u)switch(a){case TileEdge.NORTHWEST:c=c===u.northwestChild?u:void 0;break;case TileEdge.NORTHEAST:c=c===u.northeastChild?u:void 0;break;case TileEdge.SOUTHWEST:c=c===u.southwestChild?u:void 0;break;case TileEdge.SOUTHEAST:c=c===u.southeastChild?u:void 0}else c=u}if(void 0!==c){if(c._lastSelectionResult===TileSelectionResult.RENDERED)return!defined(c.data.vertexArray)&&void visitTile$1(e,t,i,c,a,n,s,l);if(TileSelectionResult.originalResult(r._lastSelectionResult)!==TileSelectionResult.CULLED)switch(a){case TileEdge.WEST:visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l);break;case TileEdge.EAST:visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l);break;case TileEdge.SOUTH:visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l);break;case TileEdge.NORTH:visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l);break;case TileEdge.NORTHWEST:visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l);break;case TileEdge.NORTHEAST:visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l);break;case TileEdge.SOUTHWEST:visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l);break;case TileEdge.SOUTHEAST:visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l);break;default:throw new DeveloperError("Invalid edge")}}}}function visitTile$1(e,t,i,r,n,a,o,s){var l=r.data;if(void 0===l.fill)l.fill=new TerrainFillMesh(r);else if(l.fill.visitedFrame===a)return;l.fill.enqueuedFrame!==a&&(l.fill.enqueuedFrame=a,l.fill.changedThisFrame=!1,o.enqueue(r)),propagateEdge(e,t,i,r,n,s)}function propagateEdge(e,t,i,r,n,a){var o,s,l,c,u,d=r.data.fill,h=i.data.fill,p=defined(h)?(h.visitedFrame=t.frameNumber,h.changedThisFrame&&(createFillMesh(e,t,i,a),h.changedThisFrame=!1),i.data.fill.mesh):i.data.mesh;switch(n){case TileEdge.WEST:o=d.westMeshes,s=d.westTiles;break;case TileEdge.SOUTH:o=d.southMeshes,s=d.southTiles;break;case TileEdge.EAST:o=d.eastMeshes,s=d.eastTiles;break;case TileEdge.NORTH:o=d.northMeshes,s=d.northTiles;break;case TileEdge.NORTHWEST:return d.changedThisFrame=d.changedThisFrame||d.northwestMesh!==p,d.northwestMesh=p,void(d.northwestTile=i);case TileEdge.NORTHEAST:return d.changedThisFrame=d.changedThisFrame||d.northeastMesh!==p,d.northeastMesh=p,void(d.northeastTile=i);case TileEdge.SOUTHWEST:return d.changedThisFrame=d.changedThisFrame||d.southwestMesh!==p,d.southwestMesh=p,void(d.southwestTile=i);case TileEdge.SOUTHEAST:return d.changedThisFrame=d.changedThisFrame||d.southeastMesh!==p,d.southeastMesh=p,void(d.southeastTile=i)}if(i.level<=r.level)return d.changedThisFrame=d.changedThisFrame||o[0]!==p||1!==o.length,o[0]=p,s[0]=i,o.length=1,void(s.length=1);var m,f=i.rectangle,g=r.rectangle;switch(n){case TileEdge.WEST:for(m=(g.north-g.south)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.greaterThan(f.north,u.south,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.greaterThanOrEquals(f.south,u.north,m));++c);break;case TileEdge.SOUTH:for(m=(g.east-g.west)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.lessThan(f.west,u.east,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.lessThanOrEquals(f.east,u.west,m));++c);break;case TileEdge.EAST:for(m=(g.north-g.south)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.lessThan(f.south,u.north,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.lessThanOrEquals(f.north,u.south,m));++c);break;case TileEdge.NORTH:for(m=(g.east-g.west)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.greaterThan(f.east,u.west,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.greaterThanOrEquals(f.west,u.east,m));++c);}c-l==1?(d.changedThisFrame=d.changedThisFrame||o[l]!==p,o[l]=p,s[l]=i):(d.changedThisFrame=!0,o.splice(l,c-l,p),s.splice(l,c-l,i))}TerrainFillMesh.updateFillTiles=function(e,t,i,r){var n=e._quadtree,a=n._levelZeroTiles,o=n._lastSelectionFrameNumber,s=traversalQueueScratch;s.clear();for(var l=0;l<t.length;++l)defined(t[l].data.vertexArray)&&s.enqueue(t[l]);for(var c=s.dequeue();void 0!==c;){var u=c.findTileToWest(a),d=c.findTileToSouth(a),h=c.findTileToEast(a),p=c.findTileToNorth(a);visitRenderedTiles(e,i,c,u,o,TileEdge.EAST,!1,s,r),visitRenderedTiles(e,i,c,d,o,TileEdge.NORTH,!1,s,r),visitRenderedTiles(e,i,c,h,o,TileEdge.WEST,!1,s,r),visitRenderedTiles(e,i,c,p,o,TileEdge.SOUTH,!1,s,r);d=u.findTileToNorth(a),p=u.findTileToSouth(a),u=h.findTileToNorth(a),h=h.findTileToSouth(a);visitRenderedTiles(e,i,c,d,o,TileEdge.SOUTHEAST,!1,s,r),visitRenderedTiles(e,i,c,u,o,TileEdge.SOUTHWEST,!1,s,r),visitRenderedTiles(e,i,c,p,o,TileEdge.NORTHEAST,!1,s,r),visitRenderedTiles(e,i,c,h,o,TileEdge.NORTHWEST,!1,s,r),c=s.dequeue()}};var cartographicScratch=new Cartographic,centerCartographicScratch=new Cartographic,cartesianScratch=new Cartesian3,normalScratch=new Cartesian3,octEncodedNormalScratch=new Cartesian2,uvScratch2=new Cartesian2,uvScratch=new Cartesian2;function HeightAndNormal(){this.height=0,this.encodedNormal=new Cartesian2}function fillMissingCorner(e,t,i,r,n,a,o,s,l){if(defined(n))return n;var c=defined(a)&&defined(o)?.5*(a.height+o.height):defined(a)?a.height:defined(o)?o.height:defined(s)?s.height:(c=o=0,defined(s=e.tile.data.tileBoundingRegion)&&(o=s.minimumHeight,c=s.maximumHeight),.5*(o+c));return getVertexWithHeightAtCorner(e,t,i,r,c,l),l}var heightRangeScratch={minimumHeight:0,maximumHeight:0},swVertexScratch=new HeightAndNormal,seVertexScratch=new HeightAndNormal,nwVertexScratch=new HeightAndNormal,neVertexScratch=new HeightAndNormal,heightmapBuffer="undefined"!=typeof Uint8Array?new Uint8Array(81):void 0,scratchCreateMeshSyncOptions={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1};function createFillMesh(e,t,i,r){GlobeSurfaceTile.initialize(i,e.terrainProvider,e._imageryLayers);var n=i.data,a=n.fill,o=i.rectangle,s=i.tilingScheme.ellipsoid,l=getCorner(a,s,0,1,a.northwestTile,a.northwestMesh,a.northTiles,a.northMeshes,a.westTiles,a.westMeshes,nwVertexScratch),c=getCorner(a,s,0,0,a.southwestTile,a.southwestMesh,a.westTiles,a.westMeshes,a.southTiles,a.southMeshes,swVertexScratch),u=getCorner(a,s,1,0,a.southeastTile,a.southeastMesh,a.southTiles,a.southMeshes,a.eastTiles,a.eastMeshes,seVertexScratch),l=fillMissingCorner(a,s,0,1,l,c,d=getCorner(a,s,1,1,a.northeastTile,a.northeastMesh,a.eastTiles,a.eastMeshes,a.northTiles,a.northMeshes,neVertexScratch),u,nwVertexScratch),c=fillMissingCorner(a,s,0,0,c,l,u,d,swVertexScratch),u=fillMissingCorner(a,s,1,1,u,c,d,l,seVertexScratch),d=fillMissingCorner(a,s,1,1,d,u,l,c,neVertexScratch),h=c.height,p=u.height,m=l.height,f=d.height,h=.5*((P=Math.min(h,p,m,f))+(A=Math.max(h,p,m,f))),p=e.getLevelMaximumGeometricError(i.level),m=s.maximumRadius-p,f=4*Math.acos(m/s.maximumRadius);if(o.width>(f*=1.5)&&A-P<=p){var g=new HeightmapTerrainData({width:9,height:9,buffer:heightmapBuffer,structure:{heightOffset:A}}),_=scratchCreateMeshSyncOptions;_.tilingScheme=i.tilingScheme,_.x=i.x,_.y=i.y,_.level=i.level,a.mesh=g._createMeshSync(_)}else{var y=new TerrainEncoding(void 0,void 0,void 0,void 0,!0,!0),m=centerCartographicScratch;m.longitude=.5*(o.east+o.west),m.latitude=.5*(o.north+o.south),m.height=h,y.center=s.cartographicToCartesian(m,y.center);for(var C=5,v=a.westMeshes,S=0,T=v.length;S<T;++S)C+=v[S].eastIndicesNorthToSouth.length;for(S=0,T=(v=a.southMeshes).length;S<T;++S)C+=v[S].northIndicesWestToEast.length;for(S=0,T=(v=a.eastMeshes).length;S<T;++S)C+=v[S].westIndicesSouthToNorth.length;for(S=0,T=(v=a.northMeshes).length;S<T;++S)C+=v[S].southIndicesEastToWest.length;f=heightRangeScratch;f.minimumHeight=P,f.maximumHeight=A;var p=y.getStride(),g=0,x=g=addEdge(a,s,y,_=new Float32Array(C*p),g=addVertexWithComputedPosition(s,o,y,_,0,0,1,l.height,l.encodedNormal,1,f),a.westTiles,a.westMeshes,TileEdge.EAST,f),b=g=addEdge(a,s,y,_,g=addVertexWithComputedPosition(s,o,y,_,g,0,0,c.height,c.encodedNormal,0,f),a.southTiles,a.southMeshes,TileEdge.NORTH,f),E=g=addEdge(a,s,y,_,g=addVertexWithComputedPosition(s,o,y,_,g,1,0,u.height,u.encodedNormal,0,f),a.eastTiles,a.eastMeshes,TileEdge.WEST,f);g=addEdge(a,s,y,_,g=addVertexWithComputedPosition(s,o,y,_,g,1,1,d.height,d.encodedNormal,1,f),a.northTiles,a.northMeshes,TileEdge.SOUTH,f);var P=f.minimumHeight,A=f.maximumHeight,u=OrientedBoundingBox.fromRectangle(o,P,A,i.tilingScheme.ellipsoid),d=WebMercatorProjection.geodeticLatitudeToMercatorAngle(o.south),f=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(o.north)-d),f=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(m.latitude)-d)*f;s.geodeticSurfaceNormalCartographic(cartographicScratch,normalScratch);var s=AttributeCompression.octEncode(normalScratch,octEncodedNormalScratch),w=g;y.encode(_,g*p,u.center,Cartesian2.fromElements(.5,.5,uvScratch),h,s,f);var D,M=++g,f=3*(M-1);D=f*(M<256?1:2)<=(_.length-M*p)*Float32Array.BYTES_PER_ELEMENT?(g=M*p*Float32Array.BYTES_PER_ELEMENT,new(M<256?Uint8Array:Uint16Array)(_.buffer,g,f)):new(M<256?Uint8Array:Uint16Array)(f);var _=new Float32Array(_.buffer,0,M*p),I=0;for(S=0;S<M-2;++S)D[I++]=w,D[I++]=S,D[I++]=S+1;D[I++]=w,D[I++]=S,D[I++]=0;var R=[];for(S=x;0<=S;--S)R.push(S);var O=[];for(S=b;x<=S;--S)O.push(S);var L=[];for(S=E;b<=S;--S)L.push(S);var F=[];for(F.push(0),S=w-1;E<=S;--S)F.push(S);a.mesh=new TerrainMesh(y.center,_,D,f,M,P,A,BoundingSphere.fromOrientedBoundingBox(u),computeOccludeePoint$1(e,u.center,o,P,A),y.getStride(),u,y,t.terrainExaggeration,R,O,L,F)}y=t.context;defined(a.vertexArray)&&(defined(r)?r.push(a.vertexArray):GlobeSurfaceTile._freeVertexArray(a.vertexArray)),a.vertexArray=GlobeSurfaceTile._createVertexArrayForMesh(y,a.mesh),n.processImagery(i,e.terrainProvider,t,!0);t=a.waterMaskTexture;a.waterMaskTexture=void 0,!e.terrainProvider.hasWaterMask||defined(e=n._findAncestorTileWithTerrainData(i))&&defined(e.data.waterMaskTexture)&&(a.waterMaskTexture=e.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,n._computeWaterMaskTranslationAndScale(i,e,a.waterMaskTranslationAndScale)),defined(t)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function addVertexWithComputedPosition(e,t,i,r,n,a,o,s,l,c,u){var d=cartographicScratch;d.longitude=CesiumMath.lerp(t.west,t.east,a),d.latitude=CesiumMath.lerp(t.south,t.north,o),d.height=s;e=e.cartographicToCartesian(d,cartesianScratch),d=uvScratch2;return d.x=a,d.y=o,i.encode(r,n*i.getStride(),e,d,s,l,c),u.minimumHeight=Math.min(u.minimumHeight,s),u.maximumHeight=Math.max(u.maximumHeight,s),n+1}var sourceRectangleScratch=new Rectangle;function transformTextureCoordinates(e,t,i,r){var n=e.rectangle,a=t.rectangle;0===t.x&&1===i.x&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?((n=Rectangle.clone(e.rectangle,sourceRectangleScratch)).west-=CesiumMath.TWO_PI,n.east-=CesiumMath.TWO_PI):0===e.x&&0===i.x&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&((n=Rectangle.clone(e.rectangle,sourceRectangleScratch)).west+=CesiumMath.TWO_PI,n.east+=CesiumMath.TWO_PI);var o=n.east-n.west,s=(a.west-n.west)/o,t=(a.east-n.west)/o,e=n.north-n.south,o=(a.south-n.south)/e,e=(a.north-n.south)/e,s=(i.x-s)/(t-s),o=(i.y-o)/(e-o);return Math.abs(s)<Math.EPSILON5?s=0:Math.abs(s-1)<Math.EPSILON5&&(s=1),Math.abs(o)<Math.EPSILON5?o=0:Math.abs(o-1)<Math.EPSILON5&&(o=1),r.x=s,r.y=o,r}var encodedNormalScratch=new Cartesian2;function getVertexFromTileAtCorner(e,t,i,r,n){var a=e.encoding,e=e.vertices;n.height=a.decodeHeight(e,t),a.hasVertexNormals?a.getOctEncodedNormal(e,t,n.encodedNormal):((n=n.encodedNormal).x=0,n.y=0)}var encodedNormalScratch2=new Cartesian2,cartesianScratch2=new Cartesian3;function getInterpolatedVertexAtCorner(e,t,i,r,n,a,o,s,l,c){var u,d=r.encoding,h=r.vertices,r=transformTextureCoordinates(t,i,d.decodeTextureCoordinates(h,n,uvScratch),uvScratch),t=transformTextureCoordinates(t,i,d.decodeTextureCoordinates(h,a,uvScratch2),uvScratch2),l=l?(o-r.x)/(t.x-r.x):(s-r.y)/(t.y-r.y),t=d.decodeHeight(h,n),r=d.decodeHeight(h,a),i=i.rectangle;cartographicScratch.longitude=CesiumMath.lerp(i.west,i.east,o),cartographicScratch.latitude=CesiumMath.lerp(i.south,i.north,s),c.height=cartographicScratch.height=CesiumMath.lerp(t,r,l),d.hasVertexNormals?(n=d.getOctEncodedNormal(h,n,encodedNormalScratch),u=d.getOctEncodedNormal(h,a,encodedNormalScratch2),n=AttributeCompression.octDecode(n.x,n.y,cartesianScratch),u=AttributeCompression.octDecode(u.x,u.y,cartesianScratch2),u=Cartesian3.lerp(n,u,l,cartesianScratch),Cartesian3.normalize(u,u)):u=e.geodeticSurfaceNormalCartographic(cartographicScratch,cartesianScratch),AttributeCompression.octEncode(u,c.encodedNormal)}function getVertexWithHeightAtCorner(e,t,i,r,n,a){a.height=n;t=t.geodeticSurfaceNormalCartographic(cartographicScratch,cartesianScratch);AttributeCompression.octEncode(t,a.encodedNormal)}function getCorner(e,t,i,r,n,a,o,s,l,c,u){return getCornerFromEdge(e,t,s,o,!1,i,r,u)||getCornerFromEdge(e,t,c,l,!0,i,r,u)?u:meshIsUsable(n,a)?(getVertexFromTileAtCorner(a,(0===i?0===r?a.eastIndicesNorthToSouth:a.southIndicesEastToWest:0===r?a.northIndicesWestToEast:a.westIndicesSouthToNorth)[0],i,r,u),u):defined(a=0===i?0===r?getClosestHeightToCorner(e.westMeshes,e.westTiles,TileEdge.EAST,e.southMeshes,e.southTiles,TileEdge.NORTH):getClosestHeightToCorner(e.northMeshes,e.northTiles,TileEdge.SOUTH,e.westMeshes,e.westTiles,TileEdge.EAST):0===r?getClosestHeightToCorner(e.southMeshes,e.southTiles,TileEdge.NORTH,e.eastMeshes,e.eastTiles,TileEdge.WEST):getClosestHeightToCorner(e.eastMeshes,e.eastTiles,TileEdge.WEST,e.northMeshes,e.northTiles,TileEdge.SOUTH))?(getVertexWithHeightAtCorner(e,t,i,r,a,u),u):void 0}function getClosestHeightToCorner(e,t,i,r,n,a,o,s){i=getNearestHeightOnEdge(e,t,!1,i),a=getNearestHeightOnEdge(r,n,!0,a);return defined(i)&&defined(a)?.5*(i+a):defined(i)?i:a}function addEdge(e,t,i,r,n,a,o,s,l){for(var c=0;c<a.length;++c)n=addEdgeMesh(e,t,i,r,n,a[c],o[c],s,l);return n}function addEdgeMesh(e,t,i,r,n,a,o,s,l){var c=a.rectangle;s===TileEdge.EAST&&0===e.tile.x?((c=Rectangle.clone(a.rectangle,sourceRectangleScratch)).west-=CesiumMath.TWO_PI,c.east-=CesiumMath.TWO_PI):s===TileEdge.WEST&&0===a.x&&((c=Rectangle.clone(a.rectangle,sourceRectangleScratch)).west+=CesiumMath.TWO_PI,c.east+=CesiumMath.TWO_PI);var u,d,h,p,m=e.tile.rectangle;switch(0<n&&(i.decodeTextureCoordinates(r,n-1,uvScratch),u=uvScratch.x,d=uvScratch.y),s){case TileEdge.WEST:h=o.westIndicesSouthToNorth,p=!1;break;case TileEdge.NORTH:h=o.northIndicesWestToEast,p=!0;break;case TileEdge.EAST:h=o.eastIndicesNorthToSouth,p=!1;break;case TileEdge.SOUTH:h=o.southIndicesEastToWest,p=!0}var f,g,_=a,y=e.tile,C=o.encoding,v=o.vertices,S=i.getStride();C.hasWebMercatorT&&(f=WebMercatorProjection.geodeticLatitudeToMercatorAngle(m.south),g=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(m.north)-f));for(var T=0;T<h.length;++T){var x=h[T],b=C.decodeTextureCoordinates(v,x,uvScratch);transformTextureCoordinates(_,y,b,b);var E,P=b.x,A=b.y,w=p?P:A;w<0||1<w||Math.abs(P-u)<CesiumMath.EPSILON5&&Math.abs(A-d)<CesiumMath.EPSILON5||(w=Math.abs(P)<CesiumMath.EPSILON5||Math.abs(P-1)<CesiumMath.EPSILON5,P=Math.abs(A)<CesiumMath.EPSILON5||Math.abs(A-1)<CesiumMath.EPSILON5,w&&P||(w=C.decodePosition(v,x,cartesianScratch),P=C.decodeHeight(v,x),C.hasVertexNormals?E=C.getOctEncodedNormal(v,x,octEncodedNormalScratch):((E=octEncodedNormalScratch).x=0,E.y=0),x=A,C.hasWebMercatorT&&(A=CesiumMath.lerp(m.south,m.north,A),x=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(A)-f)*g),i.encode(r,n*S,w,b,P,E,x),l.minimumHeight=Math.min(l.minimumHeight,P),l.maximumHeight=Math.max(l.maximumHeight,P),++n))}return n}function getNearestHeightOnEdge(e,t,i,r,n,a){for(var o,s,l=i?(o=0,s=e.length,1):(o=e.length-1,s=-1),c=o;c!==s;c+=l){var u,d=e[c];if(meshIsUsable(t[c],d)){switch(r){case TileEdge.WEST:u=d.westIndicesSouthToNorth;break;case TileEdge.SOUTH:u=d.southIndicesEastToWest;break;case TileEdge.EAST:u=d.eastIndicesNorthToSouth;break;case TileEdge.NORTH:u=d.northIndicesWestToEast}var h=u[i?0:u.length-1];if(defined(h))return d.encoding.decodeHeight(d.vertices,h)}}}function meshIsUsable(e,t){return defined(t)&&(!defined(e.data.fill)||!e.data.fill.changedThisFrame)}function getCornerFromEdge(i,e,t,r,n,a,o,s){var l,c,u,d=r[n?0:t.length-1],h=t[n?0:t.length-1];if(meshIsUsable(d,h)&&(u=0===a?0===o?(l=n?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,c=n):(l=n?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,c=!n,!1):0===o?(l=n?h.westIndicesSouthToNorth:h.northIndicesWestToEast,c=!n,!0):(l=n?h.southIndicesEastToWest:h.westIndicesSouthToNorth,!(c=n)),0<l.length)){t=l[r=n?0:l.length-1],h.encoding.decodeTextureCoordinates(h.vertices,t,uvScratch);n=transformTextureCoordinates(d,i.tile,uvScratch,uvScratch);if(n.x===a&&n.y===o)return getVertexFromTileAtCorner(h,t,a,o,s),!0;if(!((r=binarySearch(l,c?a:o,function(e,t){h.encoding.decodeTextureCoordinates(h.vertices,e,uvScratch);e=transformTextureCoordinates(d,i.tile,uvScratch,uvScratch);return u?c?e.x-a:e.y-o:c?a-e.x:o-e.y}))<0))return getVertexFromTileAtCorner(h,l[r],a,o,s),!0;if(0<(r=~r)&&r<l.length)return getInterpolatedVertexAtCorner(e,d,i.tile,h,l[r-1],l[r],a,o,c,s),!0}return!1}var cornerPositionsScratch$1=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeOccludeePoint$1(e,t,i,r,n,a){var o=e.quadtree._occluders.ellipsoid,s=o.ellipsoid,e=cornerPositionsScratch$1;return Cartesian3.fromRadians(i.west,i.south,n,s,e[0]),Cartesian3.fromRadians(i.east,i.south,n,s,e[1]),Cartesian3.fromRadians(i.west,i.north,n,s,e[2]),Cartesian3.fromRadians(i.east,i.north,n,s,e[3]),o.computeHorizonCullingPointPossiblyUnderEllipsoid(t,e,r,a)}function GlobeSurfaceTileProvider(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=ShadowMode$1.RECEIVE_ONLY,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.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 Event,this._imageryLayers.layerAdded.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Event,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 Color(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=Rectangle.clone(Rectangle.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}function sortTileImageryByLayerIndex(e,t){var i=e.loadingImagery;defined(i)||(i=e.readyImagery);e=t.loadingImagery;return defined(e)||(e=t.readyImagery),i.imageryLayer._layerIndex-e.imageryLayer._layerIndex}function updateCredits(e,t){var i=t.creditDisplay;e._terrainProvider.ready&&defined(e._terrainProvider.credit)&&i.addCredit(e._terrainProvider.credit);for(var r=e._imageryLayers,n=0,a=r.length;n<a;++n){var o=r.get(n).imageryProvider;o.ready&&defined(o.credit)&&i.addCredit(o.credit)}}function pushCommand(e,t){var i,r=t.globeTranslucencyState;r.translucent?(i=e.renderState.blending.enabled,r.pushDerivedCommands(e,i,t)):t.commandList.push(e)}Object.defineProperties(GlobeSurfaceTileProvider.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=Cartesian4.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){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,defined(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}}}),GlobeSurfaceTileProvider.prototype.update=function(e){this._imageryLayers._update()},GlobeSurfaceTileProvider.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(sortTileImageryByLayerIndex)})),updateCredits(this,e);for(var t=this._vertexArraysToDestroy,i=t.length,r=0;r<i;++r)GlobeSurfaceTile._freeVertexArray(t[r]);t.length=0},GlobeSurfaceTileProvider.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];defined(n)&&(n.length=0)}var a=this._clippingPlanes;defined(a)&&a.enabled&&a.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1},GlobeSurfaceTileProvider.prototype.endUpdate=function(e){var t;defined(this._renderState)||(this._renderState=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS}}),this._blendRenderState=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},blending:BlendingState$1.ALPHA_BLEND}),(t=clone$1(this._renderState,!0)).cull.enabled=!1,this._disableCullingRenderState=RenderState.fromCache(t),(t=clone$1(this._blendRenderState,!0)).cull.enabled=!1,this._disableCullingBlendRenderState=RenderState.fromCache(t)),this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&TerrainFillMesh.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);for(var i=this._tilesToRenderByTextureCount,r=0,n=i.length;r<n;++r){var a=i[r];if(defined(a))for(var o=0,s=a.length;o<s;++o){var l=a[o],c=l.data.tileBoundingRegion;addDrawCommandsForTile(this,l,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,c.minimumHeight)}}},GlobeSurfaceTileProvider.prototype.updateForPick=function(e){for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)pushCommand(t[i],e)},GlobeSurfaceTileProvider.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},GlobeSurfaceTileProvider.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},GlobeSurfaceTileProvider.prototype.loadTile=function(e,t){var i,r=t.data,n=!0;defined(r)&&(n=r.boundingVolumeSourceTile!==t||t._lastSelectionResult===TileSelectionResult.CULLED_BUT_NEEDED,i=r.terrainState),GlobeSurfaceTile.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n),r=t.data,n&&i!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==Visibility$1.NONE&&r.boundingVolumeSourceTile===t&&GlobeSurfaceTile.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n=!1)};var boundingSphereScratch$1=new BoundingSphere,rectangleIntersectionScratch=new Rectangle,splitCartographicLimitRectangleScratch=new Rectangle,rectangleCenterScratch=new Cartographic;function clipRectangleAntimeridian(e,t){if(t.west<t.east)return t;t=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch).longitude?t.east=CesiumMath.PI:t.west=-CesiumMath.PI,t}function isUndergroundVisible(e,t){if(t.cameraUnderground)return!0;if(t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;t=e._clippingPlanes;return!(!defined(t)||!t.enabled)||!Rectangle.equals(e.cartographicLimitRectangle,Rectangle.MAX_VALUE)}GlobeSurfaceTileProvider.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);e._distance=r;var n=isUndergroundVisible(this,t);if(t.fog.enabled&&!n&&1<=CesiumMath.fog(r,t.fog.density))return Visibility$1.NONE;var a=e.data,o=a.tileBoundingRegion;if(void 0===a.boundingVolumeSourceTile)return Visibility$1.PARTIAL;var s=t.cullingVolume,l=a.orientedBoundingBox;!defined(l)&&defined(a.renderedMesh)&&(l=a.renderedMesh.boundingSphere3D),a.clippedByBoundaries=!1;r=clipRectangleAntimeridian(e.rectangle,this.cartographicLimitRectangle),r=Rectangle.simpleIntersection(r,e.rectangle,rectangleIntersectionScratch);if(!defined(r))return Visibility$1.NONE;if(Rectangle.equals(r,e.rectangle)||(a.clippedByBoundaries=!0),t.mode!==SceneMode$1.SCENE3D&&(BoundingSphere.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,o.minimumHeight,o.maximumHeight,l=boundingSphereScratch$1),Cartesian3.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===SceneMode$1.MORPHING&&defined(a.renderedMesh)&&(l=BoundingSphere.union(a.renderedMesh.boundingSphere3D,l,l))),!defined(l))return Visibility$1.PARTIAL;var c,r=this._clippingPlanes;if(defined(r)&&r.enabled){r=r.computeIntersectionWithBoundingVolume(l);if(e.isClipped=r!==Intersect$1.INSIDE,r===Intersect$1.OUTSIDE)return Visibility$1.NONE}l=s.computeVisibility(l);if(l===Intersect$1.OUTSIDE?c=Visibility$1.NONE:l===Intersect$1.INTERSECTING?c=Visibility$1.PARTIAL:l===Intersect$1.INSIDE&&(c=Visibility$1.FULL),c===Visibility$1.NONE)return c;l=t.mode===SceneMode$1.SCENE3D&&t.camera.frustum instanceof OrthographicFrustum;if(t.mode!==SceneMode$1.SCENE3D||l||!defined(i)||n)return c;a=a.occludeePointInScaledSpace;return!defined(a)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(a,o.minimumHeight)?c:Visibility$1.NONE},GlobeSurfaceTileProvider.prototype.canRefine=function(e){return!!defined(e.data.terrainData)||void 0!==this.terrainProvider.getTileDataAvailable(2*e.x,2*e.y,e.level+1)};var readyImageryScratch=[],canRenderTraversalStack=[];GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail=function(e,t){var i=e.data,r=readyImageryScratch;r.length=this._imageryLayers.length;var n,a=!1,o=!1;for(defined(i)&&(a=i.terrainState===TerrainState$1.READY,o=!0,n=i.imagery),m=0,f=r.length;m<f;++m)r[m]=o;if(defined(n))for(m=0,f=n.length;m<f;++m){var s=n[m],l=s.loadingImagery,l=!defined(l)||l.state===ImageryState$1.FAILED||l.state===ImageryState$1.INVALID,s=(s.loadingImagery||s.readyImagery).imageryLayer._layerIndex;r[s]=l&&r[s]}var c=this.quadtree._lastSelectionFrameNumber,u=canRenderTraversalStack;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);0<u.length;){var d=u.pop(),h=d._lastSelectionResultFrame===c?d._lastSelectionResult:TileSelectionResult.NONE;if(h===TileSelectionResult.RENDERED){if(defined(d.data)){if(!a&&d.data.terrainState===TerrainState$1.READY)return!1;for(var p=d.data.imagery,m=0,f=p.length;m<f;++m){var g=p[m],_=g.loadingImagery,_=!defined(_)||_.state===ImageryState$1.FAILED||_.state===ImageryState$1.INVALID,g=(g.loadingImagery||g.readyImagery).imageryLayer._layerIndex;if(_&&!r[g])return!1}}}else h===TileSelectionResult.REFINED&&u.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var tileDirectionScratch=new Cartesian3;GlobeSurfaceTileProvider.prototype.computeTileLoadPriority=function(e,t){var i=e.data;if(void 0===i)return 0;var r=i.orientedBoundingBox;if(void 0===r)return 0;i=t.camera.positionWC,t=t.camera.directionWC,r=Cartesian3.subtract(r.center,i,tileDirectionScratch),i=Cartesian3.magnitude(r);return i<CesiumMath.EPSILON5?0:(Cartesian3.divideByScalar(r,i,r),(1-Cartesian3.dot(r,t))*e._distance)};var modifiedModelViewScratch=new Matrix4,modifiedModelViewProjectionScratch=new Matrix4,tileRectangleScratch=new Cartesian4,localizedCartographicLimitRectangleScratch=new Cartesian4,localizedTranslucencyRectangleScratch=new Cartesian4,rtcScratch=new Cartesian3,centerEyeScratch=new Cartesian3,southwestScratch=new Cartesian3,northeastScratch=new Cartesian3;GlobeSurfaceTileProvider.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,a=r.length;n<a;++n){var o=r[n];defined(o.readyImagery)&&0!==o.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];defined(s)||(this._tilesToRenderByTextureCount[i]=s=[]),s.push(e),defined(e.data.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;e=this._debug;++e.tilesRendered,e.texturesRendered+=i};var cornerPositionsScratch=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeOccludeePoint(e,t,i,r,n,a){var o=e.quadtree._occluders.ellipsoid,s=o.ellipsoid,e=cornerPositionsScratch;return Cartesian3.fromRadians(i.west,i.south,n,s,e[0]),Cartesian3.fromRadians(i.east,i.south,n,s,e[1]),Cartesian3.fromRadians(i.west,i.north,n,s,e[2]),Cartesian3.fromRadians(i.east,i.north,n,s,e[3]),o.computeHorizonCullingPointPossiblyUnderEllipsoid(t,e,r,a)}function updateTileBoundingRegion(e,t,i){var r=e.data;void 0===(r=void 0===r?e.data=new GlobeSurfaceTile:r).tileBoundingRegion&&(r.tileBoundingRegion=new TileBoundingRegion({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:e.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0}));var n=r.terrainData,a=r.mesh,o=r.tileBoundingRegion;if(void 0!==a&&void 0!==a.minimumHeight&&void 0!==a.maximumHeight)return o.minimumHeight=a.minimumHeight,o.maximumHeight=a.maximumHeight,e;if(void 0!==n&&void 0!==n._minimumHeight&&void 0!==n._maximumHeight)return o.minimumHeight=n._minimumHeight*i.terrainExaggeration,o.maximumHeight=n._maximumHeight*i.terrainExaggeration,e;o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;for(var s=e.parent;void 0!==s;){var l=s.data;if(void 0!==l){var c=l.mesh;if(void 0!==c&&void 0!==c.minimumHeight&&void 0!==c.maximumHeight)return o.minimumHeight=c.minimumHeight,o.maximumHeight=c.maximumHeight,s;l=l.terrainData;if(void 0!==l&&void 0!==l._minimumHeight&&void 0!==l._maximumHeight)return o.minimumHeight=l._minimumHeight*i.terrainExaggeration,o.maximumHeight=l._maximumHeight*i.terrainExaggeration,s}s=s.parent}}function getTileReadyCallback(l,c,u){return function(e){for(var t=-1,i=e.data.imagery,r=i.length,n=0;n<r;++n)if((s=defaultValue((a=i[n]).readyImagery,a.loadingImagery)).imageryLayer===c){t=n;break}if(-1!==t){var a,o=t+l,s=defined(a=i[o])?defaultValue(a.readyImagery,a.loadingImagery):void 0;if(!defined(s)||s.imageryLayer!==c)return!c._createTileImagerySkeletons(e,u,o);for(n=t;n<o;++n)i[n].freeResources();i.splice(t,l)}return!0}}GlobeSurfaceTileProvider.prototype.computeDistanceToTile=function(e,t){var i=updateTileBoundingRegion(e,this.terrainProvider,t),r=e.data,n=r.tileBoundingRegion;if(void 0===i)return 9999999999;r.boundingVolumeSourceTile!==i&&(r.boundingVolumeSourceTile=i,defined(e.rectangle)&&(r.orientedBoundingBox=OrientedBoundingBox.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=computeOccludeePoint(this,r.orientedBoundingBox.center,e.rectangle,n.minimumHeight,n.maximumHeight,r.occludeePointInScaledSpace)));var a=n.minimumHeight,i=n.maximumHeight;r.boundingVolumeSourceTile!==e&&(r=t.camera.positionCartographic.height,e=Math.abs(r-a),Math.abs(r-i)<e?(n.minimumHeight=a,n.maximumHeight=a):(n.minimumHeight=i,n.maximumHeight=i));t=n.distanceToCamera(t);return n.minimumHeight=a,n.maximumHeight=i,t},GlobeSurfaceTileProvider.prototype.isDestroyed=function(){return!1},GlobeSurfaceTileProvider.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),destroyObject(this)},GlobeSurfaceTileProvider.prototype._onLayerAdded=function(s,e){var l,t,i,r;s.show&&(l=this._terrainProvider,i=s.imageryProvider,r=(t=this)._imageryLayersUpdatedEvent,i._reload=function(){s._imageryCache={},t._quadtree.forEachLoadedTile(function(e){if(!defined(e._loadedCallbacks[s._layerIndex])){for(var t=e.data.imagery,i=t.length,r=-1,n=0,a=0;a<i;++a){var o=t[a];if(defaultValue(o.readyImagery,o.loadingImagery).imageryLayer===s)-1===r&&(r=a),++n;else if(-1!==r)break}-1!==r&&s._createTileImagerySkeletons(e,l,r+n)&&(e._loadedCallbacks[s._layerIndex]=getTileReadyCallback(n,s,l),e.state=QuadtreeTileLoadState$1.LOADING)}})},this._quadtree.forEachLoadedTile(function(e){s._createTileImagerySkeletons(e,l)&&(e.state=QuadtreeTileLoadState$1.LOADING,0===e.level||e._lastSelectionResultFrame===t.quadtree._lastSelectionFrameNumber&&e._lastSelectionResult===TileSelectionResult.RENDERED||(e.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent())},GlobeSurfaceTileProvider.prototype._onLayerRemoved=function(l,e){this._quadtree.forEachLoadedTile(function(e){for(var t=e.data.imagery,i=-1,r=0,n=0,a=t.length;n<a;++n){var o=t[n],s=o.loadingImagery;if((s=!defined(s)?o.readyImagery:s).imageryLayer===l)-1===i&&(i=n),o.freeResources(),++r;else if(-1!==i)break}-1!==i&&t.splice(i,r)}),defined(l.imageryProvider)&&(l.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()},GlobeSurfaceTileProvider.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var scratchClippingPlanesMatrix=new Matrix4,scratchInverseTransposeClippingPlanesMatrix=new Matrix4,getDebugOrientedBoundingBox,getDebugBoundingSphere,debugDestroyPrimitive,JCi,KCi,GCi,HCi,ICi;function createTileUniformMap(r,t){var e={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_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var e=r.context.uniformState.view,t=Matrix4.multiplyByPoint(e,this.properties.rtc,centerEyeScratch);return Matrix4.setTranslation(e,t,modifiedModelViewScratch),modifiedModelViewScratch},u_modifiedModelViewProjection:function(){var e=r.context.uniformState.view,t=r.context.uniformState.projection,i=Matrix4.multiplyByPoint(e,this.properties.rtc,centerEyeScratch);return Matrix4.setTranslation(e,i,modifiedModelViewProjectionScratch),Matrix4.multiply(t,modifiedModelViewProjectionScratch,modifiedModelViewProjectionScratch),modifiedModelViewProjectionScratch},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(){var e=t._clippingPlanes;return defined(e)&&defined(e.texture)?e.texture:r.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){var e=t._clippingPlanes,e=defined(e)?Matrix4.multiply(r.context.uniformState.view,e.modelMatrix,scratchClippingPlanesMatrix):Matrix4.IDENTITY;return Matrix4.inverseTranspose(e,scratchInverseTransposeClippingPlanesMatrix)},u_clippingPlanesEdgeStyle:function(){var e=this.properties.clippingPlanesEdgeColor;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_minimumBrightness:function(){return r.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},properties:{initialColor:new Cartesian4(0,0,.5,1),fillHighlightColor:new Color(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new Cartesian2(65e5,9e6),nightFadeDistance:new Cartesian2(1e7,4e7),hsbShift:new Cartesian3,center3D:void 0,rtc:new Cartesian3,modifiedModelView:new Matrix4,tileRectangle:new Cartesian4,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new Cartesian2,southMercatorYAndOneOverHeight:new Cartesian2,waterMask:void 0,waterMaskTranslationAndScale:new Cartesian4,minMaxHeight:new Cartesian2,scaleAndBias:new Matrix4,clippingPlanesEdgeColor:Color.clone(Color.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new Cartesian4,frontFaceAlphaByDistance:new Cartesian4,backFaceAlphaByDistance:new Cartesian4,localizedTranslucencyRectangle:new Cartesian4,undergroundColor:Color.clone(Color.TRANSPARENT),undergroundColorAlphaByDistance:new Cartesian4}};return defined(t.materialUniformMap)?combine$2(e,t.materialUniformMap):e}function createWireframeVertexArrayIfNecessary(e,t,i){var r,n,i=i.data;if(defined(i.vertexArray)?(r=i.mesh,n=i.vertexArray):defined(i.fill)&&defined(i.fill.vertexArray)&&(r=i.fill.mesh,n=i.fill.vertexArray),defined(r)&&defined(n)){if(defined(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=createWireframeVertexArray(e,n,r),i.wireframeVertexArray.mesh=r}}function createWireframeVertexArray(e,t,i){i={indices:i.indices,primitiveType:PrimitiveType$1.TRIANGLES};GeometryPipeline.toWireframe(i);i=i.indices,i=Buffer$1.createIndexBuffer({context:e,typedArray:i,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.fromSizeInBytes(i.BYTES_PER_ELEMENT)});return new VertexArray({context:e,attributes:t._attributes,indexBuffer:i})}function LCi(e){return new Primitive({geometryInstances:e,appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}GCi=new GeometryInstance({geometry:BoxOutlineGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2)})}),HCi=new GeometryInstance({geometry:new SphereOutlineGeometry({radius:1})}),ICi=new Matrix4,getDebugOrientedBoundingBox=function(e,t){return e===JCi?KCi:(debugDestroyPrimitive(),JCi=e,ICi=Matrix4.fromRotationTranslation(e.halfAxes,e.center,ICi),GCi.modelMatrix=ICi,GCi.attributes.color=ColorGeometryInstanceAttribute.fromColor(t),KCi=LCi(GCi))},getDebugBoundingSphere=function(e,t){return e===JCi?KCi:(debugDestroyPrimitive(),JCi=e,ICi=Matrix4.fromTranslation(e.center,ICi),ICi=Matrix4.multiplyByUniformScale(ICi,e.radius,ICi),HCi.modelMatrix=ICi,HCi.attributes.color=ColorGeometryInstanceAttribute.fromColor(t),KCi=LCi(HCi))},debugDestroyPrimitive=function(){defined(KCi)&&(KCi.destroy(),JCi=KCi=void 0)};var otherPassesInitialColor=new Cartesian4(0,0,0,0),surfaceShaderSetOptionsScratch={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,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0},defaultUndergroundColor=Color.TRANSPARENT,defaultundergroundColorAlphaByDistance=new NearFarScalar;function addDrawCommandsForTile(e,t,i){var r=t.data;defined(r.vertexArray)||(void 0===r.fill&&(r.fill=new TerrainFillMesh(t)),r.fill.update(e,i));var n=i.creditDisplay,a=r.terrainData;if(defined(a)&&defined(a.credits))for(var o=a.credits,s=0,l=o.length;s<l;++s)n.addCredit(o[s]);var c=ContextLimits.maximumTextureImageUnits,u=r.waterMaskTexture,d=r.waterMaskTranslationAndScale;!defined(u)&&defined(r.fill)&&(u=r.fill.waterMaskTexture,d=r.fill.waterMaskTranslationAndScale);var h=i.cameraUnderground,p=i.globeTranslucencyState,m=p.translucent,f=p.frontFaceAlphaByDistance,g=p.backFaceAlphaByDistance,_=p.rectangle,y=defaultValue(e.undergroundColor,defaultUndergroundColor),C=defaultValue(e.undergroundColorAlphaByDistance,defaultundergroundColorAlphaByDistance),v=isUndergroundVisible(e,i)&&i.mode===SceneMode$1.SCENE3D&&0<y.alpha&&(0<C.nearValue||0<C.farValue),S=e.hasWaterMask&&defined(u),T=e.oceanNormalMap,x=S&&defined(T),b=e.terrainProvider.ready&&e.terrainProvider.hasVertexNormals,E=i.fog.enabled&&!h,P=e.showGroundAtmosphere&&i.mode===SceneMode$1.SCENE3D,A=ShadowMode$1.castShadows(e.shadows)&&!m,w=ShadowMode$1.receiveShadows(e.shadows)&&!m,D=e.hueShift,M=e.saturationShift,I=e.brightnessShift,R=!(CesiumMath.equalsEpsilon(D,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(M,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(I,0,CesiumMath.EPSILON7)),O=!1;P&&(F=Cartesian3.magnitude(i.camera.positionWC),O=e.nightFadeOutDistance<F),S&&--c,x&&--c,defined(i.shadowState)&&i.shadowState.shadowsEnabled&&--c,defined(e.clippingPlanes)&&e.clippingPlanes.enabled&&--c,c-=p.numberOfTextureUniforms;var L,F,N=r.renderedMesh,B=N.center,V=N.encoding,k=tileRectangleScratch,z=0,$=0,U=0,G=0,H=!1;i.mode!==SceneMode$1.SCENE3D&&(a=(L=i.mapProjection).project(Rectangle.southwest(t.rectangle),southwestScratch),F=L.project(Rectangle.northeast(t.rectangle),northeastScratch),k.x=a.x,k.y=a.y,k.z=F.x,k.w=F.y,i.mode!==SceneMode$1.MORPHING&&((B=rtcScratch).x=0,B.y=.5*(k.z+k.x),B.z=.5*(k.w+k.y),k.x-=B.y,k.y-=B.z,k.z-=B.y,k.w-=B.z),i.mode===SceneMode$1.SCENE2D&&V.quantization===TerrainQuantization$1.BITS12&&(a=1/(Math.pow(2,12)-1)*.5,F=(k.z-k.x)*a,a=(k.w-k.y)*a,k.x-=F,k.y-=a,k.z+=F,k.w+=a),L instanceof WebMercatorProjection&&(z=t.rectangle.south,$=t.rectangle.north,U=WebMercatorProjection.geodeticLatitudeToMercatorAngle(z),G=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle($)-U),H=!0));var W=surfaceShaderSetOptionsScratch;W.frameState=i,W.surfaceTile=r,W.showReflectiveOcean=S,W.showOceanWaves=x,W.enableLighting=e.enableLighting,W.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,W.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,W.showGroundAtmosphere=P,W.perFragmentGroundAtmosphere=O,W.hasVertexNormals=b,W.useWebMercatorProjection=H,W.clippedByBoundaries=r.clippedByBoundaries;var q=r.imagery,j=0,Y=q.length,X=e.showSkirts&&!h&&!m,b=e.backFaceCulling&&!h&&!m,H=b?e._renderState:e._disableCullingRenderState,Q=b?e._blendRenderState:e._disableCullingBlendRenderState,J=H,Z=e._firstPassInitialColor,K=i.context;if(defined(e._debug.boundingSphereTile)||debugDestroyPrimitive(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;for(var ee=e._drawCommands.length,te=0;te<ee;++te)e._uniformMaps[te]=createTileUniformMap(i,e)}do{var ie,re,ne=0;e._drawCommands.length<=e._usedDrawCommands?((ie=new DrawCommand).owner=t,ie.cull=!1,ie.boundingVolume=new BoundingSphere,ie.orientedBoundingBox=void 0,re=createTileUniformMap(i,e),e._drawCommands.push(ie),e._uniformMaps.push(re)):(ie=e._drawCommands[e._usedDrawCommands],re=e._uniformMaps[e._usedDrawCommands]),ie.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile&&(defined(ue=r.orientedBoundingBox)?getDebugOrientedBoundingBox(ue,Color.RED).update(i):defined(N)&&defined(N.boundingSphere3D)&&getDebugBoundingSphere(N.boundingSphere3D,Color.RED).update(i));var ae=re.properties;Cartesian4.clone(Z,ae.initialColor),ae.oceanNormalMap=T,ae.lightingFadeDistance.x=e.lightingFadeOutDistance,ae.lightingFadeDistance.y=e.lightingFadeInDistance,ae.nightFadeDistance.x=e.nightFadeOutDistance,ae.nightFadeDistance.y=e.nightFadeInDistance,ae.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;var oe=h?g:f,se=h?f:g;defined(oe)&&(Cartesian4.fromElements(oe.near,oe.nearValue,oe.far,oe.farValue,ae.frontFaceAlphaByDistance),Cartesian4.fromElements(se.near,se.nearValue,se.far,se.farValue,ae.backFaceAlphaByDistance)),Cartesian4.fromElements(C.near,C.nearValue,C.far,C.farValue,ae.undergroundColorAlphaByDistance),Color.clone(y,ae.undergroundColor);var le=!defined(r.vertexArray)&&defined(e.fillHighlightColor)&&0<e.fillHighlightColor.alpha;le&&Color.clone(e.fillHighlightColor,ae.fillHighlightColor),ae.center3D=N.center,Cartesian3.clone(B,ae.rtc),Cartesian4.clone(k,ae.tileRectangle),ae.southAndNorthLatitude.x=z,ae.southAndNorthLatitude.y=$,ae.southMercatorYAndOneOverHeight.x=U,ae.southMercatorYAndOneOverHeight.y=G;var ce=localizedCartographicLimitRectangleScratch,ue=clipRectangleAntimeridian(t.rectangle,e.cartographicLimitRectangle),oe=localizedTranslucencyRectangleScratch,se=clipRectangleAntimeridian(t.rectangle,_);Cartesian3.fromElements(D,M,I,ae.hsbShift);var de=t.rectangle,he=1/de.width,pe=1/de.height;ce.x=(ue.west-de.west)*he,ce.y=(ue.south-de.south)*pe,ce.z=(ue.east-de.west)*he,ce.w=(ue.north-de.south)*pe,Cartesian4.clone(ce,ae.localizedCartographicLimitRectangle),oe.x=(se.west-de.west)*he,oe.y=(se.south-de.south)*pe,oe.z=(se.east-de.west)*he,oe.w=(se.north-de.south)*pe,Cartesian4.clone(oe,ae.localizedTranslucencyRectangle);for(var ce=E&&CesiumMath.fog(t._distance,i.fog.density)>CesiumMath.EPSILON3,R=R&&(ce||P),me=!1,fe=!1,ge=!1,_e=!1,ye=!1,Ce=!1,ve=!1,Se=!1,Te=!1,xe=!1;ne<c&&j<Y;){var be=q[j],Ee=be.readyImagery;if(++j,defined(Ee)&&0!==Ee.imageryLayer.alpha){var Pe=be.useWebMercatorT?Ee.textureWebMercator:Ee.texture,Ae=Ee.imageryLayer;defined(be.textureTranslationAndScale)||(be.textureTranslationAndScale=Ae._calculateTextureTranslationAndScale(t,be)),ae.dayTextures[ne]=Pe,ae.dayTextureTranslationAndScale[ne]=be.textureTranslationAndScale,ae.dayTextureTexCoordsRectangle[ne]=be.textureCoordinateRectangle,ae.dayTextureUseWebMercatorT[ne]=be.useWebMercatorT,ae.dayTextureAlpha[ne]=Ae.alpha,Ce=Ce||1!==ae.dayTextureAlpha[ne],ae.dayTextureNightAlpha[ne]=Ae.nightAlpha,ve=ve||1!==ae.dayTextureNightAlpha[ne],ae.dayTextureDayAlpha[ne]=Ae.dayAlpha,ve=ve||1!==ae.dayTextureDayAlpha[ne],ae.dayTextureBrightness[ne]=Ae.brightness,me=me||ae.dayTextureBrightness[ne]!==ImageryLayer.DEFAULT_BRIGHTNESS,ae.dayTextureContrast[ne]=Ae.contrast,fe=fe||ae.dayTextureContrast[ne]!==ImageryLayer.DEFAULT_CONTRAST,ae.dayTextureHue[ne]=Ae.hue,ge=ge||ae.dayTextureHue[ne]!==ImageryLayer.DEFAULT_HUE,ae.dayTextureSaturation[ne]=Ae.saturation,_e=_e||ae.dayTextureSaturation[ne]!==ImageryLayer.DEFAULT_SATURATION,ae.dayTextureOneOverGamma[ne]=1/Ae.gamma,ye=ye||ae.dayTextureOneOverGamma[ne]!==1/ImageryLayer.DEFAULT_GAMMA,ae.dayTextureSplit[ne]=Ae.splitDirection;Se=Se||0!==ae.dayTextureSplit[ne],be=ae.dayTextureCutoutRectangles[ne];defined(be)||(be=ae.dayTextureCutoutRectangles[ne]=new Cartesian4),Cartesian4.clone(Cartesian4.ZERO,be),defined(Ae.cutoutRectangle)&&(we=clipRectangleAntimeridian(de,Ae.cutoutRectangle),Te=defined(Rectangle.simpleIntersection(we,de,rectangleIntersectionScratch))||Te,be.x=(we.west-de.west)*he,be.y=(we.south-de.south)*pe,be.z=(we.east-de.west)*he,be.w=(we.north-de.south)*pe);be=ae.colorsToAlpha[ne];defined(be)||(be=ae.colorsToAlpha[ne]=new Cartesian4);var we=defined(Ae.colorToAlpha)&&0<Ae.colorToAlphaThreshold,xe=xe||we;if(we?(we=Ae.colorToAlpha,be.x=we.red,be.y=we.green,be.z=we.blue,be.w=Ae.colorToAlphaThreshold):be.w=-1,defined(Ee.credits))for(var De=Ee.credits,Me=0,Ie=De.length;Me<Ie;++Me)n.addCredit(De[Me]);++ne}}ae.dayTextures.length=ne,ae.waterMask=u,Cartesian4.clone(d,ae.waterMaskTranslationAndScale),ae.minMaxHeight.x=V.minimumHeight,ae.minMaxHeight.y=V.maximumHeight,Matrix4.clone(V.matrix,ae.scaleAndBias);se=e._clippingPlanes,oe=defined(se)&&se.enabled&&t.isClipped;oe&&(ae.clippingPlanesEdgeColor=Color.clone(se.edgeColor,ae.clippingPlanesEdgeColor),ae.clippingPlanesEdgeWidth=se.edgeWidth),W.numberOfDayTextures=ne,W.applyBrightness=me,W.applyContrast=fe,W.applyHue=ge,W.applySaturation=_e,W.applyGamma=ye,W.applyAlpha=Ce,W.applyDayNightAlpha=ve,W.applySplit=Se,W.enableFog=ce,W.enableClippingPlanes=oe,W.clippingPlanes=se,W.hasImageryLayerCutout=Te,W.colorCorrect=R,W.highlightFillTile=le,W.colorToAlpha=xe,W.showUndergroundColor=v,W.translucent=m;oe=r.renderedMesh.indices.length;X||(oe=r.renderedMesh.indexCountWithoutSkirts),ie.shaderProgram=e._surfaceShaderSet.getShaderProgram(W),ie.castShadows=A,ie.receiveShadows=w,ie.renderState=J,ie.primitiveType=PrimitiveType$1.TRIANGLES,ie.vertexArray=r.vertexArray||r.fill.vertexArray,ie.count=oe,ie.uniformMap=re,ie.pass=Pass$1.GLOBE,e._debug.wireframe&&(createWireframeVertexArrayIfNecessary(K,e,t),defined(r.wireframeVertexArray)&&(ie.vertexArray=r.wireframeVertexArray,ie.primitiveType=PrimitiveType$1.LINES,ie.count=2*oe));se=ie.boundingVolume,le=ie.orientedBoundingBox}while(i.mode!==SceneMode$1.SCENE3D?(oe=r.tileBoundingRegion,BoundingSphere.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,oe.minimumHeight,oe.maximumHeight,se),Cartesian3.fromElements(se.center.z,se.center.x,se.center.y,se.center),i.mode===SceneMode$1.MORPHING&&(se=BoundingSphere.union(N.boundingSphere3D,se,se))):(ie.boundingVolume=BoundingSphere.clone(N.boundingSphere3D,se),ie.orientedBoundingBox=OrientedBoundingBox.clone(r.orientedBoundingBox,le)),ie.dirty=!0,m&&p.updateDerivedCommands(ie,i),pushCommand(ie,i),J=Q,Z=otherPassesInitialColor,j<Y)}function GlobeTranslucency(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=Rectangle.clone(Rectangle.MAX_VALUE)}function ImageryLayerCollection(){this._layers=[],this.layerAdded=new Event,this.layerRemoved=new Event,this.layerMoved=new Event,this.layerShownOrHidden=new Event}function getLayerIndex(e,t){return e.indexOf(t)}function swapLayers(e,t,i){var r,n=e._layers;(t=CesiumMath.clamp(t,0,n.length-1))!==(i=CesiumMath.clamp(i,0,n.length-1))&&(r=n[t],n[t]=n[i],n[i]=r,e._update(),e.layerMoved.raiseEvent(r,i,t))}Object.defineProperties(GlobeTranslucency.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=NearFarScalar.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=NearFarScalar.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){defined(e)||(e=Rectangle.clone(Rectangle.MAX_VALUE)),Rectangle.clone(e,this._rectangle)}}}),Object.defineProperties(ImageryLayerCollection.prototype,{length:{get:function(){return this._layers.length}}}),ImageryLayerCollection.prototype.add=function(e,t){defined(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t)},ImageryLayerCollection.prototype.addImageryProvider=function(e,t){e=new ImageryLayer(e);return this.add(e,t),e},ImageryLayerCollection.prototype.remove=function(e,t){t=defaultValue(t,!0);var i=this._layers.indexOf(e);return-1!==i&&(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(e,i),t&&e.destroy(),!0)},ImageryLayerCollection.prototype.removeAll=function(e){e=defaultValue(e,!0);for(var t=this._layers,i=0,r=t.length;i<r;i++){var n=t[i];this.layerRemoved.raiseEvent(n,i),e&&n.destroy()}this._layers=[]},ImageryLayerCollection.prototype.contains=function(e){return-1!==this.indexOf(e)},ImageryLayerCollection.prototype.indexOf=function(e){return this._layers.indexOf(e)},ImageryLayerCollection.prototype.get=function(e){return this._layers[e]},ImageryLayerCollection.prototype.raise=function(e){e=getLayerIndex(this._layers,e);swapLayers(this,e,e+1)},ImageryLayerCollection.prototype.lower=function(e){e=getLayerIndex(this._layers,e);swapLayers(this,e,e-1)},ImageryLayerCollection.prototype.raiseToTop=function(e){var t=getLayerIndex(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))},ImageryLayerCollection.prototype.lowerToBottom=function(e){var t=getLayerIndex(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var applicableRectangleScratch=new Rectangle,comparisonPoint;function QuadtreeOccluders(e){this._ellipsoid=new EllipsoidalOccluder(e.ellipsoid,Cartesian3.ZERO)}function QuadtreeTile(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=TileSelectionResult.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=QuadtreeTileLoadState$1.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function freeTile(e){defined(e)&&e.freeResources()}function TileReplacementQueue(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function remove(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}function QuadtreePrimitive(e){this._tileProvider=e.tileProvider,(this._tileProvider.quadtree=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};var t=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new TileReplacementQueue,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=defaultValue(e.maximumScreenSpaceError,2),this.tileCacheSize=defaultValue(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new QuadtreeOccluders({ellipsoid:t}),this._tileLoadProgressEvent=new Event,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}function invalidateAllTiles(e){var t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,clearTileLoadQueue(e);var i=e._levelZeroTiles;if(defined(i))for(var r=0;r<i.length;++r){for(var n=i[r].customData,a=n.length,o=0;o<a;++o){var s=n[o];s.level=0,e._addHeightCallbacks.push(s)}i[r].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}function clearTileLoadQueue(e){var 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}function updateTileLoadProgress(e,t){var i=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;i===e._lastTileLoadQueueLength&&!e._tilesInvalidated||(t.afterRender.push(Event.prototype.raiseEvent.bind(e._tileLoadProgressEvent,i)),e._lastTileLoadQueueLength=i);i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(e,t){return Math.max(e,t.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))}ImageryLayerCollection.prototype.pickImageryLayerFeatures=function(e,t){e=t.globe.pick(e,t);if(defined(e)){for(var i,s=t.globe.ellipsoid.cartesianToCartographic(e),r=t.globe._surface._tilesToRender,n=0;!defined(i)&&n<r.length;++n){var a=r[n];Rectangle.contains(a.rectangle,s)&&(i=a)}if(defined(i)){for(var o=i.data.imagery,l=[],c=[],u=o.length-1;0<=u;--u){var d,h,p,m=o[u],f=m.readyImagery;defined(f)&&(defined((p=f.imageryLayer.imageryProvider).pickFeatures)&&Rectangle.contains(f.rectangle,s)&&((d=applicableRectangleScratch).west=CesiumMath.lerp(i.rectangle.west,i.rectangle.east,m.textureCoordinateRectangle.x-(h=1/1024)),d.east=CesiumMath.lerp(i.rectangle.west,i.rectangle.east,m.textureCoordinateRectangle.z+h),d.south=CesiumMath.lerp(i.rectangle.south,i.rectangle.north,m.textureCoordinateRectangle.y-h),d.north=CesiumMath.lerp(i.rectangle.south,i.rectangle.north,m.textureCoordinateRectangle.w+h),!Rectangle.contains(d,s)||defined(p=p.pickFeatures(f.x,f.y,f.level,s.longitude,s.latitude))&&(l.push(p),c.push(f.imageryLayer))))}if(0!==l.length)return when.all(l,function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i],n=c[i];if(defined(r)&&0<r.length)for(var a=0;a<r.length;++a){var o=r[a];o.imageryLayer=n,defined(o.position)||(o.position=s),t.push(o)}}return t})}}},ImageryLayerCollection.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},ImageryLayerCollection.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},ImageryLayerCollection.prototype.isDestroyed=function(){return!1},ImageryLayerCollection.prototype.destroy=function(){return this.removeAll(!0),destroyObject(this)},ImageryLayerCollection.prototype._update=function(){for(var e,t,i=!0,r=this._layers,n=0,a=r.length;n<a;++n)(t=r[n])._layerIndex=n,t.show?(t._isBaseLayer=i,i=!1):t._isBaseLayer=!1,t.show!==t._show&&(defined(t._show)&&(e=!defined(e)?[]:e).push(t),t._show=t.show);if(defined(e))for(n=0,a=e.length;n<a;++n)t=e[n],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)},Object.defineProperties(QuadtreeOccluders.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),QuadtreeTile.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var o=0;o<t;++o)r[n++]=new QuadtreeTile({tilingScheme:e,x:o,y:a,level:0});return r},QuadtreeTile.prototype._updateCustomData=function(e,t,i){var r,n=this.customData;if(defined(t)&&defined(i)){for(n=n.filter(function(e){return-1===i.indexOf(e)}),this._customData=n,a=this._rectangle,s=0;s<t.length;++s)r=t[s],Rectangle.contains(a,r.positionCartographic)&&n.push(r);this._frameUpdated=e}else{e=this._parent;if(defined(e)&&this._frameUpdated!==e._frameUpdated){n.length=0;for(var a=this._rectangle,o=e.customData,s=0;s<o.length;++s)r=o[s],Rectangle.contains(a,r.positionCartographic)&&n.push(r);this._frameUpdated=e._frameUpdated}}},Object.defineProperties(QuadtreeTile.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 defined(this._southwestChild)||(this._southwestChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return defined(this._southeastChild)||(this._southeastChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return defined(this._northwestChild)||(this._northwestChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return defined(this._northeastChild)||(this._northeastChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<QuadtreeTileLoadState$1.DONE}},eligibleForUnloading:{get:function(){var e=!0;return defined(this.data)&&(defined(e=this.data.eligibleForUnloading)||(e=!0)),e}}}),QuadtreeTile.prototype.findLevelZeroTile=function(e,t,i){var r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=r:r<=t&&(t-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(e){return e.x===t&&e.y===i})[0]},QuadtreeTile.prototype.findTileToWest=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;e=t.findTileToWest(e);return void 0!==e?t.southwestChild===this?e.southeastChild:e.northeastChild:void 0},QuadtreeTile.prototype.findTileToEast=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;e=t.findTileToEast(e);return void 0!==e?t.southeastChild===this?e.southwestChild:e.northwestChild:void 0},QuadtreeTile.prototype.findTileToSouth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;e=t.findTileToSouth(e);return void 0!==e?t.southwestChild===this?e.northwestChild:e.northeastChild:void 0},QuadtreeTile.prototype.findTileToNorth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;e=t.findTileToNorth(e);return void 0!==e?t.northwestChild===this?e.southwestChild:e.southeastChild:void 0},QuadtreeTile.prototype.freeResources=function(){this.state=QuadtreeTileLoadState$1.START,this.renderable=!1,this.upsampledFromParent=!1,defined(this.data)&&defined(this.data.freeResources)&&this.data.freeResources(),freeTile(this._southwestChild),this._southwestChild=void 0,freeTile(this._southeastChild),this._southeastChild=void 0,freeTile(this._northwestChild),this._northwestChild=void 0,freeTile(this._northeastChild),this._northeastChild=void 0},TileReplacementQueue.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},TileReplacementQueue.prototype.trimTiles=function(e){for(var t=this.tail,i=!0;i&&defined(this._lastBeforeStartOfFrame)&&this.count>e&&defined(t);){var i=t!==this._lastBeforeStartOfFrame,r=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),remove(this,t)),t=r}},TileReplacementQueue.prototype.markTileRendered=function(e){var t=this.head;if(t!==e){if(++this.count,!defined(t))return e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,void(this.tail=e);(defined(e.replacementPrevious)||defined(e.replacementNext))&&remove(this,e),e.replacementPrevious=void 0,(e.replacementNext=t).replacementPrevious=e,this.head=e}else e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext)},Object.defineProperties(QuadtreePrimitive.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}}),QuadtreePrimitive.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0},QuadtreePrimitive.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;defined(t);)t.state!==QuadtreeTileLoadState$1.START&&e(t),t=t.replacementNext},QuadtreePrimitive.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},QuadtreePrimitive.prototype.updateHeight=function(e,t){var r=this,n={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t,removeFunc:function(){for(var e=r._addHeightCallbacks,t=e.length,i=0;i<t;++i)if(e[i]===n){e.splice(i,1);break}r._removeHeightCallbacks.push(n)}};return r._addHeightCallbacks.push(n),n.removeFunc},QuadtreePrimitive.prototype.update=function(e){defined(this._tileProvider.update)&&this._tileProvider.update(e)},QuadtreePrimitive.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(invalidateAllTiles(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),clearTileLoadQueue(this),this._debug.suspendLodUpdate||this._tileReplacementQueue.markStartOfRenderFrame())},QuadtreePrimitive.prototype.render=function(e){var t=e.passes,i=this._tileProvider;t.render&&(i.beginUpdate(e),selectTilesForRendering(this,e),createRenderCommandsForSelectedTiles(this,e),i.endUpdate(e)),t.pick&&0<this._tilesToRender.length&&i.updateForPick(e)},QuadtreePrimitive.prototype.endFrame=function(e){e.passes.render&&e.mode!==SceneMode$1.MORPHING&&(processTileLoadQueue(this,e),updateHeights(this,e),updateTileLoadProgress(this,e))},QuadtreePrimitive.prototype.isDestroyed=function(){return!1},QuadtreePrimitive.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var centerScratch=new Cartographic;function compareDistanceToPoint(e,t){var i=Rectangle.center(e.rectangle,centerScratch),r=i.longitude-comparisonPoint.longitude,e=i.latitude-comparisonPoint.latitude,t=(i=Rectangle.center(t.rectangle,centerScratch)).longitude-comparisonPoint.longitude,i=i.latitude-comparisonPoint.latitude;return r*r+e*e-(t*t+i*i)}var cameraOriginScratch=new Cartesian3,rootTraversalDetails=[];function selectTilesForRendering(e,t){var i,r=e._debug;if(!r.suspendLodUpdate){e._tilesToRender.length=0;var n,a=e._tileProvider;if(!defined(e._levelZeroTiles)){if(!a.ready)return;var o=a.tilingScheme;e._levelZeroTiles=QuadtreeTile.createLevelZeroTiles(o);var s=e._levelZeroTiles.length;if(rootTraversalDetails.length<s)for(rootTraversalDetails=new Array(s),i=0;i<s;++i)void 0===rootTraversalDetails[i]&&(rootTraversalDetails[i]=new TraversalDetails)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l=e._levelZeroTiles,c=1<l.length?e._occluders:void 0;comparisonPoint=t.camera.positionCartographic,l.sort(compareDistanceToPoint);var u,d=e._addHeightCallbacks,h=e._removeHeightCallbacks,p=t.frameNumber;if(0<d.length||0<h.length){for(i=0,u=l.length;i<u;++i)(n=l[i])._updateCustomData(p,d,h);d.length=0,h.length=0}o=t.camera;e._cameraPositionCartographic=o.positionCartographic;o=Matrix4.getTranslation(o.transform,cameraOriginScratch);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(o,e._cameraReferenceFrameOriginCartographic),i=0,u=l.length;i<u;++i)n=l[i],e._tileReplacementQueue.markTileRendered(n),n.renderable?visitIfVisible(e,n,a,t,c,!1,rootTraversalDetails[i]):(queueTileLoad(e,e._tileLoadQueueHigh,n,t),++r.tilesWaitingForChildren);e._lastSelectionFrameNumber=p}}function queueTileLoad(e,t,i,r){i.needsLoading&&(void 0!==e.tileProvider.computeTileLoadPriority&&(i._loadPriority=e.tileProvider.computeTileLoadPriority(i,r)),t.push(i))}function TraversalDetails(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function TraversalQuadDetails(){this.southwest=new TraversalDetails,this.southeast=new TraversalDetails,this.northwest=new TraversalDetails,this.northeast=new TraversalDetails}TraversalQuadDetails.prototype.combine=function(e){var t=this.southwest,i=this.southeast,r=this.northwest,n=this.northeast;e.allAreRenderable=t.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable&&n.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount+n.notYetRenderableCount};for(var traversalQuadsByLevel=new Array(31),i$1=0;i$1<traversalQuadsByLevel.length;++i$1)traversalQuadsByLevel[i$1]=new TraversalQuadDetails;function visitTile(e,t,i,r,n){var a=e._debug;++a.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>a.maxDepthVisited&&(a.maxDepthVisited=i.level);var o=screenSpaceError(e,t,i)<e.maximumScreenSpaceError,s=i.southwestChild,l=i.southeastChild,c=i.northwestChild,u=i.northeastChild,d=e._lastSelectionFrameNumber,h=i._lastSelectionResultFrame===d?i._lastSelectionResult:TileSelectionResult.NONE,d=e.tileProvider;if(o||r){var p=TileSelectionResult.originalResult(h)===TileSelectionResult.RENDERED,m=TileSelectionResult.originalResult(h)===TileSelectionResult.CULLED||h===TileSelectionResult.NONE,f=i.state===QuadtreeTileLoadState$1.DONE,p=p||m||f;if(p||defined(d.canRenderWithoutLosingDetail)&&(p=d.canRenderWithoutLosingDetail(i)),p)return o&&queueTileLoad(e,e._tileLoadQueueMedium,i,t),addTileToRenderList(e,i),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));r=!0,o&&queueTileLoad(e,e._tileLoadQueueHigh,i,t)}if(d.canRefine(i)){if(s.upsampledFromParent&&l.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent)return addTileToRenderList(e,i),queueTileLoad(e,e._tileLoadQueueMedium,i,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.REFINED;m=e._tilesToRender.length,f=e._tileLoadQueueLow.length,p=e._tileLoadQueueMedium.length,o=e._tileLoadQueueHigh.length,d=e._tileToUpdateHeights.length;if(visitVisibleChildrenNearToFar(e,s,l,c,u,t,r,n),m!==e._tilesToRender.length){l=n.allAreRenderable,c=n.anyWereRenderedLastFrame,u=n.notYetRenderableCount,r=!1;if(!l&&!c){for(var g=e._tilesToRender,_=m;_<g.length;++_)for(var y=g[_];void 0!==y&&y._lastSelectionResult!==TileSelectionResult.KICKED&&y!==i;)y._lastSelectionResult=TileSelectionResult.kick(y._lastSelectionResult),y=y.parent;e._tilesToRender.length=m,e._tileToUpdateHeights.length=d,addTileToRenderList(e,i),i._lastSelectionResult=TileSelectionResult.RENDERED;d=h===TileSelectionResult.RENDERED;!d&&u>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=f,e._tileLoadQueueMedium.length=p,e._tileLoadQueueHigh.length=o,queueTileLoad(e,e._tileLoadQueueMedium,i,t),n.notYetRenderableCount=i.renderable?0:1,r=!0),n.allAreRenderable=i.renderable,(n.anyWereRenderedLastFrame=d)||e._tileToUpdateHeights.push(i),++a.tilesWaitingForChildren}e.preloadAncestors&&!r&&queueTileLoad(e,e._tileLoadQueueLow,i,t)}}else i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,addTileToRenderList(e,i),queueTileLoad(e,e._tileLoadQueueHigh,i,t),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1}function visitVisibleChildrenNearToFar(e,t,i,r,n,a,o,s){var l=a.camera.positionCartographic,c=e._tileProvider,u=e._occluders,d=traversalQuadsByLevel[t.level],h=d.southwest,p=d.southeast,m=d.northwest,f=d.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,n,c,a,u,o,f)):(visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,i,c,a,u,o,p)):l.latitude<t.rectangle.north?(visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,r,c,a,u,o,m)):(visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,t,c,a,u,o,h)),d.combine(s)}function containsNeededPosition(e,t){t=t.rectangle;return defined(e._cameraPositionCartographic)&&Rectangle.contains(t,e._cameraPositionCartographic)||defined(e._cameraReferenceFrameOriginCartographic)&&Rectangle.contains(t,e._cameraReferenceFrameOriginCartographic)}function visitIfVisible(e,t,i,r,n,a,o){if(i.computeTileVisibility(t,r,n)!==Visibility$1.NONE)return visitTile(e,r,t,a,o);++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),o.allAreRenderable=!0,o.anyWereRenderedLastFrame=!1,o.notYetRenderableCount=0,containsNeededPosition(e,t)?(defined(t.data)&&defined(t.data.vertexArray)||queueTileLoad(e,e._tileLoadQueueMedium,t,r),o=e._lastSelectionFrameNumber,(o=t._lastSelectionResultFrame===o?t._lastSelectionResult:TileSelectionResult.NONE)!==TileSelectionResult.CULLED_BUT_NEEDED&&o!==TileSelectionResult.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=TileSelectionResult.CULLED_BUT_NEEDED):(!e.preloadSiblings&&0!==t.level||queueTileLoad(e,e._tileLoadQueueLow,t,r),t._lastSelectionResult=TileSelectionResult.CULLED),t._lastSelectionResultFrame=r.frameNumber}function screenSpaceError(e,t,i){if(t.mode===SceneMode$1.SCENE2D||t.camera.frustum instanceof OrthographicFrustum||t.camera.frustum instanceof OrthographicOffCenterFrustum)return screenSpaceError2D(e,t,i);e=e._tileProvider.getLevelMaximumGeometricError(i.level),i=i._distance,e=e*t.context.drawingBufferHeight/(i*t.camera.frustum.sseDenominator);return t.fog.enabled&&(e-=CesiumMath.fog(i,t.fog.density)*t.fog.sse),e/=t.pixelRatio}function screenSpaceError2D(e,t,i){var r=t.camera.frustum;defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);var n=t.context,a=n.drawingBufferWidth,n=n.drawingBufferHeight,n=e._tileProvider.getLevelMaximumGeometricError(i.level)/(Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,n));return t.fog.enabled&&t.mode!==SceneMode$1.SCENE2D&&(n-=CesiumMath.fog(i._distance,t.fog.density)*t.fog.sse),n/=t.pixelRatio}function addTileToRenderList(e,t){e._tilesToRender.push(t)}function processTileLoadQueue(e,t){var i,r,n=e._tileLoadQueueHigh,a=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;0===n.length&&0===a.length&&0===o.length||(e._tileReplacementQueue.trimTiles(e.tileCacheSize),i=getTimestamp$1()+e._loadQueueTimeSlice,n=processSinglePriorityLoadQueue(e,t,r=e._tileProvider,i,n,!1),n=processSinglePriorityLoadQueue(e,t,r,i,a,n),processSinglePriorityLoadQueue(e,t,r,i,o,n))}function sortByLoadPriority(e,t){return e._loadPriority-t._loadPriority}function processSinglePriorityLoadQueue(e,t,i,r,n,a){void 0!==i.computeTileLoadPriority&&n.sort(sortByLoadPriority);for(var o=0,s=n.length;o<s&&(getTimestamp$1()<r||!a);++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l),a=!0}return a}var scratchRay=new Ray,scratchCartographic$2=new Cartographic,scratchPosition$1=new Cartesian3,scratchArray$1=[];function updateHeights(e,t){if(e.tileProvider.ready){var i=scratchArray$1;i.length=0;for(var r=e._tileToUpdateHeights,n=e._tileProvider.terrainProvider,a=getTimestamp$1()+e._updateHeightsTimeSlice,o=t.mode,s=t.mapProjection,l=e.tileProvider.tilingScheme.ellipsoid;0<r.length;){var c=r[0];if(defined(c.data)&&defined(c.data.mesh)){for(var u=c.customData,d=u.length,h=!1,p=e._lastTileIndex;p<d;++p){var m,f,g=u[p];if(c.level>g.level){defined(g.positionOnEllipsoidSurface)||(g.positionOnEllipsoidSurface=Cartesian3.fromRadians(g.positionCartographic.longitude,g.positionCartographic.latitude,0,l)),o===SceneMode$1.SCENE3D?(m=l.geodeticSurfaceNormal(g.positionOnEllipsoidSurface,scratchRay.direction),defined(l.getSurfaceNormalIntersectionWithZAxis(g.positionOnEllipsoidSurface,11500,scratchRay.origin))||(defined(c.data.tileBoundingRegion)&&(f=c.data.tileBoundingRegion.minimumHeight),_=Math.min(defaultValue(f,0),-11500),T=Cartesian3.multiplyByScalar(m,Math.abs(_)+1,scratchPosition$1),Cartesian3.subtract(g.positionOnEllipsoidSurface,T,scratchRay.origin))):(Cartographic.clone(g.positionCartographic,scratchCartographic$2),scratchCartographic$2.height=-11500,s.project(scratchCartographic$2,scratchPosition$1),Cartesian3.fromElements(scratchPosition$1.z,scratchPosition$1.x,scratchPosition$1.y,scratchPosition$1),Cartesian3.clone(scratchPosition$1,scratchRay.origin),Cartesian3.clone(Cartesian3.UNIT_X,scratchRay.direction));var _=c.data.pick(scratchRay,o,s,!1,scratchPosition$1);defined(_)&&(g.callback(_),g.level=c.level)}else if(c.level===g.level){for(var y,C=c.children,v=C.length,S=0;S<v&&(y=C[S],!Rectangle.contains(y.rectangle,g.positionCartographic));++S);var T=n.getTileDataAvailable(y.x,y.y,y.level),_=c.parent;(defined(T)&&!T||defined(_)&&defined(_.data)&&defined(_.data.terrainData)&&!_.data.terrainData.isChildAvailable(_.x,_.y,y.x,y.y))&&g.removeFunc()}if(getTimestamp$1()>=a){h=!0;break}}if(h){e._lastTileIndex=p;break}e._lastTileIndex=0,r.shift()}else{var x=c._lastSelectionResultFrame===e._lastSelectionFrameNumber?c._lastSelectionResult:TileSelectionResult.NONE;x!==TileSelectionResult.RENDERED&&x!==TileSelectionResult.CULLED_BUT_NEEDED||i.push(c),r.shift(),e._lastTileIndex=0}}for(p=0;p<i.length;p++)r.push(i[p])}}function createRenderCommandsForSelectedTiles(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=0,a=r.length;n<a;++n){var o=r[n];i.showTileThisFrame(o,t)}}function Globe(e){var t=new EllipsoidTerrainProvider({ellipsoid:e=defaultValue(e,Ellipsoid.WGS84)}),i=new ImageryLayerCollection;this._ellipsoid=e,this._imageryLayerCollection=i,this._surfaceShaderSet=new GlobeSurfaceShaderSet,this._material=void 0,this._surface=new QuadtreePrimitive({tileProvider:new GlobeSurfaceTileProvider({terrainProvider:t,imageryLayers:i,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new Event,this._undergroundColor=Color.clone(Color.BLACK),this._undergroundColorAlphaByDistance=new NearFarScalar(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new GlobeTranslucency,makeShadersDirty(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Resource({url:buildModuleUrl("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.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=ShadowMode$1.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}function makeShadersDirty(e){var t=[],i=defined(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),r=[GroundAtmosphere];!defined(e._material)||i&&!e._terrainProvider.requestVertexNormals?e._surface._tileProvider.materialUniformMap=void 0:(r.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms),r.push(GlobeFS),e._surfaceShaderSet.baseVertexShaderSource=new ShaderSource({sources:[GroundAtmosphere,GlobeVS],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new ShaderSource({sources:r,defines:t}),e._surfaceShaderSet.material=e._material}function createComparePickTileFunction(i){return function(e,t){return BoundingSphere.distanceSquaredTo(e.pickBoundingSphere,i)-BoundingSphere.distanceSquaredTo(t.pickBoundingSphere,i)}}Object.defineProperties(Globe.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!defined(this._surface)||this._surface.tileProvider.ready&&0===this._surface._tileLoadQueueHigh.length&&0===this._surface._tileLoadQueueMedium.length&&0===this._surface._tileLoadQueueLow.length}},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}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){defined(e)||(e=Rectangle.clone(Rectangle.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),defined(this._material)&&makeShadersDirty(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,makeShadersDirty(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=Color.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=NearFarScalar.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});var scratchArray=[],scratchSphereIntersectionResult={start:0,stop:0};Globe.prototype.pickWorldCoordinates=function(e,t,i,r){i=defaultValue(i,!0);var n=t.mode,a=t.mapProjection,o=scratchArray;o.length=0;for(var s,l=this._surface._tilesToRender,c=l.length,u=0;u<c;++u){var d,h=(d=l[u]).data;if(defined(h)){var p=h.pickBoundingSphere;if(n!==SceneMode$1.SCENE3D)h.pickBoundingSphere=p=BoundingSphere.fromRectangleWithHeights2D(d.rectangle,a,h.tileBoundingRegion.minimumHeight,h.tileBoundingRegion.maximumHeight,p),Cartesian3.fromElements(p.center.z,p.center.x,p.center.y,p.center);else{if(!defined(h.renderedMesh))continue;BoundingSphere.clone(h.renderedMesh.boundingSphere3D,p)}defined(IntersectionTests.raySphere(e,p,scratchSphereIntersectionResult))&&o.push(h)}}for(o.sort(createComparePickTileFunction(e.origin)),c=o.length,u=0;u<c&&!defined(s=o[u].pick(e,t.mode,t.mapProjection,i,r));++u);return s};var cartoScratch=new Cartographic;Globe.prototype.pick=function(e,t,i){return defined(i=this.pickWorldCoordinates(e,t,!0,i))&&t.mode!==SceneMode$1.SCENE3D&&(i=Cartesian3.fromElements(i.y,i.z,i.x,i),e=t.mapProjection.unproject(i,cartoScratch),i=t.globe.ellipsoid.cartographicToCartesian(e,i)),i};var scratchGetHeightCartesian=new Cartesian3,scratchGetHeightIntersection=new Cartesian3,scratchGetHeightCartographic=new Cartographic,scratchGetHeightRay=new Ray;function tileIfContainsCartographic(e,t){return defined(e)&&Rectangle.contains(e.rectangle,t)?e:void 0}Globe.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(defined(t)){for(var i,r=t.length,n=0;n<r&&(i=t[n],!Rectangle.contains(i.rectangle,e));++n);if(!(r<=n)){for(var a=i;defined(i);)defined(i=tileIfContainsCartographic(i._southwestChild,e)||tileIfContainsCartographic(i._southeastChild,e)||tileIfContainsCartographic(i._northwestChild,e)||i._northeastChild)&&defined(i.data)&&defined(i.data.renderedMesh)&&(a=i);if(defined(i=a)&&defined(i.data)&&defined(i.data.renderedMesh)){var o,s=this._surface._tileProvider.tilingScheme.ellipsoid,l=Cartesian3.fromRadians(e.longitude,e.latitude,0,s,scratchGetHeightCartesian),c=scratchGetHeightRay,u=s.geodeticSurfaceNormal(l,c.direction);defined(s.getSurfaceNormalIntersectionWithZAxis(l,11500,c.origin))||(defined(i.data.tileBoundingRegion)&&(o=i.data.tileBoundingRegion.minimumHeight),o=Math.min(defaultValue(o,0),-11500),o=Cartesian3.multiplyByScalar(u,Math.abs(o)+1,scratchGetHeightIntersection),Cartesian3.subtract(l,o,c.origin));c=i.data.pick(c,void 0,void 0,!1,scratchGetHeightIntersection);if(defined(c))return s.cartesianToCartographic(c,scratchGetHeightCartographic).height}}}},Globe.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)},Globe.prototype.beginFrame=function(t){var i,r,e=this._surface,n=e.tileProvider,a=this.terrainProvider,o=this.showWaterEffect&&a.ready&&a.hasWaterMask;o&&this._oceanNormalMapResourceDirty&&(this._oceanNormalMapResourceDirty=!1,s=this._oceanNormalMapResource,defined(i=s.url)?(r=this,when(s.fetchImage(),function(e){i===r._oceanNormalMapResource.url&&(r._oceanNormalMap=r._oceanNormalMap&&r._oceanNormalMap.destroy(),r._oceanNormalMap=new Texture({context:t.context,source:e}))})):this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy());var a=t.passes,s=t.mode;a.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e.tileCacheSize=this.tileCacheSize,e.loadingDescendantLimit=this.loadingDescendantLimit,e.preloadAncestors=this.preloadAncestors,e.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===SceneMode$1.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,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.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,e.beginFrame(t))},Globe.prototype.render=function(e){this.show&&(defined(this._material)&&this._material.update(e.context),this._surface.render(e))},Globe.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},Globe.prototype.isDestroyed=function(){return!1},Globe.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(),destroyObject(this)};var PassThrough="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n}\n",PassThroughDepth="uniform highp sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);\n}\n";function GlobeDepth(){this._globeColorTexture=void 0,this._primitiveColorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this._tempGlobeDepthTexture=void 0,this._tempCopyDepthTexture=void 0,this._globeColorFramebuffer=void 0,this._primitiveColorFramebuffer=void 0,this._copyDepthFramebuffer=void 0,this._tempCopyDepthFramebuffer=void 0,this._updateDepthFramebuffer=void 0,this._clearGlobeColorCommand=void 0,this._clearPrimitiveColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._mergeColorCommand=void 0,this._viewport=new BoundingRectangle,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useLogDepth=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0,this._debugGlobeDepthViewportCommand=void 0}function executeDebugGlobeDepth(e,t,i,r){var n;defined(e._debugGlobeDepthViewportCommand)&&r===e._useLogDepth||(n=new ShaderSource({defines:[r?"LOG_DEPTH":""],sources:["uniform highp sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"]}),e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_depthTexture:function(){return e._globeDepthTexture}},owner:e}),e._useLogDepth=r),e._debugGlobeDepthViewportCommand.execute(t,i)}function destroyTextures$3(e){e._globeColorTexture=e._globeColorTexture&&!e._globeColorTexture.isDestroyed()&&e._globeColorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function destroyFramebuffers$3(e){e._globeColorFramebuffer=e._globeColorFramebuffer&&!e._globeColorFramebuffer.isDestroyed()&&e._globeColorFramebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function destroyUpdateDepthResources(e){e._tempCopyDepthFramebuffer=e._tempCopyDepthFramebuffer&&!e._tempCopyDepthFramebuffer.isDestroyed()&&e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer=e._updateDepthFramebuffer&&!e._updateDepthFramebuffer.isDestroyed()&&e._updateDepthFramebuffer.destroy(),e._tempGlobeDepthTexture=e._tempGlobeDepthTexture&&!e._tempGlobeDepthTexture.isDestroyed()&&e._tempGlobeDepthTexture.destroy()}function createUpdateDepthResources(e,t,i,r,n){e._tempGlobeDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e._tempCopyDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._tempGlobeDepthTexture],destroyAttachments:!1}),e._updateDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeDepthTexture],depthStencilTexture:n.framebuffer.depthStencilTexture,destroyAttachments:!1})}function createTextures$1(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._globeColorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}),e._globeDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST})}function createFramebuffers$2(e,t){e._globeColorFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeColorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function createPrimitiveFramebuffer(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._primitiveColorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),e._primitiveColorFramebuffer=new Framebuffer({context:t,colorTextures:[e._primitiveColorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1})}function destroyPrimitiveFramebuffer(e){e._primitiveColorTexture=e._primitiveColorTexture&&!e._primitiveColorTexture.isDestroyed()&&e._primitiveColorTexture.destroy(),e._primitiveColorFramebuffer=e._primitiveColorFramebuffer&&!e._primitiveColorFramebuffer.isDestroyed()&&e._primitiveColorFramebuffer.destroy()}function updateFramebuffers$4(e,t,i,r,n,a){var o=e._globeColorTexture,o=!defined(o)||o.width!==i||o.height!==r||n!==e._useHdr;o&&(destroyTextures$3(e),destroyFramebuffers$3(e),createTextures$1(e,t,i,r,n),createFramebuffers$2(e,t)),!o&&a===e._clearGlobeDepth||(destroyPrimitiveFramebuffer(e),a&&createPrimitiveFramebuffer(e,t,i,r,n))}function updateCopyCommands$1(e,t,i,r,n){e._viewport.width=i,e._viewport.height=r;i=!BoundingRectangle.equals(e._viewport,n.viewport),r=i!==e._useScissorTest;e._useScissorTest=i,BoundingRectangle.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=BoundingRectangle.clone(n.viewport,e._scissorRectangle),r=!0),defined(e._rs)&&BoundingRectangle.equals(e._viewport,e._rs.viewport)&&!r||(e._rs=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:BlendingState$1.ALPHA_BLEND}),e._rsUpdate=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})),defined(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._depthStencilTexture}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer,e._copyDepthCommand.renderState=e._rs,defined(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._globeColorTexture}},owner:e})),e._copyColorCommand.renderState=e._rs,defined(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer,e._tempCopyDepthCommand.renderState=e._rs,defined(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._tempGlobeDepthTexture}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer,e._updateDepthCommand.renderState=e._rsUpdate,defined(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ClearCommand({color:new Color(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e._globeColorFramebuffer,defined(e._clearPrimitiveColorCommand)||(e._clearPrimitiveColorCommand=new ClearCommand({color:new Color(0,0,0,0),stencil:0,owner:e})),e._clearPrimitiveColorCommand.framebuffer=e._primitiveColorFramebuffer,defined(e._mergeColorCommand)||(e._mergeColorCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._primitiveColorTexture}},owner:e})),e._mergeColorCommand.framebuffer=e._globeColorFramebuffer,e._mergeColorCommand.renderState=e._rsBlend}function GlobeTranslucencyFramebuffer(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._framebuffer=void 0,this._packedDepthTexture=void 0,this._packedDepthFramebuffer=void 0,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new BoundingRectangle,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}function destroyResources$3(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&!e._depthStencilRenderbuffer.isDestroyed()&&e._depthStencilRenderbuffer.destroy(),e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy(),e._packedDepthTexture=e._packedDepthTexture&&!e._packedDepthTexture.isDestroyed()&&e._packedDepthTexture.destroy(),e._packedDepthFramebuffer=e._packedDepthFramebuffer&&!e._packedDepthFramebuffer.isDestroyed()&&e._packedDepthFramebuffer.destroy()}function createResources$1(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._colorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),t.depthTexture?e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}):e._depthStencilRenderbuffer=new Renderbuffer({context:t,width:i,height:r,format:RenderbufferFormat$1.DEPTH_STENCIL}),e._framebuffer=new Framebuffer({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,depthStencilRenderbuffer:e._depthStencilRenderbuffer,destroyAttachments:!1}),e._packedDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e._packedDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._packedDepthTexture],destroyAttachments:!1})}function updateResources$1(e,t,i,r,n){var a=e._colorTexture;defined(a)&&a.width===i&&a.height===r&&n===e._useHdr||(destroyResources$3(e),createResources$1(e,t,i,r,n))}function updateCommands(e,t,i,r,n){e._viewport.width=i,e._viewport.height=r;i=!BoundingRectangle.equals(e._viewport,n.viewport),r=i!==e._useScissorTest;e._useScissorTest=i,BoundingRectangle.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=BoundingRectangle.clone(n.viewport,e._scissorRectangle),r=!0),defined(e._renderState)&&BoundingRectangle.equals(e._viewport,e._renderState.viewport)&&!r||(e._renderState=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),defined(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._depthStencilTexture}},owner:e})),defined(e._clearCommand)||(e._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e._framebuffer,e._clearCommand.renderState=e._renderState}Object.defineProperties(GlobeDepth.prototype,{framebuffer:{get:function(){return this._globeColorFramebuffer}},primitiveFramebuffer:{get:function(){return this._primitiveColorFramebuffer}}}),GlobeDepth.prototype.executeDebugGlobeDepth=function(e,t,i){executeDebugGlobeDepth(this,e,t,i)},GlobeDepth.prototype.update=function(e,t,i,r,n){var a=i.width,i=i.height;updateFramebuffers$4(this,e,a,i,r,n),updateCopyCommands$1(this,e,a,i,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=n},GlobeDepth.prototype.executeCopyDepth=function(e,t){defined(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},GlobeDepth.prototype.executeUpdateDepth=function(e,t,i){var r,n=t.framebuffer.depthStencilTexture;i||n!==this._depthStencilTexture?defined(this._updateDepthCommand)&&(defined(this._updateDepthFramebuffer)&&this._updateDepthFramebuffer.depthStencilTexture===n&&this._updateDepthFramebuffer.getColorTexture(0)===this._globeDepthTexture||(r=this._globeDepthTexture.width,i=this._globeDepthTexture.height,destroyUpdateDepthResources(this),createUpdateDepthResources(this,e,r,i,t),updateCopyCommands$1(this,e,r,i,t)),this._tempCopyDepthTexture=n,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)):defined(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)},GlobeDepth.prototype.executeCopyColor=function(e,t){defined(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},GlobeDepth.prototype.executeMergeColor=function(e,t){defined(this._mergeColorCommand)&&this._mergeColorCommand.execute(e,t)},GlobeDepth.prototype.clear=function(e,t,i){var r=this._clearGlobeColorCommand;defined(r)&&(Color.clone(i,r.color),r.execute(e,t)),defined(r=this._clearPrimitiveColorCommand)&&defined(this._primitiveColorFramebuffer)&&r.execute(e,t)},GlobeDepth.prototype.isDestroyed=function(){return!1},GlobeDepth.prototype.destroy=function(){return destroyTextures$3(this),destroyFramebuffers$3(this),destroyPrimitiveFramebuffer(this),destroyUpdateDepthResources(this),defined(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),defined(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),defined(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),defined(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),defined(this._mergeColorCommand)&&(this._mergeColorCommand.shaderProgram=this._mergeColorCommand.shaderProgram.destroy()),defined(this._debugGlobeDepthViewportCommand)&&(this._debugGlobeDepthViewportCommand.shaderProgram=this._debugGlobeDepthViewportCommand.shaderProgram.destroy()),destroyObject(this)},Object.defineProperties(GlobeTranslucencyFramebuffer.prototype,{classificationTexture:{get:function(){return this._colorTexture}},classificationFramebuffer:{get:function(){return this._framebuffer}}}),GlobeTranslucencyFramebuffer.prototype.updateAndClear=function(e,t,i,r){var n=t.width,t=t.height;updateResources$1(this,i,n,t,e),updateCommands(this,i,n,t,r),this._useHdr=e},GlobeTranslucencyFramebuffer.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)},GlobeTranslucencyFramebuffer.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this._packedDepthTexture},GlobeTranslucencyFramebuffer.prototype.isDestroyed=function(){return!1},GlobeTranslucencyFramebuffer.prototype.destroy=function(){return destroyResources$3(this),destroyObject(this)};var DerivedCommandType={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},derivedCommandsMaximumLength=DerivedCommandType.DERIVED_COMMANDS_MAXIMUM_LENGTH,DerivedCommandNames=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function GlobeTranslucencyState(){this._frontFaceAlphaByDistance=new NearFarScalar(0,1,0,1),this._backFaceAlphaByDistance=new NearFarScalar(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=Rectangle.clone(Rectangle.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedBlendCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedPickCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedCommandTypesToUpdate=new Array(derivedCommandsMaximumLength),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}function updateAlphaByDistance(e,t,i,r){return e?defined(i)?(NearFarScalar.clone(i,r),r.nearValue*=t,r.farValue*=t):(r.nearValue=t,r.farValue=t):(r.nearValue=1,r.farValue=1),r}function isFaceTranslucent(e,t,i){return e&&(i.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function isSunVisibleThroughGlobe(e,t){var i=e._frontFaceTranslucent,e=e._backFaceTranslucent;return i&&(t.cameraUnderground||e)}function isEnvironmentVisible(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function useDepthPlane(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function requiresManualDepthTest(e,t,i){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!i.depthTestAgainstTerrain&&t.mode!==SceneMode$1.SCENE2D&&t.context.depthTexture}function getNumberOfTextureUniforms(e){var t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function gatherDerivedCommandRequirements(e,t){e._derivedCommandsLength=getDerivedCommandTypes(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=getDerivedCommandTypes(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=getDerivedCommandTypes(e,t,!1,!0,e._derivedPickCommandTypes);for(var i=0,r=0;r<e._derivedCommandsLength;++r)i|=1<<e._derivedCommandTypes[r];for(r=0;r<e._derivedBlendCommandsLength;++r)i|=1<<e._derivedBlendCommandTypes[r];for(r=0;r<e._derivedPickCommandsLength;++r)i|=1<<e._derivedPickCommandTypes[r];var n=0;for(r=0;r<derivedCommandsMaximumLength;++r)0<(i&1<<r)&&(e._derivedCommandTypesToUpdate[n++]=r);e._derivedCommandsToUpdateLength=n;t=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=t,!defined(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=createDerivedCommandPacks())}function getDerivedCommandTypes(e,t,i,r,n){var a=0,o=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!o)return a;var l=t.cameraUnderground,o=e._requiresManualDepthTest,e=r?DerivedCommandType.PICK_FRONT_FACE:o?DerivedCommandType.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:DerivedCommandType.TRANSLUCENT_FRONT_FACE,o=r?DerivedCommandType.PICK_BACK_FACE:o?DerivedCommandType.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:DerivedCommandType.TRANSLUCENT_BACK_FACE;return t.mode===SceneMode$1.SCENE2D?(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_FACE,n[a++]=e):s?(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(n[a++]=e,n[a++]=o):(n[a++]=o,n[a++]=e)):l?(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_BACK_FACE),n[a++]=DerivedCommandType.OPAQUE_FRONT_FACE,n[a++]=o):(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_FACE),n[a++]=DerivedCommandType.OPAQUE_BACK_FACE,n[a++]=e),a}function removeDefine(e,t){t=e.indexOf(t);-1<t&&e.splice(t,1)}function hasDefine(e,t){return-1<e.indexOf(t)}function getOpaqueFrontFaceShaderProgram(e,t){removeDefine(e.defines,"TRANSLUCENT"),removeDefine(t.defines,"TRANSLUCENT")}function getOpaqueBackFaceShaderProgram(e,t){removeDefine(e.defines,"GROUND_ATMOSPHERE"),removeDefine(t.defines,"GROUND_ATMOSPHERE"),removeDefine(e.defines,"FOG"),removeDefine(t.defines,"FOG"),removeDefine(e.defines,"TRANSLUCENT"),removeDefine(t.defines,"TRANSLUCENT")}function getDepthOnlyShaderProgram(e,t){hasDefine(t.defines,"TILE_LIMIT_RECTANGLE")||hasDefine(t.defines,"ENABLE_CLIPPING_PLANES")||(t.sources=["void main() \n{ \n gl_FragColor = vec4(1.0); \n} \n"])}function getTranslucentShaderProgram$1(e,t){for(var i=t.sources,r=i.length,n=0;n<r;++n)i[n]=ShaderSource.replaceMain(i[n],"czm_globe_translucency_main");i.push("\n\nuniform sampler2D u_classificationTexture; \nvoid main() \n{ \n vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n#ifdef MANUAL_DEPTH_TEST \n float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st)); \n if (logDepthOrDepth != 0.0) \n { \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); \n float depthEC = eyeCoordinate.z / eyeCoordinate.w; \n if (v_positionEC.z < depthEC) \n { \n discard; \n } \n } \n#endif \n czm_globe_translucency_main(); \n vec4 classificationColor = texture2D(u_classificationTexture, st); \n if (classificationColor.a > 0.0) \n { \n // Reverse premultiplication process to get the correct composited result of the classification primitives \n classificationColor.rgb /= classificationColor.a; \n } \n gl_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + gl_FragColor * (1.0 - classificationColor.a); \n} \n")}function getTranslucentBackFaceShaderProgram(e,t){getTranslucentShaderProgram$1(e,t),removeDefine(e.defines,"GROUND_ATMOSPHERE"),removeDefine(t.defines,"GROUND_ATMOSPHERE"),removeDefine(e.defines,"FOG"),removeDefine(t.defines,"FOG")}function getTranslucentFrontFaceManualDepthTestShaderProgram(e,t){getTranslucentShaderProgram$1(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function getTranslucentBackFaceManualDepthTestShaderProgram(e,t){getTranslucentBackFaceShaderProgram(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function getPickShaderProgram(e,t){t.sources=["uniform sampler2D u_classificationTexture; \nvoid main() \n{ \n vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n vec4 pickColor = texture2D(u_classificationTexture, st); \n if (pickColor == vec4(0.0)) \n { \n discard; \n } \n gl_FragColor = pickColor; \n} \n"]}function getDerivedShaderProgram(e,t,i,r,n,a){if(!defined(n))return t;if(!r&&defined(i))return i;var o,s=e.shaderCache.getDerivedShaderProgram(t,a);return defined(s)||(o=t._attributeLocations,r=t.vertexShaderSource.clone(),i=t.fragmentShaderSource.clone(),r.defines=defined(r.defines)?r.defines.slice(0):[],i.defines=defined(i.defines)?i.defines.slice(0):[],n(r,i),s=e.shaderCache.createDerivedShaderProgram(t,a,{vertexShaderSource:r,fragmentShaderSource:i,attributeLocations:o})),s}function getOpaqueFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0}function getOpaqueBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0}function getDepthOnlyFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getDepthOnlyBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getDepthOnlyFrontAndBackFaceRenderState(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getTranslucentFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND}function getTranslucentBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND}function getPickFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function getPickBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function getDerivedRenderState(e,t,i,r,n){if(!defined(r))return e;if(!i&&defined(t))return t;t=n[e.id];return defined(t)||(r(r=RenderState.getState(e)),t=RenderState.fromCache(r),n[e.id]=t),t}function getTranslucencyUniformMap(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function getDerivedUniformMap(e,t,i,r,n){return defined(n)?!r&&defined(i)?i:combine$2(t,n(e),!1):t}function DerivedCommandPack(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function createDerivedCommandPacks(){return[new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getOpaqueFrontFaceShaderProgram,getRenderStateFunction:getOpaqueFrontFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getOpaqueBackFaceShaderProgram,getRenderStateFunction:getOpaqueBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram,getRenderStateFunction:getDepthOnlyFrontFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram,getRenderStateFunction:getDepthOnlyBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram,getRenderStateFunction:getDepthOnlyFrontAndBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentShaderProgram$1,getRenderStateFunction:getTranslucentFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentBackFaceShaderProgram,getRenderStateFunction:getTranslucentBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentFrontFaceManualDepthTestShaderProgram,getRenderStateFunction:getTranslucentFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentBackFaceManualDepthTestShaderProgram,getRenderStateFunction:getTranslucentBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:getPickShaderProgram,getRenderStateFunction:getPickFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:getPickShaderProgram,getRenderStateFunction:getPickBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap})]}Object.defineProperties(GlobeTranslucencyState.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}}}),GlobeTranslucencyState.prototype.update=function(e){var t=e.globe;if(!defined(t)||!t.show)return this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,void(this._useDepthPlane=!1);this._frontFaceAlphaByDistance=updateAlphaByDistance(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=updateAlphaByDistance(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=isFaceTranslucent(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=isFaceTranslucent(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=requiresManualDepthTest(this,e,t),this._sunVisibleThroughGlobe=isSunVisibleThroughGlobe(this,e),this._environmentVisible=isEnvironmentVisible(this,e),this._useDepthPlane=useDepthPlane(this,e),this._numberOfTextureUniforms=getNumberOfTextureUniforms(this),this._rectangle=Rectangle.clone(t.translucency.rectangle,this._rectangle),gatherDerivedCommandRequirements(this,e)};var derivedCommandNames=new Array(derivedCommandsMaximumLength),derivedCommandPacks=new Array(derivedCommandsMaximumLength);function updateDerivedCommands$1(e,t,i,r,n,a,o){var s=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!defined(s)||l){t.dirty=!1,defined(s)||(t.derivedCommands.globeTranslucency=s={});var c=o.frameNumber,u=defaultValue(s.uniformMapDirtyFrame,0),d=defaultValue(s.shaderProgramDirtyFrame,0),h=defaultValue(s.renderStateDirtyFrame,0),p=s.uniformMap!==t.uniformMap,m=s.shaderProgramId!==t.shaderProgram.id,f=s.renderStateId!==t.renderState.id;p&&(s.uniformMapDirtyFrame=c),m&&(s.shaderProgramDirtyFrame=c),f&&(s.renderStateDirtyFrame=c),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(var g=0;g<i;++g){var _,y,C=a[g],v=r[g],S=n[g],T=defined(x=s[S])?(_=x.uniformMap,y=x.shaderProgram,x.renderState):y=_=void 0,x=DrawCommand.shallowClone(t,x),b=defaultValue((s[S]=x).derivedCommands.uniformMapDirtyFrame,0),E=defaultValue(x.derivedCommands.shaderProgramDirtyFrame,0),P=defaultValue(x.derivedCommands.renderStateDirtyFrame,0),b=p||b<u,E=m||E<d,P=f||P<h;b&&(x.derivedCommands.uniformMapDirtyFrame=c),E&&(x.derivedCommands.shaderProgramDirtyFrame=c),P&&(x.derivedCommands.renderStateDirtyFrame=c),x.derivedCommands.type=v,x.pass=C.pass,x.pickOnly=C.pickOnly,x.uniformMap=getDerivedUniformMap(e,t.uniformMap,_,b,C.getUniformMapFunction),x.shaderProgram=getDerivedShaderProgram(o.context,t.shaderProgram,y,E,C.getShaderProgramFunction,S),x.renderState=getDerivedRenderState(t.renderState,T,P,C.getRenderStateFunction,C.renderStateCache)}}}function executeCommandsMatchingType(e,t,i,r,n,a,o){for(var s=0;s<t;++s){var l=e[s],c=l.derivedCommands.type;(!defined(o)||-1<o.indexOf(c))&&i(l,r,n,a)}}function executeCommands$1(e,t,i,r,n,a){for(var o=0;o<t;++o)i(e[o],r,n,a)}GlobeTranslucencyState.prototype.updateDerivedCommands=function(e,t){var i=this._derivedCommandTypesToUpdate,r=this._derivedCommandsToUpdateLength;if(0!==r){for(var n=0;n<r;++n)derivedCommandPacks[n]=this._derivedCommandPacks[i[n]],derivedCommandNames[n]=DerivedCommandNames[i[n]];updateDerivedCommands$1(this,e,r,i,derivedCommandNames,derivedCommandPacks,t)}},GlobeTranslucencyState.prototype.pushDerivedCommands=function(e,t,i){var r=i.passes.pick;if(!r||!t){var n=this._derivedCommandTypes,a=this._derivedCommandsLength;if(r?(n=this._derivedPickCommandTypes,a=this._derivedPickCommandsLength):t&&(n=this._derivedBlendCommandTypes,a=this._derivedBlendCommandsLength),0!==a)for(var o=e.derivedCommands.globeTranslucency,s=0;s<a;++s){var l=DerivedCommandNames[n[s]];i.commandList.push(o[l])}else i.commandList.push(e)}};var opaqueTypes=[DerivedCommandType.OPAQUE_FRONT_FACE,DerivedCommandType.OPAQUE_BACK_FACE],depthOnlyTypes=[DerivedCommandType.DEPTH_ONLY_FRONT_FACE,DerivedCommandType.DEPTH_ONLY_BACK_FACE,DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE];function GoogleEarthEnterpriseDiscardPolicy(){this._image=new Image}function GoogleEarthEnterpriseImageryProvider(e){var t;e=defaultValue(e,defaultValue.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,t=defined(e.metadata)?e.metadata:new GoogleEarthEnterpriseMetadata(Resource.createIfNeeded(e.url)),this._metadata=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-CesiumMath.PI,-CesiumMath.PI,CesiumMath.PI,CesiumMath.PI),ellipsoid:e.ellipsoid});e=e.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,defined(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new GoogleEarthEnterpriseDiscardPolicy),this._errorEvent=new Event,this._ready=!1;var i,r=this;this._readyPromise=t.readyPromise.then(function(e){if(t.imageryPresent)return TileProviderError.handleSuccess(i),r._ready=e;e=new RuntimeError("The server "+t.url+" doesn't have imagery");return i=TileProviderError.handleError(i,r,r._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)}).otherwise(function(e){return i=TileProviderError.handleError(i,r,r._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)})}function buildImageResource(e,t,i,r,n,a){n=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(i,r,n),t=defined(t=t.imageryVersion)&&0<t?t:1;return e._metadata.resource.getDerivedResource({url:"flatfile?f1-0"+n+"-i."+t.toString(),request:a})}function getImageType(e){var 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";return e[1]==="PNG".charCodeAt(0)&&e[2]==="PNG".charCodeAt(1)&&e[3]==="PNG".charCodeAt(2)?"image/png":void 0}function decodeEarthImageryPacket(e){for(var t=protobuf.Reader.create(e),i=t.len,r={};t.pos<i;){var n=t.uint32();switch(n>>>3){case 1:r.imageType=t.uint32();break;case 2:r.imageData=t.bytes();break;case 3:r.alphaType=t.uint32();break;case 4:r.imageAlpha=t.bytes();break;case 5:var a=r.copyrightIds;if(defined(a)||(a=r.copyrightIds=[]),2==(7&n))for(var o=t.uint32()+t.pos;t.pos<o;)a.push(t.uint32());else a.push(t.uint32());break;default:t.skipType(7&n)}}e=r.imageType;if(defined(e))switch(e){case 0:r.imageType="image/jpeg";break;case 4:r.imageType="image/png";break;default:throw new RuntimeError("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}e=r.alphaType;return defined(e)&&0!==e&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete r.alphaType,delete r.imageAlpha),r}GlobeTranslucencyState.prototype.executeGlobeCommands=function(e,t,i,r,n){var a=r.context,o=e.commands[Pass$1.GLOBE],e=e.indices[Pass$1.GLOBE];0!==e&&((this._globeTranslucencyFramebuffer=i).clearClassification(a,n),executeCommandsMatchingType(o,e,t,r,a,n,opaqueTypes))},GlobeTranslucencyState.prototype.executeGlobeClassificationCommands=function(e,t,i,r,n){var a,o=r.context,s=e.commands[Pass$1.GLOBE],l=e.indices[Pass$1.GLOBE],c=e.commands[Pass$1.TERRAIN_CLASSIFICATION],u=e.indices[Pass$1.TERRAIN_CLASSIFICATION];0!==l&&0!==u&&(a=this._frontFaceTranslucent,e=this._backFaceTranslucent,a&&e||executeCommands$1(c,u,t,r,o,n),(a||e)&&(this._globeTranslucencyFramebuffer=i,a=o.uniformState.globeDepthTexture,e=n.framebuffer,n.framebuffer=i.classificationFramebuffer,executeCommandsMatchingType(s,l,t,r,o,n,depthOnlyTypes),o.depthTexture&&(i=i.packDepth(o,n),o.uniformState.globeDepthTexture=i),executeCommands$1(c,u,t,r,o,n),o.uniformState.globeDepthTexture=a,n.framebuffer=e))},GoogleEarthEnterpriseDiscardPolicy.prototype.isReady=function(){return!0},GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage=function(e){return e===this._image},Object.defineProperties(GoogleEarthEnterpriseImageryProvider.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}}),GoogleEarthEnterpriseImageryProvider.prototype.getTileCredits=function(e,t,i){var r=this._metadata,i=r.getTileInformation(e,t,i);if(defined(i)){i=r.providers[i.imageryProvider];if(defined(i))return[i]}},GoogleEarthEnterpriseImageryProvider.prototype.requestImage=function(e,t,i,r){var n=this._tileDiscardPolicy._image,a=this._metadata,o=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),s=a.getTileInformation(e,t,i);if(!defined(s)){if(a.isValid(o)){o=new Request({throttle:r.throttle,throttleByServer:r.throttleByServer,type:r.type,priorityFunction:r.priorityFunction});return void a.populateSubtree(e,t,i,o)}return n}if(!s.hasImagery())return n;r=buildImageResource(this,s,e,t,i,r).fetchArrayBuffer();return defined(r)?r.then(function(e){decodeGoogleEarthEnterpriseData(a.key,e);var t,i=new Uint8Array(e),e=a.protoImagery;return defined(e)&&e||(t=getImageType(i)),defined(t)||defined(e)&&!e||(t=(e=decodeEarthImageryPacket(i)).imageType,i=e.imageData),defined(t)&&defined(i)?loadImageFromTypedArray({uint8Array:i,format:t,flipY:!0}):n}):void 0},GoogleEarthEnterpriseImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){};var defaultColor=new Color(1,1,1,.4),defaultGlowColor=new Color(0,1,0,.05),defaultBackgroundColor=new Color(0,.5,0,.2);function GridImageryProvider(e){e=defaultValue(e,defaultValue.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=defined(e.tilingScheme)?e.tilingScheme:new GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._cells=defaultValue(e.cells,8),this._color=defaultValue(e.color,defaultColor),this._glowColor=defaultValue(e.glowColor,defaultGlowColor),this._glowWidth=defaultValue(e.glowWidth,6),this._backgroundColor=defaultValue(e.backgroundColor,defaultBackgroundColor),this._errorEvent=new Event,this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._canvasSize=defaultValue(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=when.resolve(!0)}function InvertClassification(){this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._texture=void 0,this._classifiedTexture=void 0,this._depthStencilTexture=void 0,this._fbo=void 0,this._fboClassified=void 0,this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0});var e=this;this._uniformMap={colorTexture:function(){return e._texture},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._classifiedTexture}}}Object.defineProperties(GridImageryProvider.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}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),GridImageryProvider.prototype._drawGrid=function(e){for(var t=this._canvasSize,i=0;i<=this._cells;++i){var r=1+i/this._cells*(t-1);e.moveTo(r,0),e.lineTo(r,t),e.moveTo(0,r),e.lineTo(t,r)}e.stroke()},GridImageryProvider.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(0,0,t,t);r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i),i.lineWidth=.5*this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i);r=this._color.toCssColorString();return i.strokeStyle=r,i.lineWidth=2,i.strokeRect(0,0,t,t),i.lineWidth=1,this._drawGrid(i),e},GridImageryProvider.prototype.getTileCredits=function(e,t,i){},GridImageryProvider.prototype.requestImage=function(e,t,i,r){return this._canvas},GridImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},Object.defineProperties(InvertClassification.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),InvertClassification.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var rsUnclassified={depthMask:!1,stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},blending:BlendingState$1.ALPHA_BLEND},rsClassified={depthMask:!1,stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},blending:BlendingState$1.ALPHA_BLEND},rsDefault={depthMask:!0,depthTest:{enabled:!0},stencilTest:StencilConstants$1.setCesium3DTileBit(),stencilMask:StencilConstants$1.CESIUM_3D_TILE_MASK,blending:BlendingState$1.ALPHA_BLEND},translucentFS="#extension GL_EXT_frag_depth : enable\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform sampler2D classifiedTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n bool isClassified = all(equal(texture2D(classifiedTexture, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n vec4 highlightColor = czm_invertClassificationColor;\n if (isClassified)\n {\n discard;\n }\n#else\n vec4 highlightColor = vec4(1.0);\n if (!isClassified)\n {\n discard;\n }\n#endif\n gl_FragColor = color * highlightColor;\n gl_FragDepthEXT = texture2D(depthTexture, v_textureCoordinates).r;\n}\n",opaqueFS="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n#ifdef UNCLASSIFIED\n gl_FragColor = color * czm_invertClassificationColor;\n#else\n gl_FragColor = color;\n#endif\n}\n";function JobTypeBudget(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function JobScheduler(e){var t=new Array(JobType$1.NUMBER_OF_JOB_TYPES);t[JobType$1.TEXTURE]=new JobTypeBudget(defined(e)?e[JobType$1.TEXTURE]:10),t[JobType$1.PROGRAM]=new JobTypeBudget(defined(e)?e[JobType$1.PROGRAM]:10),t[JobType$1.BUFFER]=new JobTypeBudget(defined(e)?e[JobType$1.BUFFER]:30);for(var i=t.length,r=0,n=0;n<i;++n)r+=t[n].total;var a=new Array(i);for(n=0;n<i;++n)a[n]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=a}function Light(){}InvertClassification.prototype.update=function(e){var t=this._texture,i=!defined(t)||this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;var r,n,a=e.drawingBufferWidth,o=e.drawingBufferHeight,t=!defined(t)||t.width!==a||t.height!==o;(t||i)&&(this._texture=this._texture&&this._texture.destroy(),this._classifiedTexture=this._classifiedTexture&&this._classifiedTexture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._texture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}),defined(this._previousFramebuffer)||(this._classifiedTexture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}),this._depthStencilTexture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}))),defined(this._fbo)&&!t&&!i||(this._fbo=this._fbo&&this._fbo.destroy(),this._fboClassified=this._fboClassified&&this._fboClassified.destroy(),defined(this._previousFramebuffer)?(n=this._previousFramebuffer.depthStencilTexture,r=this._previousFramebuffer.depthStencilRenderbuffer):n=this._depthStencilTexture,this._fbo=new Framebuffer({context:e,colorTextures:[this._texture],depthStencilTexture:n,depthStencilRenderbuffer:r,destroyAttachments:!1}),defined(this._previousFramebuffer)||(this._fboClassified=new Framebuffer({context:e,colorTextures:[this._classifiedTexture],depthStencilTexture:n,destroyAttachments:!1}))),defined(this._rsUnclassified)||(this._rsUnclassified=RenderState.fromCache(rsUnclassified),this._rsClassified=RenderState.fromCache(rsClassified),this._rsDefault=RenderState.fromCache(rsDefault)),defined(this._unclassifiedCommand)&&!i||(defined(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),i=new ShaderSource({defines:["UNCLASSIFIED"],sources:[n=defined(this._previousFramebuffer)?opaqueFS:translucentFS]}),n=new ShaderSource({sources:[n]}),this._unclassifiedCommand=e.createViewportQuadCommand(i,{renderState:defined(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(n,{renderState:defined(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),defined(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),defined(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(PassThrough,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this})))},InvertClassification.prototype.clear=function(e,t){var i=t.framebuffer;defined(this._previousFramebuffer)?(t.framebuffer=this._fbo,this._clearColorCommand.execute(e,t)):(t.framebuffer=this._fbo,this._clearCommand.execute(e,t),t.framebuffer=this._fboClassified,this._clearCommand.execute(e,t)),t.framebuffer=i},InvertClassification.prototype.executeClassified=function(e,t){var i;defined(this._previousFramebuffer)||(i=t.framebuffer,t.framebuffer=this._fboClassified,this._translucentCommand.execute(e,t),t.framebuffer=i),this._classifiedCommand.execute(e,t)},InvertClassification.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},InvertClassification.prototype.isDestroyed=function(){return!1},InvertClassification.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),defined(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),destroyObject(this)},Object.defineProperties(JobTypeBudget.prototype,{total:{get:function(){return this._total}}}),JobScheduler.getTimestamp=getTimestamp$1,Object.defineProperties(JobScheduler.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),JobScheduler.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},JobScheduler.prototype.resetBudgets=function(){for(var e=this._budgets,t=e.length,i=0;i<t;++i){var r=e[i];r.starvedLastFrame=r.starvedThisFrame,r.starvedThisFrame=!1,r.usedThisFrame=0,r.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},JobScheduler.prototype.execute=function(e,t){var i,r=this._budgets,n=r[t],a=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&a)return!(n.starvedThisFrame=!0);if(n.usedThisFrame+n.stolenFromMeThisFrame>=n.total){for(var o=r.length,s=0;s<o&&(!((i=r[s]).usedThisFrame+i.stolenFromMeThisFrame<i.total)||i.starvedLastFrame);++s);if(s===o&&a)return!1;a&&(n.starvedThisFrame=!0)}a=JobScheduler.getTimestamp();e.execute();a=JobScheduler.getTimestamp()-a;return this._totalUsedThisFrame+=a,i?i.stolenFromMeThisFrame+=a:n.usedThisFrame+=a,this._executedThisFrame[t]=!0},Object.defineProperties(Light.prototype,{color:{get:DeveloperError.throwInstantiationError},intensity:{get:DeveloperError.throwInstantiationError}});var trailingSlashRegex=/\/$/,defaultCredit$1=new Credit('© <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 MapboxStyleImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).styleId,i=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;var r=Resource.createIfNeeded(defaultValue(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=i;var n=defaultValue(e.tilesize,512);this._tilesize=n;var a=defaultValue(e.username,"mapbox");this._username=a;var o,n=defined(e.scaleFactor)?"@2x":"",a=r.getUrlComponent();trailingSlashRegex.test(a)||(a+="/"),a+=this._username+"/"+t+"/tiles/"+this._tilesize+"/{z}/{x}/{y}"+n,r.url=a,r.setQueryParameters({access_token:i}),defined(e.credit)?"string"==typeof(o=e.credit)&&(o=new Credit(o)):o=defaultCredit$1,this._resource=r,this._imageryProvider=new UrlTemplateImageryProvider({url:r,credit:o,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function Moon(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).textureUrl;defined(t)||(t=buildModuleUrl("Assets/Textures/moonSmall.jpg")),this.show=defaultValue(e.show,!0),this.textureUrl=t,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.MOON),this.onlySunLighting=defaultValue(e.onlySunLighting,!0),this._ellipsoidPrimitive=new EllipsoidPrimitive({radii:this.ellipsoid.radii,material:Material.fromType(Material.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new IauOrientationAxes}Object.defineProperties(MapboxStyleImageryProvider.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},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}}}),MapboxStyleImageryProvider.prototype.getTileCredits=function(e,t,i){},MapboxStyleImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},MapboxStyleImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},MapboxStyleImageryProvider._defaultCredit=defaultCredit$1,Object.defineProperties(Moon.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var icrfToFixed=new Matrix3,rotationScratch=new Matrix3,translationScratch=new Cartesian3,scratchCommandList=[];function NeverTileDiscardPolicy(e){}Moon.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;defined(Transforms.computeIcrfToFixedMatrix(i,icrfToFixed))||Transforms.computeTemeToPseudoFixedMatrix(i,icrfToFixed);var r=this._axes.evaluate(i,rotationScratch);Matrix3.transpose(r,r),Matrix3.multiply(icrfToFixed,r,r);i=Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(i,translationScratch);Matrix3.multiplyByVector(icrfToFixed,i,i),Matrix4.fromRotationTranslation(r,i,t.modelMatrix);i=e.commandList;return(e.commandList=scratchCommandList).length=0,t.update(e),e.commandList=i,1===scratchCommandList.length?scratchCommandList[0]:void 0}},Moon.prototype.isDestroyed=function(){return!1},Moon.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),destroyObject(this)},NeverTileDiscardPolicy.prototype.isReady=function(){return!0},NeverTileDiscardPolicy.prototype.shouldDiscardImage=function(e){return!1};var AdjustTranslucentFS="#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n",CompositeOITFS="uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\nif (opaque != czm_backgroundColor)\n{\ngl_FragColor.a = 1.0;\n}\n}\n";function OIT(e){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var t=e.colorBufferFloat&&e.depthTexture;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=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ClearCommand({color:new Color(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._alphaClearCommand=new ClearCommand({color:new Color(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 BoundingRectangle,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function destroyTextures$2(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function destroyFramebuffers$2(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function destroyResources$2(e){destroyTextures$2(e),destroyFramebuffers$2(e)}function updateTextures$1(e,t,i,r){destroyTextures$2(e),e._accumulationTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT});var n=new Float32Array(i*r*4);e._revealageTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT,source:{arrayBufferView:n,width:i,height:r},flipY:!1})}function updateFramebuffers$3(e,t){destroyFramebuffers$2(e);var i,r,n=WebGLConstants$1.FRAMEBUFFER_COMPLETE,a=!0;return e._translucentMRTSupport&&(e._translucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===n&&e._adjustTranslucentFBO.status===n||(destroyFramebuffers$2(e),e._translucentMRTSupport=!1)),e._translucentMRTSupport||(e._translucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new Framebuffer({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new Framebuffer({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1}),i=e._translucentFBO.status===n,r=e._alphaFBO.status===n,t=e._adjustTranslucentFBO.status===n,n=e._adjustAlphaFBO.status===n,i&&r&&t&&n||(destroyResources$2(e),a=e._translucentMultipassSupport=!1)),a}OIT.prototype.update=function(e,t,i,r){var n,a,o,s;this.isSupported()&&(this._opaqueFBO=i,this._opaqueTexture=i.getColorTexture(0),this._depthStencilTexture=i.depthStencilTexture,o=this._opaqueTexture.width,s=this._opaqueTexture.height,(i=!defined(i=this._accumulationTexture)||i.width!==o||i.height!==s||r!==this._useHDR)&&updateTextures$1(this,e,o,s),(defined(this._translucentFBO)&&!i||updateFramebuffers$3(this,e))&&(this._useHDR=r,defined((n=this)._compositeCommand)||(a=new ShaderSource({sources:[CompositeOITFS]}),this._translucentMRTSupport&&a.defines.push("MRT"),this._compositeCommand=e.createViewportQuadCommand(a,{uniformMap:{u_opaque:function(){return n._opaqueTexture},u_accumulation:function(){return n._accumulationTexture},u_revealage:function(){return n._revealageTexture}},owner:this})),defined(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(a=new ShaderSource({defines:["MRT"],sources:[AdjustTranslucentFS]}),this._adjustTranslucentCommand=e.createViewportQuadCommand(a,{uniformMap:{u_bgColor:function(){return n._translucentMRTClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},owner:this})):this._translucentMultipassSupport&&(a=new ShaderSource({sources:[AdjustTranslucentFS]}),this._adjustTranslucentCommand=e.createViewportQuadCommand(a,{uniformMap:{u_bgColor:function(){return n._translucentMultipassClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},owner:this}),this._adjustAlphaCommand=e.createViewportQuadCommand(a,{uniformMap:{u_bgColor:function(){return n._alphaClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},owner:this}))),this._viewport.width=o,this._viewport.height=s,s=(o=!BoundingRectangle.equals(this._viewport,t.viewport))!==this._useScissorTest,this._useScissorTest=o,BoundingRectangle.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=BoundingRectangle.clone(t.viewport,this._scissorRectangle),s=!0),defined(this._rs)&&BoundingRectangle.equals(this._viewport,this._rs.viewport)&&!s||(this._rs=RenderState.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),defined(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),defined(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)))};var translucentMRTBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ZERO,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA},translucentColorBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ONE,functionDestinationAlpha:BlendFunction$1.ONE},translucentAlphaBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ZERO,functionDestinationRgb:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:BlendFunction$1.ZERO,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA};function getTranslucentRenderState(e,t,i,r){var n,a=i[r.id];return defined(a)||((n=RenderState.getState(r)).depthMask=!1,n.blending=t,a=RenderState.fromCache(n),i[r.id]=a),a}function getTranslucentMRTRenderState(e,t,i){return getTranslucentRenderState(t,translucentMRTBlend,e._translucentRenderStateCache,i)}function getTranslucentColorRenderState(e,t,i){return getTranslucentRenderState(t,translucentColorBlend,e._translucentRenderStateCache,i)}function getTranslucentAlphaRenderState(e,t,i){return getTranslucentRenderState(t,translucentAlphaBlend,e._alphaRenderStateCache,i)}var mrtShaderSource=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",colorShaderSource=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",alphaShaderSource=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";function getTranslucentShaderProgram(e,t,i,r){var n,a,o=e.shaderCache.getDerivedShaderProgram(t,i);return defined(o)||(n=t._attributeLocations,(a=t.fragmentShaderSource.clone()).sources=a.sources.map(function(e){return e=(e=(e=(e=ShaderSource.replaceMain(e,"czm_translucent_main")).replace(/gl_FragColor/g,"czm_gl_FragColor")).replace(/\bdiscard\b/g,"czm_discard = true")).replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,(-1!==r.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),a.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+r+"}\n"),o=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:n})),o}function getTranslucentMRTShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"translucentMRT",mrtShaderSource)}function getTranslucentColorShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"translucentMultipass",colorShaderSource)}function getTranslucentAlphaShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"alphaMultipass",alphaShaderSource)}function executeTranslucentCommandsSortedMultipass(e,t,i,r,n,a){var o,s,l=t.context,c=t.frameState.useLogDepth,u=t._hdr,d=r.framebuffer,h=n.length,p=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var m=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<h;++s)o=n[s],o=c?o.derivedCommands.logDepth.command:o,o=u?o.derivedCommands.hdr.command:o,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).translucentCommand,t,l,r,m);for(defined(a)&&(o=a.unclassifiedCommand,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).translucentCommand,t,l,r,m)),r.framebuffer=e._alphaFBO,s=0;s<h;++s)o=n[s],o=c?o.derivedCommands.logDepth.command:o,o=u?o.derivedCommands.hdr.command:o,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).alphaCommand,t,l,r,m);defined(a)&&(o=a.unclassifiedCommand,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).alphaCommand,t,l,r,m)),r.framebuffer=d}function executeTranslucentCommandsSortedMRT(e,t,i,r,n,a){var o=t.context,s=t.frameState.useLogDepth,l=t._hdr,c=r.framebuffer,u=n.length,d=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var h,p=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var m=0;m<u;++m)h=n[m],h=s?h.derivedCommands.logDepth.command:h,h=l?h.derivedCommands.hdr.command:h,i((d&&h.receiveShadows?h.derivedCommands.oit.shadows:h.derivedCommands.oit).translucentCommand,t,o,r,p);defined(a)&&(h=a.unclassifiedCommand,i((d&&h.receiveShadows?h.derivedCommands.oit.shadows:h.derivedCommands.oit).translucentCommand,t,o,r,p)),r.framebuffer=c}OIT.prototype.createDerivedCommands=function(e,t,i){var r,n,a,o,s,l;return defined(i)||(i={}),this._translucentMRTSupport?(defined(i.translucentCommand)&&(r=i.translucentCommand.shaderProgram,n=i.translucentCommand.renderState),i.translucentCommand=DrawCommand.shallowClone(e,i.translucentCommand),defined(r)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=r,i.translucentCommand.renderState=n):(i.translucentCommand.shaderProgram=getTranslucentMRTShaderProgram(t,e.shaderProgram),i.translucentCommand.renderState=getTranslucentMRTRenderState(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)):(defined(i.translucentCommand)&&(a=i.translucentCommand.shaderProgram,o=i.translucentCommand.renderState,s=i.alphaCommand.shaderProgram,l=i.alphaCommand.renderState),i.translucentCommand=DrawCommand.shallowClone(e,i.translucentCommand),i.alphaCommand=DrawCommand.shallowClone(e,i.alphaCommand),defined(a)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=a,i.translucentCommand.renderState=o,i.alphaCommand.shaderProgram=s,i.alphaCommand.renderState=l):(i.translucentCommand.shaderProgram=getTranslucentColorShaderProgram(t,e.shaderProgram),i.translucentCommand.renderState=getTranslucentColorRenderState(this,t,e.renderState),i.alphaCommand.shaderProgram=getTranslucentAlphaShaderProgram(t,e.shaderProgram),i.alphaCommand.renderState=getTranslucentAlphaRenderState(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)),i},OIT.prototype.executeCommands=function(e,t,i,r,n){(this._translucentMRTSupport?executeTranslucentCommandsSortedMRT:executeTranslucentCommandsSortedMultipass)(this,e,t,i,r,n)},OIT.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},OIT.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._opaqueFBO,Color.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,t)),t.framebuffer=r},OIT.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},OIT.prototype.isDestroyed=function(){return!1},OIT.prototype.destroy=function(){return destroyResources$2(this),defined(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),defined(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),defined(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),destroyObject(this)};var defaultCredit=new Credit("MapQuest, Open Street Map and contributors, CC-BY-SA");function OpenStreetMapImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=Resource.createIfNeeded(defaultValue(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+="{z}/{x}/{y}."+defaultValue(e.fileExtension,"png");var i=new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),r=defaultValue(e.minimumLevel,0),n=e.maximumLevel,a=defaultValue(e.rectangle,i.rectangle),o=i.positionToTileXY(Rectangle.southwest(a),r),s=i.positionToTileXY(Rectangle.northeast(a),r);Math.abs(s.x-o.x),Math.abs(s.y-o.y);e=defaultValue(e.credit,defaultCredit);"string"==typeof e&&(e=new Credit(e)),UrlTemplateImageryProvider.call(this,{url:t,credit:e,tilingScheme:i,tileWidth:256,tileHeight:256,minimumLevel:r,maximumLevel:n,rectangle:a})}defined(Object.create)&&(OpenStreetMapImageryProvider.prototype=Object.create(UrlTemplateImageryProvider.prototype),OpenStreetMapImageryProvider.prototype.constructor=OpenStreetMapImageryProvider);var defaultSize=new Cartesian2(1,1);function Particle(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.mass=defaultValue(e.mass,1),this.position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this.velocity=Cartesian3.clone(defaultValue(e.velocity,Cartesian3.ZERO)),this.life=defaultValue(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=Color.clone(defaultValue(e.startColor,Color.WHITE)),this.endColor=Color.clone(defaultValue(e.endColor,Color.WHITE)),this.startScale=defaultValue(e.startScale,1),this.endScale=defaultValue(e.endScale,1),this.imageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultSize)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Particle.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var deltaScratch=new Cartesian3;function ParticleBurst(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.time=defaultValue(e.time,0),this.minimum=defaultValue(e.minimum,0),this.maximum=defaultValue(e.maximum,50),this._complete=!1}function ParticleEmitter(e){}Particle.prototype.update=function(e,t){return Cartesian3.multiplyByScalar(this.velocity,e,deltaScratch),Cartesian3.add(this.position,deltaScratch,this.position),defined(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},Object.defineProperties(ParticleBurst.prototype,{complete:{get:function(){return this._complete}}}),ParticleEmitter.prototype.emit=function(e){DeveloperError.throwInstantiationError()};var defaultImageSize=new Cartesian2(1,1);function ParticleSystem(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.updateCallback=e.updateCallback,this.loop=defaultValue(e.loop,!0),this.image=defaultValue(e.image,void 0);var t=e.emitter;defined(t)||(t=new CircleEmitter(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._emitterModelMatrix=Matrix4.clone(defaultValue(e.emitterModelMatrix,Matrix4.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new Matrix4,this._startColor=Color.clone(defaultValue(e.color,defaultValue(e.startColor,Color.WHITE))),this._endColor=Color.clone(defaultValue(e.color,defaultValue(e.endColor,Color.WHITE))),this._startScale=defaultValue(e.scale,defaultValue(e.startScale,1)),this._endScale=defaultValue(e.scale,defaultValue(e.endScale,1)),this._emissionRate=defaultValue(e.emissionRate,5),this._minimumSpeed=defaultValue(e.speed,defaultValue(e.minimumSpeed,1)),this._maximumSpeed=defaultValue(e.speed,defaultValue(e.maximumSpeed,1)),this._minimumParticleLife=defaultValue(e.particleLife,defaultValue(e.minimumParticleLife,5)),this._maximumParticleLife=defaultValue(e.particleLife,defaultValue(e.maximumParticleLife,5)),this._minimumMass=defaultValue(e.mass,defaultValue(e.minimumMass,1)),this._maximumMass=defaultValue(e.mass,defaultValue(e.maximumMass,1)),this._minimumImageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultValue(e.minimumImageSize,defaultImageSize))),this._maximumImageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultValue(e.maximumImageSize,defaultImageSize))),this._sizeInMeters=defaultValue(e.sizeInMeters,!1),this._lifetime=defaultValue(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 Event,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}function updateParticlePool(e){var t=e._emissionRate,i=e._maximumParticleLife,r=0,n=e._bursts;if(defined(n))for(var a=n.length,o=0;o<a;++o)r+=n[o].maximum;for(var s=e._billboardCollection,l=e.image,t=Math.ceil(t*i+r),i=e._particles,c=e._particlePool,u=Math.max(t-i.length-c.length,0),d=0;d<u;++d){var h=new Particle;h._billboard=s.add({image:l}),c.push(h)}e._particleEstimate=t}function getOrCreateParticle(e){e=e._particlePool.pop();return e=!defined(e)?new Particle:e}function addParticleToPool(e,t){e._particlePool.push(t)}function freeParticlePool(e){for(var t=e._particles,i=e._particlePool,r=e._billboardCollection,t=t.length,n=i.length,e=e._particleEstimate,t=n-Math.max(e-t-n,0),a=t;a<n;++a){var o=i[a];r.remove(o._billboard)}i.length=t}function removeBillboard(e){defined(e._billboard)&&(e._billboard.show=!1)}function updateBillboard(e,t){var i=t._billboard;(i=!defined(i)?t._billboard=e._billboardCollection.add({image:t.image}):i).width=t.imageSize.x,i.height=t.imageSize.y,i.position=t.position,i.sizeInMeters=e.sizeInMeters,i.show=!0;var r=CesiumMath.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),n=CesiumMath.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),a=CesiumMath.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),e=CesiumMath.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);i.color=new Color(r,n,a,e),i.scale=CesiumMath.lerp(t.startScale,t.endScale,t.normalizedAge)}function addParticle(e,t){t.startColor=Color.clone(e._startColor,t.startColor),t.endColor=Color.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=CesiumMath.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=CesiumMath.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=CesiumMath.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=CesiumMath.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;var i=CesiumMath.randomBetween(e._minimumSpeed,e._maximumSpeed);Cartesian3.multiplyByScalar(t.velocity,i,t.velocity),e._particles.push(t)}function calculateNumberToEmit(e,t){if(e._isComplete)return 0;var t=(t=CesiumMath.mod(t,e._lifetime))*e._emissionRate,i=Math.floor(t);if(e._carryOver+=t-i,1<e._carryOver&&(i++,--e._carryOver),defined(e.bursts))for(var r=e.bursts.length,n=0;n<r;n++){var a=e.bursts[n],o=e._currentTime;defined(a)&&!a._complete&&o>a.time&&(i+=CesiumMath.randomBetween(a.minimum,a.maximum),a._complete=!0)}return i}Object.defineProperties(ParticleSystem.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||!Matrix4.equals(this._modelMatrix,e),Matrix4.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!Matrix4.equals(this._emitterModelMatrix,e),Matrix4.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){Color.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){Color.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}}});var rotatedVelocityScratch=new Cartesian3;function getElement(e){return e="string"==typeof e?document.getElementById(e):e}function PerformanceDisplay(e){var t=getElement((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).container);this._container=t;var i=document.createElement("div");i.className="cesium-performanceDisplay";e=document.createElement("div");e.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),e.appendChild(this._fpsText);t=document.createElement("div");t.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),t.appendChild(this._msText),i.appendChild(t),i.appendChild(e),this._container.appendChild(i),this._lastFpsSampleTime=getTimestamp$1(),this._lastMsSampleTime=getTimestamp$1(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;e=document.createElement("div");e.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),e.appendChild(this._throttledText),i.appendChild(e)}function PickDepth(){this._framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._useLogDepth=void 0,this._debugPickDepthViewportCommand=void 0}function executeDebugPickDepth(e,t,i,r){var n;defined(e._debugPickDepthViewportCommand)&&r===e._useLogDepth||(n=new ShaderSource({defines:[r?"LOG_DEPTH":""],sources:["uniform highp sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"]}),e._debugPickDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._depthTexture}},owner:e}),e._useLogDepth=r),e._debugPickDepthViewportCommand.execute(t,i)}function destroyTextures$1(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function destroyFramebuffers$1(e){e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy()}function createTextures(e,t,i,r){e._depthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE})}function createFramebuffers$1(e,t,i,r){destroyTextures$1(e),destroyFramebuffers$1(e),createTextures(e,t,i,r),e._framebuffer=new Framebuffer({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function updateFramebuffers$2(e,t,i){var r=i.width,n=i.height,i=e._depthTexture,i=!defined(i)||i.width!==r||i.height!==n;defined(e._framebuffer)&&!i||createFramebuffers$1(e,t,r,n)}function updateCopyCommands(e,t,i){defined(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand("uniform highp sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{renderState:RenderState.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=i,e._copyDepthCommand.framebuffer=e._framebuffer}ParticleSystem.prototype.update=function(e){if(this.show){defined(this._billboardCollection)||(this._billboardCollection=new BillboardCollection),this._updateParticlePool&&(updateParticlePool(this),this._updateParticlePool=!1);var t=0;(t=this._previousTime?JulianDate.secondsDifference(e.time,this._previousTime):t)<0&&(t=0);var i,r=this._particles,n=this._emitter,a=this.updateCallback,o=r.length;for(c=0;c<o;++c)(i=r[c]).update(t,a)?updateBillboard(this,i):(removeBillboard(i),addParticleToPool(this,i),r[c]=r[o-1],--c,--o);r.length=o;var s=calculateNumberToEmit(this,t);if(0<s&&defined(n)){this._matrixDirty&&(this._combinedMatrix=Matrix4.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);for(var l=this._combinedMatrix,c=0;c<s;c++)i=getOrCreateParticle(this),this._emitter.emit(i),Cartesian3.add(i.position,i.velocity,rotatedVelocityScratch),Matrix4.multiplyByPoint(l,rotatedVelocityScratch,rotatedVelocityScratch),i.position=Matrix4.multiplyByPoint(l,i.position,i.position),Cartesian3.subtract(rotatedVelocityScratch,i.position,i.velocity),Cartesian3.normalize(i.velocity,i.velocity),addParticle(this,i),updateBillboard(this,i)}if(this._billboardCollection.update(e),this._previousTime=JulianDate.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=CesiumMath.mod(this._currentTime,this._lifetime),this.bursts){var u=this.bursts.length;for(c=0;c<u;c++)this.bursts[c]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120==0&&freeParticlePool(this)}},ParticleSystem.prototype.isDestroyed=function(){return!1},ParticleSystem.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),destroyObject(this)},Object.defineProperties(PerformanceDisplay.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(this._throttledText.nodeValue=e?"(throttled)":"",this._throttled=e)}}}),PerformanceDisplay.prototype.update=function(e){var t=getTimestamp$1(),i=defaultValue(e,!0);this._fpsFrameCount++;e=t-this._lastFpsSampleTime;1e3<e&&(r="N/A",i&&(r=1e3*this._fpsFrameCount/e|0),this._fpsText.nodeValue=r+" FPS",this._lastFpsSampleTime=t,this._fpsFrameCount=0),this._msFrameCount++;var r,e=t-this._lastMsSampleTime;200<e&&(r="N/A",i&&(r=(e/this._msFrameCount).toFixed(2)),this._msText.nodeValue=r+" MS",this._lastMsSampleTime=t,this._msFrameCount=0)},PerformanceDisplay.prototype.destroy=function(){return destroyObject(this)},PickDepth.prototype.executeDebugPickDepth=function(e,t,i){executeDebugPickDepth(this,e,t,i)},PickDepth.prototype.update=function(e,t){updateFramebuffers$2(this,e,t),updateCopyCommands(this,e,t)};var scratchPackedDepth=new Cartesian4,packedDepthScale=new Cartesian4(1,1/255,1/65025,1/16581375);function PickDepthFramebuffer(){this._depthStencilTexture=void 0,this._framebuffer=void 0,this._passState=void 0}function destroyResources$1(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy()}function createResources(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight;e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}),e._framebuffer=new Framebuffer({context:t,depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1});t=new PassState(t);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new BoundingRectangle},t.viewport=new BoundingRectangle,e._passState=t}function PickFramebuffer(e){var t=new PassState(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new BoundingRectangle},t.viewport=new BoundingRectangle,this._context=e,this._fb=void 0,this._passState=t,this._width=0,this._height=0}PickDepth.prototype.getDepth=function(e,t,i){if(defined(this._framebuffer)){i=e.readPixels({x:t,y:i,width:1,height:1,framebuffer:this._framebuffer}),i=Cartesian4.unpack(i,0,scratchPackedDepth);return Cartesian4.divideByScalar(i,255,i),Cartesian4.dot(i,packedDepthScale)}},PickDepth.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},PickDepth.prototype.isDestroyed=function(){return!1},PickDepth.prototype.destroy=function(){return destroyTextures$1(this),destroyFramebuffers$1(this),defined(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=defined(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),destroyObject(this)},PickDepthFramebuffer.prototype.update=function(e,t,i){var r=i.width,n=i.height;defined(this._framebuffer)&&r===this._depthStencilTexture.width&&n===this._depthStencilTexture.height||(destroyResources$1(this),createResources(this,e));i=this._framebuffer,e=this._passState;return e.framebuffer=i,e.viewport.width=r,e.viewport.height=n,e.scissorTest.rectangle.x=t.x,e.scissorTest.rectangle.y=n-t.y,e.scissorTest.rectangle.width=1,e.scissorTest.rectangle.height=1,e},PickDepthFramebuffer.prototype.isDestroyed=function(){return!1},PickDepthFramebuffer.prototype.destroy=function(){return destroyResources$1(this),destroyObject(this)},PickFramebuffer.prototype.begin=function(e,t){var i=this._context,r=t.width,t=t.height;return BoundingRectangle.clone(e,this._passState.scissorTest.rectangle),defined(this._fb)&&this._width===r&&this._height===t||(this._width=r,this._height=t,this._fb=this._fb&&this._fb.destroy(),this._fb=new Framebuffer({context:i,colorTextures:[new Texture({context:i,width:r,height:t})],depthStencilRenderbuffer:new Renderbuffer({context:i,width:r,height:t,format:RenderbufferFormat$1.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=r,this._passState.viewport.height=t,this._passState};var colorScratch=new Color;function SceneFramebuffer(){this._colorTexture=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._framebuffer=void 0,this._idFramebuffer=void 0,this._idClearColor=new Color(0,0,0,0),this._useHdr=void 0,this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,owner:this})}function destroyResources(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._idFramebuffer=e._idFramebuffer&&e._idFramebuffer.destroy(),e._colorTexture=e._colorTexture&&e._colorTexture.destroy(),e._idTexture=e._idTexture&&e._idTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._depthStencilIdTexture=e._depthStencilIdTexture&&e._depthStencilIdTexture.destroy(),e._depthStencilIdRenderbuffer=e._depthStencilIdRenderbuffer&&e._depthStencilIdRenderbuffer.destroy(),e._framebuffer=void 0,e._idFramebuffer=void 0,e._colorTexture=void 0,e._idTexture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,e._depthStencilIdTexture=void 0,e._depthStencilIdRenderbuffer=void 0}function ShadowMapShader(){}function ShadowMap(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context;this._enabled=defaultValue(e.enabled,!0),this._softShadows=defaultValue(e.softShadows,!1),this._normalOffset=defaultValue(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=defaultValue(e.fromLightSource,!0),this.darkness=defaultValue(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=defaultValue(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1;var i,r=this._needsUpdate=!0;(FeatureDetection.isInternetExplorer()||FeatureDetection.isEdge()||(FeatureDetection.isChrome()||FeatureDetection.isFirefox())&&FeatureDetection.isWindows()&&!t.depthTexture)&&(r=!1),this._polygonOffsetSupported=r,this._terrainBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:r,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 Matrix4,this._shadowMapTexture=void 0,this._lightDirectionEC=new Cartesian3,this._lightPositionEC=new Cartesian4,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ShadowMapCamera,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new BoundingSphere,this._isPointLight=defaultValue(e.isPointLight,!1),this._pointLightRadius=defaultValue(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&defaultValue(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?defaultValue(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Cartesian2,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new OrthographicOffCenterFrustum:defined(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Cartesian4,new Cartesian4],this._cascadeMatrices=[new Matrix4,new Matrix4,new Matrix4,new Matrix4],this._cascadeDistances=new Cartesian4,i=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(i);for(var n=0;n<i;++n)this._passes[n]=new ShadowPass(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,createRenderStates(this),this._clearCommand=new ClearCommand({depth:1,color:new Color}),this._clearPassState=new PassState(t),this._size=defaultValue(e.size,2048),this.size=this._size}function ShadowPass(e){this.camera=new ShadowMapCamera,this.passState=new PassState(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function createRenderState(e,t){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.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 createRenderStates(e){var t=!e._usesDepthTexture;e._primitiveRenderState=createRenderState(t,e._primitiveBias),e._terrainRenderState=createRenderState(t,e._terrainBias),e._pointRenderState=createRenderState(t,e._pointBias)}function destroyFramebuffer(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;defined(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function createFramebufferColor(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),a=e._passes.length,o=0;o<a;++o){var s=e._passes[o];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebufferDepth(e,t){for(var i=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),r=new Framebuffer({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,a=0;a<n;++a){var o=e._passes[a];o.framebuffer=r,o.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function createFramebufferCube(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new CubeMap({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],a=0;a<6;++a){var o=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[n[a]],destroyAttachments:!1}),s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebuffer(e,t){(e._isPointLight?createFramebufferCube:e._usesDepthTexture?createFramebufferDepth:createFramebufferColor)(e,t)}function checkFramebuffer(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==WebGLConstants$1.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,createRenderStates(e),destroyFramebuffer(e),createFramebuffer(e,t))}function updateFramebuffer(e,t){defined(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(destroyFramebuffer(e),createFramebuffer(e,t),checkFramebuffer(e,t),clearFramebuffer(e,t))}function clearFramebuffer(e,t,i){i=defaultValue(i,0),!e._isPointLight&&0!==i||(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function resize(e,t){e._size=t;var i,r=e._passes,n=r.length,a=e._textureSize;e._isPointLight?(t=ContextLimits.maximumCubeMapSize>=t?t:ContextLimits.maximumCubeMapSize,a.x=t,i=new BoundingRectangle(0,0,a.y=t,t),r[0].passState.viewport=i,r[1].passState.viewport=i,r[2].passState.viewport=i,r[3].passState.viewport=i,r[4].passState.viewport=i,r[5].passState.viewport=i):1===n?(t=ContextLimits.maximumTextureSize>=t?t:ContextLimits.maximumTextureSize,a.x=t,a.y=t,r[0].passState.viewport=new BoundingRectangle(0,0,t,t)):4===n&&(t=ContextLimits.maximumTextureSize>=2*t?t:ContextLimits.maximumTextureSize/2,a.x=2*t,a.y=2*t,r[0].passState.viewport=new BoundingRectangle(0,0,t,t),r[1].passState.viewport=new BoundingRectangle(t,0,t,t),r[2].passState.viewport=new BoundingRectangle(0,t,t,t),r[3].passState.viewport=new BoundingRectangle(t,t,t,t)),e._clearPassState.viewport=new BoundingRectangle(0,0,a.x,a.y);for(var o=0;o<n;++o){var s=r[o],l=s.passState.viewport,c=l.x/a.x,u=l.y/a.y,d=l.width/a.x,l=l.height/a.y;s.textureOffsets=new Matrix4(d,0,0,c,0,l,0,u,0,0,1,0,0,0,0,1)}}PickFramebuffer.prototype.end=function(e){for(var t=defaultValue(e.width,1),i=defaultValue(e.height,1),r=this._context,n=r.readPixels({x:e.x,y:e.y,width:t,height:i,framebuffer:this._fb}),e=Math.max(t,i),a=e*e,o=Math.floor(.5*t),s=Math.floor(.5*i),l=0,c=0,u=0,d=-1,h=0;h<a;++h){if(-o<=l&&l<=o&&-s<=c&&c<=s){var p=4*((s-c)*t+l+o);colorScratch.red=Color.byteToFloat(n[p]),colorScratch.green=Color.byteToFloat(n[1+p]),colorScratch.blue=Color.byteToFloat(n[2+p]),colorScratch.alpha=Color.byteToFloat(n[3+p]);var p=r.getObjectByPickColor(colorScratch);if(defined(p))return p}(l===c||l<0&&-l===c||0<l&&l===1-c)&&(p=u,u=-d,d=p),l+=u,c+=d}},PickFramebuffer.prototype.isDestroyed=function(){return!1},PickFramebuffer.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),destroyObject(this)},SceneFramebuffer.prototype.update=function(e,t,i){var r=t.width,n=t.height,t=this._colorTexture;defined(t)&&t.width===r&&t.height===n&&i===this._useHdr||(destroyResources(this),i=(this._useHdr=i)?e.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE,this._colorTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:i,sampler:Sampler.NEAREST}),this._idTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e.depthTexture?(this._depthStencilTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),this._depthStencilIdTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST})):(this._depthStencilRenderbuffer=new Renderbuffer({context:e,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL}),this._depthStencilIdRenderbuffer=new Renderbuffer({context:e,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL})),this._framebuffer=new Framebuffer({context:e,colorTextures:[this._colorTexture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}),this._idFramebuffer=new Framebuffer({context:e,colorTextures:[this._idTexture],depthStencilTexture:this._depthStencilIdTexture,depthStencilRenderbuffer:this._depthStencilIdRenderbuffer,destroyAttachments:!1}))},SceneFramebuffer.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._framebuffer,Color.clone(i,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=this._idFramebuffer,Color.clone(this._idClearColor,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=r},SceneFramebuffer.prototype.getFramebuffer=function(){return this._framebuffer},SceneFramebuffer.prototype.getIdFramebuffer=function(){return this._idFramebuffer},SceneFramebuffer.prototype.isDestroyed=function(){return!1},SceneFramebuffer.prototype.destroy=function(){return destroyResources(this),destroyObject(this)},ShadowMapShader.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},ShadowMapShader.createShadowCastVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);r.push("SHADOW_MAP"),i&&r.push("GENERATE_POSITION");e=defined(ShaderSource.findPositionVarying(e));if(t&&!e){for(var a=n.length,o=0;o<a;++o)n[o]=ShaderSource.replaceMain(n[o],"czm_shadow_cast_main");n.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new ShaderSource({defines:r,sources:n})},ShadowMapShader.createShadowCastFragmentShader=function(e,t,i,r){var n=e.defines.slice(0),a=e.sources.slice(0),o=ShaderSource.findPositionVarying(e),s=defined(o);s||(o="v_positionEC");for(var l=a.length,c=0;c<l;++c)a[c]=ShaderSource.replaceMain(a[c],"czm_shadow_cast_main");e="";return t&&(s||(e+="varying vec3 v_positionEC; \n"),e+="uniform vec4 shadowMap_lightPositionEC; \n"),e+=r?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",e+=t?" float distance = length("+o+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_FragColor = czm_packDepth(distance); \n":i?" gl_FragColor = vec4(1.0); \n":" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",a.push(e+="} \n"),new ShaderSource({defines:n,sources:a})},ShadowMapShader.getShadowReceiveShaderKeyword=function(e,t,i,r){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+r},ShadowMapShader.createShadowReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),e=e.sources.slice(0);return r.push("SHADOW_MAP"),t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new ShaderSource({defines:r,sources:e})},ShadowMapShader.createShadowReceiveFragmentShader=function(e,t,i,r,n){for(var a=ShaderSource.findNormalVarying(e),o=!r&&defined(a)||r&&n,s=ShaderSource.findPositionVarying(e),l=defined(s),c=t._usesDepthTexture,u=t._polygonOffsetSupported,d=t._isPointLight,h=t._isSpotLight,p=1<t._numberOfCascades,m=t.debugCascadeColors,f=t.softShadows,n=d?t._pointBias:r?t._terrainBias:t._primitiveBias,t=e.defines.slice(0),g=e.sources.slice(0),_=g.length,y=0;y<_;++y)g[y]=ShaderSource.replaceMain(g[y],"czm_shadow_receive_main");d?t.push("USE_CUBE_MAP_SHADOW"):c&&t.push("USE_SHADOW_DEPTH_TEXTURE"),f&&!d&&t.push("USE_SOFT_SHADOWS"),p&&i&&r&&(o?t.push("ENABLE_VERTEX_LIGHTING"):t.push("ENABLE_DAYNIGHT_SHADING")),i&&n.normalShading&&o&&(t.push("USE_NORMAL_SHADING"),0<n.normalShadingSmooth&&t.push("USE_NORMAL_SHADING_SMOOTH"));i="";return i+=d?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",i+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+(l?" return vec4("+s+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n")+"} \nvec3 getNormalEC() \n{ \n"+(o?" return normalize("+a+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(n.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",i+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",i+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",r?i+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":u||(i+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),i+=d?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":h?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":p?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(m?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",g.push(i+=" gl_FragColor.rgb *= visibility; \n} \n"),new ShaderSource({defines:t,sources:g})},ShadowMap.MAXIMUM_DISTANCE=2e4,ShadowMap.prototype.debugCreateRenderStates=function(){createRenderStates(this)},Object.defineProperties(ShadowMap.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){resize(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}}});var scratchViewport=new BoundingRectangle;function createDebugShadowViewCommand(e,t){var i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n",i=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Pass$1.OVERLAY,i}function updateDebugShadowViewCommand(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,a=.3*Math.min(r,n),n=scratchViewport;n.x=r-a,n.y=0,n.width=a,n.height=a;a=e._debugShadowViewCommand;defined(a)||(a=createDebugShadowViewCommand(e,i),e._debugShadowViewCommand=a),defined(a.renderState)&&BoundingRectangle.equals(a.renderState.viewport,n)||(a.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(n)})),t.commandList.push(e._debugShadowViewCommand)}var frustumCornersNDC=new Array(8);frustumCornersNDC[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC[6]=new Cartesian4(1,1,1,1),frustumCornersNDC[7]=new Cartesian4(-1,1,1,1);for(var scratchMatrix=new Matrix4,scratchFrustumCorners=new Array(8),i=0;i<8;++i)scratchFrustumCorners[i]=new Cartesian4;function createDebugPointLight(e,t){return new Primitive({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var debugOutlineColors=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale=new Cartesian3;function applyDebugSettings(e,t){updateDebugShadowViewCommand(e,t);var i,r,n,a=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(a&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new DebugCameraPrimitive({camera:e._sceneCamera,color:Color.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){a&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var o=0;o<e._numberOfCascades;++o)a&&(e._debugCascadeFrustums[o]=e._debugCascadeFrustums[o]&&e._debugCascadeFrustums[o].destroy(),e._debugCascadeFrustums[o]=new DebugCameraPrimitive({camera:e._passes[o].camera,color:debugOutlineColors[o],updateOnChange:!1})),e._debugCascadeFrustums[o].update(t)}}else e._isPointLight?defined(e._debugLightFrustum)&&!e._needsUpdate||(i=e._shadowMapCamera.positionWC,r=Quaternion.IDENTITY,n=2*e._pointLightRadius,n=Cartesian3.fromElements(n,n,n,scratchScale),n=Matrix4.fromTranslationQuaternionRotationScale(i,r,n,scratchMatrix),e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=createDebugPointLight(n,Color.YELLOW)):defined(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ShadowMapCamera(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesian3.clone(e.positionWC,this.positionWC),Cartesian3.clone(e.directionWC,this.directionWC),Cartesian3.clone(e.upWC,this.upWC),Cartesian3.clone(e.rightWC,this.rightWC)};var scaleBiasMatrix=new Matrix4(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ShadowMapCamera.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return Matrix4.multiply(t,e,this.viewProjectionMatrix),Matrix4.multiply(scaleBiasMatrix,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var scratchSplits=new Array(5),scratchFrustum=new PerspectiveFrustum,scratchCascadeDistances=new Array(4),scratchMin=new Cartesian3,scratchMax=new Cartesian3;function computeCascades(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=r.frustum.near,a=r.frustum.far,o=e._numberOfCascades,s=a-n,l=a/n,c=.9,u=!1;t.shadowState.closestObjectSize<200&&(u=!0,c=.9);var d=scratchCascadeDistances,h=scratchSplits;for(h[0]=n,h[o]=a,g=0;g<o;++g){var p=(g+1)/o,m=n*Math.pow(l,p),m=CesiumMath.lerp(n+s*p,m,c);h[g+1]=m,d[g]=m-h[g]}if(u){for(g=0;g<o;++g)d[g]=Math.min(d[g],e._maximumCascadeDistances[g]);for(var f=h[0],g=0;g<o-1;++g)f+=d[g],h[g+1]=f}Cartesian4.unpack(h,0,e._cascadeSplits[0]),Cartesian4.unpack(h,1,e._cascadeSplits[1]),Cartesian4.unpack(d,0,e._cascadeDistances);var u=i.frustum,_=u.left,y=u.right,C=u.bottom,v=u.top,S=u.near,T=u.far,x=i.positionWC,b=i.directionWC,E=i.upWC,P=r.frustum.clone(scratchFrustum),A=i.getViewProjection();for(g=0;g<o;++g){P.near=h[g],P.far=h[g+1];for(var w=Matrix4.multiply(P.projectionMatrix,r.viewMatrix,scratchMatrix),D=Matrix4.inverse(w,scratchMatrix),M=Matrix4.multiply(A,D,scratchMatrix),I=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin),R=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax),O=0;O<8;++O){var L=Cartesian4.clone(frustumCornersNDC[O],scratchFrustumCorners[O]);Matrix4.multiplyByVector(M,L,L),Cartesian3.divideByScalar(L,L.w,L),Cartesian3.minimumByComponent(L,I,I),Cartesian3.maximumByComponent(L,R,R)}I.x=Math.max(I.x,0),I.y=Math.max(I.y,0),I.z=0,R.x=Math.min(R.x,1),R.y=Math.min(R.y,1),R.z=Math.min(R.z,1);var F=e._passes[g],w=F.camera;w.clone(i);D=w.frustum;D.left=_+I.x*(y-_),D.right=_+R.x*(y-_),D.bottom=C+I.y*(v-C),D.top=C+R.y*(v-C),D.near=S+I.z*(T-S),D.far=S+R.z*(T-S),F.cullingVolume=w.frustum.computeCullingVolume(x,b,E);D=e._cascadeMatrices[g];Matrix4.multiply(w.getViewProjection(),r.inverseViewMatrix,D),Matrix4.multiply(F.textureOffsets,D,D)}}var scratchLightView=new Matrix4,scratchRight$1=new Cartesian3,scratchUp$1=new Cartesian3,scratchTranslation=new Cartesian3;function fitShadowMapToScene(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=Matrix4.multiply(r.frustum.projectionMatrix,r.viewMatrix,scratchMatrix),a=Matrix4.inverse(n,scratchMatrix),o=i.directionWC,s=r.directionWC;Cartesian3.equalsEpsilon(o,s,CesiumMath.EPSILON10)&&(s=r.upWC);var l=Cartesian3.cross(o,s,scratchRight$1),s=Cartesian3.cross(l,o,scratchUp$1);Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);for(var c=Cartesian3.fromElements(0,0,0,scratchTranslation),e=Matrix4.computeView(c,o,s,l,scratchLightView),u=Matrix4.multiply(e,a,scratchMatrix),d=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin),h=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax),p=0;p<8;++p){var m=Cartesian4.clone(frustumCornersNDC[p],scratchFrustumCorners[p]);Matrix4.multiplyByVector(u,m,m),Cartesian3.divideByScalar(m,m.w,m),Cartesian3.minimumByComponent(m,d,d),Cartesian3.maximumByComponent(m,h,h)}h.z+=1e3,d.z-=10;n=scratchTranslation;n.x=-.5*(d.x+h.x),n.y=-.5*(d.y+h.y),n.z=-h.z;r=Matrix4.fromTranslation(n,scratchMatrix),e=Matrix4.multiply(r,e,e),c=.5*(h.x-d.x),a=.5*(h.y-d.y),n=h.z-d.z,r=i.frustum;r.left=-c,r.right=c,r.bottom=-a,r.top=a,r.near=.01,r.far=n,Matrix4.clone(e,i.viewMatrix),Matrix4.inverse(e,i.inverseViewMatrix),Matrix4.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),Cartesian3.clone(o,i.directionWC),Cartesian3.clone(s,i.upWC),Cartesian3.clone(l,i.rightWC)}var directions=[new Cartesian3(-1,0,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(0,1,0),new Cartesian3(0,0,1)],ups=[new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(0,-1,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,1),new Cartesian3(0,-1,0)],rights=[new Cartesian3(0,0,1),new Cartesian3(1,0,0),new Cartesian3(-1,0,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(1,0,0)];function computeOmnidirectional(e,t){var i=new PerspectiveFrustum;i.fov=CesiumMath.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=directions[r],n.upWC=ups[r],n.rightWC=rights[r],Matrix4.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),Matrix4.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var scratchCartesian1=new Cartesian3,scratchCartesian2=new Cartesian3,scratchBoundingSphere=new BoundingSphere,scratchCenter$1=scratchBoundingSphere.center;function checkVisibility(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=scratchBoundingSphere;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var a=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,scratchCartesian1),i=Cartesian3.negate(r.directionWC,scratchCartesian2),a=Cartesian3.dot(a,i),i=CesiumMath.clamp(a/.1,0,1);if(e._darkness=CesiumMath.lerp(1,e.darkness,i),a<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else e._isPointLight?(n.center=r.positionWC,n.radius=e._pointLightRadius):(a=r.frustum.far/2,r=Cartesian3.add(r.positionWC,Cartesian3.multiplyByScalar(r.directionWC,a,scratchCenter$1),scratchCenter$1),n.center=r,n.radius=a),e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere)}function updateCameras(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?Cartesian3.clone(r.directionWC,a.directionWC):e._isPointLight?Cartesian3.clone(r.positionWC,a.positionWC):a.clone(r);var o,s,r=e._lightDirectionEC;Matrix4.multiplyByPointAsVector(i.viewMatrix,a.directionWC,r),Cartesian3.normalize(r,r),Cartesian3.negate(r,r),Matrix4.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,s=e._fitNearFar?(o=Math.min(t.shadowState.nearPlane,e.maximumDistance),s=Math.min(t.shadowState.farPlane,e.maximumDistance),Math.max(s,o+1)):(o=i.frustum.near,e.maximumDistance),e._sceneCamera=Camera.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=o,e._sceneCamera.frustum.far=s,e._distance=s-o,checkVisibility(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}ShadowMap.prototype.update=function(e){var t,i,r,n;updateCameras(this,e),this._needsUpdate&&(updateFramebuffer(this,e.context),this._isPointLight&&computeOmnidirectional(this,e),this._cascadesEnabled&&(fitShadowMapToScene(this,e),1<this._numberOfCascades&&computeCascades(this,e)),this._isPointLight?this._shadowMapCullingVolume=CullingVolume.fromBoundingSphere(this._boundingSphere):(t=(n=this._shadowMapCamera).positionWC,i=n.directionWC,r=n.upWC,this._shadowMapCullingVolume=n.frustum.computeCullingVolume(t,i,r),1===this._passes.length&&this._passes[0].camera.clone(n))),1===this._passes.length&&(n=this._sceneCamera.inverseViewMatrix,Matrix4.multiply(this._shadowMapCamera.getViewProjection(),n,this._shadowMapMatrix)),this.debugShow&&applyDebugSettings(this,e)},ShadowMap.prototype.updatePass=function(e,t){clearFramebuffer(this,e,t)};var scratchTexelStepSize=new Cartesian2;function combineUniforms(t,e,i){var r=t._isPointLight?t._pointBias:i?t._terrainBias:t._primitiveBias;return combine$2(e,{shadowMap_texture:function(){return t._shadowMapTexture},shadowMap_textureCube:function(){return t._shadowMapTexture},shadowMap_matrix:function(){return t._shadowMapMatrix},shadowMap_cascadeSplits:function(){return t._cascadeSplits},shadowMap_cascadeMatrices:function(){return t._cascadeMatrices},shadowMap_lightDirectionEC:function(){return t._lightDirectionEC},shadowMap_lightPositionEC:function(){return t._lightPositionEC},shadowMap_cascadeDistances:function(){return t._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var e=scratchTexelStepSize;return e.x=1/t._textureSize.x,e.y=1/t._textureSize.y,Cartesian4.fromElements(e.x,e.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cartesian4.fromElements(r.normalOffsetScale,t._distance,t.maximumDistance,t._darkness,this.combinedUniforms2)},combinedUniforms1:new Cartesian4,combinedUniforms2:new Cartesian4},!1)}function createCastDerivedCommand(e,t,i,r,n,a){var o,s,l,c,u,d,h,p,m;return defined(a)&&(m=a.shaderProgram,o=a.renderState,s=a.uniformMap),(a=DrawCommand.shallowClone(i,a)).castShadows=!0,a.receiveShadows=!1,defined(m)&&n===i.shaderProgram.id&&!t||(l=i.shaderProgram,c=i.pass===Pass$1.GLOBE,p=i.pass!==Pass$1.TRANSLUCENT,u=e._isPointLight,d=e._usesDepthTexture,h=ShadowMapShader.getShadowCastShaderKeyword(u,c,d,p),defined(m=r.shaderCache.getDerivedShaderProgram(l,h))||(n=l.vertexShaderSource,t=l.fragmentShaderSource,n=ShadowMapShader.createShadowCastVertexShader(n,u,c),p=ShadowMapShader.createShadowCastFragmentShader(t,u,d,p),m=r.shaderCache.createDerivedShaderProgram(l,h,{vertexShaderSource:n,fragmentShaderSource:p,attributeLocations:l._attributeLocations})),o=e._primitiveRenderState,u?o=e._pointRenderState:c&&(o=e._terrainRenderState),i.renderState.cull.enabled||((o=clone$1(o,!1)).cull=clone$1(o.cull,!1),o.cull.enabled=!1,o=RenderState.fromCache(o)),s=combineUniforms(e,i.uniformMap,c)),a.shaderProgram=m,a.renderState=o,a.uniformMap=s,a}ShadowMap.createReceiveDerivedCommand=function(e,t,i,r,n){defined(n)||(n={});var a,o,s,l=0<e.length,c=t.shaderProgram,u=c.vertexShaderSource,d=c.fragmentShaderSource,h=t.pass===Pass$1.GLOBE,p=!1;return h&&(p=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&l&&(defined(n.receiveCommand)&&(s=n.receiveCommand.shaderProgram,a=n.receiveCommand.uniformMap),n.receiveCommand=DrawCommand.shallowClone(t,n.receiveCommand),n.castShadows=!1,n.receiveShadows=!0,o=n.receiveShaderCastShadows!==t.castShadows,l=n.receiveShaderProgramId!==t.shaderProgram.id,(!defined(s)||l||i||o)&&(o=ShadowMapShader.getShadowReceiveShaderKeyword(e[0],t.castShadows,h,p),defined(s=r.shaderCache.getDerivedShaderProgram(c,o))||(u=ShadowMapShader.createShadowReceiveVertexShader(u,h,p),p=ShadowMapShader.createShadowReceiveFragmentShader(d,e[0],t.castShadows,h,p),s=r.shaderCache.createDerivedShaderProgram(c,o,{vertexShaderSource:u,fragmentShaderSource:p,attributeLocations:c._attributeLocations})),a=combineUniforms(e[0],t.uniformMap,h)),n.receiveCommand.shaderProgram=s,n.receiveCommand.uniformMap=a,n.receiveShaderProgramId=t.shaderProgram.id,n.receiveShaderCastShadows=t.castShadows),n},ShadowMap.createCastDerivedCommand=function(e,t,i,r,n){if(defined(n)||(n={}),t.castShadows){var a=n.castCommands;defined(a)||(a=n.castCommands=[]);var o=n.castShaderProgramId,s=e.length;a.length=s;for(var l=0;l<s;++l)a[l]=createCastDerivedCommand(e[l],i,t,r,o,a[l]);n.castShaderProgramId=t.shaderProgram.id}return n},ShadowMap.prototype.isDestroyed=function(){return!1},ShadowMap.prototype.destroy=function(){destroyFramebuffer(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(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return destroyObject(this)};var CompareAndPackTranslucentDepth="uniform sampler2D u_opaqueDepthTexture;\nuniform sampler2D u_translucentDepthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat opaqueDepth = texture2D(u_opaqueDepthTexture, v_textureCoordinates).r;\nfloat translucentDepth = texture2D(u_translucentDepthTexture, v_textureCoordinates).r;\ntranslucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);\ngl_FragColor = czm_packDepth(translucentDepth);\n}\n",CompositeTranslucentClassification="uniform sampler2D colorTexture;\n#ifdef DEBUG_SHOW_DEPTH\nuniform sampler2D u_packedTranslucentDepth;\n#endif\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n#ifdef DEBUG_SHOW_DEPTH\nif (v_textureCoordinates.x < 0.5)\n{\ngl_FragColor.rgb = vec3(czm_unpackDepth(texture2D(u_packedTranslucentDepth, v_textureCoordinates)));\ngl_FragColor.a = 1.0;\n}\n#else\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\n#ifdef PICK\nif (color == vec4(0.0))\n{\ndiscard;\n}\n#else\ncolor.rgb /= color.a;\n#endif\ngl_FragColor = color;\n#endif\n}\n";function TranslucentTileClassification(e){this._drawClassificationFBO=void 0,this._accumulationFBO=void 0,this._packFBO=void 0,this._opaqueDepthStencilTexture=void 0,this._colorTexture=void 0,this._accumulationTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packedTranslucentDepth=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ClearCommand({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new BoundingRectangle,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}function destroyTextures(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy(),e._packedTranslucentDepth=e._packedTranslucentDepth&&!e._packedTranslucentDepth.isDestroyed()&&e._packedTranslucentDepth.destroy()}function destroyFramebuffers(e){e._drawClassificationFBO=e._drawClassificationFBO&&!e._drawClassificationFBO.isDestroyed()&&e._drawClassificationFBO.destroy(),e._accumulationFBO=e._accumulationFBO&&!e._accumulationFBO.isDestroyed()&&e._accumulationFBO.destroy(),e._packFBO=e._packFBO&&!e._packFBO.isDestroyed()&&e._packFBO.destroy()}function rgbaTexture(e,t,i){return new Texture({context:e,width:t,height:i,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST})}function updateTextures(e,t,i,r){destroyTextures(e),e._colorTexture=rgbaTexture(t,i,r),e._accumulationTexture=rgbaTexture(t,i,r),e._translucentDepthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),e._packedTranslucentDepth=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST})}function updateFramebuffers$1(e,t){destroyFramebuffers(e),e._drawClassificationFBO=new Framebuffer({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._translucentDepthStencilTexture,destroyAttachments:!1}),e._accumulationFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._translucentDepthStencilTexture,destroyAttachments:!1}),e._packFBO=new Framebuffer({context:t,colorTextures:[e._packedTranslucentDepth],destroyAttachments:!1})}function updateResources(e,t,i,r){var n,a,o,s,l;e.isSupported()&&(e._opaqueDepthStencilTexture=r.depthStencilTexture,s=e._opaqueDepthStencilTexture.width,l=e._opaqueDepthStencilTexture.height,(a=!defined(o=e._colorTexture)||o.width!==s||o.height!==l)&&updateTextures(e,t,s,l),defined(e._drawClassificationFBO)&&!a||updateFramebuffers$1(e,t),defined(e._packDepthCommand)||(n=new ShaderSource({sources:[CompareAndPackTranslucentDepth]}),e._packDepthCommand=t.createViewportQuadCommand(n,{uniformMap:{u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},owner:e})),defined(e._compositeCommand)||(n=new ShaderSource({sources:[CompositeTranslucentClassification]}),e._compositeCommand=t.createViewportQuadCommand(n,{uniformMap:{colorTexture:function(){return e._textureToComposite}},owner:e}),o=(r=e._compositeCommand).shaderProgram,a=t.shaderCache.createDerivedShaderProgram(o,"pick",{vertexShaderSource:o.vertexShaderSource,fragmentShaderSource:new ShaderSource({sources:n.sources,defines:["PICK"]}),attributeLocations:o._attributeLocations}),(o=DrawCommand.shallowClone(r)).shaderProgram=a,r.derivedCommands.pick=o),defined(e._copyCommand)||(n=new ShaderSource({sources:[CompositeTranslucentClassification]}),e._copyCommand=t.createViewportQuadCommand(n,{uniformMap:{colorTexture:function(){return e._colorTexture}},owner:e})),defined(e._accumulateCommand)||(n=new ShaderSource({sources:[CompositeTranslucentClassification]}),e._accumulateCommand=t.createViewportQuadCommand(n,{uniformMap:{colorTexture:function(){return e._colorTexture}},owner:e})),e._viewport.width=s,e._viewport.height=l,l=(s=!BoundingRectangle.equals(e._viewport,i.viewport))!==e._useScissorTest,e._useScissorTest=s,BoundingRectangle.equals(e._scissorRectangle,i.viewport)||(e._scissorRectangle=BoundingRectangle.clone(i.viewport,e._scissorRectangle),l=!0),defined(e._rsDepth)&&BoundingRectangle.equals(e._viewport,e._rsDepth.viewport)&&!l||(e._rsDepth=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),defined(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),defined(e._rsAccumulate)&&BoundingRectangle.equals(e._viewport,e._rsAccumulate.viewport)&&!l||(e._rsAccumulate=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,reference:StencilConstants$1.CESIUM_3D_TILE_MASK}})),defined(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),defined(e._rsComp)&&BoundingRectangle.equals(e._viewport,e._rsComp.viewport)&&!l||(e._rsComp=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:BlendingState$1.ALPHA_BLEND})),defined(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp))}function clear(e,t,i){var r;e._hasTranslucentDepth&&(r=i.framebuffer,i.framebuffer=e._drawClassificationFBO,e._clearColorCommand.execute(t._context,i),i.framebuffer=r,1<e._frustumsDrawn&&(i.framebuffer=e._accumulationFBO,e._clearColorCommand.execute(t._context,i)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0)}function CommandExtent(){this.command=void 0,this.near=void 0,this.far=void 0}function View(e,t,i){var r,n,a=e.context;a.depthTexture&&(r=new GlobeDepth),e._useOIT&&a.depthTexture&&(n=new OIT(a));e=new PassState(a);e.viewport=BoundingRectangle.clone(i),this.camera=t,this._cameraClone=Camera.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=i,this.passState=e,this.pickFramebuffer=new PickFramebuffer(a),this.pickDepthFramebuffer=new PickDepthFramebuffer,this.sceneFramebuffer=new SceneFramebuffer,this.globeDepth=r,this.globeTranslucencyFramebuffer=new GlobeTranslucencyFramebuffer,this.oit=n,this.translucentTileClassification=new TranslucentTileClassification(a),this.pickDepths=[],this.debugGlobeDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}Object.defineProperties(TranslucentTileClassification.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}}),TranslucentTileClassification.prototype.executeTranslucentCommands=function(e,t,i,r,n){for(var a=r.length,o=e.frameState.useLogDepth,s=e.context,l=i.framebuffer,c=0;c<a;++c)if(u=r[c],(u=o?u.derivedCommands.logDepth.command:u).depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(updateResources(this,s,i,n),i.framebuffer=this._drawClassificationFBO,this._clearDepthStencilCommand.execute(s,i),c=0;c<a;++c){var u=r[c];(u=o?u.derivedCommands.logDepth.command:u).depthForTranslucentClassification&&t(u.derivedCommands.depth.depthOnlyCommand,e,s,i)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(i.framebuffer=this._packFBO,this._packDepthCommand.execute(s,i)),i.framebuffer=l}},TranslucentTileClassification.prototype.executeClassificationCommands=function(e,t,i,r){if(this._hasTranslucentDepth){var n=e.context,a=n.uniformState,o=i.framebuffer;2===this._frustumsDrawn&&(i.framebuffer=this._accumulationFBO,this._copyCommand.execute(n,i)),i.framebuffer=this._drawClassificationFBO,1<this._frustumsDrawn&&this._clearColorCommand.execute(n,i),a.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION);var s=a.globeDepthTexture;a.globeDepthTexture=this._packedTranslucentDepth;for(var l=r.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],c=r.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],u=0;u<c;++u)t(l[u],e,n,i);a.globeDepthTexture=s,i.framebuffer=o,1!==this._frustumsDrawn&&(i.framebuffer=this._accumulationFBO,this._accumulateCommand.execute(n,i),i.framebuffer=o)}},TranslucentTileClassification.prototype.execute=function(e,t){this._hasTranslucentDepth&&(1===this._frustumsDrawn?this._textureToComposite=this._colorTexture:this._textureToComposite=this._accumulationTexture,(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),clear(this,e,t))},TranslucentTileClassification.prototype.isSupported=function(){return this._supported},TranslucentTileClassification.prototype.isDestroyed=function(){return!1},TranslucentTileClassification.prototype.destroy=function(){return destroyTextures(this),destroyFramebuffers(this),defined(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),defined(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),destroyObject(this)};var scratchPosition0=new Cartesian3,scratchPosition1=new Cartesian3;function maxComponent(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),t=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),t)}function cameraEqual(e,t,i){var r=1/Math.max(1,maxComponent(e.position,t.position));return Cartesian3.multiplyByScalar(e.position,r,scratchPosition0),Cartesian3.multiplyByScalar(t.position,r,scratchPosition1),Cartesian3.equalsEpsilon(scratchPosition0,scratchPosition1,i)&&Cartesian3.equalsEpsilon(e.direction,t.direction,i)&&Cartesian3.equalsEpsilon(e.up,t.up,i)&&Cartesian3.equalsEpsilon(e.right,t.right,i)&&Matrix4.equalsEpsilon(e.transform,t.transform,i)&&e.frustum.equalsEpsilon(t.frustum,i)}function updateFrustums(e,t,i,r){var n=t.frameState,a=n.camera,o=n.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,s=t.mode===SceneMode$1.SCENE2D,l=t.nearToFarDistance2D;r*=1+CesiumMath.EPSILON2,i=Math.min(Math.max(i,a.frustum.near),a.frustum.far),r=Math.max(Math.min(r,a.frustum.far),i);var c=s?(r=Math.min(r,a.position.z+t.nearToFarDistance2D),i=Math.min(i,r),Math.ceil(Math.max(1,r-i)/t.nearToFarDistance2D)):Math.ceil(Math.log(r/i)/Math.log(o)),u=e.frustumCommandsList;u.length=c;for(var d=0;d<c;++d){var h,p=s?(h=Math.min(r-l,i+d*l),Math.min(r,h+l)):(h=Math.max(i,Math.pow(o,d)*i),Math.min(r,o*h)),m=u[d];defined(m)?(m.near=h,m.far=p):m=u[d]=new FrustumCommands(h,p)}}function insertIntoBin(e,t,i,r,n){t.debugShowFrustums&&(i.debugOverlappingFrustums=0);for(var a,o=e.frustumCommandsList,s=o.length,l=0;l<s;++l){var c=o[l],u=c.near;if(!(c.far<r)){if(n<u)break;var d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<l),i.executeInClosestFrustum)break}}t.debugShowFrustums&&((a=e.debugFrustumStatistics.commandsInFrustums)[i.debugOverlappingFrustums]=defined(a[i.debugOverlappingFrustums])?a[i.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands),t.updateDerivedCommands(i)}View.prototype.checkForCameraUpdates=function(e){var t=this.camera,i=this._cameraClone;return cameraEqual(t,i,CesiumMath.EPSILON15)?(this._cameraStartFired&&getTimestamp$1()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=getTimestamp$1(),Camera.clone(t,i),!0)};var scratchCullingVolume$1=new CullingVolume,scratchNearFarInterval=new Interval;View.prototype.createPotentiallyVisibleSet=function(e){var t=e.frameState,i=t.camera,r=i.directionWC,n=i.positionWC,a=e._computeCommandList,o=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=this.frustumCommandsList,c=l.length,u=Pass$1.NUMBER_OF_PASSES,d=0;d<c;++d)for(var h=0;h<u;++h)l[d].indices[h]=0;a.length=0,o.length=0;for(var p=this._commandExtents,m=p.length,f=0,g=+Number.MAX_VALUE,_=-Number.MAX_VALUE,y=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,T=t.mode===SceneMode$1.SCENE3D?t.occluder:void 0,x=t.cullingVolume,b=scratchCullingVolume$1.planes,E=0;E<5;++E)b[E]=x.planes[E];for(var P,A,x=scratchCullingVolume$1,w=s.length,D=0;D<w;++D){var M=s[D],I=M.pass;if(I===Pass$1.COMPUTE)a.push(M);else if(I===Pass$1.OVERLAY)o.push(M);else{var R=M.boundingVolume;if(defined(R)){if(!e.isVisible(M,x,T))continue;var O=R.computePlaneDistances(n,r,scratchNearFarInterval),L=O.start,O=O.stop,g=Math.min(g,L),_=Math.max(_,O);y&&M.receiveShadows&&L<ShadowMap.MAXIMUM_DISTANCE&&!(I===Pass$1.GLOBE&&L<-100&&100<O)&&(I!==Pass$1.GLOBE&&L<100&&(S=Math.min(S,O-L)),C=Math.min(C,L),v=Math.max(v,O))}else M instanceof ClearCommand?(L=i.frustum.near,O=i.frustum.far):(L=i.frustum.near,O=i.frustum.far,g=Math.min(g,L),_=Math.max(_,O));I=p[f];(I=!defined(I)?p[f]=new CommandExtent:I).command=M,I.near=L,I.far=O,f++}}for(y&&(C=Math.min(Math.max(C,i.frustum.near),i.frustum.far),v=Math.max(Math.min(v,i.frustum.far),C)),y&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=v,t.shadowState.closestObjectSize=S),updateFrustums(this,e,g,_),P=0;P<f;P++)insertIntoBin(this,e,(A=p[P]).command,A.near,A.far);if(f<m)for(P=f;P<m&&defined((A=p[P]).command);P++)A.command=void 0;var F=l.length,N=t.frustumSplits;N.length=F+1;for(var B=0;B<F;++B)N[B]=l[B].near,B===F-1&&(N[B+1]=l[B].far)},View.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();for(var e=this.pickDepths,t=this.debugGlobeDepths,i=e.length,r=0;r<i;++r)e[r].destroy();for(i=t.length,r=0;r<i;++r)t[r].destroy()};var offscreenDefaultWidth=.1,mostDetailedPreloadTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.MOST_DETAILED_PRELOAD}),mostDetailedPickTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.MOST_DETAILED_PICK}),pickTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PICK});function Picking(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;var t=new BoundingRectangle(0,0,1,1),i=new Camera(e);i.frustum=new OrthographicFrustum({width:offscreenDefaultWidth,aspectRatio:1,near:.1}),this._pickOffscreenView=new View(e,i,t)}Picking.prototype.update=function(){this._pickPositionCacheDirty=!0},Picking.prototype.getPickDepth=function(e,t){var i=e.view.pickDepths,e=i[t];return defined(e)||(e=new PickDepth,i[t]=e),e};var scratchOrthoPickingFrustum=new OrthographicOffCenterFrustum,scratchOrthoOrigin=new Cartesian3,scratchOrthoDirection=new Cartesian3,scratchOrthoPixelSize=new Cartesian2,scratchOrthoPickVolumeMatrix4=new Matrix4;function getPickOrthographicCullingVolume(e,t,i,r,n){var a=e.camera,o=a.frustum;defined(o._offCenterFrustum)&&(o=o._offCenterFrustum);var s=2*(t.x-n.x)/n.width-1;s*=.5*(o.right-o.left);var l=2*(n.height-t.y-n.y)/n.height-1;l*=.5*(o.top-o.bottom);var c=Matrix4.clone(a.transform,scratchOrthoPickVolumeMatrix4);a._setTransform(Matrix4.IDENTITY);t=Cartesian3.clone(a.position,scratchOrthoOrigin);Cartesian3.multiplyByScalar(a.right,s,scratchOrthoDirection),Cartesian3.add(scratchOrthoDirection,t,t),Cartesian3.multiplyByScalar(a.up,l,scratchOrthoDirection),Cartesian3.add(scratchOrthoDirection,t,t),a._setTransform(c),e.mode===SceneMode$1.SCENE2D&&Cartesian3.fromElements(t.z,t.x,t.y,t);e=o.getPixelDimensions(n.width,n.height,1,1,scratchOrthoPixelSize),n=scratchOrthoPickingFrustum;return n.right=.5*e.x,n.left=-n.right,n.top=.5*e.y,n.bottom=-n.top,n.near=o.near,n.far=o.far,n.computeCullingVolume(t,a.directionWC,a.upWC)}var scratchPerspPickingFrustum=new PerspectiveOffCenterFrustum,scratchPerspPixelSize=new Cartesian2;function getPickPerspectiveCullingVolume(e,t,i,r,n){var a=e.camera,o=a.frustum,s=o.near,l=Math.tan(.5*o.fovy),e=o.aspectRatio*l,e=(2*(t.x-n.x)/n.width-1)*s*e,l=(2*(n.height-t.y-n.y)/n.height-1)*s*l,n=o.getPixelDimensions(n.width,n.height,1,1,scratchPerspPixelSize),i=n.x*i*.5,n=n.y*r*.5,r=scratchPerspPickingFrustum;return r.top=l+n,r.bottom=l-n,r.right=e+i,r.left=e-i,r.near=s,r.far=o.far,r.computeCullingVolume(a.positionWC,a.directionWC,a.upWC)}function getPickCullingVolume(e,t,i,r,n){var a=e.camera.frustum;return(a instanceof OrthographicFrustum||a instanceof OrthographicOffCenterFrustum?getPickOrthographicCullingVolume:getPickPerspectiveCullingVolume)(e,t,i,r,n)}var scratchRectangleWidth=3,scratchRectangleHeight=3,scratchRectangle=new BoundingRectangle(0,0,scratchRectangleWidth,scratchRectangleHeight),scratchPosition=new Cartesian2,scratchColorZero=new Color(0,0,0,0);function renderTranslucentDepthForPick(e,t){var i=e.context,r=e.frameState,n=e.environmentState,a=e.defaultView,o=(e.view=a).viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;var s=a.passState;s.viewport=BoundingRectangle.clone(o,s.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=getPickCullingVolume(e,t,1,1,o),r.tilesetPassState=pickTilesetPassState,e.updateEnvironment(),n.renderTranslucentDepthForPick=!0,s=a.pickDepthFramebuffer.update(i,t,o),e.updateAndExecuteCommands(s,scratchColorZero),e.resolveFramebuffers(s),i.endFrame()}Picking.prototype.pick=function(e,t,i,r){scratchRectangleWidth=defaultValue(i,3),scratchRectangleHeight=defaultValue(r,scratchRectangleWidth);var n=e.context,a=n.uniformState,o=e.frameState,s=e.defaultView,i=(e.view=s).viewport;i.x=0,i.y=0,i.width=n.drawingBufferWidth,i.height=n.drawingBufferHeight;r=s.passState;r.viewport=BoundingRectangle.clone(i,r.viewport);t=SceneTransforms.transformWindowToDrawingBuffer(e,t,scratchPosition);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=getPickCullingVolume(e,t,scratchRectangleWidth,scratchRectangleHeight,i),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=pickTilesetPassState,a.update(o),e.updateEnvironment(),scratchRectangle.x=t.x-.5*(scratchRectangleWidth-1),scratchRectangle.y=e.drawingBufferHeight-t.y-.5*(scratchRectangleHeight-1),scratchRectangle.width=scratchRectangleWidth,scratchRectangle.height=scratchRectangleHeight,r=s.pickFramebuffer.begin(scratchRectangle,s.viewport),e.updateAndExecuteCommands(r,scratchColorZero),e.resolveFramebuffers(r);s=s.pickFramebuffer.end(scratchRectangle);return n.endFrame(),s};var scratchPerspectiveFrustum$1=new PerspectiveFrustum,scratchPerspectiveOffCenterFrustum$1=new PerspectiveOffCenterFrustum,scratchOrthographicFrustum$1=new OrthographicFrustum,scratchOrthographicOffCenterFrustum$1=new OrthographicOffCenterFrustum;Picking.prototype.pickPositionWorldCoordinates=function(e,t,i){if(e.useDepthPicking){var r=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return Cartesian3.clone(this._pickPositionCache[r],i);var n=e.frameState,a=e.context,o=a.uniformState,s=e.defaultView;e.view=s;var l=SceneTransforms.transformWindowToDrawingBuffer(e,t,scratchPosition);e.pickTranslucentDepth?renderTranslucentDepthForPick(e,l):(e.updateFrameState(),o.update(n),e.updateEnvironment()),l.y=e.drawingBufferHeight-l.y;for(var c=e.camera,u=defined(c.frustum.fov)?c.frustum.clone(scratchPerspectiveFrustum$1):defined(c.frustum.infiniteProjectionMatrix)?c.frustum.clone(scratchPerspectiveOffCenterFrustum$1):defined(c.frustum.width)?c.frustum.clone(scratchOrthographicFrustum$1):c.frustum.clone(scratchOrthographicOffCenterFrustum$1),d=s.frustumCommandsList,h=d.length,p=0;p<h;++p){var m=this.getPickDepth(e,p).getDepth(a,l.x,l.y);if(defined(m)&&(0<m&&m<1)){var f,g=d[p];return e.mode===SceneMode$1.SCENE2D?(f=c.position.z,c.position.z=f-g.near+1,u.far=Math.max(1,g.far-g.near),u.near=1,o.update(n)):(u.near=g.near*(0!==p?e.opaqueFrustumNearOffset:1),u.far=g.far),o.updateFrustum(u),i=SceneTransforms.drawingBufferToWgs84Coordinates(e,l,m,i),e.mode===SceneMode$1.SCENE2D&&(c.position.z=f,o.update(n)),this._pickPositionCache[r]=Cartesian3.clone(i),i}}this._pickPositionCache[r]=void 0}};var scratchPickPositionCartographic=new Cartographic;function drillPick(e,t){var i,r,n=[],a=[],o=[],s=[];defined(e)||(e=Number.MAX_VALUE);for(var l=t();defined(l);){var c=l.object,u=l.position,d=l.exclude;if(defined(u)&&!defined(c)){n.push(l);break}if(!defined(c)||!defined(c.primitive))break;if(!d&&(n.push(l),--e<=0))break;u=c.primitive,d=!1;"function"==typeof u.getGeometryInstanceAttributes&&defined(c.id)&&defined(r=u.getGeometryInstanceAttributes(c.id))&&defined(r.show)&&(r.show=ShowGeometryInstanceAttribute.toValue(!(d=!0),r.show),o.push(r)),c instanceof Cesium3DTileFeature&&(c.show=!(d=!0),s.push(c)),d||(u.show=!1,a.push(u)),l=t()}for(i=0;i<a.length;++i)a[i].show=!0;for(i=0;i<o.length;++i)(r=o[i]).show=ShowGeometryInstanceAttribute.toValue(!0,r.show);for(i=0;i<s.length;++i)s[i].show=!0;return n}Picking.prototype.pickPosition=function(e,t,i){return defined(i=this.pickPositionWorldCoordinates(e,t,i))&&e.mode!==SceneMode$1.SCENE3D&&(Cartesian3.fromElements(i.y,i.z,i.x,i),e=(t=e.mapProjection).ellipsoid,t=t.unproject(i,scratchPickPositionCartographic),e.cartographicToCartesian(t,i)),i},Picking.prototype.drillPick=function(t,i,e,r,n){var a=this;return drillPick(e,function(){var e=a.pick(t,i,r,n);if(defined(e))return{object:e,position:void 0,exclude:!1}}).map(function(e){return e.object})};var scratchRight=new Cartesian3,scratchUp=new Cartesian3;function MostDetailedRayPick(e,t,i){this.ray=e,this.width=t,this.tilesets=i,this.ready=!1,this.deferred=when.defer(),this.promise=this.deferred.promise}function updateOffscreenCameraFromRay(e,t,i,r){var n=t.direction,a=Cartesian3.mostOrthogonalAxis(n,scratchRight),o=Cartesian3.cross(n,a,scratchRight),a=Cartesian3.cross(n,o,scratchUp);return r.position=t.origin,r.direction=n,r.up=a,r.right=o,r.frustum.width=defaultValue(i,offscreenDefaultWidth),r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function updateMostDetailedRayPick(e,t,i){var r=t.frameState,n=i.ray,a=i.width,o=i.tilesets,s=e._pickOffscreenView.camera,a=updateOffscreenCameraFromRay(e,n,a,s),l=mostDetailedPreloadTilesetPassState;l.camera=s,l.cullingVolume=a;for(var c=!0,u=o.length,d=0;d<u;++d){var h=o[d];h.show&&t.primitives.contains(h)&&(h.updateForPass(r,l),c=c&&l.ready)}return c&&i.deferred.resolve(),c}function getTilesets(e,t,i){for(var r=e.length,n=0;n<r;++n){var a=e.get(n);a.show&&(defined(a.isCesium3DTileset)?defined(t)&&-1!==t.indexOf(a)||i.push(a):a instanceof PrimitiveCollection&&getTilesets(a,t,i))}}function launchMostDetailedRayPick(e,t,i,r,n,a){var o=[];if(getTilesets(t.primitives,r,o),0===o.length)return when.resolve(a());o=new MostDetailedRayPick(i,n,o);return e._mostDetailedRayPicks.push(o),o.promise.then(function(){return a()})}function isExcluded(e,t){return!(!defined(e)||!defined(t)||0===t.length)&&(-1<t.indexOf(e)||-1<t.indexOf(e.primitive)||-1<t.indexOf(e.id))}function getRayIntersection(e,t,i,r,n,a,o){var s=t.context,l=s.uniformState,c=t.frameState,u=e._pickOffscreenView;updateOffscreenCameraFromRay(e,i,n,(t.view=u).camera),scratchRectangle=BoundingRectangle.clone(u.viewport,scratchRectangle);n=u.pickFramebuffer.begin(scratchRectangle,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,c.tilesetPassState=o?mostDetailedPickTilesetPassState:pickTilesetPassState,l.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(n,scratchColorZero),t.resolveFramebuffers(n);n=u.pickFramebuffer.end(s);if(t.context.depthTexture)for(var d=u.frustumCommandsList.length,h=0;h<d;++h){var p=e.getPickDepth(t,h).getDepth(s,0,0);if(defined(p)&&(0<p&&p<1)){var m=u.frustumCommandsList[h],f=m.near*(0!==h?t.opaqueFrustumNearOffset:1),m=m.far,g=Ray.getPoint(i,f+p*(m-f));break}}if(t.view=t.defaultView,s.endFrame(),defined(n)||defined(g))return{object:n,position:g,exclude:!defined(g)&&a||isExcluded(n,r)}}function getRayIntersections(e,t,i,r,n,a,o,s){return drillPick(r,function(){return getRayIntersection(e,t,i,n,a,o,s)})}function pickFromRay(e,t,i,r,n,a,o){o=getRayIntersections(e,t,i,1,r,n,a,o);if(0<o.length)return o[0]}function drillPickFromRay(e,t,i,r,n,a,o,s){return getRayIntersections(e,t,i,r,n,a,o,s)}function deferPromiseUntilPostRender(i,e){var r=when.defer();return e.then(function(e){var t=i.postRender.addEventListener(function(){r.resolve(e),t()});i.requestRender()}).otherwise(function(e){r.reject(e)}),r.promise}Picking.prototype.updateMostDetailedRayPicks=function(e){for(var t=this._mostDetailedRayPicks,i=0;i<t.length;++i)updateMostDetailedRayPick(this,e,t[i])&&t.splice(i--,1)},Picking.prototype.pickFromRay=function(e,t,i,r){return pickFromRay(this,e,t,i,r,!1,!1)},Picking.prototype.drillPickFromRay=function(e,t,i,r,n){return drillPickFromRay(this,e,t,i,r,n,!1,!1)},Picking.prototype.pickFromRayMostDetailed=function(e,t,i,r){var n=this;return t=Ray.clone(t),i=defined(i)?i.slice():i,deferPromiseUntilPostRender(e,launchMostDetailedRayPick(n,e,t,i,r,function(){return pickFromRay(n,e,t,i,r,!1,!0)}))},Picking.prototype.drillPickFromRayMostDetailed=function(e,t,i,r,n){var a=this;return t=Ray.clone(t),r=defined(r)?r.slice():r,deferPromiseUntilPostRender(e,launchMostDetailedRayPick(a,e,t,r,n,function(){return drillPickFromRay(a,e,t,i,r,n,!1,!0)}))};var scratchSurfacePosition=new Cartesian3,scratchSurfaceNormal$1=new Cartesian3,scratchSurfaceRay=new Ray,scratchCartographic$1=new Cartographic;function getRayForSampleHeight(e,t){var i=e.globe,r=(defined(i)?i:e.mapProjection).ellipsoid,i=ApproximateTerrainHeights._defaultMaxTerrainHeight,e=r.geodeticSurfaceNormalCartographic(t,scratchSurfaceNormal$1),t=Cartographic.toCartesian(t,r,scratchSurfacePosition),r=scratchSurfaceRay;r.origin=t,r.direction=e;t=new Ray;return Ray.getPoint(r,i,t.origin),Cartesian3.negate(e,t.direction),t}function getRayForClampToHeight(e,t){var i=e.globe,i=(defined(i)?i:e.mapProjection).ellipsoid;return getRayForSampleHeight(e,Cartographic.fromCartesian(t,i,scratchCartographic$1))}function getHeightFromCartesian(e,t){var i=e.globe,e=(defined(i)?i:e.mapProjection).ellipsoid;return Cartographic.fromCartesian(t,e,scratchCartographic$1).height}function sampleHeightMostDetailed(t,i,e,r,n){var a=getRayForSampleHeight(i,e);return launchMostDetailedRayPick(t,i,a,r,n,function(){var e=pickFromRay(t,i,a,r,n,!0,!0);if(defined(e))return getHeightFromCartesian(i,e.position)})}function clampToHeightMostDetailed(t,i,e,r,n,a){var o=getRayForClampToHeight(i,e);return launchMostDetailedRayPick(t,i,o,r,n,function(){var e=pickFromRay(t,i,o,r,n,!0,!0);if(defined(e))return Cartesian3.clone(e.position,a)})}Picking.prototype.sampleHeight=function(e,t,i,r){r=pickFromRay(this,e,getRayForSampleHeight(e,t),i,r,!0,!1);if(defined(r))return getHeightFromCartesian(e,r.position)},Picking.prototype.clampToHeight=function(e,t,i,r,n){r=pickFromRay(this,e,getRayForClampToHeight(e,t),i,r,!0,!1);if(defined(r))return Cartesian3.clone(r.position,n)},Picking.prototype.sampleHeightMostDetailed=function(e,r,t,i){t=defined(t)?t.slice():t;for(var n=r.length,a=new Array(n),o=0;o<n;++o)a[o]=sampleHeightMostDetailed(this,e,r[o],t,i);return deferPromiseUntilPostRender(e,when.all(a).then(function(e){for(var t=e.length,i=0;i<t;++i)r[i].height=e[i];return r}))},Picking.prototype.clampToHeightMostDetailed=function(e,r,t,i){t=defined(t)?t.slice():t;for(var n=r.length,a=new Array(n),o=0;o<n;++o)a[o]=clampToHeightMostDetailed(this,e,r[o],t,i,r[o]);return deferPromiseUntilPostRender(e,when.all(a).then(function(e){for(var t=e.length,i=0;i<t;++i)r[i]=e[i];return r}))},Picking.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var PostProcessStageSampleMode={NEAREST:0,LINEAR:1};function PostProcessStage(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).fragmentShader,i=defaultValue(e.textureScale,1),r=defaultValue(e.pixelFormat,PixelFormat$1.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=i,this._forcePowerOfTwo=defaultValue(e.forcePowerOfTwo,!1),this._sampleMode=defaultValue(e.sampleMode,PostProcessStageSampleMode.NEAREST),this._pixelFormat=r,this._pixelDatatype=defaultValue(e.pixelDatatype,PixelDatatype$1.UNSIGNED_BYTE),this._clearColor=defaultValue(e.clearColor,Color.BLACK),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;r=new PassState;r.scissorTest={enabled:!0,rectangle:defined(e.scissorRectangle)?BoundingRectangle.clone(e.scissorRectangle):new BoundingRectangle},this._passState=r,this._ready=!1;e=e.name;defined(e)||(e=createGuid()),this._name=e,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(PostProcessStage.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(defined(this._textureCache)){var e=this._textureCache.getFramebuffer(this._name);if(defined(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 depthTextureRegex=/uniform\s+sampler2D\s+depthTexture/g;function getUniformValueGetterAndSetter(n,a,o){var e=a[o];return("string"==typeof e||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)&&n._dirtyUniforms.push(o),{get:function(){return a[o]},set:function(e){var t=a[o];a[o]=e;var i=n._actualUniforms,r=i[o];defined(r)&&r!==t&&r instanceof Texture&&!defined(n._textureCache.getStageByName(o))&&(n._texturesToRelease.push(r),delete i[o],delete i[o+"Dimensions"]),t instanceof Texture&&n._texturesToRelease.push(t),"string"==typeof e||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData?n._dirtyUniforms.push(o):i[o]=e}}}function getUniformMapFunction(t,i){return function(){var e=t._actualUniforms[i];return"function"==typeof e?e():e}}function getUniformMapDimensionsFunction(t,i){return function(){var e=t[i]();if(defined(e))return e.dimensions}}function createUniformMap(e){if(!defined(e._uniformMap)){var t,i,r={},n={},a=e._uniforms,o=e._actualUniforms;for(t in a)a.hasOwnProperty(t)&&("function"!=typeof a[t]?(r[t]=getUniformMapFunction(e,t),n[t]=getUniformValueGetterAndSetter(e,a,t)):(r[t]=a[t],n[t]=a[t]),o[t]=a[t],("string"==typeof(i=r[t]())||i instanceof Texture||i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(r[t+"Dimensions"]=getUniformMapDimensionsFunction(r,t)));e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=combine$2(r,{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 createDrawCommand(e,t){var i;defined(e._command)&&!e._logDepthChanged&&!e._selectedDirty||(i=e._fragmentShader,defined(e._selectedIdTexture)&&(i="#define CZM_SELECTED_FEATURE \nuniform sampler2D czm_idTexture; \nuniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nvarying vec2 v_textureCoordinates; \nbool czm_selected(vec2 offset) \n{ \n bool selected = false;\n vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset); \n for (int i = 0; i < "+e._selectedIdTexture.width+"; ++i) \n { \n vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n if (all(equal(id, selectedId))) \n { \n return true; \n } \n } \n return false; \n} \n\nbool czm_selected() \n{ \n return czm_selected(vec2(0.0)); \n} \n\n"+(i=i.replace(/varying\s+vec2\s+v_textureCoordinates;/g,""))),i=new ShaderSource({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[i]}),e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e}))}function createSampler(e){var t,i=e._sampleMode===PostProcessStageSampleMode.LINEAR?(t=TextureMinificationFilter$1.LINEAR,TextureMagnificationFilter$1.LINEAR):(t=TextureMinificationFilter$1.NEAREST,TextureMagnificationFilter$1.NEAREST),r=e._sampler;defined(r)&&r.minificationFilter===t&&r.magnificationFilter===i||(e._sampler=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i}))}function createLoadImageFunction(t,i){return function(e){t._texturesToCreate.push({name:i,source:e})}}function createStageOutputTextureFunction(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function updateUniformTextures(e,t){var i,r=e._texturesToRelease,n=r.length;for(d=0;d<n;++d)i=(i=r[d])&&i.destroy();r.length=0;var a=e._texturesToCreate;for(n=a.length,d=0;d<n;++d){var o=a[d],s=o.name,o=o.source;e._actualUniforms[s]=new Texture({context:t,source:o})}a.length=0;var l=e._dirtyUniforms;if(0!==l.length||defined(e._texturePromise)){if(0!==l.length&&!defined(e._texturePromise)){for(var n=l.length,c=e._uniforms,u=[],d=0;d<n;++d){var h,p=c[s=l[d]];defined(e._textureCache.getStageByName(p))?e._actualUniforms[s]=createStageOutputTextureFunction(e,p):"string"==typeof p?(h=new Resource({url:p}),u.push(h.fetchImage().then(createLoadImageFunction(e,s)))):e._texturesToCreate.push({name:s,source:p})}(l.length=0)<u.length?(e._ready=!1,e._texturePromise=when.all(u).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}}else e._ready=!0}function releaseResources$1(e){defined(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();var t=e._textureCache;if(defined(t)){var i,r=e._uniforms,n=e._actualUniforms;for(i in n)n.hasOwnProperty(i)&&n[i]instanceof Texture&&(defined(t.getStageByName(r[i]))||n[i].destroy(),e._dirtyUniforms.push(i))}}function isSelectedTextureDirty$1(e){var t=defined(e._selected)?e._selected.length:0,i=defined(e._parentSelected)?e._parentSelected:0,r=(r=e._selected!==e._selectedShadow||t!==e._selectedLength)||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength;if(defined(e._selected)&&defined(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):defined(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&defined(e._combinedSelected)){if(!defined(e._combinedSelectedShadow))return!0;for(var t=e._combinedSelected.length,n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}function createSelectedTexture(e,t){if(e._selectedDirty){e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;var i=e._combinedSelected;if(defined(i)){for(var r,n,a=0,o=i.length,s=0;s<o;++s)defined((r=i[s]).pickIds)?a+=r.pickIds.length:defined(r.pickId)&&++a;if(0===o||0===a){var l=new Uint8Array(4);return l[0]=255,l[1]=255,l[2]=255,l[3]=255,void(e._selectedIdTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:l,width:1,height:1},sampler:Sampler.NEAREST}))}var c=0,u=new Uint8Array(4*a);for(s=0;s<o;++s)if(defined((r=i[s]).pickIds))for(var d=r.pickIds,h=d.length,p=0;p<h;++p)n=d[p].color,u[c]=Color.floatToByte(n.red),u[c+1]=Color.floatToByte(n.green),u[c+2]=Color.floatToByte(n.blue),u[c+3]=Color.floatToByte(n.alpha),c+=4;else defined(r.pickId)&&(n=r.pickId.color,u[c]=Color.floatToByte(n.red),u[c+1]=Color.floatToByte(n.green),u[c+2]=Color.floatToByte(n.blue),u[c+3]=Color.floatToByte(n.alpha),c+=4);e._selectedIdTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:u,width:a,height:1},sampler:Sampler.NEAREST})}}}PostProcessStage.prototype._isSupported=function(e){return!depthTextureRegex.test(this._fragmentShader)||e.depthTexture},PostProcessStage.prototype.update=function(e,t){var i;this.enabled===this._enabled||this.enabled||releaseResources$1(this),this._enabled=this.enabled,this._enabled&&(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=isSelectedTextureDirty$1(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=defined(this._selected)?this._selected.length:0,this._parentSelectedLength=defined(this._parentSelected)?this._parentSelected.length:0,createSelectedTexture(this,e),createUniformMap(this),updateUniformTextures(this,e),createDrawCommand(this,e),createSampler(this),this._selectedDirty=!1,this._ready&&(t=this._textureCache.getFramebuffer(this._name),defined(this._command.framebuffer=t)&&((t=t.getColorTexture(0)).width===e.drawingBufferWidth&&t.height===e.drawingBufferHeight||defined(i=this._renderState)&&t.width===i.viewport.width&&t.height===i.viewport.height||(this._renderState=RenderState.fromCache({viewport:new BoundingRectangle(0,0,t.width,t.height)})),this._command.renderState=i)))},PostProcessStage.prototype.execute=function(e,t,i,r){defined(this._command)&&defined(this._command.framebuffer)&&this._ready&&this._enabled&&(this._colorTexture=t,this._depthTexture=i,this._idTexture=r,Sampler.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler),defined(r=0<this.scissorRectangle.width&&0<this.scissorRectangle.height?this._passState:void 0)&&(r.context=e),this._command.execute(e,r))},PostProcessStage.prototype.isDestroyed=function(){return!1},PostProcessStage.prototype.destroy=function(){return releaseResources$1(this),destroyObject(this)};var AcesTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\ncolor /= texture2D(autoExposure, vec2(0.5)).r;\n#endif\ncolor = czm_acesTonemapping(color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",AmbientOcclusionGenerate="uniform sampler2D randomTexture;\nuniform sampler2D depthTexture;\nuniform float intensity;\nuniform float bias;\nuniform float lengthCap;\nuniform float stepSize;\nuniform float frustumLength;\nvarying vec2 v_textureCoordinates;\nvec4 clipToEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\nposEC = posEC / posEC.w;\nreturn posEC;\n}\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\n{\nvec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\nvec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\nvec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\nvec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\nvec3 up = posInCamera.xyz - posInCameraUp.xyz;\nvec3 down = posInCameraDown.xyz - posInCamera.xyz;\nvec3 left = posInCamera.xyz - posInCameraLeft.xyz;\nvec3 right = posInCameraRight.xyz - posInCamera.xyz;\nvec3 DX = length(left) < length(right) ? left : right;\nvec3 DY = length(up) < length(down) ? up : down;\nreturn normalize(cross(DY, DX));\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = clipToEye(v_textureCoordinates, depth);\nif (posInCamera.z > frustumLength)\n{\ngl_FragColor = vec4(1.0);\nreturn;\n}\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\nfloat depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));\nfloat depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));\nfloat depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));\nfloat depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));\nvec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\nfloat ao = 0.0;\nvec2 sampleDirection = vec2(1.0, 0.0);\nfloat gapAngle = 90.0 * czm_radiansPerDegree;\nfloat randomVal = texture2D(randomTexture, v_textureCoordinates).x;\nfor (int i = 0; i < 4; i++)\n{\nfloat newGapAngle = gapAngle * (float(i) + randomVal);\nfloat cosVal = cos(newGapAngle);\nfloat sinVal = sin(newGapAngle);\nvec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\nfloat localAO = 0.0;\nfloat localStepSize = stepSize;\nfor (int j = 0; j < 6; j++)\n{\nvec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;\nif(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\n{\nbreak;\n}\nfloat stepDepthInfo = czm_readDepth(depthTexture, newCoords);\nvec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\nvec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\nfloat len = length(diffVec);\nif (len > lengthCap)\n{\nbreak;\n}\nfloat dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\nfloat weight = len / lengthCap;\nweight = 1.0 - weight * weight;\nif (dotVal < bias)\n{\ndotVal = 0.0;\n}\nlocalAO = max(localAO, dotVal * weight);\nlocalStepSize += stepSize;\n}\nao += localAO;\n}\nao /= 4.0;\nao = 1.0 - clamp(ao, 0.0, 1.0);\nao = pow(ao, intensity);\ngl_FragColor = vec4(vec3(ao), 1.0);\n}\n",AmbientOcclusionModulate="uniform sampler2D colorTexture;\nuniform sampler2D ambientOcclusionTexture;\nuniform bool ambientOcclusionOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 ao = texture2D(ambientOcclusionTexture, v_textureCoordinates).rgb;\ngl_FragColor.rgb = ambientOcclusionOnly ? ao : ao * color;\n}\n",BlackAndWhite="uniform sampler2D colorTexture;\nuniform float gradations;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = vec4(rgb, 1.0);\nreturn;\n}\n#endif\nfloat luminance = czm_luminance(rgb);\nfloat darkness = luminance * gradations;\ndarkness = (darkness - fract(darkness)) / gradations;\ngl_FragColor = vec4(vec3(darkness), 1.0);\n}\n",BloomComposite="uniform sampler2D colorTexture;\nuniform sampler2D bloomTexture;\nuniform bool glowOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = color;\nreturn;\n}\n#endif\nvec4 bloom = texture2D(bloomTexture, v_textureCoordinates);\ngl_FragColor = glowOnly ? bloom : bloom + color;\n}\n",Brightness="uniform sampler2D colorTexture;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 target = vec3(0.0);\ngl_FragColor = vec4(mix(target, rgb, brightness), 1.0);\n}\n",ContrastBias="uniform sampler2D colorTexture;\nuniform float contrast;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;\nsceneColor = czm_RGBToHSB(sceneColor);\nsceneColor.z += brightness;\nsceneColor = czm_HSBToRGB(sceneColor);\nfloat factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\nsceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\ngl_FragColor = vec4(sceneColor, 1.0);\n}\n",DepthOfField="uniform sampler2D colorTexture;\nuniform sampler2D blurTexture;\nuniform sampler2D depthTexture;\nuniform float focalDistance;\nvarying vec2 v_textureCoordinates;\nvec4 toEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\nposInCamera = posInCamera / posInCamera.w;\nreturn posInCamera;\n}\nfloat computeDepthBlur(float depth)\n{\nfloat f;\nif (depth < focalDistance)\n{\nf = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\n}\nelse\n{\nf = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\nf = pow(f, 0.1);\n}\nf *= f;\nf = clamp(f, 0.0, 1.0);\nreturn pow(f, 0.5);\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = toEye(v_textureCoordinates, depth);\nfloat d = computeDepthBlur(-posInCamera.z);\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), texture2D(blurTexture, v_textureCoordinates), d);\n}\n",DepthView="uniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\ngl_FragColor = vec4(vec3(depth), 1.0);\n}\n",EdgeDetection="uniform sampler2D depthTexture;\nuniform float length;\nuniform vec4 color;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat directions[3];\ndirections[0] = -1.0;\ndirections[1] = 0.0;\ndirections[2] = 1.0;\nfloat scalars[3];\nscalars[0] = 3.0;\nscalars[1] = 10.0;\nscalars[2] = 3.0;\nfloat padx = czm_pixelRatio / czm_viewport.z;\nfloat pady = czm_pixelRatio / czm_viewport.w;\n#ifdef CZM_SELECTED_FEATURE\nbool selected = false;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nselected = selected || czm_selected(vec2(-padx, dir * pady));\nselected = selected || czm_selected(vec2(padx, dir * pady));\nselected = selected || czm_selected(vec2(dir * padx, -pady));\nselected = selected || czm_selected(vec2(dir * padx, pady));\nif (selected)\n{\nbreak;\n}\n}\nif (!selected)\n{\ngl_FragColor = vec4(color.rgb, 0.0);\nreturn;\n}\n#endif\nfloat horizEdge = 0.0;\nfloat vertEdge = 0.0;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nfloat scale = scalars[i];\nhorizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\nhorizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\nvertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\nvertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n}\nfloat len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\ngl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n}\n",FilmicTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\nconst float A = 0.22;\nconst float B = 0.30;\nconst float C = 0.10;\nconst float D = 0.20;\nconst float E = 0.01;\nconst float F = 0.30;\nconst float white = 11.2;\nvec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\nfloat w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\nc = czm_inverseGamma(c / w);\ngl_FragColor = vec4(c, fragmentColor.a);\n}\n",FXAA="varying vec2 v_textureCoordinates;\nuniform sampler2D colorTexture;\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\nvoid main()\n{\nvec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;\nvec4 color = FxaaPixelShader(\nv_textureCoordinates,\ncolorTexture,\nfxaaQualityRcpFrame,\nfxaaQualitySubpix,\nfxaaQualityEdgeThreshold,\nfxaaQualityEdgeThresholdMin);\nfloat alpha = texture2D(colorTexture, v_textureCoordinates).a;\ngl_FragColor = vec4(color.rgb, alpha);\n}\n",GaussianBlur1D="#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D colorTexture;\n#ifdef USE_STEP_SIZE\nuniform float stepSize;\n#else\nuniform vec2 step;\n#endif\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\n#ifdef USE_STEP_SIZE\nvec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));\n#else\nvec2 step = step;\n#endif\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(colorTexture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * step;\nresult += texture2D(colorTexture, st - offset) * g.x;\nresult += texture2D(colorTexture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n",LensFlare="uniform sampler2D colorTexture;\nuniform sampler2D dirtTexture;\nuniform sampler2D starTexture;\nuniform vec2 dirtTextureDimensions;\nuniform float distortion;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform float dirtAmount;\nuniform float earthRadius;\nuniform float intensity;\nvarying vec2 v_textureCoordinates;\n#define DISTANCE_TO_SPACE 6500000.0\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\n{\nvec4 positionEC = czm_view * vec4(WC, 1.0);\npositionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nreturn czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n}\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\n{\nvec2 NDC = texcoord * 2.0 - 1.0;\nvec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\nvec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\nNDC.xy -= earthPosSC.xy;\nfloat X = abs(NDC.x) * sceneSize.x;\nfloat Y = abs(NDC.y) * sceneSize.y;\nreturn clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\n}\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\n{\nvec2 sceneSize = czm_viewport.zw;\nvec3 color;\nif(isSpace)\n{\ncolor.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture2D(tex, texcoord + direction * distortion.b).b;\n}\nelse\n{\ncolor.r = texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = texture2D(tex, texcoord + direction * distortion.b).b;\n}\nreturn vec4(clamp(color, 0.0, 1.0), 0.0);\n}\nvoid main(void)\n{\nvec4 originalColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 rgb = originalColor.rgb;\nbool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\nvec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\nvec4 sunPositionEC = czm_view * sunPos;\nvec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\nsunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\nif(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\n{\ngl_FragColor = originalColor;\nreturn;\n}\nvec2 texcoord = vec2(1.0) - v_textureCoordinates;\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\nvec2 invPixelSize = 1.0 / pixelSize;\nvec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);\nvec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\nvec3 direction = normalize(vec3(ghostVec, 0.0));\nvec4 result = vec4(0.0);\nvec4 ghost = vec4(0.0);\nfor (int i = 0; i < 4; ++i)\n{\nvec2 offset = fract(texcoord + ghostVec * float(i));\nghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\n}\nresult += ghost;\nvec2 haloVec = normalize(ghostVec) * haloWidth;\nfloat weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\nweightForHalo = pow(1.0 - weightForHalo, 5.0);\nresult += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\nvec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;\nif (dirtTexCoords.x > 1.0)\n{\ndirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);\n}\nif (dirtTexCoords.y > 1.0)\n{\ndirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);\n}\nresult += dirtAmount * texture2D(dirtTexture, dirtTexCoords);\nfloat camrot = czm_view[0].z + czm_view[1].y;\nfloat cosValue = cos(camrot);\nfloat sinValue = sin(camrot);\nmat3 rotation = mat3(\ncosValue, -sinValue, 0.0,\nsinValue, cosValue, 0.0,\n0.0, 0.0, 1.0\n);\nvec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\nvec3 st2 = vec3((rotation * st1).xy, 1.0);\nvec3 st3 = st2 * 0.5 + vec3(0.5);\nvec2 lensStarTexcoord = st3.xy;\nfloat weightForLensFlare = length(vec3(sunPos.xy, 0.0));\nfloat oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\nif (!isSpace)\n{\nresult *= oneMinusWeightForLensFlare * intensity * 0.2;\n}\nelse\n{\nresult *= oneMinusWeightForLensFlare * intensity;\nresult *= texture2D(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\n}\nresult += texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = result;\n}\n",ModifiedReinhardTonemapping="uniform sampler2D colorTexture;\nuniform vec3 white;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = (color * (1.0 + color / white)) / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",NightVision="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat rand(vec2 co)\n{\nreturn fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\nvoid main(void)\n{\nfloat noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 green = vec3(0.0, 1.0, 0.0);\ngl_FragColor = vec4((noiseValue + rgb) * green, 1.0);\n}\n",ReinhardTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = color / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",Silhouette="uniform sampler2D colorTexture;\nuniform sampler2D silhouetteTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\n}\n",FXAA3_11="#if (FXAA_QUALITY_PRESET == 10)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 3.0\n#define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 3.0\n#define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 4.0\n#define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 4.0\n#define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 4.0\n#define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 2.0\n#define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 3.0\n#define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n#define FXAA_QUALITY_PS 9\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 4.0\n#define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n#define FXAA_QUALITY_PS 10\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 4.0\n#define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n#define FXAA_QUALITY_PS 11\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 4.0\n#define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.0\n#define FXAA_QUALITY_P2 1.0\n#define FXAA_QUALITY_P3 1.0\n#define FXAA_QUALITY_P4 1.0\n#define FXAA_QUALITY_P5 1.5\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\nFxaaFloat4 FxaaPixelShader(\nFxaaFloat2 pos,\nFxaaTex tex,\nFxaaFloat2 fxaaQualityRcpFrame,\nFxaaFloat fxaaQualitySubpix,\nFxaaFloat fxaaQualityEdgeThreshold,\nFxaaFloat fxaaQualityEdgeThresholdMin\n) {\nFxaaFloat2 posM;\nposM.x = pos.x;\nposM.y = pos.y;\nFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n#define lumaM rgbyM.y\nFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat maxSM = max(lumaS, lumaM);\nFxaaFloat minSM = min(lumaS, lumaM);\nFxaaFloat maxESM = max(lumaE, maxSM);\nFxaaFloat minESM = min(lumaE, minSM);\nFxaaFloat maxWN = max(lumaN, lumaW);\nFxaaFloat minWN = min(lumaN, lumaW);\nFxaaFloat rangeMax = max(maxWN, maxESM);\nFxaaFloat rangeMin = min(minWN, minESM);\nFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\nFxaaFloat range = rangeMax - rangeMin;\nFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\nFxaaBool earlyExit = range < rangeMaxClamped;\nif(earlyExit)\nreturn rgbyM;\nFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNS = lumaN + lumaS;\nFxaaFloat lumaWE = lumaW + lumaE;\nFxaaFloat subpixRcpRange = 1.0/range;\nFxaaFloat subpixNSWE = lumaNS + lumaWE;\nFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\nFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\nFxaaFloat lumaNESE = lumaNE + lumaSE;\nFxaaFloat lumaNWNE = lumaNW + lumaNE;\nFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\nFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\nFxaaFloat lumaNWSW = lumaNW + lumaSW;\nFxaaFloat lumaSWSE = lumaSW + lumaSE;\nFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\nFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\nFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\nFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\nFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\nFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\nFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\nFxaaFloat lengthSign = fxaaQualityRcpFrame.x;\nFxaaBool horzSpan = edgeHorz >= edgeVert;\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\nif(!horzSpan) lumaN = lumaW;\nif(!horzSpan) lumaS = lumaE;\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\nFxaaFloat gradientN = lumaN - lumaM;\nFxaaFloat gradientS = lumaS - lumaM;\nFxaaFloat lumaNN = lumaN + lumaM;\nFxaaFloat lumaSS = lumaS + lumaM;\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\nif(pairN) lengthSign = -lengthSign;\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\nFxaaFloat2 posB;\nposB.x = posM.x;\nposB.y = posM.y;\nFxaaFloat2 offNP;\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\nif(!horzSpan) posB.x += lengthSign * 0.5;\nif( horzSpan) posB.y += lengthSign * 0.5;\nFxaaFloat2 posN;\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\nFxaaFloat2 posP;\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\nFxaaFloat subpixE = subpixC * subpixC;\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\nif(!pairN) lumaNN = lumaSS;\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\nFxaaFloat subpixF = subpixD * subpixE;\nFxaaBool lumaMLTZero = lumaMM < 0.0;\nlumaEndN -= lumaNN * 0.5;\nlumaEndP -= lumaNN * 0.5;\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\nFxaaBool doneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n#if (FXAA_QUALITY_PS > 3)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n#if (FXAA_QUALITY_PS > 4)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n#if (FXAA_QUALITY_PS > 5)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n#if (FXAA_QUALITY_PS > 6)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n#if (FXAA_QUALITY_PS > 7)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n#if (FXAA_QUALITY_PS > 8)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n#if (FXAA_QUALITY_PS > 9)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n#if (FXAA_QUALITY_PS > 10)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n#if (FXAA_QUALITY_PS > 11)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n#if (FXAA_QUALITY_PS > 12)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\nFxaaFloat dstN = posM.x - posN.x;\nFxaaFloat dstP = posP.x - posM.x;\nif(!horzSpan) dstN = posM.y - posN.y;\nif(!horzSpan) dstP = posP.y - posM.y;\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\nFxaaFloat spanLength = (dstP + dstN);\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\nFxaaFloat spanLengthRcp = 1.0/spanLength;\nFxaaBool directionN = dstN < dstP;\nFxaaFloat dst = min(dstN, dstP);\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\nFxaaFloat subpixG = subpixF * subpixF;\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n";function PostProcessStageComposite(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=defaultValue(e.inputPreviousStageTexture,!0);var t=e.name;defined(t)||(t=createGuid()),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}function isSelectedTextureDirty(e){var t=defined(e._selected)?e._selected.length:0,i=defined(e._parentSelected)?e._parentSelected:0,r=(r=e._selected!==e._selectedShadow||t!==e._selectedLength)||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength;if(defined(e._selected)&&defined(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):defined(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&defined(e._combinedSelected)){if(!defined(e._combinedSelectedShadow))return!0;for(var t=e._combinedSelected.length,n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}Object.defineProperties(PostProcessStageComposite.prototype,{ready:{get:function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)if(!e[i].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)t[r].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}}}),PostProcessStageComposite.prototype._isSupported=function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)if(!t[r]._isSupported(e))return!1;return!0},PostProcessStageComposite.prototype.get=function(e){return this._stages[e]},PostProcessStageComposite.prototype.update=function(e,t){this._selectedDirty=isSelectedTextureDirty(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=defined(this._selected)?this._selected.length:0,this._parentSelectedLength=defined(this._parentSelected)?this._parentSelected.length:0;for(var i=this._stages,r=i.length,n=0;n<r;++n){var a=i[n];this._selectedDirty&&(a.parentSelected=this._combinedSelected),a.update(e,t)}},PostProcessStageComposite.prototype.isDestroyed=function(){return!1},PostProcessStageComposite.prototype.destroy=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)};var PostProcessStageLibrary={};function createBlur(e){var t="#define USE_STEP_SIZE\n"+GaussianBlur1D,r=new PostProcessStage({name:e+"_x_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:PostProcessStageSampleMode.LINEAR}),n=new PostProcessStage({name:e+"_y_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:PostProcessStageSampleMode.LINEAR}),t={};return Object.defineProperties(t,{delta:{get:function(){return r.uniforms.delta},set:function(e){var t=r.uniforms,i=n.uniforms;t.delta=i.delta=e}},sigma:{get:function(){return r.uniforms.sigma},set:function(e){var t=r.uniforms,i=n.uniforms;t.sigma=i.sigma=e}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(e){var t=r.uniforms,i=n.uniforms;t.stepSize=i.stepSize=e}}}),new PostProcessStageComposite({name:e,stages:[r,n],uniforms:t})}function getSilhouetteEdgeDetection(e){if(!defined(e))return PostProcessStageLibrary.createEdgeDetectionStage();for(var t=new PostProcessStageComposite({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),i={},r="",n="",a=0;a<e.length;++a)r+="uniform sampler2D edgeTexture"+a+"; \n",n+=" vec4 edge"+a+" = texture2D(edgeTexture"+a+", v_textureCoordinates); \n if (edge"+a+".a > 0.0) \n { \n color = edge"+a+"; \n break; \n } \n",i["edgeTexture"+a]=e[a].name;return new PostProcessStageComposite({name:"czm_edge_detection_composite",stages:[t,new PostProcessStage({name:"czm_edge_detection_combine",fragmentShader:r+"varying vec2 v_textureCoordinates; \nvoid main() { \n vec4 color = vec4(0.0); \n for (int i = 0; i < "+e.length+"; i++) \n { \n"+n+" } \n gl_FragColor = color; \n} \n",uniforms:i})]})}PostProcessStageLibrary.createBlurStage=function(){return createBlur("czm_blur")},PostProcessStageLibrary.createDepthOfFieldStage=function(){var t=createBlur("czm_depth_of_field_blur"),i=new PostProcessStage({name:"czm_depth_of_field_composite",fragmentShader:DepthOfField,uniforms:{focalDistance:5,blurTexture:t.name}}),e={};return Object.defineProperties(e,{focalDistance:{get:function(){return i.uniforms.focalDistance},set:function(e){i.uniforms.focalDistance=e}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}}}),new PostProcessStageComposite({name:"czm_depth_of_field",stages:[t,i],inputPreviousStageTexture:!1,uniforms:e})},PostProcessStageLibrary.isDepthOfFieldSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createEdgeDetectionStage=function(){return new PostProcessStage({name:"czm_edge_detection_"+createGuid(),fragmentShader:EdgeDetection,uniforms:{length:.25,color:Color.clone(Color.BLACK)}})},PostProcessStageLibrary.isEdgeDetectionSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createSilhouetteStage=function(e){e=getSilhouetteEdgeDetection(e);return new PostProcessStageComposite({name:"czm_silhouette",stages:[e,new PostProcessStage({name:"czm_silhouette_color_edges",fragmentShader:Silhouette,uniforms:{silhouetteTexture:e.name}})],inputPreviousStageTexture:!1,uniforms:e.uniforms})},PostProcessStageLibrary.isSilhouetteSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createBloomStage=function(){var t=new PostProcessStage({name:"czm_bloom_contrast_bias",fragmentShader:ContrastBias,uniforms:{contrast:128,brightness:-.3}}),i=createBlur("czm_bloom_blur"),e=new PostProcessStageComposite({name:"czm_bloom_contrast_bias_blur",stages:[t,i]}),r=new PostProcessStage({name:"czm_bloom_generate_composite",fragmentShader:BloomComposite,uniforms:{glowOnly:!1,bloomTexture:e.name}}),n={};return Object.defineProperties(n,{glowOnly:{get:function(){return r.uniforms.glowOnly},set:function(e){r.uniforms.glowOnly=e}},contrast:{get:function(){return t.uniforms.contrast},set:function(e){t.uniforms.contrast=e}},brightness:{get:function(){return t.uniforms.brightness},set:function(e){t.uniforms.brightness=e}},delta:{get:function(){return i.uniforms.delta},set:function(e){i.uniforms.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){i.uniforms.sigma=e}},stepSize:{get:function(){return i.uniforms.stepSize},set:function(e){i.uniforms.stepSize=e}}}),new PostProcessStageComposite({name:"czm_bloom",stages:[e,r],inputPreviousStageTexture:!1,uniforms:n})},PostProcessStageLibrary.createAmbientOcclusionStage=function(){var t=new PostProcessStage({name:"czm_ambient_occlusion_generate",fragmentShader:AmbientOcclusionGenerate,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),i=createBlur("czm_ambient_occlusion_blur");i.uniforms.stepSize=.86;var e=new PostProcessStageComposite({name:"czm_ambient_occlusion_generate_blur",stages:[t,i]}),r=new PostProcessStage({name:"czm_ambient_occlusion_composite",fragmentShader:AmbientOcclusionModulate,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return t.uniforms.intensity},set:function(e){t.uniforms.intensity=e}},bias:{get:function(){return t.uniforms.bias},set:function(e){t.uniforms.bias=e}},lengthCap:{get:function(){return t.uniforms.lengthCap},set:function(e){t.uniforms.lengthCap=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}},frustumLength:{get:function(){return t.uniforms.frustumLength},set:function(e){t.uniforms.frustumLength=e}},randomTexture:{get:function(){return t.uniforms.randomTexture},set:function(e){t.uniforms.randomTexture=e}},delta:{get:function(){return i.uniforms.delta},set:function(e){i.uniforms.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){i.uniforms.sigma=e}},blurStepSize:{get:function(){return i.uniforms.stepSize},set:function(e){i.uniforms.stepSize=e}},ambientOcclusionOnly:{get:function(){return r.uniforms.ambientOcclusionOnly},set:function(e){r.uniforms.ambientOcclusionOnly=e}}}),new PostProcessStageComposite({name:"czm_ambient_occlusion",stages:[e,r],inputPreviousStageTexture:!1,uniforms:n})},PostProcessStageLibrary.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var fxaaFS="#define FXAA_QUALITY_PRESET 39 \n"+FXAA3_11+"\n"+FXAA;function PostProcessStageTextureCache(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function getLastStageName(e){for(;defined(e.length);)e=e.get(e.length-1);return e.name}function getStageDependencies(e,t,i,r,n){if(!r.enabled||!r._isSupported(t))return n;var a=i[r.name]={};defined(n)&&(a[getLastStageName(e.getStageByName(n))]=!0);var o=r.uniforms;if(defined(o))for(var s=Object.getOwnPropertyNames(o),l=s.length,c=0;c<l;++c){var u=o[s[c]];"string"!=typeof u||defined(u=e.getStageByName(u))&&(a[getLastStageName(u)]=!0)}return r.name}function getCompositeDependencies(e,t,i,r,n){if(defined(r.enabled)&&!r.enabled||defined(r._isSupported)&&!r._isSupported(t))return n;for(var a,o=n,s=!defined(r.inputPreviousStageTexture)||r.inputPreviousStageTexture,l=n,c=r.length,u=0;u<c;++u){var d=r.get(u),l=(defined(d.length)?getCompositeDependencies:getStageDependencies)(e,t,i,d,n);s&&(n=l)}if(s)for(a=1;a<c;++a)defined(i[h=getLastStageName(r.get(a))])||(i[h]={}),i[h][o]=!0;else for(a=1;a<c;++a)for(var h,p=i[h=getLastStageName(r.get(a))],m=0;m<a;++m)p[getLastStageName(r.get(m))]=!0;return l}function getDependencies(e,t){var i,r,n,a,o={};return defined(e.ambientOcclusion)?(a=e.ambientOcclusion,i=e.bloom,r=e._tonemapping,n=e.fxaa,a=getCompositeDependencies(e,t,o,a,void 0),a=getStageDependencies(e,t,o,r,a=getCompositeDependencies(e,t,o,i,a)),getStageDependencies(e,t,o,n,a=getCompositeDependencies(e,t,o,e,a))):getCompositeDependencies(e,t,o,e,void 0),o}function getFramebuffer(e,t,i){for(var r,n=e._collection.getStageByName(t),a=n._textureScale,o=n._forcePowerOfTwo,s=n._pixelFormat,l=n._pixelDatatype,c=n._clearColor,u=e._framebuffers,d=u.length,h=0;h<d;++h)if(a===(r=u[h]).textureScale&&o===r.forcePowerOfTwo&&s===r.pixelFormat&&l===r.pixelDatatype&&Color.equals(c,r.clearColor)){for(var p=r.stages,m=p.length,f=!1,g=0;g<m;++g)if(i[p[g]]){f=!0;break}if(!f)break}return defined(r)&&h<d?r.stages.push(t):u.push(r={textureScale:a,forcePowerOfTwo:o,pixelFormat:s,pixelDatatype:l,clearColor:c,stages:[t],buffer:void 0,clear:void 0}),r}function createFramebuffers(e,t){var i,r=getDependencies(e._collection,t);for(i in r)r.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=getFramebuffer(e,i,r[i]))}function releaseResources(e){for(var t=e._framebuffers,i=t.length,r=0;r<i;++r){var n=t[r];n.buffer=n.buffer&&n.buffer.destroy(),n.buffer=void 0}}function updateFramebuffers(e,t){for(var i=e._width,r=e._height,n=e._framebuffers,a=n.length,o=0;o<a;++o){var s=n[o],l=s.textureScale,c=Math.ceil(i*l),u=Math.ceil(r*l),l=Math.min(c,u);s.forcePowerOfTwo&&(u=c=l=!CesiumMath.isPowerOfTwo(l)?CesiumMath.nextPowerOfTwo(l):l),s.buffer=new Framebuffer({context:t,colorTextures:[new Texture({context:t,width:c,height:u,pixelFormat:s.pixelFormat,pixelDatatype:s.pixelDatatype})]}),s.clear=new ClearCommand({color:s.clearColor,framebuffer:s.buffer})}}PostProcessStageLibrary.createFXAAStage=function(){return new PostProcessStage({name:"czm_FXAA",fragmentShader:fxaaFS,sampleMode:PostProcessStageSampleMode.LINEAR})},PostProcessStageLibrary.createAcesTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_aces",fragmentShader:e+=AcesTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createFilmicTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_filmic",fragmentShader:e+=FilmicTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createReinhardTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_reinhard",fragmentShader:e+=ReinhardTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createModifiedReinhardTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_modified_reinhard",fragmentShader:e+=ModifiedReinhardTonemapping,uniforms:{white:Color.WHITE,autoExposure:void 0}})},PostProcessStageLibrary.createAutoExposureStage=function(){return new AutoExposure},PostProcessStageLibrary.createBlackAndWhiteStage=function(){return new PostProcessStage({name:"czm_black_and_white",fragmentShader:BlackAndWhite,uniforms:{gradations:5}})},PostProcessStageLibrary.createBrightnessStage=function(){return new PostProcessStage({name:"czm_brightness",fragmentShader:Brightness,uniforms:{brightness:.5}})},PostProcessStageLibrary.createNightVisionStage=function(){return new PostProcessStage({name:"czm_night_vision",fragmentShader:NightVision})},PostProcessStageLibrary.createDepthViewStage=function(){return new PostProcessStage({name:"czm_depth_view",fragmentShader:DepthView})},PostProcessStageLibrary.createLensFlareStage=function(){return new PostProcessStage({name:"czm_lens_flare",fragmentShader:LensFlare,uniforms:{dirtTexture:buildModuleUrl("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:buildModuleUrl("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:Ellipsoid.WGS84.maximumRadius}})},PostProcessStageTextureCache.prototype.updateDependencies=function(){this._updateDependencies=!0},PostProcessStageTextureCache.prototype.update=function(e){var t=this._collection,i=this._updateDependencies,r=defined(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),n=defined(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),a=defined(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),o=defined(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),n=!defined(t._activeStages)||0<t._activeStages.length||r||n||a||o;(i||!n&&0<this._framebuffers.length)&&(releaseResources(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),(i||n)&&(0===this._framebuffers.length&&createFramebuffers(this,e),a=e.drawingBufferWidth,o=e.drawingBufferHeight,n=this._width!==a||this._height!==o,(i||n)&&(this._width=a,this._height=o,this._updateDependencies=!1,releaseResources(this),updateFramebuffers(this,e)))},PostProcessStageTextureCache.prototype.clear=function(e){for(var t=this._framebuffers,i=0;i<t.length;++i)t[i].clear.execute(e)},PostProcessStageTextureCache.prototype.getStageByName=function(e){return this._collection.getStageByName(e)},PostProcessStageTextureCache.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)},PostProcessStageTextureCache.prototype.getFramebuffer=function(e){e=this._stageNameToFramebuffer[e];if(defined(e))return e.buffer},PostProcessStageTextureCache.prototype.isDestroyed=function(){return!1},PostProcessStageTextureCache.prototype.destroy=function(){return releaseResources(this),destroyObject(this)};var Tonemapper={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===Tonemapper.REINHARD||e===Tonemapper.MODIFIED_REINHARD||e===Tonemapper.FILMIC||e===Tonemapper.ACES}},Tonemapper$1=Object.freeze(Tonemapper),stackScratch=[];function PostProcessStageCollection(){var e=PostProcessStageLibrary.createFXAAStage(),t=PostProcessStageLibrary.createAmbientOcclusionStage(),i=PostProcessStageLibrary.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=PostProcessStageLibrary.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Tonemapper$1.ACES;var r=this._tonemapping;e.enabled=!1,t.enabled=!1,i.enabled=!1,r.enabled=!1;var n=new PostProcessStageTextureCache(this),a={},o=stackScratch;for(o.push(e,t,i,r);0<o.length;){var s=o.pop();(a[s.name]=s)._textureCache=n;var l=s.length;if(defined(l))for(var c=0;c<l;++c)o.push(s.get(c))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;var u=this;t.uniforms.randomTexture=function(){return u._randomTexture},this._ao=t,this._bloom=i,this._fxaa=e,this._lastLength=void 0,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=a,this._textureCache=n}function removeStages(e){if(e._stagesRemoved){e._stagesRemoved=!1;for(var t=[],i=e._stages,r=i.length,n=0,a=0;n<r;++n){var o=i[n];o&&(o._index=a++,t.push(o))}e._stages=t}}function getOutputTexture(e){for(;defined(e.length);)e=e.get(e.length-1);return e.outputTexture}function execute(e,t,i,r,n){if(defined(e.execute))e.execute(t,i,r,n);else{var a,o=e.length;if(e.inputPreviousStageTexture)for(execute(e.get(0),t,i,r,n),a=1;a<o;++a)execute(e.get(a),t,getOutputTexture(e.get(a-1)),r,n);else for(a=0;a<o;++a)execute(e.get(a),t,i,r,n)}}function QuadtreeTileProvider(){DeveloperError.throwInstantiationError()}function SceneTransitioner(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Object.defineProperties(PostProcessStageCollection.prototype,{ready:{get:function(){for(var e=!1,t=this._stages,i=t.length-1;0<=i;--i)var r=t[i],e=e||r.ready&&r.enabled;var n=this._fxaa,a=this._ao,o=this._bloom,s=this._tonemapping;return e=(e=(e=(e=e||n.ready&&n.enabled)||a.ready&&a.enabled)||o.ready&&o.enabled)||s.ready&&s.enabled}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return removeStages(this),this._stages.length}},outputTexture:{get:function(){var e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);for(var t=this._stages,i=t.length-1;0<=i;--i){var r=t[i];if(defined(r)&&r.ready&&r.enabled)return this.getOutputTexture(r.name)}e=this._tonemapping;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);e=this._bloom;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);e=this._ao;return e.enabled&&e.ready?this.getOutputTexture(e.name):void 0}},hasSelected:{get:function(){for(var e=arraySlice(this._stages);0<e.length;){var t=e.pop();if(defined(t)){if(defined(t.selected))return!0;var i=t.length;if(defined(i))for(var r=0;r<i;++r)e.push(t.get(r))}}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper!==e){defined(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());var t,i,r=this._autoExposureEnabled;switch(e){case Tonemapper$1.REINHARD:t=PostProcessStageLibrary.createReinhardTonemappingStage(r);break;case Tonemapper$1.MODIFIED_REINHARD:t=PostProcessStageLibrary.createModifiedReinhardTonemappingStage(r);break;case Tonemapper$1.FILMIC:t=PostProcessStageLibrary.createFilmicTonemappingStage(r);break;default:t=PostProcessStageLibrary.createAcesTonemappingStage(r)}r&&(i=this._autoExposure,t.uniforms.autoExposure=function(){return i.outputTexture}),this._tonemapper=e,this._tonemapping=t,defined(this._stageNames)&&((this._stageNames[t.name]=t)._textureCache=this._textureCache),this._textureCacheDirty=!0}}}}),PostProcessStageCollection.prototype.add=function(e){var t=this._stageNames,i=stackScratch;for(i.push(e);0<i.length;){var r=i.pop();(t[r.name]=r)._textureCache=this._textureCache;var n=r.length;if(defined(n))for(var a=0;a<n;++a)i.push(r.get(a))}var o=this._stages;return e._index=o.length,o.push(e),this._textureCacheDirty=!0,e},PostProcessStageCollection.prototype.remove=function(e){if(!this.contains(e))return!1;var t=this._stageNames,i=stackScratch;for(i.push(e);0<i.length;){var r=i.pop();delete t[r.name];var n=r.length;if(defined(n))for(var a=0;a<n;++a)i.push(r.get(a))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0},PostProcessStageCollection.prototype.contains=function(e){return defined(e)&&defined(e._index)&&e._textureCache===this._textureCache},PostProcessStageCollection.prototype.get=function(e){return removeStages(this),this._stages[e]},PostProcessStageCollection.prototype.removeAll=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)this.remove(e[i]);e.length=0},PostProcessStageCollection.prototype.getStageByName=function(e){return this._stageNames[e]},PostProcessStageCollection.prototype.update=function(e,t,i){removeStages(this);var r=this._activeStages,n=this._activeStages=this._previousActiveStages;this._previousActiveStages=r;var a,o=this._stages,s=n.length=o.length,l=0;for(C=0;C<s;++C)(a=o[C]).ready&&a.enabled&&a._isSupported(e)&&(n[l++]=a);var c=(n.length=l)!==r.length;if(!c)for(C=0;C<l;++C)if(n[C]!==r[C]){c=!0;break}var u=this._ao,d=this._bloom,h=this._autoExposure,p=this._tonemapping,m=this._fxaa;p.enabled=i;var f=u.enabled&&u._isSupported(e),g=d.enabled&&d._isSupported(e),_=p.enabled&&p._isSupported(e),i=m.enabled&&m._isSupported(e);if((c||this._textureCacheDirty||l!==this._lastLength||f!==this._aoEnabled||g!==this._bloomEnabled||_!==this._tonemappingEnabled||i!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._lastLength=l,this._aoEnabled=f,this._bloomEnabled=g,this._tonemappingEnabled=_,this._fxaaEnabled=i,this._textureCacheDirty=!1),defined(this._randomTexture)&&!f&&(this._randomTexture.destroy(),this._randomTexture=void 0),!defined(this._randomTexture)&&f){for(var s=196608,y=new Uint8Array(s),C=0;C<s;C+=3)y[C]=Math.floor(255*Math.random());this._randomTexture=new Texture({context:e,pixelFormat:PixelFormat$1.RGB,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:y,width:256,height:256},sampler:new Sampler({wrapS:TextureWrap$1.REPEAT,wrapT:TextureWrap$1.REPEAT,minificationFilter:TextureMinificationFilter$1.NEAREST,magnificationFilter:TextureMagnificationFilter$1.NEAREST})})}for(this._textureCache.update(e),m.update(e,t),u.update(e,t),d.update(e,t),p.update(e,t),this._autoExposureEnabled&&h.update(e,t),s=o.length,C=0;C<s;++C)o[C].update(e,t)},PostProcessStageCollection.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)},PostProcessStageCollection.prototype.getOutputTexture=function(e){e=this.getStageByName(e);if(defined(e))return getOutputTexture(e)},PostProcessStageCollection.prototype.execute=function(e,t,i,r){var n=this._activeStages,a=n.length,o=this._fxaa,s=this._ao,l=this._bloom,c=this._autoExposure,u=this._tonemapping,d=s.enabled&&s._isSupported(e),h=l.enabled&&l._isSupported(e),p=this._autoExposureEnabled,m=u.enabled&&u._isSupported(e),f=o.enabled&&o._isSupported(e);if(f||d||h||m||0!==a){t=t;d&&s.ready&&(execute(s,e,t,i,r),t=getOutputTexture(s)),h&&l.ready&&(execute(l,e,t,i,r),t=getOutputTexture(l)),p&&c.ready&&execute(c,e,t,i,r),m&&u.ready&&(execute(u,e,t,i,r),t=getOutputTexture(u));u=t;if(0<a){execute(n[0],e,t,i,r);for(var g=1;g<a;++g)execute(n[g],e,getOutputTexture(n[g-1]),i,r);u=getOutputTexture(n[a-1])}f&&o.ready&&execute(o,e,u,i,r)}},PostProcessStageCollection.prototype.copy=function(e,t){var i;defined(this._copyColorCommand)||((i=this)._copyColorCommand=e.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return i.outputTexture}},owner:this})),this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},PostProcessStageCollection.prototype.isDestroyed=function(){return!1},PostProcessStageCollection.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(),destroyObject(this)},QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},Object.defineProperties(QuadtreeTileProvider.prototype,{quadtree:{get:DeveloperError.throwInstantiationError,set:DeveloperError.throwInstantiationError},ready:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError}}),QuadtreeTileProvider.prototype.update=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.beginUpdate=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.endUpdate=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.getLevelMaximumGeometricError=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.loadTile=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.computeTileVisibility=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.showTileThisFrame=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.computeDistanceToTile=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.isDestroyed=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.destroy=DeveloperError.throwInstantiationError,SceneTransitioner.prototype.completeMorph=function(){defined(this._completeMorph)&&this._completeMorph()},SceneTransitioner.prototype.morphTo2D=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._morphToOrthographic=i.camera.frustum instanceof OrthographicFrustum,this._previousMode!==SceneMode$1.SCENE2D&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.SCENE2D,!0),i._mode=SceneMode$1.MORPHING,i.camera._setTransform(Matrix4.IDENTITY),this._previousMode===SceneMode$1.COLUMBUS_VIEW?morphFromColumbusViewTo2D(this,e):morphFrom3DTo2D(this,e,t),0===e&&defined(this._completeMorph)&&this._completeMorph())};var scratchToCVPosition=new Cartesian3,scratchToCVDirection=new Cartesian3,scratchToCVUp=new Cartesian3,scratchToCVPosition2D=new Cartesian3,scratchToCVDirection2D=new Cartesian3,scratchToCVUp2D=new Cartesian3,scratchToCVSurfacePosition=new Cartesian3,scratchToCVCartographic=new Cartographic,scratchToCVToENU=new Matrix4,scratchToCVFrustumPerspective=new PerspectiveFrustum,scratchToCVFrustumOrthographic=new OrthographicFrustum,scratchToCVCamera={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};SceneTransitioner.prototype.morphToColumbusView=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i,r,n,a,o,s,l=this._scene;this._previousMode=l.mode,this._previousMode!==SceneMode$1.COLUMBUS_VIEW&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.COLUMBUS_VIEW,!0),l.camera._setTransform(Matrix4.IDENTITY),i=scratchToCVPosition,r=scratchToCVDirection,n=scratchToCVUp,0<e?(i.x=0,i.y=-1,i.z=1,i=Cartesian3.multiplyByScalar(Cartesian3.normalize(i,i),5*t.maximumRadius,i),Cartesian3.negate(Cartesian3.normalize(i,r),r),Cartesian3.cross(Cartesian3.UNIT_X,r,n)):(a=l.camera,this._previousMode===SceneMode$1.SCENE2D?(Cartesian3.clone(a.position,i),i.z=a.frustum.right-a.frustum.left,Cartesian3.negate(Cartesian3.UNIT_Z,r),Cartesian3.clone(Cartesian3.UNIT_Y,n)):(Cartesian3.clone(a.positionWC,i),Cartesian3.clone(a.directionWC,r),Cartesian3.clone(a.upWC,n),o=t.scaleToGeodeticSurface(i,scratchToCVSurfacePosition),o=Transforms.eastNorthUpToFixedFrame(o,t,scratchToCVToENU),Matrix4.inverseTransformation(o,o),l.mapProjection.project(t.cartesianToCartographic(i,scratchToCVCartographic),i),Matrix4.multiplyByPointAsVector(o,r,r),Matrix4.multiplyByPointAsVector(o,n,n))),this._morphToOrthographic?((s=scratchToCVFrustumOrthographic).width=l.camera.frustum.right-l.camera.frustum.left,s.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight):((s=scratchToCVFrustumPerspective).aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,s.fov=CesiumMath.toRadians(60)),(o=scratchToCVCamera).position=i,o.direction=r,o.up=n,o.frustum=s,createMorphHandler(this,s=completeColumbusViewCallback(o)),this._previousMode===SceneMode$1.SCENE2D?morphFrom2DToColumbusView(this,e,o,s):(o.position2D=Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,i,scratchToCVPosition2D),o.direction2D=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,r,scratchToCVDirection2D),o.up2D=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,n,scratchToCVUp2D),l._mode=SceneMode$1.MORPHING,morphFrom3DToColumbusView(this,e,o,s)),0===e&&defined(this._completeMorph)&&this._completeMorph())};var scratchCVTo3DCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,frustum:void 0},scratch2DTo3DFrustumPersp=new PerspectiveFrustum;function createMorphHandler(e,t){var i;e._scene.completeMorphOnUserInput&&(e._morphHandler=new ScreenSpaceEventHandler(e._scene.canvas),i=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)},e._completeMorph=i,e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.LEFT_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.MIDDLE_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.RIGHT_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.WHEEL))}function destroyMorphHandler(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}SceneTransitioner.prototype.morphTo3D=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i,r,n=this._scene;this._previousMode=n.mode,this._previousMode!==SceneMode$1.SCENE3D&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.SCENE3D,!0),n._mode=SceneMode$1.MORPHING,n.camera._setTransform(Matrix4.IDENTITY),this._previousMode===SceneMode$1.SCENE2D?morphFrom2DTo3D(this,e,t):(0<e?(Cartesian3.fromDegrees(0,0,5*t.maximumRadius,t,(i=scratchCVTo3DCamera).position),Cartesian3.negate(i.position,i.direction),Cartesian3.normalize(i.direction,i.direction),Cartesian3.clone(Cartesian3.UNIT_Z,i.up)):i=getColumbusViewTo3DCamera(this,t),(t=n.camera).frustum instanceof OrthographicFrustum?r=t.frustum.clone():((r=scratch2DTo3DFrustumPersp).aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=CesiumMath.toRadians(60)),i.frustum=r,createMorphHandler(this,r=complete3DCallback(i)),morphFromColumbusViewTo3D(this,e,i,r)),0===e&&defined(this._completeMorph)&&this._completeMorph())},SceneTransitioner.prototype.isDestroyed=function(){return!1},SceneTransitioner.prototype.destroy=function(){return destroyMorphHandler(this),destroyObject(this)};var scratchCVTo3DCartographic=new Cartographic,scratchCVTo3DSurfacePoint=new Cartesian3,scratchCVTo3DFromENU=new Matrix4;function getColumbusViewTo3DCamera(e,t){var i=e._scene,r=i.camera,n=scratchCVTo3DCamera,a=n.position,o=n.direction,e=n.up,i=i.mapProjection.unproject(r.position,scratchCVTo3DCartographic);t.cartographicToCartesian(i,a);a=t.scaleToGeodeticSurface(a,scratchCVTo3DSurfacePoint),t=Transforms.eastNorthUpToFixedFrame(a,t,scratchCVTo3DFromENU);return Matrix4.multiplyByPointAsVector(t,r.direction,o),Matrix4.multiplyByPointAsVector(t,r.up,e),n}var scratchCVTo3DStartPos=new Cartesian3,scratchCVTo3DStartDir=new Cartesian3,scratchCVTo3DStartUp=new Cartesian3,scratchCVTo3DEndPos=new Cartesian3,scratchCVTo3DEndDir=new Cartesian3,scratchCVTo3DEndUp=new Cartesian3;function morphFromColumbusViewTo3D(e,t,i,r){t*=.5;var n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratchCVTo3DStartPos),s=Cartesian3.clone(a.direction,scratchCVTo3DStartDir),l=Cartesian3.clone(a.up,scratchCVTo3DStartUp),c=Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,i.position,scratchCVTo3DEndPos),u=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D_INVERSE,i.direction,scratchCVTo3DEndDir),d=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D_INVERSE,i.up,scratchCVTo3DEndUp);i=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,c,e.time,a.position),columbusViewMorph(s,u,e.time,a.direction),columbusViewMorph(l,d,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right)},complete:function(){addMorphTimeAnimations(e,n,0,1,t,r)}});e._currentTweens.push(i)}var scratch2DTo3DFrustumOrtho=new OrthographicFrustum,scratch3DToCVStartPos=new Cartesian3,scratch3DToCVStartDir=new Cartesian3,scratch3DToCVStartUp=new Cartesian3,scratch3DToCVEndPos=new Cartesian3,scratch3DToCVEndDir=new Cartesian3,scratch3DToCVEndUp=new Cartesian3;function morphFrom2DTo3D(e,t,i){var r,n,a=e._scene,o=a.camera;0<(t/=3)?(Cartesian3.fromDegrees(0,0,5*i.maximumRadius,i,(r=scratchCVTo3DCamera).position),Cartesian3.negate(r.position,r.direction),Cartesian3.normalize(r.direction,r.direction),Cartesian3.clone(Cartesian3.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=getColumbusViewTo3DCamera(e,i)),e._morphToOrthographic?((n=scratch2DTo3DFrustumOrtho).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,n.width=o.frustum.right-o.frustum.left):((n=scratch2DTo3DFrustumPersp).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,n.fov=CesiumMath.toRadians(60)),r.frustum=n;var s,l=complete3DCallback(r);createMorphHandler(e,l),s=e._morphToOrthographic?function(){morphFromColumbusViewTo3D(e,t,r,l)}:function(){morphOrthographicToPerspective(e,t,r,function(){morphFromColumbusViewTo3D(e,t,r,l)})},0<t?(a._mode=SceneMode$1.SCENE2D,o.flyTo({duration:t,destination:Cartesian3.fromDegrees(0,0,5*i.maximumRadius,i,scratch3DToCVEndPos),complete:function(){a._mode=SceneMode$1.MORPHING,s()}})):s()}function columbusViewMorph(e,t,i,r){return Cartesian3.lerp(e,t,i,r)}function morphPerspectiveToOrthographic(e,t,i,r,n){var a,o,s,l=e._scene,c=l.camera;c.frustum instanceof OrthographicFrustum||(a=c.frustum.fov,o=.5*CesiumMath.RADIANS_PER_DEGREE,s=i.position.z*Math.tan(.5*a),c.frustum.far=s/Math.tan(.5*o)+1e7,t=l.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){c.frustum.fov=CesiumMath.lerp(a,o,e.time),e=s/Math.tan(.5*c.frustum.fov),r(c,e)},complete:function(){c.frustum=i.frustum.clone(),n(e)}}),e._currentTweens.push(t))}var scratchCVTo2DStartPos=new Cartesian3,scratchCVTo2DStartDir=new Cartesian3,scratchCVTo2DStartUp=new Cartesian3,scratchCVTo2DEndPos=new Cartesian3,scratchCVTo2DEndDir=new Cartesian3,scratchCVTo2DEndUp=new Cartesian3,scratchCVTo2DFrustum=new OrthographicOffCenterFrustum,scratchCVTo2DRay=new Ray,scratchCVTo2DPickPos=new Cartesian3,scratchCVTo2DCamera={position:void 0,direction:void 0,up:void 0,frustum:void 0};function morphFromColumbusViewTo2D(e,t){t*=.5;var i,r,n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratchCVTo2DStartPos),s=Cartesian3.clone(a.direction,scratchCVTo2DStartDir),l=Cartesian3.clone(a.up,scratchCVTo2DStartUp),c=Cartesian3.negate(Cartesian3.UNIT_Z,scratchCVTo2DEndDir),u=Cartesian3.clone(Cartesian3.UNIT_Y,scratchCVTo2DEndUp),d=scratchCVTo2DEndPos;0<t?(Cartesian3.clone(Cartesian3.ZERO,scratchCVTo2DEndPos),d.z=5*n.mapProjection.ellipsoid.maximumRadius):(Cartesian3.clone(o,scratchCVTo2DEndPos),Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,o,(i=scratchCVTo2DRay).origin),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s,i.direction),!defined(r=n.globe)||defined(h=r.pickWorldCoordinates(i,n,!0,scratchCVTo2DPickPos))&&(Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,h,d),d.z+=Cartesian3.distance(o,d)));var h=scratchCVTo2DFrustum;h.right=.5*d.z,h.left=-h.right,h.top=h.right*(n.drawingBufferHeight/n.drawingBufferWidth),h.bottom=-h.top;var p=scratchCVTo2DCamera;p.position=d,p.direction=c,p.up=u,p.frustum=h;var m=complete2DCallback(p);function f(e,t){e.position.z=t}createMorphHandler(e,m);n=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,d,e.time,a.position),columbusViewMorph(s,c,e.time,a.direction),columbusViewMorph(l,u,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right),a._adjustOrthographicFrustum(!0)},complete:function(){morphPerspectiveToOrthographic(e,t,p,f,m)}});e._currentTweens.push(n)}var scratch3DTo2DCartographic=new Cartographic,scratch3DTo2DCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,position2D:new Cartesian3,direction2D:new Cartesian3,up2D:new Cartesian3,frustum:new OrthographicOffCenterFrustum},scratch3DTo2DEndCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,frustum:void 0},scratch3DTo2DPickPosition=new Cartesian3,scratch3DTo2DRay=new Ray,scratch3DTo2DToENU=new Matrix4,scratch3DTo2DSurfacePoint=new Cartesian3;function morphFrom3DTo2D(e,t,i){var r,n,a=e._scene,o=a.camera,s=scratch3DTo2DCamera;function l(e,t){e.position.x=t}0<(t*=.5)?(Cartesian3.clone(Cartesian3.ZERO,s.position),s.position.z=5*i.maximumRadius,Cartesian3.negate(Cartesian3.UNIT_Z,s.direction),Cartesian3.clone(Cartesian3.UNIT_Y,s.up)):(i.cartesianToCartographic(o.positionWC,scratch3DTo2DCartographic),a.mapProjection.project(scratch3DTo2DCartographic,s.position),Cartesian3.negate(Cartesian3.UNIT_Z,s.direction),Cartesian3.clone(Cartesian3.UNIT_Y,s.up),Cartesian3.clone(s.position2D,(n=scratch3DTo2DRay).origin),r=Cartesian3.clone(o.directionWC,n.direction),o=i.scaleToGeodeticSurface(o.positionWC,scratch3DTo2DSurfacePoint),i=Transforms.eastNorthUpToFixedFrame(o,i,scratch3DTo2DToENU),Matrix4.inverseTransformation(i,i),Matrix4.multiplyByPointAsVector(i,r,r),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,r,r),!defined(r=a.globe)||defined(c=r.pickWorldCoordinates(n,a,!0,scratch3DTo2DPickPosition))&&(n=Cartesian3.distance(s.position2D,c),c.x+=n,Cartesian3.clone(c,s.position2D))),Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,s.position,s.position2D),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s.direction,s.direction2D),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s.up,s.up2D);var c=s.frustum;c.right=.5*s.position.z,c.left=-c.right,c.top=c.right*(a.drawingBufferHeight/a.drawingBufferWidth),c.bottom=-c.top;a=scratch3DTo2DEndCamera;Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,s.position2D,a.position),Cartesian3.clone(s.direction,a.direction),Cartesian3.clone(s.up,a.up),a.frustum=c;var u=complete2DCallback(a);createMorphHandler(e,u),morphFrom3DToColumbusView(e,t,s,function(){morphPerspectiveToOrthographic(e,t,s,l,u)})}function morphOrthographicToPerspective(e,t,i,r){var n=e._scene,a=n.camera,o=a.frustum.right-a.frustum.left;a.frustum=i.frustum.clone();var s=a.frustum.fov,l=.5*CesiumMath.RADIANS_PER_DEGREE,c=o*Math.tan(.5*s);a.frustum.far=c/Math.tan(.5*l)+1e7,a.frustum.fov=l;t=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){a.frustum.fov=CesiumMath.lerp(l,s,e.time),a.position.z=c/Math.tan(.5*a.frustum.fov)},complete:function(){r(e)}});e._currentTweens.push(t)}function morphFrom2DToColumbusView(n,a,o,s){a*=.5;var l=n._scene,c=l.camera,u=Cartesian3.clone(o.position,scratch3DToCVEndPos),d=Cartesian3.clone(o.direction,scratch3DToCVEndDir),h=Cartesian3.clone(o.up,scratch3DToCVEndUp);function e(){c.frustum=o.frustum.clone();var t=Cartesian3.clone(c.position,scratch3DToCVStartPos),i=Cartesian3.clone(c.direction,scratch3DToCVStartDir),r=Cartesian3.clone(c.up,scratch3DToCVStartUp);t.z=u.z;var e=l.tweens.add({duration:a,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(t,u,e.time,c.position),columbusViewMorph(i,d,e.time,c.direction),columbusViewMorph(r,h,e.time,c.up),Cartesian3.cross(c.direction,c.up,c.right),Cartesian3.normalize(c.right,c.right)},complete:function(){s(n)}});n._currentTweens.push(e)}l._mode=SceneMode$1.MORPHING,n._morphToOrthographic?e():morphOrthographicToPerspective(n,0,o,e)}function morphFrom3DToColumbusView(e,t,i,r){var n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratch3DToCVStartPos),s=Cartesian3.clone(a.direction,scratch3DToCVStartDir),l=Cartesian3.clone(a.up,scratch3DToCVStartUp),c=Cartesian3.clone(i.position2D,scratch3DToCVEndPos),u=Cartesian3.clone(i.direction2D,scratch3DToCVEndDir),d=Cartesian3.clone(i.up2D,scratch3DToCVEndUp);i=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,c,e.time,a.position),columbusViewMorph(s,u,e.time,a.direction),columbusViewMorph(l,d,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right),a._adjustOrthographicFrustum(!0)},complete:function(){addMorphTimeAnimations(e,n,1,0,t,r)}});e._currentTweens.push(i)}function addMorphTimeAnimations(e,t,i,r,n,a){n={object:t,property:"morphTime",startValue:i,stopValue:r,duration:n,easingFunction:EasingFunction$1.QUARTIC_OUT};defined(a)&&(n.complete=function(){a(e)});n=t.tweens.addProperty(n);e._currentTweens.push(n)}function complete3DCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.SCENE3D,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE3D),destroyMorphHandler(e);var i=t.camera;e._previousMode===SceneMode$1.MORPHING&&!e._morphCancelled||(e._morphCancelled=!1,Cartesian3.clone(r.position,i.position),Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right),i.frustum=r.frustum.clone());i=i.frustum;t.frameState.useLogDepth&&(i.near=.1,i.far=1e10);i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.SCENE3D,i)}}function complete2DCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.SCENE2D,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE2D),destroyMorphHandler(e);var i=t.camera;Cartesian3.clone(r.position,i.position),i.position.z=2*t.mapProjection.ellipsoid.maximumRadius,Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right),i.frustum=r.frustum.clone();i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.SCENE2D,i)}}function completeColumbusViewCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.COLUMBUS_VIEW,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.COLUMBUS_VIEW),destroyMorphHandler(e);var i=t.camera;e._previousModeMode===SceneMode$1.MORPHING&&!e._morphCancelled||(e._morphCancelled=!1,Cartesian3.clone(r.position,i.position),Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right));i=i.frustum;t.frameState.useLogDepth&&(i.near=.1,i.far=1e10);i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.COLUMBUS_VIEW,i)}}function Tween(e,t,i,r,n,a,o,s,l,c){this._tweens=e,this._tweenjs=t,this._startObject=clone$1(i),this._stopObject=clone$1(r),this._duration=n,this._delay=a,this._easingFunction=o,this._update=s,this._complete=l,this.cancel=c,this.needsStart=!0}function TweenCollection(){this._tweens=[]}function ScreenSpaceCameraController(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.translateEventTypes=CameraEventType$1.LEFT_DRAG,this.zoomEventTypes=[CameraEventType$1.RIGHT_DRAG,CameraEventType$1.WHEEL,CameraEventType$1.PINCH],this.rotateEventTypes=CameraEventType$1.LEFT_DRAG,this.tiltEventTypes=[CameraEventType$1.MIDDLE_DRAG,CameraEventType$1.PINCH,{eventType:CameraEventType$1.LEFT_DRAG,modifier:KeyboardEventModifier$1.CTRL},{eventType:CameraEventType$1.RIGHT_DRAG,modifier:KeyboardEventModifier$1.CTRL}],this.lookEventTypes={eventType:CameraEventType$1.LEFT_DRAG,modifier:KeyboardEventModifier$1.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new CameraEventAggregator(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 TweenCollection,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new Cartesian2(-1,-1),this._tiltCenter=new Cartesian3,this._rotateMousePosition=new Cartesian2(-1,-1),this._rotateStartPosition=new Cartesian3,this._strafeStartPosition=new Cartesian3,this._strafeMousePosition=new Cartesian2,this._strafeEndMousePosition=new Cartesian2,this._zoomMouseStart=new Cartesian2(-1,-1),this._zoomWorldPosition=new Cartesian3,this._useZoomWorldPosition=!1,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;e=e.mapProjection;this._maxCoord=e.project(new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function decay(e,t){return e<0?0:Math.exp(-(25*(1-t))*e)}function sameMousePosition(e){return Cartesian2.equalsEpsilon(e.startPosition,e.endPosition,CesiumMath.EPSILON14)}Object.defineProperties(Tween.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}}}),Tween.prototype.cancelTween=function(){this._tweens.remove(this)},Object.defineProperties(TweenCollection.prototype,{length:{get:function(){return this._tweens.length}}}),TweenCollection.prototype.add=function(e){if(0===(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).duration)return defined(e.complete)&&e.complete(),new Tween(this);var t=e.duration/TimeConstants$1.SECONDS_PER_MILLISECOND,i=defaultValue(e.delay,0),r=i/TimeConstants$1.SECONDS_PER_MILLISECOND,n=defaultValue(e.easingFunction,EasingFunction$1.LINEAR_NONE),a=e.startObject,o=new TWEEN.Tween(a);o.to(clone$1(e.stopObject),t),o.delay(r),o.easing(n),defined(e.update)&&o.onUpdate(function(){e.update(a)}),o.onComplete(defaultValue(e.complete,null)),o.repeat(defaultValue(e._repeat,0));n=new Tween(this,o,e.startObject,e.stopObject,e.duration,i,n,e.update,e.complete,e.cancel);return this._tweens.push(n),n},TweenCollection.prototype.addProperty=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).object,i=e.property,r=e.startValue,n=e.stopValue;return this.add({startObject:{value:r},stopObject:{value:n},duration:defaultValue(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){t[i]=e.value},complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},TweenCollection.prototype.addAlpha=function(e){var t,r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).material,n=[];for(t in r.uniforms)r.uniforms.hasOwnProperty(t)&&defined(r.uniforms[t])&&defined(r.uniforms[t].alpha)&&n.push(t);return this.add({startObject:{alpha:defaultValue(e.startValue,0)},stopObject:{alpha:defaultValue(e.stopValue,1)},duration:defaultValue(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){for(var t=n.length,i=0;i<t;++i)r.uniforms[n[i]].alpha=e.alpha},complete:e.complete,cancel:e.cancel})},TweenCollection.prototype.addOffsetIncrement=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).material.uniforms;return this.addProperty({object:t,property:"offset",startValue:t.offset,stopValue:t.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},TweenCollection.prototype.remove=function(e){if(!defined(e))return!1;var t=this._tweens.indexOf(e);return-1!==t&&(e.tweenjs.stop(),defined(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},TweenCollection.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var i=e[t];i.tweenjs.stop(),defined(i.cancel)&&i.cancel()}e.length=0},TweenCollection.prototype.contains=function(e){return defined(e)&&-1!==this._tweens.indexOf(e)},TweenCollection.prototype.get=function(e){return this._tweens[e]},TweenCollection.prototype.update=function(e){var t=this._tweens,i=0;for(e=defined(e)?e/TimeConstants$1.SECONDS_PER_MILLISECOND:getTimestamp$1();i<t.length;){var r=t[i],n=r.tweenjs;r.needsStart?(r.needsStart=!1,n.start(e)):n.update(e)?i++:(n.stop(),t.splice(i,1))}};var inertiaMaxClickTimeThreshold=.4;function maintainInertia(e,t,i,r,n,a,o){var s=a[o];defined(s)||(s=a[o]={startPosition:new Cartesian2,endPosition:new Cartesian2,motion:new Cartesian2,inertiaEnabled:!0});var l=e.getButtonPressTime(t,i),c=e.getButtonReleaseTime(t,i),u=l&&c&&(c.getTime()-l.getTime())/1e3,o=new Date,o=c&&(o.getTime()-c.getTime())/1e3;l&&c&&u<inertiaMaxClickTimeThreshold&&(o=decay(o,r),defined(r=e.getLastMovement(t,i))&&!sameMousePosition(r)&&s.inertiaEnabled&&(s.motion.x=.5*(r.endPosition.x-r.startPosition.x),s.motion.y=.5*(r.endPosition.y-r.startPosition.y),s.startPosition=Cartesian2.clone(r.startPosition,s.startPosition),s.endPosition=Cartesian2.multiplyByScalar(s.motion,o,s.endPosition),s.endPosition=Cartesian2.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||Cartesian2.distance(s.startPosition,s.endPosition)<.5||e.isButtonDown(t,i)||n(a,e.getStartMousePosition(t,i),s)))}function activateInertia(e,t){if(defined(t)){var i=e[t];defined(i)&&(i.inertiaEnabled=!0);var r=e._inertiaDisablers[t];if(defined(r))for(var n=r.length,a=0;a<n;++a)defined(i=e[r[a]])&&(i.inertiaEnabled=!1)}}var scratchEventTypeArray=[];function reactToInput(e,t,i,r,n,a){if(defined(i)){var o=e._aggregator;Array.isArray(i)||(scratchEventTypeArray[0]=i,i=scratchEventTypeArray);for(var s=i.length,l=0;l<s;++l){var c=i[l],u=defined(c.eventType)?c.eventType:c,d=c.modifier,h=o.isMoving(u,d)&&o.getMovement(u,d),c=o.getStartMousePosition(u,d);e.enableInputs&&t&&(h?(r(e,c,h),activateInertia(e,a)):n<1&&maintainInertia(o,u,d,n,r,e,a))}}}var scratchZoomPickRay=new Ray,scratchPickCartesian$1=new Cartesian3,scratchZoomOffset=new Cartesian2,scratchZoomDirection=new Cartesian3,scratchCenterPixel=new Cartesian2,scratchCenterPosition=new Cartesian3,scratchPositionNormal=new Cartesian3,scratchPickNormal=new Cartesian3,scratchZoomAxis=new Cartesian3,scratchCameraPositionNormal=new Cartesian3,scratchTargetNormal=new Cartesian3,scratchCameraPosition=new Cartesian3,scratchCameraUpNormal=new Cartesian3,scratchCameraRightNormal=new Cartesian3,scratchForwardNormal=new Cartesian3,scratchPositionToTarget=new Cartesian3,scratchPositionToTargetNormal=new Cartesian3,scratchPan=new Cartesian3,scratchCenterMovement=new Cartesian3,scratchCenter=new Cartesian3,scratchCartesian=new Cartesian3,scratchCartesianTwo=new Cartesian3,scratchCartesianThree=new Cartesian3,scratchZoomViewOptions={orientation:new HeadingPitchRoll};function handleZoom(e,t,i,r,n,a){var o=1;defined(a)&&(o=CesiumMath.clamp(Math.abs(a),.25,1));var s=e.minimumZoomDistance*o,l=e.maximumZoomDistance,c=CesiumMath.clamp(c=r*(n-s),e._minimumZoomRate,e._maximumZoomRate),a=(i.endPosition.y-i.startPosition.y)/e._scene.canvas.clientHeight,o=c*(a=Math.min(a,e.maximumMovementRatio));if(e.enableCollisionDetection||0===e.minimumZoomDistance||!defined(e._globe)){if(0<o&&Math.abs(n-s)<1)return;if(o<0&&Math.abs(n-l)<1)return;n-o<s?o=n-s-1:l<n-o&&(o=n-l)}r=e._scene,i=r.camera,c=r.mode,a=scratchZoomViewOptions.orientation;if(a.heading=i.heading,a.pitch=i.pitch,a.roll=i.roll,i.frustum instanceof OrthographicFrustum)0<Math.abs(o)&&(i.zoomIn(o),i._adjustOrthographicFrustum());else{s=Cartesian2.equals(t,e._zoomMouseStart),n=e._zoomingOnVector,l=e._rotatingZoom;if(s||(e._zoomMouseStart=Cartesian2.clone(t,e._zoomMouseStart),defined(e._globe)&&(_=c===SceneMode$1.SCENE2D?(_=i.getPickRay(t,scratchZoomPickRay).origin,Cartesian3.fromElements(_.y,_.z,_.x)):pickGlobe(e,t,scratchPickCartesian$1)),defined(_)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=Cartesian3.clone(_,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,n=e._zoomingOnVector=!1,l=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),e._useZoomWorldPosition){a=c===SceneMode$1.COLUMBUS_VIEW;if(i.positionCartographic.height<2e6&&(l=!0),!s||l){if(c===SceneMode$1.SCENE2D){var u=e._zoomWorldPosition,d=i.position;!Cartesian3.equals(u,d)&&i.positionCartographic.height<2*e._maxCoord.x&&(f=i.position.x,h=Cartesian3.subtract(u,d,scratchZoomDirection),Cartesian3.normalize(h,h),m=Cartesian3.distance(u,d)*o/(.5*i.getMagnitude()),i.move(h,.5*m),(i.position.x<0&&0<f||0<i.position.x&&f<0)&&(_=i.getPickRay(t,scratchZoomPickRay).origin,_=Cartesian3.fromElements(_.y,_.z,_.x),e._zoomWorldPosition=Cartesian3.clone(_,e._zoomWorldPosition)))}else if(c===SceneMode$1.SCENE3D){l=Cartesian3.normalize(i.position,scratchCameraPositionNormal);if(e._cameraUnderground||e._zoomingUnderground||i.positionCartographic.height<3e3&&Math.abs(Cartesian3.dot(i.direction,l))<.6)a=!0;else{u=r.canvas,d=scratchCenterPixel;d.x=u.clientWidth/2,d.y=u.clientHeight/2;var h=pickGlobe(e,d,scratchCenterPosition);if(defined(h))if(i.positionCartographic.height<1e6){if(!(-.5<=Cartesian3.dot(i.direction,l))){var p=scratchCameraPosition;Cartesian3.clone(i.position,p);var m=e._zoomWorldPosition,f=Cartesian3.normalize(m,f=scratchTargetNormal);if(Cartesian3.dot(f,l)<0)return;var g=scratchCenter,_=scratchForwardNormal;Cartesian3.clone(i.direction,_),Cartesian3.add(p,Cartesian3.multiplyByScalar(_,1e3,scratchCartesian),g);u=scratchPositionToTarget,d=scratchPositionToTargetNormal;Cartesian3.subtract(m,p,u),Cartesian3.normalize(u,d);f=Cartesian3.dot(l,d);if(0<=f)return void(e._zoomMouseStart.x=-1);l=Math.acos(-f),f=Cartesian3.magnitude(p),m=Cartesian3.magnitude(m),f=f-o,u=Cartesian3.magnitude(u),u=Math.asin(CesiumMath.clamp(u/m*Math.sin(l),-1,1))-Math.asin(CesiumMath.clamp(f/m*Math.sin(l),-1,1))+l,m=scratchCameraUpNormal;Cartesian3.normalize(p,m);l=Cartesian3.cross(d,m,l=scratchCameraRightNormal);l=Cartesian3.normalize(l,l),Cartesian3.normalize(Cartesian3.cross(m,l,scratchCartesian),_),Cartesian3.multiplyByScalar(Cartesian3.normalize(g,scratchCartesian),Cartesian3.magnitude(g)-o,g),Cartesian3.normalize(p,p),Cartesian3.multiplyByScalar(p,f,p);d=scratchPan;Cartesian3.multiplyByScalar(Cartesian3.add(Cartesian3.multiplyByScalar(m,Math.cos(u)-1,scratchCartesianTwo),Cartesian3.multiplyByScalar(_,Math.sin(u),scratchCartesianThree),scratchCartesian),f,d),Cartesian3.add(p,d,p),Cartesian3.normalize(g,m),Cartesian3.normalize(Cartesian3.cross(m,l,scratchCartesian),_);l=scratchCenterMovement;return Cartesian3.multiplyByScalar(Cartesian3.add(Cartesian3.multiplyByScalar(m,Math.cos(u)-1,scratchCartesianTwo),Cartesian3.multiplyByScalar(_,Math.sin(u),scratchCartesianThree),scratchCartesian),Cartesian3.magnitude(g),l),Cartesian3.add(g,l,g),Cartesian3.clone(p,i.position),Cartesian3.normalize(Cartesian3.subtract(g,p,scratchCartesian),i.direction),Cartesian3.clone(i.direction,i.direction),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.cross(i.right,i.direction,i.up),void i.setView(scratchZoomViewOptions)}a=!0}else{g=Cartesian3.normalize(h,scratchPositionNormal),p=Cartesian3.normalize(e._zoomWorldPosition,scratchPickNormal),h=Cartesian3.dot(p,g);0<h&&h<1&&(h=CesiumMath.acosClamped(h),p=Cartesian3.cross(p,g,scratchZoomAxis),g=Math.abs(h)>CesiumMath.toRadians(20)?.75*i.positionCartographic.height:i.positionCartographic.height-o,i.rotate(p,h*(o/g)))}else a=!0}}e._rotatingZoom=!a}!s&&a||n?(r=SceneTransforms.wgs84ToWindowCoordinates(r,e._zoomWorldPosition,scratchZoomOffset),t=(c!==SceneMode$1.COLUMBUS_VIEW&&Cartesian2.equals(t,e._zoomMouseStart)&&defined(r)?i.getPickRay(r,scratchZoomPickRay):i.getPickRay(t,scratchZoomPickRay)).direction,c!==SceneMode$1.COLUMBUS_VIEW&&c!==SceneMode$1.SCENE2D||Cartesian3.fromElements(t.y,t.z,t.x,t),i.move(t,o),e._zoomingOnVector=!0):i.zoomIn(o),e._cameraUnderground||i.setView(scratchZoomViewOptions)}else i.zoomIn(o)}}var translate2DStart=new Ray,translate2DEnd=new Ray,scratchTranslateP0=new Cartesian3;function translate2D(e,t,i){var r=e._scene.camera,e=r.getPickRay(i.startPosition,translate2DStart).origin,i=r.getPickRay(i.endPosition,translate2DEnd).origin,e=Cartesian3.fromElements(e.y,e.z,e.x,e),i=Cartesian3.fromElements(i.y,i.z,i.x,i),e=Cartesian3.subtract(e,i,scratchTranslateP0),i=Cartesian3.magnitude(e);0<i&&(Cartesian3.normalize(e,e),r.move(e,i))}function zoom2D(e,t,i){defined(i.distance)&&(i=i.distance);var r=e._scene.camera;handleZoom(e,t,i,e._zoomFactor,r.getMagnitude())}var twist2DStart=new Cartesian2,twist2DEnd=new Cartesian2;function twist2D(e,t,i){var r,n,a;defined(i.angleAndHeight)?singleAxisTwist2D(e,t,i.angleAndHeight):(r=(a=e._scene).camera,t=(n=a.canvas).clientWidth,e=n.clientHeight,(a=twist2DStart).x=2/t*i.startPosition.x-1,a.y=2/e*(e-i.startPosition.y)-1,a=Cartesian2.normalize(a,a),(n=twist2DEnd).x=2/t*i.endPosition.x-1,n.y=2/e*(e-i.endPosition.y)-1,n=Cartesian2.normalize(n,n),i=CesiumMath.acosClamped(a.x),a.y<0&&(i=CesiumMath.TWO_PI-i),a=CesiumMath.acosClamped(n.x),n.y<0&&(a=CesiumMath.TWO_PI-a),r.twistRight(a-i))}function singleAxisTwist2D(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;(r=r>e._maximumRotateRate?e._maximumRotateRate:r)<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,a=n.camera,n=n.canvas,n=(i.endPosition.x-i.startPosition.x)/n.clientWidth,n=r*(n=Math.min(n,e.maximumMovementRatio))*Math.PI*4;a.twistRight(n)}function update2D(e){var t=e._scene.mapMode2D===MapMode2D$1.ROTATE;Matrix4.equals(Matrix4.IDENTITY,e._scene.camera.transform)?(reactToInput(e,e.enableTranslate,e.translateEventTypes,translate2D,e.inertiaTranslate,"_lastInertiaTranslateMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom2D,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&reactToInput(e,e.enableRotate,e.tiltEventTypes,twist2D,e.inertiaSpin,"_lastInertiaTiltMovement")):(reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom2D,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&reactToInput(e,e.enableRotate,e.translateEventTypes,twist2D,e.inertiaSpin,"_lastInertiaSpinMovement"))}var pickGlobeScratchRay=new Ray,scratchDepthIntersection=new Cartesian3,scratchRayIntersection=new Cartesian3;function pickGlobe(e,t,i){var r=e._scene,n=e._globe,a=r.camera;if(defined(n)){var o,e=!e._cameraUnderground;r.pickPositionSupported&&(o=r.pickPositionWorldCoordinates(t,scratchDepthIntersection));t=a.getPickRay(t,pickGlobeScratchRay),e=n.pickWorldCoordinates(t,r,e,scratchRayIntersection);return(defined(o)?Cartesian3.distance(o,a.positionWC):Number.POSITIVE_INFINITY)<(defined(e)?Cartesian3.distance(e,a.positionWC):Number.POSITIVE_INFINITY)?Cartesian3.clone(o,i):Cartesian3.clone(e,i)}}var scratchDistanceCartographic=new Cartographic;function getDistanceFromSurface(e){var t=e._ellipsoid,i=e._scene,r=i.camera,n=0;i.mode===SceneMode$1.SCENE3D?defined(t=t.cartesianToCartographic(r.position,scratchDistanceCartographic))&&(n=t.height):n=r.position.z;e=defaultValue(e._scene.globeHeight,0);return Math.abs(e-n)}var scratchSurfaceNormal=new Cartesian3;function getZoomDistanceUnderground(e,t){var i=t.origin,t=t.direction,e=getDistanceFromSurface(e),i=Cartesian3.normalize(i,scratchSurfaceNormal),t=Math.abs(Cartesian3.dot(i,t));return e*(t=2*Math.max(t,.5))}function getTiltCenterUnderground(e,t,i,r){var n=Cartesian3.distance(t.origin,i),i=getDistanceFromSurface(e);return CesiumMath.clamp(5*i,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance)<n&&(n=Math.min(n,i/5),n=Math.max(n,100)),Ray.getPoint(t,n,r)}function getStrafeStartPositionUnderground(e,t,i,r){var n;return(!defined(i)||(n=Cartesian3.distance(t.origin,i))>e._maximumUndergroundPickDistance)&&(n=getDistanceFromSurface(e)),Ray.getPoint(t,n,r)}var scratchInertialDelta=new Cartesian2;function continueStrafing(e,t){var i=t.endPosition,r=Cartesian2.subtract(t.endPosition,t.startPosition,scratchInertialDelta),n=e._strafeEndMousePosition;Cartesian2.add(n,r,n),t.endPosition=n,strafe(e,t,e._strafeStartPosition),t.endPosition=i}var translateCVStartRay=new Ray,translateCVEndRay=new Ray,translateCVStartPos=new Cartesian3,translateCVEndPos=new Cartesian3,translateCVDifference=new Cartesian3,translateCVOrigin=new Cartesian3,translateCVPlane=new Plane(Cartesian3.UNIT_X,0),translateCVStartMouse=new Cartesian2,translateCVEndMouse=new Cartesian2;function translateCV(e,t,i){if(Cartesian3.equals(t,e._translateMousePosition)||(e._looking=!1),Cartesian3.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking)look3D(e,t,i);else if(e._strafing)continueStrafing(e,i);else{var r,n=e._scene.camera,a=e._cameraUnderground,o=Cartesian2.clone(i.startPosition,translateCVStartMouse),s=Cartesian2.clone(i.endPosition,translateCVEndMouse),l=n.getPickRay(o,translateCVStartRay),c=Cartesian3.clone(Cartesian3.ZERO,translateCVOrigin),u=Cartesian3.UNIT_X;if(n.position.z<e._minimumPickingTerrainHeight&&defined(r=pickGlobe(e,o,translateCVStartPos))&&(c.x=r.x),a||c.x>n.position.z&&defined(r)){var d=r;return a&&(d=getStrafeStartPositionUnderground(e,l,r,translateCVStartPos)),Cartesian2.clone(t,e._strafeMousePosition),Cartesian2.clone(t,e._strafeEndMousePosition),Cartesian3.clone(d,e._strafeStartPosition),e._strafing=!0,void strafe(e,i,e._strafeStartPosition)}u=Plane.fromPointNormal(c,u,translateCVPlane),l=n.getPickRay(o,translateCVStartRay),l=IntersectionTests.rayPlane(l,u,translateCVStartPos),s=n.getPickRay(s,translateCVEndRay),u=IntersectionTests.rayPlane(s,u,translateCVEndPos);if(!defined(l)||!defined(u))return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._translateMousePosition);l=Cartesian3.subtract(l,u,translateCVDifference),u=l.x;l.x=l.y,l.y=l.z,l.z=u;u=Cartesian3.magnitude(l);u>CesiumMath.EPSILON6&&(Cartesian3.normalize(l,l),n.move(l,u))}}var rotateCVWindowPos=new Cartesian2,rotateCVWindowRay=new Ray,rotateCVCenter=new Cartesian3,rotateCVVerticalCenter=new Cartesian3,rotateCVTransform=new Matrix4,rotateCVVerticalTransform=new Matrix4,rotateCVOrigin=new Cartesian3,rotateCVPlane=new Plane(Cartesian3.UNIT_X,0),rotateCVCartesian3=new Cartesian3,rotateCVCart=new Cartographic,rotateCVOldTransform=new Matrix4,rotateCVQuaternion=new Quaternion,rotateCVMatrix=new Matrix3,tilt3DCartesian3=new Cartesian3;function rotateCV(e,t,i){var r;defined(i.angleAndHeight)&&(i=i.angleAndHeight),Cartesian2.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking?look3D(e,t,i):(r=e._scene.camera,e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,rotateCVOnPlane(e,t,i)):rotateCVOnTerrain(e,t,i))}function rotateCVOnPlane(e,t,i){var r=e._scene,n=r.camera,a=r.canvas,o=rotateCVWindowPos;o.x=a.clientWidth/2,o.y=a.clientHeight/2;var s=n.getPickRay(o,rotateCVWindowRay),l=Cartesian3.UNIT_X,a=s.origin,o=s.direction,s=Cartesian3.dot(l,o);if(!defined(c=Math.abs(s)>CesiumMath.EPSILON6?-Cartesian3.dot(l,a)/s:c)||c<=0)return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._tiltCenterMousePosition);o=Cartesian3.multiplyByScalar(o,c,rotateCVCenter);Cartesian3.add(a,o,o);var c=r.mapProjection,a=c.ellipsoid;Cartesian3.fromElements(o.y,o.z,o.x,o);r=c.unproject(o,rotateCVCart);a.cartographicToCartesian(r,o);c=Transforms.eastNorthUpToFixedFrame(o,a,rotateCVTransform),r=e._globe,o=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;a=Matrix4.clone(n.transform,rotateCVOldTransform);n._setTransform(c),rotate3D(e,t,i,Cartesian3.UNIT_Z),n._setTransform(a),e._globe=r;o=(e._ellipsoid=o).maximumRadius;e._rotateFactor=1/o,e._rotateRateRangeAdjustment=o}function rotateCVOnTerrain(e,t,i){var r=e._scene,n=r.camera,a=e._cameraUnderground,o=Cartesian3.UNIT_X;if(Cartesian2.equals(t,e._tiltCenterMousePosition))h=Cartesian3.clone(e._tiltCenter,rotateCVCenter);else{if(!defined(h=n.position.z<e._minimumPickingTerrainHeight?pickGlobe(e,t,rotateCVCenter):h)){var s=(d=n.getPickRay(t,rotateCVWindowRay)).origin,l=d.direction,c=Cartesian3.dot(o,l);if(!defined(u=Math.abs(c)>CesiumMath.EPSILON6?-Cartesian3.dot(o,s)/c:u)||u<=0)return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._tiltCenterMousePosition);h=Cartesian3.multiplyByScalar(l,u,rotateCVCenter),Cartesian3.add(s,h,h)}a&&getTiltCenterUnderground(e,d=!defined(d)?n.getPickRay(t,rotateCVWindowRay):d,h,h),Cartesian2.clone(t,e._tiltCenterMousePosition),Cartesian3.clone(h,e._tiltCenter)}var l=r.canvas,u=rotateCVWindowPos;u.x=l.clientWidth/2,u.y=e._tiltCenterMousePosition.y,d=n.getPickRay(u,rotateCVWindowRay);s=Cartesian3.clone(Cartesian3.ZERO,rotateCVOrigin);s.x=h.x;r=Plane.fromPointNormal(s,o,rotateCVPlane),l=IntersectionTests.rayPlane(d,r,rotateCVVerticalCenter),u=n._projection,s=u.ellipsoid;Cartesian3.fromElements(h.y,h.z,h.x,h);o=u.unproject(h,rotateCVCart);s.cartographicToCartesian(o,h);var d=Transforms.eastNorthUpToFixedFrame(h,s,rotateCVTransform),r=defined(l)?(Cartesian3.fromElements(l.y,l.z,l.x,l),o=u.unproject(l,rotateCVCart),s.cartographicToCartesian(o,l),Transforms.eastNorthUpToFixedFrame(l,s,rotateCVVerticalTransform)):d,h=e._globe,u=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;o=Cartesian3.UNIT_Z,l=Matrix4.clone(n.transform,rotateCVOldTransform);n._setTransform(d);s=Cartesian3.cross(Cartesian3.UNIT_Z,Cartesian3.normalize(n.position,rotateCVCartesian3),rotateCVCartesian3),d=Cartesian3.dot(n.right,s);rotate3D(e,t,i,o,!1,!0),n._setTransform(r),d<0?(s=i.startPosition.y-i.endPosition.y,d=n.constrainedAxis,rotate3D(e,t,i,o=a&&s<0||!a&&0<s?void 0:o,!(n.constrainedAxis=void 0),!1),n.constrainedAxis=d):rotate3D(e,t,i,o,!0,!1),defined(n.constrainedAxis)&&(o=Cartesian3.cross(n.direction,n.constrainedAxis,tilt3DCartesian3),Cartesian3.equalsEpsilon(o,Cartesian3.ZERO,CesiumMath.EPSILON6)||(Cartesian3.dot(o,n.right)<0&&Cartesian3.negate(o,o),Cartesian3.cross(o,n.direction,n.up),Cartesian3.cross(n.direction,n.up,n.right),Cartesian3.normalize(n.up,n.up),Cartesian3.normalize(n.right,n.right))),n._setTransform(l),e._globe=h;u=(e._ellipsoid=u).maximumRadius;e._rotateFactor=1/u,e._rotateRateRangeAdjustment=u;u=Cartesian3.clone(n.positionWC,rotateCVCartesian3);e.enableCollisionDetection&&adjustHeightForTerrain(e),Cartesian3.equals(n.positionWC,u)||(n._setTransform(r),n.worldToCameraCoordinatesPoint(u,u),r=Cartesian3.magnitudeSquared(u),Cartesian3.magnitudeSquared(n.position)>r&&(Cartesian3.normalize(n.position,n.position),Cartesian3.multiplyByScalar(n.position,Math.sqrt(r),n.position)),r=Cartesian3.angleBetween(u,n.position),u=Cartesian3.cross(u,n.position,u),Cartesian3.normalize(u,u),r=Quaternion.fromAxisAngle(u,r,rotateCVQuaternion),r=Matrix3.fromQuaternion(r,rotateCVMatrix),Matrix3.multiplyByVector(r,n.direction,n.direction),Matrix3.multiplyByVector(r,n.up,n.up),Cartesian3.cross(n.direction,n.up,n.right),Cartesian3.cross(n.right,n.direction,n.up),n._setTransform(l))}var zoomCVWindowPos=new Cartesian2,zoomCVWindowRay=new Ray,zoomCVIntersection=new Cartesian3;function zoomCV(e,t,i){defined(i.distance)&&(i=i.distance);var r,n=e._scene,a=n.camera,o=n.canvas,s=e._cameraUnderground;s?r=t:((r=zoomCVWindowPos).x=o.clientWidth/2,r.y=o.clientHeight/2);var l,c,u,d=a.getPickRay(r,zoomCVWindowRay),n=d.origin,o=d.direction;defined(l=a.position.z<e._minimumPickingTerrainHeight?pickGlobe(e,r,zoomCVIntersection):l)&&(c=Cartesian3.distance(n,l)),s&&(u=getZoomDistanceUnderground(e,d),c=defined(c)?Math.min(c,u):u),defined(c)||(u=Cartesian3.UNIT_X,c=-Cartesian3.dot(u,n)/Cartesian3.dot(u,o)),handleZoom(e,t,i,e._zoomFactor,c)}function updateCV(e){var t,i=e._scene.camera;Matrix4.equals(Matrix4.IDENTITY,i.transform)?(t=e._tweens,e._aggregator.anyButtonDown&&t.removeAll(),reactToInput(e,e.enableTilt,e.tiltEventTypes,rotateCV,e.inertiaSpin,"_lastInertiaTiltMovement"),reactToInput(e,e.enableTranslate,e.translateEventTypes,translateCV,e.inertiaTranslate,"_lastInertiaTranslateMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoomCV,e.inertiaZoom,"_lastInertiaZoomMovement"),reactToInput(e,e.enableLook,e.lookEventTypes,look3D),e._aggregator.anyButtonDown||t.contains(e._tween)||defined(i=i.createCorrectPositionTween(e.bounceAnimationTime))&&(e._tween=t.add(i)),t.update()):(reactToInput(e,e.enableRotate,e.rotateEventTypes,rotate3D,e.inertiaSpin,"_lastInertiaSpinMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom3D,e.inertiaZoom,"_lastInertiaZoomMovement"))}var scratchStrafeRay=new Ray,scratchStrafePlane=new Plane(Cartesian3.UNIT_X,0),scratchStrafeIntersection=new Cartesian3,scratchStrafeDirection=new Cartesian3,scratchMousePos=new Cartesian3;function strafe(e,t,i){var r=e._scene,n=r.camera,a=n.getPickRay(t.endPosition,scratchStrafeRay),e=Cartesian3.clone(n.direction,scratchStrafeDirection);r.mode===SceneMode$1.COLUMBUS_VIEW&&Cartesian3.fromElements(e.z,e.x,e.y,e);t=Plane.fromPointNormal(i,e,scratchStrafePlane),t=IntersectionTests.rayPlane(a,t,scratchStrafeIntersection);defined(t)&&(e=Cartesian3.subtract(i,t,e),r.mode===SceneMode$1.COLUMBUS_VIEW&&Cartesian3.fromElements(e.y,e.z,e.x,e),Cartesian3.add(n.position,e,n.position))}var spin3DPick=new Cartesian3,scratchCartographic=new Cartographic,scratchRadii=new Cartesian3,scratchEllipsoid=new Ellipsoid,scratchLookUp=new Cartesian3,scratchNormal=new Cartesian3;function spin3D(e,t,i){var r=e._scene.camera,n=e._cameraUnderground,a=e._ellipsoid;if(Matrix4.equals(r.transform,Matrix4.IDENTITY)){var o,s,l=a.geodeticSurfaceNormal(r.position,scratchLookUp);if(Cartesian2.equals(t,e._rotateMousePosition))if(e._looking)look3D(e,t,i,l);else if(e._rotating)rotate3D(e,t,i);else if(e._strafing)continueStrafing(e,i);else{if(Cartesian3.magnitude(r.position)<Cartesian3.magnitude(e._rotateStartPosition))return;o=Cartesian3.magnitude(e._rotateStartPosition),(s=scratchRadii).x=s.y=s.z=o,pan3D(e,t,i,a=Ellipsoid.fromCartesian3(s,scratchEllipsoid))}else{e._looking=!1,e._rotating=!1,e._strafing=!1;var c,u,d,h=a.cartesianToCartographic(r.positionWC,scratchCartographic).height;defined(e._globe)&&h<e._minimumPickingTerrainHeight?defined(c=pickGlobe(e,i.startPosition,scratchMousePos))?(d=!1,u=r.getPickRay(i.startPosition,pickGlobeScratchRay),n?(d=!0,getStrafeStartPositionUnderground(e,u,c,c)):(n=a.geodeticSurfaceNormal(c,scratchNormal),d=Math.abs(Cartesian3.dot(u.direction,n))<.05||Cartesian3.magnitude(r.position)<Cartesian3.magnitude(c)),d?(Cartesian2.clone(t,e._strafeEndMousePosition),Cartesian3.clone(c,e._strafeStartPosition),e._strafing=!0,strafe(e,i,e._strafeStartPosition)):(o=Cartesian3.magnitude(c),(s=scratchRadii).x=s.y=s.z=o,pan3D(e,t,i,a=Ellipsoid.fromCartesian3(s,scratchEllipsoid)),Cartesian3.clone(c,e._rotateStartPosition))):(e._looking=!0,look3D(e,t,i,l)):defined(r.pickEllipsoid(i.startPosition,e._ellipsoid,spin3DPick))?(pan3D(e,t,i,e._ellipsoid),Cartesian3.clone(spin3DPick,e._rotateStartPosition)):h>e._minimumTrackBallHeight?(e._rotating=!0,rotate3D(e,t,i)):(e._looking=!0,look3D(e,t,i,l)),Cartesian2.clone(t,e._rotateMousePosition)}}else rotate3D(e,t,i)}function rotate3D(e,t,i,r,n,a){n=defaultValue(n,!1),a=defaultValue(a,!1);var o=e._scene,s=o.camera,l=o.canvas,c=s.constrainedAxis;defined(r)&&(s.constrainedAxis=r);o=Cartesian3.magnitude(s.position),r=e._rotateFactor*(o-e._rotateRateRangeAdjustment);(r=r>e._maximumRotateRate?e._maximumRotateRate:r)<e._minimumRotateRate&&(r=e._minimumRotateRate);o=(i.startPosition.x-i.endPosition.x)/l.clientWidth,l=(i.startPosition.y-i.endPosition.y)/l.clientHeight,o=Math.min(o,e.maximumMovementRatio),l=Math.min(l,e.maximumMovementRatio),o=r*o*Math.PI*2,l=r*l*Math.PI;n||s.rotateRight(o),a||s.rotateUp(l),s.constrainedAxis=c}var pan3DP0=Cartesian4.clone(Cartesian4.UNIT_W),pan3DP1=Cartesian4.clone(Cartesian4.UNIT_W),pan3DTemp0=new Cartesian3,pan3DTemp1=new Cartesian3,pan3DTemp2=new Cartesian3,pan3DTemp3=new Cartesian3,pan3DStartMousePosition=new Cartesian2,pan3DEndMousePosition=new Cartesian2;function pan3D(e,t,i,r){var n,a,o=e._scene.camera,s=Cartesian2.clone(i.startPosition,pan3DStartMousePosition),l=Cartesian2.clone(i.endPosition,pan3DEndMousePosition),c=o.pickEllipsoid(s,r,pan3DP0),u=o.pickEllipsoid(l,r,pan3DP1);if(!defined(c)||!defined(u))return e._rotating=!0,void rotate3D(e,t,i);c=o.worldToCameraCoordinates(c,c),u=o.worldToCameraCoordinates(u,u),defined(o.constrainedAxis)?(n=o.constrainedAxis,s=Cartesian3.mostOrthogonalAxis(n,pan3DTemp0),Cartesian3.cross(s,n,s),Cartesian3.normalize(s,s),l=Cartesian3.cross(n,s,pan3DTemp1),r=Cartesian3.magnitude(c),a=Cartesian3.dot(n,c),e=Math.acos(a/r),t=Cartesian3.multiplyByScalar(n,a,pan3DTemp2),Cartesian3.subtract(c,t,t),Cartesian3.normalize(t,t),i=Cartesian3.magnitude(u),r=Cartesian3.dot(n,u),a=Math.acos(r/i),i=Cartesian3.multiplyByScalar(n,r,pan3DTemp3),Cartesian3.subtract(u,i,i),Cartesian3.normalize(i,i),r=Math.acos(Cartesian3.dot(t,s)),Cartesian3.dot(t,l)<0&&(r=CesiumMath.TWO_PI-r),s=Math.acos(Cartesian3.dot(i,s)),i=r-(s=Cartesian3.dot(i,l)<0?CesiumMath.TWO_PI-s:s),l=Cartesian3.equalsEpsilon(n,o.position,CesiumMath.EPSILON2)?o.right:Cartesian3.cross(n,o.position,pan3DTemp0),s=Cartesian3.cross(n,l,pan3DTemp0),l=Cartesian3.dot(s,Cartesian3.subtract(c,n,pan3DTemp1)),s=Cartesian3.dot(s,Cartesian3.subtract(u,n,pan3DTemp1)),a=0<l&&0<s?a-e:0<l&&s<=0?0<Cartesian3.dot(o.position,n)?-e-a:e+a:e-a,o.rotateRight(i),o.rotateUp(a)):(Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),a=Cartesian3.dot(c,u),u=Cartesian3.cross(c,u,pan3DTemp0),a<1&&!Cartesian3.equalsEpsilon(u,Cartesian3.ZERO,CesiumMath.EPSILON14)&&(a=Math.acos(a),o.rotate(u,a)))}var zoom3DUnitPosition=new Cartesian3,zoom3DCartographic=new Cartographic;function zoom3D(e,t,i){defined(i.distance)&&(i=i.distance);var r,n=e._ellipsoid,a=e._scene,o=a.camera,s=a.canvas,a=e._cameraUnderground;a?r=t:((r=zoomCVWindowPos).x=s.clientWidth/2,r.y=s.clientHeight/2);var l,c,s=o.getPickRay(r,zoomCVWindowRay),n=n.cartesianToCartographic(o.position,zoom3DCartographic).height;defined(l=n<e._minimumPickingTerrainHeight?pickGlobe(e,r,zoomCVIntersection):l)&&(c=Cartesian3.distance(s.origin,l)),a&&(s=getZoomDistanceUnderground(e,s),c=defined(c)?Math.min(c,s):s),defined(c)||(c=n);n=Cartesian3.normalize(o.position,zoom3DUnitPosition);handleZoom(e,t,i,e._zoomFactor,c,Cartesian3.dot(n,o.direction))}var tilt3DWindowPos=new Cartesian2,tilt3DRay=new Ray,tilt3DCenter=new Cartesian3,tilt3DVerticalCenter=new Cartesian3,tilt3DTransform=new Matrix4,tilt3DVerticalTransform=new Matrix4,tilt3DOldTransform=new Matrix4,tilt3DQuaternion=new Quaternion,tilt3DMatrix=new Matrix3,tilt3DCart=new Cartographic,tilt3DLookUp=new Cartesian3;function tilt3D(e,t,i){var r,n=e._scene.camera;Matrix4.equals(n.transform,Matrix4.IDENTITY)&&(defined(i.angleAndHeight)&&(i=i.angleAndHeight),Cartesian2.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking?(r=e._ellipsoid.geodeticSurfaceNormal(n.position,tilt3DLookUp),look3D(e,t,i,r)):(n=e._ellipsoid.cartesianToCartographic(n.position,tilt3DCart),e._tiltOnEllipsoid||n.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,tilt3DOnEllipsoid(e,t,i)):tilt3DOnTerrain(e,t,i)))}var tilt3DOnEllipsoidCartographic=new Cartographic;function tilt3DOnEllipsoid(e,t,i){var r=e._ellipsoid,n=e._scene,a=n.camera,o=.25*e.minimumZoomDistance,s=r.cartesianToCartographic(a.positionWC,tilt3DOnEllipsoidCartographic).height;if(!(s-o-1<CesiumMath.EPSILON3&&i.endPosition.y-i.startPosition.y<0)){o=n.canvas,n=tilt3DWindowPos;n.x=o.clientWidth/2,n.y=o.clientHeight/2;o=a.getPickRay(n,tilt3DRay),n=IntersectionTests.rayEllipsoid(o,r);if(defined(n))u=Ray.getPoint(o,n.start,tilt3DCenter);else{if(!(s>e._minimumTrackBallHeight)){e._looking=!0;var l=e._ellipsoid.geodeticSurfaceNormal(a.position,tilt3DLookUp);return look3D(e,t,i,l),void Cartesian2.clone(t,e._tiltCenterMousePosition)}var c=IntersectionTests.grazingAltitudeLocation(o,r);if(!defined(c))return;l=r.cartesianToCartographic(c,tilt3DCart);l.height=0,u=r.cartographicToCartesian(l,tilt3DCenter)}var c=Transforms.eastNorthUpToFixedFrame(u,r,tilt3DTransform),l=e._globe,u=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;r=Matrix4.clone(a.transform,tilt3DOldTransform);a._setTransform(c),rotate3D(e,t,i,Cartesian3.UNIT_Z),a._setTransform(r),e._globe=l;u=(e._ellipsoid=u).maximumRadius;e._rotateFactor=1/u,e._rotateRateRangeAdjustment=u}}function tilt3DOnTerrain(e,t,i){var r=e._ellipsoid,n=e._scene,a=n.camera,o=e._cameraUnderground;if(Cartesian2.equals(t,e._tiltCenterMousePosition))d=Cartesian3.clone(e._tiltCenter,tilt3DCenter);else{if(!defined(d=pickGlobe(e,t,tilt3DCenter))){var s=a.getPickRay(t,tilt3DRay),l=IntersectionTests.rayEllipsoid(s,r);if(!defined(l))return void(r.cartesianToCartographic(a.position,tilt3DCart).height<=e._minimumTrackBallHeight&&(e._looking=!0,u=e._ellipsoid.geodeticSurfaceNormal(a.position,tilt3DLookUp),look3D(e,t,i,u),Cartesian2.clone(t,e._tiltCenterMousePosition)));d=Ray.getPoint(s,l.start,tilt3DCenter)}o&&getTiltCenterUnderground(e,s=!defined(s)?a.getPickRay(t,tilt3DRay):s,d,d),Cartesian2.clone(t,e._tiltCenterMousePosition),Cartesian3.clone(d,e._tiltCenter)}var c=n.canvas,u=tilt3DWindowPos;u.x=c.clientWidth/2,u.y=e._tiltCenterMousePosition.y,s=a.getPickRay(u,tilt3DRay);var d,n=Cartesian3.magnitude(d),c=Cartesian3.fromElements(n,n,n,scratchRadii),u=Ellipsoid.fromCartesian3(c,scratchEllipsoid);defined(l=IntersectionTests.rayEllipsoid(s,u))&&(c=Cartesian3.magnitude(s.origin)>n?l.start:l.stop,n=Ray.getPoint(s,c,tilt3DVerticalCenter),l=Transforms.eastNorthUpToFixedFrame(d,r,tilt3DTransform),s=Transforms.eastNorthUpToFixedFrame(n,u,tilt3DVerticalTransform),c=e._globe,d=e._ellipsoid,e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1,r=Cartesian3.UNIT_Z,u=Matrix4.clone(a.transform,tilt3DOldTransform),a._setTransform(l),l=Cartesian3.cross(n,a.positionWC,tilt3DCartesian3),n=Cartesian3.dot(a.rightWC,l),rotate3D(e,t,i,r,!1,!0),a._setTransform(s),n<0?(l=i.startPosition.y-i.endPosition.y,n=a.constrainedAxis,rotate3D(e,t,i,r=o&&l<0||!o&&0<l?void 0:r,!(a.constrainedAxis=void 0),!1),a.constrainedAxis=n):rotate3D(e,t,i,r,!0,!1),defined(a.constrainedAxis)&&(r=Cartesian3.cross(a.direction,a.constrainedAxis,tilt3DCartesian3),Cartesian3.equalsEpsilon(r,Cartesian3.ZERO,CesiumMath.EPSILON6)||(Cartesian3.dot(r,a.right)<0&&Cartesian3.negate(r,r),Cartesian3.cross(r,a.direction,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.up,a.up),Cartesian3.normalize(a.right,a.right))),a._setTransform(u),e._globe=c,d=(e._ellipsoid=d).maximumRadius,e._rotateFactor=1/d,e._rotateRateRangeAdjustment=d,d=Cartesian3.clone(a.positionWC,tilt3DCartesian3),e.enableCollisionDetection&&adjustHeightForTerrain(e),Cartesian3.equals(a.positionWC,d)||(a._setTransform(s),a.worldToCameraCoordinatesPoint(d,d),s=Cartesian3.magnitudeSquared(d),Cartesian3.magnitudeSquared(a.position)>s&&(Cartesian3.normalize(a.position,a.position),Cartesian3.multiplyByScalar(a.position,Math.sqrt(s),a.position)),s=Cartesian3.angleBetween(d,a.position),d=Cartesian3.cross(d,a.position,d),Cartesian3.normalize(d,d),s=Quaternion.fromAxisAngle(d,s,tilt3DQuaternion),s=Matrix3.fromQuaternion(s,tilt3DMatrix),Matrix3.multiplyByVector(s,a.direction,a.direction),Matrix3.multiplyByVector(s,a.up,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.cross(a.right,a.direction,a.up),a._setTransform(u)))}var look3DStartPos=new Cartesian2,look3DEndPos=new Cartesian2,look3DStartRay=new Ray,look3DEndRay=new Ray,look3DNegativeRot=new Cartesian3,look3DTan=new Cartesian3;function look3D(e,t,i,r){var n=e._scene.camera,a=look3DStartPos;a.x=i.startPosition.x,a.y=0;var o=look3DEndPos;o.x=i.endPosition.x,o.y=0;var s=n.getPickRay(a,look3DStartRay),l=n.getPickRay(o,look3DEndRay),c=0;n.frustum instanceof OrthographicFrustum?(h=s.origin,d=l.origin,Cartesian3.add(n.direction,h,h),Cartesian3.add(n.direction,d,d),Cartesian3.subtract(h,n.position,h),Cartesian3.subtract(d,n.position,d),Cartesian3.normalize(h,h),Cartesian3.normalize(d,d)):(h=s.direction,d=l.direction);var u=Cartesian3.dot(h,d);u<1&&(c=Math.acos(u));var d,h,c=i.startPosition.x>i.endPosition.x?-c:c,e=e._horizontalRotationAxis;defined(r)?n.look(r,-c):defined(e)?n.look(e,-c):n.lookLeft(c),a.x=0,a.y=i.startPosition.y,o.x=0,o.y=i.endPosition.y,s=n.getPickRay(a,look3DStartRay),l=n.getPickRay(o,look3DEndRay),c=0,n.frustum instanceof OrthographicFrustum?(h=s.origin,d=l.origin,Cartesian3.add(n.direction,h,h),Cartesian3.add(n.direction,d,d),Cartesian3.subtract(h,n.position,h),Cartesian3.subtract(d,n.position,d),Cartesian3.normalize(h,h),Cartesian3.normalize(d,d)):(h=s.direction,d=l.direction),(u=Cartesian3.dot(h,d))<1&&(c=Math.acos(u)),c=i.startPosition.y>i.endPosition.y?-c:c,defined(r=defaultValue(r,e))?(h=n.direction,d=Cartesian3.negate(r,look3DNegativeRot),i=Cartesian3.equalsEpsilon(h,r,CesiumMath.EPSILON2),e=Cartesian3.equalsEpsilon(h,d,CesiumMath.EPSILON2),i||e?(i&&c<0||e&&0<c)&&n.look(n.right,-c):(u=Cartesian3.dot(h,r),e=CesiumMath.acosClamped(u),0<c&&e<c&&(c=e-CesiumMath.EPSILON4),u=Cartesian3.dot(h,d),e=CesiumMath.acosClamped(u),c<0&&e<-c&&(c=-e+CesiumMath.EPSILON4),h=Cartesian3.cross(r,h,look3DTan),n.look(h,c))):n.lookUp(c)}function update3D(e){reactToInput(e,e.enableRotate,e.rotateEventTypes,spin3D,e.inertiaSpin,"_lastInertiaSpinMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom3D,e.inertiaZoom,"_lastInertiaZoomMovement"),reactToInput(e,e.enableTilt,e.tiltEventTypes,tilt3D,e.inertiaSpin,"_lastInertiaTiltMovement"),reactToInput(e,e.enableLook,e.lookEventTypes,look3D)}var scratchAdjustHeightTransform=new Matrix4,scratchAdjustHeightCartographic=new Cartographic;function adjustHeightForTerrain(e){e._adjustedHeightForTerrain=!0;var t,i,r,n,a,o,s=e._scene,l=s.mode,c=s.globe;defined(c)&&l!==SceneMode$1.SCENE2D&&l!==SceneMode$1.MORPHING&&(t=s.camera,i=c.ellipsoid,r=s.mapProjection,Matrix4.equals(t.transform,Matrix4.IDENTITY)||(n=Matrix4.clone(t.transform,scratchAdjustHeightTransform),a=Cartesian3.magnitude(t.position),t._setTransform(Matrix4.IDENTITY)),o=scratchAdjustHeightCartographic,l===SceneMode$1.SCENE3D?i.cartesianToCartographic(t.position,o):r.unproject(t.position,o),c=!1,o.height<e._minimumCollisionTerrainHeight&&(defined(s=e._scene.globeHeight)&&(s=s+e.minimumZoomDistance,o.height<s&&(o.height=s,l===SceneMode$1.SCENE3D?i.cartographicToCartesian(o,t.position):r.project(o,t.position),c=!0))),defined(n)&&(t._setTransform(n),c&&(Cartesian3.normalize(t.position,t.position),Cartesian3.negate(t.position,t.direction),Cartesian3.multiplyByScalar(t.position,Math.max(a,e.minimumZoomDistance),t.position),Cartesian3.normalize(t.direction,t.direction),Cartesian3.cross(t.direction,t.up,t.right),Cartesian3.cross(t.right,t.direction,t.up))))}ScreenSpaceCameraController.prototype.onMap=function(){var e=this._scene,t=e.mode,e=e.camera;return t!==SceneMode$1.COLUMBUS_VIEW||Math.abs(e.position.x)-this._maxCoord.x<0&&Math.abs(e.position.y)-this._maxCoord.y<0};var scratchPreviousPosition=new Cartesian3,scratchPreviousDirection=new Cartesian3;ScreenSpaceCameraController.prototype.update=function(){var e=this._scene,t=e.camera,i=e.globe,r=e.mode;Matrix4.equals(t.transform,Matrix4.IDENTITY)?(this._globe=i,this._ellipsoid=(defined(this._globe)?this._globe:e.mapProjection).ellipsoid):(this._globe=void 0,this._ellipsoid=Ellipsoid.UNIT_SPHERE),this._cameraUnderground=e.cameraUnderground&&defined(this._globe),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*e.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*e.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*e.terrainExaggeration;i=this._ellipsoid.maximumRadius;this._rotateFactor=1/i,this._rotateRateRangeAdjustment=i,this._adjustedHeightForTerrain=!1;e=Cartesian3.clone(t.positionWC,scratchPreviousPosition),i=Cartesian3.clone(t.directionWC,scratchPreviousDirection);r===SceneMode$1.SCENE2D?update2D(this):r===SceneMode$1.COLUMBUS_VIEW?(this._horizontalRotationAxis=Cartesian3.UNIT_Z,updateCV(this)):r===SceneMode$1.SCENE3D&&(this._horizontalRotationAxis=void 0,update3D(this)),!this.enableCollisionDetection||this._adjustedHeightForTerrain||Cartesian3.equals(e,t.positionWC)&&Cartesian3.equals(i,t.directionWC)||adjustHeightForTerrain(this),this._aggregator.reset()},ScreenSpaceCameraController.prototype.isDestroyed=function(){return!1},ScreenSpaceCameraController.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),destroyObject(this)};var AdditiveBlend="uniform sampler2D colorTexture;\nuniform sampler2D colorTexture2;\nuniform vec2 center;\nuniform float radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(colorTexture, v_textureCoordinates);\nvec4 color1 = texture2D(colorTexture2, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - center) / radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color1, t);\n}\n",BrightPass="uniform sampler2D colorTexture;\nuniform float avgLuminance;\nuniform float threshold;\nuniform float offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(avgLuminance) * luminance / avgLuminance;\nfloat brightLum = max(scaledLum - threshold, 0.0);\nfloat brightness = brightLum / (offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n";function SunPostProcess(){this._sceneFramebuffer=new SceneFramebuffer;var e=new Array(6);e[0]=new PostProcessStage({fragmentShader:PassThrough,textureScale:.125,forcePowerOfTwo:!0,sampleMode:PostProcessStageSampleMode.LINEAR});var t=e[1]=new PostProcessStage({fragmentShader:BrightPass,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:.125,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new Cartesian2,e[2]=new PostProcessStage({fragmentShader:GaussianBlur1D,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:.125,forcePowerOfTwo:!0}),e[3]=new PostProcessStage({fragmentShader:GaussianBlur1D,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:.125,forcePowerOfTwo:!0}),e[4]=new PostProcessStage({fragmentShader:PassThrough,sampleMode:PostProcessStageSampleMode.LINEAR}),this._uCenter=new Cartesian2,this._uRadius=void 0,e[5]=new PostProcessStage({fragmentShader:AdditiveBlend,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.getFramebuffer().getColorTexture(0)}}}),this._stages=new PostProcessStageComposite({stages:e});for(var r=new PostProcessStageTextureCache(this),n=e.length,a=0;a<n;++a)e[a]._textureCache=r;this._textureCache=r,this.length=e.length}SunPostProcess.prototype.get=function(e){return this._stages.get(e)},SunPostProcess.prototype.getStageByName=function(e){for(var t=this._stages.length,i=0;i<t;++i){var r=this._stages.get(i);if(r.name===e)return r}};var sunPositionECScratch=new Cartesian4,sunPositionWCScratch=new Cartesian2,sizeScratch=new Cartesian2,postProcessMatrix4Scratch=new Matrix4;function updateSunPosition(e,t,i){var r=t.uniformState,n=r.sunPositionWC,a=r.view,o=r.viewProjection,s=r.projection,l=Matrix4.computeViewportTransformation(i,0,1,postProcessMatrix4Scratch),c=Matrix4.multiplyByPoint(a,n,sunPositionECScratch),u=Transforms.pointToGLWindowCoordinates(o,l,n,sunPositionWCScratch);c.x+=CesiumMath.SOLAR_RADIUS;r=Transforms.pointToGLWindowCoordinates(s,l,c,c),i=30*Cartesian2.magnitude(Cartesian2.subtract(r,u,r))*2,a=sizeScratch;a.x=i,a.y=i,e._uCenter=Cartesian2.clone(u,e._uCenter),e._uRadius=.15*Math.max(a.x,a.y);var s=t.drawingBufferWidth,c=t.drawingBufferHeight,d=e._stages,r=d.get(0),i=r.outputTexture.width,t=r.outputTexture.height,e=new BoundingRectangle;e.width=i,e.height=t,l=Matrix4.computeViewportTransformation(e,0,1,postProcessMatrix4Scratch),u=Transforms.pointToGLWindowCoordinates(o,l,n,sunPositionWCScratch),a.x*=i/s,a.y*=t/c;var h=r.scissorRectangle;h.x=Math.max(u.x-.5*a.x,0),h.y=Math.max(u.y-.5*a.y,0),h.width=Math.min(a.x,s),h.height=Math.min(a.y,c);for(var p=1;p<4;++p)BoundingRectangle.clone(h,d.get(p).scissorRectangle)}SunPostProcess.prototype.clear=function(e,t,i){this._sceneFramebuffer.clear(e,t,i),this._textureCache.clear(e)},SunPostProcess.prototype.update=function(e){var t=e.context,i=e.viewport,e=this._sceneFramebuffer;e.update(t,i);e=e.getFramebuffer();return this._textureCache.update(t),this._stages.update(t,!1),updateSunPosition(this,t,i),e},SunPostProcess.prototype.execute=function(e){var t=this._sceneFramebuffer.getFramebuffer().getColorTexture(0),i=this._stages,r=i.length;i.get(0).execute(e,t);for(var n=1;n<r;++n)i.get(n).execute(e,i.get(n-1).outputTexture)},SunPostProcess.prototype.copy=function(e,t){var i;defined(this._copyColorCommand)||((i=this)._copyColorCommand=e.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return i._stages.get(i._stages.length-1).outputTexture}},owner:this})),this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},SunPostProcess.prototype.isDestroyed=function(){return!1},SunPostProcess.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),destroyObject(this)};var requestRenderAfterFrame=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Scene(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).canvas,i=e.creditContainer,r=e.creditViewport,n=clone$1(e.contextOptions);defined(n)||(n={}),defined(n.webgl)||(n.webgl={}),n.webgl.powerPreference=defaultValue(n.webgl.powerPreference,"high-performance");var a=defined(i),n=new Context(t,n);a||((i=document.createElement("div")).style.position="absolute",i.style.bottom="0",i.style["text-shadow"]="0 0 2px #000000",i.style.color="#ffffff",i.style["font-size"]="10px",i.style["padding-right"]="5px",t.parentNode.appendChild(i)),defined(r)||(r=t.parentNode),this._id=createGuid(),this._jobScheduler=new JobScheduler,this._frameState=new FrameState(n,new CreditDisplay(i," • ",r),this._jobScheduler),this._frameState.scene3DOnly=defaultValue(e.scene3DOnly,!1),this._removeCreditContainer=!a,this._creditContainer=i,this._canvas=t,this._context=n,this._computeEngine=new ComputeEngine(n),this._globe=void 0,this._globeTranslucencyState=new GlobeTranslucencyState,this._primitives=new PrimitiveCollection,this._groundPrimitives=new PrimitiveCollection,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=n.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new TweenCollection,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=defaultValue(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new DepthPlane,this._clearColorCommand=new ClearCommand({color:new Color,stencil:0,owner:this}),this._depthClearCommand=new ClearCommand({depth:1,owner:this}),this._stencilClearCommand=new ClearCommand({stencil:0}),this._classificationStencilClearCommand=new ClearCommand({stencil:0,renderState:RenderState.fromCache({stencilMask:StencilConstants$1.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new SceneTransitioner(this),this._preUpdate=new Event,this._postUpdate=new Event,this._renderError=new Event,this._preRender=new Event,this._postRender=new Event,this._minimumDisableDepthTestDistance=0,this._debugInspector=new DebugInspector,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Event,this.morphComplete=new Event,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=Color.clone(Color.BLACK),this._mode=SceneMode$1.SCENE3D,this._mapProjection=defined(e.mapProjection)?e.mapProjection:new GeographicProjection,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new Fog,this._shadowMapCamera=new Camera(this),this.shadowMap=new ShadowMap({context:n,lightCamera:this._shadowMapCamera,enabled:defaultValue(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=Color.clone(Color.WHITE),this._actualInvertClassificationColor=Color.clone(this._invertClassificationColor),this._invertClassification=new InvertClassification,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new PostProcessStageCollection,this._brdfLutGenerator=new BrdfLutGenerator,this._terrainExaggeration=defaultValue(e.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new ScreenSpaceCameraController(this),this._cameraUnderground=!1,this._mapMode2D=defaultValue(e.mapMode2D,MapMode2D$1.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,separatePrimitiveFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=defaultValue(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=defaultValue(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=RequestScheduler.requestCompletedEvent.addEventListener(requestRenderAfterFrame(this)),this._removeTaskProcessorListenerCallback=TaskProcessor.taskCompletedEvent.addEventListener(requestRenderAfterFrame(this)),this._removeGlobeCallbacks=[];e=new BoundingRectangle(0,0,n.drawingBufferWidth,n.drawingBufferHeight),n=new Camera(this);this._logDepthBuffer&&(n.frustum.near=.1,n.frustum.far=1e10),this.preloadFlightCamera=new Camera(this),this.preloadFlightCullingVolume=void 0,this._picking=new Picking(this),this._defaultView=new View(this,n,e),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._specularEnvironmentMapAtlas=void 0,this.light=new SunLight,updateFrameNumber(this,0,JulianDate.now()),this.updateFrameState(),this.initializeFrame()}function updateGlobeListeners(e,t){for(var i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;var r=[];defined(t)&&(r.push(t.imageryLayersUpdatedEvent.addEventListener(requestRenderAfterFrame(e))),r.push(t.terrainProviderChanged.addEventListener(requestRenderAfterFrame(e)))),e._removeGlobeCallbacks=r}function updateDerivedCommands(e,t,i){var r=e._frameState,n=e._context,a=e._view.oit,o=r.shadowState.lightShadowMaps,s=r.shadowState.lightShadowsEnabled,r=t.derivedCommands;defined(t.pickId)&&(r.picking=DerivedCommand.createPickDerivedCommand(e,t,n,r.picking)),t.pickOnly||(r.depth=DerivedCommand.createDepthOnlyDerivedCommand(e,t,n,r.depth)),r.originalCommand=t,e._hdr&&(r.hdr=DerivedCommand.createHdrCommand(t,n,r.hdr),r=(t=r.hdr.command).derivedCommands),s&&t.receiveShadows&&(r.shadows=ShadowMap.createReceiveDerivedCommand(o,t,i,n,r.shadows)),t.pass===Pass$1.TRANSLUCENT&&defined(a)&&a.isSupported()&&(s&&t.receiveShadows?(r.oit=defined(r.oit)?r.oit:{},r.oit.shadows=a.createDerivedCommands(r.shadows.receiveCommand,n,r.oit.shadows)):r.oit=a.createDerivedCommands(t,n,r.oit))}Object.defineProperties(Scene.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 ContextLimits.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return ContextLimits.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 OctahedralProjectedCubeMap.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,updateGlobeListeners(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(defined(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(defined(this.globe))return this.globe.terrainProvider},set:function(e){defined(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(defined(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===SceneMode$1.SCENE2D?this.morphTo2D(0):e===SceneMode$1.SCENE3D?this.morphTo3D(0):e===SceneMode$1.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Camera(this),defined(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new DeviceOrientationCameraController(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}},imagerySplitPosition:{get:function(){return this._frameState.imagerySplitPosition},set:function(e){this._frameState.imagerySplitPosition=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){var t=this._context,t=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=t!==this._hdr,this._hdr=t}},highDynamicRangeSupported:{get:function(){var e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},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}}}),Scene.prototype.getCompressedTextureFormatSupported=function(e){var t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1},Scene.prototype.updateDerivedCommands=function(e){var t,i,r,n,a,o,s,l,c,u;defined(e.derivedCommands)&&(t=this._frameState,i=this._context,r=!1,l=t.shadowState.lastDirtyTime,e.lastDirtyTime!==l&&(e.lastDirtyTime=l,r=e.dirty=!0),c=t.useLogDepth,n=this._hdr,o=defined((a=e.derivedCommands).logDepth),u=defined(a.hdr),s=defined(a.originalCommand),l=c&&!o,c=!(c&&n||s),e.dirty=e.dirty||l||n&&!u||c,e.dirty&&(e.dirty=!1,u=t.shadowState.shadowMaps,t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=ShadowMap.createCastDerivedCommand(u,e,r,i,a.shadows)),(o||l)&&(a.logDepth=DerivedCommand.createLogDepthCommand(e,i,a.logDepth),updateDerivedCommands(this,a.logDepth.command,r)),(s||c)&&updateDerivedCommands(this,e,r)))};var renderTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.RENDER}),preloadTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PRELOAD}),preloadFlightTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PRELOAD_FLIGHT}),requestRenderModeDeferCheckPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.REQUEST_RENDER_MODE_DEFER_CHECK}),scratchOccluderBoundingSphere=new BoundingSphere,scratchOccluder;function getOccluder(e){var t=e.globe;if(e._mode===SceneMode$1.SCENE3D&&defined(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){var i=t.ellipsoid,t=e.frameState.minimumTerrainHeight;return scratchOccluderBoundingSphere.radius=i.minimumRadius+t,scratchOccluder=Occluder.fromBoundingSphere(scratchOccluderBoundingSphere,e.camera.positionWC,scratchOccluder)}}function updateFrameNumber(e,t,i){e=e._frameState;e.frameNumber=t,e.time=JulianDate.clone(i,e.time)}Scene.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1},Scene.prototype.updateFrameState=function(){var 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=getOccluder(this),t.terrainExaggeration=this._terrainExaggeration,t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof OrthographicFrustum||this.camera.frustum instanceof OrthographicOffCenterFrustum),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=Color.clone(this.invertClassificationColor,this._actualInvertClassificationColor),InvertClassification.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,defined(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0},Scene.prototype.isVisible=function(e,t,i){return defined(e)&&(!defined(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==Intersect$1.OUTSIDE&&(!defined(i)||!e.occlude||!e.boundingVolume.isOccluded(i)))};var transformFrom2D=new Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function debugShowBoundingVolume(e,t,i,r){var n=t._frameState,a=n.context,o=e.boundingVolume;defined(t._debugVolume)&&t._debugVolume.destroy();var s,l,c,u=Cartesian3.clone(o.center);n.mode!==SceneMode$1.SCENE3D&&(u=Matrix4.multiplyByPoint(transformFrom2D,u,u),l=(s=n.mapProjection).unproject(u),u=s.ellipsoid.cartographicToCartesian(l)),defined(o.radius)?(c=o.radius,c=GeometryPipeline.toWireframe(EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(c,c,c),vertexFormat:PerInstanceColorAppearance.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Primitive({geometryInstances:new GeometryInstance({geometry:c,modelMatrix:Matrix4.fromTranslation(u),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)}}),appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1})):(h=o.halfAxes,c=GeometryPipeline.toWireframe(BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:PerInstanceColorAppearance.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Primitive({geometryInstances:new GeometryInstance({geometry:c,modelMatrix:Matrix4.fromRotationTranslation(h,u,new Matrix4),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)}}),appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1}));var d,h=n.commandList,u=n.commandList=[];t._debugVolume.update(n),e=u[0],n.useLogDepth&&(e=DerivedCommand.createLogDepthCommand(e,a).command),defined(r)&&(d=i.framebuffer,i.framebuffer=r),e.execute(a,i),defined(d)&&(i.framebuffer=d),n.commandList=h}function executeCommand(e,t,i,r,n){var a=t._frameState;if(!defined(t.debugCommandFilter)||t.debugCommandFilter(e))if(e instanceof ClearCommand)e.execute(i,r);else{e.debugShowBoundingVolume&&defined(e.boundingVolume)&&debugShowBoundingVolume(e,t,r,n),a.useLogDepth&&defined(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);n=a.passes;if(!n.pick&&!n.depth&&t._hdr&&defined(e.derivedCommands)&&defined(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),n.pick||n.depth){if(n.pick&&!n.depth&&defined(e.derivedCommands.picking))return void(e=e.derivedCommands.picking.pickCommand).execute(i,r);if(defined(e.derivedCommands.depth))return void(e=e.derivedCommands.depth.depthOnlyCommand).execute(i,r)}t.debugShowCommands||t.debugShowFrustums?t._debugInspector.executeDebugShowFrustumsCommand(t,e,r):(a.shadowState.lightShadowsEnabled&&e.receiveShadows&&defined(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand:e).execute(i,r)}}function executeIdCommand(e,t,i,r){var n=t._frameState,t=e.derivedCommands;defined(t)&&(n.useLogDepth&&defined(t.logDepth)&&(e=t.logDepth.command),defined((t=e.derivedCommands).picking)?(e=t.picking.pickCommand).execute(i,r):defined(t.depth)&&(e=t.depth.depthOnlyCommand).execute(i,r))}function backToFront(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function frontToBack(e,t,i){return e.boundingVolume.distanceSquaredTo(i)-t.boundingVolume.distanceSquaredTo(i)+CesiumMath.EPSILON12}function executeTranslucentCommandsBackToFront(e,t,i,r,n){var a=e.context;mergeSort(r,backToFront,e.camera.positionWC),defined(n)&&t(n.unclassifiedCommand,e,a,i);for(var o=r.length,s=0;s<o;++s)t(r[s],e,a,i)}function executeTranslucentCommandsFrontToBack(e,t,i,r,n){var a=e.context;mergeSort(r,frontToBack,e.camera.positionWC),defined(n)&&t(n.unclassifiedCommand,e,a,i);for(var o=r.length,s=0;s<o;++s)t(r[s],e,a,i)}function getDebugGlobeDepth(e,t){var i=e._view.debugGlobeDepths,r=i[t];return!defined(r)&&e.context.depthTexture&&(r=new GlobeDepth,i[t]=r),r}var transformFrom2D=Matrix4.inverseTransformation(transformFrom2D,transformFrom2D),scratchPerspectiveFrustum=new PerspectiveFrustum,scratchPerspectiveOffCenterFrustum=new PerspectiveOffCenterFrustum,scratchOrthographicFrustum=new OrthographicFrustum,scratchOrthographicOffCenterFrustum=new OrthographicOffCenterFrustum;function executeCommands(e,t){var i,r=e.camera,n=e.context,a=e.frameState,o=n.uniformState;o.updateCamera(r),(i=defined(r.frustum.fov)?r.frustum.clone(scratchPerspectiveFrustum):defined(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(scratchPerspectiveOffCenterFrustum):defined(r.frustum.width)?r.frustum.clone(scratchOrthographicFrustum):r.frustum.clone(scratchOrthographicOffCenterFrustum)).near=r.frustum.near,i.far=r.frustum.far,o.updateFrustum(i),o.updatePass(Pass$1.ENVIRONMENT);var s,l=a.passes,c=l.pick,u=e._environmentState,d=e._view,h=u.renderTranslucentDepthForPick,p=u.useWebVR;c||(defined(s=u.skyBoxCommand)&&executeCommand(s,e,n,t),u.isSkyAtmosphereVisible&&executeCommand(u.skyAtmosphereCommand,e,n,t),u.isSunVisible&&(u.sunDrawCommand.execute(n,t),e.sunBloom&&!p&&(p=u.useGlobeDepthFramebuffer?d.globeDepth.framebuffer:u.usePostProcess?d.sceneFramebuffer.getFramebuffer():u.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,p),t.framebuffer=p)),u.isMoonVisible&&u.moonCommand.execute(n,t));for(var m,f=u.useOIT?(defined(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r,n){d.oit.executeCommands(e,t,i,r,n)}),e._executeOITFunction):l.render?executeTranslucentCommandsBackToFront:executeTranslucentCommandsFrontToBack,g=d.frustumCommandsList,_=g.length,y=u.clearGlobeDepth,C=u.useDepthPlane,v=e._globeTranslucencyState,S=v.translucent,T=e._view.globeTranslucencyFramebuffer,x=(u.separatePrimitiveFramebuffer=!1,e._depthClearCommand),b=e._stencilClearCommand,E=e._classificationStencilClearCommand,P=e._depthPlane,A=u.usePostProcessSelected,w=r.position.z,D=0;D<_;++D){var M=_-D-1,I=g[M];e.mode===SceneMode$1.SCENE2D?(r.position.z=w-I.near+1,i.far=Math.max(1,I.far-I.near),i.near=1,o.update(a)):(i.near=0!=M?I.near*e.opaqueFrustumNearOffset:I.near,i.far=I.far),o.updateFrustum(i);var R,O=e.debugShowGlobeDepth?getDebugGlobeDepth(e,M):d.globeDepth;0,e.debugShowGlobeDepth&&defined(O)&&u.useGlobeDepthFramebuffer&&(O.update(n,t,d.viewport,e._hdr,y),O.clear(n,t,e._clearColorCommand.color),R=t.framebuffer,t.framebuffer=O.framebuffer),x.execute(n,t),n.stencilBuffer&&b.execute(n,t),o.updatePass(Pass$1.GLOBE);var L,F=I.commands[Pass$1.GLOBE],N=I.indices[Pass$1.GLOBE];if(S)v.executeGlobeCommands(I,executeCommand,T,e,t);else for(m=0;m<N;++m)executeCommand(F[m],e,n,t);if(defined(O)&&u.useGlobeDepthFramebuffer&&O.executeCopyDepth(n,t),e.debugShowGlobeDepth&&defined(O)&&u.useGlobeDepthFramebuffer&&(t.framebuffer=R),!u.renderTranslucentDepthForPick)if(o.updatePass(Pass$1.TERRAIN_CLASSIFICATION),F=I.commands[Pass$1.TERRAIN_CLASSIFICATION],N=I.indices[Pass$1.TERRAIN_CLASSIFICATION],S)v.executeGlobeClassificationCommands(I,executeCommand,T,e,t);else for(m=0;m<N;++m)executeCommand(F[m],e,n,t);if(y&&(x.execute(n,t),C&&P.execute(n,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],m=0;m<N;++m)executeCommand(F[m],e,n,t);if(0<N&&(defined(O)&&u.useGlobeDepthFramebuffer&&O.executeUpdateDepth(n,t,y),!u.renderTranslucentDepthForPick))for(o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<N;++m)executeCommand(F[m],e,n,t)}else{e._invertClassification.clear(n,t);var B=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo,o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],m=0;m<N;++m)executeCommand(F[m],e,n,t);for(defined(O)&&u.useGlobeDepthFramebuffer&&O.executeUpdateDepth(n,t,y),o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],m=0;m<N;++m)executeCommand(F[m],e,n,t);for(t.framebuffer=B,e._invertClassification.executeClassified(n,t),1===a.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(n,t),0<N&&n.stencilBuffer&&E.execute(n,t),o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<N;++m)executeCommand(F[m],e,n,t)}for(0<N&&n.stencilBuffer&&b.execute(n,t),o.updatePass(Pass$1.OPAQUE),F=I.commands[Pass$1.OPAQUE],N=I.indices[Pass$1.OPAQUE],m=0;m<N;++m)executeCommand(F[m],e,n,t);if(0!=M&&e.mode!==SceneMode$1.SCENE2D&&(i.near=I.near,o.updateFrustum(i)),!c&&u.useInvertClassification&&a.invertClassificationColor.alpha<1&&(L=e._invertClassification),o.updatePass(Pass$1.TRANSLUCENT),(F=I.commands[Pass$1.TRANSLUCENT]).length=I.indices[Pass$1.TRANSLUCENT],f(e,executeCommand,t,F,L),0<I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION]&&d.translucentTileClassification.isSupported()&&(d.translucentTileClassification.executeTranslucentCommands(e,executeCommand,t,F,O.framebuffer),d.translucentTileClassification.executeClassificationCommands(e,executeCommand,t,I)),n.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||h)&&(O=(h?t:O).framebuffer.depthStencilTexture,(V=e._picking.getPickDepth(e,M)).update(n,O),V.executeCopyDepth(n,t)),!c&&A){var V=t.framebuffer;if(t.framebuffer=d.sceneFramebuffer.getIdFramebuffer(),i.near=0!=M?I.near*e.opaqueFrustumNearOffset:I.near,i.far=I.far,o.updateFrustum(i),o.updatePass(Pass$1.GLOBE),F=I.commands[Pass$1.GLOBE],N=I.indices[Pass$1.GLOBE],S)v.executeGlobeCommands(I,executeIdCommand,T,e,t);else for(m=0;m<N;++m)executeIdCommand(F[m],e,n,t);for(y&&(x.framebuffer=t.framebuffer,x.execute(n,t),x.framebuffer=void 0),y&&C&&P.execute(n,t),o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],m=0;m<N;++m)executeIdCommand(F[m],e,n,t);for(o.updatePass(Pass$1.OPAQUE),F=I.commands[Pass$1.OPAQUE],N=I.indices[Pass$1.OPAQUE],m=0;m<N;++m)executeIdCommand(F[m],e,n,t);for(o.updatePass(Pass$1.TRANSLUCENT),F=I.commands[Pass$1.TRANSLUCENT],N=I.indices[Pass$1.TRANSLUCENT],m=0;m<N;++m)executeIdCommand(F[m],e,n,t);t.framebuffer=V}}}function executeComputeCommands(e){e.context.uniformState.updatePass(Pass$1.COMPUTE);var t=e._environmentState.sunComputeCommand;defined(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;n<r;++n)i[n].execute(e._computeEngine)}function executeOverlayCommands(e,t){e.context.uniformState.updatePass(Pass$1.OVERLAY);for(var i=e.context,r=e._overlayCommandList,n=r.length,a=0;a<n;++a)r[a].execute(i,t)}function insertShadowCastCommands(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,a=i.passes,o=a.length,s=t.length,l=0;l<s;++l){var c=t[l];if(e.updateDerivedCommands(c),c.castShadows&&(c.pass===Pass$1.GLOBE||c.pass===Pass$1.CESIUM_3D_TILE||c.pass===Pass$1.OPAQUE||c.pass===Pass$1.TRANSLUCENT)&&e.isVisible(c,r))if(n)for(var u=0;u<o;++u)a[u].commandList.push(c);else if(1===o)a[0].commandList.push(c);else for(var d=!1,h=o-1;0<=h;--h){var p=a[h].cullingVolume;if(e.isVisible(c,p))a[h].commandList.push(c),d=!0;else if(d)break}}}function executeShadowMapCastCommands(e){var t=e.frameState,i=t.shadowState.shadowMaps,r=i.length;if(t.shadowState.shadowsEnabled)for(var n=e.context,a=n.uniformState,o=0;o<r;++o){var s=i[o];if(!s.outOfView){for(var l=s.passes,c=l.length,u=0;u<c;++u)l[u].commandList.length=0;for(insertShadowCastCommands(e,e.frameState.commandList,s),u=0;u<c;++u){var d=s.passes[u];a.updateCamera(d.camera),s.updatePass(n,u);for(var h=d.commandList.length,p=0;p<h;++p){var m=d.commandList[p];a.updatePass(m.pass),executeCommand(m.derivedCommands.shadows.castCommands[o],e,n,d.passState)}}}}}var scratchEyeTranslation=new Cartesian3;function executeWebVRCommands(e,t,i){var r=e._view,n=r.camera,a=e._environmentState.renderTranslucentDepthForPick;updateAndClearFramebuffers(e,t,i),a||updateAndRenderPrimitives(e),r.createPotentiallyVisibleSet(e),a||(executeComputeCommands(e),executeShadowMapCastCommands(e));var o=t.viewport;o.x=0,o.y=0,o.width=.5*o.width;var s=Camera.clone(n,e._cameraVR);s.frustum=n.frustum;var l=n.frustum.near,i=l*defaultValue(e.focalLength,5),r=defaultValue(e.eyeSeparation,i/30),a=Cartesian3.multiplyByScalar(s.right,.5*r,scratchEyeTranslation);n.frustum.aspectRatio=o.width/o.height;i=.5*r*l/i;Cartesian3.add(s.position,a,n.position),n.frustum.xOffset=i,executeCommands(e,t),o.x=o.width,Cartesian3.subtract(s.position,a,n.position),n.frustum.xOffset=-i,executeCommands(e,t),Camera.clone(s,n)}Scene.prototype.updateAndExecuteCommands=function(e,t){var i=this._frameState.mode;this._environmentState.useWebVR?executeWebVRCommands(this,e,t):i!==SceneMode$1.SCENE2D||this._mapMode2D===MapMode2D$1.ROTATE?executeCommandsInViewport(!0,this,e,t):(updateAndClearFramebuffers(this,e,t),execute2DViewportCommands(this,e))};var scratch2DViewportCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratch2DViewportMaxCoord=new Cartesian3,scratch2DViewportSavedPosition=new Cartesian3,scratch2DViewportTransform=new Matrix4,scratch2DViewportCameraTransform=new Matrix4,scratch2DViewportEyePoint=new Cartesian3,scratch2DViewportWindowCoords=new Cartesian3,scratch2DViewport=new BoundingRectangle;function execute2DViewportCommands(e,t){var i=e.context,r=e.frameState,n=e.camera,a=t.viewport,o=BoundingRectangle.clone(a,scratch2DViewport);t.viewport=o;var s=scratch2DViewportMaxCoord;e.mapProjection.project(scratch2DViewportCartographic,s);var l=Cartesian3.clone(n.position,scratch2DViewportSavedPosition),c=Matrix4.clone(n.transform,scratch2DViewportCameraTransform),u=n.frustum.clone();n._setTransform(Matrix4.IDENTITY);var d=Matrix4.computeViewportTransformation(o,0,1,scratch2DViewportTransform),h=n.frustum.projectionMatrix,p=n.positionWC.y,m=Cartesian3.fromElements(CesiumMath.sign(p)*s.x-p,0,-n.positionWC.x,scratch2DViewportEyePoint),f=Transforms.pointToGLWindowCoordinates(h,d,m,scratch2DViewportWindowCoords);f.x=Math.floor(f.x);h=o.x,d=o.width;0===p||f.x<=h||f.x>=h+d?executeCommandsInViewport(!0,e,t):(Math.abs(h+.5*d-f.x)<1?(o.width=f.x-o.x,n.position.x*=CesiumMath.sign(n.position.x),n.frustum.right=0,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=f.x,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=0):f.x>h+.5*d?(o.width=f.x-h,m=n.frustum.right,n.frustum.right=s.x-p,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=f.x,o.width=h+d-f.x,n.position.x=-n.position.x,n.frustum.left=-n.frustum.right,n.frustum.right=m-2*n.frustum.right):(o.x=f.x,o.width=h+d-f.x,d=n.frustum.left,n.frustum.left=-s.x-p,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=h,o.width=f.x-h,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=d-2*n.frustum.left),r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!1,e,t)),n._setTransform(c),Cartesian3.clone(l,n.position),n.frustum=u.clone(),t.viewport=a}function executeCommandsInViewport(e,t,i,r){var n=t._environmentState,a=t._view,n=n.renderTranslucentDepthForPick;e||n||(t.frameState.commandList.length=0),n||updateAndRenderPrimitives(t),a.createPotentiallyVisibleSet(t),e&&(defined(r)&&updateAndClearFramebuffers(t,i,r),n||(executeComputeCommands(t),executeShadowMapCastCommands(t))),executeCommands(t,i)}var scratchCullingVolume=new CullingVolume;function updateDebugFrustumPlanes(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new DebugCameraPrimitive({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),defined(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function updateShadowMaps(e){var t=e._frameState,i=t.shadowMaps,r=i.length,e=0<r&&!t.passes.pick&&e.mode===SceneMode$1.SCENE3D;if(e!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=e),t.shadowState.lightShadowsEnabled=!1,e){for(var n=0;n<r;++n)if(i[n]!==t.shadowState.shadowMaps[n]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0;for(var a=t.shadowState.lightShadowMaps.length=0;a<r;++a){var o=i[a];o.update(t),t.shadowState.shadowMaps.push(o),o.fromLightSource&&(t.shadowState.lightShadowMaps.push(o),t.shadowState.lightShadowsEnabled=!0),o.dirty&&(++t.shadowState.lastDirtyTime,o.dirty=!1)}}}function updateAndRenderPrimitives(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),updateDebugFrustumPlanes(e),updateShadowMaps(e),e._globe&&e._globe.render(t)}function updateAndClearFramebuffers(e,t,i){var r=e._context,n=e._frameState,a=e._environmentState,o=e._view,s=e._frameState.passes.pick,l=a.useWebVR;a.originalFramebuffer=t.framebuffer,defined(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new SunPostProcess:defined(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!defined(e.sun)&&defined(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var c=e._clearColorCommand;Color.clone(i,c.color),c.execute(r,t);var u=a.useGlobeDepthFramebuffer=defined(o.globeDepth);u&&(o.globeDepth.update(r,t,o.viewport,e._hdr,a.clearGlobeDepth),o.globeDepth.clear(r,t,i));var d=o.oit,h=a.useOIT=!s&&defined(d)&&d.isSupported();h&&(d.update(r,t,o.globeDepth.framebuffer,e._hdr),d.clear(r,t,i),a.useOIT=d.isSupported());var p,m=e.postProcessStages,f=a.usePostProcess=!s&&(e._hdr||0<m.length||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);a.usePostProcessSelected=!1,f&&(o.sceneFramebuffer.update(r,o.viewport,e._hdr),o.sceneFramebuffer.clear(r,t,i),m.update(r,n.useLogDepth,e._hdr),m.clear(r),f=a.usePostProcess=m.ready,a.usePostProcessSelected=f&&m.hasSelected),a.isSunVisible&&e.sunBloom&&!l?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(r,t,i)):u?t.framebuffer=o.globeDepth.framebuffer:f&&(t.framebuffer=o.sceneFramebuffer.getFramebuffer()),defined(t.framebuffer)&&c.execute(r,t),(a.useInvertClassification=!s&&defined(t.framebuffer)&&e.invertClassification)&&(defined(p=1===e.frameState.invertClassificationColor.alpha&&a.useGlobeDepthFramebuffer?o.globeDepth.framebuffer:p)||r.depthTexture?(e._invertClassification.previousFramebuffer=p,e._invertClassification.update(r),e._invertClassification.clear(r,t),e.frameState.invertClassificationColor.alpha<1&&h&&((h=(p=e._invertClassification.unclassifiedCommand).derivedCommands).oit=d.createDerivedCommands(p,r,h.oit))):a.useInvertClassification=!1),e._globeTranslucencyState.translucent&&o.globeTranslucencyFramebuffer.updateAndClear(e._hdr,o.viewport,r,t)}function callAfterRenderFunctions(e){for(var t=e._frameState.afterRender,i=0,r=t.length;i<r;++i)t[i](),e.requestRender();t.length=0}function getGlobeHeight(e){var t=e._globe,e=e.camera.positionCartographic;if(defined(t)&&t.show&&defined(e))return t.getHeight(e)}function isCameraUnderground(e){var t=e.camera,i=e._mode,r=e.globe,n=e._screenSpaceCameraController,t=t.positionCartographic;if(!defined(t))return!1;if(!n.onMap()&&t.height<0)return!0;if(!defined(r)||!r.show||i===SceneMode$1.SCENE2D||i===SceneMode$1.MORPHING)return!1;e=e._globeHeight;return defined(e)&&t.height<e}function updateDebugShowFramesPerSecond(e,t){var i,r;e.debugShowFramesPerSecond?(defined(e._performanceDisplay)||((i=document.createElement("div")).className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(i),r=new PerformanceDisplay({container:i}),e._performanceDisplay=r,e._performanceContainer=i),e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)):defined(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function prePassesUpdate(e){e._jobScheduler.resetBudgets();var t=e._frameState;e.primitives.prePassesUpdate(t),defined(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function postPassesUpdate(e){var t=e._frameState;e.primitives.postPassesUpdate(t),RequestScheduler.update()}Scene.prototype.updateEnvironment=function(){var e=this._frameState,t=this._view,i=this._environmentState,r=e.passes.render,n=e.passes.offscreen,a=this.skyAtmosphere,o=this.globe,s=this._globeTranslucencyState;!r||this._mode!==SceneMode$1.SCENE2D&&t.camera.frustum instanceof OrthographicFrustum||!s.environmentVisible?(i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0):(defined(a)?(defined(o)&&(a.setDynamicAtmosphereColor(o.enableLighting&&o.dynamicAtmosphereLighting,o.dynamicAtmosphereLightingFromSun),i.isReadyForAtmosphere=i.isReadyForAtmosphere||0<o._surface._tilesToRender.length),i.skyAtmosphereCommand=a.update(e,o),defined(i.skyAtmosphereCommand)&&this.updateDerivedCommands(i.skyAtmosphereCommand)):i.skyAtmosphereCommand=void 0,i.skyBoxCommand=defined(this.skyBox)?this.skyBox.update(e,this._hdr):void 0,t=defined(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0,i.sunDrawCommand=defined(t)?t.drawCommand:void 0,i.sunComputeCommand=defined(t)?t.computeCommand:void 0,i.moonCommand=defined(this.moon)?this.moon.update(e):void 0);o=i.clearGlobeDepth=defined(o)&&o.show&&(!o.depthTestAgainstTerrain||this.mode===SceneMode$1.SCENE2D);(i.useDepthPlane=o&&this.mode===SceneMode$1.SCENE3D&&s.useDepthPlane)&&this._depthPlane.update(e),i.renderTranslucentDepthForPick=!1,i.useWebVR=this._useWebVR&&this.mode!==SceneMode$1.SCENE2D&&!n;for(var s=e.mode!==SceneMode$1.SCENE3D||s.sunVisibleThroughGlobe?void 0:e.occluder,l=e.cullingVolume,c=scratchCullingVolume.planes,u=0;u<5;++u)c[u]=l.planes[u];l=scratchCullingVolume,i.isSkyAtmosphereVisible=defined(i.skyAtmosphereCommand)&&i.isReadyForAtmosphere,i.isSunVisible=this.isVisible(i.sunDrawCommand,l,s),i.isMoonVisible=this.isVisible(i.moonCommand,l,s);i=this.specularEnvironmentMaps,s=this._specularEnvironmentMapAtlas;!defined(i)||defined(s)&&s.url===i?!defined(i)&&defined(s)&&(s.destroy(),this._specularEnvironmentMapAtlas=void 0):(s=s&&s.destroy(),this._specularEnvironmentMapAtlas=new OctahedralProjectedCubeMap(i)),defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)},Scene.prototype.resolveFramebuffers=function(e){var t=this._context,i=this._frameState,r=this._environmentState,n=this._view,a=n.globeDepth,o=r.useOIT,s=r.useGlobeDepthFramebuffer,l=r.usePostProcess,c=r.originalFramebuffer,u=s?a.framebuffer:void 0,d=n.sceneFramebuffer.getFramebuffer(),h=n.sceneFramebuffer.getIdFramebuffer();r.separatePrimitiveFramebuffer&&a.executeMergeColor(t,e),o&&(e.framebuffer=l?d:c,n.oit.execute(t,e));r=n.translucentTileClassification;r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),l&&(n=this.postProcessStages,r=(s&&!o?u:d).getColorTexture(0),h=h.getColorTexture(0),d=defaultValue(u,d).depthStencilTexture,n.execute(t,r,d,h),n.copy(t,c)),o||l||!s||(e.framebuffer=c,a.executeCopyColor(t,e));i=i.useLogDepth;this.debugShowGlobeDepth&&s&&getDebugGlobeDepth(this,this.debugShowDepthFrustum-1).executeDebugGlobeDepth(t,e,i),this.debugShowPickDepth&&s&&this._picking.getPickDepth(this,this.debugShowDepthFrustum-1).executeDebugPickDepth(t,e,i)},Scene.prototype.initializeFrame=function(){120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=getGlobeHeight(this),this._cameraUnderground=isCameraUnderground(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),defined(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};var scratchBackgroundColor=new Color;function render(e){var t=e._frameState,i=e.context,r=i.uniformState,n=e._defaultView;e._view=n,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=renderTilesetPassState;var a=defaultValue(e.backgroundColor,Color.BLACK);e._hdr&&((a=Color.clone(a,scratchBackgroundColor)).red=Math.pow(a.red,e.gamma),a.green=Math.pow(a.green,e.gamma),a.blue=Math.pow(a.blue,e.gamma)),t.backgroundColor=a,e.fog.update(t),r.update(t);var o=e.shadowMap;defined(o)&&o.enabled&&(!defined(e.light)||e.light instanceof SunLight?Cartesian3.negate(r.sunDirectionWC,e._shadowMapCamera.direction):Cartesian3.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(o)),e._computeCommandList.length=0,e._overlayCommandList.length=0;o=n.viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;n=n.passState;n.framebuffer=void 0,n.blendingEnabled=void 0,n.scissorTest=void 0,n.viewport=BoundingRectangle.clone(o,n.viewport),defined(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(n,a),e.resolveFramebuffers(n),n.framebuffer=void 0,executeOverlayCommands(e,n),defined(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),i.endFrame()}function tryAndCatchError(t,e){try{e(t)}catch(e){if(t._renderError.raiseEvent(t,e),t.rethrowRenderErrors)throw e}}function updateMostDetailedRayPicks(e){return e._picking.updateMostDetailedRayPicks(e)}function updatePreloadPass(e){var t=e._frameState;preloadTilesetPassState.camera=t.camera,preloadTilesetPassState.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,preloadTilesetPassState)}function updatePreloadFlightPass(e){var t=e._frameState;t.camera.canPreloadFlight()&&(preloadFlightTilesetPassState.camera=e.preloadFlightCamera,preloadFlightTilesetPassState.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,preloadFlightTilesetPassState))}function updateRequestRenderModeDeferCheckPass(e){e.primitives.updateForPass(e._frameState,requestRenderModeDeferCheckPassState)}Scene.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);var t=this._frameState;t.newFrame=!1,defined(e)||(e=JulianDate.now());var i=this._view.checkForCameraUpdates(this),r=!this.requestRenderMode||this._renderRequested||i||this._logDepthBufferDirty||this._hdrDirty||this.mode===SceneMode$1.MORPHING;!r&&defined(this.maximumRenderTimeChange)&&defined(this._lastRenderTime)&&(i=Math.abs(JulianDate.secondsDifference(this._lastRenderTime,e)),r=r||i>this.maximumRenderTimeChange),r&&(this._lastRenderTime=JulianDate.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1,updateFrameNumber(this,CesiumMath.incrementWrap(t.frameNumber,15e6,1),e),t.newFrame=!0),tryAndCatchError(this,prePassesUpdate),this.primitives.show&&(tryAndCatchError(this,updateMostDetailedRayPicks),tryAndCatchError(this,updatePreloadPass),tryAndCatchError(this,updatePreloadFlightPass),r||tryAndCatchError(this,updateRequestRenderModeDeferCheckPass)),this._postUpdate.raiseEvent(this,e),r&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),tryAndCatchError(this,render)),updateDebugShowFramesPerSecond(this,r),tryAndCatchError(this,postPassesUpdate),callAfterRenderFunctions(this),r&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())},Scene.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},Scene.prototype.requestRender=function(){this._renderRequested=!0},Scene.prototype.clampLineWidth=function(e){return Math.max(ContextLimits.minimumAliasedLineWidth,Math.min(e,ContextLimits.maximumAliasedLineWidth))},Scene.prototype.pick=function(e,t,i){return this._picking.pick(this,e,t,i)},Scene.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)},Scene.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)},Scene.prototype.drillPick=function(e,t,i,r){return this._picking.drillPick(this,e,t,i,r)},Scene.prototype.pickFromRay=function(e,t,i){return this._picking.pickFromRay(this,e,t,i)},Scene.prototype.drillPickFromRay=function(e,t,i,r){return this._picking.drillPickFromRay(this,e,t,i,r)},Scene.prototype.pickFromRayMostDetailed=function(e,t,i){return this._picking.pickFromRayMostDetailed(this,e,t,i)},Scene.prototype.drillPickFromRayMostDetailed=function(e,t,i,r){return this._picking.drillPickFromRayMostDetailed(this,e,t,i,r)},Scene.prototype.sampleHeight=function(e,t,i){return this._picking.sampleHeight(this,e,t,i)},Scene.prototype.clampToHeight=function(e,t,i,r){return this._picking.clampToHeight(this,e,t,i,r)},Scene.prototype.sampleHeightMostDetailed=function(e,t,i){return this._picking.sampleHeightMostDetailed(this,e,t,i)},Scene.prototype.clampToHeightMostDetailed=function(e,t,i){return this._picking.clampToHeightMostDetailed(this,e,t,i)},Scene.prototype.cartesianToCanvasCoordinates=function(e,t){return SceneTransforms.wgs84ToWindowCoordinates(this,e,t)},Scene.prototype.completeMorph=function(){this._transitioner.completeMorph()},Scene.prototype.morphTo2D=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphTo2D(e,t)},Scene.prototype.morphToColumbusView=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphToColumbusView(e,t)},Scene.prototype.morphTo3D=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphTo3D(e,t)},Scene.prototype.isDestroyed=function(){return!1},Scene.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.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(),defined(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(var e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,destroyObject(this)};var SkyAtmosphereCommon="const float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nconst float g = -0.95;\nconst float g2 = g * g;\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nuniform vec3 u_radiiAndDynamicAtmosphereColor;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvec3 getLightDirection(vec3 positionWC)\n{\nfloat lightEnum = u_radiiAndDynamicAtmosphereColor.z;\nvec3 lightDirection =\npositionWC * float(lightEnum == 0.0) +\nczm_lightDirectionWC * float(lightEnum == 1.0) +\nczm_sunDirectionWC * float(lightEnum == 2.0);\nreturn normalize(lightDirection);\n}\nvoid calculateRayScatteringFromSpace(in vec3 positionWC, in vec3 ray, in float innerRadius, in float outerRadius, inout float far, out vec3 start, out float startOffset)\n{\nfloat cameraHeight = length(positionWC);\nfloat B = 2.0 * dot(positionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B * B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nstart = positionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth);\nstartOffset = startDepth * scale(startAngle);\n}\nvoid calculateRayScatteringFromGround(in vec3 positionWC, in vec3 ray, in float atmosphereScale, in float innerRadius, out vec3 start, out float startOffset)\n{\nfloat cameraHeight = length(positionWC);\nstart = positionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nstartOffset = depth*scale(startAngle);\n}\nczm_raySegment rayEllipsoidIntersection(czm_ray ray, vec3 inverseRadii)\n{\nvec3 o = inverseRadii * (czm_inverseView * vec4(ray.origin, 1.0)).xyz;\nvec3 d = inverseRadii * (czm_inverseView * vec4(ray.direction, 0.0)).xyz;\nfloat a = dot(d, d);\nfloat b = dot(d, o);\nfloat c = dot(o, o) - 1.0;\nfloat discriminant = b * b - a * c;\nif (discriminant < 0.0)\n{\nreturn czm_emptyRaySegment;\n}\ndiscriminant = sqrt(discriminant);\nfloat t1 = (-b - discriminant) / a;\nfloat t2 = (-b + discriminant) / a;\nif (t1 < 0.0 && t2 < 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nif (t1 < 0.0 && t2 >= 0.0)\n{\nt1 = 0.0;\n}\nreturn czm_raySegment(t1, t2);\n}\nvec3 getAdjustedPosition(vec3 positionWC, float innerRadius)\n{\nfloat cameraHeight = czm_eyeHeight + innerRadius;\nreturn normalize(positionWC) * cameraHeight;\n}\nvec3 getTranslucentPosition(vec3 positionWC, vec3 outerPositionWC, float innerRadius, out bool intersectsEllipsoid)\n{\nvec3 directionWC = normalize(outerPositionWC - positionWC);\nvec3 directionEC = czm_viewRotation * directionWC;\nczm_ray viewRay = czm_ray(vec3(0.0), directionEC);\nczm_raySegment raySegment = rayEllipsoidIntersection(viewRay, czm_ellipsoidInverseRadii);\nintersectsEllipsoid = raySegment.start >= 0.0;\nif (intersectsEllipsoid)\n{\nreturn positionWC + raySegment.stop * directionWC;\n}\nreturn getAdjustedPosition(positionWC, innerRadius);\n}\nvoid calculateMieColorAndRayleighColor(vec3 outerPositionWC, out vec3 mieColor, out vec3 rayleighColor)\n{\nfloat outerRadius = u_radiiAndDynamicAtmosphereColor.x;\nfloat innerRadius = u_radiiAndDynamicAtmosphereColor.y;\n#ifdef GLOBE_TRANSLUCENT\nbool intersectsEllipsoid = false;\nvec3 startPositionWC = getTranslucentPosition(czm_viewerPositionWC, outerPositionWC, innerRadius, intersectsEllipsoid);\n#else\nvec3 startPositionWC = getAdjustedPosition(czm_viewerPositionWC, innerRadius);\n#endif\nvec3 lightDirection = getLightDirection(startPositionWC);\nvec3 ray = outerPositionWC - startPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\nvec3 start;\nfloat startOffset;\n#ifdef SKY_FROM_SPACE\n#ifdef GLOBE_TRANSLUCENT\nif (intersectsEllipsoid)\n{\ncalculateRayScatteringFromGround(startPositionWC, ray, atmosphereScale, innerRadius, start, startOffset);\n}\nelse\n{\ncalculateRayScatteringFromSpace(startPositionWC, ray, innerRadius, outerRadius, far, start, startOffset);\n}\n#else\ncalculateRayScatteringFromSpace(startPositionWC, ray, innerRadius, outerRadius, far, start, startOffset);\n#endif\n#else\ncalculateRayScatteringFromGround(startPositionWC, ray, atmosphereScale, innerRadius, start, startOffset);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nfor (int i = 0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDirection, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nmieColor = frontColor * KmESun;\nrayleighColor = frontColor * (InvWavelength * KrESun);\nmieColor = min(mieColor, vec3(10000000.0));\nrayleighColor = min(rayleighColor, vec3(10000000.0));\n}\nvec4 calculateFinalColor(vec3 positionWC, vec3 toCamera, vec3 lightDirection, vec3 mieColor, vec3 rayleighColor)\n{\nfloat cosAngle = dot(lightDirection, normalize(toCamera)) / length(toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nvec3 rgb = rayleighPhase * rayleighColor + miePhase * mieColor;\nconst float exposure = 2.0;\nvec3 rgbExposure = vec3(1.0) - exp(-exposure * rgb);\n#ifndef HDR\nrgb = rgbExposure;\n#endif\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\n#endif\nfloat outerRadius = u_radiiAndDynamicAtmosphereColor.x;\nfloat innerRadius = u_radiiAndDynamicAtmosphereColor.y;\nfloat lightEnum = u_radiiAndDynamicAtmosphereColor.z;\nfloat cameraHeight = czm_eyeHeight + innerRadius;\nfloat atmosphereAlpha = clamp((outerRadius - cameraHeight) / (outerRadius - innerRadius), 0.0, 1.0);\nfloat nightAlpha = (lightEnum != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;\natmosphereAlpha *= pow(nightAlpha, 0.5);\nvec4 finalColor = vec4(rgb, mix(clamp(rgbExposure.b, 0.0, 1.0), 1.0, atmosphereAlpha) * smoothstep(0.0, 1.0, czm_morphTime));\nif (mieColor.b > 1.0)\n{\nfloat strength = mieColor.b;\nfloat minDistance = outerRadius;\nfloat maxDistance = outerRadius * 3.0;\nfloat maxStrengthLerp = 1.0 - clamp((maxDistance - cameraHeight) / (maxDistance - minDistance), 0.0, 1.0);\nfloat maxStrength = mix(100.0, 10000.0, maxStrengthLerp);\nstrength = min(strength, maxStrength);\nfloat alpha = 1.0 - (strength / maxStrength);\nfinalColor.a = alpha;\n}\nreturn finalColor;\n}\n",SkyAtmosphereFS="varying vec3 v_outerPositionWC;\n#ifndef PER_FRAGMENT_ATMOSPHERE\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvoid main (void)\n{\nvec3 toCamera = czm_viewerPositionWC - v_outerPositionWC;\nvec3 lightDirection = getLightDirection(czm_viewerPositionWC);\nvec3 mieColor;\nvec3 rayleighColor;\n#ifdef PER_FRAGMENT_ATMOSPHERE\ncalculateMieColorAndRayleighColor(v_outerPositionWC, mieColor, rayleighColor);\n#else\nmieColor = v_mieColor;\nrayleighColor = v_rayleighColor;\n#endif\ngl_FragColor = calculateFinalColor(czm_viewerPositionWC, toCamera, lightDirection, mieColor, rayleighColor);\n}\n",SkyAtmosphereVS="attribute vec4 position;\nvarying vec3 v_outerPositionWC;\n#ifndef PER_FRAGMENT_ATMOSPHERE\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvoid main(void)\n{\nvec4 positionWC = czm_model * position;\n#ifndef PER_FRAGMENT_ATMOSPHERE\ncalculateMieColorAndRayleighColor(positionWC.xyz, v_mieColor, v_rayleighColor);\n#endif\nv_outerPositionWC = positionWC.xyz;\ngl_Position = czm_modelViewProjection * position;\n}\n";function SkyAtmosphere(e){e=defaultValue(e,Ellipsoid.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;var t=Cartesian3.multiplyByScalar(e.radii,1.025,new Cartesian3);this._scaleMatrix=Matrix4.fromScale(t),this._modelMatrix=new Matrix4,this._command=new DrawCommand({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Cartesian3;t=new Cartesian3;t.x=1.025*e.maximumRadius,t.y=e.maximumRadius,t.z=0,this._radiiAndDynamicAtmosphereColor=t;var i=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return i._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return i._hueSaturationBrightness.x=i.hueShift,i._hueSaturationBrightness.y=i.saturationShift,i._hueSaturationBrightness.z=i.brightnessShift,i._hueSaturationBrightness}}}Object.defineProperties(SkyAtmosphere.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),SkyAtmosphere.prototype.setDynamicAtmosphereColor=function(e,t){this._radiiAndDynamicAtmosphereColor.z=e?t?2:1:0};var scratchModelMatrix$1=new Matrix4;function hasColorCorrection(e){return!(CesiumMath.equalsEpsilon(e.hueShift,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(e.saturationShift,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(e.brightnessShift,0,CesiumMath.EPSILON7))}SkyAtmosphere.prototype.update=function(e,t){if(this.show){var i=e.mode;if((i===SceneMode$1.SCENE3D||i===SceneMode$1.MORPHING)&&e.passes.render){var r=Matrix4.fromRotationTranslation(e.context.uniformState.inverseViewRotation,Cartesian3.ZERO,scratchModelMatrix$1),n=Matrix4.multiplyTransformation(r,Axis$1.Y_UP_TO_Z_UP,scratchModelMatrix$1),a=Matrix4.multiply(this._scaleMatrix,n,scratchModelMatrix$1);Matrix4.clone(a,this._modelMatrix);i=e.context,r=hasColorCorrection(this),n=e.globeTranslucencyState.translucent,a=this.perFragmentAtmosphere||n||!defined(t)||!t.show,t=this._command;defined(t.vertexArray)||(o=EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:VertexFormat.POSITION_ONLY})),t.vertexArray=VertexArray.fromGeometry({context:i,geometry:o,attributeLocations:GeometryPipeline.createAttributeLocations(o),bufferUsage:BufferUsage$1.STATIC_DRAW}),t.renderState=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},blending:BlendingState$1.ALPHA_BLEND,depthMask:!1}));var o=r|a<<2|n<<3;o!==this._flags&&(this._flags=o,o=[],r&&o.push("COLOR_CORRECT"),a&&o.push("PER_FRAGMENT_ATMOSPHERE"),n&&o.push("GLOBE_TRANSLUCENT"),a=new ShaderSource({defines:o.concat("SKY_FROM_SPACE"),sources:[SkyAtmosphereCommon,SkyAtmosphereVS]}),n=new ShaderSource({defines:o.concat("SKY_FROM_SPACE"),sources:[SkyAtmosphereCommon,SkyAtmosphereFS]}),this._spSkyFromSpace=ShaderProgram.fromCache({context:i,vertexShaderSource:a,fragmentShaderSource:n}),a=new ShaderSource({defines:o.concat("SKY_FROM_ATMOSPHERE"),sources:[SkyAtmosphereCommon,SkyAtmosphereVS]}),n=new ShaderSource({defines:o.concat("SKY_FROM_ATMOSPHERE"),sources:[SkyAtmosphereCommon,SkyAtmosphereFS]}),this._spSkyFromAtmosphere=ShaderProgram.fromCache({context:i,vertexShaderSource:a,fragmentShaderSource:n}));e=e.camera.positionWC;return Cartesian3.magnitude(e)>this._radiiAndDynamicAtmosphereColor.x?t.shaderProgram=this._spSkyFromSpace:t.shaderProgram=this._spSkyFromAtmosphere,t}}},SkyAtmosphere.prototype.isDestroyed=function(){return!1},SkyAtmosphere.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),destroyObject(this)};var SkyBoxFS="uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n",SkyBoxVS="attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n";function SkyBox(e){this.sources=e.sources,this._sources=void 0,this.show=defaultValue(e.show,!0),this._command=new DrawCommand({modelMatrix:Matrix4.clone(Matrix4.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}function SphereEmitter(e){e=defaultValue(e,1),this._radius=defaultValue(e,1)}function StyleExpression(){}SkyBox.prototype.update=function(e,t){var i=this;if(this.show&&(e.mode===SceneMode$1.SCENE3D||e.mode===SceneMode$1.MORPHING)&&e.passes.render){var r=e.context;this._sources!==this.sources&&(this._sources=this.sources,"string"==typeof(n=this.sources).positiveX?loadCubeMap(r,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new CubeMap({context:r,source:n})));var n,a,e=this._command;if(defined(e.vertexArray)||(e.uniformMap={u_cubeMap:function(){return i._cubeMap}},n=BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:VertexFormat.POSITION_ONLY})),a=this._attributeLocations=GeometryPipeline.createAttributeLocations(n),e.vertexArray=VertexArray.fromGeometry({context:r,geometry:n,attributeLocations:a,bufferUsage:BufferUsage$1.STATIC_DRAW}),e.renderState=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND})),defined(e.shaderProgram)&&this._useHdr===t||(a=new ShaderSource({defines:[t?"HDR":""],sources:[SkyBoxFS]}),e.shaderProgram=ShaderProgram.fromCache({context:r,vertexShaderSource:SkyBoxVS,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t),defined(this._cubeMap))return e}},SkyBox.prototype.isDestroyed=function(){return!1},SkyBox.prototype.destroy=function(){var 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(),destroyObject(this)},Object.defineProperties(SphereEmitter.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),SphereEmitter.prototype.emit=function(e){var t=CesiumMath.randomBetween(0,CesiumMath.TWO_PI),i=CesiumMath.randomBetween(0,CesiumMath.PI),r=CesiumMath.randomBetween(0,this._radius),n=r*Math.cos(t)*Math.sin(i),t=r*Math.sin(t)*Math.sin(i),i=r*Math.cos(i);e.position=Cartesian3.fromElements(n,t,i,e.position),e.velocity=Cartesian3.normalize(e.position,e.velocity)},StyleExpression.prototype.evaluate=function(e,t){DeveloperError.throwInstantiationError()},StyleExpression.prototype.evaluateColor=function(e,t){DeveloperError.throwInstantiationError()},StyleExpression.prototype.getShaderFunction=function(e,t,i,r){DeveloperError.throwInstantiationError()};var SunFS="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\ngl_FragColor = czm_gammaCorrect(color);\n}\n",SunTextureFS="uniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction, float lengthScalar)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition) * lengthScalar;\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nfloat lengthScalar = 2.0 / sqrt(2.0);\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position) * lengthScalar;\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(vec2(1.0), surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n",SunVS="attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n";function Sun(){this.show=!0,this._drawCommand=new DrawCommand({primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:new BoundingSphere,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new BoundingSphere,this._boundingVolume2D=new BoundingSphere,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;var e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(Sun.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var scratchPositionWC=new Cartesian2,scratchLimbWC=new Cartesian2,scratchPositionEC=new Cartesian4,scratchCartesian4=new Cartesian4;function TileBoundingVolume(){}function TileCoordinatesImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._color=defaultValue(e.color,Color.YELLOW),this._errorEvent=new Event,this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._readyPromise=when.resolve(!0),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}function TileDiscardPolicy(e){DeveloperError.throwInstantiationError()}Sun.prototype.update=function(e,t,i){if(this.show){var r=e.mode;if(r!==SceneMode$1.SCENE2D&&r!==SceneMode$1.MORPHING&&e.passes.render){var n,a=e.context,o=t.viewport.width,s=t.viewport.height;defined(this._texture)&&o===this._drawingBufferWidth&&s===this._drawingBufferHeight&&!this._glowFactorDirty&&i===this._useHdr||(this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=i,s=Math.max(o,s),s=Math.pow(2,Math.ceil(Math.log(s)/Math.log(2))-2),s=Math.max(1,s),l=i?a.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE,this._texture=new Texture({context:a,width:s,height:s,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:l}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5,(n=this)._commands.computeCommand=new ComputeCommand({fragmentShaderSource:SunTextureFS,outputTexture:this._texture,uniformMap:{u_radiusTS:function(){return n._radiusTS}},persists:!1,owner:this,postExecute:function(){n._commands.computeCommand=void 0}}));var l=this._drawCommand;defined(l.vertexArray)||(h={direction:0},(d=new Uint8Array(8))[0]=0,d[1]=0,d[2]=255,d[3]=0,d[4]=255,d[5]=255,d[6]=0,d[7]=255,c=Buffer$1.createVertexBuffer({context:a,typedArray:d,usage:BufferUsage$1.STATIC_DRAW}),u=[{index:h.direction,vertexBuffer:c,componentsPerAttribute:2,normalize:!0,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE}],d=Buffer$1.createIndexBuffer({context:a,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT}),l.vertexArray=new VertexArray({context:a,attributes:u,indexBuffer:d}),l.shaderProgram=ShaderProgram.fromCache({context:a,vertexShaderSource:SunVS,fragmentShaderSource:SunFS,attributeLocations:h}),l.renderState=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND}),l.uniformMap=this._uniformMap);var c=a.uniformState.sunPositionWC,u=a.uniformState.sunPositionColumbusView,d=this._boundingVolume,h=this._boundingVolume2D;Cartesian3.clone(c,d.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,d.radius=CesiumMath.SOLAR_RADIUS+CesiumMath.SOLAR_RADIUS*this._glowLengthTS,h.radius=d.radius,r===SceneMode$1.SCENE3D?BoundingSphere.clone(d,l.boundingVolume):r===SceneMode$1.COLUMBUS_VIEW&&BoundingSphere.clone(h,l.boundingVolume);c=SceneTransforms.computeActualWgs84Position(e,c,scratchCartesian4),c=Cartesian3.magnitude(Cartesian3.subtract(c,e.camera.position,scratchCartesian4)),e=a.uniformState.projection,a=scratchPositionEC;a.x=0,a.y=0,a.z=-c,a.w=1;c=Matrix4.multiplyByVector(e,a,scratchCartesian4),c=SceneTransforms.clipToGLWindowCoordinates(t.viewport,c,scratchPositionWC);a.x=CesiumMath.SOLAR_RADIUS;a=Matrix4.multiplyByVector(e,a,scratchCartesian4),a=SceneTransforms.clipToGLWindowCoordinates(t.viewport,a,scratchLimbWC);return this._size=Cartesian2.magnitude(Cartesian2.subtract(a,c,scratchCartesian4)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands}}},Sun.prototype.isDestroyed=function(){return!1},Sun.prototype.destroy=function(){var 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(),destroyObject(this)},TileBoundingVolume.prototype.boundingVolume=void 0,TileBoundingVolume.prototype.boundingSphere=void 0,TileBoundingVolume.prototype.distanceToCamera=function(e){DeveloperError.throwInstantiationError()},TileBoundingVolume.prototype.intersectPlane=function(e){DeveloperError.throwInstantiationError()},TileBoundingVolume.prototype.createDebugVolume=function(e){DeveloperError.throwInstantiationError()},Object.defineProperties(TileCoordinatesImageryProvider.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}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),TileCoordinatesImageryProvider.prototype.getTileCredits=function(e,t,i){},TileCoordinatesImageryProvider.prototype.requestImage=function(e,t,i,r){var n=document.createElement("canvas");n.width=256,n.height=256;var a=n.getContext("2d"),o=this._color.toCssColorString();return a.strokeStyle=o,a.lineWidth=2,a.strokeRect(1,1,255,255),a.font="bold 25px Arial",a.textAlign="center",a.fillStyle=o,a.fillText("L: "+i,124,86),a.fillText("X: "+e,124,136),a.fillText("Y: "+t,124,186),n},TileCoordinatesImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},TileDiscardPolicy.prototype.isReady=DeveloperError.throwInstantiationError,TileDiscardPolicy.prototype.shouldDiscardImage=DeveloperError.throwInstantiationError;var TileState={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},TileState$1=Object.freeze(TileState);function TimeDynamicPointCloud(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this.maximumMemoryUsage=defaultValue(e.maximumMemoryUsage,256),this.shading=new PointCloudShading(e.shading),this.style=e.style,this.frameFailed=new Event,this.frameChanged=new Event,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new PointCloudEyeDomeLighting,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._readyPromise=when.defer(),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=arrayFill(new Array(5),0),this._runningAverage=0}function getFragmentShaderLoaded(e){return"uniform vec4 czm_pickColor;\n"+e}function getUniformMapLoaded(t){return function(e){return combine$2(e,{czm_pickColor:function(){return t._pickId.color}})}}function getPickIdLoaded(){return"czm_pickColor"}Object.defineProperties(TimeDynamicPointCloud.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(defined(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise.promise}}}),TimeDynamicPointCloud.prototype.makeStyleDirty=function(){this._styleDirty=!0},TimeDynamicPointCloud.prototype._getAverageLoadTime=function(){return 0===this._runningLength?.05:this._runningAverage};var scratchDate=new JulianDate;function getClockMultiplier(e){var t=e._clock,e=t.canAnimate&&t.shouldAnimate,t=t.multiplier;return e?t:0}function getIntervalIndex(e,t){return e._intervals.indexOf(t.start)}function getNextInterval(e,t){var i=e._intervals,r=e._clock,n=getClockMultiplier(e);if(0!==n){var a=e._getAverageLoadTime(),a=JulianDate.addSeconds(r.currentTime,a*n,scratchDate),a=i.indexOf(a);return a===getIntervalIndex(e,t)&&(0<=n?++a:--a),i.get(a)}}function getCurrentInterval(e){var t=e._intervals,e=e._clock.currentTime,e=t.indexOf(e);return t.get(e)}function reachedInterval(e,t,i){var r=getClockMultiplier(e),t=getIntervalIndex(e,t),i=getIntervalIndex(e,i);return 0<=r?i<=t:t<=i}function handleFrameFailure(t,i){return function(e){e=defined(e.message)?e.message:e.toString();0<t.frameFailed.numberOfListeners?t.frameFailed.raiseEvent({uri:i,message:e}):(console.log("A frame failed to load: "+i),console.log("Error: "+e))}}function requestFrame(t,e,i){var r,n=getIntervalIndex(t,e),a=t._frames,o=a[n];return defined(o)||(r=defined(r=e.data.transform)?Matrix4.fromArray(r):void 0,e=e.data.uri,o={pointCloud:void 0,transform:r,timestamp:getTimestamp$1(),sequential:!0,ready:!1,touchedFrameNumber:i.frameNumber},a[n]=o,Resource.fetchArrayBuffer({url:e}).then(function(e){return o.pointCloud=new PointCloud({arrayBuffer:e,cull:!0,fragmentShaderLoaded:getFragmentShaderLoaded,uniformMapLoaded:getUniformMapLoaded(t),pickIdLoaded:getPickIdLoaded}),o.pointCloud.readyPromise}).otherwise(handleFrameFailure(t,e))),o}function updateAverageLoadTime(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 prepareFrame(e,t,i,r){t.touchedFrameNumber<r.frameNumber-1&&(t.sequential=!1);var n,a,o=t.pointCloud;defined(o)&&!t.ready&&(a=(n=r.commandList).length,renderFrame(e,t,i,r),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,n.length=a,t.sequential&&updateAverageLoadTime(e,(getTimestamp$1()-t.timestamp)/1e3))),t.touchedFrameNumber=r.frameNumber}var scratchModelMatrix=new Matrix4;function getGeometricError(e,t){e=e.shading;return defined(e)&&defined(e.baseResolution)?e.baseResolution:defined(t.boundingSphere)?CesiumMath.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function getMaximumAttenuation(e){e=e.shading;return defined(e)&&defined(e.maximumAttenuation)?e.maximumAttenuation:10}var defaultShading=new PointCloudShading;function renderFrame(e,t,i,r){var n=defaultValue(e.shading,defaultShading),a=t.pointCloud,o=defaultValue(t.transform,Matrix4.IDENTITY);a.modelMatrix=Matrix4.multiplyTransformation(e.modelMatrix,o,scratchModelMatrix),a.style=e.style,a.time=i.timeSinceLoad,a.shadows=e.shadows,a.clippingPlanes=e._clippingPlanes,a.isClipped=i.isClipped,a.attenuation=n.attenuation,a.backFaceCulling=n.backFaceCulling,a.normalShading=n.normalShading,a.geometricError=getGeometricError(e,a),a.geometricErrorScale=n.geometricErrorScale,a.maximumAttenuation=getMaximumAttenuation(e),a.update(r),t.touchedFrameNumber=r.frameNumber}function loadFrame(e,t,i,r){prepareFrame(e,requestFrame(e,t,r),i,r)}function getUnloadCondition(t){return function(e){return e.touchedFrameNumber<t.frameNumber}}function unloadFrames(e,t){for(var i=e._frames,r=i.length,n=0;n<r;++n){var a,o=i[n];defined(o)&&(defined(t)&&!t(o)||(a=o.pointCloud,o.ready&&(e._totalMemoryUsageInBytes-=a.geometryByteLength),defined(a)&&a.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),i[n]=void 0))}}function getFrame(e,t){t=getIntervalIndex(e,t),t=e._frames[t];if(defined(t)&&t.ready)return t}function updateInterval(e,t,i,r,n){return defined(i)&&(i.ready||(loadFrame(e,t,r,n),i.ready))}function getNearestReadyInterval(e,t,i,r,n){var a,o,s=e._intervals,l=e._frames,i=getIntervalIndex(e,i),c=getIntervalIndex(e,t);if(c<=i){for(a=i;c<=a;--a)if(updateInterval(e,o=s.get(a),l[a],r,n))return o}else for(a=i;a<=c;++a)if(updateInterval(e,o=s.get(a),l[a],r,n))return o;return t}function setFramesDirty(e,t,i){for(var r=e._frames,n=r.length,a=0;a<n;++a){var o=r[a];defined(o)&&defined(o.pointCloud)&&(o.pointCloud.clippingPlanesDirty=t,o.pointCloud.styleDirty=i)}}var updateState={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};TimeDynamicPointCloud.prototype.update=function(e){var t,i,r,n,a,o,s,l,c,u,d;e.mode!==SceneMode$1.MORPHING&&this.show&&(defined(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),defined(this._loadTimestamp)||(this._loadTimestamp=JulianDate.clone(e.time)),o=Math.max(1e3*JulianDate.secondsDifference(e.time,this._loadTimestamp),0),n=0,u=!1,(s=defined(l=this._clippingPlanes)&&l.enabled)&&(l.update(e),n=l.clippingPlanesState),this._clippingPlanesState!==n&&(this._clippingPlanesState=n,u=!0),a=this._styleDirty,this._styleDirty=!1,(u||a)&&setFramesDirty(this,u,a),updateState.timeSinceLoad=o,updateState.isClipped=s,t=this.shading,i=this._pointCloudEyeDomeLighting,r=(d=e.commandList).length,l=this._previousInterval,n=this._nextInterval,defined(u=getCurrentInterval(this))&&(a=!1,s=0===(o=getClockMultiplier(this)),o!==this._clockMultiplier&&(a=!0,this._clockMultiplier=o),defined(l)&&!s||(l=u),defined(n)&&!a&&!reachedInterval(this,u,n)||(n=getNextInterval(this,u)),defined(u=getFrame(this,l=getNearestReadyInterval(this,l,u,updateState,e)))||(loadFrame(this,l,updateState,e),u=this._lastRenderedFrame),defined(u)&&renderFrame(this,u,updateState,e),defined(n)&&loadFrame(this,n,updateState,e),c=this,defined(u)&&!defined(this._lastRenderedFrame)&&e.afterRender.push(function(){c._readyPromise.resolve(c)}),defined(u)&&u!==this._lastRenderedFrame&&0<c.frameChanged.numberOfListeners&&e.afterRender.push(function(){c.frameChanged.raiseEvent(c)}),this._previousInterval=l,this._nextInterval=n,this._lastRenderedFrame=u,u=this._totalMemoryUsageInBytes,1024*this.maximumMemoryUsage*1024<u&&unloadFrames(this,getUnloadCondition(e)),d=d.length-r,defined(t)&&t.attenuation&&t.eyeDomeLighting&&0<d&&i.update(e,r,t,this.boundingSphere)))},TimeDynamicPointCloud.prototype.isDestroyed=function(){return!1},TimeDynamicPointCloud.prototype.destroy=function(){return unloadFrames(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),destroyObject(this)};var ViewportQuadFS="varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n",oldValue;function ViewportQuad(e,t){this.show=!0,defined(e)||(e=new BoundingRectangle),this.rectangle=BoundingRectangle.clone(e),defined(t)||(t=Material.fromType(Material.ColorType,{color:new Color(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}ViewportQuad.prototype.update=function(e){var t,i;this.show&&(defined(i=this._rs)&&BoundingRectangle.equals(i.viewport,this.rectangle)||(this._rs=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render&&(t=e.context,this._material===this.material&&defined(this._overlayCommand)||(this._material=this.material,defined(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy(),i=new ShaderSource({sources:[this._material.shaderSource,ViewportQuadFS]}),this._overlayCommand=t.createViewportQuadCommand(i,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Pass$1.OVERLAY),this._material.update(t),this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)))},ViewportQuad.prototype.isDestroyed=function(){return!1},ViewportQuad.prototype.destroy=function(){return defined(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),destroyObject(this)},"undefined"!=typeof ko&&(oldValue=ko),function(R){var S=this||(0,eval)("this"),T=S.document,v=S.navigator,x=S.jQuery,b=S.JSON;x||"undefined"==typeof jQuery||(x=jQuery),function(e,r){function i(e,t){return null===e||typeof e in l?e===t:!1}function a(e,t){var i;return function(){i||(i=I.a.setTimeout(function(){i=R;e()},t))}}function o(e,t){var i;return function(){clearTimeout(i);i=I.a.setTimeout(e,t)}}function c(e,t){t&&"change"!==t?"beforeChange"===t?this.pc(e):this.gb(e,t):this.qc(e)}function n(e,t){null!==t&&t.s&&t.s()}function s(e,t){var i=this.qd,r=i[p];r.ra||(this.Qb&&this.mb[t]?(i.uc(t,e,this.mb[t]),this.mb[t]=null,--this.Qb):r.I[t]||i.uc(t,e,r.J?{da:e}:i.$c(e)),e.Ja&&e.gd())}var I="undefined"!==typeof e?e:{};I.b=function(e,t){for(var i=e.split("."),r=I,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},I.L=function(e,t,i){e[t]=i},I.version="3.5.1",I.b("version",I.version),I.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},I.a=function(){function d(e,t){for(var i in e)a.call(e,i)&&t(i,e[i])}function e(e,t){if(t)for(var i in t)a.call(t,i)&&(e[i]=t[i]);return e}function t(e,t){e.__proto__=t;return e}function n(e,t,i,r){var n=e[t].match(u)||[];I.a.D(i.match(u),function(e){I.a.Na(n,e,r)});e[t]=n.join(" ")}var a=Object.prototype.hasOwnProperty,i={__proto__:[]}instanceof Array,r="function"===typeof Symbol,o={},s={};o[v&&/Firefox\/2/i.test(v.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];o.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");d(o,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)s[t[i]]=e});var l={propertychange:!0},c=T&&function(){for(var e=3,t=T.createElement("div"),i=t.getElementsByTagName("i");t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e",i[0];);return 4<e?e:R}(),u=/\S+/g,h;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(e,t,i){for(var r=0,n=e.length;r<n;r++)t.call(i,e[r],r,e)},A:"function"==typeof Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t)}:function(e,t){for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Lb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r,e))return e[r];return R},Pa:function(e,t){var i=I.a.A(e,t);0<i?e.splice(i,1):0===i&&e.shift()},wc:function(e){var t=[];e&&I.a.D(e,function(e){0>I.a.A(t,e)&&t.push(e)});return t},Mb:function(e,t,i){var r=[];if(e)for(var n=0,a=e.length;n<a;n++)r.push(t.call(i,e[n],n));return r},jb:function(e,t,i){var r=[];if(e)for(var n=0,a=e.length;n<a;n++)t.call(i,e[n],n)&&r.push(e[n]);return r},Nb:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},Na:function(e,t,i){var r=I.a.A(I.a.bc(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},Ba:i,extend:e,setPrototypeOf:t,Ab:i?t:e,P:d,Ga:function(e,t,i){if(!e)return e;var r={},n;for(n in e)a.call(e,n)&&(r[n]=t.call(i,e[n],n,e));return r},Tb:function(e){for(;e.firstChild;)I.removeNode(e.firstChild)},Yb:function(e){e=I.a.la(e);for(var t=(e[0]&&e[0].ownerDocument||T).createElement("div"),i=0,r=e.length;i<r;i++)t.appendChild(I.oa(e[i]));return t},Ca:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var a=e[i].cloneNode(!0);n.push(t?I.oa(a):a)}return n},va:function(e,t){I.a.Tb(e);if(t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},Xc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,a=0,o=t.length;a<o;a++)n.insertBefore(t[a],r);a=0;for(o=i.length;a<o;a++)I.removeNode(i[a])}},Ua:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},Zc:function(e,t){7>c?e.setAttribute("selected",t):e.selected=t},Db:function(e){return null===e||e===R?"":e.trim?e.trim():e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(e,t){e=e||"";return t.length>e.length?!1:e.substring(0,t.length)===t},vd:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(1!==e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(t.compareDocumentPosition(e)&16);for(;e&&e!=t;)e=e.parentNode;return!!e},Sb:function(e){return I.a.vd(e,e.ownerDocument.documentElement)},kd:function(e){return!!I.a.Lb(e,I.a.Sb)},R:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Ac:function(e){return I.onError?function(){try{return e.apply(this,arguments)}catch(e){throw I.onError&&I.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(I.a.Ac(e),t)},Gc:function(e){setTimeout(function(){I.onError&&I.onError(e);throw e},0)},B:function(t,e,i){var r=I.a.Ac(i);i=l[e];if(I.options.useOnlyNativeEvents||i||!x)if(i||"function"!=typeof t.addEventListener)if("undefined"!=typeof t.attachEvent){var n=function(e){r.call(t,e)},a="on"+e;t.attachEvent(a,n);I.a.K.za(t,function(){t.detachEvent(a,n)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else t.addEventListener(e,r,!1);else h||(h="function"==typeof x(t).on?"on":"bind"),x(t)[h](e,r)},Fb:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var i;"input"===I.a.R(e)&&e.type&&"click"==t.toLowerCase()?(i=e.type,i="checkbox"==i||"radio"==i):i=!1;if(I.options.useOnlyNativeEvents||!x||i)if("function"==typeof T.createEvent)if("function"==typeof e.dispatchEvent)i=T.createEvent(s[t]||"HTMLEvents"),i.initEvent(t,!0,!0,S,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(i);else throw Error("The supplied element doesn't support dispatchEvent");else if(i&&e.click)e.click();else if("undefined"!=typeof e.fireEvent)e.fireEvent("on"+t);else throw Error("Browser doesn't support triggering events");else x(e).trigger(t)},f:function(e){return I.O(e)?e():e},bc:function(e){return I.O(e)?e.v():e},Eb:function(t,e,i){var r;e&&("object"===typeof t.classList?(r=t.classList[i?"add":"remove"],I.a.D(e.match(u),function(e){r.call(t.classList,e)})):"string"===typeof t.className.baseVal?n(t.className,"baseVal",e,i):n(t,"className",e,i))},Bb:function(e,t){var i=I.a.f(t);if(null===i||i===R)i="";var r=I.h.firstChild(e);!r||3!=r.nodeType||I.h.nextSibling(r)?I.h.va(e,[e.ownerDocument.createTextNode(i)]):r.data=i;I.a.Ad(e)},Yc:function(e,t){e.name=t;if(7>=c)try{var i=e.name.replace(/[&<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"});e.mergeAttributes(T.createElement("<input name='"+i+"'/>"),!1)}catch(e){}},Ad:function(e){9<=c&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},wd:function(e){if(c){var t=e.style.width;e.style.width=0;e.style.width=t}},Pd:function(e,t){e=I.a.f(e);t=I.a.f(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},la:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Da:function(e){return r?Symbol(e):e},Zd:6===c,$d:7===c,W:c,Lc:function(e,t){for(var i=I.a.la(e.getElementsByTagName("input")).concat(I.a.la(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],a=i.length-1;0<=a;a--)r(i[a])&&n.push(i[a]);return n},Nd:function(e){return"string"==typeof e&&(e=I.a.Db(e))?b&&b.parse?b.parse(e):new Function("return "+e)():null},hc:function(e,t,i){if(!b||!b.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 b.stringify(I.a.f(e),t,i)},Od:function(e,t,i){i=i||{};var r=i.params||{},n=i.includeFields||this.Jc,a=e;if("object"==typeof e&&"form"===I.a.R(e))for(var a=e.action,o=n.length-1;0<=o;o--)for(var s=I.a.Lc(e,n[o]),l=s.length-1;0<=l;l--)r[s[l].name]=s[l].value;t=I.a.f(t);var c=T.createElement("form");c.style.display="none";c.action=a;c.method="post";for(var u in t)e=T.createElement("input"),e.type="hidden",e.name=u,e.value=I.a.hc(I.a.f(t[u])),c.appendChild(e);d(r,function(e,t){var i=T.createElement("input");i.type="hidden";i.name=e;i.value=t;c.appendChild(i)});T.body.appendChild(c);i.submitter?i.submitter(c):c.submit();setTimeout(function(){c.parentNode.removeChild(c)},0)}}}(),I.b("utils",I.a),I.b("utils.arrayForEach",I.a.D),I.b("utils.arrayFirst",I.a.Lb),I.b("utils.arrayFilter",I.a.jb),I.b("utils.arrayGetDistinctValues",I.a.wc),I.b("utils.arrayIndexOf",I.a.A),I.b("utils.arrayMap",I.a.Mb),I.b("utils.arrayPushAll",I.a.Nb),I.b("utils.arrayRemoveItem",I.a.Pa),I.b("utils.cloneNodes",I.a.Ca),I.b("utils.createSymbolOrString",I.a.Da),I.b("utils.extend",I.a.extend),I.b("utils.fieldsIncludedWithJsonPost",I.a.Jc),I.b("utils.getFormFields",I.a.Lc),I.b("utils.objectMap",I.a.Ga),I.b("utils.peekObservable",I.a.bc),I.b("utils.postJson",I.a.Od),I.b("utils.parseJson",I.a.Nd),I.b("utils.registerEventHandler",I.a.B),I.b("utils.stringifyJson",I.a.hc),I.b("utils.range",I.a.Pd),I.b("utils.toggleDomNodeCssClass",I.a.Eb),I.b("utils.triggerEvent",I.a.Fb),I.b("utils.unwrapObservable",I.a.f),I.b("utils.objectForEach",I.a.P),I.b("utils.addOrRemoveItem",I.a.Na),I.b("utils.setTextContent",I.a.Bb),I.b("unwrap",I.a.f),Function.prototype.bind||(Function.prototype.bind=function(t){var i=this;if(1===arguments.length)return function(){return i.apply(t,arguments)};var r=Array.prototype.slice.call(arguments,1);return function(){var e=r.slice(0);e.push.apply(e,arguments);return i.apply(t,e)}}),I.a.g=new function(){var r=0,n="__ko__"+(new Date).getTime(),a={},o,e;I.a.W?(o=function(e,t){var i=e[n];if(!i||"null"===i||!a[i]){if(!t)return R;i=e[n]="ko"+r++;a[i]={}}return a[i]},e=function(e){var t=e[n];return t?(delete a[t],e[n]=null,!0):!1}):(o=function(e,t){var i=e[n];!i&&t&&(i=e[n]={});return i},e=function(e){return e[n]?(delete e[n],!0):!1});return{get:function(e,t){var i=o(e,!1);return i&&i[t]},set:function(e,t,i){(e=o(e,i!==R))&&(e[t]=i)},Ub:function(e,t,i){e=o(e,!0);return e[t]||(e[t]=i)},clear:e,Z:function(){return r+++n}}},I.b("utils.domData",I.a.g),I.b("utils.domData.clear",I.a.g.clear),I.a.K=new function(){function r(e,t){var i=I.a.g.get(e,o);i===R&&t&&(i=[],I.a.g.set(e,o,i));return i}function a(e){var t=r(e,!1);if(t)for(var t=t.slice(0),i=0;i<t.length;i++)t[i](e);I.a.g.clear(e);I.a.K.cleanExternalData(e);s[e.nodeType]&&n(e.childNodes,!0)}function n(e,t){for(var i=[],r,n=0;n<e.length;n++)if(!t||8===e[n].nodeType)if(a(i[i.length]=r=e[n]),e[n]!==r)for(;n--&&-1==I.a.A(i,e[n]););}var o=I.a.g.Z(),t={1:!0,8:!0,9:!0},s={1:!0,9:!0};return{za:function(e,t){if("function"!=typeof t)throw Error("Callback must be a function");r(e,!0).push(t)},yb:function(e,t){var i=r(e,!1);i&&(I.a.Pa(i,t),0==i.length&&I.a.g.set(e,o,R))},oa:function(e){I.u.G(function(){t[e.nodeType]&&(a(e),s[e.nodeType]&&n(e.getElementsByTagName("*")))});return e},removeNode:function(e){I.oa(e);e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){x&&"function"==typeof x.cleanData&&x.cleanData([e])}}},I.oa=I.a.K.oa,I.removeNode=I.a.K.removeNode,I.b("cleanNode",I.oa),I.b("removeNode",I.removeNode),I.b("utils.domNodeDisposal",I.a.K),I.b("utils.domNodeDisposal.addDisposeCallback",I.a.K.za),I.b("utils.domNodeDisposal.removeDisposeCallback",I.a.K.yb),function(){var s=[0,"",""],e=[1,"<table>","</table>"],t=[3,"<table><tbody><tr>","</tr></tbody></table>"],i=[1,"<select multiple='multiple'>","</select>"],l={thead:e,tbody:e,tfoot:e,tr:[2,"<table><tbody>","</tbody></table>"],td:t,th:t,option:i,optgroup:i},c=8>=I.a.W;I.a.ua=function(e,t){var i;if(x){if(x.parseHTML)i=x.parseHTML(e,t)||[];else if((i=x.clean([e],t))&&i[0]){for(var r=i[0];r.parentNode&&11!==r.parentNode.nodeType;)r=r.parentNode;r.parentNode&&r.parentNode.removeChild(r)}}else{(i=t)||(i=T);var r=i.parentWindow||i.defaultView||S,n=I.a.Db(e).toLowerCase(),a=i.createElement("div"),o;o=(n=n.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&l[n[1]]||s;n=o[0];o="ignored<div>"+o[1]+e+o[2]+"</div>";"function"==typeof r.innerShiv?a.appendChild(r.innerShiv(o)):(c&&i.body.appendChild(a),a.innerHTML=o,c&&a.parentNode.removeChild(a));for(;n--;)a=a.lastChild;i=I.a.la(a.lastChild.childNodes)}return i};I.a.Md=function(e,t){var i=I.a.ua(e,t);return i.length&&i[0].parentElement||I.a.Yb(i)};I.a.fc=function(e,t){I.a.Tb(e);t=I.a.f(t);if(null!==t&&t!==R)if("string"!=typeof t&&(t=t.toString()),x)x(e).html(t);else for(var i=I.a.ua(t,e.ownerDocument),r=0;r<i.length;r++)e.appendChild(i[r])}}(),I.b("utils.parseHtmlFragment",I.a.ua),I.b("utils.setHtml",I.a.fc),I.aa=function(){function s(e,t){if(e)if(8==e.nodeType){var i=I.aa.Uc(e.nodeValue);null!=i&&t.push({ud:e,Kd:i})}else if(1==e.nodeType)for(var i=0,r=e.childNodes,n=r.length;i<n;i++)s(r[i],t)}var r={};return{Xb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);r[t]=e;return"\x3c!--[ko_memo:"+t+"]--\x3e"},bd:function(e,t){var i=r[e];if(i===R)throw Error("Couldn't find any memo with ID "+e+". Perhaps it's already been unmemoized.");try{return i.apply(null,t||[]),!0}finally{delete r[e]}},cd:function(e,t){var i=[];s(e,i);for(var r=0,n=i.length;r<n;r++){var a=i[r].ud,o=[a];t&&I.a.Nb(o,t);I.aa.bd(i[r].Kd,o);a.nodeValue="";a.parentNode&&a.parentNode.removeChild(a)}},Uc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),I.b("memoization",I.aa),I.b("memoization.memoize",I.aa.Xb),I.b("memoization.unmemoize",I.aa.bd),I.b("memoization.parseMemoText",I.aa.Uc),I.b("memoization.unmemoizeDomNodeAndDescendants",I.aa.cd),I.na=function(){function e(){if(n)for(var e=n,t=0,i;o<n;)if(i=r[o++]){if(o>e){if(5e3<=++t){o=n;I.a.Gc(Error("'Too much recursion' after processing "+t+" task groups."));break}e=n}try{i()}catch(e){I.a.Gc(e)}}}function t(){e();o=n=r.length=0}var i,r=[],n=0,a=1,o=0;S.MutationObserver?i=function(e){var t=T.createElement("div");new MutationObserver(e).observe(t,{attributes:!0});return function(){t.classList.toggle("foo")}}(t):i=T&&"onreadystatechange"in T.createElement("script")?function(e){var t=T.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null;T.documentElement.removeChild(t);t=null;e()};T.documentElement.appendChild(t)}:function(e){setTimeout(e,0)};return{scheduler:i,zb:function(e){n||I.na.scheduler(t);r[n++]=e;return a++},cancel:function(e){e=e-(a-n);e>=o&&e<n&&(r[e]=null)},resetForTesting:function(){var e=n-o;o=n=r.length=0;return e},Sd:e}}(),I.b("tasks",I.na),I.b("tasks.schedule",I.na.zb),I.b("tasks.runEarly",I.na.Sd),I.Ta={throttle:function(t,i){t.throttleEvaluation=i;var r=null;return I.$({read:t,write:function(e){clearTimeout(r);r=I.a.setTimeout(function(){t(e)},i)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method);e.Hb=!1;n="function"==typeof r?r:"notifyWhenChangesStop"==r?o:a;e.ub(function(e){return n(e,i,t)})},deferred:function(r,e){if(!0!==e)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");r.Hb||(r.Hb=!0,r.ub(function(e){var t,i=!1;return function(){if(!i){I.na.cancel(t);t=I.na.zb(e);try{i=!0,r.notifySubscribers(R,"dirty")}finally{i=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:i}};var l={undefined:1,boolean:1,number:1,string:1};I.b("extenders",I.Ta),I.ic=function(e,t,i){this.da=e;this.lc=t;this.mc=i;this.Ib=!1;this.fb=this.Jb=null;I.L(this,"dispose",this.s);I.L(this,"disposeWhenNodeIsRemoved",this.l)},I.ic.prototype.s=function(){this.Ib||(this.fb&&I.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},I.ic.prototype.l=function(e){this.Jb=e;I.a.K.za(e,this.fb=this.s.bind(this))},I.T=function(){I.a.Ab(this,t);t.qb(this)};var t={qb:function(e){e.U={change:[]};e.sc=1},subscribe:function(e,t,i){var r=this;i=i||"change";var n=new I.ic(r,t?e.bind(t):e,function(){I.a.Pa(r.U[i],n);r.hb&&r.hb(i)});r.Qa&&r.Qa(i);r.U[i]||(r.U[i]=[]);r.U[i].push(n);return n},notifySubscribers:function(e,t){t=t||"change";"change"===t&&this.Gb();if(this.Wa(t)){var i="change"===t&&this.ed||this.U[t].slice(0);try{I.u.xc();for(var r=0,n;n=i[r];++r)n.Ib||n.lc(e)}finally{I.u.end()}}},ob:function(){return this.sc},Dd:function(e){return this.ob()!==e},Gb:function(){++this.sc},ub:function(e){var i=this,t=I.O(i),r,n,a,o,s;i.gb||(i.gb=i.notifySubscribers,i.notifySubscribers=c);var l=e(function(){i.Ja=!1;t&&o===i&&(o=i.nc?i.nc():i());var e=n||s&&i.sb(a,o);s=n=r=!1;e&&i.gb(a=o)});i.qc=function(e,t){t&&i.Ja||(s=!t);i.ed=i.U.change.slice(0);i.Ja=r=!0;o=e;l()};i.pc=function(e){r||(a=e,i.gb(e,"beforeChange"))};i.rc=function(){s=!0};i.gd=function(){i.sb(a,i.v(!0))&&(n=!0)}},Wa:function(e){return this.U[e]&&this.U[e].length},Bd:function(e){if(e)return this.U[e]&&this.U[e].length||0;var i=0;I.a.P(this.U,function(e,t){"dirty"!==e&&(i+=t.length)});return i},sb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},toString:function(){return"[object Object]"},extend:function(e){var r=this;e&&I.a.P(e,function(e,t){var i=I.Ta[e];"function"==typeof i&&(r=i(r,t)||r)});return r}};I.L(t,"init",t.qb),I.L(t,"subscribe",t.subscribe),I.L(t,"extend",t.extend),I.L(t,"getSubscriptionsCount",t.Bd),I.a.Ba&&I.a.setPrototypeOf(t,Function.prototype),I.T.fn=t,I.Qc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},I.b("subscribable",I.T),I.b("isSubscribable",I.Qc),I.S=I.u=function(){function r(e){t.push(i);i=e}function n(){i=t.pop()}var t=[],i,a=0;return{xc:r,end:n,cc:function(e){if(i){if(!I.Qc(e))throw Error("Only subscribable things can act as dependencies");i.od.call(i.pd,e,e.fd||(e.fd=++a))}},G:function(e,t,i){try{return r(),e.apply(t,i||[])}finally{n()}},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}}}(),I.b("computedContext",I.S),I.b("computedContext.getDependenciesCount",I.S.qa),I.b("computedContext.getDependencies",I.S.Va),I.b("computedContext.isInitial",I.S.Ya),I.b("computedContext.registerDependency",I.S.cc),I.b("ignoreDependencies",I.Yd=I.u.G);var u=I.a.Da("_latestValue");I.ta=function(e){function t(){if(0<arguments.length)return t.sb(t[u],arguments[0])&&(t.ya(),t[u]=arguments[0],t.xa()),this;I.u.cc(t);return t[u]}t[u]=e;I.a.Ba||I.a.extend(t,I.T.fn);I.T.fn.qb(t);I.a.Ab(t,d);I.options.deferUpdates&&I.Ta.deferred(t,!0);return t};var d={equalityComparer:i,v:function(){return this[u]},xa:function(){this.notifySubscribers(this[u],"spectate");this.notifySubscribers(this[u])},ya:function(){this.notifySubscribers(this[u],"beforeChange")}};I.a.Ba&&I.a.setPrototypeOf(d,I.T.fn);var h=I.ta.Ma="__ko_proto__";d[h]=I.ta,I.O=function(e){if((e="function"==typeof e&&e[h])&&e!==d[h]&&e!==I.o.fn[h])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},I.Za=function(e){return"function"==typeof e&&(e[h]===d[h]||e[h]===I.o.fn[h]&&e.Nc)},I.b("observable",I.ta),I.b("isObservable",I.O),I.b("isWriteableObservable",I.Za),I.b("isWritableObservable",I.Za),I.b("observable.fn",d),I.L(d,"peek",d.v),I.L(d,"valueHasMutated",d.xa),I.L(d,"valueWillMutate",d.ya),I.Ha=function(e){e=e||[];if("object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");e=I.ta(e);I.a.Ab(e,I.Ha.fn);return e.extend({trackArrayChanges:!0})},I.Ha.fn={remove:function(t){for(var e=this.v(),i=[],r="function"!=typeof t||I.O(t)?function(e){return e===t}:t,n=0;n<e.length;n++){var a=e[n];if(r(a)){0===i.length&&this.ya();if(e[n]!==a)throw Error("Array modified during remove; cannot remove item");i.push(a);e.splice(n,1);n--}}i.length&&this.xa();return i},removeAll:function(t){if(t===R){var e=this.v(),i=e.slice(0);this.ya();e.splice(0,e.length);this.xa();return i}return t?this.remove(function(e){return 0<=I.a.A(t,e)}):[]},destroy:function(t){var e=this.v(),i="function"!=typeof t||I.O(t)?function(e){return e===t}:t;this.ya();for(var r=e.length-1;0<=r;r--){var n=e[r];i(n)&&(n._destroy=!0)}this.xa()},destroyAll:function(t){return t===R?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=I.a.A(t,e)}):[]},indexOf:function(e){var t=this();return I.a.A(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ya(),this.v()[i]=t,this.xa())},sorted:function(e){var t=this().slice(0);return e?t.sort(e):t.sort()},reversed:function(){return this().slice(0).reverse()}},I.a.Ba&&I.a.setPrototypeOf(I.Ha.fn,I.ta.fn),I.a.D("pop push reverse shift sort splice unshift".split(" "),function(i){I.Ha.fn[i]=function(){var e=this.v();this.ya();this.zc(e,i,arguments);var t=e[i].apply(e,arguments);this.xa();return t===e?this:t}}),I.a.D(["slice"],function(t){I.Ha.fn[t]=function(){var e=this();return e[t].apply(e,arguments)}}),I.Pc=function(e){return I.O(e)&&"function"==typeof e.remove&&"function"==typeof e.push},I.b("observableArray",I.Ha),I.b("isObservableArray",I.Pc),I.Ta.trackArrayChanges=function(i,e){function t(){function e(){if(p){var e=[].concat(i.v()||[]),t;if(i.Wa("arrayChange")){if(!h||1<p)h=I.a.Pb(a,e,i.Ob);t=h}a=e;h=null;p=0;t&&t.length&&i.notifySubscribers(t,"arrayChange")}}d?e():(d=!0,n=i.subscribe(function(){++p},null,"spectate"),a=[].concat(i.v()||[]),h=null,r=i.subscribe(e))}i.Ob={};e&&"object"==typeof e&&I.a.extend(i.Ob,e);i.Ob.sparse=!0;if(!i.zc){var d=!1,h=null,r,n,p=0,a,o=i.Qa,s=i.hb;i.Qa=function(e){o&&o.call(i,e);"arrayChange"===e&&t()};i.hb=function(e){s&&s.call(i,e);"arrayChange"!==e||i.Wa("arrayChange")||(r&&r.s(),n&&n.s(),n=r=null,d=!1,a=R)};i.zc=function(e,t,i){function r(e,t,i){return n[n.length]={status:e,value:t,index:i}}if(d&&!p){var n=[],a=e.length,o=i.length,s=0;switch(t){case"push":s=a;case"unshift":for(t=0;t<o;t++)r("added",i[t],s+t);break;case"pop":s=a-1;case"shift":a&&r("deleted",e[s],s);break;case"splice":t=Math.min(Math.max(0,0>i[0]?a+i[0]:i[0]),a);for(var a=1===o?a:Math.min(t+(i[1]||0),a),o=t+o-2,s=Math.max(a,o),l=[],c=[],u=2;t<s;++t,++u)t<a&&c.push(r("deleted",e[t],t)),t<o&&l.push(r("added",i[u],t));I.a.Kc(c,l);break;default:return}h=n}}}};var p=I.a.Da("_state");I.o=I.$=function(e,t,i){function r(){if(0<arguments.length){if("function"===typeof n)n.apply(a.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}a.ra||I.u.cc(r);(a.ka||a.J&&r.Xa())&&r.ha();return a.X}"object"===typeof e?i=e:(i=i||{},e&&(i.read=e));if("function"!=typeof i.read)throw Error("Pass a function that returns the value of the ko.computed");var n=i.write,a={X:R,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:i.read,nb:t||i.owner,l:i.disposeWhenNodeIsRemoved||i.l||null,Sa:i.disposeWhen||i.Sa,Rb:null,I:{},V:0,Ic:null};r[p]=a;r.Nc="function"===typeof n;I.a.Ba||I.a.extend(r,I.T.fn);I.T.fn.qb(r);I.a.Ab(r,m);i.pure?(a.wb=!0,a.J=!0,I.a.extend(r,f)):i.deferEvaluation&&I.a.extend(r,g);I.options.deferUpdates&&I.Ta.deferred(r,!0);a.l&&(a.jc=!0,a.l.nodeType||(a.l=null));a.J||i.deferEvaluation||r.ha();a.l&&r.ja()&&I.a.K.za(a.l,a.Rb=function(){r.s()});return r};var m={equalityComparer:i,qa:function(){return this[p].V},Va:function(){var i=[];I.a.P(this[p].I,function(e,t){i[t.Ka]=t.da});return i},Vb:function(t){if(!this[p].V)return!1;var e=this.Va();return-1!==I.a.A(e,t)?!0:!!I.a.Lb(e,function(e){return e.Vb&&e.Vb(t)})},uc:function(e,t,i){if(this[p].wb&&t===this)throw Error("A 'pure' computed must not be called recursively");this[p].I[e]=i;i.Ka=this[p].V++;i.La=t.ob()},Xa:function(){var e,t,i=this[p].I;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&(t=i[e],this.Ia&&t.da.Ja||t.da.Dd(t.La)))return!0},Jd:function(){this.Ia&&!this[p].rb&&this.Ia(!1)},ja:function(){var e=this[p];return e.ka||0<e.V},Rd:function(){this.Ja?this[p].ka&&(this[p].sa=!0):this.Hc()},$c:function(e){if(e.Hb){var t=e.subscribe(this.Jd,this,"dirty"),i=e.subscribe(this.Rd,this);return{da:e,s:function(){t.s();i.s()}}}return e.subscribe(this.Hc,this)},Hc:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[p].Ic),this[p].Ic=I.a.setTimeout(function(){e.ha(!0)},t)):e.Ia?e.Ia(!0):e.ha(!0)},ha:function(e){var t=this[p],i=t.Sa,r=!1;if(!t.rb&&!t.ra){if(t.l&&!I.a.Sb(t.l)||i&&i()){if(!t.jc){this.s();return}}else t.jc=!1;t.rb=!0;try{r=this.zd(e)}finally{t.rb=!1}return r}},zd:function(e){var t=this[p],i=!1,r=t.wb?R:!t.V,i={qd:this,mb:t.I,Qb:t.V};I.u.xc({pd:i,od:s,o:this,Ya:r});t.I={};t.V=0;var n=this.yd(t,i);t.V?i=this.sb(t.X,n):(this.s(),i=!0);i&&(t.J?this.Gb():this.notifySubscribers(t.X,"beforeChange"),t.X=n,this.notifySubscribers(t.X,"spectate"),!t.J&&e&&this.notifySubscribers(t.X),this.rc&&this.rc());r&&this.notifySubscribers(t.X,"awake");return i},yd:function(e,t){try{var i=e.Wc;return e.nb?i.call(e.nb):i()}finally{I.u.end(),t.Qb&&!e.J&&I.a.P(t.mb,n),e.sa=e.ka=!1}},v:function(e){var t=this[p];(t.ka&&(e||!t.V)||t.J&&this.Xa())&&this.ha();return t.X},ub:function(e){I.T.fn.ub.call(this,e);this.nc=function(){this[p].J||(this[p].sa?this.ha():this[p].ka=!1);return this[p].X};this.Ia=function(e){this.pc(this[p].X);this[p].ka=!0;e&&(this[p].sa=!0);this.qc(this,!e)}},s:function(){var e=this[p];!e.J&&e.I&&I.a.P(e.I,function(e,t){t.s&&t.s()});e.l&&e.Rb&&I.a.K.yb(e.l,e.Rb);e.I=R;e.V=0;e.ra=!0;e.sa=!1;e.ka=!1;e.J=!1;e.l=R;e.Sa=R;e.Wc=R;this.Nc||(e.nb=R)}},f={Qa:function(e){var n=this,a=n[p];if(!a.ra&&a.J&&"change"==e){a.J=!1;if(a.sa||n.Xa())a.I=null,a.V=0,n.ha()&&n.Gb();else{var i=[];I.a.P(a.I,function(e,t){i[t.Ka]=e});I.a.D(i,function(e,t){var i=a.I[e],r=n.$c(i.da);r.Ka=t;r.La=i.La;a.I[e]=r});n.Xa()&&n.ha()&&n.Gb()}a.ra||n.notifySubscribers(a.X,"awake")}},hb:function(e){var i=this[p];i.ra||"change"!=e||this.Wa("change")||(I.a.P(i.I,function(e,t){t.s&&(i.I[e]={da:t.da,Ka:t.Ka,La:t.La},t.s())}),i.J=!0,this.notifySubscribers(R,"asleep"))},ob:function(){var e=this[p];e.J&&(e.sa||this.Xa())&&this.ha();return I.T.fn.ob.call(this)}},g={Qa:function(e){"change"!=e&&"beforeChange"!=e||this.v()}};I.a.Ba&&I.a.setPrototypeOf(m,I.T.fn);var _=I.ta.Ma;m[_]=I.o,I.Oc=function(e){return"function"==typeof e&&e[_]===m[_]},I.Fd=function(e){return I.Oc(e)&&e[p]&&e[p].wb},I.b("computed",I.o),I.b("dependentObservable",I.o),I.b("isComputed",I.Oc),I.b("isPureComputed",I.Fd),I.b("computed.fn",m),I.L(m,"peek",m.v),I.L(m,"dispose",m.s),I.L(m,"isActive",m.ja),I.L(m,"getDependenciesCount",m.qa),I.L(m,"getDependencies",m.Va),I.xb=function(e,t){if("function"===typeof e)return I.o(e,t,{pure:!0});e=I.a.extend({},e);e.pure=!0;return I.o(e,t)},I.b("pureComputed",I.xb),function(){function s(r,n,a){a=a||new t;r=n(r);if("object"!=typeof r||null===r||r===R||r instanceof RegExp||r instanceof Date||r instanceof String||r instanceof Number||r instanceof Boolean)return r;var o=r instanceof Array?[]:{};a.save(r,o);e(r,function(e){var t=n(r[e]);switch(typeof t){case"boolean":case"number":case"string":case"function":o[e]=t;break;case"object":case"undefined":var i=a.get(t);o[e]=i!==R?i:s(t,n,a)}});return o}function e(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function t(){this.keys=[];this.values=[]}I.ad=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return s(e,function(e){for(var t=0;I.O(e)&&10>t;t++)e=e();return e})};I.toJSON=function(e,t,i){e=I.ad(e);return I.a.hc(e,t,i)};t.prototype={constructor:t,save:function(e,t){var i=I.a.A(this.keys,e);0<=i?this.values[i]=t:(this.keys.push(e),this.values.push(t))},get:function(e){e=I.a.A(this.keys,e);return 0<=e?this.values[e]:R}}}(),I.b("toJS",I.ad),I.b("toJSON",I.toJSON),I.Wd=function(r,e,n){function t(t){var e=I.xb(r,n).extend({ma:"always"}),i=e.subscribe(function(e){e&&(i.s(),t(e))});e.notifySubscribers(e.v());return i}return"function"!==typeof Promise||e?t(e.bind(n)):new Promise(t)},I.b("when",I.Wd),function(){I.w={M:function(e){switch(I.a.R(e)){case"option":return!0===e.__ko__hasDomDataOptionValue__?I.a.g.get(e,I.c.options.$b):7>=I.a.W?e.getAttributeNode("value")&&e.getAttributeNode("value").specified?e.value:e.text:e.value;case"select":return 0<=e.selectedIndex?I.w.M(e.options[e.selectedIndex]):R;default:return e.value}},cb:function(e,t,i){switch(I.a.R(e)){case"option":"string"===typeof t?(I.a.g.set(e,I.c.options.$b,R),"__ko__hasDomDataOptionValue__"in e&&delete e.__ko__hasDomDataOptionValue__,e.value=t):(I.a.g.set(e,I.c.options.$b,t),e.__ko__hasDomDataOptionValue__=!0,e.value="number"===typeof t?t:"");break;case"select":if(""===t||null===t)t=R;for(var r=-1,n=0,a=e.options.length,o;n<a;++n)if(o=I.w.M(e.options[n]),o==t||""===o&&t===R){r=n;break}if(i||0<=r||t===R&&1<e.size)e.selectedIndex=r,6===I.a.W&&I.a.setTimeout(function(){e.selectedIndex=r},0);break;default:if(null===t||t===R)t="";e.value=t}}}}(),I.b("selectExtensions",I.w),I.b("selectExtensions.readValue",I.w.M),I.b("selectExtensions.writeValue",I.w.cb),I.m=function(){function r(e){e=I.a.Db(e);123===e.charCodeAt(0)&&(e=e.slice(1,-1));e+="\n,";var t=[],i=e.match(d),r,n=[],a=0;if(1<i.length){for(var o=0,s;s=i[o];++o){var l=s.charCodeAt(0);if(44===l){if(0>=a){t.push(r&&n.length?{key:r,value:n.join("")}:{unknown:r||n.join("")});r=a=0;n=[];continue}}else if(58===l){if(!a&&!r&&1===n.length){r=n.pop();continue}}else if(47===l&&1<s.length&&(47===s.charCodeAt(1)||42===s.charCodeAt(1)))continue;else 47===l&&o&&1<s.length?(l=i[o-1].match(h))&&!p[l[0]]&&(e=e.substr(e.indexOf(s)+1),i=e.match(d),o=-1,s="/"):40===l||123===l||91===l?++a:41===l||125===l||93===l?--a:r||n.length||34!==l&&39!==l||(s=s.slice(1,-1));n.push(s)}if(0<a)throw Error("Unbalanced parentheses, braces, or brackets")}return t}var c=["true","false","null","undefined"],u=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,d=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),h=/[\])"'A-Za-z0-9_$]+$/,p={in:1,return:1,typeof:1},m={};return{Ra:[],wa:m,ac:r,vb:function(e,t){function n(e,t){var i;if(!l){var r=I.getBindingHandler(e);if(r&&r.preprocess&&!(t=r.preprocess(t,e,n)))return;if(r=m[e])i=t,0<=I.a.A(c,i)?i=!1:(r=i.match(u),i=null===r?!1:r[1]?"Object("+r[1]+")"+r[2]:i),r=i;r&&o.push("'"+("string"==typeof m[e]?m[e]:e)+"':function(_z){"+i+"=_z}")}s&&(t="function(){return "+t+" }");a.push("'"+e+"':"+t)}t=t||{};var a=[],o=[],s=t.valueAccessors,l=t.bindingParams,i="string"===typeof e?r(e):e;I.a.D(i,function(e){n(e.key||e.unknown,e.value)});o.length&&n("_ko_property_writers","{"+o.join(",")+" }");return a.join(",")},Id:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},eb:function(e,t,i,r,n){if(e&&I.O(e))!I.Za(e)||n&&e.v()===r||e(r);else if((e=t.get("_ko_property_writers"))&&e[i])e[i](r)}}}(),I.b("expressionRewriting",I.m),I.b("expressionRewriting.bindingRewriteValidators",I.m.Ra),I.b("expressionRewriting.parseObjectLiteral",I.m.ac),I.b("expressionRewriting.preProcessBindings",I.m.vb),I.b("expressionRewriting._twoWayBindings",I.m.wa),I.b("jsonExpressionRewriting",I.m),I.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",I.m.vb),function(){function a(e){return 8==e.nodeType&&i.test(t?e.text:e.nodeValue)}function o(e){return 8==e.nodeType&&n.test(t?e.text:e.nodeValue)}function r(e,t){for(var i=e,r=1,n=[];i=i.nextSibling;){if(o(i)&&(I.a.g.set(i,c,!0),r--,0===r))return n;n.push(i);a(i)&&r++}if(!t)throw Error("Cannot find closing comment tag to match: "+e.nodeValue);return null}function s(e,t){var i=r(e,t);return i?0<i.length?i[i.length-1].nextSibling:e.nextSibling:null}var t=T&&"\x3c!--test--\x3e"===T.createComment("test").text,i=t?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,n=t?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0},c="__ko_matchedEndComment__";I.h={ea:{},childNodes:function(e){return a(e)?r(e):e.childNodes},Ea:function(e){if(a(e)){e=I.h.childNodes(e);for(var t=0,i=e.length;t<i;t++)I.removeNode(e[t])}else I.a.Tb(e)},va:function(e,t){if(a(e)){I.h.Ea(e);for(var i=e.nextSibling,r=0,n=t.length;r<n;r++)i.parentNode.insertBefore(t[r],i)}else I.a.va(e,t)},Vc:function(e,t){var i;a(e)?(i=e.nextSibling,e=e.parentNode):i=e.firstChild;i?t!==i&&e.insertBefore(t,i):e.appendChild(t)},Wb:function(e,t,i){i?(i=i.nextSibling,a(e)&&(e=e.parentNode),i?t!==i&&e.insertBefore(t,i):e.appendChild(t)):I.h.Vc(e,t)},firstChild:function(e){if(a(e))return!e.nextSibling||o(e.nextSibling)?null:e.nextSibling;if(e.firstChild&&o(e.firstChild))throw Error("Found invalid end comment, as the first child of "+e);return e.firstChild},nextSibling:function(e){a(e)&&(e=s(e));if(e.nextSibling&&o(e.nextSibling)){var t=e.nextSibling;if(o(t)&&!I.a.g.get(t,c))throw Error("Found end comment without a matching opening comment, as child of "+e);return null}return e.nextSibling},Cd:a,Vd:function(e){return(e=(t?e.text:e.nodeValue).match(i))?e[1]:null},Sc:function(e){if(l[I.a.R(e)]){var t=e.firstChild;if(t)do{if(1===t.nodeType){var i;i=t.firstChild;var r=null;if(i)do{if(r)r.push(i);else if(a(i)){var n=s(i,!0);n?i=n:r=[i]}else o(i)&&(r=[i])}while(i=i.nextSibling);if(i=r)for(r=t.nextSibling,n=0;n<i.length;n++)r?e.insertBefore(i[n],r):e.appendChild(i[n])}}while(t=t.nextSibling)}}}}(),I.b("virtualElements",I.h),I.b("virtualElements.allowedBindings",I.h.ea),I.b("virtualElements.emptyNode",I.h.Ea),I.b("virtualElements.insertAfter",I.h.Wb),I.b("virtualElements.prepend",I.h.Vc),I.b("virtualElements.setDomNodeChildren",I.h.va),function(){I.ga=function(){this.nd={}};I.a.extend(I.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||I.j.getComponentNameForNode(e);case 8:return I.h.Cd(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return I.j.tc(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return I.j.tc(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return I.h.Vd(e);default:return null}},parseBindingsString:function(t,e,i,r){try{var n=this.nd,a=t+(r&&r.valueAccessors||""),o;if(!(o=n[a])){var s,l="with($context){with($data||{}){return{"+I.m.vb(t,r)+"}}}";s=new Function("$context","$element",l);o=n[a]=s}return o(e,i)}catch(e){throw e.message="Unable to parse bindings.\nBindings value: "+t+"\nMessage: "+e.message,e}}});I.ga.instance=new I.ga}(),I.b("bindingProvider",I.ga),function(){function r(e){var t=(e=I.a.g.get(e,v))&&e.N;t&&(e.N=null,t.Tc())}function n(e,t,i){this.node=e;this.yc=t;this.kb=[];this.H=!1;t.N||I.a.K.za(e,r);i&&i.N&&(i.N.kb.push(e),this.Kb=i)}function a(e){return function(){return e}}function p(e){return e()}function o(i){return I.a.Ga(I.u.G(i),function(e,t){return function(){return i()[t]}})}function s(e,t,i){return"function"===typeof e?o(e.bind(null,t,i)):I.a.Ga(e,a)}function m(e,t){return o(this.getBindings.bind(this,e,t))}function l(e,t){var i=I.h.firstChild(t);if(i){var r,n=I.ga.instance,a=n.preprocessNode;if(a){for(;r=i;)i=I.h.nextSibling(r),a.call(n,r);i=I.h.firstChild(t)}for(;r=i;)i=I.h.nextSibling(r),c(e,r)}I.i.ma(t,I.i.H)}function c(e,t){var i=e,r=1===t.nodeType;r&&I.h.Sc(t);if(r||I.ga.instance.nodeHasBindings(t))i=u(t,null,e).bindingContextForDescendants;i&&!y[I.a.R(t)]&&l(i,t)}function f(r){var n=[],a={},o=[];I.a.P(r,function t(e){if(!a[e]){var i=I.getBindingHandler(e);i&&(i.after&&(o.push(e),I.a.D(i.after,function(e){if(r[e]){if(-1!==I.a.A(o,e))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+o.join(", "));t(e)}}),o.length--),n.push({key:e,Mc:i}));a[e]=!0}});return n}function u(n,e,t){var i=I.a.g.Ub(n,v,{}),r=i.hd;if(!e){if(r)throw Error("You cannot apply bindings multiple times to the same element.");i.hd=!0}r||(i.context=t);i.Zb||(i.Zb={});var a;if(e&&"function"!==typeof e)a=e;else{var o=I.ga.instance,s=o.getBindingAccessors||m,l=I.$(function(){if(a=e?e(t,n):s.call(o,n,t)){if(t[g])t[g]();if(t[_])t[_]()}return a},null,{l:n});a&&l.ja()||(l=null)}var c=t,u;if(a){var d=function(){return I.a.Ga(l?l():a,p)},h=l?function(e){return function(){return p(l()[e])}}:function(e){return a[e]};d.get=function(e){return a[e]&&p(h(e))};d.has=function(e){return e in a};I.i.H in a&&I.i.subscribe(n,I.i.H,function(){var e=(0,a[I.i.H])();if(e){var t=I.h.childNodes(n);t.length&&e(t,I.Ec(t[0]))}});I.i.pa in a&&(c=I.i.Cb(n,t),I.i.subscribe(n,I.i.pa,function(){var e=(0,a[I.i.pa])();e&&I.h.firstChild(n)&&e(n)}));i=f(a);I.a.D(i,function(e){var t=e.Mc.init,i=e.Mc.update,r=e.key;if(8===n.nodeType&&!I.h.ea[r])throw Error("The binding '"+r+"' cannot be used with virtual elements");try{"function"==typeof t&&I.u.G(function(){var e=t(n,h(r),d,c.$data,c);if(e&&e.controlsDescendantBindings){if(u!==R)throw Error("Multiple bindings ("+u+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=r}}),"function"==typeof i&&I.$(function(){i(n,h(r),d,c.$data,c)},null,{l:n})}catch(e){throw e.message='Unable to process binding "'+r+": "+a[r]+'"\nMessage: '+e.message,e}})}i=u===R;return{shouldBindDescendants:i,bindingContextForDescendants:i&&c}}function d(e,t){return e&&e instanceof I.fa?e:new I.fa(e,R,R,t)}var g=I.a.Da("_subscribable"),h=I.a.Da("_ancestorBindingInfo"),_=I.a.Da("_dataDependency");I.c={};var y={script:!0,textarea:!0,template:!0};I.getBindingHandler=function(e){return I.c[e]};var C={};I.fa=function(e,i,r,n,t){function a(){var e=c?l():l,t=I.a.f(e);i?(I.a.extend(o,i),h in i&&(o[h]=i[h])):(o.$parents=[],o.$root=t,o.ko=I);o[g]=u;s?t=o.$data:(o.$rawData=e,o.$data=t);r&&(o[r]=t);n&&n(o,i,t);if(i&&i[g]&&!I.S.o().Vb(i[g]))i[g]();d&&(o[_]=d);return o.$data}var o=this,s=e===C,l=s?R:e,c="function"==typeof l&&!I.O(l),u,d=t&&t.dataDependency;t&&t.exportDependencies?a():(u=I.xb(a),u.v(),u.ja()?u.equalityComparer=null:o[g]=R)};I.fa.prototype.createChildContext=function(t,i,r,e){!e&&i&&"object"==typeof i&&(e=i,i=e.as,r=e.extend);if(i&&e&&e.noChildContext){var n="function"==typeof t&&!I.O(t);return new I.fa(C,this,null,function(e){r&&r(e);e[i]=n?t():t},e)}return new I.fa(t,this,i,function(e,t){e.$parentContext=t;e.$parent=t.$data;e.$parents=(t.$parents||[]).slice(0);e.$parents.unshift(e.$parent);r&&r(e)},e)};I.fa.prototype.extend=function(t,e){return new I.fa(C,this,null,function(e){I.a.extend(e,"function"==typeof t?t(e):t)},e)};var v=I.a.g.Z();n.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)};n.prototype.sd=function(e){I.a.Pa(this.kb,e);!this.kb.length&&this.H&&this.Cc()};n.prototype.Cc=function(){this.H=!0;this.yc.N&&!this.kb.length&&(this.yc.N=null,I.a.K.yb(this.node,r),I.i.ma(this.node,I.i.pa),this.Tc())};I.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(e,t,i,r,n){var a=I.a.g.Ub(e,v,{});a.Fa||(a.Fa=new I.T);n&&n.notifyImmediately&&a.Zb[t]&&I.u.G(i,r,[e]);return a.Fa.subscribe(i,r,t)},ma:function(e,t){var i=I.a.g.get(e,v);if(i&&(i.Zb[t]=!0,i.Fa&&i.Fa.notifySubscribers(e,t),t==I.i.H))if(i.N)i.N.Cc();else if(i.N===R&&i.Fa&&i.Fa.Wa(I.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")},Cb:function(e,t){var i=I.a.g.Ub(e,v,{});i.N||(i.N=new n(e,i,t[h]));return t[h]==i?t:t.extend(function(e){e[h]=i})}};I.Td=function(e){return(e=I.a.g.get(e,v))&&e.context};I.ib=function(e,t,i){1===e.nodeType&&I.h.Sc(e);return u(e,t,d(i))};I.ld=function(e,t,i){i=d(i);return I.ib(e,s(t,i,e),i)};I.Oa=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(d(e),t)};I.vc=function(e,t,i){!x&&S.jQuery&&(x=S.jQuery);if(2>arguments.length){if(t=T.body,!t)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!t||1!==t.nodeType&&8!==t.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");c(d(e,i),t)};I.Dc=function(e){return!e||1!==e.nodeType&&8!==e.nodeType?R:I.Td(e)};I.Ec=function(e){return(e=I.Dc(e))?e.$data:R};I.b("bindingHandlers",I.c);I.b("bindingEvent",I.i);I.b("bindingEvent.subscribe",I.i.subscribe);I.b("bindingEvent.startPossiblyAsyncContentBinding",I.i.Cb);I.b("applyBindings",I.vc);I.b("applyBindingsToDescendants",I.Oa);I.b("applyBindingAccessorsToNode",I.ib);I.b("applyBindingsToNode",I.ld);I.b("contextFor",I.Dc);I.b("dataFor",I.Ec)}(),function(s){function r(r,e){var n=Object.prototype.hasOwnProperty.call(o,r)?o[r]:s,a;n?n.subscribe(e):(n=o[r]=new I.T,n.subscribe(e),t(r,function(e,t){var i=!(!t||!t.synchronous);c[r]={definition:e,Gd:i};delete o[r];a||i?n.notifySubscribers(e):I.na.zb(function(){n.notifySubscribers(e)})}),a=!0)}function t(e,i){l("getConfig",[e],function(t){t?l("loadComponent",[e,t],function(e){i(e,t)}):i(null,null)})}function l(t,i,r,n){n||(n=I.j.loaders.slice(0));var e=n.shift();if(e){var a=e[t];if(a){var o=!1;if(a.apply(e,i.concat(function(e){o?r(null):null!==e?r(e):l(t,i,r,n)}))!==s&&(o=!0,!e.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else l(t,i,r,n)}else r(null)}var o={},c={};I.j={get:function(e,t){var i=Object.prototype.hasOwnProperty.call(c,e)?c[e]:s;i?i.Gd?I.u.G(function(){t(i.definition)}):I.na.zb(function(){t(i.definition)}):r(e,t)},Bc:function(e){delete c[e]},oc:l};I.j.loaders=[];I.b("components",I.j);I.b("components.get",I.j.get);I.b("components.clearCachedDefinition",I.j.Bc)}(),function(){function n(t,e,i,r){function n(){0===--o&&r(a)}var a={},o=2,s=i.template;i=i.viewModel;s?l(e,s,function(e){I.j.oc("loadTemplate",[t,e],function(e){a.template=e;n()})}):n();i?l(e,i,function(e){I.j.oc("loadViewModel",[t,e],function(e){a[u]=e;n()})}):n()}function a(e,t,i){if("function"===typeof t)i(function(e){return new t(e)});else if("function"===typeof t[u])i(t[u]);else if("instance"in t){var r=t.instance;i(function(){return r})}else"viewModel"in t?a(e,t.viewModel,i):e("Unknown viewModel value: "+t)}function o(e){switch(I.a.R(e)){case"script":return I.a.ua(e.text);case"textarea":return I.a.ua(e.value);case"template":if(s(e.content))return I.a.Ca(e.content.childNodes)}return I.a.Ca(e.childNodes)}function s(e){return S.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function l(e,t,i){"string"===typeof t.require?r||S.require?(r||S.require)([t.require],function(e){e&&"object"===typeof e&&e.Xd&&e["default"]&&(e=e["default"]);i(e)}):e("Uses require, but no AMD loader is present"):i(t)}function c(t){return function(e){throw Error("Component '"+t+"': "+e)}}var i={};I.j.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(I.j.tb(e))throw Error("Component "+e+" is already registered");i[e]=t};I.j.tb=function(e){return Object.prototype.hasOwnProperty.call(i,e)};I.j.unregister=function(e){delete i[e];I.j.Bc(e)};I.j.Fc={getConfig:function(e,t){t(I.j.tb(e)?i[e]:null)},loadComponent:function(t,e,i){var r=c(t);l(r,e,function(e){n(t,r,e,i)})},loadTemplate:function(e,t,i){e=c(e);if("string"===typeof t)i(I.a.ua(t));else if(t instanceof Array)i(t);else if(s(t))i(I.a.la(t.childNodes));else if(t.element)if(t=t.element,S.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)i(o(t));else if("string"===typeof t){var r=T.getElementById(t);r?i(o(r)):e("Cannot find element with ID "+t)}else e("Unknown element type: "+t);else e("Unknown template value: "+t)},loadViewModel:function(e,t,i){a(c(e),t,i)}};var u="createViewModel";I.b("components.register",I.j.register);I.b("components.isRegistered",I.j.tb);I.b("components.unregister",I.j.unregister);I.b("components.defaultLoader",I.j.Fc);I.j.loaders.push(I.j.Fc);I.j.dd=i}(),function(){function o(i,e){var t=i.getAttribute("params");if(t){var t=n.parseBindingsString(t,e,i,{valueAccessors:!0,bindingParams:!0}),t=I.a.Ga(t,function(e){return I.o(e,null,{l:i})}),r=I.a.Ga(t,function(t){var e=t.v();return t.ja()?I.o({read:function(){return I.a.f(t())},write:I.Za(e)&&function(e){t()(e)},l:i}):e});Object.prototype.hasOwnProperty.call(r,"$raw")||(r.$raw=t);return r}return{$raw:{}}}I.j.getComponentNameForNode=function(e){var t=I.a.R(e);if(I.j.tb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=I.a.W&&e.tagName===t))return t};I.j.tc=function(e,t,i,r){if(1===t.nodeType){var n=I.j.getComponentNameForNode(t);if(n){e=e||{};if(e.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:n,params:o(t,i)};e.component=r?function(){return a}:a}}return e};var n=new I.ga;9>I.a.W&&(I.j.register=function(t){return function(e){return t.apply(this,arguments)}}(I.j.register),T.createDocumentFragment=function(t){return function(){var e=t();I.j.dd;return e}}(T.createDocumentFragment))}(),function(){function p(e,t,i){t=t.template;if(!t)throw Error("Component '"+e+"' has no template");e=I.a.Ca(t);I.h.va(i,e)}function m(e,t,i){var r=e.createViewModel;return r?r.call(e,t,i):t}var f=0;I.c.component={init:function(o,t,e,i,s){function l(){var e=c&&c.dispose;"function"===typeof e&&e.call(c);d&&d.s();u=c=d=null}var c,u,d,h=I.a.la(I.h.childNodes(o));I.h.Ea(o);I.a.K.za(o,l);I.o(function(){var e=I.a.f(t()),i,r;"string"===typeof e?i=e:(i=I.a.f(e.name),r=I.a.f(e.params));if(!i)throw Error("No component name specified");var n=I.i.Cb(o,s),a=u=++f;I.j.get(i,function(e){if(u===a){l();if(!e)throw Error("Unknown component '"+i+"'");p(i,e,o);var t=m(e,r,{element:o,templateNodes:h});e=n.createChildContext(t,{extend:function(e){e.$component=t;e.$componentTemplateNodes=h}});t&&t.koDescendantsComplete&&(d=I.i.subscribe(o,I.i.pa,t.koDescendantsComplete,t));c=t;I.Oa(e,o)}})},null,{l:o});return{controlsDescendantBindings:!0}}};I.h.ea.component=!0}();var y={class:"className",for:"htmlFor"};I.c.attr={update:function(n,e){var t=I.a.f(e())||{};I.a.P(t,function(e,t){t=I.a.f(t);var i=e.indexOf(":"),i="lookupNamespaceURI"in n&&0<i&&n.lookupNamespaceURI(e.substr(0,i)),r=!1===t||null===t||t===R;r?i?n.removeAttributeNS(i,e):n.removeAttribute(e):t=t.toString();8>=I.a.W&&e in y?(e=y[e],r?n.removeAttribute(e):n[e]=t):r||(i?n.setAttributeNS(i,e,t):n.setAttribute(e,t));"name"===e&&I.a.Yc(n,r?"":t)})}},function(){I.c.checked={after:["value","attr"],init:function(a,o,s){function e(){var e=a.checked,t=l();if(!I.S.Ya()&&(e||!u&&!I.S.qa())){var i=I.u.G(o);if(d){var r=h?i.v():i,n=p;p=t;n!==t?e&&(I.a.Na(r,t,!0),I.a.Na(r,n,!1)):I.a.Na(r,t,e);h&&I.Za(i)&&i(r)}else c&&(t===R?t=e:e||(t=R)),I.m.eb(i,s,"checked",t,!0)}}function t(){var e=I.a.f(o()),t=l();d?(a.checked=0<=I.a.A(e,t),p=t):a.checked=c&&t===R?!!e:l()===e}var l=I.xb(function(){if(s.has("checkedValue"))return I.a.f(s.get("checkedValue"));if(r)return s.has("value")?I.a.f(s.get("value")):a.value}),c="checkbox"==a.type,u="radio"==a.type;if(c||u){var i=o(),d=c&&I.a.f(i)instanceof Array,h=!(d&&i.push&&i.splice),r=u||d,p=d?l():R;u&&!a.name&&I.c.uniqueName.init(a,function(){return!0});I.o(e,null,{l:a});I.a.B(a,"click",e);I.o(t,null,{l:a});i=R}}};I.m.wa.checked=!0;I.c.checkedValue={update:function(e,t){e.value=I.a.f(t())}}}(),I.c["class"]={update:function(e,t){var i=I.a.Db(I.a.f(t()));I.a.Eb(e,e.__ko__cssValue,!1);e.__ko__cssValue=i;I.a.Eb(e,i,!0)}},I.c.css={update:function(i,e){var t=I.a.f(e());null!==t&&"object"==typeof t?I.a.P(t,function(e,t){t=I.a.f(t);I.a.Eb(i,e,t)}):I.c["class"].update(i,e)}},I.c.enable={update:function(e,t){var i=I.a.f(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},I.c.disable={update:function(e,t){I.c.enable.update(e,function(){return!I.a.f(t())})}},I.c.event={init:function(e,a,o,s,l){var t=a()||{};I.a.P(t,function(n){"string"==typeof n&&I.a.B(e,n,function(e){var t,i=a()[n];if(i){try{var r=I.a.la(arguments);s=l.$data;r.unshift(s);t=i.apply(s,r)}finally{!0!==t&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===o.get(n+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},I.c.foreach={Rc:function(i){return function(){var e=i(),t=I.a.bc(e);if(!t||"number"==typeof t.length)return{foreach:e,templateEngine:I.ba.Ma};I.a.f(e);return{foreach:t.data,as:t.as,noChildContext:t.noChildContext,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:I.ba.Ma}}},init:function(e,t){return I.c.template.init(e,I.c.foreach.Rc(t))},update:function(e,t,i,r,n){return I.c.template.update(e,I.c.foreach.Rc(t),i,r,n)}},I.m.Ra.foreach=!1,I.h.ea.foreach=!0,I.c.hasfocus={init:function(r,n,a){function e(e){r.__ko_hasfocusUpdating=!0;var t=r.ownerDocument;if("activeElement"in t){var i;try{i=t.activeElement}catch(e){i=t.body}e=i===r}t=n();I.m.eb(t,a,"hasfocus",e,!0);r.__ko_hasfocusLastValue=e;r.__ko_hasfocusUpdating=!1}var t=e.bind(null,!0),i=e.bind(null,!1);I.a.B(r,"focus",t);I.a.B(r,"focusin",t);I.a.B(r,"blur",i);I.a.B(r,"focusout",i);r.__ko_hasfocusLastValue=!1},update:function(e,t){var i=!!I.a.f(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),I.u.G(I.a.Fb,null,[e,i?"focusin":"focusout"]))}},I.m.wa.hasfocus=!0,I.c.hasFocus=I.c.hasfocus,I.m.wa.hasFocus="hasfocus",I.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){I.a.fc(e,t())}},function(){function e(e,p,m){I.c[e]={init:function(n,a,e,t,o){var s,l,c={},u,d,h;if(p){t=e.get("as");var i=e.get("noChildContext");h=!(t&&i);c={as:t,noChildContext:i,exportDependencies:h}}d=(u="render"==e.get("completeOn"))||e.has(I.i.pa);I.o(function(){var e=I.a.f(a()),t=!m!==!e,i=!l,r;if(h||t!==s){d&&(o=I.i.Cb(n,o));if(t){if(!p||h)c.dataDependency=I.S.o();r=p?o.createChildContext("function"==typeof e?e:a,c):I.S.qa()?o.extend(null,c):o}i&&I.S.qa()&&(l=I.a.Ca(I.h.childNodes(n),!0));t?(i||I.h.va(n,I.a.Ca(l)),I.Oa(r,n)):(I.h.Ea(n),u||I.i.ma(n,I.i.H));s=t}},null,{l:n});return{controlsDescendantBindings:!0}}};I.m.Ra[e]=!1;I.h.ea[e]=!0}e("if");e("ifnot",!1,!0);e("with",!0)}(),I.c.let={init:function(e,t,i,r,n){t=n.extend(t);I.Oa(t,e);return{controlsDescendantBindings:!0}}},I.h.ea.let=!0;var C={};I.c.options={init:function(e){if("select"!==I.a.R(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(r,e,n){function t(){return I.a.jb(r.options,function(e){return e.selected})}function a(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function i(e,t){if(p&&c)I.i.ma(r,I.i.H);else if(h.length){var i=0<=I.a.A(h,I.w.M(t[0]));I.a.Zc(t[0],i);p&&!i&&I.u.G(I.a.Fb,null,[r,"change"])}}var o=r.multiple,s=0!=r.length&&o?r.scrollTop:null,l=I.a.f(e()),c=n.get("valueAllowUnset")&&n.has("value"),u=n.get("optionsIncludeDestroyed");e={};var d,h=[];c||(o?h=I.a.Mb(t(),I.w.M):0<=r.selectedIndex&&h.push(I.w.M(r.options[r.selectedIndex])));l&&("undefined"==typeof l.length&&(l=[l]),d=I.a.jb(l,function(e){return u||e===R||null===e||!I.a.f(e._destroy)}),n.has("optionsCaption")&&(l=I.a.f(n.get("optionsCaption")),null!==l&&l!==R&&d.unshift(C)));var p=!1;e.beforeRemove=function(e){r.removeChild(e)};l=i;n.has("optionsAfterRender")&&"function"==typeof n.get("optionsAfterRender")&&(l=function(e,t){i(0,t);I.u.G(n.get("optionsAfterRender"),null,[t[0],e!==C?e:R])});I.a.ec(r,d,function(e,t,i){i.length&&(h=!c&&i[0].selected?[I.w.M(i[0])]:[],p=!0);t=r.ownerDocument.createElement("option");e===C?(I.a.Bb(t,n.get("optionsCaption")),I.w.cb(t,R)):(i=a(e,n.get("optionsValue"),e),I.w.cb(t,I.a.f(i)),e=a(e,n.get("optionsText"),i),I.a.Bb(t,e));return[t]},e,l);if(!c){var m;o?m=h.length&&t().length<h.length:m=h.length&&0<=r.selectedIndex?I.w.M(r.options[r.selectedIndex])!==h[0]:h.length||0<=r.selectedIndex;m&&I.u.G(I.a.Fb,null,[r,"change"])}(c||I.S.Ya())&&I.i.ma(r,I.i.H);I.a.wd(r);s&&20<Math.abs(s-r.scrollTop)&&(r.scrollTop=s)}},I.c.options.$b=I.a.g.Z(),I.c.selectedOptions={init:function(r,n,i){function e(){var e=n(),t=[];I.a.D(r.getElementsByTagName("option"),function(e){e.selected&&t.push(I.w.M(e))});I.m.eb(e,i,"selectedOptions",t)}function t(){var i=I.a.f(n()),e=r.scrollTop;i&&"number"==typeof i.length&&I.a.D(r.getElementsByTagName("option"),function(e){var t=0<=I.a.A(i,I.w.M(e));e.selected!=t&&I.a.Zc(e,t)});r.scrollTop=e}if("select"!=I.a.R(r))throw Error("selectedOptions binding applies only to SELECT elements");var a;I.i.subscribe(r,I.i.H,function(){a?e():(I.a.B(r,"change",e),a=I.o(t,null,{l:r}))},null,{notifyImmediately:!0})},update:function(){}},I.m.wa.selectedOptions=!0,I.c.style={update:function(r,e){var t=I.a.f(e()||{});I.a.P(t,function(e,t){t=I.a.f(t);if(null===t||t===R||!1===t)t="";if(x)x(r).css(e,t);else if(/^--/.test(e))r.style.setProperty(e,t);else{e=e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()});var i=r.style[e];r.style[e]=t;t===i||r.style[e]!=i||isNaN(t)||(r.style[e]=t+"px")}})}},I.c.submit={init:function(r,n,e,t,a){if("function"!=typeof n())throw Error("The value for a submit binding must be a function");I.a.B(r,"submit",function(e){var t,i=n();try{t=i.call(a.$data,r)}finally{!0!==t&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}})}},I.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){I.a.Bb(e,t())}},I.h.ea.text=!0,function(){if(S&&S.navigator){var e=function(e){if(e)return parseFloat(e[1])},t=S.navigator.userAgent,h,p,m,f,g;(h=S.opera&&S.opera.version&&parseInt(S.opera.version()))||(g=e(t.match(/Edge\/([^ ]+)$/)))||e(t.match(/Chrome\/([^ ]+)/))||(p=e(t.match(/Version\/([^ ]+) Safari/)))||(m=e(t.match(/Firefox\/([^ ]+)/)))||(f=I.a.W||e(t.match(/MSIE ([^ ]+)/)))||(f=e(t.match(/rv:([^ )]+)/)))}if(8<=f&&10>f)var r=I.a.g.Z(),n=I.a.g.Z(),a=function(e){var t=this.activeElement;(t=t&&I.a.g.get(t,n))&&t(e)},_=function(e,t){var i=e.ownerDocument;I.a.g.get(i,r)||(I.a.g.set(i,r,!0),I.a.B(i,"selectionchange",a));I.a.g.set(e,n,t)};I.c.textInput={init:function(i,t,r){function e(e,t){I.a.B(i,e,t)}function n(){var e=I.a.f(t());if(null===e||e===R)e="";c!==R&&e===c?I.a.setTimeout(n,4):i.value!==e&&(d=!0,i.value=e,d=!1,s=i.value)}function a(){l||(c=i.value,l=I.a.setTimeout(o,4))}function o(){clearTimeout(l);c=l=R;var e=i.value;s!==e&&(s=e,I.m.eb(t(),r,"textInput",e))}var s=i.value,l,c,u=9==I.a.W?a:o,d=!1;f&&e("keypress",o);11>f&&e("propertychange",function(e){d||"value"!==e.propertyName||u()});8==f&&(e("keyup",o),e("keydown",o));_&&(_(i,u),e("dragend",a));(!f||9<=f)&&e("input",u);5>p&&"textarea"===I.a.R(i)?(e("keydown",a),e("paste",a),e("cut",a)):11>h?e("keydown",a):4>m?(e("DOMAutoComplete",o),e("dragdrop",o),e("drop",o)):g&&"number"===i.type&&e("keydown",a);e("change",o);e("blur",o);I.o(n,null,{l:i})}};I.m.wa.textInput=!0;I.c.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),I.c.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++I.c.uniqueName.rd;I.a.Yc(e,i)}}},I.c.uniqueName.rd=0,I.c.using={init:function(e,t,i,r,n){var a;i.has("as")&&(a={as:i.get("as"),noChildContext:i.get("noChildContext")});t=n.createChildContext(t,a);I.Oa(t,e);return{controlsDescendantBindings:!0}}},I.h.ea.using=!0,I.c.value={init:function(i,r,n){var a=I.a.R(i),e="input"==a;if(!e||"checkbox"!=i.type&&"radio"!=i.type){var t=[],o=n.get("valueUpdate"),s=!1,l=null;o&&("string"==typeof o?t=[o]:t=I.a.wc(o),I.a.Pa(t,"change"));var c=function(){l=null;s=!1;var e=r(),t=I.w.M(i);I.m.eb(e,n,"value",t)};!I.a.W||!e||"text"!=i.type||"off"==i.autocomplete||i.form&&"off"==i.form.autocomplete||-1!=I.a.A(t,"propertychange")||(I.a.B(i,"propertychange",function(){s=!0}),I.a.B(i,"focus",function(){s=!1}),I.a.B(i,"blur",function(){s&&c()}));I.a.D(t,function(e){var t=c;I.a.Ud(e,"after")&&(t=function(){l=I.w.M(i);I.a.setTimeout(c,0)},e=e.substring(5));I.a.B(i,e,t)});var u;u=e&&"file"==i.type?function(){var e=I.a.f(r());null===e||e===R||""===e?i.value="":I.u.G(c)}:function(){var e=I.a.f(r()),t=I.w.M(i);if(null!==l&&e===l)I.a.setTimeout(u,0);else if(e!==t||t===R)"select"===a?(t=n.get("valueAllowUnset"),I.w.cb(i,e,t),t||e===I.w.M(i)||I.u.G(c)):I.w.cb(i,e)};if("select"===a){var d;I.i.subscribe(i,I.i.H,function(){d?n.get("valueAllowUnset")?u():c():(I.a.B(i,"change",c),d=I.o(u,null,{l:i}))},null,{notifyImmediately:!0})}else I.a.B(i,"change",c),I.o(u,null,{l:i})}else I.ib(i,{checkedValue:r})},update:function(){}},I.m.wa.value=!0,I.c.visible={update:function(e,t){var i=I.a.f(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},I.c.hidden={update:function(e,t){I.c.visible.update(e,function(){return!I.a.f(t())})}},function(a){I.c[a]={init:function(e,t,i,r,n){return I.c.event.init.call(this,e,function(){var e={};e[a]=t();return e},i,r,n)}}}("click"),I.ca=function(){},I.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},I.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},I.ca.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||T;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new I.C.F(i)}if(1==e.nodeType||8==e.nodeType)return new I.C.ia(e);throw Error("Unknown template type: "+e)},I.ca.prototype.renderTemplate=function(e,t,i,r){e=this.makeTemplateSource(e,r);return this.renderTemplateSource(e,t,i,r)},I.ca.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(e,t).data("isRewritten")},I.ca.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i);t=t(e.text());e.text(t);e.data("isRewritten",!0)},I.b("templateEngine",I.ca),I.kc=function(){function o(e,t,i,r){e=I.m.ac(e);for(var n=I.m.Ra,a=0;a<e.length;a++){var o=e[a].key;if(Object.prototype.hasOwnProperty.call(n,o)){var s=n[o];if("function"===typeof s){if(o=s(e[a].value))throw Error(o)}else if(!s)throw Error("This template engine does not support the '"+o+"' binding within its templates")}}i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+I.m.vb(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')";return r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return I.kc.Ld(e,t)},i)},Ld:function(e,a){return e.replace(t,function(e,t,i,r,n){return o(n,t,i,a)}).replace(i,function(e,t){return o(t,"\x3c!-- ko --\x3e","#comment",a)})},md:function(r,n){return I.aa.Xb(function(e,t){var i=e.nextSibling;i&&i.nodeName.toLowerCase()===n&&I.ib(i,r,t)})}}}(),I.b("__tr_ambtns",I.kc.md),function(){I.C={};I.C.F=function(e){if(this.F=e){var t=I.a.R(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}};I.C.F.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.F[e];var t=arguments[0];"innerHTML"===e?I.a.fc(this.F,t):this.F[e]=t};var t=I.a.g.Z()+"_";I.C.F.prototype.data=function(e){if(1===arguments.length)return I.a.g.get(this.F,t+e);I.a.g.set(this.F,t+e,arguments[1])};var n=I.a.g.Z();I.C.F.prototype.nodes=function(){var e=this.F;if(0==arguments.length){var t=I.a.g.get(e,n)||{},i=t.lb||(3===this.ab?e.content:4===this.ab?e:R);if(!i||t.jd){var r=this.text();r&&r!==t.bb&&(i=I.a.Md(r,e.ownerDocument),I.a.g.set(e,n,{lb:i,bb:r,jd:!0}))}return i}t=arguments[0];this.ab!==R&&this.text("");I.a.g.set(e,n,{lb:t})};I.C.ia=function(e){this.F=e};I.C.ia.prototype=new I.C.F;I.C.ia.prototype.constructor=I.C.ia;I.C.ia.prototype.text=function(){if(0==arguments.length){var e=I.a.g.get(this.F,n)||{};e.bb===R&&e.lb&&(e.bb=e.lb.innerHTML);return e.bb}I.a.g.set(this.F,n,{bb:arguments[0]})};I.b("templateSources",I.C);I.b("templateSources.domElement",I.C.F);I.b("templateSources.anonymousTemplate",I.C.ia)}(),function(){function r(e,t,i){var r;for(t=I.h.nextSibling(t);e&&(r=e)!==t;)e=I.h.nextSibling(r),i(r,e)}function h(e,t){if(e.length){var n=e[0],a=e[e.length-1],i=n.parentNode,o=I.ga.instance,s=o.preprocessNode;if(s){r(n,a,function(e,t){var i=e.previousSibling,r=s.call(o,e);r&&(e===n&&(n=r[0]||t),e===a&&(a=r[r.length-1]||i))});e.length=0;if(!n)return;n===a?e.push(n):(e.push(n,a),I.a.Ua(e,i))}r(n,a,function(e){1!==e.nodeType&&8!==e.nodeType||I.vc(t,e)});r(n,a,function(e){1!==e.nodeType&&8!==e.nodeType||I.aa.cd(e,[t])});I.a.Ua(e,i)}}function l(e){return e.nodeType?e:0<e.length?e[0]:null}function p(e,t,i,r,n){n=n||{};var a=(e&&l(e)||i||{}).ownerDocument,o=n.templateEngine||c;I.kc.xd(i,o,a);i=o.renderTemplate(i,r,n,a);if("number"!=typeof i.length||0<i.length&&"number"!=typeof i[0].nodeType)throw Error("Template engine must return an array of DOM nodes");a=!1;switch(t){case"replaceChildren":I.h.va(e,i);a=!0;break;case"replaceNode":I.a.Xc(e,i);a=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}a&&(h(i,r),n.afterRender&&I.u.G(n.afterRender,null,[i,r[n.as||"$data"]]),"replaceChildren"==t&&I.i.ma(e,I.i.H));return i}function m(e,t,i){return I.O(e)?e():"function"===typeof e?e(t,i):e}var c;I.gc=function(e){if(e!=R&&!(e instanceof I.ca))throw Error("templateEngine must inherit from ko.templateEngine");c=e};I.dc=function(i,r,n,a,o){n=n||{};if((n.templateEngine||c)==R)throw Error("Set a template engine before calling renderTemplate");o=o||"replaceChildren";if(a){var s=l(a);return I.$(function(){var e=r&&r instanceof I.fa?r:new I.fa(r,null,null,null,{exportDependencies:!0}),t=m(i,e.$data,e),e=p(a,o,t,e,n);"replaceNode"==o&&(a=e,s=l(a))},null,{Sa:function(){return!s||!I.a.Sb(s)},l:s&&"replaceNode"==o?s.parentNode:s})}return I.aa.Xb(function(e){I.dc(i,r,n,e,"replaceNode")})};I.Qd=function(r,t,n,a,o){function i(e,t){I.u.G(I.a.ec,null,[a,e,l,n,s,t]);I.i.ma(a,I.i.H)}function s(e,t){h(t,c);n.afterRender&&n.afterRender(t,e);c=null}function l(e,t){c=o.createChildContext(e,{as:u,noChildContext:n.noChildContext,extend:function(e){e.$index=t;u&&(e[u+"Index"]=t)}});var i=m(r,e,c);return p(a,"ignoreTargetNode",i,c,n)}var c,u=n.as,d=!1===n.includeDestroyed||I.options.foreachHidesDestroyed&&!n.includeDestroyed;if(d||n.beforeRemove||!I.Pc(t))return I.$(function(){var e=I.a.f(t)||[];"undefined"==typeof e.length&&(e=[e]);d&&(e=I.a.jb(e,function(e){return e===R||null===e||!I.a.f(e._destroy)}));i(e)},null,{l:a});i(t.v());var e=t.subscribe(function(e){i(t(),e)},null,"arrayChange");e.l(a);return e};var o=I.a.g.Z(),n=I.a.g.Z();I.c.template={init:function(e,t){var i=I.a.f(t());if("string"==typeof i||"name"in i)I.h.Ea(e);else if("nodes"in i){i=i.nodes||[];if(I.O(i))throw Error('The "nodes" option must be a plain, non-observable array.');var r=i[0]&&i[0].parentNode;r&&I.a.g.get(r,n)||(r=I.a.Yb(i),I.a.g.set(r,n,!0));new I.C.ia(e).nodes(r)}else if(i=I.h.childNodes(e),0<i.length)r=I.a.Yb(i),new I.C.ia(e).nodes(r);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(e,t,i,r,n){var a=t();t=I.a.f(a);i=!0;r=null;"string"==typeof t?t={}:(a="name"in t?t.name:e,"if"in t&&(i=I.a.f(t["if"])),i&&"ifnot"in t&&(i=!I.a.f(t.ifnot)),i&&!a&&(i=!1));"foreach"in t?r=I.Qd(a,i&&t.foreach||[],t,e,n):i?(i=n,"data"in t&&(i=n.createChildContext(t.data,{as:t.as,noChildContext:t.noChildContext,exportDependencies:!0})),r=I.dc(a,i,t,e)):I.h.Ea(e);n=r;(t=I.a.g.get(e,o))&&"function"==typeof t.s&&t.s();I.a.g.set(e,o,!n||n.ja&&!n.ja()?R:n)}};I.m.Ra.template=function(e){e=I.m.ac(e);return 1==e.length&&e[0].unknown||I.m.Id(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"};I.h.ea.template=!0}(),I.b("setTemplateEngine",I.gc),I.b("renderTemplate",I.dc),I.a.Kc=function(e,t,i){if(e.length&&t.length){var r,n,a,o,s;for(r=n=0;(!i||r<i)&&(o=e[n]);++n){for(a=0;s=t[a];++a)if(o.value===s.value){o.moved=s.index;s.moved=o.index;t.splice(a,1);r=a=0;break}r+=a}}},I.a.Pb=function(){function r(e,t,i,r,n){var a=Math.min,o=Math.max,s=[],l,c=e.length,u,d=t.length,h=d-c||1,p=c+d+1,m,f,g;for(l=0;l<=c;l++)for(f=m,s.push(m=[]),g=a(d,l+h),u=o(0,l-1);u<=g;u++)m[u]=u?l?e[l-1]===t[u-1]?f[u-1]:a(f[u]||p,m[u-1]||p)+1:u+1:l+1;a=[];o=[];h=[];l=c;for(u=d;l||u;)d=s[l][u]-1,u&&d===s[l][u-1]?o.push(a[a.length]={status:i,value:t[--u],index:u}):l&&d===s[l-1][u]?h.push(a[a.length]={status:r,value:e[--l],index:l}):(--u,--l,n.sparse||a.push({status:"retained",value:t[u]}));I.a.Kc(h,o,!n.dontLimitMoves&&10*c);return a.reverse()}return function(e,t,i){i="boolean"===typeof i?{dontLimitMoves:i}:i||{};e=e||[];t=t||[];return e.length<t.length?r(e,t,"added","deleted",i):r(t,e,"deleted","added",i)}}(),I.b("utils.compareArrays",I.a.Pb),function(){function w(t,i,r,n,a){var o=[],e=I.$(function(){var e=i(r,a,I.a.Ua(o,t))||[];0<o.length&&(I.a.Xc(o,e),n&&I.u.G(n,null,[r,e,a]));o.length=0;I.a.Nb(o,e)},null,{l:t,Sa:function(){return!I.a.kd(o)}});return{Y:o,$:e.ja()?e:R}}var D=I.a.g.Z(),M=I.a.g.Z();I.a.ec=function(t,e,i,r,n,a){function o(e){C={Aa:e,pb:I.ta(p++)};d.push(C);u||y.push(C)}function s(e){C=c[e];p!==C.pb.v()&&_.push(C);C.pb(p++);I.a.Ua(C.Y,t);d.push(C)}function l(t,i){if(t)for(var r=0,e=i.length;r<e;r++)I.a.D(i[r].Y,function(e){t(e,r,i[r].Aa)})}e=e||[];"undefined"==typeof e.length&&(e=[e]);r=r||{};var c=I.a.g.get(t,D),u=!c,d=[],h=0,p=0,m=[],f=[],g=[],_=[],y=[],C,v=0;if(u)I.a.D(e,o);else{if(!a||c&&c._countWaitingForRemove){var S=I.a.Mb(c,function(e){return e.Aa});a=I.a.Pb(S,e,{dontLimitMoves:r.dontLimitMoves,sparse:!0})}for(var S=0,T,x,b;T=a[S];S++)switch(x=T.moved,b=T.index,T.status){case"deleted":for(;h<b;)s(h++);x===R&&(C=c[h],C.$&&(C.$.s(),C.$=R),I.a.Ua(C.Y,t).length&&(r.beforeRemove&&(d.push(C),v++,C.Aa===M?C=null:g.push(C)),C&&m.push.apply(m,C.Y)));h++;break;case"added":for(;p<b;)s(h++);x!==R?(f.push(d.length),s(x)):o(T.value)}for(;p<e.length;)s(h++);d._countWaitingForRemove=v}I.a.g.set(t,D,d);l(r.beforeMove,_);I.a.D(m,r.beforeRemove?I.oa:I.removeNode);var E,P,A;try{A=t.ownerDocument.activeElement}catch(e){}if(f.length)for(;(S=f.shift())!=R;){C=d[S];for(E=R;S;)if((P=d[--S].Y)&&P.length){E=P[P.length-1];break}for(e=0;h=C.Y[e];E=h,e++)I.h.Wb(t,h,E)}for(S=0;C=d[S];S++){C.Y||I.a.extend(C,w(t,i,C.Aa,n,C.pb));for(e=0;h=C.Y[e];E=h,e++)I.h.Wb(t,h,E);!C.Ed&&n&&(n(C.Aa,C.Y,C.pb),C.Ed=!0,E=C.Y[C.Y.length-1])}A&&t.ownerDocument.activeElement!=A&&A.focus();l(r.beforeRemove,g);for(S=0;S<g.length;++S)g[S].Aa=M;l(r.afterMove,_);l(r.afterAdd,y)}}(),I.b("utils.setDomNodeChildrenFromArrayMapping",I.a.ec),I.ba=function(){this.allowTemplateRewriting=!1},I.ba.prototype=new I.ca,I.ba.prototype.constructor=I.ba,I.ba.prototype.renderTemplateSource=function(e,t,i,r){if(t=(9>I.a.W?0:e.nodes)?e.nodes():null)return I.a.la(t.cloneNode(!0).childNodes);e=e.text();return I.a.ua(e,r)},I.ba.Ma=new I.ba,I.gc(I.ba.Ma),I.b("nativeTemplateEngine",I.ba),function(){I.$a=function(){var a=this.Hd=function(){if(!x||!x.tmpl)return 0;try{if(0<=x.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(e,t,i,r){r=r||T;i=i||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var n=e.data("precompiled");n||(n=e.text()||"",n=x.template(null,"{{ko_with $item.koBindingContext}}"+n+"{{/ko_with}}"),e.data("precompiled",n));e=[t.$data];t=x.extend({koBindingContext:t},i.templateOptions);t=x.tmpl(n,e,t);t.appendTo(r.createElement("div"));x.fragments={};return t};this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"};this.addTemplate=function(e,t){T.write("<script type='text/html' id='"+e+"'>"+t+"<\/script>")};0<a&&(x.tmpl.tag.ko_code={open:"__.push($1 || '');"},x.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};I.$a.prototype=new I.ca;I.$a.prototype.constructor=I.$a;var e=new I.$a;0<e.Hd&&I.gc(e);I.b("jqueryTmplTemplateEngine",I.$a)}()}(S.ko={})}();var knockout=ko;"undefined"!=typeof window?(ko=window.ko,void 0!==oldValue?window.ko=oldValue:delete window.ko):(ko=global.ko,void 0!==oldValue?global.ko=oldValue:delete global.ko);var OBSERVABLES_PROPERTY="__knockoutObservables",SUBSCRIBABLE_PROPERTY="__knockoutSubscribable";function track(r,e){if(!r)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,a=getAllObservablesForObject(r,!0);return(e=e||Object.getOwnPropertyNames(r)).forEach(function(e){var t,i;e!==OBSERVABLES_PROPERTY&&e!==SUBSCRIBABLE_PROPERTY&&(e in a||(t=(i=r[e])instanceof Array,i=n.isObservable(i)?i:t?n.observableArray(i):n.observable(i),Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:i,set:n.isWriteableObservable(i)?i:void 0}),a[e]=i,t&¬ifyWhenPresentOrFutureArrayValuesMutate(n,i)))}),r}function getAllObservablesForObject(e,t){var i=e[OBSERVABLES_PROPERTY];return!i&&t&&(i={},Object.defineProperty(e,OBSERVABLES_PROPERTY,{value:i})),i}function defineComputedProperty(e,t,i){var r={owner:e,deferEvaluation:!0};if("function"==typeof i)r.read=i;else{if("value"in i)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof i.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=i.get,r.write=i.set}return e[t]=this.computed(r),track.call(this,e,[t]),e}function notifyWhenPresentOrFutureArrayValuesMutate(t,i){var r=null;t.computed(function(){r&&(r.dispose(),r=null);var e=i();e instanceof Array&&(r=startWatchingArrayInstance(t,i,e))})}function startWatchingArrayInstance(e,t,i){return getSubscribableForArray(e,i).subscribe(t)}function getSubscribableForArray(e,t){var i,r=t[SUBSCRIBABLE_PROPERTY];return r||(r=new e.subscribable,Object.defineProperty(t,SUBSCRIBABLE_PROPERTY,{value:r}),wrapStandardArrayMutators(t,r,i={}),addKnockoutArrayMutators(e,t,r,i)),r}function wrapStandardArrayMutators(i,r,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(e){var t=i[e];i[e]=function(){var e=t.apply(this,arguments);return!0!==n.pause&&r.notifySubscribers(this),e}})}function addKnockoutArrayMutators(i,r,n,a){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(t){Object.defineProperty(r,t,{enumerable:!1,value:function(){var e;a.pause=!0;try{e=i.observableArray.fn[t].apply(i.observableArray(r),arguments)}finally{a.pause=!1}return n.notifySubscribers(r),e}})})}function getObservable(e,t){if(!e)return null;e=getAllObservablesForObject(e,!1);return e&&e[t]||null}function valueHasMutated(e,t){t=getObservable(e,t);t&&t.valueHasMutated()}function attachToKo(e){e.track=track,e.getObservable=getObservable,e.valueHasMutated=valueHasMutated,e.defineProperty=defineComputedProperty}var knockout_es5={attachToKo:attachToKo},svgNS$1="http://www.w3.org/2000/svg",svgClassName="cesium-svgPath-svg",SvgPathBindingHandler={register:function(o){o.bindingHandlers.cesiumSvgPath={init:function(e,r){var n=document.createElementNS(svgNS$1,"svg:svg");n.setAttribute("class",svgClassName);var a=document.createElementNS(svgNS$1,"path");return n.appendChild(a),o.virtualElements.setDomNodeChildren(e,[n]),o.computed({read:function(){var e=o.unwrap(r());a.setAttribute("d",o.unwrap(e.path));var t=o.unwrap(e.width),i=o.unwrap(e.height);n.setAttribute("width",t),n.setAttribute("height",i),n.setAttribute("viewBox","0 0 "+t+" "+i),e.css&&n.setAttribute("class",svgClassName+" "+o.unwrap(e.css))},disposeWhenNodeIsRemoved:e}),{controlsDescendantBindings:!0}}},o.virtualElements.allowedBindings.cesiumSvgPath=!0}};knockout_es5.attachToKo(knockout),SvgPathBindingHandler.register(knockout);var tmp$1={},Kak,Lak,Mak,Nak,Oak,Pak,Nik,Oik,Gak,Hak,Iak;Kak={defaultNoDataValue:-34027999387901484e22,decode:function(e,t){var i=(t=t||{}).encodedMaskData||null===t.encodedMaskData,r=Oak(e,t.inputOffset||0,i),e=null!==t.noDataValue?t.noDataValue:Kak.defaultNoDataValue,i=Lak(r,t.pixelType||Float32Array,t.encodedMaskData,e,t.returnMask),e={width:r.width,height:r.height,pixelData:i.resultPixels,minValue:i.minValue,maxValue:r.pixels.maxValue,noDataValue:e};return i.resultMask&&(e.maskData=i.resultMask),t.returnEncodedMask&&r.mask&&(e.encodedMaskData=r.mask.bitset||null),t.returnFileInfo&&(e.fileInfo=Mak(r),t.computeUsedBitDepths&&(e.fileInfo.bitDepths=Nak(r))),e}},Lak=function(e,t,i,r,n){var a,o,s,l=0,c=e.pixels.numBlocksX,u=e.pixels.numBlocksY,d=Math.floor(e.width/c),h=Math.floor(e.height/u),p=2*e.maxZError,m=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),o=new t(e.width*e.height),n&&i&&(s=new Uint8Array(e.width*e.height));for(var f,g,_=new Float32Array(d*h),y=0;y<=u;y++){var C=y!==u?h:e.height%u;if(0!==C)for(var v=0;v<=c;v++){var S=v!==c?d:e.width%c;if(0!==S){var T,x,b,E,P=y*e.width*h+v*d,A=e.width-S,w=e.pixels.blocks[l];if(w.encoding<2?(T=0===w.encoding?w.rawData:(Pak(w.stuffedData,w.bitsPerPixel,w.numValidPixels,w.offset,p,_,e.pixels.maxValue),_),x=0):b=2===w.encoding?0:w.offset,i)for(g=0;g<C;g++){for(7&P&&(E=i[P>>3],E<<=7&P),f=0;f<S;f++)128&(E=!(7&P)?i[P>>3]:E)?(s&&(s[P]=1),m=(a=w.encoding<2?T[x++]:b)<m?a:m,o[P++]=a):(s&&(s[P]=0),o[P++]=r),E<<=1;P+=A}else if(w.encoding<2)for(g=0;g<C;g++){for(f=0;f<S;f++)m=(a=T[x++])<m?a:m,o[P++]=a;P+=A}else for(m=b<m?b:m,g=0;g<C;g++){for(f=0;f<S;f++)o[P++]=b;P+=A}if(1===w.encoding&&x!==w.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:o,resultMask:s,minValue:m}},Mak=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},Nak=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},r=0;r<t;r++){var n=e.pixels.blocks[r];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},Oak=function(e,t,i){var r={},n=new Uint8Array(e,t,10);if(r.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==r.fileIdentifierString.trim())throw"Unexpected file identifier string: "+r.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(r.fileVersion=a.getInt32(0,!0),r.imageType=a.getInt32(4,!0),r.height=a.getUint32(8,!0),r.width=a.getUint32(12,!0),r.maxZError=a.getFloat64(16,!0),t+=24,!i)if(a=new DataView(e,t,16),r.mask={},r.mask.numBlocksY=a.getUint32(0,!0),r.mask.numBlocksX=a.getUint32(4,!0),r.mask.numBytes=a.getUint32(8,!0),r.mask.maxValue=a.getFloat32(12,!0),t+=16,0<r.mask.numBytes){var o=new Uint8Array(Math.ceil(r.width*r.height/8)),s=(a=new DataView(e,t,r.mask.numBytes)).getInt16(0,!0),l=2,c=0;do{if(0<s)for(;s--;)o[c++]=a.getUint8(l++);else for(var u=a.getUint8(l++),s=-s;s--;)o[c++]=u}while(s=a.getInt16(l,!0),(l+=2)<r.mask.numBytes);if(-32768!==s||c<o.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=o,t+=r.mask.numBytes}else 0==(r.mask.numBytes|r.mask.numBlocksY|r.mask.maxValue)&&(r.mask.bitset=new Uint8Array(Math.ceil(r.width*r.height/8)));a=new DataView(e,t,16),r.pixels={},r.pixels.numBlocksY=a.getUint32(0,!0),r.pixels.numBlocksX=a.getUint32(4,!0),r.pixels.numBytes=a.getUint32(8,!0),r.pixels.maxValue=a.getFloat32(12,!0),t+=16;var n=r.pixels.numBlocksX,i=r.pixels.numBlocksY,d=n+(0<r.width%n?1:0),h=i+(0<r.height%i?1:0);r.pixels.blocks=new Array(d*h);for(var p=0,m=0;m<h;m++)for(var f=0;f<d;f++){var g=0,_=e.byteLength-t;a=new DataView(e,t,Math.min(10,_));var y={};r.pixels.blocks[p++]=y;var C,_=a.getUint8(0);if(g++,y.encoding=63&_,3<y.encoding)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==_&&2!==_){if(_>>=6,2===(y.offsetType=_))y.offset=a.getInt8(1),g++;else if(1===_)y.offset=a.getInt16(1,!0),g+=2;else{if(0!==_)throw"Invalid block offset type";y.offset=a.getFloat32(1,!0),g+=4}if(1===y.encoding)if(_=a.getUint8(g),g++,y.bitsPerPixel=63&_,_>>=6,2===(y.numValidPixelsType=_))y.numValidPixels=a.getUint8(g),g++;else if(1===_)y.numValidPixels=a.getUint16(g,!0),g+=2;else{if(0!==_)throw"Invalid valid pixel count type";y.numValidPixels=a.getUint32(g,!0),g+=4}}if(t+=g,3!==y.encoding)if(0===y.encoding){var v=(r.pixels.numBytes-1)/4;if(v!==Math.floor(v))throw"uncompressed block has invalid length";C=new ArrayBuffer(4*v),new Uint8Array(C).set(new Uint8Array(e,t,4*v));var S=new Float32Array(C);y.rawData=S,t+=4*v}else 1===y.encoding&&(S=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),v=Math.ceil(S/4),C=new ArrayBuffer(4*v),new Uint8Array(C).set(new Uint8Array(e,t,S)),y.stuffedData=new Uint32Array(C),t+=S)}else t++}return r.eofOffset=t,r},Pak=function(e,t,i,r,n,a,o){var s,l,c,u,d=(1<<t)-1,h=0,p=0,m=Math.ceil((o-r)/n),f=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*f,s=0;s<i;s++)0===p&&(u=e[h++],p=32),t<=p?(c=u>>>p-t&d,p-=t):(c=(u&d)<<(l=t-p)&d,c+=(u=e[h++])>>>(p=32-l)),a[s]=c<m?r+c*n:o;return a},Gak=Kak,Hak=function(){var v=function(e,t,i,r,n,a,o,s){var l,c,u,d,h,p=(1<<i)-1,m=0,f=0,g=4*e.length-Math.ceil(i*r/8);if(e[e.length-1]<<=8*g,n)for(l=0;l<r;l++)0===f&&(u=e[m++],f=32),i<=f?(c=u>>>f-i&p,f-=i):(c=(u&p)<<(d=i-f)&p,c+=(u=e[m++])>>>(f=32-d)),t[l]=n[c];else for(h=Math.ceil((s-a)/o),l=0;l<r;l++)0===f&&(u=e[m++],f=32),i<=f?(c=u>>>f-i&p,f-=i):(c=(u&p)<<(d=i-f)&p,c+=(u=e[m++])>>>(f=32-d)),t[l]=c<h?a+c*o:s},S=function(e,t,i,r,n,a){var o,s,l=(1<<t)-1,c=0,u=0,d=0,h=0,p=[],m=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*m;for(var f=Math.ceil((a-r)/n),u=0;u<i;u++)0===d&&(s=e[c++],d=32),t<=d?(h=s>>>d-t&l,d-=t):(h=(s&l)<<(o=t-d)&l,h+=(s=e[c++])>>>(d=32-o)),p[u]=h<f?r+h*n:a;return p.unshift(r),p},T=function(e,t,i,r,n,a,o,s){var l,c,u,d=(1<<i)-1,h=0,p=0,m=0;if(n)for(g=0;g<r;g++)0===p&&(c=e[h++],p=32,m=0),i<=p?(l=c>>>m&d,p-=i,m+=i):(l=c>>>m&d,p=32-(u=i-p),l|=((c=e[h++])&(1<<u)-1)<<i-u,m=u),t[g]=n[l];else for(var f=Math.ceil((s-a)/o),g=0;g<r;g++)0===p&&(c=e[h++],p=32,m=0),i<=p?(l=c>>>m&d,p-=i,m+=i):(l=c>>>m&d,p=32-(u=i-p),l|=((c=e[h++])&(1<<u)-1)<<i-u,m=u),t[g]=l<f?a+l*o:s;return t},x=function(e,t,i,r,n,a){for(var o,s,l=(1<<t)-1,c=0,u=0,d=0,h=0,p=0,m=[],f=Math.ceil((a-r)/n),u=0;u<i;u++)0===d&&(s=e[c++],d=32,p=0),t<=d?(h=s>>>p&l,d-=t,p+=t):(h=s>>>p&l,d=32-(o=t-d),h|=((s=e[c++])&(1<<o)-1)<<t-o,p=o),m[u]=h<f?r+h*n:a;return m.unshift(r),m},b=function(e,t,i,r){var n,a,o,s,l=(1<<i)-1,c=0,u=0,d=4*e.length-Math.ceil(i*r/8);for(e[e.length-1]<<=8*d,n=0;n<r;n++)0===u&&(o=e[c++],u=32),i<=u?(a=o>>>u-i&l,u-=i):(a=(o&l)<<(s=i-u)&l,a+=(o=e[c++])>>>(u=32-s)),t[n]=a;return t},E=function(e,t,i,r){for(var n,a,o,s=(1<<i)-1,l=0,c=0,u=0,d=0;d<r;d++)0===c&&(a=e[l++],c=32,u=0),i<=c?(n=a>>>u&s,c-=i,u+=i):(n=a>>>u&s,c=32-(o=i-c),n|=((a=e[l++])&(1<<o)-1)<<i-o,u=o),t[d]=n;return t},k={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,r=e.length,n=Math.floor(r/2),a=0;n;){var o=359<=n?359:n;for(n-=o;t+=e[a++]<<8,i+=t+=e[a++],--o;);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&r&&(i+=t+=e[a]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,r=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,r),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var a=new DataView(e,i,8),r=a.getInt32(0,!0);if(i+=4,3<=(n.fileVersion=r)&&(n.checksum=a.getUint32(4,!0),i+=4),a=new DataView(e,i,12),n.height=a.getUint32(0,!0),n.width=a.getUint32(4,!0),i+=8,4<=r?(n.numDims=a.getUint32(8,!0),i+=4):n.numDims=1,a=new DataView(e,i,40),n.numValidPixel=a.getUint32(0,!0),n.microBlockSize=a.getInt32(4,!0),n.blobSize=a.getInt32(8,!0),n.imageType=a.getInt32(12,!0),n.maxZError=a.getFloat64(16,!0),n.zMin=a.getFloat64(24,!0),n.zMax=a.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,3<=r&&this.computeChecksumFletcher32(new Uint8Array(e,i-(4<=r?52:48),n.blobSize-14))!==n.checksum)throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,r=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),a=this.readSubArray(e,t.ptr,r,n),o=this.readSubArray(e,t.ptr+n,r,n);t.ptr+=2*n;for(var s=!0,l=0;l<i.numDims;l++)if(a[l]!==o[l]){s=!1;break}return i.minValues=a,i.maxValues=o,s},readSubArray:function(e,t,i,r){var n=i===Uint8Array?new Uint8Array(e,t,r):(n=new ArrayBuffer(r),new Uint8Array(n).set(new Uint8Array(e,t,r)),new i(n));return n},readMask:function(e,t){var i=t.ptr,r=t.headerInfo,n=r.width*r.height,r=r.numValidPixel,a=new DataView(e,i,4),o={};if(o.numBytes=a.getUint32(0,!0),i+=4,(0===r||n===r)&&0!==o.numBytes)throw"invalid mask";if(0===r)l=new Uint8Array(Math.ceil(n/8)),o.bitset=l,h=new Uint8Array(n),t.pixels.resultMask=h,i+=o.numBytes;else if(0<o.numBytes){var s,l=new Uint8Array(Math.ceil(n/8)),c=(a=new DataView(e,i,o.numBytes)).getInt16(0,!0),u=2,d=0;do{if(0<c)for(;c--;)l[d++]=a.getUint8(u++);else for(s=a.getUint8(u++),c=-c;c--;)l[d++]=s}while(c=a.getInt16(u,!0),(u+=2)<o.numBytes);if(-32768!==c||d<l.length)throw"Unexpected end of mask RLE encoding";for(var h=new Uint8Array(n),p=0,m=0,m=0;m<n;m++)7&m?(p=l[m>>3],p<<=7&m):p=l[m>>3],128&p&&(h[m]=1);t.pixels.resultMask=h,o.bitset=l,i+=o.numBytes}return t.ptr=i,t.mask=o,!0},readDataOneSweep:function(e,t,i){var r=t.ptr,n=t.headerInfo,a=n.numDims,o=n.width*n.height,s=n.imageType,n=n.numValidPixel*k.getDataTypeSize(s)*a,l=t.pixels.resultMask,c=i===Uint8Array?new Uint8Array(e,r,n):(s=new ArrayBuffer(n),new Uint8Array(s).set(new Uint8Array(e,r,n)),new i(s));if(c.length===o*a)t.pixels.resultPixels=c;else{t.pixels.resultPixels=new i(o*a);var u,d=0,h=0,p=0;if(1<a)for(p=0;p<a;p++)for(u=p*o,h=0;h<o;h++)l[h]&&(t.pixels.resultPixels[u+h]=c[d++]);else for(h=0;h<o;h++)l[h]&&(t.pixels.resultPixels[h]=c[d++])}return t.ptr=r+=n,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,r=new DataView(e,t.ptr,16);if(t.ptr+=16,r.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=r.getInt32(4,!0),a=r.getInt32(8,!0),o=r.getInt32(12,!0);if(o<=a)return!1;var s=new Uint32Array(o-a);k.decodeBits(e,t,s);for(var l,c,u,d=[],h=a;h<o;h++)d[l=h-(h<n?0:n)]={first:s[h-a],second:null};var p=e.byteLength-t.ptr,r=Math.ceil(p/4),r=new ArrayBuffer(4*r);new Uint8Array(r).set(new Uint8Array(e,t.ptr,p));var m=new Uint32Array(r),f=0,g=0,_=m[0];for(h=a;h<o;h++)0<(u=d[l=h-(h<n?0:n)].first)&&(d[l].second=_<<f>>>32-u,u<=32-f?32===(f+=u)&&(f=0,_=m[++g]):(_=m[++g],d[l].second|=_>>>32-(f+=u-32)));var y=0,C=0,v=new A;for(h=0;h<d.length;h++)void 0!==d[h]&&(y=Math.max(y,d[h].first));C=i<=y?i:y,30<=y&&console.log("WARning, large NUM LUT BITS IS "+y);var S,T,x,b,E,P=[];for(h=a;h<o;h++)if(0<(u=d[l=h-(h<n?0:n)].first))if(S=[u,l],u<=C)for(T=d[l].second<<C-u,x=1<<C-u,c=0;c<x;c++)P[T|c]=S;else for(T=d[l].second,E=v,b=u-1;0<=b;b--)E=T>>>b&1?(E.right||(E.right=new A),E.right):(E.left||(E.left=new A),E.left),0!==b||E.val||(E.val=S[1]);return{decodeLut:P,numBitsLUTQick:C,numBitsLUT:y,tree:v,stuffedData:m,srcPtr:g,bitPos:f}},readHuffman:function(e,t,i){var r,n,a,o,s,l,c,u,d,h=t.headerInfo,p=h.numDims,m=t.headerInfo.height,f=t.headerInfo.width,g=f*m,e=this.readHuffmanTree(e,t),_=e.decodeLut,y=e.tree,C=e.stuffedData,v=e.srcPtr,S=e.bitPos,T=e.numBitsLUTQick,x=e.numBitsLUT,b=0===t.headerInfo.imageType?128:0,E=t.pixels.resultMask,P=0;0<S&&(v++,S=0);for(var A=C[v],w=1===t.encodeMode,D=new i(g*p),M=D,I=0;I<h.numDims;I++){if(1<p&&(M=new i(D.buffer,g*I,g),P=0),t.headerInfo.numValidPixel===f*m)for(l=u=0;l<m;l++)for(c=0;c<f;c++,u++){if(n=0,s=o=A<<S>>>32-T,_[s=32-S<T?o|=C[v+1]>>>64-S-T:s])n=_[s][1],S+=_[s][0];else for(s=o=A<<S>>>32-x,32-S<x&&(s=o|=C[v+1]>>>64-S-x),r=y,d=0;d<x;d++)if(!(r=o>>>x-d-1&1?r.right:r.left).left&&!r.right){n=r.val,S=S+d+1;break}32<=S&&(S-=32,A=C[++v]),a=n-b,w?(a+=!(0<c)&&0<l?M[u-f]:P,a&=255,P=M[u]=a):M[u]=a}else for(l=u=0;l<m;l++)for(c=0;c<f;c++,u++)if(E[u]){if(n=0,s=o=A<<S>>>32-T,_[s=32-S<T?o|=C[v+1]>>>64-S-T:s])n=_[s][1],S+=_[s][0];else for(s=o=A<<S>>>32-x,32-S<x&&(s=o|=C[v+1]>>>64-S-x),r=y,d=0;d<x;d++)if(!(r=o>>>x-d-1&1?r.right:r.left).left&&!r.right){n=r.val,S=S+d+1;break}32<=S&&(S-=32,A=C[++v]),a=n-b,w?(!(0<c&&E[u-1])&&0<l&&E[u-f]?a+=M[u-f]:a+=P,a&=255,P=M[u]=a):M[u]=a}t.ptr=t.ptr+4*(v+1)+(0<S?4:0)}t.pixels.resultPixels=D},decodeBits:function(e,t,i,r,n){var a=t.headerInfo,o=a.fileVersion,s=0,l=5<=e.byteLength-t.ptr?5:e.byteLength-t.ptr,c=new DataView(e,t.ptr,l),u=c.getUint8(0);s++;var d=u>>6,h=0==d?4:3-d,l=0<(32&u),d=31&u,u=0;if(1==h)u=c.getUint8(s),s++;else if(2==h)u=c.getUint16(s,!0),s+=2;else{if(4!=h)throw"Invalid valid pixel count type";u=c.getUint32(s,!0),s+=4}var p,m,f,g,_,y,C,h=2*a.maxZError,a=1<a.numDims?a.maxValues[n]:a.zMax;if(l){for(t.counter.lut++,y=c.getUint8(s),s++,g=Math.ceil((y-1)*d/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),f=new Uint8Array(m),t.ptr+=s,f.set(new Uint8Array(e,t.ptr,g)),c=new Uint32Array(m),t.ptr+=g,C=0;y-1>>>C;)C++;g=Math.ceil(u*C/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),(f=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,g)),p=new Uint32Array(m),t.ptr+=g,c=(3<=o?x:S)(c,d,y-1,r,h,a),(3<=o?T:v)(p,i,C,u,c)}else t.counter.bitstuffer++,C=d,t.ptr+=s,0<C&&(g=Math.ceil(u*C/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),(f=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,g)),p=new Uint32Array(m),t.ptr+=g,3<=o?null===r?E(p,i,C,u):T(p,i,C,u,!1,r,h,a):null===r?b(p,i,C,u):v(p,i,C,u,!1,r,h,a))},readTiles:function(e,t,i){var r=t.headerInfo,n=r.width,a=r.height,o=r.microBlockSize,s=r.imageType,l=k.getDataTypeSize(s),c=Math.ceil(n/o),u=Math.ceil(a/o);t.pixels.numBlocksY=u,t.pixels.numBlocksX=c;for(var d,h,p,m,f,g,_,y,C,v,S,T,x,b,E=t.pixels.ptr=0,P=0,A=0,w=0,D=0,M=0,I=0,R=0,O=new i(o*o),L=a%o||o,F=n%o||o,N=r.numDims,B=t.pixels.resultMask,V=t.pixels.resultPixels,A=0;A<u;A++)for(d=A!==u-1?o:L,w=0;w<c;w++)for(D=A*n*o+w*o,g=n-(h=w!==c-1?o:F),b=0;b<N;b++){if(1<N&&(V=new i(t.pixels.resultPixels.buffer,n*a*b*l,n*a)),p=e.byteLength-t.ptr,C={},R=0,R++,f=(m=(y=new DataView(e,t.ptr,Math.min(10,p))).getUint8(0))>>6&255,(m>>2&15)!=(w*o>>3&15))throw"integrity issue";if(3<(S=3&m))throw t.ptr+=R,"Invalid block encoding ("+S+")";if(2!=S)if(0==S){if(t.counter.uncompressed++,t.ptr+=R,M=(M=d*h*l)<(_=e.byteLength-t.ptr)?M:_,T=new ArrayBuffer(M%l==0?M:M+l-M%l),new Uint8Array(T).set(new Uint8Array(e,t.ptr,M)),v=new i(T),I=0,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=v[I++]),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=v[I++];D+=g}t.ptr+=I*l}else if(T=k.getDataTypeUsed(s,f),x=k.getOnePixel(C,R,T,y),R+=k.getDataTypeSize(T),3==S)if(t.ptr+=R,t.counter.constantoffset++,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=x),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=x;D+=g}else if(t.ptr+=R,k.decodeBits(e,t,O,x,b),R=0,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=O[R++]),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=O[R++];D+=g}else t.counter.constant++,t.ptr+=R}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:k.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t,i=e.headerInfo.zMax,r=e.headerInfo.numDims,n=e.headerInfo.height*e.headerInfo.width,a=n*r,o=0,s=0,l=e.pixels.resultMask;if(l)if(1<r)for(o=0;o<r;o++)for(t=o*n,s=0;s<n;s++)l[s]&&(e.pixels.resultPixels[t+s]=i);else for(s=0;s<n;s++)l[s]&&(e.pixels.resultPixels[s]=i);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(i);else for(s=0;s<a;s++)e.pixels.resultPixels[s]=i},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:t=Float32Array;break;case 7:t=Float64Array;break;default:t=Float32Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:t="F32";break;case 7:t="F64";break;default:t="F32"}return t},isValidPixelValue:function(e,t){if(null===t)return!1;var i;switch(e){case 0:i=-128<=t&&t<=127;break;case 1:i=0<=t&&t<=255;break;case 2:i=-32768<=t&&t<=32767;break;case 3:i=0<=t&&t<=65536;break;case 4:i=-2147483648<=t&&t<=2147483647;break;case 5:i=0<=t&&t<=4294967296;break;case 6:i=-34027999387901484e22<=t&&t<=34027999387901484e22;break;case 7:i=5e-324<=t&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,r){var n=0;switch(i){case 0:n=r.getInt8(t);break;case 1:n=r.getUint8(t);break;case 2:n=r.getInt16(t,!0);break;case 3:n=r.getUint16(t,!0);break;case 4:n=r.getInt32(t,!0);break;case 5:n=r.getUInt32(t,!0);break;case 6:n=r.getFloat32(t,!0);break;case 7:n=r.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},A=function(e,t,i){this.val=e,this.left=t,this.right=i};return{decode:function(e,t){var i=(t=t||{}).noDataValue,r=0,n={};if(n.ptr=t.inputOffset||0,n.pixels={},k.readHeaderInfo(e,n)){var a=n.headerInfo,o=a.fileVersion,s=k.getDataTypeArray(a.imageType);k.readMask(e,n),a.numValidPixel===a.width*a.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var l,c=a.width*a.height;if(n.pixels.resultPixels=new s(c*a.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==a.numValidPixel)if(a.zMax===a.zMin)k.constructConstantSurface(n);else if(4<=o&&k.checkMinMaxRanges(e,n))k.constructConstantSurface(n);else{var u=new DataView(e,n.ptr,2),d=u.getUint8(0);if(n.ptr++,d)k.readDataOneSweep(e,n,s);else if(1<o&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){u=u.getUint8(1);if(n.ptr++,2<(n.encodeMode=u)||o<4&&1<u)throw"Invalid Huffman flag "+u;u?k.readHuffman(e,n,s):k.readTiles(e,n,s)}else k.readTiles(e,n,s)}n.eofOffset=n.ptr,t.inputOffset?(l=n.headerInfo.blobSize+t.inputOffset-n.ptr,1<=Math.abs(l)&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(l=n.headerInfo.blobSize-n.ptr,1<=Math.abs(l)&&(n.eofOffset=n.headerInfo.blobSize));var h={width:a.width,height:a.height,pixelData:n.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&k.isValidPixelValue(a.imageType,i)){for(var p=n.pixels.resultMask,r=0;r<c;r++)p[r]||(h.pixelData[r]=i);h.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(h.fileInfo=k.formatFileInfo(n)),h}},getBandCount:function(e){for(var t=0,i=0,r={ptr:0,pixels:{}};i<e.byteLength-58;)k.readHeaderInfo(e,r),i+=r.headerInfo.blobSize,t++,r.ptr=i;return t}}}(),Nik=new ArrayBuffer(4),Oik=new Uint8Array(Nik),Iak=(new Uint32Array(Nik)[0]=1)===Oik[0],tmp$1.Lerc={decode:function(e,t){if(!Iak)throw"Big endian system is not supported.";var i,r,n=(t=t||{}).inputOffset||0,a=new Uint8Array(e,n,10),a=String.fromCharCode.apply(null,a);if("CntZImage"===a.trim())i=Gak,r=1;else{if("Lerc2"!==a.substring(0,5))throw"Unexpected file identifier string: "+a;i=Hak,r=2}for(var o,s,l,c,u,d,h=0,p=e.byteLength-10,m=[],f={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<p;){var g=i.decode(e,{inputOffset:n,encodedMaskData:o,maskData:l,returnMask:0===h,returnEncodedMask:0===h,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null}),n=g.fileInfo.eofOffset;0===h&&(o=g.encodedMaskData,l=g.maskData,f.width=g.width,f.height=g.height,f.dimCount=g.dimCount||1,f.pixelType=g.pixelType||g.fileInfo.pixelType,f.mask=g.maskData),1<r&&g.fileInfo.mask&&0<g.fileInfo.mask.numBytes&&m.push(g.maskData),h++,f.pixels.push(g.pixelData),f.statistics.push({minValue:g.minValue,maxValue:g.maxValue,noDataValue:g.noDataValue,dimStats:g.dimStats})}if(1<r&&1<m.length){for(d=f.width*f.height,f.bandMasks=m,(l=new Uint8Array(d)).set(m[0]),c=1;c<m.length;c++)for(s=m[c],u=0;u<d;u++)l[u]=l[u]&s[u];f.maskData=l}return f}};var LercDecode=tmp$1.Lerc,tmp={},hjk,ijk;hjk=tmp,ijk=function(){return n={},r.m=i=[function(e,t,i){var r=function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e};function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=i(1),a=i.webm,o=i.mp4,s="undefined"!=typeof navigator&&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,r=(r(l,[{key:"_addSourceToVideo",value:function(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}},{key:"enable",value:function(){s?(this.disable(),console.warn("\n NoSleep enabled for older iOS devices. This can interrupt\n active or long-running network requests from completing successfully.\n See https://github.com/richtr/NoSleep.js/issues/15 for more details.\n "),this.noSleepTimer=window.setInterval(function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){s?this.noSleepTimer&&(console.warn("\n NoSleep now disabled for older iOS devices.\n "),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),l);function l(){var e=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),s?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("muted",""),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",a),this._addSourceToVideo(this.noSleepVideo,"mp4",o),this.noSleepVideo.addEventListener("loadedmetadata",function(){e.noSleepVideo.duration<=1?e.noSleepVideo.setAttribute("loop",""):e.noSleepVideo.addEventListener("timeupdate",function(){.5<e.noSleepVideo.currentTime&&(e.noSleepVideo.currentTime=Math.random())})}))}e.exports=r},function(e,t,i){e.exports={webm:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",mp4:"data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}}],r.c=n,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0);function r(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var i,n},hjk.NoSleep=ijk();var NoSleep=tmp.NoSleep;function quickselect(e,t,i,r,n){quickselectStep(e,t,i||0,r||e.length-1,n||defaultCompare)}function quickselectStep(e,t,i,r,n){for(;i<r;){var a,o,s,l;600<r-i&&(a=r-i+1,o=t-i+1,l=Math.log(a),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(a-s)/a)*(o-a/2<0?-1:1),quickselectStep(e,t,Math.max(i,Math.floor(t-o*s/a+l)),Math.min(r,Math.floor(t+(a-o)*s/a+l)),n));var c=e[t],u=i,d=r;for(swap(e,i,t),0<n(e[r],c)&&swap(e,i,r);u<d;){for(swap(e,u,d),u++,d--;n(e[u],c)<0;)u++;for(;0<n(e[d],c);)d--}0===n(e[i],c)?swap(e,i,d):swap(e,++d,r),d<=t&&(i=d+1),t<=d&&(r=d-1)}}function swap(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function defaultCompare(e,t){return e<t?-1:t<e?1:0}function ClockViewModel(t){defined(t)||(t=new Clock),this._clock=t,this._eventHelper=new EventHelper,this._eventHelper.add(t.onTick,this.synchronize,this),this.systemTime=knockout.observable(JulianDate.now()),this.systemTime.equalityComparer=JulianDate.equals,this.startTime=knockout.observable(t.startTime),this.startTime.equalityComparer=JulianDate.equals,this.startTime.subscribe(function(e){t.startTime=e,this.synchronize()},this),this.stopTime=knockout.observable(t.stopTime),this.stopTime.equalityComparer=JulianDate.equals,this.stopTime.subscribe(function(e){t.stopTime=e,this.synchronize()},this),this.currentTime=knockout.observable(t.currentTime),this.currentTime.equalityComparer=JulianDate.equals,this.currentTime.subscribe(function(e){t.currentTime=e,this.synchronize()},this),this.multiplier=knockout.observable(t.multiplier),this.multiplier.subscribe(function(e){t.multiplier=e,this.synchronize()},this),this.clockStep=knockout.observable(t.clockStep),this.clockStep.subscribe(function(e){t.clockStep=e,this.synchronize()},this),this.clockRange=knockout.observable(t.clockRange),this.clockRange.subscribe(function(e){t.clockRange=e,this.synchronize()},this),this.canAnimate=knockout.observable(t.canAnimate),this.canAnimate.subscribe(function(e){t.canAnimate=e,this.synchronize()},this),this.shouldAnimate=knockout.observable(t.shouldAnimate),this.shouldAnimate.subscribe(function(e){t.shouldAnimate=e,this.synchronize()},this),knockout.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}function Command(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,DeveloperError.throwInstantiationError()}function createCommand(i,e){e=defaultValue(e,!0);var r=new Event,n=new Event;function t(){var e,t={args:arguments,cancel:!1};return r.raiseEvent(t),t.cancel||(e=i.apply(null,arguments),n.raiseEvent(e)),e}return t.canExecute=e,knockout.track(t,["canExecute"]),Object.defineProperties(t,{beforeExecute:{value:r},afterExecute:{value:n}}),t}Object.defineProperties(ClockViewModel.prototype,{clock:{get:function(){return this._clock}}}),ClockViewModel.prototype.synchronize=function(){var e=this._clock;this.systemTime=JulianDate.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},ClockViewModel.prototype.isDestroyed=function(){return!1},ClockViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var InspectorShared={};function subscribeAndEvaluate(e,t,i,r,n){return i.call(r,e[t]),knockout.getObservable(e,t).subscribe(i,r,n)}function ToggleButtonViewModel(e,t){this._command=e,t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.toggled=defaultValue(t.toggled,!1),this.tooltip=defaultValue(t.tooltip,""),knockout.track(this,["toggled","tooltip"])}InspectorShared.createCheckbox=function(e,t,i){var r=document.createElement("div"),n=document.createElement("label"),a=document.createElement("input");a.type="checkbox";t="checked: "+t;return defined(i)&&(t+=", enable: "+i),a.setAttribute("data-bind",t),n.appendChild(a),n.appendChild(document.createTextNode(e)),r.appendChild(n),r},InspectorShared.createSection=function(e,t,i,r){var n=document.createElement("div");n.className="cesium-cesiumInspector-section",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-section-collapsed": !'+i+" }"),e.appendChild(n);e=document.createElement("h3");e.className="cesium-cesiumInspector-sectionHeader",e.appendChild(document.createTextNode(t)),e.setAttribute("data-bind","click: "+r),n.appendChild(e);e=document.createElement("div");return e.className="cesium-cesiumInspector-sectionContent",n.appendChild(e),e},Object.defineProperties(ToggleButtonViewModel.prototype,{command:{get:function(){return this._command}}});var DepthViewPacked="uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nfloat z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\nfloat scale = pow(z_ndc * 0.5 + 0.5, 8.0);\ngl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";function removePipelineExtras(e){return ForEach.shader(e,function(e){removeExtras(e)}),ForEach.buffer(e,function(e){removeExtras(e)}),ForEach.image(e,function(e){removeExtras(e),ForEach.compressedImage(e,function(e){removeExtras(e)})}),removeExtras(e),e}function removeExtras(e){defined(e.extras)&&(defined(e.extras._pipeline)&&delete e.extras._pipeline,0===Object.keys(e.extras).length&&delete e.extras)}var svgNS="http://www.w3.org/2000/svg",xlinkNS="http://www.w3.org/1999/xlink",widgetForDrag,gradientEnabledColor0=Color.fromCssColorString("rgba(247,250,255,0.384)"),gradientEnabledColor1=Color.fromCssColorString("rgba(143,191,255,0.216)"),gradientEnabledColor2=Color.fromCssColorString("rgba(153,197,255,0.098)"),gradientEnabledColor3=Color.fromCssColorString("rgba(255,255,255,0.086)"),gradientDisabledColor0=Color.fromCssColorString("rgba(255,255,255,0.267)"),gradientDisabledColor1=Color.fromCssColorString("rgba(255,255,255,0)"),gradientKnobColor=Color.fromCssColorString("rgba(66,67,68,0.3)"),gradientPointerColor=Color.fromCssColorString("rgba(0,0,0,0.5)");function getElementColor(e){return Color.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var svgIconsById={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 svgFromObject(e){var t,i=document.createElementNS(svgNS,e.tagName);for(t in e)if(e.hasOwnProperty(t)&&"tagName"!==t)if("children"===t)for(var r=e.children.length,n=0;n<r;++n)i.appendChild(svgFromObject(e.children[n]));else 0===t.indexOf("xlink:")?i.setAttributeNS(xlinkNS,t.substring(6),e[t]):"textContent"===t?i.textContent=e[t]:i.setAttribute(t,e[t]);return i}function svgText(e,t,i){var r=document.createElementNS(svgNS,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");t=document.createElementNS(svgNS,"tspan");return t.textContent=i,r.appendChild(t),r}function setShuttleRingPointer(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}var makeColorStringScratch=new Color;function makeColorString(e,t){var i=t.alpha,r=1-i;return makeColorStringScratch.red=e.red*r+t.red*i,makeColorStringScratch.green=e.green*r+t.green*i,makeColorStringScratch.blue=e.blue*r+t.blue*i,makeColorStringScratch.toCssColorString()}function rectButton(e,t,i){var r=svgIconsById[i];return svgFromObject({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:i,tagName:r.tagName,transform:r.transform,d:r.d},{tagName:"title",textContent:""}]})}function wingButton(e,t,i){var r=svgIconsById[i],n=svgIconsById.animation_pathWingButton;return svgFromObject({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:n.tagName,d:n.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:n.tagName,d:n.d},{class:"cesium-animation-buttonPath",id:i,tagName:r.tagName,transform:r.transform,d:r.d},{tagName:"title",textContent:""}]})}function setShuttleRingFromMouseOrTouch(e,t){var i,r,n,a,o,s,l=e._viewModel,c=l.shuttleRingDragging;c&&widgetForDrag!==e||("mousedown"===t.type||c&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||c&&"touchmove"===t.type&&1===t.touches.length?(s=e._centerX,i=e._centerY,o=e._svgNode.getBoundingClientRect(),n="touchstart"===t.type||"touchmove"===t.type?(r=t.touches[0].clientX,t.touches[0].clientY):(r=t.clientX,t.clientY),!c&&(r>o.right||r<o.left||n<o.top||n>o.bottom)||(a=e._shuttleRingPointer.getBoundingClientRect(),s=r-s-o.left,o=n-i-o.top,180<(o=180*Math.atan2(o,s)/Math.PI+90)&&(o-=360),s=l.shuttleRingAngle,c||r<a.right&&r>a.left&&n>a.top&&n<a.bottom?(widgetForDrag=e,l.shuttleRingDragging=!0,l.shuttleRingAngle=o):o<s?l.slower():s<o&&l.faster(),t.preventDefault())):(e===widgetForDrag&&(widgetForDrag=void 0),l.shuttleRingDragging=!1))}function SvgButton(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[subscribeAndEvaluate(t,"toggled",this.setToggled,this),subscribeAndEvaluate(t,"tooltip",this.setTooltip,this),subscribeAndEvaluate(t.command,"canExecute",this.setEnabled,this)]}function Animation(e,t){e=getElement(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;var i=e.ownerDocument,r=document.createElement("style");r.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); }",i.head.insertBefore(r,i.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.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=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var a=document.createElementNS(svgNS,"svg:svg");(this._svgNode=a).setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",xlinkNS);var o=document.createElementNS(svgNS,"g");this._topG=o,this._realtimeSVG=new SvgButton(wingButton(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new SvgButton(rectButton(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new SvgButton(rectButton(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new SvgButton(rectButton(84,99,"animation_pathPause"),t.pauseViewModel);var s=document.createElementNS(svgNS,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);var l=svgFromObject({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;var c=svgIconsById.animation_pathSwooshFX,u=svgIconsById.animation_pathPointer,d=svgFromObject({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:c.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:c.d},{tagName:c.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:c.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=svgFromObject({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});var h=svgFromObject({tagName:"g",transform:"translate(100,100)"});this._knobOuter=svgFromObject({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});r=svgFromObject({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=svgText(0,-24,""),this._knobTime=svgText(0,-7,""),this._knobStatus=svgText(0,-41,"");c=svgFromObject({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),u=document.createElementNS(svgNS,"g");u.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),o.appendChild(u),o.appendChild(h),o.appendChild(s),u.appendChild(l),u.appendChild(d),u.appendChild(this._shuttleRingPointer),h.appendChild(this._knobOuter),h.appendChild(r),h.appendChild(this._knobDate),h.appendChild(this._knobTime),h.appendChild(this._knobStatus),h.appendChild(c),a.appendChild(o),e.appendChild(a);var p=this;function m(e){setShuttleRingFromMouseOrTouch(p,e)}this._mouseCallback=m,l.addEventListener("mousedown",m,!0),l.addEventListener("touchstart",m,!0),d.addEventListener("mousedown",m,!0),d.addEventListener("touchstart",m,!0),i.addEventListener("mousemove",m,!0),i.addEventListener("touchmove",m,!0),i.addEventListener("mouseup",m,!0),i.addEventListener("touchend",m,!0),i.addEventListener("touchcancel",m,!0),this._shuttleRingPointer.addEventListener("mousedown",m,!0),this._shuttleRingPointer.addEventListener("touchstart",m,!0),this._knobOuter.addEventListener("mousedown",m,!0),this._knobOuter.addEventListener("touchstart",m,!0);var f,g=this._knobTime.childNodes[0],_=this._knobDate.childNodes[0],y=this._knobStatus.childNodes[0];this._subscriptions=[subscribeAndEvaluate(t.pauseViewModel,"toggled",function(e){f!==e&&((f=e)?p._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):p._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),subscribeAndEvaluate(t,"shuttleRingAngle",function(e){setShuttleRingPointer(p._shuttleRingPointer,p._knobOuter,e)}),subscribeAndEvaluate(t,"dateLabel",function(e){_.textContent!==e&&(_.textContent=e)}),subscribeAndEvaluate(t,"timeLabel",function(e){g.textContent!==e&&(g.textContent=e)}),subscribeAndEvaluate(t,"multiplierLabel",function(e){y.textContent!==e&&(y.textContent=e)})],this.applyThemeChanges(),this.resize()}SvgButton.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();destroyObject(this)},SvgButton.prototype.isDestroyed=function(){return!1},SvgButton.prototype.setEnabled=function(e){this._enabled!==e&&((this._enabled=e)?this._toggled?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton"):this.svgElement.setAttribute("class","cesium-animation-buttonDisabled"))},SvgButton.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")))},SvgButton.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},Object.defineProperties(Animation.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Animation.prototype.isDestroyed=function(){return!1},Animation.prototype.destroy=function(){defined(this._observer)&&(this._observer.disconnect(),this._observer=void 0);var 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();for(var i=this._subscriptions,r=0,n=i.length;r<n;r++)i[r].dispose();return destroyObject(this)},Animation.prototype.resize=function(){var e,t,i,r,n,a=this._container.clientWidth,o=this._container.clientHeight;a===this._lastWidth&&o===this._lastHeight||(i=o,0===(t=a)&&0===o?(t=200,i=132):0===a?t=(i=o)/132*200:0===o&&(i=(t=a)/200*132),r=t/200,n=i/132,(e=this._svgNode).style.cssText="width: "+t+"px; height: "+i+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",e.setAttribute("width",t),e.setAttribute("height",i),e.setAttribute("viewBox","0 0 "+t+" "+i),this._topG.setAttribute("transform","scale("+r+","+n+")"),this._centerX=Math.max(1,100*r),this._centerY=Math.max(1,100*n),this._lastHeight=a,this._lastWidth=o)},Animation.prototype.applyThemeChanges=function(){var e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(defined(this._observer))return;var t=this;return t._observer=new MutationObserver(function(){e.body.contains(t._container)&&(t._observer.disconnect(),t._observer=void 0,t.applyThemeChanges())}),void t._observer.observe(e,{childList:!0,subtree:!0})}var i=getElementColor(this._themeNormal),r=getElementColor(this._themeHover),n=getElementColor(this._themeSelect),a=getElementColor(this._themeDisabled),o=getElementColor(this._themeKnob),s=getElementColor(this._themePointer),l=getElementColor(this._themeSwoosh),c=getElementColor(this._themeSwooshHover),o=svgFromObject({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(i,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(i,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(i,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(i,gradientEnabledColor3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(r,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(r,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(r,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(r,gradientEnabledColor3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(n,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(n,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(n,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(n,gradientEnabledColor3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(a,gradientDisabledColor0)},{tagName:"stop",offset:"75%","stop-color":makeColorString(a,gradientDisabledColor1)}]},{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":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.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":makeColorString(s,gradientPointerColor)},{tagName:"stop",offset:"100%","stop-color":makeColorString(s,gradientPointerColor)}]},{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":makeColorString(o,gradientEnabledColor0)},{tagName:"stop",offset:"60%","stop-color":makeColorString(o,gradientKnobColor)},{tagName:"stop",offset:"85%","stop-color":makeColorString(o,gradientEnabledColor1)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":makeColorString(o,gradientKnobColor)},{tagName:"stop",offset:"60%","stop-color":makeColorString(o,gradientEnabledColor0)},{tagName:"stop",offset:"85%","stop-color":makeColorString(o,gradientEnabledColor3)}]}]});defined(this._defsElement)?this._svgNode.replaceChild(o,this._defsElement):this._svgNode.appendChild(o),this._defsElement=o};var monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],realtimeShuttleRingAngle=15,maxShuttleRingAngle=105;function numberComparator(e,t){return e-t}function getTypicalMultiplierIndex(e,t){e=binarySearch(t,e,numberComparator);return e<0?~e:e}function angleToMultiplier(e,t){if(Math.abs(e)<=realtimeShuttleRingAngle)return e/realtimeShuttleRingAngle;var i,r=realtimeShuttleRingAngle,n=maxShuttleRingAngle;return 0<e?(i=+Math.log(t[t.length-1])/(n-r),Math.exp(0+i*(e-r))):(i=+Math.log(-t[0])/(n-r),-Math.exp(0+i*(Math.abs(e)-r)))}function multiplierToAngle(e,t,i){if(i.clockStep===ClockStep$1.SYSTEM_CLOCK)return realtimeShuttleRingAngle;if(Math.abs(e)<=1)return e*realtimeShuttleRingAngle;var r=t[t.length-1];r<e?e=r:e<-r&&(e=-r);var n,a=realtimeShuttleRingAngle,i=maxShuttleRingAngle;return 0<e?(n=+Math.log(r)/(i-a),+Math.log(e)/n+a):(n=+Math.log(-t[0])/(i-a),-(+Math.log(Math.abs(e))/n+a))}function AnimationViewModel(e){var o=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=AnimationViewModel.defaultDateFormatter,this._timeFormatter=AnimationViewModel.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,knockout.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(AnimationViewModel.defaultTicks),this.timeLabel=void 0,knockout.defineProperty(this,"timeLabel",function(){return o._timeFormatter(o._clockViewModel.currentTime,o)}),this.dateLabel=void 0,knockout.defineProperty(this,"dateLabel",function(){return o._dateFormatter(o._clockViewModel.currentTime,o)}),this.multiplierLabel=void 0,knockout.defineProperty(this,"multiplierLabel",function(){var e=o._clockViewModel;if(e.clockStep===ClockStep$1.SYSTEM_CLOCK)return"Today";e=e.multiplier;return e%1==0?e.toFixed(0)+"x":e.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,knockout.defineProperty(this,"shuttleRingAngle",{get:function(){return multiplierToAngle(e.multiplier,o._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,maxShuttleRingAngle),-maxShuttleRingAngle);var t,i,r,n=o._allShuttleRingTicks,a=o._clockViewModel;a.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)!==maxShuttleRingAngle?(r=angleToMultiplier(e,n),o.snapToTicks?r=n[getTypicalMultiplierIndex(r,n)]:0!==r&&(100<(t=Math.abs(r))?(i=t.toFixed(0).length-2,i=Math.pow(10,i),r=Math.round(r/i)*i|0):realtimeShuttleRingAngle<t?r=Math.round(r):1<t?r=+r.toFixed(1):0<t&&(r=+r.toFixed(2))),a.multiplier=r):a.multiplier=0<e?n[n.length-1]:n[0]}}),this._canAnimate=void 0,knockout.defineProperty(this,"_canAnimate",function(){var e=o._clockViewModel,t=e.clockRange;if(o.shuttleRingDragging||t===ClockRange$1.UNBOUNDED)return!0;var i=e.multiplier,r=e.currentTime,n=e.startTime,a=!1;return(a=t===ClockRange$1.LOOP_STOP?JulianDate.greaterThan(r,n)||r.equals(n)&&0<i:(t=e.stopTime,JulianDate.greaterThan(r,n)&&JulianDate.lessThan(r,t)||r.equals(n)&&0<i||r.equals(t)&&i<0))||(e.shouldAnimate=!1),a}),this._isSystemTimeAvailable=void 0,knockout.defineProperty(this,"_isSystemTimeAvailable",function(){var e=o._clockViewModel;if(e.clockRange===ClockRange$1.UNBOUNDED)return!0;var t=e.systemTime;return JulianDate.greaterThanOrEquals(t,e.startTime)&&JulianDate.lessThanOrEquals(t,e.stopTime)}),this._isAnimating=void 0,knockout.defineProperty(this,"_isAnimating",function(){return o._clockViewModel.shouldAnimate&&(o._canAnimate||o.shuttleRingDragging)});var t=createCommand(function(){var e=o._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:o._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return!o._isAnimating}),tooltip:"Pause"});t=createCommand(function(){var e=o._clockViewModel,t=e.multiplier;0<t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return o._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});t=createCommand(function(){var e=o._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return o._isAnimating&&0<e.multiplier&&e.clockStep!==ClockStep$1.SYSTEM_CLOCK}),tooltip:"Play Forward"});t=createCommand(function(){o._clockViewModel.clockStep=ClockStep$1.SYSTEM_CLOCK},knockout.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return e.clockStep===ClockStep$1.SYSTEM_CLOCK}),tooltip:knockout.computed(function(){return o._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=createCommand(function(){var e=o._clockViewModel,t=o._allShuttleRingTicks,i=getTypicalMultiplierIndex(e.multiplier,t)-1;0<=i&&(e.multiplier=t[i])}),this._faster=createCommand(function(){var e=o._clockViewModel,t=o._allShuttleRingTicks,i=getTypicalMultiplierIndex(e.multiplier,t)+1;i<t.length&&(e.multiplier=t[i])})}function BaseLayerPickerViewModel(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).globe,i=defaultValue(e.imageryProviderViewModels,[]),r=defaultValue(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=i.slice(0),this.terrainProviderViewModels=r.slice(0),this.dropDownVisible=!1,knockout.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);var l=knockout.getObservable(this,"imageryProviderViewModels"),t=knockout.pureComputed(function(){for(var e=l(),t={},i=0;i<e.length;i++){var r=e[i],n=r.category;defined(t[n])?t[n].push(r):t[n]=[r]}var a=Object.keys(t),o=[];for(i=0;i<a.length;i++){var s=a[i];o.push({name:s,providers:t[s]})}return o});this._imageryProviders=t;var c=knockout.getObservable(this,"terrainProviderViewModels"),t=knockout.pureComputed(function(){for(var e=c(),t={},i=0;i<e.length;i++){var r=e[i],n=r.category;defined(t[n])?t[n].push(r):t[n]=[r]}var a=Object.keys(t),o=[];for(i=0;i<a.length;i++){var s=a[i];o.push({name:s,providers:t[s]})}return o});this._terrainProviders=t,this.buttonTooltip=void 0,knockout.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,t=this.selectedTerrain,e=defined(e)?e.name:void 0,t=defined(t)?t.name:void 0;return defined(e)&&defined(t)?e+"\n"+t:defined(e)?e:t}),this.buttonImageUrl=void 0,knockout.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;if(defined(e))return e.iconUrl}),this.selectedImagery=void 0;var d=knockout.observable();this._currentImageryProviders=[],knockout.defineProperty(this,"selectedImagery",{get:function(){return d()},set:function(e){if(d()!==e){var t=this._currentImageryProviders,i=t.length,r=this._globe.imageryLayers,n=!1;for(u=0;u<i;u++)for(var a=r.length,o=0;o<a;o++){var s=r.get(o);if(s.imageryProvider===t[u]){r.remove(s),n=!0;break}}if(defined(e)){var l,c=e.creationCommand();if(Array.isArray(c)){for(var u=c.length-1;0<=u;u--)r.addImageryProvider(c[u],0);this._currentImageryProviders=c.slice(0)}else this._currentImageryProviders=[c],n||defined(l=r.get(0))&&r.remove(l),r.addImageryProvider(c,0)}d(e),this.dropDownVisible=!1}else this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var n=knockout.observable();knockout.defineProperty(this,"selectedTerrain",{get:function(){return n()},set:function(e){var t;n()!==e&&(defined(e)&&(t=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(t instanceof EllipsoidTerrainProvider),this._globe.terrainProvider=t,n(e)),this.dropDownVisible=!1}});var a=this;this._toggleDropDown=createCommand(function(){a.dropDownVisible=!a.dropDownVisible}),this.selectedImagery=defaultValue(e.selectedImageryProviderViewModel,i[0]),this.selectedTerrain=defaultValue(e.selectedTerrainProviderViewModel,r[0])}function BaseLayerPicker(e,t){e=getElement(e);var i=new BaseLayerPickerViewModel(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var n=document.createElement("img");n.setAttribute("draggable","false"),n.className="cesium-baseLayerPicker-selected",n.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),r.appendChild(n);var a=document.createElement("div");a.className="cesium-baseLayerPicker-dropDown",a.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(a);t=document.createElement("div");t.className="cesium-baseLayerPicker-sectionTitle",t.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),t.innerHTML="Imagery",a.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-section",n.setAttribute("data-bind","foreach: _imageryProviders"),a.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-category",n.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-categoryTitle",n.setAttribute("data-bind","text: name"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-choices",n.setAttribute("data-bind","foreach: providers"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-item",t.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),n.appendChild(t);n=document.createElement("img");n.className="cesium-baseLayerPicker-itemIcon",n.setAttribute("data-bind","attr: { src: iconUrl }"),n.setAttribute("draggable","false"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-itemLabel",n.setAttribute("data-bind","text: name"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-sectionTitle",t.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),t.innerHTML="Terrain",a.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-section",n.setAttribute("data-bind","foreach: _terrainProviders"),a.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-category",n.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-categoryTitle",n.setAttribute("data-bind","text: name"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-choices",n.setAttribute("data-bind","foreach: providers"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-item",t.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),n.appendChild(t);n=document.createElement("img");n.className="cesium-baseLayerPicker-itemIcon",n.setAttribute("data-bind","attr: { src: iconUrl }"),n.setAttribute("draggable","false"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-itemLabel",n.setAttribute("data-bind","text: name"),t.appendChild(n),knockout.applyBindings(i,r),knockout.applyBindings(i,a),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=a,this._closeDropDown=function(e){r.contains(e.target)||a.contains(e.target)||(i.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function ProviderViewModel(e){var t=e.creationFunction;defined(t.canExecute)||(t=createCommand(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=defaultValue(e.category,""),knockout.track(this,["name","tooltip","iconUrl"])}function createDefaultImageryProviderViewModels(){var e=[];return e.push(new ProviderViewModel({name:"Bing Maps Aerial",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.AERIAL})}})),e.push(new ProviderViewModel({name:"Bing Maps Aerial with Labels",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.AERIAL_WITH_LABELS})}})),e.push(new ProviderViewModel({name:"Bing Maps Roads",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.ROAD})}})),e.push(new ProviderViewModel({name:"ESRI World Imagery",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"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 NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"ESRI World Street Map",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"ESRI National Geographic",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"Open­Street­Map",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new ProviderViewModel({name:"Stamen Watercolor",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new ProviderViewModel({name:"Stamen Toner",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new ProviderViewModel({name:"Sentinel-2",iconUrl:buildModuleUrl("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 new IonImageryProvider({assetId:3954})}})),e.push(new ProviderViewModel({name:"Blue Marble",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return new IonImageryProvider({assetId:3845})}})),e.push(new ProviderViewModel({name:"Earth at night",iconUrl:buildModuleUrl("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 new IonImageryProvider({assetId:3812})}})),e.push(new ProviderViewModel({name:"Natural Earth II",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",category:"Cesium ion",creationFunction:function(){return new TileMapServiceImageryProvider({url:buildModuleUrl("Assets/Textures/NaturalEarthII")})}})),e}function createDefaultTerrainProviderViewModels(){var e=[];return e.push(new ProviderViewModel({name:"WGS84 Ellipsoid",iconUrl:buildModuleUrl("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new EllipsoidTerrainProvider}})),e.push(new ProviderViewModel({name:"Cesium World Terrain",iconUrl:buildModuleUrl("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 createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}})),e}function getPickTileset(t){return function(e){e=t._scene.pick(e.position);defined(e)&&e.primitive instanceof Cesium3DTileset&&(t.tileset=e.primitive),t.pickActive=!1}}function selectTilesetOnHover(t,e){e?t._eventHandler.setInputAction(function(e){e=t._scene.pick(e.endPosition);defined(e)&&e.primitive instanceof Cesium3DTileset&&(t.tileset=e.primitive)},ScreenSpaceEventType$1.MOUSE_MOVE):(t._eventHandler.removeInputAction(ScreenSpaceEventType$1.MOUSE_MOVE),t.picking=t.picking)}AnimationViewModel.defaultDateFormatter=function(e,t){e=JulianDate.toGregorianDate(e);return monthNames[e.month-1]+" "+e.day+" "+e.year},AnimationViewModel.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],AnimationViewModel.defaultTimeFormatter=function(e,t){var i=JulianDate.toGregorianDate(e),e=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?sprintf("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,e):sprintf("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},AnimationViewModel.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},AnimationViewModel.prototype.setShuttleRingTicks=function(e){var t,i={},r=this._sortedFilteredPositiveTicks;for(o=r.length=0,n=e.length;o<n;++o)t=e[o],i.hasOwnProperty(t)||(i[t]=!0,r.push(t));r.sort(numberComparator);for(var n,a=[],o=(n=r.length)-1;0<=o;--o)0!==(t=r[o])&&a.push(-t);Array.prototype.push.apply(a,r),this._allShuttleRingTicks=a},Object.defineProperties(AnimationViewModel.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}}}),AnimationViewModel._maxShuttleRingAngle=maxShuttleRingAngle,AnimationViewModel._realtimeShuttleRingAngle=realtimeShuttleRingAngle,Object.defineProperties(BaseLayerPickerViewModel.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),Object.defineProperties(BaseLayerPicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),BaseLayerPicker.prototype.isDestroyed=function(){return!1},BaseLayerPicker.prototype.destroy=function(){return FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._element),knockout.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),destroyObject(this)},Object.defineProperties(ProviderViewModel.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var stringOptions={maximumFractionDigits:3};function formatMemoryString(e){e/=1048576;return e<1?e.toLocaleString(void 0,stringOptions):Math.round(e).toLocaleString()}function getStatistics(e,t){if(!defined(e))return"";var i=t?e._statisticsPerPass[Cesium3DTilePass$1.PICK]:e._statisticsPerPass[Cesium3DTilePass$1.RENDER],e='<ul class="cesium-cesiumInspector-statistics">';return e+="<li><strong>Visited: </strong>"+i.visited.toLocaleString()+"</li><li><strong>Selected: </strong>"+i.selected.toLocaleString()+"</li><li><strong>Commands: </strong>"+i.numberOfCommands.toLocaleString()+"</li>",e+="</ul>",t||(e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Requests: </strong>"+i.numberOfPendingRequests.toLocaleString()+"</li><li><strong>Attempted: </strong>"+i.numberOfAttemptedRequests.toLocaleString()+"</li><li><strong>Processing: </strong>"+i.numberOfTilesProcessing.toLocaleString()+"</li><li><strong>Content Ready: </strong>"+i.numberOfTilesWithContentReady.toLocaleString()+"</li><li><strong>Total: </strong>"+i.numberOfTilesTotal.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Features Selected: </strong>"+i.numberOfFeaturesSelected.toLocaleString()+"</li><li><strong>Features Loaded: </strong>"+i.numberOfFeaturesLoaded.toLocaleString()+"</li><li><strong>Points Selected: </strong>"+i.numberOfPointsSelected.toLocaleString()+"</li><li><strong>Points Loaded: </strong>"+i.numberOfPointsLoaded.toLocaleString()+"</li><li><strong>Triangles Selected: </strong>"+i.numberOfTrianglesSelected.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Tiles styled: </strong>"+i.numberOfTilesStyled.toLocaleString()+"</li><li><strong>Features styled: </strong>"+i.numberOfFeaturesStyled.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Children Union Culled: </strong>"+i.numberOfTilesCulledWithChildrenUnion.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Geometry Memory (MB): </strong>"+formatMemoryString(i.geometryByteLength)+"</li><li><strong>Texture Memory (MB): </strong>"+formatMemoryString(i.texturesByteLength)+"</li><li><strong>Batch Table Memory (MB): </strong>"+formatMemoryString(i.batchTableByteLength)+"</li>",e+="</ul>"),e}var colorBlendModes=[{text:"Highlight",value:Cesium3DTileColorBlendMode$1.HIGHLIGHT},{text:"Replace",value:Cesium3DTileColorBlendMode$1.REPLACE},{text:"Mix",value:Cesium3DTileColorBlendMode$1.MIX}],highlightColor=new Color(1,1,0,.4),scratchColor=new Color,oldColor=new Color;function Cesium3DTilesInspectorViewModel(r,e){var n=this,t=r.canvas;this._eventHandler=new ScreenSpaceEventHandler(t),this._scene=r,this._performanceContainer=e,this._canvas=t,this._performanceDisplay=new PerformanceDisplay({container:e}),this._statisticsText="",this._pickStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,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._tileset=void 0,this._feature=void 0,this._tile=void 0,knockout.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_editorError","showPickStatistics","showStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=knockout.observable({}),this.properties=[],knockout.defineProperty(this,"properties",function(){var e,t=[],i=n._properties();for(e in i)i.hasOwnProperty(e)&&t.push(e);return t});var i=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return i()},set:function(e){i(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;var a=knockout.observable();knockout.defineProperty(this,"colorBlendMode",{get:function(){return a()},set:function(e){a(e),defined(n._tileset)&&(n._tileset.colorBlendMode=e,n._scene.requestRender())}}),this.colorBlendMode=Cesium3DTileColorBlendMode$1.HIGHLIGHT;var o=knockout.observable(),s=knockout.observable();knockout.defineProperty(this,"picking",{get:function(){return s()},set:function(e){s(e),e?n._eventHandler.setInputAction(function(e){var t,i=r.pick(e.endPosition);i instanceof Cesium3DTileFeature?(n.feature=i,n.tile=i.content.tile):defined(i)&&defined(i.content)?(n.feature=void 0,n.tile=i.content.tile):(n.feature=void 0,n.tile=void 0),defined(n._tileset)&&(o&&defined(i)&&defined(i.content)?(r.pickPositionSupported&&defined(t=r.pickPosition(e.endPosition))&&(n._tileset.debugPickPosition=t),n._tileset.debugPickedTile=i.content.tile):n._tileset.debugPickedTile=void 0,n._scene.requestRender())},ScreenSpaceEventType$1.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(ScreenSpaceEventType$1.MOUSE_MOVE))}}),this.picking=!0;var l=knockout.observable();knockout.defineProperty(this,"colorize",{get:function(){return l()},set:function(e){l(e),defined(n._tileset)&&(n._tileset.debugColorizeTiles=e,n._scene.requestRender())}}),this.colorize=!1;var c=knockout.observable();knockout.defineProperty(this,"wireframe",{get:function(){return c()},set:function(e){c(e),defined(n._tileset)&&(n._tileset.debugWireframe=e,n._scene.requestRender())}}),this.wireframe=!1;var u=knockout.observable();knockout.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(e){u(e),defined(n._tileset)&&(n._tileset.debugShowBoundingVolume=e,n._scene.requestRender())}}),this.showBoundingVolumes=!1;var d=knockout.observable();knockout.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(e){d(e),defined(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=e,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;var h=knockout.observable();knockout.defineProperty(this,"showRequestVolumes",{get:function(){return h()},set:function(e){h(e),defined(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=e,n._scene.requestRender())}}),this.showRequestVolumes=!1;var p=knockout.observable();knockout.defineProperty(this,"freezeFrame",{get:function(){return p()},set:function(e){p(e),defined(n._tileset)&&(n._tileset.debugFreezeFrame=e,n._scene.debugShowFrustumPlanes=e,n._scene.requestRender())}}),this.freezeFrame=!1,knockout.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return o()},set:function(e){o(e),defined(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=e,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;var m=knockout.observable();knockout.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(e){m(e),defined(n._tileset)&&(n._tileset.debugShowGeometricError=e,n._scene.requestRender())}}),this.showGeometricError=!1;var f=knockout.observable();knockout.defineProperty(this,"showRenderingStatistics",{get:function(){return f()},set:function(e){f(e),defined(n._tileset)&&(n._tileset.debugShowRenderingStatistics=e,n._scene.requestRender())}}),this.showRenderingStatistics=!1;var g=knockout.observable();knockout.defineProperty(this,"showMemoryUsage",{get:function(){return g()},set:function(e){g(e),defined(n._tileset)&&(n._tileset.debugShowMemoryUsage=e,n._scene.requestRender())}}),this.showMemoryUsage=!1;var _=knockout.observable();knockout.defineProperty(this,"showUrl",{get:function(){return _()},set:function(e){_(e),defined(n._tileset)&&(n._tileset.debugShowUrl=e,n._scene.requestRender())}}),this.showUrl=!1;var y=knockout.observable();knockout.defineProperty(this,"maximumScreenSpaceError",{get:function(){return y()},set:function(e){e=Number(e),isNaN(e)||(y(e),defined(n._tileset)&&(n._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;var C=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return C()},set:function(e){e=Number(e),isNaN(e)||(C(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,knockout.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(C(),1/6)},set:function(e){C(Math.pow(e,6))}});var v=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return v()},set:function(e){e=Number(e),isNaN(e)||(v(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;var S=getPickTileset(this),T=knockout.observable();knockout.defineProperty(this,"pickActive",{get:function(){return T()},set:function(e){T(e),e?n._eventHandler.setInputAction(S,ScreenSpaceEventType$1.LEFT_CLICK):n._eventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}});var x=knockout.observable();knockout.defineProperty(this,"pointCloudShading",{get:function(){return x()},set:function(e){x(e),defined(n._tileset)&&(n._tileset.pointCloudShading.attenuation=e)}}),this.pointCloudShading=!1;var b=knockout.observable();knockout.defineProperty(this,"geometricErrorScale",{get:function(){return b()},set:function(e){e=Number(e),isNaN(e)||(b(e),defined(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=e))}}),this.geometricErrorScale=1;var E=knockout.observable();knockout.defineProperty(this,"maximumAttenuation",{get:function(){return E()},set:function(e){e=Number(e),isNaN(e)||(E(e),defined(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=0===e?void 0:e))}}),this.maximumAttenuation=0;var P=knockout.observable();knockout.defineProperty(this,"baseResolution",{get:function(){return P()},set:function(e){e=Number(e),isNaN(e)||(P(e),defined(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=0===e?void 0:e))}}),this.baseResolution=0;var A=knockout.observable();knockout.defineProperty(this,"eyeDomeLighting",{get:function(){return A()},set:function(e){A(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=e)}}),this.eyeDomeLighting=!1;var w=knockout.observable();knockout.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return w()},set:function(e){e=Number(e),isNaN(e)||(w(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=e))}}),this.eyeDomeLightingStrength=1;var D=knockout.observable();knockout.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return D()},set:function(e){e=Number(e),isNaN(e)||(D(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=e))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;var M=knockout.observable();knockout.defineProperty(this,"skipLevelOfDetail",{get:function(){return M()},set:function(e){M(e),defined(n._tileset)&&(n._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;var I=knockout.observable();knockout.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return I()},set:function(e){e=Number(e),isNaN(e)||(I(e),defined(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;var R=knockout.observable();knockout.defineProperty(this,"baseScreenSpaceError",{get:function(){return R()},set:function(e){e=Number(e),isNaN(e)||(R(e),defined(n._tileset)&&(n._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;var O=knockout.observable();knockout.defineProperty(this,"skipLevels",{get:function(){return O()},set:function(e){e=Number(e),isNaN(e)||(O(e),defined(n._tileset)&&(n._tileset.skipLevels=e))}}),this.skipLevels=1;var L=knockout.observable();knockout.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return L()},set:function(e){L(e),defined(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;var F=knockout.observable();knockout.defineProperty(this,"loadSiblings",{get:function(){return F()},set:function(e){F(e),defined(n._tileset)&&(n._tileset.loadSiblings=e)}}),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=r.postRender.addEventListener(function(){n._update()}),defined(this._tileset)||selectTilesetOnHover(this,!0)}function hasFeatures(e){if(0<e.featuresLength)return 1;var t=e.innerContents;if(defined(t)){for(var i=t.length,r=0;r<i;++r)if(!hasFeatures(t[r]))return;return 1}}function Cesium3DTilesInspector(e,t){e=getElement(e);var i=document.createElement("div"),r=document.createElement("div");r.setAttribute("data-bind","visible: performance");var n=new Cesium3DTilesInspectorViewModel(t,r);this._viewModel=n,this._container=e,this._element=i;var a=document.createElement("div");a.textContent="3D Tiles Inspector",a.className="cesium-cesiumInspector-button",a.setAttribute("data-bind","click: toggleInspector"),i.appendChild(a),i.className="cesium-cesiumInspector cesium-3DTilesInspector",i.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(i);var o=document.createElement("div");(this._panel=o).className="cesium-cesiumInspector-dropDown",i.appendChild(o);var s=InspectorShared.createSection,l=InspectorShared.createCheckbox,c=s(o,"Tileset","tilesetVisible","toggleTileset"),u=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Update","updateVisible","toggleUpdate"),h=s(o,"Logging","loggingVisible","toggleLogging"),p=s(o,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),t=s(o,"Style","styleVisible","toggleStyle"),a=s(o,"Optimization","optimizationVisible","toggleOptimization"),e=document.createElement("div");e.className="field-group";s=document.createElement("label");s.className="field-label",s.appendChild(document.createTextNode("Properties: "));o=document.createElement("div");o.setAttribute("data-bind","text: properties"),e.appendChild(s),e.appendChild(o),c.appendChild(e),c.appendChild(makeButton("togglePickTileset","Pick Tileset","pickActive")),c.appendChild(makeButton("trimTilesCache","Trim Tiles Cache")),c.appendChild(l("Enable Picking","picking")),u.appendChild(l("Colorize","colorize")),u.appendChild(l("Wireframe","wireframe")),u.appendChild(l("Bounding Volumes","showBoundingVolumes")),u.appendChild(l("Content Volumes","showContentBoundingVolumes")),u.appendChild(l("Request Volumes","showRequestVolumes")),u.appendChild(l("Point Cloud Shading","pointCloudShading"));c=document.createElement("div");c.setAttribute("data-bind","visible: pointCloudShading"),c.appendChild(makeRangeInput("geometricErrorScale",0,2,.01,"Geometric Error Scale")),c.appendChild(makeRangeInput("maximumAttenuation",0,32,1,"Maximum Attenuation")),c.appendChild(makeRangeInput("baseResolution",0,1,.01,"Base Resolution")),c.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),u.appendChild(c);u=document.createElement("div");u.setAttribute("data-bind","visible: eyeDomeLighting"),u.appendChild(makeRangeInput("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),u.appendChild(makeRangeInput("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),c.appendChild(u),d.appendChild(l("Freeze Frame","freezeFrame")),d.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));u=document.createElement("div");u.appendChild(makeRangeInput("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),d.appendChild(u);u=document.createElement("div");u.setAttribute("data-bind","visible: dynamicScreenSpaceError"),u.appendChild(makeRangeInput("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),u.appendChild(makeRangeInput("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),d.appendChild(u),h.appendChild(l("Performance","performance")),h.appendChild(r),h.appendChild(l("Statistics","showStatistics"));r=document.createElement("div");r.className="cesium-3dTilesInspector-statistics",r.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(r),h.appendChild(l("Pick Statistics","showPickStatistics"));r=document.createElement("div");r.className="cesium-3dTilesInspector-statistics",r.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(r);r=document.createElement("div");t.appendChild(r),r.appendChild(document.createTextNode("Color Blend Mode: "));t=document.createElement("select");t.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),r.appendChild(t);t=document.createElement("textarea");t.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),r.className="cesium-cesiumInspector-styleEditor",r.appendChild(t);t=makeButton("compileStyle","Compile (Ctrl+Enter)");r.appendChild(t);t=document.createElement("div");t.className="cesium-cesiumInspector-error",t.setAttribute("data-bind","text: editorError"),r.appendChild(t),p.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),p.appendChild(l("Geometric Error","showGeometricError")),p.appendChild(l("Rendering Statistics","showRenderingStatistics")),p.appendChild(l("Memory Usage (MB)","showMemoryUsage")),p.appendChild(l("Url","showUrl")),a.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));p=document.createElement("div");p.appendChild(makeRangeInput("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),a.appendChild(p);p=document.createElement("div");p.appendChild(makeRangeInput("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),a.appendChild(p);p=document.createElement("div");p.appendChild(makeRangeInput("skipLevels",0,10,1,"Min. levels to skip")),a.appendChild(p),a.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),a.appendChild(l("Load siblings of visible tiles","loadSiblings")),knockout.applyBindings(n,i)}function makeRangeInput(e,t,i,r,n,a){a=defaultValue(a,e);var o=document.createElement("input");o.setAttribute("data-bind","value: "+a),o.type="number";a=document.createElement("input");a.type="range",a.min=t,a.max=i,a.step=r,a.setAttribute("data-bind",'valueUpdate: "input", value: '+e);e=document.createElement("div");e.appendChild(a);a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(n)),a.appendChild(o),a.appendChild(e),a}function makeButton(e,t,i){var r=document.createElement("button");r.type="button",r.textContent=t,r.className="cesium-cesiumInspector-pickButton";e="click: "+e;return defined(i)&&(e+=', css: {"cesium-cesiumInspector-pickButtonHighlight" : '+i+"}"),r.setAttribute("data-bind",e),r}function frustumStatisticsToString(e){if(defined(e)){var t,i="Command Statistics",r=e.commandsInFrustums;for(t in r)if(r.hasOwnProperty(t)){var n,a=parseInt(t,10);if(7===a)n="1, 2 and 3";else{for(var o=[],s=2;0<=s;s--){var l=Math.pow(2,s);l<=a&&(o.push(s+1),a-=l)}n=o.reverse().join(" and ")}i+="<br>    "+r[t]+" in frustum "+n}i+="<br>Total: "+e.totalCommands}return i}function boundDepthFrustum(e,t,i){t=Math.min(i,t);return t=Math.max(t,e)}Object.defineProperties(Cesium3DTilesInspectorViewModel.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}},colorBlendModes:{get:function(){return colorBlendModes}},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,defined(e)){var t=this;e.readyPromise.then(function(e){t.isDestroyed()||t._properties(e.properties)});for(var i=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],r=i.length,n=0;n<r;++n){var a=i[n];this[a]=this[a]}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;var o=e.pointCloudShading;this.pointCloudShading=o.attenuation,this.geometricErrorScale=o.geometricErrorScale,this.maximumAttenuation=o.maximumAttenuation||0,this.baseResolution=o.baseResolution||0,this.eyeDomeLighting=o.eyeDomeLighting,this.eyeDomeLightingStrength=o.eyeDomeLightingStrength,this.eyeDomeLightingRadius=o.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=getStatistics(e,!1),this._pickStatisticsText=getStatistics(e,!0),selectTilesetOnHover(this,!1)}},feature:{get:function(){return this._feature},set:function(e){var t;this._feature!==e&&(defined(t=this._feature)&&!t.content.isDestroyed()&&(!this.colorize&&defined(this._style)?t.color=defined(this._style.color)?this._style.color.evaluateColor(t,scratchColor):Color.WHITE:t.color=oldColor,this._scene.requestRender()),defined(e)&&(Color.clone(e.color,oldColor),e.color=highlightColor,this._scene.requestRender()),this._feature=e)}},tile:{get:function(){return this._tile},set:function(e){var t;this._tile!==e&&(!defined(t=this._tile)||t.isDestroyed()||hasFeatures(t.content)||(t.color=oldColor,this._scene.requestRender()),defined(e)&&!hasFeatures(e.content)&&(Color.clone(e.color,oldColor),e.color=highlightColor,this._scene.requestRender()),this._tile=e)}}}),Cesium3DTilesInspectorViewModel.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},Cesium3DTilesInspectorViewModel.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},Cesium3DTilesInspectorViewModel.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},Cesium3DTilesInspectorViewModel.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},Cesium3DTilesInspectorViewModel.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},Cesium3DTilesInspectorViewModel.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},Cesium3DTilesInspectorViewModel.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},Cesium3DTilesInspectorViewModel.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},Cesium3DTilesInspectorViewModel.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},Cesium3DTilesInspectorViewModel.prototype.trimTilesCache=function(){defined(this._tileset)&&this._tileset.trimLoadedTiles()},Cesium3DTilesInspectorViewModel.prototype.compileStyle=function(){var e=this._tileset;if(defined(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new Cesium3DTileStyle(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},Cesium3DTilesInspectorViewModel.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();var i,r=t.target,n=r.selectionStart,a=r.selectionEnd,o=a,s=r.value.slice(n,a).split("\n"),l=s.length;if(t.shiftKey)for(i=0;i<l;++i)" "===s[i][0]&&(" "===s[i][1]?(s[i]=s[i].substr(2),o-=2):(s[i]=s[i].substr(1),--o));else for(i=0;i<l;++i)s[i]=" "+s[i],o+=2;var c=s.join("\n");r.value=r.value.slice(0,n)+c+r.value.slice(a),r.selectionStart=n!==a?n:o,r.selectionEnd=o}else!t.ctrlKey||10!==t.keyCode&&13!==t.keyCode||this.compileStyle();return!0},Cesium3DTilesInspectorViewModel.prototype._update=function(){var e=this._tileset;if(this.performance&&this._performanceDisplay.update(),defined(e)){if(e.isDestroyed())return this.tile=void 0,this.feature=void 0,void(this.tileset=void 0);var 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=getStatistics(e,!1),this._pickStatisticsText=getStatistics(e,!0))},Cesium3DTilesInspectorViewModel.prototype.isDestroyed=function(){return!1},Cesium3DTilesInspectorViewModel.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();var t=this;return this._definedProperties.forEach(function(e){knockout.getObservable(t,e).dispose()}),destroyObject(this)},Cesium3DTilesInspectorViewModel.getStatistics=getStatistics,Object.defineProperties(Cesium3DTilesInspector.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Cesium3DTilesInspector.prototype.isDestroyed=function(){return!1},Cesium3DTilesInspector.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),destroyObject(this)};var scratchPickRay=new Ray,scratchPickCartesian=new Cartesian3;function CesiumInspectorViewModel(e,t){var c=this,i=e.canvas,r=new ScreenSpaceEventHandler(i);this._eventHandler=r,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;var n,u=this._scene.globe;function a(e){e=c._scene.pick({x:e.position.x,y:e.position.y});defined(e)&&(c.primitive=defined(e.collection)?e.collection:e.primitive),c._scene.requestRender(),c.pickPrimitiveActive=!1}function o(e){var t,i=u.ellipsoid,e=c._scene.camera.getPickRay(e.position,scratchPickRay),e=u.pick(e,c._scene,scratchPickCartesian);if(defined(e))for(var r=i.cartesianToCartographic(e),n=u._surface.tileProvider._tilesToRenderByTextureCount,a=0;!t&&a<n.length;++a){var o=n[a];if(defined(o))for(var s=0;!t&&s<o.length;++s){var l=o[s];Rectangle.contains(l.rectangle,r)&&(t=l)}}c.tile=t,c.pickTileActive=!1}u.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.globeDepth=!1,this.pickDepth=!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="",knockout.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","globeDepth","pickDepth","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=createCommand(function(){c.dropDownVisible=!c.dropDownVisible}),this._toggleGeneral=createCommand(function(){c.generalVisible=!c.generalVisible}),this._togglePrimitives=createCommand(function(){c.primitivesVisible=!c.primitivesVisible}),this._toggleTerrain=createCommand(function(){c.terrainVisible=!c.terrainVisible}),this._frustumsSubscription=knockout.getObservable(this,"frustums").subscribe(function(e){c._scene.debugShowFrustums=e,c._scene.requestRender()}),this._frustumPlanesSubscription=knockout.getObservable(this,"frustumPlanes").subscribe(function(e){c._scene.debugShowFrustumPlanes=e,c._scene.requestRender()}),this._performanceSubscription=knockout.getObservable(this,"performance").subscribe(function(e){e?c._performanceDisplay=new PerformanceDisplay({container:c._performanceContainer}):c._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=createCommand(function(){return c._primitive.debugShowBoundingVolume=c.primitiveBoundingSphere,c._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=knockout.getObservable(this,"primitiveBoundingSphere").subscribe(function(){c._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=createCommand(function(){var e;return c.primitiveReferenceFrame?(e=c._primitive.modelMatrix,c._modelMatrixPrimitive=new DebugModelMatrixPrimitive({modelMatrix:e}),c._scene.primitives.add(c._modelMatrixPrimitive)):defined(c._modelMatrixPrimitive)&&(c._scene.primitives.remove(c._modelMatrixPrimitive),c._modelMatrixPrimitive=void 0),c._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=knockout.getObservable(this,"primitiveReferenceFrame").subscribe(function(){c._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=createCommand(function(){return c.filterPrimitive?c._scene.debugCommandFilter=function(e){return!(!defined(c._modelMatrixPrimitive)||e.owner!==c._modelMatrixPrimitive._primitive)||!!defined(c._primitive)&&(e.owner===c._primitive||e.owner===c._primitive._billboardCollection||e.owner.primitive===c._primitive)}:c._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=knockout.getObservable(this,"filterPrimitive").subscribe(function(){c._doFilterPrimitive(),c._scene.requestRender()}),this._wireframeSubscription=knockout.getObservable(this,"wireframe").subscribe(function(e){u._surface.tileProvider._debug.wireframe=e,c._scene.requestRender()}),this._globeDepthSubscription=knockout.getObservable(this,"globeDepth").subscribe(function(e){c._scene.debugShowGlobeDepth=e,c._scene.requestRender()}),this._pickDepthSubscription=knockout.getObservable(this,"pickDepth").subscribe(function(e){c._scene.debugShowPickDepth=e,c._scene.requestRender()}),this._depthFrustumSubscription=knockout.getObservable(this,"depthFrustum").subscribe(function(e){c._scene.debugShowDepthFrustum=e,c._scene.requestRender()}),this._incrementDepthFrustum=createCommand(function(){var e=c.depthFrustum+1;return c.depthFrustum=boundDepthFrustum(1,c._numberOfFrustums,e),c._scene.requestRender(),!0}),this._decrementDepthFrustum=createCommand(function(){var e=c.depthFrustum-1;return c.depthFrustum=boundDepthFrustum(1,c._numberOfFrustums,e),c._scene.requestRender(),!0}),this._suspendUpdatesSubscription=knockout.getObservable(this,"suspendUpdates").subscribe(function(e){(u._surface._debug.suspendLodUpdate=e)||(c.filterTile=!1)}),this._showTileCoordinates=createCommand(function(){return c.tileCoordinates&&!defined(n)?n=e.imageryLayers.addImageryProvider(new TileCoordinatesImageryProvider({tilingScheme:e.terrainProvider.tilingScheme})):!c.tileCoordinates&&defined(n)&&(e.imageryLayers.remove(n),n=void 0),!0}),this._tileCoordinatesSubscription=knockout.getObservable(this,"tileCoordinates").subscribe(function(){c._showTileCoordinates(),c._scene.requestRender()}),this._tileBoundingSphereSubscription=knockout.getObservable(this,"tileBoundingSphere").subscribe(function(){c._showTileBoundingSphere(),c._scene.requestRender()}),this._showTileBoundingSphere=createCommand(function(){return c.tileBoundingSphere?u._surface.tileProvider._debug.boundingSphereTile=c._tile:u._surface.tileProvider._debug.boundingSphereTile=void 0,c._scene.requestRender(),!0}),this._doFilterTile=createCommand(function(){return c.filterTile?(c.suspendUpdates=!0,u._surface._tilesToRender=[],defined(c._tile)&&c._tile.renderable&&u._surface._tilesToRender.push(c._tile)):c.suspendUpdates=!1,!0}),this._filterTileSubscription=knockout.getObservable(this,"filterTile").subscribe(function(){c.doFilterTile(),c._scene.requestRender()}),this._pickPrimitive=createCommand(function(){c.pickPrimitiveActive=!c.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=knockout.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?r.setInputAction(a,ScreenSpaceEventType$1.LEFT_CLICK):r.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}),this._pickTile=createCommand(function(){c.pickTileActive=!c.pickTileActive}),this._pickTileActiveSubscription=knockout.getObservable(this,"pickTileActive").subscribe(function(e){e?r.setInputAction(o,ScreenSpaceEventType$1.LEFT_CLICK):r.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){c._update()})}function CesiumInspector(e,t){e=getElement(e);var i=document.createElement("div"),r=new CesiumInspectorViewModel(t,i);this._viewModel=r,this._container=e;var n=document.createElement("div");this._element=n;var a=document.createElement("div");a.textContent="Cesium Inspector",a.className="cesium-cesiumInspector-button",a.setAttribute("data-bind","click: toggleDropDown"),n.appendChild(a),n.className="cesium-cesiumInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var o=document.createElement("div");(this._panel=o).className="cesium-cesiumInspector-dropDown",n.appendChild(o);var s=InspectorShared.createSection,l=InspectorShared.createCheckbox,c=s(o,"General","generalVisible","toggleGeneral"),u=l("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(d),c.appendChild(u),c.appendChild(l("Show Frustum Planes","frustumPlanes")),c.appendChild(l("Performance Display","performance")),i.className="cesium-cesiumInspector-performanceDisplay",c.appendChild(i);var h=document.createElement("div");h.className="cesium-cesiumInspector-shaderCache",h.setAttribute("data-bind","html: shaderCacheText"),c.appendChild(h);var p=document.createElement("div");c.appendChild(p);t=document.createElement("span");t.setAttribute("data-bind",'html: "     Frustum:"'),p.appendChild(t);a=document.createElement("span");a.setAttribute("data-bind","text: depthFrustumText"),p.appendChild(a);e=document.createElement("input");e.type="button",e.value="-",e.className="cesium-cesiumInspector-pickButton",e.setAttribute("data-bind","click: decrementDepthFrustum"),p.appendChild(e);n=document.createElement("input");n.type="button",n.value="+",n.className="cesium-cesiumInspector-pickButton",n.setAttribute("data-bind","click: incrementDepthFrustum"),p.appendChild(n);d=s(o,"Primitives","primitivesVisible","togglePrimitives"),u=document.createElement("div");u.className="cesium-cesiumInspector-pickSection",d.appendChild(u);i=document.createElement("input");i.type="button",i.value="Pick a primitive",i.className="cesium-cesiumInspector-pickButton",i.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');h=document.createElement("div");h.className="cesium-cesiumInspector-center",h.appendChild(i),u.appendChild(h),u.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),u.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),u.appendChild(this._primitiveOnly);c=s(o,"Terrain","terrainVisible","toggleTerrain"),t=document.createElement("div");t.className="cesium-cesiumInspector-pickSection",c.appendChild(t);a=document.createElement("input");a.type="button",a.value="Pick a tile",a.className="cesium-cesiumInspector-pickButton",a.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),(h=document.createElement("div")).appendChild(a),h.className="cesium-cesiumInspector-center",t.appendChild(h);e=document.createElement("div");t.appendChild(e);p=document.createElement("input");p.type="button",p.value="Parent",p.className="cesium-cesiumInspector-pickButton",p.setAttribute("data-bind","click: selectParent");n=document.createElement("input");n.type="button",n.value="NW",n.className="cesium-cesiumInspector-pickButton",n.setAttribute("data-bind","click: selectNW");d=document.createElement("input");d.type="button",d.value="NE",d.className="cesium-cesiumInspector-pickButton",d.setAttribute("data-bind","click: selectNE");i=document.createElement("input");i.type="button",i.value="SW",i.className="cesium-cesiumInspector-pickButton",i.setAttribute("data-bind","click: selectSW");u=document.createElement("input");u.type="button",u.value="SE",u.className="cesium-cesiumInspector-pickButton",u.setAttribute("data-bind","click: selectSE");s=document.createElement("div");s.className="cesium-cesiumInspector-tileText",e.className="cesium-cesiumInspector-frustumStatistics",e.appendChild(s),e.setAttribute("data-bind","visible: hasPickedTile"),s.setAttribute("data-bind","html: tileText");o=document.createElement("div");o.className="cesium-cesiumInspector-relativeText",o.textContent="Select relative:",e.appendChild(o);a=document.createElement("table"),h=document.createElement("tr"),s=document.createElement("tr"),o=document.createElement("td");o.appendChild(p);p=document.createElement("td");p.appendChild(n);n=document.createElement("td");n.appendChild(d),h.appendChild(o),h.appendChild(p),h.appendChild(n);p=document.createElement("td"),n=document.createElement("td");n.appendChild(i);i=document.createElement("td");i.appendChild(u),s.appendChild(p),s.appendChild(n),s.appendChild(i),a.appendChild(h),a.appendChild(s),e.appendChild(a),t.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),t.appendChild(l("Show only selected","filterTile","hasPickedTile")),c.appendChild(l("Wireframe","wireframe")),c.appendChild(l("Suspend LOD update","suspendUpdates")),c.appendChild(l("Show tile coordinates","tileCoordinates")),knockout.applyBindings(r,this._element)}function getDefaultSkyBoxUrl(e){return buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_"+e+".jpg")}function startRenderLoop(a){a._renderLoopRunning=!0;var o=0;requestAnimationFramePolyFill(function e(t){if(!a.isDestroyed())if(a._useDefaultRenderLoop)try{var i,r,n=a._targetFrameRate;defined(n)?(i=1e3/n)<(r=t-o)&&(a.resize(),a.render(),o=t-r%i):(a.resize(),a.render()),requestAnimationFramePolyFill(e)}catch(e){a._useDefaultRenderLoop=!1,a._renderLoopRunning=!1,a._showRenderLoopErrors&&a.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,e)}else a._renderLoopRunning=!1})}function configurePixelRatio(e){var t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,defined(e._scene)&&(e._scene.pixelRatio=t),t}function configureCanvasSize(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,n=configurePixelRatio(e);e._canvasClientWidth=i,e._canvasClientHeight=r,r*=n,t.width=i*=n,t.height=r,e._canRender=0!=i&&0!=r,e._lastDevicePixelRatio=window.devicePixelRatio}function configureCameraFrustum(e){var t=e._canvas,i=t.width,t=t.height;0!==i&&0!==t&&(defined((e=e._scene.camera.frustum).aspectRatio)?e.aspectRatio=i/t:(e.top=e.right*(t/i),e.bottom=-e.top))}function CesiumWidget(e,t){e=getElement(e),t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=document.createElement("div");i.className="cesium-widget",e.appendChild(i);var r=document.createElement("canvas"),n=FeatureDetection.supportsImageRenderingPixelated();function a(){r!==r.ownerDocument.activeElement&&r.ownerDocument.activeElement.blur()}(this._supportsImageRenderingPixelated=n)&&(r.style.imageRendering=FeatureDetection.imageRenderingValue()),r.oncontextmenu=function(){return!1},r.onselectstart=function(){return!1},r.addEventListener("mousedown",a),r.addEventListener("pointerdown",a),i.appendChild(r);var o=document.createElement("div");o.className="cesium-widget-credits";var s=defined(t.creditContainer)?getElement(t.creditContainer):i;s.appendChild(o);var l=defined(t.creditViewport)?getElement(t.creditViewport):i,c=defaultValue(t.showRenderLoopErrors,!0),n=defaultValue(t.useBrowserRecommendedResolution,!0);this._element=i,this._container=e,this._canvas=r,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=l,this._creditContainer=s,this._innerCreditContainer=o,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=c,this._resolutionScale=1,this._useBrowserRecommendedResolution=n,this._forceResize=!1,this._clock=defined(t.clock)?t.clock:new Clock,configureCanvasSize(this);try{var u=new Scene({canvas:r,contextOptions:t.contextOptions,creditContainer:o,creditViewport:l,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:defaultValue(t.scene3DOnly,!1),terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange});(this._scene=u).camera.constrainedAxis=Cartesian3.UNIT_Z,configurePixelRatio(this),configureCameraFrustum(this);var d=defaultValue(u.mapProjection.ellipsoid,Ellipsoid.WGS84),h=t.globe;!1!==(h=!defined(h)?new Globe(d):h)&&(u.globe=h,u.globe.shadows=defaultValue(t.terrainShadows,ShadowMode$1.RECEIVE_ONLY));var p=t.skyBox;!1!==(p=!defined(p)?new SkyBox({sources:{positiveX:getDefaultSkyBoxUrl("px"),negativeX:getDefaultSkyBoxUrl("mx"),positiveY:getDefaultSkyBoxUrl("py"),negativeY:getDefaultSkyBoxUrl("my"),positiveZ:getDefaultSkyBoxUrl("pz"),negativeZ:getDefaultSkyBoxUrl("mz")}}):p)&&(u.skyBox=p,u.sun=new Sun,u.moon=new Moon);var m=t.skyAtmosphere;!1!==(m=!defined(m)?new SkyAtmosphere(d):m)&&(u.skyAtmosphere=m);var f=!1!==t.globe&&t.imageryProvider;!1!==(f=!defined(f)?createWorldImagery():f)&&u.imageryLayers.addImageryProvider(f),defined(t.terrainProvider)&&!1!==t.globe&&(u.terrainProvider=t.terrainProvider),this._screenSpaceEventHandler=new ScreenSpaceEventHandler(r),defined(t.sceneMode)&&(t.sceneMode===SceneMode$1.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===SceneMode$1.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=defaultValue(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;var g=this;this._onRenderError=function(e,t){g._useDefaultRenderLoop=!1,g._renderLoopRunning=!1,g._showRenderLoopErrors&&g.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)},u.renderError.addEventListener(this._onRenderError)}catch(e){throw c&&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:',e),e}}function FullscreenButtonViewModel(e,t){t=getElement(t=!defined(t)?document.body:t);var i=this,r=knockout.observable(Fullscreen.fullscreen),n=knockout.observable(Fullscreen.enabled),t=t.ownerDocument;this.isFullscreen=void 0,knockout.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,knockout.defineProperty(this,"isFullscreenEnabled",{get:function(){return n()},set:function(e){n(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=createCommand(function(){Fullscreen.fullscreen?Fullscreen.exitFullscreen():Fullscreen.requestFullscreen(i._fullscreenElement)},knockout.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=defaultValue(getElement(e),t.body),this._callback=function(){r(Fullscreen.fullscreen)},t.addEventListener(Fullscreen.changeEventName,this._callback)}Object.defineProperties(CesiumInspectorViewModel.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(){var e=this;return createCommand(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return createCommand(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return createCommand(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return createCommand(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return createCommand(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){var t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,defined(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,defined(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),(this._primitive=e).show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){var t;defined(e)?(this.hasPickedTile=!0,e!==this._tile&&(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,defined(t=e.data)&&defined(t.tileBoundingRegion)?this.tileText+="<br>Min: "+t.tileBoundingRegion.minimumHeight+" Max: "+t.tileBoundingRegion.maximumHeight:this.tileText+="<br>(Tile is not loaded)"),this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()):(this.hasPickedTile=!1,this._tile=void 0)}}}),CesiumInspectorViewModel.prototype._update=function(){this.frustums&&(this.frustumStatisticText=frustumStatisticsToString(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=boundDepthFrustum(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},CesiumInspectorViewModel.prototype.isDestroyed=function(){return!1},CesiumInspectorViewModel.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._globeDepthSubscription.dispose(),this._pickDepthSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),destroyObject(this)},Object.defineProperties(CesiumInspector.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),CesiumInspector.prototype.isDestroyed=function(){return!1},CesiumInspector.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),destroyObject(this)},Object.defineProperties(CesiumWidget.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}},camera:{get:function(){return this._scene.camera}},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)&&!this._renderLoopRunning&&startRenderLoop(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)}}}),CesiumWidget.prototype.showErrorPanel=function(e,t,i){var r=this._element,n=document.createElement("div");n.className="cesium-widget-errorPanel";var a=document.createElement("div");a.className="cesium-widget-errorPanel-content",n.appendChild(a);var o=document.createElement("div");o.className="cesium-widget-errorPanel-header",o.appendChild(document.createTextNode(e)),a.appendChild(o);var s=document.createElement("div");function l(){s.style.maxHeight=Math.max(Math.round(.9*r.clientHeight-100),30)+"px"}s.className="cesium-widget-errorPanel-scroll",a.appendChild(s),l(),defined(window.addEventListener)&&window.addEventListener("resize",l,!1);var c,u,d,h=defined(t),o=defined(i);(h||o)&&((p=document.createElement("div")).className="cesium-widget-errorPanel-message",s.appendChild(p),o&&(c=formatError(i),h||(t=formatError({name:(i="string"==typeof i?new Error(i):i).name,message:i.message}),c=i.stack),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+c),(u=document.createElement("div")).className="cesium-widget-errorPanel-message-details collapsed",(d=document.createElement("span")).className="cesium-widget-errorPanel-more-details",d.appendChild(document.createTextNode("See more...")),u.appendChild(d),u.onclick=function(e){u.removeChild(d),u.appendChild(document.createTextNode(c)),u.className="cesium-widget-errorPanel-message-details",a.className="cesium-widget-errorPanel-content expanded",u.onclick=void 0},s.appendChild(u)),p.innerHTML="<p>"+t+"</p>");var p=document.createElement("div");p.className="cesium-widget-errorPanel-buttonPanel",a.appendChild(p);t=document.createElement("button");t.setAttribute("type","button"),t.className="cesium-button",t.appendChild(document.createTextNode("OK")),t.onclick=function(){defined(l)&&defined(window.removeEventListener)&&window.removeEventListener("resize",l,!1),r.removeChild(n)},p.appendChild(t),r.appendChild(n)},CesiumWidget.prototype.isDestroyed=function(){return!1},CesiumWidget.prototype.destroy=function(){defined(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),destroyObject(this)},CesiumWidget.prototype.resize=function(){var e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,configureCanvasSize(this),configureCameraFrustum(this),this._scene.requestRender())},CesiumWidget.prototype.render=function(){var e;this._canRender?(this._scene.initializeFrame(),e=this._clock.tick(),this._scene.render(e)):this._clock.tick()},Object.defineProperties(FullscreenButtonViewModel.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),FullscreenButtonViewModel.prototype.isDestroyed=function(){return!1},FullscreenButtonViewModel.prototype.destroy=function(){document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};var enterFullScreenPath="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",exitFullScreenPath="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 FullscreenButton(e,t){var i=new FullscreenButtonViewModel(t,e=getElement(e));i._exitFullScreenPath=exitFullScreenPath,i._enterFullScreenPath=enterFullScreenPath;t=document.createElement("button");t.type="button",t.className="cesium-button cesium-fullscreenButton",t.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(t),knockout.applyBindings(i,t),this._container=e,this._viewModel=i,this._element=t}Object.defineProperties(FullscreenButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),FullscreenButton.prototype.isDestroyed=function(){return!1},FullscreenButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var DEFAULT_HEIGHT=1e3;function GeocoderViewModel(e){defined(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new CartographicGeocoderService,new IonGeocoderService({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new Event,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=handleArrowDown,this._handleArrowUp=handleArrowUp;var n=this;this._suggestionsVisible=knockout.pureComputed(function(){var e=0<knockout.getObservable(n,"_suggestions")().length,t=knockout.getObservable(n,"_showSuggestions")();return e&&t}),this._searchCommand=createCommand(function(e){return e=defaultValue(e,GeocodeType$1.SEARCH),n._focusTextbox=!1,defined(n._selectedSuggestion)?(n.activateSuggestion(n._selectedSuggestion),!1):(n.hideSuggestions(),void(n.isSearchInProgress?cancelGeocode(n):geocode(n,n._geocoderServices,e)))}),this.deselectSuggestion=function(){n._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(i||r)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,t="Enter"===t.key||13===t.keyCode;return r?handleArrowUp(n):i?handleArrowDown(n):t&&n._searchCommand(),!0},this.activateSuggestion=function(e){n.hideSuggestions(),n._searchText=e.displayName;e=e.destination;clearSuggestions(n),n.destinationFound(n,e)},this.hideSuggestions=function(){n._showSuggestions=!1,n._selectedSuggestion=void 0},this.showSuggestions=function(){n._showSuggestions=!0},this.handleMouseover=function(e,t){e!==n._selectedSuggestion&&(n._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=defaultValue(e.autocomplete,!0),this.destinationFound=defaultValue(e.destinationFound,GeocoderViewModel.flyToDestination),this._focusTextbox=!1,knockout.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);e=knockout.getObservable(this,"_searchText");e.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=e.subscribe(function(){GeocoderViewModel._updateSearchSuggestions(n)}),this.isSearchInProgress=void 0,knockout.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,knockout.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,knockout.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function handleArrowUp(e){var t;0!==e._suggestions.length&&(-1!==(t=e._suggestions.indexOf(e._selectedSuggestion))&&0!==t?(e._selectedSuggestion=e._suggestions[t=t-1],GeocoderViewModel._adjustSuggestionsScroll(e,t)):e._selectedSuggestion=void 0)}function handleArrowDown(e){var t;0!==e._suggestions.length&&(t=e._suggestions.length,t=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t,e._selectedSuggestion=e._suggestions[t],GeocoderViewModel._adjustSuggestionsScroll(e,t))}function computeFlyToLocationForCartographic(t,e){var i=defined(e)?e.availability:void 0;return defined(i)?sampleTerrainMostDetailed(e,[t]).then(function(e){return(t=e[0]).height+=DEFAULT_HEIGHT,t}):(t.height+=DEFAULT_HEIGHT,when.resolve(t))}function flyToDestination(e,t){var i,r=e._scene,n=r.mapProjection.ellipsoid,a=r.camera,o=r.terrainProvider,s=t;t instanceof Rectangle?CesiumMath.equalsEpsilon(t.south,t.north,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(t.east,t.west,CesiumMath.EPSILON7)?t=Rectangle.center(t):i=computeFlyToLocationForRectangle(t,r):t=n.cartesianToCartographic(t),(i=!defined(i)?computeFlyToLocationForCartographic(t,o):i).then(function(e){s=n.cartographicToCartesian(e)}).always(function(){a.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:Matrix4.IDENTITY})})}function chainPromise(e,t,i,r){return e.then(function(e){return defined(e)&&"fulfilled"===e.state&&0<e.value.length?e:t.geocode(i,r).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}})})}function geocode(i,e,t){var r=i._searchText;if(hasOnlyWhitespace(r))i.showSuggestions();else{i._isSearchInProgress=!0;for(var n=when.resolve(),a=0;a<e.length;a++)n=chainPromise(n,e[a],r,t);(i._geocodePromise=n).then(function(e){if(!n.cancel){i._isSearchInProgress=!1;var t=e.value;if("fulfilled"===e.state&&defined(t)&&0<t.length)return i._searchText=t[0].displayName,void i.destinationFound(i,t[0].destination);i._searchText=r+" (not found)"}})}}function adjustSuggestionsScroll(e,t){var i=getElement(e._viewContainer),e=i.getElementsByClassName("search-results")[0],i=i.getElementsByTagName("li")[t];0!==t?(t=i.offsetTop)+i.clientHeight>e.clientHeight?e.scrollTop=t+i.clientHeight:t<e.scrollTop&&(e.scrollTop=t):e.scrollTop=0}function cancelGeocode(e){e._isSearchInProgress=!1,defined(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function hasOnlyWhitespace(e){return/^\s*$/.test(e)}function clearSuggestions(e){knockout.getObservable(e,"_suggestions").removeAll()}function updateSearchSuggestions(r){var i,t;r.autoComplete&&(i=r._searchText,clearSuggestions(r),hasOnlyWhitespace(i)||(t=when.resolve([]),r._geocoderServices.forEach(function(e){t=t.then(function(t){return 5<=t.length?t:e.geocode(i,GeocodeType$1.AUTOCOMPLETE).then(function(e){return t=t.concat(e)})})}),t.then(function(e){for(var t=r._suggestions,i=0;i<e.length;i++)t.push(e[i])})))}Object.defineProperties(GeocoderViewModel.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}}}),GeocoderViewModel.prototype.destroy=function(){this._suggestionSubscription.dispose()},GeocoderViewModel.flyToDestination=flyToDestination,GeocoderViewModel._updateSearchSuggestions=updateSearchSuggestions,GeocoderViewModel._adjustSuggestionsScroll=adjustSuggestionsScroll;var startSearchPath="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",stopSearchPath="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 Geocoder(e){var i=getElement(e.container),r=new GeocoderViewModel(e);r._startSearchPath=startSearchPath,r._stopSearchPath=stopSearchPath;var t=document.createElement("form");t.setAttribute("data-bind","submit: search");var n=document.createElement("input");n.type="search",n.className="cesium-geocoder-input",n.setAttribute("placeholder","Enter an address or landmark..."),n.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(){n.select()},0)},n.addEventListener("focus",this._onTextBoxFocus,!1),t.appendChild(n),this._textBox=n;var a=document.createElement("span");a.className="cesium-geocoder-searchButton",a.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),t.appendChild(a),i.appendChild(t);var o=document.createElement("div");o.className="search-results",o.setAttribute("data-bind","visible: _suggestionsVisible");e=document.createElement("ul");e.setAttribute("data-bind","foreach: _suggestions");a=document.createElement("li");e.appendChild(a),a.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),o.appendChild(e),i.appendChild(o),knockout.applyBindings(r,t),knockout.applyBindings(r,o),this._container=i,this._searchSuggestionsContainer=o,this._viewModel=r,this._form=t,this._onInputBegin=function(e){var t=e.target;"function"==typeof e.composedPath&&(t=e.composedPath()[0]),i.contains(t)||(r._focusTextbox=!1,r.hideSuggestions())},this._onInputEnd=function(e){r._focusTextbox=!0,r.showSuggestions()},FeatureDetection.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),i.addEventListener("pointerup",this._onInputEnd,!0),i.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),i.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),i.addEventListener("touchend",this._onInputEnd,!0),i.addEventListener("touchcancel",this._onInputEnd,!0))}function HomeButtonViewModel(e,t){this._scene=e,this._duration=t;var i=this;this._command=createCommand(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",knockout.track(this,["tooltip"])}function HomeButton(e,t,i){e=getElement(e);t=new HomeButtonViewModel(t,i);t._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";i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-home-button",i.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(i),knockout.applyBindings(t,i),this._container=e,this._viewModel=t,this._element=i}Object.defineProperties(Geocoder.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),Geocoder.prototype.isDestroyed=function(){return!1},Geocoder.prototype.destroy=function(){var e=this._container;return FeatureDetection.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(),knockout.cleanNode(this._form),knockout.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),destroyObject(this)},Object.defineProperties(HomeButtonViewModel.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}}}),Object.defineProperties(HomeButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),HomeButton.prototype.isDestroyed=function(){return!1},HomeButton.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var cameraEnabledPath="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",cameraDisabledPath="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 InfoBoxViewModel(){this._cameraClicked=new Event,this._closeClicked=new Event,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",knockout.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,knockout.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?cameraDisabledPath:cameraEnabledPath}}),knockout.defineProperty(this,"_bodyless",{get:function(){return!defined(this.description)||0===this.description.length}})}function InfoBox(e){e=getElement(e);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(n);var t=document.createElement("div");t.className="cesium-infoBox-title",t.setAttribute("data-bind","text: titleText"),n.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-infoBox-camera",t.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-infoBox-close",t.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),t.innerHTML="×",n.appendChild(t);var a=document.createElement("iframe");a.className="cesium-infoBox-iframe",a.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),a.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),a.setAttribute("allowfullscreen",!0),n.appendChild(a);var i=new InfoBoxViewModel;knockout.applyBindings(i,n),this._container=e,this._element=n,this._frame=a,this._viewModel=i,this._descriptionSubscription=void 0;var o=this;a.addEventListener("load",function(){var e=a.contentDocument,t=e.createElement("link");t.href=buildModuleUrl("Widgets/InfoBox/InfoBoxDescription.css"),t.rel="stylesheet",t.type="text/css";var r=e.createElement("div");r.className="cesium-infoBox-description",e.head.appendChild(t),e.body.appendChild(r),o._descriptionSubscription=subscribeAndEvaluate(i,"description",function(e){a.style.height="5px",r.innerHTML=e;var t=null,i=r.firstElementChild;null===i||1!==r.childNodes.length||null!==(e=window.getComputedStyle(i))&&(i=e["background-color"],defined(i=Color.fromCssColorString(i))&&0!==i.alpha&&(t=e["background-color"])),n.style["background-color"]=t;t=r.getBoundingClientRect().height;a.style.height=t+"px"})}),a.setAttribute("src","about:blank")}function NavigationHelpButtonViewModel(){this.showInstructions=!1;var e=this;this._command=createCommand(function(){e.showInstructions=!e.showInstructions}),this._showClick=createCommand(function(){e._touch=!1}),this._showTouch=createCommand(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",knockout.track(this,["tooltip","showInstructions","_touch"])}function NavigationHelpButton(e){var t=getElement(e.container),i=new NavigationHelpButtonViewModel,r=defaultValue(e.instructionsInitiallyVisible,!1);i.showInstructions=r,i._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";var n=document.createElement("span");n.className="cesium-navigationHelpButton-wrapper",t.appendChild(n);var a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",a.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),n.appendChild(a);var o=document.createElement("div");o.className="cesium-navigation-help",o.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),n.appendChild(o);e=document.createElement("button");e.type="button",e.className="cesium-navigation-button cesium-navigation-button-left",e.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');r=document.createElement("img");r.src=buildModuleUrl("Widgets/Images/NavigationHelp/Mouse.svg"),r.className="cesium-navigation-button-icon",r.style.width="25px",r.style.height="25px",e.appendChild(r),e.appendChild(document.createTextNode("Mouse"));a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-right",a.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');r=document.createElement("img");r.src=buildModuleUrl("Widgets/Images/NavigationHelp/Touch.svg"),r.className="cesium-navigation-button-icon",r.style.width="25px",r.style.height="25px",a.appendChild(r),a.appendChild(document.createTextNode("Touch")),o.appendChild(e),o.appendChild(a);a=document.createElement("div");a.className="cesium-click-navigation-help cesium-navigation-help-instructions",a.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),a.innerHTML=' <table> <tr> <td><img src="'+buildModuleUrl("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="'+buildModuleUrl("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="'+buildModuleUrl("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>',o.appendChild(a);a=document.createElement("div");a.className="cesium-touch-navigation-help cesium-navigation-help-instructions",a.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),a.innerHTML=' <table> <tr> <td><img src="'+buildModuleUrl("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="'+buildModuleUrl("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="'+buildModuleUrl("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="'+buildModuleUrl("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>',o.appendChild(a),knockout.applyBindings(i,n),this._container=t,this._viewModel=i,this._wrapper=n,this._closeInstructions=function(e){n.contains(e.target)||(i.showInstructions=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}function PerformanceWatchdogViewModel(e){this._scene=e.scene,this.lowFrameRateMessage=defaultValue(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,knockout.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var t=this;this._dismissMessage=createCommand(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});e=FrameRateMonitor.fromScene(e.scene);this._unsubscribeLowFrameRate=e.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=e.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}function PerformanceWatchdog(e){var t=getElement(e.container),i=new PerformanceWatchdogViewModel(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");e=document.createElement("button");e.setAttribute("type","button"),e.className="cesium-performance-watchdog-message-dismiss",e.innerHTML="×",e.setAttribute("data-bind","click: dismissMessage"),r.appendChild(e);e=document.createElement("div");e.className="cesium-performance-watchdog-message",e.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(e),t.appendChild(r),knockout.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}function ProjectionPickerViewModel(e){this._scene=e,this._orthographic=e.camera.frustum instanceof OrthographicFrustum,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,knockout.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var n=this;knockout.defineProperty(this,"selectedTooltip",function(){return n._orthographic?n.tooltipOrthographic:n.tooltipPerspective}),this._toggleDropDown=createCommand(function(){n.sceneMode===SceneMode$1.SCENE2D||n._flightInProgress||(n.dropDownVisible=!n.dropDownVisible)}),this._eventHelper=new EventHelper,this._eventHelper.add(e.morphComplete,function(e,t,i,r){n.sceneMode=i,n._orthographic=i===SceneMode$1.SCENE2D||n._scene.camera.frustum instanceof OrthographicFrustum}),this._eventHelper.add(e.preRender,function(){n._flightInProgress=defined(e.camera._currentFlight)}),this._switchToPerspective=createCommand(function(){n.sceneMode!==SceneMode$1.SCENE2D&&(n._scene.camera.switchToPerspectiveFrustum(),n._orthographic=!1,n.dropDownVisible=!1)}),this._switchToOrthographic=createCommand(function(){n.sceneMode!==SceneMode$1.SCENE2D&&(n._scene.camera.switchToOrthographicFrustum(),n._orthographic=!0,n.dropDownVisible=!1)}),this._sceneMode=SceneMode$1}InfoBoxViewModel.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},Object.defineProperties(InfoBoxViewModel.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),Object.defineProperties(InfoBox.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),InfoBox.prototype.isDestroyed=function(){return!1},InfoBox.prototype.destroy=function(){var e=this._container;return knockout.cleanNode(this._element),e.removeChild(this._element),defined(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),destroyObject(this)},Object.defineProperties(NavigationHelpButtonViewModel.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),Object.defineProperties(NavigationHelpButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),NavigationHelpButton.prototype.isDestroyed=function(){return!1},NavigationHelpButton.prototype.destroy=function(){return FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)},Object.defineProperties(PerformanceWatchdogViewModel.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),PerformanceWatchdogViewModel.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),destroyObject(this)},Object.defineProperties(PerformanceWatchdog.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),PerformanceWatchdog.prototype.isDestroyed=function(){return!1},PerformanceWatchdog.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)},Object.defineProperties(ProjectionPickerViewModel.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}}}),ProjectionPickerViewModel.prototype.isDestroyed=function(){return!1},ProjectionPickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var perspectivePath="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",orthographicPath="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 ProjectionPicker(e,t){e=getElement(e);var i=new ProjectionPickerViewModel(t);i._perspectivePath=perspectivePath,i._orthographicPath=orthographicPath;var r=document.createElement("span");r.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(r);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button",t.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'),t.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --\x3e\x3c!-- /ko --\x3e',r.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",t.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 }'),r.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",t.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 }'),r.appendChild(t),knockout.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(e){r.contains(e.target)||(i.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function SceneModePickerViewModel(e,t){this._scene=e;var n=this;this._eventHelper=new EventHelper,this._eventHelper.add(e.morphStart,function(e,t,i,r){n.sceneMode=i,n.dropDownVisible=!1}),this._duration=defaultValue(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",knockout.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,knockout.defineProperty(this,"selectedTooltip",function(){var e=n.sceneMode;return e===SceneMode$1.SCENE2D?n.tooltip2D:e===SceneMode$1.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=createCommand(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=createCommand(function(){e.morphTo2D(n._duration)}),this._morphTo3D=createCommand(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=createCommand(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=SceneMode$1}Object.defineProperties(ProjectionPicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),ProjectionPicker.prototype.isDestroyed=function(){return!1},ProjectionPicker.prototype.destroy=function(){return this._viewModel.destroy(),FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)},Object.defineProperties(SceneModePickerViewModel.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}}}),SceneModePickerViewModel.prototype.isDestroyed=function(){return!1},SceneModePickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var globePath="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",flatMapPath="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",columbusViewPath="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 SceneModePicker(e,t,i){e=getElement(e);var r=new SceneModePickerViewModel(t,i);r._globePath=globePath,r._flatMapPath=flatMapPath,r._columbusViewPath=columbusViewPath;var n=document.createElement("span");n.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(n);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.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'),i.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --\x3e\x3c!-- /ko --\x3e',n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.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 }'),n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.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 }'),n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.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 }'),n.appendChild(i),knockout.applyBindings(r,n),this._viewModel=r,this._container=e,this._wrapper=n,this._closeDropDown=function(e){n.contains(e.target)||(r.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(SceneModePicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SceneModePicker.prototype.isDestroyed=function(){return!1},SceneModePicker.prototype.destroy=function(){return this._viewModel.destroy(),FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)};var screenSpacePos=new Cartesian2,offScreen="-1000px";function SelectionIndicatorViewModel(i,e,t){this._scene=i,this._screenPositionX=offScreen,this._screenPositionY=offScreen,this._tweens=i.tweens,this._container=defaultValue(t,document.body),this._selectionIndicatorElement=e,this._scale=1,this.position=void 0,this.showSelection=!1,knockout.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,knockout.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&defined(this.position)}}),knockout.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(e,t){return SceneTransforms.wgs84ToWindowCoordinates(i,e,t)}}function SelectionIndicator(e,t){e=getElement(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"svg:svg");n.setAttribute("width",160),n.setAttribute("height",160),n.setAttribute("viewBox","0 0 160 160");e=document.createElementNS(r,"g");e.setAttribute("transform","translate(80,80)"),n.appendChild(e);r=document.createElementNS(r,"path");r.setAttribute("data-bind","attr: { transform: _transform }"),r.setAttribute("d","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"),e.appendChild(r),i.appendChild(n);t=new SelectionIndicatorViewModel(t,this._element,this._container);this._viewModel=t,knockout.applyBindings(this._viewModel,this._element)}function TimelineHighlightRange(e,t,i){this._color=e,this._height=t,this._base=defaultValue(i,0)}function TimelineTrack(e,t,i,r){this.interval=e,this.height=t,this.color=i||new Color(.5,.5,.5,1),this.backgroundColor=r||new Color(0,0,0,0)}SelectionIndicatorViewModel.prototype.update=function(){var e,t,i,r,n;this.showSelection&&defined(this.position)&&(defined(e=this.computeScreenSpacePosition(this.position,screenSpacePos))?(t=(n=this._container).parentNode.clientWidth,i=n.parentNode.clientHeight,n=.5*(r=this._selectionIndicatorElement.clientWidth),e.x=Math.min(Math.max(e.x,-r),t+r)-n,e.y=Math.min(Math.max(e.y,-r),i+r)-n,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"):(this._screenPositionX=offScreen,this._screenPositionY=offScreen))},SelectionIndicatorViewModel.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:EasingFunction$1.EXPONENTIAL_OUT})},SelectionIndicatorViewModel.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:EasingFunction$1.EXPONENTIAL_OUT})},Object.defineProperties(SelectionIndicatorViewModel.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),Object.defineProperties(SelectionIndicator.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SelectionIndicator.prototype.isDestroyed=function(){return!1},SelectionIndicator.prototype.destroy=function(){var e=this._container;return knockout.cleanNode(this._element),e.removeChild(this._element),destroyObject(this)},TimelineHighlightRange.prototype.getHeight=function(){return this._height},TimelineHighlightRange.prototype.getBase=function(){return this._base},TimelineHighlightRange.prototype.getStartTime=function(){return this._start},TimelineHighlightRange.prototype.getStopTime=function(){return this._stop},TimelineHighlightRange.prototype.setRange=function(e,t){this._start=e,this._stop=t},TimelineHighlightRange.prototype.render=function(e){var t,i,r="";return this._start&&this._stop&&this._color&&(i=JulianDate.secondsDifference(this._start,e.epochJulian),t=Math.round(e.timeBarWidth*e.getAlpha(i)),i=JulianDate.secondsDifference(this._stop,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(i))-t,t<0&&(i+=t,t=0),0<(i=t+i>e.timeBarWidth?e.timeBarWidth-t:i)&&(r='<span class="cesium-timeline-highlight" style="left: '+t.toString()+"px; width: "+i.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')),r},TimelineTrack.prototype.render=function(e,t){var i=this.interval.start,r=this.interval.stop,n=t.startJulian,a=JulianDate.addSeconds(t.startJulian,t.duration,new JulianDate);if(JulianDate.lessThan(i,n)&&JulianDate.greaterThan(r,a))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(JulianDate.lessThanOrEquals(i,a)&&JulianDate.greaterThanOrEquals(r,n)){for(var o,s,l=0;l<t.timeBarWidth;++l){var c=JulianDate.addSeconds(t.startJulian,l/t.timeBarWidth*t.duration,new JulianDate);!defined(o)&&JulianDate.greaterThanOrEquals(c,i)?o=l:!defined(s)&&JulianDate.greaterThanOrEquals(c,r)&&(s=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),defined(o)&&(defined(s)||(s=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(o,t.y,Math.max(s-o,1),this.height))}};var timelineWheelDelta=1e12,timelineMouseMode={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},timelineTouchMode={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},timelineTicScales=[.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],timelineMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Timeline(e,t){var i=(e=getElement(e)).ownerDocument;this.container=e;var r=i.createElement("div");r.className="cesium-timeline-main",e.appendChild(r),this._topDiv=r,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=timelineMouseMode.none,this._touchMode=timelineTouchMode.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=createMouseDownCallback(this),this._onMouseUp=createMouseUpCallback(this),this._onMouseMove=createMouseMoveCallback(this),this._onMouseWheel=createMouseWheelCallback(this),this._onTouchStart=createTouchStartCallback(this),this._onTouchMove=createTouchMoveCallback(this),this._onTouchEnd=createTouchEndCallback(this);r=this._timeBarEle;i.addEventListener("mouseup",this._onMouseUp,!1),i.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function twoDigits(e){return e<10?"0"+e.toString():e.toString()}function createMouseDownCallback(t){return function(e){t._mouseMode!==timelineMouseMode.touchOnly&&(0===e.button?(t._mouseMode=timelineMouseMode.scrub,t._scrubElement&&(t._scrubElement.style.backgroundPosition="-16px 0"),t._onMouseMove(e)):(t._mouseX=e.clientX,2===e.button?t._mouseMode=timelineMouseMode.zoom:t._mouseMode=timelineMouseMode.slide)),e.preventDefault()}}function createMouseUpCallback(t){return function(e){t._mouseMode=timelineMouseMode.none,t._scrubElement&&(t._scrubElement.style.backgroundPosition="0 0"),t._timelineDrag=0,t._timelineDragLocation=void 0}}function createMouseMoveCallback(r){return function(e){var t,i;r._mouseMode===timelineMouseMode.scrub?(e.preventDefault(),(t=e.clientX-r._topDiv.getBoundingClientRect().left)<0?(r._timelineDragLocation=0,r._timelineDrag=-.01*r._timeBarSecondsSpan):t>r._topDiv.clientWidth?(r._timelineDragLocation=r._topDiv.clientWidth,r._timelineDrag=.01*r._timeBarSecondsSpan):(r._timelineDragLocation=void 0,r._setTimeBarTime(t,t*r._timeBarSecondsSpan/r._topDiv.clientWidth))):r._mouseMode===timelineMouseMode.slide?(i=r._mouseX-e.clientX,r._mouseX=e.clientX,0!==i&&(t=i*r._timeBarSecondsSpan/r._topDiv.clientWidth,r.zoomTo(JulianDate.addSeconds(r._startJulian,t,new JulianDate),JulianDate.addSeconds(r._endJulian,t,new JulianDate)))):r._mouseMode===timelineMouseMode.zoom&&(i=r._mouseX-e.clientX,r._mouseX=e.clientX,0!==i&&r.zoomFrom(Math.pow(1.01,i)))}}function createMouseWheelCallback(t){return function(e){e=e.wheelDeltaY||e.wheelDelta||-e.detail;e/=timelineWheelDelta=Math.max(Math.min(Math.abs(e),timelineWheelDelta),1),t.zoomFrom(Math.pow(1.05,-e))}}function createTouchStartCallback(n){return function(e){var t,i=e.touches.length,r=n._topDiv.getBoundingClientRect().left;e.preventDefault(),n._mouseMode=timelineMouseMode.touchOnly,1===i?(t=JulianDate.secondsDifference(n._scrubJulian,n._startJulian),t=Math.round(t*n._topDiv.clientWidth/n._timeBarSecondsSpan+r),Math.abs(e.touches[0].clientX-t)<50?(n._touchMode=timelineTouchMode.scrub,n._scrubElement&&(n._scrubElement.style.backgroundPosition=1===i?"-16px 0":"0 0")):(n._touchMode=timelineTouchMode.singleTap,n._touchState.centerX=e.touches[0].clientX-r)):2===i?(n._touchMode=timelineTouchMode.slideZoom,n._touchState.centerX=.5*(e.touches[0].clientX+e.touches[1].clientX)-r,n._touchState.spanX=Math.abs(e.touches[0].clientX-e.touches[1].clientX)):n._touchMode=timelineTouchMode.ignore}}function createTouchEndCallback(r){return function(e){var t=e.touches.length,i=r._topDiv.getBoundingClientRect().left;r._touchMode===timelineTouchMode.singleTap?(r._touchMode=timelineTouchMode.scrub,r._onTouchMove(e)):r._touchMode===timelineTouchMode.scrub&&r._onTouchMove(e),r._mouseMode=timelineMouseMode.touchOnly,1!==t?r._touchMode=0<t?timelineTouchMode.ignore:timelineTouchMode.none:r._touchMode===timelineTouchMode.slideZoom&&(r._touchState.centerX=e.touches[0].clientX-i),r._scrubElement&&(r._scrubElement.style.backgroundPosition="0 0")}}function createTouchMoveCallback(s){return function(e){var t,i,r,n,a=1,o=s._topDiv.getBoundingClientRect().left;s._touchMode===timelineTouchMode.singleTap&&(s._touchMode=timelineTouchMode.slideZoom),s._mouseMode=timelineMouseMode.touchOnly,s._touchMode===timelineTouchMode.scrub?(e.preventDefault(),1===e.changedTouches.length&&0<=(t=e.changedTouches[0].clientX-o)&&t<=s._topDiv.clientWidth&&s._setTimeBarTime(t,t*s._timeBarSecondsSpan/s._topDiv.clientWidth)):s._touchMode===timelineTouchMode.slideZoom&&(2===(t=e.touches.length)?(i=.5*(e.touches[0].clientX+e.touches[1].clientX)-o,r=Math.abs(e.touches[0].clientX-e.touches[1].clientX)):1===t&&(i=e.touches[0].clientX-o,r=0),defined(i)&&(n=0<r&&0<s._touchState.spanX?(a=s._touchState.spanX/r,JulianDate.addSeconds(s._startJulian,(s._touchState.centerX*s._timeBarSecondsSpan-i*s._timeBarSecondsSpan*a)/s._topDiv.clientWidth,new JulianDate)):(n=s._touchState.centerX-i,JulianDate.addSeconds(s._startJulian,n*s._timeBarSecondsSpan/s._topDiv.clientWidth,new JulianDate)),s.zoomTo(n,JulianDate.addSeconds(n,s._timeBarSecondsSpan*a,new JulianDate)),s._touchState.centerX=i,s._touchState.spanX=r))}}function lockScreen(e){var t=!1,i=window.screen;return defined(i)&&(defined(i.lockOrientation)?t=i.lockOrientation(e):defined(i.mozLockOrientation)?t=i.mozLockOrientation(e):defined(i.msLockOrientation)?t=i.msLockOrientation(e):defined(i.orientation&&i.orientation.lock)&&(t=i.orientation.lock(e))),t}function unlockScreen(){var e=window.screen;defined(e)&&(defined(e.unlockOrientation)?e.unlockOrientation():defined(e.mozUnlockOrientation)?e.mozUnlockOrientation():defined(e.msUnlockOrientation)?e.msUnlockOrientation():defined(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function toggleVR(e,t,i,r){r()||(i()?(t.useWebVR=!1,e._locked&&(unlockScreen(),e._locked=!1),e._noSleep.disable(),Fullscreen.exitFullscreen(),i(!1)):(Fullscreen.fullscreen||Fullscreen.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=lockScreen("landscape")),i(t.useWebVR=!0)))}function VRButtonViewModel(e,t){var i=this,r=knockout.observable(Fullscreen.enabled),n=knockout.observable(!1);this.isVRMode=void 0,knockout.defineProperty(this,"isVRMode",{get:function(){return n()}}),this.isVREnabled=void 0,knockout.defineProperty(this,"isVREnabled",{get:function(){return r()},set:function(e){r(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",function(){return r()?n()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});var a=knockout.observable(!1);this._isOrthographic=void 0,knockout.defineProperty(this,"_isOrthographic",{get:function(){return a()}}),this._eventHelper=new EventHelper,this._eventHelper.add(e.preRender,function(){a(e.camera.frustum instanceof OrthographicFrustum)}),this._locked=!1,this._noSleep=new NoSleep,this._command=createCommand(function(){toggleVR(i,e,n,a)},knockout.getObservable(this,"isVREnabled")),this._vrElement=defaultValue(getElement(t),document.body),this._callback=function(){!Fullscreen.fullscreen&&n()&&(e.useWebVR=!1,i._locked&&(unlockScreen(),i._locked=!1),i._noSleep.disable(),n(!1))},document.addEventListener(Fullscreen.changeEventName,this._callback)}Timeline.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},Timeline.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},Timeline.prototype.isDestroyed=function(){return!1},Timeline.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);var e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),destroyObject(this)},Timeline.prototype.addHighlightRange=function(e,t,i){i=new TimelineHighlightRange(e,t,i);return this._highlightRanges.push(i),this.resize(),i},Timeline.prototype.addTrack=function(e,t,i,r){r=new TimelineTrack(e,t,i,r);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r},Timeline.prototype.zoomTo=function(e,t){var i,r;this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=JulianDate.secondsDifference(t,e),this._clock&&this._clock.clockRange!==ClockRange$1.UNBOUNDED&&(i=this._clock.startTime,n=this._clock.stopTime,r=JulianDate.secondsDifference(n,i),t=JulianDate.secondsDifference(i,this._startJulian),e=JulianDate.secondsDifference(n,this._endJulian),this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):0<t?(this._endJulian=JulianDate.addSeconds(this._endJulian,t,new JulianDate),this._startJulian=i,this._timeBarSecondsSpan=JulianDate.secondsDifference(this._endJulian,this._startJulian)):e<0&&(this._startJulian=JulianDate.addSeconds(this._startJulian,e,new JulianDate),this._endJulian=n,this._timeBarSecondsSpan=JulianDate.secondsDifference(this._endJulian,this._startJulian))),this._makeTics();var 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)},Timeline.prototype.zoomFrom=function(e){var t=JulianDate.secondsDifference(this._scrubJulian,this._startJulian);1<e||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(JulianDate.addSeconds(this._startJulian,t-t*e,new JulianDate),JulianDate.addSeconds(this._endJulian,i*e-i,new JulianDate))},Timeline.prototype.makeLabel=function(e){var t=JulianDate.toGregorianDate(e),e=t.millisecond,i=" UTC";if(0<e&&this._timeBarSecondsSpan<3600){for(i=Math.floor(e).toString();i.length<3;)i="0"+i;i="."+i}return timelineMonthNames[t.month-1]+" "+t.day+" "+t.year+" "+twoDigits(t.hour)+":"+twoDigits(t.minute)+":"+twoDigits(t.second)+i},Timeline.prototype.smallestTicInPixels=7,Timeline.prototype._makeTics=function(){var e=this._timeBarEle,t=JulianDate.secondsDifference(this._scrubJulian,this._startJulian),i=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),r=i-8,n=this;this._needleEle.style.left=i.toString()+"px";var a="",t=31536e6,o=0,s=this._timeBarSecondsSpan;s<.01?(this._timeBarSecondsSpan=s=.01,this._endJulian=JulianDate.addSeconds(this._startJulian,.01,new JulianDate)):t<s&&(this._timeBarSecondsSpan=s=t,this._endJulian=JulianDate.addSeconds(this._startJulian,t,new JulianDate));var l=this._timeBarEle.clientWidth;l<10&&(l=10);var c=this._startJulian,i=Math.min(s/l*1e-5,.4),t=JulianDate.toGregorianDate(c),t=31536e4<s?JulianDate.fromDate(new Date(Date.UTC(100*Math.floor(t.year/100),0))):31536e3<s?JulianDate.fromDate(new Date(Date.UTC(10*Math.floor(t.year/10),0))):86400<s?JulianDate.fromDate(new Date(Date.UTC(t.year,0))):JulianDate.fromDate(new Date(Date.UTC(t.year,t.month,t.day))),u=JulianDate.secondsDifference(this._startJulian,JulianDate.addSeconds(t,i,new JulianDate)),d=u+s;function h(e){return Math.floor(u/e)*e}function p(e,t){return Math.ceil(e/t+.5)*t}function m(e){return(e-u)/s}function f(e,t){return e-t*Math.round(e/t)}this._epochJulian=t,this._rulerEle.innerHTML=this.makeLabel(JulianDate.addSeconds(this._endJulian,-.01,new JulianDate));var g=this._rulerEle.offsetWidth+20;g<30&&(g=180);i=o;o-=1e-10;var _={startTime:u,startJulian:c,epochJulian:t,duration:s,timeBarWidth:l,getAlpha:m};this._highlightRanges.forEach(function(e){a+=e.render(_)});var y=0,C=0,v=0,S=g/l;1<S&&(S=1),S*=this._timeBarSecondsSpan;for(var T=-1,x=-1,b=timelineTicScales.length,E=0;E<b;++E){var P=timelineTicScales[E];if(++T,S<(y=P)&&o<P)break;x<0&&l*(P/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(x=T)}if(0<T){for(;0<T;)if(--T,Math.abs(f(y,timelineTicScales[T]))<1e-5){timelineTicScales[T]>=o&&(C=timelineTicScales[T]);break}if(0<=x)for(;x<T;){if(Math.abs(f(C,timelineTicScales[x]))<1e-5&&timelineTicScales[x]>=o){v=timelineTicScales[x];break}++x}}1e-10<(o=i)&&v<1e-5&&1e-10<Math.abs(o-y)&&(v=o)<=y+1e-10&&(C=0);var A=-999999;if(3<=l*(v/this._timeBarSecondsSpan))for(w=h(v);w<=d;w=p(w,v))a+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(l*m(w)).toString()+'px;"></span>';if(3<=l*(C/this._timeBarSecondsSpan))for(w=h(C);w<=d;w=p(w,C))a+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(l*m(w)).toString()+'px;"></span>';if(2<=l*(y/this._timeBarSecondsSpan)){d+=this._mainTicSpan=y;for(var w=h(y),D=JulianDate.computeTaiMinusUtc(t);w<=d;){var M,I=JulianDate.addSeconds(c,w-u,new JulianDate);2.1<y&&(M=JulianDate.computeTaiMinusUtc(I),.1<Math.abs(M-D)&&(w+=M-D,I=JulianDate.addSeconds(c,w-u,new JulianDate)));var R=Math.round(l*m(w)),O=this.makeLabel(I);this._rulerEle.innerHTML=O;I=R-((M=(M=this._rulerEle.offsetWidth)<10?g:M)/2-1);A<I?(A=I+M+5,a+='<span class="cesium-timeline-ticMain" style="left: '+R.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+I.toString()+'px;">'+O+"</span>"):a+='<span class="cesium-timeline-ticSub" style="left: '+R.toString()+'px;"></span>',w=p(w,y)}}else this._mainTicSpan=-1;e.innerHTML=a+='<span class="cesium-timeline-icon16" style="left:'+r+'px;bottom:0;background-position: 0 0;"></span>',this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),_.y=0,this._trackList.forEach(function(e){e.render(n._context,_),_.y+=e.height})},Timeline.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e,t=this._scrubElement;defined(this._scrubElement)&&(e=JulianDate.secondsDifference(this._scrubJulian,this._startJulian),e=Math.round(e*this._topDiv.clientWidth/this._timeBarSecondsSpan),this._lastXPos!==e&&(this._lastXPos=e,t.style.left=e-8+"px",this._needleEle.style.left=e+"px")),defined(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(JulianDate.addSeconds(this._startJulian,this._timelineDrag,new JulianDate),JulianDate.addSeconds(this._endJulian,this._timelineDrag,new JulianDate)))},Timeline.prototype._setTimeBarTime=function(e,t){e=Math.round(e),this._scrubJulian=JulianDate.addSeconds(this._startJulian,t,new JulianDate),this._scrubElement&&(this._scrubElement.style.left=(e-8).toString()+"px",this._needleEle.style.left=e.toString()+"px");var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},Timeline.prototype.resize=function(){var t,e=this.container.clientWidth,i=this.container.clientHeight;e===this._lastWidth&&i===this._lastHeight||(this._trackContainer.style.height=i+"px",t=1,this._trackList.forEach(function(e){t+=e.height}),this._trackListEle.style.height=t.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=t,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=i)},Object.defineProperties(VRButtonViewModel.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),VRButtonViewModel.prototype.isDestroyed=function(){return!1},VRButtonViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};var enterVRPath="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",exitVRPath="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 VRButton(e,t,i){e=getElement(e);t=new VRButtonViewModel(t,i);t._exitVRPath=exitVRPath,t._enterVRPath=enterVRPath;i=document.createElement("button");i.type="button",i.className="cesium-button cesium-vrButton",i.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(i),knockout.applyBindings(t,i),this._container=e,this._viewModel=t,this._element=i}Object.defineProperties(VRButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),VRButton.prototype.isDestroyed=function(){return!1},VRButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var boundingSphereScratch=new BoundingSphere;function onTimelineScrubfunction(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function getCesium3DTileFeatureDescription(i){var e=i.getPropertyNames(),r="";return e.forEach(function(e){var t=i.getProperty(e);defined(t)&&(r+="<tr><th>"+e+"</th><td>"+t+"</td></tr>")}),r=0<r.length?'<table class="cesium-infoBox-defaultTable"><tbody>'+r+"</tbody></table>":r}function getCesium3DTileFeatureName(e){for(var t=[],i=e.getPropertyNames(),r=0;r<i.length;r++){var n=i[r];/^name$/i.test(n)?t[0]=e.getProperty(n):/name/i.test(n)?t[1]=e.getProperty(n):/^title$/i.test(n)?t[2]=e.getProperty(n):/^(id|identifier)$/i.test(n)?t[3]=e.getProperty(n):/element/i.test(n)?t[4]=e.getProperty(n):/(id|identifier)$/i.test(n)&&(t[5]=e.getProperty(n))}var a=t.length;for(r=0;r<a;r++){var o=t[r];if(defined(o)&&""!==o)return o}return"Unnamed Feature"}function pickEntity(e,t){var i=e.scene.pick(t.position);if(defined(i)){var r=defaultValue(i.id,i.primitive.id);if(r instanceof Entity)return r;if(i instanceof Cesium3DTileFeature)return new Entity({name:getCesium3DTileFeatureName(i),description:getCesium3DTileFeatureDescription(i),feature:i})}if(defined(e.scene.globe))return pickImageryLayerFeature(e,t.position)}function trackDataSourceClock(e,t,i){!defined(i)||defined(i=i.clock)&&(i.getValue(t),defined(e)&&(e.updateFromClock(),e.zoomTo(i.startTime,i.stopTime)))}var cartesian3Scratch=new Cartesian3;function pickImageryLayerFeature(i,e){var t=i.scene,e=t.camera.getPickRay(e),t=t.imageryLayers.pickImageryLayerFeatures(e,t);if(defined(t)){var r=new Entity({id:"Loading...",description:"Loading feature information..."});return when(t,function(e){var t;i.selectedEntity===r&&(defined(e)&&0!==e.length?(e=new Entity({id:(t=e[0]).name,description:t.description}),defined(t.position)&&(t=i.scene.globe.ellipsoid.cartographicToCartesian(t.position,cartesian3Scratch),e.position=new ConstantPositionProperty(t)),i.selectedEntity=e):i.selectedEntity=createNoFeaturesEntity())},function(){i.selectedEntity===r&&(i.selectedEntity=createNoFeaturesEntity())}),r}}function createNoFeaturesEntity(){return new Entity({id:"None",description:"No features found."})}function enableVRUI(e,t){var i=e._geocoder,r=e._homeButton,n=e._sceneModePicker,a=e._projectionPicker,o=e._baseLayerPicker,s=e._animation,l=e._timeline,c=e._fullscreenButton,u=e._infoBox,d=e._selectionIndicator,h=t?"hidden":"visible";defined(i)&&(i.container.style.visibility=h),defined(r)&&(r.container.style.visibility=h),defined(n)&&(n.container.style.visibility=h),defined(a)&&(a.container.style.visibility=h),defined(o)&&(o.container.style.visibility=h),defined(s)&&(s.container.style.visibility=h),defined(l)&&(l.container.style.visibility=h),defined(c)&&c.viewModel.isFullscreenEnabled&&(c.container.style.visibility=h),defined(u)&&(u.container.style.visibility=h),defined(d)&&(d.container.style.visibility=h),e._container&&(c=t||!defined(c)?0:c.container.clientWidth,e._vrButton.container.style.right=c+"px",e.forceResize())}function Viewer(e,t){e=getElement(e);var i=!(defined((t=defaultValue(t,defaultValue.EMPTY_OBJECT)).globe)&&!1===t.globe||defined(t.baseLayerPicker)&&!1===t.baseLayerPicker),r=this,n=document.createElement("div");n.className="cesium-viewer",e.appendChild(n);var a=document.createElement("div");a.className="cesium-viewer-cesiumWidgetContainer",n.appendChild(a);var o=document.createElement("div");o.className="cesium-viewer-bottom",n.appendChild(o);var s,l,c=defaultValue(t.scene3DOnly,!1),u=!1;defined(t.clockViewModel)?s=(l=t.clockViewModel).clock:(l=new ClockViewModel(s=new Clock),u=!0),defined(t.shouldAnimate)&&(s.shouldAnimate=t.shouldAnimate);var d=new CesiumWidget(a,{imageryProvider:!i&&!defined(t.imageryProvider)&&void 0,clock:s,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:defined(t.creditContainer)?t.creditContainer:o,creditViewport:t.creditViewport,scene3DOnly:c,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange}),h=t.dataSources,p=!1;defined(h)||(h=new DataSourceCollection,p=!0);var m,f,g=d.scene,_=new DataSourceDisplay({scene:g,dataSourceCollection:h}),a=new EventHelper;a.add(s.onTick,Viewer.prototype._onTick,this),a.add(g.morphStart,Viewer.prototype._clearTrackedObject,this),defined(t.selectionIndicator)&&!1===t.selectionIndicator||((m=document.createElement("div")).className="cesium-viewer-selectionIndicatorContainer",n.appendChild(m),m=new SelectionIndicator(m,g)),defined(t.infoBox)&&!1===t.infoBox||((N=document.createElement("div")).className="cesium-viewer-infoBoxContainer",n.appendChild(N),C=(f=new InfoBox(N)).viewModel,a.add(C.cameraClicked,Viewer.prototype._onInfoBoxCameraClicked,this),a.add(C.closeClicked,Viewer.prototype._onInfoBoxClockClicked,this));var y,C,v,S,T,x,b,E,P,A,w,D,M,I,R,O,L,F,N=document.createElement("div");if(N.className="cesium-viewer-toolbar",n.appendChild(N),defined(t.geocoder)&&!1===t.geocoder||((C=document.createElement("div")).className="cesium-viewer-geocoderContainer",N.appendChild(C),defined(t.geocoder)&&"boolean"!=typeof t.geocoder&&(v=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),y=new Geocoder({container:C,geocoderServices:v,scene:g}),a.add(y.viewModel.search.beforeExecute,Viewer.prototype._clearObjects,this)),defined(t.homeButton)&&!1===t.homeButton||(S=new HomeButton(N,g),defined(y)&&a.add(S.viewModel.command.afterExecute,function(){var e=y.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),a.add(S.viewModel.command.beforeExecute,Viewer.prototype._clearTrackedObject,this)),c||defined(t.sceneModePicker)&&!1===t.sceneModePicker||(T=new SceneModePicker(N,g)),t.projectionPicker&&(x=new ProjectionPicker(N,g)),i&&(b=defaultValue(t.imageryProviderViewModels,createDefaultImageryProviderViewModels()),E=defaultValue(t.terrainProviderViewModels,createDefaultTerrainProviderViewModels()),b=new BaseLayerPicker(N,{globe:g.globe,imageryProviderViewModels:b,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:E,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),E=N.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]),defined(t.imageryProvider)&&!1!==t.imageryProvider&&(i&&(b.viewModel.selectedImagery=void 0),g.imageryLayers.removeAll(),g.imageryLayers.addImageryProvider(t.imageryProvider)),defined(t.terrainProvider)&&(i&&(b.viewModel.selectedTerrain=void 0),g.terrainProvider=t.terrainProvider),!defined(t.navigationHelpButton)||!1!==t.navigationHelpButton){var B,V=!0;try{defined(window.localStorage)&&(defined(B=window.localStorage.getItem("cesium-hasSeenNavHelp"))&&Boolean(B)?V=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true"))}catch(e){}V=new NavigationHelpButton({container:N,instructionsInitiallyVisible:defaultValue(t.navigationInstructionsInitiallyVisible,V)})}defined(t.animation)&&!1===t.animation||((w=document.createElement("div")).className="cesium-viewer-animationContainer",n.appendChild(w),P=new Animation(w,new AnimationViewModel(l))),defined(t.timeline)&&!1===t.timeline||((w=document.createElement("div")).className="cesium-viewer-timelineContainer",n.appendChild(w),(A=new Timeline(w,s)).addEventListener("settime",onTimelineScrubfunction,!1),A.zoomTo(s.startTime,s.stopTime)),defined(t.fullscreenButton)&&!1===t.fullscreenButton||((I=document.createElement("div")).className="cesium-viewer-fullscreenContainer",n.appendChild(I),M=subscribeAndEvaluate((D=new FullscreenButton(I,t.fullscreenElement)).viewModel,"isFullscreenEnabled",function(e){I.style.display=e?"block":"none",defined(A)&&(A.container.style.right=I.clientWidth+"px",A.resize())})),t.vrButton&&((F=document.createElement("div")).className="cesium-viewer-vrContainer",n.appendChild(F),O=subscribeAndEvaluate((R=new VRButton(F,g,t.fullScreenElement)).viewModel,"isVREnabled",function(e){F.style.display=e?"block":"none",defined(D)&&(F.style.right=I.clientWidth+"px"),defined(A)&&(A.container.style.right=F.clientWidth+"px",A.resize())}),L=subscribeAndEvaluate(R.viewModel,"isVRMode",function(e){enableVRUI(r,e)})),this._baseLayerPickerDropDown=E,this._fullscreenSubscription=M,this._vrSubscription=O,this._vrModeSubscription=L,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=defaultValue(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=o,this._element=n,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=f,this._dataSourceCollection=h,this._destroyDataSourceCollection=p,this._dataSourceDisplay=_,this._clockViewModel=l,this._destroyClockViewModel=u,this._toolbar=N,this._homeButton=S,this._sceneModePicker=T,this._projectionPicker=x,this._baseLayerPicker=b,this._navigationHelpButton=V,this._animation=P,this._timeline=A,this._fullscreenButton=D,this._vrButton=R,this._geocoder=y,this._eventHelper=a,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=defined(f)||defined(m),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new Event,this._trackedEntityChanged=new Event,knockout.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),a.add(h.dataSourceAdded,Viewer.prototype._onDataSourceAdded,this),a.add(h.dataSourceRemoved,Viewer.prototype._onDataSourceRemoved,this),a.add(g.postUpdate,Viewer.prototype.resize,this),a.add(g.postRender,Viewer.prototype._postRender,this);for(var k=h.length,z=0;z<k;z++)this._dataSourceAdded(h,h.get(z));this._dataSourceAdded(void 0,_.defaultDataSource),a.add(h.dataSourceAdded,Viewer.prototype._dataSourceAdded,this),a.add(h.dataSourceRemoved,Viewer.prototype._dataSourceRemoved,this),d.screenSpaceEventHandler.setInputAction(function(e){r.selectedEntity=pickEntity(r,e)},ScreenSpaceEventType$1.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(function(e){defined(e=pickEntity(r,e))?Property.getValueOrUndefined(e.position,r.clock.currentTime)?r.trackedEntity=e:r.zoomTo(e):defined(r.trackedEntity)&&(r.trackedEntity=void 0)},ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK)}function zoomToOrFly(i,e,t,r){cancelZoom(i);var n=when.defer();return i._zoomPromise=n,i._zoomIsFlight=r,i._zoomOptions=t,when(e,function(e){var t;i._zoomPromise===n&&(e instanceof ImageryLayer?e.getViewableRectangle().then(function(e){return computeFlyToLocationForRectangle(e,i.scene)}).then(function(e){i._zoomPromise===n&&(i._zoomTarget=e)}):e instanceof Cesium3DTileset||e instanceof TimeDynamicPointCloud?i._zoomTarget=e:e.isLoading&&defined(e.loadingEvent)?t=e.loadingEvent.addEventListener(function(){t(),i._zoomPromise===n&&(i._zoomTarget=e.entities.values.slice(0))}):Array.isArray(e)?i._zoomTarget=e.slice(0):(defined((e=defaultValue(e.values,e)).entities)&&(e=e.entities.values),Array.isArray(e)?i._zoomTarget=e.slice(0):i._zoomTarget=[e]))}),i.scene.requestRender(),n.promise}function clearZoom(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function cancelZoom(e){var t=e._zoomPromise;defined(t)&&(clearZoom(e),t.resolve(!1))}function updateZoomTarget(t){var i=t._zoomTarget;if(defined(i)&&t.scene.mode!==SceneMode$1.MORPHING){var r,e=t.scene,n=e.camera,a=t._zoomPromise,o=defaultValue(t._zoomOptions,{});if(i instanceof Cesium3DTileset)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(o.offset)||(o.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyToBoundingSphere(i.boundingSphere,r):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),a.resolve(!0)),clearZoom(t)});if(i instanceof TimeDynamicPointCloud)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(o.offset)||(o.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyToBoundingSphere(e,r):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),a.resolve(!0)),clearZoom(t)});if(i instanceof Cartographic)return r={destination:e.mapProjection.ellipsoid.cartographicToCartesian(i),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyTo(r):(n.setView(r),a.resolve(!0)),void clearZoom(t);for(var s=i,l=[],c=0,u=s.length;c<u;c++){var d=t._dataSourceDisplay.getBoundingSphere(s[c],!1,boundingSphereScratch);if(d===BoundingSphereState$1.PENDING)return;d!==BoundingSphereState$1.FAILED&&l.push(BoundingSphere.clone(boundingSphereScratch))}0!==l.length?(t.trackedEntity=void 0,e=BoundingSphere.fromBoundingSpheres(l),t._zoomIsFlight?(clearZoom(t),n.flyToBoundingSphere(e,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)},offset:o.offset})):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),clearZoom(t),a.resolve(!0))):cancelZoom(t)}}function updateTrackedEntity(e){var t,i,r,n,a;e._needTrackedEntityUpdate&&(t=e._trackedEntity,i=e.clock.currentTime,defined(Property.getValueOrUndefined(t.position,i))&&(r=e.scene,(a=e._dataSourceDisplay.getBoundingSphere(t,!1,boundingSphereScratch))!==BoundingSphereState$1.PENDING&&((n=r.mode)!==SceneMode$1.COLUMBUS_VIEW&&n!==SceneMode$1.SCENE2D||(r.screenSpaceCameraController.enableTranslate=!1),n!==SceneMode$1.COLUMBUS_VIEW&&n!==SceneMode$1.SCENE3D||(r.screenSpaceCameraController.enableTilt=!1),a=a!==BoundingSphereState$1.FAILED?boundingSphereScratch:void 0,e._entityView=new EntityView(t,r,r.mapProjection.ellipsoid),e._entityView.update(i,a),e._needTrackedEntityUpdate=!1)))}function viewerCesium3DTilesInspectorMixin(e){var t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);var i=new Cesium3DTilesInspector(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return i}}})}function viewerCesiumInspectorMixin(e){var t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);var i=new CesiumInspector(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return i}}})}function viewerDragDropMixin(o,e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=!0,i=defaultValue(e.flyToOnDrop,!0),r=new Event,s=defaultValue(e.clearOnDrop,!0),n=defaultValue(e.dropTarget,o.container),l=defaultValue(e.clampToGround,!0),c=e.proxy;function a(e){stop(e),s&&(o.entities.removeAll(),o.dataSources.removeAll());for(var t=e.dataTransfer.files,i=t.length,r=0;r<i;r++){var n=t[r],a=new FileReader;a.onload=createOnLoadCallback(o,n,c,l),a.onerror=createDropErrorCallback(o,n),a.readAsText(n)}}n=getElement(n),Object.defineProperties(o,{dropTarget:{get:function(){return n},set:function(e){unsubscribe(n,a),subscribe(n=e,a)}},dropEnabled:{get:function(){return t},set:function(e){e!==t&&((e?subscribe:unsubscribe)(n,a),t=e)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return s},set:function(e){s=e}},flyToOnDrop:{get:function(){return i},set:function(e){i=e}},proxy:{get:function(){return c},set:function(e){c=e}},clampToGround:{get:function(){return l},set:function(e){l=e}}}),subscribe(n,a),o.destroy=wrapFunction(o,o.destroy,function(){o.dropEnabled=!1}),o._handleDrop=a}function stop(e){e.stopPropagation(),e.preventDefault()}function unsubscribe(e,t){defined(e)&&(e.removeEventListener("drop",t,!1),e.removeEventListener("dragenter",stop,!1),e.removeEventListener("dragover",stop,!1),e.removeEventListener("dragexit",stop,!1))}function subscribe(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",stop,!1),e.addEventListener("dragover",stop,!1),e.addEventListener("dragexit",stop,!1)}function createOnLoadCallback(r,n,a,o){var s=r.scene;return function(e){var t,i=n.name;try{if(/\.czml$/i.test(i))t=CzmlDataSource.load(JSON.parse(e.target.result),{sourceUri:i});else if(/\.geojson$/i.test(i)||/\.json$/i.test(i)||/\.topojson$/i.test(i))t=GeoJsonDataSource.load(JSON.parse(e.target.result),{sourceUri:i,clampToGround:o});else{if(!/\.(kml|kmz)$/i.test(i))return void r.dropError.raiseEvent(r,i,"Unrecognized file: "+i);t=KmlDataSource.load(n,{sourceUri:i,proxy:a,camera:s.camera,canvas:s.canvas,clampToGround:o})}defined(t)&&r.dataSources.add(t).then(function(e){r.flyToOnDrop&&r.flyTo(e)}).otherwise(function(e){r.dropError.raiseEvent(r,i,e)})}catch(e){r.dropError.raiseEvent(r,i,e)}}}function createDropErrorCallback(t,i){return function(e){t.dropError.raiseEvent(t,i.name,e.target.error)}}function viewerPerformanceWatchdogMixin(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=new PerformanceWatchdog({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return i}}})}function callAndWrap(e,t,i){try{return e(t,i)}catch(e){return when.reject(e)}}function createTaskProcessorWorker(n){var a;return function(e){var t=e.data,i=[],r={id:t.id,result:void 0,error:void 0};return when(callAndWrap(n,t.parameters,i)).then(function(e){r.result=e}).otherwise(function(e){e instanceof Error?r.error={name:e.name,message:e.message,stack:e.stack}:r.error=e}).always(function(){defined(a)||(a=defaultValue(self.webkitPostMessage,self.postMessage)),t.canTransferArrayBuffer||(i.length=0);try{a(r,i)}catch(e){r.result=void 0,r.error="postMessage failed with error: "+formatError(e)+"\n with responseMessage: "+JSON.stringify(r),a(r)}})}}Object.defineProperties(Viewer.prototype,{container:{get:function(){return this._container}},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._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},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}},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._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){var t,i;this._trackedEntity!==e&&(this._trackedEntity=e,cancelZoom(this),i=(t=this.scene).mode,defined(e)&&defined(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(Matrix4.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender())}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){var t;this._selectedEntity!==e&&(this._selectedEntity=e,t=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0,defined(e)?defined(t)&&t.animateAppear():defined(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e))}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,trackDataSourceClock(this._timeline,this.clock,e))}}}),Viewer.prototype.extend=function(e,t){e(this,t)},Viewer.prototype.resize=function(){var e,t,i,r,n=this._cesiumWidget,a=this._container,o=a.clientWidth,s=a.clientHeight,l=defined(this._animation),c=defined(this._timeline);n.resize(),o===this._lastWidth&&s===this._lastHeight||(r=s-125,defined(e=this._baseLayerPickerDropDown)&&(e.style.maxHeight=r+"px"),defined(this._geocoder)&&(this._geocoder.searchSuggestionsContainer.style.maxHeight=r+"px"),defined(this._infoBox)&&(this._infoBox.viewModel.maxHeight=r),a=this._timeline,r=e=n=0,l&&"hidden"!==window.getComputedStyle(this._animation.container).visibility&&(t=this._lastWidth,i=this._animation.container,900<o?(n=169,t<=900&&(i.style.width="169px",i.style.height="112px",this._animation.resize())):600<=o?(n=136,(t<600||900<t)&&(i.style.width="136px",i.style.height="90px",this._animation.resize())):(n=106,(600<t||0===t)&&(i.style.width="106px",i.style.height="70px",this._animation.resize())),e=n+5),c&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility&&(l=this._fullscreenButton,t=this._vrButton,c=(i=a.container).style,r=i.clientHeight+3,c.left=n+"px",n=0,defined(l)&&(n+=l.container.clientWidth),defined(t)&&(n+=t.container.clientWidth),c.right=n+"px",a.resize()),this._bottomContainer.style.left=e+"px",this._bottomContainer.style.bottom=r+"px",this._lastWidth=o,this._lastHeight=s)},Viewer.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Viewer.prototype.render=function(){this._cesiumWidget.render()},Viewer.prototype.isDestroyed=function(){return!1},Viewer.prototype.destroy=function(){this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK);for(var e=this.dataSources,t=e.length,i=0;i<t;i++)this._dataSourceRemoved(e,e.get(i));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),defined(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),defined(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),defined(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),defined(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),defined(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),defined(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),defined(this._timeline)&&(this._timeline.removeEventListener("settime",onTimelineScrubfunction,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),defined(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),defined(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),defined(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),defined(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),destroyObject(this)},Viewer.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Viewer.prototype._onEntityCollectionChanged,this)},Viewer.prototype._dataSourceRemoved=function(e,t){t=t.entities;t.collectionChanged.removeEventListener(Viewer.prototype._onEntityCollectionChanged,this),defined(this.trackedEntity)&&t.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),defined(this.selectedEntity)&&t.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Viewer.prototype._onTick=function(e){var t=e.currentTime,i=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=i);var r,n=this._entityView;defined(n)&&(a=this._trackedEntity,this._dataSourceDisplay.getBoundingSphere(a,!1,boundingSphereScratch)===BoundingSphereState$1.DONE&&n.update(t,boundingSphereScratch));var e=!1,i=this.selectedEntity,a=defined(i)&&this._enableInfoOrSelection;a&&i.isShowing&&i.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(i,!0,boundingSphereScratch)!==BoundingSphereState$1.FAILED?r=boundingSphereScratch.center:defined(i.position)&&(r=i.position.getValue(t,r)),e=defined(r));n=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;defined(n)&&(n.position=Cartesian3.clone(r,n.position),n.showSelection=a&&e,n.update());n=defined(this._infoBox)?this._infoBox.viewModel:void 0;defined(n)&&(n.showInfo=a,n.enableCamera=e,n.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(n.titleText=defaultValue(i.name,i.id),n.description=Property.getValueOrDefault(i.description,t,"")):(n.titleText="",n.description=""))},Viewer.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var a=i[n];this.trackedEntity===a&&(this.trackedEntity=void 0),this.selectedEntity===a&&(this.selectedEntity=void 0)}},Viewer.prototype._onInfoBoxCameraClicked=function(e){e.isCameraTracking&&this.trackedEntity===this.selectedEntity?this.trackedEntity=void 0:defined(this.selectedEntity.position)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)},Viewer.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Viewer.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Viewer.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Viewer.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&trackDataSourceClock(this.timeline,this.clock,e)},Viewer.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,t=this._eventHelper.add(t.changedEvent,Viewer.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=t},Viewer.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,t=t.entities.id;this._dataSourceChangedListeners[t](),this._dataSourceChangedListeners[t]=void 0,i&&(i=e.length,this._automaticallyTrackDataSourceClocks&&0<i?this.clockTrackedDataSource=e.get(i-1):this.clockTrackedDataSource=void 0)},Viewer.prototype.zoomTo=function(e,t){return zoomToOrFly(this,e,{offset:t},!1)},Viewer.prototype.flyTo=function(e,t){return zoomToOrFly(this,e,t,!0)},Viewer.prototype._postRender=function(){updateZoomTarget(this),updateTrackedEntity(this)};var VERSION="1.80";exports.Animation=Animation,exports.AnimationViewModel=AnimationViewModel,exports.Appearance=Appearance,exports.ApproximateTerrainHeights=ApproximateTerrainHeights,exports.ArcGISTiledElevationTerrainProvider=ArcGISTiledElevationTerrainProvider,exports.ArcGisMapServerImageryProvider=ArcGisMapServerImageryProvider,exports.ArcType=ArcType$1,exports.AssociativeArray=AssociativeArray,exports.AttributeCompression=AttributeCompression,exports.AttributeType=AttributeType$1,exports.AutoExposure=AutoExposure,exports.Autolinker=Autolinker,exports.AutomaticUniforms=AutomaticUniforms,exports.Axis=Axis$1,exports.AxisAlignedBoundingBox=AxisAlignedBoundingBox,exports.BaseLayerPicker=BaseLayerPicker,exports.BaseLayerPickerViewModel=BaseLayerPickerViewModel,exports.BatchTable=BatchTable,exports.Batched3DModel3DTileContent=Batched3DModel3DTileContent,exports.Billboard=Billboard,exports.BillboardCollection=BillboardCollection,exports.BillboardGraphics=BillboardGraphics,exports.BillboardVisualizer=BillboardVisualizer,exports.BingMapsGeocoderService=BingMapsGeocoderService,exports.BingMapsImageryProvider=BingMapsImageryProvider,exports.BingMapsStyle=BingMapsStyle$1,exports.BlendEquation=BlendEquation$1,exports.BlendFunction=BlendFunction$1,exports.BlendOption=BlendOption$1,exports.BlendingState=BlendingState$1,exports.BoundingRectangle=BoundingRectangle,exports.BoundingSphere=BoundingSphere,exports.BoundingSphereState=BoundingSphereState$1,exports.BoxEmitter=BoxEmitter,exports.BoxGeometry=BoxGeometry,exports.BoxGeometryUpdater=BoxGeometryUpdater,exports.BoxGraphics=BoxGraphics,exports.BoxOutlineGeometry=BoxOutlineGeometry,exports.BrdfLutGenerator=BrdfLutGenerator,exports.Buffer=Buffer$1,exports.BufferUsage=BufferUsage$1,exports.CallbackProperty=CallbackProperty,exports.Camera=Camera,exports.CameraEventAggregator=CameraEventAggregator,exports.CameraEventType=CameraEventType$1,exports.CameraFlightPath=CameraFlightPath,exports.Cartesian2=Cartesian2,exports.Cartesian3=Cartesian3,exports.Cartesian4=Cartesian4,exports.Cartographic=Cartographic,exports.CartographicGeocoderService=CartographicGeocoderService,exports.CatmullRomSpline=CatmullRomSpline,exports.Cesium3DTile=Cesium3DTile,exports.Cesium3DTileBatchTable=Cesium3DTileBatchTable,exports.Cesium3DTileColorBlendMode=Cesium3DTileColorBlendMode$1,exports.Cesium3DTileContent=Cesium3DTileContent,exports.Cesium3DTileContentFactory=Cesium3DTileContentFactory,exports.Cesium3DTileContentState=Cesium3DTileContentState$1,exports.Cesium3DTileFeature=Cesium3DTileFeature,exports.Cesium3DTileFeatureTable=Cesium3DTileFeatureTable,exports.Cesium3DTileOptimizationHint=Cesium3DTileOptimizationHint$1,exports.Cesium3DTileOptimizations=Cesium3DTileOptimizations,exports.Cesium3DTilePass=Cesium3DTilePass$1,exports.Cesium3DTilePassState=Cesium3DTilePassState,exports.Cesium3DTilePointFeature=Cesium3DTilePointFeature,exports.Cesium3DTileRefine=Cesium3DTileRefine$1,exports.Cesium3DTileStyle=Cesium3DTileStyle,exports.Cesium3DTileStyleEngine=Cesium3DTileStyleEngine,exports.Cesium3DTilesInspector=Cesium3DTilesInspector,exports.Cesium3DTilesInspectorViewModel=Cesium3DTilesInspectorViewModel,exports.Cesium3DTileset=Cesium3DTileset,exports.Cesium3DTilesetCache=Cesium3DTilesetCache,exports.Cesium3DTilesetGraphics=Cesium3DTilesetGraphics,exports.Cesium3DTilesetHeatmap=Cesium3DTilesetHeatmap,exports.Cesium3DTilesetMostDetailedTraversal=Cesium3DTilesetMostDetailedTraversal,exports.Cesium3DTilesetStatistics=Cesium3DTilesetStatistics,exports.Cesium3DTilesetTraversal=Cesium3DTilesetTraversal,exports.Cesium3DTilesetVisualizer=Cesium3DTilesetVisualizer,exports.CesiumInspector=CesiumInspector,exports.CesiumInspectorViewModel=CesiumInspectorViewModel,exports.CesiumTerrainProvider=CesiumTerrainProvider,exports.CesiumWidget=CesiumWidget,exports.Check=Check,exports.CheckerboardMaterialProperty=CheckerboardMaterialProperty,exports.CircleEmitter=CircleEmitter,exports.CircleGeometry=CircleGeometry,exports.CircleOutlineGeometry=CircleOutlineGeometry,exports.ClassificationModel=ClassificationModel,exports.ClassificationPrimitive=ClassificationPrimitive,exports.ClassificationType=ClassificationType$1,exports.ClearCommand=ClearCommand,exports.ClippingPlane=ClippingPlane,exports.ClippingPlaneCollection=ClippingPlaneCollection,exports.Clock=Clock,exports.ClockRange=ClockRange$1,exports.ClockStep=ClockStep$1,exports.ClockViewModel=ClockViewModel,exports.Color=Color,exports.ColorBlendMode=ColorBlendMode$1,exports.ColorGeometryInstanceAttribute=ColorGeometryInstanceAttribute,exports.ColorMaterialProperty=ColorMaterialProperty,exports.Command=Command,exports.ComponentDatatype=ComponentDatatype$1,exports.Composite3DTileContent=Composite3DTileContent,exports.CompositeEntityCollection=CompositeEntityCollection,exports.CompositeMaterialProperty=CompositeMaterialProperty,exports.CompositePositionProperty=CompositePositionProperty,exports.CompositeProperty=CompositeProperty,exports.CompressedTextureBuffer=CompressedTextureBuffer,exports.ComputeCommand=ComputeCommand,exports.ComputeEngine=ComputeEngine,exports.ConditionsExpression=ConditionsExpression,exports.ConeEmitter=ConeEmitter,exports.ConstantPositionProperty=ConstantPositionProperty,exports.ConstantProperty=ConstantProperty,exports.Context=Context,exports.ContextLimits=ContextLimits,exports.CoplanarPolygonGeometry=CoplanarPolygonGeometry,exports.CoplanarPolygonGeometryLibrary=CoplanarPolygonGeometryLibrary,exports.CoplanarPolygonOutlineGeometry=CoplanarPolygonOutlineGeometry,exports.CornerType=CornerType$1,exports.CorridorGeometry=CorridorGeometry,exports.CorridorGeometryLibrary=CorridorGeometryLibrary,exports.CorridorGeometryUpdater=CorridorGeometryUpdater,exports.CorridorGraphics=CorridorGraphics,exports.CorridorOutlineGeometry=CorridorOutlineGeometry,exports.Credit=Credit,exports.CreditDisplay=CreditDisplay,exports.CubeMap=CubeMap,exports.CubeMapFace=CubeMapFace,exports.CubicRealPolynomial=CubicRealPolynomial,exports.CullFace=CullFace$1,exports.CullingVolume=CullingVolume,exports.CustomDataSource=CustomDataSource,exports.CylinderGeometry=CylinderGeometry,exports.CylinderGeometryLibrary=CylinderGeometryLibrary,exports.CylinderGeometryUpdater=CylinderGeometryUpdater,exports.CylinderGraphics=CylinderGraphics,exports.CylinderOutlineGeometry=CylinderOutlineGeometry,exports.CzmlDataSource=CzmlDataSource,exports.DataSource=DataSource,exports.DataSourceClock=DataSourceClock,exports.DataSourceCollection=DataSourceCollection,exports.DataSourceDisplay=DataSourceDisplay,exports.DebugAppearance=DebugAppearance,exports.DebugCameraPrimitive=DebugCameraPrimitive,exports.DebugInspector=DebugInspector,exports.DebugModelMatrixPrimitive=DebugModelMatrixPrimitive,exports.DefaultProxy=DefaultProxy,exports.DepthFunction=DepthFunction$1,exports.DepthPlane=DepthPlane,exports.DerivedCommand=DerivedCommand,exports.DeveloperError=DeveloperError,exports.DeviceOrientationCameraController=DeviceOrientationCameraController,exports.DirectionalLight=DirectionalLight,exports.DiscardEmptyTileImagePolicy=DiscardEmptyTileImagePolicy,exports.DiscardMissingTileImagePolicy=DiscardMissingTileImagePolicy,exports.DistanceDisplayCondition=DistanceDisplayCondition,exports.DistanceDisplayConditionGeometryInstanceAttribute=DistanceDisplayConditionGeometryInstanceAttribute,exports.DoubleEndedPriorityQueue=DoubleEndedPriorityQueue,exports.DoublyLinkedList=DoublyLinkedList,exports.DracoLoader=DracoLoader,exports.DrawCommand=DrawCommand,exports.DynamicGeometryBatch=DynamicGeometryBatch,exports.DynamicGeometryUpdater=DynamicGeometryUpdater$1,exports.EarthOrientationParameters=EarthOrientationParameters,exports.EarthOrientationParametersSample=EarthOrientationParametersSample,exports.EasingFunction=EasingFunction$1,exports.EllipseGeometry=EllipseGeometry,exports.EllipseGeometryLibrary=EllipseGeometryLibrary,exports.EllipseGeometryUpdater=EllipseGeometryUpdater,exports.EllipseGraphics=EllipseGraphics,exports.EllipseOutlineGeometry=EllipseOutlineGeometry,exports.Ellipsoid=Ellipsoid,exports.EllipsoidGeodesic=EllipsoidGeodesic,exports.EllipsoidGeometry=EllipsoidGeometry,exports.EllipsoidGeometryUpdater=EllipsoidGeometryUpdater,exports.EllipsoidGraphics=EllipsoidGraphics,exports.EllipsoidOutlineGeometry=EllipsoidOutlineGeometry,exports.EllipsoidPrimitive=EllipsoidPrimitive,exports.EllipsoidRhumbLine=EllipsoidRhumbLine,exports.EllipsoidSurfaceAppearance=EllipsoidSurfaceAppearance,exports.EllipsoidTangentPlane=EllipsoidTangentPlane,exports.EllipsoidTerrainProvider=EllipsoidTerrainProvider,exports.EllipsoidalOccluder=EllipsoidalOccluder,exports.Empty3DTileContent=Empty3DTileContent,exports.EncodedCartesian3=EncodedCartesian3,exports.Entity=Entity,exports.EntityCluster=EntityCluster,exports.EntityCollection=EntityCollection,exports.EntityView=EntityView,exports.Event=Event,exports.EventHelper=EventHelper,exports.Expression=Expression,exports.ExpressionNodeType=ExpressionNodeType$1,exports.ExtrapolationType=ExtrapolationType$1,exports.FXAA3_11=FXAA3_11,exports.FeatureDetection=FeatureDetection,exports.Fog=Fog,exports.ForEach=ForEach,exports.FrameRateMonitor=FrameRateMonitor,exports.FrameState=FrameState,exports.Framebuffer=Framebuffer,exports.FrustumCommands=FrustumCommands,exports.FrustumGeometry=FrustumGeometry,exports.FrustumOutlineGeometry=FrustumOutlineGeometry,exports.Fullscreen=Fullscreen,exports.FullscreenButton=FullscreenButton,exports.FullscreenButtonViewModel=FullscreenButtonViewModel,exports.GeoJsonDataSource=GeoJsonDataSource,exports.GeocodeType=GeocodeType$1,exports.Geocoder=Geocoder,exports.GeocoderService=GeocoderService,exports.GeocoderViewModel=GeocoderViewModel,exports.GeographicProjection=GeographicProjection,exports.GeographicTilingScheme=GeographicTilingScheme,exports.Geometry=Geometry,exports.Geometry3DTileContent=Geometry3DTileContent,exports.GeometryAttribute=GeometryAttribute,exports.GeometryAttributes=GeometryAttributes,exports.GeometryFactory=GeometryFactory,exports.GeometryInstance=GeometryInstance,exports.GeometryInstanceAttribute=GeometryInstanceAttribute,exports.GeometryOffsetAttribute=GeometryOffsetAttribute$1,exports.GeometryPipeline=GeometryPipeline,exports.GeometryType=GeometryType$1,exports.GeometryUpdater=GeometryUpdater,exports.GeometryVisualizer=GeometryVisualizer,exports.GetFeatureInfoFormat=GetFeatureInfoFormat,exports.Globe=Globe,exports.GlobeDepth=GlobeDepth,exports.GlobeSurfaceShaderSet=GlobeSurfaceShaderSet,exports.GlobeSurfaceTile=GlobeSurfaceTile,exports.GlobeSurfaceTileProvider=GlobeSurfaceTileProvider,exports.GlobeTranslucency=GlobeTranslucency,exports.GlobeTranslucencyFramebuffer=GlobeTranslucencyFramebuffer,exports.GlobeTranslucencyState=GlobeTranslucencyState,exports.GoogleEarthEnterpriseImageryProvider=GoogleEarthEnterpriseImageryProvider,exports.GoogleEarthEnterpriseMapsProvider=GoogleEarthEnterpriseMapsProvider,exports.GoogleEarthEnterpriseMetadata=GoogleEarthEnterpriseMetadata,exports.GoogleEarthEnterpriseTerrainData=GoogleEarthEnterpriseTerrainData,exports.GoogleEarthEnterpriseTerrainProvider=GoogleEarthEnterpriseTerrainProvider,exports.GoogleEarthEnterpriseTileInformation=GoogleEarthEnterpriseTileInformation,exports.GregorianDate=GregorianDate,exports.GridImageryProvider=GridImageryProvider,exports.GridMaterialProperty=GridMaterialProperty,exports.GroundGeometryUpdater=GroundGeometryUpdater,exports.GroundPolylineGeometry=GroundPolylineGeometry,exports.GroundPolylinePrimitive=GroundPolylinePrimitive,exports.GroundPrimitive=GroundPrimitive,exports.HeadingPitchRange=HeadingPitchRange,exports.HeadingPitchRoll=HeadingPitchRoll,exports.Heap=Heap,exports.HeightReference=HeightReference$1,exports.HeightmapEncoding=HeightmapEncoding$1,exports.HeightmapTerrainData=HeightmapTerrainData,exports.HeightmapTessellator=HeightmapTessellator,exports.HermitePolynomialApproximation=HermitePolynomialApproximation,exports.HermiteSpline=HermiteSpline,exports.HomeButton=HomeButton,exports.HomeButtonViewModel=HomeButtonViewModel,exports.HorizontalOrigin=HorizontalOrigin$1,exports.Iau2000Orientation=Iau2000Orientation,exports.Iau2006XysData=Iau2006XysData,exports.Iau2006XysSample=Iau2006XysSample,exports.IauOrientationAxes=IauOrientationAxes,exports.IauOrientationParameters=IauOrientationParameters,exports.ImageMaterialProperty=ImageMaterialProperty,exports.Imagery=Imagery,exports.ImageryLayer=ImageryLayer,exports.ImageryLayerCollection=ImageryLayerCollection,exports.ImageryLayerFeatureInfo=ImageryLayerFeatureInfo,exports.ImageryProvider=ImageryProvider,exports.ImagerySplitDirection=ImagerySplitDirection$1,exports.ImageryState=ImageryState$1,exports.IndexDatatype=IndexDatatype$1,exports.InfoBox=InfoBox,exports.InfoBoxViewModel=InfoBoxViewModel,exports.InspectorShared=InspectorShared,exports.Instanced3DModel3DTileContent=Instanced3DModel3DTileContent,exports.InterpolationAlgorithm=InterpolationAlgorithm,exports.Intersect=Intersect$1,exports.IntersectionTests=IntersectionTests,exports.Intersections2D=Intersections2D,exports.Interval=Interval,exports.InvertClassification=InvertClassification,exports.Ion=Ion,exports.IonGeocoderService=IonGeocoderService,exports.IonImageryProvider=IonImageryProvider,exports.IonResource=IonResource,exports.IonWorldImageryStyle=IonWorldImageryStyle$1,exports.Iso8601=Iso8601,exports.JobScheduler=JobScheduler,exports.JobType=JobType$1,exports.JulianDate=JulianDate,exports.KeyboardEventModifier=KeyboardEventModifier$1,exports.KmlCamera=KmlCamera,exports.KmlDataSource=KmlDataSource,exports.KmlLookAt=KmlLookAt,exports.KmlTour=KmlTour,exports.KmlTourFlyTo=KmlTourFlyTo,exports.KmlTourWait=KmlTourWait,exports.Label=Label,exports.LabelCollection=LabelCollection,exports.LabelGraphics=LabelGraphics,exports.LabelStyle=LabelStyle$1,exports.LabelVisualizer=LabelVisualizer,exports.LagrangePolynomialApproximation=LagrangePolynomialApproximation,exports.LeapSecond=LeapSecond,exports.LercDecode=LercDecode,exports.Light=Light,exports.LinearApproximation=LinearApproximation,exports.LinearSpline=LinearSpline,exports.ManagedArray=ManagedArray,exports.MapMode2D=MapMode2D$1,exports.MapProjection=MapProjection,exports.MapboxImageryProvider=MapboxImageryProvider,exports.MapboxStyleImageryProvider=MapboxStyleImageryProvider,exports.Material=Material,exports.MaterialAppearance=MaterialAppearance,exports.MaterialProperty=MaterialProperty,exports.Math=CesiumMath,exports.Matrix2=Matrix2,exports.Matrix3=Matrix3,exports.Matrix4=Matrix4,exports.MipmapHint=MipmapHint$1,exports.Model=Model,exports.ModelAnimation=ModelAnimation,exports.ModelAnimationCache=ModelAnimationCache,exports.ModelAnimationCollection=ModelAnimationCollection,exports.ModelAnimationLoop=ModelAnimationLoop$1,exports.ModelAnimationState=ModelAnimationState,exports.ModelGraphics=ModelGraphics,exports.ModelInstance=ModelInstance,exports.ModelInstanceCollection=ModelInstanceCollection,exports.ModelLoadResources=ModelLoadResources,exports.ModelMaterial=ModelMaterial,exports.ModelMesh=ModelMesh,exports.ModelNode=ModelNode,exports.ModelOutlineLoader=ModelOutlineLoader,exports.ModelUtility=ModelUtility,exports.ModelVisualizer=ModelVisualizer,exports.Moon=Moon,exports.NavigationHelpButton=NavigationHelpButton,exports.NavigationHelpButtonViewModel=NavigationHelpButtonViewModel,exports.NearFarScalar=NearFarScalar,exports.NeverTileDiscardPolicy=NeverTileDiscardPolicy,exports.NoSleep=NoSleep,exports.NodeTransformationProperty=NodeTransformationProperty,exports.OIT=OIT,exports.Occluder=Occluder,exports.OctahedralProjectedCubeMap=OctahedralProjectedCubeMap,exports.OffsetGeometryInstanceAttribute=OffsetGeometryInstanceAttribute,exports.OpenCageGeocoderService=OpenCageGeocoderService,exports.OpenStreetMapImageryProvider=OpenStreetMapImageryProvider,exports.OrderedGroundPrimitiveCollection=OrderedGroundPrimitiveCollection,exports.OrientedBoundingBox=OrientedBoundingBox,exports.OrthographicFrustum=OrthographicFrustum,exports.OrthographicOffCenterFrustum=OrthographicOffCenterFrustum,exports.Packable=Packable,exports.PackableForInterpolation=PackableForInterpolation,exports.Particle=Particle,exports.ParticleBurst=ParticleBurst,exports.ParticleEmitter=ParticleEmitter,exports.ParticleSystem=ParticleSystem,exports.Pass=Pass$1,exports.PassState=PassState,exports.PathGraphics=PathGraphics,exports.PathVisualizer=PathVisualizer,exports.PeliasGeocoderService=PeliasGeocoderService,exports.PerInstanceColorAppearance=PerInstanceColorAppearance,exports.PerformanceDisplay=PerformanceDisplay,exports.PerformanceWatchdog=PerformanceWatchdog,exports.PerformanceWatchdogViewModel=PerformanceWatchdogViewModel,exports.PerspectiveFrustum=PerspectiveFrustum,exports.PerspectiveOffCenterFrustum=PerspectiveOffCenterFrustum,exports.PickDepth=PickDepth,exports.PickDepthFramebuffer=PickDepthFramebuffer,exports.PickFramebuffer=PickFramebuffer,exports.Picking=Picking,exports.PinBuilder=PinBuilder,exports.PixelDatatype=PixelDatatype$1,exports.PixelFormat=PixelFormat$1,exports.Plane=Plane,exports.PlaneGeometry=PlaneGeometry,exports.PlaneGeometryUpdater=PlaneGeometryUpdater,exports.PlaneGraphics=PlaneGraphics,exports.PlaneOutlineGeometry=PlaneOutlineGeometry,exports.PointCloud=PointCloud,exports.PointCloud3DTileContent=PointCloud3DTileContent,exports.PointCloudEyeDomeLighting=PointCloudEyeDomeLighting,exports.PointCloudShading=PointCloudShading,exports.PointGraphics=PointGraphics,exports.PointPrimitive=PointPrimitive,exports.PointPrimitiveCollection=PointPrimitiveCollection,exports.PointVisualizer=PointVisualizer,exports.PolygonGeometry=PolygonGeometry,exports.PolygonGeometryLibrary=PolygonGeometryLibrary,exports.PolygonGeometryUpdater=PolygonGeometryUpdater,exports.PolygonGraphics=PolygonGraphics,exports.PolygonHierarchy=PolygonHierarchy,exports.PolygonOutlineGeometry=PolygonOutlineGeometry,exports.PolygonPipeline=PolygonPipeline,exports.Polyline=Polyline,exports.PolylineArrowMaterialProperty=PolylineArrowMaterialProperty,exports.PolylineCollection=PolylineCollection,exports.PolylineColorAppearance=PolylineColorAppearance,exports.PolylineDashMaterialProperty=PolylineDashMaterialProperty,exports.PolylineGeometry=PolylineGeometry,exports.PolylineGeometryUpdater=PolylineGeometryUpdater,exports.PolylineGlowMaterialProperty=PolylineGlowMaterialProperty,exports.PolylineGraphics=PolylineGraphics,exports.PolylineMaterialAppearance=PolylineMaterialAppearance,exports.PolylineOutlineMaterialProperty=PolylineOutlineMaterialProperty,exports.PolylinePipeline=PolylinePipeline,exports.PolylineVisualizer=PolylineVisualizer,exports.PolylineVolumeGeometry=PolylineVolumeGeometry,exports.PolylineVolumeGeometryLibrary=PolylineVolumeGeometryLibrary,exports.PolylineVolumeGeometryUpdater=PolylineVolumeGeometryUpdater,exports.PolylineVolumeGraphics=PolylineVolumeGraphics,exports.PolylineVolumeOutlineGeometry=PolylineVolumeOutlineGeometry,exports.PositionProperty=PositionProperty,exports.PositionPropertyArray=PositionPropertyArray,exports.PostProcessStage=PostProcessStage,exports.PostProcessStageCollection=PostProcessStageCollection,exports.PostProcessStageComposite=PostProcessStageComposite,exports.PostProcessStageLibrary=PostProcessStageLibrary,exports.PostProcessStageSampleMode=PostProcessStageSampleMode,exports.PostProcessStageTextureCache=PostProcessStageTextureCache,exports.Primitive=Primitive,exports.PrimitiveCollection=PrimitiveCollection,exports.PrimitivePipeline=PrimitivePipeline,exports.PrimitiveState=PrimitiveState$1,exports.PrimitiveType=PrimitiveType$1,exports.ProjectionPicker=ProjectionPicker,exports.ProjectionPickerViewModel=ProjectionPickerViewModel,exports.Property=Property,exports.PropertyArray=PropertyArray,exports.PropertyBag=PropertyBag,exports.ProviderViewModel=ProviderViewModel,exports.Proxy=Proxy,exports.QuadraticRealPolynomial=QuadraticRealPolynomial,exports.QuadtreeOccluders=QuadtreeOccluders,exports.QuadtreePrimitive=QuadtreePrimitive,exports.QuadtreeTile=QuadtreeTile,exports.QuadtreeTileLoadState=QuadtreeTileLoadState$1,exports.QuadtreeTileProvider=QuadtreeTileProvider,exports.QuantizedMeshTerrainData=QuantizedMeshTerrainData,exports.QuarticRealPolynomial=QuarticRealPolynomial,exports.Quaternion=Quaternion,exports.QuaternionSpline=QuaternionSpline,exports.Queue=Queue,exports.Ray=Ray,exports.Rectangle=Rectangle,exports.RectangleCollisionChecker=RectangleCollisionChecker,exports.RectangleGeometry=RectangleGeometry,exports.RectangleGeometryLibrary=RectangleGeometryLibrary,exports.RectangleGeometryUpdater=RectangleGeometryUpdater,exports.RectangleGraphics=RectangleGraphics,exports.RectangleOutlineGeometry=RectangleOutlineGeometry,exports.ReferenceFrame=ReferenceFrame$1,exports.ReferenceProperty=ReferenceProperty,exports.RenderState=RenderState,exports.Renderbuffer=Renderbuffer,exports.RenderbufferFormat=RenderbufferFormat$1,exports.Request=Request,exports.RequestErrorEvent=RequestErrorEvent,exports.RequestScheduler=RequestScheduler,exports.RequestState=RequestState$1,exports.RequestType=RequestType$1,exports.Resource=Resource,exports.Rotation=Rotation,exports.RuntimeError=RuntimeError,exports.SDFSettings=SDFSettings$1,exports.SampledPositionProperty=SampledPositionProperty,exports.SampledProperty=SampledProperty,exports.Sampler=Sampler,exports.ScaledPositionProperty=ScaledPositionProperty,exports.Scene=Scene,exports.SceneFramebuffer=SceneFramebuffer,exports.SceneMode=SceneMode$1,exports.SceneModePicker=SceneModePicker,exports.SceneModePickerViewModel=SceneModePickerViewModel,exports.SceneTransforms=SceneTransforms,exports.SceneTransitioner=SceneTransitioner,exports.ScreenSpaceCameraController=ScreenSpaceCameraController,exports.ScreenSpaceEventHandler=ScreenSpaceEventHandler,exports.ScreenSpaceEventType=ScreenSpaceEventType$1,exports.SelectionIndicator=SelectionIndicator,exports.SelectionIndicatorViewModel=SelectionIndicatorViewModel,exports.ShaderCache=ShaderCache,exports.ShaderProgram=ShaderProgram,exports.ShaderSource=ShaderSource,exports.ShadowMap=ShadowMap,exports.ShadowMapShader=ShadowMapShader,exports.ShadowMode=ShadowMode$1,exports.ShadowVolumeAppearance=ShadowVolumeAppearance,exports.ShowGeometryInstanceAttribute=ShowGeometryInstanceAttribute,exports.Simon1994PlanetaryPositions=Simon1994PlanetaryPositions,exports.SimplePolylineGeometry=SimplePolylineGeometry,exports.SingleTileImageryProvider=SingleTileImageryProvider,exports.SkyAtmosphere=SkyAtmosphere,exports.SkyBox=SkyBox,exports.SphereEmitter=SphereEmitter,exports.SphereGeometry=SphereGeometry,exports.SphereOutlineGeometry=SphereOutlineGeometry,exports.Spherical=Spherical,exports.Spline=Spline,exports.StaticGeometryColorBatch=StaticGeometryColorBatch,exports.StaticGeometryPerMaterialBatch=StaticGeometryPerMaterialBatch,exports.StaticGroundGeometryColorBatch=StaticGroundGeometryColorBatch,exports.StaticGroundGeometryPerMaterialBatch=StaticGroundGeometryPerMaterialBatch,exports.StaticGroundPolylinePerMaterialBatch=StaticGroundPolylinePerMaterialBatch,exports.StaticOutlineGeometryBatch=StaticOutlineGeometryBatch,exports.StencilConstants=StencilConstants$1,exports.StencilFunction=StencilFunction$1,exports.StencilOperation=StencilOperation$1,exports.StripeMaterialProperty=StripeMaterialProperty,exports.StripeOrientation=StripeOrientation$1,exports.StyleExpression=StyleExpression,exports.Sun=Sun,exports.SunLight=SunLight,exports.SunPostProcess=SunPostProcess,exports.SvgPathBindingHandler=SvgPathBindingHandler,exports.TaskProcessor=TaskProcessor,exports.TerrainData=TerrainData,exports.TerrainEncoding=TerrainEncoding,exports.TerrainFillMesh=TerrainFillMesh,exports.TerrainMesh=TerrainMesh,exports.TerrainOffsetProperty=TerrainOffsetProperty,exports.TerrainProvider=TerrainProvider,exports.TerrainQuantization=TerrainQuantization$1,exports.TerrainState=TerrainState$1,exports.Texture=Texture,exports.TextureAtlas=TextureAtlas,exports.TextureCache=TextureCache,exports.TextureMagnificationFilter=TextureMagnificationFilter$1,exports.TextureMinificationFilter=TextureMinificationFilter$1,exports.TextureWrap=TextureWrap$1,exports.TileAvailability=TileAvailability,exports.TileBoundingRegion=TileBoundingRegion,exports.TileBoundingSphere=TileBoundingSphere,exports.TileBoundingVolume=TileBoundingVolume,exports.TileCoordinatesImageryProvider=TileCoordinatesImageryProvider,exports.TileDiscardPolicy=TileDiscardPolicy,exports.TileEdge=TileEdge,exports.TileImagery=TileImagery,exports.TileMapServiceImageryProvider=TileMapServiceImageryProvider,exports.TileOrientedBoundingBox=TileOrientedBoundingBox,exports.TileProviderError=TileProviderError,exports.TileReplacementQueue=TileReplacementQueue,exports.TileSelectionResult=TileSelectionResult,exports.TileState=TileState$1,exports.Tileset3DTileContent=Tileset3DTileContent,exports.TilingScheme=TilingScheme,exports.TimeConstants=TimeConstants$1,exports.TimeDynamicImagery=TimeDynamicImagery,exports.TimeDynamicPointCloud=TimeDynamicPointCloud,exports.TimeInterval=TimeInterval,exports.TimeIntervalCollection=TimeIntervalCollection,exports.TimeIntervalCollectionPositionProperty=TimeIntervalCollectionPositionProperty,exports.TimeIntervalCollectionProperty=TimeIntervalCollectionProperty,exports.TimeStandard=TimeStandard$1,exports.Timeline=Timeline,exports.TimelineHighlightRange=TimelineHighlightRange,exports.TimelineTrack=TimelineTrack,exports.Tipsify=Tipsify,exports.ToggleButtonViewModel=ToggleButtonViewModel,exports.Tonemapper=Tonemapper$1,exports.Transforms=Transforms,exports.TranslationRotationScale=TranslationRotationScale,exports.TranslucentTileClassification=TranslucentTileClassification,exports.TridiagonalSystemSolver=TridiagonalSystemSolver,exports.TrustedServers=TrustedServers,exports.Tween=TWEEN,exports.TweenCollection=TweenCollection,exports.UniformState=UniformState,exports.Uri=URI,exports.UrlTemplateImageryProvider=UrlTemplateImageryProvider,exports.VERSION=VERSION,exports.VRButton=VRButton,exports.VRButtonViewModel=VRButtonViewModel,exports.VRTheWorldTerrainProvider=VRTheWorldTerrainProvider,exports.Vector3DTileBatch=Vector3DTileBatch,exports.Vector3DTileClampedPolylines=Vector3DTileClampedPolylines,exports.Vector3DTileContent=Vector3DTileContent,exports.Vector3DTileGeometry=Vector3DTileGeometry,exports.Vector3DTilePoints=Vector3DTilePoints,exports.Vector3DTilePolygons=Vector3DTilePolygons,exports.Vector3DTilePolylines=Vector3DTilePolylines,exports.Vector3DTilePrimitive=Vector3DTilePrimitive,exports.VelocityOrientationProperty=VelocityOrientationProperty,exports.VelocityVectorProperty=VelocityVectorProperty,exports.VertexArray=VertexArray,exports.VertexArrayFacade=VertexArrayFacade,exports.VertexFormat=VertexFormat,exports.VerticalOrigin=VerticalOrigin$1,exports.VideoSynchronizer=VideoSynchronizer,exports.View=View,exports.Viewer=Viewer,exports.ViewportQuad=ViewportQuad,exports.Visibility=Visibility$1,exports.Visualizer=Visualizer,exports.WallGeometry=WallGeometry,exports.WallGeometryLibrary=WallGeometryLibrary,exports.WallGeometryUpdater=WallGeometryUpdater,exports.WallGraphics=WallGraphics,exports.WallOutlineGeometry=WallOutlineGeometry,exports.WebGLConstants=WebGLConstants$1,exports.WebMapServiceImageryProvider=WebMapServiceImageryProvider,exports.WebMapTileServiceImageryProvider=WebMapTileServiceImageryProvider,exports.WebMercatorProjection=WebMercatorProjection,exports.WebMercatorTilingScheme=WebMercatorTilingScheme,exports.WeightSpline=WeightSpline,exports.WindingOrder=WindingOrder$1,exports._shadersAcesTonemappingStage=AcesTonemapping,exports._shadersAdditiveBlend=AdditiveBlend,exports._shadersAdjustTranslucentFS=AdjustTranslucentFS,exports._shadersAllMaterialAppearanceFS=AllMaterialAppearanceFS,exports._shadersAllMaterialAppearanceVS=AllMaterialAppearanceVS,exports._shadersAmbientOcclusionGenerate=AmbientOcclusionGenerate,exports._shadersAmbientOcclusionModulate=AmbientOcclusionModulate,exports._shadersAspectRampMaterial=AspectRampMaterial,exports._shadersBasicMaterialAppearanceFS=BasicMaterialAppearanceFS,exports._shadersBasicMaterialAppearanceVS=BasicMaterialAppearanceVS,exports._shadersBillboardCollectionFS=BillboardCollectionFS,exports._shadersBillboardCollectionVS=BillboardCollectionVS,exports._shadersBlackAndWhite=BlackAndWhite,exports._shadersBloomComposite=BloomComposite,exports._shadersBrdfLutGeneratorFS=BrdfLutGeneratorFS,exports._shadersBrightPass=BrightPass,exports._shadersBrightness=Brightness,exports._shadersBumpMapMaterial=BumpMapMaterial,exports._shadersCheckerboardMaterial=CheckerboardMaterial,exports._shadersCompareAndPackTranslucentDepth=CompareAndPackTranslucentDepth,exports._shadersCompositeOITFS=CompositeOITFS,exports._shadersCompositeTranslucentClassification=CompositeTranslucentClassification,exports._shadersContrastBias=ContrastBias,exports._shadersCzmBuiltins=CzmBuiltins,exports._shadersDepthOfField=DepthOfField,exports._shadersDepthPlaneFS=DepthPlaneFS,exports._shadersDepthPlaneVS=DepthPlaneVS,exports._shadersDepthView=DepthView,exports._shadersDepthViewPacked=DepthViewPacked,exports._shadersDotMaterial=DotMaterial,exports._shadersEdgeDetection=EdgeDetection,exports._shadersElevationBandMaterial=ElevationBandMaterial,exports._shadersElevationContourMaterial=ElevationContourMaterial,exports._shadersElevationRampMaterial=ElevationRampMaterial,exports._shadersEllipsoidFS=EllipsoidFS,exports._shadersEllipsoidSurfaceAppearanceFS=EllipsoidSurfaceAppearanceFS,exports._shadersEllipsoidSurfaceAppearanceVS=EllipsoidSurfaceAppearanceVS,exports._shadersEllipsoidVS=EllipsoidVS,exports._shadersFXAA=FXAA,exports._shadersFadeMaterial=FadeMaterial,exports._shadersFilmicTonemapping=FilmicTonemapping,exports._shadersGaussianBlur1D=GaussianBlur1D,exports._shadersGlobeFS=GlobeFS,exports._shadersGlobeVS=GlobeVS,exports._shadersGridMaterial=GridMaterial,exports._shadersGroundAtmosphere=GroundAtmosphere,exports._shadersHSBToRGB=czm_HSBToRGB,exports._shadersHSLToRGB=czm_HSLToRGB,exports._shadersLensFlare=LensFlare,exports._shadersModifiedReinhardTonemapping=ModifiedReinhardTonemapping,exports._shadersNightVision=NightVision,exports._shadersNormalMapMaterial=NormalMapMaterial,exports._shadersOctahedralProjectionAtlasFS=OctahedralProjectionAtlasFS,exports._shadersOctahedralProjectionFS=OctahedralProjectionFS,exports._shadersOctahedralProjectionVS=OctahedralProjectionVS,exports._shadersPassThrough=PassThrough,exports._shadersPassThroughDepth=PassThroughDepth,exports._shadersPerInstanceColorAppearanceFS=PerInstanceColorAppearanceFS,exports._shadersPerInstanceColorAppearanceVS=PerInstanceColorAppearanceVS,exports._shadersPerInstanceFlatColorAppearanceFS=PerInstanceFlatColorAppearanceFS,exports._shadersPerInstanceFlatColorAppearanceVS=PerInstanceFlatColorAppearanceVS,exports._shadersPointCloudEyeDomeLighting=PointCloudEyeDomeLightingShader,exports._shadersPointPrimitiveCollectionFS=PointPrimitiveCollectionFS,exports._shadersPointPrimitiveCollectionVS=PointPrimitiveCollectionVS,exports._shadersPolylineArrowMaterial=PolylineArrowMaterial,exports._shadersPolylineColorAppearanceVS=PolylineColorAppearanceVS,exports._shadersPolylineCommon=PolylineCommon,exports._shadersPolylineDashMaterial=PolylineDashMaterial,exports._shadersPolylineFS=PolylineFS$1,exports._shadersPolylineGlowMaterial=PolylineGlowMaterial,exports._shadersPolylineMaterialAppearanceVS=PolylineMaterialAppearanceVS,exports._shadersPolylineOutlineMaterial=PolylineOutlineMaterial,exports._shadersPolylineShadowVolumeFS=PolylineShadowVolumeFS,exports._shadersPolylineShadowVolumeMorphFS=PolylineShadowVolumeMorphFS,exports._shadersPolylineShadowVolumeMorphVS=PolylineShadowVolumeMorphVS,exports._shadersPolylineShadowVolumeVS=PolylineShadowVolumeVS,exports._shadersPolylineVS=PolylineVS,exports._shadersRGBToHSB=czm_RGBToHSB,exports._shadersRGBToHSL=czm_RGBToHSL,exports._shadersRGBToXYZ=czm_RGBToXYZ,exports._shadersReinhardTonemapping=ReinhardTonemapping,exports._shadersReprojectWebMercatorFS=ReprojectWebMercatorFS,exports._shadersReprojectWebMercatorVS=ReprojectWebMercatorVS,exports._shadersRimLightingMaterial=RimLightingMaterial,exports._shadersShadowVolumeAppearanceFS=ShadowVolumeAppearanceFS,exports._shadersShadowVolumeAppearanceVS=ShadowVolumeAppearanceVS,exports._shadersShadowVolumeFS=ShadowVolumeFS,exports._shadersSilhouette=Silhouette,exports._shadersSkyAtmosphereCommon=SkyAtmosphereCommon,exports._shadersSkyAtmosphereFS=SkyAtmosphereFS,exports._shadersSkyAtmosphereVS=SkyAtmosphereVS,exports._shadersSkyBoxFS=SkyBoxFS,exports._shadersSkyBoxVS=SkyBoxVS,exports._shadersSlopeRampMaterial=SlopeRampMaterial,exports._shadersStripeMaterial=StripeMaterial,exports._shadersSunFS=SunFS,exports._shadersSunTextureFS=SunTextureFS,exports._shadersSunVS=SunVS,exports._shadersTexturedMaterialAppearanceFS=TexturedMaterialAppearanceFS,exports._shadersTexturedMaterialAppearanceVS=TexturedMaterialAppearanceVS,exports._shadersVector3DTileClampedPolylinesFS=Vector3DTileClampedPolylinesFS,exports._shadersVector3DTileClampedPolylinesVS=Vector3DTileClampedPolylinesVS,exports._shadersVector3DTilePolylinesVS=Vector3DTilePolylinesVS,exports._shadersVectorTileVS=VectorTileVS,exports._shadersViewportQuadFS=ViewportQuadFS,exports._shadersViewportQuadVS=ViewportQuadVS,exports._shadersWater=WaterMaterial,exports._shadersXYZToRGB=czm_XYZToRGB,exports._shadersacesTonemapping=czm_acesTonemapping,exports._shadersalphaWeight=czm_alphaWeight,exports._shadersantialias=czm_antialias,exports._shadersapproximateSphericalCoordinates=czm_approximateSphericalCoordinates,exports._shadersbackFacing=czm_backFacing,exports._shadersbranchFreeTernary=czm_branchFreeTernary,exports._shaderscascadeColor=czm_cascadeColor,exports._shaderscascadeDistance=czm_cascadeDistance,exports._shaderscascadeMatrix=czm_cascadeMatrix,exports._shaderscascadeWeights=czm_cascadeWeights,exports._shaderscolumbusViewMorph=czm_columbusViewMorph,exports._shaderscomputePosition=czm_computePosition,exports._shaderscosineAndSine=czm_cosineAndSine,exports._shadersdecompressTextureCoordinates=czm_decompressTextureCoordinates,exports._shadersdegreesPerRadian=czm_degreesPerRadian,exports._shadersdepthClamp=czm_depthClamp,exports._shadersdepthRange=czm_depthRange,exports._shadersdepthRangeStruct=czm_depthRangeStruct,exports._shaderseastNorthUpToEyeCoordinates=czm_eastNorthUpToEyeCoordinates,exports._shadersellipsoidContainsPoint=czm_ellipsoidContainsPoint,exports._shadersellipsoidWgs84TextureCoordinates=czm_ellipsoidWgs84TextureCoordinates,exports._shadersepsilon1=czm_epsilon1,exports._shadersepsilon2=czm_epsilon2,exports._shadersepsilon3=czm_epsilon3,exports._shadersepsilon4=czm_epsilon4,exports._shadersepsilon5=czm_epsilon5,exports._shadersepsilon6=czm_epsilon6,exports._shadersepsilon7=czm_epsilon7,exports._shadersequalsEpsilon=czm_equalsEpsilon,exports._shaderseyeOffset=czm_eyeOffset,exports._shaderseyeToWindowCoordinates=czm_eyeToWindowCoordinates,exports._shadersfastApproximateAtan=czm_fastApproximateAtan,exports._shadersfog=czm_fog,exports._shadersgammaCorrect=czm_gammaCorrect,exports._shadersgeodeticSurfaceNormal=czm_geodeticSurfaceNormal,exports._shadersgetDefaultMaterial=czm_getDefaultMaterial,exports._shadersgetLambertDiffuse=czm_getLambertDiffuse,exports._shadersgetSpecular=czm_getSpecular,exports._shadersgetWaterNoise=czm_getWaterNoise,exports._shadershue=czm_hue,exports._shadersinfinity=czm_infinity,exports._shadersinverseGamma=czm_inverseGamma,exports._shadersisEmpty=czm_isEmpty,exports._shadersisFull=czm_isFull,exports._shaderslatitudeToWebMercatorFraction=czm_latitudeToWebMercatorFraction,exports._shaderslineDistance=czm_lineDistance,exports._shadersluminance=czm_luminance,exports._shadersmaterial=czm_material,exports._shadersmaterialInput=czm_materialInput,exports._shadersmetersPerPixel=czm_metersPerPixel,exports._shadersmodelToWindowCoordinates=czm_modelToWindowCoordinates,exports._shadersmultiplyWithColorBalance=czm_multiplyWithColorBalance,exports._shadersnearFarScalar=czm_nearFarScalar,exports._shadersoctDecode=czm_octDecode,exports._shadersoneOverPi=czm_oneOverPi,exports._shadersoneOverTwoPi=czm_oneOverTwoPi,exports._shaderspackDepth=czm_packDepth,exports._shaderspassCesium3DTile=czm_passCesium3DTile,exports._shaderspassCesium3DTileClassification=czm_passCesium3DTileClassification,exports._shaderspassCesium3DTileClassificationIgnoreShow=czm_passCesium3DTileClassificationIgnoreShow,exports._shaderspassClassification=czm_passClassification,exports._shaderspassCompute=czm_passCompute,exports._shaderspassEnvironment=czm_passEnvironment,exports._shaderspassGlobe=czm_passGlobe,exports._shaderspassOpaque=czm_passOpaque,exports._shaderspassOverlay=czm_passOverlay,exports._shaderspassTerrainClassification=czm_passTerrainClassification,exports._shaderspassTranslucent=czm_passTranslucent,exports._shadersphong=czm_phong,exports._shaderspi=czm_pi,exports._shaderspiOverFour=czm_piOverFour,exports._shaderspiOverSix=czm_piOverSix,exports._shaderspiOverThree=czm_piOverThree,exports._shaderspiOverTwo=czm_piOverTwo,exports._shadersplaneDistance=czm_planeDistance,exports._shaderspointAlongRay=czm_pointAlongRay,exports._shadersradiansPerDegree=czm_radiansPerDegree;exports._shadersray=czm_ray,exports._shadersrayEllipsoidIntersectionInterval=czm_rayEllipsoidIntersectionInterval,exports._shadersraySegment=czm_raySegment,exports._shadersreadDepth=czm_readDepth,exports._shadersreadNonPerspective=czm_readNonPerspective,exports._shadersreverseLogDepth=czm_reverseLogDepth,exports._shaderssampleOctahedralProjection=czm_sampleOctahedralProjection,exports._shaderssaturation=czm_saturation,exports._shaderssceneMode2D=czm_sceneMode2D,exports._shaderssceneMode3D=czm_sceneMode3D,exports._shaderssceneModeColumbusView=czm_sceneModeColumbusView,exports._shaderssceneModeMorphing=czm_sceneModeMorphing,exports._shadersshadowDepthCompare=czm_shadowDepthCompare,exports._shadersshadowParameters=czm_shadowParameters,exports._shadersshadowVisibility=czm_shadowVisibility,exports._shaderssignNotZero=czm_signNotZero,exports._shaderssolarRadius=czm_solarRadius,exports._shaderssphericalHarmonics=czm_sphericalHarmonics,exports._shaderstangentToEyeSpaceMatrix=czm_tangentToEyeSpaceMatrix,exports._shadersthreePiOver2=czm_threePiOver2,exports._shaderstransformPlane=czm_transformPlane,exports._shaderstranslateRelativeToEye=czm_translateRelativeToEye,exports._shaderstranslucentPhong=czm_translucentPhong,exports._shaderstranspose=czm_transpose,exports._shaderstwoPi=czm_twoPi,exports._shadersunpackDepth=czm_unpackDepth,exports._shadersunpackFloat=czm_unpackFloat,exports._shadersvertexLogDepth=czm_vertexLogDepth,exports._shaderswebMercatorMaxLatitude=czm_webMercatorMaxLatitude,exports._shaderswindowToEyeCoordinates=czm_windowToEyeCoordinates,exports._shaderswriteDepthClamp=czm_writeDepthClamp,exports._shaderswriteLogDepth=czm_writeLogDepth,exports._shaderswriteNonPerspective=czm_writeNonPerspective,exports.addBuffer=addBuffer,exports.addDefaults=addDefaults,exports.addExtensionsRequired=addExtensionsRequired,exports.addExtensionsUsed=addExtensionsUsed,exports.addPipelineExtras=addPipelineExtras,exports.addToArray=addToArray,exports.appendForwardSlash=appendForwardSlash,exports.arrayFill=arrayFill,exports.arrayRemoveDuplicates=arrayRemoveDuplicates,exports.arraySlice=arraySlice,exports.barycentricCoordinates=barycentricCoordinates,exports.binarySearch=binarySearch,exports.bitmap_sdf=calcSDF,exports.buildModuleUrl=buildModuleUrl,exports.cancelAnimationFrame=cancelAnimationFramePolyfill,exports.clone=clone$1,exports.combine=combine$2,exports.computeFlyToLocationForRectangle=computeFlyToLocationForRectangle,exports.createBillboardPointCallback=createBillboardPointCallback,exports.createCommand=createCommand,exports.createDefaultImageryProviderViewModels=createDefaultImageryProviderViewModels,exports.createDefaultTerrainProviderViewModels=createDefaultTerrainProviderViewModels,exports.createElevationBandMaterial=createElevationBandMaterial,exports.createGuid=createGuid,exports.createMaterialPropertyDescriptor=createMaterialPropertyDescriptor,exports.createOsmBuildings=createOsmBuildings,exports.createPropertyDescriptor=createPropertyDescriptor,exports.createRawPropertyDescriptor=createRawPropertyDescriptor,exports.createTangentSpaceDebugPrimitive=createTangentSpaceDebugPrimitive,exports.createTaskProcessorWorker=createTaskProcessorWorker,exports.createUniform=createUniform,exports.createUniformArray=createUniformArray,exports.createWorldImagery=createWorldImagery,exports.createWorldTerrain=createWorldTerrain,exports.decodeGoogleEarthEnterpriseData=decodeGoogleEarthEnterpriseData,exports.decodeVectorPolylinePositions=decodeVectorPolylinePositions,exports.defaultValue=defaultValue,exports.defined=defined,exports.deprecationWarning=deprecationWarning,exports.destroyObject=destroyObject,exports.earcut_2_2_1=earcut,exports.exportKml=exportKml,exports.findAccessorMinMax=findAccessorMinMax,exports.formatError=formatError,exports.freezeRenderState=freezeRenderState,exports.getAbsoluteUri=getAbsoluteUri,exports.getAccessorByteStride=getAccessorByteStride,exports.getBaseUri=getBaseUri,exports.getBinaryAccessor=getBinaryAccessor,exports.getClipAndStyleCode=getClipAndStyleCode,exports.getClippingFunction=getClippingFunction,exports.getComponentReader=getComponentReader,exports.getElement=getElement,exports.getExtensionFromUri=getExtensionFromUri,exports.getFilenameFromUri=getFilenameFromUri,exports.getImagePixels=getImagePixels,exports.getJsonFromTypedArray=getJsonFromTypedArray,exports.getMagic=getMagic,exports.getStringFromTypedArray=getStringFromTypedArray,exports.getTimestamp=getTimestamp$1,exports.graphemesplitter=GraphemeSplitter,exports.hasExtension=hasExtension,exports.heightReferenceOnEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,exports.isBitSet=isBitSet,exports.isBlobUri=isBlobUri,exports.isCrossOriginUrl=isCrossOriginUrl,exports.isDataUri=isDataUri,exports.isLeapYear=isLeapYear,exports.jsep=jsep,exports.kdbush=kdbush,exports.knockout=knockout,exports.knockout_3_5_1=knockout,exports.knockout_es5=knockout_es5,exports.loadAndExecuteScript=loadAndExecuteScript,exports.loadCRN=loadCRN,exports.loadCubeMap=loadCubeMap,exports.loadImageFromTypedArray=loadImageFromTypedArray,exports.loadKTX=loadKTX,exports.measureText=measureText,exports.mergeSort=mergeSort,exports.mersenne_twister=MersenneTwister,exports.modernizeShader=modernizeShader,exports.moveTechniqueRenderStates=moveTechniqueRenderStates,exports.moveTechniquesToExtension=moveTechniquesToExtension,exports.numberOfComponentsForType=numberOfComponentsForType,exports.objectToQuery=objectToQuery,exports.oneTimeWarning=oneTimeWarning,exports.parseGlb=parseGlb,exports.parseResponseHeaders=parseResponseHeaders,exports.pointInsideTriangle=pointInsideTriangle,exports.processModelMaterialsCommon=processModelMaterialsCommon,exports.processPbrMaterials=processPbrMaterials,exports.protobuf_minimal=protobuf,exports.purify=purify,exports.queryToObject=queryToObject,exports.quickselect=quickselect,exports.rbush=RBush,exports.readAccessorPacked=readAccessorPacked,exports.removeExtensionsRequired=removeExtensionsRequired,exports.removeExtensionsUsed=removeExtensionsUsed,exports.removePipelineExtras=removePipelineExtras,exports.removeUnusedElements=removeUnusedElements,exports.requestAnimationFrame=requestAnimationFramePolyFill,exports.sampleTerrain=sampleTerrain,exports.sampleTerrainMostDetailed=sampleTerrainMostDetailed,exports.scaleToGeodeticSurface=scaleToGeodeticSurface,exports.sprintf=sprintf,exports.subdivideArray=subdivideArray,exports.subscribeAndEvaluate=subscribeAndEvaluate,exports.topojson=topojson,exports.updateAccessorComponentTypes=updateAccessorComponentTypes,exports.updateVersion=updateVersion,exports.viewerCesium3DTilesInspectorMixin=viewerCesium3DTilesInspectorMixin,exports.viewerCesiumInspectorMixin=viewerCesiumInspectorMixin,exports.viewerDragDropMixin=viewerDragDropMixin,exports.viewerPerformanceWatchdogMixin=viewerPerformanceWatchdogMixin,exports.webGLConstantToGlslType=webGLConstantToGlslType,exports.when=when,exports.wrapFunction=wrapFunction,exports.writeTextToCanvas=writeTextToCanvas,exports.zip=zip,Object.defineProperty(exports,"__esModule",{value:!0})}); diff --git a/public/Cesium/ThirdParty/Workers/deflate.js b/public/Cesium/ThirdParty/Workers/deflate.js index 613e4eb..736cace 100644 --- a/public/Cesium/ThirdParty/Workers/deflate.js +++ b/public/Cesium/ThirdParty/Workers/deflate.js @@ -1 +1 @@ -!function(e){var h=15,dt=256,p=573,st=256,lt=-2,ct=-5,n=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ht(){var c=this;function u(t,e,n){for(var a,i,r=[],_=0,o=1;o<=h;o++)r[o]=_=_+n[o-1]<<1;for(a=0;a<=e;a++)0!==(i=t[2*a+1])&&(t[2*a]=function(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}(r[i]++,i))}c.build_tree=function(t){var e,n,a,i=c.dyn_tree,r=c.stat_desc.static_tree,_=c.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=p,e=0;e<_;e++)0!==i[2*e]?(t.heap[++t.heap_len]=o=e,t.depth[e]=0):i[2*e+1]=0;for(;t.heap_len<2;)i[2*(a=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[a]=0,t.opt_len--,r&&(t.static_len-=r[2*a+1]);for(c.max_code=o,e=Math.floor(t.heap_len/2);1<=e;e--)t.pqdownheap(i,e);for(a=_;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],t.pqdownheap(i,1),n=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=n,i[2*a]=i[2*e]+i[2*n],t.depth[a]=Math.max(t.depth[e],t.depth[n])+1,i[2*e+1]=i[2*n+1]=a,t.heap[1]=a++,t.pqdownheap(i,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t){for(var e,n,a,i,r,_=c.dyn_tree,o=c.stat_desc.static_tree,u=c.stat_desc.extra_bits,f=c.stat_desc.extra_base,d=c.stat_desc.max_length,s=0,l=0;l<=h;l++)t.bl_count[l]=0;for(_[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<p;e++)d<(l=_[2*_[2*(n=t.heap[e])+1]+1]+1)&&(l=d,s++),_[2*n+1]=l,n>c.max_code||(t.bl_count[l]++,i=0,f<=n&&(i=u[n-f]),r=_[2*n],t.opt_len+=r*(l+i),o&&(t.static_len+=r*(o[2*n+1]+i)));if(0!==s){do{for(l=d-1;0===t.bl_count[l];)l--}while(t.bl_count[l]--,t.bl_count[l+1]+=2,t.bl_count[d]--,0<(s-=2));for(l=d;0!==l;l--)for(n=t.bl_count[l];0!==n;)(a=t.heap[--e])>c.max_code||(_[2*a+1]!=l&&(t.opt_len+=(l-_[2*a+1])*_[2*a],_[2*a+1]=l),n--)}}(t),u(i,c.max_code,t.bl_count)}}function pt(t,e,n,a,i){var r=this;r.static_tree=t,r.extra_bits=e,r.extra_base=n,r.elems=a,r.max_length=i}ht._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],ht.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],ht.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],ht.d_code=function(t){return t<256?n[t]:n[256+(t>>>7)]},ht.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],ht.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],ht.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ht.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],pt.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],pt.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],pt.static_l_desc=new pt(pt.static_ltree,ht.extra_lbits,257,286,h),pt.static_d_desc=new pt(pt.static_dtree,ht.extra_dbits,0,30,h),pt.static_bl_desc=new pt(null,ht.extra_blbits,0,19,7);function t(t,e,n,a,i){var r=this;r.good_length=t,r.max_lazy=e,r.nice_length=n,r.max_chain=a,r.func=i}var a,xt=[new t(0,0,0,0,0),new t(4,4,8,4,1),new t(4,5,16,8,1),new t(4,6,32,32,1),new t(4,4,16,16,2),new t(8,16,32,32,2),new t(8,16,128,128,2),new t(8,32,128,256,2),new t(32,128,258,1024,2),new t(32,258,258,4096,2)],vt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],bt=113,gt=666,wt=258,mt=262;function yt(t,e,n,a){var i=t[2*e],t=t[2*n];return i<t||i==t&&a[e]<=a[n]}function i(){var o,u,f,d,l,s,c,h,i,p,x,v,b,_,g,w,m,y,M,A,U,E,k,z,q,D,I,P,S,L,j,B,C,F,G,H,J,r,K,a,N,O=this,Q=new ht,R=new ht,T=new ht;function V(){for(var t=0;t<286;t++)j[2*t]=0;for(t=0;t<30;t++)B[2*t]=0;for(t=0;t<19;t++)C[2*t]=0;j[512]=1,O.opt_len=O.static_len=0,H=r=0}function W(t,e){var n,a,i=-1,r=t[1],_=0,o=7,u=4;for(0===r&&(o=138,u=3),t[2*(e+1)+1]=65535,n=0;n<=e;n++)a=r,r=t[2*(n+1)+1],++_<o&&a==r||(_<u?C[2*a]+=_:0!==a?(a!=i&&C[2*a]++,C[32]++):_<=10?C[34]++:C[36]++,i=a,u=(_=0)===r?(o=138,3):a==r?(o=6,3):(o=7,4))}function X(t){O.pending_buf[O.pending++]=t}function Y(t){X(255&t),X(t>>>8&255)}function Z(t,e){var n=e;16-n<N?(Y(a|=(e=t)<<N&65535),a=e>>>16-N,N+=n-16):(a|=t<<N&65535,N+=n)}function $(t,e){t*=2;Z(65535&e[t],65535&e[1+t])}function tt(t,e){var n,a,i=-1,r=t[1],_=0,o=7,u=4;for(0===r&&(o=138,u=3),n=0;n<=e;n++)if(a=r,r=t[2*(n+1)+1],!(++_<o&&a==r)){if(_<u)for(;$(a,C),0!=--_;);else 0!==a?(a!=i&&($(a,C),_--),$(16,C),Z(_-3,2)):_<=10?($(17,C),Z(_-3,3)):($(18,C),Z(_-11,7));i=a,u=(_=0)===r?(o=138,3):a==r?(o=6,3):(o=7,4)}}function et(){16==N?(Y(a),N=a=0):8<=N&&(X(255&a),a>>>=8,N-=8)}function nt(t,e){var n,a;if(O.pending_buf[J+2*H]=t>>>8&255,O.pending_buf[J+2*H+1]=255&t,O.pending_buf[F+H]=255&e,H++,0===t?j[2*e]++:(r++,t--,j[2*(ht._length_code[e]+dt+1)]++,B[2*ht.d_code(t)]++),0==(8191&H)&&2<I){for(n=8*H,t=U-m,a=0;a<30;a++)n+=B[2*a]*(5+ht.extra_dbits[a]);if(n>>>=3,r<Math.floor(H/2)&&n<Math.floor(t/2))return!0}return H==G-1}function at(t,e){var n,a,i,r,_=0;if(0!==H)for(;n=O.pending_buf[J+2*_]<<8&65280|255&O.pending_buf[J+2*_+1],a=255&O.pending_buf[F+_],_++,0==n?$(a,t):($((i=ht._length_code[a])+dt+1,t),0!==(r=ht.extra_lbits[i])&&Z(a-=ht.base_length[i],r),$(i=ht.d_code(--n),e),0!==(r=ht.extra_dbits[i])&&Z(n-=ht.base_dist[i],r)),_<H;);$(st,t),K=t[513]}function it(){8<N?Y(a):0<N&&X(255&a),N=a=0}function rt(t,e,n){Z(0+(n?1:0),3),n=t,t=e,e=!0,it(),K=8,e&&(Y(t),Y(~t)),O.pending_buf.set(h.subarray(n,n+t),O.pending),O.pending+=t}function e(t,e,n){var a,i,r=0;0<I?(Q.build_tree(O),R.build_tree(O),r=function(){var t;for(W(j,Q.max_code),W(B,R.max_code),T.build_tree(O),t=18;3<=t&&0===C[2*ht.bl_order[t]+1];t--);return O.opt_len+=3*(t+1)+5+5+4,t}(),a=O.opt_len+3+7>>>3,(i=O.static_len+3+7>>>3)<=a&&(a=i)):a=i=e+5,e+4<=a&&-1!=t?rt(t,e,n):i==a?(Z(2+(n?1:0),3),at(pt.static_ltree,pt.static_dtree)):(Z(4+(n?1:0),3),function(t,e,n){var a;for(Z(t-257,5),Z(e-1,5),Z(n-4,4),a=0;a<n;a++)Z(C[2*ht.bl_order[a]+1],3);tt(j,t-1),tt(B,e-1)}(Q.max_code+1,R.max_code+1,r+1),at(j,B)),V(),n&&it()}function _t(t){e(0<=m?m:-1,U-m,t),m=U,o.flush_pending()}function ot(){var t,e,n,a;do{if(0===(a=i-k-U)&&0===U&&0===k)a=l;else if(-1==a)a--;else if(l+l-mt<=U){for(h.set(h.subarray(l,l+l),0),E-=l,U-=l,m-=l,t=b,n=t;e=65535&x[--n],x[n]=l<=e?e-l:0,0!=--t;);for(t=l,n=t;e=65535&p[--n],p[n]=l<=e?e-l:0,0!=--t;);a+=l}if(0===o.avail_in)return}while(t=o.read_buf(h,U+k,a),3<=(k+=t)&&(v=((v=255&h[U])<<w^255&h[U+1])&g),k<mt&&0!==o.avail_in)}function ut(t){var e,n,a=q,i=U,r=z,_=l-mt<U?U-(l-mt):0,o=L,u=c,f=U+wt,d=h[i+r-1],s=h[i+r];S<=z&&(a>>=2),k<o&&(o=k);do{if(h[(e=t)+r]==s&&h[e+r-1]==d&&h[e]==h[i]&&h[++e]==h[i+1]){for(i+=2,e++;h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&i<f;);if(n=wt-(f-i),i=f-wt,r<n){if(E=t,o<=(r=n))break;d=h[i+r-1],s=h[i+r]}}}while((t=65535&p[t&u])>_&&0!=--a);return r<=k?r:k}function ft(t){return t.total_in=t.total_out=0,t.msg=null,O.pending=0,O.pending_out=0,u=bt,d=0,Q.dyn_tree=j,Q.stat_desc=pt.static_l_desc,R.dyn_tree=B,R.stat_desc=pt.static_d_desc,T.dyn_tree=C,T.stat_desc=pt.static_bl_desc,N=a=0,K=8,V(),function(){var t;for(i=2*l,t=x[b-1]=0;t<b-1;t++)x[t]=0;D=xt[I].max_lazy,S=xt[I].good_length,L=xt[I].nice_length,q=xt[I].max_chain,y=z=2,v=A=k=m=U=0}(),0}O.depth=[],O.bl_count=[],O.heap=[],j=[],B=[],C=[],O.pqdownheap=function(t,e){for(var n=O.heap,a=n[e],i=e<<1;i<=O.heap_len&&(i<O.heap_len&&yt(t,n[i+1],n[i],O.depth)&&i++,!yt(t,a,n[i],O.depth));)n[e]=n[i],e=i,i<<=1;n[e]=a},O.deflateInit=function(t,e,n,a,i,r){return a=a||8,i=i||8,r=r||0,t.msg=null,-1==e&&(e=6),i<1||9<i||8!=a||n<9||15<n||e<0||9<e||r<0||2<r?lt:(t.dstate=O,c=(l=1<<(s=n))-1,g=(b=1<<(_=i+7))-1,w=Math.floor((_+3-1)/3),h=new Uint8Array(2*l),p=[],x=[],G=1<<i+6,O.pending_buf=new Uint8Array(4*G),f=4*G,J=Math.floor(G/2),F=3*G,I=e,P=r,ft(t))},O.deflateEnd=function(){return 42!=u&&u!=bt&&u!=gt?lt:(O.pending_buf=null,h=p=x=null,O.dstate=null,u==bt?-3:0)},O.deflateParams=function(t,e,n){var a=0;return(e=-1==e?6:e)<0||9<e||n<0||2<n?lt:(xt[I].func!=xt[e].func&&0!==t.total_in&&(a=t.deflate(1)),I!=e&&(D=xt[I=e].max_lazy,S=xt[I].good_length,L=xt[I].nice_length,q=xt[I].max_chain),P=n,a)},O.deflateSetDictionary=function(t,e,n){var a,i=n,r=0;if(!e||42!=u)return lt;if(i<3)return 0;for(l-mt<i&&(r=n-(i=l-mt)),h.set(e.subarray(r,r+i),0),m=U=i,v=((v=255&h[0])<<w^255&h[1])&g,a=0;a<=i-3;a++)v=(v<<w^255&h[a+2])&g,p[a&c]=x[v],x[v]=a;return 0},O.deflate=function(t,e){var n,a,i,r,_;if(4<e||e<0)return lt;if(!t.next_out||!t.next_in&&0!==t.avail_in||u==gt&&4!=e)return t.msg=vt[4],lt;if(0===t.avail_out)return t.msg=vt[7],ct;if(o=t,i=d,d=e,42==u&&(_=8+(s-8<<4)<<8,_|=(a=3<(a=(I-1&255)>>1)?3:a)<<6,0!==U&&(_|=32),u=bt,X((_=_+=31-_%31)>>8&255),X(255&_)),0!==O.pending){if(o.flush_pending(),0===o.avail_out)return d=-1,0}else if(0===o.avail_in&&e<=i&&4!=e)return o.msg=vt[7],ct;if(u==gt&&0!==o.avail_in)return t.msg=vt[7],ct;if(0!==o.avail_in||0!==k||0!=e&&u!=gt){switch(r=-1,xt[I].func){case 0:r=function(t){var e,n=65535;for(f-5<n&&(n=f-5);;){if(k<=1){if(ot(),0===k&&0==t)return 0;if(0===k)break}if(U+=k,k=0,e=m+n,(0===U||e<=U)&&(k=U-e,U=e,_t(!1),0===o.avail_out))return 0;if(l-mt<=U-m&&(_t(!1),0===o.avail_out))return 0}return _t(4==t),0===o.avail_out?4==t?2:0:4==t?3:1}(e);break;case 1:r=function(t){for(var e,n=0;;){if(k<mt){if(ot(),k<mt&&0==t)return 0;if(0===k)break}if(3<=k&&(v=(v<<w^255&h[U+2])&g,n=65535&x[v],p[U&c]=x[v],x[v]=U),3<=(y=0!==n&&(U-n&65535)<=l-mt&&2!=P?ut(n):y))if(e=nt(U-E,y-3),k-=y,y<=D&&3<=k){for(y--;v=(v<<w^255&h[++U+2])&g,n=65535&x[v],p[U&c]=x[v],x[v]=U,0!=--y;);U++}else U+=y,y=0,v=((v=255&h[U])<<w^255&h[U+1])&g;else e=nt(0,255&h[U]),k--,U++;if(e&&(_t(!1),0===o.avail_out))return 0}return _t(4==t),0===o.avail_out?4==t?2:0:4==t?3:1}(e);break;case 2:r=function(t){for(var e,n,a=0;;){if(k<mt){if(ot(),k<mt&&0==t)return 0;if(0===k)break}if(3<=k&&(v=(v<<w^255&h[U+2])&g,a=65535&x[v],p[U&c]=x[v],x[v]=U),z=y,M=E,y=2,0!==a&&z<D&&(U-a&65535)<=l-mt&&(y=2!=P?ut(a):y)<=5&&(1==P||3==y&&4096<U-E)&&(y=2),3<=z&&y<=z){for(n=U+k-3,e=nt(U-1-M,z-3),k-=z-1,z-=2;++U<=n&&(v=(v<<w^255&h[U+2])&g,a=65535&x[v],p[U&c]=x[v],x[v]=U),0!=--z;);if(A=0,y=2,U++,e&&(_t(!1),0===o.avail_out))return 0}else if(0!==A){if((e=nt(0,255&h[U-1]))&&_t(!1),U++,k--,0===o.avail_out)return 0}else A=1,U++,k--}return 0!==A&&(e=nt(0,255&h[U-1]),A=0),_t(4==t),0===o.avail_out?4==t?2:0:4==t?3:1}(e)}if(2!=r&&3!=r||(u=gt),0==r||2==r)return 0===o.avail_out&&(d=-1),0;if(1==r){if(1==e)Z(2,3),$(st,pt.static_ltree),et(),1+K+10-N<9&&(Z(2,3),$(st,pt.static_ltree),et()),K=7;else if(rt(0,0,!1),3==e)for(n=0;n<b;n++)x[n]=0;if(o.flush_pending(),0===o.avail_out)return d=-1,0}}return 4!=e?0:1}}function r(){var t=this;t.next_in_index=0,t.next_out_index=0,t.avail_in=0,t.total_in=0,t.avail_out=0,t.total_out=0}function _(t){var o=new r,u=new Uint8Array(512);void 0===t&&(t=-1),o.deflateInit(t),o.next_out=u,this.append=function(t,e){var n,a=[],i=0,r=0,_=0;if(t.length){o.next_in_index=0,o.next_in=t,o.avail_in=t.length;do{if(o.next_out_index=0,o.avail_out=512,0!=o.deflate(0))throw"deflating: "+o.msg}while(o.next_out_index&&(512==o.next_out_index?a.push(new Uint8Array(u)):a.push(new Uint8Array(u.subarray(0,o.next_out_index)))),_+=o.next_out_index,e&&0<o.next_in_index&&o.next_in_index!=i&&(e(o.next_in_index),i=o.next_in_index),0<o.avail_in||0===o.avail_out);return n=new Uint8Array(_),a.forEach(function(t){n.set(t,r),r+=t.length}),n}},this.flush=function(){var t,e,n=[],a=0,i=0;do{if(o.next_out_index=0,o.avail_out=512,1!=(t=o.deflate(4))&&0!=t)throw"deflating: "+o.msg}while(0<512-o.avail_out&&n.push(new Uint8Array(u.subarray(0,o.next_out_index))),i+=o.next_out_index,0<o.avail_in||0===o.avail_out);return o.deflateEnd(),e=new Uint8Array(i),n.forEach(function(t){e.set(t,a),a+=t.length}),e}}r.prototype={deflateInit:function(t,e){return this.dstate=new i,e=e||h,this.dstate.deflateInit(this,t,e)},deflate:function(t){return this.dstate?this.dstate.deflate(this,t):lt},deflateEnd:function(){if(!this.dstate)return lt;var t=this.dstate.deflateEnd();return this.dstate=null,t},deflateParams:function(t,e){return this.dstate?this.dstate.deflateParams(this,t,e):lt},deflateSetDictionary:function(t,e){return this.dstate?this.dstate.deflateSetDictionary(this,t,e):lt},read_buf:function(t,e,n){var a=this,i=a.avail_in;return 0===(i=n<i?n:i)?0:(a.avail_in-=i,t.set(a.next_in.subarray(a.next_in_index,a.next_in_index+i),e),a.next_in_index+=i,a.total_in+=i,i)},flush_pending:function(){var t=this,e=t.dstate.pending;0!==(e=e>t.avail_out?t.avail_out:e)&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,0===t.dstate.pending&&(t.dstate.pending_out=0))}},e.zip?e.zip.Deflater=_:(a=new _,e.addEventListener("message",function(t){t=t.data;t.init&&(a=new _(t.level),e.postMessage({oninit:!0})),t.append&&e.postMessage({onappend:!0,data:a.append(t.data,function(t){e.postMessage({progress:!0,current:t})})}),t.flush&&e.postMessage({onflush:!0,data:a.flush()})},!1))}(this); \ No newline at end of file +!function(e){var h=15,dt=256,p=573,st=256,lt=-2,ct=-5,n=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ht(){var c=this;function u(t,e,n){for(var a,i,r=[],_=0,o=1;o<=h;o++)r[o]=_=_+n[o-1]<<1;for(a=0;a<=e;a++)0!==(i=t[2*a+1])&&(t[2*a]=function(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}(r[i]++,i))}c.build_tree=function(t){var e,n,a,i=c.dyn_tree,r=c.stat_desc.static_tree,_=c.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=p,e=0;e<_;e++)0!==i[2*e]?(t.heap[++t.heap_len]=o=e,t.depth[e]=0):i[2*e+1]=0;for(;t.heap_len<2;)i[2*(a=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[a]=0,t.opt_len--,r&&(t.static_len-=r[2*a+1]);for(c.max_code=o,e=Math.floor(t.heap_len/2);1<=e;e--)t.pqdownheap(i,e);for(a=_;e=t.heap[1],t.heap[1]=t.heap[t.heap_len--],t.pqdownheap(i,1),n=t.heap[1],t.heap[--t.heap_max]=e,t.heap[--t.heap_max]=n,i[2*a]=i[2*e]+i[2*n],t.depth[a]=Math.max(t.depth[e],t.depth[n])+1,i[2*e+1]=i[2*n+1]=a,t.heap[1]=a++,t.pqdownheap(i,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t){for(var e,n,a,i,r,_=c.dyn_tree,o=c.stat_desc.static_tree,u=c.stat_desc.extra_bits,f=c.stat_desc.extra_base,d=c.stat_desc.max_length,s=0,l=0;l<=h;l++)t.bl_count[l]=0;for(_[2*t.heap[t.heap_max]+1]=0,e=t.heap_max+1;e<p;e++)d<(l=_[2*_[2*(n=t.heap[e])+1]+1]+1)&&(l=d,s++),_[2*n+1]=l,n>c.max_code||(t.bl_count[l]++,i=0,f<=n&&(i=u[n-f]),r=_[2*n],t.opt_len+=r*(l+i),o&&(t.static_len+=r*(o[2*n+1]+i)));if(0!==s){do{for(l=d-1;0===t.bl_count[l];)l--}while(t.bl_count[l]--,t.bl_count[l+1]+=2,t.bl_count[d]--,0<(s-=2));for(l=d;0!==l;l--)for(n=t.bl_count[l];0!==n;)(a=t.heap[--e])>c.max_code||(_[2*a+1]!=l&&(t.opt_len+=(l-_[2*a+1])*_[2*a],_[2*a+1]=l),n--)}}(t),u(i,c.max_code,t.bl_count)}}function pt(t,e,n,a,i){var r=this;r.static_tree=t,r.extra_bits=e,r.extra_base=n,r.elems=a,r.max_length=i}ht._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],ht.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],ht.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],ht.d_code=function(t){return t<256?n[t]:n[256+(t>>>7)]},ht.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],ht.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],ht.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ht.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],pt.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],pt.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],pt.static_l_desc=new pt(pt.static_ltree,ht.extra_lbits,257,286,h),pt.static_d_desc=new pt(pt.static_dtree,ht.extra_dbits,0,30,h),pt.static_bl_desc=new pt(null,ht.extra_blbits,0,19,7);function t(t,e,n,a,i){var r=this;r.good_length=t,r.max_lazy=e,r.nice_length=n,r.max_chain=a,r.func=i}var a,xt=[new t(0,0,0,0,0),new t(4,4,8,4,1),new t(4,5,16,8,1),new t(4,6,32,32,1),new t(4,4,16,16,2),new t(8,16,32,32,2),new t(8,16,128,128,2),new t(8,32,128,256,2),new t(32,128,258,1024,2),new t(32,258,258,4096,2)],vt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],bt=113,gt=666,wt=258,mt=262;function yt(t,e,n,a){var i=t[2*e],t=t[2*n];return i<t||i==t&&a[e]<=a[n]}function i(){var o,u,f,d,l,s,c,h,i,p,x,v,b,_,g,w,m,y,M,A,U,E,k,z,q,D,I,P,S,L,j,B,C,F,G,H,J,r,K,a,N,O=this,Q=new ht,R=new ht,T=new ht;function V(){for(var t=0;t<286;t++)j[2*t]=0;for(t=0;t<30;t++)B[2*t]=0;for(t=0;t<19;t++)C[2*t]=0;j[512]=1,O.opt_len=O.static_len=0,H=r=0}function W(t,e){var n,a,i=-1,r=t[1],_=0,o=7,u=4;for(0===r&&(o=138,u=3),t[2*(e+1)+1]=65535,n=0;n<=e;n++)a=r,r=t[2*(n+1)+1],++_<o&&a==r||(_<u?C[2*a]+=_:0!==a?(a!=i&&C[2*a]++,C[32]++):_<=10?C[34]++:C[36]++,i=a,u=(_=0)===r?(o=138,3):a==r?(o=6,3):(o=7,4))}function X(t){O.pending_buf[O.pending++]=t}function Y(t){X(255&t),X(t>>>8&255)}function Z(t,e){var n=e;16-n<N?(Y(a|=(e=t)<<N&65535),a=e>>>16-N,N+=n-16):(a|=t<<N&65535,N+=n)}function $(t,e){t*=2;Z(65535&e[t],65535&e[1+t])}function tt(t,e){var n,a,i=-1,r=t[1],_=0,o=7,u=4;for(0===r&&(o=138,u=3),n=0;n<=e;n++)if(a=r,r=t[2*(n+1)+1],!(++_<o&&a==r)){if(_<u)for(;$(a,C),0!=--_;);else 0!==a?(a!=i&&($(a,C),_--),$(16,C),Z(_-3,2)):_<=10?($(17,C),Z(_-3,3)):($(18,C),Z(_-11,7));i=a,u=(_=0)===r?(o=138,3):a==r?(o=6,3):(o=7,4)}}function et(){16==N?(Y(a),N=a=0):8<=N&&(X(255&a),a>>>=8,N-=8)}function nt(t,e){var n,a;if(O.pending_buf[J+2*H]=t>>>8&255,O.pending_buf[J+2*H+1]=255&t,O.pending_buf[F+H]=255&e,H++,0===t?j[2*e]++:(r++,t--,j[2*(ht._length_code[e]+dt+1)]++,B[2*ht.d_code(t)]++),0==(8191&H)&&2<I){for(n=8*H,t=U-m,a=0;a<30;a++)n+=B[2*a]*(5+ht.extra_dbits[a]);if(n>>>=3,r<Math.floor(H/2)&&n<Math.floor(t/2))return!0}return H==G-1}function at(t,e){var n,a,i,r,_=0;if(0!==H)for(;n=O.pending_buf[J+2*_]<<8&65280|255&O.pending_buf[J+2*_+1],a=255&O.pending_buf[F+_],_++,0==n?$(a,t):($((i=ht._length_code[a])+dt+1,t),0!==(r=ht.extra_lbits[i])&&Z(a-=ht.base_length[i],r),$(i=ht.d_code(--n),e),0!==(r=ht.extra_dbits[i])&&Z(n-=ht.base_dist[i],r)),_<H;);$(st,t),K=t[513]}function it(){8<N?Y(a):0<N&&X(255&a),N=a=0}function rt(t,e,n){Z(0+(n?1:0),3),n=t,t=e,e=!0,it(),K=8,e&&(Y(t),Y(~t)),O.pending_buf.set(h.subarray(n,n+t),O.pending),O.pending+=t}function e(t,e,n){var a,i,r=0;0<I?(Q.build_tree(O),R.build_tree(O),r=function(){var t;for(W(j,Q.max_code),W(B,R.max_code),T.build_tree(O),t=18;3<=t&&0===C[2*ht.bl_order[t]+1];t--);return O.opt_len+=3*(t+1)+5+5+4,t}(),a=O.opt_len+3+7>>>3,(i=O.static_len+3+7>>>3)<=a&&(a=i)):a=i=e+5,e+4<=a&&-1!=t?rt(t,e,n):i==a?(Z(2+(n?1:0),3),at(pt.static_ltree,pt.static_dtree)):(Z(4+(n?1:0),3),function(t,e,n){var a;for(Z(t-257,5),Z(e-1,5),Z(n-4,4),a=0;a<n;a++)Z(C[2*ht.bl_order[a]+1],3);tt(j,t-1),tt(B,e-1)}(Q.max_code+1,R.max_code+1,r+1),at(j,B)),V(),n&&it()}function _t(t){e(0<=m?m:-1,U-m,t),m=U,o.flush_pending()}function ot(){var t,e,n,a;do{if(0===(a=i-k-U)&&0===U&&0===k)a=l;else if(-1==a)a--;else if(l+l-mt<=U){for(h.set(h.subarray(l,l+l),0),E-=l,U-=l,m-=l,n=t=b;e=65535&x[--n],x[n]=l<=e?e-l:0,0!=--t;);for(n=t=l;e=65535&p[--n],p[n]=l<=e?e-l:0,0!=--t;);a+=l}if(0===o.avail_in)return}while(t=o.read_buf(h,U+k,a),3<=(k+=t)&&(v=((v=255&h[U])<<w^255&h[U+1])&g),k<mt&&0!==o.avail_in)}function ut(t){var e,n,a=q,i=U,r=z,_=l-mt<U?U-(l-mt):0,o=L,u=c,f=U+wt,d=h[i+r-1],s=h[i+r];S<=z&&(a>>=2),k<o&&(o=k);do{if(h[(e=t)+r]==s&&h[e+r-1]==d&&h[e]==h[i]&&h[++e]==h[i+1]){for(i+=2,e++;h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&h[++i]==h[++e]&&i<f;);if(n=wt-(f-i),i=f-wt,r<n){if(E=t,o<=(r=n))break;d=h[i+r-1],s=h[i+r]}}}while((t=65535&p[t&u])>_&&0!=--a);return r<=k?r:k}function ft(t){return t.total_in=t.total_out=0,t.msg=null,O.pending=0,O.pending_out=0,u=bt,d=0,Q.dyn_tree=j,Q.stat_desc=pt.static_l_desc,R.dyn_tree=B,R.stat_desc=pt.static_d_desc,T.dyn_tree=C,T.stat_desc=pt.static_bl_desc,N=a=0,K=8,V(),function(){var t;for(i=2*l,t=x[b-1]=0;t<b-1;t++)x[t]=0;D=xt[I].max_lazy,S=xt[I].good_length,L=xt[I].nice_length,q=xt[I].max_chain,y=z=2,v=A=k=m=U=0}(),0}O.depth=[],O.bl_count=[],O.heap=[],j=[],B=[],C=[],O.pqdownheap=function(t,e){for(var n=O.heap,a=n[e],i=e<<1;i<=O.heap_len&&(i<O.heap_len&&yt(t,n[i+1],n[i],O.depth)&&i++,!yt(t,a,n[i],O.depth));)n[e]=n[i],e=i,i<<=1;n[e]=a},O.deflateInit=function(t,e,n,a,i,r){return a=a||8,i=i||8,r=r||0,t.msg=null,-1==e&&(e=6),i<1||9<i||8!=a||n<9||15<n||e<0||9<e||r<0||2<r?lt:(t.dstate=O,c=(l=1<<(s=n))-1,g=(b=1<<(_=i+7))-1,w=Math.floor((_+3-1)/3),h=new Uint8Array(2*l),p=[],x=[],G=1<<i+6,O.pending_buf=new Uint8Array(4*G),f=4*G,J=Math.floor(G/2),F=3*G,I=e,P=r,ft(t))},O.deflateEnd=function(){return 42!=u&&u!=bt&&u!=gt?lt:(O.pending_buf=null,h=p=x=null,O.dstate=null,u==bt?-3:0)},O.deflateParams=function(t,e,n){var a=0;return(e=-1==e?6:e)<0||9<e||n<0||2<n?lt:(xt[I].func!=xt[e].func&&0!==t.total_in&&(a=t.deflate(1)),I!=e&&(D=xt[I=e].max_lazy,S=xt[I].good_length,L=xt[I].nice_length,q=xt[I].max_chain),P=n,a)},O.deflateSetDictionary=function(t,e,n){var a,i=n,r=0;if(!e||42!=u)return lt;if(i<3)return 0;for(l-mt<i&&(r=n-(i=l-mt)),h.set(e.subarray(r,r+i),0),m=U=i,v=((v=255&h[0])<<w^255&h[1])&g,a=0;a<=i-3;a++)v=(v<<w^255&h[a+2])&g,p[a&c]=x[v],x[v]=a;return 0},O.deflate=function(t,e){var n,a,i,r,_;if(4<e||e<0)return lt;if(!t.next_out||!t.next_in&&0!==t.avail_in||u==gt&&4!=e)return t.msg=vt[4],lt;if(0===t.avail_out)return t.msg=vt[7],ct;if(o=t,i=d,d=e,42==u&&(_=8+(s-8<<4)<<8,_|=(a=3<(a=(I-1&255)>>1)?3:a)<<6,0!==U&&(_|=32),u=bt,X((_=_+=31-_%31)>>8&255),X(255&_)),0!==O.pending){if(o.flush_pending(),0===o.avail_out)return d=-1,0}else if(0===o.avail_in&&e<=i&&4!=e)return o.msg=vt[7],ct;if(u==gt&&0!==o.avail_in)return t.msg=vt[7],ct;if(0!==o.avail_in||0!==k||0!=e&&u!=gt){switch(r=-1,xt[I].func){case 0:r=function(t){var e,n=65535;for(f-5<n&&(n=f-5);;){if(k<=1){if(ot(),0===k&&0==t)return 0;if(0===k)break}if(U+=k,e=m+n,((k=0)===U||e<=U)&&(k=U-e,U=e,_t(!1),0===o.avail_out))return 0;if(l-mt<=U-m&&(_t(!1),0===o.avail_out))return 0}return _t(4==t),0===o.avail_out?4==t?2:0:4==t?3:1}(e);break;case 1:r=function(t){for(var e,n=0;;){if(k<mt){if(ot(),k<mt&&0==t)return 0;if(0===k)break}if(3<=k&&(v=(v<<w^255&h[U+2])&g,n=65535&x[v],p[U&c]=x[v],x[v]=U),3<=(y=0!==n&&(U-n&65535)<=l-mt&&2!=P?ut(n):y))if(e=nt(U-E,y-3),k-=y,y<=D&&3<=k){for(y--;v=(v<<w^255&h[++U+2])&g,n=65535&x[v],p[U&c]=x[v],x[v]=U,0!=--y;);U++}else U+=y,y=0,v=((v=255&h[U])<<w^255&h[U+1])&g;else e=nt(0,255&h[U]),k--,U++;if(e&&(_t(!1),0===o.avail_out))return 0}return _t(4==t),0===o.avail_out?4==t?2:0:4==t?3:1}(e);break;case 2:r=function(t){for(var e,n,a=0;;){if(k<mt){if(ot(),k<mt&&0==t)return 0;if(0===k)break}if(3<=k&&(v=(v<<w^255&h[U+2])&g,a=65535&x[v],p[U&c]=x[v],x[v]=U),z=y,M=E,y=2,0!==a&&z<D&&(U-a&65535)<=l-mt&&(y=2!=P?ut(a):y)<=5&&(1==P||3==y&&4096<U-E)&&(y=2),3<=z&&y<=z){for(n=U+k-3,e=nt(U-1-M,z-3),k-=z-1,z-=2;++U<=n&&(v=(v<<w^255&h[U+2])&g,a=65535&x[v],p[U&c]=x[v],x[v]=U),0!=--z;);if(A=0,y=2,U++,e&&(_t(!1),0===o.avail_out))return 0}else if(0!==A){if((e=nt(0,255&h[U-1]))&&_t(!1),U++,k--,0===o.avail_out)return 0}else A=1,U++,k--}return 0!==A&&(e=nt(0,255&h[U-1]),A=0),_t(4==t),0===o.avail_out?4==t?2:0:4==t?3:1}(e)}if(2!=r&&3!=r||(u=gt),0==r||2==r)return 0===o.avail_out&&(d=-1),0;if(1==r){if(1==e)Z(2,3),$(st,pt.static_ltree),et(),1+K+10-N<9&&(Z(2,3),$(st,pt.static_ltree),et()),K=7;else if(rt(0,0,!1),3==e)for(n=0;n<b;n++)x[n]=0;if(o.flush_pending(),0===o.avail_out)return d=-1,0}}return 4!=e?0:1}}function r(){var t=this;t.next_in_index=0,t.next_out_index=0,t.avail_in=0,t.total_in=0,t.avail_out=0,t.total_out=0}function _(t){var o=new r,u=new Uint8Array(512);o.deflateInit(t=void 0===t?-1:t),o.next_out=u,this.append=function(t,e){var n,a=[],i=0,r=0,_=0;if(t.length){o.next_in_index=0,o.next_in=t,o.avail_in=t.length;do{if(o.next_out_index=0,o.avail_out=512,0!=o.deflate(0))throw"deflating: "+o.msg}while(o.next_out_index&&(512==o.next_out_index?a.push(new Uint8Array(u)):a.push(new Uint8Array(u.subarray(0,o.next_out_index)))),_+=o.next_out_index,e&&0<o.next_in_index&&o.next_in_index!=i&&(e(o.next_in_index),i=o.next_in_index),0<o.avail_in||0===o.avail_out);return n=new Uint8Array(_),a.forEach(function(t){n.set(t,r),r+=t.length}),n}},this.flush=function(){var t,e,n=[],a=0,i=0;do{if(o.next_out_index=0,o.avail_out=512,1!=(t=o.deflate(4))&&0!=t)throw"deflating: "+o.msg}while(0<512-o.avail_out&&n.push(new Uint8Array(u.subarray(0,o.next_out_index))),i+=o.next_out_index,0<o.avail_in||0===o.avail_out);return o.deflateEnd(),e=new Uint8Array(i),n.forEach(function(t){e.set(t,a),a+=t.length}),e}}r.prototype={deflateInit:function(t,e){return this.dstate=new i,this.dstate.deflateInit(this,t,e=e||h)},deflate:function(t){return this.dstate?this.dstate.deflate(this,t):lt},deflateEnd:function(){if(!this.dstate)return lt;var t=this.dstate.deflateEnd();return this.dstate=null,t},deflateParams:function(t,e){return this.dstate?this.dstate.deflateParams(this,t,e):lt},deflateSetDictionary:function(t,e){return this.dstate?this.dstate.deflateSetDictionary(this,t,e):lt},read_buf:function(t,e,n){var a=this,i=a.avail_in;return 0===(i=n<i?n:i)?0:(a.avail_in-=i,t.set(a.next_in.subarray(a.next_in_index,a.next_in_index+i),e),a.next_in_index+=i,a.total_in+=i,i)},flush_pending:function(){var t=this,e=t.dstate.pending;0!==(e=e>t.avail_out?t.avail_out:e)&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,0===t.dstate.pending&&(t.dstate.pending_out=0))}},e.zip?e.zip.Deflater=_:(a=new _,e.addEventListener("message",function(t){t=t.data;t.init&&(a=new _(t.level),e.postMessage({oninit:!0})),t.append&&e.postMessage({onappend:!0,data:a.append(t.data,function(t){e.postMessage({progress:!0,current:t})})}),t.flush&&e.postMessage({onflush:!0,data:a.flush()})},!1))}(this); \ No newline at end of file diff --git a/public/Cesium/ThirdParty/Workers/inflate.js b/public/Cesium/ThirdParty/Workers/inflate.js index cf89312..628afe9 100644 --- a/public/Cesium/ThirdParty/Workers/inflate.js +++ b/public/Cesium/ThirdParty/Workers/inflate.js @@ -1 +1 @@ -!function(t){var L=0,P=1,j=-2,q=-3,u=-4,B=-5,C=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],F=1440,a=[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],r=[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],x=[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],w=[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],c=[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],v=[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],D=15;function G(){var s,f,E,S,U,z;function o(i,t,e,n,a,r,_,l,d,s,f){for(var o,b,u,x,w,c,v,h,k,m,y,g,p,A=0,I=e;E[i[t+A]]++,A++,I--,0!==I;);if(E[0]==e)return _[0]=-1,l[0]=0,L;for(v=l[0],w=1;w<=D&&0===E[w];w++);for(v<(c=w)&&(v=w),I=D;0!==I&&0===E[I];I--);for((u=I)<v&&(v=I),l[0]=v,g=1<<w;w<I;w++,g<<=1)if((g-=E[w])<0)return q;if((g-=E[I])<0)return q;for(E[I]+=g,z[1]=w=0,A=1,y=2;0!=--I;)z[y]=w+=E[A],y++,A++;for(I=0,A=0;0!==(w=i[t+A])&&(f[z[w]++]=I),A++,++I<e;);for(e=z[u],z[0]=I=0,x=-1,m=-v,p=k=U[A=0]=0;c<=u;c++)for(o=E[c];0!=o--;){for(;m+v<c;){if(x++,m+=v,p=u-m,p=v<p?v:p,(b=1<<(w=c-m))>o+1&&(b-=o+1,y=c,w<p))for(;++w<p&&!((b<<=1)<=E[++y]);)b-=E[y];if(p=1<<w,s[0]+p>F)return q;U[x]=k=s[0],s[0]+=p,0!==x?(z[x]=I,S[0]=w,w=I>>>m-(S[1]=v),S[2]=k-U[x-1]-w,d.set(S,3*(U[x-1]+w))):_[0]=k}for(S[1]=c-m,e<=A?S[0]=192:f[A]<n?(S[0]=f[A]<256?0:96,S[2]=f[A++]):(S[0]=r[f[A]-n]+16+64,S[2]=a[f[A++]-n]),b=1<<c-m,w=I>>>m;w<p;w+=b)d.set(S,3*(k+w));for(w=1<<c-1;0!=(I&w);w>>>=1)I^=w;for(I^=w,h=(1<<m)-1;(I&h)!=z[x];)x--,h=(1<<(m-=v))-1}return 0!==g&&1!=u?B:L}function b(i){var t;for(s||(s=[],f=[],E=new Int32Array(D+1),S=[],U=new Int32Array(D),z=new Int32Array(D+1)),f.length<i&&(f=[]),t=0;t<i;t++)f[t]=0;for(t=0;t<D+1;t++)E[t]=0;for(t=0;t<3;t++)S[t]=0;U.set(E.subarray(0,D),0),z.set(E.subarray(0,D+1),0)}this.inflate_trees_bits=function(i,t,e,n,a){return b(19),(n=o(i,s[0]=0,19,19,null,null,e,t,n,s,f))==q?a.msg="oversubscribed dynamic bit lengths tree":n!=B&&0!==t[0]||(a.msg="incomplete dynamic bit lengths tree",n=q),n},this.inflate_trees_dynamic=function(i,t,e,n,a,r,_,l,d){return b(288),(r=o(e,s[0]=0,i,257,x,w,r,n,l,s,f))!=L||0===n[0]?(r==q?d.msg="oversubscribed literal/length tree":r!=u&&(d.msg="incomplete literal/length tree",r=q),r):(b(288),(r=o(e,i,t,0,c,v,_,a,l,s,f))!=L||0===a[0]&&257<i?(r==q?d.msg="oversubscribed distance tree":r==B?(d.msg="incomplete distance tree",r=q):r!=u&&(d.msg="empty distance tree with lengths",r=q),r):L)}}G.inflate_trees_fixed=function(i,t,e,n){return i[0]=9,t[0]=5,e[0]=a,n[0]=r,L};var S=0,U=1,z=2,M=3,H=4,J=5,K=6,N=7,O=8,Q=9;function e(){var u,x,w,c,v=0,h=0,k=0,m=0,y=0,g=0,p=0,A=0,I=0,E=0;this.init=function(i,t,e,n,a,r){u=S,p=i,A=t,w=e,I=n,c=a,E=r,x=null},this.proc=function(i,t,e){for(var n,a,r,_,l=0,d=0,s=0,s=t.next_in_index,f=t.avail_in,l=i.bitb,d=i.bitk,o=i.write,b=o<i.read?i.read-o-1:i.end-o;;)switch(u){case S:if(258<=b&&10<=f&&(i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,e=function(i,t,e,n,a,r,_,l){var d,s,f,o,b,u,x,w,c=l.next_in_index,v=l.avail_in,h=_.bitb,k=_.bitk,m=_.write,y=m<_.read?_.read-m-1:_.end-m,g=C[i],p=C[t];do{for(;k<20;)v--,h|=(255&l.read_byte(c++))<<k,k+=8;if(0!==(o=(s=e)[w=3*((f=n)+(d=h&g))]))for(;;){if(h>>=s[w+1],k-=s[w+1],0!=(16&o)){for(o&=15,b=s[w+2]+(h&C[o]),h>>=o,k-=o;k<15;)v--,h|=(255&l.read_byte(c++))<<k,k+=8;for(d=h&p,s=a,f=r,w=3*(f+d),o=s[w];;){if(h>>=s[w+1],k-=s[w+1],0!=(16&o)){for(o&=15;k<o;)v--,h|=(255&l.read_byte(c++))<<k,k+=8;if(u=s[w+2]+(h&C[o]),h>>=o,k-=o,y-=b,u<=m)0<m-(x=m-u)&&m-x<2?(_.window[m++]=_.window[x++],_.window[m++]=_.window[x++]):(_.window.set(_.window.subarray(x,x+2),m),m+=2,x+=2),b-=2;else{for(x=m-u;x+=_.end,x<0;);if((o=_.end-x)<b){if(b-=o,0<m-x&&m-x<o)for(;_.window[m++]=_.window[x++],0!=--o;);else _.window.set(_.window.subarray(x,x+o),m),m+=o,x+=o,o=0;x=0}}if(0<m-x&&m-x<b)for(;_.window[m++]=_.window[x++],0!=--b;);else _.window.set(_.window.subarray(x,x+b),m),m+=b,x+=b,b=0;break}if(0!=(64&o))return l.msg="invalid distance code",v+=b=k>>3<(b=l.avail_in-v)?k>>3:b,c-=b,k-=b<<3,_.bitb=h,_.bitk=k,l.avail_in=v,l.total_in+=c-l.next_in_index,l.next_in_index=c,_.write=m,q;d+=s[w+2],o=s[w=3*(f+(d+=h&C[o]))]}break}if(0!=(64&o))return 0!=(32&o)?(v+=b=k>>3<(b=l.avail_in-v)?k>>3:b,c-=b,k-=b<<3,_.bitb=h,_.bitk=k,l.avail_in=v,l.total_in+=c-l.next_in_index,l.next_in_index=c,_.write=m,P):(l.msg="invalid literal/length code",v+=b=k>>3<(b=l.avail_in-v)?k>>3:b,c-=b,k-=b<<3,_.bitb=h,_.bitk=k,l.avail_in=v,l.total_in+=c-l.next_in_index,l.next_in_index=c,_.write=m,q);if(d+=s[w+2],0===(o=s[w=3*(f+(d+=h&C[o]))])){h>>=s[w+1],k-=s[w+1],_.window[m++]=s[w+2],y--;break}}else h>>=s[w+1],k-=s[w+1],_.window[m++]=s[w+2],y--}while(258<=y&&10<=v);return v+=b=k>>3<(b=l.avail_in-v)?k>>3:b,c-=b,k-=b<<3,_.bitb=h,_.bitk=k,l.avail_in=v,l.total_in+=c-l.next_in_index,l.next_in_index=c,_.write=m,L}(p,A,w,I,c,E,i,t),s=t.next_in_index,f=t.avail_in,l=i.bitb,d=i.bitk,b=(o=i.write)<i.read?i.read-o-1:i.end-o,e!=L)){u=e==P?N:Q;break}k=p,x=w,h=I,u=U;case U:for(n=k;d<n;){if(0===f)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,f--,l|=(255&t.read_byte(s++))<<d,d+=8}if(a=3*(h+(l&C[n])),l>>>=x[a+1],d-=x[a+1],0===(r=x[a])){m=x[a+2],u=K;break}if(0!=(16&r)){y=15&r,v=x[a+2],u=z;break}if(0==(64&r)){k=r,h=a/3+x[a+2];break}if(0==(32&r))return u=Q,t.msg="invalid literal/length code",e=q,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);u=N;break;case z:for(n=y;d<n;){if(0===f)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,f--,l|=(255&t.read_byte(s++))<<d,d+=8}v+=l&C[n],l>>=n,d-=n,k=A,x=c,h=E,u=M;case M:for(n=k;d<n;){if(0===f)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,f--,l|=(255&t.read_byte(s++))<<d,d+=8}if(a=3*(h+(l&C[n])),l>>=x[a+1],d-=x[a+1],0!=(16&(r=x[a]))){y=15&r,g=x[a+2],u=H;break}if(0!=(64&r))return u=Q,t.msg="invalid distance code",e=q,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);k=r,h=a/3+x[a+2];break;case H:for(n=y;d<n;){if(0===f)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,f--,l|=(255&t.read_byte(s++))<<d,d+=8}g+=l&C[n],l>>=n,d-=n,u=J;case J:for(_=o-g;_<0;)_+=i.end;for(;0!==v;){if(0===b&&(o==i.end&&0!==i.read&&(b=(o=0)<i.read?i.read-o-1:i.end-o),0===b&&(i.write=o,e=i.inflate_flush(t,e),b=(o=i.write)<i.read?i.read-o-1:i.end-o,0===(b=o==i.end&&0!==i.read?(o=0)<i.read?i.read-o-1:i.end-o:b))))return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);i.window[o++]=i.window[_++],b--,_==i.end&&(_=0),v--}u=S;break;case K:if(0===b&&(o==i.end&&0!==i.read&&(b=(o=0)<i.read?i.read-o-1:i.end-o),0===b&&(i.write=o,e=i.inflate_flush(t,e),b=(o=i.write)<i.read?i.read-o-1:i.end-o,0===(b=o==i.end&&0!==i.read?(o=0)<i.read?i.read-o-1:i.end-o:b))))return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,i.window[o++]=m,b--,u=S;break;case N:if(7<d&&(d-=8,f++,s--),i.write=o,e=i.inflate_flush(t,e),b=(o=i.write)<i.read?i.read-o-1:i.end-o,i.read!=i.write)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);u=O;case O:return e=P,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);case Q:return e=q,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);default:return e=j,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e)}},this.free=function(){}}var R=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=0,V=1,W=2,X=3,Y=4,Z=5,$=6,ii=7,ti=8,ei=9;function n(i,t){var m,y=this,g=T,p=0,A=0,I=0,E=[0],S=[0],U=new e,z=0,D=new Int32Array(3*F),M=new G;y.bitk=0,y.bitb=0,y.window=new Uint8Array(t),y.end=t,y.read=0,y.write=0,y.reset=function(i,t){t&&(t[0]=0),g==$&&U.free(i),g=T,y.bitk=0,y.bitb=0,y.read=y.write=0},y.reset(i,null),y.inflate_flush=function(i,t){var e=i.next_out_index,n=y.read,a=(n<=y.write?y.write:y.end)-n;return 0!==(a=a>i.avail_out?i.avail_out:a)&&t==B&&(t=L),i.avail_out-=a,i.total_out+=a,i.next_out.set(y.window.subarray(n,n+a),e),e+=a,(n+=a)==y.end&&(n=0,y.write==y.end&&(y.write=0),0!==(a=(a=y.write-n)>i.avail_out?i.avail_out:a)&&t==B&&(t=L),i.avail_out-=a,i.total_out+=a,i.next_out.set(y.window.subarray(n,n+a),e),e+=a,n+=a),i.next_out_index=e,y.read=n,t},y.proc=function(i,t){for(var e,n=i.next_in_index,a=i.avail_in,r=y.bitb,_=y.bitk,l=y.write,d=l<y.read?y.read-l-1:y.end-l;;)switch(g){case T:for(;_<3;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}switch(z=1&(w=7&r),w>>>1){case 0:r>>>=3,r>>>=w=7&(_-=3),_-=w,g=V;break;case 1:var s=[],f=[],o=[[]],b=[[]];G.inflate_trees_fixed(s,f,o,b),U.init(s[0],f[0],o[0],0,b[0],0),r>>>=3,_-=3,g=$;break;case 2:r>>>=3,_-=3,g=X;break;case 3:return r>>>=3,_-=3,g=ei,i.msg="invalid block type",t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t)}break;case V:for(;_<32;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}if((~r>>>16&65535)!=(65535&r))return g=ei,i.msg="invalid stored block lengths",t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);p=65535&r,r=_=0,g=0!==p?W:0!==z?ii:T;break;case W:if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);if(0===d&&(l==y.end&&0!==y.read&&(d=(l=0)<y.read?y.read-l-1:y.end-l),0===d&&(y.write=l,t=y.inflate_flush(i,t),d=(l=y.write)<y.read?y.read-l-1:y.end-l,0===(d=l==y.end&&0!==y.read?(l=0)<y.read?y.read-l-1:y.end-l:d))))return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);if(t=L,d<(w=a<(w=p)?a:w)&&(w=d),y.window.set(i.read_buf(n,w),l),n+=w,a-=w,l+=w,d-=w,0!=(p-=w))break;g=0!==z?ii:T;break;case X:for(;_<14;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}if(A=w=16383&r,29<(31&w)||29<(w>>5&31))return g=ei,i.msg="too many length or distance symbols",t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);if(w=258+(31&w)+(w>>5&31),!m||m.length<w)m=[];else for(e=0;e<w;e++)m[e]=0;r>>>=14,_-=14,I=0,g=Y;case Y:for(;I<4+(A>>>10);){for(;_<3;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}m[R[I++]]=7&r,r>>>=3,_-=3}for(;I<19;)m[R[I++]]=0;if(E[0]=7,(w=M.inflate_trees_bits(m,E,S,D,i))!=L)return(t=w)==q&&(m=null,g=ei),y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);I=0,g=Z;case Z:for(;I<258+(31&(w=A))+(w>>5&31);){for(var u,x,w=E[0];_<w;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}if(w=D[3*(S[0]+(r&C[w]))+1],(x=D[3*(S[0]+(r&C[w]))+2])<16)r>>>=w,_-=w,m[I++]=x;else{for(e=18==x?7:x-14,u=18==x?11:3;_<w+e;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}if(_-=w,u+=(r>>>=w)&C[e],r>>>=e,_-=e,258+(31&(w=A))+(w>>5&31)<(e=I)+u||16==x&&e<1)return m=null,g=ei,i.msg="invalid bit length repeat",t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);for(x=16==x?m[e-1]:0;m[e++]=x,0!=--u;);I=e}}S[0]=-1;var c=[],v=[],h=[],k=[];if(c[0]=9,v[0]=6,w=A,(w=M.inflate_trees_dynamic(257+(31&w),1+(w>>5&31),m,c,v,h,k,D,i))!=L)return w==q&&(m=null,g=ei),t=w,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);U.init(c[0],v[0],D,h[0],D,k[0]),g=$;case $:if(y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,(t=U.proc(y,i,t))!=P)return y.inflate_flush(i,t);if(t=L,U.free(i),n=i.next_in_index,a=i.avail_in,r=y.bitb,_=y.bitk,d=(l=y.write)<y.read?y.read-l-1:y.end-l,0===z){g=T;break}g=ii;case ii:if(y.write=l,t=y.inflate_flush(i,t),d=(l=y.write)<y.read?y.read-l-1:y.end-l,y.read!=y.write)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);g=ti;case ti:return t=P,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);case ei:return t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);default:return t=j,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t)}},y.free=function(i){y.reset(i,null),y.window=null,D=null},y.set_dictionary=function(i,t,e){y.window.set(i.subarray(t,t+e),0),y.read=y.write=e},y.sync_point=function(){return g==V?1:0}}var _,l=[0,0,255,255];function d(){var e=this;function _(i){return i&&i.istate?(i.total_in=i.total_out=0,i.msg=null,i.istate.mode=7,i.istate.blocks.reset(i,null),L):j}e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0,e.inflateEnd=function(i){return e.blocks&&e.blocks.free(i),e.blocks=null,L},e.inflateInit=function(i,t){return i.msg=null,e.blocks=null,t<8||15<t?(e.inflateEnd(i),j):(e.wbits=t,i.istate.blocks=new n(i,1<<t),_(i),L)},e.inflate=function(i,t){var e,n;if(!i||!i.istate||!i.next_in)return j;for(t=4==t?B:L,e=B;;)switch(i.istate.mode){case 0:if(0===i.avail_in)return e;if(e=t,i.avail_in--,i.total_in++,8!=(15&(i.istate.method=i.read_byte(i.next_in_index++)))){i.istate.mode=13,i.msg="unknown compression method",i.istate.marker=5;break}if(8+(i.istate.method>>4)>i.istate.wbits){i.istate.mode=13,i.msg="invalid window size",i.istate.marker=5;break}i.istate.mode=1;case 1:if(0===i.avail_in)return e;if(e=t,i.avail_in--,i.total_in++,n=255&i.read_byte(i.next_in_index++),((i.istate.method<<8)+n)%31!=0){i.istate.mode=13,i.msg="incorrect header check",i.istate.marker=5;break}if(0==(32&n)){i.istate.mode=7;break}i.istate.mode=2;case 2:if(0===i.avail_in)return e;e=t,i.avail_in--,i.total_in++,i.istate.need=(255&i.read_byte(i.next_in_index++))<<24&4278190080,i.istate.mode=3;case 3:if(0===i.avail_in)return e;e=t,i.avail_in--,i.total_in++,i.istate.need+=(255&i.read_byte(i.next_in_index++))<<16&16711680,i.istate.mode=4;case 4:if(0===i.avail_in)return e;e=t,i.avail_in--,i.total_in++,i.istate.need+=(255&i.read_byte(i.next_in_index++))<<8&65280,i.istate.mode=5;case 5:return 0===i.avail_in?e:(e=t,i.avail_in--,i.total_in++,i.istate.need+=255&i.read_byte(i.next_in_index++),i.istate.mode=6,2);case 6:return i.istate.mode=13,i.msg="need dictionary",i.istate.marker=0,j;case 7:if((e=i.istate.blocks.proc(i,e))==q){i.istate.mode=13,i.istate.marker=0;break}if((e=e==L?t:e)!=P)return e;e=t,i.istate.blocks.reset(i,i.istate.was),i.istate.mode=12;case 12:return P;case 13:return q;default:return j}},e.inflateSetDictionary=function(i,t,e){var n=0,a=e;return i&&i.istate&&6==i.istate.mode?(a>=1<<i.istate.wbits&&(n=e-(a=(1<<i.istate.wbits)-1)),i.istate.blocks.set_dictionary(t,n,a),i.istate.mode=7,L):j},e.inflateSync=function(i){var t,e,n,a,r;if(!i||!i.istate)return j;if(13!=i.istate.mode&&(i.istate.mode=13,i.istate.marker=0),0===(t=i.avail_in))return B;for(e=i.next_in_index,n=i.istate.marker;0!==t&&n<4;)i.read_byte(e)==l[n]?n++:n=0!==i.read_byte(e)?0:4-n,e++,t--;return i.total_in+=e-i.next_in_index,i.next_in_index=e,i.avail_in=t,4!=(i.istate.marker=n)?q:(a=i.total_in,r=i.total_out,_(i),i.total_in=a,i.total_out=r,i.istate.mode=7,L)},e.inflateSyncPoint=function(i){return i&&i.istate&&i.istate.blocks?i.istate.blocks.sync_point():j}}function i(){}function s(){var d=new i,s=new Uint8Array(512),f=!1;d.inflateInit(),d.next_out=s,this.append=function(i,t){var e,n,a=[],r=0,_=0,l=0;if(0!==i.length){d.next_in_index=0,d.next_in=i,d.avail_in=i.length;do{if(d.next_out_index=0,d.avail_out=512,0!==d.avail_in||f||(d.next_in_index=0,f=!0),e=d.inflate(0),f&&e==B)return-1;if(e!=L&&e!=P)throw"inflating: "+d.msg;if((f||e==P)&&d.avail_in==i.length)return-1}while(d.next_out_index&&(512==d.next_out_index?a.push(new Uint8Array(s)):a.push(new Uint8Array(s.subarray(0,d.next_out_index)))),l+=d.next_out_index,t&&0<d.next_in_index&&d.next_in_index!=r&&(t(d.next_in_index),r=d.next_in_index),0<d.avail_in||0===d.avail_out);return n=new Uint8Array(l),a.forEach(function(i){n.set(i,_),_+=i.length}),n}},this.flush=function(){d.inflateEnd()}}i.prototype={inflateInit:function(i){return this.istate=new d,i=i||15,this.istate.inflateInit(this,i)},inflate:function(i){return this.istate?this.istate.inflate(this,i):j},inflateEnd:function(){if(!this.istate)return j;var i=this.istate.inflateEnd(this);return this.istate=null,i},inflateSync:function(){return this.istate?this.istate.inflateSync(this):j},inflateSetDictionary:function(i,t){return this.istate?this.istate.inflateSetDictionary(this,i,t):j},read_byte:function(i){return this.next_in.subarray(i,i+1)[0]},read_buf:function(i,t){return this.next_in.subarray(i,i+t)}},t.zip?t.zip.Inflater=s:(_=new s,t.addEventListener("message",function(i){i=i.data;i.append&&t.postMessage({onappend:!0,data:_.append(i.data,function(i){t.postMessage({progress:!0,current:i})})}),i.flush&&(_.flush(),t.postMessage({onflush:!0}))},!1))}(this); \ No newline at end of file +!function(t){var L=0,P=1,j=-2,q=-3,u=-4,B=-5,C=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],F=1440,a=[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],r=[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],x=[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],w=[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],c=[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],v=[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],D=15;function G(){var s,f,E,S,U,z;function o(i,t,e,n,a,r,_,l,d,s,f){for(var o,b,u,x,w,c,v,h,k,m,y,g,p,A=0,I=e;E[i[t+A]]++,A++,0!==--I;);if(E[0]==e)return _[0]=-1,l[0]=0,L;for(v=l[0],w=1;w<=D&&0===E[w];w++);for(v<(c=w)&&(v=w),I=D;0!==I&&0===E[I];I--);for(l[0]=v=(u=I)<v?I:v,g=1<<w;w<I;w++,g<<=1)if((g-=E[w])<0)return q;if((g-=E[I])<0)return q;for(E[I]+=g,z[1]=w=0,A=1,y=2;0!=--I;)z[y]=w+=E[A],y++,A++;for(A=I=0;0!==(w=i[t+A])&&(f[z[w]++]=I),A++,++I<e;);for(e=z[u],z[0]=I=0,x=-1,m=-v,p=k=U[A=0]=0;c<=u;c++)for(o=E[c];0!=o--;){for(;m+v<c;){if(x++,p=v<(p=u-(m+=v))?v:p,(b=1<<(w=c-m))>o+1&&(b-=o+1,y=c,w<p))for(;++w<p&&!((b<<=1)<=E[++y]);)b-=E[y];if(s[0]+(p=1<<w)>F)return q;U[x]=k=s[0],s[0]+=p,0!==x?(z[x]=I,S[0]=w,S[1]=v,S[2]=k-U[x-1]-(w=I>>>m-v),d.set(S,3*(U[x-1]+w))):_[0]=k}for(S[1]=c-m,e<=A?S[0]=192:f[A]<n?(S[0]=f[A]<256?0:96,S[2]=f[A++]):(S[0]=r[f[A]-n]+16+64,S[2]=a[f[A++]-n]),b=1<<c-m,w=I>>>m;w<p;w+=b)d.set(S,3*(k+w));for(w=1<<c-1;0!=(I&w);w>>>=1)I^=w;for(I^=w,h=(1<<m)-1;(I&h)!=z[x];)x--,h=(1<<(m-=v))-1}return 0!==g&&1!=u?B:L}function b(i){var t;for(s||(s=[],f=[],E=new Int32Array(D+1),S=[],U=new Int32Array(D),z=new Int32Array(D+1)),f.length<i&&(f=[]),t=0;t<i;t++)f[t]=0;for(t=0;t<D+1;t++)E[t]=0;for(t=0;t<3;t++)S[t]=0;U.set(E.subarray(0,D),0),z.set(E.subarray(0,D+1),0)}this.inflate_trees_bits=function(i,t,e,n,a){return b(19),(n=o(i,s[0]=0,19,19,null,null,e,t,n,s,f))==q?a.msg="oversubscribed dynamic bit lengths tree":n!=B&&0!==t[0]||(a.msg="incomplete dynamic bit lengths tree",n=q),n},this.inflate_trees_dynamic=function(i,t,e,n,a,r,_,l,d){return b(288),(r=o(e,s[0]=0,i,257,x,w,r,n,l,s,f))!=L||0===n[0]?(r==q?d.msg="oversubscribed literal/length tree":r!=u&&(d.msg="incomplete literal/length tree",r=q),r):(b(288),(r=o(e,i,t,0,c,v,_,a,l,s,f))!=L||0===a[0]&&257<i?(r==q?d.msg="oversubscribed distance tree":r==B?(d.msg="incomplete distance tree",r=q):r!=u&&(d.msg="empty distance tree with lengths",r=q),r):L)}}G.inflate_trees_fixed=function(i,t,e,n){return i[0]=9,t[0]=5,e[0]=a,n[0]=r,L};var S=0,U=1,z=2,M=3,H=4,J=5,K=6,N=7,O=8,Q=9;function e(){var u,x,w,c,v=0,h=0,k=0,m=0,y=0,g=0,p=0,A=0,I=0,E=0;this.init=function(i,t,e,n,a,r){u=S,p=i,A=t,w=e,I=n,c=a,E=r,x=null},this.proc=function(i,t,e){for(var n,a,r,_,l=0,d=0,s=0,s=t.next_in_index,f=t.avail_in,l=i.bitb,d=i.bitk,o=i.write,b=o<i.read?i.read-o-1:i.end-o;;)switch(u){case S:if(258<=b&&10<=f&&(i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,e=function(i,t,e,n,a,r,_,l){var d,s,f,o,b,u,x,w,c=l.next_in_index,v=l.avail_in,h=_.bitb,k=_.bitk,m=_.write,y=m<_.read?_.read-m-1:_.end-m,g=C[i],p=C[t];do{for(;k<20;)v--,h|=(255&l.read_byte(c++))<<k,k+=8;if(0!==(o=(s=e)[w=3*((f=n)+(d=h&g))]))for(;;){if(h>>=s[w+1],k-=s[w+1],0!=(16&o)){for(o&=15,b=s[w+2]+(h&C[o]),h>>=o,k-=o;k<15;)v--,h|=(255&l.read_byte(c++))<<k,k+=8;for(o=(s=a)[w=3*((f=r)+(d=h&p))];;){if(h>>=s[w+1],k-=s[w+1],0!=(16&o)){for(o&=15;k<o;)v--,h|=(255&l.read_byte(c++))<<k,k+=8;if(u=s[w+2]+(h&C[o]),h>>=o,k-=o,y-=b,u<=m)0<m-(x=m-u)&&m-x<2?(_.window[m++]=_.window[x++],_.window[m++]=_.window[x++]):(_.window.set(_.window.subarray(x,x+2),m),m+=2,x+=2),b-=2;else{for(x=m-u;(x+=_.end)<0;);if((o=_.end-x)<b){if(b-=o,0<m-x&&m-x<o)for(;_.window[m++]=_.window[x++],0!=--o;);else _.window.set(_.window.subarray(x,x+o),m),m+=o,x+=o,o=0;x=0}}if(0<m-x&&m-x<b)for(;_.window[m++]=_.window[x++],0!=--b;);else _.window.set(_.window.subarray(x,x+b),m),m+=b,x+=b,b=0;break}if(0!=(64&o))return l.msg="invalid distance code",v+=b=k>>3<(b=l.avail_in-v)?k>>3:b,c-=b,k-=b<<3,_.bitb=h,_.bitk=k,l.avail_in=v,l.total_in+=c-l.next_in_index,l.next_in_index=c,_.write=m,q;d+=s[w+2],o=s[w=3*(f+(d+=h&C[o]))]}break}if(0!=(64&o))return 0!=(32&o)?(v+=b=k>>3<(b=l.avail_in-v)?k>>3:b,c-=b,k-=b<<3,_.bitb=h,_.bitk=k,l.avail_in=v,l.total_in+=c-l.next_in_index,l.next_in_index=c,_.write=m,P):(l.msg="invalid literal/length code",v+=b=k>>3<(b=l.avail_in-v)?k>>3:b,c-=b,k-=b<<3,_.bitb=h,_.bitk=k,l.avail_in=v,l.total_in+=c-l.next_in_index,l.next_in_index=c,_.write=m,q);if(d+=s[w+2],0===(o=s[w=3*(f+(d+=h&C[o]))])){h>>=s[w+1],k-=s[w+1],_.window[m++]=s[w+2],y--;break}}else h>>=s[w+1],k-=s[w+1],_.window[m++]=s[w+2],y--}while(258<=y&&10<=v);return v+=b=k>>3<(b=l.avail_in-v)?k>>3:b,c-=b,k-=b<<3,_.bitb=h,_.bitk=k,l.avail_in=v,l.total_in+=c-l.next_in_index,l.next_in_index=c,_.write=m,L}(p,A,w,I,c,E,i,t),s=t.next_in_index,f=t.avail_in,l=i.bitb,d=i.bitk,b=(o=i.write)<i.read?i.read-o-1:i.end-o,e!=L)){u=e==P?N:Q;break}k=p,x=w,h=I,u=U;case U:for(n=k;d<n;){if(0===f)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,f--,l|=(255&t.read_byte(s++))<<d,d+=8}if(a=3*(h+(l&C[n])),l>>>=x[a+1],d-=x[a+1],0===(r=x[a])){m=x[a+2],u=K;break}if(0!=(16&r)){y=15&r,v=x[a+2],u=z;break}if(0==(64&r)){k=r,h=a/3+x[a+2];break}if(0==(32&r))return u=Q,t.msg="invalid literal/length code",e=q,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);u=N;break;case z:for(n=y;d<n;){if(0===f)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,f--,l|=(255&t.read_byte(s++))<<d,d+=8}v+=l&C[n],l>>=n,d-=n,k=A,x=c,h=E,u=M;case M:for(n=k;d<n;){if(0===f)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,f--,l|=(255&t.read_byte(s++))<<d,d+=8}if(a=3*(h+(l&C[n])),l>>=x[a+1],d-=x[a+1],0!=(16&(r=x[a]))){y=15&r,g=x[a+2],u=H;break}if(0!=(64&r))return u=Q,t.msg="invalid distance code",e=q,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);k=r,h=a/3+x[a+2];break;case H:for(n=y;d<n;){if(0===f)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,f--,l|=(255&t.read_byte(s++))<<d,d+=8}g+=l&C[n],l>>=n,d-=n,u=J;case J:for(_=o-g;_<0;)_+=i.end;for(;0!==v;){if(0===b&&0===(b=o==i.end&&0!==i.read?(o=0)<i.read?i.read-o-1:i.end-o:b)&&(i.write=o,e=i.inflate_flush(t,e),b=(o=i.write)<i.read?i.read-o-1:i.end-o,0===(b=o==i.end&&0!==i.read?(o=0)<i.read?i.read-o-1:i.end-o:b)))return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);i.window[o++]=i.window[_++],b--,_==i.end&&(_=0),v--}u=S;break;case K:if(0===b&&0===(b=o==i.end&&0!==i.read?(o=0)<i.read?i.read-o-1:i.end-o:b)&&(i.write=o,e=i.inflate_flush(t,e),b=(o=i.write)<i.read?i.read-o-1:i.end-o,0===(b=o==i.end&&0!==i.read?(o=0)<i.read?i.read-o-1:i.end-o:b)))return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);e=L,i.window[o++]=m,b--,u=S;break;case N:if(7<d&&(d-=8,f++,s--),i.write=o,e=i.inflate_flush(t,e),b=(o=i.write)<i.read?i.read-o-1:i.end-o,i.read!=i.write)return i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);u=O;case O:return e=P,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);case Q:return e=q,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e);default:return e=j,i.bitb=l,i.bitk=d,t.avail_in=f,t.total_in+=s-t.next_in_index,t.next_in_index=s,i.write=o,i.inflate_flush(t,e)}},this.free=function(){}}var R=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=0,V=1,W=2,X=3,Y=4,Z=5,$=6,ii=7,ti=8,ei=9;function n(i,t){var m,y=this,g=T,p=0,A=0,I=0,E=[0],S=[0],U=new e,z=0,D=new Int32Array(3*F),M=new G;y.bitk=0,y.bitb=0,y.window=new Uint8Array(t),y.end=t,y.read=0,y.write=0,y.reset=function(i,t){t&&(t[0]=0),g==$&&U.free(i),g=T,y.bitk=0,y.bitb=0,y.read=y.write=0},y.reset(i,null),y.inflate_flush=function(i,t){var e=i.next_out_index,n=y.read,a=(n<=y.write?y.write:y.end)-n;return 0!==(a=a>i.avail_out?i.avail_out:a)&&t==B&&(t=L),i.avail_out-=a,i.total_out+=a,i.next_out.set(y.window.subarray(n,n+a),e),e+=a,(n+=a)==y.end&&(n=0,y.write==y.end&&(y.write=0),0!==(a=(a=y.write-n)>i.avail_out?i.avail_out:a)&&t==B&&(t=L),i.avail_out-=a,i.total_out+=a,i.next_out.set(y.window.subarray(n,n+a),e),e+=a,n+=a),i.next_out_index=e,y.read=n,t},y.proc=function(i,t){for(var e,n=i.next_in_index,a=i.avail_in,r=y.bitb,_=y.bitk,l=y.write,d=l<y.read?y.read-l-1:y.end-l;;)switch(g){case T:for(;_<3;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}switch(z=1&(w=7&r),w>>>1){case 0:r>>>=3,r>>>=w=7&(_-=3),_-=w,g=V;break;case 1:var s=[],f=[],o=[[]],b=[[]];G.inflate_trees_fixed(s,f,o,b),U.init(s[0],f[0],o[0],0,b[0],0),r>>>=3,_-=3,g=$;break;case 2:r>>>=3,_-=3,g=X;break;case 3:return r>>>=3,_-=3,g=ei,i.msg="invalid block type",t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t)}break;case V:for(;_<32;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}if((~r>>>16&65535)!=(65535&r))return g=ei,i.msg="invalid stored block lengths",t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);p=65535&r,r=_=0,g=0!==p?W:0!==z?ii:T;break;case W:if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);if(0===d&&0===(d=l==y.end&&0!==y.read?(l=0)<y.read?y.read-l-1:y.end-l:d)&&(y.write=l,t=y.inflate_flush(i,t),d=(l=y.write)<y.read?y.read-l-1:y.end-l,0===(d=l==y.end&&0!==y.read?(l=0)<y.read?y.read-l-1:y.end-l:d)))return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);if(t=L,d<(w=a<(w=p)?a:w)&&(w=d),y.window.set(i.read_buf(n,w),l),n+=w,a-=w,l+=w,d-=w,0!=(p-=w))break;g=0!==z?ii:T;break;case X:for(;_<14;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}if(A=w=16383&r,29<(31&w)||29<(w>>5&31))return g=ei,i.msg="too many length or distance symbols",t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);if(w=258+(31&w)+(w>>5&31),!m||m.length<w)m=[];else for(e=0;e<w;e++)m[e]=0;r>>>=14,_-=14,I=0,g=Y;case Y:for(;I<4+(A>>>10);){for(;_<3;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}m[R[I++]]=7&r,r>>>=3,_-=3}for(;I<19;)m[R[I++]]=0;if(E[0]=7,(w=M.inflate_trees_bits(m,E,S,D,i))!=L)return(t=w)==q&&(m=null,g=ei),y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);I=0,g=Z;case Z:for(;I<258+(31&(w=A))+(w>>5&31);){for(var u,x,w=E[0];_<w;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}if(w=D[3*(S[0]+(r&C[w]))+1],(x=D[3*(S[0]+(r&C[w]))+2])<16)r>>>=w,_-=w,m[I++]=x;else{for(e=18==x?7:x-14,u=18==x?11:3;_<w+e;){if(0===a)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);t=L,a--,r|=(255&i.read_byte(n++))<<_,_+=8}if(_-=w,u+=(r>>>=w)&C[e],r>>>=e,_-=e,258+(31&(w=A))+(w>>5&31)<(e=I)+u||16==x&&e<1)return m=null,g=ei,i.msg="invalid bit length repeat",t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);for(x=16==x?m[e-1]:0;m[e++]=x,0!=--u;);I=e}}S[0]=-1;var c=[],v=[],h=[],k=[];if(c[0]=9,v[0]=6,(w=M.inflate_trees_dynamic(257+(31&(w=A)),1+(w>>5&31),m,c,v,h,k,D,i))!=L)return w==q&&(m=null,g=ei),t=w,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);U.init(c[0],v[0],D,h[0],D,k[0]),g=$;case $:if(y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,(t=U.proc(y,i,t))!=P)return y.inflate_flush(i,t);if(t=L,U.free(i),n=i.next_in_index,a=i.avail_in,r=y.bitb,_=y.bitk,d=(l=y.write)<y.read?y.read-l-1:y.end-l,0===z){g=T;break}g=ii;case ii:if(y.write=l,t=y.inflate_flush(i,t),d=(l=y.write)<y.read?y.read-l-1:y.end-l,y.read!=y.write)return y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);g=ti;case ti:return t=P,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);case ei:return t=q,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t);default:return t=j,y.bitb=r,y.bitk=_,i.avail_in=a,i.total_in+=n-i.next_in_index,i.next_in_index=n,y.write=l,y.inflate_flush(i,t)}},y.free=function(i){y.reset(i,null),y.window=null,D=null},y.set_dictionary=function(i,t,e){y.window.set(i.subarray(t,t+e),0),y.read=y.write=e},y.sync_point=function(){return g==V?1:0}}var _,l=[0,0,255,255];function d(){var e=this;function _(i){return i&&i.istate?(i.total_in=i.total_out=0,i.msg=null,i.istate.mode=7,i.istate.blocks.reset(i,null),L):j}e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0,e.inflateEnd=function(i){return e.blocks&&e.blocks.free(i),e.blocks=null,L},e.inflateInit=function(i,t){return i.msg=null,e.blocks=null,t<8||15<t?(e.inflateEnd(i),j):(e.wbits=t,i.istate.blocks=new n(i,1<<t),_(i),L)},e.inflate=function(i,t){var e,n;if(!i||!i.istate||!i.next_in)return j;for(t=4==t?B:L,e=B;;)switch(i.istate.mode){case 0:if(0===i.avail_in)return e;if(e=t,i.avail_in--,i.total_in++,8!=(15&(i.istate.method=i.read_byte(i.next_in_index++)))){i.istate.mode=13,i.msg="unknown compression method",i.istate.marker=5;break}if(8+(i.istate.method>>4)>i.istate.wbits){i.istate.mode=13,i.msg="invalid window size",i.istate.marker=5;break}i.istate.mode=1;case 1:if(0===i.avail_in)return e;if(e=t,i.avail_in--,i.total_in++,n=255&i.read_byte(i.next_in_index++),((i.istate.method<<8)+n)%31!=0){i.istate.mode=13,i.msg="incorrect header check",i.istate.marker=5;break}if(0==(32&n)){i.istate.mode=7;break}i.istate.mode=2;case 2:if(0===i.avail_in)return e;e=t,i.avail_in--,i.total_in++,i.istate.need=(255&i.read_byte(i.next_in_index++))<<24&4278190080,i.istate.mode=3;case 3:if(0===i.avail_in)return e;e=t,i.avail_in--,i.total_in++,i.istate.need+=(255&i.read_byte(i.next_in_index++))<<16&16711680,i.istate.mode=4;case 4:if(0===i.avail_in)return e;e=t,i.avail_in--,i.total_in++,i.istate.need+=(255&i.read_byte(i.next_in_index++))<<8&65280,i.istate.mode=5;case 5:return 0===i.avail_in?e:(e=t,i.avail_in--,i.total_in++,i.istate.need+=255&i.read_byte(i.next_in_index++),i.istate.mode=6,2);case 6:return i.istate.mode=13,i.msg="need dictionary",i.istate.marker=0,j;case 7:if((e=i.istate.blocks.proc(i,e))==q){i.istate.mode=13,i.istate.marker=0;break}if((e=e==L?t:e)!=P)return e;e=t,i.istate.blocks.reset(i,i.istate.was),i.istate.mode=12;case 12:return P;case 13:return q;default:return j}},e.inflateSetDictionary=function(i,t,e){var n=0,a=e;return i&&i.istate&&6==i.istate.mode?(a>=1<<i.istate.wbits&&(n=e-(a=(1<<i.istate.wbits)-1)),i.istate.blocks.set_dictionary(t,n,a),i.istate.mode=7,L):j},e.inflateSync=function(i){var t,e,n,a,r;if(!i||!i.istate)return j;if(13!=i.istate.mode&&(i.istate.mode=13,i.istate.marker=0),0===(t=i.avail_in))return B;for(e=i.next_in_index,n=i.istate.marker;0!==t&&n<4;)i.read_byte(e)==l[n]?n++:n=0!==i.read_byte(e)?0:4-n,e++,t--;return i.total_in+=e-i.next_in_index,i.next_in_index=e,i.avail_in=t,4!=(i.istate.marker=n)?q:(a=i.total_in,r=i.total_out,_(i),i.total_in=a,i.total_out=r,i.istate.mode=7,L)},e.inflateSyncPoint=function(i){return i&&i.istate&&i.istate.blocks?i.istate.blocks.sync_point():j}}function i(){}function s(){var d=new i,s=new Uint8Array(512),f=!1;d.inflateInit(),d.next_out=s,this.append=function(i,t){var e,n,a=[],r=0,_=0,l=0;if(0!==i.length){d.next_in_index=0,d.next_in=i,d.avail_in=i.length;do{if(d.next_out_index=0,d.avail_out=512,0!==d.avail_in||f||(d.next_in_index=0,f=!0),e=d.inflate(0),f&&e==B)return-1;if(e!=L&&e!=P)throw"inflating: "+d.msg;if((f||e==P)&&d.avail_in==i.length)return-1}while(d.next_out_index&&(512==d.next_out_index?a.push(new Uint8Array(s)):a.push(new Uint8Array(s.subarray(0,d.next_out_index)))),l+=d.next_out_index,t&&0<d.next_in_index&&d.next_in_index!=r&&(t(d.next_in_index),r=d.next_in_index),0<d.avail_in||0===d.avail_out);return n=new Uint8Array(l),a.forEach(function(i){n.set(i,_),_+=i.length}),n}},this.flush=function(){d.inflateEnd()}}i.prototype={inflateInit:function(i){return this.istate=new d,this.istate.inflateInit(this,i=i||15)},inflate:function(i){return this.istate?this.istate.inflate(this,i):j},inflateEnd:function(){if(!this.istate)return j;var i=this.istate.inflateEnd(this);return this.istate=null,i},inflateSync:function(){return this.istate?this.istate.inflateSync(this):j},inflateSetDictionary:function(i,t){return this.istate?this.istate.inflateSetDictionary(this,i,t):j},read_byte:function(i){return this.next_in.subarray(i,i+1)[0]},read_buf:function(i,t){return this.next_in.subarray(i,i+t)}},t.zip?t.zip.Inflater=s:(_=new s,t.addEventListener("message",function(i){i=i.data;i.append&&t.postMessage({onappend:!0,data:_.append(i.data,function(i){t.postMessage({progress:!0,current:i})})}),i.flush&&(_.flush(),t.postMessage({onflush:!0}))},!1))}(this); \ No newline at end of file diff --git a/public/Cesium/Workers/ArcType-dc1c5aee.js b/public/Cesium/Workers/ArcType-2b58731c.js similarity index 100% rename from public/Cesium/Workers/ArcType-dc1c5aee.js rename to public/Cesium/Workers/ArcType-2b58731c.js diff --git a/public/Cesium/Workers/AttributeCompression-f02ec82f.js b/public/Cesium/Workers/AttributeCompression-10c27d9c.js similarity index 52% rename from public/Cesium/Workers/AttributeCompression-f02ec82f.js rename to public/Cesium/Workers/AttributeCompression-10c27d9c.js index f5897ee..bf3ef32 100644 --- a/public/Cesium/Workers/AttributeCompression-f02ec82f.js +++ b/public/Cesium/Workers/AttributeCompression-10c27d9c.js @@ -1 +1 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694"],function(t,a,o,u,c){"use strict";var i={octEncodeInRange:function(t,o,e){var n;return e.x=t.x/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),e.y=t.y/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),t.z<0&&(n=e.x,t=e.y,e.x=(1-Math.abs(t))*c.CesiumMath.signNotZero(n),e.y=(1-Math.abs(n))*c.CesiumMath.signNotZero(t)),e.x=c.CesiumMath.toSNorm(e.x,o),e.y=c.CesiumMath.toSNorm(e.y,o),e},octEncode:function(t,o){return i.octEncodeInRange(t,255,o)}},e=new a.Cartesian2,n=new Uint8Array(1);function r(t){return n[0]=t,n[0]}i.octEncodeToCartesian4=function(t,o){return i.octEncodeInRange(t,65535,e),o.x=r(e.x*(1/256)),o.y=r(e.x),o.z=r(e.y*(1/256)),o.w=r(e.y),o},i.octDecodeInRange=function(t,o,e,n){return n.x=c.CesiumMath.fromSNorm(t,e),n.y=c.CesiumMath.fromSNorm(o,e),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0&&(e=n.x,n.x=(1-Math.abs(n.y))*c.CesiumMath.signNotZero(e),n.y=(1-Math.abs(e))*c.CesiumMath.signNotZero(n.y)),a.Cartesian3.normalize(n,n)},i.octDecode=function(t,o,e){return i.octDecodeInRange(t,o,255,e)},i.octDecodeFromCartesian4=function(t,o){var e=256*t.x+t.y,t=256*t.z+t.w;return i.octDecodeInRange(e,t,65535,o)},i.octPackFloat=function(t){return 256*t.x+t.y};var s=new a.Cartesian2;function d(t){return t>>1^-(1&t)}i.octEncodeFloat=function(t){return i.octEncode(t,s),i.octPackFloat(s)},i.octDecodeFloat=function(t,o){var e=t/256,t=Math.floor(e),e=256*(e-t);return i.octDecode(t,e,o)},i.octPack=function(t,o,e,n){t=i.octEncodeFloat(t),o=i.octEncodeFloat(o),e=i.octEncode(e,s);return n.x=65536*e.x+t,n.y=65536*e.y+o,n},i.octUnpack=function(t,o,e,n){var a=t.x/65536,c=Math.floor(a),r=65536*(a-c),a=t.y/65536,t=Math.floor(a),a=65536*(a-t);i.octDecodeFloat(r,o),i.octDecodeFloat(a,e),i.octDecode(c,t,n)},i.compressTextureCoordinates=function(t){return 4096*(4095*t.x|0)+(4095*t.y|0)},i.decompressTextureCoordinates=function(t,o){var e=t/4096,e=Math.floor(e);return o.x=e/4095,o.y=(t-4096*e)/4095,o},i.zigZagDeltaDecode=function(t,o,e){for(var n=t.length,a=0,c=0,r=0,i=0;i<n;++i)a+=d(t[i]),c+=d(o[i]),t[i]=a,o[i]=c,u.defined(e)&&(r+=d(e[i]),e[i]=r)},t.AttributeCompression=i}); +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Math-d6182036"],function(t,a,o,u,c){"use strict";var i={octEncodeInRange:function(t,o,e){var n;return e.x=t.x/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),e.y=t.y/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),t.z<0&&(n=e.x,t=e.y,e.x=(1-Math.abs(t))*c.CesiumMath.signNotZero(n),e.y=(1-Math.abs(n))*c.CesiumMath.signNotZero(t)),e.x=c.CesiumMath.toSNorm(e.x,o),e.y=c.CesiumMath.toSNorm(e.y,o),e},octEncode:function(t,o){return i.octEncodeInRange(t,255,o)}},e=new a.Cartesian2,n=new Uint8Array(1);function r(t){return n[0]=t,n[0]}i.octEncodeToCartesian4=function(t,o){return i.octEncodeInRange(t,65535,e),o.x=r(e.x*(1/256)),o.y=r(e.x),o.z=r(e.y*(1/256)),o.w=r(e.y),o},i.octDecodeInRange=function(t,o,e,n){return n.x=c.CesiumMath.fromSNorm(t,e),n.y=c.CesiumMath.fromSNorm(o,e),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0&&(e=n.x,n.x=(1-Math.abs(n.y))*c.CesiumMath.signNotZero(e),n.y=(1-Math.abs(e))*c.CesiumMath.signNotZero(n.y)),a.Cartesian3.normalize(n,n)},i.octDecode=function(t,o,e){return i.octDecodeInRange(t,o,255,e)},i.octDecodeFromCartesian4=function(t,o){var e=t.x,n=t.y,a=t.z,t=t.w;return i.octDecodeInRange(256*e+n,256*a+t,65535,o)},i.octPackFloat=function(t){return 256*t.x+t.y};var s=new a.Cartesian2;function d(t){return t>>1^-(1&t)}i.octEncodeFloat=function(t){return i.octEncode(t,s),i.octPackFloat(s)},i.octDecodeFloat=function(t,o){var e=t/256,t=Math.floor(e);return i.octDecode(t,256*(e-t),o)},i.octPack=function(t,o,e,n){t=i.octEncodeFloat(t),o=i.octEncodeFloat(o),e=i.octEncode(e,s);return n.x=65536*e.x+t,n.y=65536*e.y+o,n},i.octUnpack=function(t,o,e,n){var a=t.x/65536,c=Math.floor(a),r=65536*(a-c),a=t.y/65536,t=Math.floor(a),a=65536*(a-t);i.octDecodeFloat(r,o),i.octDecodeFloat(a,e),i.octDecode(c,t,n)},i.compressTextureCoordinates=function(t){return 4096*(4095*t.x|0)+(4095*t.y|0)},i.decompressTextureCoordinates=function(t,o){var e=Math.floor(t/4096);return o.x=e/4095,o.y=(t-4096*e)/4095,o},i.zigZagDeltaDecode=function(t,o,e){for(var n=t.length,a=0,c=0,r=0,i=0;i<n;++i)a+=d(t[i]),c+=d(o[i]),t[i]=a,o[i]=c,u.defined(e)&&(r+=d(e[i]),e[i]=r)},t.AttributeCompression=i}); diff --git a/public/Cesium/Workers/BoundingRectangle-07202124.js b/public/Cesium/Workers/BoundingRectangle-07202124.js new file mode 100644 index 0000000..865af40 --- /dev/null +++ b/public/Cesium/Workers/BoundingRectangle-07202124.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Transforms-79117a7b"],function(t,h,e,c,a){"use strict";function f(t,e,n,i){this.x=c.defaultValue(t,0),this.y=c.defaultValue(e,0),this.width=c.defaultValue(n,0),this.height=c.defaultValue(i,0)}f.packedLength=4,f.pack=function(t,e,n){return n=c.defaultValue(n,0),e[n++]=t.x,e[n++]=t.y,e[n++]=t.width,e[n]=t.height,e},f.unpack=function(t,e,n){return e=c.defaultValue(e,0),(n=!c.defined(n)?new f:n).x=t[e++],n.y=t[e++],n.width=t[e++],n.height=t[e],n},f.fromPoints=function(t,e){if(c.defined(e)||(e=new f),!c.defined(t)||0===t.length)return e.x=0,e.y=0,e.width=0,e.height=0,e;for(var n=t.length,i=t[0].x,h=t[0].y,r=t[0].x,a=t[0].y,d=1;d<n;d++)var u=t[d],o=u.x,u=u.y,i=Math.min(o,i),r=Math.max(o,r),h=Math.min(u,h),a=Math.max(u,a);return e.x=i,e.y=h,e.width=r-i,e.height=a-h,e};var r=new a.GeographicProjection,d=new h.Cartographic,u=new h.Cartographic;f.fromRectangle=function(t,e,n){if(c.defined(n)||(n=new f),!c.defined(t))return n.x=0,n.y=0,n.width=0,n.height=0,n;var i=(e=c.defaultValue(e,r)).project(h.Rectangle.southwest(t,d)),t=e.project(h.Rectangle.northeast(t,u));return h.Cartesian2.subtract(t,i,t),n.x=i.x,n.y=i.y,n.width=t.x,n.height=t.y,n},f.clone=function(t,e){if(c.defined(t))return c.defined(e)?(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e):new f(t.x,t.y,t.width,t.height)},f.union=function(t,e,n){c.defined(n)||(n=new f);var i=Math.min(t.x,e.x),h=Math.min(t.y,e.y),r=Math.max(t.x+t.width,e.x+e.width),e=Math.max(t.y+t.height,e.y+e.height);return n.x=i,n.y=h,n.width=r-i,n.height=e-h,n},f.expand=function(t,e,n){n=f.clone(t,n);var i=e.x-n.x,t=e.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=e.x),t>n.height?n.height=t:t<0&&(n.height-=t,n.y=e.y),n},f.intersect=function(t,e){var n=t.x,i=t.y,h=e.x,r=e.y;return n>h+e.width||n+t.width<h||i+t.height<r||i>r+e.height?a.Intersect.OUTSIDE:a.Intersect.INTERSECTING},f.equals=function(t,e){return t===e||c.defined(t)&&c.defined(e)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},f.prototype.clone=function(t){return f.clone(this,t)},f.prototype.intersect=function(t){return f.intersect(this,t)},f.prototype.equals=function(t){return f.equals(this,t)},t.BoundingRectangle=f}); diff --git a/public/Cesium/Workers/BoundingRectangle-7ee12c46.js b/public/Cesium/Workers/BoundingRectangle-7ee12c46.js deleted file mode 100644 index 60accdf..0000000 --- a/public/Cesium/Workers/BoundingRectangle-7ee12c46.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Transforms-a73b3b3b"],function(t,h,e,f,a){"use strict";function o(t,e,n,i){this.x=f.defaultValue(t,0),this.y=f.defaultValue(e,0),this.width=f.defaultValue(n,0),this.height=f.defaultValue(i,0)}o.packedLength=4,o.pack=function(t,e,n){return n=f.defaultValue(n,0),e[n++]=t.x,e[n++]=t.y,e[n++]=t.width,e[n]=t.height,e},o.unpack=function(t,e,n){return e=f.defaultValue(e,0),(n=!f.defined(n)?new o:n).x=t[e++],n.y=t[e++],n.width=t[e++],n.height=t[e],n},o.fromPoints=function(t,e){if(f.defined(e)||(e=new o),!f.defined(t)||0===t.length)return e.x=0,e.y=0,e.width=0,e.height=0,e;for(var n=t.length,i=t[0].x,h=t[0].y,r=t[0].x,a=t[0].y,d=1;d<n;d++)var u=t[d],c=u.x,u=u.y,i=Math.min(c,i),r=Math.max(c,r),h=Math.min(u,h),a=Math.max(u,a);return e.x=i,e.y=h,e.width=r-i,e.height=a-h,e};var r=new a.GeographicProjection,d=new h.Cartographic,u=new h.Cartographic;o.fromRectangle=function(t,e,n){if(f.defined(n)||(n=new o),!f.defined(t))return n.x=0,n.y=0,n.width=0,n.height=0,n;var i=(e=f.defaultValue(e,r)).project(h.Rectangle.southwest(t,d)),t=e.project(h.Rectangle.northeast(t,u));return h.Cartesian2.subtract(t,i,t),n.x=i.x,n.y=i.y,n.width=t.x,n.height=t.y,n},o.clone=function(t,e){if(f.defined(t))return f.defined(e)?(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e):new o(t.x,t.y,t.width,t.height)},o.union=function(t,e,n){f.defined(n)||(n=new o);var i=Math.min(t.x,e.x),h=Math.min(t.y,e.y),r=Math.max(t.x+t.width,e.x+e.width),e=Math.max(t.y+t.height,e.y+e.height);return n.x=i,n.y=h,n.width=r-i,n.height=e-h,n},o.expand=function(t,e,n){n=o.clone(t,n);var i=e.x-n.x,t=e.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=e.x),t>n.height?n.height=t:t<0&&(n.height-=t,n.y=e.y),n},o.intersect=function(t,e){var n=t.x,i=t.y,h=e.x,r=e.y;return n>h+e.width||n+t.width<h||i+t.height<r||i>r+e.height?a.Intersect.OUTSIDE:a.Intersect.INTERSECTING},o.equals=function(t,e){return t===e||f.defined(t)&&f.defined(e)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.intersect=function(t){return o.intersect(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},t.BoundingRectangle=o}); diff --git a/public/Cesium/Workers/BoxGeometry-c7d4febc.js b/public/Cesium/Workers/BoxGeometry-0609cbde.js similarity index 75% rename from public/Cesium/Workers/BoxGeometry-c7d4febc.js rename to public/Cesium/Workers/BoxGeometry-0609cbde.js index 319a26e..7fd1b99 100644 --- a/public/Cesium/Workers/BoxGeometry-c7d4febc.js +++ b/public/Cesium/Workers/BoxGeometry-0609cbde.js @@ -1 +1 @@ -define(["exports","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./when-208fe5b0","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./VertexFormat-e8cbf5b3"],function(t,s,y,p,e,x,f,c,A,o){"use strict";var b=new p.Cartesian3;function m(t){var e=(t=f.defaultValue(t,f.defaultValue.EMPTY_OBJECT)).minimum,a=t.maximum,n=f.defaultValue(t.vertexFormat,o.VertexFormat.DEFAULT);this._minimum=p.Cartesian3.clone(e),this._maximum=p.Cartesian3.clone(a),this._vertexFormat=n,this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxGeometry"}m.fromDimensions=function(t){var e=(t=f.defaultValue(t,f.defaultValue.EMPTY_OBJECT)).dimensions,e=p.Cartesian3.multiplyByScalar(e,.5,new p.Cartesian3);return new m({minimum:p.Cartesian3.negate(e,new p.Cartesian3),maximum:e,vertexFormat:t.vertexFormat,offsetAttribute:t.offsetAttribute})},m.fromAxisAlignedBoundingBox=function(t){return new m({minimum:t.minimum,maximum:t.maximum})},m.packedLength=2*p.Cartesian3.packedLength+o.VertexFormat.packedLength+1,m.pack=function(t,e,a){return a=f.defaultValue(a,0),p.Cartesian3.pack(t._minimum,e,a),p.Cartesian3.pack(t._maximum,e,a+p.Cartesian3.packedLength),o.VertexFormat.pack(t._vertexFormat,e,a+2*p.Cartesian3.packedLength),e[a+2*p.Cartesian3.packedLength+o.VertexFormat.packedLength]=f.defaultValue(t._offsetAttribute,-1),e};var a,u=new p.Cartesian3,l=new p.Cartesian3,d=new o.VertexFormat,C={minimum:u,maximum:l,vertexFormat:d,offsetAttribute:void 0};m.unpack=function(t,e,a){e=f.defaultValue(e,0);var n=p.Cartesian3.unpack(t,e,u),r=p.Cartesian3.unpack(t,e+p.Cartesian3.packedLength,l),i=o.VertexFormat.unpack(t,e+2*p.Cartesian3.packedLength,d),e=t[e+2*p.Cartesian3.packedLength+o.VertexFormat.packedLength];return f.defined(a)?(a._minimum=p.Cartesian3.clone(n,a._minimum),a._maximum=p.Cartesian3.clone(r,a._maximum),a._vertexFormat=o.VertexFormat.clone(i,a._vertexFormat),a._offsetAttribute=-1===e?void 0:e,a):(C.offsetAttribute=-1===e?void 0:e,new m(C))},m.createGeometry=function(t){var e=t._minimum,a=t._maximum,n=t._vertexFormat;if(!p.Cartesian3.equals(e,a)){var r,i,o,m=new A.GeometryAttributes;n.position&&(n.st||n.normal||n.tangent||n.bitangent)?(n.position&&((u=new Float64Array(72))[0]=e.x,u[1]=e.y,u[2]=a.z,u[3]=a.x,u[4]=e.y,u[5]=a.z,u[6]=a.x,u[7]=a.y,u[8]=a.z,u[9]=e.x,u[10]=a.y,u[11]=a.z,u[12]=e.x,u[13]=e.y,u[14]=e.z,u[15]=a.x,u[16]=e.y,u[17]=e.z,u[18]=a.x,u[19]=a.y,u[20]=e.z,u[21]=e.x,u[22]=a.y,u[23]=e.z,u[24]=a.x,u[25]=e.y,u[26]=e.z,u[27]=a.x,u[28]=a.y,u[29]=e.z,u[30]=a.x,u[31]=a.y,u[32]=a.z,u[33]=a.x,u[34]=e.y,u[35]=a.z,u[36]=e.x,u[37]=e.y,u[38]=e.z,u[39]=e.x,u[40]=a.y,u[41]=e.z,u[42]=e.x,u[43]=a.y,u[44]=a.z,u[45]=e.x,u[46]=e.y,u[47]=a.z,u[48]=e.x,u[49]=a.y,u[50]=e.z,u[51]=a.x,u[52]=a.y,u[53]=e.z,u[54]=a.x,u[55]=a.y,u[56]=a.z,u[57]=e.x,u[58]=a.y,u[59]=a.z,u[60]=e.x,u[61]=e.y,u[62]=e.z,u[63]=a.x,u[64]=e.y,u[65]=e.z,u[66]=a.x,u[67]=e.y,u[68]=a.z,u[69]=e.x,u[70]=e.y,u[71]=a.z,m.position=new c.GeometryAttribute({componentDatatype:x.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&((r=new Float32Array(72))[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,r[12]=0,r[13]=0,r[14]=-1,r[15]=0,r[16]=0,r[17]=-1,r[18]=0,r[19]=0,r[20]=-1,r[21]=0,r[22]=0,r[23]=-1,r[24]=1,r[25]=0,r[26]=0,r[27]=1,r[28]=0,r[29]=0,r[30]=1,r[31]=0,r[32]=0,r[33]=1,r[34]=0,r[35]=0,r[36]=-1,r[37]=0,r[38]=0,r[39]=-1,r[40]=0,r[41]=0,r[42]=-1,r[43]=0,r[44]=0,r[45]=-1,r[46]=0,r[47]=0,r[48]=0,r[49]=1,r[50]=0,r[51]=0,r[52]=1,r[53]=0,r[54]=0,r[55]=1,r[56]=0,r[57]=0,r[58]=1,r[59]=0,r[60]=0,r[61]=-1,r[62]=0,r[63]=0,r[64]=-1,r[65]=0,r[66]=0,r[67]=-1,r[68]=0,r[69]=0,r[70]=-1,r[71]=0,m.normal=new c.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r})),n.st&&((i=new Float32Array(48))[0]=0,i[1]=0,i[2]=1,i[3]=0,i[4]=1,i[5]=1,i[6]=0,i[7]=1,i[8]=1,i[9]=0,i[10]=0,i[11]=0,i[12]=0,i[13]=1,i[14]=1,i[15]=1,i[16]=0,i[17]=0,i[18]=1,i[19]=0,i[20]=1,i[21]=1,i[22]=0,i[23]=1,i[24]=1,i[25]=0,i[26]=0,i[27]=0,i[28]=0,i[29]=1,i[30]=1,i[31]=1,i[32]=1,i[33]=0,i[34]=0,i[35]=0,i[36]=0,i[37]=1,i[38]=1,i[39]=1,i[40]=0,i[41]=0,i[42]=1,i[43]=0,i[44]=1,i[45]=1,i[46]=0,i[47]=1,m.st=new c.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})),n.tangent&&((i=new Float32Array(72))[0]=1,i[1]=0,i[2]=0,i[3]=1,i[4]=0,i[5]=0,i[6]=1,i[7]=0,i[8]=0,i[9]=1,i[10]=0,i[11]=0,i[12]=-1,i[13]=0,i[14]=0,i[15]=-1,i[16]=0,i[17]=0,i[18]=-1,i[19]=0,i[20]=0,i[21]=-1,i[22]=0,i[23]=0,i[24]=0,i[25]=1,i[26]=0,i[27]=0,i[28]=1,i[29]=0,i[30]=0,i[31]=1,i[32]=0,i[33]=0,i[34]=1,i[35]=0,i[36]=0,i[37]=-1,i[38]=0,i[39]=0,i[40]=-1,i[41]=0,i[42]=0,i[43]=-1,i[44]=0,i[45]=0,i[46]=-1,i[47]=0,i[48]=-1,i[49]=0,i[50]=0,i[51]=-1,i[52]=0,i[53]=0,i[54]=-1,i[55]=0,i[56]=0,i[57]=-1,i[58]=0,i[59]=0,i[60]=1,i[61]=0,i[62]=0,i[63]=1,i[64]=0,i[65]=0,i[66]=1,i[67]=0,i[68]=0,i[69]=1,i[70]=0,i[71]=0,m.tangent=new c.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:i})),n.bitangent&&((o=new Float32Array(72))[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=1,o[14]=0,o[15]=0,o[16]=1,o[17]=0,o[18]=0,o[19]=1,o[20]=0,o[21]=0,o[22]=1,o[23]=0,o[24]=0,o[25]=0,o[26]=1,o[27]=0,o[28]=0,o[29]=1,o[30]=0,o[31]=0,o[32]=1,o[33]=0,o[34]=0,o[35]=1,o[36]=0,o[37]=0,o[38]=1,o[39]=0,o[40]=0,o[41]=1,o[42]=0,o[43]=0,o[44]=1,o[45]=0,o[46]=0,o[47]=1,o[48]=0,o[49]=0,o[50]=1,o[51]=0,o[52]=0,o[53]=1,o[54]=0,o[55]=0,o[56]=1,o[57]=0,o[58]=0,o[59]=1,o[60]=0,o[61]=0,o[62]=1,o[63]=0,o[64]=0,o[65]=1,o[66]=0,o[67]=0,o[68]=1,o[69]=0,o[70]=0,o[71]=1,m.bitangent=new c.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:o})),(o=new Uint16Array(36))[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23):((u=new Float64Array(24))[0]=e.x,u[1]=e.y,u[2]=e.z,u[3]=a.x,u[4]=e.y,u[5]=e.z,u[6]=a.x,u[7]=a.y,u[8]=e.z,u[9]=e.x,u[10]=a.y,u[11]=e.z,u[12]=e.x,u[13]=e.y,u[14]=a.z,u[15]=a.x,u[16]=e.y,u[17]=a.z,u[18]=a.x,u[19]=a.y,u[20]=a.z,u[21]=e.x,u[22]=a.y,u[23]=a.z,m.position=new c.GeometryAttribute({componentDatatype:x.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),(o=new Uint16Array(36))[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4);var u,a=p.Cartesian3.subtract(a,e,b),e=.5*p.Cartesian3.magnitude(a);return f.defined(t._offsetAttribute)&&(a=u.length,u=new Uint8Array(a/3),a=t._offsetAttribute===s.GeometryOffsetAttribute.NONE?0:1,s.arrayFill(u,a),m.applyOffset=new c.GeometryAttribute({componentDatatype:x.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})),new c.Geometry({attributes:m,indices:o,primitiveType:c.PrimitiveType.TRIANGLES,boundingSphere:new y.BoundingSphere(p.Cartesian3.ZERO,e),offsetAttribute:t._offsetAttribute})}},m.getUnitBox=function(){return a=!f.defined(a)?m.createGeometry(m.fromDimensions({dimensions:new p.Cartesian3(1,1,1),vertexFormat:o.VertexFormat.POSITION_ONLY})):a},t.BoxGeometry=m}); +define(["exports","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./when-54335d57","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./VertexFormat-81ec7207"],function(t,s,y,p,e,x,c,f,A,o){"use strict";var l=new p.Cartesian3;function m(t){var e=(t=c.defaultValue(t,c.defaultValue.EMPTY_OBJECT)).minimum,a=t.maximum,n=c.defaultValue(t.vertexFormat,o.VertexFormat.DEFAULT);this._minimum=p.Cartesian3.clone(e),this._maximum=p.Cartesian3.clone(a),this._vertexFormat=n,this._offsetAttribute=t.offsetAttribute,this._workerName="createBoxGeometry"}m.fromDimensions=function(t){var e=(t=c.defaultValue(t,c.defaultValue.EMPTY_OBJECT)).dimensions,e=p.Cartesian3.multiplyByScalar(e,.5,new p.Cartesian3);return new m({minimum:p.Cartesian3.negate(e,new p.Cartesian3),maximum:e,vertexFormat:t.vertexFormat,offsetAttribute:t.offsetAttribute})},m.fromAxisAlignedBoundingBox=function(t){return new m({minimum:t.minimum,maximum:t.maximum})},m.packedLength=2*p.Cartesian3.packedLength+o.VertexFormat.packedLength+1,m.pack=function(t,e,a){return a=c.defaultValue(a,0),p.Cartesian3.pack(t._minimum,e,a),p.Cartesian3.pack(t._maximum,e,a+p.Cartesian3.packedLength),o.VertexFormat.pack(t._vertexFormat,e,a+2*p.Cartesian3.packedLength),e[a+2*p.Cartesian3.packedLength+o.VertexFormat.packedLength]=c.defaultValue(t._offsetAttribute,-1),e};var a,u=new p.Cartesian3,d=new p.Cartesian3,C=new o.VertexFormat,b={minimum:u,maximum:d,vertexFormat:C,offsetAttribute:void 0};m.unpack=function(t,e,a){e=c.defaultValue(e,0);var n=p.Cartesian3.unpack(t,e,u),r=p.Cartesian3.unpack(t,e+p.Cartesian3.packedLength,d),i=o.VertexFormat.unpack(t,e+2*p.Cartesian3.packedLength,C),e=t[e+2*p.Cartesian3.packedLength+o.VertexFormat.packedLength];return c.defined(a)?(a._minimum=p.Cartesian3.clone(n,a._minimum),a._maximum=p.Cartesian3.clone(r,a._maximum),a._vertexFormat=o.VertexFormat.clone(i,a._vertexFormat),a._offsetAttribute=-1===e?void 0:e,a):(b.offsetAttribute=-1===e?void 0:e,new m(b))},m.createGeometry=function(t){var e=t._minimum,a=t._maximum,n=t._vertexFormat;if(!p.Cartesian3.equals(e,a)){var r,i,o,m=new A.GeometryAttributes;n.position&&(n.st||n.normal||n.tangent||n.bitangent)?(n.position&&((u=new Float64Array(72))[0]=e.x,u[1]=e.y,u[2]=a.z,u[3]=a.x,u[4]=e.y,u[5]=a.z,u[6]=a.x,u[7]=a.y,u[8]=a.z,u[9]=e.x,u[10]=a.y,u[11]=a.z,u[12]=e.x,u[13]=e.y,u[14]=e.z,u[15]=a.x,u[16]=e.y,u[17]=e.z,u[18]=a.x,u[19]=a.y,u[20]=e.z,u[21]=e.x,u[22]=a.y,u[23]=e.z,u[24]=a.x,u[25]=e.y,u[26]=e.z,u[27]=a.x,u[28]=a.y,u[29]=e.z,u[30]=a.x,u[31]=a.y,u[32]=a.z,u[33]=a.x,u[34]=e.y,u[35]=a.z,u[36]=e.x,u[37]=e.y,u[38]=e.z,u[39]=e.x,u[40]=a.y,u[41]=e.z,u[42]=e.x,u[43]=a.y,u[44]=a.z,u[45]=e.x,u[46]=e.y,u[47]=a.z,u[48]=e.x,u[49]=a.y,u[50]=e.z,u[51]=a.x,u[52]=a.y,u[53]=e.z,u[54]=a.x,u[55]=a.y,u[56]=a.z,u[57]=e.x,u[58]=a.y,u[59]=a.z,u[60]=e.x,u[61]=e.y,u[62]=e.z,u[63]=a.x,u[64]=e.y,u[65]=e.z,u[66]=a.x,u[67]=e.y,u[68]=a.z,u[69]=e.x,u[70]=e.y,u[71]=a.z,m.position=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&((r=new Float32Array(72))[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,r[12]=0,r[13]=0,r[14]=-1,r[15]=0,r[16]=0,r[17]=-1,r[18]=0,r[19]=0,r[20]=-1,r[21]=0,r[22]=0,r[23]=-1,r[24]=1,r[25]=0,r[26]=0,r[27]=1,r[28]=0,r[29]=0,r[30]=1,r[31]=0,r[32]=0,r[33]=1,r[34]=0,r[35]=0,r[36]=-1,r[37]=0,r[38]=0,r[39]=-1,r[40]=0,r[41]=0,r[42]=-1,r[43]=0,r[44]=0,r[45]=-1,r[46]=0,r[47]=0,r[48]=0,r[49]=1,r[50]=0,r[51]=0,r[52]=1,r[53]=0,r[54]=0,r[55]=1,r[56]=0,r[57]=0,r[58]=1,r[59]=0,r[60]=0,r[61]=-1,r[62]=0,r[63]=0,r[64]=-1,r[65]=0,r[66]=0,r[67]=-1,r[68]=0,r[69]=0,r[70]=-1,r[71]=0,m.normal=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r})),n.st&&((i=new Float32Array(48))[0]=0,i[1]=0,i[2]=1,i[3]=0,i[4]=1,i[5]=1,i[6]=0,i[7]=1,i[8]=1,i[9]=0,i[10]=0,i[11]=0,i[12]=0,i[13]=1,i[14]=1,i[15]=1,i[16]=0,i[17]=0,i[18]=1,i[19]=0,i[20]=1,i[21]=1,i[22]=0,i[23]=1,i[24]=1,i[25]=0,i[26]=0,i[27]=0,i[28]=0,i[29]=1,i[30]=1,i[31]=1,i[32]=1,i[33]=0,i[34]=0,i[35]=0,i[36]=0,i[37]=1,i[38]=1,i[39]=1,i[40]=0,i[41]=0,i[42]=1,i[43]=0,i[44]=1,i[45]=1,i[46]=0,i[47]=1,m.st=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})),n.tangent&&((i=new Float32Array(72))[0]=1,i[1]=0,i[2]=0,i[3]=1,i[4]=0,i[5]=0,i[6]=1,i[7]=0,i[8]=0,i[9]=1,i[10]=0,i[11]=0,i[12]=-1,i[13]=0,i[14]=0,i[15]=-1,i[16]=0,i[17]=0,i[18]=-1,i[19]=0,i[20]=0,i[21]=-1,i[22]=0,i[23]=0,i[24]=0,i[25]=1,i[26]=0,i[27]=0,i[28]=1,i[29]=0,i[30]=0,i[31]=1,i[32]=0,i[33]=0,i[34]=1,i[35]=0,i[36]=0,i[37]=-1,i[38]=0,i[39]=0,i[40]=-1,i[41]=0,i[42]=0,i[43]=-1,i[44]=0,i[45]=0,i[46]=-1,i[47]=0,i[48]=-1,i[49]=0,i[50]=0,i[51]=-1,i[52]=0,i[53]=0,i[54]=-1,i[55]=0,i[56]=0,i[57]=-1,i[58]=0,i[59]=0,i[60]=1,i[61]=0,i[62]=0,i[63]=1,i[64]=0,i[65]=0,i[66]=1,i[67]=0,i[68]=0,i[69]=1,i[70]=0,i[71]=0,m.tangent=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:i})),n.bitangent&&((o=new Float32Array(72))[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=1,o[14]=0,o[15]=0,o[16]=1,o[17]=0,o[18]=0,o[19]=1,o[20]=0,o[21]=0,o[22]=1,o[23]=0,o[24]=0,o[25]=0,o[26]=1,o[27]=0,o[28]=0,o[29]=1,o[30]=0,o[31]=0,o[32]=1,o[33]=0,o[34]=0,o[35]=1,o[36]=0,o[37]=0,o[38]=1,o[39]=0,o[40]=0,o[41]=1,o[42]=0,o[43]=0,o[44]=1,o[45]=0,o[46]=0,o[47]=1,o[48]=0,o[49]=0,o[50]=1,o[51]=0,o[52]=0,o[53]=1,o[54]=0,o[55]=0,o[56]=1,o[57]=0,o[58]=0,o[59]=1,o[60]=0,o[61]=0,o[62]=1,o[63]=0,o[64]=0,o[65]=1,o[66]=0,o[67]=0,o[68]=1,o[69]=0,o[70]=0,o[71]=1,m.bitangent=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:o})),(o=new Uint16Array(36))[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23):((u=new Float64Array(24))[0]=e.x,u[1]=e.y,u[2]=e.z,u[3]=a.x,u[4]=e.y,u[5]=e.z,u[6]=a.x,u[7]=a.y,u[8]=e.z,u[9]=e.x,u[10]=a.y,u[11]=e.z,u[12]=e.x,u[13]=e.y,u[14]=a.z,u[15]=a.x,u[16]=e.y,u[17]=a.z,u[18]=a.x,u[19]=a.y,u[20]=a.z,u[21]=e.x,u[22]=a.y,u[23]=a.z,m.position=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),(o=new Uint16Array(36))[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4);var u,a=p.Cartesian3.subtract(a,e,l),e=.5*p.Cartesian3.magnitude(a);return c.defined(t._offsetAttribute)&&(a=u.length,u=new Uint8Array(a/3),a=t._offsetAttribute===s.GeometryOffsetAttribute.NONE?0:1,s.arrayFill(u,a),m.applyOffset=new f.GeometryAttribute({componentDatatype:x.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})),new f.Geometry({attributes:m,indices:o,primitiveType:f.PrimitiveType.TRIANGLES,boundingSphere:new y.BoundingSphere(p.Cartesian3.ZERO,e),offsetAttribute:t._offsetAttribute})}},m.getUnitBox=function(){return a=!c.defined(a)?m.createGeometry(m.fromDimensions({dimensions:new p.Cartesian3(1,1,1),vertexFormat:o.VertexFormat.POSITION_ONLY})):a},t.BoxGeometry=m}); diff --git a/public/Cesium/Workers/Cartesian2-8417ca3d.js b/public/Cesium/Workers/Cartesian2-8417ca3d.js deleted file mode 100644 index bae26c8..0000000 --- a/public/Cesium/Workers/Cartesian2-8417ca3d.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694"],function(e,i,S,q){"use strict";function O(e,t,n){this.x=S.defaultValue(e,0),this.y=S.defaultValue(t,0),this.z=S.defaultValue(n,0)}O.fromSpherical=function(e,t){S.defined(t)||(t=new O);var n=e.clock,a=e.cone,r=S.defaultValue(e.magnitude,1),e=r*Math.sin(a);return t.x=e*Math.cos(n),t.y=e*Math.sin(n),t.z=r*Math.cos(a),t},O.fromElements=function(e,t,n,a){return S.defined(a)?(a.x=e,a.y=t,a.z=n,a):new O(e,t,n)},O.fromCartesian4=O.clone=function(e,t){if(S.defined(e))return S.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new O(e.x,e.y,e.z)},O.packedLength=3,O.pack=function(e,t,n){return n=S.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},O.unpack=function(e,t,n){return t=S.defaultValue(t,0),(n=!S.defined(n)?new O:n).x=e[t++],n.y=e[t++],n.z=e[t],n},O.packArray=function(e,t){var n=e.length,a=3*n;if(S.defined(t)){if(!Array.isArray(t)&&t.length!==a)throw new i.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==a&&(t.length=a)}else t=new Array(a);for(var r=0;r<n;++r)O.pack(e[r],t,3*r);return t},O.unpackArray=function(e,t){var n=e.length;S.defined(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var r=a/3;t[r]=O.unpack(e,a,t[r])}return t},O.fromArray=O.unpack,O.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},O.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},O.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},O.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},O.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},O.magnitude=function(e){return Math.sqrt(O.magnitudeSquared(e))};var n=new O;O.distance=function(e,t){return O.subtract(e,t,n),O.magnitude(n)},O.distanceSquared=function(e,t){return O.subtract(e,t,n),O.magnitudeSquared(n)},O.normalize=function(e,t){var n=O.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},O.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},O.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},O.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},O.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},O.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},O.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},O.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},O.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},O.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 r=new O;O.lerp=function(e,t,n,a){return O.multiplyByScalar(t,n,r),a=O.multiplyByScalar(e,1-n,a),O.add(r,a,a)};var a=new O,u=new O;O.angleBetween=function(e,t){O.normalize(e,a),O.normalize(t,u);e=O.dot(a,u),t=O.magnitude(O.cross(a,u,a));return Math.atan2(t,e)};var o=new O;O.mostOrthogonalAxis=function(e,t){e=O.normalize(e,o);return O.abs(e,e),t=e.x<=e.y?e.x<=e.z?O.clone(O.UNIT_X,t):O.clone(O.UNIT_Z,t):e.y<=e.z?O.clone(O.UNIT_Y,t):O.clone(O.UNIT_Z,t)},O.projectVector=function(e,t,n){e=O.dot(e,t)/O.dot(t,t);return O.multiplyByScalar(t,e,n)},O.equals=function(e,t){return e===t||S.defined(e)&&S.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},O.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},O.equalsEpsilon=function(e,t,n,a){return e===t||S.defined(e)&&S.defined(t)&&q.CesiumMath.equalsEpsilon(e.x,t.x,n,a)&&q.CesiumMath.equalsEpsilon(e.y,t.y,n,a)&&q.CesiumMath.equalsEpsilon(e.z,t.z,n,a)},O.cross=function(e,t,n){var a=e.x,r=e.y,i=e.z,u=t.x,o=t.y,e=t.z,t=r*e-i*o,e=i*u-a*e,u=a*o-r*u;return n.x=t,n.y=e,n.z=u,n},O.midpoint=function(e,t,n){return n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y),n.z=.5*(e.z+t.z),n},O.fromDegrees=function(e,t,n,a,r){return e=q.CesiumMath.toRadians(e),t=q.CesiumMath.toRadians(t),O.fromRadians(e,t,n,a,r)};var s=new O,d=new O,h=new O(40680631590769,40680631590769,40408299984661.445);O.fromRadians=function(e,t,n,a,r){n=S.defaultValue(n,0);var i=S.defined(a)?a.radiiSquared:h,a=Math.cos(t);s.x=a*Math.cos(e),s.y=a*Math.sin(e),s.z=Math.sin(t),s=O.normalize(s,s),O.multiplyComponents(i,s,d);i=Math.sqrt(O.dot(s,d));return d=O.divideByScalar(d,i,d),s=O.multiplyByScalar(s,n,s),S.defined(r)||(r=new O),O.add(d,s,r)},O.fromDegreesArray=function(e,t,n){var a=e.length;S.defined(n)?n.length=a/2:n=new Array(a/2);for(var r=0;r<a;r+=2){var i=e[r],u=e[r+1],o=r/2;n[o]=O.fromDegrees(i,u,0,t,n[o])}return n},O.fromRadiansArray=function(e,t,n){var a=e.length;S.defined(n)?n.length=a/2:n=new Array(a/2);for(var r=0;r<a;r+=2){var i=e[r],u=e[r+1],o=r/2;n[o]=O.fromRadians(i,u,0,t,n[o])}return n},O.fromDegreesArrayHeights=function(e,t,n){var a=e.length;S.defined(n)?n.length=a/3:n=new Array(a/3);for(var r=0;r<a;r+=3){var i=e[r],u=e[r+1],o=e[r+2],s=r/3;n[s]=O.fromDegrees(i,u,o,t,n[s])}return n},O.fromRadiansArrayHeights=function(e,t,n){var a=e.length;S.defined(n)?n.length=a/3:n=new Array(a/3);for(var r=0;r<a;r+=3){var i=e[r],u=e[r+1],o=e[r+2],s=r/3;n[s]=O.fromRadians(i,u,o,t,n[s])}return n},O.ZERO=Object.freeze(new O(0,0,0)),O.UNIT_X=Object.freeze(new O(1,0,0)),O.UNIT_Y=Object.freeze(new O(0,1,0)),O.UNIT_Z=Object.freeze(new O(0,0,1)),O.prototype.clone=function(e){return O.clone(this,e)},O.prototype.equals=function(e){return O.equals(this,e)},O.prototype.equalsEpsilon=function(e,t,n){return O.equalsEpsilon(this,e,t,n)},O.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};var T=new O,A=new O;function l(e,t,n,a,r){var i=e.x,u=e.y,o=e.z,s=t.x,d=t.y,t=t.z,h=i*i*s*s,l=u*u*d*d,f=o*o*t*t,s=h+l+f,d=Math.sqrt(1/s),t=O.multiplyByScalar(e,d,T);if(s<a)return isFinite(d)?O.clone(t,r):void 0;var c=n.x,m=n.y,y=n.z,n=A;n.x=t.x*c*2,n.y=t.y*m*2,n.z=t.z*y*2;var p=(1-d)*O.magnitude(e)/(.5*O.magnitude(n)),g=0;do{var M,x,w,v,_,C,z,g=(z=h*(v=(M=1/(1+(p-=g)*c))*M)+l*(_=(x=1/(1+p*m))*x)+f*(C=(w=1/(1+p*y))*w)-1)/(-2*(h*(v*M)*c+l*(_*x)*m+f*(C*w)*y))}while(Math.abs(z)>q.CesiumMath.EPSILON12);return S.defined(r)?(r.x=i*M,r.y=u*x,r.z=o*w,r):new O(i*M,u*x,o*w)}function f(e,t,n){this.longitude=S.defaultValue(e,0),this.latitude=S.defaultValue(t,0),this.height=S.defaultValue(n,0)}f.fromRadians=function(e,t,n,a){return n=S.defaultValue(n,0),S.defined(a)?(a.longitude=e,a.latitude=t,a.height=n,a):new f(e,t,n)},f.fromDegrees=function(e,t,n,a){return e=q.CesiumMath.toRadians(e),t=q.CesiumMath.toRadians(t),f.fromRadians(e,t,n,a)};var c=new O,m=new O,y=new O,p=new O(1/6378137,1/6378137,1/6356752.314245179),g=new O(1/40680631590769,1/40680631590769,1/40408299984661.445),M=q.CesiumMath.EPSILON1;function x(e,t,n,a){t=S.defaultValue(t,0),n=S.defaultValue(n,0),a=S.defaultValue(a,0),e._radii=new O(t,n,a),e._radiiSquared=new O(t*t,n*n,a*a),e._radiiToTheFourth=new O(t*t*t*t,n*n*n*n,a*a*a*a),e._oneOverRadii=new O(0===t?0:1/t,0===n?0:1/n,0===a?0:1/a),e._oneOverRadiiSquared=new O(0===t?0:1/(t*t),0===n?0:1/(n*n),0===a?0:1/(a*a)),e._minimumRadius=Math.min(t,n,a),e._maximumRadius=Math.max(t,n,a),e._centerToleranceSquared=q.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function w(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,x(this,e,t,n)}f.fromCartesian=function(e,t,n){var a=S.defined(t)?t.oneOverRadii:p,r=S.defined(t)?t.oneOverRadiiSquared:g,a=l(e,a,r,S.defined(t)?t._centerToleranceSquared:M,m);if(S.defined(a)){t=O.multiplyComponents(a,r,c),t=O.normalize(t,t),r=O.subtract(e,a,y),a=Math.atan2(t.y,t.x),t=Math.asin(t.z),r=q.CesiumMath.sign(O.dot(r,e))*O.magnitude(r);return S.defined(n)?(n.longitude=a,n.latitude=t,n.height=r,n):new f(a,t,r)}},f.toCartesian=function(e,t,n){return O.fromRadians(e.longitude,e.latitude,e.height,t,n)},f.clone=function(e,t){if(S.defined(e))return S.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new f(e.longitude,e.latitude,e.height)},f.equals=function(e,t){return e===t||S.defined(e)&&S.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},f.equalsEpsilon=function(e,t,n){return n=S.defaultValue(n,0),e===t||S.defined(e)&&S.defined(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},f.ZERO=Object.freeze(new f(0,0,0)),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(w.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}}}),w.clone=function(e,t){if(S.defined(e)){var n=e._radii;return S.defined(t)?(O.clone(n,t._radii),O.clone(e._radiiSquared,t._radiiSquared),O.clone(e._radiiToTheFourth,t._radiiToTheFourth),O.clone(e._oneOverRadii,t._oneOverRadii),O.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new w(n.x,n.y,n.z)}},w.fromCartesian3=function(e,t){return S.defined(t)||(t=new w),S.defined(e)&&x(t,e.x,e.y,e.z),t},w.WGS84=Object.freeze(new w(6378137,6378137,6356752.314245179)),w.UNIT_SPHERE=Object.freeze(new w(1,1,1)),w.MOON=Object.freeze(new w(q.CesiumMath.LUNAR_RADIUS,q.CesiumMath.LUNAR_RADIUS,q.CesiumMath.LUNAR_RADIUS)),w.prototype.clone=function(e){return w.clone(this,e)},w.packedLength=O.packedLength,w.pack=function(e,t,n){return n=S.defaultValue(n,0),O.pack(e._radii,t,n),t},w.unpack=function(e,t,n){t=S.defaultValue(t,0);t=O.unpack(e,t);return w.fromCartesian3(t,n)},w.prototype.geocentricSurfaceNormal=O.normalize,w.prototype.geodeticSurfaceNormalCartographic=function(e,t){var n=e.longitude,a=e.latitude,r=Math.cos(a),e=r*Math.cos(n),n=r*Math.sin(n),a=Math.sin(a);return(t=!S.defined(t)?new O:t).x=e,t.y=n,t.z=a,O.normalize(t,t)},w.prototype.geodeticSurfaceNormal=function(e,t){if(!O.equalsEpsilon(e,O.ZERO,q.CesiumMath.EPSILON14))return S.defined(t)||(t=new O),t=O.multiplyComponents(e,this._oneOverRadiiSquared,t),O.normalize(t,t)};var v=new O,_=new O;w.prototype.cartographicToCartesian=function(e,t){var n=v,a=_;this.geodeticSurfaceNormalCartographic(e,n),O.multiplyComponents(this._radiiSquared,n,a);var r=Math.sqrt(O.dot(n,a));return O.divideByScalar(a,r,a),O.multiplyByScalar(n,e.height,n),S.defined(t)||(t=new O),O.add(a,n,t)},w.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;S.defined(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var C=new O,z=new O,R=new O;w.prototype.cartesianToCartographic=function(e,t){var n=this.scaleToGeodeticSurface(e,z);if(S.defined(n)){var a=this.geodeticSurfaceNormal(n,C),r=O.subtract(e,n,R),n=Math.atan2(a.y,a.x),a=Math.asin(a.z),r=q.CesiumMath.sign(O.dot(r,e))*O.magnitude(r);return S.defined(t)?(t.longitude=n,t.latitude=a,t.height=r,t):new f(n,a,r)}},w.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;S.defined(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},w.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},w.prototype.scaleToGeocentricSurface=function(e,t){S.defined(t)||(t=new O);var n=e.x,a=e.y,r=e.z,i=this._oneOverRadiiSquared,i=1/Math.sqrt(n*n*i.x+a*a*i.y+r*r*i.z);return O.multiplyByScalar(e,i,t)},w.prototype.transformPositionToScaledSpace=function(e,t){return S.defined(t)||(t=new O),O.multiplyComponents(e,this._oneOverRadii,t)},w.prototype.transformPositionFromScaledSpace=function(e,t){return S.defined(t)||(t=new O),O.multiplyComponents(e,this._radii,t)},w.prototype.equals=function(e){return this===e||S.defined(e)&&O.equals(this._radii,e._radii)},w.prototype.toString=function(){return this._radii.toString()},w.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=S.defaultValue(t,0);var a=this._squaredXOverSquaredZ;if((n=!S.defined(n)?new O:n).x=0,n.y=0,n.z=e.z*(1-a),!(Math.abs(n.z)>=this._radii.z-t))return n};var V=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],b=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function I(e,t,n){for(var a=.5*(t+e),r=.5*(t-e),i=0,u=0;u<5;u++){var o=r*V[u];i+=b[u]*(n(a+o)+n(a-o))}return i*=r}function E(e,t,n,a){this.west=S.defaultValue(e,0),this.south=S.defaultValue(t,0),this.east=S.defaultValue(n,0),this.north=S.defaultValue(a,0)}w.prototype.surfaceArea=function(e){for(var t=e.west,r=e.east,n=e.south,a=e.north;r<t;)r+=q.CesiumMath.TWO_PI;var e=this._radiiSquared,i=e.x,u=e.y,o=e.z,s=i*u;return I(n,a,function(e){var n=Math.cos(e),a=Math.sin(e);return Math.cos(e)*I(t,r,function(e){var t=Math.cos(e),e=Math.sin(e);return Math.sqrt(s*a*a+o*(u*t*t+i*e*e)*n*n)})})},Object.defineProperties(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,n){return n=S.defaultValue(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},E.unpack=function(e,t,n){return t=S.defaultValue(t,0),(n=!S.defined(n)?new E:n).west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},E.computeWidth=function(e){var t=e.east,e=e.west;return t<e&&(t+=q.CesiumMath.TWO_PI),t-e},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,n,a,r){return e=q.CesiumMath.toRadians(S.defaultValue(e,0)),t=q.CesiumMath.toRadians(S.defaultValue(t,0)),n=q.CesiumMath.toRadians(S.defaultValue(n,0)),a=q.CesiumMath.toRadians(S.defaultValue(a,0)),S.defined(r)?(r.west=e,r.south=t,r.east=n,r.north=a,r):new E(e,t,n,a)},E.fromRadians=function(e,t,n,a,r){return S.defined(r)?(r.west=S.defaultValue(e,0),r.south=S.defaultValue(t,0),r.east=S.defaultValue(n,0),r.north=S.defaultValue(a,0),r):new E(e,t,n,a)},E.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,d=e.length;s<d;s++)var h=e[s],n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),o=Math.max(o,h.latitude),h=0<=h.longitude?h.longitude:h.longitude+q.CesiumMath.TWO_PI,r=Math.min(r,h),i=Math.max(i,h);return i-r<a-n&&(n=r,(a=i)>q.CesiumMath.PI&&(a-=q.CesiumMath.TWO_PI),n>q.CesiumMath.PI&&(n-=q.CesiumMath.TWO_PI)),S.defined(t)?(t.west=n,t.south=u,t.east=a,t.north=o,t):new E(n,u,a,o)},E.fromCartesianArray=function(e,t,n){t=S.defaultValue(t,w.WGS84);for(var a=Number.MAX_VALUE,r=-Number.MAX_VALUE,i=Number.MAX_VALUE,u=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++)var l=t.cartesianToCartographic(e[d]),a=Math.min(a,l.longitude),r=Math.max(r,l.longitude),o=Math.min(o,l.latitude),s=Math.max(s,l.latitude),l=0<=l.longitude?l.longitude:l.longitude+q.CesiumMath.TWO_PI,i=Math.min(i,l),u=Math.max(u,l);return u-i<r-a&&(a=i,(r=u)>q.CesiumMath.PI&&(r-=q.CesiumMath.TWO_PI),a>q.CesiumMath.PI&&(a-=q.CesiumMath.TWO_PI)),S.defined(n)?(n.west=a,n.south=o,n.east=r,n.north=s,n):new E(a,o,r,s)},E.clone=function(e,t){if(S.defined(e))return S.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.equalsEpsilon=function(e,t,n){return n=S.defaultValue(n,0),e===t||S.defined(e)&&S.defined(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},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||S.defined(e)&&S.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.validate=function(e){},E.southwest=function(e,t){return S.defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new f(e.west,e.south)},E.northwest=function(e,t){return S.defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new f(e.west,e.north)},E.northeast=function(e,t){return S.defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new f(e.east,e.north)},E.southeast=function(e,t){return S.defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new f(e.east,e.south)},E.center=function(e,t){var n=e.east,a=e.west;n<a&&(n+=q.CesiumMath.TWO_PI);n=q.CesiumMath.negativePiToPi(.5*(a+n)),e=.5*(e.south+e.north);return S.defined(t)?(t.longitude=n,t.latitude=e,t.height=0,t):new f(n,e)},E.intersection=function(e,t,n){var a=e.east,r=e.west,i=t.east,u=t.west;a<r&&0<i?a+=q.CesiumMath.TWO_PI:i<u&&0<a&&(i+=q.CesiumMath.TWO_PI),a<r&&u<0?u+=q.CesiumMath.TWO_PI:i<u&&r<0&&(r+=q.CesiumMath.TWO_PI);u=q.CesiumMath.negativePiToPi(Math.max(r,u)),a=q.CesiumMath.negativePiToPi(Math.min(a,i));if(!((e.west<e.east||t.west<t.east)&&a<=u)){i=Math.max(e.south,t.south),t=Math.min(e.north,t.north);if(!(t<=i))return S.defined(n)?(n.west=u,n.south=i,n.east=a,n.north=t,n):new E(u,i,a,t)}},E.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),r=Math.max(e.south,t.south),i=Math.min(e.east,t.east),t=Math.min(e.north,t.north);if(!(t<=r||i<=a))return S.defined(n)?(n.west=a,n.south=r,n.east=i,n.north=t,n):new E(a,r,i,t)},E.union=function(e,t,n){S.defined(n)||(n=new E);var a=e.east,r=e.west,i=t.east,u=t.west;a<r&&0<i?a+=q.CesiumMath.TWO_PI:i<u&&0<a&&(i+=q.CesiumMath.TWO_PI),a<r&&u<0?u+=q.CesiumMath.TWO_PI:i<u&&r<0&&(r+=q.CesiumMath.TWO_PI);u=q.CesiumMath.convertLongitudeRange(Math.min(r,u)),i=q.CesiumMath.convertLongitudeRange(Math.max(a,i));return n.west=u,n.south=Math.min(e.south,t.south),n.east=i,n.north=Math.max(e.north,t.north),n},E.expand=function(e,t,n){return(n=!S.defined(n)?new E: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},E.contains=function(e,t){var n=t.longitude,a=t.latitude,r=e.west,t=e.east;return t<r&&(t+=q.CesiumMath.TWO_PI,n<0&&(n+=q.CesiumMath.TWO_PI)),(r<n||q.CesiumMath.equalsEpsilon(n,r,q.CesiumMath.EPSILON14))&&(n<t||q.CesiumMath.equalsEpsilon(n,t,q.CesiumMath.EPSILON14))&&a>=e.south&&a<=e.north};var P=new f;function N(e,t){this.x=S.defaultValue(e,0),this.y=S.defaultValue(t,0)}E.subsample=function(e,t,n,a){t=S.defaultValue(t,w.WGS84),n=S.defaultValue(n,0),S.defined(a)||(a=[]);var r=0,i=e.north,u=e.south,o=e.east,s=e.west,d=P;d.height=n,d.longitude=s,d.latitude=i,a[r]=t.cartographicToCartesian(d,a[r]),r++,d.longitude=o,a[r]=t.cartographicToCartesian(d,a[r]),r++,d.latitude=u,a[r]=t.cartographicToCartesian(d,a[r]),r++,d.longitude=s,a[r]=t.cartographicToCartesian(d,a[r]),r++,d.latitude=i<0?i:0<u?u:0;for(var h=1;h<8;++h)d.longitude=-Math.PI+h*q.CesiumMath.PI_OVER_TWO,E.contains(e,d)&&(a[r]=t.cartographicToCartesian(d,a[r]),r++);return 0===d.latitude&&(d.longitude=s,a[r]=t.cartographicToCartesian(d,a[r]),r++,d.longitude=o,a[r]=t.cartographicToCartesian(d,a[r]),r++),a.length=r,a},E.MAX_VALUE=Object.freeze(new E(-Math.PI,-q.CesiumMath.PI_OVER_TWO,Math.PI,q.CesiumMath.PI_OVER_TWO)),N.fromElements=function(e,t,n){return S.defined(n)?(n.x=e,n.y=t,n):new N(e,t)},N.fromCartesian3=N.clone=function(e,t){if(S.defined(e))return S.defined(t)?(t.x=e.x,t.y=e.y,t):new N(e.x,e.y)},N.fromCartesian4=N.clone,N.packedLength=2,N.pack=function(e,t,n){return n=S.defaultValue(n,0),t[n++]=e.x,t[n]=e.y,t},N.unpack=function(e,t,n){return t=S.defaultValue(t,0),(n=!S.defined(n)?new N:n).x=e[t++],n.y=e[t],n},N.packArray=function(e,t){var n=e.length,a=2*n;if(S.defined(t)){if(!Array.isArray(t)&&t.length!==a)throw new i.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==a&&(t.length=a)}else t=new Array(a);for(var r=0;r<n;++r)N.pack(e[r],t,2*r);return t},N.unpackArray=function(e,t){var n=e.length;S.defined(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var r=a/2;t[r]=N.unpack(e,a,t[r])}return t},N.fromArray=N.unpack,N.maximumComponent=function(e){return Math.max(e.x,e.y)},N.minimumComponent=function(e){return Math.min(e.x,e.y)},N.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},N.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},N.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},N.magnitude=function(e){return Math.sqrt(N.magnitudeSquared(e))};var U=new N;N.distance=function(e,t){return N.subtract(e,t,U),N.magnitude(U)},N.distanceSquared=function(e,t){return N.subtract(e,t,U),N.magnitudeSquared(U)},N.normalize=function(e,t){var n=N.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},N.dot=function(e,t){return e.x*t.x+e.y*t.y},N.cross=function(e,t){return e.x*t.y-e.y*t.x},N.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},N.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},N.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},N.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},N.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},N.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},N.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},N.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var L=new N;N.lerp=function(e,t,n,a){return N.multiplyByScalar(t,n,L),a=N.multiplyByScalar(e,1-n,a),N.add(L,a,a)};var W=new N,k=new N;N.angleBetween=function(e,t){return N.normalize(e,W),N.normalize(t,k),q.CesiumMath.acosClamped(N.dot(W,k))};var B=new N;N.mostOrthogonalAxis=function(e,t){e=N.normalize(e,B);return N.abs(e,e),t=e.x<=e.y?N.clone(N.UNIT_X,t):N.clone(N.UNIT_Y,t)},N.equals=function(e,t){return e===t||S.defined(e)&&S.defined(t)&&e.x===t.x&&e.y===t.y},N.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},N.equalsEpsilon=function(e,t,n,a){return e===t||S.defined(e)&&S.defined(t)&&q.CesiumMath.equalsEpsilon(e.x,t.x,n,a)&&q.CesiumMath.equalsEpsilon(e.y,t.y,n,a)},N.ZERO=Object.freeze(new N(0,0)),N.UNIT_X=Object.freeze(new N(1,0)),N.UNIT_Y=Object.freeze(new N(0,1)),N.prototype.clone=function(e){return N.clone(this,e)},N.prototype.equals=function(e){return N.equals(this,e)},N.prototype.equalsEpsilon=function(e,t,n){return N.equalsEpsilon(this,e,t,n)},N.prototype.toString=function(){return"("+this.x+", "+this.y+")"},e.Cartesian2=N,e.Cartesian3=O,e.Cartographic=f,e.Ellipsoid=w,e.Rectangle=E}); diff --git a/public/Cesium/Workers/Cartesian2-8646c5a1.js b/public/Cesium/Workers/Cartesian2-8646c5a1.js new file mode 100644 index 0000000..8947ca9 --- /dev/null +++ b/public/Cesium/Workers/Cartesian2-8646c5a1.js @@ -0,0 +1 @@ +define(["exports","./Check-24483042","./when-54335d57","./Math-d6182036"],function(e,i,S,q){"use strict";function O(e,t,n){this.x=S.defaultValue(e,0),this.y=S.defaultValue(t,0),this.z=S.defaultValue(n,0)}O.fromSpherical=function(e,t){S.defined(t)||(t=new O);var n=e.clock,a=e.cone,r=S.defaultValue(e.magnitude,1),e=r*Math.sin(a);return t.x=e*Math.cos(n),t.y=e*Math.sin(n),t.z=r*Math.cos(a),t},O.fromElements=function(e,t,n,a){return S.defined(a)?(a.x=e,a.y=t,a.z=n,a):new O(e,t,n)},O.fromCartesian4=O.clone=function(e,t){if(S.defined(e))return S.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new O(e.x,e.y,e.z)},O.packedLength=3,O.pack=function(e,t,n){return n=S.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},O.unpack=function(e,t,n){return t=S.defaultValue(t,0),(n=!S.defined(n)?new O:n).x=e[t++],n.y=e[t++],n.z=e[t],n},O.packArray=function(e,t){var n=e.length,a=3*n;if(S.defined(t)){if(!Array.isArray(t)&&t.length!==a)throw new i.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==a&&(t.length=a)}else t=new Array(a);for(var r=0;r<n;++r)O.pack(e[r],t,3*r);return t},O.unpackArray=function(e,t){var n=e.length;S.defined(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var r=a/3;t[r]=O.unpack(e,a,t[r])}return t},O.fromArray=O.unpack,O.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},O.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},O.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},O.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},O.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},O.magnitude=function(e){return Math.sqrt(O.magnitudeSquared(e))};var n=new O;O.distance=function(e,t){return O.subtract(e,t,n),O.magnitude(n)},O.distanceSquared=function(e,t){return O.subtract(e,t,n),O.magnitudeSquared(n)},O.normalize=function(e,t){var n=O.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},O.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},O.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},O.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},O.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},O.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},O.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},O.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},O.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},O.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 r=new O;O.lerp=function(e,t,n,a){return O.multiplyByScalar(t,n,r),a=O.multiplyByScalar(e,1-n,a),O.add(r,a,a)};var a=new O,u=new O;O.angleBetween=function(e,t){O.normalize(e,a),O.normalize(t,u);e=O.dot(a,u),t=O.magnitude(O.cross(a,u,a));return Math.atan2(t,e)};var o=new O;O.mostOrthogonalAxis=function(e,t){e=O.normalize(e,o);return O.abs(e,e),t=e.x<=e.y?e.x<=e.z?O.clone(O.UNIT_X,t):O.clone(O.UNIT_Z,t):e.y<=e.z?O.clone(O.UNIT_Y,t):O.clone(O.UNIT_Z,t)},O.projectVector=function(e,t,n){e=O.dot(e,t)/O.dot(t,t);return O.multiplyByScalar(t,e,n)},O.equals=function(e,t){return e===t||S.defined(e)&&S.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},O.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},O.equalsEpsilon=function(e,t,n,a){return e===t||S.defined(e)&&S.defined(t)&&q.CesiumMath.equalsEpsilon(e.x,t.x,n,a)&&q.CesiumMath.equalsEpsilon(e.y,t.y,n,a)&&q.CesiumMath.equalsEpsilon(e.z,t.z,n,a)},O.cross=function(e,t,n){var a=e.x,r=e.y,i=e.z,u=t.x,o=t.y,e=t.z,t=i*u-a*e,u=a*o-r*u;return n.x=r*e-i*o,n.y=t,n.z=u,n},O.midpoint=function(e,t,n){return n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y),n.z=.5*(e.z+t.z),n},O.fromDegrees=function(e,t,n,a,r){return e=q.CesiumMath.toRadians(e),t=q.CesiumMath.toRadians(t),O.fromRadians(e,t,n,a,r)};var d=new O,s=new O,h=new O(40680631590769,40680631590769,40408299984661.445);O.fromRadians=function(e,t,n,a,r){n=S.defaultValue(n,0);var i=S.defined(a)?a.radiiSquared:h,a=Math.cos(t);d.x=a*Math.cos(e),d.y=a*Math.sin(e),d.z=Math.sin(t),d=O.normalize(d,d),O.multiplyComponents(i,d,s);i=Math.sqrt(O.dot(d,s));return s=O.divideByScalar(s,i,s),d=O.multiplyByScalar(d,n,d),S.defined(r)||(r=new O),O.add(s,d,r)},O.fromDegreesArray=function(e,t,n){var a=e.length;S.defined(n)?n.length=a/2:n=new Array(a/2);for(var r=0;r<a;r+=2){var i=e[r],u=e[r+1],o=r/2;n[o]=O.fromDegrees(i,u,0,t,n[o])}return n},O.fromRadiansArray=function(e,t,n){var a=e.length;S.defined(n)?n.length=a/2:n=new Array(a/2);for(var r=0;r<a;r+=2){var i=e[r],u=e[r+1],o=r/2;n[o]=O.fromRadians(i,u,0,t,n[o])}return n},O.fromDegreesArrayHeights=function(e,t,n){var a=e.length;S.defined(n)?n.length=a/3:n=new Array(a/3);for(var r=0;r<a;r+=3){var i=e[r],u=e[r+1],o=e[r+2],d=r/3;n[d]=O.fromDegrees(i,u,o,t,n[d])}return n},O.fromRadiansArrayHeights=function(e,t,n){var a=e.length;S.defined(n)?n.length=a/3:n=new Array(a/3);for(var r=0;r<a;r+=3){var i=e[r],u=e[r+1],o=e[r+2],d=r/3;n[d]=O.fromRadians(i,u,o,t,n[d])}return n},O.ZERO=Object.freeze(new O(0,0,0)),O.UNIT_X=Object.freeze(new O(1,0,0)),O.UNIT_Y=Object.freeze(new O(0,1,0)),O.UNIT_Z=Object.freeze(new O(0,0,1)),O.prototype.clone=function(e){return O.clone(this,e)},O.prototype.equals=function(e){return O.equals(this,e)},O.prototype.equalsEpsilon=function(e,t,n){return O.equalsEpsilon(this,e,t,n)},O.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};var T=new O,A=new O;function l(e,t,n,a,r){var i=e.x,u=e.y,o=e.z,d=t.x,s=t.y,t=t.z,h=i*i*d*d,l=u*u*s*s,f=o*o*t*t,d=h+l+f,s=Math.sqrt(1/d),t=O.multiplyByScalar(e,s,T);if(d<a)return isFinite(s)?O.clone(t,r):void 0;var c=n.x,m=n.y,y=n.z,n=A;n.x=t.x*c*2,n.y=t.y*m*2,n.z=t.z*y*2;var p=(1-s)*O.magnitude(e)/(.5*O.magnitude(n)),g=0;do{var M,x,w,v,_,C,z,g=(z=h*(v=(M=1/(1+(p-=g)*c))*M)+l*(_=(x=1/(1+p*m))*x)+f*(C=(w=1/(1+p*y))*w)-1)/(-2*(h*(v*M)*c+l*(_*x)*m+f*(C*w)*y))}while(Math.abs(z)>q.CesiumMath.EPSILON12);return S.defined(r)?(r.x=i*M,r.y=u*x,r.z=o*w,r):new O(i*M,u*x,o*w)}function f(e,t,n){this.longitude=S.defaultValue(e,0),this.latitude=S.defaultValue(t,0),this.height=S.defaultValue(n,0)}f.fromRadians=function(e,t,n,a){return n=S.defaultValue(n,0),S.defined(a)?(a.longitude=e,a.latitude=t,a.height=n,a):new f(e,t,n)},f.fromDegrees=function(e,t,n,a){return e=q.CesiumMath.toRadians(e),t=q.CesiumMath.toRadians(t),f.fromRadians(e,t,n,a)};var c=new O,m=new O,y=new O,p=new O(1/6378137,1/6378137,1/6356752.314245179),g=new O(1/40680631590769,1/40680631590769,1/40408299984661.445),M=q.CesiumMath.EPSILON1;function x(e,t,n,a){t=S.defaultValue(t,0),n=S.defaultValue(n,0),a=S.defaultValue(a,0),e._radii=new O(t,n,a),e._radiiSquared=new O(t*t,n*n,a*a),e._radiiToTheFourth=new O(t*t*t*t,n*n*n*n,a*a*a*a),e._oneOverRadii=new O(0===t?0:1/t,0===n?0:1/n,0===a?0:1/a),e._oneOverRadiiSquared=new O(0===t?0:1/(t*t),0===n?0:1/(n*n),0===a?0:1/(a*a)),e._minimumRadius=Math.min(t,n,a),e._maximumRadius=Math.max(t,n,a),e._centerToleranceSquared=q.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function w(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,x(this,e,t,n)}f.fromCartesian=function(e,t,n){var a=S.defined(t)?t.oneOverRadii:p,r=S.defined(t)?t.oneOverRadiiSquared:g,a=l(e,a,r,S.defined(t)?t._centerToleranceSquared:M,m);if(S.defined(a)){t=O.multiplyComponents(a,r,c),t=O.normalize(t,t),r=O.subtract(e,a,y),a=Math.atan2(t.y,t.x),t=Math.asin(t.z),r=q.CesiumMath.sign(O.dot(r,e))*O.magnitude(r);return S.defined(n)?(n.longitude=a,n.latitude=t,n.height=r,n):new f(a,t,r)}},f.toCartesian=function(e,t,n){return O.fromRadians(e.longitude,e.latitude,e.height,t,n)},f.clone=function(e,t){if(S.defined(e))return S.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new f(e.longitude,e.latitude,e.height)},f.equals=function(e,t){return e===t||S.defined(e)&&S.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},f.equalsEpsilon=function(e,t,n){return n=S.defaultValue(n,0),e===t||S.defined(e)&&S.defined(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},f.ZERO=Object.freeze(new f(0,0,0)),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(w.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}}}),w.clone=function(e,t){if(S.defined(e)){var n=e._radii;return S.defined(t)?(O.clone(n,t._radii),O.clone(e._radiiSquared,t._radiiSquared),O.clone(e._radiiToTheFourth,t._radiiToTheFourth),O.clone(e._oneOverRadii,t._oneOverRadii),O.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new w(n.x,n.y,n.z)}},w.fromCartesian3=function(e,t){return S.defined(t)||(t=new w),S.defined(e)&&x(t,e.x,e.y,e.z),t},w.WGS84=Object.freeze(new w(6378137,6378137,6356752.314245179)),w.UNIT_SPHERE=Object.freeze(new w(1,1,1)),w.MOON=Object.freeze(new w(q.CesiumMath.LUNAR_RADIUS,q.CesiumMath.LUNAR_RADIUS,q.CesiumMath.LUNAR_RADIUS)),w.prototype.clone=function(e){return w.clone(this,e)},w.packedLength=O.packedLength,w.pack=function(e,t,n){return n=S.defaultValue(n,0),O.pack(e._radii,t,n),t},w.unpack=function(e,t,n){t=S.defaultValue(t,0);t=O.unpack(e,t);return w.fromCartesian3(t,n)},w.prototype.geocentricSurfaceNormal=O.normalize,w.prototype.geodeticSurfaceNormalCartographic=function(e,t){var n=e.longitude,a=e.latitude,r=Math.cos(a),e=r*Math.cos(n),n=r*Math.sin(n),a=Math.sin(a);return(t=!S.defined(t)?new O:t).x=e,t.y=n,t.z=a,O.normalize(t,t)},w.prototype.geodeticSurfaceNormal=function(e,t){if(!O.equalsEpsilon(e,O.ZERO,q.CesiumMath.EPSILON14))return S.defined(t)||(t=new O),t=O.multiplyComponents(e,this._oneOverRadiiSquared,t),O.normalize(t,t)};var v=new O,_=new O;w.prototype.cartographicToCartesian=function(e,t){var n=v,a=_;this.geodeticSurfaceNormalCartographic(e,n),O.multiplyComponents(this._radiiSquared,n,a);var r=Math.sqrt(O.dot(n,a));return O.divideByScalar(a,r,a),O.multiplyByScalar(n,e.height,n),S.defined(t)||(t=new O),O.add(a,n,t)},w.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;S.defined(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var C=new O,z=new O,R=new O;w.prototype.cartesianToCartographic=function(e,t){var n=this.scaleToGeodeticSurface(e,z);if(S.defined(n)){var a=this.geodeticSurfaceNormal(n,C),r=O.subtract(e,n,R),n=Math.atan2(a.y,a.x),a=Math.asin(a.z),r=q.CesiumMath.sign(O.dot(r,e))*O.magnitude(r);return S.defined(t)?(t.longitude=n,t.latitude=a,t.height=r,t):new f(n,a,r)}},w.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;S.defined(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},w.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},w.prototype.scaleToGeocentricSurface=function(e,t){S.defined(t)||(t=new O);var n=e.x,a=e.y,r=e.z,i=this._oneOverRadiiSquared,i=1/Math.sqrt(n*n*i.x+a*a*i.y+r*r*i.z);return O.multiplyByScalar(e,i,t)},w.prototype.transformPositionToScaledSpace=function(e,t){return S.defined(t)||(t=new O),O.multiplyComponents(e,this._oneOverRadii,t)},w.prototype.transformPositionFromScaledSpace=function(e,t){return S.defined(t)||(t=new O),O.multiplyComponents(e,this._radii,t)},w.prototype.equals=function(e){return this===e||S.defined(e)&&O.equals(this._radii,e._radii)},w.prototype.toString=function(){return this._radii.toString()},w.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=S.defaultValue(t,0);var a=this._squaredXOverSquaredZ;if((n=!S.defined(n)?new O:n).x=0,n.y=0,n.z=e.z*(1-a),!(Math.abs(n.z)>=this._radii.z-t))return n};var V=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],I=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function b(e,t,n){for(var a=.5*(t+e),r=.5*(t-e),i=0,u=0;u<5;u++){var o=r*V[u];i+=I[u]*(n(a+o)+n(a-o))}return i*=r}function E(e,t,n,a){this.west=S.defaultValue(e,0),this.south=S.defaultValue(t,0),this.east=S.defaultValue(n,0),this.north=S.defaultValue(a,0)}w.prototype.surfaceArea=function(e){for(var t=e.west,r=e.east,n=e.south,a=e.north;r<t;)r+=q.CesiumMath.TWO_PI;var e=this._radiiSquared,i=e.x,u=e.y,o=e.z,d=i*u;return b(n,a,function(e){var n=Math.cos(e),a=Math.sin(e);return Math.cos(e)*b(t,r,function(e){var t=Math.cos(e),e=Math.sin(e);return Math.sqrt(d*a*a+o*(u*t*t+i*e*e)*n*n)})})},Object.defineProperties(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,n){return n=S.defaultValue(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},E.unpack=function(e,t,n){return t=S.defaultValue(t,0),(n=!S.defined(n)?new E:n).west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},E.computeWidth=function(e){var t=e.east,e=e.west;return t<e&&(t+=q.CesiumMath.TWO_PI),t-e},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,n,a,r){return e=q.CesiumMath.toRadians(S.defaultValue(e,0)),t=q.CesiumMath.toRadians(S.defaultValue(t,0)),n=q.CesiumMath.toRadians(S.defaultValue(n,0)),a=q.CesiumMath.toRadians(S.defaultValue(a,0)),S.defined(r)?(r.west=e,r.south=t,r.east=n,r.north=a,r):new E(e,t,n,a)},E.fromRadians=function(e,t,n,a,r){return S.defined(r)?(r.west=S.defaultValue(e,0),r.south=S.defaultValue(t,0),r.east=S.defaultValue(n,0),r.north=S.defaultValue(a,0),r):new E(e,t,n,a)},E.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,o=-Number.MAX_VALUE,d=0,s=e.length;d<s;d++)var h=e[d],n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),o=Math.max(o,h.latitude),h=0<=h.longitude?h.longitude:h.longitude+q.CesiumMath.TWO_PI,r=Math.min(r,h),i=Math.max(i,h);return i-r<a-n&&((a=i)>q.CesiumMath.PI&&(a-=q.CesiumMath.TWO_PI),(n=r)>q.CesiumMath.PI&&(n-=q.CesiumMath.TWO_PI)),S.defined(t)?(t.west=n,t.south=u,t.east=a,t.north=o,t):new E(n,u,a,o)},E.fromCartesianArray=function(e,t,n){t=S.defaultValue(t,w.WGS84);for(var a=Number.MAX_VALUE,r=-Number.MAX_VALUE,i=Number.MAX_VALUE,u=-Number.MAX_VALUE,o=Number.MAX_VALUE,d=-Number.MAX_VALUE,s=0,h=e.length;s<h;s++)var l=t.cartesianToCartographic(e[s]),a=Math.min(a,l.longitude),r=Math.max(r,l.longitude),o=Math.min(o,l.latitude),d=Math.max(d,l.latitude),l=0<=l.longitude?l.longitude:l.longitude+q.CesiumMath.TWO_PI,i=Math.min(i,l),u=Math.max(u,l);return u-i<r-a&&((r=u)>q.CesiumMath.PI&&(r-=q.CesiumMath.TWO_PI),(a=i)>q.CesiumMath.PI&&(a-=q.CesiumMath.TWO_PI)),S.defined(n)?(n.west=a,n.south=o,n.east=r,n.north=d,n):new E(a,o,r,d)},E.clone=function(e,t){if(S.defined(e))return S.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.equalsEpsilon=function(e,t,n){return n=S.defaultValue(n,0),e===t||S.defined(e)&&S.defined(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},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||S.defined(e)&&S.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.validate=function(e){},E.southwest=function(e,t){return S.defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new f(e.west,e.south)},E.northwest=function(e,t){return S.defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new f(e.west,e.north)},E.northeast=function(e,t){return S.defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new f(e.east,e.north)},E.southeast=function(e,t){return S.defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new f(e.east,e.south)},E.center=function(e,t){var n=e.east,a=e.west;n<a&&(n+=q.CesiumMath.TWO_PI);n=q.CesiumMath.negativePiToPi(.5*(a+n)),e=.5*(e.south+e.north);return S.defined(t)?(t.longitude=n,t.latitude=e,t.height=0,t):new f(n,e)},E.intersection=function(e,t,n){var a=e.east,r=e.west,i=t.east,u=t.west;a<r&&0<i?a+=q.CesiumMath.TWO_PI:i<u&&0<a&&(i+=q.CesiumMath.TWO_PI),a<r&&u<0?u+=q.CesiumMath.TWO_PI:i<u&&r<0&&(r+=q.CesiumMath.TWO_PI);u=q.CesiumMath.negativePiToPi(Math.max(r,u)),a=q.CesiumMath.negativePiToPi(Math.min(a,i));if(!((e.west<e.east||t.west<t.east)&&a<=u)){i=Math.max(e.south,t.south),t=Math.min(e.north,t.north);if(!(t<=i))return S.defined(n)?(n.west=u,n.south=i,n.east=a,n.north=t,n):new E(u,i,a,t)}},E.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),r=Math.max(e.south,t.south),i=Math.min(e.east,t.east),t=Math.min(e.north,t.north);if(!(t<=r||i<=a))return S.defined(n)?(n.west=a,n.south=r,n.east=i,n.north=t,n):new E(a,r,i,t)},E.union=function(e,t,n){S.defined(n)||(n=new E);var a=e.east,r=e.west,i=t.east,u=t.west;a<r&&0<i?a+=q.CesiumMath.TWO_PI:i<u&&0<a&&(i+=q.CesiumMath.TWO_PI),a<r&&u<0?u+=q.CesiumMath.TWO_PI:i<u&&r<0&&(r+=q.CesiumMath.TWO_PI);u=q.CesiumMath.convertLongitudeRange(Math.min(r,u)),i=q.CesiumMath.convertLongitudeRange(Math.max(a,i));return n.west=u,n.south=Math.min(e.south,t.south),n.east=i,n.north=Math.max(e.north,t.north),n},E.expand=function(e,t,n){return(n=!S.defined(n)?new E: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},E.contains=function(e,t){var n=t.longitude,a=t.latitude,r=e.west,t=e.east;return t<r&&(t+=q.CesiumMath.TWO_PI,n<0&&(n+=q.CesiumMath.TWO_PI)),(r<n||q.CesiumMath.equalsEpsilon(n,r,q.CesiumMath.EPSILON14))&&(n<t||q.CesiumMath.equalsEpsilon(n,t,q.CesiumMath.EPSILON14))&&a>=e.south&&a<=e.north};var P=new f;function N(e,t){this.x=S.defaultValue(e,0),this.y=S.defaultValue(t,0)}E.subsample=function(e,t,n,a){t=S.defaultValue(t,w.WGS84),n=S.defaultValue(n,0),S.defined(a)||(a=[]);var r=0,i=e.north,u=e.south,o=e.east,d=e.west,s=P;s.height=n,s.longitude=d,s.latitude=i,a[r]=t.cartographicToCartesian(s,a[r]),r++,s.longitude=o,a[r]=t.cartographicToCartesian(s,a[r]),r++,s.latitude=u,a[r]=t.cartographicToCartesian(s,a[r]),r++,s.longitude=d,a[r]=t.cartographicToCartesian(s,a[r]),r++,s.latitude=i<0?i:0<u?u:0;for(var h=1;h<8;++h)s.longitude=-Math.PI+h*q.CesiumMath.PI_OVER_TWO,E.contains(e,s)&&(a[r]=t.cartographicToCartesian(s,a[r]),r++);return 0===s.latitude&&(s.longitude=d,a[r]=t.cartographicToCartesian(s,a[r]),r++,s.longitude=o,a[r]=t.cartographicToCartesian(s,a[r]),r++),a.length=r,a},E.MAX_VALUE=Object.freeze(new E(-Math.PI,-q.CesiumMath.PI_OVER_TWO,Math.PI,q.CesiumMath.PI_OVER_TWO)),N.fromElements=function(e,t,n){return S.defined(n)?(n.x=e,n.y=t,n):new N(e,t)},N.fromCartesian3=N.clone=function(e,t){if(S.defined(e))return S.defined(t)?(t.x=e.x,t.y=e.y,t):new N(e.x,e.y)},N.fromCartesian4=N.clone,N.packedLength=2,N.pack=function(e,t,n){return n=S.defaultValue(n,0),t[n++]=e.x,t[n]=e.y,t},N.unpack=function(e,t,n){return t=S.defaultValue(t,0),(n=!S.defined(n)?new N:n).x=e[t++],n.y=e[t],n},N.packArray=function(e,t){var n=e.length,a=2*n;if(S.defined(t)){if(!Array.isArray(t)&&t.length!==a)throw new i.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==a&&(t.length=a)}else t=new Array(a);for(var r=0;r<n;++r)N.pack(e[r],t,2*r);return t},N.unpackArray=function(e,t){var n=e.length;S.defined(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var r=a/2;t[r]=N.unpack(e,a,t[r])}return t},N.fromArray=N.unpack,N.maximumComponent=function(e){return Math.max(e.x,e.y)},N.minimumComponent=function(e){return Math.min(e.x,e.y)},N.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},N.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},N.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},N.magnitude=function(e){return Math.sqrt(N.magnitudeSquared(e))};var U=new N;N.distance=function(e,t){return N.subtract(e,t,U),N.magnitude(U)},N.distanceSquared=function(e,t){return N.subtract(e,t,U),N.magnitudeSquared(U)},N.normalize=function(e,t){var n=N.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},N.dot=function(e,t){return e.x*t.x+e.y*t.y},N.cross=function(e,t){return e.x*t.y-e.y*t.x},N.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},N.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},N.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},N.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},N.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},N.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},N.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},N.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var L=new N;N.lerp=function(e,t,n,a){return N.multiplyByScalar(t,n,L),a=N.multiplyByScalar(e,1-n,a),N.add(L,a,a)};var W=new N,k=new N;N.angleBetween=function(e,t){return N.normalize(e,W),N.normalize(t,k),q.CesiumMath.acosClamped(N.dot(W,k))};var B=new N;N.mostOrthogonalAxis=function(e,t){e=N.normalize(e,B);return N.abs(e,e),t=e.x<=e.y?N.clone(N.UNIT_X,t):N.clone(N.UNIT_Y,t)},N.equals=function(e,t){return e===t||S.defined(e)&&S.defined(t)&&e.x===t.x&&e.y===t.y},N.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},N.equalsEpsilon=function(e,t,n,a){return e===t||S.defined(e)&&S.defined(t)&&q.CesiumMath.equalsEpsilon(e.x,t.x,n,a)&&q.CesiumMath.equalsEpsilon(e.y,t.y,n,a)},N.ZERO=Object.freeze(new N(0,0)),N.UNIT_X=Object.freeze(new N(1,0)),N.UNIT_Y=Object.freeze(new N(0,1)),N.prototype.clone=function(e){return N.clone(this,e)},N.prototype.equals=function(e){return N.equals(this,e)},N.prototype.equalsEpsilon=function(e,t,n){return N.equalsEpsilon(this,e,t,n)},N.prototype.toString=function(){return"("+this.x+", "+this.y+")"},e.Cartesian2=N,e.Cartesian3=O,e.Cartographic=f,e.Ellipsoid=w,e.Rectangle=E}); diff --git a/public/Cesium/Workers/Check-24483042.js b/public/Cesium/Workers/Check-24483042.js new file mode 100644 index 0000000..a7631b0 --- /dev/null +++ b/public/Cesium/Workers/Check-24483042.js @@ -0,0 +1 @@ +define(["exports","./when-54335d57"],function(e,n){"use strict";function r(e){var t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}n.defined(Object.create)&&((r.prototype=Object.create(Error.prototype)).constructor=r),r.prototype.toString=function(){var e=this.name+": "+this.message;return n.defined(this.stack)&&(e+="\n"+this.stack.toString()),e},r.throwInstantiationError=function(){throw new r("This function defines an interface and should not be called directly.")};var a={};function o(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}a.typeOf={},a.defined=function(e,t){if(!n.defined(t))throw new r(e+" is required, actual value was undefined")},a.typeOf.func=function(e,t){if("function"!=typeof t)throw new r(o(typeof t,"function",e))},a.typeOf.string=function(e,t){if("string"!=typeof t)throw new r(o(typeof t,"string",e))},a.typeOf.number=function(e,t){if("number"!=typeof t)throw new r(o(typeof t,"number",e))},a.typeOf.number.lessThan=function(e,t,n){if(a.typeOf.number(e,t),n<=t)throw new r("Expected "+e+" to be less than "+n+", actual value was "+t)},a.typeOf.number.lessThanOrEquals=function(e,t,n){if(a.typeOf.number(e,t),n<t)throw new r("Expected "+e+" to be less than or equal to "+n+", actual value was "+t)},a.typeOf.number.greaterThan=function(e,t,n){if(a.typeOf.number(e,t),t<=n)throw new r("Expected "+e+" to be greater than "+n+", actual value was "+t)},a.typeOf.number.greaterThanOrEquals=function(e,t,n){if(a.typeOf.number(e,t),t<n)throw new r("Expected "+e+" to be greater than or equal to"+n+", actual value was "+t)},a.typeOf.object=function(e,t){if("object"!=typeof t)throw new r(o(typeof t,"object",e))},a.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new r(o(typeof t,"boolean",e))},a.typeOf.number.equals=function(e,t,n,o){if(a.typeOf.number(e,n),a.typeOf.number(t,o),n!==o)throw new r(e+" must be equal to "+t+", the actual values are "+n+" and "+o)},e.Check=a,e.DeveloperError=r}); diff --git a/public/Cesium/Workers/Check-d18af7c4.js b/public/Cesium/Workers/Check-d18af7c4.js deleted file mode 100644 index 133f72a..0000000 --- a/public/Cesium/Workers/Check-d18af7c4.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./when-208fe5b0"],function(e,n){"use strict";function r(e){var t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}n.defined(Object.create)&&((r.prototype=Object.create(Error.prototype)).constructor=r),r.prototype.toString=function(){var e=this.name+": "+this.message;return n.defined(this.stack)&&(e+="\n"+this.stack.toString()),e},r.throwInstantiationError=function(){throw new r("This function defines an interface and should not be called directly.")};var f={};function o(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}f.typeOf={},f.defined=function(e,t){if(!n.defined(t))throw new r(e+" is required, actual value was undefined")},f.typeOf.func=function(e,t){if("function"!=typeof t)throw new r(o(typeof t,"function",e))},f.typeOf.string=function(e,t){if("string"!=typeof t)throw new r(o(typeof t,"string",e))},f.typeOf.number=function(e,t){if("number"!=typeof t)throw new r(o(typeof t,"number",e))},f.typeOf.number.lessThan=function(e,t,n){if(f.typeOf.number(e,t),n<=t)throw new r("Expected "+e+" to be less than "+n+", actual value was "+t)},f.typeOf.number.lessThanOrEquals=function(e,t,n){if(f.typeOf.number(e,t),n<t)throw new r("Expected "+e+" to be less than or equal to "+n+", actual value was "+t)},f.typeOf.number.greaterThan=function(e,t,n){if(f.typeOf.number(e,t),t<=n)throw new r("Expected "+e+" to be greater than "+n+", actual value was "+t)},f.typeOf.number.greaterThanOrEquals=function(e,t,n){if(f.typeOf.number(e,t),t<n)throw new r("Expected "+e+" to be greater than or equal to"+n+", actual value was "+t)},f.typeOf.object=function(e,t){if("object"!=typeof t)throw new r(o(typeof t,"object",e))},f.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new r(o(typeof t,"boolean",e))},f.typeOf.number.equals=function(e,t,n,o){if(f.typeOf.number(e,n),f.typeOf.number(t,o),n!==o)throw new r(e+" must be equal to "+t+", the actual values are "+n+" and "+o)},e.Check=f,e.DeveloperError=r}); diff --git a/public/Cesium/Workers/Color-b0d12252.js b/public/Cesium/Workers/Color-98c5f877.js similarity index 98% rename from public/Cesium/Workers/Color-b0d12252.js rename to public/Cesium/Workers/Color-98c5f877.js index d23046b..57e3112 100644 --- a/public/Cesium/Workers/Color-b0d12252.js +++ b/public/Cesium/Workers/Color-98c5f877.js @@ -1 +1 @@ -define(["exports","./Check-d18af7c4","./when-208fe5b0","./Transforms-a73b3b3b","./Math-4e53b694"],function(e,r,C,o,a){"use strict";function i(e,r,o){return o<0&&(o+=1),1<o&&--o,6*o<1?e+6*(r-e)*o:2*o<1?r:3*o<2?e+(r-e)*(2/3-o)*6:e}function E(e,r,o,t){this.red=C.defaultValue(e,1),this.green=C.defaultValue(r,1),this.blue=C.defaultValue(o,1),this.alpha=C.defaultValue(t,1)}var t,f;E.fromCartesian4=function(e,r){return C.defined(r)?(r.red=e.x,r.green=e.y,r.blue=e.z,r.alpha=e.w,r):new E(e.x,e.y,e.z,e.w)},E.fromBytes=function(e,r,o,t,f){return e=E.byteToFloat(C.defaultValue(e,255)),r=E.byteToFloat(C.defaultValue(r,255)),o=E.byteToFloat(C.defaultValue(o,255)),t=E.byteToFloat(C.defaultValue(t,255)),C.defined(f)?(f.red=e,f.green=r,f.blue=o,f.alpha=t,f):new E(e,r,o,t)},E.fromAlpha=function(e,r,o){return C.defined(o)?(o.red=e.red,o.green=e.green,o.blue=e.blue,o.alpha=r,o):new E(e.red,e.green,e.blue,r)},o.FeatureDetection.supportsTypedArrays()&&(o=new ArrayBuffer(4),t=new Uint32Array(o),f=new Uint8Array(o)),E.fromRgba=function(e,r){return t[0]=e,E.fromBytes(f[0],f[1],f[2],f[3],r)},E.fromHsl=function(e,r,o,t,f){e=C.defaultValue(e,0)%1,r=C.defaultValue(r,0),o=C.defaultValue(o,0),t=C.defaultValue(t,1);var s=o,n=o,l=o;return 0!==r&&(s=i(r=2*o-(o=o<.5?o*(1+r):o+r-o*r),o,e+1/3),n=i(r,o,e),l=i(r,o,e-1/3)),C.defined(f)?(f.red=s,f.green=n,f.blue=l,f.alpha=t,f):new E(s,n,l,t)},E.fromRandom=function(e,r){var o=(e=C.defaultValue(e,C.defaultValue.EMPTY_OBJECT)).red;C.defined(o)||(t=C.defaultValue(e.minimumRed,0),f=C.defaultValue(e.maximumRed,1),o=t+a.CesiumMath.nextRandomNumber()*(f-t));var t,f=e.green;C.defined(f)||(s=C.defaultValue(e.minimumGreen,0),t=C.defaultValue(e.maximumGreen,1),f=s+a.CesiumMath.nextRandomNumber()*(t-s));var s=e.blue;C.defined(s)||(n=C.defaultValue(e.minimumBlue,0),l=C.defaultValue(e.maximumBlue,1),s=n+a.CesiumMath.nextRandomNumber()*(l-n));var n,l=e.alpha;return C.defined(l)||(n=C.defaultValue(e.minimumAlpha,0),e=C.defaultValue(e.maximumAlpha,1),l=n+a.CesiumMath.nextRandomNumber()*(e-n)),C.defined(r)?(r.red=o,r.green=f,r.blue=s,r.alpha=l,r):new E(o,f,s,l)};var s=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,n=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,l=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,u=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;E.fromCssColorString=function(e,r){C.defined(r)||(r=new E);var o=E[(e=e.replace(/\s/g,"")).toUpperCase()];if(C.defined(o))return E.clone(o,r),r;o=s.exec(e);return null!==o?(r.red=parseInt(o[1],16)/15,r.green=parseInt(o[2],16)/15,r.blue=parseInt(o[3],16)/15,r.alpha=parseInt(C.defaultValue(o[4],"f"),16)/15,r):null!==(o=n.exec(e))?(r.red=parseInt(o[1],16)/255,r.green=parseInt(o[2],16)/255,r.blue=parseInt(o[3],16)/255,r.alpha=parseInt(C.defaultValue(o[4],"ff"),16)/255,r):null!==(o=l.exec(e))?(r.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),r.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),r.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),r.alpha=parseFloat(C.defaultValue(o[4],"1.0")),r):null!==(o=u.exec(e))?E.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(C.defaultValue(o[4],"1.0")),r):r=void 0},E.packedLength=4,E.pack=function(e,r,o){return o=C.defaultValue(o,0),r[o++]=e.red,r[o++]=e.green,r[o++]=e.blue,r[o]=e.alpha,r},E.unpack=function(e,r,o){return r=C.defaultValue(r,0),(o=!C.defined(o)?new E:o).red=e[r++],o.green=e[r++],o.blue=e[r++],o.alpha=e[r],o},E.byteToFloat=function(e){return e/255},E.floatToByte=function(e){return 1===e?255:256*e|0},E.clone=function(e,r){if(C.defined(e))return C.defined(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new E(e.red,e.green,e.blue,e.alpha)},E.equals=function(e,r){return e===r||C.defined(e)&&C.defined(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},E.equalsArray=function(e,r,o){return e.red===r[o]&&e.green===r[o+1]&&e.blue===r[o+2]&&e.alpha===r[o+3]},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,r){return this===e||C.defined(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},E.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},E.prototype.toCssColorString=function(){var e=E.floatToByte(this.red),r=E.floatToByte(this.green),o=E.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+r+","+o+")":"rgba("+e+","+r+","+o+","+this.alpha+")"},E.prototype.toCssHexString=function(){var e=E.floatToByte(this.red).toString(16);e.length<2&&(e="0"+e);var r=E.floatToByte(this.green).toString(16);r.length<2&&(r="0"+r);var o=E.floatToByte(this.blue).toString(16);if(o.length<2&&(o="0"+o),this.alpha<1){var t=E.floatToByte(this.alpha).toString(16);return"#"+e+r+o+(t=t.length<2?"0"+t:t)}return"#"+e+r+o},E.prototype.toBytes=function(e){var r=E.floatToByte(this.red),o=E.floatToByte(this.green),t=E.floatToByte(this.blue),f=E.floatToByte(this.alpha);return C.defined(e)?(e[0]=r,e[1]=o,e[2]=t,e[3]=f,e):[r,o,t,f]},E.prototype.toRgba=function(){return f[0]=E.floatToByte(this.red),f[1]=E.floatToByte(this.green),f[2]=E.floatToByte(this.blue),f[3]=E.floatToByte(this.alpha),t[0]},E.prototype.brighten=function(e,r){return e=1-e,r.red=1-(1-this.red)*e,r.green=1-(1-this.green)*e,r.blue=1-(1-this.blue)*e,r.alpha=this.alpha,r},E.prototype.darken=function(e,r){return e=1-e,r.red=this.red*e,r.green=this.green*e,r.blue=this.blue*e,r.alpha=this.alpha,r},E.prototype.withAlpha=function(e,r){return E.fromAlpha(this,e,r)},E.add=function(e,r,o){return o.red=e.red+r.red,o.green=e.green+r.green,o.blue=e.blue+r.blue,o.alpha=e.alpha+r.alpha,o},E.subtract=function(e,r,o){return o.red=e.red-r.red,o.green=e.green-r.green,o.blue=e.blue-r.blue,o.alpha=e.alpha-r.alpha,o},E.multiply=function(e,r,o){return o.red=e.red*r.red,o.green=e.green*r.green,o.blue=e.blue*r.blue,o.alpha=e.alpha*r.alpha,o},E.divide=function(e,r,o){return o.red=e.red/r.red,o.green=e.green/r.green,o.blue=e.blue/r.blue,o.alpha=e.alpha/r.alpha,o},E.mod=function(e,r,o){return o.red=e.red%r.red,o.green=e.green%r.green,o.blue=e.blue%r.blue,o.alpha=e.alpha%r.alpha,o},E.lerp=function(e,r,o,t){return t.red=a.CesiumMath.lerp(e.red,r.red,o),t.green=a.CesiumMath.lerp(e.green,r.green,o),t.blue=a.CesiumMath.lerp(e.blue,r.blue,o),t.alpha=a.CesiumMath.lerp(e.alpha,r.alpha,o),t},E.multiplyByScalar=function(e,r,o){return o.red=e.red*r,o.green=e.green*r,o.blue=e.blue*r,o.alpha=e.alpha*r,o},E.divideByScalar=function(e,r,o){return o.red=e.red/r,o.green=e.green/r,o.blue=e.blue/r,o.alpha=e.alpha/r,o},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)),e.Color=E}); +define(["exports","./Check-24483042","./when-54335d57","./Transforms-79117a7b","./Math-d6182036"],function(e,r,C,o,a){"use strict";function i(e,r,o){return o<0&&(o+=1),1<o&&--o,6*o<1?e+6*(r-e)*o:2*o<1?r:3*o<2?e+(r-e)*(2/3-o)*6:e}function E(e,r,o,t){this.red=C.defaultValue(e,1),this.green=C.defaultValue(r,1),this.blue=C.defaultValue(o,1),this.alpha=C.defaultValue(t,1)}var t,f;E.fromCartesian4=function(e,r){return C.defined(r)?(r.red=e.x,r.green=e.y,r.blue=e.z,r.alpha=e.w,r):new E(e.x,e.y,e.z,e.w)},E.fromBytes=function(e,r,o,t,f){return e=E.byteToFloat(C.defaultValue(e,255)),r=E.byteToFloat(C.defaultValue(r,255)),o=E.byteToFloat(C.defaultValue(o,255)),t=E.byteToFloat(C.defaultValue(t,255)),C.defined(f)?(f.red=e,f.green=r,f.blue=o,f.alpha=t,f):new E(e,r,o,t)},E.fromAlpha=function(e,r,o){return C.defined(o)?(o.red=e.red,o.green=e.green,o.blue=e.blue,o.alpha=r,o):new E(e.red,e.green,e.blue,r)},o.FeatureDetection.supportsTypedArrays()&&(o=new ArrayBuffer(4),t=new Uint32Array(o),f=new Uint8Array(o)),E.fromRgba=function(e,r){return t[0]=e,E.fromBytes(f[0],f[1],f[2],f[3],r)},E.fromHsl=function(e,r,o,t,f){e=C.defaultValue(e,0)%1,r=C.defaultValue(r,0),o=C.defaultValue(o,0),t=C.defaultValue(t,1);var s=o,n=o,l=o;return 0!==r&&(s=i(r=2*o-(o=o<.5?o*(1+r):o+r-o*r),o,e+1/3),n=i(r,o,e),l=i(r,o,e-1/3)),C.defined(f)?(f.red=s,f.green=n,f.blue=l,f.alpha=t,f):new E(s,n,l,t)},E.fromRandom=function(e,r){var o=(e=C.defaultValue(e,C.defaultValue.EMPTY_OBJECT)).red;C.defined(o)||(t=C.defaultValue(e.minimumRed,0),f=C.defaultValue(e.maximumRed,1),o=t+a.CesiumMath.nextRandomNumber()*(f-t));var t,f=e.green;C.defined(f)||(s=C.defaultValue(e.minimumGreen,0),t=C.defaultValue(e.maximumGreen,1),f=s+a.CesiumMath.nextRandomNumber()*(t-s));var s=e.blue;C.defined(s)||(n=C.defaultValue(e.minimumBlue,0),l=C.defaultValue(e.maximumBlue,1),s=n+a.CesiumMath.nextRandomNumber()*(l-n));var n,l=e.alpha;return C.defined(l)||(n=C.defaultValue(e.minimumAlpha,0),e=C.defaultValue(e.maximumAlpha,1),l=n+a.CesiumMath.nextRandomNumber()*(e-n)),C.defined(r)?(r.red=o,r.green=f,r.blue=s,r.alpha=l,r):new E(o,f,s,l)};var s=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,n=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,l=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,u=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;E.fromCssColorString=function(e,r){C.defined(r)||(r=new E);var o=E[(e=e.replace(/\s/g,"")).toUpperCase()];if(C.defined(o))return E.clone(o,r),r;o=s.exec(e);return null!==o?(r.red=parseInt(o[1],16)/15,r.green=parseInt(o[2],16)/15,r.blue=parseInt(o[3],16)/15,r.alpha=parseInt(C.defaultValue(o[4],"f"),16)/15,r):null!==(o=n.exec(e))?(r.red=parseInt(o[1],16)/255,r.green=parseInt(o[2],16)/255,r.blue=parseInt(o[3],16)/255,r.alpha=parseInt(C.defaultValue(o[4],"ff"),16)/255,r):null!==(o=l.exec(e))?(r.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),r.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),r.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),r.alpha=parseFloat(C.defaultValue(o[4],"1.0")),r):null!==(o=u.exec(e))?E.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(C.defaultValue(o[4],"1.0")),r):r=void 0},E.packedLength=4,E.pack=function(e,r,o){return o=C.defaultValue(o,0),r[o++]=e.red,r[o++]=e.green,r[o++]=e.blue,r[o]=e.alpha,r},E.unpack=function(e,r,o){return r=C.defaultValue(r,0),(o=!C.defined(o)?new E:o).red=e[r++],o.green=e[r++],o.blue=e[r++],o.alpha=e[r],o},E.byteToFloat=function(e){return e/255},E.floatToByte=function(e){return 1===e?255:256*e|0},E.clone=function(e,r){if(C.defined(e))return C.defined(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new E(e.red,e.green,e.blue,e.alpha)},E.equals=function(e,r){return e===r||C.defined(e)&&C.defined(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},E.equalsArray=function(e,r,o){return e.red===r[o]&&e.green===r[o+1]&&e.blue===r[o+2]&&e.alpha===r[o+3]},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,r){return this===e||C.defined(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},E.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},E.prototype.toCssColorString=function(){var e=E.floatToByte(this.red),r=E.floatToByte(this.green),o=E.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+r+","+o+")":"rgba("+e+","+r+","+o+","+this.alpha+")"},E.prototype.toCssHexString=function(){var e=E.floatToByte(this.red).toString(16);e.length<2&&(e="0"+e);var r=E.floatToByte(this.green).toString(16);r.length<2&&(r="0"+r);var o=E.floatToByte(this.blue).toString(16);if(o.length<2&&(o="0"+o),this.alpha<1){var t=E.floatToByte(this.alpha).toString(16);return"#"+e+r+o+(t=t.length<2?"0"+t:t)}return"#"+e+r+o},E.prototype.toBytes=function(e){var r=E.floatToByte(this.red),o=E.floatToByte(this.green),t=E.floatToByte(this.blue),f=E.floatToByte(this.alpha);return C.defined(e)?(e[0]=r,e[1]=o,e[2]=t,e[3]=f,e):[r,o,t,f]},E.prototype.toRgba=function(){return f[0]=E.floatToByte(this.red),f[1]=E.floatToByte(this.green),f[2]=E.floatToByte(this.blue),f[3]=E.floatToByte(this.alpha),t[0]},E.prototype.brighten=function(e,r){return r.red=1-(1-this.red)*(e=1-e),r.green=1-(1-this.green)*e,r.blue=1-(1-this.blue)*e,r.alpha=this.alpha,r},E.prototype.darken=function(e,r){return r.red=this.red*(e=1-e),r.green=this.green*e,r.blue=this.blue*e,r.alpha=this.alpha,r},E.prototype.withAlpha=function(e,r){return E.fromAlpha(this,e,r)},E.add=function(e,r,o){return o.red=e.red+r.red,o.green=e.green+r.green,o.blue=e.blue+r.blue,o.alpha=e.alpha+r.alpha,o},E.subtract=function(e,r,o){return o.red=e.red-r.red,o.green=e.green-r.green,o.blue=e.blue-r.blue,o.alpha=e.alpha-r.alpha,o},E.multiply=function(e,r,o){return o.red=e.red*r.red,o.green=e.green*r.green,o.blue=e.blue*r.blue,o.alpha=e.alpha*r.alpha,o},E.divide=function(e,r,o){return o.red=e.red/r.red,o.green=e.green/r.green,o.blue=e.blue/r.blue,o.alpha=e.alpha/r.alpha,o},E.mod=function(e,r,o){return o.red=e.red%r.red,o.green=e.green%r.green,o.blue=e.blue%r.blue,o.alpha=e.alpha%r.alpha,o},E.lerp=function(e,r,o,t){return t.red=a.CesiumMath.lerp(e.red,r.red,o),t.green=a.CesiumMath.lerp(e.green,r.green,o),t.blue=a.CesiumMath.lerp(e.blue,r.blue,o),t.alpha=a.CesiumMath.lerp(e.alpha,r.alpha,o),t},E.multiplyByScalar=function(e,r,o){return o.red=e.red*r,o.green=e.green*r,o.blue=e.blue*r,o.alpha=e.alpha*r,o},E.divideByScalar=function(e,r,o){return o.red=e.red/r,o.green=e.green/r,o.blue=e.blue/r,o.alpha=e.alpha/r,o},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)),e.Color=E}); diff --git a/public/Cesium/Workers/ComponentDatatype-9204e9f6.js b/public/Cesium/Workers/ComponentDatatype-1a100acd.js similarity index 94% rename from public/Cesium/Workers/ComponentDatatype-9204e9f6.js rename to public/Cesium/Workers/ComponentDatatype-1a100acd.js index 5da610d..c18df9a 100644 --- a/public/Cesium/Workers/ComponentDatatype-9204e9f6.js +++ b/public/Cesium/Workers/ComponentDatatype-1a100acd.js @@ -1 +1 @@ -define(["exports","./when-208fe5b0","./Check-d18af7c4","./WebGLConstants-76bb35d1"],function(r,a,e,n){"use strict";var E={BYTE:n.WebGLConstants.BYTE,UNSIGNED_BYTE:n.WebGLConstants.UNSIGNED_BYTE,SHORT:n.WebGLConstants.SHORT,UNSIGNED_SHORT:n.WebGLConstants.UNSIGNED_SHORT,INT:n.WebGLConstants.INT,UNSIGNED_INT:n.WebGLConstants.UNSIGNED_INT,FLOAT:n.WebGLConstants.FLOAT,DOUBLE:n.WebGLConstants.DOUBLE,getSizeInBytes:function(r){switch(r){case E.BYTE:return Int8Array.BYTES_PER_ELEMENT;case E.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case E.SHORT:return Int16Array.BYTES_PER_ELEMENT;case E.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case E.INT:return Int32Array.BYTES_PER_ELEMENT;case E.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case E.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case E.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},fromTypedArray:function(r){return r instanceof Int8Array?E.BYTE:r instanceof Uint8Array?E.UNSIGNED_BYTE:r instanceof Int16Array?E.SHORT:r instanceof Uint16Array?E.UNSIGNED_SHORT:r instanceof Int32Array?E.INT:r instanceof Uint32Array?E.UNSIGNED_INT:r instanceof Float32Array?E.FLOAT:r instanceof Float64Array?E.DOUBLE:void 0},validate:function(r){return a.defined(r)&&(r===E.BYTE||r===E.UNSIGNED_BYTE||r===E.SHORT||r===E.UNSIGNED_SHORT||r===E.INT||r===E.UNSIGNED_INT||r===E.FLOAT||r===E.DOUBLE)},createTypedArray:function(r,e){switch(r){case E.BYTE:return new Int8Array(e);case E.UNSIGNED_BYTE:return new Uint8Array(e);case E.SHORT:return new Int16Array(e);case E.UNSIGNED_SHORT:return new Uint16Array(e);case E.INT:return new Int32Array(e);case E.UNSIGNED_INT:return new Uint32Array(e);case E.FLOAT:return new Float32Array(e);case E.DOUBLE:return new Float64Array(e)}},createArrayBufferView:function(r,e,n,t){switch(n=a.defaultValue(n,0),t=a.defaultValue(t,(e.byteLength-n)/E.getSizeInBytes(r)),r){case E.BYTE:return new Int8Array(e,n,t);case E.UNSIGNED_BYTE:return new Uint8Array(e,n,t);case E.SHORT:return new Int16Array(e,n,t);case E.UNSIGNED_SHORT:return new Uint16Array(e,n,t);case E.INT:return new Int32Array(e,n,t);case E.UNSIGNED_INT:return new Uint32Array(e,n,t);case E.FLOAT:return new Float32Array(e,n,t);case E.DOUBLE:return new Float64Array(e,n,t)}},fromName:function(r){switch(r){case"BYTE":return E.BYTE;case"UNSIGNED_BYTE":return E.UNSIGNED_BYTE;case"SHORT":return E.SHORT;case"UNSIGNED_SHORT":return E.UNSIGNED_SHORT;case"INT":return E.INT;case"UNSIGNED_INT":return E.UNSIGNED_INT;case"FLOAT":return E.FLOAT;case"DOUBLE":return E.DOUBLE}}},n=Object.freeze(E);r.ComponentDatatype=n}); +define(["exports","./when-54335d57","./Check-24483042","./WebGLConstants-95ceb4e9"],function(r,a,e,n){"use strict";var E={BYTE:n.WebGLConstants.BYTE,UNSIGNED_BYTE:n.WebGLConstants.UNSIGNED_BYTE,SHORT:n.WebGLConstants.SHORT,UNSIGNED_SHORT:n.WebGLConstants.UNSIGNED_SHORT,INT:n.WebGLConstants.INT,UNSIGNED_INT:n.WebGLConstants.UNSIGNED_INT,FLOAT:n.WebGLConstants.FLOAT,DOUBLE:n.WebGLConstants.DOUBLE,getSizeInBytes:function(r){switch(r){case E.BYTE:return Int8Array.BYTES_PER_ELEMENT;case E.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case E.SHORT:return Int16Array.BYTES_PER_ELEMENT;case E.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case E.INT:return Int32Array.BYTES_PER_ELEMENT;case E.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case E.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case E.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},fromTypedArray:function(r){return r instanceof Int8Array?E.BYTE:r instanceof Uint8Array?E.UNSIGNED_BYTE:r instanceof Int16Array?E.SHORT:r instanceof Uint16Array?E.UNSIGNED_SHORT:r instanceof Int32Array?E.INT:r instanceof Uint32Array?E.UNSIGNED_INT:r instanceof Float32Array?E.FLOAT:r instanceof Float64Array?E.DOUBLE:void 0},validate:function(r){return a.defined(r)&&(r===E.BYTE||r===E.UNSIGNED_BYTE||r===E.SHORT||r===E.UNSIGNED_SHORT||r===E.INT||r===E.UNSIGNED_INT||r===E.FLOAT||r===E.DOUBLE)},createTypedArray:function(r,e){switch(r){case E.BYTE:return new Int8Array(e);case E.UNSIGNED_BYTE:return new Uint8Array(e);case E.SHORT:return new Int16Array(e);case E.UNSIGNED_SHORT:return new Uint16Array(e);case E.INT:return new Int32Array(e);case E.UNSIGNED_INT:return new Uint32Array(e);case E.FLOAT:return new Float32Array(e);case E.DOUBLE:return new Float64Array(e)}},createArrayBufferView:function(r,e,n,t){switch(n=a.defaultValue(n,0),t=a.defaultValue(t,(e.byteLength-n)/E.getSizeInBytes(r)),r){case E.BYTE:return new Int8Array(e,n,t);case E.UNSIGNED_BYTE:return new Uint8Array(e,n,t);case E.SHORT:return new Int16Array(e,n,t);case E.UNSIGNED_SHORT:return new Uint16Array(e,n,t);case E.INT:return new Int32Array(e,n,t);case E.UNSIGNED_INT:return new Uint32Array(e,n,t);case E.FLOAT:return new Float32Array(e,n,t);case E.DOUBLE:return new Float64Array(e,n,t)}},fromName:function(r){switch(r){case"BYTE":return E.BYTE;case"UNSIGNED_BYTE":return E.UNSIGNED_BYTE;case"SHORT":return E.SHORT;case"UNSIGNED_SHORT":return E.UNSIGNED_SHORT;case"INT":return E.INT;case"UNSIGNED_INT":return E.UNSIGNED_INT;case"FLOAT":return E.FLOAT;case"DOUBLE":return E.DOUBLE}}},n=Object.freeze(E);r.ComponentDatatype=n}); diff --git a/public/Cesium/Workers/CoplanarPolygonGeometryLibrary-32520d7a.js b/public/Cesium/Workers/CoplanarPolygonGeometryLibrary-32520d7a.js new file mode 100644 index 0000000..d733ed9 --- /dev/null +++ b/public/Cesium/Workers/CoplanarPolygonGeometryLibrary-32520d7a.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./Transforms-79117a7b","./OrientedBoundingBox-eb360dc3"],function(n,d,t,l,f){"use strict";var e={},i=new d.Cartesian3,x=new d.Cartesian3,B=new d.Cartesian3,P=new d.Cartesian3,M=new f.OrientedBoundingBox;function o(n,t,e,r,a){t=d.Cartesian3.subtract(n,t,i),e=d.Cartesian3.dot(e,t),t=d.Cartesian3.dot(r,t);return d.Cartesian2.fromElements(e,t,a)}e.validOutline=function(n){var t=f.OrientedBoundingBox.fromPoints(n,M).halfAxes,e=l.Matrix3.getColumn(t,0,x),n=l.Matrix3.getColumn(t,1,B),t=l.Matrix3.getColumn(t,2,P),e=d.Cartesian3.magnitude(e),n=d.Cartesian3.magnitude(n),t=d.Cartesian3.magnitude(t);return!(0===e&&(0===n||0===t)||0===n&&0===t)},e.computeProjectTo2DArguments=function(n,t,e,r){var a,i,o=f.OrientedBoundingBox.fromPoints(n,M),u=o.halfAxes,s=l.Matrix3.getColumn(u,0,x),C=l.Matrix3.getColumn(u,1,B),c=l.Matrix3.getColumn(u,2,P),m=d.Cartesian3.magnitude(s),g=d.Cartesian3.magnitude(C),n=d.Cartesian3.magnitude(c),u=Math.min(m,g,n);return(0!==m||0!==g&&0!==n)&&(0!==g||0!==n)&&(u!==g&&u!==n||(a=s),u===m?a=C:u===n&&(i=C),u!==m&&u!==g||(i=c),d.Cartesian3.normalize(a,e),d.Cartesian3.normalize(i,r),d.Cartesian3.clone(o.center,t),!0)},e.createProjectPointsTo2DFunction=function(r,a,i){return function(n){for(var t=new Array(n.length),e=0;e<n.length;e++)t[e]=o(n[e],r,a,i);return t}},e.createProjectPointTo2DFunction=function(e,r,a){return function(n,t){return o(n,e,r,a,t)}},n.CoplanarPolygonGeometryLibrary=e}); diff --git a/public/Cesium/Workers/CoplanarPolygonGeometryLibrary-6c63fe5e.js b/public/Cesium/Workers/CoplanarPolygonGeometryLibrary-6c63fe5e.js deleted file mode 100644 index b2ddb03..0000000 --- a/public/Cesium/Workers/CoplanarPolygonGeometryLibrary-6c63fe5e.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./Transforms-a73b3b3b","./OrientedBoundingBox-18b4901f"],function(n,g,t,f,l){"use strict";var e={},i=new g.Cartesian3,x=new g.Cartesian3,B=new g.Cartesian3,P=new g.Cartesian3,M=new l.OrientedBoundingBox;function o(n,t,e,r,a){t=g.Cartesian3.subtract(n,t,i),e=g.Cartesian3.dot(e,t),t=g.Cartesian3.dot(r,t);return g.Cartesian2.fromElements(e,t,a)}e.validOutline=function(n){var t=l.OrientedBoundingBox.fromPoints(n,M).halfAxes,e=f.Matrix3.getColumn(t,0,x),n=f.Matrix3.getColumn(t,1,B),t=f.Matrix3.getColumn(t,2,P),e=g.Cartesian3.magnitude(e),n=g.Cartesian3.magnitude(n),t=g.Cartesian3.magnitude(t);return!(0===e&&(0===n||0===t)||0===n&&0===t)},e.computeProjectTo2DArguments=function(n,t,e,r){var a,i,o=l.OrientedBoundingBox.fromPoints(n,M),u=o.halfAxes,s=f.Matrix3.getColumn(u,0,x),C=f.Matrix3.getColumn(u,1,B),c=f.Matrix3.getColumn(u,2,P),m=g.Cartesian3.magnitude(s),d=g.Cartesian3.magnitude(C),n=g.Cartesian3.magnitude(c),u=Math.min(m,d,n);return(0!==m||0!==d&&0!==n)&&(0!==d||0!==n)&&(u!==d&&u!==n||(a=s),u===m?a=C:u===n&&(i=C),u!==m&&u!==d||(i=c),g.Cartesian3.normalize(a,e),g.Cartesian3.normalize(i,r),g.Cartesian3.clone(o.center,t),!0)},e.createProjectPointsTo2DFunction=function(r,a,i){return function(n){for(var t=new Array(n.length),e=0;e<n.length;e++)t[e]=o(n[e],r,a,i);return t}},e.createProjectPointTo2DFunction=function(e,r,a){return function(n,t){return o(n,e,r,a,t)}},n.CoplanarPolygonGeometryLibrary=e}); diff --git a/public/Cesium/Workers/CorridorGeometryLibrary-1ea8b9ee.js b/public/Cesium/Workers/CorridorGeometryLibrary-1ea8b9ee.js new file mode 100644 index 0000000..b76b3b2 --- /dev/null +++ b/public/Cesium/Workers/CorridorGeometryLibrary-1ea8b9ee.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./PolylineVolumeGeometryLibrary-4d0ebb44","./when-54335d57","./Math-d6182036","./Transforms-79117a7b","./PolylinePipeline-3803a6c2"],function(a,O,R,s,V,u,Q){"use strict";var e={},U=new O.Cartesian3,d=new O.Cartesian3,p=new O.Cartesian3,m=new O.Cartesian3,G=[new O.Cartesian3,new O.Cartesian3],I=new O.Cartesian3,q=new O.Cartesian3,j=new O.Cartesian3,k=new O.Cartesian3,F=new O.Cartesian3,H=new O.Cartesian3,J=new O.Cartesian3,K=new O.Cartesian3,W=new O.Cartesian3,X=new O.Cartesian3,c=new u.Quaternion,g=new u.Matrix3;function Y(a,e,r,n,t){var i=O.Cartesian3.angleBetween(O.Cartesian3.subtract(e,a,U),O.Cartesian3.subtract(r,a,d)),s=n===R.CornerType.BEVELED?1:Math.ceil(i/V.CesiumMath.toRadians(5))+1,n=3*s,o=new Array(n);o[n-3]=r.x,o[n-2]=r.y,o[n-1]=r.z;var C=t?u.Matrix3.fromQuaternion(u.Quaternion.fromAxisAngle(O.Cartesian3.negate(a,U),i/s,c),g):u.Matrix3.fromQuaternion(u.Quaternion.fromAxisAngle(a,i/s,c),g),l=0;e=O.Cartesian3.clone(e,U);for(var y=0;y<s;y++)e=u.Matrix3.multiplyByVector(C,e,e),o[l++]=e.x,o[l++]=e.y,o[l++]=e.z;return o}function Z(a,e,r,n){var t=U;return[(t=(n||(e=O.Cartesian3.negate(e,e)),O.Cartesian3.add(a,e,t))).x,t.y,t.z,r.x,r.y,r.z]}function $(a,e,r,n){for(var t=new Array(a.length),i=new Array(a.length),s=O.Cartesian3.multiplyByScalar(e,r,U),o=O.Cartesian3.negate(s,d),C=0,l=a.length-1,y=0;y<a.length;y+=3){var u=O.Cartesian3.fromArray(a,y,p),c=O.Cartesian3.add(u,o,m);t[C++]=c.x,t[C++]=c.y,t[C++]=c.z;u=O.Cartesian3.add(u,s,m);i[l--]=u.z,i[l--]=u.y,i[l--]=u.x}return n.push(t,i),n}e.addAttribute=function(a,e,r,n){var t=e.x,i=e.y,e=e.z;s.defined(r)&&(a[r]=t,a[r+1]=i,a[r+2]=e),s.defined(n)&&(a[n]=e,a[n-1]=i,a[n-2]=t)};var _=new O.Cartesian3,aa=new O.Cartesian3;e.computePositions=function(a){var e=a.granularity,r=a.positions,n=a.ellipsoid,t=a.width/2,i=a.cornerType,s=a.saveAttributes,o=I,C=j,l=k,y=F,u=H,c=J,d=K,p=W,m=X,g=[],h=s?[]:void 0,f=s?[]:void 0,w=r[0],z=r[1],x=O.Cartesian3.normalize(O.Cartesian3.subtract(z,w,x=q),x),o=n.geodeticSurfaceNormal(w,o),l=O.Cartesian3.normalize(O.Cartesian3.cross(o,x,l),l);s&&(h.push(l.x,l.y,l.z),f.push(o.x,o.y,o.z));for(var P,A,B,v,E,S,b,c=O.Cartesian3.clone(w,c),w=z,C=O.Cartesian3.negate(x,C),D=[],M=r.length,T=1;T<M-1;T++){o=n.geodeticSurfaceNormal(w,o),z=r[T+1],x=O.Cartesian3.normalize(O.Cartesian3.subtract(z,w,x),x),y=O.Cartesian3.normalize(O.Cartesian3.add(x,C,y),y);var N=O.Cartesian3.multiplyByScalar(o,O.Cartesian3.dot(x,o),_);O.Cartesian3.subtract(x,N,N),O.Cartesian3.normalize(N,N);var L=O.Cartesian3.multiplyByScalar(o,O.Cartesian3.dot(C,o),aa);O.Cartesian3.subtract(C,L,L),O.Cartesian3.normalize(L,L),V.CesiumMath.equalsEpsilon(Math.abs(O.Cartesian3.dot(N,L)),1,V.CesiumMath.EPSILON7)||(y=O.Cartesian3.cross(y,o,y),y=O.Cartesian3.cross(o,y,y),y=O.Cartesian3.normalize(y,y),N=t/Math.max(.25,O.Cartesian3.magnitude(O.Cartesian3.cross(y,C,U))),L=R.PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(x,C,w,n),y=O.Cartesian3.multiplyByScalar(y,N,y),L?(d=O.Cartesian3.add(w,y,d),m=O.Cartesian3.add(d,O.Cartesian3.multiplyByScalar(l,t,m),m),p=O.Cartesian3.add(d,O.Cartesian3.multiplyByScalar(l,2*t,p),p),G[0]=O.Cartesian3.clone(c,G[0]),G[1]=O.Cartesian3.clone(m,G[1]),g=$(Q.PolylinePipeline.generateArc({positions:G,granularity:e,ellipsoid:n}),l,t,g),s&&(h.push(l.x,l.y,l.z),f.push(o.x,o.y,o.z)),u=O.Cartesian3.clone(p,u),l=O.Cartesian3.normalize(O.Cartesian3.cross(o,x,l),l),p=O.Cartesian3.add(d,O.Cartesian3.multiplyByScalar(l,2*t,p),p),c=O.Cartesian3.add(d,O.Cartesian3.multiplyByScalar(l,t,c),c),i===R.CornerType.ROUNDED||i===R.CornerType.BEVELED?D.push({leftPositions:Y(d,u,p,i,L)}):D.push({leftPositions:Z(w,O.Cartesian3.negate(y,y),p,L)})):(p=O.Cartesian3.add(w,y,p),m=O.Cartesian3.add(p,O.Cartesian3.negate(O.Cartesian3.multiplyByScalar(l,t,m),m),m),d=O.Cartesian3.add(p,O.Cartesian3.negate(O.Cartesian3.multiplyByScalar(l,2*t,d),d),d),G[0]=O.Cartesian3.clone(c,G[0]),G[1]=O.Cartesian3.clone(m,G[1]),g=$(Q.PolylinePipeline.generateArc({positions:G,granularity:e,ellipsoid:n}),l,t,g),s&&(h.push(l.x,l.y,l.z),f.push(o.x,o.y,o.z)),u=O.Cartesian3.clone(d,u),l=O.Cartesian3.normalize(O.Cartesian3.cross(o,x,l),l),d=O.Cartesian3.add(p,O.Cartesian3.negate(O.Cartesian3.multiplyByScalar(l,2*t,d),d),d),c=O.Cartesian3.add(p,O.Cartesian3.negate(O.Cartesian3.multiplyByScalar(l,t,c),c),c),i===R.CornerType.ROUNDED||i===R.CornerType.BEVELED?D.push({rightPositions:Y(p,u,d,i,L)}):D.push({rightPositions:Z(w,y,d,L)})),C=O.Cartesian3.negate(x,C)),w=z}return o=n.geodeticSurfaceNormal(w,o),G[0]=O.Cartesian3.clone(c,G[0]),G[1]=O.Cartesian3.clone(w,G[1]),g=$(Q.PolylinePipeline.generateArc({positions:G,granularity:e,ellipsoid:n}),l,t,g),s&&(h.push(l.x,l.y,l.z),f.push(o.x,o.y,o.z)),i===R.CornerType.ROUNDED&&(A=I,B=j,v=(P=g)[1],E=O.Cartesian3.fromArray(P[1],v.length-3,E=q),B=O.Cartesian3.fromArray(P[0],0,B),S=Y(A=O.Cartesian3.midpoint(E,B,A),E,B,R.CornerType.ROUNDED,!1),b=P.length-1,a=P[b-1],v=P[b],E=O.Cartesian3.fromArray(a,a.length-3,E),B=O.Cartesian3.fromArray(v,0,B),B=[S,Y(A=O.Cartesian3.midpoint(E,B,A),E,B,R.CornerType.ROUNDED,!1)]),{positions:g,corners:D,lefts:h,normals:f,endPositions:B}},a.CorridorGeometryLibrary=e}); diff --git a/public/Cesium/Workers/CorridorGeometryLibrary-dd337458.js b/public/Cesium/Workers/CorridorGeometryLibrary-dd337458.js deleted file mode 100644 index 18ee18c..0000000 --- a/public/Cesium/Workers/CorridorGeometryLibrary-dd337458.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./PolylineVolumeGeometryLibrary-a2a20b2b","./when-208fe5b0","./Math-4e53b694","./Transforms-a73b3b3b","./PolylinePipeline-232a4d9a"],function(a,O,R,s,V,u,Q){"use strict";var e={},U=new O.Cartesian3,d=new O.Cartesian3,p=new O.Cartesian3,m=new O.Cartesian3,G=[new O.Cartesian3,new O.Cartesian3],I=new O.Cartesian3,q=new O.Cartesian3,j=new O.Cartesian3,k=new O.Cartesian3,F=new O.Cartesian3,H=new O.Cartesian3,J=new O.Cartesian3,K=new O.Cartesian3,W=new O.Cartesian3,X=new O.Cartesian3,c=new u.Quaternion,g=new u.Matrix3;function Y(a,e,r,n,t){var i=O.Cartesian3.angleBetween(O.Cartesian3.subtract(e,a,U),O.Cartesian3.subtract(r,a,d)),s=n===R.CornerType.BEVELED?1:Math.ceil(i/V.CesiumMath.toRadians(5))+1,n=3*s,o=new Array(n);o[n-3]=r.x,o[n-2]=r.y,o[n-1]=r.z;var C=t?u.Matrix3.fromQuaternion(u.Quaternion.fromAxisAngle(O.Cartesian3.negate(a,U),i/s,c),g):u.Matrix3.fromQuaternion(u.Quaternion.fromAxisAngle(a,i/s,c),g),l=0;e=O.Cartesian3.clone(e,U);for(var y=0;y<s;y++)e=u.Matrix3.multiplyByVector(C,e,e),o[l++]=e.x,o[l++]=e.y,o[l++]=e.z;return o}function Z(a,e,r,n){var t=U;return[(t=(n||(e=O.Cartesian3.negate(e,e)),O.Cartesian3.add(a,e,t))).x,t.y,t.z,r.x,r.y,r.z]}function $(a,e,r,n){for(var t=new Array(a.length),i=new Array(a.length),s=O.Cartesian3.multiplyByScalar(e,r,U),o=O.Cartesian3.negate(s,d),C=0,l=a.length-1,y=0;y<a.length;y+=3){var u=O.Cartesian3.fromArray(a,y,p),c=O.Cartesian3.add(u,o,m);t[C++]=c.x,t[C++]=c.y,t[C++]=c.z;u=O.Cartesian3.add(u,s,m);i[l--]=u.z,i[l--]=u.y,i[l--]=u.x}return n.push(t,i),n}e.addAttribute=function(a,e,r,n){var t=e.x,i=e.y,e=e.z;s.defined(r)&&(a[r]=t,a[r+1]=i,a[r+2]=e),s.defined(n)&&(a[n]=e,a[n-1]=i,a[n-2]=t)};var _=new O.Cartesian3,aa=new O.Cartesian3;e.computePositions=function(a){var e=a.granularity,r=a.positions,n=a.ellipsoid,t=a.width/2,i=a.cornerType,s=a.saveAttributes,o=I,C=q,l=j,y=k,u=F,c=H,d=J,p=K,m=W,g=X,h=[],f=s?[]:void 0,w=s?[]:void 0,z=r[0],x=r[1],C=O.Cartesian3.normalize(O.Cartesian3.subtract(x,z,C),C),o=n.geodeticSurfaceNormal(z,o),y=O.Cartesian3.normalize(O.Cartesian3.cross(o,C,y),y);s&&(f.push(y.x,y.y,y.z),w.push(o.x,o.y,o.z));for(var b,P,A,B,v,E,S,d=O.Cartesian3.clone(z,d),z=x,l=O.Cartesian3.negate(C,l),D=[],M=r.length,T=1;T<M-1;T++){o=n.geodeticSurfaceNormal(z,o),x=r[T+1],C=O.Cartesian3.normalize(O.Cartesian3.subtract(x,z,C),C),u=O.Cartesian3.normalize(O.Cartesian3.add(C,l,u),u);var N=O.Cartesian3.multiplyByScalar(o,O.Cartesian3.dot(C,o),_);O.Cartesian3.subtract(C,N,N),O.Cartesian3.normalize(N,N);var L=O.Cartesian3.multiplyByScalar(o,O.Cartesian3.dot(l,o),aa);O.Cartesian3.subtract(l,L,L),O.Cartesian3.normalize(L,L),V.CesiumMath.equalsEpsilon(Math.abs(O.Cartesian3.dot(N,L)),1,V.CesiumMath.EPSILON7)||(u=O.Cartesian3.cross(u,o,u),u=O.Cartesian3.cross(o,u,u),u=O.Cartesian3.normalize(u,u),N=t/Math.max(.25,O.Cartesian3.magnitude(O.Cartesian3.cross(u,l,U))),L=R.PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(C,l,z,n),u=O.Cartesian3.multiplyByScalar(u,N,u),L?(p=O.Cartesian3.add(z,u,p),g=O.Cartesian3.add(p,O.Cartesian3.multiplyByScalar(y,t,g),g),m=O.Cartesian3.add(p,O.Cartesian3.multiplyByScalar(y,2*t,m),m),G[0]=O.Cartesian3.clone(d,G[0]),G[1]=O.Cartesian3.clone(g,G[1]),h=$(Q.PolylinePipeline.generateArc({positions:G,granularity:e,ellipsoid:n}),y,t,h),s&&(f.push(y.x,y.y,y.z),w.push(o.x,o.y,o.z)),c=O.Cartesian3.clone(m,c),y=O.Cartesian3.normalize(O.Cartesian3.cross(o,C,y),y),m=O.Cartesian3.add(p,O.Cartesian3.multiplyByScalar(y,2*t,m),m),d=O.Cartesian3.add(p,O.Cartesian3.multiplyByScalar(y,t,d),d),i===R.CornerType.ROUNDED||i===R.CornerType.BEVELED?D.push({leftPositions:Y(p,c,m,i,L)}):D.push({leftPositions:Z(z,O.Cartesian3.negate(u,u),m,L)})):(m=O.Cartesian3.add(z,u,m),g=O.Cartesian3.add(m,O.Cartesian3.negate(O.Cartesian3.multiplyByScalar(y,t,g),g),g),p=O.Cartesian3.add(m,O.Cartesian3.negate(O.Cartesian3.multiplyByScalar(y,2*t,p),p),p),G[0]=O.Cartesian3.clone(d,G[0]),G[1]=O.Cartesian3.clone(g,G[1]),h=$(Q.PolylinePipeline.generateArc({positions:G,granularity:e,ellipsoid:n}),y,t,h),s&&(f.push(y.x,y.y,y.z),w.push(o.x,o.y,o.z)),c=O.Cartesian3.clone(p,c),y=O.Cartesian3.normalize(O.Cartesian3.cross(o,C,y),y),p=O.Cartesian3.add(m,O.Cartesian3.negate(O.Cartesian3.multiplyByScalar(y,2*t,p),p),p),d=O.Cartesian3.add(m,O.Cartesian3.negate(O.Cartesian3.multiplyByScalar(y,t,d),d),d),i===R.CornerType.ROUNDED||i===R.CornerType.BEVELED?D.push({rightPositions:Y(m,c,p,i,L)}):D.push({rightPositions:Z(z,u,p,L)})),l=O.Cartesian3.negate(C,l)),z=x}return o=n.geodeticSurfaceNormal(z,o),G[0]=O.Cartesian3.clone(d,G[0]),G[1]=O.Cartesian3.clone(z,G[1]),h=$(Q.PolylinePipeline.generateArc({positions:G,granularity:e,ellipsoid:n}),y,t,h),s&&(f.push(y.x,y.y,y.z),w.push(o.x,o.y,o.z)),i===R.CornerType.ROUNDED&&(P=I,A=q,B=j,v=(b=h)[1],A=O.Cartesian3.fromArray(b[1],v.length-3,A),B=O.Cartesian3.fromArray(b[0],0,B),E=Y(P=O.Cartesian3.midpoint(A,B,P),A,B,R.CornerType.ROUNDED,!1),S=b.length-1,a=b[S-1],v=b[S],A=O.Cartesian3.fromArray(a,a.length-3,A),B=O.Cartesian3.fromArray(v,0,B),B=[E,Y(P=O.Cartesian3.midpoint(A,B,P),A,B,R.CornerType.ROUNDED,!1)]),{positions:h,corners:D,lefts:f,normals:w,endPositions:B}},a.CorridorGeometryLibrary=e}); diff --git a/public/Cesium/Workers/CylinderGeometry-7778847f.js b/public/Cesium/Workers/CylinderGeometry-7778847f.js deleted file mode 100644 index babb012..0000000 --- a/public/Cesium/Workers/CylinderGeometry-7778847f.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./ComponentDatatype-9204e9f6","./CylinderGeometryLibrary-daf6cec5","./when-208fe5b0","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./VertexFormat-e8cbf5b3"],function(t,P,k,M,z,E,N,e,I,U,S,B,m){"use strict";var Y=new M.Cartesian2,Z=new M.Cartesian3,J=new M.Cartesian3,W=new M.Cartesian3,j=new M.Cartesian3;function u(t){var e=(t=N.defaultValue(t,N.defaultValue.EMPTY_OBJECT)).length,a=t.topRadius,r=t.bottomRadius,n=N.defaultValue(t.vertexFormat,m.VertexFormat.DEFAULT),o=N.defaultValue(t.slices,128);this._length=e,this._topRadius=a,this._bottomRadius=r,this._vertexFormat=m.VertexFormat.clone(n),this._slices=o,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}u.packedLength=m.VertexFormat.packedLength+5,u.pack=function(t,e,a){return a=N.defaultValue(a,0),m.VertexFormat.pack(t._vertexFormat,e,a),a+=m.VertexFormat.packedLength,e[a++]=t._length,e[a++]=t._topRadius,e[a++]=t._bottomRadius,e[a++]=t._slices,e[a]=N.defaultValue(t._offsetAttribute,-1),e};var a,d=new m.VertexFormat,f={vertexFormat:d,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};u.unpack=function(t,e,a){e=N.defaultValue(e,0);var r=m.VertexFormat.unpack(t,e,d);e+=m.VertexFormat.packedLength;var n=t[e++],o=t[e++],i=t[e++],s=t[e++],e=t[e];return N.defined(a)?(a._vertexFormat=m.VertexFormat.clone(r,a._vertexFormat),a._length=n,a._topRadius=o,a._bottomRadius=i,a._slices=s,a._offsetAttribute=-1===e?void 0:e,a):(f.length=n,f.topRadius=o,f.bottomRadius=i,f.slices=s,f.offsetAttribute=-1===e?void 0:e,new u(f))},u.createGeometry=function(t){var e=t._length,a=t._topRadius,r=t._bottomRadius,n=t._vertexFormat,o=t._slices;if(!(e<=0||a<0||r<0||0===a&&0===r)){var i=o+o,s=o+i,m=i+i,u=E.CylinderGeometryLibrary.computePositions(e,a,r,o,!0),d=n.st?new Float32Array(2*m):void 0,f=n.normal?new Float32Array(3*m):void 0,p=n.tangent?new Float32Array(3*m):void 0,y=n.bitangent?new Float32Array(3*m):void 0,l=n.normal||n.tangent||n.bitangent;if(l){var b=n.tangent||n.bitangent,c=0,v=0,A=0,g=Math.atan2(r-a,e),h=Z;h.z=Math.sin(g);for(var x=Math.cos(g),_=W,C=J,F=0;F<o;F++){var w=F/o*B.CesiumMath.TWO_PI,G=x*Math.cos(w),w=x*Math.sin(w);l&&(h.x=G,h.y=w,b&&(_=M.Cartesian3.normalize(M.Cartesian3.cross(M.Cartesian3.UNIT_Z,h,_),_)),n.normal&&(f[c++]=h.x,f[c++]=h.y,f[c++]=h.z,f[c++]=h.x,f[c++]=h.y,f[c++]=h.z),n.tangent&&(p[v++]=_.x,p[v++]=_.y,p[v++]=_.z,p[v++]=_.x,p[v++]=_.y,p[v++]=_.z),n.bitangent&&(C=M.Cartesian3.normalize(M.Cartesian3.cross(h,_,C),C),y[A++]=C.x,y[A++]=C.y,y[A++]=C.z,y[A++]=C.x,y[A++]=C.y,y[A++]=C.z))}for(F=0;F<o;F++)n.normal&&(f[c++]=0,f[c++]=0,f[c++]=-1),n.tangent&&(p[v++]=1,p[v++]=0,p[v++]=0),n.bitangent&&(y[A++]=0,y[A++]=-1,y[A++]=0);for(F=0;F<o;F++)n.normal&&(f[c++]=0,f[c++]=0,f[c++]=1),n.tangent&&(p[v++]=1,p[v++]=0,p[v++]=0),n.bitangent&&(y[A++]=0,y[A++]=1,y[A++]=0)}var g=12*o-12,D=S.IndexDatatype.createTypedArray(m,g),R=0,V=0;for(F=0;F<o-1;F++)D[R++]=V,D[R++]=V+2,D[R++]=V+3,D[R++]=V,D[R++]=V+3,D[R++]=V+1,V+=2;for(D[R++]=i-2,D[R++]=0,D[R++]=1,D[R++]=i-2,D[R++]=1,D[R++]=i-1,F=1;F<o-1;F++)D[R++]=i+F+1,D[R++]=i+F,D[R++]=i;for(F=1;F<o-1;F++)D[R++]=s,D[R++]=s+F,D[R++]=s+F+1;var T=0;if(n.st){var O=Math.max(a,r);for(F=0;F<m;F++){var L=M.Cartesian3.fromArray(u,3*F,j);d[T++]=(L.x+O)/(2*O),d[T++]=(L.y+O)/(2*O)}}g=new U.GeometryAttributes;n.position&&(g.position=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&(g.normal=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:f})),n.tangent&&(g.tangent=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),n.bitangent&&(g.bitangent=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:y})),n.st&&(g.st=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})),Y.x=.5*e,Y.y=Math.max(r,a);r=new k.BoundingSphere(M.Cartesian3.ZERO,M.Cartesian2.magnitude(Y));return N.defined(t._offsetAttribute)&&(e=u.length,a=new Uint8Array(e/3),e=t._offsetAttribute===P.GeometryOffsetAttribute.NONE?0:1,P.arrayFill(a,e),g.applyOffset=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),new I.Geometry({attributes:g,indices:D,primitiveType:I.PrimitiveType.TRIANGLES,boundingSphere:r,offsetAttribute:t._offsetAttribute})}},u.getUnitCylinder=function(){return a=!N.defined(a)?u.createGeometry(new u({topRadius:1,bottomRadius:1,length:1,vertexFormat:m.VertexFormat.POSITION_ONLY})):a},t.CylinderGeometry=u}); diff --git a/public/Cesium/Workers/CylinderGeometry-a5313e27.js b/public/Cesium/Workers/CylinderGeometry-a5313e27.js new file mode 100644 index 0000000..da06234 --- /dev/null +++ b/public/Cesium/Workers/CylinderGeometry-a5313e27.js @@ -0,0 +1 @@ +define(["exports","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Cartesian2-8646c5a1","./ComponentDatatype-1a100acd","./CylinderGeometryLibrary-85e5e690","./when-54335d57","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./VertexFormat-81ec7207"],function(t,P,k,M,z,E,N,e,I,U,S,B,m){"use strict";var Y=new M.Cartesian2,Z=new M.Cartesian3,J=new M.Cartesian3,W=new M.Cartesian3,j=new M.Cartesian3;function u(t){var e=(t=N.defaultValue(t,N.defaultValue.EMPTY_OBJECT)).length,a=t.topRadius,r=t.bottomRadius,n=N.defaultValue(t.vertexFormat,m.VertexFormat.DEFAULT),o=N.defaultValue(t.slices,128);this._length=e,this._topRadius=a,this._bottomRadius=r,this._vertexFormat=m.VertexFormat.clone(n),this._slices=o,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}u.packedLength=m.VertexFormat.packedLength+5,u.pack=function(t,e,a){return a=N.defaultValue(a,0),m.VertexFormat.pack(t._vertexFormat,e,a),a+=m.VertexFormat.packedLength,e[a++]=t._length,e[a++]=t._topRadius,e[a++]=t._bottomRadius,e[a++]=t._slices,e[a]=N.defaultValue(t._offsetAttribute,-1),e};var a,d=new m.VertexFormat,p={vertexFormat:d,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};u.unpack=function(t,e,a){e=N.defaultValue(e,0);var r=m.VertexFormat.unpack(t,e,d);e+=m.VertexFormat.packedLength;var n=t[e++],o=t[e++],i=t[e++],s=t[e++],e=t[e];return N.defined(a)?(a._vertexFormat=m.VertexFormat.clone(r,a._vertexFormat),a._length=n,a._topRadius=o,a._bottomRadius=i,a._slices=s,a._offsetAttribute=-1===e?void 0:e,a):(p.length=n,p.topRadius=o,p.bottomRadius=i,p.slices=s,p.offsetAttribute=-1===e?void 0:e,new u(p))},u.createGeometry=function(t){var e=t._length,a=t._topRadius,r=t._bottomRadius,n=t._vertexFormat,o=t._slices;if(!(e<=0||a<0||r<0||0===a&&0===r)){var i=o+o,s=o+i,m=i+i,u=E.CylinderGeometryLibrary.computePositions(e,a,r,o,!0),d=n.st?new Float32Array(2*m):void 0,p=n.normal?new Float32Array(3*m):void 0,y=n.tangent?new Float32Array(3*m):void 0,l=n.bitangent?new Float32Array(3*m):void 0,f=n.normal||n.tangent||n.bitangent;if(f){var c=n.tangent||n.bitangent,b=0,v=0,A=0,g=Math.atan2(r-a,e),h=Z;h.z=Math.sin(g);for(var x=Math.cos(g),_=W,C=J,F=0;F<o;F++){var w=F/o*B.CesiumMath.TWO_PI,G=x*Math.cos(w),w=x*Math.sin(w);f&&(h.x=G,h.y=w,c&&(_=M.Cartesian3.normalize(M.Cartesian3.cross(M.Cartesian3.UNIT_Z,h,_),_)),n.normal&&(p[b++]=h.x,p[b++]=h.y,p[b++]=h.z,p[b++]=h.x,p[b++]=h.y,p[b++]=h.z),n.tangent&&(y[v++]=_.x,y[v++]=_.y,y[v++]=_.z,y[v++]=_.x,y[v++]=_.y,y[v++]=_.z),n.bitangent&&(C=M.Cartesian3.normalize(M.Cartesian3.cross(h,_,C),C),l[A++]=C.x,l[A++]=C.y,l[A++]=C.z,l[A++]=C.x,l[A++]=C.y,l[A++]=C.z))}for(F=0;F<o;F++)n.normal&&(p[b++]=0,p[b++]=0,p[b++]=-1),n.tangent&&(y[v++]=1,y[v++]=0,y[v++]=0),n.bitangent&&(l[A++]=0,l[A++]=-1,l[A++]=0);for(F=0;F<o;F++)n.normal&&(p[b++]=0,p[b++]=0,p[b++]=1),n.tangent&&(y[v++]=1,y[v++]=0,y[v++]=0),n.bitangent&&(l[A++]=0,l[A++]=1,l[A++]=0)}var D=S.IndexDatatype.createTypedArray(m,12*o-12),R=0,V=0;for(F=0;F<o-1;F++)D[R++]=V,D[R++]=V+2,D[R++]=V+3,D[R++]=V,D[R++]=V+3,D[R++]=V+1,V+=2;for(D[R++]=i-2,D[R++]=0,D[R++]=1,D[R++]=i-2,D[R++]=1,D[R++]=i-1,F=1;F<o-1;F++)D[R++]=i+F+1,D[R++]=i+F,D[R++]=i;for(F=1;F<o-1;F++)D[R++]=s,D[R++]=s+F,D[R++]=s+F+1;var T=0;if(n.st){var O=Math.max(a,r);for(F=0;F<m;F++){var L=M.Cartesian3.fromArray(u,3*F,j);d[T++]=(L.x+O)/(2*O),d[T++]=(L.y+O)/(2*O)}}g=new U.GeometryAttributes;n.position&&(g.position=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&(g.normal=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),n.tangent&&(g.tangent=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:y})),n.bitangent&&(g.bitangent=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:l})),n.st&&(g.st=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})),Y.x=.5*e,Y.y=Math.max(r,a);r=new k.BoundingSphere(M.Cartesian3.ZERO,M.Cartesian2.magnitude(Y));return N.defined(t._offsetAttribute)&&(e=u.length,a=new Uint8Array(e/3),e=t._offsetAttribute===P.GeometryOffsetAttribute.NONE?0:1,P.arrayFill(a,e),g.applyOffset=new I.GeometryAttribute({componentDatatype:z.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),new I.Geometry({attributes:g,indices:D,primitiveType:I.PrimitiveType.TRIANGLES,boundingSphere:r,offsetAttribute:t._offsetAttribute})}},u.getUnitCylinder=function(){return a=!N.defined(a)?u.createGeometry(new u({topRadius:1,bottomRadius:1,length:1,vertexFormat:m.VertexFormat.POSITION_ONLY})):a},t.CylinderGeometry=u}); diff --git a/public/Cesium/Workers/CylinderGeometryLibrary-85e5e690.js b/public/Cesium/Workers/CylinderGeometryLibrary-85e5e690.js new file mode 100644 index 0000000..21eaaed --- /dev/null +++ b/public/Cesium/Workers/CylinderGeometryLibrary-85e5e690.js @@ -0,0 +1 @@ +define(["exports","./Math-d6182036"],function(r,l){"use strict";var t={computePositions:function(r,t,e,a,i){for(var n=.5*r,o=-n,r=a+a,s=new Float64Array(3*(i?2*r:r)),u=0,c=0,f=i?3*r:0,h=i?3*(r+a):3*a,y=0;y<a;y++){var M=y/a*l.CesiumMath.TWO_PI,d=Math.cos(M),m=Math.sin(M),v=d*e,M=m*e,d=d*t,m=m*t;s[c+f]=v,s[c+f+1]=M,s[c+f+2]=o,s[c+h]=d,s[c+h+1]=m,s[c+h+2]=n,c+=3,i&&(s[u++]=v,s[u++]=M,s[u++]=o,s[u++]=d,s[u++]=m,s[u++]=n)}return s}};r.CylinderGeometryLibrary=t}); diff --git a/public/Cesium/Workers/CylinderGeometryLibrary-daf6cec5.js b/public/Cesium/Workers/CylinderGeometryLibrary-daf6cec5.js deleted file mode 100644 index b1fb95e..0000000 --- a/public/Cesium/Workers/CylinderGeometryLibrary-daf6cec5.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Math-4e53b694"],function(r,d){"use strict";var t={computePositions:function(r,t,e,a,i){for(var n=.5*r,o=-n,r=a+a,s=new Float64Array(3*(i?2*r:r)),u=0,c=0,f=i?3*r:0,h=i?3*(r+a):3*a,y=0;y<a;y++){var M=y/a*d.CesiumMath.TWO_PI,m=Math.cos(M),v=Math.sin(M),b=m*e,M=v*e,m=m*t,v=v*t;s[c+f]=b,s[c+f+1]=M,s[c+f+2]=o,s[c+h]=m,s[c+h+1]=v,s[c+h+2]=n,c+=3,i&&(s[u++]=b,s[u++]=M,s[u++]=o,s[u++]=m,s[u++]=v,s[u++]=n)}return s}};r.CylinderGeometryLibrary=t}); diff --git a/public/Cesium/Workers/EllipseGeometry-42ee4ae7.js b/public/Cesium/Workers/EllipseGeometry-8e3bce61.js similarity index 85% rename from public/Cesium/Workers/EllipseGeometry-42ee4ae7.js rename to public/Cesium/Workers/EllipseGeometry-8e3bce61.js index e8cc59a..a30ee08 100644 --- a/public/Cesium/Workers/EllipseGeometry-42ee4ae7.js +++ b/public/Cesium/Workers/EllipseGeometry-8e3bce61.js @@ -1 +1 @@ -define(["exports","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./when-208fe5b0","./EllipseGeometryLibrary-2412418f","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryInstance-d919cab6","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./Math-4e53b694","./VertexFormat-e8cbf5b3"],function(t,L,R,j,e,k,z,B,Y,H,m,p,y,c,d){"use strict";var U=new j.Cartesian3,Q=new j.Cartesian3,W=new j.Cartesian3,S=new j.Cartesian3,J=new j.Cartesian2,q=new R.Matrix3,Z=new R.Matrix3,K=new R.Quaternion,X=new j.Cartesian3,$=new j.Cartesian3,tt=new j.Cartesian3,et=new j.Cartographic,rt=new j.Cartesian3,at=new j.Cartesian2,it=new j.Cartesian2;function f(t,e,r){var a=e.vertexFormat,i=e.center,n=e.semiMajorAxis,o=e.semiMinorAxis,s=e.ellipsoid,u=e.stRotation,l=r?t.length/3*2:t.length/3,m=e.shadowVolume,p=a.st?new Float32Array(2*l):void 0,y=a.normal?new Float32Array(3*l):void 0,c=a.tangent?new Float32Array(3*l):void 0,d=a.bitangent?new Float32Array(3*l):void 0,f=m?new Float32Array(3*l):void 0,A=0,h=X,x=$,g=tt,b=new R.GeographicProjection(s),_=b.project(s.cartesianToCartographic(i,et),rt),i=s.scaleToGeodeticSurface(i,U);s.geodeticSurfaceNormal(i,i);var C=q,v=Z;v=0!==u?(S=R.Quaternion.fromAxisAngle(i,u,K),C=R.Matrix3.fromQuaternion(S,C),S=R.Quaternion.fromAxisAngle(i,-u,K),R.Matrix3.fromQuaternion(S,v)):(C=R.Matrix3.clone(R.Matrix3.IDENTITY,C),R.Matrix3.clone(R.Matrix3.IDENTITY,v));for(var w=j.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,at),M=j.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,it),E=t.length,I=r?E:0,T=I/3*2,G=0;G<E;G+=3){var N,P=G+1,F=G+2,V=j.Cartesian3.fromArray(t,G,U);a.st&&(N=R.Matrix3.multiplyByVector(C,V,Q),N=b.project(s.cartesianToCartographic(N,et),W),j.Cartesian3.subtract(N,_,N),J.x=(N.x+n)/(2*n),J.y=(N.y+o)/(2*o),w.x=Math.min(J.x,w.x),w.y=Math.min(J.y,w.y),M.x=Math.max(J.x,M.x),M.y=Math.max(J.y,M.y),r&&(p[A+T]=J.x,p[A+1+T]=J.y),p[A++]=J.x,p[A++]=J.y),(a.normal||a.tangent||a.bitangent||m)&&(h=s.geodeticSurfaceNormal(V,h),m&&(f[G+I]=-h.x,f[P+I]=-h.y,f[F+I]=-h.z),(a.normal||a.tangent||a.bitangent)&&((a.tangent||a.bitangent)&&(x=j.Cartesian3.normalize(j.Cartesian3.cross(j.Cartesian3.UNIT_Z,h,x),x),R.Matrix3.multiplyByVector(v,x,x)),a.normal&&(y[G]=h.x,y[P]=h.y,y[F]=h.z,r&&(y[G+I]=-h.x,y[P+I]=-h.y,y[F+I]=-h.z)),a.tangent&&(c[G]=x.x,c[P]=x.y,c[F]=x.z,r&&(c[G+I]=-x.x,c[P+I]=-x.y,c[F+I]=-x.z)),a.bitangent&&(g=j.Cartesian3.normalize(j.Cartesian3.cross(h,x,g),g),d[G]=g.x,d[P]=g.y,d[F]=g.z,r&&(d[G+I]=g.x,d[P+I]=g.y,d[F+I]=g.z))))}if(a.st)for(var E=p.length,D=0;D<E;D+=2)p[D]=(p[D]-w.x)/(M.x-w.x),p[D+1]=(p[D+1]-w.y)/(M.y-w.y);var O,S=new H.GeometryAttributes;return a.position&&(O=B.EllipseGeometryLibrary.raisePositionsToHeight(t,e,r),S.position=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:O})),a.st&&(S.st=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:p})),a.normal&&(S.normal=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:y})),a.tangent&&(S.tangent=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),a.bitangent&&(S.bitangent=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),m&&(S.extrudeDirection=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:f})),r&&z.defined(e.offsetAttribute)&&(O=new Uint8Array(l),O=e.offsetAttribute===L.GeometryOffsetAttribute.TOP?L.arrayFill(O,1,0,l/2):(e=e.offsetAttribute===L.GeometryOffsetAttribute.NONE?0:1,L.arrayFill(O,e)),S.applyOffset=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})),S}function A(t){for(var e,r,a=new Array(t*(t+1)*12-6),i=0,n=0,o=1,s=0;s<3;s++)a[i++]=o++,a[i++]=n,a[i++]=o;for(s=2;s<t+1;++s){for(o=s*(s+1)-1,n=(s-1)*s-1,a[i++]=o++,a[i++]=n,a[i++]=o,e=2*s,r=0;r<e-1;++r)a[i++]=o,a[i++]=n++,a[i++]=n,a[i++]=o++,a[i++]=n,a[i++]=o;a[i++]=o++,a[i++]=n,a[i++]=o}for(e=2*t,++o,++n,s=0;s<e-1;++s)a[i++]=o,a[i++]=n++,a[i++]=n,a[i++]=o++,a[i++]=n,a[i++]=o;for(a[i++]=o,a[i++]=n++,a[i++]=n,a[i++]=o++,a[i++]=n++,a[i++]=n,++n,s=t-1;1<s;--s){for(a[i++]=n++,a[i++]=n,a[i++]=o,e=2*s,r=0;r<e-1;++r)a[i++]=o,a[i++]=n++,a[i++]=n,a[i++]=o++,a[i++]=n,a[i++]=o;a[i++]=n++,a[i++]=n++,a[i++]=o++}for(s=0;s<3;s++)a[i++]=n++,a[i++]=n,a[i++]=o;return a}var n=new j.Cartesian3;var h=new R.BoundingSphere,x=new R.BoundingSphere;function o(t){var e=t.center,r=t.ellipsoid,a=t.semiMajorAxis,i=j.Cartesian3.multiplyByScalar(r.geodeticSurfaceNormal(e,U),t.height,U);h.center=j.Cartesian3.add(e,i,h.center),h.radius=a,i=j.Cartesian3.multiplyByScalar(r.geodeticSurfaceNormal(e,i),t.extrudedHeight,i),x.center=j.Cartesian3.add(e,i,x.center),x.radius=a;var n=B.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!0),r=n.positions,e=n.numPts,i=n.outerPositions,a=R.BoundingSphere.union(h,x),n=f(r,t,!0),o=(l=A(e)).length;l.length=2*o;for(var s=r.length/3,u=0;u<o;u+=3)l[u+o]=l[u+2]+s,l[u+1+o]=l[u+1]+s,l[u+2+o]=l[u]+s;var r=y.IndexDatatype.createTypedArray(2*s/3,l),r=new Y.Geometry({attributes:n,indices:r,primitiveType:Y.PrimitiveType.TRIANGLES}),t=function(t,e){var r=e.vertexFormat,a=e.center,i=e.semiMajorAxis,n=e.semiMinorAxis,o=e.ellipsoid,s=e.height,u=e.extrudedHeight,l=e.stRotation,m=t.length/3*2,p=new Float64Array(3*m),y=r.st?new Float32Array(2*m):void 0,c=r.normal?new Float32Array(3*m):void 0,d=r.tangent?new Float32Array(3*m):void 0,f=r.bitangent?new Float32Array(3*m):void 0,A=e.shadowVolume,h=A?new Float32Array(3*m):void 0,x=0,g=X,b=$,_=tt,C=new R.GeographicProjection(o),v=C.project(o.cartesianToCartographic(a,et),rt),a=o.scaleToGeodeticSurface(a,U);o.geodeticSurfaceNormal(a,a);for(var a=R.Quaternion.fromAxisAngle(a,l,K),w=R.Matrix3.fromQuaternion(a,q),M=j.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,at),E=j.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,it),I=(D=t.length)/3*2,T=0;T<D;T+=3){var G=T+1,N=T+2,P=j.Cartesian3.fromArray(t,T,U);r.st&&(V=R.Matrix3.multiplyByVector(w,P,Q),F=C.project(o.cartesianToCartographic(V,et),W),j.Cartesian3.subtract(F,v,F),J.x=(F.x+i)/(2*i),J.y=(F.y+n)/(2*n),M.x=Math.min(J.x,M.x),M.y=Math.min(J.y,M.y),E.x=Math.max(J.x,E.x),E.y=Math.max(J.y,E.y),y[x+I]=J.x,y[x+1+I]=J.y,y[x++]=J.x,y[x++]=J.y),P=o.scaleToGeodeticSurface(P,P),V=j.Cartesian3.clone(P,Q),g=o.geodeticSurfaceNormal(P,g),A&&(h[T+D]=-g.x,h[G+D]=-g.y,h[N+D]=-g.z);var F=j.Cartesian3.multiplyByScalar(g,s,S),P=j.Cartesian3.add(P,F,P),F=j.Cartesian3.multiplyByScalar(g,u,F),V=j.Cartesian3.add(V,F,V);r.position&&(p[T+D]=V.x,p[G+D]=V.y,p[N+D]=V.z,p[T]=P.x,p[G]=P.y,p[N]=P.z),(r.normal||r.tangent||r.bitangent)&&(_=j.Cartesian3.clone(g,_),F=j.Cartesian3.fromArray(t,(T+3)%D,S),j.Cartesian3.subtract(F,P,F),P=j.Cartesian3.subtract(V,P,W),g=j.Cartesian3.normalize(j.Cartesian3.cross(P,F,g),g),r.normal&&(c[T]=g.x,c[G]=g.y,c[N]=g.z,c[T+D]=g.x,c[G+D]=g.y,c[N+D]=g.z),r.tangent&&(b=j.Cartesian3.normalize(j.Cartesian3.cross(_,g,b),b),d[T]=b.x,d[G]=b.y,d[N]=b.z,d[T+D]=b.x,d[T+1+D]=b.y,d[T+2+D]=b.z),r.bitangent&&(f[T]=_.x,f[G]=_.y,f[N]=_.z,f[T+D]=_.x,f[G+D]=_.y,f[N+D]=_.z))}if(r.st)for(var D=y.length,O=0;O<D;O+=2)y[O]=(y[O]-M.x)/(E.x-M.x),y[O+1]=(y[O+1]-M.y)/(E.y-M.y);return l=new H.GeometryAttributes,r.position&&(l.position=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p})),r.st&&(l.st=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:y})),r.normal&&(l.normal=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),r.tangent&&(l.tangent=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),r.bitangent&&(l.bitangent=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:f})),A&&(l.extrudeDirection=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),z.defined(e.offsetAttribute)&&(a=new Uint8Array(m),a=e.offsetAttribute===L.GeometryOffsetAttribute.TOP?L.arrayFill(a,1,0,m/2):(e=e.offsetAttribute===L.GeometryOffsetAttribute.NONE?0:1,L.arrayFill(a,e)),l.applyOffset=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),l}(i,t),l=function(t){for(var e=t.length/3,r=y.IndexDatatype.createTypedArray(e,6*e),a=0,i=0;i<e;i++){var n=i+e,o=(i+1)%e,s=o+e;r[a++]=i,r[a++]=n,r[a++]=o,r[a++]=o,r[a++]=n,r[a++]=s}return r}(i),i=y.IndexDatatype.createTypedArray(2*i.length/3,l),i=new Y.Geometry({attributes:t,indices:i,primitiveType:Y.PrimitiveType.TRIANGLES}),i=p.GeometryPipeline.combineInstances([new m.GeometryInstance({geometry:r}),new m.GeometryInstance({geometry:i})]);return{boundingSphere:a,attributes:i[0].attributes,indices:i[0].indices}}function s(t,e,r,a,i,n,o){for(var s=B.EllipseGeometryLibrary.computeEllipsePositions({center:t,semiMajorAxis:e,semiMinorAxis:r,rotation:a,granularity:i},!1,!0).outerPositions,u=s.length/3,l=new Array(u),m=0;m<u;++m)l[m]=j.Cartesian3.fromArray(s,3*m);o=j.Rectangle.fromCartesianArray(l,n,o);return o.width>c.CesiumMath.PI&&(o.north=0<o.north?c.CesiumMath.PI_OVER_TWO-c.CesiumMath.EPSILON7:o.north,o.south=o.south<0?c.CesiumMath.EPSILON7-c.CesiumMath.PI_OVER_TWO:o.south,o.east=c.CesiumMath.PI,o.west=-c.CesiumMath.PI),o}function g(t){var e=(t=z.defaultValue(t,z.defaultValue.EMPTY_OBJECT)).center,r=z.defaultValue(t.ellipsoid,j.Ellipsoid.WGS84),a=t.semiMajorAxis,i=t.semiMinorAxis,n=z.defaultValue(t.granularity,c.CesiumMath.RADIANS_PER_DEGREE),o=z.defaultValue(t.vertexFormat,d.VertexFormat.DEFAULT),s=z.defaultValue(t.height,0),u=z.defaultValue(t.extrudedHeight,s);this._center=j.Cartesian3.clone(e),this._semiMajorAxis=a,this._semiMinorAxis=i,this._ellipsoid=j.Ellipsoid.clone(r),this._rotation=z.defaultValue(t.rotation,0),this._stRotation=z.defaultValue(t.stRotation,0),this._height=Math.max(u,s),this._granularity=n,this._vertexFormat=d.VertexFormat.clone(o),this._extrudedHeight=Math.min(u,s),this._shadowVolume=z.defaultValue(t.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}g.packedLength=j.Cartesian3.packedLength+j.Ellipsoid.packedLength+d.VertexFormat.packedLength+9,g.pack=function(t,e,r){return r=z.defaultValue(r,0),j.Cartesian3.pack(t._center,e,r),r+=j.Cartesian3.packedLength,j.Ellipsoid.pack(t._ellipsoid,e,r),r+=j.Ellipsoid.packedLength,d.VertexFormat.pack(t._vertexFormat,e,r),r+=d.VertexFormat.packedLength,e[r++]=t._semiMajorAxis,e[r++]=t._semiMinorAxis,e[r++]=t._rotation,e[r++]=t._stRotation,e[r++]=t._height,e[r++]=t._granularity,e[r++]=t._extrudedHeight,e[r++]=t._shadowVolume?1:0,e[r]=z.defaultValue(t._offsetAttribute,-1),e};var b=new j.Cartesian3,_=new j.Ellipsoid,C=new d.VertexFormat,v={center:b,ellipsoid:_,vertexFormat:C,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};g.unpack=function(t,e,r){e=z.defaultValue(e,0);var a=j.Cartesian3.unpack(t,e,b);e+=j.Cartesian3.packedLength;var i=j.Ellipsoid.unpack(t,e,_);e+=j.Ellipsoid.packedLength;var n=d.VertexFormat.unpack(t,e,C);e+=d.VertexFormat.packedLength;var o=t[e++],s=t[e++],u=t[e++],l=t[e++],m=t[e++],p=t[e++],y=t[e++],c=1===t[e++],e=t[e];return z.defined(r)?(r._center=j.Cartesian3.clone(a,r._center),r._ellipsoid=j.Ellipsoid.clone(i,r._ellipsoid),r._vertexFormat=d.VertexFormat.clone(n,r._vertexFormat),r._semiMajorAxis=o,r._semiMinorAxis=s,r._rotation=u,r._stRotation=l,r._height=m,r._granularity=p,r._extrudedHeight=y,r._shadowVolume=c,r._offsetAttribute=-1===e?void 0:e,r):(v.height=m,v.extrudedHeight=y,v.granularity=p,v.stRotation=l,v.rotation=u,v.semiMajorAxis=o,v.semiMinorAxis=s,v.shadowVolume=c,v.offsetAttribute=-1===e?void 0:e,new g(v))},g.computeRectangle=function(t,e){var r=(t=z.defaultValue(t,z.defaultValue.EMPTY_OBJECT)).center,a=z.defaultValue(t.ellipsoid,j.Ellipsoid.WGS84),i=t.semiMajorAxis,n=t.semiMinorAxis,o=z.defaultValue(t.granularity,c.CesiumMath.RADIANS_PER_DEGREE);return s(r,i,n,z.defaultValue(t.rotation,0),o,a,e)},g.createGeometry=function(t){if(!(t._semiMajorAxis<=0||t._semiMinorAxis<=0)){var e=t._height,r=t._extrudedHeight,a=!c.CesiumMath.equalsEpsilon(e,r,0,c.CesiumMath.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);var i,e={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:e,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};return a?(e.extrudedHeight=r,e.shadowVolume=t._shadowVolume,e.offsetAttribute=t._offsetAttribute,i=o(e)):(i=function(t){var e=t.center;n=j.Cartesian3.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(e,n),t.height,n),n=j.Cartesian3.add(e,n,n);var r=new R.BoundingSphere(n,t.semiMajorAxis),e=(a=B.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!1)).positions,a=a.numPts,t=f(e,t,!1),a=A(a);return{boundingSphere:r,attributes:t,indices:a=y.IndexDatatype.createTypedArray(e.length/3,a)}}(e),z.defined(t._offsetAttribute)&&(r=i.attributes.position.values.length,e=new Uint8Array(r/3),r=t._offsetAttribute===L.GeometryOffsetAttribute.NONE?0:1,L.arrayFill(e,r),i.attributes.applyOffset=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e}))),new Y.Geometry({attributes:i.attributes,indices:i.indices,primitiveType:Y.PrimitiveType.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:t._offsetAttribute})}},g.createShadowVolume=function(t,e,r){var a=t._granularity,i=t._ellipsoid,e=e(a,i),r=r(a,i);return new g({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:i,rotation:t._rotation,stRotation:t._stRotation,granularity:a,extrudedHeight:e,height:r,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(g.prototype,{rectangle:{get:function(){return z.defined(this._rectangle)||(this._rectangle=s(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return z.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){var e=-t._stRotation;if(0==e)return[0,0,0,1,1,0];for(var r=B.EllipseGeometryLibrary.computeEllipsePositions({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,rotation:t._rotation,granularity:t._granularity},!1,!0).outerPositions,a=r.length/3,i=new Array(a),n=0;n<a;++n)i[n]=j.Cartesian3.fromArray(r,3*n);var o=t._ellipsoid,t=t.rectangle;return Y.Geometry._textureCoordinateRotationPoints(i,e,o,t)}(this)),this._textureCoordinateRotationPoints}}}),t.EllipseGeometry=g}); +define(["exports","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./when-54335d57","./EllipseGeometryLibrary-e452d6b7","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryInstance-6aa9010a","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./Math-d6182036","./VertexFormat-81ec7207"],function(t,L,R,j,e,k,z,B,Y,H,m,p,y,c,d){"use strict";var U=new j.Cartesian3,Q=new j.Cartesian3,W=new j.Cartesian3,S=new j.Cartesian3,J=new j.Cartesian2,q=new R.Matrix3,Z=new R.Matrix3,K=new R.Quaternion,X=new j.Cartesian3,$=new j.Cartesian3,tt=new j.Cartesian3,et=new j.Cartographic,rt=new j.Cartesian3,at=new j.Cartesian2,it=new j.Cartesian2;function A(t,e,r){var a=e.vertexFormat,i=e.center,n=e.semiMajorAxis,o=e.semiMinorAxis,s=e.ellipsoid,u=e.stRotation,l=r?t.length/3*2:t.length/3,m=e.shadowVolume,p=a.st?new Float32Array(2*l):void 0,y=a.normal?new Float32Array(3*l):void 0,c=a.tangent?new Float32Array(3*l):void 0,d=a.bitangent?new Float32Array(3*l):void 0,A=m?new Float32Array(3*l):void 0,f=0,h=X,x=$,g=tt,_=new R.GeographicProjection(s),b=_.project(s.cartesianToCartographic(i,et),rt),i=s.scaleToGeodeticSurface(i,U);s.geodeticSurfaceNormal(i,i);var C=q,v=Z;v=0!==u?(S=R.Quaternion.fromAxisAngle(i,u,K),C=R.Matrix3.fromQuaternion(S,C),S=R.Quaternion.fromAxisAngle(i,-u,K),R.Matrix3.fromQuaternion(S,v)):(C=R.Matrix3.clone(R.Matrix3.IDENTITY,C),R.Matrix3.clone(R.Matrix3.IDENTITY,v));for(var w=j.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,at),M=j.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,it),E=t.length,I=r?E:0,T=I/3*2,G=0;G<E;G+=3){var N,P=G+1,F=G+2,V=j.Cartesian3.fromArray(t,G,U);a.st&&(N=R.Matrix3.multiplyByVector(C,V,Q),N=_.project(s.cartesianToCartographic(N,et),W),j.Cartesian3.subtract(N,b,N),J.x=(N.x+n)/(2*n),J.y=(N.y+o)/(2*o),w.x=Math.min(J.x,w.x),w.y=Math.min(J.y,w.y),M.x=Math.max(J.x,M.x),M.y=Math.max(J.y,M.y),r&&(p[f+T]=J.x,p[f+1+T]=J.y),p[f++]=J.x,p[f++]=J.y),(a.normal||a.tangent||a.bitangent||m)&&(h=s.geodeticSurfaceNormal(V,h),m&&(A[G+I]=-h.x,A[P+I]=-h.y,A[F+I]=-h.z),(a.normal||a.tangent||a.bitangent)&&((a.tangent||a.bitangent)&&(x=j.Cartesian3.normalize(j.Cartesian3.cross(j.Cartesian3.UNIT_Z,h,x),x),R.Matrix3.multiplyByVector(v,x,x)),a.normal&&(y[G]=h.x,y[P]=h.y,y[F]=h.z,r&&(y[G+I]=-h.x,y[P+I]=-h.y,y[F+I]=-h.z)),a.tangent&&(c[G]=x.x,c[P]=x.y,c[F]=x.z,r&&(c[G+I]=-x.x,c[P+I]=-x.y,c[F+I]=-x.z)),a.bitangent&&(g=j.Cartesian3.normalize(j.Cartesian3.cross(h,x,g),g),d[G]=g.x,d[P]=g.y,d[F]=g.z,r&&(d[G+I]=g.x,d[P+I]=g.y,d[F+I]=g.z))))}if(a.st)for(var E=p.length,D=0;D<E;D+=2)p[D]=(p[D]-w.x)/(M.x-w.x),p[D+1]=(p[D+1]-w.y)/(M.y-w.y);var O,S=new H.GeometryAttributes;return a.position&&(O=B.EllipseGeometryLibrary.raisePositionsToHeight(t,e,r),S.position=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:O})),a.st&&(S.st=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:p})),a.normal&&(S.normal=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:y})),a.tangent&&(S.tangent=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),a.bitangent&&(S.bitangent=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),m&&(S.extrudeDirection=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A})),r&&z.defined(e.offsetAttribute)&&(O=new Uint8Array(l),O=e.offsetAttribute===L.GeometryOffsetAttribute.TOP?L.arrayFill(O,1,0,l/2):(e=e.offsetAttribute===L.GeometryOffsetAttribute.NONE?0:1,L.arrayFill(O,e)),S.applyOffset=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})),S}function f(t){for(var e,r,a=new Array(t*(t+1)*12-6),i=0,n=0,o=1,s=0;s<3;s++)a[i++]=o++,a[i++]=n,a[i++]=o;for(s=2;s<t+1;++s){for(o=s*(s+1)-1,n=(s-1)*s-1,a[i++]=o++,a[i++]=n,a[i++]=o,e=2*s,r=0;r<e-1;++r)a[i++]=o,a[i++]=n++,a[i++]=n,a[i++]=o++,a[i++]=n,a[i++]=o;a[i++]=o++,a[i++]=n,a[i++]=o}for(e=2*t,++o,++n,s=0;s<e-1;++s)a[i++]=o,a[i++]=n++,a[i++]=n,a[i++]=o++,a[i++]=n,a[i++]=o;for(a[i++]=o,a[i++]=n++,a[i++]=n,a[i++]=o++,a[i++]=n++,a[i++]=n,++n,s=t-1;1<s;--s){for(a[i++]=n++,a[i++]=n,a[i++]=o,e=2*s,r=0;r<e-1;++r)a[i++]=o,a[i++]=n++,a[i++]=n,a[i++]=o++,a[i++]=n,a[i++]=o;a[i++]=n++,a[i++]=n++,a[i++]=o++}for(s=0;s<3;s++)a[i++]=n++,a[i++]=n,a[i++]=o;return a}var n=new j.Cartesian3;var h=new R.BoundingSphere,x=new R.BoundingSphere;function o(t){var e=t.center,r=t.ellipsoid,a=t.semiMajorAxis,i=j.Cartesian3.multiplyByScalar(r.geodeticSurfaceNormal(e,U),t.height,U);h.center=j.Cartesian3.add(e,i,h.center),h.radius=a,i=j.Cartesian3.multiplyByScalar(r.geodeticSurfaceNormal(e,i),t.extrudedHeight,i),x.center=j.Cartesian3.add(e,i,x.center),x.radius=a;var n=B.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!0),r=n.positions,e=n.numPts,i=n.outerPositions,a=R.BoundingSphere.union(h,x),n=A(r,t,!0),o=(l=f(e)).length;l.length=2*o;for(var s=r.length/3,u=0;u<o;u+=3)l[u+o]=l[u+2]+s,l[u+1+o]=l[u+1]+s,l[u+2+o]=l[u]+s;var r=y.IndexDatatype.createTypedArray(2*s/3,l),r=new Y.Geometry({attributes:n,indices:r,primitiveType:Y.PrimitiveType.TRIANGLES}),t=function(t,e){var r=e.vertexFormat,a=e.center,i=e.semiMajorAxis,n=e.semiMinorAxis,o=e.ellipsoid,s=e.height,u=e.extrudedHeight,l=e.stRotation,m=t.length/3*2,p=new Float64Array(3*m),y=r.st?new Float32Array(2*m):void 0,c=r.normal?new Float32Array(3*m):void 0,d=r.tangent?new Float32Array(3*m):void 0,A=r.bitangent?new Float32Array(3*m):void 0,f=e.shadowVolume,h=f?new Float32Array(3*m):void 0,x=0,g=X,_=$,b=tt,C=new R.GeographicProjection(o),v=C.project(o.cartesianToCartographic(a,et),rt),a=o.scaleToGeodeticSurface(a,U);o.geodeticSurfaceNormal(a,a);for(var a=R.Quaternion.fromAxisAngle(a,l,K),w=R.Matrix3.fromQuaternion(a,q),M=j.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,at),E=j.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,it),I=(D=t.length)/3*2,T=0;T<D;T+=3){var G=T+1,N=T+2,P=j.Cartesian3.fromArray(t,T,U);r.st&&(V=R.Matrix3.multiplyByVector(w,P,Q),F=C.project(o.cartesianToCartographic(V,et),W),j.Cartesian3.subtract(F,v,F),J.x=(F.x+i)/(2*i),J.y=(F.y+n)/(2*n),M.x=Math.min(J.x,M.x),M.y=Math.min(J.y,M.y),E.x=Math.max(J.x,E.x),E.y=Math.max(J.y,E.y),y[x+I]=J.x,y[x+1+I]=J.y,y[x++]=J.x,y[x++]=J.y),P=o.scaleToGeodeticSurface(P,P),V=j.Cartesian3.clone(P,Q),g=o.geodeticSurfaceNormal(P,g),f&&(h[T+D]=-g.x,h[G+D]=-g.y,h[N+D]=-g.z);var F=j.Cartesian3.multiplyByScalar(g,s,S),P=j.Cartesian3.add(P,F,P),F=j.Cartesian3.multiplyByScalar(g,u,F),V=j.Cartesian3.add(V,F,V);r.position&&(p[T+D]=V.x,p[G+D]=V.y,p[N+D]=V.z,p[T]=P.x,p[G]=P.y,p[N]=P.z),(r.normal||r.tangent||r.bitangent)&&(b=j.Cartesian3.clone(g,b),F=j.Cartesian3.fromArray(t,(T+3)%D,S),j.Cartesian3.subtract(F,P,F),P=j.Cartesian3.subtract(V,P,W),g=j.Cartesian3.normalize(j.Cartesian3.cross(P,F,g),g),r.normal&&(c[T]=g.x,c[G]=g.y,c[N]=g.z,c[T+D]=g.x,c[G+D]=g.y,c[N+D]=g.z),r.tangent&&(_=j.Cartesian3.normalize(j.Cartesian3.cross(b,g,_),_),d[T]=_.x,d[G]=_.y,d[N]=_.z,d[T+D]=_.x,d[T+1+D]=_.y,d[T+2+D]=_.z),r.bitangent&&(A[T]=b.x,A[G]=b.y,A[N]=b.z,A[T+D]=b.x,A[G+D]=b.y,A[N+D]=b.z))}if(r.st)for(var D=y.length,O=0;O<D;O+=2)y[O]=(y[O]-M.x)/(E.x-M.x),y[O+1]=(y[O+1]-M.y)/(E.y-M.y);return l=new H.GeometryAttributes,r.position&&(l.position=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p})),r.st&&(l.st=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:y})),r.normal&&(l.normal=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),r.tangent&&(l.tangent=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),r.bitangent&&(l.bitangent=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A})),f&&(l.extrudeDirection=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),z.defined(e.offsetAttribute)&&(a=new Uint8Array(m),a=e.offsetAttribute===L.GeometryOffsetAttribute.TOP?L.arrayFill(a,1,0,m/2):(e=e.offsetAttribute===L.GeometryOffsetAttribute.NONE?0:1,L.arrayFill(a,e)),l.applyOffset=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),l}(i,t),l=function(t){for(var e=t.length/3,r=y.IndexDatatype.createTypedArray(e,6*e),a=0,i=0;i<e;i++){var n=i+e,o=(i+1)%e,s=o+e;r[a++]=i,r[a++]=n,r[a++]=o,r[a++]=o,r[a++]=n,r[a++]=s}return r}(i),i=y.IndexDatatype.createTypedArray(2*i.length/3,l),i=new Y.Geometry({attributes:t,indices:i,primitiveType:Y.PrimitiveType.TRIANGLES}),i=p.GeometryPipeline.combineInstances([new m.GeometryInstance({geometry:r}),new m.GeometryInstance({geometry:i})]);return{boundingSphere:a,attributes:i[0].attributes,indices:i[0].indices}}function s(t,e,r,a,i,n,o){for(var s=B.EllipseGeometryLibrary.computeEllipsePositions({center:t,semiMajorAxis:e,semiMinorAxis:r,rotation:a,granularity:i},!1,!0).outerPositions,u=s.length/3,l=new Array(u),m=0;m<u;++m)l[m]=j.Cartesian3.fromArray(s,3*m);o=j.Rectangle.fromCartesianArray(l,n,o);return o.width>c.CesiumMath.PI&&(o.north=0<o.north?c.CesiumMath.PI_OVER_TWO-c.CesiumMath.EPSILON7:o.north,o.south=o.south<0?c.CesiumMath.EPSILON7-c.CesiumMath.PI_OVER_TWO:o.south,o.east=c.CesiumMath.PI,o.west=-c.CesiumMath.PI),o}function g(t){var e=(t=z.defaultValue(t,z.defaultValue.EMPTY_OBJECT)).center,r=z.defaultValue(t.ellipsoid,j.Ellipsoid.WGS84),a=t.semiMajorAxis,i=t.semiMinorAxis,n=z.defaultValue(t.granularity,c.CesiumMath.RADIANS_PER_DEGREE),o=z.defaultValue(t.vertexFormat,d.VertexFormat.DEFAULT),s=z.defaultValue(t.height,0),u=z.defaultValue(t.extrudedHeight,s);this._center=j.Cartesian3.clone(e),this._semiMajorAxis=a,this._semiMinorAxis=i,this._ellipsoid=j.Ellipsoid.clone(r),this._rotation=z.defaultValue(t.rotation,0),this._stRotation=z.defaultValue(t.stRotation,0),this._height=Math.max(u,s),this._granularity=n,this._vertexFormat=d.VertexFormat.clone(o),this._extrudedHeight=Math.min(u,s),this._shadowVolume=z.defaultValue(t.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}g.packedLength=j.Cartesian3.packedLength+j.Ellipsoid.packedLength+d.VertexFormat.packedLength+9,g.pack=function(t,e,r){return r=z.defaultValue(r,0),j.Cartesian3.pack(t._center,e,r),r+=j.Cartesian3.packedLength,j.Ellipsoid.pack(t._ellipsoid,e,r),r+=j.Ellipsoid.packedLength,d.VertexFormat.pack(t._vertexFormat,e,r),r+=d.VertexFormat.packedLength,e[r++]=t._semiMajorAxis,e[r++]=t._semiMinorAxis,e[r++]=t._rotation,e[r++]=t._stRotation,e[r++]=t._height,e[r++]=t._granularity,e[r++]=t._extrudedHeight,e[r++]=t._shadowVolume?1:0,e[r]=z.defaultValue(t._offsetAttribute,-1),e};var _=new j.Cartesian3,b=new j.Ellipsoid,C=new d.VertexFormat,v={center:_,ellipsoid:b,vertexFormat:C,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};g.unpack=function(t,e,r){e=z.defaultValue(e,0);var a=j.Cartesian3.unpack(t,e,_);e+=j.Cartesian3.packedLength;var i=j.Ellipsoid.unpack(t,e,b);e+=j.Ellipsoid.packedLength;var n=d.VertexFormat.unpack(t,e,C);e+=d.VertexFormat.packedLength;var o=t[e++],s=t[e++],u=t[e++],l=t[e++],m=t[e++],p=t[e++],y=t[e++],c=1===t[e++],e=t[e];return z.defined(r)?(r._center=j.Cartesian3.clone(a,r._center),r._ellipsoid=j.Ellipsoid.clone(i,r._ellipsoid),r._vertexFormat=d.VertexFormat.clone(n,r._vertexFormat),r._semiMajorAxis=o,r._semiMinorAxis=s,r._rotation=u,r._stRotation=l,r._height=m,r._granularity=p,r._extrudedHeight=y,r._shadowVolume=c,r._offsetAttribute=-1===e?void 0:e,r):(v.height=m,v.extrudedHeight=y,v.granularity=p,v.stRotation=l,v.rotation=u,v.semiMajorAxis=o,v.semiMinorAxis=s,v.shadowVolume=c,v.offsetAttribute=-1===e?void 0:e,new g(v))},g.computeRectangle=function(t,e){var r=(t=z.defaultValue(t,z.defaultValue.EMPTY_OBJECT)).center,a=z.defaultValue(t.ellipsoid,j.Ellipsoid.WGS84),i=t.semiMajorAxis,n=t.semiMinorAxis,o=z.defaultValue(t.granularity,c.CesiumMath.RADIANS_PER_DEGREE);return s(r,i,n,z.defaultValue(t.rotation,0),o,a,e)},g.createGeometry=function(t){if(!(t._semiMajorAxis<=0||t._semiMinorAxis<=0)){var e=t._height,r=t._extrudedHeight,a=!c.CesiumMath.equalsEpsilon(e,r,0,c.CesiumMath.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);var i,e={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:e,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};return a?(e.extrudedHeight=r,e.shadowVolume=t._shadowVolume,e.offsetAttribute=t._offsetAttribute,i=o(e)):(i=function(t){var e=t.center;n=j.Cartesian3.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(e,n),t.height,n),n=j.Cartesian3.add(e,n,n);var r=new R.BoundingSphere(n,t.semiMajorAxis),e=(a=B.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!1)).positions,a=a.numPts,t=A(e,t,!1),a=f(a);return{boundingSphere:r,attributes:t,indices:a=y.IndexDatatype.createTypedArray(e.length/3,a)}}(e),z.defined(t._offsetAttribute)&&(r=i.attributes.position.values.length,e=new Uint8Array(r/3),r=t._offsetAttribute===L.GeometryOffsetAttribute.NONE?0:1,L.arrayFill(e,r),i.attributes.applyOffset=new Y.GeometryAttribute({componentDatatype:k.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e}))),new Y.Geometry({attributes:i.attributes,indices:i.indices,primitiveType:Y.PrimitiveType.TRIANGLES,boundingSphere:i.boundingSphere,offsetAttribute:t._offsetAttribute})}},g.createShadowVolume=function(t,e,r){var a=t._granularity,i=t._ellipsoid,e=e(a,i),r=r(a,i);return new g({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:i,rotation:t._rotation,stRotation:t._stRotation,granularity:a,extrudedHeight:e,height:r,vertexFormat:d.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(g.prototype,{rectangle:{get:function(){return z.defined(this._rectangle)||(this._rectangle=s(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return z.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){var e=-t._stRotation;if(0==e)return[0,0,0,1,1,0];for(var r=B.EllipseGeometryLibrary.computeEllipsePositions({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,rotation:t._rotation,granularity:t._granularity},!1,!0).outerPositions,a=r.length/3,i=new Array(a),n=0;n<a;++n)i[n]=j.Cartesian3.fromArray(r,3*n);var o=t._ellipsoid,t=t.rectangle;return Y.Geometry._textureCoordinateRotationPoints(i,e,o,t)}(this)),this._textureCoordinateRotationPoints}}}),t.EllipseGeometry=g}); diff --git a/public/Cesium/Workers/EllipseGeometryLibrary-2412418f.js b/public/Cesium/Workers/EllipseGeometryLibrary-2412418f.js deleted file mode 100644 index e58fb96..0000000 --- a/public/Cesium/Workers/EllipseGeometryLibrary-2412418f.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./Math-4e53b694","./Transforms-a73b3b3b"],function(a,E,V,y){"use strict";var e={},u=new E.Cartesian3,m=new E.Cartesian3,c=new y.Quaternion,h=new y.Matrix3;function A(a,e,r,t,i,n,s,o,l,C){e=a+e;E.Cartesian3.multiplyByScalar(t,Math.cos(e),u),E.Cartesian3.multiplyByScalar(r,Math.sin(e),m),E.Cartesian3.add(u,m,u);e=Math.cos(a);e*=e;a=Math.sin(a);a*=a;a=n/Math.sqrt(s*e+i*a)/o;return y.Quaternion.fromAxisAngle(u,a,c),y.Matrix3.fromQuaternion(c,h),y.Matrix3.multiplyByVector(h,l,C),E.Cartesian3.normalize(C,C),E.Cartesian3.multiplyByScalar(C,o,C),C}var R=new E.Cartesian3,W=new E.Cartesian3,S=new E.Cartesian3,M=new E.Cartesian3;e.raisePositionsToHeight=function(a,e,r){for(var t=e.ellipsoid,i=e.height,n=e.extrudedHeight,e=r?a.length/3*2:a.length/3,s=new Float64Array(3*e),o=a.length,l=r?o:0,C=0;C<o;C+=3){var y=C+1,u=C+2,m=E.Cartesian3.fromArray(a,C,R);t.scaleToGeodeticSurface(m,m);var c=E.Cartesian3.clone(m,W),h=t.geodeticSurfaceNormal(m,M),x=E.Cartesian3.multiplyByScalar(h,i,S);E.Cartesian3.add(m,x,m),r&&(E.Cartesian3.multiplyByScalar(h,n,x),E.Cartesian3.add(c,x,c),s[C+l]=c.x,s[y+l]=c.y,s[u+l]=c.z),s[C]=m.x,s[y]=m.y,s[u]=m.z}return s};var b=new E.Cartesian3,B=new E.Cartesian3,Q=new E.Cartesian3;e.computeEllipsePositions=function(a,e,r){var t=a.semiMinorAxis,i=a.semiMajorAxis,n=a.rotation,s=a.center,a=8*a.granularity,o=t*t,l=i*i,C=i*t,y=E.Cartesian3.magnitude(s),u=E.Cartesian3.normalize(s,b),m=E.Cartesian3.cross(E.Cartesian3.UNIT_Z,s,B),m=E.Cartesian3.normalize(m,m),c=E.Cartesian3.cross(u,m,Q),h=1+Math.ceil(V.CesiumMath.PI_OVER_TWO/a),x=V.CesiumMath.PI_OVER_TWO/(h-1),M=V.CesiumMath.PI_OVER_TWO-h*x;M<0&&(h-=Math.ceil(Math.abs(M)/x));var z,f,_,d,O,p=e?new Array(3*(h*(h+2)*2)):void 0,w=0,P=R,T=W,a=4*h*3,I=a-1,g=0,v=r?new Array(a):void 0,P=A(M=V.CesiumMath.PI_OVER_TWO,n,c,m,o,C,l,y,u,P);for(e&&(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z),r&&(v[I--]=P.z,v[I--]=P.y,v[I--]=P.x),M=V.CesiumMath.PI_OVER_TWO-x,z=1;z<h+1;++z){if(P=A(M,n,c,m,o,C,l,y,u,P),T=A(Math.PI-M,n,c,m,o,C,l,y,u,T),e){for(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,_=2*z+2,f=1;f<_-1;++f)d=f/(_-1),O=E.Cartesian3.lerp(P,T,d,S),p[w++]=O.x,p[w++]=O.y,p[w++]=O.z;p[w++]=T.x,p[w++]=T.y,p[w++]=T.z}r&&(v[I--]=P.z,v[I--]=P.y,v[I--]=P.x,v[g++]=T.x,v[g++]=T.y,v[g++]=T.z),M=V.CesiumMath.PI_OVER_TWO-(z+1)*x}for(z=h;1<z;--z){if(P=A(-(M=V.CesiumMath.PI_OVER_TWO-(z-1)*x),n,c,m,o,C,l,y,u,P),T=A(M+Math.PI,n,c,m,o,C,l,y,u,T),e){for(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,_=2*(z-1)+2,f=1;f<_-1;++f)d=f/(_-1),O=E.Cartesian3.lerp(P,T,d,S),p[w++]=O.x,p[w++]=O.y,p[w++]=O.z;p[w++]=T.x,p[w++]=T.y,p[w++]=T.z}r&&(v[I--]=P.z,v[I--]=P.y,v[I--]=P.x,v[g++]=T.x,v[g++]=T.y,v[g++]=T.z)}P=A(-(M=V.CesiumMath.PI_OVER_TWO),n,c,m,o,C,l,y,u,P);a={};return e&&(p[w++]=P.x,p[w++]=P.y,p[w++]=P.z,a.positions=p,a.numPts=h),r&&(v[I--]=P.z,v[I--]=P.y,v[I--]=P.x,a.outerPositions=v),a},a.EllipseGeometryLibrary=e}); diff --git a/public/Cesium/Workers/EllipseGeometryLibrary-e452d6b7.js b/public/Cesium/Workers/EllipseGeometryLibrary-e452d6b7.js new file mode 100644 index 0000000..2c22b31 --- /dev/null +++ b/public/Cesium/Workers/EllipseGeometryLibrary-e452d6b7.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./Math-d6182036","./Transforms-79117a7b"],function(a,v,E,y){"use strict";var e={},u=new v.Cartesian3,m=new v.Cartesian3,c=new y.Quaternion,h=new y.Matrix3;function V(a,e,r,t,i,n,s,o,l,C){e=a+e;v.Cartesian3.multiplyByScalar(t,Math.cos(e),u),v.Cartesian3.multiplyByScalar(r,Math.sin(e),m),v.Cartesian3.add(u,m,u);e=Math.cos(a);e*=e;a=Math.sin(a);a*=a;a=n/Math.sqrt(s*e+i*a);return y.Quaternion.fromAxisAngle(u,a/o,c),y.Matrix3.fromQuaternion(c,h),y.Matrix3.multiplyByVector(h,l,C),v.Cartesian3.normalize(C,C),v.Cartesian3.multiplyByScalar(C,o,C),C}var A=new v.Cartesian3,R=new v.Cartesian3,W=new v.Cartesian3,M=new v.Cartesian3;e.raisePositionsToHeight=function(a,e,r){for(var t=e.ellipsoid,i=e.height,n=e.extrudedHeight,e=r?a.length/3*2:a.length/3,s=new Float64Array(3*e),o=a.length,l=r?o:0,C=0;C<o;C+=3){var y=C+1,u=C+2,m=v.Cartesian3.fromArray(a,C,A);t.scaleToGeodeticSurface(m,m);var c=v.Cartesian3.clone(m,R),h=t.geodeticSurfaceNormal(m,M),x=v.Cartesian3.multiplyByScalar(h,i,W);v.Cartesian3.add(m,x,m),r&&(v.Cartesian3.multiplyByScalar(h,n,x),v.Cartesian3.add(c,x,c),s[C+l]=c.x,s[y+l]=c.y,s[u+l]=c.z),s[C]=m.x,s[y]=m.y,s[u]=m.z}return s};var S=new v.Cartesian3,B=new v.Cartesian3,b=new v.Cartesian3;e.computeEllipsePositions=function(a,e,r){var t=a.semiMinorAxis,i=a.semiMajorAxis,n=a.rotation,s=a.center,a=8*a.granularity,o=t*t,l=i*i,C=i*t,y=v.Cartesian3.magnitude(s),u=v.Cartesian3.normalize(s,S),m=v.Cartesian3.cross(v.Cartesian3.UNIT_Z,s,B),m=v.Cartesian3.normalize(m,m),c=v.Cartesian3.cross(u,m,b),h=1+Math.ceil(E.CesiumMath.PI_OVER_TWO/a),x=E.CesiumMath.PI_OVER_TWO/(h-1),M=E.CesiumMath.PI_OVER_TWO-h*x;M<0&&(h-=Math.ceil(Math.abs(M)/x));var z,f,_,d,O=e?new Array(3*(h*(h+2)*2)):void 0,p=0,w=A,P=R,a=4*h*3,T=a-1,I=0,g=r?new Array(a):void 0,w=V(M=E.CesiumMath.PI_OVER_TWO,n,c,m,o,C,l,y,u,w);for(e&&(O[p++]=w.x,O[p++]=w.y,O[p++]=w.z),r&&(g[T--]=w.z,g[T--]=w.y,g[T--]=w.x),M=E.CesiumMath.PI_OVER_TWO-x,z=1;z<h+1;++z){if(w=V(M,n,c,m,o,C,l,y,u,w),P=V(Math.PI-M,n,c,m,o,C,l,y,u,P),e){for(O[p++]=w.x,O[p++]=w.y,O[p++]=w.z,_=2*z+2,f=1;f<_-1;++f)d=v.Cartesian3.lerp(w,P,f/(_-1),W),O[p++]=d.x,O[p++]=d.y,O[p++]=d.z;O[p++]=P.x,O[p++]=P.y,O[p++]=P.z}r&&(g[T--]=w.z,g[T--]=w.y,g[T--]=w.x,g[I++]=P.x,g[I++]=P.y,g[I++]=P.z),M=E.CesiumMath.PI_OVER_TWO-(z+1)*x}for(z=h;1<z;--z){if(w=V(-(M=E.CesiumMath.PI_OVER_TWO-(z-1)*x),n,c,m,o,C,l,y,u,w),P=V(M+Math.PI,n,c,m,o,C,l,y,u,P),e){for(O[p++]=w.x,O[p++]=w.y,O[p++]=w.z,_=2*(z-1)+2,f=1;f<_-1;++f)d=v.Cartesian3.lerp(w,P,f/(_-1),W),O[p++]=d.x,O[p++]=d.y,O[p++]=d.z;O[p++]=P.x,O[p++]=P.y,O[p++]=P.z}r&&(g[T--]=w.z,g[T--]=w.y,g[T--]=w.x,g[I++]=P.x,g[I++]=P.y,g[I++]=P.z)}w=V(-(M=E.CesiumMath.PI_OVER_TWO),n,c,m,o,C,l,y,u,w);a={};return e&&(O[p++]=w.x,O[p++]=w.y,O[p++]=w.z,a.positions=O,a.numPts=h),r&&(g[T--]=w.z,g[T--]=w.y,g[T--]=w.x,a.outerPositions=g),a},a.EllipseGeometryLibrary=e}); diff --git a/public/Cesium/Workers/EllipseOutlineGeometry-ab13c628.js b/public/Cesium/Workers/EllipseOutlineGeometry-61cb55e1.js similarity index 86% rename from public/Cesium/Workers/EllipseOutlineGeometry-ab13c628.js rename to public/Cesium/Workers/EllipseOutlineGeometry-61cb55e1.js index ee82858..02ff776 100644 --- a/public/Cesium/Workers/EllipseOutlineGeometry-ab13c628.js +++ b/public/Cesium/Workers/EllipseOutlineGeometry-61cb55e1.js @@ -1 +1 @@ -define(["exports","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./ComponentDatatype-9204e9f6","./when-208fe5b0","./Check-d18af7c4","./EllipseGeometryLibrary-2412418f","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694"],function(e,f,c,m,h,y,t,b,A,_,g,x){"use strict";var E=new m.Cartesian3,s=new m.Cartesian3;var v=new c.BoundingSphere,M=new c.BoundingSphere;function C(e){var t=(e=y.defaultValue(e,y.defaultValue.EMPTY_OBJECT)).center,i=y.defaultValue(e.ellipsoid,m.Ellipsoid.WGS84),r=e.semiMajorAxis,a=e.semiMinorAxis,n=y.defaultValue(e.granularity,x.CesiumMath.RADIANS_PER_DEGREE),o=y.defaultValue(e.height,0),s=y.defaultValue(e.extrudedHeight,o);this._center=m.Cartesian3.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=a,this._ellipsoid=m.Ellipsoid.clone(i),this._rotation=y.defaultValue(e.rotation,0),this._height=Math.max(s,o),this._granularity=n,this._extrudedHeight=Math.min(s,o),this._numberOfVerticalLines=Math.max(y.defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}C.packedLength=m.Cartesian3.packedLength+m.Ellipsoid.packedLength+8,C.pack=function(e,t,i){return i=y.defaultValue(i,0),m.Cartesian3.pack(e._center,t,i),i+=m.Cartesian3.packedLength,m.Ellipsoid.pack(e._ellipsoid,t,i),i+=m.Ellipsoid.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]=y.defaultValue(e._offsetAttribute,-1),t};var G=new m.Cartesian3,L=new m.Ellipsoid,O={center:G,ellipsoid:L,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};C.unpack=function(e,t,i){t=y.defaultValue(t,0);var r=m.Cartesian3.unpack(e,t,G);t+=m.Cartesian3.packedLength;var a=m.Ellipsoid.unpack(e,t,L);t+=m.Ellipsoid.packedLength;var n=e[t++],o=e[t++],s=e[t++],u=e[t++],l=e[t++],d=e[t++],p=e[t++],t=e[t];return y.defined(i)?(i._center=m.Cartesian3.clone(r,i._center),i._ellipsoid=m.Ellipsoid.clone(a,i._ellipsoid),i._semiMajorAxis=n,i._semiMinorAxis=o,i._rotation=s,i._height=u,i._granularity=l,i._extrudedHeight=d,i._numberOfVerticalLines=p,i._offsetAttribute=-1===t?void 0:t,i):(O.height=u,O.extrudedHeight=d,O.granularity=l,O.rotation=s,O.semiMajorAxis=n,O.semiMinorAxis=o,O.numberOfVerticalLines=p,O.offsetAttribute=-1===t?void 0:t,new C(O))},C.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!x.CesiumMath.equalsEpsilon(t,i,0,x.CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var a,t={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return r?(t.extrudedHeight=i,t.offsetAttribute=e._offsetAttribute,a=function(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,a=m.Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,E),e.height,E);v.center=m.Cartesian3.add(t,a,v.center),v.radius=r,a=m.Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,a),e.extrudedHeight,a),M.center=m.Cartesian3.add(t,a,M.center),M.radius=r;var t=b.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,t=(a=new _.GeometryAttributes({position:new A.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b.EllipseGeometryLibrary.raisePositionsToHeight(t,e,!0)})})).position.values,r=c.BoundingSphere.union(v,M),n=t.length/3;y.defined(e.offsetAttribute)&&(o=new Uint8Array(n),o=e.offsetAttribute===f.GeometryOffsetAttribute.TOP?f.arrayFill(o,1,0,n/2):(t=e.offsetAttribute===f.GeometryOffsetAttribute.NONE?0:1,f.arrayFill(o,t)),a.applyOffset=new A.GeometryAttribute({componentDatatype:h.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o}));var o=y.defaultValue(e.numberOfVerticalLines,16),o=x.CesiumMath.clamp(o,0,n/2),s=g.IndexDatatype.createTypedArray(n,2*n+2*o);n/=2;var u=0;for(p=0;p<n;++p)s[u++]=p,s[u++]=(p+1)%n,s[u++]=p+n,s[u++]=(p+1)%n+n;if(0<o)for(var e=Math.min(o,n),l=Math.round(n/e),d=Math.min(l*o,n),p=0;p<d;p+=l)s[u++]=p,s[u++]=p+n;return{boundingSphere:r,attributes:a,indices:s}}(t)):(a=function(e){var t=e.center;s=m.Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,s),e.height,s),s=m.Cartesian3.add(t,s,s);for(var i=new c.BoundingSphere(s,e.semiMajorAxis),t=b.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,e=new _.GeometryAttributes({position:new A.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b.EllipseGeometryLibrary.raisePositionsToHeight(t,e,!1)})}),r=t.length/3,a=g.IndexDatatype.createTypedArray(r,2*r),n=0,o=0;o<r;++o)a[n++]=o,a[n++]=(o+1)%r;return{boundingSphere:i,attributes:e,indices:a}}(t),y.defined(e._offsetAttribute)&&(i=a.attributes.position.values.length,t=new Uint8Array(i/3),i=e._offsetAttribute===f.GeometryOffsetAttribute.NONE?0:1,f.arrayFill(t,i),a.attributes.applyOffset=new A.GeometryAttribute({componentDatatype:h.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t}))),new A.Geometry({attributes:a.attributes,indices:a.indices,primitiveType:A.PrimitiveType.LINES,boundingSphere:a.boundingSphere,offsetAttribute:e._offsetAttribute})}},e.EllipseOutlineGeometry=C}); +define(["exports","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Cartesian2-8646c5a1","./ComponentDatatype-1a100acd","./when-54335d57","./Check-24483042","./EllipseGeometryLibrary-e452d6b7","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036"],function(e,c,f,m,h,y,t,b,A,_,g,x){"use strict";var E=new m.Cartesian3,s=new m.Cartesian3;var v=new f.BoundingSphere,M=new f.BoundingSphere;function C(e){var t=(e=y.defaultValue(e,y.defaultValue.EMPTY_OBJECT)).center,i=y.defaultValue(e.ellipsoid,m.Ellipsoid.WGS84),r=e.semiMajorAxis,a=e.semiMinorAxis,n=y.defaultValue(e.granularity,x.CesiumMath.RADIANS_PER_DEGREE),o=y.defaultValue(e.height,0),s=y.defaultValue(e.extrudedHeight,o);this._center=m.Cartesian3.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=a,this._ellipsoid=m.Ellipsoid.clone(i),this._rotation=y.defaultValue(e.rotation,0),this._height=Math.max(s,o),this._granularity=n,this._extrudedHeight=Math.min(s,o),this._numberOfVerticalLines=Math.max(y.defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}C.packedLength=m.Cartesian3.packedLength+m.Ellipsoid.packedLength+8,C.pack=function(e,t,i){return i=y.defaultValue(i,0),m.Cartesian3.pack(e._center,t,i),i+=m.Cartesian3.packedLength,m.Ellipsoid.pack(e._ellipsoid,t,i),i+=m.Ellipsoid.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]=y.defaultValue(e._offsetAttribute,-1),t};var G=new m.Cartesian3,L=new m.Ellipsoid,O={center:G,ellipsoid:L,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};C.unpack=function(e,t,i){t=y.defaultValue(t,0);var r=m.Cartesian3.unpack(e,t,G);t+=m.Cartesian3.packedLength;var a=m.Ellipsoid.unpack(e,t,L);t+=m.Ellipsoid.packedLength;var n=e[t++],o=e[t++],s=e[t++],u=e[t++],l=e[t++],d=e[t++],p=e[t++],t=e[t];return y.defined(i)?(i._center=m.Cartesian3.clone(r,i._center),i._ellipsoid=m.Ellipsoid.clone(a,i._ellipsoid),i._semiMajorAxis=n,i._semiMinorAxis=o,i._rotation=s,i._height=u,i._granularity=l,i._extrudedHeight=d,i._numberOfVerticalLines=p,i._offsetAttribute=-1===t?void 0:t,i):(O.height=u,O.extrudedHeight=d,O.granularity=l,O.rotation=s,O.semiMajorAxis=n,O.semiMinorAxis=o,O.numberOfVerticalLines=p,O.offsetAttribute=-1===t?void 0:t,new C(O))},C.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!x.CesiumMath.equalsEpsilon(t,i,0,x.CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var a,t={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return r?(t.extrudedHeight=i,t.offsetAttribute=e._offsetAttribute,a=function(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,a=m.Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,E),e.height,E);v.center=m.Cartesian3.add(t,a,v.center),v.radius=r,a=m.Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,a),e.extrudedHeight,a),M.center=m.Cartesian3.add(t,a,M.center),M.radius=r;var t=b.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,t=(a=new _.GeometryAttributes({position:new A.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b.EllipseGeometryLibrary.raisePositionsToHeight(t,e,!0)})})).position.values,r=f.BoundingSphere.union(v,M),n=t.length/3;y.defined(e.offsetAttribute)&&(o=new Uint8Array(n),o=e.offsetAttribute===c.GeometryOffsetAttribute.TOP?c.arrayFill(o,1,0,n/2):(t=e.offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(o,t)),a.applyOffset=new A.GeometryAttribute({componentDatatype:h.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o}));var o=y.defaultValue(e.numberOfVerticalLines,16),o=x.CesiumMath.clamp(o,0,n/2),s=g.IndexDatatype.createTypedArray(n,2*n+2*o);n/=2;var u=0;for(p=0;p<n;++p)s[u++]=p,s[u++]=(p+1)%n,s[u++]=p+n,s[u++]=(p+1)%n+n;if(0<o)for(var e=Math.min(o,n),l=Math.round(n/e),d=Math.min(l*o,n),p=0;p<d;p+=l)s[u++]=p,s[u++]=p+n;return{boundingSphere:r,attributes:a,indices:s}}(t)):(a=function(e){var t=e.center;s=m.Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,s),e.height,s),s=m.Cartesian3.add(t,s,s);for(var i=new f.BoundingSphere(s,e.semiMajorAxis),t=b.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,e=new _.GeometryAttributes({position:new A.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b.EllipseGeometryLibrary.raisePositionsToHeight(t,e,!1)})}),r=t.length/3,a=g.IndexDatatype.createTypedArray(r,2*r),n=0,o=0;o<r;++o)a[n++]=o,a[n++]=(o+1)%r;return{boundingSphere:i,attributes:e,indices:a}}(t),y.defined(e._offsetAttribute)&&(i=a.attributes.position.values.length,t=new Uint8Array(i/3),i=e._offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(t,i),a.attributes.applyOffset=new A.GeometryAttribute({componentDatatype:h.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t}))),new A.Geometry({attributes:a.attributes,indices:a.indices,primitiveType:A.PrimitiveType.LINES,boundingSphere:a.boundingSphere,offsetAttribute:e._offsetAttribute})}},e.EllipseOutlineGeometry=C}); diff --git a/public/Cesium/Workers/EllipsoidGeodesic-8015072b.js b/public/Cesium/Workers/EllipsoidGeodesic-cc216670.js similarity index 53% rename from public/Cesium/Workers/EllipsoidGeodesic-8015072b.js rename to public/Cesium/Workers/EllipsoidGeodesic-cc216670.js index 85fc0ee..d762813 100644 --- a/public/Cesium/Workers/EllipsoidGeodesic-8015072b.js +++ b/public/Cesium/Workers/EllipsoidGeodesic-cc216670.js @@ -1 +1 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694"],function(t,S,a,p,U){"use strict";function b(t,a,i,n,e,s,r){var h,i=(h=t)*(i=i)*(4+h*(4-3*i))/16;return(1-i)*t*a*(n+i*e*(r+i*s*(2*r*r-1)))}var q=new S.Cartesian3,w=new S.Cartesian3;function n(t,a,i,n){var e,s,r,h,o,d,c,u,M,l,g,_,p,f,m,v,C,H,O;S.Cartesian3.normalize(n.cartographicToCartesian(a,w),q),S.Cartesian3.normalize(n.cartographicToCartesian(i,w),w),function(t,a,i,n,e,s,r){var h=(a-i)/a,o=s-n,n=Math.atan((1-h)*Math.tan(e)),e=Math.atan((1-h)*Math.tan(r)),r=Math.cos(n),n=Math.sin(n),d=Math.cos(e),e=Math.sin(e),c=r*d,u=r*e,M=n*e,l=n*d,g=o,_=U.CesiumMath.TWO_PI,p=Math.cos(g),f=Math.sin(g);do{var m,v,C,H,O,p=Math.cos(g),f=Math.sin(g),S=u-l*p,_=g,q=(C=M+c*p)-2*M/(O=0===(v=Math.sqrt(d*d*f*f+S*S))?(m=0,1):1-(m=c*f/v)*m),g=o+b(h,m,O,H=Math.atan2(v,C),v,C,q=!isFinite(q)?0:q)}while(Math.abs(g-_)>U.CesiumMath.EPSILON12);n=i*(1+(e=O*(a*a-i*i)/(i*i))*(4096+e*(e*(320-175*e)-768))/16384)*(H-(n=e*(256+e*(e*(74-47*e)-128))/1024)*v*(q+n*(C*(2*(a=q*q)-1)-n*q*(4*v*v-3)*(4*a-3)/6)/4)),a=Math.atan2(d*f,u-l*p),r=Math.atan2(r*f,u*p-l),t._distance=n,t._startHeading=a,t._endHeading=r,t._uSquared=e}(t,n.maximumRadius,n.minimumRadius,a.longitude,a.latitude,i.longitude,i.latitude),t._start=S.Cartographic.clone(a,t._start),t._end=S.Cartographic.clone(i,t._end),t._start.height=0,t._end.height=0,s=(e=t)._uSquared,r=e._ellipsoid.maximumRadius,h=e._ellipsoid.minimumRadius,o=(r-h)/r,d=Math.cos(e._startHeading),c=Math.sin(e._startHeading),u=(1-o)*Math.tan(e._start.latitude),M=1/Math.sqrt(1+u*u),l=M*u,g=Math.atan2(u,d),f=1-(p=(_=M*c)*_),m=Math.sqrt(f),H=1-3*(v=s/4)+35*(C=v*v)/4,O=1-5*v,s=(i=1+v-3*C/4+5*(n=C*v)/4-175*(a=C*C)/64)*g-(t=1-v+15*C/8-35*n/8)*Math.sin(2*g)*v/2-H*Math.sin(4*g)*C/16-O*Math.sin(6*g)*n/48-5*Math.sin(8*g)*a/512,(e=e._constants).a=r,e.b=h,e.f=o,e.cosineHeading=d,e.sineHeading=c,e.tanU=u,e.cosineU=M,e.sineU=l,e.sigma=g,e.sineAlpha=_,e.sineSquaredAlpha=p,e.cosineSquaredAlpha=f,e.cosineAlpha=m,e.u2Over4=v,e.u4Over16=C,e.u6Over64=n,e.u8Over256=a,e.a0=i,e.a1=t,e.a2=H,e.a3=O,e.distanceRatio=s}function i(t,a,i){i=p.defaultValue(i,S.Ellipsoid.WGS84);this._ellipsoid=i,this._start=new S.Cartographic,this._end=new S.Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,p.defined(t)&&p.defined(a)&&n(this,t,a,i)}Object.defineProperties(i.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}}}),i.prototype.setEndPoints=function(t,a){n(this,t,a,this._ellipsoid)},i.prototype.interpolateUsingFraction=function(t,a){return this.interpolateUsingSurfaceDistance(this._distance*t,a)},i.prototype.interpolateUsingSurfaceDistance=function(t,a){var i=this._constants,n=i.distanceRatio+t/i.b,e=Math.cos(2*n),s=Math.cos(4*n),r=Math.cos(6*n),h=Math.sin(2*n),o=Math.sin(4*n),d=Math.sin(6*n),c=Math.sin(8*n),u=n*n,M=n*u,l=i.u8Over256,g=i.u2Over4,_=i.u6Over64,t=i.u4Over16,u=2*M*l*e/3+n*(1-g+7*t/4-15*_/4+579*l/64-(t-15*_/4+187*l/16)*e-(5*_/4-115*l/16)*s-29*l*r/16)+(g/2-t+71*_/32-85*l/16)*h+(5*t/16-5*_/4+383*l/96)*o-u*((_-11*l/2)*h+5*l*o/2)+(29*_/96-29*l/16)*d+539*l*c/1536,h=Math.asin(Math.sin(u)*i.cosineAlpha),o=Math.atan(i.a/i.b*Math.tan(h));u-=i.sigma;_=Math.cos(2*i.sigma+u),d=Math.sin(u),l=Math.cos(u),c=i.cosineU*l,h=i.sineU*d,_=Math.atan2(d*i.sineHeading,c-h*i.cosineHeading)-b(i.f,i.sineAlpha,i.cosineSquaredAlpha,u,d,l,_);return p.defined(a)?(a.longitude=this._start.longitude+_,a.latitude=o,a.height=0,a):new S.Cartographic(this._start.longitude+_,o,0)},t.EllipsoidGeodesic=i}); +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Math-d6182036"],function(t,S,a,_,U){"use strict";function w(t,a,i,n,e,s,r){var h,i=(h=t)*(i=i)*(4+h*(4-3*i))/16;return(1-i)*t*a*(n+i*e*(r+i*s*(2*r*r-1)))}var q=new S.Cartesian3,A=new S.Cartesian3;function n(t,a,i,n){var e,s,r,h,o,d,u,c,M,l,g,_,p,f,m,v,C,H,O;S.Cartesian3.normalize(n.cartographicToCartesian(a,A),q),S.Cartesian3.normalize(n.cartographicToCartesian(i,A),A),function(t,a,i,n,e,s,r){var h=(a-i)/a,o=s-n,n=Math.atan((1-h)*Math.tan(e)),e=Math.atan((1-h)*Math.tan(r)),r=Math.cos(n),n=Math.sin(n),d=Math.cos(e),e=Math.sin(e),u=r*d,c=r*e,M=n*e,l=n*d,g=o,_=U.CesiumMath.TWO_PI,p=Math.cos(g),f=Math.sin(g);do{var m,v,C,H,O,p=Math.cos(g),f=Math.sin(g),S=c-l*p,_=g,q=(C=M+u*p)-2*M/(O=0===(v=Math.sqrt(d*d*f*f+S*S))?(m=0,1):1-(m=u*f/v)*m),g=o+w(h,m,O,H=Math.atan2(v,C),v,C,q=!isFinite(q)?0:q)}while(Math.abs(g-_)>U.CesiumMath.EPSILON12);n=i*(1+(e=O*(a*a-i*i)/(i*i))*(4096+e*(e*(320-175*e)-768))/16384)*(H-(n=e*(256+e*(e*(74-47*e)-128))/1024)*v*(q+n*(C*(2*(a=q*q)-1)-n*q*(4*v*v-3)*(4*a-3)/6)/4)),a=Math.atan2(d*f,c-l*p),r=Math.atan2(r*f,c*p-l),t._distance=n,t._startHeading=a,t._endHeading=r,t._uSquared=e}(t,n.maximumRadius,n.minimumRadius,a.longitude,a.latitude,i.longitude,i.latitude),t._start=S.Cartographic.clone(a,t._start),t._end=S.Cartographic.clone(i,t._end),t._start.height=0,t._end.height=0,s=(e=t)._uSquared,r=e._ellipsoid.maximumRadius,h=e._ellipsoid.minimumRadius,o=(r-h)/r,d=Math.cos(e._startHeading),u=Math.sin(e._startHeading),c=(1-o)*Math.tan(e._start.latitude),M=1/Math.sqrt(1+c*c),l=M*c,g=Math.atan2(c,d),f=1-(p=(_=M*u)*_),m=Math.sqrt(f),H=1-3*(v=s/4)+35*(C=v*v)/4,O=1-5*v,s=(i=1+v-3*C/4+5*(n=C*v)/4-175*(a=C*C)/64)*g-(t=1-v+15*C/8-35*n/8)*Math.sin(2*g)*v/2-H*Math.sin(4*g)*C/16-O*Math.sin(6*g)*n/48-5*Math.sin(8*g)*a/512,(e=e._constants).a=r,e.b=h,e.f=o,e.cosineHeading=d,e.sineHeading=u,e.tanU=c,e.cosineU=M,e.sineU=l,e.sigma=g,e.sineAlpha=_,e.sineSquaredAlpha=p,e.cosineSquaredAlpha=f,e.cosineAlpha=m,e.u2Over4=v,e.u4Over16=C,e.u6Over64=n,e.u8Over256=a,e.a0=i,e.a1=t,e.a2=H,e.a3=O,e.distanceRatio=s}function i(t,a,i){i=_.defaultValue(i,S.Ellipsoid.WGS84);this._ellipsoid=i,this._start=new S.Cartographic,this._end=new S.Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,_.defined(t)&&_.defined(a)&&n(this,t,a,i)}Object.defineProperties(i.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}}}),i.prototype.setEndPoints=function(t,a){n(this,t,a,this._ellipsoid)},i.prototype.interpolateUsingFraction=function(t,a){return this.interpolateUsingSurfaceDistance(this._distance*t,a)},i.prototype.interpolateUsingSurfaceDistance=function(t,a){var i=this._constants,n=i.distanceRatio+t/i.b,e=Math.cos(2*n),s=Math.cos(4*n),r=Math.cos(6*n),h=Math.sin(2*n),o=Math.sin(4*n),d=Math.sin(6*n),u=Math.sin(8*n),c=n*n,M=i.u8Over256,l=i.u2Over4,g=i.u6Over64,t=i.u4Over16,c=2*(n*c)*M*e/3+n*(1-l+7*t/4-15*g/4+579*M/64-(t-15*g/4+187*M/16)*e-(5*g/4-115*M/16)*s-29*M*r/16)+(l/2-t+71*g/32-85*M/16)*h+(5*t/16-5*g/4+383*M/96)*o-c*((g-11*M/2)*h+5*M*o/2)+(29*g/96-29*M/16)*d+539*M*u/1536,h=Math.asin(Math.sin(c)*i.cosineAlpha),o=Math.atan(i.a/i.b*Math.tan(h));c-=i.sigma;g=Math.cos(2*i.sigma+c),d=Math.sin(c),M=Math.cos(c),u=i.cosineU*M,h=i.sineU*d,g=Math.atan2(d*i.sineHeading,u-h*i.cosineHeading)-w(i.f,i.sineAlpha,i.cosineSquaredAlpha,c,d,M,g);return _.defined(a)?(a.longitude=this._start.longitude+g,a.latitude=o,a.height=0,a):new S.Cartographic(this._start.longitude+g,o,0)},t.EllipsoidGeodesic=i}); diff --git a/public/Cesium/Workers/EllipsoidGeometry-8e9adb8a.js b/public/Cesium/Workers/EllipsoidGeometry-8e9adb8a.js new file mode 100644 index 0000000..4f31429 --- /dev/null +++ b/public/Cesium/Workers/EllipsoidGeometry-8e9adb8a.js @@ -0,0 +1 @@ +define(["exports","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Cartesian2-8646c5a1","./ComponentDatatype-1a100acd","./when-54335d57","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./VertexFormat-81ec7207"],function(t,$,tt,et,at,it,e,rt,nt,ot,mt,f){"use strict";var st=new et.Cartesian3,ut=new et.Cartesian3,lt=new et.Cartesian3,ct=new et.Cartesian3,ft=new et.Cartesian3,l=new et.Cartesian3(1,1,1),dt=Math.cos,Ct=Math.sin;function d(t){t=it.defaultValue(t,it.defaultValue.EMPTY_OBJECT);var e=it.defaultValue(t.radii,l),a=it.defaultValue(t.innerRadii,e),i=it.defaultValue(t.minimumClock,0),r=it.defaultValue(t.maximumClock,mt.CesiumMath.TWO_PI),n=it.defaultValue(t.minimumCone,0),o=it.defaultValue(t.maximumCone,mt.CesiumMath.PI),m=Math.round(it.defaultValue(t.stackPartitions,64)),s=Math.round(it.defaultValue(t.slicePartitions,64)),u=it.defaultValue(t.vertexFormat,f.VertexFormat.DEFAULT);this._radii=et.Cartesian3.clone(e),this._innerRadii=et.Cartesian3.clone(a),this._minimumClock=i,this._maximumClock=r,this._minimumCone=n,this._maximumCone=o,this._stackPartitions=m,this._slicePartitions=s,this._vertexFormat=f.VertexFormat.clone(u),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}d.packedLength=2*et.Cartesian3.packedLength+f.VertexFormat.packedLength+7,d.pack=function(t,e,a){return a=it.defaultValue(a,0),et.Cartesian3.pack(t._radii,e,a),a+=et.Cartesian3.packedLength,et.Cartesian3.pack(t._innerRadii,e,a),a+=et.Cartesian3.packedLength,f.VertexFormat.pack(t._vertexFormat,e,a),a+=f.VertexFormat.packedLength,e[a++]=t._minimumClock,e[a++]=t._maximumClock,e[a++]=t._minimumCone,e[a++]=t._maximumCone,e[a++]=t._stackPartitions,e[a++]=t._slicePartitions,e[a]=it.defaultValue(t._offsetAttribute,-1),e};var a,C=new et.Cartesian3,p=new et.Cartesian3,y=new f.VertexFormat,_={radii:C,innerRadii:p,vertexFormat:y,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};d.unpack=function(t,e,a){e=it.defaultValue(e,0);var i=et.Cartesian3.unpack(t,e,C);e+=et.Cartesian3.packedLength;var r=et.Cartesian3.unpack(t,e,p);e+=et.Cartesian3.packedLength;var n=f.VertexFormat.unpack(t,e,y);e+=f.VertexFormat.packedLength;var o=t[e++],m=t[e++],s=t[e++],u=t[e++],l=t[e++],c=t[e++],e=t[e];return it.defined(a)?(a._radii=et.Cartesian3.clone(i,a._radii),a._innerRadii=et.Cartesian3.clone(r,a._innerRadii),a._vertexFormat=f.VertexFormat.clone(n,a._vertexFormat),a._minimumClock=o,a._maximumClock=m,a._minimumCone=s,a._maximumCone=u,a._stackPartitions=l,a._slicePartitions=c,a._offsetAttribute=-1===e?void 0:e,a):(_.minimumClock=o,_.maximumClock=m,_.minimumCone=s,_.maximumCone=u,_.stackPartitions=l,_.slicePartitions=c,_.offsetAttribute=-1===e?void 0:e,new d(_))},d.createGeometry=function(t){var e=t._radii;if(!(e.x<=0||e.y<=0||e.z<=0)){var a=t._innerRadii;if(!(a.x<=0||a.y<=0||a.z<=0)){var i=t._minimumClock,r=t._maximumClock,n=t._minimumCone,o=t._maximumCone,m=t._vertexFormat,s=t._slicePartitions+1,u=t._stackPartitions+1;(s=Math.round(s*Math.abs(r-i)/mt.CesiumMath.TWO_PI))<2&&(s=2),(u=Math.round(u*Math.abs(o-n)/mt.CesiumMath.PI))<2&&(u=2);var l=0,c=[n],f=[i];for(B=0;B<u;B++)c.push(n+B*(o-n)/(u-1));for(c.push(o),I=0;I<s;I++)f.push(i+I*(r-i)/(s-1));f.push(r);var d=c.length,C=f.length,p=0,y=1,_=a.x!==e.x||a.y!==e.y||a.z!==e.z,h=!1,v=!1,A=!1;_&&(y=2,0<n&&(h=!0,p+=s-1),o<Math.PI&&(v=!0,p+=s-1),(r-i)%mt.CesiumMath.TWO_PI?(A=!0,p+=2*(u-1)+1):p+=1);var x=C*d*y,k=new Float64Array(3*x),b=$.arrayFill(new Array(x),!1),w=$.arrayFill(new Array(x),!1),F=s*u*y,P=ot.IndexDatatype.createTypedArray(F,6*(F+p+1-(s+u)*y)),g=m.normal?new Float32Array(3*x):void 0,V=m.tangent?new Float32Array(3*x):void 0,M=m.bitangent?new Float32Array(3*x):void 0,T=m.st?new Float32Array(2*x):void 0,D=new Array(d),G=new Array(d);for(B=0;B<d;B++)D[B]=Ct(c[B]),G[B]=dt(c[B]);for(var L=new Array(C),O=new Array(C),I=0;I<C;I++)O[I]=dt(f[I]),L[I]=Ct(f[I]);for(B=0;B<d;B++)for(I=0;I<C;I++)k[l++]=e.x*D[B]*O[I],k[l++]=e.y*D[B]*L[I],k[l++]=e.z*G[B];var E,z,N,R,U=x/2;if(_)for(B=0;B<d;B++)for(I=0;I<C;I++)k[l++]=a.x*D[B]*O[I],k[l++]=a.y*D[B]*L[I],k[l++]=a.z*G[B],b[U]=!0,0<B&&B!==d-1&&0!==I&&I!==C-1&&(w[U]=!0),U++;for(l=0,B=1;B<d-2;B++)for(E=B*C,z=(B+1)*C,I=1;I<C-2;I++)P[l++]=z+I,P[l++]=z+I+1,P[l++]=E+I+1,P[l++]=z+I,P[l++]=E+I+1,P[l++]=E+I;if(_)for(var S=d*C,B=1;B<d-2;B++)for(E=S+B*C,z=S+(B+1)*C,I=1;I<C-2;I++)P[l++]=z+I,P[l++]=E+I,P[l++]=E+I+1,P[l++]=z+I,P[l++]=E+I+1,P[l++]=z+I+1;if(_){if(h)for(R=d*C,B=1;B<C-2;B++)P[l++]=B,P[l++]=B+1,P[l++]=R+B+1,P[l++]=B,P[l++]=R+B+1,P[l++]=R+B;if(v)for(N=d*C-C,R=d*C*y-C,B=1;B<C-2;B++)P[l++]=N+B+1,P[l++]=N+B,P[l++]=R+B,P[l++]=N+B+1,P[l++]=R+B,P[l++]=R+B+1}if(A){for(B=1;B<d-2;B++)P[l++]=R=C*d+(N=C*B),P[l++]=N+C,P[l++]=N,P[l++]=R,P[l++]=R+C,P[l++]=N+C;for(B=1;B<d-2;B++)R=C*d+C*(B+1)-1,P[l++]=(N=C*(B+1)-1)+C,P[l++]=R,P[l++]=N,P[l++]=N+C,P[l++]=R+C,P[l++]=R}v=new nt.GeometryAttributes;m.position&&(v.position=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k}));var W=0,Y=0,J=0,X=0,Z=x/2,j=et.Ellipsoid.fromCartesian3(e),q=et.Ellipsoid.fromCartesian3(a);if(m.st||m.normal||m.tangent||m.bitangent){for(B=0;B<x;B++){var H,K=b[B]?q:j,Q=et.Cartesian3.fromArray(k,3*B,st),Q=K.geodeticSurfaceNormal(Q,ut);w[B]&&et.Cartesian3.negate(Q,Q),m.st&&(H=et.Cartesian2.negate(Q,ft),T[W++]=Math.atan2(H.y,H.x)/mt.CesiumMath.TWO_PI+.5,T[W++]=Math.asin(Q.z)/Math.PI+.5),m.normal&&(g[Y++]=Q.x,g[Y++]=Q.y,g[Y++]=Q.z),(m.tangent||m.bitangent)&&(H=0,b[B]&&(H=Z),H=!h&&H<=B&&B<H+2*C?et.Cartesian3.UNIT_X:et.Cartesian3.UNIT_Z,et.Cartesian3.cross(H,Q,H=lt),et.Cartesian3.normalize(H,H),m.tangent&&(V[J++]=H.x,V[J++]=H.y,V[J++]=H.z),m.bitangent&&(H=et.Cartesian3.cross(Q,H,ct),et.Cartesian3.normalize(H,H),M[X++]=H.x,M[X++]=H.y,M[X++]=H.z))}m.st&&(v.st=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:T})),m.normal&&(v.normal=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g})),m.tangent&&(v.tangent=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),m.bitangent&&(v.bitangent=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M}))}return it.defined(t._offsetAttribute)&&(y=k.length,A=new Uint8Array(y/3),y=t._offsetAttribute===$.GeometryOffsetAttribute.NONE?0:1,$.arrayFill(A,y),v.applyOffset=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})),new rt.Geometry({attributes:v,indices:P,primitiveType:rt.PrimitiveType.TRIANGLES,boundingSphere:tt.BoundingSphere.fromEllipsoid(j),offsetAttribute:t._offsetAttribute})}}},d.getUnitEllipsoid=function(){return a=!it.defined(a)?d.createGeometry(new d({radii:new et.Cartesian3(1,1,1),vertexFormat:f.VertexFormat.POSITION_ONLY})):a},t.EllipsoidGeometry=d}); diff --git a/public/Cesium/Workers/EllipsoidGeometry-cb484b79.js b/public/Cesium/Workers/EllipsoidGeometry-cb484b79.js deleted file mode 100644 index 878edc2..0000000 --- a/public/Cesium/Workers/EllipsoidGeometry-cb484b79.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./ComponentDatatype-9204e9f6","./when-208fe5b0","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./VertexFormat-e8cbf5b3"],function(t,$,tt,et,at,it,e,rt,nt,ot,mt,c){"use strict";var st=new et.Cartesian3,ut=new et.Cartesian3,lt=new et.Cartesian3,ft=new et.Cartesian3,ct=new et.Cartesian3,l=new et.Cartesian3(1,1,1),dt=Math.cos,Ct=Math.sin;function d(t){t=it.defaultValue(t,it.defaultValue.EMPTY_OBJECT);var e=it.defaultValue(t.radii,l),a=it.defaultValue(t.innerRadii,e),i=it.defaultValue(t.minimumClock,0),r=it.defaultValue(t.maximumClock,mt.CesiumMath.TWO_PI),n=it.defaultValue(t.minimumCone,0),o=it.defaultValue(t.maximumCone,mt.CesiumMath.PI),m=Math.round(it.defaultValue(t.stackPartitions,64)),s=Math.round(it.defaultValue(t.slicePartitions,64)),u=it.defaultValue(t.vertexFormat,c.VertexFormat.DEFAULT);this._radii=et.Cartesian3.clone(e),this._innerRadii=et.Cartesian3.clone(a),this._minimumClock=i,this._maximumClock=r,this._minimumCone=n,this._maximumCone=o,this._stackPartitions=m,this._slicePartitions=s,this._vertexFormat=c.VertexFormat.clone(u),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}d.packedLength=2*et.Cartesian3.packedLength+c.VertexFormat.packedLength+7,d.pack=function(t,e,a){return a=it.defaultValue(a,0),et.Cartesian3.pack(t._radii,e,a),a+=et.Cartesian3.packedLength,et.Cartesian3.pack(t._innerRadii,e,a),a+=et.Cartesian3.packedLength,c.VertexFormat.pack(t._vertexFormat,e,a),a+=c.VertexFormat.packedLength,e[a++]=t._minimumClock,e[a++]=t._maximumClock,e[a++]=t._minimumCone,e[a++]=t._maximumCone,e[a++]=t._stackPartitions,e[a++]=t._slicePartitions,e[a]=it.defaultValue(t._offsetAttribute,-1),e};var a,C=new et.Cartesian3,p=new et.Cartesian3,y=new c.VertexFormat,_={radii:C,innerRadii:p,vertexFormat:y,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};d.unpack=function(t,e,a){e=it.defaultValue(e,0);var i=et.Cartesian3.unpack(t,e,C);e+=et.Cartesian3.packedLength;var r=et.Cartesian3.unpack(t,e,p);e+=et.Cartesian3.packedLength;var n=c.VertexFormat.unpack(t,e,y);e+=c.VertexFormat.packedLength;var o=t[e++],m=t[e++],s=t[e++],u=t[e++],l=t[e++],f=t[e++],e=t[e];return it.defined(a)?(a._radii=et.Cartesian3.clone(i,a._radii),a._innerRadii=et.Cartesian3.clone(r,a._innerRadii),a._vertexFormat=c.VertexFormat.clone(n,a._vertexFormat),a._minimumClock=o,a._maximumClock=m,a._minimumCone=s,a._maximumCone=u,a._stackPartitions=l,a._slicePartitions=f,a._offsetAttribute=-1===e?void 0:e,a):(_.minimumClock=o,_.maximumClock=m,_.minimumCone=s,_.maximumCone=u,_.stackPartitions=l,_.slicePartitions=f,_.offsetAttribute=-1===e?void 0:e,new d(_))},d.createGeometry=function(t){var e=t._radii;if(!(e.x<=0||e.y<=0||e.z<=0)){var a=t._innerRadii;if(!(a.x<=0||a.y<=0||a.z<=0)){var i=t._minimumClock,r=t._maximumClock,n=t._minimumCone,o=t._maximumCone,m=t._vertexFormat,s=t._slicePartitions+1,u=t._stackPartitions+1;(s=Math.round(s*Math.abs(r-i)/mt.CesiumMath.TWO_PI))<2&&(s=2),(u=Math.round(u*Math.abs(o-n)/mt.CesiumMath.PI))<2&&(u=2);var l=0,f=[n],c=[i];for(B=0;B<u;B++)f.push(n+B*(o-n)/(u-1));for(f.push(o),I=0;I<s;I++)c.push(i+I*(r-i)/(s-1));c.push(r);var d=f.length,C=c.length,p=0,y=1,_=a.x!==e.x||a.y!==e.y||a.z!==e.z,h=!1,b=!1,v=!1;_&&(y=2,0<n&&(h=!0,p+=s-1),o<Math.PI&&(b=!0,p+=s-1),(r-i)%mt.CesiumMath.TWO_PI?(v=!0,p+=2*(u-1)+1):p+=1);var A=C*d*y,x=new Float64Array(3*A),k=$.arrayFill(new Array(A),!1),w=$.arrayFill(new Array(A),!1),F=s*u*y,p=6*(F+p+1-(s+u)*y),P=ot.IndexDatatype.createTypedArray(F,p),g=m.normal?new Float32Array(3*A):void 0,V=m.tangent?new Float32Array(3*A):void 0,M=m.bitangent?new Float32Array(3*A):void 0,T=m.st?new Float32Array(2*A):void 0,D=new Array(d),G=new Array(d);for(B=0;B<d;B++)D[B]=Ct(f[B]),G[B]=dt(f[B]);for(var L=new Array(C),O=new Array(C),I=0;I<C;I++)O[I]=dt(c[I]),L[I]=Ct(c[I]);for(B=0;B<d;B++)for(I=0;I<C;I++)x[l++]=e.x*D[B]*O[I],x[l++]=e.y*D[B]*L[I],x[l++]=e.z*G[B];var E,z,N,R,U=A/2;if(_)for(B=0;B<d;B++)for(I=0;I<C;I++)x[l++]=a.x*D[B]*O[I],x[l++]=a.y*D[B]*L[I],x[l++]=a.z*G[B],k[U]=!0,0<B&&B!==d-1&&0!==I&&I!==C-1&&(w[U]=!0),U++;for(l=0,B=1;B<d-2;B++)for(E=B*C,z=(B+1)*C,I=1;I<C-2;I++)P[l++]=z+I,P[l++]=z+I+1,P[l++]=E+I+1,P[l++]=z+I,P[l++]=E+I+1,P[l++]=E+I;if(_)for(var S=d*C,B=1;B<d-2;B++)for(E=S+B*C,z=S+(B+1)*C,I=1;I<C-2;I++)P[l++]=z+I,P[l++]=E+I,P[l++]=E+I+1,P[l++]=z+I,P[l++]=E+I+1,P[l++]=z+I+1;if(_){if(h)for(R=d*C,B=1;B<C-2;B++)P[l++]=B,P[l++]=B+1,P[l++]=R+B+1,P[l++]=B,P[l++]=R+B+1,P[l++]=R+B;if(b)for(N=d*C-C,R=d*C*y-C,B=1;B<C-2;B++)P[l++]=N+B+1,P[l++]=N+B,P[l++]=R+B,P[l++]=N+B+1,P[l++]=R+B,P[l++]=R+B+1}if(v){for(B=1;B<d-2;B++)R=C*d+C*B,N=C*B,P[l++]=R,P[l++]=N+C,P[l++]=N,P[l++]=R,P[l++]=R+C,P[l++]=N+C;for(B=1;B<d-2;B++)R=C*d+C*(B+1)-1,N=C*(B+1)-1,P[l++]=N+C,P[l++]=R,P[l++]=N,P[l++]=N+C,P[l++]=R+C,P[l++]=R}b=new nt.GeometryAttributes;m.position&&(b.position=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:x}));var W=0,Y=0,J=0,X=0,Z=A/2,j=et.Ellipsoid.fromCartesian3(e),q=et.Ellipsoid.fromCartesian3(a);if(m.st||m.normal||m.tangent||m.bitangent){for(B=0;B<A;B++){var H,K=k[B]?q:j,Q=et.Cartesian3.fromArray(x,3*B,st),K=K.geodeticSurfaceNormal(Q,ut);w[B]&&et.Cartesian3.negate(K,K),m.st&&(H=et.Cartesian2.negate(K,ct),T[W++]=Math.atan2(H.y,H.x)/mt.CesiumMath.TWO_PI+.5,T[W++]=Math.asin(K.z)/Math.PI+.5),m.normal&&(g[Y++]=K.x,g[Y++]=K.y,g[Y++]=K.z),(m.tangent||m.bitangent)&&(Q=lt,H=0,k[B]&&(H=Z),H=!h&&H<=B&&B<H+2*C?et.Cartesian3.UNIT_X:et.Cartesian3.UNIT_Z,et.Cartesian3.cross(H,K,Q),et.Cartesian3.normalize(Q,Q),m.tangent&&(V[J++]=Q.x,V[J++]=Q.y,V[J++]=Q.z),m.bitangent&&(Q=et.Cartesian3.cross(K,Q,ft),et.Cartesian3.normalize(Q,Q),M[X++]=Q.x,M[X++]=Q.y,M[X++]=Q.z))}m.st&&(b.st=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:T})),m.normal&&(b.normal=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g})),m.tangent&&(b.tangent=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),m.bitangent&&(b.bitangent=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:M}))}return it.defined(t._offsetAttribute)&&(y=x.length,v=new Uint8Array(y/3),y=t._offsetAttribute===$.GeometryOffsetAttribute.NONE?0:1,$.arrayFill(v,y),b.applyOffset=new rt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})),new rt.Geometry({attributes:b,indices:P,primitiveType:rt.PrimitiveType.TRIANGLES,boundingSphere:tt.BoundingSphere.fromEllipsoid(j),offsetAttribute:t._offsetAttribute})}}},d.getUnitEllipsoid=function(){return a=!it.defined(a)?d.createGeometry(new d({radii:new et.Cartesian3(1,1,1),vertexFormat:c.VertexFormat.POSITION_ONLY})):a},t.EllipsoidGeometry=d}); diff --git a/public/Cesium/Workers/EllipsoidOutlineGeometry-dd7f7ad1.js b/public/Cesium/Workers/EllipsoidOutlineGeometry-b505f2ae.js similarity index 56% rename from public/Cesium/Workers/EllipsoidOutlineGeometry-dd7f7ad1.js rename to public/Cesium/Workers/EllipsoidOutlineGeometry-b505f2ae.js index 3e5a3be..21eaa5f 100644 --- a/public/Cesium/Workers/EllipsoidOutlineGeometry-dd7f7ad1.js +++ b/public/Cesium/Workers/EllipsoidOutlineGeometry-b505f2ae.js @@ -1 +1 @@ -define(["exports","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./ComponentDatatype-9204e9f6","./when-208fe5b0","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694"],function(i,D,I,T,z,L,t,R,N,B,S){"use strict";var f=new T.Cartesian3(1,1,1),U=Math.cos,F=Math.sin;function l(i){i=L.defaultValue(i,L.defaultValue.EMPTY_OBJECT);var t=L.defaultValue(i.radii,f),e=L.defaultValue(i.innerRadii,t),a=L.defaultValue(i.minimumClock,0),n=L.defaultValue(i.maximumClock,S.CesiumMath.TWO_PI),r=L.defaultValue(i.minimumCone,0),o=L.defaultValue(i.maximumCone,S.CesiumMath.PI),s=Math.round(L.defaultValue(i.stackPartitions,10)),m=Math.round(L.defaultValue(i.slicePartitions,8)),u=Math.round(L.defaultValue(i.subdivisions,128));this._radii=T.Cartesian3.clone(t),this._innerRadii=T.Cartesian3.clone(e),this._minimumClock=a,this._maximumClock=n,this._minimumCone=r,this._maximumCone=o,this._stackPartitions=s,this._slicePartitions=m,this._subdivisions=u,this._offsetAttribute=i.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}l.packedLength=2*T.Cartesian3.packedLength+8,l.pack=function(i,t,e){return e=L.defaultValue(e,0),T.Cartesian3.pack(i._radii,t,e),e+=T.Cartesian3.packedLength,T.Cartesian3.pack(i._innerRadii,t,e),e+=T.Cartesian3.packedLength,t[e++]=i._minimumClock,t[e++]=i._maximumClock,t[e++]=i._minimumCone,t[e++]=i._maximumCone,t[e++]=i._stackPartitions,t[e++]=i._slicePartitions,t[e++]=i._subdivisions,t[e]=L.defaultValue(i._offsetAttribute,-1),t};var c=new T.Cartesian3,C=new T.Cartesian3,_={radii:c,innerRadii:C,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};l.unpack=function(i,t,e){t=L.defaultValue(t,0);var a=T.Cartesian3.unpack(i,t,c);t+=T.Cartesian3.packedLength;var n=T.Cartesian3.unpack(i,t,C);t+=T.Cartesian3.packedLength;var r=i[t++],o=i[t++],s=i[t++],m=i[t++],u=i[t++],f=i[t++],d=i[t++],t=i[t];return L.defined(e)?(e._radii=T.Cartesian3.clone(a,e._radii),e._innerRadii=T.Cartesian3.clone(n,e._innerRadii),e._minimumClock=r,e._maximumClock=o,e._minimumCone=s,e._maximumCone=m,e._stackPartitions=u,e._slicePartitions=f,e._subdivisions=d,e._offsetAttribute=-1===t?void 0:t,e):(_.minimumClock=r,_.maximumClock=o,_.minimumCone=s,_.maximumCone=m,_.stackPartitions=u,_.slicePartitions=f,_.subdivisions=d,_.offsetAttribute=-1===t?void 0:t,new l(_))},l.createGeometry=function(i){var t=i._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var e=i._innerRadii;if(!(e.x<=0||e.y<=0||e.z<=0)){var a=i._minimumClock,n=i._maximumClock,r=i._minimumCone,o=i._maximumCone,s=i._subdivisions,m=T.Ellipsoid.fromCartesian3(t),u=i._slicePartitions+1,f=i._stackPartitions+1;(u=Math.round(u*Math.abs(n-a)/S.CesiumMath.TWO_PI))<2&&(u=2),(f=Math.round(f*Math.abs(o-r)/S.CesiumMath.PI))<2&&(f=2);var d=0,l=1,c=e.x!==t.x||e.y!==t.y||e.z!==t.z,C=!1,_=!1;c&&(l=2,0<r&&(C=!0,d+=u),o<Math.PI&&(_=!0,d+=u));for(var h,p,b=s*l*(f+u),y=new Float64Array(3*b),d=2*(b+d-(u+f)*l),v=B.IndexDatatype.createTypedArray(b,d),k=0,A=new Array(f),x=new Array(f),P=0;P<f;P++)p=r+P*(o-r)/(f-1),A[P]=F(p),x[P]=U(p);var w=new Array(s),M=new Array(s);for(P=0;P<s;P++)h=a+P*(n-a)/(s-1),w[P]=F(h),M[P]=U(h);for(P=0;P<f;P++)for(g=0;g<s;g++)y[k++]=t.x*A[P]*M[g],y[k++]=t.y*A[P]*w[g],y[k++]=t.z*x[P];if(c)for(P=0;P<f;P++)for(g=0;g<s;g++)y[k++]=e.x*A[P]*M[g],y[k++]=e.y*A[P]*w[g],y[k++]=e.z*x[P];for(A.length=s,x.length=s,P=0;P<s;P++)p=r+P*(o-r)/(s-1),A[P]=F(p),x[P]=U(p);for(w.length=u,M.length=u,P=0;P<u;P++)h=a+P*(n-a)/(u-1),w[P]=F(h),M[P]=U(h);for(P=0;P<s;P++)for(g=0;g<u;g++)y[k++]=t.x*A[P]*M[g],y[k++]=t.y*A[P]*w[g],y[k++]=t.z*x[P];if(c)for(P=0;P<s;P++)for(g=0;g<u;g++)y[k++]=e.x*A[P]*M[g],y[k++]=e.y*A[P]*w[g],y[k++]=e.z*x[P];for(P=k=0;P<f*l;P++)for(var V=P*s,g=0;g<s-1;g++)v[k++]=V+g,v[k++]=V+g+1;var G=f*s*l;for(P=0;P<u;P++)for(g=0;g<s-1;g++)v[k++]=G+P+g*u,v[k++]=G+P+(g+1)*u;if(c)for(G=f*s*l+u*s,P=0;P<u;P++)for(g=0;g<s-1;g++)v[k++]=G+P+g*u,v[k++]=G+P+(g+1)*u;if(c){var E=f*s*l,O=E+s*u;if(C)for(P=0;P<u;P++)v[k++]=E+P,v[k++]=O+P;if(_)for(E+=s*u-u,O+=s*u-u,P=0;P<u;P++)v[k++]=E+P,v[k++]=O+P}c=new N.GeometryAttributes({position:new R.GeometryAttribute({componentDatatype:z.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:y})});return L.defined(i._offsetAttribute)&&(C=y.length,_=new Uint8Array(C/3),C=i._offsetAttribute===D.GeometryOffsetAttribute.NONE?0:1,D.arrayFill(_,C),c.applyOffset=new R.GeometryAttribute({componentDatatype:z.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})),new R.Geometry({attributes:c,indices:v,primitiveType:R.PrimitiveType.LINES,boundingSphere:I.BoundingSphere.fromEllipsoid(m),offsetAttribute:i._offsetAttribute})}}},i.EllipsoidOutlineGeometry=l}); +define(["exports","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Cartesian2-8646c5a1","./ComponentDatatype-1a100acd","./when-54335d57","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036"],function(i,D,I,T,z,L,t,R,N,B,S){"use strict";var f=new T.Cartesian3(1,1,1),U=Math.cos,F=Math.sin;function l(i){i=L.defaultValue(i,L.defaultValue.EMPTY_OBJECT);var t=L.defaultValue(i.radii,f),e=L.defaultValue(i.innerRadii,t),a=L.defaultValue(i.minimumClock,0),n=L.defaultValue(i.maximumClock,S.CesiumMath.TWO_PI),r=L.defaultValue(i.minimumCone,0),o=L.defaultValue(i.maximumCone,S.CesiumMath.PI),s=Math.round(L.defaultValue(i.stackPartitions,10)),m=Math.round(L.defaultValue(i.slicePartitions,8)),u=Math.round(L.defaultValue(i.subdivisions,128));this._radii=T.Cartesian3.clone(t),this._innerRadii=T.Cartesian3.clone(e),this._minimumClock=a,this._maximumClock=n,this._minimumCone=r,this._maximumCone=o,this._stackPartitions=s,this._slicePartitions=m,this._subdivisions=u,this._offsetAttribute=i.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}l.packedLength=2*T.Cartesian3.packedLength+8,l.pack=function(i,t,e){return e=L.defaultValue(e,0),T.Cartesian3.pack(i._radii,t,e),e+=T.Cartesian3.packedLength,T.Cartesian3.pack(i._innerRadii,t,e),e+=T.Cartesian3.packedLength,t[e++]=i._minimumClock,t[e++]=i._maximumClock,t[e++]=i._minimumCone,t[e++]=i._maximumCone,t[e++]=i._stackPartitions,t[e++]=i._slicePartitions,t[e++]=i._subdivisions,t[e]=L.defaultValue(i._offsetAttribute,-1),t};var c=new T.Cartesian3,C=new T.Cartesian3,_={radii:c,innerRadii:C,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};l.unpack=function(i,t,e){t=L.defaultValue(t,0);var a=T.Cartesian3.unpack(i,t,c);t+=T.Cartesian3.packedLength;var n=T.Cartesian3.unpack(i,t,C);t+=T.Cartesian3.packedLength;var r=i[t++],o=i[t++],s=i[t++],m=i[t++],u=i[t++],f=i[t++],d=i[t++],t=i[t];return L.defined(e)?(e._radii=T.Cartesian3.clone(a,e._radii),e._innerRadii=T.Cartesian3.clone(n,e._innerRadii),e._minimumClock=r,e._maximumClock=o,e._minimumCone=s,e._maximumCone=m,e._stackPartitions=u,e._slicePartitions=f,e._subdivisions=d,e._offsetAttribute=-1===t?void 0:t,e):(_.minimumClock=r,_.maximumClock=o,_.minimumCone=s,_.maximumCone=m,_.stackPartitions=u,_.slicePartitions=f,_.subdivisions=d,_.offsetAttribute=-1===t?void 0:t,new l(_))},l.createGeometry=function(i){var t=i._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var e=i._innerRadii;if(!(e.x<=0||e.y<=0||e.z<=0)){var a=i._minimumClock,n=i._maximumClock,r=i._minimumCone,o=i._maximumCone,s=i._subdivisions,m=T.Ellipsoid.fromCartesian3(t),u=i._slicePartitions+1,f=i._stackPartitions+1;(u=Math.round(u*Math.abs(n-a)/S.CesiumMath.TWO_PI))<2&&(u=2),(f=Math.round(f*Math.abs(o-r)/S.CesiumMath.PI))<2&&(f=2);var d=0,l=1,c=e.x!==t.x||e.y!==t.y||e.z!==t.z,C=!1,_=!1;c&&(l=2,0<r&&(C=!0,d+=u),o<Math.PI&&(_=!0,d+=u));for(var h,p,y=s*l*(f+u),v=new Float64Array(3*y),k=B.IndexDatatype.createTypedArray(y,2*(y+d-(u+f)*l)),b=0,A=new Array(f),x=new Array(f),P=0;P<f;P++)A[P]=F(p=r+P*(o-r)/(f-1)),x[P]=U(p);var w=new Array(s),M=new Array(s);for(P=0;P<s;P++)w[P]=F(h=a+P*(n-a)/(s-1)),M[P]=U(h);for(P=0;P<f;P++)for(g=0;g<s;g++)v[b++]=t.x*A[P]*M[g],v[b++]=t.y*A[P]*w[g],v[b++]=t.z*x[P];if(c)for(P=0;P<f;P++)for(g=0;g<s;g++)v[b++]=e.x*A[P]*M[g],v[b++]=e.y*A[P]*w[g],v[b++]=e.z*x[P];for(A.length=s,x.length=s,P=0;P<s;P++)A[P]=F(p=r+P*(o-r)/(s-1)),x[P]=U(p);for(w.length=u,M.length=u,P=0;P<u;P++)w[P]=F(h=a+P*(n-a)/(u-1)),M[P]=U(h);for(P=0;P<s;P++)for(g=0;g<u;g++)v[b++]=t.x*A[P]*M[g],v[b++]=t.y*A[P]*w[g],v[b++]=t.z*x[P];if(c)for(P=0;P<s;P++)for(g=0;g<u;g++)v[b++]=e.x*A[P]*M[g],v[b++]=e.y*A[P]*w[g],v[b++]=e.z*x[P];for(P=b=0;P<f*l;P++)for(var V=P*s,g=0;g<s-1;g++)k[b++]=V+g,k[b++]=V+g+1;var G=f*s*l;for(P=0;P<u;P++)for(g=0;g<s-1;g++)k[b++]=G+P+g*u,k[b++]=G+P+(g+1)*u;if(c)for(G=f*s*l+u*s,P=0;P<u;P++)for(g=0;g<s-1;g++)k[b++]=G+P+g*u,k[b++]=G+P+(g+1)*u;if(c){var E=f*s*l,O=E+s*u;if(C)for(P=0;P<u;P++)k[b++]=E+P,k[b++]=O+P;if(_)for(E+=s*u-u,O+=s*u-u,P=0;P<u;P++)k[b++]=E+P,k[b++]=O+P}c=new N.GeometryAttributes({position:new R.GeometryAttribute({componentDatatype:z.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v})});return L.defined(i._offsetAttribute)&&(C=v.length,_=new Uint8Array(C/3),C=i._offsetAttribute===D.GeometryOffsetAttribute.NONE?0:1,D.arrayFill(_,C),c.applyOffset=new R.GeometryAttribute({componentDatatype:z.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})),new R.Geometry({attributes:c,indices:k,primitiveType:R.PrimitiveType.LINES,boundingSphere:I.BoundingSphere.fromEllipsoid(m),offsetAttribute:i._offsetAttribute})}}},i.EllipsoidOutlineGeometry=l}); diff --git a/public/Cesium/Workers/EllipsoidRhumbLine-2b7999f3.js b/public/Cesium/Workers/EllipsoidRhumbLine-2b7999f3.js new file mode 100644 index 0000000..1f63fb5 --- /dev/null +++ b/public/Cesium/Workers/EllipsoidRhumbLine-2b7999f3.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Math-d6182036"],function(t,M,i,c,g){"use strict";function l(t,i,a){if(0===t)return i*a;var e=t*t,n=e*e,s=n*e,h=s*e,u=h*e,t=u*e,a=a;return i*((1-e/4-3*n/64-5*s/256-175*h/16384-441*u/65536-4851*t/1048576)*a-(3*e/8+3*n/32+45*s/1024+105*h/4096+2205*u/131072+6237*t/524288)*Math.sin(2*a)+(15*n/256+45*s/1024+525*h/16384+1575*u/65536+155925*t/8388608)*Math.sin(4*a)-(35*s/3072+175*h/12288+3675*u/262144+13475*t/1048576)*Math.sin(6*a)+(315*h/131072+2205*u/524288+43659*t/8388608)*Math.sin(8*a)-(693*u/1310720+6237*t/5242880)*Math.sin(10*a)+1001*t/8388608*Math.sin(12*a))}function d(t,i){if(0===t)return Math.log(Math.tan(.5*(g.CesiumMath.PI_OVER_TWO+i)));var a=t*Math.sin(i);return Math.log(Math.tan(.5*(g.CesiumMath.PI_OVER_TWO+i)))-t/2*Math.log((1+a)/(1-a))}var r=new M.Cartesian3,m=new M.Cartesian3;function e(t,i,a,e){M.Cartesian3.normalize(e.cartographicToCartesian(i,m),r),M.Cartesian3.normalize(e.cartographicToCartesian(a,m),m);var n,s,h=e.maximumRadius,u=e.minimumRadius,o=h*h;t._ellipticitySquared=(o-u*u)/o,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=M.Cartographic.clone(i,t._start),t._start.height=0,t._end=M.Cartographic.clone(a,t._end),t._end.height=0,t._heading=(n=t,s=i.longitude,h=i.latitude,u=a.longitude,o=a.latitude,h=d(n._ellipticity,h),o=d(n._ellipticity,o),Math.atan2(g.CesiumMath.negativePiToPi(u-s),o-h)),t._distance=(u=t,s=e.maximumRadius,o=e.minimumRadius,h=i.longitude,t=i.latitude,e=a.longitude,i=a.latitude,a=u._heading,e-=h,h=0,h=g.CesiumMath.equalsEpsilon(Math.abs(a),g.CesiumMath.PI_OVER_TWO,g.CesiumMath.EPSILON8)?s===o?s*Math.cos(t)*g.CesiumMath.negativePiToPi(e):(o=Math.sin(t),s*Math.cos(t)*g.CesiumMath.negativePiToPi(e)/Math.sqrt(1-u._ellipticitySquared*o*o)):(t=l(u._ellipticity,s,t),(l(u._ellipticity,s,i)-t)/Math.cos(a)),Math.abs(h))}function o(t,i,a,e,n,s){if(0===a)return M.Cartographic.clone(t,s);var h,u,o,r=n*n;return o=Math.abs(g.CesiumMath.PI_OVER_TWO-Math.abs(i))>g.CesiumMath.EPSILON8?(h=function(t,i,a){var e=t/a;if(0===i)return e;var n=e*e,s=n*e,h=s*e,u=i*i,o=u*u,r=o*u,l=r*u,d=l*u,M=d*u,c=Math.sin(2*e),g=Math.cos(2*e),m=Math.sin(4*e),_=Math.cos(4*e),p=Math.sin(6*e),C=Math.cos(6*e),t=Math.sin(8*e),a=Math.cos(8*e),i=Math.sin(10*e);return e+e*u/4+7*e*o/64+15*e*r/256+579*e*l/16384+1515*e*d/65536+16837*e*M/1048576+(3*e*o/16+45*e*r/256-e*(32*n-561)*l/4096-e*(232*n-1677)*d/16384+e*(399985-90560*n+512*h)*M/5242880)*g+(21*e*r/256+483*e*l/4096-e*(224*n-1969)*d/16384-e*(33152*n-112599)*M/1048576)*_+(151*e*l/4096+4681*e*d/65536+1479*e*M/16384-453*s*M/32768)*C+(1097*e*d/65536+42783*e*M/1048576)*a+8011*e*M/1048576*Math.cos(10*e)+(3*u/8+3*o/16+213*r/2048-3*n*r/64+255*l/4096-33*n*l/512+20861*d/524288-33*n*d/512+h*d/1024+28273*M/1048576-471*n*M/8192+9*h*M/4096)*c+(21*o/256+21*r/256+533*l/8192-21*n*l/512+197*d/4096-315*n*d/4096+584039*M/16777216-12517*n*M/131072+7*h*M/2048)*m+(151*r/6144+151*l/4096+5019*d/131072-453*n*d/16384+26965*M/786432-8607*n*M/131072)*p+(1097*l/131072+1097*d/65536+225797*M/10485760-1097*n*M/65536)*t+(8011*d/2621440+8011*M/1048576)*i+293393*M/251658240*Math.sin(12*e)}(l(n,e,t.latitude)+a*Math.cos(i),n,e),o=d(n,t.latitude),u=d(n,h),o=Math.tan(i)*(u-o),g.CesiumMath.negativePiToPi(t.longitude+o)):(h=t.latitude,o=a/(0===n?e*Math.cos(t.latitude):(n=Math.sin(t.latitude),e*Math.cos(t.latitude)/Math.sqrt(1-r*n*n))),0<i?g.CesiumMath.negativePiToPi(t.longitude+o):g.CesiumMath.negativePiToPi(t.longitude-o)),c.defined(s)?(s.longitude=o,s.latitude=h,s.height=0,s):new M.Cartographic(o,h,0)}function _(t,i,a){a=c.defaultValue(a,M.Ellipsoid.WGS84);this._ellipsoid=a,this._start=new M.Cartographic,this._end=new M.Cartographic,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,c.defined(t)&&c.defined(i)&&e(this,t,i,a)}Object.defineProperties(_.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}}}),_.fromStartHeadingDistance=function(t,i,a,e,n){var s=c.defaultValue(e,M.Ellipsoid.WGS84),h=s.maximumRadius,u=s.minimumRadius,h=h*h,h=Math.sqrt((h-u*u)/h),h=o(t,i=g.CesiumMath.negativePiToPi(i),a,s.maximumRadius,h);return!c.defined(n)||c.defined(e)&&!e.equals(n.ellipsoid)?new _(t,h,s):(n.setEndPoints(t,h),n)},_.prototype.setEndPoints=function(t,i){e(this,t,i,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(t,i){return this.interpolateUsingSurfaceDistance(t*this._distance,i)},_.prototype.interpolateUsingSurfaceDistance=function(t,i){return o(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)},_.prototype.findIntersectionWithLongitude=function(t,i){var a=this._ellipticity,e=this._heading,n=Math.abs(e),s=this._start;if(t=g.CesiumMath.negativePiToPi(t),g.CesiumMath.equalsEpsilon(Math.abs(t),Math.PI,g.CesiumMath.EPSILON14)&&(t=g.CesiumMath.sign(s.longitude)*Math.PI),c.defined(i)||(i=new M.Cartographic),Math.abs(g.CesiumMath.PI_OVER_TWO-n)<=g.CesiumMath.EPSILON8)return i.longitude=t,i.latitude=s.latitude,i.height=0,i;if(g.CesiumMath.equalsEpsilon(Math.abs(g.CesiumMath.PI_OVER_TWO-n),g.CesiumMath.PI_OVER_TWO,g.CesiumMath.EPSILON8))return g.CesiumMath.equalsEpsilon(t,s.longitude,g.CesiumMath.EPSILON12)?void 0:(i.longitude=t,i.latitude=g.CesiumMath.PI_OVER_TWO*g.CesiumMath.sign(g.CesiumMath.PI_OVER_TWO-e),i.height=0,i);var h=s.latitude,n=a*Math.sin(h),u=Math.tan(.5*(g.CesiumMath.PI_OVER_TWO+h))*Math.exp((t-s.longitude)/Math.tan(e)),o=(1+n)/(1-n),r=s.latitude;do{var l=r,d=a*Math.sin(l),r=2*Math.atan(u*Math.pow((1+d)/(1-d)/o,a/2))-g.CesiumMath.PI_OVER_TWO}while(!g.CesiumMath.equalsEpsilon(r,l,g.CesiumMath.EPSILON12));return i.longitude=t,i.latitude=r,i.height=0,i},_.prototype.findIntersectionWithLatitude=function(t,i){var a=this._ellipticity,e=this._heading,n=this._start;if(!g.CesiumMath.equalsEpsilon(Math.abs(e),g.CesiumMath.PI_OVER_TWO,g.CesiumMath.EPSILON8)){var s=d(a,n.latitude),a=d(a,t),s=Math.tan(e)*(a-s),s=g.CesiumMath.negativePiToPi(n.longitude+s);return c.defined(i)?(i.longitude=s,i.latitude=t,i.height=0,i):new M.Cartographic(s,t,0)}},t.EllipsoidRhumbLine=_}); diff --git a/public/Cesium/Workers/EllipsoidRhumbLine-8cb2e5a4.js b/public/Cesium/Workers/EllipsoidRhumbLine-8cb2e5a4.js deleted file mode 100644 index 8a5438d..0000000 --- a/public/Cesium/Workers/EllipsoidRhumbLine-8cb2e5a4.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694"],function(t,M,i,c,m){"use strict";function d(t,i,a){if(0===t)return i*a;var e=t*t,n=e*e,s=n*e,h=s*e,u=h*e,t=u*e,a=a;return i*((1-e/4-3*n/64-5*s/256-175*h/16384-441*u/65536-4851*t/1048576)*a-(3*e/8+3*n/32+45*s/1024+105*h/4096+2205*u/131072+6237*t/524288)*Math.sin(2*a)+(15*n/256+45*s/1024+525*h/16384+1575*u/65536+155925*t/8388608)*Math.sin(4*a)-(35*s/3072+175*h/12288+3675*u/262144+13475*t/1048576)*Math.sin(6*a)+(315*h/131072+2205*u/524288+43659*t/8388608)*Math.sin(8*a)-(693*u/1310720+6237*t/5242880)*Math.sin(10*a)+1001*t/8388608*Math.sin(12*a))}function l(t,i){if(0===t)return Math.log(Math.tan(.5*(m.CesiumMath.PI_OVER_TWO+i)));var a=t*Math.sin(i);return Math.log(Math.tan(.5*(m.CesiumMath.PI_OVER_TWO+i)))-t/2*Math.log((1+a)/(1-a))}var r=new M.Cartesian3,_=new M.Cartesian3;function e(t,i,a,e){M.Cartesian3.normalize(e.cartographicToCartesian(i,_),r),M.Cartesian3.normalize(e.cartographicToCartesian(a,_),_);var n,s=e.maximumRadius,h=e.minimumRadius,u=s*s,o=h*h;t._ellipticitySquared=(u-o)/u,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=M.Cartographic.clone(i,t._start),t._start.height=0,t._end=M.Cartographic.clone(a,t._end),t._end.height=0,t._heading=(n=t,s=i.longitude,h=i.latitude,o=a.longitude,u=a.latitude,h=l(n._ellipticity,h),u=l(n._ellipticity,u),Math.atan2(m.CesiumMath.negativePiToPi(o-s),u-h)),t._distance=(o=t,s=e.maximumRadius,u=e.minimumRadius,h=i.longitude,t=i.latitude,e=a.longitude,i=a.latitude,a=o._heading,e-=h,h=0,h=m.CesiumMath.equalsEpsilon(Math.abs(a),m.CesiumMath.PI_OVER_TWO,m.CesiumMath.EPSILON8)?s===u?s*Math.cos(t)*m.CesiumMath.negativePiToPi(e):(u=Math.sin(t),s*Math.cos(t)*m.CesiumMath.negativePiToPi(e)/Math.sqrt(1-o._ellipticitySquared*u*u)):(t=d(o._ellipticity,s,t),(d(o._ellipticity,s,i)-t)/Math.cos(a)),Math.abs(h))}function o(t,i,a,e,n,s){var h,u,o,r=n*n;return o=Math.abs(m.CesiumMath.PI_OVER_TWO-Math.abs(i))>m.CesiumMath.EPSILON8?(h=function(t,i,a){var e=t/a;if(0===i)return e;var n=e*e,s=n*e,h=s*e,u=i*i,o=u*u,r=o*u,d=r*u,l=d*u,M=l*u,c=Math.sin(2*e),m=Math.cos(2*e),_=Math.sin(4*e),g=Math.cos(4*e),p=Math.sin(6*e),C=Math.cos(6*e),t=Math.sin(8*e),a=Math.cos(8*e),i=Math.sin(10*e);return e+e*u/4+7*e*o/64+15*e*r/256+579*e*d/16384+1515*e*l/65536+16837*e*M/1048576+(3*e*o/16+45*e*r/256-e*(32*n-561)*d/4096-e*(232*n-1677)*l/16384+e*(399985-90560*n+512*h)*M/5242880)*m+(21*e*r/256+483*e*d/4096-e*(224*n-1969)*l/16384-e*(33152*n-112599)*M/1048576)*g+(151*e*d/4096+4681*e*l/65536+1479*e*M/16384-453*s*M/32768)*C+(1097*e*l/65536+42783*e*M/1048576)*a+8011*e*M/1048576*Math.cos(10*e)+(3*u/8+3*o/16+213*r/2048-3*n*r/64+255*d/4096-33*n*d/512+20861*l/524288-33*n*l/512+h*l/1024+28273*M/1048576-471*n*M/8192+9*h*M/4096)*c+(21*o/256+21*r/256+533*d/8192-21*n*d/512+197*l/4096-315*n*l/4096+584039*M/16777216-12517*n*M/131072+7*h*M/2048)*_+(151*r/6144+151*d/4096+5019*l/131072-453*n*l/16384+26965*M/786432-8607*n*M/131072)*p+(1097*d/131072+1097*l/65536+225797*M/10485760-1097*n*M/65536)*t+(8011*l/2621440+8011*M/1048576)*i+293393*M/251658240*Math.sin(12*e)}(d(n,e,t.latitude)+a*Math.cos(i),n,e),o=l(n,t.latitude),u=l(n,h),o=Math.tan(i)*(u-o),m.CesiumMath.negativePiToPi(t.longitude+o)):(h=t.latitude,o=a/(0===n?e*Math.cos(t.latitude):(n=Math.sin(t.latitude),e*Math.cos(t.latitude)/Math.sqrt(1-r*n*n))),0<i?m.CesiumMath.negativePiToPi(t.longitude+o):m.CesiumMath.negativePiToPi(t.longitude-o)),c.defined(s)?(s.longitude=o,s.latitude=h,s.height=0,s):new M.Cartographic(o,h,0)}function g(t,i,a){a=c.defaultValue(a,M.Ellipsoid.WGS84);this._ellipsoid=a,this._start=new M.Cartographic,this._end=new M.Cartographic,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,c.defined(t)&&c.defined(i)&&e(this,t,i,a)}Object.defineProperties(g.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}}}),g.fromStartHeadingDistance=function(t,i,a,e,n){var s=c.defaultValue(e,M.Ellipsoid.WGS84),h=s.maximumRadius,u=s.minimumRadius,h=h*h,u=u*u,h=Math.sqrt((h-u)/h),h=o(t,i=m.CesiumMath.negativePiToPi(i),a,s.maximumRadius,h);return!c.defined(n)||c.defined(e)&&!e.equals(n.ellipsoid)?new g(t,h,s):(n.setEndPoints(t,h),n)},g.prototype.setEndPoints=function(t,i){e(this,t,i,this._ellipsoid)},g.prototype.interpolateUsingFraction=function(t,i){return this.interpolateUsingSurfaceDistance(t*this._distance,i)},g.prototype.interpolateUsingSurfaceDistance=function(t,i){return o(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)},g.prototype.findIntersectionWithLongitude=function(t,i){var a=this._ellipticity,e=this._heading,n=Math.abs(e),s=this._start;if(t=m.CesiumMath.negativePiToPi(t),m.CesiumMath.equalsEpsilon(Math.abs(t),Math.PI,m.CesiumMath.EPSILON14)&&(t=m.CesiumMath.sign(s.longitude)*Math.PI),c.defined(i)||(i=new M.Cartographic),Math.abs(m.CesiumMath.PI_OVER_TWO-n)<=m.CesiumMath.EPSILON8)return i.longitude=t,i.latitude=s.latitude,i.height=0,i;if(m.CesiumMath.equalsEpsilon(Math.abs(m.CesiumMath.PI_OVER_TWO-n),m.CesiumMath.PI_OVER_TWO,m.CesiumMath.EPSILON8))return m.CesiumMath.equalsEpsilon(t,s.longitude,m.CesiumMath.EPSILON12)?void 0:(i.longitude=t,i.latitude=m.CesiumMath.PI_OVER_TWO*m.CesiumMath.sign(m.CesiumMath.PI_OVER_TWO-e),i.height=0,i);var h=s.latitude,n=a*Math.sin(h),u=Math.tan(.5*(m.CesiumMath.PI_OVER_TWO+h))*Math.exp((t-s.longitude)/Math.tan(e)),o=(1+n)/(1-n),r=s.latitude;do{var d=r,l=a*Math.sin(d),l=(1+l)/(1-l),r=2*Math.atan(u*Math.pow(l/o,a/2))-m.CesiumMath.PI_OVER_TWO}while(!m.CesiumMath.equalsEpsilon(r,d,m.CesiumMath.EPSILON12));return i.longitude=t,i.latitude=r,i.height=0,i},g.prototype.findIntersectionWithLatitude=function(t,i){var a=this._ellipticity,e=this._heading,n=this._start;if(!m.CesiumMath.equalsEpsilon(Math.abs(e),m.CesiumMath.PI_OVER_TWO,m.CesiumMath.EPSILON8)){var s=l(a,n.latitude),a=l(a,t),s=Math.tan(e)*(a-s),s=m.CesiumMath.negativePiToPi(n.longitude+s);return c.defined(i)?(i.longitude=s,i.latitude=t,i.height=0,i):new M.Cartographic(s,t,0)}},t.EllipsoidRhumbLine=g}); diff --git a/public/Cesium/Workers/EllipsoidTangentPlane-9123a53b.js b/public/Cesium/Workers/EllipsoidTangentPlane-325a8e68.js similarity index 95% rename from public/Cesium/Workers/EllipsoidTangentPlane-9123a53b.js rename to public/Cesium/Workers/EllipsoidTangentPlane-325a8e68.js index c9a019a..4ead61e 100644 --- a/public/Cesium/Workers/EllipsoidTangentPlane-9123a53b.js +++ b/public/Cesium/Workers/EllipsoidTangentPlane-325a8e68.js @@ -1 +1 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Transforms-a73b3b3b","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(e,C,n,p,a,i,r){"use strict";function x(e,n,t){this.minimum=C.Cartesian3.clone(p.defaultValue(e,C.Cartesian3.ZERO)),this.maximum=C.Cartesian3.clone(p.defaultValue(n,C.Cartesian3.ZERO)),t=p.defined(t)?C.Cartesian3.clone(t):C.Cartesian3.midpoint(this.minimum,this.maximum,new C.Cartesian3),this.center=t}x.fromPoints=function(e,n){if(p.defined(n)||(n=new x),!p.defined(e)||0===e.length)return n.minimum=C.Cartesian3.clone(C.Cartesian3.ZERO,n.minimum),n.maximum=C.Cartesian3.clone(C.Cartesian3.ZERO,n.maximum),n.center=C.Cartesian3.clone(C.Cartesian3.ZERO,n.center),n;for(var t=e[0].x,i=e[0].y,a=e[0].z,r=e[0].x,s=e[0].y,o=e[0].z,m=e.length,l=1;l<m;l++)var c=e[l],u=c.x,d=c.y,c=c.z,t=Math.min(u,t),r=Math.max(u,r),i=Math.min(d,i),s=Math.max(d,s),a=Math.min(c,a),o=Math.max(c,o);var f=n.minimum;f.x=t,f.y=i,f.z=a;var h=n.maximum;return h.x=r,h.y=s,h.z=o,n.center=C.Cartesian3.midpoint(f,h,n.center),n},x.clone=function(e,n){if(p.defined(e))return p.defined(n)?(n.minimum=C.Cartesian3.clone(e.minimum,n.minimum),n.maximum=C.Cartesian3.clone(e.maximum,n.maximum),n.center=C.Cartesian3.clone(e.center,n.center),n):new x(e.minimum,e.maximum,e.center)},x.equals=function(e,n){return e===n||p.defined(e)&&p.defined(n)&&C.Cartesian3.equals(e.center,n.center)&&C.Cartesian3.equals(e.minimum,n.minimum)&&C.Cartesian3.equals(e.maximum,n.maximum)};var s=new C.Cartesian3;x.intersectPlane=function(e,n){s=C.Cartesian3.subtract(e.maximum,e.minimum,s);var t=C.Cartesian3.multiplyByScalar(s,.5,s),i=n.normal,t=t.x*Math.abs(i.x)+t.y*Math.abs(i.y)+t.z*Math.abs(i.z),n=C.Cartesian3.dot(e.center,i)+n.distance;return 0<n-t?a.Intersect.INSIDE:n+t<0?a.Intersect.OUTSIDE:a.Intersect.INTERSECTING},x.prototype.clone=function(e){return x.clone(this,e)},x.prototype.intersectPlane=function(e){return x.intersectPlane(this,e)},x.prototype.equals=function(e){return x.equals(this,e)};var o=new a.Cartesian4;function t(e,n){e=(n=p.defaultValue(n,C.Ellipsoid.WGS84)).scaleToGeodeticSurface(e);var t=a.Transforms.eastNorthUpToFixedFrame(e,n);this._ellipsoid=n,this._origin=e,this._xAxis=C.Cartesian3.fromCartesian4(a.Matrix4.getColumn(t,0,o)),this._yAxis=C.Cartesian3.fromCartesian4(a.Matrix4.getColumn(t,1,o));t=C.Cartesian3.fromCartesian4(a.Matrix4.getColumn(t,2,o));this._plane=r.Plane.fromPointNormal(e,t)}Object.defineProperties(t.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 m=new x;t.fromPoints=function(e,n){return new t(x.fromPoints(e,m).center,n)};var l=new i.Ray,c=new C.Cartesian3;t.prototype.projectPointOntoPlane=function(e,n){var t=l;t.origin=e,C.Cartesian3.normalize(e,t.direction);e=i.IntersectionTests.rayPlane(t,this._plane,c);if(p.defined(e)||(C.Cartesian3.negate(t.direction,t.direction),e=i.IntersectionTests.rayPlane(t,this._plane,c)),p.defined(e)){t=C.Cartesian3.subtract(e,this._origin,e),e=C.Cartesian3.dot(this._xAxis,t),t=C.Cartesian3.dot(this._yAxis,t);return p.defined(n)?(n.x=e,n.y=t,n):new C.Cartesian2(e,t)}},t.prototype.projectPointsOntoPlane=function(e,n){p.defined(n)||(n=[]);for(var t=0,i=e.length,a=0;a<i;a++){var r=this.projectPointOntoPlane(e[a],n[t]);p.defined(r)&&(n[t]=r,t++)}return n.length=t,n},t.prototype.projectPointToNearestOnPlane=function(e,n){p.defined(n)||(n=new C.Cartesian2);var t=l;t.origin=e,C.Cartesian3.clone(this._plane.normal,t.direction);e=i.IntersectionTests.rayPlane(t,this._plane,c);p.defined(e)||(C.Cartesian3.negate(t.direction,t.direction),e=i.IntersectionTests.rayPlane(t,this._plane,c));t=C.Cartesian3.subtract(e,this._origin,e),e=C.Cartesian3.dot(this._xAxis,t),t=C.Cartesian3.dot(this._yAxis,t);return n.x=e,n.y=t,n},t.prototype.projectPointsToNearestOnPlane=function(e,n){p.defined(n)||(n=[]);var t=e.length;n.length=t;for(var i=0;i<t;i++)n[i]=this.projectPointToNearestOnPlane(e[i],n[i]);return n};var u=new C.Cartesian3;t.prototype.projectPointOntoEllipsoid=function(e,n){p.defined(n)||(n=new C.Cartesian3);var t=this._ellipsoid,i=this._origin,a=this._xAxis,r=this._yAxis,s=u;return C.Cartesian3.multiplyByScalar(a,e.x,s),n=C.Cartesian3.add(i,s,n),C.Cartesian3.multiplyByScalar(r,e.y,s),C.Cartesian3.add(n,s,n),t.scaleToGeocentricSurface(n,n),n},t.prototype.projectPointsOntoEllipsoid=function(e,n){var t=e.length;p.defined(n)?n.length=t:n=new Array(t);for(var i=0;i<t;++i)n[i]=this.projectPointOntoEllipsoid(e[i],n[i]);return n},e.AxisAlignedBoundingBox=x,e.EllipsoidTangentPlane=t}); +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Transforms-79117a7b","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(e,C,n,p,a,i,r){"use strict";function x(e,n,t){this.minimum=C.Cartesian3.clone(p.defaultValue(e,C.Cartesian3.ZERO)),this.maximum=C.Cartesian3.clone(p.defaultValue(n,C.Cartesian3.ZERO)),t=p.defined(t)?C.Cartesian3.clone(t):C.Cartesian3.midpoint(this.minimum,this.maximum,new C.Cartesian3),this.center=t}x.fromPoints=function(e,n){if(p.defined(n)||(n=new x),!p.defined(e)||0===e.length)return n.minimum=C.Cartesian3.clone(C.Cartesian3.ZERO,n.minimum),n.maximum=C.Cartesian3.clone(C.Cartesian3.ZERO,n.maximum),n.center=C.Cartesian3.clone(C.Cartesian3.ZERO,n.center),n;for(var t=e[0].x,i=e[0].y,a=e[0].z,r=e[0].x,s=e[0].y,o=e[0].z,m=e.length,l=1;l<m;l++)var c=e[l],u=c.x,d=c.y,c=c.z,t=Math.min(u,t),r=Math.max(u,r),i=Math.min(d,i),s=Math.max(d,s),a=Math.min(c,a),o=Math.max(c,o);var f=n.minimum;f.x=t,f.y=i,f.z=a;var h=n.maximum;return h.x=r,h.y=s,h.z=o,n.center=C.Cartesian3.midpoint(f,h,n.center),n},x.clone=function(e,n){if(p.defined(e))return p.defined(n)?(n.minimum=C.Cartesian3.clone(e.minimum,n.minimum),n.maximum=C.Cartesian3.clone(e.maximum,n.maximum),n.center=C.Cartesian3.clone(e.center,n.center),n):new x(e.minimum,e.maximum,e.center)},x.equals=function(e,n){return e===n||p.defined(e)&&p.defined(n)&&C.Cartesian3.equals(e.center,n.center)&&C.Cartesian3.equals(e.minimum,n.minimum)&&C.Cartesian3.equals(e.maximum,n.maximum)};var s=new C.Cartesian3;x.intersectPlane=function(e,n){s=C.Cartesian3.subtract(e.maximum,e.minimum,s);var t=C.Cartesian3.multiplyByScalar(s,.5,s),i=n.normal,t=t.x*Math.abs(i.x)+t.y*Math.abs(i.y)+t.z*Math.abs(i.z),n=C.Cartesian3.dot(e.center,i)+n.distance;return 0<n-t?a.Intersect.INSIDE:n+t<0?a.Intersect.OUTSIDE:a.Intersect.INTERSECTING},x.prototype.clone=function(e){return x.clone(this,e)},x.prototype.intersectPlane=function(e){return x.intersectPlane(this,e)},x.prototype.equals=function(e){return x.equals(this,e)};var o=new a.Cartesian4;function t(e,n){e=(n=p.defaultValue(n,C.Ellipsoid.WGS84)).scaleToGeodeticSurface(e);var t=a.Transforms.eastNorthUpToFixedFrame(e,n);this._ellipsoid=n,this._origin=e,this._xAxis=C.Cartesian3.fromCartesian4(a.Matrix4.getColumn(t,0,o)),this._yAxis=C.Cartesian3.fromCartesian4(a.Matrix4.getColumn(t,1,o));t=C.Cartesian3.fromCartesian4(a.Matrix4.getColumn(t,2,o));this._plane=r.Plane.fromPointNormal(e,t)}Object.defineProperties(t.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 m=new x;t.fromPoints=function(e,n){return new t(x.fromPoints(e,m).center,n)};var l=new i.Ray,c=new C.Cartesian3;t.prototype.projectPointOntoPlane=function(e,n){var t=l;t.origin=e,C.Cartesian3.normalize(e,t.direction);e=i.IntersectionTests.rayPlane(t,this._plane,c);if(p.defined(e)||(C.Cartesian3.negate(t.direction,t.direction),e=i.IntersectionTests.rayPlane(t,this._plane,c)),p.defined(e)){t=C.Cartesian3.subtract(e,this._origin,e),e=C.Cartesian3.dot(this._xAxis,t),t=C.Cartesian3.dot(this._yAxis,t);return p.defined(n)?(n.x=e,n.y=t,n):new C.Cartesian2(e,t)}},t.prototype.projectPointsOntoPlane=function(e,n){p.defined(n)||(n=[]);for(var t=0,i=e.length,a=0;a<i;a++){var r=this.projectPointOntoPlane(e[a],n[t]);p.defined(r)&&(n[t]=r,t++)}return n.length=t,n},t.prototype.projectPointToNearestOnPlane=function(e,n){p.defined(n)||(n=new C.Cartesian2);var t=l;t.origin=e,C.Cartesian3.clone(this._plane.normal,t.direction);e=i.IntersectionTests.rayPlane(t,this._plane,c);p.defined(e)||(C.Cartesian3.negate(t.direction,t.direction),e=i.IntersectionTests.rayPlane(t,this._plane,c));t=C.Cartesian3.subtract(e,this._origin,e),e=C.Cartesian3.dot(this._xAxis,t),t=C.Cartesian3.dot(this._yAxis,t);return n.x=e,n.y=t,n},t.prototype.projectPointsToNearestOnPlane=function(e,n){p.defined(n)||(n=[]);var t=e.length;n.length=t;for(var i=0;i<t;i++)n[i]=this.projectPointToNearestOnPlane(e[i],n[i]);return n};var u=new C.Cartesian3;t.prototype.projectPointOntoEllipsoid=function(e,n){p.defined(n)||(n=new C.Cartesian3);var t=this._ellipsoid,i=this._origin,a=this._xAxis,r=this._yAxis,s=u;return C.Cartesian3.multiplyByScalar(a,e.x,s),n=C.Cartesian3.add(i,s,n),C.Cartesian3.multiplyByScalar(r,e.y,s),C.Cartesian3.add(n,s,n),t.scaleToGeocentricSurface(n,n),n},t.prototype.projectPointsOntoEllipsoid=function(e,n){var t=e.length;p.defined(n)?n.length=t:n=new Array(t);for(var i=0;i<t;++i)n[i]=this.projectPointOntoEllipsoid(e[i],n[i]);return n},e.AxisAlignedBoundingBox=x,e.EllipsoidTangentPlane=t}); diff --git a/public/Cesium/Workers/EncodedCartesian3-874933de.js b/public/Cesium/Workers/EncodedCartesian3-bf827957.js similarity index 83% rename from public/Cesium/Workers/EncodedCartesian3-874933de.js rename to public/Cesium/Workers/EncodedCartesian3-bf827957.js index f533fc4..a4ae02b 100644 --- a/public/Cesium/Workers/EncodedCartesian3-874933de.js +++ b/public/Cesium/Workers/EncodedCartesian3-bf827957.js @@ -1 +1 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0"],function(e,n,i,h){"use strict";function a(){this.high=n.Cartesian3.clone(n.Cartesian3.ZERO),this.low=n.Cartesian3.clone(n.Cartesian3.ZERO)}a.encode=function(e,n){var i;return h.defined(n)||(n={high:0,low:0}),0<=e?(i=65536*Math.floor(e/65536),n.high=i,n.low=e-i):(i=65536*Math.floor(-e/65536),n.high=-i,n.low=e+i),n};var r={high:0,low:0};a.fromCartesian=function(e,n){var i=(n=!h.defined(n)?new a:n).high,o=n.low;return a.encode(e.x,r),i.x=r.high,o.x=r.low,a.encode(e.y,r),i.y=r.high,o.y=r.low,a.encode(e.z,r),i.z=r.high,o.z=r.low,n};var t=new a;a.writeElements=function(e,n,i){a.fromCartesian(e,t);var o=t.high,e=t.low;n[i]=o.x,n[i+1]=o.y,n[i+2]=o.z,n[i+3]=e.x,n[i+4]=e.y,n[i+5]=e.z},e.EncodedCartesian3=a}); +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57"],function(e,n,i,h){"use strict";function a(){this.high=n.Cartesian3.clone(n.Cartesian3.ZERO),this.low=n.Cartesian3.clone(n.Cartesian3.ZERO)}a.encode=function(e,n){var i;return h.defined(n)||(n={high:0,low:0}),0<=e?(i=65536*Math.floor(e/65536),n.high=i,n.low=e-i):(i=65536*Math.floor(-e/65536),n.high=-i,n.low=e+i),n};var r={high:0,low:0};a.fromCartesian=function(e,n){var i=(n=!h.defined(n)?new a:n).high,o=n.low;return a.encode(e.x,r),i.x=r.high,o.x=r.low,a.encode(e.y,r),i.y=r.high,o.y=r.low,a.encode(e.z,r),i.z=r.high,o.z=r.low,n};var t=new a;a.writeElements=function(e,n,i){a.fromCartesian(e,t);var o=t.high,e=t.low;n[i]=o.x,n[i+1]=o.y,n[i+2]=o.z,n[i+3]=e.x,n[i+4]=e.y,n[i+5]=e.z},e.EncodedCartesian3=a}); diff --git a/public/Cesium/Workers/FrustumGeometry-00e2e34e.js b/public/Cesium/Workers/FrustumGeometry-00e2e34e.js deleted file mode 100644 index 3de89f2..0000000 --- a/public/Cesium/Workers/FrustumGeometry-00e2e34e.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./when-208fe5b0","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./Math-4e53b694","./Plane-4aa8974d","./VertexFormat-e8cbf5b3"],function(t,v,g,e,w,x,b,M,i,f,u){"use strict";function h(t){this.planes=x.defaultValue(t,[])}var p=[new g.Cartesian3,new g.Cartesian3,new g.Cartesian3];g.Cartesian3.clone(g.Cartesian3.UNIT_X,p[0]),g.Cartesian3.clone(g.Cartesian3.UNIT_Y,p[1]),g.Cartesian3.clone(g.Cartesian3.UNIT_Z,p[2]);var d=new g.Cartesian3,c=new g.Cartesian3,l=new f.Plane(new g.Cartesian3(1,0,0),0);function r(t){t=x.defaultValue(t,x.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=x.defaultValue(t.near,1),this._near=this.near,this.far=x.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._orthographicMatrix=new v.Matrix4}function n(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=v.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}h.fromBoundingSphere=function(t,e){x.defined(e)||(e=new h);var a=p.length,i=e.planes;i.length=2*a;for(var r=t.center,n=t.radius,o=0,s=0;s<a;++s){var f=p[s],u=i[o],l=i[o+1];x.defined(u)||(u=i[o]=new v.Cartesian4),x.defined(l)||(l=i[o+1]=new v.Cartesian4),g.Cartesian3.multiplyByScalar(f,-n,d),g.Cartesian3.add(r,d,d),u.x=f.x,u.y=f.y,u.z=f.z,u.w=-g.Cartesian3.dot(f,d),g.Cartesian3.multiplyByScalar(f,n,d),g.Cartesian3.add(r,d,d),l.x=-f.x,l.y=-f.y,l.z=-f.z,l.w=-g.Cartesian3.dot(g.Cartesian3.negate(f,c),d),o+=2}return e},h.prototype.computeVisibility=function(t){for(var e=this.planes,a=!1,i=0,r=e.length;i<r;++i){var n=t.intersectPlane(f.Plane.fromCartesian4(e[i],l));if(n===v.Intersect.OUTSIDE)return v.Intersect.OUTSIDE;n===v.Intersect.INTERSECTING&&(a=!0)}return a?v.Intersect.INTERSECTING:v.Intersect.INSIDE},h.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===h.MASK_OUTSIDE||e===h.MASK_INSIDE)return e;for(var a=h.MASK_INSIDE,i=this.planes,r=0,n=i.length;r<n;++r){var o=r<31?1<<r:0;if(!(r<31&&0==(e&o))){var s=t.intersectPlane(f.Plane.fromCartesian4(i[r],l));if(s===v.Intersect.OUTSIDE)return h.MASK_OUTSIDE;s===v.Intersect.INTERSECTING&&(a|=o)}}return a},h.MASK_OUTSIDE=4294967295,h.MASK_INSIDE=0,h.MASK_INDETERMINATE=2147483647,Object.defineProperties(r.prototype,{projectionMatrix:{get:function(){return n(this),this._orthographicMatrix}}});var m=new g.Cartesian3,C=new g.Cartesian3,_=new g.Cartesian3,y=new g.Cartesian3;function F(t){t=x.defaultValue(t,x.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new r,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=x.defaultValue(t.near,1),this._near=this.near,this.far=x.defaultValue(t.far,5e8),this._far=this.far}function o(t){var e,a=t._offCenterFrustum;t.width===t._width&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far||(t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far,e=1/t.aspectRatio,a.right=.5*t.width,a.left=-a.right,a.top=e*a.right,a.bottom=-a.top,a.near=t.near,a.far=t.far)}function s(t){t=x.defaultValue(t,x.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=x.defaultValue(t.near,1),this._near=this.near,this.far=x.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._perspectiveMatrix=new v.Matrix4,this._infinitePerspective=new v.Matrix4}function V(t){var e=t.top,a=t.bottom,i=t.right,r=t.left,n=t.near,o=t.far;e===t._top&&a===t._bottom&&r===t._left&&i===t._right&&n===t._near&&o===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=a,t._near=n,t._far=o,t._perspectiveMatrix=v.Matrix4.computePerspectiveOffCenter(r,i,a,e,n,o,t._perspectiveMatrix),t._infinitePerspective=v.Matrix4.computeInfinitePerspectiveOffCenter(r,i,a,e,n,t._infinitePerspective))}r.prototype.computeCullingVolume=function(t,e,a){var i=this._cullingVolume.planes,r=this.top,n=this.bottom,o=this.right,s=this.left,f=this.near,u=this.far,l=g.Cartesian3.cross(e,a,m);g.Cartesian3.normalize(l,l);var h=C;g.Cartesian3.multiplyByScalar(e,f,h),g.Cartesian3.add(t,h,h);f=_;g.Cartesian3.multiplyByScalar(l,s,f),g.Cartesian3.add(h,f,f);s=i[0];return(s=!x.defined(s)?i[0]=new v.Cartesian4:s).x=l.x,s.y=l.y,s.z=l.z,s.w=-g.Cartesian3.dot(l,f),g.Cartesian3.multiplyByScalar(l,o,f),g.Cartesian3.add(h,f,f),s=i[1],(s=!x.defined(s)?i[1]=new v.Cartesian4:s).x=-l.x,s.y=-l.y,s.z=-l.z,s.w=-g.Cartesian3.dot(g.Cartesian3.negate(l,y),f),g.Cartesian3.multiplyByScalar(a,n,f),g.Cartesian3.add(h,f,f),s=i[2],(s=!x.defined(s)?i[2]=new v.Cartesian4:s).x=a.x,s.y=a.y,s.z=a.z,s.w=-g.Cartesian3.dot(a,f),g.Cartesian3.multiplyByScalar(a,r,f),g.Cartesian3.add(h,f,f),s=i[3],(s=!x.defined(s)?i[3]=new v.Cartesian4:s).x=-a.x,s.y=-a.y,s.z=-a.z,s.w=-g.Cartesian3.dot(g.Cartesian3.negate(a,y),f),s=i[4],(s=!x.defined(s)?i[4]=new v.Cartesian4:s).x=e.x,s.y=e.y,s.z=e.z,s.w=-g.Cartesian3.dot(e,h),g.Cartesian3.multiplyByScalar(e,u,f),g.Cartesian3.add(t,f,f),s=i[5],(s=!x.defined(s)?i[5]=new v.Cartesian4:s).x=-e.x,s.y=-e.y,s.z=-e.z,s.w=-g.Cartesian3.dot(g.Cartesian3.negate(e,y),f),this._cullingVolume},r.prototype.getPixelDimensions=function(t,e,a,i,r){n(this);t=i*(this.right-this.left)/t,e=i*(this.top-this.bottom)/e;return r.x=t,r.y=e,r},r.prototype.clone=function(t){return(t=!x.defined(t)?new r:t).left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},r.prototype.equals=function(t){return x.defined(t)&&t instanceof r&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},r.prototype.equalsEpsilon=function(t,e,a){return t===this||x.defined(t)&&t instanceof r&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},F.packedLength=4,F.pack=function(t,e,a){return a=x.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},F.unpack=function(t,e,a){return e=x.defaultValue(e,0),(a=!x.defined(a)?new F:a).width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(F.prototype,{projectionMatrix:{get:function(){return o(this),this._offCenterFrustum.projectionMatrix}}}),F.prototype.computeCullingVolume=function(t,e,a){return o(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},F.prototype.getPixelDimensions=function(t,e,a,i,r){return o(this),this._offCenterFrustum.getPixelDimensions(t,e,a,i,r)},F.prototype.clone=function(t){return(t=!x.defined(t)?new F:t).aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},F.prototype.equals=function(t){return!!(x.defined(t)&&t instanceof F)&&(o(this),o(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},F.prototype.equalsEpsilon=function(t,e,a){return!!(x.defined(t)&&t instanceof F)&&(o(this),o(t),i.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(s.prototype,{projectionMatrix:{get:function(){return V(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return V(this),this._infinitePerspective}}});var E=new g.Cartesian3,O=new g.Cartesian3,P=new g.Cartesian3,z=new g.Cartesian3;function R(t){t=x.defaultValue(t,x.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new s,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=x.defaultValue(t.near,1),this._near=this.near,this.far=x.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=x.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=x.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function S(t){var e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}s.prototype.computeCullingVolume=function(t,e,a){var i=this._cullingVolume.planes,r=this.top,n=this.bottom,o=this.right,s=this.left,f=this.near,u=this.far,l=g.Cartesian3.cross(e,a,E),h=O;g.Cartesian3.multiplyByScalar(e,f,h),g.Cartesian3.add(t,h,h);f=P;g.Cartesian3.multiplyByScalar(e,u,f),g.Cartesian3.add(t,f,f);u=z;g.Cartesian3.multiplyByScalar(l,s,u),g.Cartesian3.add(h,u,u),g.Cartesian3.subtract(u,t,u),g.Cartesian3.normalize(u,u),g.Cartesian3.cross(u,a,u),g.Cartesian3.normalize(u,u);s=i[0];return(s=!x.defined(s)?i[0]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,t),g.Cartesian3.multiplyByScalar(l,o,u),g.Cartesian3.add(h,u,u),g.Cartesian3.subtract(u,t,u),g.Cartesian3.cross(a,u,u),g.Cartesian3.normalize(u,u),s=i[1],(s=!x.defined(s)?i[1]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,t),g.Cartesian3.multiplyByScalar(a,n,u),g.Cartesian3.add(h,u,u),g.Cartesian3.subtract(u,t,u),g.Cartesian3.cross(l,u,u),g.Cartesian3.normalize(u,u),s=i[2],(s=!x.defined(s)?i[2]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,t),g.Cartesian3.multiplyByScalar(a,r,u),g.Cartesian3.add(h,u,u),g.Cartesian3.subtract(u,t,u),g.Cartesian3.cross(u,l,u),g.Cartesian3.normalize(u,u),s=i[3],(s=!x.defined(s)?i[3]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,t),s=i[4],(s=!x.defined(s)?i[4]=new v.Cartesian4:s).x=e.x,s.y=e.y,s.z=e.z,s.w=-g.Cartesian3.dot(e,h),g.Cartesian3.negate(e,u),s=i[5],(s=!x.defined(s)?i[5]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,f),this._cullingVolume},s.prototype.getPixelDimensions=function(t,e,a,i,r){V(this);var n=1/this.near,e=2*i*a*(this.top*n)/e,t=2*i*a*(this.right*n)/t;return r.x=t,r.y=e,r},s.prototype.clone=function(t){return(t=!x.defined(t)?new s:t).right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},s.prototype.equals=function(t){return x.defined(t)&&t instanceof s&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},s.prototype.equalsEpsilon=function(t,e,a){return t===this||x.defined(t)&&t instanceof s&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},R.packedLength=6,R.pack=function(t,e,a){return a=x.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},R.unpack=function(t,e,a){return e=x.defaultValue(e,0),(a=!x.defined(a)?new R:a).fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(R.prototype,{projectionMatrix:{get:function(){return S(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return S(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return S(this),this._fovy}},sseDenominator:{get:function(){return S(this),this._sseDenominator}}}),R.prototype.computeCullingVolume=function(t,e,a){return S(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},R.prototype.getPixelDimensions=function(t,e,a,i,r){return S(this),this._offCenterFrustum.getPixelDimensions(t,e,a,i,r)},R.prototype.clone=function(t){return(t=!x.defined(t)?new R:t).aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},R.prototype.equals=function(t){return!!(x.defined(t)&&t instanceof R)&&(S(this),S(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},R.prototype.equalsEpsilon=function(t,e,a){return!!(x.defined(t)&&t instanceof R)&&(S(this),S(t),i.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function T(t){var e,a,i=t.frustum,r=t.orientation,n=t.origin,o=x.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT),t=x.defaultValue(t._drawNearPlane,!0);i instanceof R?(e=0,a=R.packedLength):i instanceof F&&(e=1,a=F.packedLength),this._frustumType=e,this._frustum=i.clone(),this._origin=g.Cartesian3.clone(n),this._orientation=v.Quaternion.clone(r),this._drawNearPlane=t,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+g.Cartesian3.packedLength+v.Quaternion.packedLength+u.VertexFormat.packedLength}T.pack=function(t,e,a){a=x.defaultValue(a,0);var i=t._frustumType,r=t._frustum;return 0===(e[a++]=i)?(R.pack(r,e,a),a+=R.packedLength):(F.pack(r,e,a),a+=F.packedLength),g.Cartesian3.pack(t._origin,e,a),a+=g.Cartesian3.packedLength,v.Quaternion.pack(t._orientation,e,a),a+=v.Quaternion.packedLength,u.VertexFormat.pack(t._vertexFormat,e,a),e[a+=u.VertexFormat.packedLength]=t._drawNearPlane?1:0,e};var k=new R,A=new F,D=new v.Quaternion,I=new g.Cartesian3,q=new u.VertexFormat;function B(t,e,a,i,r,n,o,s){for(var f=t/3*2,u=0;u<4;++u)x.defined(e)&&(e[t]=n.x,e[t+1]=n.y,e[t+2]=n.z),x.defined(a)&&(a[t]=o.x,a[t+1]=o.y,a[t+2]=o.z),x.defined(i)&&(i[t]=s.x,i[t+1]=s.y,i[t+2]=s.z),t+=3;r[f]=0,r[1+f]=0,r[2+f]=1,r[3+f]=0,r[4+f]=1,r[5+f]=1,r[6+f]=0,r[7+f]=1}T.unpack=function(t,e,a){e=x.defaultValue(e,0);var i,r=t[e++];0===r?(i=R.unpack(t,e,k),e+=R.packedLength):(i=F.unpack(t,e,A),e+=F.packedLength);var n=g.Cartesian3.unpack(t,e,I);e+=g.Cartesian3.packedLength;var o=v.Quaternion.unpack(t,e,D);e+=v.Quaternion.packedLength;var s=u.VertexFormat.unpack(t,e,q),t=1===t[e+=u.VertexFormat.packedLength];if(!x.defined(a))return new T({frustum:i,origin:n,orientation:o,vertexFormat:s,_drawNearPlane:t});e=r===a._frustumType?a._frustum:void 0;return a._frustum=i.clone(e),a._frustumType=r,a._origin=g.Cartesian3.clone(n,a._origin),a._orientation=v.Quaternion.clone(o,a._orientation),a._vertexFormat=u.VertexFormat.clone(s,a._vertexFormat),a._drawNearPlane=t,a};var L=new v.Matrix3,N=new v.Matrix4,G=new v.Matrix4,j=new g.Cartesian3,U=new g.Cartesian3,Q=new g.Cartesian3,K=new g.Cartesian3,Y=new g.Cartesian3,J=new g.Cartesian3,W=new Array(3),X=new Array(4);X[0]=new v.Cartesian4(-1,-1,1,1),X[1]=new v.Cartesian4(1,-1,1,1),X[2]=new v.Cartesian4(1,1,1,1),X[3]=new v.Cartesian4(-1,1,1,1);for(var Z=new Array(4),a=0;a<4;++a)Z[a]=new v.Cartesian4;T._computeNearFarPlanes=function(t,e,a,i,r,n,o,s){var e=v.Matrix3.fromQuaternion(e,L),n=x.defaultValue(n,j),o=x.defaultValue(o,U),f=x.defaultValue(s,Q),n=v.Matrix3.getColumn(e,0,n),o=v.Matrix3.getColumn(e,1,o),f=v.Matrix3.getColumn(e,2,f);g.Cartesian3.normalize(n,n),g.Cartesian3.normalize(o,o),g.Cartesian3.normalize(f,f),g.Cartesian3.negate(n,n);var u,l,n=v.Matrix4.computeView(t,f,o,n,N);0===a?(a=i.projectionMatrix,a=v.Matrix4.multiply(a,n,G),l=v.Matrix4.inverse(a,G)):u=v.Matrix4.inverseTransformation(n,G),x.defined(l)?(W[0]=i.near,W[1]=i.far):(W[0]=0,W[1]=i.near,W[2]=i.far);for(var h=0;h<2;++h)for(var p=0;p<4;++p){var d,c,m=v.Cartesian4.clone(X[p],Z[p]);x.defined(l)?(d=1/(m=v.Matrix4.multiplyByVector(l,m,m)).w,g.Cartesian3.multiplyByScalar(m,d,m),g.Cartesian3.subtract(m,t,m),g.Cartesian3.normalize(m,m),c=g.Cartesian3.dot(f,m),g.Cartesian3.multiplyByScalar(m,W[h]/c,m),g.Cartesian3.add(m,t,m)):(x.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),d=W[h],c=W[h+1],m.x=.5*(m.x*(i.right-i.left)+i.left+i.right),m.y=.5*(m.y*(i.top-i.bottom)+i.bottom+i.top),m.z=.5*(m.z*(d-c)-d-c),m.w=1,v.Matrix4.multiplyByVector(u,m,m)),r[12*h+3*p]=m.x,r[12*h+3*p+1]=m.y,r[12*h+3*p+2]=m.z}},T.createGeometry=function(t){var e=t._frustumType,a=t._frustum,i=t._origin,r=t._orientation,n=t._drawNearPlane,o=t._vertexFormat,s=n?6:5,f=new Float64Array(72);T._computeNearFarPlanes(i,r,e,a,f);var u=24;f[u]=f[12],f[u+1]=f[13],f[u+2]=f[14],f[u+3]=f[0],f[u+4]=f[1],f[u+5]=f[2],f[u+6]=f[9],f[u+7]=f[10],f[u+8]=f[11],f[u+9]=f[21],f[u+10]=f[22],f[u+11]=f[23],f[u+=12]=f[15],f[u+1]=f[16],f[u+2]=f[17],f[u+3]=f[3],f[u+4]=f[4],f[u+5]=f[5],f[u+6]=f[0],f[u+7]=f[1],f[u+8]=f[2],f[u+9]=f[12],f[u+10]=f[13],f[u+11]=f[14],f[u+=12]=f[3],f[u+1]=f[4],f[u+2]=f[5],f[u+3]=f[15],f[u+4]=f[16],f[u+5]=f[17],f[u+6]=f[18],f[u+7]=f[19],f[u+8]=f[20],f[u+9]=f[6],f[u+10]=f[7],f[u+11]=f[8],f[u+=12]=f[6],f[u+1]=f[7],f[u+2]=f[8],f[u+3]=f[18],f[u+4]=f[19],f[u+5]=f[20],f[u+6]=f[21],f[u+7]=f[22],f[u+8]=f[23],f[u+9]=f[9],f[u+10]=f[10],f[u+11]=f[11],n||(f=f.subarray(12));var l,h,p,d,c=new M.GeometryAttributes({position:new b.GeometryAttribute({componentDatatype:w.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})});(x.defined(o.normal)||x.defined(o.tangent)||x.defined(o.bitangent)||x.defined(o.st))&&(l=x.defined(o.normal)?new Float32Array(12*s):void 0,h=x.defined(o.tangent)?new Float32Array(12*s):void 0,p=x.defined(o.bitangent)?new Float32Array(12*s):void 0,d=x.defined(o.st)?new Float32Array(8*s):void 0,t=j,i=U,r=Q,e=g.Cartesian3.negate(t,K),a=g.Cartesian3.negate(i,Y),o=g.Cartesian3.negate(r,J),u=0,n&&(B(u,l,h,p,d,o,t,i),u+=12),B(u,l,h,p,d,r,e,i),B(u+=12,l,h,p,d,e,o,i),B(u+=12,l,h,p,d,a,o,e),B(u+=12,l,h,p,d,t,r,i),B(u+=12,l,h,p,d,i,r,e),x.defined(l)&&(c.normal=new b.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:l})),x.defined(h)&&(c.tangent=new b.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),x.defined(p)&&(c.bitangent=new b.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),x.defined(d)&&(c.st=new b.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})));for(var m=new Uint16Array(6*s),C=0;C<s;++C){var _=6*C,y=4*C;m[_]=y,m[1+_]=1+y,m[2+_]=2+y,m[3+_]=y,m[4+_]=2+y,m[5+_]=3+y}return new b.Geometry({attributes:c,indices:m,primitiveType:b.PrimitiveType.TRIANGLES,boundingSphere:v.BoundingSphere.fromVertices(f)})},t.FrustumGeometry=T,t.OrthographicFrustum=F,t.PerspectiveFrustum=R}); diff --git a/public/Cesium/Workers/FrustumGeometry-c7d19501.js b/public/Cesium/Workers/FrustumGeometry-c7d19501.js new file mode 100644 index 0000000..dd605ef --- /dev/null +++ b/public/Cesium/Workers/FrustumGeometry-c7d19501.js @@ -0,0 +1 @@ +define(["exports","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./when-54335d57","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./Math-d6182036","./Plane-13ae4b1b","./VertexFormat-81ec7207"],function(t,v,g,e,w,x,M,b,i,f,u){"use strict";function h(t){this.planes=x.defaultValue(t,[])}var p=[new g.Cartesian3,new g.Cartesian3,new g.Cartesian3];g.Cartesian3.clone(g.Cartesian3.UNIT_X,p[0]),g.Cartesian3.clone(g.Cartesian3.UNIT_Y,p[1]),g.Cartesian3.clone(g.Cartesian3.UNIT_Z,p[2]);var d=new g.Cartesian3,c=new g.Cartesian3,l=new f.Plane(new g.Cartesian3(1,0,0),0);function r(t){t=x.defaultValue(t,x.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=x.defaultValue(t.near,1),this._near=this.near,this.far=x.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._orthographicMatrix=new v.Matrix4}function o(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=v.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}h.fromBoundingSphere=function(t,e){x.defined(e)||(e=new h);var a=p.length,i=e.planes;i.length=2*a;for(var r=t.center,n=t.radius,o=0,s=0;s<a;++s){var f=p[s],u=i[o],l=i[o+1];x.defined(u)||(u=i[o]=new v.Cartesian4),x.defined(l)||(l=i[o+1]=new v.Cartesian4),g.Cartesian3.multiplyByScalar(f,-n,d),g.Cartesian3.add(r,d,d),u.x=f.x,u.y=f.y,u.z=f.z,u.w=-g.Cartesian3.dot(f,d),g.Cartesian3.multiplyByScalar(f,n,d),g.Cartesian3.add(r,d,d),l.x=-f.x,l.y=-f.y,l.z=-f.z,l.w=-g.Cartesian3.dot(g.Cartesian3.negate(f,c),d),o+=2}return e},h.prototype.computeVisibility=function(t){for(var e=this.planes,a=!1,i=0,r=e.length;i<r;++i){var n=t.intersectPlane(f.Plane.fromCartesian4(e[i],l));if(n===v.Intersect.OUTSIDE)return v.Intersect.OUTSIDE;n===v.Intersect.INTERSECTING&&(a=!0)}return a?v.Intersect.INTERSECTING:v.Intersect.INSIDE},h.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===h.MASK_OUTSIDE||e===h.MASK_INSIDE)return e;for(var a=h.MASK_INSIDE,i=this.planes,r=0,n=i.length;r<n;++r){var o=r<31?1<<r:0;if(!(r<31&&0==(e&o))){var s=t.intersectPlane(f.Plane.fromCartesian4(i[r],l));if(s===v.Intersect.OUTSIDE)return h.MASK_OUTSIDE;s===v.Intersect.INTERSECTING&&(a|=o)}}return a},h.MASK_OUTSIDE=4294967295,h.MASK_INSIDE=0,h.MASK_INDETERMINATE=2147483647,Object.defineProperties(r.prototype,{projectionMatrix:{get:function(){return o(this),this._orthographicMatrix}}});var m=new g.Cartesian3,C=new g.Cartesian3,_=new g.Cartesian3,y=new g.Cartesian3;function F(t){t=x.defaultValue(t,x.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new r,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=x.defaultValue(t.near,1),this._near=this.near,this.far=x.defaultValue(t.far,5e8),this._far=this.far}function n(t){var e,a=t._offCenterFrustum;t.width===t._width&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far||(t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far,e=1/t.aspectRatio,a.right=.5*t.width,a.left=-a.right,a.top=e*a.right,a.bottom=-a.top,a.near=t.near,a.far=t.far)}function s(t){t=x.defaultValue(t,x.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=x.defaultValue(t.near,1),this._near=this.near,this.far=x.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._perspectiveMatrix=new v.Matrix4,this._infinitePerspective=new v.Matrix4}function V(t){var e=t.top,a=t.bottom,i=t.right,r=t.left,n=t.near,o=t.far;e===t._top&&a===t._bottom&&r===t._left&&i===t._right&&n===t._near&&o===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=a,t._near=n,t._far=o,t._perspectiveMatrix=v.Matrix4.computePerspectiveOffCenter(r,i,a,e,n,o,t._perspectiveMatrix),t._infinitePerspective=v.Matrix4.computeInfinitePerspectiveOffCenter(r,i,a,e,n,t._infinitePerspective))}r.prototype.computeCullingVolume=function(t,e,a){var i=this._cullingVolume.planes,r=this.top,n=this.bottom,o=this.right,s=this.left,f=this.near,u=this.far,l=g.Cartesian3.cross(e,a,m);g.Cartesian3.normalize(l,l);var h=C;g.Cartesian3.multiplyByScalar(e,f,h),g.Cartesian3.add(t,h,h);f=_;g.Cartesian3.multiplyByScalar(l,s,f),g.Cartesian3.add(h,f,f);s=i[0];return(s=!x.defined(s)?i[0]=new v.Cartesian4:s).x=l.x,s.y=l.y,s.z=l.z,s.w=-g.Cartesian3.dot(l,f),g.Cartesian3.multiplyByScalar(l,o,f),g.Cartesian3.add(h,f,f),s=i[1],(s=!x.defined(s)?i[1]=new v.Cartesian4:s).x=-l.x,s.y=-l.y,s.z=-l.z,s.w=-g.Cartesian3.dot(g.Cartesian3.negate(l,y),f),g.Cartesian3.multiplyByScalar(a,n,f),g.Cartesian3.add(h,f,f),s=i[2],(s=!x.defined(s)?i[2]=new v.Cartesian4:s).x=a.x,s.y=a.y,s.z=a.z,s.w=-g.Cartesian3.dot(a,f),g.Cartesian3.multiplyByScalar(a,r,f),g.Cartesian3.add(h,f,f),s=i[3],(s=!x.defined(s)?i[3]=new v.Cartesian4:s).x=-a.x,s.y=-a.y,s.z=-a.z,s.w=-g.Cartesian3.dot(g.Cartesian3.negate(a,y),f),s=i[4],(s=!x.defined(s)?i[4]=new v.Cartesian4:s).x=e.x,s.y=e.y,s.z=e.z,s.w=-g.Cartesian3.dot(e,h),g.Cartesian3.multiplyByScalar(e,u,f),g.Cartesian3.add(t,f,f),s=i[5],(s=!x.defined(s)?i[5]=new v.Cartesian4:s).x=-e.x,s.y=-e.y,s.z=-e.z,s.w=-g.Cartesian3.dot(g.Cartesian3.negate(e,y),f),this._cullingVolume},r.prototype.getPixelDimensions=function(t,e,a,i,r){o(this);var n=this.right-this.left,e=i*(this.top-this.bottom)/e;return r.x=i*n/t,r.y=e,r},r.prototype.clone=function(t){return(t=!x.defined(t)?new r:t).left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},r.prototype.equals=function(t){return x.defined(t)&&t instanceof r&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},r.prototype.equalsEpsilon=function(t,e,a){return t===this||x.defined(t)&&t instanceof r&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},F.packedLength=4,F.pack=function(t,e,a){return a=x.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},F.unpack=function(t,e,a){return e=x.defaultValue(e,0),(a=!x.defined(a)?new F:a).width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(F.prototype,{projectionMatrix:{get:function(){return n(this),this._offCenterFrustum.projectionMatrix}}}),F.prototype.computeCullingVolume=function(t,e,a){return n(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},F.prototype.getPixelDimensions=function(t,e,a,i,r){return n(this),this._offCenterFrustum.getPixelDimensions(t,e,a,i,r)},F.prototype.clone=function(t){return(t=!x.defined(t)?new F:t).aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},F.prototype.equals=function(t){return!!(x.defined(t)&&t instanceof F)&&(n(this),n(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},F.prototype.equalsEpsilon=function(t,e,a){return!!(x.defined(t)&&t instanceof F)&&(n(this),n(t),i.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(s.prototype,{projectionMatrix:{get:function(){return V(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return V(this),this._infinitePerspective}}});var E=new g.Cartesian3,O=new g.Cartesian3,P=new g.Cartesian3,z=new g.Cartesian3;function R(t){t=x.defaultValue(t,x.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new s,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=x.defaultValue(t.near,1),this._near=this.near,this.far=x.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=x.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=x.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function S(t){var e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}s.prototype.computeCullingVolume=function(t,e,a){var i=this._cullingVolume.planes,r=this.top,n=this.bottom,o=this.right,s=this.left,f=this.near,u=this.far,l=g.Cartesian3.cross(e,a,E),h=O;g.Cartesian3.multiplyByScalar(e,f,h),g.Cartesian3.add(t,h,h);f=P;g.Cartesian3.multiplyByScalar(e,u,f),g.Cartesian3.add(t,f,f);u=z;g.Cartesian3.multiplyByScalar(l,s,u),g.Cartesian3.add(h,u,u),g.Cartesian3.subtract(u,t,u),g.Cartesian3.normalize(u,u),g.Cartesian3.cross(u,a,u),g.Cartesian3.normalize(u,u);s=i[0];return(s=!x.defined(s)?i[0]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,t),g.Cartesian3.multiplyByScalar(l,o,u),g.Cartesian3.add(h,u,u),g.Cartesian3.subtract(u,t,u),g.Cartesian3.cross(a,u,u),g.Cartesian3.normalize(u,u),s=i[1],(s=!x.defined(s)?i[1]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,t),g.Cartesian3.multiplyByScalar(a,n,u),g.Cartesian3.add(h,u,u),g.Cartesian3.subtract(u,t,u),g.Cartesian3.cross(l,u,u),g.Cartesian3.normalize(u,u),s=i[2],(s=!x.defined(s)?i[2]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,t),g.Cartesian3.multiplyByScalar(a,r,u),g.Cartesian3.add(h,u,u),g.Cartesian3.subtract(u,t,u),g.Cartesian3.cross(u,l,u),g.Cartesian3.normalize(u,u),s=i[3],(s=!x.defined(s)?i[3]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,t),s=i[4],(s=!x.defined(s)?i[4]=new v.Cartesian4:s).x=e.x,s.y=e.y,s.z=e.z,s.w=-g.Cartesian3.dot(e,h),g.Cartesian3.negate(e,u),s=i[5],(s=!x.defined(s)?i[5]=new v.Cartesian4:s).x=u.x,s.y=u.y,s.z=u.z,s.w=-g.Cartesian3.dot(u,f),this._cullingVolume},s.prototype.getPixelDimensions=function(t,e,a,i,r){V(this);var n=1/this.near,e=2*i*a*(o=this.top*n)/e,o=this.right*n;return r.x=2*i*a*o/t,r.y=e,r},s.prototype.clone=function(t){return(t=!x.defined(t)?new s:t).right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},s.prototype.equals=function(t){return x.defined(t)&&t instanceof s&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},s.prototype.equalsEpsilon=function(t,e,a){return t===this||x.defined(t)&&t instanceof s&&i.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&i.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&i.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&i.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&i.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&i.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},R.packedLength=6,R.pack=function(t,e,a){return a=x.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},R.unpack=function(t,e,a){return e=x.defaultValue(e,0),(a=!x.defined(a)?new R:a).fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(R.prototype,{projectionMatrix:{get:function(){return S(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return S(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return S(this),this._fovy}},sseDenominator:{get:function(){return S(this),this._sseDenominator}}}),R.prototype.computeCullingVolume=function(t,e,a){return S(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},R.prototype.getPixelDimensions=function(t,e,a,i,r){return S(this),this._offCenterFrustum.getPixelDimensions(t,e,a,i,r)},R.prototype.clone=function(t){return(t=!x.defined(t)?new R:t).aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},R.prototype.equals=function(t){return!!(x.defined(t)&&t instanceof R)&&(S(this),S(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},R.prototype.equalsEpsilon=function(t,e,a){return!!(x.defined(t)&&t instanceof R)&&(S(this),S(t),i.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&i.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function T(t){var e,a,i=t.frustum,r=t.orientation,n=t.origin,o=x.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT),t=x.defaultValue(t._drawNearPlane,!0);i instanceof R?(e=0,a=R.packedLength):i instanceof F&&(e=1,a=F.packedLength),this._frustumType=e,this._frustum=i.clone(),this._origin=g.Cartesian3.clone(n),this._orientation=v.Quaternion.clone(r),this._drawNearPlane=t,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+g.Cartesian3.packedLength+v.Quaternion.packedLength+u.VertexFormat.packedLength}T.pack=function(t,e,a){a=x.defaultValue(a,0);var i=t._frustumType,r=t._frustum;return 0===(e[a++]=i)?(R.pack(r,e,a),a+=R.packedLength):(F.pack(r,e,a),a+=F.packedLength),g.Cartesian3.pack(t._origin,e,a),a+=g.Cartesian3.packedLength,v.Quaternion.pack(t._orientation,e,a),a+=v.Quaternion.packedLength,u.VertexFormat.pack(t._vertexFormat,e,a),e[a+=u.VertexFormat.packedLength]=t._drawNearPlane?1:0,e};var k=new R,A=new F,D=new v.Quaternion,I=new g.Cartesian3,q=new u.VertexFormat;function B(t,e,a,i,r,n,o,s){for(var f=t/3*2,u=0;u<4;++u)x.defined(e)&&(e[t]=n.x,e[t+1]=n.y,e[t+2]=n.z),x.defined(a)&&(a[t]=o.x,a[t+1]=o.y,a[t+2]=o.z),x.defined(i)&&(i[t]=s.x,i[t+1]=s.y,i[t+2]=s.z),t+=3;r[f]=0,r[1+f]=0,r[2+f]=1,r[3+f]=0,r[4+f]=1,r[5+f]=1,r[6+f]=0,r[7+f]=1}T.unpack=function(t,e,a){e=x.defaultValue(e,0);var i,r=t[e++];0===r?(i=R.unpack(t,e,k),e+=R.packedLength):(i=F.unpack(t,e,A),e+=F.packedLength);var n=g.Cartesian3.unpack(t,e,I);e+=g.Cartesian3.packedLength;var o=v.Quaternion.unpack(t,e,D);e+=v.Quaternion.packedLength;var s=u.VertexFormat.unpack(t,e,q),t=1===t[e+=u.VertexFormat.packedLength];if(!x.defined(a))return new T({frustum:i,origin:n,orientation:o,vertexFormat:s,_drawNearPlane:t});e=r===a._frustumType?a._frustum:void 0;return a._frustum=i.clone(e),a._frustumType=r,a._origin=g.Cartesian3.clone(n,a._origin),a._orientation=v.Quaternion.clone(o,a._orientation),a._vertexFormat=u.VertexFormat.clone(s,a._vertexFormat),a._drawNearPlane=t,a};var L=new v.Matrix3,N=new v.Matrix4,G=new v.Matrix4,j=new g.Cartesian3,U=new g.Cartesian3,Q=new g.Cartesian3,K=new g.Cartesian3,Y=new g.Cartesian3,J=new g.Cartesian3,W=new Array(3),X=new Array(4);X[0]=new v.Cartesian4(-1,-1,1,1),X[1]=new v.Cartesian4(1,-1,1,1),X[2]=new v.Cartesian4(1,1,1,1),X[3]=new v.Cartesian4(-1,1,1,1);for(var Z=new Array(4),a=0;a<4;++a)Z[a]=new v.Cartesian4;T._computeNearFarPlanes=function(t,e,a,i,r,n,o,s){var e=v.Matrix3.fromQuaternion(e,L),n=x.defaultValue(n,j),o=x.defaultValue(o,U),f=x.defaultValue(s,Q),n=v.Matrix3.getColumn(e,0,n),o=v.Matrix3.getColumn(e,1,o),f=v.Matrix3.getColumn(e,2,f);g.Cartesian3.normalize(n,n),g.Cartesian3.normalize(o,o),g.Cartesian3.normalize(f,f),g.Cartesian3.negate(n,n);var u,l,n=v.Matrix4.computeView(t,f,o,n,N);0===a?(a=i.projectionMatrix,a=v.Matrix4.multiply(a,n,G),l=v.Matrix4.inverse(a,G)):u=v.Matrix4.inverseTransformation(n,G),x.defined(l)?(W[0]=i.near,W[1]=i.far):(W[0]=0,W[1]=i.near,W[2]=i.far);for(var h=0;h<2;++h)for(var p=0;p<4;++p){var d,c,m=v.Cartesian4.clone(X[p],Z[p]);x.defined(l)?(d=1/(m=v.Matrix4.multiplyByVector(l,m,m)).w,g.Cartesian3.multiplyByScalar(m,d,m),g.Cartesian3.subtract(m,t,m),g.Cartesian3.normalize(m,m),c=g.Cartesian3.dot(f,m),g.Cartesian3.multiplyByScalar(m,W[h]/c,m),g.Cartesian3.add(m,t,m)):(x.defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),d=W[h],c=W[h+1],m.x=.5*(m.x*(i.right-i.left)+i.left+i.right),m.y=.5*(m.y*(i.top-i.bottom)+i.bottom+i.top),m.z=.5*(m.z*(d-c)-d-c),m.w=1,v.Matrix4.multiplyByVector(u,m,m)),r[12*h+3*p]=m.x,r[12*h+3*p+1]=m.y,r[12*h+3*p+2]=m.z}},T.createGeometry=function(t){var e=t._frustumType,a=t._frustum,i=t._origin,r=t._orientation,n=t._drawNearPlane,o=t._vertexFormat,s=n?6:5,f=new Float64Array(72);T._computeNearFarPlanes(i,r,e,a,f);var u=24;f[u]=f[12],f[u+1]=f[13],f[u+2]=f[14],f[u+3]=f[0],f[u+4]=f[1],f[u+5]=f[2],f[u+6]=f[9],f[u+7]=f[10],f[u+8]=f[11],f[u+9]=f[21],f[u+10]=f[22],f[u+11]=f[23],f[u+=12]=f[15],f[u+1]=f[16],f[u+2]=f[17],f[u+3]=f[3],f[u+4]=f[4],f[u+5]=f[5],f[u+6]=f[0],f[u+7]=f[1],f[u+8]=f[2],f[u+9]=f[12],f[u+10]=f[13],f[u+11]=f[14],f[u+=12]=f[3],f[u+1]=f[4],f[u+2]=f[5],f[u+3]=f[15],f[u+4]=f[16],f[u+5]=f[17],f[u+6]=f[18],f[u+7]=f[19],f[u+8]=f[20],f[u+9]=f[6],f[u+10]=f[7],f[u+11]=f[8],f[u+=12]=f[6],f[u+1]=f[7],f[u+2]=f[8],f[u+3]=f[18],f[u+4]=f[19],f[u+5]=f[20],f[u+6]=f[21],f[u+7]=f[22],f[u+8]=f[23],f[u+9]=f[9],f[u+10]=f[10],f[u+11]=f[11],n||(f=f.subarray(12));var l,h,p,d,c=new b.GeometryAttributes({position:new M.GeometryAttribute({componentDatatype:w.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})});(x.defined(o.normal)||x.defined(o.tangent)||x.defined(o.bitangent)||x.defined(o.st))&&(l=x.defined(o.normal)?new Float32Array(12*s):void 0,h=x.defined(o.tangent)?new Float32Array(12*s):void 0,p=x.defined(o.bitangent)?new Float32Array(12*s):void 0,d=x.defined(o.st)?new Float32Array(8*s):void 0,t=U,i=Q,e=g.Cartesian3.negate(r=j,K),a=g.Cartesian3.negate(t,Y),o=g.Cartesian3.negate(i,J),u=0,n&&(B(u,l,h,p,d,o,r,t),u+=12),B(u,l,h,p,d,i,e,t),B(u+=12,l,h,p,d,e,o,t),B(u+=12,l,h,p,d,a,o,e),B(u+=12,l,h,p,d,r,i,t),B(u+=12,l,h,p,d,t,i,e),x.defined(l)&&(c.normal=new M.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:l})),x.defined(h)&&(c.tangent=new M.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),x.defined(p)&&(c.bitangent=new M.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),x.defined(d)&&(c.st=new M.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})));for(var m=new Uint16Array(6*s),C=0;C<s;++C){var _=6*C,y=4*C;m[_]=y,m[1+_]=1+y,m[2+_]=2+y,m[3+_]=y,m[4+_]=2+y,m[5+_]=3+y}return new M.Geometry({attributes:c,indices:m,primitiveType:M.PrimitiveType.TRIANGLES,boundingSphere:v.BoundingSphere.fromVertices(f)})},t.FrustumGeometry=T,t.OrthographicFrustum=F,t.PerspectiveFrustum=R}); diff --git a/public/Cesium/Workers/GeometryAttribute-04a19cfe.js b/public/Cesium/Workers/GeometryAttribute-374f805d.js similarity index 95% rename from public/Cesium/Workers/GeometryAttribute-04a19cfe.js rename to public/Cesium/Workers/GeometryAttribute-374f805d.js index b239b8d..f6e38f5 100644 --- a/public/Cesium/Workers/GeometryAttribute-04a19cfe.js +++ b/public/Cesium/Workers/GeometryAttribute-374f805d.js @@ -1 +1 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Transforms-a73b3b3b","./WebGLConstants-76bb35d1"],function(t,x,e,a,L,n){"use strict";var r=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function w(t,e,n,r){this[0]=a.defaultValue(t,0),this[1]=a.defaultValue(n,0),this[2]=a.defaultValue(e,0),this[3]=a.defaultValue(r,0)}w.packedLength=4,w.pack=function(t,e,n){return n=a.defaultValue(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e},w.unpack=function(t,e,n){return e=a.defaultValue(e,0),(n=!a.defined(n)?new w:n)[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n},w.clone=function(t,e){if(a.defined(t))return a.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):new w(t[0],t[2],t[1],t[3])},w.fromArray=function(t,e,n){return e=a.defaultValue(e,0),(n=!a.defined(n)?new w:n)[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],n},w.fromColumnMajorArray=function(t,e){return w.clone(t,e)},w.fromRowMajorArray=function(t,e){return a.defined(e)?(e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3],e):new w(t[0],t[1],t[2],t[3])},w.fromScale=function(t,e){return a.defined(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=t.y,e):new w(t.x,0,0,t.y)},w.fromUniformScale=function(t,e){return a.defined(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=t,e):new w(t,0,0,t)},w.fromRotation=function(t,e){var n=Math.cos(t),t=Math.sin(t);return a.defined(e)?(e[0]=n,e[1]=t,e[2]=-t,e[3]=n,e):new w(n,-t,t,n)},w.toArray=function(t,e){return a.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):[t[0],t[1],t[2],t[3]]},w.getElementIndex=function(t,e){return 2*t+e},w.getColumn=function(t,e,n){var r=2*e,e=t[r],r=t[1+r];return n.x=e,n.y=r,n},w.setColumn=function(t,e,n,r){e*=2;return(r=w.clone(t,r))[e]=n.x,r[1+e]=n.y,r},w.getRow=function(t,e,n){var r=t[e],e=t[e+2];return n.x=r,n.y=e,n},w.setRow=function(t,e,n,r){return(r=w.clone(t,r))[e]=n.x,r[e+2]=n.y,r};var i=new x.Cartesian2;w.getScale=function(t,e){return e.x=x.Cartesian2.magnitude(x.Cartesian2.fromElements(t[0],t[1],i)),e.y=x.Cartesian2.magnitude(x.Cartesian2.fromElements(t[2],t[3],i)),e};var u=new x.Cartesian2;w.getMaximumScale=function(t){return w.getScale(t,u),x.Cartesian2.maximumComponent(u)},w.multiply=function(t,e,n){var r=t[0]*e[0]+t[2]*e[1],a=t[0]*e[2]+t[2]*e[3],i=t[1]*e[0]+t[3]*e[1],e=t[1]*e[2]+t[3]*e[3];return n[0]=r,n[1]=i,n[2]=a,n[3]=e,n},w.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n},w.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n},w.multiplyByVector=function(t,e,n){var r=t[0]*e.x+t[2]*e.y,e=t[1]*e.x+t[3]*e.y;return n.x=r,n.y=e,n},w.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n},w.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.y,n[3]=t[3]*e.y,n},w.negate=function(t,e){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},w.transpose=function(t,e){var n=t[0],r=t[2],a=t[1],t=t[3];return e[0]=n,e[1]=r,e[2]=a,e[3]=t,e},w.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e},w.equals=function(t,e){return t===e||a.defined(t)&&a.defined(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},w.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]},w.equalsEpsilon=function(t,e,n){return n=a.defaultValue(n,0),t===e||a.defined(t)&&a.defined(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n},w.IDENTITY=Object.freeze(new w(1,0,0,1)),w.ZERO=Object.freeze(new w(0,0,0,0)),w.COLUMN0ROW0=0,w.COLUMN0ROW1=1,w.COLUMN1ROW0=2,w.COLUMN1ROW1=3,Object.defineProperties(w.prototype,{length:{get:function(){return w.packedLength}}}),w.prototype.clone=function(t){return w.clone(this,t)},w.prototype.equals=function(t){return w.equals(this,t)},w.prototype.equalsEpsilon=function(t,e){return w.equalsEpsilon(this,t,e)},w.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"};var o={POINTS:n.WebGLConstants.POINTS,LINES:n.WebGLConstants.LINES,LINE_LOOP:n.WebGLConstants.LINE_LOOP,LINE_STRIP:n.WebGLConstants.LINE_STRIP,TRIANGLES:n.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:n.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:n.WebGLConstants.TRIANGLE_FAN,validate:function(t){return t===o.POINTS||t===o.LINES||t===o.LINE_LOOP||t===o.LINE_STRIP||t===o.TRIANGLES||t===o.TRIANGLE_STRIP||t===o.TRIANGLE_FAN}},s=Object.freeze(o);function f(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=a.defaultValue(t.primitiveType,s.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=a.defaultValue(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}f.computeNumberOfVertices=function(t){var e,n,r=-1;for(e in t.attributes)t.attributes.hasOwnProperty(e)&&a.defined(t.attributes[e])&&a.defined(t.attributes[e].values)&&(r=(n=t.attributes[e]).values.length/n.componentsPerAttribute);return r};var g=new x.Cartographic,S=new x.Cartesian3,A=new L.Matrix4,O=[new x.Cartographic,new x.Cartographic,new x.Cartographic],M=[new x.Cartesian2,new x.Cartesian2,new x.Cartesian2],R=[new x.Cartesian2,new x.Cartesian2,new x.Cartesian2],v=new x.Cartesian3,V=new L.Quaternion,P=new L.Matrix4,G=new w;f._textureCoordinateRotationPoints=function(t,e,n,r){var a=x.Rectangle.center(r,g),i=x.Cartographic.toCartesian(a,n,S),a=L.Transforms.eastNorthUpToFixedFrame(i,n,A),u=L.Matrix4.inverse(a,A),o=M,s=O;s[0].longitude=r.west,s[0].latitude=r.south,s[1].longitude=r.west,s[1].latitude=r.north,s[2].longitude=r.east,s[2].latitude=r.south;for(var f=v,c=0;c<3;c++)x.Cartographic.toCartesian(s[c],n,f),f=L.Matrix4.multiplyByPointAsVector(u,f,f),o[c].x=f.x,o[c].y=f.y;var i=L.Quaternion.fromAxisAngle(x.Cartesian3.UNIT_Z,-e,V),l=L.Matrix3.fromQuaternion(i,P),d=t.length,y=Number.POSITIVE_INFINITY,m=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(c=0;c<d;c++)f=L.Matrix4.multiplyByPointAsVector(u,t[c],f),f=L.Matrix3.multiplyByVector(l,f,f),y=Math.min(y,f.x),m=Math.min(m,f.y),p=Math.max(p,f.x),h=Math.max(h,f.y);var N=w.fromRotation(e,G),I=R;I[0].x=y,I[0].y=m,I[1].x=y,I[1].y=h,I[2].x=p,I[2].y=m;var b=o[0],C=o[2].x-b.x,T=o[1].y-b.y;for(c=0;c<3;c++){var E=I[c];w.multiplyByVector(N,E,E),E.x=(E.x-b.x)/C,E.y=(E.y-b.y)/T}a=I[0],r=I[1],i=I[2],e=new Array(6);return x.Cartesian2.pack(a,e),x.Cartesian2.pack(r,e,2),x.Cartesian2.pack(i,e,4),e},t.Geometry=f,t.GeometryAttribute=function(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=a.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=r,t.Matrix2=w,t.PrimitiveType=s}); +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Transforms-79117a7b","./WebGLConstants-95ceb4e9"],function(t,x,e,a,L,n){"use strict";var r=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function w(t,e,n,r){this[0]=a.defaultValue(t,0),this[1]=a.defaultValue(n,0),this[2]=a.defaultValue(e,0),this[3]=a.defaultValue(r,0)}w.packedLength=4,w.pack=function(t,e,n){return n=a.defaultValue(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e},w.unpack=function(t,e,n){return e=a.defaultValue(e,0),(n=!a.defined(n)?new w:n)[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n},w.clone=function(t,e){if(a.defined(t))return a.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):new w(t[0],t[2],t[1],t[3])},w.fromArray=function(t,e,n){return e=a.defaultValue(e,0),(n=!a.defined(n)?new w:n)[0]=t[e],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],n},w.fromColumnMajorArray=function(t,e){return w.clone(t,e)},w.fromRowMajorArray=function(t,e){return a.defined(e)?(e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3],e):new w(t[0],t[1],t[2],t[3])},w.fromScale=function(t,e){return a.defined(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=t.y,e):new w(t.x,0,0,t.y)},w.fromUniformScale=function(t,e){return a.defined(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=t,e):new w(t,0,0,t)},w.fromRotation=function(t,e){var n=Math.cos(t),t=Math.sin(t);return a.defined(e)?(e[0]=n,e[1]=t,e[2]=-t,e[3]=n,e):new w(n,-t,t,n)},w.toArray=function(t,e){return a.defined(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):[t[0],t[1],t[2],t[3]]},w.getElementIndex=function(t,e){return 2*t+e},w.getColumn=function(t,e,n){var r=2*e,e=t[r],r=t[1+r];return n.x=e,n.y=r,n},w.setColumn=function(t,e,n,r){e*=2;return(r=w.clone(t,r))[e]=n.x,r[1+e]=n.y,r},w.getRow=function(t,e,n){var r=t[e],e=t[e+2];return n.x=r,n.y=e,n},w.setRow=function(t,e,n,r){return(r=w.clone(t,r))[e]=n.x,r[e+2]=n.y,r};var i=new x.Cartesian2;w.getScale=function(t,e){return e.x=x.Cartesian2.magnitude(x.Cartesian2.fromElements(t[0],t[1],i)),e.y=x.Cartesian2.magnitude(x.Cartesian2.fromElements(t[2],t[3],i)),e};var u=new x.Cartesian2;w.getMaximumScale=function(t){return w.getScale(t,u),x.Cartesian2.maximumComponent(u)},w.multiply=function(t,e,n){var r=t[0]*e[0]+t[2]*e[1],a=t[0]*e[2]+t[2]*e[3],i=t[1]*e[0]+t[3]*e[1],e=t[1]*e[2]+t[3]*e[3];return n[0]=r,n[1]=i,n[2]=a,n[3]=e,n},w.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n},w.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n},w.multiplyByVector=function(t,e,n){var r=t[0]*e.x+t[2]*e.y,e=t[1]*e.x+t[3]*e.y;return n.x=r,n.y=e,n},w.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n},w.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.y,n[3]=t[3]*e.y,n},w.negate=function(t,e){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},w.transpose=function(t,e){var n=t[0],r=t[2],a=t[1],t=t[3];return e[0]=n,e[1]=r,e[2]=a,e[3]=t,e},w.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e},w.equals=function(t,e){return t===e||a.defined(t)&&a.defined(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},w.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]},w.equalsEpsilon=function(t,e,n){return n=a.defaultValue(n,0),t===e||a.defined(t)&&a.defined(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n},w.IDENTITY=Object.freeze(new w(1,0,0,1)),w.ZERO=Object.freeze(new w(0,0,0,0)),w.COLUMN0ROW0=0,w.COLUMN0ROW1=1,w.COLUMN1ROW0=2,w.COLUMN1ROW1=3,Object.defineProperties(w.prototype,{length:{get:function(){return w.packedLength}}}),w.prototype.clone=function(t){return w.clone(this,t)},w.prototype.equals=function(t){return w.equals(this,t)},w.prototype.equalsEpsilon=function(t,e){return w.equalsEpsilon(this,t,e)},w.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"};var o={POINTS:n.WebGLConstants.POINTS,LINES:n.WebGLConstants.LINES,LINE_LOOP:n.WebGLConstants.LINE_LOOP,LINE_STRIP:n.WebGLConstants.LINE_STRIP,TRIANGLES:n.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:n.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:n.WebGLConstants.TRIANGLE_FAN,validate:function(t){return t===o.POINTS||t===o.LINES||t===o.LINE_LOOP||t===o.LINE_STRIP||t===o.TRIANGLES||t===o.TRIANGLE_STRIP||t===o.TRIANGLE_FAN}},s=Object.freeze(o);function f(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=a.defaultValue(t.primitiveType,s.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=a.defaultValue(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}f.computeNumberOfVertices=function(t){var e,n,r=-1;for(e in t.attributes)t.attributes.hasOwnProperty(e)&&a.defined(t.attributes[e])&&a.defined(t.attributes[e].values)&&(r=(n=t.attributes[e]).values.length/n.componentsPerAttribute);return r};var g=new x.Cartographic,S=new x.Cartesian3,A=new L.Matrix4,O=[new x.Cartographic,new x.Cartographic,new x.Cartographic],M=[new x.Cartesian2,new x.Cartesian2,new x.Cartesian2],R=[new x.Cartesian2,new x.Cartesian2,new x.Cartesian2],v=new x.Cartesian3,V=new L.Quaternion,P=new L.Matrix4,G=new w;f._textureCoordinateRotationPoints=function(t,e,n,r){var a=x.Rectangle.center(r,g),i=x.Cartographic.toCartesian(a,n,S),a=L.Transforms.eastNorthUpToFixedFrame(i,n,A),u=L.Matrix4.inverse(a,A),o=M,s=O;s[0].longitude=r.west,s[0].latitude=r.south,s[1].longitude=r.west,s[1].latitude=r.north,s[2].longitude=r.east,s[2].latitude=r.south;for(var f=v,c=0;c<3;c++)x.Cartographic.toCartesian(s[c],n,f),f=L.Matrix4.multiplyByPointAsVector(u,f,f),o[c].x=f.x,o[c].y=f.y;var i=L.Quaternion.fromAxisAngle(x.Cartesian3.UNIT_Z,-e,V),l=L.Matrix3.fromQuaternion(i,P),d=t.length,y=Number.POSITIVE_INFINITY,m=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(c=0;c<d;c++)f=L.Matrix4.multiplyByPointAsVector(u,t[c],f),f=L.Matrix3.multiplyByVector(l,f,f),y=Math.min(y,f.x),m=Math.min(m,f.y),p=Math.max(p,f.x),h=Math.max(h,f.y);var N=w.fromRotation(e,G),I=R;I[0].x=y,I[0].y=m,I[1].x=y,I[1].y=h,I[2].x=p,I[2].y=m;var C=o[0],b=o[2].x-C.x,T=o[1].y-C.y;for(c=0;c<3;c++){var E=I[c];w.multiplyByVector(N,E,E),E.x=(E.x-C.x)/b,E.y=(E.y-C.y)/T}a=I[0],r=I[1],i=I[2],e=new Array(6);return x.Cartesian2.pack(a,e),x.Cartesian2.pack(r,e,2),x.Cartesian2.pack(i,e,4),e},t.Geometry=f,t.GeometryAttribute=function(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=a.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=r,t.Matrix2=w,t.PrimitiveType=s}); diff --git a/public/Cesium/Workers/GeometryAttributes-b0b294d8.js b/public/Cesium/Workers/GeometryAttributes-caa08d6c.js similarity index 76% rename from public/Cesium/Workers/GeometryAttributes-b0b294d8.js rename to public/Cesium/Workers/GeometryAttributes-caa08d6c.js index c764c73..22c7589 100644 --- a/public/Cesium/Workers/GeometryAttributes-b0b294d8.js +++ b/public/Cesium/Workers/GeometryAttributes-caa08d6c.js @@ -1 +1 @@ -define(["exports","./when-208fe5b0"],function(t,n){"use strict";t.GeometryAttributes=function(t){t=n.defaultValue(t,n.defaultValue.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}}); +define(["exports","./when-54335d57"],function(t,n){"use strict";t.GeometryAttributes=function(t){t=n.defaultValue(t,n.defaultValue.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}}); diff --git a/public/Cesium/Workers/GeometryInstance-6aa9010a.js b/public/Cesium/Workers/GeometryInstance-6aa9010a.js new file mode 100644 index 0000000..76bb2e3 --- /dev/null +++ b/public/Cesium/Workers/GeometryInstance-6aa9010a.js @@ -0,0 +1 @@ +define(["exports","./when-54335d57","./Check-24483042","./Transforms-79117a7b"],function(e,t,i,r){"use strict";e.GeometryInstance=function(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=r.Matrix4.clone(t.defaultValue(e.modelMatrix,r.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}}); diff --git a/public/Cesium/Workers/GeometryInstance-d919cab6.js b/public/Cesium/Workers/GeometryInstance-d919cab6.js deleted file mode 100644 index 9b50b41..0000000 --- a/public/Cesium/Workers/GeometryInstance-d919cab6.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./when-208fe5b0","./Check-d18af7c4","./Transforms-a73b3b3b"],function(e,t,i,a){"use strict";e.GeometryInstance=function(e){e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=a.Matrix4.clone(t.defaultValue(e.modelMatrix,a.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}}); diff --git a/public/Cesium/Workers/GeometryOffsetAttribute-718fa138.js b/public/Cesium/Workers/GeometryOffsetAttribute-718fa138.js new file mode 100644 index 0000000..9256b9c --- /dev/null +++ b/public/Cesium/Workers/GeometryOffsetAttribute-718fa138.js @@ -0,0 +1 @@ +define(["exports","./Check-24483042","./when-54335d57"],function(e,t,l){"use strict";var a=Object.freeze({NONE:0,TOP:1,ALL:2});e.GeometryOffsetAttribute=a,e.arrayFill=function(e,t,a,f){if("function"==typeof e.fill)return e.fill(t,a,f);for(var r=e.length>>>0,n=(a=l.defaultValue(a,0))<0?Math.max(r+a,0):Math.min(a,r),i=(f=l.defaultValue(f,r))<0?Math.max(r+f,0):Math.min(f,r);n<i;)e[n]=t,n++;return e}}); diff --git a/public/Cesium/Workers/GeometryOffsetAttribute-def3b741.js b/public/Cesium/Workers/GeometryOffsetAttribute-def3b741.js deleted file mode 100644 index 5e018fe..0000000 --- a/public/Cesium/Workers/GeometryOffsetAttribute-def3b741.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Check-d18af7c4","./when-208fe5b0"],function(e,t,l){"use strict";var f=Object.freeze({NONE:0,TOP:1,ALL:2});e.GeometryOffsetAttribute=f,e.arrayFill=function(e,t,f,a){if("function"==typeof e.fill)return e.fill(t,f,a);for(var r=e.length>>>0,n=(f=l.defaultValue(f,0))<0?Math.max(r+f,0):Math.min(f,r),i=(a=l.defaultValue(a,r))<0?Math.max(r+a,0):Math.min(a,r);n<i;)e[n]=t,n++;return e}}); diff --git a/public/Cesium/Workers/GeometryPipeline-571ff4c9.js b/public/Cesium/Workers/GeometryPipeline-571ff4c9.js new file mode 100644 index 0000000..0079fc0 --- /dev/null +++ b/public/Cesium/Workers/GeometryPipeline-571ff4c9.js @@ -0,0 +1 @@ +define(["exports","./AttributeCompression-10c27d9c","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Math-d6182036","./Transforms-79117a7b","./ComponentDatatype-1a100acd","./EncodedCartesian3-bf827957","./GeometryAttribute-374f805d","./IndexDatatype-82ceea78","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(e,A,R,t,V,L,z,I,d,O,P,D,a){"use strict";var g=new R.Cartesian3,T=new R.Cartesian3,x=new R.Cartesian3;var s={calculateACMR:function(e){var t=(e=V.defaultValue(e,V.defaultValue.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=V.defaultValue(e.cacheSize,24),n=t.length;if(!V.defined(r))for(var r=0,i=0,s=t[i];i<n;)r<s&&(r=s),s=t[++i];for(var o=[],u=0;u<r+1;u++)o[u]=0;for(var p=a+1,d=0;d<n;++d)p-o[t[d]]>a&&(o[t[d]]=p,++p);return(p-a+1)/(n/3)}};s.tipsify=function(e){var t=(e=V.defaultValue(e,V.defaultValue.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=V.defaultValue(e.cacheSize,24);function n(e,t,r,a,n,i,s){for(var o,u=-1,p=-1,d=0;d<r.length;){var l=r[d];a[l].numLiveTriangles&&(o=0,(p<(o=n-a[l].timeStamp+2*a[l].numLiveTriangles<=t?n-a[l].timeStamp:o)||-1===p)&&(p=o,u=l)),++d}return-1===u?function(e,t,r){for(;1<=t.length;){var a=t[t.length-1];if(t.splice(t.length-1,1),0<e[a].numLiveTriangles)return a}for(;v<r;){if(0<e[v].numLiveTriangles)return++v-1;++v}return-1}(a,i,s):u}var e=t.length,i=0,s=t[P=0],o=e;if(V.defined(r))i=r+1;else{for(;P<o;)i<s&&(i=s),s=t[++P];if(-1===i)return 0;++i}for(var u=[],p=0;p<i;p++)u[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};for(var d=P=0;P<o;)u[t[P]].vertexTriangles.push(d),++u[t[P]].numLiveTriangles,u[t[P+1]].vertexTriangles.push(d),++u[t[P+1]].numLiveTriangles,u[t[P+2]].vertexTriangles.push(d),++u[t[P+2]].numLiveTriangles,++d,P+=3;var l,y=0,f=a+1,v=1,c=[],m=[],C=0,h=[],b=e/3,g=[];for(p=0;p<b;p++)g[p]=!1;for(;-1!==y;){for(var A,c=[],T=(A=u[y]).vertexTriangles.length,x=0;x<T;++x)if(!g[d=A.vertexTriangles[x]]){g[d]=!0;for(var P=d+d+d,w=0;w<3;++w)l=t[P],c.push(l),m.push(l),h[C]=l,++C,--(l=u[l]).numLiveTriangles,f-l.timeStamp>a&&(l.timeStamp=f,++f),++P}y=n(0,a,c,u,f,m,i)}return h};var r={};function o(e,t,r,a,n){e[t++]=r,e[t++]=a,e[t++]=a,e[t++]=n,e[t++]=n,e[t]=r}function v(e){var t,r,a={};for(t in e)e.hasOwnProperty(t)&&V.defined(e[t])&&V.defined(e[t].values)&&(r=e[t],a[t]=new O.GeometryAttribute({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]}));return a}r.toWireframe=function(e){var t=e.indices;if(V.defined(t)){switch(e.primitiveType){case O.PrimitiveType.TRIANGLES:e.indices=function(e){for(var t=e.length,r=P.IndexDatatype.createTypedArray(t,t/3*6),a=0,n=0;n<t;n+=3,a+=6)o(r,a,e[n],e[n+1],e[n+2]);return r}(t);break;case O.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){var t=e.length;if(3<=t){var r=P.IndexDatatype.createTypedArray(t,6*(t-2));o(r,0,e[0],e[1],e[2]);for(var a=6,n=3;n<t;++n,a+=6)o(r,a,e[n-1],e[n],e[n-2]);return r}return new Uint16Array}(t);break;case O.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(0<e.length){for(var t=e.length-1,r=P.IndexDatatype.createTypedArray(t,6*(t-1)),a=e[0],n=0,i=1;i<t;++i,n+=6)o(r,n,a,e[i],e[i+1]);return r}return new Uint16Array}(t)}e.primitiveType=O.PrimitiveType.LINES}return e},r.createLineSegmentsForVectors=function(e,t,r){t=V.defaultValue(t,"normal"),r=V.defaultValue(r,1e4);for(var a,n=e.attributes.position.values,i=e.attributes[t].values,s=n.length,o=new Float64Array(2*s),u=0,p=0;p<s;p+=3)o[u++]=n[p],o[u++]=n[p+1],o[u++]=n[p+2],o[u++]=n[p]+i[p]*r,o[u++]=n[p+1]+i[p+1]*r,o[u++]=n[p+2]+i[p+2]*r;e=e.boundingSphere;return V.defined(e)&&(a=new z.BoundingSphere(e.center,e.radius+r)),new O.Geometry({attributes:{position:new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:O.PrimitiveType.LINES,boundingSphere:a})},r.createAttributeLocations=function(e){for(var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],a=e.attributes,n={},i=0,s=r.length,o=0;o<s;++o){var u=r[o];V.defined(a[u])&&(n[u]=i++)}for(t in a)a.hasOwnProperty(t)&&!V.defined(n[t])&&(n[t]=i++);return n},r.reorderForPreVertexCache=function(e){var t=O.Geometry.computeNumberOfVertices(e),r=e.indices;if(V.defined(r)){for(var a=new Int32Array(t),n=0;n<t;n++)a[n]=-1;for(var i,s=r,o=s.length,u=P.IndexDatatype.createTypedArray(t,o),p=0,d=0,l=0;p<o;)-1!==(i=a[s[p]])?u[d]=i:(a[i=s[p]]=l,u[d]=l,++l),++p,++d;e.indices=u;var y,f=e.attributes;for(y in f)if(f.hasOwnProperty(y)&&V.defined(f[y])&&V.defined(f[y].values)){for(var v=f[y],c=v.values,m=0,C=v.componentsPerAttribute,h=I.ComponentDatatype.createTypedArray(v.componentDatatype,l*C);m<t;){var b=a[m];if(-1!==b)for(var g=0;g<C;g++)h[C*b+g]=c[C*m+g];++m}v.values=h}}return e},r.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===O.PrimitiveType.TRIANGLES&&V.defined(r)){for(var a=r.length,n=0,i=0;i<a;i++)r[i]>n&&(n=r[i]);e.indices=s.tipsify({indices:r,maximumIndex:n,cacheSize:t})}return e},r.fitToUnsignedShortIndices=function(e){var t=[],r=O.Geometry.computeNumberOfVertices(e);if(V.defined(e.indices)&&r>=L.CesiumMath.SIXTY_FOUR_KILOBYTES){var a,n=[],i=[],s=0,o=v(e.attributes),u=e.indices,p=u.length;e.primitiveType===O.PrimitiveType.TRIANGLES?a=3:e.primitiveType===O.PrimitiveType.LINES?a=2:e.primitiveType===O.PrimitiveType.POINTS&&(a=1);for(var d=0;d<p;d+=a){for(var l=0;l<a;++l){var y=u[d+l],f=n[y];V.defined(f)||(f=s++,n[y]=f,function(e,t,r){for(var a in t)if(t.hasOwnProperty(a)&&V.defined(t[a])&&V.defined(t[a].values))for(var n=t[a],i=0;i<n.componentsPerAttribute;++i)e[a].values.push(n.values[r*n.componentsPerAttribute+i])}(o,e.attributes,y)),i.push(f)}s+a>=L.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new O.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],s=0,o=v(e.attributes))}0!==i.length&&t.push(new O.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var y=new R.Cartesian3,f=new R.Cartographic;r.projectTo2D=function(e,t,r,a,n){for(var i=e.attributes[t],s=(n=V.defined(n)?n:new z.GeographicProjection).ellipsoid,o=i.values,u=new Float64Array(o.length),p=0,d=0;d<o.length;d+=3){var l=R.Cartesian3.fromArray(o,d,y),l=s.cartesianToCartographic(l,f),l=n.project(l,y);u[p++]=l.x,u[p++]=l.y,u[p++]=l.z}return e.attributes[r]=i,e.attributes[a]=new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),delete e.attributes[t],e};var l={high:0,low:0};r.encodeAttribute=function(e,t,r,a){for(var n=e.attributes[t],i=n.values,s=i.length,o=new Float32Array(s),u=new Float32Array(s),p=0;p<s;++p)d.EncodedCartesian3.encode(i[p],l),o[p]=l.high,u[p]=l.low;n=n.componentsPerAttribute;return e.attributes[r]=new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.FLOAT,componentsPerAttribute:n,values:o}),e.attributes[a]=new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.FLOAT,componentsPerAttribute:n,values:u}),delete e.attributes[t],e};var i=new R.Cartesian3;function n(e,t){if(V.defined(t))for(var r=t.values,a=r.length,n=0;n<a;n+=3)R.Cartesian3.unpack(r,n,i),z.Matrix4.multiplyByPoint(e,i,i),R.Cartesian3.pack(i,r,n)}function u(e,t){if(V.defined(t))for(var r=t.values,a=r.length,n=0;n<a;n+=3)R.Cartesian3.unpack(r,n,i),z.Matrix3.multiplyByVector(e,i,i),i=R.Cartesian3.normalize(i,i),R.Cartesian3.pack(i,r,n)}var p=new z.Matrix4,c=new z.Matrix3;r.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(z.Matrix4.equals(t,z.Matrix4.IDENTITY))return e;var r=e.geometry.attributes;n(t,r.position),n(t,r.prevPosition),n(t,r.nextPosition),(V.defined(r.normal)||V.defined(r.tangent)||V.defined(r.bitangent))&&(z.Matrix4.inverse(t,p),z.Matrix4.transpose(p,p),z.Matrix4.getMatrix3(p,c),u(c,r.normal),u(c,r.tangent),u(c,r.bitangent));r=e.geometry.boundingSphere;return V.defined(r)&&(e.geometry.boundingSphere=z.BoundingSphere.transform(r,t,r)),e.modelMatrix=z.Matrix4.clone(z.Matrix4.IDENTITY),e};var w=new R.Cartesian3;function m(e,t){var r,a,n=e.length;e[0].modelMatrix;var i,s,o,u=V.defined(e[0][t].indices),p=e[0][t].primitiveType,d=function(e,t){var r,a=e.length,n={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&V.defined(i[r])&&V.defined(i[r].values)){for(var s=i[r],o=s.values.length,u=!0,p=1;p<a;++p){var d=e[p][t].attributes[r];if(!V.defined(d)||s.componentDatatype!==d.componentDatatype||s.componentsPerAttribute!==d.componentsPerAttribute||s.normalize!==d.normalize){u=!1;break}o+=d.values.length}u&&(n[r]=new O.GeometryAttribute({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:I.ComponentDatatype.createTypedArray(s.componentDatatype,o)}))}return n}(e,t);for(r in d)if(d.hasOwnProperty(r))for(i=d[r].values,y=b=0;y<n;++y)for(o=(s=e[y][t].attributes[r].values).length,a=0;a<o;++a)i[b++]=s[a];if(u){for(var l=0,y=0;y<n;++y)l+=e[y][t].indices.length;var f=O.Geometry.computeNumberOfVertices(new O.Geometry({attributes:d,primitiveType:O.PrimitiveType.POINTS})),v=P.IndexDatatype.createTypedArray(f,l),c=0,m=0;for(y=0;y<n;++y){for(var C=e[y][t].indices,h=C.length,b=0;b<h;++b)v[c++]=m+C[b];m+=O.Geometry.computeNumberOfVertices(e[y][t])}f=v}var g=new R.Cartesian3,A=0;for(y=0;y<n;++y){if(T=e[y][t].boundingSphere,!V.defined(T)){g=void 0;break}R.Cartesian3.add(T.center,g,g)}if(V.defined(g))for(R.Cartesian3.divideByScalar(g,n,g),y=0;y<n;++y){var T=e[y][t].boundingSphere,x=R.Cartesian3.magnitude(R.Cartesian3.subtract(T.center,g,w))+T.radius;A<x&&(A=x)}return new O.Geometry({attributes:d,indices:f,primitiveType:p,boundingSphere:V.defined(g)?new z.BoundingSphere(g,A):void 0})}r.combineInstances=function(e){for(var t=[],r=[],a=e.length,n=0;n<a;++n){var i=e[n];V.defined(i.geometry)?t.push(i):V.defined(i.westHemisphereGeometry)&&V.defined(i.eastHemisphereGeometry)&&r.push(i)}var s=[];return 0<t.length&&s.push(m(t,"geometry")),0<r.length&&(s.push(m(r,"westHemisphereGeometry")),s.push(m(r,"eastHemisphereGeometry"))),s};var S=new R.Cartesian3,E=new R.Cartesian3,N=new R.Cartesian3,M=new R.Cartesian3;r.computeNormal=function(e){for(var t=e.indices,r=e.attributes,a=r.position.values,n=r.position.values.length/3,i=t.length,s=new Array(n),o=new Array(i/3),u=new Array(i),p=0;p<n;p++)s[p]={indexOffset:0,count:0,currentCount:0};var d=0;for(p=0;p<i;p+=3){var l=t[p],y=t[p+1],f=t[p+2],v=3*l,c=3*y,m=3*f;E.x=a[v],E.y=a[1+v],E.z=a[2+v],N.x=a[c],N.y=a[1+c],N.z=a[2+c],M.x=a[m],M.y=a[1+m],M.z=a[2+m],s[l].count++,s[y].count++,s[f].count++,R.Cartesian3.subtract(N,E,N),R.Cartesian3.subtract(M,E,M),o[d]=R.Cartesian3.cross(N,M,new R.Cartesian3),d++}var C=0;for(p=0;p<n;p++)s[p].indexOffset+=C,C+=s[p].count;for(p=d=0;p<i;p+=3){var h,b=(h=s[t[p]]).indexOffset+h.currentCount;u[b]=d,h.currentCount++,u[(h=s[t[p+1]]).indexOffset+h.currentCount]=d,h.currentCount++,u[(h=s[t[p+2]]).indexOffset+h.currentCount]=d,h.currentCount++,d++}var g=new Float32Array(3*n);for(p=0;p<n;p++){var A=3*p;if(h=s[p],R.Cartesian3.clone(R.Cartesian3.ZERO,S),0<h.count){for(d=0;d<h.count;d++)R.Cartesian3.add(S,o[u[h.indexOffset+d]],S);R.Cartesian3.equalsEpsilon(R.Cartesian3.ZERO,S,L.CesiumMath.EPSILON10)&&R.Cartesian3.clone(o[u[h.indexOffset]],S)}R.Cartesian3.equalsEpsilon(R.Cartesian3.ZERO,S,L.CesiumMath.EPSILON10)&&(S.z=1),R.Cartesian3.normalize(S,S),g[A]=S.x,g[1+A]=S.y,g[2+A]=S.z}return e.attributes.normal=new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g}),e};var G=new R.Cartesian3,F=new R.Cartesian3,B=new R.Cartesian3;r.computeTangentAndBitangent=function(e){e.attributes;for(var t=e.indices,r=e.attributes.position.values,a=e.attributes.normal.values,n=e.attributes.st.values,i=e.attributes.position.values.length/3,s=t.length,o=new Array(3*i),u=0;u<o.length;u++)o[u]=0;for(u=0;u<s;u+=3){var p,d,l,y=t[u],f=t[u+1],v=t[u+2],c=2*y,m=2*f,C=2*v,h=r[p=3*y],b=r[p+1],g=r[p+2],A=n[c],y=n[1+c],c=n[1+m]-y,y=n[1+C]-y,A=1/((n[m]-A)*y-(n[C]-A)*c),h=(y*(r[d=3*f]-h)-c*(r[l=3*v]-h))*A,b=(y*(r[d+1]-b)-c*(r[l+1]-b))*A,A=(y*(r[d+2]-g)-c*(r[l+2]-g))*A;o[p]+=h,o[p+1]+=b,o[p+2]+=A,o[d]+=h,o[d+1]+=b,o[d+2]+=A,o[l]+=h,o[l+1]+=b,o[l+2]+=A}var T=new Float32Array(3*i),x=new Float32Array(3*i);for(u=0;u<i;u++){d=(p=3*u)+1,l=p+2;var P=R.Cartesian3.fromArray(a,p,G),w=R.Cartesian3.fromArray(o,p,B),S=R.Cartesian3.dot(P,w);R.Cartesian3.multiplyByScalar(P,S,F),R.Cartesian3.normalize(R.Cartesian3.subtract(w,F,w),w),T[p]=w.x,T[d]=w.y,T[l]=w.z,R.Cartesian3.normalize(R.Cartesian3.cross(P,w,w),w),x[p]=w.x,x[d]=w.y,x[l]=w.z}return e.attributes.tangent=new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:T}),e.attributes.bitangent=new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:x}),e};var k=new R.Cartesian2,_=new R.Cartesian3,q=new R.Cartesian3,U=new R.Cartesian3,Y=new R.Cartesian2;function C(e){switch(e.primitiveType){case O.PrimitiveType.TRIANGLE_FAN:return function(e){var t=O.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var a=3,n=3;n<t;++n)r[a++]=n-1,r[a++]=0,r[a++]=n;return e.indices=r,e.primitiveType=O.PrimitiveType.TRIANGLES,e}(e);case O.PrimitiveType.TRIANGLE_STRIP:return function(e){var t=O.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,3<t&&(r[3]=0,r[4]=2,r[5]=3);for(var a=6,n=3;n<t-1;n+=2)r[a++]=n,r[a++]=n-1,r[a++]=n+1,n+2<t&&(r[a++]=n,r[a++]=n+1,r[a++]=n+2);return e.indices=r,e.primitiveType=O.PrimitiveType.TRIANGLES,e}(e);case O.PrimitiveType.TRIANGLES:return function(e){if(V.defined(e.indices))return e;for(var t=O.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,t),a=0;a<t;++a)r[a]=a;return e.indices=r,e}(e);case O.PrimitiveType.LINE_STRIP:return function(e){var t=O.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var a=2,n=2;n<t;++n)r[a++]=n-1,r[a++]=n;return e.indices=r,e.primitiveType=O.PrimitiveType.LINES,e}(e);case O.PrimitiveType.LINE_LOOP:return function(e){var t=O.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var a=2,n=2;n<t;++n)r[a++]=n-1,r[a++]=n;return r[a++]=t-1,r[a]=0,e.indices=r,e.primitiveType=O.PrimitiveType.LINES,e}(e);case O.PrimitiveType.LINES:return function(e){if(V.defined(e.indices))return e;for(var t=O.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,t),a=0;a<t;++a)r[a]=a;return e.indices=r,e}(e)}return e}function h(e,t){Math.abs(e.y)<L.CesiumMath.EPSILON6&&(e.y=t?-L.CesiumMath.EPSILON6:L.CesiumMath.EPSILON6)}r.compressVertices=function(e){var t=e.attributes.extrudeDirection;if(V.defined(t)){for(var r=t.values,a=r.length/3,n=new Float32Array(2*a),i=0,s=0;s<a;++s)R.Cartesian3.fromArray(r,3*s,_),R.Cartesian3.equals(_,R.Cartesian3.ZERO)?i+=2:(Y=A.AttributeCompression.octEncodeInRange(_,65535,Y),n[i++]=Y.x,n[i++]=Y.y);return e.attributes.compressedAttributes=new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n}),delete e.attributes.extrudeDirection,e}var o=e.attributes.normal,u=e.attributes.st,p=V.defined(o),d=V.defined(u);if(!p&&!d)return e;var l,y,f,v,c=e.attributes.tangent,t=e.attributes.bitangent,m=V.defined(c),C=V.defined(t);p&&(l=o.values),d&&(y=u.values),m&&(f=c.values),C&&(v=t.values);c=a=(p?l:y).length/(p?3:2),t=d&&p?2:1;c*=t+=m||C?1:0;var h=new Float32Array(c),b=0;for(s=0;s<a;++s){d&&(R.Cartesian2.fromArray(y,2*s,k),h[b++]=A.AttributeCompression.compressTextureCoordinates(k));var g=3*s;p&&V.defined(f)&&V.defined(v)?(R.Cartesian3.fromArray(l,g,_),R.Cartesian3.fromArray(f,g,q),R.Cartesian3.fromArray(v,g,U),A.AttributeCompression.octPack(_,q,U,k),h[b++]=k.x,h[b++]=k.y):(p&&(R.Cartesian3.fromArray(l,g,_),h[b++]=A.AttributeCompression.octEncodeFloat(_)),m&&(R.Cartesian3.fromArray(f,g,_),h[b++]=A.AttributeCompression.octEncodeFloat(_)),C&&(R.Cartesian3.fromArray(v,g,_),h[b++]=A.AttributeCompression.octEncodeFloat(_)))}return e.attributes.compressedAttributes=new O.GeometryAttribute({componentDatatype:I.ComponentDatatype.FLOAT,componentsPerAttribute:t,values:h}),p&&delete e.attributes.normal,d&&delete e.attributes.st,C&&delete e.attributes.bitangent,m&&delete e.attributes.tangent,e};var b=new R.Cartesian3;function Z(e,t,r,a){R.Cartesian3.add(e,R.Cartesian3.multiplyByScalar(R.Cartesian3.subtract(t,e,b),e.y/(e.y-t.y),b),r),R.Cartesian3.clone(r,a),h(r,!0),h(a,!1)}var H=new R.Cartesian3,W=new R.Cartesian3,X=new R.Cartesian3,j=new R.Cartesian3,J={positions:new Array(7),indices:new Array(9)};function K(e,t,r){if(!(0<=e.x||0<=t.x||0<=r.x)){!function(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return h(e,e.y<0),h(t,t.y<0),h(r,r.y<0);var a=Math.abs(e.y),n=Math.abs(t.y),i=Math.abs(r.y),n=n<a?i<a?L.CesiumMath.sign(e.y):L.CesiumMath.sign(r.y):i<n?L.CesiumMath.sign(t.y):L.CesiumMath.sign(r.y);h(e,n=n<0),h(t,n),h(r,n)}(e,t,r);var a=e.y<0,n=t.y<0,i=r.y<0,s=0;s+=a?1:0,s+=n?1:0;var o=J.indices;1==(s+=i?1:0)?(o[1]=3,o[2]=4,o[5]=6,o[7]=6,o[8]=5,a?(Z(e,t,H,X),Z(e,r,W,j),o[0]=0,o[3]=1,o[4]=2,o[6]=1):n?(Z(t,r,H,X),Z(t,e,W,j),o[0]=1,o[3]=2,o[4]=0,o[6]=2):i&&(Z(r,e,H,X),Z(r,t,W,j),o[0]=2,o[3]=0,o[4]=1,o[6]=0)):2==s&&(o[2]=4,o[4]=4,o[5]=3,o[7]=5,o[8]=6,a?n?i||(Z(r,e,H,X),Z(r,t,W,j),o[0]=0,o[1]=1,o[3]=0,o[6]=2):(Z(t,r,H,X),Z(t,e,W,j),o[0]=2,o[1]=0,o[3]=2,o[6]=1):(Z(e,t,H,X),Z(e,r,W,j),o[0]=1,o[1]=2,o[3]=1,o[6]=0));o=J.positions;return o[0]=e,o[1]=t,o[2]=r,o.length=3,1!=s&&2!=s||(o[3]=H,o[4]=W,o[5]=X,o[6]=j,o.length=7),J}}function Q(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)r.hasOwnProperty(a)&&V.defined(r[a])&&V.defined(r[a].values)&&((a=r[a]).values=I.ComponentDatatype.createTypedArray(a.componentDatatype,a.values));var n=O.Geometry.computeNumberOfVertices(e);return e.indices=P.IndexDatatype.createTypedArray(n,e.indices),t&&(e.boundingSphere=z.BoundingSphere.fromVertices(r.position.values)),e}}function $(e){var t,r,a=e.attributes,n={};for(t in a)a.hasOwnProperty(t)&&V.defined(a[t])&&V.defined(a[t].values)&&(r=a[t],n[t]=new O.GeometryAttribute({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]}));return new O.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ee(e,t,r){var a=V.defined(e.geometry.boundingSphere);t=Q(t,a),r=Q(r,a),V.defined(r)&&!V.defined(t)?e.geometry=r:!V.defined(r)&&V.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function te(u,p){var d=new u,l=new u,y=new u;return function(e,t,r,a,n,i,s,o){e=u.fromArray(n,e*p,d),t=u.fromArray(n,t*p,l),r=u.fromArray(n,r*p,y);u.multiplyByScalar(e,a.x,e),u.multiplyByScalar(t,a.y,t),u.multiplyByScalar(r,a.z,r);e=u.add(e,t,e);u.add(e,r,e),o&&u.normalize(e,e),u.pack(e,i,s*p)}}var re=te(z.Cartesian4,4),ae=te(R.Cartesian3,3),ne=te(R.Cartesian2,2),ie=function(e,t,r,a,n,i,s){e=n[e]*a.x,t=n[t]*a.y,a=n[r]*a.z;i[s]=e+t+a>L.CesiumMath.EPSILON6?1:0},se=new R.Cartesian3,oe=new R.Cartesian3,ue=new R.Cartesian3,pe=new R.Cartesian3;function de(e,t,r,a,n,i,s,o,u,p,d,l,y,f,v,c){if(V.defined(i)||V.defined(s)||V.defined(o)||V.defined(u)||V.defined(p)||0!==f){var m,C=function(e,t,r,a,n){var i,s,o,u,p,d,l;if(V.defined(n)||(n=new R.Cartesian3),V.defined(t.z)){if(R.Cartesian3.equalsEpsilon(e,t,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_X,n);if(R.Cartesian3.equalsEpsilon(e,r,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_Y,n);if(R.Cartesian3.equalsEpsilon(e,a,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_Z,n);i=R.Cartesian3.subtract(r,t,g),s=R.Cartesian3.subtract(a,t,T),o=R.Cartesian3.subtract(e,t,x),u=R.Cartesian3.dot(i,i),y=R.Cartesian3.dot(i,s),p=R.Cartesian3.dot(i,o),d=R.Cartesian3.dot(s,s),l=R.Cartesian3.dot(s,o)}else{if(R.Cartesian2.equalsEpsilon(e,t,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_X,n);if(R.Cartesian2.equalsEpsilon(e,r,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_Y,n);if(R.Cartesian2.equalsEpsilon(e,a,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_Z,n);i=R.Cartesian2.subtract(r,t,g),s=R.Cartesian2.subtract(a,t,T),o=R.Cartesian2.subtract(e,t,x),u=R.Cartesian2.dot(i,i),y=R.Cartesian2.dot(i,s),p=R.Cartesian2.dot(i,o),d=R.Cartesian2.dot(s,s),l=R.Cartesian2.dot(s,o)}n.y=d*p-y*l,n.z=u*l-y*p;var y=u*d-y*y;return 0!==n.y&&(n.y/=y),0!==n.z&&(n.z/=y),n.x=1-n.y-n.z,n}(a,R.Cartesian3.fromArray(n,3*e,se),R.Cartesian3.fromArray(n,3*t,oe),R.Cartesian3.fromArray(n,3*r,ue),pe);if(V.defined(i)&&ae(e,t,r,C,i,l.normal.values,c,!0),V.defined(p)&&(n=R.Cartesian3.fromArray(p,3*e,se),i=R.Cartesian3.fromArray(p,3*t,oe),p=R.Cartesian3.fromArray(p,3*r,ue),R.Cartesian3.multiplyByScalar(n,C.x,n),R.Cartesian3.multiplyByScalar(i,C.y,i),R.Cartesian3.multiplyByScalar(p,C.z,p),R.Cartesian3.equals(n,R.Cartesian3.ZERO)&&R.Cartesian3.equals(i,R.Cartesian3.ZERO)&&R.Cartesian3.equals(p,R.Cartesian3.ZERO)?((m=se).x=0,m.y=0,m.z=0):(m=R.Cartesian3.add(n,i,n),R.Cartesian3.add(m,p,m),R.Cartesian3.normalize(m,m)),R.Cartesian3.pack(m,l.extrudeDirection.values,3*c)),V.defined(d)&&ie(e,t,r,C,d,l.applyOffset.values,c),V.defined(s)&&ae(e,t,r,C,s,l.tangent.values,c,!0),V.defined(o)&&ae(e,t,r,C,o,l.bitangent.values,c,!0),V.defined(u)&&ne(e,t,r,C,u,l.st.values,c),0<f)for(var h=0;h<f;h++){var b=y[h];!function(e,t,r,a,n,i,s){var o=i.componentsPerAttribute,u=i.values,p=s.values;switch(o){case 4:re(e,t,r,a,u,p,n,!1);break;case 3:ae(e,t,r,a,u,p,n,!1);break;case 2:ne(e,t,r,a,u,p,n,!1);break;default:p[n]=u[e]*a.x+u[t]*a.y+u[r]*a.z}}(e,t,r,C,c,v[b],l[b])}}}function le(e,t,r,a,n,i){var s=e.position.values.length/3;if(-1===n)return e.position.values.push(i.x,i.y,i.z),t.push(s),s;a=a[n],n=r[a];return-1===n?(r[a]=s,e.position.values.push(i.x,i.y,i.z),t.push(s),s):(t.push(n),n)}var ye={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function fe(e){var t,r=e.geometry,a=r.attributes,n=a.position.values,i=V.defined(a.normal)?a.normal.values:void 0,s=V.defined(a.bitangent)?a.bitangent.values:void 0,o=V.defined(a.tangent)?a.tangent.values:void 0,u=V.defined(a.st)?a.st.values:void 0,p=V.defined(a.extrudeDirection)?a.extrudeDirection.values:void 0,d=V.defined(a.applyOffset)?a.applyOffset.values:void 0,l=r.indices,y=[];for(t in a)a.hasOwnProperty(t)&&!ye[t]&&V.defined(a[t])&&y.push(t);var f,v,c=y.length,m=$(r),C=$(r),h=[];h.length=n.length/3;var b=[];for(b.length=n.length/3,A=0;A<h.length;++A)h[A]=-1,b[A]=-1;for(var g=l.length,A=0;A<g;A+=3){var T=l[A],x=l[A+1],P=l[A+2],w=R.Cartesian3.fromArray(n,3*T),S=R.Cartesian3.fromArray(n,3*x),I=R.Cartesian3.fromArray(n,3*P),O=K(w,S,I);if(V.defined(O)&&3<O.positions.length)for(var E=O.positions,N=O.indices,L=N.length,z=0;z<L;++z){var D=N[z],M=E[D],G=M.y<0?(f=C.attributes,v=C.indices,h):(f=m.attributes,v=m.indices,b);de(T,x,P,M,n,i,o,s,u,p,d,f,y,c,a,le(f,v,G,l,D<3?A+D:-1,M))}else V.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),G=w.y<0?(f=C.attributes,v=C.indices,h):(f=m.attributes,v=m.indices,b),de(T,x,P,w,n,i,o,s,u,p,d,f,y,c,a,le(f,v,G,l,A,w)),de(T,x,P,S,n,i,o,s,u,p,d,f,y,c,a,le(f,v,G,l,A+1,S)),de(T,x,P,I,n,i,o,s,u,p,d,f,y,c,a,le(f,v,G,l,A+2,I))}ee(e,C,m)}var ve=a.Plane.fromPointNormal(R.Cartesian3.ZERO,R.Cartesian3.UNIT_Y),ce=new R.Cartesian3,me=new R.Cartesian3;function Ce(e,t,r,a,n,i,s){V.defined(s)&&(a=R.Cartesian3.fromArray(a,3*e,se),R.Cartesian3.equalsEpsilon(a,r,L.CesiumMath.EPSILON10)?i.applyOffset.values[n]=s[e]:i.applyOffset.values[n]=s[t])}function he(e){var t,r=e.geometry,a=r.attributes,n=a.position.values,i=V.defined(a.applyOffset)?a.applyOffset.values:void 0,s=r.indices,o=$(r),u=$(r),p=s.length,d=[];d.length=n.length/3;var l=[];for(l.length=n.length/3,t=0;t<d.length;++t)d[t]=-1,l[t]=-1;for(t=0;t<p;t+=2){var y=s[t],f=s[t+1],v=R.Cartesian3.fromArray(n,3*y,se),c=R.Cartesian3.fromArray(n,3*f,oe);Math.abs(v.y)<L.CesiumMath.EPSILON6&&(v.y<0?v.y=-L.CesiumMath.EPSILON6:v.y=L.CesiumMath.EPSILON6),Math.abs(c.y)<L.CesiumMath.EPSILON6&&(c.y<0?c.y=-L.CesiumMath.EPSILON6:c.y=L.CesiumMath.EPSILON6);var m,C,h,b,g=o.attributes,A=o.indices,T=l,x=u.attributes,P=u.indices,w=d,S=D.IntersectionTests.lineSegmentPlane(v,c,ve,ue);V.defined(S)?(m=R.Cartesian3.multiplyByScalar(R.Cartesian3.UNIT_Y,5*L.CesiumMath.EPSILON9,ce),v.y<0&&(R.Cartesian3.negate(m,m),g=u.attributes,A=u.indices,T=d,x=o.attributes,P=o.indices,w=l),C=R.Cartesian3.add(S,m,me),Ce(y,f,v,n,le(g,A,T,s,t,v),g,i),Ce(y,f,C,n,le(g,A,T,s,-1,C),g,i),R.Cartesian3.negate(m,m),R.Cartesian3.add(S,m,C),Ce(y,f,C,n,le(x,P,w,s,-1,C),x,i),Ce(y,f,c,n,le(x,P,w,s,t+1,c),x,i)):(x=v.y<0?(h=u.attributes,b=u.indices,d):(h=o.attributes,b=o.indices,l),Ce(y,f,v,n,le(h,b,x,s,t,v),h,i),Ce(y,f,c,n,le(h,b,x,s,t+1,c),h,i))}ee(e,u,o)}var be=new R.Cartesian2,ge=new R.Cartesian2,Ae=new R.Cartesian3,Te=new R.Cartesian3,xe=new R.Cartesian3,Pe=new R.Cartesian3,we=new R.Cartesian3,Se=new R.Cartesian3,Ie=new z.Cartesian4;function Oe(e){for(var e=e.attributes,t=e.position.values,r=e.prevPosition.values,a=e.nextPosition.values,n=t.length,i=0;i<n;i+=3){var s,o=R.Cartesian3.unpack(t,i,Ae);0<o.x||(s=R.Cartesian3.unpack(r,i,Te),(o.y<0&&0<s.y||0<o.y&&s.y<0)&&(0<i-3?(r[i]=t[i-3],r[i+1]=t[i-2],r[i+2]=t[i-1]):R.Cartesian3.pack(o,r,i)),s=R.Cartesian3.unpack(a,i,xe),(o.y<0&&0<s.y||0<o.y&&s.y<0)&&(i+3<n?(a[i]=t[i+3],a[i+1]=t[i+4],a[i+2]=t[i+5]):R.Cartesian3.pack(o,a,i)))}}var Ee=5*L.CesiumMath.EPSILON9,Ne=L.CesiumMath.EPSILON6;r.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(V.defined(r)&&(0<r.center.x-r.radius||z.BoundingSphere.intersectPlane(r,a.Plane.ORIGIN_ZX_PLANE)!==z.Intersect.INTERSECTING))return e;if(t.geometryType!==O.GeometryType.NONE)switch(t.geometryType){case O.GeometryType.POLYLINES:!function(e){for(var t=e.geometry,r=t.attributes,a=r.position.values,n=r.prevPosition.values,i=r.nextPosition.values,s=r.expandAndWidth.values,o=V.defined(r.st)?r.st.values:void 0,u=V.defined(r.color)?r.color.values:void 0,p=$(t),d=$(t),l=!1,y=a.length/3,f=0;f<y;f+=4){var v=f,c=f+2,m=R.Cartesian3.fromArray(a,3*v,Ae),C=R.Cartesian3.fromArray(a,3*c,Te);if(Math.abs(m.y)<Ne)for(m.y=Ne*(C.y<0?-1:1),a[3*f+1]=m.y,a[3*(f+1)+1]=m.y,O=3*v;O<3*v+12;O+=3)n[O]=a[3*f],n[O+1]=a[3*f+1],n[O+2]=a[3*f+2];if(Math.abs(C.y)<Ne)for(C.y=Ne*(m.y<0?-1:1),a[3*(f+2)+1]=C.y,a[3*(f+3)+1]=C.y,O=3*v;O<3*v+12;O+=3)i[O]=a[3*(f+2)],i[O+1]=a[3*(f+2)+1],i[O+2]=a[3*(f+2)+2];var h=p.attributes,b=p.indices,g=d.attributes,A=d.indices,T=D.IntersectionTests.lineSegmentPlane(m,C,ve,Pe);if(V.defined(T)){var l=!0,x=R.Cartesian3.multiplyByScalar(R.Cartesian3.UNIT_Y,Ee,we);m.y<0&&(R.Cartesian3.negate(x,x),h=d.attributes,b=d.indices,g=p.attributes,A=p.indices);var P=R.Cartesian3.add(T,x,Se);h.position.values.push(m.x,m.y,m.z,m.x,m.y,m.z),h.position.values.push(P.x,P.y,P.z),h.position.values.push(P.x,P.y,P.z),h.prevPosition.values.push(n[3*v],n[3*v+1],n[3*v+2]),h.prevPosition.values.push(n[3*v+3],n[3*v+4],n[3*v+5]),h.prevPosition.values.push(m.x,m.y,m.z,m.x,m.y,m.z),h.nextPosition.values.push(P.x,P.y,P.z),h.nextPosition.values.push(P.x,P.y,P.z),h.nextPosition.values.push(P.x,P.y,P.z),h.nextPosition.values.push(P.x,P.y,P.z),R.Cartesian3.negate(x,x),R.Cartesian3.add(T,x,P),g.position.values.push(P.x,P.y,P.z),g.position.values.push(P.x,P.y,P.z),g.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),g.prevPosition.values.push(P.x,P.y,P.z),g.prevPosition.values.push(P.x,P.y,P.z),g.prevPosition.values.push(P.x,P.y,P.z),g.prevPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),g.nextPosition.values.push(i[3*c],i[3*c+1],i[3*c+2]),g.nextPosition.values.push(i[3*c+3],i[3*c+4],i[3*c+5]);var w=R.Cartesian2.fromArray(s,2*v,be),S=Math.abs(w.y);h.expandAndWidth.values.push(-1,S,1,S),h.expandAndWidth.values.push(-1,-S,1,-S),g.expandAndWidth.values.push(-1,S,1,S),g.expandAndWidth.values.push(-1,-S,1,-S);x=R.Cartesian3.magnitudeSquared(R.Cartesian3.subtract(T,m,xe));if(x/=R.Cartesian3.magnitudeSquared(R.Cartesian3.subtract(C,m,xe)),V.defined(u)){for(var P=z.Cartesian4.fromArray(u,4*v,Ie),I=z.Cartesian4.fromArray(u,4*c,Ie),w=L.CesiumMath.lerp(P.x,I.x,x),S=L.CesiumMath.lerp(P.y,I.y,x),T=L.CesiumMath.lerp(P.z,I.z,x),I=L.CesiumMath.lerp(P.w,I.w,x),O=4*v;O<4*v+8;++O)h.color.values.push(u[O]);for(h.color.values.push(w,S,T,I),h.color.values.push(w,S,T,I),g.color.values.push(w,S,T,I),g.color.values.push(w,S,T,I),O=4*c;O<4*c+8;++O)g.color.values.push(u[O])}if(V.defined(o)){var I=R.Cartesian2.fromArray(o,2*v,be),E=R.Cartesian2.fromArray(o,2*(f+3),ge),x=L.CesiumMath.lerp(I.x,E.x,x);for(O=2*v;O<2*v+4;++O)h.st.values.push(o[O]);for(h.st.values.push(x,I.y),h.st.values.push(x,E.y),g.st.values.push(x,I.y),g.st.values.push(x,E.y),O=2*c;O<2*c+4;++O)g.st.values.push(o[O])}E=h.position.values.length/3-4,b.push(E,E+2,E+1),b.push(E+1,E+2,E+3),E=g.position.values.length/3-4,A.push(E,E+2,E+1),A.push(E+1,E+2,E+3)}else{var N,A=m.y<0?(N=d.attributes,d.indices):(N=p.attributes,p.indices);for(N.position.values.push(m.x,m.y,m.z),N.position.values.push(m.x,m.y,m.z),N.position.values.push(C.x,C.y,C.z),N.position.values.push(C.x,C.y,C.z),O=3*f;O<3*f+12;++O)N.prevPosition.values.push(n[O]),N.nextPosition.values.push(i[O]);for(O=2*f;O<2*f+8;++O)N.expandAndWidth.values.push(s[O]),V.defined(o)&&N.st.values.push(o[O]);if(V.defined(u))for(O=4*f;O<4*f+16;++O)N.color.values.push(u[O]);E=N.position.values.length/3-4,A.push(E,E+2,E+1),A.push(E+1,E+2,E+3)}}l&&(Oe(d),Oe(p)),ee(e,d,p)}(e);break;case O.GeometryType.TRIANGLES:fe(e);break;case O.GeometryType.LINES:he(e)}else C(t),t.primitiveType===O.PrimitiveType.TRIANGLES?fe(e):t.primitiveType===O.PrimitiveType.LINES&&he(e);return e},e.GeometryPipeline=r}); diff --git a/public/Cesium/Workers/GeometryPipeline-5e672526.js b/public/Cesium/Workers/GeometryPipeline-5e672526.js deleted file mode 100644 index a575232..0000000 --- a/public/Cesium/Workers/GeometryPipeline-5e672526.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./AttributeCompression-f02ec82f","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694","./Transforms-a73b3b3b","./ComponentDatatype-9204e9f6","./EncodedCartesian3-874933de","./GeometryAttribute-04a19cfe","./IndexDatatype-d47ad6f6","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(e,A,R,t,V,L,z,w,d,S,P,D,a){"use strict";var g=new R.Cartesian3,T=new R.Cartesian3,x=new R.Cartesian3;var s={calculateACMR:function(e){var t=(e=V.defaultValue(e,V.defaultValue.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=V.defaultValue(e.cacheSize,24),n=t.length;if(!V.defined(r))for(var r=0,i=0,s=t[i];i<n;)r<s&&(r=s),s=t[++i];for(var o=[],u=0;u<r+1;u++)o[u]=0;for(var p=a+1,d=0;d<n;++d)p-o[t[d]]>a&&(o[t[d]]=p,++p);return(p-a+1)/(n/3)}};s.tipsify=function(e){var t=(e=V.defaultValue(e,V.defaultValue.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=V.defaultValue(e.cacheSize,24);function n(e,t,r,a,n,i,s){for(var o,u=-1,p=-1,d=0;d<r.length;){var l=r[d];a[l].numLiveTriangles&&(o=0,(p<(o=n-a[l].timeStamp+2*a[l].numLiveTriangles<=t?n-a[l].timeStamp:o)||-1===p)&&(p=o,u=l)),++d}return-1===u?function(e,t,r){for(;1<=t.length;){var a=t[t.length-1];if(t.splice(t.length-1,1),0<e[a].numLiveTriangles)return a}for(;v<r;){if(0<e[v].numLiveTriangles)return++v-1;++v}return-1}(a,i,s):u}var e=t.length,i=0,s=t[P=0],o=e;if(V.defined(r))i=r+1;else{for(;P<o;)i<s&&(i=s),s=t[++P];if(-1===i)return 0;++i}for(var u=[],p=0;p<i;p++)u[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};for(var d=P=0;P<o;)u[t[P]].vertexTriangles.push(d),++u[t[P]].numLiveTriangles,u[t[P+1]].vertexTriangles.push(d),++u[t[P+1]].numLiveTriangles,u[t[P+2]].vertexTriangles.push(d),++u[t[P+2]].numLiveTriangles,++d,P+=3;var l,y=0,f=a+1,v=1,c=[],m=[],C=0,h=[],b=e/3,g=[];for(p=0;p<b;p++)g[p]=!1;for(;-1!==y;){for(var A,c=[],T=(A=u[y]).vertexTriangles.length,x=0;x<T;++x)if(!g[d=A.vertexTriangles[x]]){g[d]=!0;for(var P=d+d+d,w=0;w<3;++w)l=t[P],c.push(l),m.push(l),h[C]=l,++C,--(l=u[l]).numLiveTriangles,f-l.timeStamp>a&&(l.timeStamp=f,++f),++P}y=n(0,a,c,u,f,m,i)}return h};var r={};function o(e,t,r,a,n){e[t++]=r,e[t++]=a,e[t++]=a,e[t++]=n,e[t++]=n,e[t]=r}function v(e){var t,r,a={};for(t in e)e.hasOwnProperty(t)&&V.defined(e[t])&&V.defined(e[t].values)&&(r=e[t],a[t]=new S.GeometryAttribute({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]}));return a}r.toWireframe=function(e){var t=e.indices;if(V.defined(t)){switch(e.primitiveType){case S.PrimitiveType.TRIANGLES:e.indices=function(e){for(var t=e.length,r=t/3*6,a=P.IndexDatatype.createTypedArray(t,r),n=0,i=0;i<t;i+=3,n+=6)o(a,n,e[i],e[i+1],e[i+2]);return a}(t);break;case S.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){var t=e.length;if(3<=t){var r=6*(t-2),a=P.IndexDatatype.createTypedArray(t,r);o(a,0,e[0],e[1],e[2]);for(var n=6,i=3;i<t;++i,n+=6)o(a,n,e[i-1],e[i],e[i-2]);return a}return new Uint16Array}(t);break;case S.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(0<e.length){for(var t=e.length-1,r=6*(t-1),a=P.IndexDatatype.createTypedArray(t,r),n=e[0],i=0,s=1;s<t;++s,i+=6)o(a,i,n,e[s],e[s+1]);return a}return new Uint16Array}(t)}e.primitiveType=S.PrimitiveType.LINES}return e},r.createLineSegmentsForVectors=function(e,t,r){t=V.defaultValue(t,"normal"),r=V.defaultValue(r,1e4);for(var a,n=e.attributes.position.values,i=e.attributes[t].values,s=n.length,o=new Float64Array(2*s),u=0,p=0;p<s;p+=3)o[u++]=n[p],o[u++]=n[p+1],o[u++]=n[p+2],o[u++]=n[p]+i[p]*r,o[u++]=n[p+1]+i[p+1]*r,o[u++]=n[p+2]+i[p+2]*r;e=e.boundingSphere;return V.defined(e)&&(a=new z.BoundingSphere(e.center,e.radius+r)),new S.Geometry({attributes:{position:new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:S.PrimitiveType.LINES,boundingSphere:a})},r.createAttributeLocations=function(e){for(var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],a=e.attributes,n={},i=0,s=r.length,o=0;o<s;++o){var u=r[o];V.defined(a[u])&&(n[u]=i++)}for(t in a)a.hasOwnProperty(t)&&!V.defined(n[t])&&(n[t]=i++);return n},r.reorderForPreVertexCache=function(e){var t=S.Geometry.computeNumberOfVertices(e),r=e.indices;if(V.defined(r)){for(var a=new Int32Array(t),n=0;n<t;n++)a[n]=-1;for(var i,s=r,o=s.length,u=P.IndexDatatype.createTypedArray(t,o),p=0,d=0,l=0;p<o;)-1!==(i=a[s[p]])?u[d]=i:(a[i=s[p]]=l,u[d]=l,++l),++p,++d;e.indices=u;var y,f=e.attributes;for(y in f)if(f.hasOwnProperty(y)&&V.defined(f[y])&&V.defined(f[y].values)){for(var v=f[y],c=v.values,m=0,C=v.componentsPerAttribute,h=w.ComponentDatatype.createTypedArray(v.componentDatatype,l*C);m<t;){var b=a[m];if(-1!==b)for(var g=0;g<C;g++)h[C*b+g]=c[C*m+g];++m}v.values=h}}return e},r.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.PrimitiveType.TRIANGLES&&V.defined(r)){for(var a=r.length,n=0,i=0;i<a;i++)r[i]>n&&(n=r[i]);e.indices=s.tipsify({indices:r,maximumIndex:n,cacheSize:t})}return e},r.fitToUnsignedShortIndices=function(e){var t=[],r=S.Geometry.computeNumberOfVertices(e);if(V.defined(e.indices)&&r>=L.CesiumMath.SIXTY_FOUR_KILOBYTES){var a,n=[],i=[],s=0,o=v(e.attributes),u=e.indices,p=u.length;e.primitiveType===S.PrimitiveType.TRIANGLES?a=3:e.primitiveType===S.PrimitiveType.LINES?a=2:e.primitiveType===S.PrimitiveType.POINTS&&(a=1);for(var d=0;d<p;d+=a){for(var l=0;l<a;++l){var y=u[d+l],f=n[y];V.defined(f)||(f=s++,n[y]=f,function(e,t,r){for(var a in t)if(t.hasOwnProperty(a)&&V.defined(t[a])&&V.defined(t[a].values))for(var n=t[a],i=0;i<n.componentsPerAttribute;++i)e[a].values.push(n.values[r*n.componentsPerAttribute+i])}(o,e.attributes,y)),i.push(f)}s+a>=L.CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new S.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],s=0,o=v(e.attributes))}0!==i.length&&t.push(new S.Geometry({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var y=new R.Cartesian3,f=new R.Cartographic;r.projectTo2D=function(e,t,r,a,n){for(var i=e.attributes[t],s=(n=V.defined(n)?n:new z.GeographicProjection).ellipsoid,o=i.values,u=new Float64Array(o.length),p=0,d=0;d<o.length;d+=3){var l=R.Cartesian3.fromArray(o,d,y),l=s.cartesianToCartographic(l,f),l=n.project(l,y);u[p++]=l.x,u[p++]=l.y,u[p++]=l.z}return e.attributes[r]=i,e.attributes[a]=new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u}),delete e.attributes[t],e};var l={high:0,low:0};r.encodeAttribute=function(e,t,r,a){for(var n=e.attributes[t],i=n.values,s=i.length,o=new Float32Array(s),u=new Float32Array(s),p=0;p<s;++p)d.EncodedCartesian3.encode(i[p],l),o[p]=l.high,u[p]=l.low;n=n.componentsPerAttribute;return e.attributes[r]=new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:n,values:o}),e.attributes[a]=new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:n,values:u}),delete e.attributes[t],e};var i=new R.Cartesian3;function n(e,t){if(V.defined(t))for(var r=t.values,a=r.length,n=0;n<a;n+=3)R.Cartesian3.unpack(r,n,i),z.Matrix4.multiplyByPoint(e,i,i),R.Cartesian3.pack(i,r,n)}function u(e,t){if(V.defined(t))for(var r=t.values,a=r.length,n=0;n<a;n+=3)R.Cartesian3.unpack(r,n,i),z.Matrix3.multiplyByVector(e,i,i),i=R.Cartesian3.normalize(i,i),R.Cartesian3.pack(i,r,n)}var p=new z.Matrix4,c=new z.Matrix3;r.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(z.Matrix4.equals(t,z.Matrix4.IDENTITY))return e;var r=e.geometry.attributes;n(t,r.position),n(t,r.prevPosition),n(t,r.nextPosition),(V.defined(r.normal)||V.defined(r.tangent)||V.defined(r.bitangent))&&(z.Matrix4.inverse(t,p),z.Matrix4.transpose(p,p),z.Matrix4.getMatrix3(p,c),u(c,r.normal),u(c,r.tangent),u(c,r.bitangent));r=e.geometry.boundingSphere;return V.defined(r)&&(e.geometry.boundingSphere=z.BoundingSphere.transform(r,t,r)),e.modelMatrix=z.Matrix4.clone(z.Matrix4.IDENTITY),e};var I=new R.Cartesian3;function m(e,t){var r,a,n=e.length;e[0].modelMatrix;var i,s,o,u=V.defined(e[0][t].indices),p=e[0][t].primitiveType,d=function(e,t){var r,a=e.length,n={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&V.defined(i[r])&&V.defined(i[r].values)){for(var s=i[r],o=s.values.length,u=!0,p=1;p<a;++p){var d=e[p][t].attributes[r];if(!V.defined(d)||s.componentDatatype!==d.componentDatatype||s.componentsPerAttribute!==d.componentsPerAttribute||s.normalize!==d.normalize){u=!1;break}o+=d.values.length}u&&(n[r]=new S.GeometryAttribute({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:w.ComponentDatatype.createTypedArray(s.componentDatatype,o)}))}return n}(e,t);for(r in d)if(d.hasOwnProperty(r))for(i=d[r].values,y=b=0;y<n;++y)for(o=(s=e[y][t].attributes[r].values).length,a=0;a<o;++a)i[b++]=s[a];if(u){for(var l=0,y=0;y<n;++y)l+=e[y][t].indices.length;var f=S.Geometry.computeNumberOfVertices(new S.Geometry({attributes:d,primitiveType:S.PrimitiveType.POINTS})),v=P.IndexDatatype.createTypedArray(f,l),c=0,m=0;for(y=0;y<n;++y){for(var C=e[y][t].indices,h=C.length,b=0;b<h;++b)v[c++]=m+C[b];m+=S.Geometry.computeNumberOfVertices(e[y][t])}f=v}var g=new R.Cartesian3,A=0;for(y=0;y<n;++y){if(T=e[y][t].boundingSphere,!V.defined(T)){g=void 0;break}R.Cartesian3.add(T.center,g,g)}if(V.defined(g))for(R.Cartesian3.divideByScalar(g,n,g),y=0;y<n;++y){var T=e[y][t].boundingSphere,x=R.Cartesian3.magnitude(R.Cartesian3.subtract(T.center,g,I))+T.radius;A<x&&(A=x)}return new S.Geometry({attributes:d,indices:f,primitiveType:p,boundingSphere:V.defined(g)?new z.BoundingSphere(g,A):void 0})}r.combineInstances=function(e){for(var t=[],r=[],a=e.length,n=0;n<a;++n){var i=e[n];V.defined(i.geometry)?t.push(i):V.defined(i.westHemisphereGeometry)&&V.defined(i.eastHemisphereGeometry)&&r.push(i)}var s=[];return 0<t.length&&s.push(m(t,"geometry")),0<r.length&&(s.push(m(r,"westHemisphereGeometry")),s.push(m(r,"eastHemisphereGeometry"))),s};var O=new R.Cartesian3,E=new R.Cartesian3,N=new R.Cartesian3,M=new R.Cartesian3;r.computeNormal=function(e){for(var t=e.indices,r=e.attributes,a=r.position.values,n=r.position.values.length/3,i=t.length,s=new Array(n),o=new Array(i/3),u=new Array(i),p=0;p<n;p++)s[p]={indexOffset:0,count:0,currentCount:0};var d=0;for(p=0;p<i;p+=3){var l=t[p],y=t[p+1],f=t[p+2],v=3*l,c=3*y,m=3*f;E.x=a[v],E.y=a[1+v],E.z=a[2+v],N.x=a[c],N.y=a[1+c],N.z=a[2+c],M.x=a[m],M.y=a[1+m],M.z=a[2+m],s[l].count++,s[y].count++,s[f].count++,R.Cartesian3.subtract(N,E,N),R.Cartesian3.subtract(M,E,M),o[d]=R.Cartesian3.cross(N,M,new R.Cartesian3),d++}var C=0;for(p=0;p<n;p++)s[p].indexOffset+=C,C+=s[p].count;for(p=d=0;p<i;p+=3){var h,b=(h=s[t[p]]).indexOffset+h.currentCount;u[b]=d,h.currentCount++,u[(h=s[t[p+1]]).indexOffset+h.currentCount]=d,h.currentCount++,u[(h=s[t[p+2]]).indexOffset+h.currentCount]=d,h.currentCount++,d++}var g=new Float32Array(3*n);for(p=0;p<n;p++){var A=3*p;if(h=s[p],R.Cartesian3.clone(R.Cartesian3.ZERO,O),0<h.count){for(d=0;d<h.count;d++)R.Cartesian3.add(O,o[u[h.indexOffset+d]],O);R.Cartesian3.equalsEpsilon(R.Cartesian3.ZERO,O,L.CesiumMath.EPSILON10)&&R.Cartesian3.clone(o[u[h.indexOffset]],O)}R.Cartesian3.equalsEpsilon(R.Cartesian3.ZERO,O,L.CesiumMath.EPSILON10)&&(O.z=1),R.Cartesian3.normalize(O,O),g[A]=O.x,g[1+A]=O.y,g[2+A]=O.z}return e.attributes.normal=new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g}),e};var G=new R.Cartesian3,F=new R.Cartesian3,B=new R.Cartesian3;r.computeTangentAndBitangent=function(e){e.attributes;for(var t=e.indices,r=e.attributes.position.values,a=e.attributes.normal.values,n=e.attributes.st.values,i=e.attributes.position.values.length/3,s=t.length,o=new Array(3*i),u=0;u<o.length;u++)o[u]=0;for(u=0;u<s;u+=3){var p,d=t[u],l=t[u+1],y=t[u+2],f=3*l,v=3*y,c=2*d,m=2*l,C=2*y,h=r[p=3*d],b=r[p+1],l=r[p+2],y=n[c],d=n[1+c],c=n[1+m]-d,d=n[1+C]-d,y=1/((n[m]-y)*d-(n[C]-y)*c),h=(d*(r[f]-h)-c*(r[v]-h))*y,b=(d*(r[f+1]-b)-c*(r[v+1]-b))*y,y=(d*(r[f+2]-l)-c*(r[v+2]-l))*y;o[p]+=h,o[p+1]+=b,o[p+2]+=y,o[f]+=h,o[f+1]+=b,o[f+2]+=y,o[v]+=h,o[v+1]+=b,o[v+2]+=y}var g=new Float32Array(3*i),A=new Float32Array(3*i);for(u=0;u<i;u++){f=(p=3*u)+1,v=p+2;var T=R.Cartesian3.fromArray(a,p,G),x=R.Cartesian3.fromArray(o,p,B),P=R.Cartesian3.dot(T,x);R.Cartesian3.multiplyByScalar(T,P,F),R.Cartesian3.normalize(R.Cartesian3.subtract(x,F,x),x),g[p]=x.x,g[f]=x.y,g[v]=x.z,R.Cartesian3.normalize(R.Cartesian3.cross(T,x,x),x),A[p]=x.x,A[f]=x.y,A[v]=x.z}return e.attributes.tangent=new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:A}),e};var k=new R.Cartesian2,_=new R.Cartesian3,q=new R.Cartesian3,U=new R.Cartesian3,Y=new R.Cartesian2;function C(e){switch(e.primitiveType){case S.PrimitiveType.TRIANGLE_FAN:return function(e){var t=S.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var a=3,n=3;n<t;++n)r[a++]=n-1,r[a++]=0,r[a++]=n;return e.indices=r,e.primitiveType=S.PrimitiveType.TRIANGLES,e}(e);case S.PrimitiveType.TRIANGLE_STRIP:return function(e){var t=S.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,3<t&&(r[3]=0,r[4]=2,r[5]=3);for(var a=6,n=3;n<t-1;n+=2)r[a++]=n,r[a++]=n-1,r[a++]=n+1,n+2<t&&(r[a++]=n,r[a++]=n+1,r[a++]=n+2);return e.indices=r,e.primitiveType=S.PrimitiveType.TRIANGLES,e}(e);case S.PrimitiveType.TRIANGLES:return function(e){if(V.defined(e.indices))return e;for(var t=S.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,t),a=0;a<t;++a)r[a]=a;return e.indices=r,e}(e);case S.PrimitiveType.LINE_STRIP:return function(e){var t=S.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var a=2,n=2;n<t;++n)r[a++]=n-1,r[a++]=n;return e.indices=r,e.primitiveType=S.PrimitiveType.LINES,e}(e);case S.PrimitiveType.LINE_LOOP:return function(e){var t=S.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var a=2,n=2;n<t;++n)r[a++]=n-1,r[a++]=n;return r[a++]=t-1,r[a]=0,e.indices=r,e.primitiveType=S.PrimitiveType.LINES,e}(e);case S.PrimitiveType.LINES:return function(e){if(V.defined(e.indices))return e;for(var t=S.Geometry.computeNumberOfVertices(e),r=P.IndexDatatype.createTypedArray(t,t),a=0;a<t;++a)r[a]=a;return e.indices=r,e}(e)}return e}function h(e,t){Math.abs(e.y)<L.CesiumMath.EPSILON6&&(e.y=t?-L.CesiumMath.EPSILON6:L.CesiumMath.EPSILON6)}r.compressVertices=function(e){var t=e.attributes.extrudeDirection;if(V.defined(t)){for(var r=t.values,a=r.length/3,n=new Float32Array(2*a),i=0,s=0;s<a;++s)R.Cartesian3.fromArray(r,3*s,_),R.Cartesian3.equals(_,R.Cartesian3.ZERO)?i+=2:(Y=A.AttributeCompression.octEncodeInRange(_,65535,Y),n[i++]=Y.x,n[i++]=Y.y);return e.attributes.compressedAttributes=new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:n}),delete e.attributes.extrudeDirection,e}var o=e.attributes.normal,u=e.attributes.st,p=V.defined(o),d=V.defined(u);if(!p&&!d)return e;var l,y,f,v,c=e.attributes.tangent,t=e.attributes.bitangent,m=V.defined(c),C=V.defined(t);p&&(l=o.values),d&&(y=u.values),m&&(f=c.values),C&&(v=t.values);c=a=(p?l:y).length/(p?3:2),t=d&&p?2:1;c*=t+=m||C?1:0;var h=new Float32Array(c),b=0;for(s=0;s<a;++s){d&&(R.Cartesian2.fromArray(y,2*s,k),h[b++]=A.AttributeCompression.compressTextureCoordinates(k));var g=3*s;p&&V.defined(f)&&V.defined(v)?(R.Cartesian3.fromArray(l,g,_),R.Cartesian3.fromArray(f,g,q),R.Cartesian3.fromArray(v,g,U),A.AttributeCompression.octPack(_,q,U,k),h[b++]=k.x,h[b++]=k.y):(p&&(R.Cartesian3.fromArray(l,g,_),h[b++]=A.AttributeCompression.octEncodeFloat(_)),m&&(R.Cartesian3.fromArray(f,g,_),h[b++]=A.AttributeCompression.octEncodeFloat(_)),C&&(R.Cartesian3.fromArray(v,g,_),h[b++]=A.AttributeCompression.octEncodeFloat(_)))}return e.attributes.compressedAttributes=new S.GeometryAttribute({componentDatatype:w.ComponentDatatype.FLOAT,componentsPerAttribute:t,values:h}),p&&delete e.attributes.normal,d&&delete e.attributes.st,C&&delete e.attributes.bitangent,m&&delete e.attributes.tangent,e};var b=new R.Cartesian3;function Z(e,t,r,a){R.Cartesian3.add(e,R.Cartesian3.multiplyByScalar(R.Cartesian3.subtract(t,e,b),e.y/(e.y-t.y),b),r),R.Cartesian3.clone(r,a),h(r,!0),h(a,!1)}var H=new R.Cartesian3,W=new R.Cartesian3,X=new R.Cartesian3,j=new R.Cartesian3,J={positions:new Array(7),indices:new Array(9)};function K(e,t,r){if(!(0<=e.x||0<=t.x||0<=r.x)){!function(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return h(e,e.y<0),h(t,t.y<0),h(r,r.y<0);var a=Math.abs(e.y),n=Math.abs(t.y),i=Math.abs(r.y),n=n<a?i<a?L.CesiumMath.sign(e.y):L.CesiumMath.sign(r.y):i<n?L.CesiumMath.sign(t.y):L.CesiumMath.sign(r.y);h(e,n=n<0),h(t,n),h(r,n)}(e,t,r);var a=e.y<0,n=t.y<0,i=r.y<0,s=0;s+=a?1:0,s+=n?1:0,s+=i?1:0;var o=J.indices;1==s?(o[1]=3,o[2]=4,o[5]=6,o[7]=6,o[8]=5,a?(Z(e,t,H,X),Z(e,r,W,j),o[0]=0,o[3]=1,o[4]=2,o[6]=1):n?(Z(t,r,H,X),Z(t,e,W,j),o[0]=1,o[3]=2,o[4]=0,o[6]=2):i&&(Z(r,e,H,X),Z(r,t,W,j),o[0]=2,o[3]=0,o[4]=1,o[6]=0)):2==s&&(o[2]=4,o[4]=4,o[5]=3,o[7]=5,o[8]=6,a?n?i||(Z(r,e,H,X),Z(r,t,W,j),o[0]=0,o[1]=1,o[3]=0,o[6]=2):(Z(t,r,H,X),Z(t,e,W,j),o[0]=2,o[1]=0,o[3]=2,o[6]=1):(Z(e,t,H,X),Z(e,r,W,j),o[0]=1,o[1]=2,o[3]=1,o[6]=0));o=J.positions;return o[0]=e,o[1]=t,o[2]=r,o.length=3,1!=s&&2!=s||(o[3]=H,o[4]=W,o[5]=X,o[6]=j,o.length=7),J}}function Q(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)r.hasOwnProperty(a)&&V.defined(r[a])&&V.defined(r[a].values)&&((a=r[a]).values=w.ComponentDatatype.createTypedArray(a.componentDatatype,a.values));var n=S.Geometry.computeNumberOfVertices(e);return e.indices=P.IndexDatatype.createTypedArray(n,e.indices),t&&(e.boundingSphere=z.BoundingSphere.fromVertices(r.position.values)),e}}function $(e){var t,r,a=e.attributes,n={};for(t in a)a.hasOwnProperty(t)&&V.defined(a[t])&&V.defined(a[t].values)&&(r=a[t],n[t]=new S.GeometryAttribute({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]}));return new S.Geometry({attributes:n,indices:[],primitiveType:e.primitiveType})}function ee(e,t,r){var a=V.defined(e.geometry.boundingSphere);t=Q(t,a),r=Q(r,a),V.defined(r)&&!V.defined(t)?e.geometry=r:!V.defined(r)&&V.defined(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function te(u,p){var d=new u,l=new u,y=new u;return function(e,t,r,a,n,i,s,o){e=u.fromArray(n,e*p,d),t=u.fromArray(n,t*p,l),r=u.fromArray(n,r*p,y);u.multiplyByScalar(e,a.x,e),u.multiplyByScalar(t,a.y,t),u.multiplyByScalar(r,a.z,r);e=u.add(e,t,e);u.add(e,r,e),o&&u.normalize(e,e),u.pack(e,i,s*p)}}var re=te(z.Cartesian4,4),ae=te(R.Cartesian3,3),ne=te(R.Cartesian2,2),ie=function(e,t,r,a,n,i,s){e=n[e]*a.x,t=n[t]*a.y,a=n[r]*a.z;i[s]=e+t+a>L.CesiumMath.EPSILON6?1:0},se=new R.Cartesian3,oe=new R.Cartesian3,ue=new R.Cartesian3,pe=new R.Cartesian3;function de(e,t,r,a,n,i,s,o,u,p,d,l,y,f,v,c){if(V.defined(i)||V.defined(s)||V.defined(o)||V.defined(u)||V.defined(p)||0!==f){var m,C=function(e,t,r,a,n){var i,s,o,u,p,d,l;if(V.defined(n)||(n=new R.Cartesian3),V.defined(t.z)){if(R.Cartesian3.equalsEpsilon(e,t,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_X,n);if(R.Cartesian3.equalsEpsilon(e,r,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_Y,n);if(R.Cartesian3.equalsEpsilon(e,a,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_Z,n);i=R.Cartesian3.subtract(r,t,g),s=R.Cartesian3.subtract(a,t,T),o=R.Cartesian3.subtract(e,t,x),u=R.Cartesian3.dot(i,i),y=R.Cartesian3.dot(i,s),p=R.Cartesian3.dot(i,o),d=R.Cartesian3.dot(s,s),l=R.Cartesian3.dot(s,o)}else{if(R.Cartesian2.equalsEpsilon(e,t,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_X,n);if(R.Cartesian2.equalsEpsilon(e,r,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_Y,n);if(R.Cartesian2.equalsEpsilon(e,a,L.CesiumMath.EPSILON14))return R.Cartesian3.clone(R.Cartesian3.UNIT_Z,n);i=R.Cartesian2.subtract(r,t,g),s=R.Cartesian2.subtract(a,t,T),o=R.Cartesian2.subtract(e,t,x),u=R.Cartesian2.dot(i,i),y=R.Cartesian2.dot(i,s),p=R.Cartesian2.dot(i,o),d=R.Cartesian2.dot(s,s),l=R.Cartesian2.dot(s,o)}n.y=d*p-y*l,n.z=u*l-y*p;var y=u*d-y*y;return 0!==n.y&&(n.y/=y),0!==n.z&&(n.z/=y),n.x=1-n.y-n.z,n}(a,R.Cartesian3.fromArray(n,3*e,se),R.Cartesian3.fromArray(n,3*t,oe),R.Cartesian3.fromArray(n,3*r,ue),pe);if(V.defined(i)&&ae(e,t,r,C,i,l.normal.values,c,!0),V.defined(p)&&(n=R.Cartesian3.fromArray(p,3*e,se),i=R.Cartesian3.fromArray(p,3*t,oe),p=R.Cartesian3.fromArray(p,3*r,ue),R.Cartesian3.multiplyByScalar(n,C.x,n),R.Cartesian3.multiplyByScalar(i,C.y,i),R.Cartesian3.multiplyByScalar(p,C.z,p),R.Cartesian3.equals(n,R.Cartesian3.ZERO)&&R.Cartesian3.equals(i,R.Cartesian3.ZERO)&&R.Cartesian3.equals(p,R.Cartesian3.ZERO)?((m=se).x=0,m.y=0,m.z=0):(m=R.Cartesian3.add(n,i,n),R.Cartesian3.add(m,p,m),R.Cartesian3.normalize(m,m)),R.Cartesian3.pack(m,l.extrudeDirection.values,3*c)),V.defined(d)&&ie(e,t,r,C,d,l.applyOffset.values,c),V.defined(s)&&ae(e,t,r,C,s,l.tangent.values,c,!0),V.defined(o)&&ae(e,t,r,C,o,l.bitangent.values,c,!0),V.defined(u)&&ne(e,t,r,C,u,l.st.values,c),0<f)for(var h=0;h<f;h++){var b=y[h];!function(e,t,r,a,n,i,s){var o=i.componentsPerAttribute,u=i.values,p=s.values;switch(o){case 4:re(e,t,r,a,u,p,n,!1);break;case 3:ae(e,t,r,a,u,p,n,!1);break;case 2:ne(e,t,r,a,u,p,n,!1);break;default:p[n]=u[e]*a.x+u[t]*a.y+u[r]*a.z}}(e,t,r,C,c,v[b],l[b])}}}function le(e,t,r,a,n,i){var s=e.position.values.length/3;if(-1===n)return e.position.values.push(i.x,i.y,i.z),t.push(s),s;a=a[n],n=r[a];return-1===n?(r[a]=s,e.position.values.push(i.x,i.y,i.z),t.push(s),s):(t.push(n),n)}var ye={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function fe(e){var t,r=e.geometry,a=r.attributes,n=a.position.values,i=V.defined(a.normal)?a.normal.values:void 0,s=V.defined(a.bitangent)?a.bitangent.values:void 0,o=V.defined(a.tangent)?a.tangent.values:void 0,u=V.defined(a.st)?a.st.values:void 0,p=V.defined(a.extrudeDirection)?a.extrudeDirection.values:void 0,d=V.defined(a.applyOffset)?a.applyOffset.values:void 0,l=r.indices,y=[];for(t in a)a.hasOwnProperty(t)&&!ye[t]&&V.defined(a[t])&&y.push(t);var f,v,c=y.length,m=$(r),C=$(r),h=[];h.length=n.length/3;var b=[];for(b.length=n.length/3,A=0;A<h.length;++A)h[A]=-1,b[A]=-1;for(var g=l.length,A=0;A<g;A+=3){var T=l[A],x=l[A+1],P=l[A+2],w=R.Cartesian3.fromArray(n,3*T),S=R.Cartesian3.fromArray(n,3*x),I=R.Cartesian3.fromArray(n,3*P),O=K(w,S,I);if(V.defined(O)&&3<O.positions.length)for(var E=O.positions,N=O.indices,L=N.length,z=0;z<L;++z){var D=N[z],M=E[D],G=M.y<0?(f=C.attributes,v=C.indices,h):(f=m.attributes,v=m.indices,b);de(T,x,P,M,n,i,o,s,u,p,d,f,y,c,a,le(f,v,G,l,D<3?A+D:-1,M))}else V.defined(O)&&(w=O.positions[0],S=O.positions[1],I=O.positions[2]),G=w.y<0?(f=C.attributes,v=C.indices,h):(f=m.attributes,v=m.indices,b),de(T,x,P,w,n,i,o,s,u,p,d,f,y,c,a,le(f,v,G,l,A,w)),de(T,x,P,S,n,i,o,s,u,p,d,f,y,c,a,le(f,v,G,l,A+1,S)),de(T,x,P,I,n,i,o,s,u,p,d,f,y,c,a,le(f,v,G,l,A+2,I))}ee(e,C,m)}var ve=a.Plane.fromPointNormal(R.Cartesian3.ZERO,R.Cartesian3.UNIT_Y),ce=new R.Cartesian3,me=new R.Cartesian3;function Ce(e,t,r,a,n,i,s){V.defined(s)&&(a=R.Cartesian3.fromArray(a,3*e,se),R.Cartesian3.equalsEpsilon(a,r,L.CesiumMath.EPSILON10)?i.applyOffset.values[n]=s[e]:i.applyOffset.values[n]=s[t])}function he(e){var t,r=e.geometry,a=r.attributes,n=a.position.values,i=V.defined(a.applyOffset)?a.applyOffset.values:void 0,s=r.indices,o=$(r),u=$(r),p=s.length,d=[];d.length=n.length/3;var l=[];for(l.length=n.length/3,t=0;t<d.length;++t)d[t]=-1,l[t]=-1;for(t=0;t<p;t+=2){var y=s[t],f=s[t+1],v=R.Cartesian3.fromArray(n,3*y,se),c=R.Cartesian3.fromArray(n,3*f,oe);Math.abs(v.y)<L.CesiumMath.EPSILON6&&(v.y<0?v.y=-L.CesiumMath.EPSILON6:v.y=L.CesiumMath.EPSILON6),Math.abs(c.y)<L.CesiumMath.EPSILON6&&(c.y<0?c.y=-L.CesiumMath.EPSILON6:c.y=L.CesiumMath.EPSILON6);var m,C,h,b,g=o.attributes,A=o.indices,T=l,x=u.attributes,P=u.indices,w=d,S=D.IntersectionTests.lineSegmentPlane(v,c,ve,ue);V.defined(S)?(m=R.Cartesian3.multiplyByScalar(R.Cartesian3.UNIT_Y,5*L.CesiumMath.EPSILON9,ce),v.y<0&&(R.Cartesian3.negate(m,m),g=u.attributes,A=u.indices,T=d,x=o.attributes,P=o.indices,w=l),C=R.Cartesian3.add(S,m,me),Ce(y,f,v,n,le(g,A,T,s,t,v),g,i),Ce(y,f,C,n,le(g,A,T,s,-1,C),g,i),R.Cartesian3.negate(m,m),R.Cartesian3.add(S,m,C),Ce(y,f,C,n,le(x,P,w,s,-1,C),x,i),Ce(y,f,c,n,le(x,P,w,s,t+1,c),x,i)):(x=v.y<0?(h=u.attributes,b=u.indices,d):(h=o.attributes,b=o.indices,l),Ce(y,f,v,n,le(h,b,x,s,t,v),h,i),Ce(y,f,c,n,le(h,b,x,s,t+1,c),h,i))}ee(e,u,o)}var be=new R.Cartesian2,ge=new R.Cartesian2,Ae=new R.Cartesian3,Te=new R.Cartesian3,xe=new R.Cartesian3,Pe=new R.Cartesian3,we=new R.Cartesian3,Se=new R.Cartesian3,Ie=new z.Cartesian4;function Oe(e){for(var e=e.attributes,t=e.position.values,r=e.prevPosition.values,a=e.nextPosition.values,n=t.length,i=0;i<n;i+=3){var s,o=R.Cartesian3.unpack(t,i,Ae);0<o.x||(s=R.Cartesian3.unpack(r,i,Te),(o.y<0&&0<s.y||0<o.y&&s.y<0)&&(0<i-3?(r[i]=t[i-3],r[i+1]=t[i-2],r[i+2]=t[i-1]):R.Cartesian3.pack(o,r,i)),s=R.Cartesian3.unpack(a,i,xe),(o.y<0&&0<s.y||0<o.y&&s.y<0)&&(i+3<n?(a[i]=t[i+3],a[i+1]=t[i+4],a[i+2]=t[i+5]):R.Cartesian3.pack(o,a,i)))}}var Ee=5*L.CesiumMath.EPSILON9,Ne=L.CesiumMath.EPSILON6;r.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(V.defined(r)&&(0<r.center.x-r.radius||z.BoundingSphere.intersectPlane(r,a.Plane.ORIGIN_ZX_PLANE)!==z.Intersect.INTERSECTING))return e;if(t.geometryType!==S.GeometryType.NONE)switch(t.geometryType){case S.GeometryType.POLYLINES:!function(e){for(var t=e.geometry,r=t.attributes,a=r.position.values,n=r.prevPosition.values,i=r.nextPosition.values,s=r.expandAndWidth.values,o=V.defined(r.st)?r.st.values:void 0,u=V.defined(r.color)?r.color.values:void 0,p=$(t),d=$(t),l=!1,y=a.length/3,f=0;f<y;f+=4){var v=f,c=f+2,m=R.Cartesian3.fromArray(a,3*v,Ae),C=R.Cartesian3.fromArray(a,3*c,Te);if(Math.abs(m.y)<Ne)for(m.y=Ne*(C.y<0?-1:1),a[3*f+1]=m.y,a[3*(f+1)+1]=m.y,O=3*v;O<3*v+12;O+=3)n[O]=a[3*f],n[O+1]=a[3*f+1],n[O+2]=a[3*f+2];if(Math.abs(C.y)<Ne)for(C.y=Ne*(m.y<0?-1:1),a[3*(f+2)+1]=C.y,a[3*(f+3)+1]=C.y,O=3*v;O<3*v+12;O+=3)i[O]=a[3*(f+2)],i[O+1]=a[3*(f+2)+1],i[O+2]=a[3*(f+2)+2];var h=p.attributes,b=p.indices,g=d.attributes,A=d.indices,T=D.IntersectionTests.lineSegmentPlane(m,C,ve,Pe);if(V.defined(T)){var l=!0,x=R.Cartesian3.multiplyByScalar(R.Cartesian3.UNIT_Y,Ee,we);m.y<0&&(R.Cartesian3.negate(x,x),h=d.attributes,b=d.indices,g=p.attributes,A=p.indices);var P=R.Cartesian3.add(T,x,Se);h.position.values.push(m.x,m.y,m.z,m.x,m.y,m.z),h.position.values.push(P.x,P.y,P.z),h.position.values.push(P.x,P.y,P.z),h.prevPosition.values.push(n[3*v],n[3*v+1],n[3*v+2]),h.prevPosition.values.push(n[3*v+3],n[3*v+4],n[3*v+5]),h.prevPosition.values.push(m.x,m.y,m.z,m.x,m.y,m.z),h.nextPosition.values.push(P.x,P.y,P.z),h.nextPosition.values.push(P.x,P.y,P.z),h.nextPosition.values.push(P.x,P.y,P.z),h.nextPosition.values.push(P.x,P.y,P.z),R.Cartesian3.negate(x,x),R.Cartesian3.add(T,x,P),g.position.values.push(P.x,P.y,P.z),g.position.values.push(P.x,P.y,P.z),g.position.values.push(C.x,C.y,C.z,C.x,C.y,C.z),g.prevPosition.values.push(P.x,P.y,P.z),g.prevPosition.values.push(P.x,P.y,P.z),g.prevPosition.values.push(P.x,P.y,P.z),g.prevPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(C.x,C.y,C.z,C.x,C.y,C.z),g.nextPosition.values.push(i[3*c],i[3*c+1],i[3*c+2]),g.nextPosition.values.push(i[3*c+3],i[3*c+4],i[3*c+5]);var w=R.Cartesian2.fromArray(s,2*v,be),S=Math.abs(w.y);h.expandAndWidth.values.push(-1,S,1,S),h.expandAndWidth.values.push(-1,-S,1,-S),g.expandAndWidth.values.push(-1,S,1,S),g.expandAndWidth.values.push(-1,-S,1,-S);x=R.Cartesian3.magnitudeSquared(R.Cartesian3.subtract(T,m,xe));if(x/=R.Cartesian3.magnitudeSquared(R.Cartesian3.subtract(C,m,xe)),V.defined(u)){for(var P=z.Cartesian4.fromArray(u,4*v,Ie),I=z.Cartesian4.fromArray(u,4*c,Ie),w=L.CesiumMath.lerp(P.x,I.x,x),S=L.CesiumMath.lerp(P.y,I.y,x),T=L.CesiumMath.lerp(P.z,I.z,x),I=L.CesiumMath.lerp(P.w,I.w,x),O=4*v;O<4*v+8;++O)h.color.values.push(u[O]);for(h.color.values.push(w,S,T,I),h.color.values.push(w,S,T,I),g.color.values.push(w,S,T,I),g.color.values.push(w,S,T,I),O=4*c;O<4*c+8;++O)g.color.values.push(u[O])}if(V.defined(o)){var I=R.Cartesian2.fromArray(o,2*v,be),E=R.Cartesian2.fromArray(o,2*(f+3),ge),x=L.CesiumMath.lerp(I.x,E.x,x);for(O=2*v;O<2*v+4;++O)h.st.values.push(o[O]);for(h.st.values.push(x,I.y),h.st.values.push(x,E.y),g.st.values.push(x,I.y),g.st.values.push(x,E.y),O=2*c;O<2*c+4;++O)g.st.values.push(o[O])}E=h.position.values.length/3-4,b.push(E,E+2,E+1),b.push(E+1,E+2,E+3),E=g.position.values.length/3-4,A.push(E,E+2,E+1),A.push(E+1,E+2,E+3)}else{var N,A=m.y<0?(N=d.attributes,d.indices):(N=p.attributes,p.indices);for(N.position.values.push(m.x,m.y,m.z),N.position.values.push(m.x,m.y,m.z),N.position.values.push(C.x,C.y,C.z),N.position.values.push(C.x,C.y,C.z),O=3*f;O<3*f+12;++O)N.prevPosition.values.push(n[O]),N.nextPosition.values.push(i[O]);for(O=2*f;O<2*f+8;++O)N.expandAndWidth.values.push(s[O]),V.defined(o)&&N.st.values.push(o[O]);if(V.defined(u))for(O=4*f;O<4*f+16;++O)N.color.values.push(u[O]);E=N.position.values.length/3-4,A.push(E,E+2,E+1),A.push(E+1,E+2,E+3)}}l&&(Oe(d),Oe(p)),ee(e,d,p)}(e);break;case S.GeometryType.TRIANGLES:fe(e);break;case S.GeometryType.LINES:he(e)}else C(t),t.primitiveType===S.PrimitiveType.TRIANGLES?fe(e):t.primitiveType===S.PrimitiveType.LINES&&he(e);return e},e.GeometryPipeline=r}); diff --git a/public/Cesium/Workers/IndexDatatype-d47ad6f6.js b/public/Cesium/Workers/IndexDatatype-82ceea78.js similarity index 87% rename from public/Cesium/Workers/IndexDatatype-d47ad6f6.js rename to public/Cesium/Workers/IndexDatatype-82ceea78.js index 93e4eab..b767187 100644 --- a/public/Cesium/Workers/IndexDatatype-d47ad6f6.js +++ b/public/Cesium/Workers/IndexDatatype-82ceea78.js @@ -1 +1 @@ -define(["exports","./when-208fe5b0","./Check-d18af7c4","./Math-4e53b694","./WebGLConstants-76bb35d1"],function(e,r,t,N,n){"use strict";var E={UNSIGNED_BYTE:n.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:n.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:n.WebGLConstants.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case E.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case E.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case E.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},fromSizeInBytes:function(e){switch(e){case 2:return E.UNSIGNED_SHORT;case 4:return E.UNSIGNED_INT;case 1:return E.UNSIGNED_BYTE}},validate:function(e){return r.defined(e)&&(e===E.UNSIGNED_BYTE||e===E.UNSIGNED_SHORT||e===E.UNSIGNED_INT)},createTypedArray:function(e,r){return new(e>=N.CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(r)},createTypedArrayFromArrayBuffer:function(e,r,t,n){return new(e>=N.CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(r,t,n)}},n=Object.freeze(E);e.IndexDatatype=n}); +define(["exports","./when-54335d57","./Check-24483042","./Math-d6182036","./WebGLConstants-95ceb4e9"],function(e,r,t,N,n){"use strict";var E={UNSIGNED_BYTE:n.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:n.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:n.WebGLConstants.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case E.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case E.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case E.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},fromSizeInBytes:function(e){switch(e){case 2:return E.UNSIGNED_SHORT;case 4:return E.UNSIGNED_INT;case 1:return E.UNSIGNED_BYTE}},validate:function(e){return r.defined(e)&&(e===E.UNSIGNED_BYTE||e===E.UNSIGNED_SHORT||e===E.UNSIGNED_INT)},createTypedArray:function(e,r){return new(e>=N.CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(r)},createTypedArrayFromArrayBuffer:function(e,r,t,n){return new(e>=N.CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(r,t,n)}},n=Object.freeze(E);e.IndexDatatype=n}); diff --git a/public/Cesium/Workers/IntersectionTests-5394f658.js b/public/Cesium/Workers/IntersectionTests-5394f658.js new file mode 100644 index 0000000..050d1ce --- /dev/null +++ b/public/Cesium/Workers/IntersectionTests-5394f658.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./when-54335d57","./Check-24483042","./Transforms-79117a7b","./Math-d6182036"],function(a,O,d,t,x,y){"use strict";var P={};function i(a,t,e){var r=a+t;return y.CesiumMath.sign(a)!==y.CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(a),Math.abs(t)))<e?0:r}P.computeDiscriminant=function(a,t,e){return t*t-4*a*e},P.computeRealRoots=function(a,t,e){if(0===a)return 0===t?[]:[-e/t];if(0===t){if(0===e)return[0,0];var r=Math.abs(e),n=Math.abs(a);if(r<n&&r/n<y.CesiumMath.EPSILON14)return[0,0];if(n<r&&n/r<y.CesiumMath.EPSILON14)return[];if((n=-e/a)<0)return[];r=Math.sqrt(n);return[-r,r]}if(0===e)return(n=-t/a)<0?[n,0]:[0,n];n=i(t*t,-(4*a*e),y.CesiumMath.EPSILON14);if(n<0)return[];n=-.5*i(t,y.CesiumMath.sign(t)*Math.sqrt(n),y.CesiumMath.EPSILON14);return 0<t?[n/a,e/n]:[e/n,n/a]};var g={};function s(a,t,e,r){var n=a,i=t/3,s=e/3,o=r,u=n*s,C=i*o,c=i*i,l=s*s,h=n*s-c,a=n*o-i*s,t=i*o-l,e=4*h*t-a*a;if(e<0){var r=u*l<=c*C?-2*i*(f=h)+(m=n)*a:-(m=o)*a+2*s*(f=t),M=-(r<0?-1:1)*Math.abs(m)*Math.sqrt(-e),m=(d=M-r)/2,m=m<0?-Math.pow(-m,1/3):Math.pow(m,1/3),M=d===M?-m:-f/m,M=f<=0?m+M:-r/(m*m+M*M+f);return u*l<=c*C?[(M-i)/n]:[-o/(M+s)]}var f=h,u=-2*i*h+n*a,l=t,c=-o*a+2*s*t,C=Math.sqrt(e),h=Math.sqrt(3)/2,a=Math.abs(Math.atan2(n*C,-u)/3);M=2*Math.sqrt(-f);t=Math.cos(a);d=M*t;var e=M*(-t/2-h*Math.sin(a)),u=2*i<d+e?d-i:e-i,f=n,n=u/f,a=Math.abs(Math.atan2(o*C,-c)/3),o=-o,a=(d=(M=2*Math.sqrt(-l))*(t=Math.cos(a)))+(e=M*(-t/2-h*Math.sin(a)))<2*s?d+s:e+s,d=o/a,e=-u*a-f*o,a=(s*e-i*(u*o))/(-i*e+s*(f*a));return n<=a?n<=d?a<=d?[n,a,d]:[n,d,a]:[d,n,a]:n<=d?[a,n,d]:a<=d?[a,d,n]:[d,a,n]}g.computeDiscriminant=function(a,t,e,r){var n=t*t,i=e*e;return 18*a*t*e*r+n*i-27*(a*a)*(r*r)-4*(a*i*e+n*t*r)},g.computeRealRoots=function(a,t,e,r){var n;if(0===a)return P.computeRealRoots(t,e,r);if(0!==t)return 0===e?0===r?(i=-t/a)<0?[i,0,0]:[0,0,i]:s(a,t,0,r):0===r?0===(n=P.computeRealRoots(a,t,e)).length?[0]:n[1]<=0?[n[0],n[1],0]:0<=n[0]?[0,n[0],n[1]]:[n[0],0,n[1]]:s(a,t,e,r);if(0!==e)return 0===r?0===(n=P.computeRealRoots(a,0,e)).Length?[0]:[n[0],0,n[1]]:s(a,0,e,r);if(0===r)return[0,0,0];var i=(i=-r/a)<0?-Math.pow(-i,1/3):Math.pow(i,1/3);return[i,i,i]};var N={};function C(a,t,e,r){var n=a*a,i=t-3*n/8,s=e-t*a/2+n*a/8,r=r-e*a/4+t*n/16-3*n*n/256,e=g.computeRealRoots(1,2*i,i*i-4*r,-s*s);if(0<e.length){t=-a/4,n=e[e.length-1];if(Math.abs(n)<y.CesiumMath.EPSILON14){a=P.computeRealRoots(1,i,r);if(2===a.length){var e=a[0],o=a[1];if(0<=e&&0<=o){r=Math.sqrt(e),a=Math.sqrt(o);return[t-a,t-r,t+r,t+a]}if(0<=e&&o<0)return[t-(u=Math.sqrt(e)),t+u];if(e<0&&0<=o)return[t-(u=Math.sqrt(o)),t+u]}return[]}if(0<n){var o=Math.sqrt(n),u=(i+n+s/o)/2,s=P.computeRealRoots(1,o,(i+n-s/o)/2),u=P.computeRealRoots(1,-o,u);return 0!==s.length?(s[0]+=t,s[1]+=t,0!==u.length?(u[0]+=t,u[1]+=t,s[1]<=u[0]?[s[0],s[1],u[0],u[1]]:u[1]<=s[0]?[u[0],u[1],s[0],s[1]]:s[0]>=u[0]&&s[1]<=u[1]?[u[0],s[0],s[1],u[1]]:u[0]>=s[0]&&u[1]<=s[1]?[s[0],u[0],u[1],s[1]]:s[0]>u[0]&&s[0]<u[1]?[u[0],s[0],u[1],s[1]]:[s[0],u[0],s[1],u[1]]):s):0!==u.length?(u[0]+=t,u[1]+=t,u):[]}}return[]}function c(a,t,e,r){var n=a*a,i=g.computeRealRoots(1,-2*t,e*a+t*t-4*r,n*r-e*t*a+e*e);if(0<i.length){var s,o,u,C,c=i[0],l=t-c,h=l*l,M=a/2,i=l/2,t=h-4*r,l=h+4*Math.abs(r),h=n-4*c,n=n+4*Math.abs(c);o=c<0||t*n<h*l?(s=(h=Math.sqrt(h))/2,0===h?0:(a*i-e)/h):(s=0===(o=Math.sqrt(t))?0:(a*i-e)/o,o/2),0==M&&0===s?C=u=0:y.CesiumMath.sign(M)===y.CesiumMath.sign(s)?C=c/(u=M+s):u=c/(C=M-s),0==i&&0===o?f=m=0:y.CesiumMath.sign(i)===y.CesiumMath.sign(o)?f=r/(m=i+o):m=r/(f=i-o);var m=P.computeRealRoots(1,u,m),f=P.computeRealRoots(1,C,f);if(0!==m.length)return 0!==f.length?m[1]<=f[0]?[m[0],m[1],f[0],f[1]]:f[1]<=m[0]?[f[0],f[1],m[0],m[1]]:m[0]>=f[0]&&m[1]<=f[1]?[f[0],m[0],m[1],f[1]]:f[0]>=m[0]&&f[1]<=m[1]?[m[0],f[0],f[1],m[1]]:m[0]>f[0]&&m[0]<f[1]?[f[0],m[0],f[1],m[1]]:[m[0],f[0],m[1],f[1]]:m;if(0!==f.length)return f}return[]}function e(a,t){t=O.Cartesian3.clone(d.defaultValue(t,O.Cartesian3.ZERO)),O.Cartesian3.equals(t,O.Cartesian3.ZERO)||O.Cartesian3.normalize(t,t),this.origin=O.Cartesian3.clone(d.defaultValue(a,O.Cartesian3.ZERO)),this.direction=t}N.computeDiscriminant=function(a,t,e,r,n){var i=a*a,s=t*t,o=s*t,u=e*e,C=u*e,c=r*r,l=c*r,h=n*n;return s*u*c-4*o*l-4*a*C*c+18*a*t*e*l-27*i*c*c+256*(i*a)*(h*n)+n*(18*o*e*r-4*s*C+16*a*u*u-80*a*t*u*r-6*a*s*c+144*i*e*c)+h*(144*a*s*e-27*s*s-128*i*u-192*i*t*r)},N.computeRealRoots=function(a,t,e,r,n){if(Math.abs(a)<y.CesiumMath.EPSILON15)return g.computeRealRoots(t,e,r,n);var i=t/a,s=e/a,o=r/a,u=n/a,a=i<0?1:0;switch(a+=s<0?a+1:a,a+=o<0?a+1:a,a+=u<0?a+1:a){case 0:return C(i,s,o,u);case 1:case 2:return c(i,s,o,u);case 3:case 4:return C(i,s,o,u);case 5:return c(i,s,o,u);case 6:case 7:return C(i,s,o,u);case 8:return c(i,s,o,u);case 9:case 10:return C(i,s,o,u);case 11:return c(i,s,o,u);case 12:case 13:case 14:case 15:return C(i,s,o,u);default:return}},e.clone=function(a,t){if(d.defined(a))return d.defined(t)?(t.origin=O.Cartesian3.clone(a.origin),t.direction=O.Cartesian3.clone(a.direction),t):new e(a.origin,a.direction)},e.getPoint=function(a,t,e){return d.defined(e)||(e=new O.Cartesian3),e=O.Cartesian3.multiplyByScalar(a.direction,t,e),O.Cartesian3.add(a.origin,e,e)};var l={rayPlane:function(a,t,e){d.defined(e)||(e=new O.Cartesian3);var r=a.origin,n=a.direction,i=t.normal,a=O.Cartesian3.dot(i,n);if(!(Math.abs(a)<y.CesiumMath.EPSILON15)){a=(-t.distance-O.Cartesian3.dot(i,r))/a;if(!(a<0))return e=O.Cartesian3.multiplyByScalar(n,a,e),O.Cartesian3.add(r,e,e)}}},M=new O.Cartesian3,m=new O.Cartesian3,f=new O.Cartesian3,p=new O.Cartesian3,v=new O.Cartesian3;l.rayTriangleParametric=function(a,t,e,r,n){n=d.defaultValue(n,!1);var i,s,o,u=a.origin,C=a.direction,c=O.Cartesian3.subtract(e,t,M),a=O.Cartesian3.subtract(r,t,m),e=O.Cartesian3.cross(C,a,f),r=O.Cartesian3.dot(c,e);if(n){if(r<y.CesiumMath.EPSILON6)return;if(h=O.Cartesian3.subtract(u,t,p),(l=O.Cartesian3.dot(h,e))<0||r<l)return;if(i=O.Cartesian3.cross(h,c,v),(s=O.Cartesian3.dot(C,i))<0||r<l+s)return;o=O.Cartesian3.dot(a,i)/r}else{if(Math.abs(r)<y.CesiumMath.EPSILON6)return;var l,r=1/r,h=O.Cartesian3.subtract(u,t,p);if((l=O.Cartesian3.dot(h,e)*r)<0||1<l)return;if(i=O.Cartesian3.cross(h,c,v),(s=O.Cartesian3.dot(C,i)*r)<0||1<l+s)return;o=O.Cartesian3.dot(a,i)*r}return o},l.rayTriangle=function(a,t,e,r,n,i){n=l.rayTriangleParametric(a,t,e,r,n);if(d.defined(n)&&!(n<0))return d.defined(i)||(i=new O.Cartesian3),O.Cartesian3.multiplyByScalar(a.direction,n,i),O.Cartesian3.add(a.origin,i,i)};var u=new e;l.lineSegmentTriangle=function(a,t,e,r,n,i,s){var o=u;O.Cartesian3.clone(a,o.origin),O.Cartesian3.subtract(t,a,o.direction),O.Cartesian3.normalize(o.direction,o.direction);i=l.rayTriangleParametric(o,e,r,n,i);if(!(!d.defined(i)||i<0||i>O.Cartesian3.distance(a,t)))return d.defined(s)||(s=new O.Cartesian3),O.Cartesian3.multiplyByScalar(o.direction,i,s),O.Cartesian3.add(o.origin,s,s)};var o={root0:0,root1:0};function h(a,t,e){d.defined(e)||(e=new x.Interval);var r=a.origin,n=a.direction,a=t.center,t=t.radius*t.radius,a=O.Cartesian3.subtract(r,a,f),t=function(a,t,e,r){if(!((i=t*t-4*a*e)<0)){if(0<i){var n=1/(2*a),e=Math.sqrt(i),i=(-t+e)*n,n=(-t-e)*n;return i<n?(r.root0=i,r.root1=n):(r.root0=n,r.root1=i),r}a=-t/(2*a);if(0!=a)return r.root0=r.root1=a,r}}(O.Cartesian3.dot(n,n),2*O.Cartesian3.dot(n,a),O.Cartesian3.magnitudeSquared(a)-t,o);if(d.defined(t))return e.start=t.root0,e.stop=t.root1,e}l.raySphere=function(a,t,e){if(e=h(a,t,e),d.defined(e)&&!(e.stop<0))return e.start=Math.max(e.start,0),e};var w=new e;l.lineSegmentSphere=function(a,t,e,r){var n=w;O.Cartesian3.clone(a,n.origin);t=O.Cartesian3.subtract(t,a,n.direction),a=O.Cartesian3.magnitude(t);if(O.Cartesian3.normalize(t,t),r=h(n,e,r),!(!d.defined(r)||r.stop<0||r.start>a))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,a),r};var R=new O.Cartesian3,S=new O.Cartesian3;function b(a,t,e){var r=a+t;return y.CesiumMath.sign(a)!==y.CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(a),Math.abs(t)))<e?0:r}l.rayEllipsoid=function(a,t){var e=t.oneOverRadii,r=O.Cartesian3.multiplyComponents(e,a.origin,R),t=O.Cartesian3.multiplyComponents(e,a.direction,S),e=O.Cartesian3.magnitudeSquared(r),a=O.Cartesian3.dot(r,t);if(1<e){if(0<=a)return;var n,i,r=a*a,s=e-1;if(r<(i=(n=O.Cartesian3.magnitudeSquared(t))*s))return;if(i<r){var o,u=a*a-i,C=(o=-a+Math.sqrt(u))/n,r=s/o;return C<r?new x.Interval(C,r):{start:r,stop:C}}C=Math.sqrt(s/n);return new x.Interval(C,C)}return e<1?(s=e-1,u=a*a-(i=(n=O.Cartesian3.magnitudeSquared(t))*s),o=-a+Math.sqrt(u),new x.Interval(0,o/n)):a<0?(n=O.Cartesian3.magnitudeSquared(t),new x.Interval(0,-a/n)):void 0};var q=new O.Cartesian3,L=new O.Cartesian3,I=new O.Cartesian3,E=new O.Cartesian3,z=new O.Cartesian3,T=new x.Matrix3,U=new x.Matrix3,W=new x.Matrix3,B=new x.Matrix3,V=new x.Matrix3,Z=new x.Matrix3,A=new x.Matrix3,D=new O.Cartesian3,k=new O.Cartesian3,F=new O.Cartographic;l.grazingAltitudeLocation=function(a,t){var e=a.origin,r=a.direction;if(!O.Cartesian3.equals(e,O.Cartesian3.ZERO)){var n=t.geodeticSurfaceNormal(e,q);if(0<=O.Cartesian3.dot(r,n))return e}var i=d.defined(this.rayEllipsoid(a,t)),s=t.transformPositionToScaledSpace(r,q),n=O.Cartesian3.normalize(s,s),a=O.Cartesian3.mostOrthogonalAxis(s,E),s=O.Cartesian3.normalize(O.Cartesian3.cross(a,n,L),L),a=O.Cartesian3.normalize(O.Cartesian3.cross(n,s,I),I),o=T;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=a.x,o[7]=a.y,o[8]=a.z;var n=x.Matrix3.transpose(o,U),u=x.Matrix3.fromScale(t.radii,W),s=x.Matrix3.fromScale(t.oneOverRadii,B),a=V;a[0]=0,a[1]=-r.z,a[2]=r.y,a[3]=r.z,a[4]=0,a[5]=-r.x,a[6]=-r.y,a[7]=r.x,a[8]=0;var s=x.Matrix3.multiply(x.Matrix3.multiply(n,s,Z),a,Z),a=x.Matrix3.multiply(x.Matrix3.multiply(s,u,A),o,A),s=x.Matrix3.multiplyByVector(s,e,z),C=function(a,t,e,r,n){var i=r*r,s=n*n,o=(a[x.Matrix3.COLUMN1ROW1]-a[x.Matrix3.COLUMN2ROW2])*s,u=n*(r*b(a[x.Matrix3.COLUMN1ROW0],a[x.Matrix3.COLUMN0ROW1],y.CesiumMath.EPSILON15)+t.y),C=a[x.Matrix3.COLUMN0ROW0]*i+a[x.Matrix3.COLUMN2ROW2]*s+r*t.x+e,c=s*b(a[x.Matrix3.COLUMN2ROW1],a[x.Matrix3.COLUMN1ROW2],y.CesiumMath.EPSILON15),l=n*(r*b(a[x.Matrix3.COLUMN2ROW0],a[x.Matrix3.COLUMN0ROW2])+t.z),h=[];if(0==l&&0==c){if(0===(g=P.computeRealRoots(o,u,C)).length)return h;var M=g[0],m=Math.sqrt(Math.max(1-M*M,0));return h.push(new O.Cartesian3(r,n*M,n*-m)),h.push(new O.Cartesian3(r,n*M,n*m)),2===g.length&&(f=g[1],d=Math.sqrt(Math.max(1-f*f,0)),h.push(new O.Cartesian3(r,n*f,n*-d)),h.push(new O.Cartesian3(r,n*f,n*d))),h}var f=o*o+(M=c*c),d=2*(u*o+(m=l*c)),M=2*C*o+u*u-M+(t=l*l),m=2*(C*u-m);if(0==f&&0==d&&0==M&&0==m)return h;var g,p=(g=N.computeRealRoots(f,d,M,m,C*C-t)).length;if(0===p)return h;for(var v=0;v<p;++v){var w=g[v],R=w*w,S=Math.max(1-R,0),S=Math.sqrt(S),R=y.CesiumMath.sign(o)===y.CesiumMath.sign(C)?b(o*R+C,u*w,y.CesiumMath.EPSILON12):y.CesiumMath.sign(C)===y.CesiumMath.sign(u*w)?b(o*R,u*w+C,y.CesiumMath.EPSILON12):b(o*R+u*w,C,y.CesiumMath.EPSILON12),R=R*b(c*w,l,y.CesiumMath.EPSILON15);R<0?h.push(new O.Cartesian3(r,n*w,n*S)):0<R?h.push(new O.Cartesian3(r,n*w,n*-S)):0!==S?(h.push(new O.Cartesian3(r,n*w,n*-S)),h.push(new O.Cartesian3(r,n*w,n*S)),++v):h.push(new O.Cartesian3(r,n*w,n*S))}return h}(a,O.Cartesian3.negate(s,q),0,0,1),c=C.length;if(0<c){for(var l=O.Cartesian3.clone(O.Cartesian3.ZERO,k),h=Number.NEGATIVE_INFINITY,M=0;M<c;++M){var m=x.Matrix3.multiplyByVector(u,x.Matrix3.multiplyByVector(o,C[M],D),D),f=O.Cartesian3.normalize(O.Cartesian3.subtract(m,e,E),E),f=O.Cartesian3.dot(f,r);h<f&&(h=f,l=O.Cartesian3.clone(m,l))}a=t.cartesianToCartographic(l,F),h=y.CesiumMath.clamp(h,0,1),s=O.Cartesian3.magnitude(O.Cartesian3.subtract(l,e,E))*Math.sqrt(1-h*h);return a.height=s=i?-s:s,t.cartographicToCartesian(a,new O.Cartesian3)}};var G=new O.Cartesian3;l.lineSegmentPlane=function(a,t,e,r){d.defined(r)||(r=new O.Cartesian3);var n=O.Cartesian3.subtract(t,a,G),i=e.normal,t=O.Cartesian3.dot(i,n);if(!(Math.abs(t)<y.CesiumMath.EPSILON6)){i=O.Cartesian3.dot(i,a),t=-(e.distance+i)/t;if(!(t<0||1<t))return O.Cartesian3.multiplyByScalar(n,t,r),O.Cartesian3.add(a,r,r),r}},l.trianglePlaneIntersection=function(a,t,e,r){var n,i,s=r.normal,o=r.distance,u=O.Cartesian3.dot(s,a)+o<0,C=O.Cartesian3.dot(s,t)+o<0,s=O.Cartesian3.dot(s,e)+o<0,o=0;if(o+=u?1:0,o+=C?1:0,1!=(o+=s?1:0)&&2!=o||(n=new O.Cartesian3,i=new O.Cartesian3),1==o){if(u)return l.lineSegmentPlane(a,t,r,n),l.lineSegmentPlane(a,e,r,i),{positions:[a,t,e,n,i],indices:[0,3,4,1,2,4,1,4,3]};if(C)return l.lineSegmentPlane(t,e,r,n),l.lineSegmentPlane(t,a,r,i),{positions:[a,t,e,n,i],indices:[1,3,4,2,0,4,2,4,3]};if(s)return l.lineSegmentPlane(e,a,r,n),l.lineSegmentPlane(e,t,r,i),{positions:[a,t,e,n,i],indices:[2,3,4,0,1,4,0,4,3]}}else if(2==o){if(!u)return l.lineSegmentPlane(t,a,r,n),l.lineSegmentPlane(e,a,r,i),{positions:[a,t,e,n,i],indices:[1,2,4,1,4,3,0,3,4]};if(!C)return l.lineSegmentPlane(e,t,r,n),l.lineSegmentPlane(a,t,r,i),{positions:[a,t,e,n,i],indices:[2,0,4,2,4,3,1,3,4]};if(!s)return l.lineSegmentPlane(a,e,r,n),l.lineSegmentPlane(t,e,r,i),{positions:[a,t,e,n,i],indices:[0,1,4,0,4,3,2,3,4]}}},a.IntersectionTests=l,a.Ray=e}); diff --git a/public/Cesium/Workers/IntersectionTests-7d224a2f.js b/public/Cesium/Workers/IntersectionTests-7d224a2f.js deleted file mode 100644 index cc31d37..0000000 --- a/public/Cesium/Workers/IntersectionTests-7d224a2f.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./when-208fe5b0","./Check-d18af7c4","./Transforms-a73b3b3b","./Math-4e53b694"],function(a,O,d,t,x,y){"use strict";var P={};function i(a,t,e){var r=a+t;return y.CesiumMath.sign(a)!==y.CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(a),Math.abs(t)))<e?0:r}P.computeDiscriminant=function(a,t,e){return t*t-4*a*e},P.computeRealRoots=function(a,t,e){if(0===a)return 0===t?[]:[-e/t];if(0===t){if(0===e)return[0,0];var r=Math.abs(e),n=Math.abs(a);if(r<n&&r/n<y.CesiumMath.EPSILON14)return[0,0];if(n<r&&n/r<y.CesiumMath.EPSILON14)return[];if((n=-e/a)<0)return[];r=Math.sqrt(n);return[-r,r]}if(0===e)return(n=-t/a)<0?[n,0]:[0,n];n=i(t*t,-(4*a*e),y.CesiumMath.EPSILON14);if(n<0)return[];n=-.5*i(t,y.CesiumMath.sign(t)*Math.sqrt(n),y.CesiumMath.EPSILON14);return 0<t?[n/a,e/n]:[e/n,n/a]};var g={};function s(a,t,e,r){var n=a,i=t/3,s=e/3,o=r,u=n*s,C=i*o,c=i*i,l=s*s,h=n*s-c,a=n*o-i*s,t=i*o-l,e=4*h*t-a*a;if(e<0){var r=u*l<=c*C?-2*i*(m=h)+(f=n)*a:-(f=o)*a+2*s*(m=t),M=-(r<0?-1:1)*Math.abs(f)*Math.sqrt(-e),f=(d=M-r)/2,f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),M=d===M?-f:-m/f,M=m<=0?f+M:-r/(f*f+M*M+m);return u*l<=c*C?[(M-i)/n]:[-o/(M+s)]}var m=h,u=-2*i*h+n*a,l=t,c=-o*a+2*s*t,C=Math.sqrt(e),h=Math.sqrt(3)/2,a=Math.abs(Math.atan2(n*C,-u)/3);M=2*Math.sqrt(-m);t=Math.cos(a);d=M*t;var e=M*(-t/2-h*Math.sin(a)),u=2*i<d+e?d-i:e-i,m=n,n=u/m,a=Math.abs(Math.atan2(o*C,-c)/3),o=-o,a=(d=(M=2*Math.sqrt(-l))*(t=Math.cos(a)))+(e=M*(-t/2-h*Math.sin(a)))<2*s?d+s:e+s,d=o/a,e=-u*a-m*o,a=(s*e-i*(u*o))/(-i*e+s*(m*a));return n<=a?n<=d?a<=d?[n,a,d]:[n,d,a]:[d,n,a]:n<=d?[a,n,d]:a<=d?[a,d,n]:[d,a,n]}g.computeDiscriminant=function(a,t,e,r){var n=t*t,i=e*e;return 18*a*t*e*r+n*i-27*(a*a)*(r*r)-4*(a*i*e+n*t*r)},g.computeRealRoots=function(a,t,e,r){var n;if(0===a)return P.computeRealRoots(t,e,r);if(0!==t)return 0===e?0===r?(i=-t/a)<0?[i,0,0]:[0,0,i]:s(a,t,0,r):0===r?0===(n=P.computeRealRoots(a,t,e)).length?[0]:n[1]<=0?[n[0],n[1],0]:0<=n[0]?[0,n[0],n[1]]:[n[0],0,n[1]]:s(a,t,e,r);if(0!==e)return 0===r?0===(n=P.computeRealRoots(a,0,e)).Length?[0]:[n[0],0,n[1]]:s(a,0,e,r);if(0===r)return[0,0,0];var i=(i=-r/a)<0?-Math.pow(-i,1/3):Math.pow(i,1/3);return[i,i,i]};var b={};function C(a,t,e,r){var n=a*a,i=t-3*n/8,s=e-t*a/2+n*a/8,r=r-e*a/4+t*n/16-3*n*n/256,e=g.computeRealRoots(1,2*i,i*i-4*r,-s*s);if(0<e.length){t=-a/4,n=e[e.length-1];if(Math.abs(n)<y.CesiumMath.EPSILON14){a=P.computeRealRoots(1,i,r);if(2===a.length){var e=a[0],o=a[1];if(0<=e&&0<=o){r=Math.sqrt(e),a=Math.sqrt(o);return[t-a,t-r,t+r,t+a]}if(0<=e&&o<0)return[t-(u=Math.sqrt(e)),t+u];if(e<0&&0<=o)return[t-(u=Math.sqrt(o)),t+u]}return[]}if(0<n){var o=Math.sqrt(n),u=(i+n-s/o)/2,s=(i+n+s/o)/2,u=P.computeRealRoots(1,o,u),s=P.computeRealRoots(1,-o,s);return 0!==u.length?(u[0]+=t,u[1]+=t,0!==s.length?(s[0]+=t,s[1]+=t,u[1]<=s[0]?[u[0],u[1],s[0],s[1]]:s[1]<=u[0]?[s[0],s[1],u[0],u[1]]:u[0]>=s[0]&&u[1]<=s[1]?[s[0],u[0],u[1],s[1]]:s[0]>=u[0]&&s[1]<=u[1]?[u[0],s[0],s[1],u[1]]:u[0]>s[0]&&u[0]<s[1]?[s[0],u[0],s[1],u[1]]:[u[0],s[0],u[1],s[1]]):u):0!==s.length?(s[0]+=t,s[1]+=t,s):[]}}return[]}function c(a,t,e,r){var n=a*a,i=-2*t,s=e*a+t*t-4*r,o=n*r-e*t*a+e*e,u=g.computeRealRoots(1,i,s,o);if(0<u.length){var C,c,l,h,M=u[0],i=t-M,s=i*i,o=a/2,u=i/2,t=s-4*r,i=s+4*Math.abs(r),s=n-4*M,n=n+4*Math.abs(M);c=M<0||t*n<s*i?(C=(s=Math.sqrt(s))/2,0===s?0:(a*u-e)/s):(C=0===(c=Math.sqrt(t))?0:(a*u-e)/c,c/2),0==o&&0===C?h=l=0:y.CesiumMath.sign(o)===y.CesiumMath.sign(C)?h=M/(l=o+C):l=M/(h=o-C),0==u&&0===c?m=f=0:y.CesiumMath.sign(u)===y.CesiumMath.sign(c)?m=r/(f=u+c):f=r/(m=u-c);var f=P.computeRealRoots(1,l,f),m=P.computeRealRoots(1,h,m);if(0!==f.length)return 0!==m.length?f[1]<=m[0]?[f[0],f[1],m[0],m[1]]:m[1]<=f[0]?[m[0],m[1],f[0],f[1]]:f[0]>=m[0]&&f[1]<=m[1]?[m[0],f[0],f[1],m[1]]:m[0]>=f[0]&&m[1]<=f[1]?[f[0],m[0],m[1],f[1]]:f[0]>m[0]&&f[0]<m[1]?[m[0],f[0],m[1],f[1]]:[f[0],m[0],f[1],m[1]]:f;if(0!==m.length)return m}return[]}function e(a,t){t=O.Cartesian3.clone(d.defaultValue(t,O.Cartesian3.ZERO)),O.Cartesian3.equals(t,O.Cartesian3.ZERO)||O.Cartesian3.normalize(t,t),this.origin=O.Cartesian3.clone(d.defaultValue(a,O.Cartesian3.ZERO)),this.direction=t}b.computeDiscriminant=function(a,t,e,r,n){var i=a*a,s=t*t,o=s*t,u=e*e,C=u*e,c=r*r,l=c*r,h=n*n;return s*u*c-4*o*l-4*a*C*c+18*a*t*e*l-27*i*c*c+256*(i*a)*(h*n)+n*(18*o*e*r-4*s*C+16*a*u*u-80*a*t*u*r-6*a*s*c+144*i*e*c)+h*(144*a*s*e-27*s*s-128*i*u-192*i*t*r)},b.computeRealRoots=function(a,t,e,r,n){if(Math.abs(a)<y.CesiumMath.EPSILON15)return g.computeRealRoots(t,e,r,n);var i=t/a,s=e/a,o=r/a,u=n/a,a=i<0?1:0;switch(a+=s<0?a+1:a,a+=o<0?a+1:a,a+=u<0?a+1:a){case 0:return C(i,s,o,u);case 1:case 2:return c(i,s,o,u);case 3:case 4:return C(i,s,o,u);case 5:return c(i,s,o,u);case 6:case 7:return C(i,s,o,u);case 8:return c(i,s,o,u);case 9:case 10:return C(i,s,o,u);case 11:return c(i,s,o,u);case 12:case 13:case 14:case 15:return C(i,s,o,u);default:return}},e.clone=function(a,t){if(d.defined(a))return d.defined(t)?(t.origin=O.Cartesian3.clone(a.origin),t.direction=O.Cartesian3.clone(a.direction),t):new e(a.origin,a.direction)},e.getPoint=function(a,t,e){return d.defined(e)||(e=new O.Cartesian3),e=O.Cartesian3.multiplyByScalar(a.direction,t,e),O.Cartesian3.add(a.origin,e,e)};var l={rayPlane:function(a,t,e){d.defined(e)||(e=new O.Cartesian3);var r=a.origin,n=a.direction,i=t.normal,a=O.Cartesian3.dot(i,n);if(!(Math.abs(a)<y.CesiumMath.EPSILON15)){a=(-t.distance-O.Cartesian3.dot(i,r))/a;if(!(a<0))return e=O.Cartesian3.multiplyByScalar(n,a,e),O.Cartesian3.add(r,e,e)}}},M=new O.Cartesian3,f=new O.Cartesian3,m=new O.Cartesian3,p=new O.Cartesian3,v=new O.Cartesian3;l.rayTriangleParametric=function(a,t,e,r,n){n=d.defaultValue(n,!1);var i,s,o,u=a.origin,C=a.direction,c=O.Cartesian3.subtract(e,t,M),a=O.Cartesian3.subtract(r,t,f),e=O.Cartesian3.cross(C,a,m),r=O.Cartesian3.dot(c,e);if(n){if(r<y.CesiumMath.EPSILON6)return;if(h=O.Cartesian3.subtract(u,t,p),(l=O.Cartesian3.dot(h,e))<0||r<l)return;if(i=O.Cartesian3.cross(h,c,v),(s=O.Cartesian3.dot(C,i))<0||r<l+s)return;o=O.Cartesian3.dot(a,i)/r}else{if(Math.abs(r)<y.CesiumMath.EPSILON6)return;var l,r=1/r,h=O.Cartesian3.subtract(u,t,p);if((l=O.Cartesian3.dot(h,e)*r)<0||1<l)return;if(i=O.Cartesian3.cross(h,c,v),(s=O.Cartesian3.dot(C,i)*r)<0||1<l+s)return;o=O.Cartesian3.dot(a,i)*r}return o},l.rayTriangle=function(a,t,e,r,n,i){n=l.rayTriangleParametric(a,t,e,r,n);if(d.defined(n)&&!(n<0))return d.defined(i)||(i=new O.Cartesian3),O.Cartesian3.multiplyByScalar(a.direction,n,i),O.Cartesian3.add(a.origin,i,i)};var u=new e;l.lineSegmentTriangle=function(a,t,e,r,n,i,s){var o=u;O.Cartesian3.clone(a,o.origin),O.Cartesian3.subtract(t,a,o.direction),O.Cartesian3.normalize(o.direction,o.direction);i=l.rayTriangleParametric(o,e,r,n,i);if(!(!d.defined(i)||i<0||i>O.Cartesian3.distance(a,t)))return d.defined(s)||(s=new O.Cartesian3),O.Cartesian3.multiplyByScalar(o.direction,i,s),O.Cartesian3.add(o.origin,s,s)};var o={root0:0,root1:0};function h(a,t,e){d.defined(e)||(e=new x.Interval);var r=a.origin,n=a.direction,a=t.center,t=t.radius*t.radius,a=O.Cartesian3.subtract(r,a,m),t=function(a,t,e,r){if(!((i=t*t-4*a*e)<0)){if(0<i){var n=1/(2*a),e=Math.sqrt(i),i=(-t+e)*n,n=(-t-e)*n;return i<n?(r.root0=i,r.root1=n):(r.root0=n,r.root1=i),r}a=-t/(2*a);if(0!=a)return r.root0=r.root1=a,r}}(O.Cartesian3.dot(n,n),2*O.Cartesian3.dot(n,a),O.Cartesian3.magnitudeSquared(a)-t,o);if(d.defined(t))return e.start=t.root0,e.stop=t.root1,e}l.raySphere=function(a,t,e){if(e=h(a,t,e),d.defined(e)&&!(e.stop<0))return e.start=Math.max(e.start,0),e};var w=new e;l.lineSegmentSphere=function(a,t,e,r){var n=w;O.Cartesian3.clone(a,n.origin);t=O.Cartesian3.subtract(t,a,n.direction),a=O.Cartesian3.magnitude(t);if(O.Cartesian3.normalize(t,t),r=h(n,e,r),!(!d.defined(r)||r.stop<0||r.start>a))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,a),r};var R=new O.Cartesian3,S=new O.Cartesian3;function N(a,t,e){var r=a+t;return y.CesiumMath.sign(a)!==y.CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(a),Math.abs(t)))<e?0:r}l.rayEllipsoid=function(a,t){var e=t.oneOverRadii,r=O.Cartesian3.multiplyComponents(e,a.origin,R),t=O.Cartesian3.multiplyComponents(e,a.direction,S),e=O.Cartesian3.magnitudeSquared(r),a=O.Cartesian3.dot(r,t);if(1<e){if(0<=a)return;var n,i,r=a*a,s=e-1;if(r<(i=(n=O.Cartesian3.magnitudeSquared(t))*s))return;if(i<r){var o,u=a*a-i,C=(o=-a+Math.sqrt(u))/n,r=s/o;return C<r?new x.Interval(C,r):{start:r,stop:C}}C=Math.sqrt(s/n);return new x.Interval(C,C)}return e<1?(s=e-1,u=a*a-(i=(n=O.Cartesian3.magnitudeSquared(t))*s),o=-a+Math.sqrt(u),new x.Interval(0,o/n)):a<0?(n=O.Cartesian3.magnitudeSquared(t),new x.Interval(0,-a/n)):void 0};var q=new O.Cartesian3,L=new O.Cartesian3,I=new O.Cartesian3,E=new O.Cartesian3,z=new O.Cartesian3,T=new x.Matrix3,U=new x.Matrix3,W=new x.Matrix3,B=new x.Matrix3,V=new x.Matrix3,Z=new x.Matrix3,A=new x.Matrix3,D=new O.Cartesian3,k=new O.Cartesian3,F=new O.Cartographic;l.grazingAltitudeLocation=function(a,t){var e=a.origin,r=a.direction;if(!O.Cartesian3.equals(e,O.Cartesian3.ZERO)){var n=t.geodeticSurfaceNormal(e,q);if(0<=O.Cartesian3.dot(r,n))return e}var i=d.defined(this.rayEllipsoid(a,t)),s=t.transformPositionToScaledSpace(r,q),n=O.Cartesian3.normalize(s,s),a=O.Cartesian3.mostOrthogonalAxis(s,E),s=O.Cartesian3.normalize(O.Cartesian3.cross(a,n,L),L),a=O.Cartesian3.normalize(O.Cartesian3.cross(n,s,I),I),o=T;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=a.x,o[7]=a.y,o[8]=a.z;var n=x.Matrix3.transpose(o,U),u=x.Matrix3.fromScale(t.radii,W),s=x.Matrix3.fromScale(t.oneOverRadii,B),a=V;a[0]=0,a[1]=-r.z,a[2]=r.y,a[3]=r.z,a[4]=0,a[5]=-r.x,a[6]=-r.y,a[7]=r.x,a[8]=0;var s=x.Matrix3.multiply(x.Matrix3.multiply(n,s,Z),a,Z),a=x.Matrix3.multiply(x.Matrix3.multiply(s,u,A),o,A),s=x.Matrix3.multiplyByVector(s,e,z),C=function(a,t,e,r,n){var i=r*r,s=n*n,o=(a[x.Matrix3.COLUMN1ROW1]-a[x.Matrix3.COLUMN2ROW2])*s,u=n*(r*N(a[x.Matrix3.COLUMN1ROW0],a[x.Matrix3.COLUMN0ROW1],y.CesiumMath.EPSILON15)+t.y),C=a[x.Matrix3.COLUMN0ROW0]*i+a[x.Matrix3.COLUMN2ROW2]*s+r*t.x+e,c=s*N(a[x.Matrix3.COLUMN2ROW1],a[x.Matrix3.COLUMN1ROW2],y.CesiumMath.EPSILON15),l=n*(r*N(a[x.Matrix3.COLUMN2ROW0],a[x.Matrix3.COLUMN0ROW2])+t.z),h=[];if(0==l&&0==c){if(0===(g=P.computeRealRoots(o,u,C)).length)return h;var M=g[0],f=Math.sqrt(Math.max(1-M*M,0));return h.push(new O.Cartesian3(r,n*M,n*-f)),h.push(new O.Cartesian3(r,n*M,n*f)),2===g.length&&(m=g[1],d=Math.sqrt(Math.max(1-m*m,0)),h.push(new O.Cartesian3(r,n*m,n*-d)),h.push(new O.Cartesian3(r,n*m,n*d))),h}var m=o*o+(M=c*c),d=2*(u*o+(f=l*c)),M=2*C*o+u*u-M+(t=l*l),f=2*(C*u-f),t=C*C-t;if(0==m&&0==d&&0==M&&0==f)return h;var g,p=(g=b.computeRealRoots(m,d,M,f,t)).length;if(0===p)return h;for(var v=0;v<p;++v){var w=g[v],R=w*w,S=Math.max(1-R,0),S=Math.sqrt(S),R=y.CesiumMath.sign(o)===y.CesiumMath.sign(C)?N(o*R+C,u*w,y.CesiumMath.EPSILON12):y.CesiumMath.sign(C)===y.CesiumMath.sign(u*w)?N(o*R,u*w+C,y.CesiumMath.EPSILON12):N(o*R+u*w,C,y.CesiumMath.EPSILON12),R=R*N(c*w,l,y.CesiumMath.EPSILON15);R<0?h.push(new O.Cartesian3(r,n*w,n*S)):0<R?h.push(new O.Cartesian3(r,n*w,n*-S)):0!==S?(h.push(new O.Cartesian3(r,n*w,n*-S)),h.push(new O.Cartesian3(r,n*w,n*S)),++v):h.push(new O.Cartesian3(r,n*w,n*S))}return h}(a,O.Cartesian3.negate(s,q),0,0,1),c=C.length;if(0<c){for(var l=O.Cartesian3.clone(O.Cartesian3.ZERO,k),h=Number.NEGATIVE_INFINITY,M=0;M<c;++M){var f=x.Matrix3.multiplyByVector(u,x.Matrix3.multiplyByVector(o,C[M],D),D),m=O.Cartesian3.normalize(O.Cartesian3.subtract(f,e,E),E),m=O.Cartesian3.dot(m,r);h<m&&(h=m,l=O.Cartesian3.clone(f,l))}a=t.cartesianToCartographic(l,F),h=y.CesiumMath.clamp(h,0,1),s=O.Cartesian3.magnitude(O.Cartesian3.subtract(l,e,E))*Math.sqrt(1-h*h);return s=i?-s:s,a.height=s,t.cartographicToCartesian(a,new O.Cartesian3)}};var G=new O.Cartesian3;l.lineSegmentPlane=function(a,t,e,r){d.defined(r)||(r=new O.Cartesian3);var n=O.Cartesian3.subtract(t,a,G),i=e.normal,t=O.Cartesian3.dot(i,n);if(!(Math.abs(t)<y.CesiumMath.EPSILON6)){i=O.Cartesian3.dot(i,a),t=-(e.distance+i)/t;if(!(t<0||1<t))return O.Cartesian3.multiplyByScalar(n,t,r),O.Cartesian3.add(a,r,r),r}},l.trianglePlaneIntersection=function(a,t,e,r){var n,i,s=r.normal,o=r.distance,u=O.Cartesian3.dot(s,a)+o<0,C=O.Cartesian3.dot(s,t)+o<0,s=O.Cartesian3.dot(s,e)+o<0,o=0;if(o+=u?1:0,o+=C?1:0,1!=(o+=s?1:0)&&2!=o||(n=new O.Cartesian3,i=new O.Cartesian3),1==o){if(u)return l.lineSegmentPlane(a,t,r,n),l.lineSegmentPlane(a,e,r,i),{positions:[a,t,e,n,i],indices:[0,3,4,1,2,4,1,4,3]};if(C)return l.lineSegmentPlane(t,e,r,n),l.lineSegmentPlane(t,a,r,i),{positions:[a,t,e,n,i],indices:[1,3,4,2,0,4,2,4,3]};if(s)return l.lineSegmentPlane(e,a,r,n),l.lineSegmentPlane(e,t,r,i),{positions:[a,t,e,n,i],indices:[2,3,4,0,1,4,0,4,3]}}else if(2==o){if(!u)return l.lineSegmentPlane(t,a,r,n),l.lineSegmentPlane(e,a,r,i),{positions:[a,t,e,n,i],indices:[1,2,4,1,4,3,0,3,4]};if(!C)return l.lineSegmentPlane(e,t,r,n),l.lineSegmentPlane(a,t,r,i),{positions:[a,t,e,n,i],indices:[2,0,4,2,4,3,1,3,4]};if(!s)return l.lineSegmentPlane(a,e,r,n),l.lineSegmentPlane(t,e,r,i),{positions:[a,t,e,n,i],indices:[0,1,4,0,4,3,2,3,4]}}},a.IntersectionTests=l,a.Ray=e}); diff --git a/public/Cesium/Workers/Math-4e53b694.js b/public/Cesium/Workers/Math-d6182036.js similarity index 97% rename from public/Cesium/Workers/Math-4e53b694.js rename to public/Cesium/Workers/Math-d6182036.js index d467c68..a512b82 100644 --- a/public/Cesium/Workers/Math-4e53b694.js +++ b/public/Cesium/Workers/Math-d6182036.js @@ -1 +1 @@ -define(["exports","./Check-d18af7c4","./when-208fe5b0"],function(t,n,r){"use strict";function i(t){null==t&&(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,this.init_genrand(t)}i.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},i.prototype.genrand_int32=function(){var t,n,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^i[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^i[1&t];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[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,(t^=t>>>18)>>>0},i.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var h={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};h.sign=r.defaultValue(Math.sign,function(t){return 0===(t=+t)||t!=t?t:0<t?1:-1}),h.signNotZero=function(t){return t<0?-1:1},h.toSNorm=function(t,n){return n=r.defaultValue(n,255),Math.round((.5*h.clamp(t,-1,1)+.5)*n)},h.fromSNorm=function(t,n){return n=r.defaultValue(n,255),h.clamp(t,0,n)/n*2-1},h.normalize=function(t,n,i){return 0===(i=Math.max(i-n,0))?0:h.clamp((t-n)/i,0,1)},h.sinh=r.defaultValue(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2}),h.cosh=r.defaultValue(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2}),h.lerp=function(t,n,i){return(1-i)*t+i*n},h.PI=Math.PI,h.ONE_OVER_PI=1/Math.PI,h.PI_OVER_TWO=Math.PI/2,h.PI_OVER_THREE=Math.PI/3,h.PI_OVER_FOUR=Math.PI/4,h.PI_OVER_SIX=Math.PI/6,h.THREE_PI_OVER_TWO=3*Math.PI/2,h.TWO_PI=2*Math.PI,h.ONE_OVER_TWO_PI=1/(2*Math.PI),h.RADIANS_PER_DEGREE=Math.PI/180,h.DEGREES_PER_RADIAN=180/Math.PI,h.RADIANS_PER_ARCSECOND=h.RADIANS_PER_DEGREE/3600,h.toRadians=function(t){return t*h.RADIANS_PER_DEGREE},h.toDegrees=function(t){return t*h.DEGREES_PER_RADIAN},h.convertLongitudeRange=function(t){var n=h.TWO_PI,t=t-Math.floor(t/n)*n;return t<-Math.PI?t+n:t>=Math.PI?t-n:t},h.clampToLatitudeRange=function(t){return h.clamp(t,-1*h.PI_OVER_TWO,h.PI_OVER_TWO)},h.negativePiToPi=function(t){return t>=-h.PI&&t<=h.PI?t:h.zeroToTwoPi(t+h.PI)-h.PI},h.zeroToTwoPi=function(t){if(0<=t&&t<=h.TWO_PI)return t;var n=h.mod(t,h.TWO_PI);return Math.abs(n)<h.EPSILON14&&Math.abs(t)>h.EPSILON14?h.TWO_PI:n},h.mod=function(t,n){return h.sign(t)===h.sign(n)&&Math.abs(t)<Math.abs(n)?t:(t%n+n)%n},h.equalsEpsilon=function(t,n,i,a){i=r.defaultValue(i,0),a=r.defaultValue(a,i);var e=Math.abs(t-n);return e<=a||e<=i*Math.max(Math.abs(t),Math.abs(n))},h.lessThan=function(t,n,i){return t-n<-i},h.lessThanOrEquals=function(t,n,i){return t-n<i},h.greaterThan=function(t,n,i){return i<t-n},h.greaterThanOrEquals=function(t,n,i){return-i<t-n};var u=[1];h.factorial=function(t){var n=u.length;if(n<=t)for(var i=u[n-1],a=n;a<=t;a++){var e=i*a;u.push(e),i=e}return u[t]},h.incrementWrap=function(t,n,i){return i=r.defaultValue(i,0),t=n<++t?i:t},h.isPowerOfTwo=function(t){return 0!==t&&0==(t&t-1)},h.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},h.previousPowerOfTwo=function(t){return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t=((t|=t>>32)>>>0)-(t>>>1)},h.clamp=function(t,n,i){return t<n?n:i<t?i:t};var a=new i;h.setRandomNumberSeed=function(t){a=new i(t)},h.nextRandomNumber=function(){return a.random()},h.randomBetween=function(t,n){return h.nextRandomNumber()*(n-t)+t},h.acosClamped=function(t){return Math.acos(h.clamp(t,-1,1))},h.asinClamped=function(t){return Math.asin(h.clamp(t,-1,1))},h.chordLength=function(t,n){return 2*n*Math.sin(.5*t)},h.logBase=function(t,n){return Math.log(t)/Math.log(n)},h.cbrt=r.defaultValue(Math.cbrt,function(t){var n=Math.pow(Math.abs(t),1/3);return t<0?-n:n}),h.log2=r.defaultValue(Math.log2,function(t){return Math.log(t)*Math.LOG2E}),h.fog=function(t,n){n*=t;return 1-Math.exp(-n*n)},h.fastApproximateAtan=function(t){return t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},h.fastApproximateAtan2=function(t,n){var i=Math.abs(t),a=Math.abs(n),e=Math.max(i,a),e=Math.min(i,a)/e,i=h.fastApproximateAtan(e);return i=Math.abs(n)>Math.abs(t)?h.PI_OVER_TWO-i:i,i=t<0?h.PI-i:i,i=n<0?-i:i},t.CesiumMath=h}); +define(["exports","./Check-24483042","./when-54335d57"],function(t,n,r){"use strict";function i(t){null==t&&(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,this.init_genrand(t)}i.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},i.prototype.genrand_int32=function(){var t,n,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^i[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^i[1&t];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[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,(t^=t>>>18)>>>0},i.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var h={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};h.sign=r.defaultValue(Math.sign,function(t){return 0===(t=+t)||t!=t?t:0<t?1:-1}),h.signNotZero=function(t){return t<0?-1:1},h.toSNorm=function(t,n){return n=r.defaultValue(n,255),Math.round((.5*h.clamp(t,-1,1)+.5)*n)},h.fromSNorm=function(t,n){return n=r.defaultValue(n,255),h.clamp(t,0,n)/n*2-1},h.normalize=function(t,n,i){return 0===(i=Math.max(i-n,0))?0:h.clamp((t-n)/i,0,1)},h.sinh=r.defaultValue(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2}),h.cosh=r.defaultValue(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2}),h.lerp=function(t,n,i){return(1-i)*t+i*n},h.PI=Math.PI,h.ONE_OVER_PI=1/Math.PI,h.PI_OVER_TWO=Math.PI/2,h.PI_OVER_THREE=Math.PI/3,h.PI_OVER_FOUR=Math.PI/4,h.PI_OVER_SIX=Math.PI/6,h.THREE_PI_OVER_TWO=3*Math.PI/2,h.TWO_PI=2*Math.PI,h.ONE_OVER_TWO_PI=1/(2*Math.PI),h.RADIANS_PER_DEGREE=Math.PI/180,h.DEGREES_PER_RADIAN=180/Math.PI,h.RADIANS_PER_ARCSECOND=h.RADIANS_PER_DEGREE/3600,h.toRadians=function(t){return t*h.RADIANS_PER_DEGREE},h.toDegrees=function(t){return t*h.DEGREES_PER_RADIAN},h.convertLongitudeRange=function(t){var n=h.TWO_PI,t=t-Math.floor(t/n)*n;return t<-Math.PI?t+n:t>=Math.PI?t-n:t},h.clampToLatitudeRange=function(t){return h.clamp(t,-1*h.PI_OVER_TWO,h.PI_OVER_TWO)},h.negativePiToPi=function(t){return t>=-h.PI&&t<=h.PI?t:h.zeroToTwoPi(t+h.PI)-h.PI},h.zeroToTwoPi=function(t){if(0<=t&&t<=h.TWO_PI)return t;var n=h.mod(t,h.TWO_PI);return Math.abs(n)<h.EPSILON14&&Math.abs(t)>h.EPSILON14?h.TWO_PI:n},h.mod=function(t,n){return h.sign(t)===h.sign(n)&&Math.abs(t)<Math.abs(n)?t:(t%n+n)%n},h.equalsEpsilon=function(t,n,i,a){i=r.defaultValue(i,0),a=r.defaultValue(a,i);var e=Math.abs(t-n);return e<=a||e<=i*Math.max(Math.abs(t),Math.abs(n))},h.lessThan=function(t,n,i){return t-n<-i},h.lessThanOrEquals=function(t,n,i){return t-n<i},h.greaterThan=function(t,n,i){return i<t-n},h.greaterThanOrEquals=function(t,n,i){return-i<t-n};var u=[1];h.factorial=function(t){var n=u.length;if(n<=t)for(var i=u[n-1],a=n;a<=t;a++){var e=i*a;u.push(e),i=e}return u[t]},h.incrementWrap=function(t,n,i){return i=r.defaultValue(i,0),t=n<++t?i:t},h.isPowerOfTwo=function(t){return 0!==t&&0==(t&t-1)},h.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},h.previousPowerOfTwo=function(t){return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t=((t|=t>>32)>>>0)-(t>>>1)},h.clamp=function(t,n,i){return t<n?n:i<t?i:t};var a=new i;h.setRandomNumberSeed=function(t){a=new i(t)},h.nextRandomNumber=function(){return a.random()},h.randomBetween=function(t,n){return h.nextRandomNumber()*(n-t)+t},h.acosClamped=function(t){return Math.acos(h.clamp(t,-1,1))},h.asinClamped=function(t){return Math.asin(h.clamp(t,-1,1))},h.chordLength=function(t,n){return 2*n*Math.sin(.5*t)},h.logBase=function(t,n){return Math.log(t)/Math.log(n)},h.cbrt=r.defaultValue(Math.cbrt,function(t){var n=Math.pow(Math.abs(t),1/3);return t<0?-n:n}),h.log2=r.defaultValue(Math.log2,function(t){return Math.log(t)*Math.LOG2E}),h.fog=function(t,n){n*=t;return 1-Math.exp(-n*n)},h.fastApproximateAtan=function(t){return t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},h.fastApproximateAtan2=function(t,n){var i=Math.abs(t),a=Math.abs(n),e=Math.max(i,a);a=Math.min(i,a);i=h.fastApproximateAtan(a/e);return i=Math.abs(n)>Math.abs(t)?h.PI_OVER_TWO-i:i,i=t<0?h.PI-i:i,i=n<0?-i:i},t.CesiumMath=h}); diff --git a/public/Cesium/Workers/OrientedBoundingBox-18b4901f.js b/public/Cesium/Workers/OrientedBoundingBox-18b4901f.js deleted file mode 100644 index 7c121e0..0000000 --- a/public/Cesium/Workers/OrientedBoundingBox-18b4901f.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./EllipsoidTangentPlane-9123a53b","./Math-4e53b694","./Plane-4aa8974d"],function(a,b,O,t,P,w,y,N){"use strict";function A(a,t){this.center=O.Cartesian3.clone(P.defaultValue(a,O.Cartesian3.ZERO)),this.halfAxes=b.Matrix3.clone(P.defaultValue(t,b.Matrix3.ZERO))}A.packedLength=O.Cartesian3.packedLength+b.Matrix3.packedLength,A.pack=function(a,t,e){return e=P.defaultValue(e,0),O.Cartesian3.pack(a.center,t,e),b.Matrix3.pack(a.halfAxes,t,e+O.Cartesian3.packedLength),t},A.unpack=function(a,t,e){return t=P.defaultValue(t,0),P.defined(e)||(e=new A),O.Cartesian3.unpack(a,t,e.center),b.Matrix3.unpack(a,t+O.Cartesian3.packedLength,e.halfAxes),e};var T=new O.Cartesian3,R=new O.Cartesian3,I=new O.Cartesian3,E=new O.Cartesian3,L=new O.Cartesian3,z=new O.Cartesian3,S=new b.Matrix3,U={unitary:new b.Matrix3,diagonal:new b.Matrix3};A.fromPoints=function(a,t){if(P.defined(t)||(t=new A),!P.defined(a)||0===a.length)return t.halfAxes=b.Matrix3.ZERO,t.center=O.Cartesian3.ZERO,t;for(var e=a.length,n=O.Cartesian3.clone(a[0],T),r=1;r<e;r++)O.Cartesian3.add(n,a[r],n);var i=1/e;O.Cartesian3.multiplyByScalar(n,i,n);var s,o=0,C=0,c=0,u=0,l=0,d=0;for(r=0;r<e;r++)o+=(s=O.Cartesian3.subtract(a[r],n,R)).x*s.x,C+=s.x*s.y,c+=s.x*s.z,u+=s.y*s.y,l+=s.y*s.z,d+=s.z*s.z;o*=i,C*=i,c*=i,u*=i,l*=i,d*=i;i=S;i[0]=o,i[1]=C,i[2]=c,i[3]=C,i[4]=u,i[5]=l,i[6]=c,i[7]=l,i[8]=d;var i=b.Matrix3.computeEigenDecomposition(i,U),i=b.Matrix3.clone(i.unitary,t.halfAxes),h=b.Matrix3.getColumn(i,0,E),x=b.Matrix3.getColumn(i,1,L),M=b.Matrix3.getColumn(i,2,z),m=-Number.MAX_VALUE,f=-Number.MAX_VALUE,p=-Number.MAX_VALUE,g=Number.MAX_VALUE,w=Number.MAX_VALUE,y=Number.MAX_VALUE;for(r=0;r<e;r++)s=a[r],m=Math.max(O.Cartesian3.dot(h,s),m),f=Math.max(O.Cartesian3.dot(x,s),f),p=Math.max(O.Cartesian3.dot(M,s),p),g=Math.min(O.Cartesian3.dot(h,s),g),w=Math.min(O.Cartesian3.dot(x,s),w),y=Math.min(O.Cartesian3.dot(M,s),y);h=O.Cartesian3.multiplyByScalar(h,.5*(g+m),h),x=O.Cartesian3.multiplyByScalar(x,.5*(w+f),x),M=O.Cartesian3.multiplyByScalar(M,.5*(y+p),M),i=O.Cartesian3.add(h,x,t.center);O.Cartesian3.add(i,M,i);i=I;return i.x=m-g,i.y=f-w,i.z=p-y,O.Cartesian3.multiplyByScalar(i,.5,i),b.Matrix3.multiplyByScale(t.halfAxes,i,t.halfAxes),t};var d=new O.Cartesian3,h=new O.Cartesian3;function V(a,t,e,n,r,i,s,o,C,c,u){var l=(u=!P.defined(u)?new A:u).halfAxes;b.Matrix3.setColumn(l,0,t,l),b.Matrix3.setColumn(l,1,e,l),b.Matrix3.setColumn(l,2,n,l),(e=d).x=(r+i)/2,e.y=(s+o)/2,e.z=(C+c)/2;n=h;n.x=(i-r)/2,n.y=(o-s)/2,n.z=(c-C)/2;C=u.center,e=b.Matrix3.multiplyByVector(l,e,e);return O.Cartesian3.add(a,e,C),b.Matrix3.multiplyByScale(l,n,l),u}var v=new O.Cartographic,B=new O.Cartesian3,_=new O.Cartographic,k=new O.Cartographic,W=new O.Cartographic,D=new O.Cartographic,q=new O.Cartographic,X=new O.Cartesian3,j=new O.Cartesian3,Z=new O.Cartesian3,G=new O.Cartesian3,F=new O.Cartesian3,Y=new O.Cartesian2,H=new O.Cartesian2,J=new O.Cartesian2,K=new O.Cartesian2,Q=new O.Cartesian2,$=new O.Cartesian3,aa=new O.Cartesian3,ta=new O.Cartesian3,ea=new O.Cartesian3,na=new O.Cartesian2,ra=new O.Cartesian3,ia=new O.Cartesian3,sa=new O.Cartesian3,oa=new N.Plane(O.Cartesian3.UNIT_X,0);A.fromRectangle=function(a,t,e,n,r){if(t=P.defaultValue(t,0),e=P.defaultValue(e,0),n=P.defaultValue(n,O.Ellipsoid.WGS84),a.width<=y.CesiumMath.PI){var i=O.Rectangle.center(a,v),s=n.cartographicToCartesian(i,B),o=new w.EllipsoidTangentPlane(s,n),C=o.plane,c=i.longitude,u=a.south<0&&0<a.north?0:i.latitude,l=O.Cartographic.fromRadians(c,a.north,e,_),d=O.Cartographic.fromRadians(a.west,a.north,e,k),h=O.Cartographic.fromRadians(a.west,u,e,W),x=O.Cartographic.fromRadians(a.west,a.south,e,D),M=O.Cartographic.fromRadians(c,a.south,e,q),m=n.cartographicToCartesian(l,X),f=n.cartographicToCartesian(d,j),p=n.cartographicToCartesian(h,Z),g=n.cartographicToCartesian(x,G),s=n.cartographicToCartesian(M,F),i=o.projectPointToNearestOnPlane(m,Y),u=o.projectPointToNearestOnPlane(f,H),c=o.projectPointToNearestOnPlane(p,J),l=o.projectPointToNearestOnPlane(g,K),h=o.projectPointToNearestOnPlane(s,Q),m=-(M=Math.min(u.x,c.x,l.x)),p=Math.max(u.y,i.y),s=Math.min(l.y,h.y);return d.height=x.height=t,f=n.cartographicToCartesian(d,j),g=n.cartographicToCartesian(x,G),c=Math.min(N.Plane.getPointDistance(C,f),N.Plane.getPointDistance(C,g)),u=e,V(o.origin,o.xAxis,o.yAxis,o.zAxis,M,m,s,p,c,u,r)}i=0<a.south,l=a.north<0,h=i?a.south:l?a.north:0,d=O.Rectangle.center(a,v).longitude,x=O.Cartesian3.fromRadians(d,h,e,n,$);x.z=0;f=Math.abs(x.x)<y.CesiumMath.EPSILON10&&Math.abs(x.y)<y.CesiumMath.EPSILON10?O.Cartesian3.UNIT_X:O.Cartesian3.normalize(x,aa),g=O.Cartesian3.UNIT_Z,o=O.Cartesian3.cross(f,g,ta);C=N.Plane.fromPointNormal(x,f,oa);d=O.Cartesian3.fromRadians(d+y.CesiumMath.PI_OVER_TWO,h,e,n,ea);M=-(m=O.Cartesian3.dot(N.Plane.projectPointOntoPlane(C,d,na),o)),p=O.Cartesian3.fromRadians(0,a.north,l?t:e,n,ra).z,s=O.Cartesian3.fromRadians(0,a.south,i?t:e,n,ia).z;n=O.Cartesian3.fromRadians(a.east,h,e,n,sa);return V(x,o,g,f,M,m,s,p,c=N.Plane.getPointDistance(C,n),u=0,r)},A.clone=function(a,t){if(P.defined(a))return P.defined(t)?(O.Cartesian3.clone(a.center,t.center),b.Matrix3.clone(a.halfAxes,t.halfAxes),t):new A(a.center,a.halfAxes)},A.intersectPlane=function(a,t){var e=a.center,n=t.normal,r=a.halfAxes,i=n.x,s=n.y,a=n.z,r=Math.abs(i*r[b.Matrix3.COLUMN0ROW0]+s*r[b.Matrix3.COLUMN0ROW1]+a*r[b.Matrix3.COLUMN0ROW2])+Math.abs(i*r[b.Matrix3.COLUMN1ROW0]+s*r[b.Matrix3.COLUMN1ROW1]+a*r[b.Matrix3.COLUMN1ROW2])+Math.abs(i*r[b.Matrix3.COLUMN2ROW0]+s*r[b.Matrix3.COLUMN2ROW1]+a*r[b.Matrix3.COLUMN2ROW2]),t=O.Cartesian3.dot(n,e)+t.distance;return t<=-r?b.Intersect.OUTSIDE:r<=t?b.Intersect.INSIDE:b.Intersect.INTERSECTING};var x=new O.Cartesian3,M=new O.Cartesian3,m=new O.Cartesian3,c=new O.Cartesian3;A.distanceSquaredTo=function(a,t){var e=O.Cartesian3.subtract(t,a.center,d),n=a.halfAxes,r=b.Matrix3.getColumn(n,0,x),i=b.Matrix3.getColumn(n,1,M),s=b.Matrix3.getColumn(n,2,m),o=O.Cartesian3.magnitude(r),t=O.Cartesian3.magnitude(i),a=O.Cartesian3.magnitude(s);O.Cartesian3.normalize(r,r),O.Cartesian3.normalize(i,i),O.Cartesian3.normalize(s,s);n=c;n.x=O.Cartesian3.dot(e,r),n.y=O.Cartesian3.dot(e,i),n.z=O.Cartesian3.dot(e,s);var C,s=0;return n.x<-o?s+=(C=n.x+o)*C:n.x>o&&(s+=(C=n.x-o)*C),n.y<-t?s+=(C=n.y+t)*C:n.y>t&&(s+=(C=n.y-t)*C),n.z<-a?s+=(C=n.z+a)*C:n.z>a&&(s+=(C=n.z-a)*C),s};var f=new O.Cartesian3,p=new O.Cartesian3;A.computePlaneDistances=function(a,t,e,n){P.defined(n)||(n=new b.Interval);var r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=a.center,o=a.halfAxes,C=b.Matrix3.getColumn(o,0,x),c=b.Matrix3.getColumn(o,1,M),u=b.Matrix3.getColumn(o,2,m),l=O.Cartesian3.add(C,c,f);O.Cartesian3.add(l,u,l),O.Cartesian3.add(l,s,l);a=O.Cartesian3.subtract(l,t,p),o=O.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i);return O.Cartesian3.add(s,C,l),O.Cartesian3.add(l,c,l),O.Cartesian3.subtract(l,u,l),O.Cartesian3.subtract(l,t,a),o=O.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),O.Cartesian3.add(s,C,l),O.Cartesian3.subtract(l,c,l),O.Cartesian3.add(l,u,l),O.Cartesian3.subtract(l,t,a),o=O.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),O.Cartesian3.add(s,C,l),O.Cartesian3.subtract(l,c,l),O.Cartesian3.subtract(l,u,l),O.Cartesian3.subtract(l,t,a),o=O.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),O.Cartesian3.subtract(s,C,l),O.Cartesian3.add(l,c,l),O.Cartesian3.add(l,u,l),O.Cartesian3.subtract(l,t,a),o=O.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),O.Cartesian3.subtract(s,C,l),O.Cartesian3.add(l,c,l),O.Cartesian3.subtract(l,u,l),O.Cartesian3.subtract(l,t,a),o=O.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),O.Cartesian3.subtract(s,C,l),O.Cartesian3.subtract(l,c,l),O.Cartesian3.add(l,u,l),O.Cartesian3.subtract(l,t,a),o=O.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),O.Cartesian3.subtract(s,C,l),O.Cartesian3.subtract(l,c,l),O.Cartesian3.subtract(l,u,l),O.Cartesian3.subtract(l,t,a),o=O.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),n.start=r,n.stop=i,n};var e=new b.BoundingSphere;A.isOccluded=function(a,t){a=b.BoundingSphere.fromOrientedBoundingBox(a,e);return!t.isBoundingSphereVisible(a)},A.prototype.intersectPlane=function(a){return A.intersectPlane(this,a)},A.prototype.distanceSquaredTo=function(a){return A.distanceSquaredTo(this,a)},A.prototype.computePlaneDistances=function(a,t,e){return A.computePlaneDistances(this,a,t,e)},A.prototype.isOccluded=function(a){return A.isOccluded(this,a)},A.equals=function(a,t){return a===t||P.defined(a)&&P.defined(t)&&O.Cartesian3.equals(a.center,t.center)&&b.Matrix3.equals(a.halfAxes,t.halfAxes)},A.prototype.clone=function(a){return A.clone(this,a)},A.prototype.equals=function(a){return A.equals(this,a)},a.OrientedBoundingBox=A}); diff --git a/public/Cesium/Workers/OrientedBoundingBox-eb360dc3.js b/public/Cesium/Workers/OrientedBoundingBox-eb360dc3.js new file mode 100644 index 0000000..1617721 --- /dev/null +++ b/public/Cesium/Workers/OrientedBoundingBox-eb360dc3.js @@ -0,0 +1 @@ +define(["exports","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./EllipsoidTangentPlane-325a8e68","./Math-d6182036","./Plane-13ae4b1b"],function(a,O,P,t,N,g,w,y){"use strict";function A(a,t){this.center=P.Cartesian3.clone(N.defaultValue(a,P.Cartesian3.ZERO)),this.halfAxes=O.Matrix3.clone(N.defaultValue(t,O.Matrix3.ZERO))}A.packedLength=P.Cartesian3.packedLength+O.Matrix3.packedLength,A.pack=function(a,t,e){return e=N.defaultValue(e,0),P.Cartesian3.pack(a.center,t,e),O.Matrix3.pack(a.halfAxes,t,e+P.Cartesian3.packedLength),t},A.unpack=function(a,t,e){return t=N.defaultValue(t,0),N.defined(e)||(e=new A),P.Cartesian3.unpack(a,t,e.center),O.Matrix3.unpack(a,t+P.Cartesian3.packedLength,e.halfAxes),e};var T=new P.Cartesian3,R=new P.Cartesian3,I=new P.Cartesian3,E=new P.Cartesian3,L=new P.Cartesian3,z=new P.Cartesian3,S=new O.Matrix3,U={unitary:new O.Matrix3,diagonal:new O.Matrix3};A.fromPoints=function(a,t){if(N.defined(t)||(t=new A),!N.defined(a)||0===a.length)return t.halfAxes=O.Matrix3.ZERO,t.center=P.Cartesian3.ZERO,t;for(var e=a.length,n=P.Cartesian3.clone(a[0],T),r=1;r<e;r++)P.Cartesian3.add(n,a[r],n);var i=1/e;P.Cartesian3.multiplyByScalar(n,i,n);var s,o=0,C=0,c=0,u=0,l=0,d=0;for(r=0;r<e;r++)o+=(s=P.Cartesian3.subtract(a[r],n,R)).x*s.x,C+=s.x*s.y,c+=s.x*s.z,u+=s.y*s.y,l+=s.y*s.z,d+=s.z*s.z;C*=i,c*=i,u*=i,l*=i,d*=i;var h=S;h[0]=o*=i,h[1]=C,h[2]=c,h[3]=C,h[4]=u,h[5]=l,h[6]=c,h[7]=l,h[8]=d;var h=O.Matrix3.computeEigenDecomposition(h,U),h=O.Matrix3.clone(h.unitary,t.halfAxes),x=O.Matrix3.getColumn(h,0,E),M=O.Matrix3.getColumn(h,1,L),m=O.Matrix3.getColumn(h,2,z),f=-Number.MAX_VALUE,p=-Number.MAX_VALUE,g=-Number.MAX_VALUE,w=Number.MAX_VALUE,y=Number.MAX_VALUE,b=Number.MAX_VALUE;for(r=0;r<e;r++)s=a[r],f=Math.max(P.Cartesian3.dot(x,s),f),p=Math.max(P.Cartesian3.dot(M,s),p),g=Math.max(P.Cartesian3.dot(m,s),g),w=Math.min(P.Cartesian3.dot(x,s),w),y=Math.min(P.Cartesian3.dot(M,s),y),b=Math.min(P.Cartesian3.dot(m,s),b);x=P.Cartesian3.multiplyByScalar(x,.5*(w+f),x),M=P.Cartesian3.multiplyByScalar(M,.5*(y+p),M),m=P.Cartesian3.multiplyByScalar(m,.5*(b+g),m),h=P.Cartesian3.add(x,M,t.center);P.Cartesian3.add(h,m,h);h=I;return h.x=f-w,h.y=p-y,h.z=g-b,P.Cartesian3.multiplyByScalar(h,.5,h),O.Matrix3.multiplyByScale(t.halfAxes,h,t.halfAxes),t};var d=new P.Cartesian3,h=new P.Cartesian3;function b(a,t,e,n,r,i,s,o,C,c,u){var l=(u=!N.defined(u)?new A:u).halfAxes;O.Matrix3.setColumn(l,0,t,l),O.Matrix3.setColumn(l,1,e,l),O.Matrix3.setColumn(l,2,n,l),(e=d).x=(r+i)/2,e.y=(s+o)/2,e.z=(C+c)/2;n=h;n.x=(i-r)/2,n.y=(o-s)/2,n.z=(c-C)/2;C=u.center,e=O.Matrix3.multiplyByVector(l,e,e);return P.Cartesian3.add(a,e,C),O.Matrix3.multiplyByScale(l,n,l),u}var v=new P.Cartographic,V=new P.Cartesian3,B=new P.Cartographic,_=new P.Cartographic,k=new P.Cartographic,W=new P.Cartographic,D=new P.Cartographic,q=new P.Cartesian3,X=new P.Cartesian3,j=new P.Cartesian3,Z=new P.Cartesian3,G=new P.Cartesian3,F=new P.Cartesian2,Y=new P.Cartesian2,H=new P.Cartesian2,J=new P.Cartesian2,K=new P.Cartesian2,Q=new P.Cartesian3,$=new P.Cartesian3,aa=new P.Cartesian3,ta=new P.Cartesian3,ea=new P.Cartesian2,na=new P.Cartesian3,ra=new P.Cartesian3,ia=new P.Cartesian3,sa=new y.Plane(P.Cartesian3.UNIT_X,0);A.fromRectangle=function(a,t,e,n,r){if(t=N.defaultValue(t,0),e=N.defaultValue(e,0),n=N.defaultValue(n,P.Ellipsoid.WGS84),a.width<=w.CesiumMath.PI){var i=P.Rectangle.center(a,v),s=n.cartographicToCartesian(i,V),o=new g.EllipsoidTangentPlane(s,n),C=o.plane,c=i.longitude,u=a.south<0&&0<a.north?0:i.latitude,l=P.Cartographic.fromRadians(c,a.north,e,B),d=P.Cartographic.fromRadians(a.west,a.north,e,_),h=P.Cartographic.fromRadians(a.west,u,e,k),x=P.Cartographic.fromRadians(a.west,a.south,e,W),M=P.Cartographic.fromRadians(c,a.south,e,D),m=n.cartographicToCartesian(l,q),f=n.cartographicToCartesian(d,X),p=n.cartographicToCartesian(h,j),s=n.cartographicToCartesian(x,Z),i=n.cartographicToCartesian(M,G),u=o.projectPointToNearestOnPlane(m,F),c=o.projectPointToNearestOnPlane(f,Y),l=o.projectPointToNearestOnPlane(p,H),h=o.projectPointToNearestOnPlane(s,J),M=o.projectPointToNearestOnPlane(i,K),p=-(m=Math.min(c.x,l.x,h.x)),i=Math.max(c.y,u.y),l=Math.min(h.y,M.y);return d.height=x.height=t,f=n.cartographicToCartesian(d,X),s=n.cartographicToCartesian(x,Z),c=Math.min(y.Plane.getPointDistance(C,f),y.Plane.getPointDistance(C,s)),b(o.origin,o.xAxis,o.yAxis,o.zAxis,m,p,l,i,c,e,r)}u=0<a.south,h=a.north<0,M=u?a.south:h?a.north:0,d=P.Rectangle.center(a,v).longitude,x=P.Cartesian3.fromRadians(d,M,e,n,Q);x.z=0;f=Math.abs(x.x)<w.CesiumMath.EPSILON10&&Math.abs(x.y)<w.CesiumMath.EPSILON10?P.Cartesian3.UNIT_X:P.Cartesian3.normalize(x,$),s=P.Cartesian3.UNIT_Z,o=P.Cartesian3.cross(f,s,aa);C=y.Plane.fromPointNormal(x,f,sa);d=P.Cartesian3.fromRadians(d+w.CesiumMath.PI_OVER_TWO,M,e,n,ta);m=-(p=P.Cartesian3.dot(y.Plane.projectPointOntoPlane(C,d,ea),o)),i=P.Cartesian3.fromRadians(0,a.north,h?t:e,n,na).z,l=P.Cartesian3.fromRadians(0,a.south,u?t:e,n,ra).z;n=P.Cartesian3.fromRadians(a.east,M,e,n,ia);return b(x,o,s,f,m,p,l,i,c=y.Plane.getPointDistance(C,n),0,r)},A.clone=function(a,t){if(N.defined(a))return N.defined(t)?(P.Cartesian3.clone(a.center,t.center),O.Matrix3.clone(a.halfAxes,t.halfAxes),t):new A(a.center,a.halfAxes)},A.intersectPlane=function(a,t){var e=a.center,n=t.normal,r=a.halfAxes,i=n.x,s=n.y,a=n.z,r=Math.abs(i*r[O.Matrix3.COLUMN0ROW0]+s*r[O.Matrix3.COLUMN0ROW1]+a*r[O.Matrix3.COLUMN0ROW2])+Math.abs(i*r[O.Matrix3.COLUMN1ROW0]+s*r[O.Matrix3.COLUMN1ROW1]+a*r[O.Matrix3.COLUMN1ROW2])+Math.abs(i*r[O.Matrix3.COLUMN2ROW0]+s*r[O.Matrix3.COLUMN2ROW1]+a*r[O.Matrix3.COLUMN2ROW2]),t=P.Cartesian3.dot(n,e)+t.distance;return t<=-r?O.Intersect.OUTSIDE:r<=t?O.Intersect.INSIDE:O.Intersect.INTERSECTING};var x=new P.Cartesian3,M=new P.Cartesian3,m=new P.Cartesian3,c=new P.Cartesian3;A.distanceSquaredTo=function(a,t){var e=P.Cartesian3.subtract(t,a.center,d),n=a.halfAxes,r=O.Matrix3.getColumn(n,0,x),i=O.Matrix3.getColumn(n,1,M),s=O.Matrix3.getColumn(n,2,m),o=P.Cartesian3.magnitude(r),t=P.Cartesian3.magnitude(i),a=P.Cartesian3.magnitude(s);P.Cartesian3.normalize(r,r),P.Cartesian3.normalize(i,i),P.Cartesian3.normalize(s,s);n=c;n.x=P.Cartesian3.dot(e,r),n.y=P.Cartesian3.dot(e,i),n.z=P.Cartesian3.dot(e,s);var C,s=0;return n.x<-o?s+=(C=n.x+o)*C:n.x>o&&(s+=(C=n.x-o)*C),n.y<-t?s+=(C=n.y+t)*C:n.y>t&&(s+=(C=n.y-t)*C),n.z<-a?s+=(C=n.z+a)*C:n.z>a&&(s+=(C=n.z-a)*C),s};var f=new P.Cartesian3,p=new P.Cartesian3;A.computePlaneDistances=function(a,t,e,n){N.defined(n)||(n=new O.Interval);var r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=a.center,o=a.halfAxes,C=O.Matrix3.getColumn(o,0,x),c=O.Matrix3.getColumn(o,1,M),u=O.Matrix3.getColumn(o,2,m),l=P.Cartesian3.add(C,c,f);P.Cartesian3.add(l,u,l),P.Cartesian3.add(l,s,l);a=P.Cartesian3.subtract(l,t,p),o=P.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i);return P.Cartesian3.add(s,C,l),P.Cartesian3.add(l,c,l),P.Cartesian3.subtract(l,u,l),P.Cartesian3.subtract(l,t,a),o=P.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),P.Cartesian3.add(s,C,l),P.Cartesian3.subtract(l,c,l),P.Cartesian3.add(l,u,l),P.Cartesian3.subtract(l,t,a),o=P.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),P.Cartesian3.add(s,C,l),P.Cartesian3.subtract(l,c,l),P.Cartesian3.subtract(l,u,l),P.Cartesian3.subtract(l,t,a),o=P.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),P.Cartesian3.subtract(s,C,l),P.Cartesian3.add(l,c,l),P.Cartesian3.add(l,u,l),P.Cartesian3.subtract(l,t,a),o=P.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),P.Cartesian3.subtract(s,C,l),P.Cartesian3.add(l,c,l),P.Cartesian3.subtract(l,u,l),P.Cartesian3.subtract(l,t,a),o=P.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),P.Cartesian3.subtract(s,C,l),P.Cartesian3.subtract(l,c,l),P.Cartesian3.add(l,u,l),P.Cartesian3.subtract(l,t,a),o=P.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),P.Cartesian3.subtract(s,C,l),P.Cartesian3.subtract(l,c,l),P.Cartesian3.subtract(l,u,l),P.Cartesian3.subtract(l,t,a),o=P.Cartesian3.dot(e,a),r=Math.min(o,r),i=Math.max(o,i),n.start=r,n.stop=i,n};var e=new O.BoundingSphere;A.isOccluded=function(a,t){a=O.BoundingSphere.fromOrientedBoundingBox(a,e);return!t.isBoundingSphereVisible(a)},A.prototype.intersectPlane=function(a){return A.intersectPlane(this,a)},A.prototype.distanceSquaredTo=function(a){return A.distanceSquaredTo(this,a)},A.prototype.computePlaneDistances=function(a,t,e){return A.computePlaneDistances(this,a,t,e)},A.prototype.isOccluded=function(a){return A.isOccluded(this,a)},A.equals=function(a,t){return a===t||N.defined(a)&&N.defined(t)&&P.Cartesian3.equals(a.center,t.center)&&O.Matrix3.equals(a.halfAxes,t.halfAxes)},A.prototype.clone=function(a){return A.clone(this,a)},A.prototype.equals=function(a){return A.equals(this,a)},a.OrientedBoundingBox=A}); diff --git a/public/Cesium/Workers/Plane-4aa8974d.js b/public/Cesium/Workers/Plane-13ae4b1b.js similarity index 84% rename from public/Cesium/Workers/Plane-4aa8974d.js rename to public/Cesium/Workers/Plane-13ae4b1b.js index b63c30b..1951166 100644 --- a/public/Cesium/Workers/Plane-4aa8974d.js +++ b/public/Cesium/Workers/Plane-13ae4b1b.js @@ -1 +1 @@ -define(["exports","./Cartesian2-8417ca3d","./Transforms-a73b3b3b","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694"],function(n,r,i,e,s,a){"use strict";function o(n,e){this.normal=r.Cartesian3.clone(n),this.distance=e}o.fromPointNormal=function(n,e,a){n=-r.Cartesian3.dot(e,n);return s.defined(a)?(r.Cartesian3.clone(e,a.normal),a.distance=n,a):new o(e,n)};var t=new r.Cartesian3;o.fromCartesian4=function(n,e){var a=r.Cartesian3.fromCartesian4(n,t),n=n.w;return s.defined(e)?(r.Cartesian3.clone(a,e.normal),e.distance=n,e):new o(a,n)},o.getPointDistance=function(n,e){return r.Cartesian3.dot(n.normal,e)+n.distance};var c=new r.Cartesian3;o.projectPointOntoPlane=function(n,e,a){s.defined(a)||(a=new r.Cartesian3);var t=o.getPointDistance(n,e),t=r.Cartesian3.multiplyByScalar(n.normal,t,c);return r.Cartesian3.subtract(e,t,a)};var l=new i.Matrix4,C=new i.Cartesian4,f=new r.Cartesian3;o.transform=function(n,e,a){var t=n.normal,n=n.distance,e=i.Matrix4.inverseTranspose(e,l),n=i.Cartesian4.fromElements(t.x,t.y,t.z,n,C),n=i.Matrix4.multiplyByVector(e,n,n),e=r.Cartesian3.fromCartesian4(n,f);return n=i.Cartesian4.divideByScalar(n,r.Cartesian3.magnitude(e),n),o.fromCartesian4(n,a)},o.clone=function(n,e){return s.defined(e)?(r.Cartesian3.clone(n.normal,e.normal),e.distance=n.distance,e):new o(n.normal,n.distance)},o.equals=function(n,e){return n.distance===e.distance&&r.Cartesian3.equals(n.normal,e.normal)},o.ORIGIN_XY_PLANE=Object.freeze(new o(r.Cartesian3.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=Object.freeze(new o(r.Cartesian3.UNIT_X,0)),o.ORIGIN_ZX_PLANE=Object.freeze(new o(r.Cartesian3.UNIT_Y,0)),n.Plane=o}); +define(["exports","./Cartesian2-8646c5a1","./Transforms-79117a7b","./Check-24483042","./when-54335d57","./Math-d6182036"],function(n,r,i,e,s,a){"use strict";function o(n,e){this.normal=r.Cartesian3.clone(n),this.distance=e}o.fromPointNormal=function(n,e,a){n=-r.Cartesian3.dot(e,n);return s.defined(a)?(r.Cartesian3.clone(e,a.normal),a.distance=n,a):new o(e,n)};var t=new r.Cartesian3;o.fromCartesian4=function(n,e){var a=r.Cartesian3.fromCartesian4(n,t),n=n.w;return s.defined(e)?(r.Cartesian3.clone(a,e.normal),e.distance=n,e):new o(a,n)},o.getPointDistance=function(n,e){return r.Cartesian3.dot(n.normal,e)+n.distance};var c=new r.Cartesian3;o.projectPointOntoPlane=function(n,e,a){s.defined(a)||(a=new r.Cartesian3);var t=o.getPointDistance(n,e),t=r.Cartesian3.multiplyByScalar(n.normal,t,c);return r.Cartesian3.subtract(e,t,a)};var l=new i.Matrix4,C=new i.Cartesian4,d=new r.Cartesian3;o.transform=function(n,e,a){var t=n.normal,n=n.distance,e=i.Matrix4.inverseTranspose(e,l),n=i.Cartesian4.fromElements(t.x,t.y,t.z,n,C),n=i.Matrix4.multiplyByVector(e,n,n),e=r.Cartesian3.fromCartesian4(n,d);return n=i.Cartesian4.divideByScalar(n,r.Cartesian3.magnitude(e),n),o.fromCartesian4(n,a)},o.clone=function(n,e){return s.defined(e)?(r.Cartesian3.clone(n.normal,e.normal),e.distance=n.distance,e):new o(n.normal,n.distance)},o.equals=function(n,e){return n.distance===e.distance&&r.Cartesian3.equals(n.normal,e.normal)},o.ORIGIN_XY_PLANE=Object.freeze(new o(r.Cartesian3.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=Object.freeze(new o(r.Cartesian3.UNIT_X,0)),o.ORIGIN_ZX_PLANE=Object.freeze(new o(r.Cartesian3.UNIT_Y,0)),n.Plane=o}); diff --git a/public/Cesium/Workers/PolygonGeometryLibrary-d175a7f1.js b/public/Cesium/Workers/PolygonGeometryLibrary-2a7648d9.js similarity index 93% rename from public/Cesium/Workers/PolygonGeometryLibrary-d175a7f1.js rename to public/Cesium/Workers/PolygonGeometryLibrary-2a7648d9.js index 5537bf1..d2fcb13 100644 --- a/public/Cesium/Workers/PolygonGeometryLibrary-d175a7f1.js +++ b/public/Cesium/Workers/PolygonGeometryLibrary-2a7648d9.js @@ -1 +1 @@ -define(["exports","./ArcType-dc1c5aee","./arrayRemoveDuplicates-0f62a181","./Cartesian2-8417ca3d","./ComponentDatatype-9204e9f6","./when-208fe5b0","./EllipsoidRhumbLine-8cb2e5a4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./Math-4e53b694","./Transforms-a73b3b3b","./PolygonPipeline-bfd1975b"],function(e,I,x,E,A,P,f,_,G,p,L,M,d,D){"use strict";function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}}),S.prototype.enqueue=function(e){this._array.push(e),this._length++},S.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,10<++t&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},S.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},S.prototype.contains=function(e){return-1!==this._array.indexOf(e)},S.prototype.clear=function(){this._array.length=this._offset=this._length=0},S.prototype.sort=function(e){0<this._offset&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var R={computeHierarchyPackedLength:function(e){for(var t=0,r=[e];0<r.length;){var i=r.pop();if(P.defined(i)){t+=2;var n=i.positions,a=i.holes;if(P.defined(n)&&(t+=n.length*E.Cartesian3.packedLength),P.defined(a))for(var o=a.length,s=0;s<o;++s)r.push(a[s])}}return t},packPolygonHierarchy:function(e,t,r){for(var i=[e];0<i.length;){var n=i.pop();if(P.defined(n)){var a=n.positions,o=n.holes;if(t[r++]=P.defined(a)?a.length:0,t[r++]=P.defined(o)?o.length:0,P.defined(a))for(var s=a.length,u=0;u<s;++u,r+=3)E.Cartesian3.pack(a[u],t,r);if(P.defined(o))for(var l=o.length,h=0;h<l;++h)i.push(o[h])}}return r},unpackPolygonHierarchy:function(e,t){for(var r=e[t++],i=e[t++],n=new Array(r),a=0<i?new Array(i):void 0,o=0;o<r;++o,t+=E.Cartesian3.packedLength)n[o]=E.Cartesian3.unpack(e,t);for(var s=0;s<i;++s)a[s]=R.unpackPolygonHierarchy(e,t),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:n,holes:a,startingIndex:t}}},y=new E.Cartesian3;R.subdivideLineCount=function(e,t,r){r=E.Cartesian3.distance(e,t)/r,r=Math.max(0,Math.ceil(M.CesiumMath.log2(r)));return Math.pow(2,r)};var g=new E.Cartographic,m=new E.Cartographic,v=new E.Cartographic,C=new E.Cartesian3;R.subdivideRhumbLineCount=function(e,t,r,i){t=e.cartesianToCartographic(t,g),r=e.cartesianToCartographic(r,m),i=new f.EllipsoidRhumbLine(t,r,e).surfaceDistance/i,i=Math.max(0,Math.ceil(M.CesiumMath.log2(i)));return Math.pow(2,i)},R.subdivideLine=function(e,t,r,i){var n=R.subdivideLineCount(e,t,r),a=E.Cartesian3.distance(e,t),o=a/n,s=i=!P.defined(i)?[]:i;s.length=3*n;for(var u,l,h,c=0,f=0;f<n;f++){var p=(p=e,u=t,l=f*o,h=a,E.Cartesian3.subtract(u,p,y),E.Cartesian3.multiplyByScalar(y,l/h,y),E.Cartesian3.add(p,y,y),[y.x,y.y,y.z]);s[c++]=p[0],s[c++]=p[1],s[c++]=p[2]}return s},R.subdivideRhumbLine=function(e,t,r,i,n){var t=e.cartesianToCartographic(t,g),r=e.cartesianToCartographic(r,m),a=new f.EllipsoidRhumbLine(t,r,e),i=a.surfaceDistance/i,i=Math.max(0,Math.ceil(M.CesiumMath.log2(i))),o=Math.pow(2,i),s=a.surfaceDistance/o,u=n=!P.defined(n)?[]:n;u.length=3*o;for(var l=0,h=0;h<o;h++){var c=a.interpolateUsingSurfaceDistance(h*s,v),c=e.cartographicToCartesian(c,C);u[l++]=c.x,u[l++]=c.y,u[l++]=c.z}return u};var b=new E.Cartesian3,w=new E.Cartesian3,T=new E.Cartesian3,N=new E.Cartesian3;R.scaleToGeodeticHeightExtruded=function(e,t,r,i,n){i=P.defaultValue(i,E.Ellipsoid.WGS84);var a=b,o=w,s=T,u=N;if(P.defined(e)&&P.defined(e.attributes)&&P.defined(e.attributes.position))for(var l=e.attributes.position.values,h=l.length/2,c=0;c<h;c+=3)E.Cartesian3.fromArray(l,c,s),i.geodeticSurfaceNormal(s,a),u=i.scaleToGeodeticSurface(s,u),o=E.Cartesian3.multiplyByScalar(a,r,o),o=E.Cartesian3.add(u,o,o),l[c+h]=o.x,l[c+1+h]=o.y,l[c+2+h]=o.z,n&&(u=E.Cartesian3.clone(s,u)),o=E.Cartesian3.multiplyByScalar(a,t,o),o=E.Cartesian3.add(u,o,o),l[c]=o.x,l[c+1]=o.y,l[c+2]=o.z;return e},R.polygonOutlinesFromHierarchy=function(e,t,r){var i,n,a=[],o=new S;for(o.enqueue(e);0!==o.length;){var s=o.dequeue(),u=s.positions;if(t)for(n=u.length,h=0;h<n;h++)r.scaleToGeodeticSurface(u[h],u[h]);if(!((u=x.arrayRemoveDuplicates(u,E.Cartesian3.equalsEpsilon,!0)).length<3)){for(var l=s.holes?s.holes.length:0,h=0;h<l;h++){var c=s.holes[h],f=c.positions;if(t)for(n=f.length,i=0;i<n;++i)r.scaleToGeodeticSurface(f[i],f[i]);if(!((f=x.arrayRemoveDuplicates(f,E.Cartesian3.equalsEpsilon,!0)).length<3)){a.push(f);var p=0;for(P.defined(c.holes)&&(p=c.holes.length),i=0;i<p;i++)o.enqueue(c.holes[i])}}a.push(u)}}return a},R.polygonsFromHierarchy=function(e,t,r,i){var n=[],a=[],o=new S;for(o.enqueue(e);0!==o.length;){var s,u=o.dequeue(),l=u.positions,h=u.holes;if(r)for(s=l.length,v=0;v<s;v++)i.scaleToGeodeticSurface(l[v],l[v]);if(!((l=x.arrayRemoveDuplicates(l,E.Cartesian3.equalsEpsilon,!0)).length<3)){var c=t(l);if(P.defined(c)){var f=[],p=D.PolygonPipeline.computeWindingOrder2D(c);p===D.WindingOrder.CLOCKWISE&&(c.reverse(),l=l.slice().reverse());for(var d,y=l.slice(),g=P.defined(h)?h.length:0,m=[],v=0;v<g;v++){var C=h[v],b=C.positions;if(r)for(s=b.length,d=0;d<s;++d)i.scaleToGeodeticSurface(b[d],b[d]);if(!((b=x.arrayRemoveDuplicates(b,E.Cartesian3.equalsEpsilon,!0)).length<3)){var w=t(b);if(P.defined(w)){D.PolygonPipeline.computeWindingOrder2D(w)===D.WindingOrder.CLOCKWISE&&(w.reverse(),b=b.slice().reverse()),m.push(b),f.push(y.length);var y=y.concat(b),c=c.concat(w),T=0;for(P.defined(C.holes)&&(T=C.holes.length),d=0;d<T;d++)o.enqueue(C.holes[d])}}}n.push({outerRing:l,holes:m}),a.push({positions:y,positions2D:c,holes:f})}}}return{hierarchy:n,polygons:a}};var O=new E.Cartesian2,q=new E.Cartesian3,B=new d.Quaternion,H=new d.Matrix3;R.computeBoundingRectangle=function(e,t,r,i,n){for(var i=d.Quaternion.fromAxisAngle(e,i,B),a=d.Matrix3.fromQuaternion(i,H),o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=r.length,c=0;c<h;++c){var f=E.Cartesian3.clone(r[c],q);d.Matrix3.multiplyByVector(a,f,f);f=t(f,O);P.defined(f)&&(o=Math.min(o,f.x),s=Math.max(s,f.x),u=Math.min(u,f.y),l=Math.max(l,f.y))}return n.x=o,n.y=u,n.width=s-o,n.height=l-u,n},R.createGeometryFromPositions=function(e,t,r,i,n,a){var o=D.PolygonPipeline.triangulate(t.positions2D,t.holes);o.length<3&&(o=[0,1,2]);var s=t.positions;if(i){for(var u=s.length,l=new Array(3*u),h=0,c=0;c<u;c++){var f=s[c];l[h++]=f.x,l[h++]=f.y,l[h++]=f.z}i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},indices:o,primitiveType:_.PrimitiveType.TRIANGLES});return n.normal?p.GeometryPipeline.computeNormal(i):i}return a===I.ArcType.GEODESIC?D.PolygonPipeline.computeSubdivision(e,s,o,r):a===I.ArcType.RHUMB?D.PolygonPipeline.computeRhumbLineSubdivision(e,s,o,r):void 0};var k=[],z=new E.Cartesian3,W=new E.Cartesian3;R.computeWallGeometry=function(e,t,r,i,n){var a,o,s,u=e.length,l=0;if(i)for(o=3*u*2,a=new Array(2*o),s=0;s<u;s++)p=e[s],d=e[(s+1)%u],a[l]=a[l+o]=p.x,a[++l]=a[l+o]=p.y,a[++l]=a[l+o]=p.z,a[++l]=a[l+o]=d.x,a[++l]=a[l+o]=d.y,a[++l]=a[l+o]=d.z,++l;else{var h=M.CesiumMath.chordLength(r,t.maximumRadius),c=0;if(n===I.ArcType.GEODESIC)for(s=0;s<u;s++)c+=R.subdivideLineCount(e[s],e[(s+1)%u],h);else if(n===I.ArcType.RHUMB)for(s=0;s<u;s++)c+=R.subdivideRhumbLineCount(t,e[s],e[(s+1)%u],h);for(o=3*(c+u),a=new Array(2*o),s=0;s<u;s++){var f,p=e[s],d=e[(s+1)%u];n===I.ArcType.GEODESIC?f=R.subdivideLine(p,d,h,k):n===I.ArcType.RHUMB&&(f=R.subdivideRhumbLine(t,p,d,h,k));for(var y=f.length,g=0;g<y;++g,++l)a[l]=f[g],a[l+o]=f[g];a[l]=d.x,a[l+o]=d.x,a[++l]=d.y,a[l+o]=d.y,a[++l]=d.z,a[l+o]=d.z,++l}}var u=a.length,m=L.IndexDatatype.createTypedArray(u/3,u-6*e.length),v=0;for(u/=6,s=0;s<u;s++){var C=s,b=C+1,w=C+u,T=w+1;p=E.Cartesian3.fromArray(a,3*C,z),d=E.Cartesian3.fromArray(a,3*b,W),E.Cartesian3.equalsEpsilon(p,d,M.CesiumMath.EPSILON10,M.CesiumMath.EPSILON10)||(m[v++]=C,m[v++]=w,m[v++]=b,m[v++]=b,m[v++]=w,m[v++]=T)}return new _.Geometry({attributes:new G.GeometryAttributes({position:new _.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a})}),indices:m,primitiveType:_.PrimitiveType.TRIANGLES})},e.PolygonGeometryLibrary=R}); +define(["exports","./ArcType-2b58731c","./arrayRemoveDuplicates-3fea1e5f","./Cartesian2-8646c5a1","./ComponentDatatype-1a100acd","./when-54335d57","./EllipsoidRhumbLine-2b7999f3","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./Math-d6182036","./Transforms-79117a7b","./PolygonPipeline-97a7160d"],function(e,I,x,E,A,P,f,_,G,p,L,M,d,D){"use strict";function S(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(S.prototype,{length:{get:function(){return this._length}}}),S.prototype.enqueue=function(e){this._array.push(e),this._length++},S.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,10<++t&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},S.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},S.prototype.contains=function(e){return-1!==this._array.indexOf(e)},S.prototype.clear=function(){this._array.length=this._offset=this._length=0},S.prototype.sort=function(e){0<this._offset&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var R={computeHierarchyPackedLength:function(e){for(var t=0,r=[e];0<r.length;){var i=r.pop();if(P.defined(i)){t+=2;var n=i.positions,a=i.holes;if(P.defined(n)&&(t+=n.length*E.Cartesian3.packedLength),P.defined(a))for(var o=a.length,s=0;s<o;++s)r.push(a[s])}}return t},packPolygonHierarchy:function(e,t,r){for(var i=[e];0<i.length;){var n=i.pop();if(P.defined(n)){var a=n.positions,o=n.holes;if(t[r++]=P.defined(a)?a.length:0,t[r++]=P.defined(o)?o.length:0,P.defined(a))for(var s=a.length,u=0;u<s;++u,r+=3)E.Cartesian3.pack(a[u],t,r);if(P.defined(o))for(var l=o.length,h=0;h<l;++h)i.push(o[h])}}return r},unpackPolygonHierarchy:function(e,t){for(var r=e[t++],i=e[t++],n=new Array(r),a=0<i?new Array(i):void 0,o=0;o<r;++o,t+=E.Cartesian3.packedLength)n[o]=E.Cartesian3.unpack(e,t);for(var s=0;s<i;++s)a[s]=R.unpackPolygonHierarchy(e,t),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:n,holes:a,startingIndex:t}}},y=new E.Cartesian3;R.subdivideLineCount=function(e,t,r){t=E.Cartesian3.distance(e,t),r=Math.max(0,Math.ceil(M.CesiumMath.log2(t/r)));return Math.pow(2,r)};var g=new E.Cartographic,m=new E.Cartographic,v=new E.Cartographic,C=new E.Cartesian3;R.subdivideRhumbLineCount=function(e,t,r,i){t=e.cartesianToCartographic(t,g),r=e.cartesianToCartographic(r,m),i=new f.EllipsoidRhumbLine(t,r,e).surfaceDistance/i,i=Math.max(0,Math.ceil(M.CesiumMath.log2(i)));return Math.pow(2,i)},R.subdivideLine=function(e,t,r,i){var n=R.subdivideLineCount(e,t,r),a=E.Cartesian3.distance(e,t),o=a/n,s=i=!P.defined(i)?[]:i;s.length=3*n;for(var u,l,h,c=0,f=0;f<n;f++){var p=(p=e,u=t,l=f*o,h=a,E.Cartesian3.subtract(u,p,y),E.Cartesian3.multiplyByScalar(y,l/h,y),E.Cartesian3.add(p,y,y),[y.x,y.y,y.z]);s[c++]=p[0],s[c++]=p[1],s[c++]=p[2]}return s},R.subdivideRhumbLine=function(e,t,r,i,n){var t=e.cartesianToCartographic(t,g),r=e.cartesianToCartographic(r,m),a=new f.EllipsoidRhumbLine(t,r,e),i=a.surfaceDistance/i,i=Math.max(0,Math.ceil(M.CesiumMath.log2(i))),o=Math.pow(2,i),s=a.surfaceDistance/o,u=n=!P.defined(n)?[]:n;u.length=3*o;for(var l=0,h=0;h<o;h++){var c=a.interpolateUsingSurfaceDistance(h*s,v),c=e.cartographicToCartesian(c,C);u[l++]=c.x,u[l++]=c.y,u[l++]=c.z}return u};var b=new E.Cartesian3,w=new E.Cartesian3,T=new E.Cartesian3,N=new E.Cartesian3;R.scaleToGeodeticHeightExtruded=function(e,t,r,i,n){i=P.defaultValue(i,E.Ellipsoid.WGS84);var a=b,o=w,s=T,u=N;if(P.defined(e)&&P.defined(e.attributes)&&P.defined(e.attributes.position))for(var l=e.attributes.position.values,h=l.length/2,c=0;c<h;c+=3)E.Cartesian3.fromArray(l,c,s),i.geodeticSurfaceNormal(s,a),u=i.scaleToGeodeticSurface(s,u),o=E.Cartesian3.multiplyByScalar(a,r,o),o=E.Cartesian3.add(u,o,o),l[c+h]=o.x,l[c+1+h]=o.y,l[c+2+h]=o.z,n&&(u=E.Cartesian3.clone(s,u)),o=E.Cartesian3.multiplyByScalar(a,t,o),o=E.Cartesian3.add(u,o,o),l[c]=o.x,l[c+1]=o.y,l[c+2]=o.z;return e},R.polygonOutlinesFromHierarchy=function(e,t,r){var i,n,a=[],o=new S;for(o.enqueue(e);0!==o.length;){var s=o.dequeue(),u=s.positions;if(t)for(n=u.length,h=0;h<n;h++)r.scaleToGeodeticSurface(u[h],u[h]);if(!((u=x.arrayRemoveDuplicates(u,E.Cartesian3.equalsEpsilon,!0)).length<3)){for(var l=s.holes?s.holes.length:0,h=0;h<l;h++){var c=s.holes[h],f=c.positions;if(t)for(n=f.length,i=0;i<n;++i)r.scaleToGeodeticSurface(f[i],f[i]);if(!((f=x.arrayRemoveDuplicates(f,E.Cartesian3.equalsEpsilon,!0)).length<3)){a.push(f);var p=0;for(P.defined(c.holes)&&(p=c.holes.length),i=0;i<p;i++)o.enqueue(c.holes[i])}}a.push(u)}}return a},R.polygonsFromHierarchy=function(e,t,r,i){var n=[],a=[],o=new S;for(o.enqueue(e);0!==o.length;){var s,u=o.dequeue(),l=u.positions,h=u.holes;if(r)for(s=l.length,v=0;v<s;v++)i.scaleToGeodeticSurface(l[v],l[v]);if(!((l=x.arrayRemoveDuplicates(l,E.Cartesian3.equalsEpsilon,!0)).length<3)){var c=t(l);if(P.defined(c)){var f=[],p=D.PolygonPipeline.computeWindingOrder2D(c);p===D.WindingOrder.CLOCKWISE&&(c.reverse(),l=l.slice().reverse());for(var d,y=l.slice(),g=P.defined(h)?h.length:0,m=[],v=0;v<g;v++){var C=h[v],b=C.positions;if(r)for(s=b.length,d=0;d<s;++d)i.scaleToGeodeticSurface(b[d],b[d]);if(!((b=x.arrayRemoveDuplicates(b,E.Cartesian3.equalsEpsilon,!0)).length<3)){var w=t(b);if(P.defined(w)){D.PolygonPipeline.computeWindingOrder2D(w)===D.WindingOrder.CLOCKWISE&&(w.reverse(),b=b.slice().reverse()),m.push(b),f.push(y.length);var y=y.concat(b),c=c.concat(w),T=0;for(P.defined(C.holes)&&(T=C.holes.length),d=0;d<T;d++)o.enqueue(C.holes[d])}}}n.push({outerRing:l,holes:m}),a.push({positions:y,positions2D:c,holes:f})}}}return{hierarchy:n,polygons:a}};var O=new E.Cartesian2,q=new E.Cartesian3,B=new d.Quaternion,H=new d.Matrix3;R.computeBoundingRectangle=function(e,t,r,i,n){for(var i=d.Quaternion.fromAxisAngle(e,i,B),a=d.Matrix3.fromQuaternion(i,H),o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=r.length,c=0;c<h;++c){var f=E.Cartesian3.clone(r[c],q);d.Matrix3.multiplyByVector(a,f,f);f=t(f,O);P.defined(f)&&(o=Math.min(o,f.x),s=Math.max(s,f.x),u=Math.min(u,f.y),l=Math.max(l,f.y))}return n.x=o,n.y=u,n.width=s-o,n.height=l-u,n},R.createGeometryFromPositions=function(e,t,r,i,n,a){var o=D.PolygonPipeline.triangulate(t.positions2D,t.holes);o.length<3&&(o=[0,1,2]);var s=t.positions;if(i){for(var u=s.length,l=new Array(3*u),h=0,c=0;c<u;c++){var f=s[c];l[h++]=f.x,l[h++]=f.y,l[h++]=f.z}i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})},indices:o,primitiveType:_.PrimitiveType.TRIANGLES});return n.normal?p.GeometryPipeline.computeNormal(i):i}return a===I.ArcType.GEODESIC?D.PolygonPipeline.computeSubdivision(e,s,o,r):a===I.ArcType.RHUMB?D.PolygonPipeline.computeRhumbLineSubdivision(e,s,o,r):void 0};var k=[],z=new E.Cartesian3,W=new E.Cartesian3;R.computeWallGeometry=function(e,t,r,i,n){var a,o,s,u=e.length,l=0;if(i)for(o=3*u*2,a=new Array(2*o),s=0;s<u;s++)p=e[s],d=e[(s+1)%u],a[l]=a[l+o]=p.x,a[++l]=a[l+o]=p.y,a[++l]=a[l+o]=p.z,a[++l]=a[l+o]=d.x,a[++l]=a[l+o]=d.y,a[++l]=a[l+o]=d.z,++l;else{var h=M.CesiumMath.chordLength(r,t.maximumRadius),c=0;if(n===I.ArcType.GEODESIC)for(s=0;s<u;s++)c+=R.subdivideLineCount(e[s],e[(s+1)%u],h);else if(n===I.ArcType.RHUMB)for(s=0;s<u;s++)c+=R.subdivideRhumbLineCount(t,e[s],e[(s+1)%u],h);for(o=3*(c+u),a=new Array(2*o),s=0;s<u;s++){var f,p=e[s],d=e[(s+1)%u];n===I.ArcType.GEODESIC?f=R.subdivideLine(p,d,h,k):n===I.ArcType.RHUMB&&(f=R.subdivideRhumbLine(t,p,d,h,k));for(var y=f.length,g=0;g<y;++g,++l)a[l]=f[g],a[l+o]=f[g];a[l]=d.x,a[l+o]=d.x,a[++l]=d.y,a[l+o]=d.y,a[++l]=d.z,a[l+o]=d.z,++l}}var u=a.length,m=L.IndexDatatype.createTypedArray(u/3,u-6*e.length),v=0;for(u/=6,s=0;s<u;s++){var C=s,b=C+1,w=C+u,T=w+1;p=E.Cartesian3.fromArray(a,3*C,z),d=E.Cartesian3.fromArray(a,3*b,W),E.Cartesian3.equalsEpsilon(p,d,M.CesiumMath.EPSILON10,M.CesiumMath.EPSILON10)||(m[v++]=C,m[v++]=w,m[v++]=b,m[v++]=b,m[v++]=w,m[v++]=T)}return new _.Geometry({attributes:new G.GeometryAttributes({position:new _.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a})}),indices:m,primitiveType:_.PrimitiveType.TRIANGLES})},e.PolygonGeometryLibrary=R}); diff --git a/public/Cesium/Workers/PolygonPipeline-bfd1975b.js b/public/Cesium/Workers/PolygonPipeline-97a7160d.js similarity index 75% rename from public/Cesium/Workers/PolygonPipeline-bfd1975b.js rename to public/Cesium/Workers/PolygonPipeline-97a7160d.js index 66e8246..bfd9c46 100644 --- a/public/Cesium/Workers/PolygonPipeline-bfd1975b.js +++ b/public/Cesium/Workers/PolygonPipeline-97a7160d.js @@ -1 +1 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./when-208fe5b0","./EllipsoidRhumbLine-8cb2e5a4","./GeometryAttribute-04a19cfe","./Math-4e53b694","./WebGLConstants-76bb35d1"],function(e,L,t,D,G,O,T,W,n){"use strict";function r(e,t,n){n=n||2;var r,a,i,u,x,o=t&&t.length,s=o?t[0]*n:e.length,p=v(e,0,s,n,!0),h=[];if(!p||p.next===p.prev)return h;if(o&&(p=function(e,t,n,r){var a,i,u,x,o=[];for(a=0,i=t.length;a<i;a++)u=t[a]*r,x=a<i-1?t[a+1]*r:e.length,(x=v(e,u,x,r,!1))===x.next&&(x.steiner=!0),o.push(function(e){var t=e,n=e;for(;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next,t!==e;);return n}(x));for(o.sort(m),a=0;a<o.length;a++)!function(e,t){(t=function(e,t){var n,r=t,a=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var x=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(x<=a&&u<x){if((u=x)===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}}while(r=r.next,r!==t);if(!n)return null;if(a===u)return n;var o,s=n,p=n.x,h=n.y,f=1/0;r=n;for(;a>=r.x&&r.x>=p&&a!==r.x&&g(i<h?a:u,i,p,h,i<h?u:a,i,r.x,r.y)&&(o=Math.abs(i-r.y)/(a-r.x),w(r,e)&&(o<f||o===f&&(r.x>n.x||r.x===n.x&&function(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}(n,r)))&&(n=r,f=o)),r=r.next,r!==s;);return n}(e,t))&&c(e=E(t,e),e.next)}(o[a],n),n=c(n,n.next);return n}(e,t,p,n)),e.length>80*n){for(var f=r=e[0],l=a=e[1],y=n;y<s;y+=n)(i=e[y])<f&&(f=i),(u=e[y+1])<l&&(l=u),r<i&&(r=i),a<u&&(a=u);x=0!==(x=Math.max(r-f,a-l))?1/x:0}return d(p,h,n,f,l,x),h}function v(e,t,n,r,a){var i,u;if(a===0<M(e,t,n,r))for(i=t;i<n;i+=r)u=x(i,e[i],e[i+1],u);else for(i=n-r;t<=i;i-=r)u=x(i,e[i],e[i+1],u);return u&&p(u,u.next)&&(f(u),u=u.next),u}function c(e,t){if(!e)return e;t=t||e;var n,r=e;do{if(n=!1,r.steiner||!p(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{if(f(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function d(e,t,n,r,a,i,u){if(e){!u&&i&&function(e,t,n,r){var a=e;for(;null===a.z&&(a.z=C(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next,a!==e;);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,n,r,a,i,u,x,o,s=1;do{for(n=e,i=e=null,u=0;n;){for(u++,r=n,t=x=0;t<s&&(x++,r=r.nextZ);t++);for(o=s;0<x||0<o&&r;)0!==x&&(0===o||!r||n.z<=r.z)?(n=(a=n).nextZ,x--):(r=(a=r).nextZ,o--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}}while(i.nextZ=null,s*=2,1<u)}(a)}(e,r,a,i);for(var x,o,s=e;e.prev!==e.next;)if(x=e.prev,o=e.next,i?function(e,t,n,r){var a=e.prev,i=e,u=e.next;if(0<=b(a,i,u))return!1;var x=(a.x<i.x?a.x<u.x?a:u:i.x<u.x?i:u).x,o=(a.y<i.y?a.y<u.y?a:u:i.y<u.y?i:u).y,s=(a.x>i.x?a.x>u.x?a:u:i.x>u.x?i:u).x,p=(a.y>i.y?a.y>u.y?a:u:i.y>u.y?i:u).y,h=C(x,o,t,n,r),f=C(s,p,t,n,r),l=e.prevZ,y=e.nextZ;for(;l&&l.z>=h&&y&&y.z<=f;){if(l!==e.prev&&l!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,l.x,l.y)&&0<=b(l.prev,l,l.next))return!1;if(l=l.prevZ,y!==e.prev&&y!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,y.x,y.y)&&0<=b(y.prev,y,y.next))return!1;y=y.nextZ}for(;l&&l.z>=h;){if(l!==e.prev&&l!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,l.x,l.y)&&0<=b(l.prev,l,l.next))return!1;l=l.prevZ}for(;y&&y.z<=f;){if(y!==e.prev&&y!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,y.x,y.y)&&0<=b(y.prev,y,y.next))return!1;y=y.nextZ}return!0}(e,r,a,i):function(e){var t=e.prev,n=e,r=e.next;if(0<=b(t,n,r))return!1;var a=e.next.next;for(;a!==e.prev;){if(g(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&0<=b(a.prev,a,a.next))return!1;a=a.next}return!0}(e))t.push(x.i/n),t.push(e.i/n),t.push(o.i/n),f(e),e=o.next,s=o.next;else if((e=o)===s){u?1===u?d(e=function(e,t,n){var r=e;do{var a=r.prev,i=r.next.next}while(!p(a,i)&&h(a,r,r.next,i)&&w(a,i)&&w(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),f(r),f(r.next),r=e=i),r=r.next,r!==e);return c(r)}(c(e),t,n),t,n,r,a,i,2):2===u&&function(e,t,n,r,a,i){var u=e;do{for(var x=u.next.next;x!==u.prev;){if(u.i!==x.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&h(n,n.next,e,t))return!0}while(n=n.next,n!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;for(;n.y>i!=n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||p(e,t)&&0<b(e.prev,e,e.next)&&0<b(t.prev,t,t.next))}(u,x)){var o=E(u,x);return u=c(u,u.next),o=c(o,o.next),d(u,t,n,r,a,i),d(o,t,n,r,a,i)}x=x.next}}while(u=u.next,u!==e)}(e,t,n,r,a,i):d(c(e),t,n,r,a,i,1);break}}}function m(e,t){return e.x-t.x}function C(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function g(e,t,n,r,a,i,u,x){return 0<=(a-u)*(t-x)-(e-u)*(i-x)&&0<=(e-u)*(r-x)-(n-u)*(t-x)&&0<=(n-u)*(i-x)-(a-u)*(r-x)}function b(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function p(e,t){return e.x===t.x&&e.y===t.y}function h(e,t,n,r){var a=s(b(e,t,n)),i=s(b(e,t,r)),u=s(b(n,r,e)),x=s(b(n,r,t));return a!==i&&u!==x||(0===a&&o(e,n,t)||(0===i&&o(e,r,t)||(0===u&&o(n,e,r)||!(0!==x||!o(n,t,r)))))}function o(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 s(e){return 0<e?1:e<0?-1:0}function w(e,t){return b(e.prev,e,e.next)<0?0<=b(e,t,e.next)&&0<=b(e,e.prev,t):b(e,t,e.prev)<0||b(e,e.next,t)<0}function E(e,t){var n=new u(e.i,e.x,e.y),r=new u(t.i,t.x,t.y),a=e.next,i=t.prev;return(e.next=t).prev=e,(n.next=a).prev=n,(r.next=n).prev=r,(i.next=r).prev=i,r}function x(e,t,n,r){n=new u(e,t,n);return r?(n.next=r.next,(n.prev=r).next.prev=n,r.next=n):(n.prev=n).next=n,n}function f(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 u(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,u=n-r;i<n;i+=r)a+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return a}r.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,u=Math.abs(M(e,0,i,n));if(a)for(var x=0,o=t.length;x<o;x++){var s=t[x]*n,p=x<o-1?t[x+1]*n:e.length;u-=Math.abs(M(e,s,p,n))}for(var h=0,x=0;x<r.length;x+=3){var f=r[x]*n,l=r[x+1]*n,y=r[x+2]*n;h+=Math.abs((e[f]-e[y])*(e[1+l]-e[1+f])-(e[f]-e[l])*(e[1+y]-e[1+f]))}return 0===u&&0===h?0:Math.abs((h-u)/u)},r.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[a][i][u]);0<a&&(r+=e[a-1].length,n.holes.push(r))}return n};var a={CLOCKWISE:n.WebGLConstants.CW,COUNTER_CLOCKWISE:n.WebGLConstants.CCW,validate:function(e){return e===a.CLOCKWISE||e===a.COUNTER_CLOCKWISE}},i=Object.freeze(a),l=new L.Cartesian3,y=new L.Cartesian3,Z={computeArea2D:function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],u=e[a];n+=i.x*u.y-u.x*i.y}return.5*n},computeWindingOrder2D:function(e){return 0<Z.computeArea2D(e)?i.COUNTER_CLOCKWISE:i.CLOCKWISE},triangulate:function(e,t){return r(L.Cartesian2.packArray(e),t,2)}},P=new L.Cartesian3,I=new L.Cartesian3,B=new L.Cartesian3,S=new L.Cartesian3,A=new L.Cartesian3,z=new L.Cartesian3,N=new L.Cartesian3;Z.computeSubdivision=function(e,t,n,r){r=G.defaultValue(r,W.CesiumMath.RADIANS_PER_DEGREE);for(var a=n.slice(0),i=t.length,u=new Array(3*i),x=0,o=0;o<i;o++){var s=t[o];u[x++]=s.x,u[x++]=s.y,u[x++]=s.z}for(var p=[],h={},f=e.maximumRadius,r=W.CesiumMath.chordLength(r,f),l=r*r;0<a.length;){var y,v,c=a.pop(),d=a.pop(),m=a.pop(),C=L.Cartesian3.fromArray(u,3*m,P),g=L.Cartesian3.fromArray(u,3*d,I),b=L.Cartesian3.fromArray(u,3*c,B),w=L.Cartesian3.multiplyByScalar(L.Cartesian3.normalize(C,S),f,S),E=L.Cartesian3.multiplyByScalar(L.Cartesian3.normalize(g,A),f,A),M=L.Cartesian3.multiplyByScalar(L.Cartesian3.normalize(b,z),f,z),Z=L.Cartesian3.magnitudeSquared(L.Cartesian3.subtract(w,E,N)),E=L.Cartesian3.magnitudeSquared(L.Cartesian3.subtract(E,M,N)),M=L.Cartesian3.magnitudeSquared(L.Cartesian3.subtract(M,w,N)),w=Math.max(Z,E,M);l<w?Z===w?(o=h[y=Math.min(m,d)+" "+Math.max(m,d)],G.defined(o)||(v=L.Cartesian3.add(C,g,N),L.Cartesian3.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),o=u.length/3-1,h[y]=o),a.push(m,o,c),a.push(o,d,c)):E===w?(o=h[y=Math.min(d,c)+" "+Math.max(d,c)],G.defined(o)||(v=L.Cartesian3.add(g,b,N),L.Cartesian3.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),o=u.length/3-1,h[y]=o),a.push(d,o,m),a.push(o,c,m)):M===w&&(o=h[y=Math.min(c,m)+" "+Math.max(c,m)],G.defined(o)||(v=L.Cartesian3.add(b,C,N),L.Cartesian3.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),o=u.length/3-1,h[y]=o),a.push(c,o,d),a.push(o,m,d)):(p.push(m),p.push(d),p.push(c))}return new T.Geometry({attributes:{position:new T.GeometryAttribute({componentDatatype:D.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})},indices:p,primitiveType:T.PrimitiveType.TRIANGLES})};var U=new L.Cartographic,_=new L.Cartographic,K=new L.Cartographic,V=new L.Cartographic;Z.computeRhumbLineSubdivision=function(e,t,n,r){r=G.defaultValue(r,W.CesiumMath.RADIANS_PER_DEGREE);for(var a=n.slice(0),i=t.length,u=new Array(3*i),x=0,o=0;o<i;o++){var s=t[o];u[x++]=s.x,u[x++]=s.y,u[x++]=s.z}for(var p=[],h={},n=e.maximumRadius,f=W.CesiumMath.chordLength(r,n),l=new O.EllipsoidRhumbLine(void 0,void 0,e),y=new O.EllipsoidRhumbLine(void 0,void 0,e),v=new O.EllipsoidRhumbLine(void 0,void 0,e);0<a.length;){var c=a.pop(),d=a.pop(),m=a.pop(),C=L.Cartesian3.fromArray(u,3*m,P),g=L.Cartesian3.fromArray(u,3*d,I),b=L.Cartesian3.fromArray(u,3*c,B),w=e.cartesianToCartographic(C,U),E=e.cartesianToCartographic(g,_),M=e.cartesianToCartographic(b,K);l.setEndPoints(w,E);var Z=l.surfaceDistance;y.setEndPoints(E,M);C=y.surfaceDistance;v.setEndPoints(M,w);var S,A,z,R,g=v.surfaceDistance,b=Math.max(Z,C,g);f<b?Z===b?(o=h[S=Math.min(m,d)+" "+Math.max(m,d)],G.defined(o)||(A=l.interpolateUsingFraction(.5,V),z=.5*(w.height+E.height),R=L.Cartesian3.fromRadians(A.longitude,A.latitude,z,e,N),u.push(R.x,R.y,R.z),o=u.length/3-1,h[S]=o),a.push(m,o,c),a.push(o,d,c)):C===b?(o=h[S=Math.min(d,c)+" "+Math.max(d,c)],G.defined(o)||(A=y.interpolateUsingFraction(.5,V),z=.5*(E.height+M.height),R=L.Cartesian3.fromRadians(A.longitude,A.latitude,z,e,N),u.push(R.x,R.y,R.z),o=u.length/3-1,h[S]=o),a.push(d,o,m),a.push(o,c,m)):g===b&&(o=h[S=Math.min(c,m)+" "+Math.max(c,m)],G.defined(o)||(A=v.interpolateUsingFraction(.5,V),z=.5*(M.height+w.height),R=L.Cartesian3.fromRadians(A.longitude,A.latitude,z,e,N),u.push(R.x,R.y,R.z),o=u.length/3-1,h[S]=o),a.push(c,o,d),a.push(o,m,d)):(p.push(m),p.push(d),p.push(c))}return new T.Geometry({attributes:{position:new T.GeometryAttribute({componentDatatype:D.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})},indices:p,primitiveType:T.PrimitiveType.TRIANGLES})},Z.scaleToGeodeticHeight=function(e,t,n,r){n=G.defaultValue(n,L.Ellipsoid.WGS84);var a=l,i=y;if(t=G.defaultValue(t,0),r=G.defaultValue(r,!0),G.defined(e))for(var u=e.length,x=0;x<u;x+=3)L.Cartesian3.fromArray(e,x,i),r&&(i=n.scaleToGeodeticSurface(i,i)),0!==t&&(a=n.geodeticSurfaceNormal(i,a),L.Cartesian3.multiplyByScalar(a,t,a),L.Cartesian3.add(i,a,i)),e[x]=i.x,e[x+1]=i.y,e[x+2]=i.z;return e},e.PolygonPipeline=Z,e.WindingOrder=i}); +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./when-54335d57","./EllipsoidRhumbLine-2b7999f3","./GeometryAttribute-374f805d","./Math-d6182036","./WebGLConstants-95ceb4e9"],function(e,L,t,D,G,O,T,W,n){"use strict";function r(e,t,n){n=n||2;var r,a,i,u,x,o=t&&t.length,s=o?t[0]*n:e.length,p=v(e,0,s,n,!0),h=[];if(!p||p.next===p.prev)return h;if(o&&(p=function(e,t,n,r){var a,i,u,x,o=[];for(a=0,i=t.length;a<i;a++)u=t[a]*r,x=a<i-1?t[a+1]*r:e.length,(x=v(e,u,x,r,!1))===x.next&&(x.steiner=!0),o.push(function(e){var t=e,n=e;for(;(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next,t!==e;);return n}(x));for(o.sort(m),a=0;a<o.length;a++)!function(e,t){(t=function(e,t){var n,r=t,a=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var x=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(x<=a&&u<x){if((u=x)===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}}while(r=r.next,r!==t);if(!n)return null;if(a===u)return n;var o,s=n,p=n.x,h=n.y,f=1/0;r=n;for(;a>=r.x&&r.x>=p&&a!==r.x&&g(i<h?a:u,i,p,h,i<h?u:a,i,r.x,r.y)&&(o=Math.abs(i-r.y)/(a-r.x),b(r,e)&&(o<f||o===f&&(r.x>n.x||r.x===n.x&&function(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}(n,r)))&&(n=r,f=o)),r=r.next,r!==s;);return n}(e,t))&&c(e=E(t,e),e.next)}(o[a],n),n=c(n,n.next);return n}(e,t,p,n)),e.length>80*n){for(var f=r=e[0],l=a=e[1],y=n;y<s;y+=n)(i=e[y])<f&&(f=i),(u=e[y+1])<l&&(l=u),r<i&&(r=i),a<u&&(a=u);x=0!==(x=Math.max(r-f,a-l))?1/x:0}return d(p,h,n,f,l,x),h}function v(e,t,n,r,a){var i,u;if(a===0<M(e,t,n,r))for(i=t;i<n;i+=r)u=x(i,e[i],e[i+1],u);else for(i=n-r;t<=i;i-=r)u=x(i,e[i],e[i+1],u);return u&&p(u,u.next)&&(f(u),u=u.next),u}function c(e,t){if(!e)return e;t=t||e;var n,r=e;do{if(n=!1,r.steiner||!p(r,r.next)&&0!==w(r.prev,r,r.next))r=r.next;else{if(f(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function d(e,t,n,r,a,i,u){if(e){!u&&i&&function(e,t,n,r){var a=e;for(;null===a.z&&(a.z=C(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next,a!==e;);a.prevZ.nextZ=null,a.prevZ=null,function(e){var t,n,r,a,i,u,x,o,s=1;do{for(n=e,i=e=null,u=0;n;){for(u++,r=n,t=x=0;t<s&&(x++,r=r.nextZ);t++);for(o=s;0<x||0<o&&r;)0!==x&&(0===o||!r||n.z<=r.z)?(n=(a=n).nextZ,x--):(r=(a=r).nextZ,o--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}}while(i.nextZ=null,s*=2,1<u)}(a)}(e,r,a,i);for(var x,o,s=e;e.prev!==e.next;)if(x=e.prev,o=e.next,i?function(e,t,n,r){var a=e.prev,i=e,u=e.next;if(0<=w(a,i,u))return!1;var x=(a.x<i.x?a.x<u.x?a:u:i.x<u.x?i:u).x,o=(a.y<i.y?a.y<u.y?a:u:i.y<u.y?i:u).y,s=(a.x>i.x?a.x>u.x?a:u:i.x>u.x?i:u).x,p=(a.y>i.y?a.y>u.y?a:u:i.y>u.y?i:u).y,h=C(x,o,t,n,r),f=C(s,p,t,n,r),l=e.prevZ,y=e.nextZ;for(;l&&l.z>=h&&y&&y.z<=f;){if(l!==e.prev&&l!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,l.x,l.y)&&0<=w(l.prev,l,l.next))return!1;if(l=l.prevZ,y!==e.prev&&y!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,y.x,y.y)&&0<=w(y.prev,y,y.next))return!1;y=y.nextZ}for(;l&&l.z>=h;){if(l!==e.prev&&l!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,l.x,l.y)&&0<=w(l.prev,l,l.next))return!1;l=l.prevZ}for(;y&&y.z<=f;){if(y!==e.prev&&y!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,y.x,y.y)&&0<=w(y.prev,y,y.next))return!1;y=y.nextZ}return!0}(e,r,a,i):function(e){var t=e.prev,n=e,r=e.next;if(0<=w(t,n,r))return!1;var a=e.next.next;for(;a!==e.prev;){if(g(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&0<=w(a.prev,a,a.next))return!1;a=a.next}return!0}(e))t.push(x.i/n),t.push(e.i/n),t.push(o.i/n),f(e),e=o.next,s=o.next;else if((e=o)===s){u?1===u?d(e=function(e,t,n){var r=e;do{var a=r.prev,i=r.next.next}while(!p(a,i)&&h(a,r,r.next,i)&&b(a,i)&&b(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),f(r),f(r.next),r=e=i),r=r.next,r!==e);return c(r)}(c(e),t,n),t,n,r,a,i,2):2===u&&function(e,t,n,r,a,i){var u=e;do{for(var x=u.next.next;x!==u.prev;){if(u.i!==x.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&h(n,n.next,e,t))return!0}while(n=n.next,n!==e);return!1}(e,t)&&(b(e,t)&&b(t,e)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;for(;n.y>i!=n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||p(e,t)&&0<w(e.prev,e,e.next)&&0<w(t.prev,t,t.next))}(u,x)){var o=E(u,x);return u=c(u,u.next),o=c(o,o.next),d(u,t,n,r,a,i),d(o,t,n,r,a,i)}x=x.next}}while(u=u.next,u!==e)}(e,t,n,r,a,i):d(c(e),t,n,r,a,i,1);break}}}function m(e,t){return e.x-t.x}function C(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function g(e,t,n,r,a,i,u,x){return 0<=(a-u)*(t-x)-(e-u)*(i-x)&&0<=(e-u)*(r-x)-(n-u)*(t-x)&&0<=(n-u)*(i-x)-(a-u)*(r-x)}function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function p(e,t){return e.x===t.x&&e.y===t.y}function h(e,t,n,r){var a=s(w(e,t,n)),i=s(w(e,t,r)),u=s(w(n,r,e)),x=s(w(n,r,t));return a!==i&&u!==x||(0===a&&o(e,n,t)||(0===i&&o(e,r,t)||(0===u&&o(n,e,r)||!(0!==x||!o(n,t,r)))))}function o(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 s(e){return 0<e?1:e<0?-1:0}function b(e,t){return w(e.prev,e,e.next)<0?0<=w(e,t,e.next)&&0<=w(e,e.prev,t):w(e,t,e.prev)<0||w(e,e.next,t)<0}function E(e,t){var n=new u(e.i,e.x,e.y),r=new u(t.i,t.x,t.y),a=e.next,i=t.prev;return(e.next=t).prev=e,(n.next=a).prev=n,(r.next=n).prev=r,(i.next=r).prev=i,r}function x(e,t,n,r){n=new u(e,t,n);return r?(n.next=r.next,(n.prev=r).next.prev=n,r.next=n):(n.prev=n).next=n,n}function f(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 u(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,u=n-r;i<n;i+=r)a+=(e[u]-e[i])*(e[i+1]+e[u+1]),u=i;return a}r.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,u=Math.abs(M(e,0,i,n));if(a)for(var x=0,o=t.length;x<o;x++){var s=t[x]*n,p=x<o-1?t[x+1]*n:e.length;u-=Math.abs(M(e,s,p,n))}for(var h=0,x=0;x<r.length;x+=3){var f=r[x]*n,l=r[x+1]*n,y=r[x+2]*n;h+=Math.abs((e[f]-e[y])*(e[1+l]-e[1+f])-(e[f]-e[l])*(e[1+y]-e[1+f]))}return 0===u&&0===h?0:Math.abs((h-u)/u)},r.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var u=0;u<t;u++)n.vertices.push(e[a][i][u]);0<a&&(r+=e[a-1].length,n.holes.push(r))}return n};var a={CLOCKWISE:n.WebGLConstants.CW,COUNTER_CLOCKWISE:n.WebGLConstants.CCW,validate:function(e){return e===a.CLOCKWISE||e===a.COUNTER_CLOCKWISE}},i=Object.freeze(a),l=new L.Cartesian3,y=new L.Cartesian3,Z={computeArea2D:function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],u=e[a];n+=i.x*u.y-u.x*i.y}return.5*n},computeWindingOrder2D:function(e){return 0<Z.computeArea2D(e)?i.COUNTER_CLOCKWISE:i.CLOCKWISE},triangulate:function(e,t){return r(L.Cartesian2.packArray(e),t,2)}},P=new L.Cartesian3,I=new L.Cartesian3,B=new L.Cartesian3,S=new L.Cartesian3,A=new L.Cartesian3,z=new L.Cartesian3,N=new L.Cartesian3;Z.computeSubdivision=function(e,t,n,r){r=G.defaultValue(r,W.CesiumMath.RADIANS_PER_DEGREE);for(var a=n.slice(0),i=t.length,u=new Array(3*i),x=0,o=0;o<i;o++){var s=t[o];u[x++]=s.x,u[x++]=s.y,u[x++]=s.z}for(var p=[],h={},f=e.maximumRadius,r=W.CesiumMath.chordLength(r,f),l=r*r;0<a.length;){var y,v,c=a.pop(),d=a.pop(),m=a.pop(),C=L.Cartesian3.fromArray(u,3*m,P),g=L.Cartesian3.fromArray(u,3*d,I),w=L.Cartesian3.fromArray(u,3*c,B),b=L.Cartesian3.multiplyByScalar(L.Cartesian3.normalize(C,S),f,S),E=L.Cartesian3.multiplyByScalar(L.Cartesian3.normalize(g,A),f,A),M=L.Cartesian3.multiplyByScalar(L.Cartesian3.normalize(w,z),f,z),Z=L.Cartesian3.magnitudeSquared(L.Cartesian3.subtract(b,E,N)),E=L.Cartesian3.magnitudeSquared(L.Cartesian3.subtract(E,M,N)),M=L.Cartesian3.magnitudeSquared(L.Cartesian3.subtract(M,b,N)),b=Math.max(Z,E,M);l<b?Z===b?(o=h[y=Math.min(m,d)+" "+Math.max(m,d)],G.defined(o)||(v=L.Cartesian3.add(C,g,N),L.Cartesian3.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),o=u.length/3-1,h[y]=o),a.push(m,o,c),a.push(o,d,c)):E===b?(o=h[y=Math.min(d,c)+" "+Math.max(d,c)],G.defined(o)||(v=L.Cartesian3.add(g,w,N),L.Cartesian3.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),o=u.length/3-1,h[y]=o),a.push(d,o,m),a.push(o,c,m)):M===b&&(o=h[y=Math.min(c,m)+" "+Math.max(c,m)],G.defined(o)||(v=L.Cartesian3.add(w,C,N),L.Cartesian3.multiplyByScalar(v,.5,v),u.push(v.x,v.y,v.z),o=u.length/3-1,h[y]=o),a.push(c,o,d),a.push(o,m,d)):(p.push(m),p.push(d),p.push(c))}return new T.Geometry({attributes:{position:new T.GeometryAttribute({componentDatatype:D.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})},indices:p,primitiveType:T.PrimitiveType.TRIANGLES})};var U=new L.Cartographic,_=new L.Cartographic,K=new L.Cartographic,V=new L.Cartographic;Z.computeRhumbLineSubdivision=function(e,t,n,r){r=G.defaultValue(r,W.CesiumMath.RADIANS_PER_DEGREE);for(var a=n.slice(0),i=t.length,u=new Array(3*i),x=0,o=0;o<i;o++){var s=t[o];u[x++]=s.x,u[x++]=s.y,u[x++]=s.z}for(var p=[],h={},n=e.maximumRadius,f=W.CesiumMath.chordLength(r,n),l=new O.EllipsoidRhumbLine(void 0,void 0,e),y=new O.EllipsoidRhumbLine(void 0,void 0,e),v=new O.EllipsoidRhumbLine(void 0,void 0,e);0<a.length;){var c=a.pop(),d=a.pop(),m=a.pop(),C=L.Cartesian3.fromArray(u,3*m,P),g=L.Cartesian3.fromArray(u,3*d,I),w=L.Cartesian3.fromArray(u,3*c,B),b=e.cartesianToCartographic(C,U),E=e.cartesianToCartographic(g,_),M=e.cartesianToCartographic(w,K);l.setEndPoints(b,E);var Z=l.surfaceDistance;y.setEndPoints(E,M);C=y.surfaceDistance;v.setEndPoints(M,b);var S,A,z,R,g=v.surfaceDistance,w=Math.max(Z,C,g);f<w?Z===w?(o=h[S=Math.min(m,d)+" "+Math.max(m,d)],G.defined(o)||(A=l.interpolateUsingFraction(.5,V),z=.5*(b.height+E.height),R=L.Cartesian3.fromRadians(A.longitude,A.latitude,z,e,N),u.push(R.x,R.y,R.z),o=u.length/3-1,h[S]=o),a.push(m,o,c),a.push(o,d,c)):C===w?(o=h[S=Math.min(d,c)+" "+Math.max(d,c)],G.defined(o)||(A=y.interpolateUsingFraction(.5,V),z=.5*(E.height+M.height),R=L.Cartesian3.fromRadians(A.longitude,A.latitude,z,e,N),u.push(R.x,R.y,R.z),o=u.length/3-1,h[S]=o),a.push(d,o,m),a.push(o,c,m)):g===w&&(o=h[S=Math.min(c,m)+" "+Math.max(c,m)],G.defined(o)||(A=v.interpolateUsingFraction(.5,V),z=.5*(M.height+b.height),R=L.Cartesian3.fromRadians(A.longitude,A.latitude,z,e,N),u.push(R.x,R.y,R.z),o=u.length/3-1,h[S]=o),a.push(c,o,d),a.push(o,m,d)):(p.push(m),p.push(d),p.push(c))}return new T.Geometry({attributes:{position:new T.GeometryAttribute({componentDatatype:D.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})},indices:p,primitiveType:T.PrimitiveType.TRIANGLES})},Z.scaleToGeodeticHeight=function(e,t,n,r){n=G.defaultValue(n,L.Ellipsoid.WGS84);var a=l,i=y;if(t=G.defaultValue(t,0),r=G.defaultValue(r,!0),G.defined(e))for(var u=e.length,x=0;x<u;x+=3)L.Cartesian3.fromArray(e,x,i),r&&(i=n.scaleToGeodeticSurface(i,i)),0!==t&&(a=n.geodeticSurfaceNormal(i,a),L.Cartesian3.multiplyByScalar(a,t,a),L.Cartesian3.add(i,a,i)),e[x]=i.x,e[x+1]=i.y,e[x+2]=i.z;return e},e.PolygonPipeline=Z,e.WindingOrder=i}); diff --git a/public/Cesium/Workers/PolylinePipeline-232a4d9a.js b/public/Cesium/Workers/PolylinePipeline-232a4d9a.js deleted file mode 100644 index c373ed4..0000000 --- a/public/Cesium/Workers/PolylinePipeline-232a4d9a.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./when-208fe5b0","./Check-d18af7c4","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4","./IntersectionTests-7d224a2f","./Math-4e53b694","./Transforms-a73b3b3b","./Plane-4aa8974d"],function(a,m,p,e,r,d,v,w,P,T){"use strict";var y={numberOfPoints:function(a,e,r){e=m.Cartesian3.distance(a,e);return Math.ceil(e/r)},numberOfPointsRhumbLine:function(a,e,r){e=Math.pow(a.longitude-e.longitude,2)+Math.pow(a.latitude-e.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(r*r))))}},o=new m.Cartographic;y.extractHeights=function(a,e){for(var r=a.length,t=new Array(r),n=0;n<r;n++){var i=a[n];t[n]=e.cartesianToCartographic(i,o).height}return t};var b=new P.Matrix4,A=new m.Cartesian3,E=new m.Cartesian3,R=new T.Plane(m.Cartesian3.UNIT_X,0),M=new m.Cartesian3,S=new T.Plane(m.Cartesian3.UNIT_X,0),D=new m.Cartesian3,x=new m.Cartesian3,N=[];function G(a,e,r){var t=N;if(t.length=a,e===r){for(i=0;i<a;i++)t[i]=e;return t}for(var n=(r-e)/a,i=0;i<a;i++){var o=e+i*n;t[i]=o}return t}var I=new m.Cartographic,k=new m.Cartographic,V=new m.Cartesian3,L=new m.Cartesian3,_=new m.Cartesian3,O=new r.EllipsoidGeodesic,B=new d.EllipsoidRhumbLine;y.wrapLongitude=function(a,e){var r=[],t=[];if(p.defined(a)&&0<a.length){e=p.defaultValue(e,P.Matrix4.IDENTITY);var n=P.Matrix4.inverseTransformation(e,b),e=P.Matrix4.multiplyByPoint(n,m.Cartesian3.ZERO,A),i=m.Cartesian3.normalize(P.Matrix4.multiplyByPointAsVector(n,m.Cartesian3.UNIT_Y,E),E),o=T.Plane.fromPointNormal(e,i,R),n=m.Cartesian3.normalize(P.Matrix4.multiplyByPointAsVector(n,m.Cartesian3.UNIT_X,M),M),s=T.Plane.fromPointNormal(e,n,S),c=1;r.push(m.Cartesian3.clone(a[0]));for(var l=r[0],u=a.length,h=1;h<u;++h){var f,g,C=a[h];(T.Plane.getPointDistance(s,l)<0||T.Plane.getPointDistance(s,C)<0)&&(f=v.IntersectionTests.lineSegmentPlane(l,C,o,D),p.defined(f)&&(g=m.Cartesian3.multiplyByScalar(i,5e-9,x),T.Plane.getPointDistance(o,l)<0&&m.Cartesian3.negate(g,g),r.push(m.Cartesian3.add(f,g,new m.Cartesian3)),t.push(c+1),m.Cartesian3.negate(g,g),r.push(m.Cartesian3.add(f,g,new m.Cartesian3)),c=1)),r.push(m.Cartesian3.clone(a[h])),c++,l=C}t.push(c)}return{positions:r,lengths:t}},y.generateArc=function(a){var e=(a=!p.defined(a)?{}:a).positions,r=e.length,t=p.defaultValue(a.ellipsoid,m.Ellipsoid.WGS84),n=p.defaultValue(a.height,0),i=Array.isArray(n);if(r<1)return[];if(1===r){var o,s=t.scaleToGeodeticSurface(e[0],L);return 0!==(n=i?n[0]:n)&&(o=t.geodeticSurfaceNormal(s,V),m.Cartesian3.multiplyByScalar(o,n,o),m.Cartesian3.add(s,o,s)),[s.x,s.y,s.z]}var c=a.minDistance;p.defined(c)||(g=p.defaultValue(a.granularity,w.CesiumMath.RADIANS_PER_DEGREE),c=w.CesiumMath.chordLength(g,t.maximumRadius));for(var l=0,u=0;u<r-1;u++)l+=y.numberOfPoints(e[u],e[u+1],c);var a=3*(l+1),h=new Array(a),f=0;for(u=0;u<r-1;u++)f=function(a,e,r,t,n,i,o,s){var c=t.scaleToGeodeticSurface(a,L),l=t.scaleToGeodeticSurface(e,_),u=y.numberOfPoints(a,e,r),c=t.cartesianToCartographic(c,I),l=t.cartesianToCartographic(l,k),h=G(u,n,i);O.setEndPoints(c,l);var f=O.surfaceDistance/u,g=s;c.height=n;var C=t.cartographicToCartesian(c,V);m.Cartesian3.pack(C,o,g),g+=3;for(var p=1;p<u;p++){var d=O.interpolateUsingSurfaceDistance(p*f,k);d.height=h[p],C=t.cartographicToCartesian(d,V),m.Cartesian3.pack(C,o,g),g+=3}return g}(e[u],e[u+1],c,t,i?n[u]:n,i?n[u+1]:n,h,f);N.length=0;var g=e[r-1],g=t.cartesianToCartographic(g,I);g.height=i?n[r-1]:n;g=t.cartographicToCartesian(g,V);return m.Cartesian3.pack(g,h,a-3),h};var U=new m.Cartographic,z=new m.Cartographic;y.generateRhumbArc=function(a){var e=(a=!p.defined(a)?{}:a).positions,r=e.length,t=p.defaultValue(a.ellipsoid,m.Ellipsoid.WGS84),n=p.defaultValue(a.height,0),i=Array.isArray(n);if(r<1)return[];if(1===r){var o,s=t.scaleToGeodeticSurface(e[0],L);return 0!==(n=i?n[0]:n)&&(o=t.geodeticSurfaceNormal(s,V),m.Cartesian3.multiplyByScalar(o,n,o),m.Cartesian3.add(s,o,s)),[s.x,s.y,s.z]}for(var c,l=p.defaultValue(a.granularity,w.CesiumMath.RADIANS_PER_DEGREE),u=0,h=t.cartesianToCartographic(e[0],U),f=0;f<r-1;f++)c=t.cartesianToCartographic(e[f+1],z),u+=y.numberOfPointsRhumbLine(h,c,l),h=m.Cartographic.clone(c,U);var s=3*(u+1),g=new Array(s),C=0;for(f=0;f<r-1;f++)C=function(a,e,r,t,n,i,o,s){var a=t.cartesianToCartographic(a,I),e=t.cartesianToCartographic(e,k),c=y.numberOfPointsRhumbLine(a,e,r);a.height=0,e.height=0;var l=G(c,n,i);(B=!B.ellipsoid.equals(t)?new d.EllipsoidRhumbLine(void 0,void 0,t):B).setEndPoints(a,e);var u=B.surfaceDistance/c,h=s;a.height=n;var f=t.cartographicToCartesian(a,V);m.Cartesian3.pack(f,o,h),h+=3;for(var g=1;g<c;g++){var C=B.interpolateUsingSurfaceDistance(g*u,k);C.height=l[g],f=t.cartographicToCartesian(C,V),m.Cartesian3.pack(f,o,h),h+=3}return h}(e[f],e[f+1],l,t,i?n[f]:n,i?n[f+1]:n,g,C);N.length=0;a=e[r-1],a=t.cartesianToCartographic(a,I);a.height=i?n[r-1]:n;a=t.cartographicToCartesian(a,V);return m.Cartesian3.pack(a,g,s-3),g},y.generateCartesianArc=function(a){for(var e=y.generateArc(a),r=e.length/3,t=new Array(r),n=0;n<r;n++)t[n]=m.Cartesian3.unpack(e,3*n);return t},y.generateCartesianRhumbArc=function(a){for(var e=y.generateRhumbArc(a),r=e.length/3,t=new Array(r),n=0;n<r;n++)t[n]=m.Cartesian3.unpack(e,3*n);return t},a.PolylinePipeline=y}); diff --git a/public/Cesium/Workers/PolylinePipeline-3803a6c2.js b/public/Cesium/Workers/PolylinePipeline-3803a6c2.js new file mode 100644 index 0000000..8f18643 --- /dev/null +++ b/public/Cesium/Workers/PolylinePipeline-3803a6c2.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./when-54335d57","./Check-24483042","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3","./IntersectionTests-5394f658","./Math-d6182036","./Transforms-79117a7b","./Plane-13ae4b1b"],function(a,m,p,e,r,d,v,w,P,T){"use strict";var y={numberOfPoints:function(a,e,r){e=m.Cartesian3.distance(a,e);return Math.ceil(e/r)},numberOfPointsRhumbLine:function(a,e,r){e=Math.pow(a.longitude-e.longitude,2)+Math.pow(a.latitude-e.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(e/(r*r))))}},o=new m.Cartographic;y.extractHeights=function(a,e){for(var r=a.length,t=new Array(r),n=0;n<r;n++){var i=a[n];t[n]=e.cartesianToCartographic(i,o).height}return t};var A=new P.Matrix4,b=new m.Cartesian3,E=new m.Cartesian3,R=new T.Plane(m.Cartesian3.UNIT_X,0),M=new m.Cartesian3,S=new T.Plane(m.Cartesian3.UNIT_X,0),D=new m.Cartesian3,x=new m.Cartesian3,N=[];function G(a,e,r){var t=N;if(t.length=a,e===r){for(i=0;i<a;i++)t[i]=e;return t}for(var n=(r-e)/a,i=0;i<a;i++)t[i]=e+i*n;return t}var I=new m.Cartographic,k=new m.Cartographic,V=new m.Cartesian3,L=new m.Cartesian3,_=new m.Cartesian3,O=new r.EllipsoidGeodesic,B=new d.EllipsoidRhumbLine;y.wrapLongitude=function(a,e){var r=[],t=[];if(p.defined(a)&&0<a.length){e=p.defaultValue(e,P.Matrix4.IDENTITY);var n=P.Matrix4.inverseTransformation(e,A),e=P.Matrix4.multiplyByPoint(n,m.Cartesian3.ZERO,b),i=m.Cartesian3.normalize(P.Matrix4.multiplyByPointAsVector(n,m.Cartesian3.UNIT_Y,E),E),o=T.Plane.fromPointNormal(e,i,R),n=m.Cartesian3.normalize(P.Matrix4.multiplyByPointAsVector(n,m.Cartesian3.UNIT_X,M),M),s=T.Plane.fromPointNormal(e,n,S),c=1;r.push(m.Cartesian3.clone(a[0]));for(var l=r[0],u=a.length,h=1;h<u;++h){var g,f,C=a[h];(T.Plane.getPointDistance(s,l)<0||T.Plane.getPointDistance(s,C)<0)&&(g=v.IntersectionTests.lineSegmentPlane(l,C,o,D),p.defined(g)&&(f=m.Cartesian3.multiplyByScalar(i,5e-9,x),T.Plane.getPointDistance(o,l)<0&&m.Cartesian3.negate(f,f),r.push(m.Cartesian3.add(g,f,new m.Cartesian3)),t.push(c+1),m.Cartesian3.negate(f,f),r.push(m.Cartesian3.add(g,f,new m.Cartesian3)),c=1)),r.push(m.Cartesian3.clone(a[h])),c++,l=C}t.push(c)}return{positions:r,lengths:t}},y.generateArc=function(a){var e=(a=!p.defined(a)?{}:a).positions,r=e.length,t=p.defaultValue(a.ellipsoid,m.Ellipsoid.WGS84),n=p.defaultValue(a.height,0),i=Array.isArray(n);if(r<1)return[];if(1===r){var o,s=t.scaleToGeodeticSurface(e[0],L);return 0!==(n=i?n[0]:n)&&(o=t.geodeticSurfaceNormal(s,V),m.Cartesian3.multiplyByScalar(o,n,o),m.Cartesian3.add(s,o,s)),[s.x,s.y,s.z]}var c=a.minDistance;p.defined(c)||(f=p.defaultValue(a.granularity,w.CesiumMath.RADIANS_PER_DEGREE),c=w.CesiumMath.chordLength(f,t.maximumRadius));for(var l=0,u=0;u<r-1;u++)l+=y.numberOfPoints(e[u],e[u+1],c);var a=3*(l+1),h=new Array(a),g=0;for(u=0;u<r-1;u++)g=function(a,e,r,t,n,i,o,s){var c=t.scaleToGeodeticSurface(a,L),l=t.scaleToGeodeticSurface(e,_),u=y.numberOfPoints(a,e,r),c=t.cartesianToCartographic(c,I),l=t.cartesianToCartographic(l,k),h=G(u,n,i);O.setEndPoints(c,l);var g=O.surfaceDistance/u,f=s;c.height=n;var C=t.cartographicToCartesian(c,V);m.Cartesian3.pack(C,o,f),f+=3;for(var p=1;p<u;p++){var d=O.interpolateUsingSurfaceDistance(p*g,k);d.height=h[p],C=t.cartographicToCartesian(d,V),m.Cartesian3.pack(C,o,f),f+=3}return f}(e[u],e[u+1],c,t,i?n[u]:n,i?n[u+1]:n,h,g);N.length=0;var f=e[r-1],f=t.cartesianToCartographic(f,I);f.height=i?n[r-1]:n;f=t.cartographicToCartesian(f,V);return m.Cartesian3.pack(f,h,a-3),h};var U=new m.Cartographic,z=new m.Cartographic;y.generateRhumbArc=function(a){var e=(a=!p.defined(a)?{}:a).positions,r=e.length,t=p.defaultValue(a.ellipsoid,m.Ellipsoid.WGS84),n=p.defaultValue(a.height,0),i=Array.isArray(n);if(r<1)return[];if(1===r){var o,s=t.scaleToGeodeticSurface(e[0],L);return 0!==(n=i?n[0]:n)&&(o=t.geodeticSurfaceNormal(s,V),m.Cartesian3.multiplyByScalar(o,n,o),m.Cartesian3.add(s,o,s)),[s.x,s.y,s.z]}for(var c,l=p.defaultValue(a.granularity,w.CesiumMath.RADIANS_PER_DEGREE),u=0,h=t.cartesianToCartographic(e[0],U),g=0;g<r-1;g++)c=t.cartesianToCartographic(e[g+1],z),u+=y.numberOfPointsRhumbLine(h,c,l),h=m.Cartographic.clone(c,U);var s=3*(u+1),f=new Array(s),C=0;for(g=0;g<r-1;g++)C=function(a,e,r,t,n,i,o,s){var a=t.cartesianToCartographic(a,I),e=t.cartesianToCartographic(e,k),c=y.numberOfPointsRhumbLine(a,e,r);a.height=0,e.height=0;var l=G(c,n,i);(B=!B.ellipsoid.equals(t)?new d.EllipsoidRhumbLine(void 0,void 0,t):B).setEndPoints(a,e);var u=B.surfaceDistance/c,h=s;a.height=n;var g=t.cartographicToCartesian(a,V);m.Cartesian3.pack(g,o,h),h+=3;for(var f=1;f<c;f++){var C=B.interpolateUsingSurfaceDistance(f*u,k);C.height=l[f],g=t.cartographicToCartesian(C,V),m.Cartesian3.pack(g,o,h),h+=3}return h}(e[g],e[g+1],l,t,i?n[g]:n,i?n[g+1]:n,f,C);N.length=0;a=e[r-1],a=t.cartesianToCartographic(a,I);a.height=i?n[r-1]:n;a=t.cartographicToCartesian(a,V);return m.Cartesian3.pack(a,f,s-3),f},y.generateCartesianArc=function(a){for(var e=y.generateArc(a),r=e.length/3,t=new Array(r),n=0;n<r;n++)t[n]=m.Cartesian3.unpack(e,3*n);return t},y.generateCartesianRhumbArc=function(a){for(var e=y.generateRhumbArc(a),r=e.length/3,t=new Array(r),n=0;n<r;n++)t[n]=m.Cartesian3.unpack(e,3*n);return t},a.PolylinePipeline=y}); diff --git a/public/Cesium/Workers/PolylineVolumeGeometryLibrary-4d0ebb44.js b/public/Cesium/Workers/PolylineVolumeGeometryLibrary-4d0ebb44.js new file mode 100644 index 0000000..ac0b0aa --- /dev/null +++ b/public/Cesium/Workers/PolylineVolumeGeometryLibrary-4d0ebb44.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./Transforms-79117a7b","./EllipsoidTangentPlane-325a8e68","./Math-d6182036","./PolylinePipeline-3803a6c2"],function(a,O,f,m,N,V){"use strict";var G=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2}),R=[new O.Cartesian3,new O.Cartesian3],I=new O.Cartesian3,L=new O.Cartesian3,j=new O.Cartesian3,Q=new O.Cartesian3,F=new O.Cartesian3,U=new O.Cartesian3,_=new O.Cartesian3,q=new O.Cartesian3,Y=new O.Cartesian3,Z=new O.Cartesian3,g=new O.Cartesian3,k={},H=new O.Cartographic;function J(a,e,r,n){var t=a[0],a=a[1],a=O.Cartesian3.angleBetween(t,a),i=Math.ceil(a/n),s=new Array(i);if(e===r){for(l=0;l<i;l++)s[l]=e;return s.push(r),s}for(var o=(r-e)/i,l=1;l<i;l++)s[l]=e+l*o;return s[0]=e,s.push(r),s}var d=new O.Cartesian3,p=new O.Cartesian3;var w=new O.Cartesian3(-1,0,0),h=new f.Matrix4,v=new f.Matrix4,x=new f.Matrix3,P=f.Matrix3.IDENTITY.clone(),E=new O.Cartesian3,M=new f.Cartesian4,T=new O.Cartesian3;function K(a,e,r,n,t,i,s,o){var l=E,C=M;h=f.Transforms.eastNorthUpToFixedFrame(a,t,h),l=f.Matrix4.multiplyByPointAsVector(h,w,l);var l=O.Cartesian3.normalize(l,l),e=(l=l,e=e,a=a,t=t,t=new m.EllipsoidTangentPlane(a,t),l=t.projectPointOntoPlane(O.Cartesian3.add(a,l,d),d),a=t.projectPointOntoPlane(O.Cartesian3.add(a,e,p),p),e=O.Cartesian2.angleBetween(l,a),0<=a.x*l.y-a.y*l.x?-e:e);x=f.Matrix3.fromRotationZ(e,x),T.z=i,h=f.Matrix4.multiplyTransformation(h,f.Matrix4.fromRotationTranslation(x,T,v),h);var c=P;c[0]=s;for(var u=0;u<o;u++)for(var y=0;y<r.length;y+=3)C=O.Cartesian3.fromArray(r,y,C),C=f.Matrix3.multiplyByVector(c,C,C),C=f.Matrix4.multiplyByPoint(h,C,C),n.push(C.x,C.y,C.z);return n}var l=new O.Cartesian3;function W(a,e,r,n,t,i,s){for(var o=0;o<a.length;o+=3)n=K(O.Cartesian3.fromArray(a,o,l),e,r,n,t,i[o/3],s,1);return n}function X(a,e){for(var r=a.length,n=new Array(3*r),t=0,i=e.x+e.width/2,s=e.y+e.height/2,o=0;o<r;o++)n[t++]=a[o].x-i,n[t++]=0,n[t++]=a[o].y-s;return n}var B=new f.Quaternion,z=new O.Cartesian3,S=new f.Matrix3;function $(a,e,r,n,t,i,s,o,l,C){var c,u=O.Cartesian3.angleBetween(O.Cartesian3.subtract(e,a,Z),O.Cartesian3.subtract(r,a,g)),y=n===G.BEVELED?0:Math.ceil(u/N.CesiumMath.toRadians(5)),m=t?f.Matrix3.fromQuaternion(f.Quaternion.fromAxisAngle(O.Cartesian3.negate(a,Z),u/(y+1),B),S):f.Matrix3.fromQuaternion(f.Quaternion.fromAxisAngle(a,u/(y+1),B),S);if(e=O.Cartesian3.clone(e,z),0<y)for(var d=C?2:1,p=0;p<y;p++)e=f.Matrix3.multiplyByVector(m,e,e),c=O.Cartesian3.subtract(e,a,Z),c=O.Cartesian3.normalize(c,c),t||(c=O.Cartesian3.negate(c,c)),s=K(i.scaleToGeodeticSurface(e,g),c,o,s,i,l,1,d);else c=O.Cartesian3.subtract(e,a,Z),c=O.Cartesian3.normalize(c,c),t||(c=O.Cartesian3.negate(c,c)),s=K(i.scaleToGeodeticSurface(e,g),c,o,s,i,l,1,1),r=O.Cartesian3.clone(r,z),c=O.Cartesian3.subtract(r,a,Z),c=O.Cartesian3.normalize(c,c),t||(c=O.Cartesian3.negate(c,c)),s=K(i.scaleToGeodeticSurface(r,g),c,o,s,i,l,1,1);return s}k.removeDuplicatesFromShape=function(a){for(var e=a.length,r=[],n=e-1,t=0;t<e;n=t++){var i=a[n],s=a[t];O.Cartesian2.equals(i,s)||r.push(s)}return r},k.angleIsGreaterThanPi=function(a,e,r,n){n=new m.EllipsoidTangentPlane(r,n),a=n.projectPointOntoPlane(O.Cartesian3.add(r,a,d),d),e=n.projectPointOntoPlane(O.Cartesian3.add(r,e,p),p);return 0<=e.x*a.y-e.y*a.x};var aa=new O.Cartesian3,ea=new O.Cartesian3;k.computePositions=function(a,e,r,n,t){var i=n._ellipsoid,s=function(a,e){for(var r=new Array(a.length),n=0;n<a.length;n++){var t=a[n];H=e.cartesianToCartographic(t,H),r[n]=H.height,a[n]=e.scaleToGeodeticSurface(t,t)}return r}(a,i),o=n._granularity,l=n._cornerType,C=(t?function(a,e){var r=a.length,n=new Array(6*r),t=0,i=e.x+e.width/2,s=e.y+e.height/2,o=a[0];n[t++]=o.x-i,n[t++]=0,n[t++]=o.y-s;for(var l=1;l<r;l++){var C=(o=a[l]).x-i,c=o.y-s;n[t++]=C,n[t++]=0,n[t++]=c,n[t++]=C,n[t++]=0,n[t++]=c}return o=a[0],n[t++]=o.x-i,n[t++]=0,n[t++]=o.y-s,n}:X)(e,r),e=t?X(e,r):void 0,c=r.height/2,u=r.width/2,y=a.length,m=[],r=t?[]:void 0,d=I,p=L,f=j,g=F,w=U,h=_,v=q,x=Y,P=a[0],E=a[1];A=i.geodeticSurfaceNormal(P,A=Q),d=O.Cartesian3.subtract(E,P,d),d=O.Cartesian3.normalize(d,d),v=O.Cartesian3.cross(A,d,v);var M,v=O.Cartesian3.normalize(v,v),T=s[0],B=s[1];t&&(r=K(P,v,e,r,i,T+c,1,1)),x=O.Cartesian3.clone(P,x),P=E,p=O.Cartesian3.negate(d,p);for(var z=1;z<y-1;z++){var S=t?2:1,E=a[z+1],d=O.Cartesian3.subtract(E,P,d);d=O.Cartesian3.normalize(d,d),f=O.Cartesian3.add(d,p,f),f=O.Cartesian3.normalize(f,f);var A=i.geodeticSurfaceNormal(P,A),b=O.Cartesian3.multiplyByScalar(A,O.Cartesian3.dot(d,A),aa);O.Cartesian3.subtract(d,b,b),O.Cartesian3.normalize(b,b);var D=O.Cartesian3.multiplyByScalar(A,O.Cartesian3.dot(p,A),ea);O.Cartesian3.subtract(p,D,D),O.Cartesian3.normalize(D,D),!N.CesiumMath.equalsEpsilon(Math.abs(O.Cartesian3.dot(b,D)),1,N.CesiumMath.EPSILON7)?(f=O.Cartesian3.cross(f,A,f),f=O.Cartesian3.cross(A,f,f),f=O.Cartesian3.normalize(f,f),b=1/Math.max(.25,O.Cartesian3.magnitude(O.Cartesian3.cross(f,p,Z))),(D=k.angleIsGreaterThanPi(d,p,P,i))?(g=O.Cartesian3.add(P,O.Cartesian3.multiplyByScalar(f,b*u,f),g),w=O.Cartesian3.add(g,O.Cartesian3.multiplyByScalar(v,u,w),w),R[0]=O.Cartesian3.clone(x,R[0]),R[1]=O.Cartesian3.clone(w,R[1]),M=J(R,T+c,B+c,o),m=W(V.PolylinePipeline.generateArc({positions:R,granularity:o,ellipsoid:i}),v,C,m,i,M,1),v=O.Cartesian3.cross(A,d,v),v=O.Cartesian3.normalize(v,v),h=O.Cartesian3.add(g,O.Cartesian3.multiplyByScalar(v,u,h),h),l===G.ROUNDED||l===G.BEVELED?$(g,w,h,l,D,i,m,C,B+c,t):m=K(P,f=O.Cartesian3.negate(f,f),C,m,i,B+c,b,S)):(g=O.Cartesian3.add(P,O.Cartesian3.multiplyByScalar(f,b*u,f),g),w=O.Cartesian3.add(g,O.Cartesian3.multiplyByScalar(v,-u,w),w),R[0]=O.Cartesian3.clone(x,R[0]),R[1]=O.Cartesian3.clone(w,R[1]),M=J(R,T+c,B+c,o),m=W(V.PolylinePipeline.generateArc({positions:R,granularity:o,ellipsoid:i}),v,C,m,i,M,1),v=O.Cartesian3.cross(A,d,v),v=O.Cartesian3.normalize(v,v),h=O.Cartesian3.add(g,O.Cartesian3.multiplyByScalar(v,-u,h),h),l===G.ROUNDED||l===G.BEVELED?$(g,w,h,l,D,i,m,C,B+c,t):m=K(P,f,C,m,i,B+c,b,S)),x=O.Cartesian3.clone(h,x),p=O.Cartesian3.negate(d,p)):(m=K(x,v,C,m,i,T+c,1,1),x=P),T=B,B=s[z+1],P=E}R[0]=O.Cartesian3.clone(x,R[0]),R[1]=O.Cartesian3.clone(P,R[1]),M=J(R,T+c,B+c,o),m=W(V.PolylinePipeline.generateArc({positions:R,granularity:o,ellipsoid:i}),v,C,m,i,M,1),t&&(r=K(P,v,e,r,i,B+c,1,1));y=m.length,e=t?y+r.length:y,e=new Float64Array(e);return e.set(m),t&&e.set(r,y),e},a.CornerType=G,a.PolylineVolumeGeometryLibrary=k}); diff --git a/public/Cesium/Workers/PolylineVolumeGeometryLibrary-a2a20b2b.js b/public/Cesium/Workers/PolylineVolumeGeometryLibrary-a2a20b2b.js deleted file mode 100644 index 2d2dea9..0000000 --- a/public/Cesium/Workers/PolylineVolumeGeometryLibrary-a2a20b2b.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./Transforms-a73b3b3b","./EllipsoidTangentPlane-9123a53b","./Math-4e53b694","./PolylinePipeline-232a4d9a"],function(a,O,f,m,N,V){"use strict";var G=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2}),R=[new O.Cartesian3,new O.Cartesian3],I=new O.Cartesian3,L=new O.Cartesian3,j=new O.Cartesian3,Q=new O.Cartesian3,F=new O.Cartesian3,U=new O.Cartesian3,_=new O.Cartesian3,q=new O.Cartesian3,Y=new O.Cartesian3,Z=new O.Cartesian3,g=new O.Cartesian3,k={},H=new O.Cartographic;function J(a,e,r,n){var t=a[0],a=a[1],a=O.Cartesian3.angleBetween(t,a),i=Math.ceil(a/n),s=new Array(i);if(e===r){for(l=0;l<i;l++)s[l]=e;return s.push(r),s}for(var o=(r-e)/i,l=1;l<i;l++){var C=e+l*o;s[l]=C}return s[0]=e,s.push(r),s}var d=new O.Cartesian3,p=new O.Cartesian3;var w=new O.Cartesian3(-1,0,0),h=new f.Matrix4,v=new f.Matrix4,x=new f.Matrix3,P=f.Matrix3.IDENTITY.clone(),E=new O.Cartesian3,M=new f.Cartesian4,T=new O.Cartesian3;function K(a,e,r,n,t,i,s,o){var l=E,C=M;h=f.Transforms.eastNorthUpToFixedFrame(a,t,h),l=f.Matrix4.multiplyByPointAsVector(h,w,l);var l=O.Cartesian3.normalize(l,l),e=(l=l,e=e,a=a,t=t,t=new m.EllipsoidTangentPlane(a,t),l=t.projectPointOntoPlane(O.Cartesian3.add(a,l,d),d),a=t.projectPointOntoPlane(O.Cartesian3.add(a,e,p),p),e=O.Cartesian2.angleBetween(l,a),0<=a.x*l.y-a.y*l.x?-e:e);x=f.Matrix3.fromRotationZ(e,x),T.z=i,h=f.Matrix4.multiplyTransformation(h,f.Matrix4.fromRotationTranslation(x,T,v),h);var c=P;c[0]=s;for(var u=0;u<o;u++)for(var y=0;y<r.length;y+=3)C=O.Cartesian3.fromArray(r,y,C),C=f.Matrix3.multiplyByVector(c,C,C),C=f.Matrix4.multiplyByPoint(h,C,C),n.push(C.x,C.y,C.z);return n}var l=new O.Cartesian3;function W(a,e,r,n,t,i,s){for(var o=0;o<a.length;o+=3)n=K(O.Cartesian3.fromArray(a,o,l),e,r,n,t,i[o/3],s,1);return n}function X(a,e){for(var r=a.length,n=new Array(3*r),t=0,i=e.x+e.width/2,s=e.y+e.height/2,o=0;o<r;o++)n[t++]=a[o].x-i,n[t++]=0,n[t++]=a[o].y-s;return n}var B=new f.Quaternion,b=new O.Cartesian3,z=new f.Matrix3;function $(a,e,r,n,t,i,s,o,l,C){var c,u=O.Cartesian3.angleBetween(O.Cartesian3.subtract(e,a,Z),O.Cartesian3.subtract(r,a,g)),y=n===G.BEVELED?0:Math.ceil(u/N.CesiumMath.toRadians(5)),m=t?f.Matrix3.fromQuaternion(f.Quaternion.fromAxisAngle(O.Cartesian3.negate(a,Z),u/(y+1),B),z):f.Matrix3.fromQuaternion(f.Quaternion.fromAxisAngle(a,u/(y+1),B),z);if(e=O.Cartesian3.clone(e,b),0<y)for(var d=C?2:1,p=0;p<y;p++)e=f.Matrix3.multiplyByVector(m,e,e),c=O.Cartesian3.subtract(e,a,Z),c=O.Cartesian3.normalize(c,c),t||(c=O.Cartesian3.negate(c,c)),s=K(i.scaleToGeodeticSurface(e,g),c,o,s,i,l,1,d);else c=O.Cartesian3.subtract(e,a,Z),c=O.Cartesian3.normalize(c,c),t||(c=O.Cartesian3.negate(c,c)),s=K(i.scaleToGeodeticSurface(e,g),c,o,s,i,l,1,1),r=O.Cartesian3.clone(r,b),c=O.Cartesian3.subtract(r,a,Z),c=O.Cartesian3.normalize(c,c),t||(c=O.Cartesian3.negate(c,c)),s=K(i.scaleToGeodeticSurface(r,g),c,o,s,i,l,1,1);return s}k.removeDuplicatesFromShape=function(a){for(var e=a.length,r=[],n=e-1,t=0;t<e;n=t++){var i=a[n],s=a[t];O.Cartesian2.equals(i,s)||r.push(s)}return r},k.angleIsGreaterThanPi=function(a,e,r,n){n=new m.EllipsoidTangentPlane(r,n),a=n.projectPointOntoPlane(O.Cartesian3.add(r,a,d),d),e=n.projectPointOntoPlane(O.Cartesian3.add(r,e,p),p);return 0<=e.x*a.y-e.y*a.x};var aa=new O.Cartesian3,ea=new O.Cartesian3;k.computePositions=function(a,e,r,n,t){var i=n._ellipsoid,s=function(a,e){for(var r=new Array(a.length),n=0;n<a.length;n++){var t=a[n];H=e.cartesianToCartographic(t,H),r[n]=H.height,a[n]=e.scaleToGeodeticSurface(t,t)}return r}(a,i),o=n._granularity,l=n._cornerType,C=(t?function(a,e){var r=a.length,n=new Array(6*r),t=0,i=e.x+e.width/2,s=e.y+e.height/2,o=a[0];n[t++]=o.x-i,n[t++]=0,n[t++]=o.y-s;for(var l=1;l<r;l++){var C=(o=a[l]).x-i,c=o.y-s;n[t++]=C,n[t++]=0,n[t++]=c,n[t++]=C,n[t++]=0,n[t++]=c}return o=a[0],n[t++]=o.x-i,n[t++]=0,n[t++]=o.y-s,n}:X)(e,r),e=t?X(e,r):void 0,c=r.height/2,u=r.width/2,y=a.length,m=[],r=t?[]:void 0,d=I,p=L,f=j,g=Q,w=F,h=U,v=_,x=q,P=Y,E=a[0],M=a[1];g=i.geodeticSurfaceNormal(E,g),d=O.Cartesian3.subtract(M,E,d),d=O.Cartesian3.normalize(d,d),x=O.Cartesian3.cross(g,d,x);var T,x=O.Cartesian3.normalize(x,x),B=s[0],b=s[1];t&&(r=K(E,x,e,r,i,B+c,1,1)),P=O.Cartesian3.clone(E,P),E=M,p=O.Cartesian3.negate(d,p);for(var z=1;z<y-1;z++){var S=t?2:1,M=a[z+1],d=O.Cartesian3.subtract(M,E,d);d=O.Cartesian3.normalize(d,d),f=O.Cartesian3.add(d,p,f),f=O.Cartesian3.normalize(f,f);var g=i.geodeticSurfaceNormal(E,g),A=O.Cartesian3.multiplyByScalar(g,O.Cartesian3.dot(d,g),aa);O.Cartesian3.subtract(d,A,A),O.Cartesian3.normalize(A,A);var D=O.Cartesian3.multiplyByScalar(g,O.Cartesian3.dot(p,g),ea);O.Cartesian3.subtract(p,D,D),O.Cartesian3.normalize(D,D),!N.CesiumMath.equalsEpsilon(Math.abs(O.Cartesian3.dot(A,D)),1,N.CesiumMath.EPSILON7)?(f=O.Cartesian3.cross(f,g,f),f=O.Cartesian3.cross(g,f,f),f=O.Cartesian3.normalize(f,f),A=1/Math.max(.25,O.Cartesian3.magnitude(O.Cartesian3.cross(f,p,Z))),(D=k.angleIsGreaterThanPi(d,p,E,i))?(w=O.Cartesian3.add(E,O.Cartesian3.multiplyByScalar(f,A*u,f),w),h=O.Cartesian3.add(w,O.Cartesian3.multiplyByScalar(x,u,h),h),R[0]=O.Cartesian3.clone(P,R[0]),R[1]=O.Cartesian3.clone(h,R[1]),T=J(R,B+c,b+c,o),m=W(V.PolylinePipeline.generateArc({positions:R,granularity:o,ellipsoid:i}),x,C,m,i,T,1),x=O.Cartesian3.cross(g,d,x),x=O.Cartesian3.normalize(x,x),v=O.Cartesian3.add(w,O.Cartesian3.multiplyByScalar(x,u,v),v),l===G.ROUNDED||l===G.BEVELED?$(w,h,v,l,D,i,m,C,b+c,t):m=K(E,f=O.Cartesian3.negate(f,f),C,m,i,b+c,A,S)):(w=O.Cartesian3.add(E,O.Cartesian3.multiplyByScalar(f,A*u,f),w),h=O.Cartesian3.add(w,O.Cartesian3.multiplyByScalar(x,-u,h),h),R[0]=O.Cartesian3.clone(P,R[0]),R[1]=O.Cartesian3.clone(h,R[1]),T=J(R,B+c,b+c,o),m=W(V.PolylinePipeline.generateArc({positions:R,granularity:o,ellipsoid:i}),x,C,m,i,T,1),x=O.Cartesian3.cross(g,d,x),x=O.Cartesian3.normalize(x,x),v=O.Cartesian3.add(w,O.Cartesian3.multiplyByScalar(x,-u,v),v),l===G.ROUNDED||l===G.BEVELED?$(w,h,v,l,D,i,m,C,b+c,t):m=K(E,f,C,m,i,b+c,A,S)),P=O.Cartesian3.clone(v,P),p=O.Cartesian3.negate(d,p)):(m=K(P,x,C,m,i,B+c,1,1),P=E),B=b,b=s[z+1],E=M}R[0]=O.Cartesian3.clone(P,R[0]),R[1]=O.Cartesian3.clone(E,R[1]),T=J(R,B+c,b+c,o),m=W(V.PolylinePipeline.generateArc({positions:R,granularity:o,ellipsoid:i}),x,C,m,i,T,1),t&&(r=K(E,x,e,r,i,b+c,1,1));y=m.length,e=t?y+r.length:y,e=new Float64Array(e);return e.set(m),t&&e.set(r,y),e},a.CornerType=G,a.PolylineVolumeGeometryLibrary=k}); diff --git a/public/Cesium/Workers/PrimitivePipeline-5ce755e1.js b/public/Cesium/Workers/PrimitivePipeline-5ce755e1.js deleted file mode 100644 index 3528d66..0000000 --- a/public/Cesium/Workers/PrimitivePipeline-5ce755e1.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Transforms-a73b3b3b","./ComponentDatatype-9204e9f6","./when-208fe5b0","./Check-d18af7c4","./Cartesian2-8417ca3d","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./WebMercatorProjection-ffb6b9f8"],function(e,P,k,y,t,f,C,w,b,A,c){"use strict";function m(e,t,r){e=y.defaultValue(e,0),t=y.defaultValue(t,0),r=y.defaultValue(r,0),this.value=new Float32Array([e,t,r])}function v(e,t){var r=e.attributes,e=r.position,n=e.values.length/e.componentsPerAttribute;r.batchId=new C.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(n)});for(var i=r.batchId.values,o=0;o<n;++o)i[o]=t}function l(e){var t=e.instances,r=e.projection,n=e.elementIndexUintSupported,i=e.scene3DOnly,o=e.vertexCacheOptimize,a=e.compressVertices,e=e.modelMatrix,s=t.length;for(g=0;g<s;++g)if(y.defined(t[g].geometry)){t[g].geometry.primitiveType;break}if(!function(e,t,r){var n=!r,i=e.length;if(!n&&1<i)for(var o=e[0].modelMatrix,a=1;a<i;++a)if(!P.Matrix4.equals(o,e[a].modelMatrix)){n=!0;break}if(n)for(a=0;a<i;++a)y.defined(e[a].geometry)&&b.GeometryPipeline.transformToWorldCoordinates(e[a]);else P.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}(t,e,i),!i)for(g=0;g<s;++g)y.defined(t[g].geometry)&&b.GeometryPipeline.splitLongitude(t[g]);if(!function(e){for(var t=e.length,r=0;r<t;++r){var n=e[r];y.defined(n.geometry)?v(n.geometry,r):y.defined(n.westHemisphereGeometry)&&y.defined(n.eastHemisphereGeometry)&&(v(n.westHemisphereGeometry,r),v(n.eastHemisphereGeometry,r))}}(t),o)for(g=0;g<s;++g){var d=t[g];y.defined(d.geometry)?(b.GeometryPipeline.reorderForPostVertexCache(d.geometry),b.GeometryPipeline.reorderForPreVertexCache(d.geometry)):y.defined(d.westHemisphereGeometry)&&y.defined(d.eastHemisphereGeometry)&&(b.GeometryPipeline.reorderForPostVertexCache(d.westHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(d.westHemisphereGeometry),b.GeometryPipeline.reorderForPostVertexCache(d.eastHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(d.eastHemisphereGeometry))}var p=b.GeometryPipeline.combineInstances(t);for(s=p.length,g=0;g<s;++g){var u,f,c,m,h=(u=p[g]).attributes;if(i)for(f in h)h.hasOwnProperty(f)&&h[f].componentDatatype===k.ComponentDatatype.DOUBLE&&b.GeometryPipeline.encodeAttribute(u,f,f+"3DHigh",f+"3DLow");else for(f in h)h.hasOwnProperty(f)&&h[f].componentDatatype===k.ComponentDatatype.DOUBLE&&(c=f+"3D",m=f+"2D",b.GeometryPipeline.projectTo2D(u,f,c,m,r),y.defined(u.boundingSphere)&&"position"===f&&(u.boundingSphereCV=P.BoundingSphere.fromVertices(u.attributes.position2D.values)),b.GeometryPipeline.encodeAttribute(u,c,c+"High",c+"Low"),b.GeometryPipeline.encodeAttribute(u,m,m+"High",m+"Low"));a&&b.GeometryPipeline.compressVertices(u)}if(!n){for(var l=[],s=p.length,g=0;g<s;++g)u=p[g],l=l.concat(b.GeometryPipeline.fitToUnsignedShortIndices(u));p=l}return p}function g(e,t,r,n){var i,o,a,s=n.length-1;a=0<=s?(i=(s=n[s]).offset+s.count,r[o=s.index].indices.length):r[o=i=0].indices.length;for(var d=e.length,p=0;p<d;++p){var u=e[p][t];y.defined(u)&&(a<i+(u=u.indices.length)&&(i=0,a=r[++o].indices.length),n.push({index:o,offset:i,count:u}),i+=u)}}Object.defineProperties(m.prototype,{componentDatatype:{get:function(){return k.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),m.fromCartesian3=function(e){return new m(e.x,e.y,e.z)},m.toValue=function(e,t){return(t=!y.defined(t)?new Float32Array([e.x,e.y,e.z]):t)[0]=e.x,t[1]=e.y,t[2]=e.z,t};var h={};function i(e,t){for(var r=e.length,n=0;n<r;++n)!function(e,t){var r,n,i=e.attributes;for(r in i)i.hasOwnProperty(r)&&(n=i[r],y.defined(n)&&y.defined(n.values)&&t.push(n.values.buffer));y.defined(e.indices)&&t.push(e.indices.buffer)}(e[n],t)}function o(e){var t=e.length,r=1+(P.BoundingSphere.packedLength+1)*t,n=new Float32Array(r),i=0;n[i++]=t;for(var o=0;o<t;++o){var a=e[o];y.defined(a)?(n[i++]=1,P.BoundingSphere.pack(e[o],n,i)):n[i++]=0,i+=P.BoundingSphere.packedLength}return n}function r(e){for(var t=new Array(e[0]),r=0,n=1;n<e.length;)1===e[n++]&&(t[r]=P.BoundingSphere.unpack(e,n)),++r,n+=P.BoundingSphere.packedLength;return t}h.combineGeometry=function(e){var t,r,n,i,o,a,s=e.instances,d=s.length,p=!1;0<d&&(0<(t=l(e)).length&&(r=b.GeometryPipeline.createAttributeLocations(t[0]),e.createPickOffsets&&(g(i=s,"geometry",o=t,a=[]),g(i,"westHemisphereGeometry",o,a),g(i,"eastHemisphereGeometry",o,a),a=a)),y.defined(s[0].attributes)&&y.defined(s[0].attributes.offset)&&(n=new Array(d),p=!0));for(var u=new Array(d),f=new Array(d),c=0;c<d;++c){var m=s[c],h=m.geometry;y.defined(h)&&(u[c]=h.boundingSphere,f[c]=h.boundingSphereCV,p&&(n[c]=m.geometry.offsetAttribute));h=m.eastHemisphereGeometry,m=m.westHemisphereGeometry;y.defined(h)&&y.defined(m)&&(y.defined(h.boundingSphere)&&y.defined(m.boundingSphere)&&(u[c]=P.BoundingSphere.union(h.boundingSphere,m.boundingSphere)),y.defined(h.boundingSphereCV)&&y.defined(m.boundingSphereCV)&&(f[c]=P.BoundingSphere.union(h.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,pickOffsets:a,offsetInstanceExtend:n,boundingSpheres:u,boundingSpheresCV:f}},h.packCreateGeometryResults=function(e,t){var r=new Float64Array(function(e){for(var t=1,r=e.length,n=0;n<r;n++){var i=e[n];if(++t,y.defined(i)){var o,a=i.attributes;for(o in t+=7+2*P.BoundingSphere.packedLength+(y.defined(i.indices)?i.indices.length:0),a)a.hasOwnProperty(o)&&y.defined(a[o])&&(t+=5+a[o].values.length)}}return t}(e)),n=[],i={},o=e.length,a=0;r[a++]=o;for(var s=0;s<o;s++){var d=e[s],p=y.defined(d);if(r[a++]=p?1:0,p){r[a++]=d.primitiveType,r[a++]=d.geometryType,r[a++]=y.defaultValue(d.offsetAttribute,-1);p=y.defined(d.boundingSphere)?1:0;(r[a++]=p)&&P.BoundingSphere.pack(d.boundingSphere,r,a),a+=P.BoundingSphere.packedLength;p=y.defined(d.boundingSphereCV)?1:0;(r[a++]=p)&&P.BoundingSphere.pack(d.boundingSphereCV,r,a),a+=P.BoundingSphere.packedLength;var u,f=d.attributes,c=[];for(u in f)f.hasOwnProperty(u)&&y.defined(f[u])&&(c.push(u),y.defined(i[u])||(i[u]=n.length,n.push(u)));r[a++]=c.length;for(var m=0;m<c.length;m++){var h=c[m],l=f[h];r[a++]=i[h],r[a++]=l.componentDatatype,r[a++]=l.componentsPerAttribute,r[a++]=l.normalize?1:0,r[a++]=l.values.length,r.set(l.values,a),a+=l.values.length}p=y.defined(d.indices)?d.indices.length:0;0<(r[a++]=p)&&(r.set(d.indices,a),a+=p)}}return t.push(r.buffer),{stringTable:n,packedData:r}},h.unpackCreateGeometryResults=function(e){for(var t=e.stringTable,r=e.packedData,n=new Array(r[0]),i=0,o=1;o<r.length;)if(1===r[o++]){var a,s,d=r[o++],p=r[o++],u=r[o++];-1===u&&(u=void 0),1===r[o++]&&(a=P.BoundingSphere.unpack(r,o)),o+=P.BoundingSphere.packedLength,1===r[o++]&&(s=P.BoundingSphere.unpack(r,o)),o+=P.BoundingSphere.packedLength;var f=new w.GeometryAttributes,c=r[o++];for(S=0;S<c;S++){for(var m=t[r[o++]],h=r[o++],l=r[o++],g=0!==r[o++],y=r[o++],b=k.ComponentDatatype.createTypedArray(h,y),v=0;v<y;v++)b[v]=r[o++];f[m]=new C.GeometryAttribute({componentDatatype:h,componentsPerAttribute:l,normalize:g,values:b})}if(0<(y=r[o++]))for(var G=b.length/l,x=A.IndexDatatype.createTypedArray(G,y),S=0;S<y;S++)x[S]=r[o++];n[i++]=new C.Geometry({primitiveType:d,geometryType:p,boundingSphere:a,boundingSphereCV:s,indices:x,attributes:f,offsetAttribute:u})}else n[i++]=void 0;return n},h.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,i=0;i<n;i++)t.push(r[i].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:function(e,t){var r=e.length,n=new Float64Array(1+19*r),i=0;n[i++]=r;for(var o=0;o<r;o++){var a=e[o];P.Matrix4.pack(a.modelMatrix,n,i),i+=P.Matrix4.packedLength,y.defined(a.attributes)&&y.defined(a.attributes.offset)&&(a=a.attributes.offset.value,n[i]=a[0],n[i+1]=a[1],n[i+2]=a[2]),i+=3}return t.push(n.buffer),n}(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof P.GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},h.unpackCombineGeometryParameters=function(e){for(var t=function(e){for(var t=e,r=new Array(t[0]),n=0,i=1;i<t.length;){var o,a=P.Matrix4.unpack(t,i);i+=P.Matrix4.packedLength,y.defined(t[i])&&(o={offset:new m(t[i],t[i+1],t[i+2])}),i+=3,r[n++]={modelMatrix:a,attributes:o}}return r}(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,o=0;o<n;o++)for(var a=h.unpackCreateGeometryResults(r[o]),s=a.length,d=0;d<s;d++){var p=a[d];t[i].geometry=p,++i}var u=f.Ellipsoid.clone(e.ellipsoid);return{instances:t,ellipsoid:u,projection:new(e.isGeographic?P.GeographicProjection:c.WebMercatorProjection)(u),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:P.Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},h.packCombineGeometryResults=function(e,t){y.defined(e.geometries)&&i(e.geometries,t);var r=o(e.boundingSpheres),n=o(e.boundingSpheresCV);return t.push(r.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:r,boundingSpheresCV:n}},h.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:r(e.boundingSpheres),boundingSpheresCV:r(e.boundingSpheresCV)}},e.PrimitivePipeline=h}); diff --git a/public/Cesium/Workers/PrimitivePipeline-c76ef883.js b/public/Cesium/Workers/PrimitivePipeline-c76ef883.js new file mode 100644 index 0000000..14bd8c3 --- /dev/null +++ b/public/Cesium/Workers/PrimitivePipeline-c76ef883.js @@ -0,0 +1 @@ +define(["exports","./Transforms-79117a7b","./ComponentDatatype-1a100acd","./when-54335d57","./Check-24483042","./Cartesian2-8646c5a1","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./WebMercatorProjection-66cc0482"],function(e,P,k,y,t,c,C,w,b,A,f){"use strict";function m(e,t,r){e=y.defaultValue(e,0),t=y.defaultValue(t,0),r=y.defaultValue(r,0),this.value=new Float32Array([e,t,r])}function v(e,t){var r=e.attributes,e=r.position,n=e.values.length/e.componentsPerAttribute;r.batchId=new C.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(n)});for(var i=r.batchId.values,o=0;o<n;++o)i[o]=t}function l(e){var t=e.instances,r=e.projection,n=e.elementIndexUintSupported,i=e.scene3DOnly,o=e.vertexCacheOptimize,a=e.compressVertices,e=e.modelMatrix,s=t.length;for(g=0;g<s;++g)if(y.defined(t[g].geometry)){t[g].geometry.primitiveType;break}if(!function(e,t,r){var n=!r,i=e.length;if(!n&&1<i)for(var o=e[0].modelMatrix,a=1;a<i;++a)if(!P.Matrix4.equals(o,e[a].modelMatrix)){n=!0;break}if(n)for(a=0;a<i;++a)y.defined(e[a].geometry)&&b.GeometryPipeline.transformToWorldCoordinates(e[a]);else P.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}(t,e,i),!i)for(g=0;g<s;++g)y.defined(t[g].geometry)&&b.GeometryPipeline.splitLongitude(t[g]);if(!function(e){for(var t=e.length,r=0;r<t;++r){var n=e[r];y.defined(n.geometry)?v(n.geometry,r):y.defined(n.westHemisphereGeometry)&&y.defined(n.eastHemisphereGeometry)&&(v(n.westHemisphereGeometry,r),v(n.eastHemisphereGeometry,r))}}(t),o)for(g=0;g<s;++g){var d=t[g];y.defined(d.geometry)?(b.GeometryPipeline.reorderForPostVertexCache(d.geometry),b.GeometryPipeline.reorderForPreVertexCache(d.geometry)):y.defined(d.westHemisphereGeometry)&&y.defined(d.eastHemisphereGeometry)&&(b.GeometryPipeline.reorderForPostVertexCache(d.westHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(d.westHemisphereGeometry),b.GeometryPipeline.reorderForPostVertexCache(d.eastHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(d.eastHemisphereGeometry))}var p=b.GeometryPipeline.combineInstances(t);for(s=p.length,g=0;g<s;++g){var u,c,f,m,h=(u=p[g]).attributes;if(i)for(c in h)h.hasOwnProperty(c)&&h[c].componentDatatype===k.ComponentDatatype.DOUBLE&&b.GeometryPipeline.encodeAttribute(u,c,c+"3DHigh",c+"3DLow");else for(c in h)h.hasOwnProperty(c)&&h[c].componentDatatype===k.ComponentDatatype.DOUBLE&&(b.GeometryPipeline.projectTo2D(u,c,f=c+"3D",m=c+"2D",r),y.defined(u.boundingSphere)&&"position"===c&&(u.boundingSphereCV=P.BoundingSphere.fromVertices(u.attributes.position2D.values)),b.GeometryPipeline.encodeAttribute(u,f,f+"High",f+"Low"),b.GeometryPipeline.encodeAttribute(u,m,m+"High",m+"Low"));a&&b.GeometryPipeline.compressVertices(u)}if(!n){for(var l=[],s=p.length,g=0;g<s;++g)u=p[g],l=l.concat(b.GeometryPipeline.fitToUnsignedShortIndices(u));p=l}return p}function g(e,t,r,n){var i,o,a,s=n.length-1;a=0<=s?(i=(s=n[s]).offset+s.count,r[o=s.index].indices.length):r[o=i=0].indices.length;for(var d=e.length,p=0;p<d;++p){var u=e[p][t];y.defined(u)&&(a<i+(u=u.indices.length)&&(i=0,a=r[++o].indices.length),n.push({index:o,offset:i,count:u}),i+=u)}}Object.defineProperties(m.prototype,{componentDatatype:{get:function(){return k.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),m.fromCartesian3=function(e){return new m(e.x,e.y,e.z)},m.toValue=function(e,t){return(t=!y.defined(t)?new Float32Array([e.x,e.y,e.z]):t)[0]=e.x,t[1]=e.y,t[2]=e.z,t};var h={};function i(e,t){for(var r=e.length,n=0;n<r;++n)!function(e,t){var r,n,i=e.attributes;for(r in i)i.hasOwnProperty(r)&&(n=i[r],y.defined(n)&&y.defined(n.values)&&t.push(n.values.buffer));y.defined(e.indices)&&t.push(e.indices.buffer)}(e[n],t)}function o(e){var t=e.length,r=1+(P.BoundingSphere.packedLength+1)*t,n=new Float32Array(r),i=0;n[i++]=t;for(var o=0;o<t;++o){var a=e[o];y.defined(a)?(n[i++]=1,P.BoundingSphere.pack(e[o],n,i)):n[i++]=0,i+=P.BoundingSphere.packedLength}return n}function r(e){for(var t=new Array(e[0]),r=0,n=1;n<e.length;)1===e[n++]&&(t[r]=P.BoundingSphere.unpack(e,n)),++r,n+=P.BoundingSphere.packedLength;return t}h.combineGeometry=function(e){var t,r,n,i,o,a,s=e.instances,d=s.length,p=!1;0<d&&(0<(t=l(e)).length&&(r=b.GeometryPipeline.createAttributeLocations(t[0]),e.createPickOffsets&&(g(i=s,"geometry",o=t,a=[]),g(i,"westHemisphereGeometry",o,a),g(i,"eastHemisphereGeometry",o,a),a=a)),y.defined(s[0].attributes)&&y.defined(s[0].attributes.offset)&&(n=new Array(d),p=!0));for(var u=new Array(d),c=new Array(d),f=0;f<d;++f){var m=s[f],h=m.geometry;y.defined(h)&&(u[f]=h.boundingSphere,c[f]=h.boundingSphereCV,p&&(n[f]=m.geometry.offsetAttribute));h=m.eastHemisphereGeometry,m=m.westHemisphereGeometry;y.defined(h)&&y.defined(m)&&(y.defined(h.boundingSphere)&&y.defined(m.boundingSphere)&&(u[f]=P.BoundingSphere.union(h.boundingSphere,m.boundingSphere)),y.defined(h.boundingSphereCV)&&y.defined(m.boundingSphereCV)&&(c[f]=P.BoundingSphere.union(h.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,pickOffsets:a,offsetInstanceExtend:n,boundingSpheres:u,boundingSpheresCV:c}},h.packCreateGeometryResults=function(e,t){var r=new Float64Array(function(e){for(var t=1,r=e.length,n=0;n<r;n++){var i=e[n];if(++t,y.defined(i)){var o,a=i.attributes;for(o in t+=7+2*P.BoundingSphere.packedLength+(y.defined(i.indices)?i.indices.length:0),a)a.hasOwnProperty(o)&&y.defined(a[o])&&(t+=5+a[o].values.length)}}return t}(e)),n=[],i={},o=e.length,a=0;r[a++]=o;for(var s=0;s<o;s++){var d=e[s],p=y.defined(d);if(r[a++]=p?1:0,p){r[a++]=d.primitiveType,r[a++]=d.geometryType,r[a++]=y.defaultValue(d.offsetAttribute,-1);p=y.defined(d.boundingSphere)?1:0;(r[a++]=p)&&P.BoundingSphere.pack(d.boundingSphere,r,a),a+=P.BoundingSphere.packedLength;p=y.defined(d.boundingSphereCV)?1:0;(r[a++]=p)&&P.BoundingSphere.pack(d.boundingSphereCV,r,a),a+=P.BoundingSphere.packedLength;var u,c=d.attributes,f=[];for(u in c)c.hasOwnProperty(u)&&y.defined(c[u])&&(f.push(u),y.defined(i[u])||(i[u]=n.length,n.push(u)));r[a++]=f.length;for(var m=0;m<f.length;m++){var h=f[m],l=c[h];r[a++]=i[h],r[a++]=l.componentDatatype,r[a++]=l.componentsPerAttribute,r[a++]=l.normalize?1:0,r[a++]=l.values.length,r.set(l.values,a),a+=l.values.length}p=y.defined(d.indices)?d.indices.length:0;0<(r[a++]=p)&&(r.set(d.indices,a),a+=p)}}return t.push(r.buffer),{stringTable:n,packedData:r}},h.unpackCreateGeometryResults=function(e){for(var t=e.stringTable,r=e.packedData,n=new Array(r[0]),i=0,o=1;o<r.length;)if(1===r[o++]){var a,s,d=r[o++],p=r[o++],u=r[o++];-1===u&&(u=void 0),1===r[o++]&&(a=P.BoundingSphere.unpack(r,o)),o+=P.BoundingSphere.packedLength,1===r[o++]&&(s=P.BoundingSphere.unpack(r,o)),o+=P.BoundingSphere.packedLength;var c=new w.GeometryAttributes,f=r[o++];for(S=0;S<f;S++){for(var m=t[r[o++]],h=r[o++],l=r[o++],g=0!==r[o++],y=r[o++],b=k.ComponentDatatype.createTypedArray(h,y),v=0;v<y;v++)b[v]=r[o++];c[m]=new C.GeometryAttribute({componentDatatype:h,componentsPerAttribute:l,normalize:g,values:b})}if(0<(y=r[o++]))for(var G=b.length/l,x=A.IndexDatatype.createTypedArray(G,y),S=0;S<y;S++)x[S]=r[o++];n[i++]=new C.Geometry({primitiveType:d,geometryType:p,boundingSphere:a,boundingSphereCV:s,indices:x,attributes:c,offsetAttribute:u})}else n[i++]=void 0;return n},h.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,i=0;i<n;i++)t.push(r[i].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:function(e,t){var r=e.length,n=new Float64Array(1+19*r),i=0;n[i++]=r;for(var o=0;o<r;o++){var a=e[o];P.Matrix4.pack(a.modelMatrix,n,i),i+=P.Matrix4.packedLength,y.defined(a.attributes)&&y.defined(a.attributes.offset)&&(a=a.attributes.offset.value,n[i]=a[0],n[i+1]=a[1],n[i+2]=a[2]),i+=3}return t.push(n.buffer),n}(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof P.GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},h.unpackCombineGeometryParameters=function(e){for(var t=function(e){for(var t=e,r=new Array(t[0]),n=0,i=1;i<t.length;){var o,a=P.Matrix4.unpack(t,i);i+=P.Matrix4.packedLength,y.defined(t[i])&&(o={offset:new m(t[i],t[i+1],t[i+2])}),i+=3,r[n++]={modelMatrix:a,attributes:o}}return r}(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,o=0;o<n;o++)for(var a=h.unpackCreateGeometryResults(r[o]),s=a.length,d=0;d<s;d++){var p=a[d];t[i].geometry=p,++i}var u=c.Ellipsoid.clone(e.ellipsoid);return{instances:t,ellipsoid:u,projection:new(e.isGeographic?P.GeographicProjection:f.WebMercatorProjection)(u),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:P.Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},h.packCombineGeometryResults=function(e,t){y.defined(e.geometries)&&i(e.geometries,t);var r=o(e.boundingSpheres),n=o(e.boundingSpheresCV);return t.push(r.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:r,boundingSpheresCV:n}},h.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:r(e.boundingSpheres),boundingSpheresCV:r(e.boundingSpheresCV)}},e.PrimitivePipeline=h}); diff --git a/public/Cesium/Workers/RectangleGeometryLibrary-57cd4923.js b/public/Cesium/Workers/RectangleGeometryLibrary-57cd4923.js new file mode 100644 index 0000000..405e9fa --- /dev/null +++ b/public/Cesium/Workers/RectangleGeometryLibrary-57cd4923.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./when-54335d57","./Check-24483042","./Transforms-79117a7b","./Math-d6182036","./GeometryAttribute-374f805d"],function(t,X,d,n,a,Y,l){"use strict";var w=Math.cos,M=Math.sin,m=Math.sqrt,r={computePosition:function(t,n,a,r,e,o,s){var i=n.radiiSquared,g=t.nwCorner,h=t.boundingRectangle,u=g.latitude-t.granYCos*r+e*t.granXSin,c=w(u),C=M(u),l=i.z*C,S=g.longitude+r*t.granYSin+e*t.granXCos,n=c*w(S),g=c*M(S),c=i.x*n,i=i.y*g,C=m(c*n+i*g+l*C);o.x=c/C,o.y=i/C,o.z=l/C,a&&(a=t.stNwCorner,d.defined(a)?(u=a.latitude-t.stGranYCos*r+e*t.stGranXSin,S=a.longitude+r*t.stGranYSin+e*t.stGranXCos,s.x=(S-t.stWest)*t.lonScalar,s.y=(u-t.stSouth)*t.latScalar):(s.x=(S-h.west)*t.lonScalar,s.y=(u-h.south)*t.latScalar))}},S=new l.Matrix2,p=new X.Cartesian3,G=new X.Cartographic,x=new X.Cartesian3,R=new a.GeographicProjection;function f(t,n,a,r,e,o,s){var i=Math.cos(n),g=r*i,h=a*i,u=Math.sin(n),c=r*u,C=a*u;p=R.project(t,p),p=X.Cartesian3.subtract(p,x,p);i=l.Matrix2.fromRotation(n,S);p=l.Matrix2.multiplyByVector(i,p,p),p=X.Cartesian3.add(p,x,p);r=(t=R.unproject(p,t)).latitude,a=r+--o*C,u=r-g*--s,n=r-g*s+o*C,i=Math.max(r,a,u,n),r=Math.min(r,a,u,n),a=t.longitude,u=a+o*h,n=a+s*c,o=a+s*c+o*h;return{north:i,south:r,east:Math.max(a,u,n,o),west:Math.min(a,u,n,o),granYCos:g,granYSin:c,granXCos:h,granXSin:C,nwCorner:t}}r.computeOptions=function(t,n,a,r,e,o,s){var i=t.east,g=t.west,h=t.north,u=t.south,c=!1,C=!1;h===Y.CesiumMath.PI_OVER_TWO&&(c=!0),u===-Y.CesiumMath.PI_OVER_TWO&&(C=!0);var l,S=h-u,d=(w=i<g?Y.CesiumMath.TWO_PI-g+i:i-g)/((l=Math.ceil(w/n)+1)-1),w=S/((M=Math.ceil(S/n)+1)-1),S=X.Rectangle.northwest(t,o),n=X.Rectangle.center(t,G);0===a&&0===r||(n.longitude<S.longitude&&(n.longitude+=Y.CesiumMath.TWO_PI),x=R.project(n,x));var M,o=w,n=d,e=X.Rectangle.clone(t,e),C={granYCos:o,granYSin:0,granXCos:n,granXSin:0,nwCorner:S,boundingRectangle:e,width:l,height:M,northCap:c,southCap:C};return 0!==a&&(h=(S=f(S,a,d,w,0,l,M)).north,u=S.south,i=S.east,g=S.west,C.granYCos=S.granYCos,C.granYSin=S.granYSin,C.granXCos=S.granXCos,C.granXSin=S.granXSin,e.north=h,e.south=u,e.east=i,e.west=g),0!==r&&(a-=r,M=f(s=X.Rectangle.northwest(e,s),a,d,w,0,l,M),C.stGranYCos=M.granYCos,C.stGranXCos=M.granXCos,C.stGranYSin=M.granYSin,C.stGranXSin=M.granXSin,C.stNwCorner=s,C.stWest=M.west,C.stSouth=M.south),C},t.RectangleGeometryLibrary=r}); diff --git a/public/Cesium/Workers/RectangleGeometryLibrary-b88eec5f.js b/public/Cesium/Workers/RectangleGeometryLibrary-b88eec5f.js deleted file mode 100644 index dd7014b..0000000 --- a/public/Cesium/Workers/RectangleGeometryLibrary-b88eec5f.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./when-208fe5b0","./Check-d18af7c4","./Transforms-a73b3b3b","./Math-4e53b694","./GeometryAttribute-04a19cfe"],function(t,X,d,n,a,Y,l){"use strict";var w=Math.cos,M=Math.sin,m=Math.sqrt,r={computePosition:function(t,n,a,r,e,o,s){var i=n.radiiSquared,g=t.nwCorner,h=t.boundingRectangle,u=g.latitude-t.granYCos*r+e*t.granXSin,c=w(u),C=M(u),l=i.z*C,S=g.longitude+r*t.granYSin+e*t.granXCos,n=c*w(S),g=c*M(S),c=i.x*n,i=i.y*g,C=m(c*n+i*g+l*C);o.x=c/C,o.y=i/C,o.z=l/C,a&&(a=t.stNwCorner,d.defined(a)?(u=a.latitude-t.stGranYCos*r+e*t.stGranXSin,S=a.longitude+r*t.stGranYSin+e*t.stGranXCos,s.x=(S-t.stWest)*t.lonScalar,s.y=(u-t.stSouth)*t.latScalar):(s.x=(S-h.west)*t.lonScalar,s.y=(u-h.south)*t.latScalar))}},S=new l.Matrix2,p=new X.Cartesian3,f=new X.Cartographic,G=new X.Cartesian3,b=new a.GeographicProjection;function x(t,n,a,r,e,o,s){var i=Math.cos(n),g=r*i,h=a*i,u=Math.sin(n),c=r*u,C=a*u;p=b.project(t,p),p=X.Cartesian3.subtract(p,G,p);i=l.Matrix2.fromRotation(n,S);p=l.Matrix2.multiplyByVector(i,p,p),p=X.Cartesian3.add(p,G,p),--o,--s;r=(t=b.unproject(p,t)).latitude,a=r+o*C,u=r-g*s,n=r-g*s+o*C,i=Math.max(r,a,u,n),r=Math.min(r,a,u,n),a=t.longitude,u=a+o*h,n=a+s*c,o=a+s*c+o*h;return{north:i,south:r,east:Math.max(a,u,n,o),west:Math.min(a,u,n,o),granYCos:g,granYSin:c,granXCos:h,granXSin:C,nwCorner:t}}r.computeOptions=function(t,n,a,r,e,o,s){var i=t.east,g=t.west,h=t.north,u=t.south,c=!1,C=!1;h===Y.CesiumMath.PI_OVER_TWO&&(c=!0),u===-Y.CesiumMath.PI_OVER_TWO&&(C=!0);var l,S=h-u,d=(w=i<g?Y.CesiumMath.TWO_PI-g+i:i-g)/((l=Math.ceil(w/n)+1)-1),w=S/((M=Math.ceil(S/n)+1)-1),S=X.Rectangle.northwest(t,o),n=X.Rectangle.center(t,f);0===a&&0===r||(n.longitude<S.longitude&&(n.longitude+=Y.CesiumMath.TWO_PI),G=b.project(n,G));var M,o=w,n=d,e=X.Rectangle.clone(t,e),C={granYCos:o,granYSin:0,granXCos:n,granXSin:0,nwCorner:S,boundingRectangle:e,width:l,height:M,northCap:c,southCap:C};return 0!==a&&(h=(S=x(S,a,d,w,0,l,M)).north,u=S.south,i=S.east,g=S.west,C.granYCos=S.granYCos,C.granYSin=S.granYSin,C.granXCos=S.granXCos,C.granXSin=S.granXSin,e.north=h,e.south=u,e.east=i,e.west=g),0!==r&&(a-=r,M=x(s=X.Rectangle.northwest(e,s),a,d,w,0,l,M),C.stGranYCos=M.granYCos,C.stGranXCos=M.granXCos,C.stGranYSin=M.granYSin,C.stGranXSin=M.granXSin,C.stNwCorner=s,C.stWest=M.west,C.stSouth=M.south),C},t.RectangleGeometryLibrary=r}); diff --git a/public/Cesium/Workers/RuntimeError-7f634f5d.js b/public/Cesium/Workers/RuntimeError-7f634f5d.js deleted file mode 100644 index 390d258..0000000 --- a/public/Cesium/Workers/RuntimeError-7f634f5d.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./when-208fe5b0"],function(t,e){"use strict";function r(t){var e;this.name="RuntimeError",this.message=t;try{throw new Error}catch(t){e=t.stack}this.stack=e}e.defined(Object.create)&&((r.prototype=Object.create(Error.prototype)).constructor=r),r.prototype.toString=function(){var t=this.name+": "+this.message;return e.defined(this.stack)&&(t+="\n"+this.stack.toString()),t},t.RuntimeError=r}); diff --git a/public/Cesium/Workers/RuntimeError-88a32665.js b/public/Cesium/Workers/RuntimeError-88a32665.js new file mode 100644 index 0000000..b01613d --- /dev/null +++ b/public/Cesium/Workers/RuntimeError-88a32665.js @@ -0,0 +1 @@ +define(["exports","./when-54335d57"],function(t,r){"use strict";function e(t){var r;this.name="RuntimeError",this.message=t;try{throw new Error}catch(t){r=t.stack}this.stack=r}r.defined(Object.create)&&((e.prototype=Object.create(Error.prototype)).constructor=e),e.prototype.toString=function(){var t=this.name+": "+this.message;return r.defined(this.stack)&&(t+="\n"+this.stack.toString()),t},t.RuntimeError=e}); diff --git a/public/Cesium/Workers/TerrainEncoding-73cbc4e6.js b/public/Cesium/Workers/TerrainEncoding-c552e269.js similarity index 77% rename from public/Cesium/Workers/TerrainEncoding-73cbc4e6.js rename to public/Cesium/Workers/TerrainEncoding-c552e269.js index c5a6139..68f47b7 100644 --- a/public/Cesium/Workers/TerrainEncoding-73cbc4e6.js +++ b/public/Cesium/Workers/TerrainEncoding-c552e269.js @@ -1 +1 @@ -define(["exports","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./AttributeCompression-f02ec82f","./ComponentDatatype-9204e9f6","./Math-4e53b694"],function(t,l,p,e,h,d,o,f){"use strict";function i(t,e){this._ellipsoid=t,this._cameraPosition=new p.Cartesian3,this._cameraPositionInScaledSpace=new p.Cartesian3,this._distanceToLimbInScaledSpaceSquared=0,h.defined(e)&&(this.cameraPosition=e)}Object.defineProperties(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){var e=this._ellipsoid.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),i=p.Cartesian3.magnitudeSquared(e)-1;p.Cartesian3.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=i}}});var r=new p.Cartesian3;i.prototype.isPointVisible=function(t){return S(this._ellipsoid.transformPositionToScaledSpace(t,r),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},i.prototype.isScaledSpacePointVisible=function(t){return S(t,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var a=new p.Cartesian3;i.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(t,e){var i,r=this._ellipsoid,e=h.defined(e)&&e<0&&r.minimumRadius>-e?((i=a).x=this._cameraPosition.x/(r.radii.x+e),i.y=this._cameraPosition.y/(r.radii.y+e),i.z=this._cameraPosition.z/(r.radii.z+e),i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared);return S(t,i,e)},i.prototype.computeHorizonCullingPoint=function(t,e,i){return u(this._ellipsoid,t,e,i)};var s=p.Ellipsoid.clone(p.Ellipsoid.UNIT_SPHERE);i.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(t,e,i,r){return u(c(this._ellipsoid,i,s),t,e,r)},i.prototype.computeHorizonCullingPointFromVertices=function(t,e,i,r,a){return C(this._ellipsoid,t,e,i,r,a)},i.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(t,e,i,r,a,n){return C(c(this._ellipsoid,a,s),t,e,i,r,n)};var n=[];i.prototype.computeHorizonCullingPointFromRectangle=function(t,e,i){var r=p.Rectangle.subsample(t,e,0,n),t=l.BoundingSphere.fromPoints(r);if(!(p.Cartesian3.magnitude(t.center)<.1*e.minimumRadius))return this.computeHorizonCullingPoint(t.center,r,i)};var m=new p.Cartesian3;function c(t,e,i){return h.defined(e)&&e<0&&t.minimumRadius>-e&&(e=p.Cartesian3.fromElements(t.radii.x+e,t.radii.y+e,t.radii.z+e,m),t=p.Ellipsoid.fromCartesian3(e,i)),t}function u(t,e,i,r){h.defined(r)||(r=new p.Cartesian3);for(var a=P(t,e),n=0,o=0,s=i.length;o<s;++o){var m=M(t,i[o],a);if(m<0)return;n=Math.max(n,m)}return g(a,n,r)}var x=new p.Cartesian3;function C(t,e,i,r,a,n){h.defined(n)||(n=new p.Cartesian3),r=h.defaultValue(r,3),a=h.defaultValue(a,p.Cartesian3.ZERO);for(var o=P(t,e),s=0,m=0,c=i.length;m<c;m+=r){x.x=i[m]+a.x,x.y=i[m+1]+a.y,x.z=i[m+2]+a.z;var u=M(t,x,o);if(u<0)return;s=Math.max(s,u)}return g(o,s,n)}function S(t,e,i){t=p.Cartesian3.subtract(t,e,r),e=-p.Cartesian3.dot(t,e);return!(i<0?0<e:i<e&&e*e/p.Cartesian3.magnitudeSquared(t)>i)}var y=new p.Cartesian3,b=new p.Cartesian3;function M(t,e,i){var r=t.transformPositionToScaledSpace(e,y),t=p.Cartesian3.magnitudeSquared(r),e=Math.sqrt(t),r=p.Cartesian3.divideByScalar(r,e,b),t=Math.max(1,t),e=1/(e=Math.max(1,e));return 1/(p.Cartesian3.dot(r,i)*e-p.Cartesian3.magnitude(p.Cartesian3.cross(r,i,r))*(Math.sqrt(t-1)*e))}function g(t,e,i){if(!(e<=0||e===1/0||e!=e))return p.Cartesian3.multiplyByScalar(t,e,i)}var T=new p.Cartesian3;function P(t,e){return p.Cartesian3.equals(e,p.Cartesian3.ZERO)?e:(t.transformPositionToScaledSpace(e,T),p.Cartesian3.normalize(T,T))}var z=Object.freeze({NONE:0,BITS12:1}),E=new p.Cartesian3,v=new p.Cartesian3,N=new p.Cartesian2,I=new l.Matrix4,B=new l.Matrix4,_=Math.pow(2,12);function w(t,e,i,r,a,n){var o,s,m,c,u,d=z.NONE;h.defined(t)&&h.defined(e)&&h.defined(i)&&h.defined(r)&&(c=t.minimum,s=t.maximum,u=p.Cartesian3.subtract(s,c,v),m=i-e,d=Math.max(p.Cartesian3.maximumComponent(u),m)<_-1?z.BITS12:z.NONE,o=t.center,s=l.Matrix4.inverseTransformation(r,new l.Matrix4),m=p.Cartesian3.negate(c,E),l.Matrix4.multiply(l.Matrix4.fromTranslation(m,I),s,s),(m=E).x=1/u.x,m.y=1/u.y,m.z=1/u.z,l.Matrix4.multiply(l.Matrix4.fromScale(m,I),s,s),m=l.Matrix4.clone(r),l.Matrix4.setTranslation(m,p.Cartesian3.ZERO,m),r=l.Matrix4.clone(r,new l.Matrix4),c=l.Matrix4.fromTranslation(c,I),u=l.Matrix4.fromScale(u,B),u=l.Matrix4.multiply(c,u,I),l.Matrix4.multiply(r,u,r),l.Matrix4.multiply(m,u,m)),this.quantization=d,this.minimumHeight=e,this.maximumHeight=i,this.center=o,this.toScaledENU=s,this.fromScaledENU=r,this.matrix=m,this.hasVertexNormals=a,this.hasWebMercatorT=h.defaultValue(n,!1)}w.prototype.encode=function(t,e,i,r,a,n,o){var s,m,c=r.x,u=r.y;return this.quantization===z.BITS12?((i=l.Matrix4.multiplyByPoint(this.toScaledENU,i,E)).x=f.CesiumMath.clamp(i.x,0,1),i.y=f.CesiumMath.clamp(i.y,0,1),i.z=f.CesiumMath.clamp(i.z,0,1),s=this.maximumHeight-this.minimumHeight,m=f.CesiumMath.clamp((a-this.minimumHeight)/s,0,1),p.Cartesian2.fromElements(i.x,i.y,N),r=d.AttributeCompression.compressTextureCoordinates(N),p.Cartesian2.fromElements(i.z,m,N),s=d.AttributeCompression.compressTextureCoordinates(N),p.Cartesian2.fromElements(c,u,N),m=d.AttributeCompression.compressTextureCoordinates(N),t[e++]=r,t[e++]=s,t[e++]=m,this.hasWebMercatorT&&(p.Cartesian2.fromElements(o,0,N),m=d.AttributeCompression.compressTextureCoordinates(N),t[e++]=m)):(p.Cartesian3.subtract(i,this.center,E),t[e++]=E.x,t[e++]=E.y,t[e++]=E.z,t[e++]=a,t[e++]=c,t[e++]=u,this.hasWebMercatorT&&(t[e++]=o)),this.hasVertexNormals&&(t[e++]=d.AttributeCompression.octPackFloat(n)),e},w.prototype.decodePosition=function(t,e,i){if(h.defined(i)||(i=new p.Cartesian3),e*=this.getStride(),this.quantization!==z.BITS12)return i.x=t[e],i.y=t[e+1],i.z=t[e+2],p.Cartesian3.add(i,this.center,i);var r=d.AttributeCompression.decompressTextureCoordinates(t[e],N);i.x=r.x,i.y=r.y;e=d.AttributeCompression.decompressTextureCoordinates(t[e+1],N);return i.z=e.x,l.Matrix4.multiplyByPoint(this.fromScaledENU,i,i)},w.prototype.decodeTextureCoordinates=function(t,e,i){return h.defined(i)||(i=new p.Cartesian2),e*=this.getStride(),this.quantization===z.BITS12?d.AttributeCompression.decompressTextureCoordinates(t[e+2],i):p.Cartesian2.fromElements(t[e+4],t[e+5],i)},w.prototype.decodeHeight=function(t,e){return e*=this.getStride(),this.quantization!==z.BITS12?t[e+3]:d.AttributeCompression.decompressTextureCoordinates(t[e+1],N).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight},w.prototype.decodeWebMercatorT=function(t,e){return e*=this.getStride(),this.quantization===z.BITS12?d.AttributeCompression.decompressTextureCoordinates(t[e+3],N).x:t[e+6]},w.prototype.getOctEncodedNormal=function(t,e,i){t=t[e=(e+1)*this.getStride()-1]/256,e=Math.floor(t),t=256*(t-e);return p.Cartesian2.fromElements(e,t,i)},w.prototype.getStride=function(){var t=this.quantization===z.BITS12?3:6;return this.hasWebMercatorT&&++t,this.hasVertexNormals&&++t,t};var A={position3DAndHeight:0,textureCoordAndEncodedNormals:1},q={compressed0:0,compressed1:1};w.prototype.getAttributes=function(t){var e,i=o.ComponentDatatype.FLOAT,r=o.ComponentDatatype.getSizeInBytes(i);if(this.quantization===z.NONE){var a=2;return this.hasWebMercatorT&&++a,this.hasVertexNormals&&++a,[{index:A.position3DAndHeight,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:4,offsetInBytes:0,strideInBytes:e=(4+a)*r},{index:A.textureCoordAndEncodedNormals,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:a,offsetInBytes:4*r,strideInBytes:e}]}var n=3,a=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++n,this.hasWebMercatorT&&this.hasVertexNormals?(++a,[{index:q.compressed0,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:n,offsetInBytes:0,strideInBytes:e=(n+1)*r},{index:q.compressed1,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:1,offsetInBytes:n*r,strideInBytes:e}]):[{index:q.compressed0,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:n}]},w.prototype.getAttributeLocations=function(){return this.quantization===z.NONE?A:q},w.clone=function(t,e){return(e=!h.defined(e)?new w:e).quantization=t.quantization,e.minimumHeight=t.minimumHeight,e.maximumHeight=t.maximumHeight,e.center=p.Cartesian3.clone(t.center),e.toScaledENU=l.Matrix4.clone(t.toScaledENU),e.fromScaledENU=l.Matrix4.clone(t.fromScaledENU),e.matrix=l.Matrix4.clone(t.matrix),e.hasVertexNormals=t.hasVertexNormals,e.hasWebMercatorT=t.hasWebMercatorT,e},t.EllipsoidalOccluder=i,t.TerrainEncoding=w}); +define(["exports","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./AttributeCompression-10c27d9c","./ComponentDatatype-1a100acd","./Math-d6182036"],function(t,l,p,e,h,d,o,f){"use strict";function i(t,e){this._ellipsoid=t,this._cameraPosition=new p.Cartesian3,this._cameraPositionInScaledSpace=new p.Cartesian3,this._distanceToLimbInScaledSpaceSquared=0,h.defined(e)&&(this.cameraPosition=e)}Object.defineProperties(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){var e=this._ellipsoid.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),i=p.Cartesian3.magnitudeSquared(e)-1;p.Cartesian3.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=i}}});var r=new p.Cartesian3;i.prototype.isPointVisible=function(t){return S(this._ellipsoid.transformPositionToScaledSpace(t,r),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},i.prototype.isScaledSpacePointVisible=function(t){return S(t,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var a=new p.Cartesian3;i.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(t,e){var i,r=this._ellipsoid,e=h.defined(e)&&e<0&&r.minimumRadius>-e?((i=a).x=this._cameraPosition.x/(r.radii.x+e),i.y=this._cameraPosition.y/(r.radii.y+e),i.z=this._cameraPosition.z/(r.radii.z+e),i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared);return S(t,i,e)},i.prototype.computeHorizonCullingPoint=function(t,e,i){return u(this._ellipsoid,t,e,i)};var s=p.Ellipsoid.clone(p.Ellipsoid.UNIT_SPHERE);i.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(t,e,i,r){return u(c(this._ellipsoid,i,s),t,e,r)},i.prototype.computeHorizonCullingPointFromVertices=function(t,e,i,r,a){return C(this._ellipsoid,t,e,i,r,a)},i.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(t,e,i,r,a,n){return C(c(this._ellipsoid,a,s),t,e,i,r,n)};var n=[];i.prototype.computeHorizonCullingPointFromRectangle=function(t,e,i){var r=p.Rectangle.subsample(t,e,0,n),t=l.BoundingSphere.fromPoints(r);if(!(p.Cartesian3.magnitude(t.center)<.1*e.minimumRadius))return this.computeHorizonCullingPoint(t.center,r,i)};var m=new p.Cartesian3;function c(t,e,i){return h.defined(e)&&e<0&&t.minimumRadius>-e&&(e=p.Cartesian3.fromElements(t.radii.x+e,t.radii.y+e,t.radii.z+e,m),t=p.Ellipsoid.fromCartesian3(e,i)),t}function u(t,e,i,r){h.defined(r)||(r=new p.Cartesian3);for(var a=P(t,e),n=0,o=0,s=i.length;o<s;++o){var m=M(t,i[o],a);if(m<0)return;n=Math.max(n,m)}return g(a,n,r)}var x=new p.Cartesian3;function C(t,e,i,r,a,n){h.defined(n)||(n=new p.Cartesian3),r=h.defaultValue(r,3),a=h.defaultValue(a,p.Cartesian3.ZERO);for(var o=P(t,e),s=0,m=0,c=i.length;m<c;m+=r){x.x=i[m]+a.x,x.y=i[m+1]+a.y,x.z=i[m+2]+a.z;var u=M(t,x,o);if(u<0)return;s=Math.max(s,u)}return g(o,s,n)}function S(t,e,i){t=p.Cartesian3.subtract(t,e,r),e=-p.Cartesian3.dot(t,e);return!(i<0?0<e:i<e&&e*e/p.Cartesian3.magnitudeSquared(t)>i)}var y=new p.Cartesian3,b=new p.Cartesian3;function M(t,e,i){var r=t.transformPositionToScaledSpace(e,y),t=p.Cartesian3.magnitudeSquared(r),e=Math.sqrt(t),r=p.Cartesian3.divideByScalar(r,e,b),t=Math.max(1,t),e=1/(e=Math.max(1,e));return 1/(p.Cartesian3.dot(r,i)*e-p.Cartesian3.magnitude(p.Cartesian3.cross(r,i,r))*(Math.sqrt(t-1)*e))}function g(t,e,i){if(!(e<=0||e===1/0||e!=e))return p.Cartesian3.multiplyByScalar(t,e,i)}var T=new p.Cartesian3;function P(t,e){return p.Cartesian3.equals(e,p.Cartesian3.ZERO)?e:(t.transformPositionToScaledSpace(e,T),p.Cartesian3.normalize(T,T))}var z=Object.freeze({NONE:0,BITS12:1}),E=new p.Cartesian3,v=new p.Cartesian3,N=new p.Cartesian2,I=new l.Matrix4,B=new l.Matrix4,_=Math.pow(2,12);function w(t,e,i,r,a,n){var o,s,m,c,u,d=z.NONE;h.defined(t)&&h.defined(e)&&h.defined(i)&&h.defined(r)&&(c=t.minimum,s=t.maximum,u=p.Cartesian3.subtract(s,c,v),m=i-e,d=Math.max(p.Cartesian3.maximumComponent(u),m)<_-1?z.BITS12:z.NONE,o=t.center,s=l.Matrix4.inverseTransformation(r,new l.Matrix4),m=p.Cartesian3.negate(c,E),l.Matrix4.multiply(l.Matrix4.fromTranslation(m,I),s,s),(m=E).x=1/u.x,m.y=1/u.y,m.z=1/u.z,l.Matrix4.multiply(l.Matrix4.fromScale(m,I),s,s),m=l.Matrix4.clone(r),l.Matrix4.setTranslation(m,p.Cartesian3.ZERO,m),r=l.Matrix4.clone(r,new l.Matrix4),c=l.Matrix4.fromTranslation(c,I),u=l.Matrix4.fromScale(u,B),u=l.Matrix4.multiply(c,u,I),l.Matrix4.multiply(r,u,r),l.Matrix4.multiply(m,u,m)),this.quantization=d,this.minimumHeight=e,this.maximumHeight=i,this.center=o,this.toScaledENU=s,this.fromScaledENU=r,this.matrix=m,this.hasVertexNormals=a,this.hasWebMercatorT=h.defaultValue(n,!1)}w.prototype.encode=function(t,e,i,r,a,n,o){var s,m,c=r.x,u=r.y;return this.quantization===z.BITS12?((i=l.Matrix4.multiplyByPoint(this.toScaledENU,i,E)).x=f.CesiumMath.clamp(i.x,0,1),i.y=f.CesiumMath.clamp(i.y,0,1),i.z=f.CesiumMath.clamp(i.z,0,1),s=this.maximumHeight-this.minimumHeight,m=f.CesiumMath.clamp((a-this.minimumHeight)/s,0,1),p.Cartesian2.fromElements(i.x,i.y,N),r=d.AttributeCompression.compressTextureCoordinates(N),p.Cartesian2.fromElements(i.z,m,N),s=d.AttributeCompression.compressTextureCoordinates(N),p.Cartesian2.fromElements(c,u,N),m=d.AttributeCompression.compressTextureCoordinates(N),t[e++]=r,t[e++]=s,t[e++]=m,this.hasWebMercatorT&&(p.Cartesian2.fromElements(o,0,N),m=d.AttributeCompression.compressTextureCoordinates(N),t[e++]=m)):(p.Cartesian3.subtract(i,this.center,E),t[e++]=E.x,t[e++]=E.y,t[e++]=E.z,t[e++]=a,t[e++]=c,t[e++]=u,this.hasWebMercatorT&&(t[e++]=o)),this.hasVertexNormals&&(t[e++]=d.AttributeCompression.octPackFloat(n)),e},w.prototype.decodePosition=function(t,e,i){if(h.defined(i)||(i=new p.Cartesian3),e*=this.getStride(),this.quantization!==z.BITS12)return i.x=t[e],i.y=t[e+1],i.z=t[e+2],p.Cartesian3.add(i,this.center,i);var r=d.AttributeCompression.decompressTextureCoordinates(t[e],N);i.x=r.x,i.y=r.y;e=d.AttributeCompression.decompressTextureCoordinates(t[e+1],N);return i.z=e.x,l.Matrix4.multiplyByPoint(this.fromScaledENU,i,i)},w.prototype.decodeTextureCoordinates=function(t,e,i){return h.defined(i)||(i=new p.Cartesian2),e*=this.getStride(),this.quantization===z.BITS12?d.AttributeCompression.decompressTextureCoordinates(t[e+2],i):p.Cartesian2.fromElements(t[e+4],t[e+5],i)},w.prototype.decodeHeight=function(t,e){return e*=this.getStride(),this.quantization!==z.BITS12?t[e+3]:d.AttributeCompression.decompressTextureCoordinates(t[e+1],N).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight},w.prototype.decodeWebMercatorT=function(t,e){return e*=this.getStride(),this.quantization===z.BITS12?d.AttributeCompression.decompressTextureCoordinates(t[e+3],N).x:t[e+6]},w.prototype.getOctEncodedNormal=function(t,e,i){t=t[e=(e+1)*this.getStride()-1]/256,e=Math.floor(t);return p.Cartesian2.fromElements(e,256*(t-e),i)},w.prototype.getStride=function(){var t=this.quantization===z.BITS12?3:6;return this.hasWebMercatorT&&++t,this.hasVertexNormals&&++t,t};var A={position3DAndHeight:0,textureCoordAndEncodedNormals:1},q={compressed0:0,compressed1:1};w.prototype.getAttributes=function(t){var e,i=o.ComponentDatatype.FLOAT,r=o.ComponentDatatype.getSizeInBytes(i);if(this.quantization===z.NONE){var a=2;return this.hasWebMercatorT&&++a,this.hasVertexNormals&&++a,[{index:A.position3DAndHeight,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:4,offsetInBytes:0,strideInBytes:e=(4+a)*r},{index:A.textureCoordAndEncodedNormals,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:a,offsetInBytes:4*r,strideInBytes:e}]}var n=3,a=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++n,this.hasWebMercatorT&&this.hasVertexNormals?(++a,[{index:q.compressed0,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:n,offsetInBytes:0,strideInBytes:e=(n+1)*r},{index:q.compressed1,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:1,offsetInBytes:n*r,strideInBytes:e}]):[{index:q.compressed0,vertexBuffer:t,componentDatatype:i,componentsPerAttribute:n}]},w.prototype.getAttributeLocations=function(){return this.quantization===z.NONE?A:q},w.clone=function(t,e){return(e=!h.defined(e)?new w:e).quantization=t.quantization,e.minimumHeight=t.minimumHeight,e.maximumHeight=t.maximumHeight,e.center=p.Cartesian3.clone(t.center),e.toScaledENU=l.Matrix4.clone(t.toScaledENU),e.fromScaledENU=l.Matrix4.clone(t.fromScaledENU),e.matrix=l.Matrix4.clone(t.matrix),e.hasVertexNormals=t.hasVertexNormals,e.hasWebMercatorT=t.hasWebMercatorT,e},t.EllipsoidalOccluder=i,t.TerrainEncoding=w}); diff --git a/public/Cesium/Workers/Transforms-79117a7b.js b/public/Cesium/Workers/Transforms-79117a7b.js new file mode 100644 index 0000000..1e4f776 --- /dev/null +++ b/public/Cesium/Workers/Transforms-79117a7b.js @@ -0,0 +1 @@ +define(["exports","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Math-d6182036","./RuntimeError-88a32665"],function(e,A,o,R,F,L){"use strict";function t(e){this._ellipsoid=R.defaultValue(e,A.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(t.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),t.prototype.project=function(e,t){var n=this._semimajorAxis,r=e.longitude*n,n=e.latitude*n,e=e.height;return R.defined(t)?(t.x=r,t.y=n,t.z=e,t):new A.Cartesian3(r,n,e)},t.prototype.unproject=function(e,t){var n=this._oneOverSemimajorAxis,r=e.x*n,n=e.y*n,e=e.z;return R.defined(t)?(t.longitude=r,t.latitude=n,t.height=e,t):new A.Cartographic(r,n,e)};var a=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function i(e,t){this.start=R.defaultValue(e,0),this.stop=R.defaultValue(t,0)}function B(e,t,n,r,a,i,s,o,u){this[0]=R.defaultValue(e,0),this[1]=R.defaultValue(r,0),this[2]=R.defaultValue(s,0),this[3]=R.defaultValue(t,0),this[4]=R.defaultValue(a,0),this[5]=R.defaultValue(o,0),this[6]=R.defaultValue(n,0),this[7]=R.defaultValue(i,0),this[8]=R.defaultValue(u,0)}B.packedLength=9,B.pack=function(e,t,n){return n=R.defaultValue(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},B.unpack=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new B: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},B.clone=function(e,t){if(R.defined(e))return R.defined(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 B(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},B.fromArray=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new B:n)[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},B.fromColumnMajorArray=function(e,t){return B.clone(e,t)},B.fromRowMajorArray=function(e,t){return R.defined(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 B(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},B.fromQuaternion=function(e,t){var n=e.x*e.x,r=e.x*e.y,a=e.x*e.z,i=e.x*e.w,s=e.y*e.y,o=e.y*e.z,u=e.y*e.w,l=e.z*e.z,d=e.z*e.w,c=e.w*e.w,f=n-s-l+c,h=2*(r-d),p=2*(a+u),e=2*(r+d),r=s-n-l+c,d=2*(o-i),u=2*(a-u),i=2*(o+i),c=-n-s+l+c;return R.defined(t)?(t[0]=f,t[1]=e,t[2]=u,t[3]=h,t[4]=r,t[5]=i,t[6]=p,t[7]=d,t[8]=c,t):new B(f,h,p,e,r,d,u,i,c)},B.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),r=Math.cos(-e.heading),a=Math.cos(e.roll),i=Math.sin(-e.pitch),s=Math.sin(-e.heading),o=Math.sin(e.roll),u=n*r,l=-a*s+o*i*r,d=o*s+a*i*r,c=n*s,e=a*r+o*i*s,s=-o*r+a*i*s,i=-i,o=o*n,n=a*n;return R.defined(t)?(t[0]=u,t[1]=c,t[2]=i,t[3]=l,t[4]=e,t[5]=o,t[6]=d,t[7]=s,t[8]=n,t):new B(u,l,d,c,e,s,i,o,n)},B.fromScale=function(e,t){return R.defined(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 B(e.x,0,0,0,e.y,0,0,0,e.z)},B.fromUniformScale=function(e,t){return R.defined(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 B(e,0,0,0,e,0,0,0,e)},B.fromCrossProduct=function(e,t){return R.defined(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 B(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},B.fromRotationX=function(e,t){var n=Math.cos(e),e=Math.sin(e);return R.defined(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=e,t[6]=0,t[7]=-e,t[8]=n,t):new B(1,0,0,0,n,-e,0,e,n)},B.fromRotationY=function(e,t){var n=Math.cos(e),e=Math.sin(e);return R.defined(t)?(t[0]=n,t[1]=0,t[2]=-e,t[3]=0,t[4]=1,t[5]=0,t[6]=e,t[7]=0,t[8]=n,t):new B(n,0,e,0,1,0,-e,0,n)},B.fromRotationZ=function(e,t){var n=Math.cos(e),e=Math.sin(e);return R.defined(t)?(t[0]=n,t[1]=e,t[2]=0,t[3]=-e,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(n,-e,0,e,n,0,0,0,1)},B.toArray=function(e,t){return R.defined(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]]},B.getElementIndex=function(e,t){return 3*e+t},B.getColumn=function(e,t,n){var r=3*t,a=e[r],t=e[1+r],r=e[2+r];return n.x=a,n.y=t,n.z=r,n},B.setColumn=function(e,t,n,r){t*=3;return(r=B.clone(e,r))[t]=n.x,r[1+t]=n.y,r[2+t]=n.z,r},B.getRow=function(e,t,n){var r=e[t],a=e[t+3],t=e[t+6];return n.x=r,n.y=a,n.z=t,n},B.setRow=function(e,t,n,r){return(r=B.clone(e,r))[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var n=new A.Cartesian3;B.getScale=function(e,t){return t.x=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[0],e[1],e[2],n)),t.y=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[3],e[4],e[5],n)),t.z=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[6],e[7],e[8],n)),t};var r=new A.Cartesian3;B.getMaximumScale=function(e){return B.getScale(e,r),A.Cartesian3.maximumComponent(r)},B.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=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],o=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],u=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],l=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],t=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=s,n[4]=o,n[5]=u,n[6]=l,n[7]=d,n[8]=t,n},B.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},B.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},B.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=e[0]*r+e[3]*a+e[6]*i,t=e[1]*r+e[4]*a+e[7]*i,i=e[2]*r+e[5]*a+e[8]*i;return n.x=s,n.y=t,n.z=i,n},B.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},B.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},B.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},B.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],s=e[4],o=e[7],u=e[2],l=e[5],e=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=s,t[5]=o,t[6]=u,t[7]=l,t[8]=e,t};var s=new A.Cartesian3(1,1,1);B.getRotation=function(e,t){var n=A.Cartesian3.divideComponents(s,B.getScale(e,r),r);return t=B.multiplyByScale(e,n,t)};var c=[1,0,0],f=[2,2,1];var u=new B,l=new B;B.computeEigenDecomposition=function(e,t){for(var n=F.CesiumMath.EPSILON20,r=0,a=0,i=(t=!R.defined(t)?{}:t).unitary=B.clone(B.IDENTITY,t.unitary),s=t.diagonal=B.clone(e,t.diagonal),o=n*function(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}(s);a<10&&function(e){for(var t=0,n=0;n<3;++n){var r=e[B.getElementIndex(f[n],c[n])];t+=2*r*r}return Math.sqrt(t)}(s)>o;)!function(e,t){for(var n=F.CesiumMath.EPSILON15,r=0,a=1,i=0;i<3;++i){var s=Math.abs(e[B.getElementIndex(f[i],c[i])]);r<s&&(a=i,r=s)}var o=1,u=0,l=c[a],d=f[a];Math.abs(e[B.getElementIndex(d,l)])>n&&(u=(n=(n=(e[B.getElementIndex(d,d)]-e[B.getElementIndex(l,l)])/2/e[B.getElementIndex(d,l)])<0?-1/(-n+Math.sqrt(1+n*n)):1/(n+Math.sqrt(1+n*n)))*(o=1/Math.sqrt(1+n*n))),(t=B.clone(B.IDENTITY,t))[B.getElementIndex(l,l)]=t[B.getElementIndex(d,d)]=o,t[B.getElementIndex(d,l)]=u,t[B.getElementIndex(l,d)]=-u}(s,u),B.transpose(u,l),B.multiply(s,u,s),B.multiply(l,s,s),B.multiply(i,u,i),2<++r&&(++a,r=0);return t},B.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},B.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],s=e[7],o=e[2],u=e[5],e=e[8];return t*(i*e-u*s)+a*(u*r-n*e)+o*(n*s-i*r)},B.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],s=e[4],o=e[5],u=e[6],l=e[7],d=e[8],e=B.determinant(e);return t[0]=s*d-l*o,t[1]=l*a-r*d,t[2]=r*o-s*a,t[3]=u*o-i*d,t[4]=n*d-u*a,t[5]=i*a-n*o,t[6]=i*l-u*s,t[7]=u*r-n*l,t[8]=n*s-i*r,B.multiplyByScalar(t,1/e,t)};var d=new B;function W(e,t,n,r){this.x=R.defaultValue(e,0),this.y=R.defaultValue(t,0),this.z=R.defaultValue(n,0),this.w=R.defaultValue(r,0)}B.inverseTranspose=function(e,t){return B.inverse(B.transpose(e,d),t)},B.equals=function(e,t){return e===t||R.defined(e)&&R.defined(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]},B.equalsEpsilon=function(e,t,n){return n=R.defaultValue(n,0),e===t||R.defined(e)&&R.defined(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},B.IDENTITY=Object.freeze(new B(1,0,0,0,1,0,0,0,1)),B.ZERO=Object.freeze(new B(0,0,0,0,0,0,0,0,0)),B.COLUMN0ROW0=0,B.COLUMN0ROW1=1,B.COLUMN0ROW2=2,B.COLUMN1ROW0=3,B.COLUMN1ROW1=4,B.COLUMN1ROW2=5,B.COLUMN2ROW0=6,B.COLUMN2ROW1=7,B.COLUMN2ROW2=8,Object.defineProperties(B.prototype,{length:{get:function(){return B.packedLength}}}),B.prototype.clone=function(e){return B.clone(this,e)},B.prototype.equals=function(e){return B.equals(this,e)},B.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]},B.prototype.equalsEpsilon=function(e,t){return B.equalsEpsilon(this,e,t)},B.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},W.fromElements=function(e,t,n,r,a){return R.defined(a)?(a.x=e,a.y=t,a.z=n,a.w=r,a):new W(e,t,n,r)},W.fromColor=function(e,t){return R.defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new W(e.red,e.green,e.blue,e.alpha)},W.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new W(e.x,e.y,e.z,e.w)},W.packedLength=4,W.pack=function(e,t,n){return n=R.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},W.unpack=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new W:n).x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n},W.packArray=function(e,t){var n=e.length,r=4*n;if(R.defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new o.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var a=0;a<n;++a)W.pack(e[a],t,4*a);return t},W.unpackArray=function(e,t){var n=e.length;R.defined(t)?t.length=n/4:t=new Array(n/4);for(var r=0;r<n;r+=4){var a=r/4;t[a]=W.unpack(e,r,t[a])}return t},W.fromArray=W.unpack,W.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},W.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},W.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},W.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},W.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},W.magnitude=function(e){return Math.sqrt(W.magnitudeSquared(e))};var h=new W;W.distance=function(e,t){return W.subtract(e,t,h),W.magnitude(h)},W.distanceSquared=function(e,t){return W.subtract(e,t,h),W.magnitudeSquared(h)},W.normalize=function(e,t){var n=W.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},W.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},W.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},W.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},W.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},W.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},W.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},W.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},W.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},W.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 p=new W;W.lerp=function(e,t,n,r){return W.multiplyByScalar(t,n,p),r=W.multiplyByScalar(e,1-n,r),W.add(p,r,r)};var m=new W;W.mostOrthogonalAxis=function(e,t){e=W.normalize(e,m);return W.abs(e,e),t=e.x<=e.y?e.x<=e.z?e.x<=e.w?W.clone(W.UNIT_X,t):W.clone(W.UNIT_W,t):e.z<=e.w?W.clone(W.UNIT_Z,t):W.clone(W.UNIT_W,t):e.y<=e.z?e.y<=e.w?W.clone(W.UNIT_Y,t):W.clone(W.UNIT_W,t):e.z<=e.w?W.clone(W.UNIT_Z,t):W.clone(W.UNIT_W,t)},W.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},W.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]},W.equalsEpsilon=function(e,t,n,r){return e===t||R.defined(e)&&R.defined(t)&&F.CesiumMath.equalsEpsilon(e.x,t.x,n,r)&&F.CesiumMath.equalsEpsilon(e.y,t.y,n,r)&&F.CesiumMath.equalsEpsilon(e.z,t.z,n,r)&&F.CesiumMath.equalsEpsilon(e.w,t.w,n,r)},W.ZERO=Object.freeze(new W(0,0,0,0)),W.UNIT_X=Object.freeze(new W(1,0,0,0)),W.UNIT_Y=Object.freeze(new W(0,1,0,0)),W.UNIT_Z=Object.freeze(new W(0,0,1,0)),W.UNIT_W=Object.freeze(new W(0,0,0,1)),W.prototype.clone=function(e){return W.clone(this,e)},W.prototype.equals=function(e){return W.equals(this,e)},W.prototype.equalsEpsilon=function(e,t,n){return W.equalsEpsilon(this,e,t,n)},W.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var y=new Float32Array(1),w=new Uint8Array(y.buffer),C=new Uint32Array([287454020]),v=68===new Uint8Array(C.buffer)[0];function j(e,t,n,r,a,i,s,o,u,l,d,c,f,h,p,m){this[0]=R.defaultValue(e,0),this[1]=R.defaultValue(a,0),this[2]=R.defaultValue(u,0),this[3]=R.defaultValue(f,0),this[4]=R.defaultValue(t,0),this[5]=R.defaultValue(i,0),this[6]=R.defaultValue(l,0),this[7]=R.defaultValue(h,0),this[8]=R.defaultValue(n,0),this[9]=R.defaultValue(s,0),this[10]=R.defaultValue(d,0),this[11]=R.defaultValue(p,0),this[12]=R.defaultValue(r,0),this[13]=R.defaultValue(o,0),this[14]=R.defaultValue(c,0),this[15]=R.defaultValue(m,0)}W.packFloat=function(e,t){return R.defined(t)||(t=new W),y[0]=e,v?(t.x=w[0],t.y=w[1],t.z=w[2],t.w=w[3]):(t.x=w[3],t.y=w[2],t.z=w[1],t.w=w[0]),t},W.unpackFloat=function(e){return v?(w[0]=e.x,w[1]=e.y,w[2]=e.z,w[3]=e.w):(w[0]=e.w,w[1]=e.z,w[2]=e.y,w[3]=e.x),y[0]},j.packedLength=16,j.pack=function(e,t,n){return n=R.defaultValue(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},j.unpack=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new j: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},j.clone=function(e,t){if(R.defined(e))return R.defined(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 j(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])},j.fromArray=j.unpack,j.fromColumnMajorArray=function(e,t){return j.clone(e,t)},j.fromRowMajorArray=function(e,t){return R.defined(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 j(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])},j.fromRotationTranslation=function(e,t,n){return t=R.defaultValue(t,A.Cartesian3.ZERO),R.defined(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 j(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)},j.fromTranslationQuaternionRotationScale=function(e,t,n,r){R.defined(r)||(r=new j);var a=n.x,i=n.y,s=n.z,o=t.x*t.x,u=t.x*t.y,l=t.x*t.z,d=t.x*t.w,c=t.y*t.y,f=t.y*t.z,h=t.y*t.w,p=t.z*t.z,m=t.z*t.w,y=t.w*t.w,w=2*(u-m),n=2*(l+h),t=2*(u+m),u=c-o-p+y,m=2*(f-d),h=2*(l-h),f=2*(f+d),d=-o-c+p+y;return r[0]=(o-c-p+y)*a,r[1]=t*a,r[2]=h*a,r[3]=0,r[4]=w*i,r[5]=u*i,r[6]=f*i,r[7]=0,r[8]=n*s,r[9]=m*s,r[10]=d*s,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},j.fromTranslationRotationScale=function(e,t){return j.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},j.fromTranslation=function(e,t){return j.fromRotationTranslation(B.IDENTITY,e,t)},j.fromScale=function(e,t){return R.defined(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 j(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},j.fromUniformScale=function(e,t){return R.defined(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 j(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var g=new A.Cartesian3,x=new A.Cartesian3,E=new A.Cartesian3;j.fromCamera=function(e,t){var n=e.position,r=e.direction,a=e.up;A.Cartesian3.normalize(r,g),A.Cartesian3.normalize(A.Cartesian3.cross(g,a,x),x),A.Cartesian3.normalize(A.Cartesian3.cross(x,g,E),E);var i=x.x,s=x.y,o=x.z,u=g.x,l=g.y,d=g.z,c=E.x,f=E.y,h=E.z,p=n.x,e=n.y,r=n.z,a=i*-p+s*-e+o*-r,n=c*-p+f*-e+h*-r,r=u*p+l*e+d*r;return R.defined(t)?(t[0]=i,t[1]=c,t[2]=-u,t[3]=0,t[4]=s,t[5]=f,t[6]=-l,t[7]=0,t[8]=o,t[9]=h,t[10]=-d,t[11]=0,t[12]=a,t[13]=n,t[14]=r,t[15]=1,t):new j(i,s,o,a,c,f,h,n,-u,-l,-d,r,0,0,0,1)},j.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=1/Math.tan(.5*e),e=(r+n)/(n-r),r=2*r*n/(n-r);return a[0]=i/t,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=e,a[11]=-1,a[12]=0,a[13]=0,a[14]=r,a[15]=0,a},j.computeOrthographicOffCenter=function(e,t,n,r,a,i,s){var o=1/(t-e),u=1/(r-n),l=1/(i-a),e=-(t+e)*o,n=-(r+n)*u,a=-(i+a)*l;return u*=2,l*=-2,s[0]=o*=2,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=l,s[11]=0,s[12]=e,s[13]=n,s[14]=a,s[15]=1,s},j.computePerspectiveOffCenter=function(e,t,n,r,a,i,s){var o=2*a/(r-n),u=(t+e)/(t-e),r=(r+n)/(r-n),n=-(i+a)/(i-a),i=-2*i*a/(i-a);return s[0]=2*a/(t-e),s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=o,s[6]=0,s[7]=0,s[8]=u,s[9]=r,s[10]=n,s[11]=-1,s[12]=0,s[13]=0,s[14]=i,s[15]=0,s},j.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var s=2*a/(r-n),o=(t+e)/(t-e),r=(r+n)/(r-n),n=-2*a;return i[0]=2*a/(t-e),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=o,i[9]=r,i[10]=-1,i[11]=-1,i[12]=0,i[13]=0,i[14]=n,i[15]=0,i},j.computeViewportTransformation=function(e,t,n,r){R.defined(r)||(r=new j),e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT);var a=R.defaultValue(e.x,0),i=R.defaultValue(e.y,0),s=R.defaultValue(e.width,0),o=R.defaultValue(e.height,0);t=R.defaultValue(t,0);var u=.5*s,e=.5*o,s=.5*((n=R.defaultValue(n,1))-t),o=e,n=s,a=a+u,e=i+e,s=t+s;return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=a,r[13]=e,r[14]=s,r[15]=1,r},j.computeView=function(e,t,n,r,a){return a[0]=r.x,a[1]=n.x,a[2]=-t.x,a[3]=0,a[4]=r.y,a[5]=n.y,a[6]=-t.y,a[7]=0,a[8]=r.z,a[9]=n.z,a[10]=-t.z,a[11]=0,a[12]=-A.Cartesian3.dot(r,e),a[13]=-A.Cartesian3.dot(n,e),a[14]=A.Cartesian3.dot(t,e),a[15]=1,a},j.toArray=function(e,t){return R.defined(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]]},j.getElementIndex=function(e,t){return 4*e+t},j.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[1+r],t=e[2+r],r=e[3+r];return n.x=a,n.y=i,n.z=t,n.w=r,n},j.setColumn=function(e,t,n,r){t*=4;return(r=j.clone(e,r))[t]=n.x,r[1+t]=n.y,r[2+t]=n.z,r[3+t]=n.w,r},j.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 O=new A.Cartesian3;j.setScale=function(e,t,n){var r=j.getScale(e,O),r=A.Cartesian3.divideComponents(t,r,O);return j.multiplyByScale(e,r,n)},j.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],t=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=t,n},j.setRow=function(e,t,n,r){return(r=j.clone(e,r))[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var _=new A.Cartesian3;j.getScale=function(e,t){return t.x=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[0],e[1],e[2],_)),t.y=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[4],e[5],e[6],_)),t.z=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[8],e[9],e[10],_)),t};var S=new A.Cartesian3;j.getMaximumScale=function(e){return j.getScale(e,S),A.Cartesian3.maximumComponent(S)},j.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],s=e[3],o=e[4],u=e[5],l=e[6],d=e[7],c=e[8],f=e[9],h=e[10],p=e[11],m=e[12],y=e[13],w=e[14],C=e[15],v=t[0],g=t[1],x=t[2],E=t[3],O=t[4],_=t[5],S=t[6],b=t[7],M=t[8],A=t[9],R=t[10],T=t[11],q=t[12],z=t[13],I=t[14],P=t[15],D=a*v+u*g+f*x+y*E,U=i*v+l*g+h*x+w*E,N=s*v+d*g+p*x+C*E,V=r*O+o*_+c*S+m*b,e=a*O+u*_+f*S+y*b,t=i*O+l*_+h*S+w*b,O=s*O+d*_+p*S+C*b,_=r*M+o*A+c*R+m*T,S=a*M+u*A+f*R+y*T,b=i*M+l*A+h*R+w*T,R=s*M+d*A+p*R+C*T,T=r*q+o*z+c*I+m*P,y=a*q+u*z+f*I+y*P,w=i*q+l*z+h*I+w*P,P=s*q+d*z+p*I+C*P;return n[0]=r*v+o*g+c*x+m*E,n[1]=D,n[2]=U,n[3]=N,n[4]=V,n[5]=e,n[6]=t,n[7]=O,n[8]=_,n[9]=S,n[10]=b,n[11]=R,n[12]=T,n[13]=y,n[14]=w,n[15]=P,n},j.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},j.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},j.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],s=e[4],o=e[5],u=e[6],l=e[8],d=e[9],c=e[10],f=e[12],h=e[13],p=e[14],m=t[0],y=t[1],w=t[2],C=t[4],v=t[5],g=t[6],x=t[8],E=t[9],O=t[10],_=t[12],S=t[13],b=t[14],M=a*m+o*y+d*w,A=i*m+u*y+c*w,e=r*C+s*v+l*g,t=a*C+o*v+d*g,C=i*C+u*v+c*g,v=r*x+s*E+l*O,g=a*x+o*E+d*O,O=i*x+u*E+c*O,f=r*_+s*S+l*b+f,h=a*_+o*S+d*b+h,p=i*_+u*S+c*b+p;return n[0]=r*m+s*y+l*w,n[1]=M,n[2]=A,n[3]=0,n[4]=e,n[5]=t,n[6]=C,n[7]=0,n[8]=v,n[9]=g,n[10]=O,n[11]=0,n[12]=f,n[13]=h,n[14]=p,n[15]=1,n},j.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],s=e[4],o=e[5],u=e[6],l=e[8],d=e[9],c=e[10],f=t[0],h=t[1],p=t[2],m=t[3],y=t[4],w=t[5],C=t[6],v=t[7],g=t[8],x=a*f+o*h+d*p,E=i*f+u*h+c*p,O=r*m+s*y+l*w,t=a*m+o*y+d*w,y=i*m+u*y+c*w,w=r*C+s*v+l*g,d=a*C+o*v+d*g,g=i*C+u*v+c*g;return n[0]=r*f+s*h+l*p,n[1]=x,n[2]=E,n[3]=0,n[4]=O,n[5]=t,n[6]=y,n[7]=0,n[8]=w,n[9]=d,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},j.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=r*e[0]+a*e[4]+i*e[8]+e[12],t=r*e[1]+a*e[5]+i*e[9]+e[13],i=r*e[2]+a*e[6]+i*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]=t,n[14]=i,n[15]=e[15],n};var b=new A.Cartesian3;j.multiplyByUniformScale=function(e,t,n){return b.x=t,b.y=t,b.z=t,j.multiplyByScale(e,b,n)},j.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,t=t.z;return 1===r&&1===a&&1===t?j.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=t*e[8],n[9]=t*e[9],n[10]=t*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},j.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=t.w,o=e[0]*r+e[4]*a+e[8]*i+e[12]*s,u=e[1]*r+e[5]*a+e[9]*i+e[13]*s,t=e[2]*r+e[6]*a+e[10]*i+e[14]*s,s=e[3]*r+e[7]*a+e[11]*i+e[15]*s;return n.x=o,n.y=u,n.z=t,n.w=s,n},j.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=e[0]*r+e[4]*a+e[8]*i,t=e[1]*r+e[5]*a+e[9]*i,i=e[2]*r+e[6]*a+e[10]*i;return n.x=s,n.y=t,n.z=i,n},j.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=e[0]*r+e[4]*a+e[8]*i+e[12],t=e[1]*r+e[5]*a+e[9]*i+e[13],e=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=s,n.y=t,n.z=e,n},j.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},j.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},j.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],s=e[7],o=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]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=s,t[14]=o,t[15]=e[15],t},j.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},j.equals=function(e,t){return e===t||R.defined(e)&&R.defined(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]},j.equalsEpsilon=function(e,t,n){return n=R.defaultValue(n,0),e===t||R.defined(e)&&R.defined(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},j.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},j.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 k=new B,Y=new B,Z=new W,X=new W(0,0,0,1);j.inverse=function(e,t){var n=e[0],r=e[4],a=e[8],i=e[12],s=e[1],o=e[5],u=e[9],l=e[13],d=e[2],c=e[6],f=e[10],h=e[14],p=e[3],m=e[7],y=e[11],w=e[15],C=f*w,v=h*y,g=c*w,x=h*m,E=c*y,O=f*m,_=d*w,S=h*p,b=d*y,M=f*p,A=d*m,R=c*p,T=C*o+x*u+E*l-(v*o+g*u+O*l),q=v*s+_*u+M*l-(C*s+S*u+b*l),z=g*s+S*o+A*l-(x*s+_*o+R*l),I=O*s+b*o+R*u-(E*s+M*o+A*u),P=v*r+g*a+O*i-(C*r+x*a+E*i),D=C*n+S*a+b*i-(v*n+_*a+M*i),U=x*n+_*r+R*i-(g*n+S*r+A*i),N=E*n+M*r+A*a-(O*n+b*r+R*a),V=(C=a*l)*m+(x=i*o)*y+(E=r*u)*w-((v=i*u)*m+(g=r*l)*y+(O=a*o)*w),u=v*p+(_=n*l)*y+(M=a*s)*w-(C*p+(S=i*s)*y+(b=n*u)*w),w=g*p+S*m+(A=n*o)*w-(x*p+_*m+(R=r*s)*w),m=O*p+b*m+R*y-(E*p+M*m+A*y),y=g*f+O*h+v*c-(E*h+C*c+x*f),v=b*h+C*d+S*f-(_*f+M*h+v*d),S=_*c+R*h+x*d-(A*h+g*d+S*c),d=A*f+E*d+M*c-(b*c+R*f+O*d),i=n*T+r*q+a*z+i*I;if(Math.abs(i)<F.CesiumMath.EPSILON21){if(B.equalsEpsilon(j.getMatrix3(e,k),Y,F.CesiumMath.EPSILON7)&&W.equals(j.getRow(e,3,Z),X))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 L.RuntimeError("matrix is not invertible because its determinate is zero.")}return t[0]=T*(i=1/i),t[1]=q*i,t[2]=z*i,t[3]=I*i,t[4]=P*i,t[5]=D*i,t[6]=U*i,t[7]=N*i,t[8]=V*i,t[9]=u*i,t[10]=w*i,t[11]=m*i,t[12]=y*i,t[13]=v*i,t[14]=S*i,t[15]=d*i,t},j.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],s=e[5],o=e[6],u=e[8],l=e[9],d=e[10],c=e[12],f=e[13],h=e[14],p=-n*c-r*f-a*h,e=-i*c-s*f-o*h,h=-u*c-l*f-d*h;return t[0]=n,t[1]=i,t[2]=u,t[3]=0,t[4]=r,t[5]=s,t[6]=l,t[7]=0,t[8]=a,t[9]=o,t[10]=d,t[11]=0,t[12]=p,t[13]=e,t[14]=h,t[15]=1,t};var M=new j;function T(e,t){this.center=A.Cartesian3.clone(R.defaultValue(e,A.Cartesian3.ZERO)),this.radius=R.defaultValue(t,0)}j.inverseTranspose=function(e,t){return j.inverse(j.transpose(e,M),t)},j.IDENTITY=Object.freeze(new j(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),j.ZERO=Object.freeze(new j(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),j.COLUMN0ROW0=0,j.COLUMN0ROW1=1,j.COLUMN0ROW2=2,j.COLUMN0ROW3=3,j.COLUMN1ROW0=4,j.COLUMN1ROW1=5,j.COLUMN1ROW2=6,j.COLUMN1ROW3=7,j.COLUMN2ROW0=8,j.COLUMN2ROW1=9,j.COLUMN2ROW2=10,j.COLUMN2ROW3=11,j.COLUMN3ROW0=12,j.COLUMN3ROW1=13,j.COLUMN3ROW2=14,j.COLUMN3ROW3=15,Object.defineProperties(j.prototype,{length:{get:function(){return j.packedLength}}}),j.prototype.clone=function(e){return j.clone(this,e)},j.prototype.equals=function(e){return j.equals(this,e)},j.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]},j.prototype.equalsEpsilon=function(e,t){return j.equalsEpsilon(this,e,t)},j.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"};var q=new A.Cartesian3,z=new A.Cartesian3,I=new A.Cartesian3,P=new A.Cartesian3,D=new A.Cartesian3,U=new A.Cartesian3,N=new A.Cartesian3,V=new A.Cartesian3,H=new A.Cartesian3,J=new A.Cartesian3,G=new A.Cartesian3,Q=new A.Cartesian3,K=4/3*F.CesiumMath.PI;T.fromPoints=function(e,t){if(R.defined(t)||(t=new T),!R.defined(e)||0===e.length)return t.center=A.Cartesian3.clone(A.Cartesian3.ZERO,t.center),t.radius=0,t;for(var n=A.Cartesian3.clone(e[0],N),r=A.Cartesian3.clone(n,q),a=A.Cartesian3.clone(n,z),i=A.Cartesian3.clone(n,I),s=A.Cartesian3.clone(n,P),o=A.Cartesian3.clone(n,D),u=A.Cartesian3.clone(n,U),l=e.length,d=1;d<l;d++){A.Cartesian3.clone(e[d],n);var c=n.x,f=n.y,h=n.z;c<r.x&&A.Cartesian3.clone(n,r),c>s.x&&A.Cartesian3.clone(n,s),f<a.y&&A.Cartesian3.clone(n,a),f>o.y&&A.Cartesian3.clone(n,o),h<i.z&&A.Cartesian3.clone(n,i),h>u.z&&A.Cartesian3.clone(n,u)}var p=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(s,r,V)),m=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(o,a,V)),y=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(u,i,V)),w=r,C=s,p=p;p<m&&(p=m,w=a,C=o),p<y&&(p=y,w=i,C=u);var v=H;v.x=.5*(w.x+C.x),v.y=.5*(w.y+C.y),v.z=.5*(w.z+C.z);var g=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(C,v,V)),x=Math.sqrt(g),w=J;w.x=r.x,w.y=a.y,w.z=i.z;C=G;C.x=s.x,C.y=o.y,C.z=u.z;var E=A.Cartesian3.midpoint(w,C,Q),O=0;for(d=0;d<l;d++){A.Cartesian3.clone(e[d],n);var _=A.Cartesian3.magnitude(A.Cartesian3.subtract(n,E,V));O<_&&(O=_);var S=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(n,v,V));g<S&&(g=(x=.5*(x+(_=Math.sqrt(S))))*x,v.x=(x*v.x+(S=_-x)*n.x)/_,v.y=(x*v.y+S*n.y)/_,v.z=(x*v.z+S*n.z)/_)}return x<O?(A.Cartesian3.clone(v,t.center),t.radius=x):(A.Cartesian3.clone(E,t.center),t.radius=O),t};var $=new t,ee=new A.Cartesian3,te=new A.Cartesian3,ne=new A.Cartographic,re=new A.Cartographic;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(e,t,n,r,a){if(R.defined(a)||(a=new T),!R.defined(e))return a.center=A.Cartesian3.clone(A.Cartesian3.ZERO,a.center),a.radius=0,a;t=R.defaultValue(t,$),A.Rectangle.southwest(e,ne),ne.height=n,A.Rectangle.northeast(e,re),re.height=r;var i=t.project(ne,ee),n=t.project(re,te),e=n.x-i.x,r=n.y-i.y,t=n.z-i.z;a.radius=.5*Math.sqrt(e*e+r*r+t*t);n=a.center;return n.x=i.x+.5*e,n.y=i.y+.5*r,n.z=i.z+.5*t,a};var ae=[];T.fromRectangle3D=function(e,t,n,r){if(t=R.defaultValue(t,A.Ellipsoid.WGS84),n=R.defaultValue(n,0),R.defined(r)||(r=new T),!R.defined(e))return r.center=A.Cartesian3.clone(A.Cartesian3.ZERO,r.center),r.radius=0,r;n=A.Rectangle.subsample(e,t,n,ae);return T.fromPoints(n,r)},T.fromVertices=function(e,t,n,r){if(R.defined(r)||(r=new T),!R.defined(e)||0===e.length)return r.center=A.Cartesian3.clone(A.Cartesian3.ZERO,r.center),r.radius=0,r;t=R.defaultValue(t,A.Cartesian3.ZERO),n=R.defaultValue(n,3);var a=N;a.x=e[0]+t.x,a.y=e[1]+t.y,a.z=e[2]+t.z;for(var i=A.Cartesian3.clone(a,q),s=A.Cartesian3.clone(a,z),o=A.Cartesian3.clone(a,I),u=A.Cartesian3.clone(a,P),l=A.Cartesian3.clone(a,D),d=A.Cartesian3.clone(a,U),c=e.length,f=0;f<c;f+=n){var h=e[f]+t.x,p=e[f+1]+t.y,m=e[f+2]+t.z;a.x=h,a.y=p,a.z=m,h<i.x&&A.Cartesian3.clone(a,i),h>u.x&&A.Cartesian3.clone(a,u),p<s.y&&A.Cartesian3.clone(a,s),p>l.y&&A.Cartesian3.clone(a,l),m<o.z&&A.Cartesian3.clone(a,o),m>d.z&&A.Cartesian3.clone(a,d)}var y=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(u,i,V)),w=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(l,s,V)),C=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(d,o,V)),v=i,g=u,y=y;y<w&&(y=w,v=s,g=l),y<C&&(y=C,v=o,g=d);var x=H;x.x=.5*(v.x+g.x),x.y=.5*(v.y+g.y),x.z=.5*(v.z+g.z);var E=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(g,x,V)),O=Math.sqrt(E),v=J;v.x=i.x,v.y=s.y,v.z=o.z;g=G;g.x=u.x,g.y=l.y,g.z=d.z;var _=A.Cartesian3.midpoint(v,g,Q),S=0;for(f=0;f<c;f+=n){a.x=e[f]+t.x,a.y=e[f+1]+t.y,a.z=e[f+2]+t.z;var b=A.Cartesian3.magnitude(A.Cartesian3.subtract(a,_,V));S<b&&(S=b);var M=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(a,x,V));E<M&&(E=(O=.5*(O+(b=Math.sqrt(M))))*O,x.x=(O*x.x+(M=b-O)*a.x)/b,x.y=(O*x.y+M*a.y)/b,x.z=(O*x.z+M*a.z)/b)}return O<S?(A.Cartesian3.clone(x,r.center),r.radius=O):(A.Cartesian3.clone(_,r.center),r.radius=S),r},T.fromEncodedCartesianVertices=function(e,t,n){if(R.defined(n)||(n=new T),!R.defined(e)||!R.defined(t)||e.length!==t.length||0===e.length)return n.center=A.Cartesian3.clone(A.Cartesian3.ZERO,n.center),n.radius=0,n;var r=N;r.x=e[0]+t[0],r.y=e[1]+t[1],r.z=e[2]+t[2];for(var a=A.Cartesian3.clone(r,q),i=A.Cartesian3.clone(r,z),s=A.Cartesian3.clone(r,I),o=A.Cartesian3.clone(r,P),u=A.Cartesian3.clone(r,D),l=A.Cartesian3.clone(r,U),d=e.length,c=0;c<d;c+=3){var f=e[c]+t[c],h=e[c+1]+t[c+1],p=e[c+2]+t[c+2];r.x=f,r.y=h,r.z=p,f<a.x&&A.Cartesian3.clone(r,a),f>o.x&&A.Cartesian3.clone(r,o),h<i.y&&A.Cartesian3.clone(r,i),h>u.y&&A.Cartesian3.clone(r,u),p<s.z&&A.Cartesian3.clone(r,s),p>l.z&&A.Cartesian3.clone(r,l)}var m=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(o,a,V)),y=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(u,i,V)),w=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(l,s,V)),C=a,v=o,m=m;m<y&&(m=y,C=i,v=u),m<w&&(m=w,C=s,v=l);var g=H;g.x=.5*(C.x+v.x),g.y=.5*(C.y+v.y),g.z=.5*(C.z+v.z);var x=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(v,g,V)),E=Math.sqrt(x),C=J;C.x=a.x,C.y=i.y,C.z=s.z;v=G;v.x=o.x,v.y=u.y,v.z=l.z;var O=A.Cartesian3.midpoint(C,v,Q),_=0;for(c=0;c<d;c+=3){r.x=e[c]+t[c],r.y=e[c+1]+t[c+1],r.z=e[c+2]+t[c+2];var S=A.Cartesian3.magnitude(A.Cartesian3.subtract(r,O,V));_<S&&(_=S);var b=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(r,g,V));x<b&&(x=(E=.5*(E+(S=Math.sqrt(b))))*E,g.x=(E*g.x+(b=S-E)*r.x)/S,g.y=(E*g.y+b*r.y)/S,g.z=(E*g.z+b*r.z)/S)}return E<_?(A.Cartesian3.clone(g,n.center),n.radius=E):(A.Cartesian3.clone(O,n.center),n.radius=_),n},T.fromCornerPoints=function(e,t,n){R.defined(n)||(n=new T);e=A.Cartesian3.midpoint(e,t,n.center);return n.radius=A.Cartesian3.distance(e,t),n},T.fromEllipsoid=function(e,t){return R.defined(t)||(t=new T),A.Cartesian3.clone(A.Cartesian3.ZERO,t.center),t.radius=e.maximumRadius,t};var ie=new A.Cartesian3;T.fromBoundingSpheres=function(e,t){if(R.defined(t)||(t=new T),!R.defined(e)||0===e.length)return t.center=A.Cartesian3.clone(A.Cartesian3.ZERO,t.center),t.radius=0,t;var n=e.length;if(1===n)return T.clone(e[0],t);if(2===n)return T.union(e[0],e[1],t);for(var r=[],a=0;a<n;a++)r.push(e[a].center);var i=(t=T.fromPoints(r,t)).center,s=t.radius;for(a=0;a<n;a++)var o=e[a],s=Math.max(s,A.Cartesian3.distance(i,o.center,ie)+o.radius);return t.radius=s,t};var se=new A.Cartesian3,oe=new A.Cartesian3,ue=new A.Cartesian3;T.fromOrientedBoundingBox=function(e,t){R.defined(t)||(t=new T);var n=e.halfAxes,r=B.getColumn(n,0,se),a=B.getColumn(n,1,oe),n=B.getColumn(n,2,ue);return A.Cartesian3.add(r,a,r),A.Cartesian3.add(r,n,r),t.center=A.Cartesian3.clone(e.center,t.center),t.radius=A.Cartesian3.magnitude(r),t},T.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.center=A.Cartesian3.clone(e.center,t.center),t.radius=e.radius,t):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(e,t,n){n=R.defaultValue(n,0);var r=e.center;return t[n++]=r.x,t[n++]=r.y,t[n++]=r.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=R.defaultValue(t,0);var r=(n=!R.defined(n)?new T:n).center;return r.x=e[t++],r.y=e[t++],r.z=e[t++],n.radius=e[t],n};var le=new A.Cartesian3,de=new A.Cartesian3;T.union=function(e,t,n){R.defined(n)||(n=new T);var r=e.center,a=e.radius,i=t.center,s=t.radius,o=A.Cartesian3.subtract(i,r,le),i=A.Cartesian3.magnitude(o);if(i+s<=a)return e.clone(n),n;if(i+a<=s)return t.clone(n),n;s=.5*(a+i+s),i=A.Cartesian3.multiplyByScalar(o,(s-a)/i,de);return A.Cartesian3.add(i,r,i),A.Cartesian3.clone(i,n.center),n.radius=s,n};var ce=new A.Cartesian3;T.expand=function(e,t,n){n=T.clone(e,n);t=A.Cartesian3.magnitude(A.Cartesian3.subtract(t,n.center,ce));return t>n.radius&&(n.radius=t),n},T.intersectPlane=function(e,t){var n=e.center,r=e.radius,e=t.normal,t=A.Cartesian3.dot(e,n)+t.distance;return t<-r?a.OUTSIDE:t<r?a.INTERSECTING:a.INSIDE},T.transform=function(e,t,n){return(n=!R.defined(n)?new T:n).center=j.multiplyByPoint(t,e.center,n.center),n.radius=j.getMaximumScale(t)*e.radius,n};var fe=new A.Cartesian3;T.distanceSquaredTo=function(e,t){t=A.Cartesian3.subtract(e.center,t,fe);return A.Cartesian3.magnitudeSquared(t)-e.radius*e.radius},T.transformWithoutScale=function(e,t,n){return(n=!R.defined(n)?new T:n).center=j.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var he=new A.Cartesian3;T.computePlaneDistances=function(e,t,n,r){R.defined(r)||(r=new i);t=A.Cartesian3.subtract(e.center,t,he),t=A.Cartesian3.dot(n,t);return r.start=t-e.radius,r.stop=t+e.radius,r};for(var pe=new A.Cartesian3,me=new A.Cartesian3,ye=new A.Cartesian3,we=new A.Cartesian3,Ce=new A.Cartesian3,ve=new A.Cartographic,ge=new Array(8),xe=0;xe<8;++xe)ge[xe]=new A.Cartesian3;var Ee,Oe=new t;T.projectTo2D=function(e,t,n){var r=(t=R.defaultValue(t,Oe)).ellipsoid,a=e.center,i=e.radius,s=A.Cartesian3.equals(a,A.Cartesian3.ZERO)?A.Cartesian3.clone(A.Cartesian3.UNIT_X,pe):r.geodeticSurfaceNormal(a,pe),o=A.Cartesian3.cross(A.Cartesian3.UNIT_Z,s,me);A.Cartesian3.normalize(o,o);var u=A.Cartesian3.cross(s,o,ye);A.Cartesian3.normalize(u,u),A.Cartesian3.multiplyByScalar(s,i,s),A.Cartesian3.multiplyByScalar(u,i,u),A.Cartesian3.multiplyByScalar(o,i,o);var l=A.Cartesian3.negate(u,Ce),e=A.Cartesian3.negate(o,we),d=ge,i=d[0];A.Cartesian3.add(s,u,i),A.Cartesian3.add(i,o,i),i=d[1],A.Cartesian3.add(s,u,i),A.Cartesian3.add(i,e,i),i=d[2],A.Cartesian3.add(s,l,i),A.Cartesian3.add(i,e,i),i=d[3],A.Cartesian3.add(s,l,i),A.Cartesian3.add(i,o,i),A.Cartesian3.negate(s,s),i=d[4],A.Cartesian3.add(s,u,i),A.Cartesian3.add(i,o,i),i=d[5],A.Cartesian3.add(s,u,i),A.Cartesian3.add(i,e,i),i=d[6],A.Cartesian3.add(s,l,i),A.Cartesian3.add(i,e,i),i=d[7],A.Cartesian3.add(s,l,i),A.Cartesian3.add(i,o,i);for(var c=d.length,f=0;f<c;++f){var h=d[f];A.Cartesian3.add(a,h,h);var p=r.cartesianToCartographic(h,ve);t.project(p,h)}l=(a=(n=T.fromPoints(d,n)).center).x,o=a.y,i=a.z;return a.x=i,a.y=l,a.z=o,n},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&A.Cartesian3.equals(e.center,t.center)&&e.radius===t.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T.prototype.volume=function(){var e=this.radius;return K*e*e*e};var _e,Se,be,Me,Ae,Re,Te,qe,ze,Ie,Pe,De,Ue,Ne,Ve,Fe,Le,Be={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},We={};function je(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function ke(){var e;return R.defined(Se)||(Se=!1,He()||null!==(e=/ Chrome\/([\.0-9]+)/.exec(_e.userAgent))&&(Se=!0,be=je(e[1]))),Se}function Ye(){var e;return R.defined(Me)||(Me=!1,ke()||He()||!/ Safari\/[\.0-9]+/.test(_e.userAgent)||null!==(e=/ Version\/([\.0-9]+)/.exec(_e.userAgent))&&(Me=!0,Ae=je(e[1]))),Me}function Ze(){var e;return R.defined(Re)||(Re=!1,null!==(e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_e.userAgent))&&(Re=!0,(Te=je(e[1])).isNightly=!!e[2])),Re}function Xe(){var e;return R.defined(qe)||(qe=!1,"Microsoft Internet Explorer"===_e.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_e.userAgent))&&(qe=!0,ze=je(e[1])):"Netscape"===_e.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_e.userAgent))&&(qe=!0,ze=je(e[1]))),qe}function He(){var e;return R.defined(Ie)||(Ie=!1,null!==(e=/ Edge\/([\.0-9]+)/.exec(_e.userAgent))&&(Ie=!0,Pe=je(e[1]))),Ie}function Je(){var e;return R.defined(De)||(De=!1,null!==(e=/Firefox\/([\.0-9]+)/.exec(_e.userAgent))&&(De=!0,Ue=je(e[1]))),De}function Ge(){var e;return R.defined(Le)||((e=document.createElement("canvas")).setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;"),e=e.style.imageRendering,(Le=R.defined(e)&&""!==e)&&(Fe=e)),Le}function Qe(){return Qe._result}Object.defineProperties(We,{element:{get:function(){if(We.supportsFullscreen())return document[Be.fullscreenElement]}},changeEventName:{get:function(){if(We.supportsFullscreen())return Be.fullscreenchange}},errorEventName:{get:function(){if(We.supportsFullscreen())return Be.fullscreenerror}},enabled:{get:function(){if(We.supportsFullscreen())return document[Be.fullscreenEnabled]}},fullscreen:{get:function(){if(We.supportsFullscreen())return null!==We.element}}}),We.supportsFullscreen=function(){if(R.defined(Ee))return Ee;Ee=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return Be.requestFullscreen="requestFullscreen",Be.exitFullscreen="exitFullscreen",Be.fullscreenEnabled="fullscreenEnabled",Be.fullscreenElement="fullscreenElement",Be.fullscreenchange="fullscreenchange",Be.fullscreenerror="fullscreenerror",Ee=!0;for(var t=["webkit","moz","o","ms","khtml"],n=0,r=t.length;n<r;++n){var a,i=t[n];"function"!=typeof e[a=i+"RequestFullscreen"]&&"function"!=typeof e[a=i+"RequestFullScreen"]||(Be.requestFullscreen=a,Ee=!0),a=i+"ExitFullscreen","function"==typeof document[a]?Be.exitFullscreen=a:(a=i+"CancelFullScreen","function"==typeof document[a]&&(Be.exitFullscreen=a)),a=i+"FullscreenEnabled",void 0!==document[a]?Be.fullscreenEnabled=a:(a=i+"FullScreenEnabled",void 0!==document[a]&&(Be.fullscreenEnabled=a)),a=i+"FullscreenElement",void 0!==document[a]?Be.fullscreenElement=a:(a=i+"FullScreenElement",void 0!==document[a]&&(Be.fullscreenElement=a)),a=i+"fullscreenchange",void 0!==document["on"+a]&&(Be.fullscreenchange=a="ms"===i?"MSFullscreenChange":a),a=i+"fullscreenerror",void 0!==document["on"+a]&&(Be.fullscreenerror=a="ms"===i?"MSFullscreenError":a)}return Ee},We.requestFullscreen=function(e,t){We.supportsFullscreen()&&e[Be.requestFullscreen]({vrDisplay:t})},We.exitFullscreen=function(){We.supportsFullscreen()&&document[Be.exitFullscreen]()},We._names=Be,_e="undefined"!=typeof navigator?navigator:{},Qe._promise=void 0,Qe._result=void 0,Qe.initialize=function(){if(R.defined(Qe._promise))return Qe._promise;var e=R.when.defer();if(Qe._promise=e.promise,He())return Qe._result=!1,e.resolve(Qe._result),e.promise;var t=new Image;return t.onload=function(){Qe._result=0<t.width&&0<t.height,e.resolve(Qe._result)},t.onerror=function(){Qe._result=!1,e.resolve(Qe._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},Object.defineProperties(Qe,{initialized:{get:function(){return R.defined(Qe._result)}}});C=[];"undefined"!=typeof ArrayBuffer&&(C.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&C.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&C.push(Uint8ClampedArray));var Ke={isChrome:ke,chromeVersion:function(){return ke()&&be},isSafari:Ye,safariVersion:function(){return Ye()&&Ae},isWebkit:Ze,webkitVersion:function(){return Ze()&&Te},isInternetExplorer:Xe,internetExplorerVersion:function(){return Xe()&&ze},isEdge:He,edgeVersion:function(){return He()&&Pe},isFirefox:Je,firefoxVersion:function(){return Je()&&Ue},isWindows:function(){return Ne=!R.defined(Ne)?/Windows/i.test(_e.appVersion):Ne},hardwareConcurrency:R.defaultValue(_e.hardwareConcurrency,3),supportsPointerEvents:function(){return Ve=!R.defined(Ve)?!Je()&&"undefined"!=typeof PointerEvent&&(!R.defined(_e.pointerEnabled)||_e.pointerEnabled):Ve},supportsImageRenderingPixelated:Ge,supportsWebP:Qe,imageRenderingValue:function(){return Ge()?Fe:void 0},typedArrayTypes:C};function $e(e,t,n,r){this.x=R.defaultValue(e,0),this.y=R.defaultValue(t,0),this.z=R.defaultValue(n,0),this.w=R.defaultValue(r,0)}Ke.supportsFullscreen=function(){return We.supportsFullscreen()},Ke.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},Ke.supportsWebWorkers=function(){return"undefined"!=typeof Worker},Ke.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!Ke.isEdge()};var et=new A.Cartesian3;$e.fromAxisAngle=function(e,t,n){var r=t/2,a=Math.sin(r),t=(et=A.Cartesian3.normalize(e,et)).x*a,e=et.y*a,a=et.z*a,r=Math.cos(r);return R.defined(n)?(n.x=t,n.y=e,n.z=a,n.w=r,n):new $e(t,e,a,r)};var tt=[1,2,0],nt=new Array(3);$e.fromRotationMatrix=function(e,t){var n,r,a,i,s=e[B.COLUMN0ROW0],o=e[B.COLUMN1ROW1],u=e[B.COLUMN2ROW2],l=s+o+u,d=0<l?(a=.5*(i=Math.sqrt(l+1)),n=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*(i=.5/i),r=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*i,(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*i):(o=tt[s=tt[u=s<u&&o<u?2:s<o?1:0]],i=Math.sqrt(e[B.getElementIndex(u,u)]-e[B.getElementIndex(s,s)]-e[B.getElementIndex(o,o)]+1),(d=nt)[u]=.5*i,i=.5/i,a=(e[B.getElementIndex(o,s)]-e[B.getElementIndex(s,o)])*i,d[s]=(e[B.getElementIndex(s,u)]+e[B.getElementIndex(u,s)])*i,d[o]=(e[B.getElementIndex(o,u)]+e[B.getElementIndex(u,o)])*i,n=-d[0],r=-d[1],-d[2]);return R.defined(t)?(t.x=n,t.y=r,t.z=d,t.w=a,t):new $e(n,r,d,a)};var rt=new $e,at=new $e,it=new $e,st=new $e;$e.fromHeadingPitchRoll=function(e,t){return st=$e.fromAxisAngle(A.Cartesian3.UNIT_X,e.roll,rt),it=$e.fromAxisAngle(A.Cartesian3.UNIT_Y,-e.pitch,t),t=$e.multiply(it,st,it),at=$e.fromAxisAngle(A.Cartesian3.UNIT_Z,-e.heading,rt),$e.multiply(at,t,t)};var ot=new A.Cartesian3,ut=new A.Cartesian3,lt=new $e,dt=new $e,ct=new $e;$e.packedLength=4,$e.pack=function(e,t,n){return n=R.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},$e.unpack=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new $e:n).x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},$e.packedInterpolationLength=3,$e.convertPackedArrayForInterpolation=function(e,t,n,r){$e.unpack(e,4*n,ct),$e.conjugate(ct,ct);for(var a=0,i=n-t+1;a<i;a++){var s=3*a;$e.unpack(e,4*(t+a),lt),$e.multiply(lt,ct,lt),lt.w<0&&$e.negate(lt,lt),$e.computeAxis(lt,ot);var o=$e.computeAngle(lt);(r=!R.defined(r)?[]:r)[s]=ot.x*o,r[1+s]=ot.y*o,r[2+s]=ot.z*o}},$e.unpackInterpolationResult=function(e,t,n,r,a){R.defined(a)||(a=new $e),A.Cartesian3.fromArray(e,0,ut);e=A.Cartesian3.magnitude(ut);return $e.unpack(t,4*r,dt),0===e?$e.clone($e.IDENTITY,lt):$e.fromAxisAngle(ut,e,lt),$e.multiply(lt,dt,a)},$e.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new $e(e.x,e.y,e.z,e.w)},$e.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},$e.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},$e.magnitude=function(e){return Math.sqrt($e.magnitudeSquared(e))},$e.normalize=function(e,t){var n=1/$e.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,n=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=n,t},$e.inverse=function(e,t){var n=$e.magnitudeSquared(e);return t=$e.conjugate(e,t),$e.multiplyByScalar(t,1/n,t)},$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.w=e.w+t.w,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.w=e.w-t.w,n},$e.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},$e.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},$e.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,s=e.w,o=t.x,u=t.y,l=t.z,d=t.w,c=s*u-r*l+a*d+i*o,e=s*l+r*u-a*o+i*d,t=s*d-r*o-a*u-i*l;return n.x=s*o+r*d+a*l-i*u,n.y=c,n.z=e,n.w=t,n},$e.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},$e.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},$e.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<F.CesiumMath.EPSILON6)return t.x=t.y=t.z=0,t;n=1/Math.sqrt(1-n*n);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},$e.computeAngle=function(e){return Math.abs(e.w-1)<F.CesiumMath.EPSILON6?0:2*Math.acos(e.w)};var ft=new $e;$e.lerp=function(e,t,n,r){return ft=$e.multiplyByScalar(t,n,ft),r=$e.multiplyByScalar(e,1-n,r),$e.add(ft,r,r)};var ht=new $e,pt=new $e,mt=new $e;$e.slerp=function(e,t,n,r){var a=$e.dot(e,t),i=t;if(a<0&&(a=-a,i=ht=$e.negate(t,ht)),1-a<F.CesiumMath.EPSILON6)return $e.lerp(e,i,n,r);a=Math.acos(a);return pt=$e.multiplyByScalar(e,Math.sin((1-n)*a),pt),mt=$e.multiplyByScalar(i,Math.sin(n*a),mt),r=$e.add(pt,mt,r),$e.multiplyByScalar(r,1/Math.sin(a),r)},$e.log=function(e,t){var n=F.CesiumMath.acosClamped(e.w),r=0;return 0!==n&&(r=n/Math.sin(n)),A.Cartesian3.multiplyByScalar(e,r,t)},$e.exp=function(e,t){var n=A.Cartesian3.magnitude(e),r=0;return 0!==n&&(r=Math.sin(n)/n),t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t.w=Math.cos(n),t};var yt=new A.Cartesian3,wt=new A.Cartesian3,Ct=new $e,vt=new $e;$e.computeInnerQuadrangle=function(e,t,n,r){var a=$e.conjugate(t,Ct);$e.multiply(a,n,vt);n=$e.log(vt,yt);$e.multiply(a,e,vt);e=$e.log(vt,wt);return A.Cartesian3.add(n,e,n),A.Cartesian3.multiplyByScalar(n,.25,n),A.Cartesian3.negate(n,n),$e.exp(n,Ct),$e.multiply(t,Ct,r)},$e.squad=function(e,t,n,r,a,i){t=$e.slerp(e,t,a,Ct),r=$e.slerp(n,r,a,vt);return $e.slerp(t,r,2*a*(1-a),i)};for(var gt=new $e,C=1.9011074535173003,xt=Ke.supportsTypedArrays()?new Float32Array(8):[],Et=Ke.supportsTypedArrays()?new Float32Array(8):[],Ot=Ke.supportsTypedArrays()?new Float32Array(8):[],_t=Ke.supportsTypedArrays()?new Float32Array(8):[],St=0;St<7;++St){var bt=St+1,Mt=2*bt+1;xt[St]=1/(bt*Mt),Et[St]=bt/Mt}function At(e,t,n){for(var r,a,i=0,s=e.length-1;i<=s;)if((a=n(e[r=~~((i+s)/2)],t))<0)i=1+r;else{if(!(0<a))return r;s=r-1}return~(s+1)}function Rt(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}function Tt(){function v(e,t,n,r){return n=n||" ",n=e.length>=t?"":Array(1+t-e.length>>>0).join(n),r?e+n:n+e}function g(e,t,n,r,a,i){var s=r-e.length;return e=0<s?n||!a?v(e,r,i,n):e.slice(0,t.length)+v("",s,"0",!0)+e.slice(t.length):e}function x(e,t,n,r,a,i,s){var o=e>>>0;return e=(n=n&&o&&{2:"0b",8:"0",16:"0x"}[t]||"")+v(o.toString(t),i||0,"0",!1),g(e,n,r,a,s)}function E(e,t,n,r,a,i){return null!=r&&(e=e.slice(0,r)),g(e,"",t,n,a,i)}var O=arguments,_=0,e=O[_++];return e.replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,function(e,t,n,r,a,i,s){var o,u,l,d,c;if("%%"==e)return"%";for(var f=!1,h="",p=!1,m=!1,y=" ",w=n.length,C=0;n&&C<w;C++)switch(n.charAt(C)){case" ":h=" ";break;case"+":h="+";break;case"-":f=!0;break;case"'":y=n.charAt(C+1);break;case"0":p=!0;break;case"#":m=!0}if((r=r?"*"==r?+O[_++]:"*"==r.charAt(0)?+O[r.slice(1,-1)]:+r:0)<0&&(r=-r,f=!0),!isFinite(r))throw new Error("sprintf: (minimum-)width must be finite");switch(i=i?"*"==i?+O[_++]:"*"==i.charAt(0)?+O[i.slice(1,-1)]:+i:-1<"fFeE".indexOf(s)?6:"d"==s?0:void 0,c=t?O[t.slice(0,-1)]:O[_++],s){case"s":return E(String(c),f,r,i,p,y);case"c":return E(String.fromCharCode(+c),f,r,i,p);case"b":return x(c,2,m,f,r,i,p);case"o":return x(c,8,m,f,r,i,p);case"x":return x(c,16,m,f,r,i,p);case"X":return x(c,16,m,f,r,i,p).toUpperCase();case"u":return x(c,10,m,f,r,i,p);case"i":case"d":return o=+c||0,c=(u=(o=Math.round(o-o%1))<0?"-":h)+v(String(Math.abs(o)),i,"0",!1),g(c,u,f,r,p);case"e":case"E":case"f":case"F":case"g":case"G":return u=(o=+c)<0?"-":h,l=["toExponential","toFixed","toPrecision"]["efg".indexOf(s.toLowerCase())],d=["toString","toUpperCase"]["eEfFgG".indexOf(s)%2],c=u+Math.abs(o)[l](i),g(c,u,f,r,p)[d]();default:return e}})}function qt(e,t,n,r,a,i,s,o){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=s,this.isLeapSecond=o}function zt(e){return e%4==0&&e%100!=0||e%400==0}function It(e,t){this.julianDate=e,this.offset=t}xt[7]=C/136,Et[7]=8*C/17,$e.fastSlerp=function(e,t,n,r){var a,i=$e.dot(e,t);0<=i?a=1:(a=-1,i=-i);for(var s=i-1,i=1-n,o=n*n,u=i*i,l=7;0<=l;--l)Ot[l]=(xt[l]*o-Et[l])*s,_t[l]=(xt[l]*u-Et[l])*s;n=a*n*(1+Ot[0]*(1+Ot[1]*(1+Ot[2]*(1+Ot[3]*(1+Ot[4]*(1+Ot[5]*(1+Ot[6]*(1+Ot[7])))))))),i*=1+_t[0]*(1+_t[1]*(1+_t[2]*(1+_t[3]*(1+_t[4]*(1+_t[5]*(1+_t[6]*(1+_t[7]))))))),i=$e.multiplyByScalar(e,i,gt);return $e.multiplyByScalar(t,n,r),$e.add(i,r,r)},$e.fastSquad=function(e,t,n,r,a,i){t=$e.fastSlerp(e,t,a,Ct),r=$e.fastSlerp(n,r,a,vt);return $e.fastSlerp(t,r,2*a*(1-a),i)},$e.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},$e.equalsEpsilon=function(e,t,n){return n=R.defaultValue(n,0),e===t||R.defined(e)&&R.defined(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},$e.ZERO=Object.freeze(new $e(0,0,0,0)),$e.IDENTITY=Object.freeze(new $e(0,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){return $e.equalsEpsilon(this,e,t)},$e.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var Pt=Object.freeze({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:2400000.5}),Dt=Object.freeze({UTC:0,TAI:1}),Ut=new qt,Nt=[31,28,31,30,31,30,31,31,30,31,30,31];function Vt(e,t){return Kt.compare(e.julianDate,t.julianDate)}var Ft=new It;function Lt(e){Ft.julianDate=e;var t=Kt.leapSeconds,n=At(t,Ft,Vt),r=t[n=(n=n<0?~n:n)>=t.length?t.length-1:n].offset;0<n&&r<Kt.secondsDifference(t[n].julianDate,e)&&(r=t[--n].offset),Kt.addSeconds(e,r,e)}function Bt(e,t){Ft.julianDate=e;var n=Kt.leapSeconds,r=At(n,Ft,Vt);if(0===(r=r<0?~r:r))return Kt.addSeconds(e,-n[0].offset,t);if(r>=n.length)return Kt.addSeconds(e,-n[r-1].offset,t);var a=Kt.secondsDifference(n[r].julianDate,e);return 0===a?Kt.addSeconds(e,-n[r].offset,t):a<=1?void 0:Kt.addSeconds(e,-n[--r].offset,t)}function Wt(e,t,n){var r=t/Pt.SECONDS_PER_DAY|0;return e+=r,(t-=Pt.SECONDS_PER_DAY*r)<0&&(e--,t+=Pt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function jt(e,t,n,r,a,i,s){var o=(t-14)/12|0,e=e+4800+o,n=(1461*e/4|0)+(367*(t-2-12*o)/12|0)-(3*((e+100)/100|0)/4|0)+n-32075;(r-=12)<0&&(r+=24);s=i+(r*Pt.SECONDS_PER_HOUR+a*Pt.SECONDS_PER_MINUTE+s*Pt.SECONDS_PER_MILLISECOND);return 43200<=s&&--n,[n,s]}var kt=/^(\d{4})$/,Yt=/^(\d{4})-(\d{2})$/,Zt=/^(\d{4})-?(\d{3})$/,Xt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Ht=/^(\d{4})-?(\d{2})-?(\d{2})$/,C=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Jt=/^(\d{2})(\.\d+)?/.source+C.source,Gt=/^(\d{2}):?(\d{2})(\.\d+)?/.source+C.source,Qt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+C.source;function Kt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=R.defaultValue(e,0),t=R.defaultValue(t,0),n=R.defaultValue(n,Dt.UTC);var r=0|e;Wt(r,t+=(e-r)*Pt.SECONDS_PER_DAY,this),n===Dt.UTC&&Lt(this)}Kt.fromGregorianDate=function(e,t){e=jt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return R.defined(t)?(Wt(e[0],e[1],t),Lt(t),t):new Kt(e[0],e[1],Dt.UTC)},Kt.fromDate=function(e,t){e=jt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return R.defined(t)?(Wt(e[0],e[1],t),Lt(t),t):new Kt(e[0],e[1],Dt.UTC)},Kt.fromIso8601=function(e,t){var n,r,a,i,s,o=(e=e.replace(",",".")).split("T"),u=1,l=1,d=0,c=0,f=0,h=0,p=o[0],e=o[1];if(null!==(o=p.match(Ht))?(a=+o[1],u=+o[2],l=+o[3]):null!==(o=p.match(Yt))?(a=+o[1],u=+o[2]):null!==(o=p.match(kt))?a=+o[1]:(null!==(o=p.match(Zt))?(a=+o[1],i=+o[2],r=zt(a)):null!==(o=p.match(Xt))&&(a=+o[1],i=7*+o[2]+(+o[3]||0)-new Date(Date.UTC(a,0,4)).getUTCDay()-3),(n=new Date(Date.UTC(a,0,1))).setUTCDate(i),u=n.getUTCMonth()+1,l=n.getUTCDate()),r=zt(a),R.defined(e)){null!==(o=e.match(Qt))?(d=+o[1],c=+o[2],f=+o[3],h=1e3*+(o[4]||0),s=5):null!==(o=e.match(Gt))?(d=+o[1],c=+o[2],f=60*+(o[3]||0),s=4):null!==(o=e.match(Jt))&&(d=+o[1],c=60*+(o[2]||0),s=3);var m=o[s],y=+o[s+1],w=+(o[s+2]||0);switch(m){case"+":d-=y,c-=w;break;case"-":d+=y,c+=w;break;case"Z":break;default:c+=new Date(Date.UTC(a,u-1,l,d,c)).getTimezoneOffset()}}m=60===f;for(m&&f--;60<=c;)c-=60,d++;for(;24<=d;)d-=24,l++;for(n=r&&2===u?29:Nt[u-1];n<l;)l-=n,12<++u&&(u-=12,a++),n=r&&2===u?29:Nt[u-1];for(;c<0;)c+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)--u<1&&(u+=12,a--),l+=n=r&&2===u?29:Nt[u-1];h=jt(a,u,l,d,c,f,h);return R.defined(t)?(Wt(h[0],h[1],t),Lt(t)):t=new Kt(h[0],h[1],Dt.UTC),m&&Kt.addSeconds(t,1,t),t},Kt.now=function(e){return Kt.fromDate(new Date,e)};var $t=new Kt(0,0,Dt.TAI);function en(e){e instanceof en?(this.scheme=e.scheme,this.authority=e.authority,this.path=e.path,this.query=e.query,this.fragment=e.fragment):e&&(e=tn.exec(e),this.scheme=e[1],this.authority=e[2],this.path=e[3],this.query=e[4],this.fragment=e[5])}Kt.toGregorianDate=function(e,t){var n=!1,r=Bt(e,$t);R.defined(r)||(Kt.addSeconds(e,-1,$t),r=Bt($t,$t),n=!0);var a=r.dayNumber,i=r.secondsOfDay;43200<=i&&(a+=1);var s=a+68569|0,o=4*s/146097|0,u=4e3*(1+(s=s-((146097*o+3)/4|0)|0))/1461001|0,e=80*(s=s-(1461*u/4|0)+31|0)/2447|0,r=s-(2447*e/80|0)|0,a=2+e-12*(s=e/11|0)|0,e=100*(o-49)+u+s|0,o=i/Pt.SECONDS_PER_HOUR|0,u=i-o*Pt.SECONDS_PER_HOUR,s=u/Pt.SECONDS_PER_MINUTE|0,i=0|(u-=s*Pt.SECONDS_PER_MINUTE),u=(u-i)/Pt.SECONDS_PER_MILLISECOND;return 23<(o+=12)&&(o-=24),n&&(i+=1),R.defined(t)?(t.year=e,t.month=a,t.day=r,t.hour=o,t.minute=s,t.second=i,t.millisecond=u,t.isLeapSecond=n,t):new qt(e,a,r,o,s,i,u,n)},Kt.toDate=function(e){var t=Kt.toGregorianDate(e,Ut),e=t.second;return t.isLeapSecond&&--e,new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,e,t.millisecond))},Kt.toIso8601=function(e,t){var n=Kt.toGregorianDate(e,Ut),r=n.year,a=n.month,i=n.day,s=n.hour,o=n.minute,e=n.second,n=n.millisecond;return 1e4===r&&1===a&&1===i&&0===s&&0===o&&0===e&&0===n&&(r=9999,a=12,i=31,s=24),R.defined(t)||0===n?R.defined(t)&&0!==t?Tt("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,a,i,s,o,e,(.01*n).toFixed(t).replace(".","").slice(0,t)):Tt("%04d-%02d-%02dT%02d:%02d:%02dZ",r,a,i,s,o,e):Tt("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,a,i,s,o,e,(.01*n).toString().replace(".",""))},Kt.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Kt(e.dayNumber,e.secondsOfDay,Dt.TAI)},Kt.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!=n?n:e.secondsOfDay-t.secondsOfDay},Kt.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},Kt.equalsEpsilon=function(e,t,n){return n=R.defaultValue(n,0),e===t||R.defined(e)&&R.defined(t)&&Math.abs(Kt.secondsDifference(e,t))<=n},Kt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Pt.SECONDS_PER_DAY},Kt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Pt.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},Kt.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/Pt.SECONDS_PER_DAY},Kt.computeTaiMinusUtc=function(e){Ft.julianDate=e;var t=Kt.leapSeconds,e=At(t,Ft,Vt);return e<0&&(e=~e,--e<0&&(e=0)),t[e].offset},Kt.addSeconds=function(e,t,n){return Wt(e.dayNumber,e.secondsOfDay+t,n)},Kt.addMinutes=function(e,t,n){t=e.secondsOfDay+t*Pt.SECONDS_PER_MINUTE;return Wt(e.dayNumber,t,n)},Kt.addHours=function(e,t,n){t=e.secondsOfDay+t*Pt.SECONDS_PER_HOUR;return Wt(e.dayNumber,t,n)},Kt.addDays=function(e,t,n){return Wt(e.dayNumber+t,e.secondsOfDay,n)},Kt.lessThan=function(e,t){return Kt.compare(e,t)<0},Kt.lessThanOrEquals=function(e,t){return Kt.compare(e,t)<=0},Kt.greaterThan=function(e,t){return 0<Kt.compare(e,t)},Kt.greaterThanOrEquals=function(e,t){return 0<=Kt.compare(e,t)},Kt.prototype.clone=function(e){return Kt.clone(this,e)},Kt.prototype.equals=function(e){return Kt.equals(this,e)},Kt.prototype.equalsEpsilon=function(e,t){return Kt.equalsEpsilon(this,e,t)},Kt.prototype.toString=function(){return Kt.toIso8601(this)},Kt.leapSeconds=[new It(new Kt(2441317,43210,Dt.TAI),10),new It(new Kt(2441499,43211,Dt.TAI),11),new It(new Kt(2441683,43212,Dt.TAI),12),new It(new Kt(2442048,43213,Dt.TAI),13),new It(new Kt(2442413,43214,Dt.TAI),14),new It(new Kt(2442778,43215,Dt.TAI),15),new It(new Kt(2443144,43216,Dt.TAI),16),new It(new Kt(2443509,43217,Dt.TAI),17),new It(new Kt(2443874,43218,Dt.TAI),18),new It(new Kt(2444239,43219,Dt.TAI),19),new It(new Kt(2444786,43220,Dt.TAI),20),new It(new Kt(2445151,43221,Dt.TAI),21),new It(new Kt(2445516,43222,Dt.TAI),22),new It(new Kt(2446247,43223,Dt.TAI),23),new It(new Kt(2447161,43224,Dt.TAI),24),new It(new Kt(2447892,43225,Dt.TAI),25),new It(new Kt(2448257,43226,Dt.TAI),26),new It(new Kt(2448804,43227,Dt.TAI),27),new It(new Kt(2449169,43228,Dt.TAI),28),new It(new Kt(2449534,43229,Dt.TAI),29),new It(new Kt(2450083,43230,Dt.TAI),30),new It(new Kt(2450630,43231,Dt.TAI),31),new It(new Kt(2451179,43232,Dt.TAI),32),new It(new Kt(2453736,43233,Dt.TAI),33),new It(new Kt(2454832,43234,Dt.TAI),34),new It(new Kt(2456109,43235,Dt.TAI),35),new It(new Kt(2457204,43236,Dt.TAI),36),new It(new Kt(2457754,43237,Dt.TAI),37)],en.prototype.scheme=null,en.prototype.authority=null,en.prototype.path="",en.prototype.query=null,en.prototype.fragment=null;var tn=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");en.prototype.getScheme=function(){return this.scheme},en.prototype.getAuthority=function(){return this.authority},en.prototype.getPath=function(){return this.path},en.prototype.getQuery=function(){return this.query},en.prototype.getFragment=function(){return this.fragment},en.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},en.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},en.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},en.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(an,on).replace(nn,sn)),this.path&&(this.path=this.path.replace(nn,sn)),this.query&&(this.query=this.query.replace(nn,sn)),this.fragment&&(this.fragment=this.fragment.replace(nn,sn))};var nn=/%[0-9a-z]{2}/gi,rn=/[a-zA-Z0-9\-\._~]/,an=/(.*@)?([^@:]*)(:.*)?/;function sn(e){var t=unescape(e);return rn.test(t)?t:e.toUpperCase()}function on(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}function un(e,t){if(null===e||"object"!=typeof e)return e;t=R.defaultValue(t,!1);var n,r,a=new e.constructor;for(n in e)e.hasOwnProperty(n)&&(r=e[n],t&&(r=un(r,t)),a[n]=r);return a}function ln(e,t,n){n=R.defaultValue(n,!1);var r,a,i,s={},o=R.defined(e),u=R.defined(t);if(o)for(r in e)e.hasOwnProperty(r)&&(a=e[r],u&&n&&"object"==typeof a&&t.hasOwnProperty(r)?(i=t[r],s[r]="object"==typeof i?ln(a,i,n):a):s[r]=a);if(u)for(r in t)t.hasOwnProperty(r)&&!s.hasOwnProperty(r)&&(i=t[r],s[r]=i);return s}function dn(e,t){var n;return"undefined"!=typeof document&&(n=document),dn._implementation(e,t,n)}en.prototype.resolve=function(e){var t=new en;return this.scheme?(t.scheme=this.scheme,t.authority=this.authority,t.path=this.path,t.query=this.query):(t.scheme=e.scheme,this.authority?(t.authority=this.authority,t.path=this.path,t.query=this.query):(t.authority=e.authority,""==this.path?(t.path=e.path,t.query=this.query||e.query):("/"==this.path.charAt(0)?t.path=this.path:e.authority&&""==e.path?t.path="/"+this.path:t.path=e.path.substring(0,e.path.lastIndexOf("/")+1)+this.path,t.removeDotSegments(),t.query=this.query))),t.fragment=this.fragment,t},en.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];for(r&&t.shift(),""==t[0]&&t.shift();t.length;)".."==(e=t.shift())?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},en.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},dn._implementation=function(e,t,n){if(!R.defined(t)){if(void 0===n)return e;t=R.defaultValue(n.baseURI,n.location.href)}t=new en(t);return new en(e).resolve(t).toString()};var cn,fn=/^blob:/i;function hn(e){return fn.test(e)}var pn=/^data:/i;function mn(e){return pn.test(e)}var yn=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),wn=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function Cn(e){e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT);var t=R.defaultValue(e.throttleByServer,!1),n=R.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=R.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=R.defaultValue(e.type,wn.OTHER),this.serverKey=void 0,this.state=yn.UNISSUED,this.deferred=void 0,this.cancelled=!1}function vn(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a,i=n[r],s=i.indexOf(": ");0<s&&(a=i.substring(0,s),s=i.substring(s+2),t[a]=s)}return t}(this.responseHeaders))}function gn(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function xn(e,t){return t-e}function En(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function On(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}Cn.prototype.cancel=function(){this.cancelled=!0},Cn.prototype.clone=function(e){return R.defined(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=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Cn(this)},vn.prototype.toString=function(){var e="Request has failed.";return R.defined(this.statusCode)&&(e+=" Status Code: "+this.statusCode),e},Object.defineProperties(gn.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),gn.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var n=this;return function(){n.removeEventListener(e,t)}},gn.prototype.removeEventListener=function(e,t){for(var n=this._listeners,r=this._scopes,a=-1,i=0;i<n.length;i++)if(n[i]===e&&r[i]===t){a=i;break}return-1!==a&&(this._insideRaiseEvent?(this._toRemove.push(a),n[a]=void 0,r[a]=void 0):(n.splice(a,1),r.splice(a,1)),!0)},gn.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;for(var e=this._listeners,t=this._scopes,n=e.length,r=0;r<n;r++){var a=e[r];R.defined(a)&&e[r].apply(t[r],arguments)}var i=this._toRemove;if(0<(n=i.length)){for(i.sort(xn),r=0;r<n;r++){var s=i[r];e.splice(s,1),t.splice(s,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(En.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){var t=this._length;if(e<t){for(var n=this._array,r=e;r<t;++r)n[r]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),En.prototype.reserve=function(e){e=R.defaultValue(e,this._length),this._array.length=e},En.prototype.heapify=function(e){e=R.defaultValue(e,0);for(var t=this._length,n=this._comparator,r=this._array,a=-1,i=!0;i;){var s=2*(e+1),o=s-1,a=o<t&&n(r[o],r[e])<0?o:e;(a=s<t&&n(r[s],r[a])<0?s:a)!==e?(On(r,a,e),e=a):i=!1}},En.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);0<=t;--t)this.heapify(t)},En.prototype.insert=function(e){var t,n=this._array,r=this._comparator,a=this._maximumLength,i=this._length++;for(i<n.length?n[i]=e:n.push(e);0!==i;){var s=Math.floor((i-1)/2);if(!(r(n[i],n[s])<0))break;On(n,i,s),i=s}return R.defined(a)&&this._length>a&&(t=n[a],this._length=a),t},En.prototype.pop=function(e){if(e=R.defaultValue(e,0),0!==this._length){var t=this._array,n=t[e];return On(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n}};var _n={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Sn=20,bn=new En({comparator:function(e,t){return e.priority-t.priority}});bn.maximumLength=Sn,bn.reserve(Sn);var Mn=[],An={},Rn="undefined"!=typeof document?new en(document.location.href):new en,Tn=new gn;function qn(){}function zn(e){R.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function In(e){var t=R.defaultValue(qn.requestsByServer[e],qn.maximumRequestsPerServer);return An[e]<t}function Pn(e){return e.state===yn.UNISSUED&&(e.state=yn.ISSUED,e.deferred=R.when.defer()),e.deferred.promise}function Dn(e){var t,n,r=Pn(e);return e.state=yn.ACTIVE,Mn.push(e),++_n.numberOfActiveRequests,++_n.numberOfActiveRequestsEver,++An[e.serverKey],e.requestFunction().then((n=e,function(e){var t;n.state!==yn.CANCELLED&&(t=n.deferred,--_n.numberOfActiveRequests,--An[n.serverKey],Tn.raiseEvent(),n.state=yn.RECEIVED,n.deferred=void 0,t.resolve(e))})).otherwise((t=e,function(e){t.state!==yn.CANCELLED&&(++_n.numberOfFailedRequests,--_n.numberOfActiveRequests,--An[t.serverKey],Tn.raiseEvent(e),t.state=yn.FAILED,t.deferred.reject(e))})),r}function Un(e){var t,n=e.state===yn.ACTIVE;e.state=yn.CANCELLED,++_n.numberOfCancelledRequests,R.defined(e.deferred)&&(t=e.deferred,e.deferred=void 0,t.reject()),n&&(--_n.numberOfActiveRequests,--An[e.serverKey],++_n.numberOfCancelledActiveRequests),R.defined(e.cancelFunction)&&e.cancelFunction()}qn.maximumRequests=50,qn.maximumRequestsPerServer=6,qn.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},qn.throttleRequests=!0,qn.debugShowStatistics=!1,qn.requestCompletedEvent=Tn,Object.defineProperties(qn,{statistics:{get:function(){return _n}},priorityHeapLength:{get:function(){return Sn},set:function(e){if(e<Sn)for(;bn.length>e;)Un(bn.pop());Sn=e,bn.maximumLength=e,bn.reserve(e)}}}),qn.update=function(){for(var e,t=0,n=Mn.length,r=0;r<n;++r)(e=Mn[r]).cancelled&&Un(e),e.state===yn.ACTIVE?0<t&&(Mn[r-t]=e):++t;Mn.length-=t;var a=bn.internalArray,i=bn.length;for(r=0;r<i;++r)zn(a[r]);bn.resort();for(var s=Math.max(qn.maximumRequests-Mn.length,0),o=0;o<s&&0<bn.length;)!(e=bn.pop()).cancelled&&(!e.throttleByServer||In(e.serverKey))?(Dn(e),++o):Un(e);qn.debugShowStatistics&&(0===_n.numberOfActiveRequests&&0<_n.lastNumberOfActiveRequests&&(0<_n.numberOfAttemptedRequests&&(console.log("Number of attempted requests: "+_n.numberOfAttemptedRequests),_n.numberOfAttemptedRequests=0),0<_n.numberOfCancelledRequests&&(console.log("Number of cancelled requests: "+_n.numberOfCancelledRequests),_n.numberOfCancelledRequests=0),0<_n.numberOfCancelledActiveRequests&&(console.log("Number of cancelled active requests: "+_n.numberOfCancelledActiveRequests),_n.numberOfCancelledActiveRequests=0),0<_n.numberOfFailedRequests&&(console.log("Number of failed requests: "+_n.numberOfFailedRequests),_n.numberOfFailedRequests=0)),_n.lastNumberOfActiveRequests=_n.numberOfActiveRequests)},qn.getServerKey=function(e){var t=new en(e).resolve(Rn);t.normalize();e=t.authority;/:/.test(e)||(e=e+":"+("https"===t.scheme?"443":"80"));t=An[e];return R.defined(t)||(An[e]=0),e},qn.request=function(e){if(mn(e.url)||hn(e.url))return Tn.raiseEvent(),e.state=yn.RECEIVED,e.requestFunction();if(++_n.numberOfAttemptedRequests,R.defined(e.serverKey)||(e.serverKey=qn.getServerKey(e.url)),!qn.throttleRequests||!e.throttleByServer||In(e.serverKey)){if(!qn.throttleRequests||!e.throttle)return Dn(e);if(!(Mn.length>=qn.maximumRequests)){zn(e);var t=bn.insert(e);if(R.defined(t)){if(t===e)return;Un(t)}return Pn(e)}}},qn.clearForSpecs=function(){for(;0<bn.length;)Un(bn.pop());for(var e=Mn.length,t=0;t<e;++t)Un(Mn[t]);Mn.length=0,An={},_n.numberOfAttemptedRequests=0,_n.numberOfActiveRequests=0,_n.numberOfCancelledRequests=0,_n.numberOfCancelledActiveRequests=0,_n.numberOfFailedRequests=0,_n.numberOfActiveRequestsEver=0,_n.lastNumberOfActiveRequests=0},qn.numberOfActiveRequestsByServer=function(e){return An[e]},qn.requestHeap=bn;var Nn={},Vn={};Nn.add=function(e,t){t=e.toLowerCase()+":"+t;R.defined(Vn[t])||(Vn[t]=!0)},Nn.remove=function(e,t){t=e.toLowerCase()+":"+t;R.defined(Vn[t])&&delete Vn[t]},Nn.contains=function(e){e=function(e){var t=new en(e);if(t.normalize(),e=t.getAuthority(),R.defined(e)){if(-1===(e=-1!==e.indexOf("@")?e.split("@")[1]:e).indexOf(":")){t=t.getScheme();if("http"===(t=!R.defined(t)?(t=window.location.protocol).substring(0,t.length-1):t))e+=":80";else{if("https"!==t)return;e+=":443"}}return e}}(e);return!(!R.defined(e)||!R.defined(Vn[e]))},Nn.clear=function(){Vn={}};var Fn,Ln=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),(e.responseType="blob")===e.responseType}catch(e){return!1}}();function Bn(e,t,n,r){var a,i=e.query;if(!R.defined(i)||0===i.length)return 1;i=-1===i.indexOf("=")?((a={})[i]=void 0,a):function(e){var t={};if(""===e)return t;for(var n=e.replace(/\+/g,"%20").split(/[&;]/),r=0,a=n.length;r<a;++r){var i=n[r].split("="),s=decodeURIComponent(i[0]),o=i[1],o=R.defined(o)?decodeURIComponent(o):"",i=t[s];"string"==typeof i?t[s]=[i,o]:Array.isArray(i)?i.push(o):t[s]=o}return t}(i),t._queryParameters=n?Yn(i,t._queryParameters,r):i,e.query=void 0}function Wn(e,t){var n=t._queryParameters,t=Object.keys(n);1!==t.length||R.defined(n[t[0]])?e.query=function(e){var t,n="";for(t in e)if(e.hasOwnProperty(t)){var r=e[t],a=encodeURIComponent(t)+"=";if(Array.isArray(r))for(var i=0,s=r.length;i<s;++i)n+=a+encodeURIComponent(r[i])+"&";else n+=a+encodeURIComponent(r)+"&"}return n=n.slice(0,-1)}(n):e.query=t[0]}function jn(e,t){return R.defined(e)?R.defined(e.clone)?e.clone():un(e):t}function kn(e){if(e.state===yn.ISSUED||e.state===yn.ACTIVE)throw new L.RuntimeError("The Resource is already being fetched.");e.state=yn.UNISSUED,e.deferred=void 0}function Yn(e,t,n){if(!n)return ln(e,t);var r,a,i,s=un(e,!0);for(r in t)t.hasOwnProperty(r)&&(a=s[r],i=t[r],R.defined(a)?(Array.isArray(a)||(a=s[r]=[a]),s[r]=a.concat(i)):s[r]=Array.isArray(i)?i.slice():i);return s}function Zn(e){"string"==typeof(e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void 0,this._templateValues=jn(e.templateValues,{}),this._queryParameters=jn(e.queryParameters,{}),this.headers=jn(e.headers,{}),this.request=R.defaultValue(e.request,new Cn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=R.defaultValue(e.retryAttempts,0),this._retryCount=0;e=new en(e.url);Bn(e,this,!0,!0),e.fragment=void 0,this._url=e.toString()}function Xn(e){var n=e.resource,r=e.flipY,a=e.preferImageBitmap,i=n.request;i.url=n.url,i.requestFunction=function(){var e=!1;n.isDataUri||n.isBlobUri||(e=n.isCrossOriginUrl);var t=R.when.defer();return Zn._Implementations.createImage(i,e,t,r,a),t.promise};e=qn.request(i);if(R.defined(e))return e.otherwise(function(t){return i.state!==yn.FAILED?R.when.reject(t):n.retryOnError(t).then(function(e){return e?(i.state=yn.UNISSUED,i.deferred=void 0,Xn({resource:n,flipY:r,preferImageBitmap:a})):R.when.reject(t)})})}Zn.createIfNeeded=function(e){return e instanceof Zn?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new Zn({url:e})},Zn.supportsImageBitmapOptions=function(){if(R.defined(Fn))return Fn;if("function"!=typeof createImageBitmap)return Fn=R.when.resolve(!1);return Fn=Zn.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg=="}).then(function(e){return createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none"})}).then(function(e){return!0}).otherwise(function(){return!1})},Object.defineProperties(Zn,{isBlobSupported:{get:function(){return Ln}}}),Object.defineProperties(Zn.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){e=new en(e);Bn(e,this,!1),e.fragment=void 0,this._url=e.toString()}},extension:{get:function(){return e=this._url,(t=new en(e)).normalize(),e=t.path,e=-1===(t=(e=-1!==(t=e.lastIndexOf("/"))?e.substr(t+1):e).lastIndexOf("."))?"":e.substr(t+1);var e,t}},isDataUri:{get:function(){return mn(this._url)}},isBlobUri:{get:function(){return hn(this._url)}},isCrossOriginUrl:{get:function(){return function(e){(cn=!R.defined(cn)?document.createElement("a"):cn).href=window.location.href;var t=cn.host,n=cn.protocol;return cn.href=e,cn.href=cn.href,n!==cn.protocol||t!==cn.host}(this._url)}},hasHeaders:{get:function(){return 0<Object.keys(this.headers).length}}}),Zn.prototype.toString=function(){return this.getUrlComponent(!0,!0)},Zn.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var n=new en(this._url);e&&Wn(n,this);var n=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),r=this._templateValues,n=n.replace(/{(.*?)}/g,function(e,t){t=r[t];return R.defined(t)?encodeURIComponent(t):e});return n=t&&R.defined(this.proxy)?this.proxy.getURL(n):n},Zn.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Yn(this._queryParameters,e,!1):Yn(e,this._queryParameters,!1)},Zn.prototype.appendQueryParameters=function(e){this._queryParameters=Yn(e,this._queryParameters,!0)},Zn.prototype.setTemplateValues=function(e,t){this._templateValues=t?ln(this._templateValues,e):ln(e,this._templateValues)},Zn.prototype.getDerivedResource=function(e){var t,n=this.clone();return n._retryCount=0,R.defined(e.url)&&(Bn(t=new en(e.url),n,!0,R.defaultValue(e.preserveQueryParameters,!1)),t.fragment=void 0,n._url=t.resolve(new en(dn(this._url))).toString()),R.defined(e.queryParameters)&&(n._queryParameters=ln(e.queryParameters,n._queryParameters)),R.defined(e.templateValues)&&(n._templateValues=ln(e.templateValues,n.templateValues)),R.defined(e.headers)&&(n.headers=ln(e.headers,n.headers)),R.defined(e.proxy)&&(n.proxy=e.proxy),R.defined(e.request)&&(n.request=e.request),R.defined(e.retryCallback)&&(n.retryCallback=e.retryCallback),R.defined(e.retryAttempts)&&(n.retryAttempts=e.retryAttempts),n},Zn.prototype.retryOnError=function(e){var t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return R.when(!1);var n=this;return R.when(t(this,e)).then(function(e){return++n._retryCount,e})},Zn.prototype.clone=function(e){return(e=!R.defined(e)?new Zn({url:this._url}):e)._url=this._url,e._queryParameters=un(this._queryParameters),e._templateValues=un(this._templateValues),e.headers=un(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Zn.prototype.getBaseUri=function(e){return t=this.getUrlComponent(e),n=e,r="",-1!==(e=t.lastIndexOf("/"))&&(r=t.substring(0,e+1)),n&&(t=new en(t),R.defined(t.query)&&(r+="?"+t.query),R.defined(t.fragment)&&(r+="#"+t.fragment)),r;var t,n,r},Zn.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e+="/"),e)},Zn.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Zn.fetchArrayBuffer=function(e){return new Zn(e).fetchArrayBuffer()},Zn.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Zn.fetchBlob=function(e){return new Zn(e).fetchBlob()},Zn.prototype.fetchImage=function(e){e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT);var t=R.defaultValue(e.preferImageBitmap,!1),n=R.defaultValue(e.preferBlob,!1),r=R.defaultValue(e.flipY,!1);if(kn(this.request),!Ln||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Xn({resource:this,flipY:r,preferImageBitmap:t});var a,i,s,o=this.fetchBlob();return R.defined(o)?Zn.supportsImageBitmapOptions().then(function(e){return a=e&&t,o}).then(function(e){if(R.defined(e)){if(s=e,a)return Zn.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1});e=window.URL.createObjectURL(e);return Xn({resource:i=new Zn({url:e}),flipY:r,preferImageBitmap:!1})}}).then(function(e){if(R.defined(e))return e.blob=s,a||window.URL.revokeObjectURL(i.url),e}).otherwise(function(e){return R.defined(i)&&window.URL.revokeObjectURL(i.url),e.blob=s,R.when.reject(e)}):void 0},Zn.fetchImage=function(e){return new Zn(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Zn.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Zn.fetchText=function(e){return new Zn(e).fetchText()},Zn.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(R.defined(e))return e.then(function(e){if(R.defined(e))return JSON.parse(e)})},Zn.fetchJson=function(e){return new Zn(e).fetchJson()},Zn.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Zn.fetchXML=function(e){return new Zn(e).fetchXML()},Zn.prototype.fetchJsonp=function(e){var t;for(e=R.defaultValue(e,"callback"),kn(this.request);t="loadJsonp"+Math.random().toString().substring(2,8),R.defined(window[t]););return function n(r,a,i){var e={};e[a]=i;r.setQueryParameters(e);var s=r.request;s.url=r.url;s.requestFunction=function(){var t=R.when.defer();return window[i]=function(e){t.resolve(e);try{delete window[i]}catch(e){window[i]=void 0}},Zn._Implementations.loadAndExecuteScript(r.url,i,t),t.promise};var e=qn.request(s);if(!R.defined(e))return;return e.otherwise(function(t){return s.state!==yn.FAILED?R.when.reject(t):r.retryOnError(t).then(function(e){return e?(s.state=yn.UNISSUED,s.deferred=void 0,n(r,a,i)):R.when.reject(t)})})}(this,e,t)},Zn.fetchJsonp=function(e){return new Zn(e).fetchJsonp(e.callbackParameterName)},Zn.prototype._makeRequest=function(o){var u=this;kn(u.request);var l=u.request;l.url=u.url,l.requestFunction=function(){var e=o.responseType,t=ln(o.headers,u.headers),n=o.overrideMimeType,r=o.method,a=o.data,i=R.when.defer(),s=Zn._Implementations.loadWithXhr(u.url,e,r,a,t,i,n);return R.defined(s)&&R.defined(s.abort)&&(l.cancelFunction=function(){s.abort()}),i.promise};var e=qn.request(l);if(R.defined(e))return e.then(function(e){return l.cancelFunction=void 0,e}).otherwise(function(t){return l.cancelFunction=void 0,l.state!==yn.FAILED?R.when.reject(t):u.retryOnError(t).then(function(e){return e?(l.state=yn.UNISSUED,l.deferred=void 0,u.fetch(o)):R.when.reject(t)})})};var Hn=/^data:(.*?)(;base64)?,(.*)$/;function Jn(e,t){t=decodeURIComponent(t);return e?atob(t):t}function Gn(e,t){for(var n=Jn(e,t),t=new ArrayBuffer(n.length),r=new Uint8Array(t),a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return t}function Qn(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}Zn.prototype.fetch=function(e){return(e=jn(e,{})).method="GET",this._makeRequest(e)},Zn.fetch=function(e){return new Zn(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.delete=function(e){return(e=jn(e,{})).method="DELETE",this._makeRequest(e)},Zn.delete=function(e){return new Zn(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},Zn.prototype.head=function(e){return(e=jn(e,{})).method="HEAD",this._makeRequest(e)},Zn.head=function(e){return new Zn(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.options=function(e){return(e=jn(e,{})).method="OPTIONS",this._makeRequest(e)},Zn.options=function(e){return new Zn(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.post=function(e,t){return o.Check.defined("data",e),(t=jn(t,{})).method="POST",t.data=e,this._makeRequest(t)},Zn.post=function(e){return new Zn(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.put=function(e,t){return o.Check.defined("data",e),(t=jn(t,{})).method="PUT",t.data=e,this._makeRequest(t)},Zn.put=function(e){return new Zn(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.patch=function(e,t){return o.Check.defined("data",e),(t=jn(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},Zn.patch=function(e){return new Zn(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},(Zn._Implementations={}).createImage=function(i,s,o,u,l){var d=i.url;Zn.supportsImageBitmapOptions().then(function(e){if(!e||!l)return r=d,e=s,t=o,(n=new Image).onload=function(){t.resolve(n)},n.onerror=function(e){t.reject(e)},e&&(Nn.contains(r)?n.crossOrigin="use-credentials":n.crossOrigin=""),void(n.src=r);var t,n,r=R.when.defer(),a=Zn._Implementations.loadWithXhr(d,"blob","GET",void 0,void 0,r,void 0,void 0,void 0);return R.defined(a)&&R.defined(a.abort)&&(i.cancelFunction=function(){a.abort()}),r.promise.then(function(e){return R.defined(e)?Zn.createImageBitmapFromBlob(e,{flipY:u,premultiplyAlpha:!1}):void o.reject(new L.RuntimeError("Successfully retrieved "+d+" but it contained no content."))}).then(o.resolve)}).otherwise(o.reject)},Zn.createImageBitmapFromBlob=function(e,t){return o.Check.defined("options",t),o.Check.typeOf.bool("options.flipY",t.flipY),o.Check.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none"})};var Kn="undefined"==typeof XMLHttpRequest;function $n(e){var t,n;e=R.defaultValue(e,R.defaultValue.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._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=R.defaultValue(e.addNewLeapSeconds,!0),R.defined(e.data)?tr(this,e.data):R.defined(e.url)?(t=Zn.createIfNeeded(e.url),(n=this)._downloadPromise=t.fetchJson().then(function(e){tr(n,e)}).otherwise(function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})):tr(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function er(e,t){return Kt.compare(e.julianDate,t)}function tr(e,t){if(R.defined(t.columnNames))if(R.defined(t.samples)){var n=t.columnNames.indexOf("modifiedJulianDateUtc"),r=t.columnNames.indexOf("xPoleWanderRadians"),a=t.columnNames.indexOf("yPoleWanderRadians"),i=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),o=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||r<0||a<0||i<0||s<0||o<0||u<0)e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns";else{var l,d=e._samples=t.samples,c=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=r,e._yPoleWanderRadiansColumn=a,e._ut1MinusUtcSecondsColumn=i,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=o,e._taiMinusUtcSecondsColumn=u,e._columnCount=t.columnNames.length,e._lastIndex=void 0;for(var f=e._addNewLeapSeconds,h=0,p=d.length;h<p;h+=e._columnCount){var m,y=d[h+n],w=d[h+u],C=new Kt(y+Pt.MODIFIED_JULIAN_DATE_DIFFERENCE,w,Dt.TAI);c.push(C),f&&(w===l||!R.defined(l)||(y=At(m=Kt.leapSeconds,C,er))<0&&(C=new It(C,w),m.splice(~y,0,C)),l=w)}}}else e._dataError="Error in loaded EOP data: The samples property is required.";else e._dataError="Error in loaded EOP data: The columnNames property is required."}function nr(e,t,n,r,a){r*=n;a.xPoleWander=t[r+e._xPoleWanderRadiansColumn],a.yPoleWander=t[r+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function rr(e,t,n){return t+e*(n-t)}function ar(e,t,n,r,a,i,s){var o=e._columnCount;if(i>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[a],l=t[i];if(u.equals(l)||r.equals(u))return nr(e,n,a,o,s),s;if(r.equals(l))return nr(e,n,i,o,s),s;var d=Kt.secondsDifference(r,u)/Kt.secondsDifference(l,u),c=a*o,t=i*o,u=n[c+e._ut1MinusUtcSecondsColumn],a=n[t+e._ut1MinusUtcSecondsColumn],i=a-u;return!(.5<i||i<-.5)||(o=n[c+e._taiMinusUtcSecondsColumn])!==(i=n[t+e._taiMinusUtcSecondsColumn])&&(l.equals(r)?u=a:a-=i-o),s.xPoleWander=rr(d,n[c+e._xPoleWanderRadiansColumn],n[t+e._xPoleWanderRadiansColumn]),s.yPoleWander=rr(d,n[c+e._yPoleWanderRadiansColumn],n[t+e._yPoleWanderRadiansColumn]),s.xPoleOffset=rr(d,n[c+e._xCelestialPoleOffsetRadiansColumn],n[t+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=rr(d,n[c+e._yCelestialPoleOffsetRadiansColumn],n[t+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=rr(d,u,a),s}function ir(e,t,n){this.heading=R.defaultValue(e,0),this.pitch=R.defaultValue(t,0),this.roll=R.defaultValue(n,0)}Zn._Implementations.loadWithXhr=function(e,a,i,t,n,s,r){var o=Hn.exec(e);if(null===o){if(Kn)return u=e,l=a,d=i,c=n,f=s,h=require("url").parse(u),u="https:"===h.protocol?require("https"):require("http"),p=require("zlib"),c={protocol:h.protocol,hostname:h.hostname,port:h.port,path:h.path,query:h.query,method:d,headers:c},void u.request(c).on("response",function(t){var n;t.statusCode<200||300<=t.statusCode?f.reject(new vn(t.statusCode,t,t.headers)):(n=[],t.on("data",function(e){n.push(e)}),t.on("end",function(){var e=Buffer.concat(n);"gzip"===t.headers["content-encoding"]?p.gunzip(e,function(e,t){e?f.reject(new L.RuntimeError("Error decompressing response.")):f.resolve(Qn(t,l))}):f.resolve(Qn(e,l))}))}).on("error",function(e){f.reject(new vn)}).end();var u,l,d,c,f,h,p,m=new XMLHttpRequest;if(Nn.contains(e)&&(m.withCredentials=!0),m.open(i,e,!0),R.defined(r)&&R.defined(m.overrideMimeType)&&m.overrideMimeType(r),R.defined(n))for(var y in n)n.hasOwnProperty(y)&&m.setRequestHeader(y,n[y]);R.defined(a)&&(m.responseType=a);var w=!1;return"string"==typeof e&&(w=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),m.onload=function(){if(!(m.status<200||300<=m.status)||w&&0===m.status){var e=m.response,t=m.responseType;if("HEAD"===i||"OPTIONS"===i){var n=m.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return n.forEach(function(e){var t=e.split(": "),e=t.shift();r[e]=t.join(": ")}),void s.resolve(r)}if(204===m.status)s.resolve();else if(!R.defined(e)||R.defined(a)&&t!==a)if("json"===a&&"string"==typeof e)try{s.resolve(JSON.parse(e))}catch(e){s.reject(e)}else(""===t||"document"===t)&&R.defined(m.responseXML)&&m.responseXML.hasChildNodes()?s.resolve(m.responseXML):""!==t&&"text"!==t||!R.defined(m.responseText)?s.reject(new L.RuntimeError("Invalid XMLHttpRequest response type.")):s.resolve(m.responseText);else s.resolve(e)}else s.reject(new vn(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(e){s.reject(new vn)},m.send(t),m}s.resolve(function(e,t){t=R.defaultValue(t,"");var n=e[1],r=!!e[2],a=e[3];switch(t){case"":case"text":return Jn(r,a);case"arraybuffer":return Gn(r,a);case"blob":var i=Gn(r,a);return new Blob([i],{type:n});case"document":return(new DOMParser).parseFromString(Jn(r,a),n);case"json":return JSON.parse(Jn(r,a))}}(o,a))},Zn._Implementations.loadAndExecuteScript=function(e,t,n){return function(e){var t=R.when.defer(),n=document.createElement("script");n.async=!0,n.src=e;var r=document.getElementsByTagName("head")[0];return n.onload=function(){n.onload=void 0,r.removeChild(n),t.resolve()},n.onerror=function(e){t.reject(e)},r.appendChild(n),t.promise}(e).otherwise(n.reject)},(Zn._DefaultImplementations={}).createImage=Zn._Implementations.createImage,Zn._DefaultImplementations.loadWithXhr=Zn._Implementations.loadWithXhr,Zn._DefaultImplementations.loadAndExecuteScript=Zn._Implementations.loadAndExecuteScript,Zn.DEFAULT=Object.freeze(new Zn({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),$n.NONE=Object.freeze({getPromiseToLoad:function(){return R.when.resolve()},compute:function(e,t){return R.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Rt(0,0,0,0,0),t}}),$n.prototype.getPromiseToLoad=function(){return R.when(this._downloadPromise)},$n.prototype.compute=function(e,t){if(R.defined(this._samples)){if(R.defined(t)||(t=new Rt(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;var n=this._dates,r=this._lastIndex,a=0,i=0;if(R.defined(r)){var s=n[r],o=n[r+1],u=Kt.lessThanOrEquals(s,e),l=!R.defined(o),s=l||Kt.greaterThanOrEquals(o,e);if(u&&s)return a=r,!l&&o.equals(e)&&++a,ar(this,n,this._samples,e,a,i=a+1,t),t}o=At(n,e,Kt.compare,this._dateColumn);return 0<=o?(o<n.length-1&&n[o+1].equals(e)&&++o,i=a=o):(a=(i=~o)-1)<0&&(a=0),this._lastIndex=a,ar(this,n,this._samples,e,a,i,t),t}if(R.defined(this._dataError))throw new L.RuntimeError(this._dataError)},ir.fromQuaternion=function(e,t){R.defined(t)||(t=new ir);var n=2*(e.w*e.y-e.z*e.x),r=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),i=1-2*(e.y*e.y+e.z*e.z),e=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(e,i),t.roll=Math.atan2(a,r),t.pitch=-F.CesiumMath.asinClamped(n),t},ir.fromDegrees=function(e,t,n,r){return(r=!R.defined(r)?new ir:r).heading=e*F.CesiumMath.RADIANS_PER_DEGREE,r.pitch=t*F.CesiumMath.RADIANS_PER_DEGREE,r.roll=n*F.CesiumMath.RADIANS_PER_DEGREE,r},ir.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new ir(e.heading,e.pitch,e.roll)},ir.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},ir.equalsEpsilon=function(e,t,n,r){return e===t||R.defined(e)&&R.defined(t)&&F.CesiumMath.equalsEpsilon(e.heading,t.heading,n,r)&&F.CesiumMath.equalsEpsilon(e.pitch,t.pitch,n,r)&&F.CesiumMath.equalsEpsilon(e.roll,t.roll,n,r)},ir.prototype.clone=function(e){return ir.clone(this,e)},ir.prototype.equals=function(e){return ir.equals(this,e)},ir.prototype.equalsEpsilon=function(e,t,n){return ir.equalsEpsilon(this,e,t,n)},ir.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"};var sr,or,ur,lr=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function dr(e){return"undefined"==typeof document?e:((sr=!R.defined(sr)?document.createElement("a"):sr).href=e,sr.href=sr.href,sr.href)}function cr(){if(R.defined(or))return or;var e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&R.defined(define.amd)&&!define.amd.toUrlUndefined&&R.defined(require.toUrl)?dn("..",pr("Core/buildModuleUrl.js")):function(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),r=lr.exec(r);if(null!==r)return r[1]}}();return(or=new Zn({url:dr(e)})).appendForwardSlash(),or}function fr(e){return dr(require.toUrl("../"+e))}function hr(e){return cr().getDerivedResource({url:e}).url}function pr(e){return(ur=!R.defined(ur)?"object"==typeof define&&R.defined(define.amd)&&!define.amd.toUrlUndefined&&R.defined(require.toUrl)?fr:hr:ur)(e)}function mr(e,t,n){this.x=e,this.y=t,this.s=n}function yr(e){e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=Zn.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=R.defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=R.defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new Kt(this._sampleZeroJulianEphemerisDate,0,Dt.TAI),this._stepSizeDays=R.defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=R.defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=R.defaultValue(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),r=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),i=0;i<=t;++i){n[i]=a,r[i]=i*this._stepSizeDays;for(var s=0;s<=t;++s)s!==i&&(n[i]*=i-s);n[i]=1/n[i]}this._work=new Array(t+1),this._coef=new Array(t+1)}pr._cesiumScriptRegex=lr,pr._buildModuleUrlFromBaseUrl=hr,pr._clearBaseResource=function(){or=void 0},pr.setBaseUrl=function(e){or=Zn.DEFAULT.getDerivedResource({url:e})},pr.getCesiumBaseUrl=cr;var wr=new Kt(0,0,Dt.TAI);function Cr(e,t,n){var r=wr;return r.dayNumber=t,r.secondsOfDay=n,Kt.daysDifference(r,e._sampleZeroDateTT)}function vr(s,o){if(s._chunkDownloadsInProgress[o])return s._chunkDownloadsInProgress[o];var u=R.when.defer();s._chunkDownloadsInProgress[o]=u;var e=s._xysFileUrlTemplate,e=R.defined(e)?e.getDerivedResource({templateValues:{0:o}}):new Zn({url:pr("Assets/IAU2006_XYS/IAU2006_XYS_"+o+".json")});return R.when(e.fetchJson(),function(e){s._chunkDownloadsInProgress[o]=!1;for(var t=s._samples,n=e.samples,r=o*s._samplesPerXysFile*3,a=0,i=n.length;a<i;++a)t[r+a]=n[a];u.resolve()}),u.promise}yr.prototype.preload=function(e,t,n,r){t=Cr(this,e,t),r=Cr(this,n,r),t=t/this._stepSizeDays-this._interpolationOrder/2|0,r=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;r>=this._totalSamples&&(r=this._totalSamples-1);for(var t=(t=t<0?0:t)/this._samplesPerXysFile|0,a=r/this._samplesPerXysFile|0,i=[],s=t;s<=a;++s)i.push(vr(this,s));return R.when.all(i)},yr.prototype.computeXysRadians=function(e,t,n){var r=Cr(this,e,t);if(!(r<0)){e=r/this._stepSizeDays|0;if(!(e>=this._totalSamples)){var a=this._interpolationOrder,i=e-(a/2|0),t=(i=i<0?0:i)+a;t>=this._totalSamples&&(i=(t=this._totalSamples-1)-a)<0&&(i=0);var e=!1,s=this._samples;if(R.defined(s[3*i])||(vr(this,i/this._samplesPerXysFile|0),e=!0),R.defined(s[3*t])||(vr(this,t/this._samplesPerXysFile|0),e=!0),!e){R.defined(n)?(n.x=0,n.y=0,n.s=0):n=new mr(0,0,0);for(var o,u=r-i*this._stepSizeDays,l=this._work,d=this._denominators,c=this._coef,f=this._xTable,h=0;h<=a;++h)l[h]=u-f[h];for(h=0;h<=a;++h){for(c[h]=1,o=0;o<=a;++o)o!==h&&(c[h]*=l[o]);c[h]*=d[h];var p=3*(i+h);n.x+=c[h]*s[p++],n.y+=c[h]*s[p++],n.s+=c[h]*s[p]}return n}}}};var gr={},xr={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"}},Er={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Or={},_r={east:new A.Cartesian3,north:new A.Cartesian3,up:new A.Cartesian3,west:new A.Cartesian3,south:new A.Cartesian3,down:new A.Cartesian3},Sr=new A.Cartesian3,br=new A.Cartesian3,Mr=new A.Cartesian3;gr.localFrameToFixedFrameGenerator=function(a,i){if(!xr.hasOwnProperty(a)||!xr[a].hasOwnProperty(i))throw new o.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");var e,s=xr[a][i],t=a+i;return R.defined(Or[t])?e=Or[t]:Or[t]=e=function(e,t,n){var r;return R.defined(n)||(n=new j),A.Cartesian3.equalsEpsilon(e,A.Cartesian3.ZERO,F.CesiumMath.EPSILON14)?(A.Cartesian3.unpack(Er[a],0,Sr),A.Cartesian3.unpack(Er[i],0,br),A.Cartesian3.unpack(Er[s],0,Mr)):F.CesiumMath.equalsEpsilon(e.x,0,F.CesiumMath.EPSILON14)&&F.CesiumMath.equalsEpsilon(e.y,0,F.CesiumMath.EPSILON14)?(r=F.CesiumMath.sign(e.z),A.Cartesian3.unpack(Er[a],0,Sr),"east"!==a&&"west"!==a&&A.Cartesian3.multiplyByScalar(Sr,r,Sr),A.Cartesian3.unpack(Er[i],0,br),"east"!==i&&"west"!==i&&A.Cartesian3.multiplyByScalar(br,r,br),A.Cartesian3.unpack(Er[s],0,Mr),"east"!==s&&"west"!==s&&A.Cartesian3.multiplyByScalar(Mr,r,Mr)):((t=R.defaultValue(t,A.Ellipsoid.WGS84)).geodeticSurfaceNormal(e,_r.up),r=_r.up,(t=_r.east).x=-e.y,t.y=e.x,t.z=0,A.Cartesian3.normalize(t,_r.east),A.Cartesian3.cross(r,t,_r.north),A.Cartesian3.multiplyByScalar(_r.up,-1,_r.down),A.Cartesian3.multiplyByScalar(_r.east,-1,_r.west),A.Cartesian3.multiplyByScalar(_r.north,-1,_r.south),Sr=_r[a],br=_r[i],Mr=_r[s]),n[0]=Sr.x,n[1]=Sr.y,n[2]=Sr.z,n[3]=0,n[4]=br.x,n[5]=br.y,n[6]=br.z,n[7]=0,n[8]=Mr.x,n[9]=Mr.y,n[10]=Mr.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},e},gr.eastNorthUpToFixedFrame=gr.localFrameToFixedFrameGenerator("east","north"),gr.northEastDownToFixedFrame=gr.localFrameToFixedFrameGenerator("north","east"),gr.northUpEastToFixedFrame=gr.localFrameToFixedFrameGenerator("north","up"),gr.northWestUpToFixedFrame=gr.localFrameToFixedFrameGenerator("north","west");var Ar=new $e,Rr=new A.Cartesian3(1,1,1),Tr=new j;gr.headingPitchRollToFixedFrame=function(e,t,n,r,a){r=R.defaultValue(r,gr.eastNorthUpToFixedFrame);t=$e.fromHeadingPitchRoll(t,Ar),t=j.fromTranslationQuaternionRotationScale(A.Cartesian3.ZERO,t,Rr,Tr);return a=r(e,n,a),j.multiply(a,t,a)};var qr=new j,zr=new B;gr.headingPitchRollQuaternion=function(e,t,n,r,a){r=gr.headingPitchRollToFixedFrame(e,t,n,r,qr),r=j.getMatrix3(r,zr);return $e.fromRotationMatrix(r,a)};var Ir=new A.Cartesian3(1,1,1),Pr=new A.Cartesian3,Dr=new j,Ur=new j,Nr=new B,Vr=new $e;gr.fixedFrameToHeadingPitchRoll=function(e,t,n,r){t=R.defaultValue(t,A.Ellipsoid.WGS84),n=R.defaultValue(n,gr.eastNorthUpToFixedFrame),R.defined(r)||(r=new ir);var a=j.getTranslation(e,Pr);if(A.Cartesian3.equals(a,A.Cartesian3.ZERO))return r.heading=0,r.pitch=0,r.roll=0,r;t=j.inverseTransformation(n(a,t,Dr),Dr),e=j.setScale(e,Ir,Ur),e=j.setTranslation(e,A.Cartesian3.ZERO,e),t=j.multiply(t,e,t),t=$e.fromRotationMatrix(j.getMatrix3(t,Nr),Vr),t=$e.normalize(t,t);return ir.fromQuaternion(t,r)};var Fr=F.CesiumMath.TWO_PI/86400,Lr=new Kt;gr.computeTemeToPseudoFixedMatrix=function(e,t){var n=(Lr=Kt.addSeconds(e,-Kt.computeTaiMinusUtc(e),Lr)).dayNumber,r=Lr.secondsOfDay,e=n-2451545,e=43200<=r?(.5+e)/Pt.DAYS_PER_JULIAN_CENTURY:(e-.5)/Pt.DAYS_PER_JULIAN_CENTURY,n=(24110.54841+e*(8640184.812866+e*(.093104+-62e-7*e)))*Fr%F.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(n-2451545.5))*((r+.5*Pt.SECONDS_PER_DAY)%Pt.SECONDS_PER_DAY),r=Math.cos(n),n=Math.sin(n);return R.defined(t)?(t[0]=r,t[1]=-n,t[2]=0,t[3]=n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(r,n,0,-n,r,0,0,0,1)},gr.iau2006XysData=new yr,gr.earthOrientationParameters=$n.NONE;var Br=32.184;gr.preloadIcrfFixed=function(e){var t=e.start.dayNumber,n=e.start.secondsOfDay+Br,r=e.stop.dayNumber,e=e.stop.secondsOfDay+Br,r=gr.iau2006XysData.preload(t,n,r,e),e=gr.earthOrientationParameters.getPromiseToLoad();return R.when.all([r,e])},gr.computeIcrfToFixedMatrix=function(e,t){R.defined(t)||(t=new B);e=gr.computeFixedToIcrfMatrix(e,t);if(R.defined(e))return B.transpose(e,t)};var Wr=new mr(0,0,0),jr=new Rt(0,0,0,0,0),kr=new B,Yr=new B;gr.computeFixedToIcrfMatrix=function(e,t){R.defined(t)||(t=new B);var n=gr.earthOrientationParameters.compute(e,jr);if(R.defined(n)){var r=e.dayNumber,a=e.secondsOfDay+Br,i=gr.iau2006XysData.computeXysRadians(r,a,Wr);if(R.defined(i)){var s=i.x+n.xPoleOffset,o=i.y+n.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-o*o)),l=kr;l[0]=1-u*s*s,l[3]=-u*s*o,l[6]=s,l[1]=-u*s*o,l[4]=1-u*o*o,l[7]=o,l[2]=-s,l[5]=-o,l[8]=1-u*(s*s+o*o);s=B.fromRotationZ(-i.s,Yr),o=B.multiply(l,s,kr),i=e.dayNumber,l=(e.secondsOfDay-Kt.computeTaiMinusUtc(e)+n.ut1MinusUtc)/Pt.SECONDS_PER_DAY,s=(s=.779057273264+l+.00273781191135448*(i-2451545+l))%1*F.CesiumMath.TWO_PI,e=B.fromRotationZ(s,Yr),i=B.multiply(o,e,kr),l=Math.cos(n.xPoleWander),s=Math.cos(n.yPoleWander),o=Math.sin(n.xPoleWander),e=Math.sin(n.yPoleWander),n=r-2451545+a/Pt.SECONDS_PER_DAY,r=-47e-6*(n/=36525)*F.CesiumMath.RADIANS_PER_DEGREE/3600,a=Math.cos(r),n=Math.sin(r),r=Yr;return r[0]=l*a,r[1]=l*n,r[2]=o,r[3]=-s*n+e*o*a,r[4]=s*a+e*o*n,r[5]=-e*l,r[6]=-e*n-s*o*a,r[7]=e*a-s*o*n,r[8]=s*l,B.multiply(i,r,t)}}};var Zr=new W;gr.pointToWindowCoordinates=function(e,t,n,r){return(r=gr.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},gr.pointToGLWindowCoordinates=function(e,t,n,r){R.defined(r)||(r=new A.Cartesian2);var a=Zr;return j.multiplyByVector(e,W.fromElements(n.x,n.y,n.z,1,a),a),W.multiplyByScalar(a,1/a.w,a),j.multiplyByVector(t,a,a),A.Cartesian2.fromCartesian4(a,r)};var Xr=new A.Cartesian3,Hr=new A.Cartesian3,Jr=new A.Cartesian3;gr.rotationMatrixFromPositionVelocity=function(e,t,n,r){n=R.defaultValue(n,A.Ellipsoid.WGS84).geodeticSurfaceNormal(e,Xr),e=A.Cartesian3.cross(t,n,Hr);A.Cartesian3.equalsEpsilon(e,A.Cartesian3.ZERO,F.CesiumMath.EPSILON6)&&(e=A.Cartesian3.clone(A.Cartesian3.UNIT_X,e));n=A.Cartesian3.cross(e,t,Jr);return A.Cartesian3.normalize(n,n),A.Cartesian3.cross(t,n,e),A.Cartesian3.negate(e,e),A.Cartesian3.normalize(e,e),(r=!R.defined(r)?new B:r)[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=e.y,r[5]=e.z,r[6]=n.x,r[7]=n.y,r[8]=n.z,r};var Gr=new j(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Qr=new A.Cartographic,Kr=new A.Cartesian3,$r=new A.Cartesian3,ea=new B,ta=new j,na=new j;gr.basisTo2D=function(e,t,n){var r=j.getTranslation(t,$r),a=e.ellipsoid,i=a.cartesianToCartographic(r,Qr),i=e.project(i,Kr);A.Cartesian3.fromElements(i.z,i.x,i.y,i);a=gr.eastNorthUpToFixedFrame(r,a,ta),a=j.inverseTransformation(a,na),t=j.getMatrix3(t,ea),t=j.multiplyByMatrix3(a,t,n);return j.multiply(Gr,t,n),j.setTranslation(n,i,n),n},gr.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=gr.eastNorthUpToFixedFrame(t,r,ta),a=j.inverseTransformation(a,na),t=r.cartesianToCartographic(t,Qr),t=e.project(t,Kr);A.Cartesian3.fromElements(t.z,t.x,t.y,t);t=j.fromTranslation(t,ta);return j.multiply(Gr,a,n),j.multiply(t,n,n),n},e.BoundingSphere=T,e.Cartesian4=W,e.FeatureDetection=Ke,e.GeographicProjection=t,e.Intersect=a,e.Interval=i,e.Matrix3=B,e.Matrix4=j,e.Quaternion=$e,e.Resource=Zn,e.Transforms=gr,e.buildModuleUrl=pr}); diff --git a/public/Cesium/Workers/Transforms-a73b3b3b.js b/public/Cesium/Workers/Transforms-a73b3b3b.js deleted file mode 100644 index b363a24..0000000 --- a/public/Cesium/Workers/Transforms-a73b3b3b.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694","./RuntimeError-7f634f5d"],function(e,A,o,R,F,L){"use strict";function t(e){this._ellipsoid=R.defaultValue(e,A.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(t.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),t.prototype.project=function(e,t){var n=this._semimajorAxis,r=e.longitude*n,n=e.latitude*n,e=e.height;return R.defined(t)?(t.x=r,t.y=n,t.z=e,t):new A.Cartesian3(r,n,e)},t.prototype.unproject=function(e,t){var n=this._oneOverSemimajorAxis,r=e.x*n,n=e.y*n,e=e.z;return R.defined(t)?(t.longitude=r,t.latitude=n,t.height=e,t):new A.Cartographic(r,n,e)};var a=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function i(e,t){this.start=R.defaultValue(e,0),this.stop=R.defaultValue(t,0)}function B(e,t,n,r,a,i,s,o,u){this[0]=R.defaultValue(e,0),this[1]=R.defaultValue(r,0),this[2]=R.defaultValue(s,0),this[3]=R.defaultValue(t,0),this[4]=R.defaultValue(a,0),this[5]=R.defaultValue(o,0),this[6]=R.defaultValue(n,0),this[7]=R.defaultValue(i,0),this[8]=R.defaultValue(u,0)}B.packedLength=9,B.pack=function(e,t,n){return n=R.defaultValue(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},B.unpack=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new B: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},B.clone=function(e,t){if(R.defined(e))return R.defined(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 B(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},B.fromArray=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new B:n)[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},B.fromColumnMajorArray=function(e,t){return B.clone(e,t)},B.fromRowMajorArray=function(e,t){return R.defined(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 B(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},B.fromQuaternion=function(e,t){var n=e.x*e.x,r=e.x*e.y,a=e.x*e.z,i=e.x*e.w,s=e.y*e.y,o=e.y*e.z,u=e.y*e.w,l=e.z*e.z,c=e.z*e.w,d=e.w*e.w,f=n-s-l+d,h=2*(r-c),p=2*(a+u),e=2*(r+c),r=s-n-l+d,c=2*(o-i),u=2*(a-u),i=2*(o+i),d=-n-s+l+d;return R.defined(t)?(t[0]=f,t[1]=e,t[2]=u,t[3]=h,t[4]=r,t[5]=i,t[6]=p,t[7]=c,t[8]=d,t):new B(f,h,p,e,r,c,u,i,d)},B.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),r=Math.cos(-e.heading),a=Math.cos(e.roll),i=Math.sin(-e.pitch),s=Math.sin(-e.heading),o=Math.sin(e.roll),u=n*r,l=-a*s+o*i*r,c=o*s+a*i*r,d=n*s,e=a*r+o*i*s,s=-o*r+a*i*s,i=-i,o=o*n,n=a*n;return R.defined(t)?(t[0]=u,t[1]=d,t[2]=i,t[3]=l,t[4]=e,t[5]=o,t[6]=c,t[7]=s,t[8]=n,t):new B(u,l,c,d,e,s,i,o,n)},B.fromScale=function(e,t){return R.defined(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 B(e.x,0,0,0,e.y,0,0,0,e.z)},B.fromUniformScale=function(e,t){return R.defined(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 B(e,0,0,0,e,0,0,0,e)},B.fromCrossProduct=function(e,t){return R.defined(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 B(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},B.fromRotationX=function(e,t){var n=Math.cos(e),e=Math.sin(e);return R.defined(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=e,t[6]=0,t[7]=-e,t[8]=n,t):new B(1,0,0,0,n,-e,0,e,n)},B.fromRotationY=function(e,t){var n=Math.cos(e),e=Math.sin(e);return R.defined(t)?(t[0]=n,t[1]=0,t[2]=-e,t[3]=0,t[4]=1,t[5]=0,t[6]=e,t[7]=0,t[8]=n,t):new B(n,0,e,0,1,0,-e,0,n)},B.fromRotationZ=function(e,t){var n=Math.cos(e),e=Math.sin(e);return R.defined(t)?(t[0]=n,t[1]=e,t[2]=0,t[3]=-e,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(n,-e,0,e,n,0,0,0,1)},B.toArray=function(e,t){return R.defined(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]]},B.getElementIndex=function(e,t){return 3*e+t},B.getColumn=function(e,t,n){var r=3*t,a=e[r],t=e[1+r],r=e[2+r];return n.x=a,n.y=t,n.z=r,n},B.setColumn=function(e,t,n,r){t*=3;return(r=B.clone(e,r))[t]=n.x,r[1+t]=n.y,r[2+t]=n.z,r},B.getRow=function(e,t,n){var r=e[t],a=e[t+3],t=e[t+6];return n.x=r,n.y=a,n.z=t,n},B.setRow=function(e,t,n,r){return(r=B.clone(e,r))[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var n=new A.Cartesian3;B.getScale=function(e,t){return t.x=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[0],e[1],e[2],n)),t.y=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[3],e[4],e[5],n)),t.z=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[6],e[7],e[8],n)),t};var r=new A.Cartesian3;B.getMaximumScale=function(e){return B.getScale(e,r),A.Cartesian3.maximumComponent(r)},B.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=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],o=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],u=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],l=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],t=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=s,n[4]=o,n[5]=u,n[6]=l,n[7]=c,n[8]=t,n},B.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},B.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},B.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=e[0]*r+e[3]*a+e[6]*i,t=e[1]*r+e[4]*a+e[7]*i,i=e[2]*r+e[5]*a+e[8]*i;return n.x=s,n.y=t,n.z=i,n},B.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},B.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},B.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},B.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],s=e[4],o=e[7],u=e[2],l=e[5],e=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=s,t[5]=o,t[6]=u,t[7]=l,t[8]=e,t};var s=new A.Cartesian3(1,1,1);B.getRotation=function(e,t){var n=A.Cartesian3.divideComponents(s,B.getScale(e,r),r);return t=B.multiplyByScale(e,n,t)};var d=[1,0,0],f=[2,2,1];var u=new B,l=new B;B.computeEigenDecomposition=function(e,t){for(var n=F.CesiumMath.EPSILON20,r=0,a=0,i=(t=!R.defined(t)?{}:t).unitary=B.clone(B.IDENTITY,t.unitary),s=t.diagonal=B.clone(e,t.diagonal),o=n*function(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}(s);a<10&&function(e){for(var t=0,n=0;n<3;++n){var r=e[B.getElementIndex(f[n],d[n])];t+=2*r*r}return Math.sqrt(t)}(s)>o;)!function(e,t){for(var n=F.CesiumMath.EPSILON15,r=0,a=1,i=0;i<3;++i){var s=Math.abs(e[B.getElementIndex(f[i],d[i])]);r<s&&(a=i,r=s)}var o=1,u=0,l=d[a],c=f[a];Math.abs(e[B.getElementIndex(c,l)])>n&&(u=(n=(n=(e[B.getElementIndex(c,c)]-e[B.getElementIndex(l,l)])/2/e[B.getElementIndex(c,l)])<0?-1/(-n+Math.sqrt(1+n*n)):1/(n+Math.sqrt(1+n*n)))*(o=1/Math.sqrt(1+n*n))),(t=B.clone(B.IDENTITY,t))[B.getElementIndex(l,l)]=t[B.getElementIndex(c,c)]=o,t[B.getElementIndex(c,l)]=u,t[B.getElementIndex(l,c)]=-u}(s,u),B.transpose(u,l),B.multiply(s,u,s),B.multiply(l,s,s),B.multiply(i,u,i),2<++r&&(++a,r=0);return t},B.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},B.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],s=e[7],o=e[2],u=e[5],e=e[8];return t*(i*e-u*s)+a*(u*r-n*e)+o*(n*s-i*r)},B.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],s=e[4],o=e[5],u=e[6],l=e[7],c=e[8],e=B.determinant(e);return t[0]=s*c-l*o,t[1]=l*a-r*c,t[2]=r*o-s*a,t[3]=u*o-i*c,t[4]=n*c-u*a,t[5]=i*a-n*o,t[6]=i*l-u*s,t[7]=u*r-n*l,t[8]=n*s-i*r,B.multiplyByScalar(t,1/e,t)};var c=new B;function W(e,t,n,r){this.x=R.defaultValue(e,0),this.y=R.defaultValue(t,0),this.z=R.defaultValue(n,0),this.w=R.defaultValue(r,0)}B.inverseTranspose=function(e,t){return B.inverse(B.transpose(e,c),t)},B.equals=function(e,t){return e===t||R.defined(e)&&R.defined(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]},B.equalsEpsilon=function(e,t,n){return n=R.defaultValue(n,0),e===t||R.defined(e)&&R.defined(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},B.IDENTITY=Object.freeze(new B(1,0,0,0,1,0,0,0,1)),B.ZERO=Object.freeze(new B(0,0,0,0,0,0,0,0,0)),B.COLUMN0ROW0=0,B.COLUMN0ROW1=1,B.COLUMN0ROW2=2,B.COLUMN1ROW0=3,B.COLUMN1ROW1=4,B.COLUMN1ROW2=5,B.COLUMN2ROW0=6,B.COLUMN2ROW1=7,B.COLUMN2ROW2=8,Object.defineProperties(B.prototype,{length:{get:function(){return B.packedLength}}}),B.prototype.clone=function(e){return B.clone(this,e)},B.prototype.equals=function(e){return B.equals(this,e)},B.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]},B.prototype.equalsEpsilon=function(e,t){return B.equalsEpsilon(this,e,t)},B.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},W.fromElements=function(e,t,n,r,a){return R.defined(a)?(a.x=e,a.y=t,a.z=n,a.w=r,a):new W(e,t,n,r)},W.fromColor=function(e,t){return R.defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new W(e.red,e.green,e.blue,e.alpha)},W.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new W(e.x,e.y,e.z,e.w)},W.packedLength=4,W.pack=function(e,t,n){return n=R.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},W.unpack=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new W:n).x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n},W.packArray=function(e,t){var n=e.length,r=4*n;if(R.defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new o.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var a=0;a<n;++a)W.pack(e[a],t,4*a);return t},W.unpackArray=function(e,t){var n=e.length;R.defined(t)?t.length=n/4:t=new Array(n/4);for(var r=0;r<n;r+=4){var a=r/4;t[a]=W.unpack(e,r,t[a])}return t},W.fromArray=W.unpack,W.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},W.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},W.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},W.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},W.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},W.magnitude=function(e){return Math.sqrt(W.magnitudeSquared(e))};var h=new W;W.distance=function(e,t){return W.subtract(e,t,h),W.magnitude(h)},W.distanceSquared=function(e,t){return W.subtract(e,t,h),W.magnitudeSquared(h)},W.normalize=function(e,t){var n=W.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},W.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},W.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},W.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},W.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},W.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},W.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},W.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},W.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},W.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 p=new W;W.lerp=function(e,t,n,r){return W.multiplyByScalar(t,n,p),r=W.multiplyByScalar(e,1-n,r),W.add(p,r,r)};var m=new W;W.mostOrthogonalAxis=function(e,t){e=W.normalize(e,m);return W.abs(e,e),t=e.x<=e.y?e.x<=e.z?e.x<=e.w?W.clone(W.UNIT_X,t):W.clone(W.UNIT_W,t):e.z<=e.w?W.clone(W.UNIT_Z,t):W.clone(W.UNIT_W,t):e.y<=e.z?e.y<=e.w?W.clone(W.UNIT_Y,t):W.clone(W.UNIT_W,t):e.z<=e.w?W.clone(W.UNIT_Z,t):W.clone(W.UNIT_W,t)},W.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},W.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]},W.equalsEpsilon=function(e,t,n,r){return e===t||R.defined(e)&&R.defined(t)&&F.CesiumMath.equalsEpsilon(e.x,t.x,n,r)&&F.CesiumMath.equalsEpsilon(e.y,t.y,n,r)&&F.CesiumMath.equalsEpsilon(e.z,t.z,n,r)&&F.CesiumMath.equalsEpsilon(e.w,t.w,n,r)},W.ZERO=Object.freeze(new W(0,0,0,0)),W.UNIT_X=Object.freeze(new W(1,0,0,0)),W.UNIT_Y=Object.freeze(new W(0,1,0,0)),W.UNIT_Z=Object.freeze(new W(0,0,1,0)),W.UNIT_W=Object.freeze(new W(0,0,0,1)),W.prototype.clone=function(e){return W.clone(this,e)},W.prototype.equals=function(e){return W.equals(this,e)},W.prototype.equalsEpsilon=function(e,t,n){return W.equalsEpsilon(this,e,t,n)},W.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var y=new Float32Array(1),w=new Uint8Array(y.buffer),C=new Uint32Array([287454020]),v=68===new Uint8Array(C.buffer)[0];function j(e,t,n,r,a,i,s,o,u,l,c,d,f,h,p,m){this[0]=R.defaultValue(e,0),this[1]=R.defaultValue(a,0),this[2]=R.defaultValue(u,0),this[3]=R.defaultValue(f,0),this[4]=R.defaultValue(t,0),this[5]=R.defaultValue(i,0),this[6]=R.defaultValue(l,0),this[7]=R.defaultValue(h,0),this[8]=R.defaultValue(n,0),this[9]=R.defaultValue(s,0),this[10]=R.defaultValue(c,0),this[11]=R.defaultValue(p,0),this[12]=R.defaultValue(r,0),this[13]=R.defaultValue(o,0),this[14]=R.defaultValue(d,0),this[15]=R.defaultValue(m,0)}W.packFloat=function(e,t){return R.defined(t)||(t=new W),y[0]=e,v?(t.x=w[0],t.y=w[1],t.z=w[2],t.w=w[3]):(t.x=w[3],t.y=w[2],t.z=w[1],t.w=w[0]),t},W.unpackFloat=function(e){return v?(w[0]=e.x,w[1]=e.y,w[2]=e.z,w[3]=e.w):(w[0]=e.w,w[1]=e.z,w[2]=e.y,w[3]=e.x),y[0]},j.packedLength=16,j.pack=function(e,t,n){return n=R.defaultValue(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},j.unpack=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new j: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},j.clone=function(e,t){if(R.defined(e))return R.defined(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 j(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])},j.fromArray=j.unpack,j.fromColumnMajorArray=function(e,t){return j.clone(e,t)},j.fromRowMajorArray=function(e,t){return R.defined(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 j(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])},j.fromRotationTranslation=function(e,t,n){return t=R.defaultValue(t,A.Cartesian3.ZERO),R.defined(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 j(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)},j.fromTranslationQuaternionRotationScale=function(e,t,n,r){R.defined(r)||(r=new j);var a=n.x,i=n.y,s=n.z,o=t.x*t.x,u=t.x*t.y,l=t.x*t.z,c=t.x*t.w,d=t.y*t.y,f=t.y*t.z,h=t.y*t.w,p=t.z*t.z,m=t.z*t.w,y=t.w*t.w,w=o-d-p+y,C=2*(u-m),n=2*(l+h),t=2*(u+m),u=d-o-p+y,m=2*(f-c),h=2*(l-h),c=2*(f+c),y=-o-d+p+y;return r[0]=w*a,r[1]=t*a,r[2]=h*a,r[3]=0,r[4]=C*i,r[5]=u*i,r[6]=c*i,r[7]=0,r[8]=n*s,r[9]=m*s,r[10]=y*s,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},j.fromTranslationRotationScale=function(e,t){return j.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},j.fromTranslation=function(e,t){return j.fromRotationTranslation(B.IDENTITY,e,t)},j.fromScale=function(e,t){return R.defined(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 j(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},j.fromUniformScale=function(e,t){return R.defined(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 j(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var g=new A.Cartesian3,x=new A.Cartesian3,E=new A.Cartesian3;j.fromCamera=function(e,t){var n=e.position,r=e.direction,a=e.up;A.Cartesian3.normalize(r,g),A.Cartesian3.normalize(A.Cartesian3.cross(g,a,x),x),A.Cartesian3.normalize(A.Cartesian3.cross(x,g,E),E);var i=x.x,s=x.y,o=x.z,u=g.x,l=g.y,c=g.z,d=E.x,f=E.y,h=E.z,p=n.x,e=n.y,r=n.z,a=i*-p+s*-e+o*-r,n=d*-p+f*-e+h*-r,r=u*p+l*e+c*r;return R.defined(t)?(t[0]=i,t[1]=d,t[2]=-u,t[3]=0,t[4]=s,t[5]=f,t[6]=-l,t[7]=0,t[8]=o,t[9]=h,t[10]=-c,t[11]=0,t[12]=a,t[13]=n,t[14]=r,t[15]=1,t):new j(i,s,o,a,d,f,h,n,-u,-l,-c,r,0,0,0,1)},j.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=1/Math.tan(.5*e),e=i/t,t=(r+n)/(n-r),r=2*r*n/(n-r);return a[0]=e,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=t,a[11]=-1,a[12]=0,a[13]=0,a[14]=r,a[15]=0,a},j.computeOrthographicOffCenter=function(e,t,n,r,a,i,s){var o=1/(t-e),u=1/(r-n),l=1/(i-a),e=-(t+e)*o,n=-(r+n)*u,a=-(i+a)*l;return o*=2,u*=2,l*=-2,s[0]=o,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=l,s[11]=0,s[12]=e,s[13]=n,s[14]=a,s[15]=1,s},j.computePerspectiveOffCenter=function(e,t,n,r,a,i,s){var o=2*a/(t-e),u=2*a/(r-n),e=(t+e)/(t-e),r=(r+n)/(r-n),n=-(i+a)/(i-a),a=-2*i*a/(i-a);return s[0]=o,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=u,s[6]=0,s[7]=0,s[8]=e,s[9]=r,s[10]=n,s[11]=-1,s[12]=0,s[13]=0,s[14]=a,s[15]=0,s},j.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var s=2*a/(t-e),o=2*a/(r-n),e=(t+e)/(t-e),n=(r+n)/(r-n),a=-2*a;return i[0]=s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=e,i[9]=n,i[10]=-1,i[11]=-1,i[12]=0,i[13]=0,i[14]=a,i[15]=0,i},j.computeViewportTransformation=function(e,t,n,r){R.defined(r)||(r=new j),e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT);var a=R.defaultValue(e.x,0),i=R.defaultValue(e.y,0),s=R.defaultValue(e.width,0),o=R.defaultValue(e.height,0);t=R.defaultValue(t,0);var u=.5*s,e=.5*o,s=.5*((n=R.defaultValue(n,1))-t),o=e,n=s,a=a+u,e=i+e,s=t+s;return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=a,r[13]=e,r[14]=s,r[15]=1,r},j.computeView=function(e,t,n,r,a){return a[0]=r.x,a[1]=n.x,a[2]=-t.x,a[3]=0,a[4]=r.y,a[5]=n.y,a[6]=-t.y,a[7]=0,a[8]=r.z,a[9]=n.z,a[10]=-t.z,a[11]=0,a[12]=-A.Cartesian3.dot(r,e),a[13]=-A.Cartesian3.dot(n,e),a[14]=A.Cartesian3.dot(t,e),a[15]=1,a},j.toArray=function(e,t){return R.defined(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]]},j.getElementIndex=function(e,t){return 4*e+t},j.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[1+r],t=e[2+r],r=e[3+r];return n.x=a,n.y=i,n.z=t,n.w=r,n},j.setColumn=function(e,t,n,r){t*=4;return(r=j.clone(e,r))[t]=n.x,r[1+t]=n.y,r[2+t]=n.z,r[3+t]=n.w,r},j.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 O=new A.Cartesian3;j.setScale=function(e,t,n){var r=j.getScale(e,O),r=A.Cartesian3.divideComponents(t,r,O);return j.multiplyByScale(e,r,n)},j.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],t=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=t,n},j.setRow=function(e,t,n,r){return(r=j.clone(e,r))[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var _=new A.Cartesian3;j.getScale=function(e,t){return t.x=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[0],e[1],e[2],_)),t.y=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[4],e[5],e[6],_)),t.z=A.Cartesian3.magnitude(A.Cartesian3.fromElements(e[8],e[9],e[10],_)),t};var S=new A.Cartesian3;j.getMaximumScale=function(e){return j.getScale(e,S),A.Cartesian3.maximumComponent(S)},j.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],s=e[3],o=e[4],u=e[5],l=e[6],c=e[7],d=e[8],f=e[9],h=e[10],p=e[11],m=e[12],y=e[13],w=e[14],C=e[15],v=t[0],g=t[1],x=t[2],E=t[3],O=t[4],_=t[5],S=t[6],b=t[7],M=t[8],A=t[9],R=t[10],T=t[11],q=t[12],z=t[13],I=t[14],P=t[15],D=r*v+o*g+d*x+m*E,e=a*v+u*g+f*x+y*E,t=i*v+l*g+h*x+w*E,v=s*v+c*g+p*x+C*E,g=r*O+o*_+d*S+m*b,x=a*O+u*_+f*S+y*b,E=i*O+l*_+h*S+w*b,O=s*O+c*_+p*S+C*b,_=r*M+o*A+d*R+m*T,S=a*M+u*A+f*R+y*T,b=i*M+l*A+h*R+w*T,T=s*M+c*A+p*R+C*T,m=r*q+o*z+d*I+m*P,y=a*q+u*z+f*I+y*P,w=i*q+l*z+h*I+w*P,P=s*q+c*z+p*I+C*P;return n[0]=D,n[1]=e,n[2]=t,n[3]=v,n[4]=g,n[5]=x,n[6]=E,n[7]=O,n[8]=_,n[9]=S,n[10]=b,n[11]=T,n[12]=m,n[13]=y,n[14]=w,n[15]=P,n},j.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},j.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},j.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],s=e[4],o=e[5],u=e[6],l=e[8],c=e[9],d=e[10],f=e[12],h=e[13],p=e[14],m=t[0],y=t[1],w=t[2],C=t[4],v=t[5],g=t[6],x=t[8],E=t[9],O=t[10],_=t[12],S=t[13],b=t[14],e=r*m+s*y+l*w,t=a*m+o*y+c*w,m=i*m+u*y+d*w,y=r*C+s*v+l*g,w=a*C+o*v+c*g,C=i*C+u*v+d*g,v=r*x+s*E+l*O,g=a*x+o*E+c*O,O=i*x+u*E+d*O,f=r*_+s*S+l*b+f,h=a*_+o*S+c*b+h,p=i*_+u*S+d*b+p;return n[0]=e,n[1]=t,n[2]=m,n[3]=0,n[4]=y,n[5]=w,n[6]=C,n[7]=0,n[8]=v,n[9]=g,n[10]=O,n[11]=0,n[12]=f,n[13]=h,n[14]=p,n[15]=1,n},j.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],s=e[4],o=e[5],u=e[6],l=e[8],c=e[9],d=e[10],f=t[0],h=t[1],p=t[2],m=t[3],y=t[4],w=t[5],C=t[6],v=t[7],g=t[8],x=r*f+s*h+l*p,t=a*f+o*h+c*p,f=i*f+u*h+d*p,h=r*m+s*y+l*w,p=a*m+o*y+c*w,w=i*m+u*y+d*w,l=r*C+s*v+l*g,c=a*C+o*v+c*g,g=i*C+u*v+d*g;return n[0]=x,n[1]=t,n[2]=f,n[3]=0,n[4]=h,n[5]=p,n[6]=w,n[7]=0,n[8]=l,n[9]=c,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},j.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=r*e[0]+a*e[4]+i*e[8]+e[12],t=r*e[1]+a*e[5]+i*e[9]+e[13],i=r*e[2]+a*e[6]+i*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]=t,n[14]=i,n[15]=e[15],n};var b=new A.Cartesian3;j.multiplyByUniformScale=function(e,t,n){return b.x=t,b.y=t,b.z=t,j.multiplyByScale(e,b,n)},j.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,t=t.z;return 1===r&&1===a&&1===t?j.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=t*e[8],n[9]=t*e[9],n[10]=t*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},j.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=t.w,o=e[0]*r+e[4]*a+e[8]*i+e[12]*s,u=e[1]*r+e[5]*a+e[9]*i+e[13]*s,t=e[2]*r+e[6]*a+e[10]*i+e[14]*s,s=e[3]*r+e[7]*a+e[11]*i+e[15]*s;return n.x=o,n.y=u,n.z=t,n.w=s,n},j.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=e[0]*r+e[4]*a+e[8]*i,t=e[1]*r+e[5]*a+e[9]*i,i=e[2]*r+e[6]*a+e[10]*i;return n.x=s,n.y=t,n.z=i,n},j.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,s=e[0]*r+e[4]*a+e[8]*i+e[12],t=e[1]*r+e[5]*a+e[9]*i+e[13],e=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=s,n.y=t,n.z=e,n},j.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},j.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},j.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],s=e[7],o=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]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=s,t[14]=o,t[15]=e[15],t},j.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},j.equals=function(e,t){return e===t||R.defined(e)&&R.defined(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]},j.equalsEpsilon=function(e,t,n){return n=R.defaultValue(n,0),e===t||R.defined(e)&&R.defined(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},j.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},j.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 k=new B,Y=new B,Z=new W,X=new W(0,0,0,1);j.inverse=function(e,t){var n=e[0],r=e[4],a=e[8],i=e[12],s=e[1],o=e[5],u=e[9],l=e[13],c=e[2],d=e[6],f=e[10],h=e[14],p=e[3],m=e[7],y=e[11],w=e[15],C=f*w,v=h*y,g=d*w,x=h*m,E=d*y,O=f*m,_=c*w,S=h*p,b=c*y,M=f*p,A=c*m,R=d*p,T=C*o+x*u+E*l-(v*o+g*u+O*l),q=v*s+_*u+M*l-(C*s+S*u+b*l),z=g*s+S*o+A*l-(x*s+_*o+R*l),I=O*s+b*o+R*u-(E*s+M*o+A*u),P=v*r+g*a+O*i-(C*r+x*a+E*i),D=C*n+S*a+b*i-(v*n+_*a+M*i),U=x*n+_*r+R*i-(g*n+S*r+A*i),N=E*n+M*r+A*a-(O*n+b*r+R*a),V=(C=a*l)*m+(x=i*o)*y+(E=r*u)*w-((v=i*u)*m+(g=r*l)*y+(O=a*o)*w),u=v*p+(_=n*l)*y+(M=a*s)*w-(C*p+(S=i*s)*y+(b=n*u)*w),w=g*p+S*m+(A=n*o)*w-(x*p+_*m+(R=r*s)*w),m=O*p+b*m+R*y-(E*p+M*m+A*y),y=g*f+O*h+v*d-(E*h+C*d+x*f),v=b*h+C*c+S*f-(_*f+M*h+v*c),S=_*d+R*h+x*c-(A*h+g*c+S*d),c=A*f+E*c+M*d-(b*d+R*f+O*c),i=n*T+r*q+a*z+i*I;if(Math.abs(i)<F.CesiumMath.EPSILON21){if(B.equalsEpsilon(j.getMatrix3(e,k),Y,F.CesiumMath.EPSILON7)&&W.equals(j.getRow(e,3,Z),X))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 L.RuntimeError("matrix is not invertible because its determinate is zero.")}return i=1/i,t[0]=T*i,t[1]=q*i,t[2]=z*i,t[3]=I*i,t[4]=P*i,t[5]=D*i,t[6]=U*i,t[7]=N*i,t[8]=V*i,t[9]=u*i,t[10]=w*i,t[11]=m*i,t[12]=y*i,t[13]=v*i,t[14]=S*i,t[15]=c*i,t},j.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],s=e[5],o=e[6],u=e[8],l=e[9],c=e[10],d=e[12],f=e[13],h=e[14],p=-n*d-r*f-a*h,e=-i*d-s*f-o*h,h=-u*d-l*f-c*h;return t[0]=n,t[1]=i,t[2]=u,t[3]=0,t[4]=r,t[5]=s,t[6]=l,t[7]=0,t[8]=a,t[9]=o,t[10]=c,t[11]=0,t[12]=p,t[13]=e,t[14]=h,t[15]=1,t};var M=new j;function T(e,t){this.center=A.Cartesian3.clone(R.defaultValue(e,A.Cartesian3.ZERO)),this.radius=R.defaultValue(t,0)}j.inverseTranspose=function(e,t){return j.inverse(j.transpose(e,M),t)},j.IDENTITY=Object.freeze(new j(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),j.ZERO=Object.freeze(new j(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),j.COLUMN0ROW0=0,j.COLUMN0ROW1=1,j.COLUMN0ROW2=2,j.COLUMN0ROW3=3,j.COLUMN1ROW0=4,j.COLUMN1ROW1=5,j.COLUMN1ROW2=6,j.COLUMN1ROW3=7,j.COLUMN2ROW0=8,j.COLUMN2ROW1=9,j.COLUMN2ROW2=10,j.COLUMN2ROW3=11,j.COLUMN3ROW0=12,j.COLUMN3ROW1=13,j.COLUMN3ROW2=14,j.COLUMN3ROW3=15,Object.defineProperties(j.prototype,{length:{get:function(){return j.packedLength}}}),j.prototype.clone=function(e){return j.clone(this,e)},j.prototype.equals=function(e){return j.equals(this,e)},j.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]},j.prototype.equalsEpsilon=function(e,t){return j.equalsEpsilon(this,e,t)},j.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"};var q=new A.Cartesian3,z=new A.Cartesian3,I=new A.Cartesian3,P=new A.Cartesian3,D=new A.Cartesian3,U=new A.Cartesian3,N=new A.Cartesian3,V=new A.Cartesian3,H=new A.Cartesian3,J=new A.Cartesian3,G=new A.Cartesian3,Q=new A.Cartesian3,K=4/3*F.CesiumMath.PI;T.fromPoints=function(e,t){if(R.defined(t)||(t=new T),!R.defined(e)||0===e.length)return t.center=A.Cartesian3.clone(A.Cartesian3.ZERO,t.center),t.radius=0,t;for(var n=A.Cartesian3.clone(e[0],N),r=A.Cartesian3.clone(n,q),a=A.Cartesian3.clone(n,z),i=A.Cartesian3.clone(n,I),s=A.Cartesian3.clone(n,P),o=A.Cartesian3.clone(n,D),u=A.Cartesian3.clone(n,U),l=e.length,c=1;c<l;c++){A.Cartesian3.clone(e[c],n);var d=n.x,f=n.y,h=n.z;d<r.x&&A.Cartesian3.clone(n,r),d>s.x&&A.Cartesian3.clone(n,s),f<a.y&&A.Cartesian3.clone(n,a),f>o.y&&A.Cartesian3.clone(n,o),h<i.z&&A.Cartesian3.clone(n,i),h>u.z&&A.Cartesian3.clone(n,u)}var p=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(s,r,V)),m=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(o,a,V)),y=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(u,i,V)),w=r,C=s,p=p;p<m&&(p=m,w=a,C=o),p<y&&(p=y,w=i,C=u);var v=H;v.x=.5*(w.x+C.x),v.y=.5*(w.y+C.y),v.z=.5*(w.z+C.z);var g=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(C,v,V)),x=Math.sqrt(g),w=J;w.x=r.x,w.y=a.y,w.z=i.z;C=G;C.x=s.x,C.y=o.y,C.z=u.z;var E=A.Cartesian3.midpoint(w,C,Q),O=0;for(c=0;c<l;c++){A.Cartesian3.clone(e[c],n);var _=A.Cartesian3.magnitude(A.Cartesian3.subtract(n,E,V));O<_&&(O=_);var S=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(n,v,V));g<S&&(g=(x=.5*(x+(_=Math.sqrt(S))))*x,S=_-x,v.x=(x*v.x+S*n.x)/_,v.y=(x*v.y+S*n.y)/_,v.z=(x*v.z+S*n.z)/_)}return x<O?(A.Cartesian3.clone(v,t.center),t.radius=x):(A.Cartesian3.clone(E,t.center),t.radius=O),t};var $=new t,ee=new A.Cartesian3,te=new A.Cartesian3,ne=new A.Cartographic,re=new A.Cartographic;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(e,t,n,r,a){if(R.defined(a)||(a=new T),!R.defined(e))return a.center=A.Cartesian3.clone(A.Cartesian3.ZERO,a.center),a.radius=0,a;t=R.defaultValue(t,$),A.Rectangle.southwest(e,ne),ne.height=n,A.Rectangle.northeast(e,re),re.height=r;var i=t.project(ne,ee),n=t.project(re,te),e=n.x-i.x,r=n.y-i.y,t=n.z-i.z;a.radius=.5*Math.sqrt(e*e+r*r+t*t);n=a.center;return n.x=i.x+.5*e,n.y=i.y+.5*r,n.z=i.z+.5*t,a};var ae=[];T.fromRectangle3D=function(e,t,n,r){if(t=R.defaultValue(t,A.Ellipsoid.WGS84),n=R.defaultValue(n,0),R.defined(r)||(r=new T),!R.defined(e))return r.center=A.Cartesian3.clone(A.Cartesian3.ZERO,r.center),r.radius=0,r;n=A.Rectangle.subsample(e,t,n,ae);return T.fromPoints(n,r)},T.fromVertices=function(e,t,n,r){if(R.defined(r)||(r=new T),!R.defined(e)||0===e.length)return r.center=A.Cartesian3.clone(A.Cartesian3.ZERO,r.center),r.radius=0,r;t=R.defaultValue(t,A.Cartesian3.ZERO),n=R.defaultValue(n,3);var a=N;a.x=e[0]+t.x,a.y=e[1]+t.y,a.z=e[2]+t.z;for(var i=A.Cartesian3.clone(a,q),s=A.Cartesian3.clone(a,z),o=A.Cartesian3.clone(a,I),u=A.Cartesian3.clone(a,P),l=A.Cartesian3.clone(a,D),c=A.Cartesian3.clone(a,U),d=e.length,f=0;f<d;f+=n){var h=e[f]+t.x,p=e[f+1]+t.y,m=e[f+2]+t.z;a.x=h,a.y=p,a.z=m,h<i.x&&A.Cartesian3.clone(a,i),h>u.x&&A.Cartesian3.clone(a,u),p<s.y&&A.Cartesian3.clone(a,s),p>l.y&&A.Cartesian3.clone(a,l),m<o.z&&A.Cartesian3.clone(a,o),m>c.z&&A.Cartesian3.clone(a,c)}var y=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(u,i,V)),w=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(l,s,V)),C=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(c,o,V)),v=i,g=u,y=y;y<w&&(y=w,v=s,g=l),y<C&&(y=C,v=o,g=c);var x=H;x.x=.5*(v.x+g.x),x.y=.5*(v.y+g.y),x.z=.5*(v.z+g.z);var E=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(g,x,V)),O=Math.sqrt(E),v=J;v.x=i.x,v.y=s.y,v.z=o.z;g=G;g.x=u.x,g.y=l.y,g.z=c.z;var _=A.Cartesian3.midpoint(v,g,Q),S=0;for(f=0;f<d;f+=n){a.x=e[f]+t.x,a.y=e[f+1]+t.y,a.z=e[f+2]+t.z;var b=A.Cartesian3.magnitude(A.Cartesian3.subtract(a,_,V));S<b&&(S=b);var M=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(a,x,V));E<M&&(E=(O=.5*(O+(b=Math.sqrt(M))))*O,M=b-O,x.x=(O*x.x+M*a.x)/b,x.y=(O*x.y+M*a.y)/b,x.z=(O*x.z+M*a.z)/b)}return O<S?(A.Cartesian3.clone(x,r.center),r.radius=O):(A.Cartesian3.clone(_,r.center),r.radius=S),r},T.fromEncodedCartesianVertices=function(e,t,n){if(R.defined(n)||(n=new T),!R.defined(e)||!R.defined(t)||e.length!==t.length||0===e.length)return n.center=A.Cartesian3.clone(A.Cartesian3.ZERO,n.center),n.radius=0,n;var r=N;r.x=e[0]+t[0],r.y=e[1]+t[1],r.z=e[2]+t[2];for(var a=A.Cartesian3.clone(r,q),i=A.Cartesian3.clone(r,z),s=A.Cartesian3.clone(r,I),o=A.Cartesian3.clone(r,P),u=A.Cartesian3.clone(r,D),l=A.Cartesian3.clone(r,U),c=e.length,d=0;d<c;d+=3){var f=e[d]+t[d],h=e[d+1]+t[d+1],p=e[d+2]+t[d+2];r.x=f,r.y=h,r.z=p,f<a.x&&A.Cartesian3.clone(r,a),f>o.x&&A.Cartesian3.clone(r,o),h<i.y&&A.Cartesian3.clone(r,i),h>u.y&&A.Cartesian3.clone(r,u),p<s.z&&A.Cartesian3.clone(r,s),p>l.z&&A.Cartesian3.clone(r,l)}var m=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(o,a,V)),y=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(u,i,V)),w=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(l,s,V)),C=a,v=o,m=m;m<y&&(m=y,C=i,v=u),m<w&&(m=w,C=s,v=l);var g=H;g.x=.5*(C.x+v.x),g.y=.5*(C.y+v.y),g.z=.5*(C.z+v.z);var x=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(v,g,V)),E=Math.sqrt(x),C=J;C.x=a.x,C.y=i.y,C.z=s.z;v=G;v.x=o.x,v.y=u.y,v.z=l.z;var O=A.Cartesian3.midpoint(C,v,Q),_=0;for(d=0;d<c;d+=3){r.x=e[d]+t[d],r.y=e[d+1]+t[d+1],r.z=e[d+2]+t[d+2];var S=A.Cartesian3.magnitude(A.Cartesian3.subtract(r,O,V));_<S&&(_=S);var b=A.Cartesian3.magnitudeSquared(A.Cartesian3.subtract(r,g,V));x<b&&(x=(E=.5*(E+(S=Math.sqrt(b))))*E,b=S-E,g.x=(E*g.x+b*r.x)/S,g.y=(E*g.y+b*r.y)/S,g.z=(E*g.z+b*r.z)/S)}return E<_?(A.Cartesian3.clone(g,n.center),n.radius=E):(A.Cartesian3.clone(O,n.center),n.radius=_),n},T.fromCornerPoints=function(e,t,n){R.defined(n)||(n=new T);e=A.Cartesian3.midpoint(e,t,n.center);return n.radius=A.Cartesian3.distance(e,t),n},T.fromEllipsoid=function(e,t){return R.defined(t)||(t=new T),A.Cartesian3.clone(A.Cartesian3.ZERO,t.center),t.radius=e.maximumRadius,t};var ie=new A.Cartesian3;T.fromBoundingSpheres=function(e,t){if(R.defined(t)||(t=new T),!R.defined(e)||0===e.length)return t.center=A.Cartesian3.clone(A.Cartesian3.ZERO,t.center),t.radius=0,t;var n=e.length;if(1===n)return T.clone(e[0],t);if(2===n)return T.union(e[0],e[1],t);for(var r=[],a=0;a<n;a++)r.push(e[a].center);var i=(t=T.fromPoints(r,t)).center,s=t.radius;for(a=0;a<n;a++)var o=e[a],s=Math.max(s,A.Cartesian3.distance(i,o.center,ie)+o.radius);return t.radius=s,t};var se=new A.Cartesian3,oe=new A.Cartesian3,ue=new A.Cartesian3;T.fromOrientedBoundingBox=function(e,t){R.defined(t)||(t=new T);var n=e.halfAxes,r=B.getColumn(n,0,se),a=B.getColumn(n,1,oe),n=B.getColumn(n,2,ue);return A.Cartesian3.add(r,a,r),A.Cartesian3.add(r,n,r),t.center=A.Cartesian3.clone(e.center,t.center),t.radius=A.Cartesian3.magnitude(r),t},T.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.center=A.Cartesian3.clone(e.center,t.center),t.radius=e.radius,t):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(e,t,n){n=R.defaultValue(n,0);var r=e.center;return t[n++]=r.x,t[n++]=r.y,t[n++]=r.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=R.defaultValue(t,0);var r=(n=!R.defined(n)?new T:n).center;return r.x=e[t++],r.y=e[t++],r.z=e[t++],n.radius=e[t],n};var le=new A.Cartesian3,ce=new A.Cartesian3;T.union=function(e,t,n){R.defined(n)||(n=new T);var r=e.center,a=e.radius,i=t.center,s=t.radius,o=A.Cartesian3.subtract(i,r,le),i=A.Cartesian3.magnitude(o);if(i+s<=a)return e.clone(n),n;if(i+a<=s)return t.clone(n),n;s=.5*(a+i+s),i=A.Cartesian3.multiplyByScalar(o,(s-a)/i,ce);return A.Cartesian3.add(i,r,i),A.Cartesian3.clone(i,n.center),n.radius=s,n};var de=new A.Cartesian3;T.expand=function(e,t,n){n=T.clone(e,n);t=A.Cartesian3.magnitude(A.Cartesian3.subtract(t,n.center,de));return t>n.radius&&(n.radius=t),n},T.intersectPlane=function(e,t){var n=e.center,r=e.radius,e=t.normal,t=A.Cartesian3.dot(e,n)+t.distance;return t<-r?a.OUTSIDE:t<r?a.INTERSECTING:a.INSIDE},T.transform=function(e,t,n){return(n=!R.defined(n)?new T:n).center=j.multiplyByPoint(t,e.center,n.center),n.radius=j.getMaximumScale(t)*e.radius,n};var fe=new A.Cartesian3;T.distanceSquaredTo=function(e,t){t=A.Cartesian3.subtract(e.center,t,fe);return A.Cartesian3.magnitudeSquared(t)-e.radius*e.radius},T.transformWithoutScale=function(e,t,n){return(n=!R.defined(n)?new T:n).center=j.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var he=new A.Cartesian3;T.computePlaneDistances=function(e,t,n,r){R.defined(r)||(r=new i);t=A.Cartesian3.subtract(e.center,t,he),t=A.Cartesian3.dot(n,t);return r.start=t-e.radius,r.stop=t+e.radius,r};for(var pe=new A.Cartesian3,me=new A.Cartesian3,ye=new A.Cartesian3,we=new A.Cartesian3,Ce=new A.Cartesian3,ve=new A.Cartographic,ge=new Array(8),xe=0;xe<8;++xe)ge[xe]=new A.Cartesian3;var Ee,Oe=new t;T.projectTo2D=function(e,t,n){var r=(t=R.defaultValue(t,Oe)).ellipsoid,a=e.center,i=e.radius,s=A.Cartesian3.equals(a,A.Cartesian3.ZERO)?A.Cartesian3.clone(A.Cartesian3.UNIT_X,pe):r.geodeticSurfaceNormal(a,pe),o=A.Cartesian3.cross(A.Cartesian3.UNIT_Z,s,me);A.Cartesian3.normalize(o,o);var u=A.Cartesian3.cross(s,o,ye);A.Cartesian3.normalize(u,u),A.Cartesian3.multiplyByScalar(s,i,s),A.Cartesian3.multiplyByScalar(u,i,u),A.Cartesian3.multiplyByScalar(o,i,o);var l=A.Cartesian3.negate(u,Ce),e=A.Cartesian3.negate(o,we),c=ge,i=c[0];A.Cartesian3.add(s,u,i),A.Cartesian3.add(i,o,i),i=c[1],A.Cartesian3.add(s,u,i),A.Cartesian3.add(i,e,i),i=c[2],A.Cartesian3.add(s,l,i),A.Cartesian3.add(i,e,i),i=c[3],A.Cartesian3.add(s,l,i),A.Cartesian3.add(i,o,i),A.Cartesian3.negate(s,s),i=c[4],A.Cartesian3.add(s,u,i),A.Cartesian3.add(i,o,i),i=c[5],A.Cartesian3.add(s,u,i),A.Cartesian3.add(i,e,i),i=c[6],A.Cartesian3.add(s,l,i),A.Cartesian3.add(i,e,i),i=c[7],A.Cartesian3.add(s,l,i),A.Cartesian3.add(i,o,i);for(var d=c.length,f=0;f<d;++f){var h=c[f];A.Cartesian3.add(a,h,h);var p=r.cartesianToCartographic(h,ve);t.project(p,h)}l=(a=(n=T.fromPoints(c,n)).center).x,o=a.y,i=a.z;return a.x=i,a.y=l,a.z=o,n},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&A.Cartesian3.equals(e.center,t.center)&&e.radius===t.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T.prototype.volume=function(){var e=this.radius;return K*e*e*e};var _e,Se,be,Me,Ae,Re,Te,qe,ze,Ie,Pe,De,Ue,Ne,Ve,Fe,Le,Be={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},We={};function je(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function ke(){var e;return R.defined(Se)||(Se=!1,He()||null!==(e=/ Chrome\/([\.0-9]+)/.exec(_e.userAgent))&&(Se=!0,be=je(e[1]))),Se}function Ye(){var e;return R.defined(Me)||(Me=!1,ke()||He()||!/ Safari\/[\.0-9]+/.test(_e.userAgent)||null!==(e=/ Version\/([\.0-9]+)/.exec(_e.userAgent))&&(Me=!0,Ae=je(e[1]))),Me}function Ze(){var e;return R.defined(Re)||(Re=!1,null!==(e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_e.userAgent))&&(Re=!0,(Te=je(e[1])).isNightly=!!e[2])),Re}function Xe(){var e;return R.defined(qe)||(qe=!1,"Microsoft Internet Explorer"===_e.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_e.userAgent))&&(qe=!0,ze=je(e[1])):"Netscape"===_e.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_e.userAgent))&&(qe=!0,ze=je(e[1]))),qe}function He(){var e;return R.defined(Ie)||(Ie=!1,null!==(e=/ Edge\/([\.0-9]+)/.exec(_e.userAgent))&&(Ie=!0,Pe=je(e[1]))),Ie}function Je(){var e;return R.defined(De)||(De=!1,null!==(e=/Firefox\/([\.0-9]+)/.exec(_e.userAgent))&&(De=!0,Ue=je(e[1]))),De}function Ge(){var e;return R.defined(Le)||((e=document.createElement("canvas")).setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;"),e=e.style.imageRendering,(Le=R.defined(e)&&""!==e)&&(Fe=e)),Le}function Qe(){return Qe._result}Object.defineProperties(We,{element:{get:function(){if(We.supportsFullscreen())return document[Be.fullscreenElement]}},changeEventName:{get:function(){if(We.supportsFullscreen())return Be.fullscreenchange}},errorEventName:{get:function(){if(We.supportsFullscreen())return Be.fullscreenerror}},enabled:{get:function(){if(We.supportsFullscreen())return document[Be.fullscreenEnabled]}},fullscreen:{get:function(){if(We.supportsFullscreen())return null!==We.element}}}),We.supportsFullscreen=function(){if(R.defined(Ee))return Ee;Ee=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return Be.requestFullscreen="requestFullscreen",Be.exitFullscreen="exitFullscreen",Be.fullscreenEnabled="fullscreenEnabled",Be.fullscreenElement="fullscreenElement",Be.fullscreenchange="fullscreenchange",Be.fullscreenerror="fullscreenerror",Ee=!0;for(var t=["webkit","moz","o","ms","khtml"],n=0,r=t.length;n<r;++n){var a,i=t[n];"function"!=typeof e[a=i+"RequestFullscreen"]&&"function"!=typeof e[a=i+"RequestFullScreen"]||(Be.requestFullscreen=a,Ee=!0),a=i+"ExitFullscreen","function"==typeof document[a]?Be.exitFullscreen=a:(a=i+"CancelFullScreen","function"==typeof document[a]&&(Be.exitFullscreen=a)),a=i+"FullscreenEnabled",void 0!==document[a]?Be.fullscreenEnabled=a:(a=i+"FullScreenEnabled",void 0!==document[a]&&(Be.fullscreenEnabled=a)),a=i+"FullscreenElement",void 0!==document[a]?Be.fullscreenElement=a:(a=i+"FullScreenElement",void 0!==document[a]&&(Be.fullscreenElement=a)),a=i+"fullscreenchange",void 0!==document["on"+a]&&("ms"===i&&(a="MSFullscreenChange"),Be.fullscreenchange=a),a=i+"fullscreenerror",void 0!==document["on"+a]&&("ms"===i&&(a="MSFullscreenError"),Be.fullscreenerror=a)}return Ee},We.requestFullscreen=function(e,t){We.supportsFullscreen()&&e[Be.requestFullscreen]({vrDisplay:t})},We.exitFullscreen=function(){We.supportsFullscreen()&&document[Be.exitFullscreen]()},We._names=Be,_e="undefined"!=typeof navigator?navigator:{},Qe._promise=void 0,Qe._result=void 0,Qe.initialize=function(){if(R.defined(Qe._promise))return Qe._promise;var e=R.when.defer();if(Qe._promise=e.promise,He())return Qe._result=!1,e.resolve(Qe._result),e.promise;var t=new Image;return t.onload=function(){Qe._result=0<t.width&&0<t.height,e.resolve(Qe._result)},t.onerror=function(){Qe._result=!1,e.resolve(Qe._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},Object.defineProperties(Qe,{initialized:{get:function(){return R.defined(Qe._result)}}});C=[];"undefined"!=typeof ArrayBuffer&&(C.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&C.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&C.push(Uint8ClampedArray));var Ke={isChrome:ke,chromeVersion:function(){return ke()&&be},isSafari:Ye,safariVersion:function(){return Ye()&&Ae},isWebkit:Ze,webkitVersion:function(){return Ze()&&Te},isInternetExplorer:Xe,internetExplorerVersion:function(){return Xe()&&ze},isEdge:He,edgeVersion:function(){return He()&&Pe},isFirefox:Je,firefoxVersion:function(){return Je()&&Ue},isWindows:function(){return Ne=!R.defined(Ne)?/Windows/i.test(_e.appVersion):Ne},hardwareConcurrency:R.defaultValue(_e.hardwareConcurrency,3),supportsPointerEvents:function(){return Ve=!R.defined(Ve)?!Je()&&"undefined"!=typeof PointerEvent&&(!R.defined(_e.pointerEnabled)||_e.pointerEnabled):Ve},supportsImageRenderingPixelated:Ge,supportsWebP:Qe,imageRenderingValue:function(){return Ge()?Fe:void 0},typedArrayTypes:C};function $e(e,t,n,r){this.x=R.defaultValue(e,0),this.y=R.defaultValue(t,0),this.z=R.defaultValue(n,0),this.w=R.defaultValue(r,0)}Ke.supportsFullscreen=function(){return We.supportsFullscreen()},Ke.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},Ke.supportsWebWorkers=function(){return"undefined"!=typeof Worker},Ke.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!Ke.isEdge()};var et=new A.Cartesian3;$e.fromAxisAngle=function(e,t,n){var r=t/2,a=Math.sin(r),t=(et=A.Cartesian3.normalize(e,et)).x*a,e=et.y*a,a=et.z*a,r=Math.cos(r);return R.defined(n)?(n.x=t,n.y=e,n.z=a,n.w=r,n):new $e(t,e,a,r)};var tt=[1,2,0],nt=new Array(3);$e.fromRotationMatrix=function(e,t){var n,r,a,i,s=e[B.COLUMN0ROW0],o=e[B.COLUMN1ROW1],u=e[B.COLUMN2ROW2],l=s+o+u,c=0<l?(a=.5*(i=Math.sqrt(l+1)),i=.5/i,n=(e[B.COLUMN1ROW2]-e[B.COLUMN2ROW1])*i,r=(e[B.COLUMN2ROW0]-e[B.COLUMN0ROW2])*i,(e[B.COLUMN0ROW1]-e[B.COLUMN1ROW0])*i):(o=tt[s=tt[u=s<u&&o<u?2:s<o?1:0]],i=Math.sqrt(e[B.getElementIndex(u,u)]-e[B.getElementIndex(s,s)]-e[B.getElementIndex(o,o)]+1),(c=nt)[u]=.5*i,i=.5/i,a=(e[B.getElementIndex(o,s)]-e[B.getElementIndex(s,o)])*i,c[s]=(e[B.getElementIndex(s,u)]+e[B.getElementIndex(u,s)])*i,c[o]=(e[B.getElementIndex(o,u)]+e[B.getElementIndex(u,o)])*i,n=-c[0],r=-c[1],-c[2]);return R.defined(t)?(t.x=n,t.y=r,t.z=c,t.w=a,t):new $e(n,r,c,a)};var rt=new $e,at=new $e,it=new $e,st=new $e;$e.fromHeadingPitchRoll=function(e,t){return st=$e.fromAxisAngle(A.Cartesian3.UNIT_X,e.roll,rt),it=$e.fromAxisAngle(A.Cartesian3.UNIT_Y,-e.pitch,t),t=$e.multiply(it,st,it),at=$e.fromAxisAngle(A.Cartesian3.UNIT_Z,-e.heading,rt),$e.multiply(at,t,t)};var ot=new A.Cartesian3,ut=new A.Cartesian3,lt=new $e,ct=new $e,dt=new $e;$e.packedLength=4,$e.pack=function(e,t,n){return n=R.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},$e.unpack=function(e,t,n){return t=R.defaultValue(t,0),(n=!R.defined(n)?new $e:n).x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},$e.packedInterpolationLength=3,$e.convertPackedArrayForInterpolation=function(e,t,n,r){$e.unpack(e,4*n,dt),$e.conjugate(dt,dt);for(var a=0,i=n-t+1;a<i;a++){var s=3*a;$e.unpack(e,4*(t+a),lt),$e.multiply(lt,dt,lt),lt.w<0&&$e.negate(lt,lt),$e.computeAxis(lt,ot);var o=$e.computeAngle(lt);(r=!R.defined(r)?[]:r)[s]=ot.x*o,r[1+s]=ot.y*o,r[2+s]=ot.z*o}},$e.unpackInterpolationResult=function(e,t,n,r,a){R.defined(a)||(a=new $e),A.Cartesian3.fromArray(e,0,ut);e=A.Cartesian3.magnitude(ut);return $e.unpack(t,4*r,ct),0===e?$e.clone($e.IDENTITY,lt):$e.fromAxisAngle(ut,e,lt),$e.multiply(lt,ct,a)},$e.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new $e(e.x,e.y,e.z,e.w)},$e.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},$e.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},$e.magnitude=function(e){return Math.sqrt($e.magnitudeSquared(e))},$e.normalize=function(e,t){var n=1/$e.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,n=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=n,t},$e.inverse=function(e,t){var n=$e.magnitudeSquared(e);return t=$e.conjugate(e,t),$e.multiplyByScalar(t,1/n,t)},$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.w=e.w+t.w,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.w=e.w-t.w,n},$e.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},$e.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},$e.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,s=e.w,o=t.x,u=t.y,l=t.z,c=t.w,d=s*o+r*c+a*l-i*u,e=s*u-r*l+a*c+i*o,t=s*l+r*u-a*o+i*c,l=s*c-r*o-a*u-i*l;return n.x=d,n.y=e,n.z=t,n.w=l,n},$e.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},$e.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},$e.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<F.CesiumMath.EPSILON6)return t.x=t.y=t.z=0,t;n=1/Math.sqrt(1-n*n);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},$e.computeAngle=function(e){return Math.abs(e.w-1)<F.CesiumMath.EPSILON6?0:2*Math.acos(e.w)};var ft=new $e;$e.lerp=function(e,t,n,r){return ft=$e.multiplyByScalar(t,n,ft),r=$e.multiplyByScalar(e,1-n,r),$e.add(ft,r,r)};var ht=new $e,pt=new $e,mt=new $e;$e.slerp=function(e,t,n,r){var a=$e.dot(e,t),i=t;if(a<0&&(a=-a,i=ht=$e.negate(t,ht)),1-a<F.CesiumMath.EPSILON6)return $e.lerp(e,i,n,r);a=Math.acos(a);return pt=$e.multiplyByScalar(e,Math.sin((1-n)*a),pt),mt=$e.multiplyByScalar(i,Math.sin(n*a),mt),r=$e.add(pt,mt,r),$e.multiplyByScalar(r,1/Math.sin(a),r)},$e.log=function(e,t){var n=F.CesiumMath.acosClamped(e.w),r=0;return 0!==n&&(r=n/Math.sin(n)),A.Cartesian3.multiplyByScalar(e,r,t)},$e.exp=function(e,t){var n=A.Cartesian3.magnitude(e),r=0;return 0!==n&&(r=Math.sin(n)/n),t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t.w=Math.cos(n),t};var yt=new A.Cartesian3,wt=new A.Cartesian3,Ct=new $e,vt=new $e;$e.computeInnerQuadrangle=function(e,t,n,r){var a=$e.conjugate(t,Ct);$e.multiply(a,n,vt);n=$e.log(vt,yt);$e.multiply(a,e,vt);e=$e.log(vt,wt);return A.Cartesian3.add(n,e,n),A.Cartesian3.multiplyByScalar(n,.25,n),A.Cartesian3.negate(n,n),$e.exp(n,Ct),$e.multiply(t,Ct,r)},$e.squad=function(e,t,n,r,a,i){t=$e.slerp(e,t,a,Ct),r=$e.slerp(n,r,a,vt);return $e.slerp(t,r,2*a*(1-a),i)};for(var gt=new $e,C=1.9011074535173003,xt=Ke.supportsTypedArrays()?new Float32Array(8):[],Et=Ke.supportsTypedArrays()?new Float32Array(8):[],Ot=Ke.supportsTypedArrays()?new Float32Array(8):[],_t=Ke.supportsTypedArrays()?new Float32Array(8):[],St=0;St<7;++St){var bt=St+1,Mt=2*bt+1;xt[St]=1/(bt*Mt),Et[St]=bt/Mt}function At(e,t,n){for(var r,a,i=0,s=e.length-1;i<=s;)if((a=n(e[r=~~((i+s)/2)],t))<0)i=1+r;else{if(!(0<a))return r;s=r-1}return~(s+1)}function Rt(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}function Tt(){function v(e,t,n,r){return n=n||" ",n=e.length>=t?"":Array(1+t-e.length>>>0).join(n),r?e+n:n+e}function g(e,t,n,r,a,i){var s=r-e.length;return e=0<s?n||!a?v(e,r,i,n):e.slice(0,t.length)+v("",s,"0",!0)+e.slice(t.length):e}function x(e,t,n,r,a,i,s){var o=e>>>0;return e=(n=n&&o&&{2:"0b",8:"0",16:"0x"}[t]||"")+v(o.toString(t),i||0,"0",!1),g(e,n,r,a,s)}function E(e,t,n,r,a,i){return null!=r&&(e=e.slice(0,r)),g(e,"",t,n,a,i)}var O=arguments,_=0,e=O[_++];return e.replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,function(e,t,n,r,a,i,s){var o,u,l,c,d;if("%%"==e)return"%";for(var f=!1,h="",p=!1,m=!1,y=" ",w=n.length,C=0;n&&C<w;C++)switch(n.charAt(C)){case" ":h=" ";break;case"+":h="+";break;case"-":f=!0;break;case"'":y=n.charAt(C+1);break;case"0":p=!0;break;case"#":m=!0}if((r=r?"*"==r?+O[_++]:"*"==r.charAt(0)?+O[r.slice(1,-1)]:+r:0)<0&&(r=-r,f=!0),!isFinite(r))throw new Error("sprintf: (minimum-)width must be finite");switch(i=i?"*"==i?+O[_++]:"*"==i.charAt(0)?+O[i.slice(1,-1)]:+i:-1<"fFeE".indexOf(s)?6:"d"==s?0:void 0,d=t?O[t.slice(0,-1)]:O[_++],s){case"s":return E(String(d),f,r,i,p,y);case"c":return E(String.fromCharCode(+d),f,r,i,p);case"b":return x(d,2,m,f,r,i,p);case"o":return x(d,8,m,f,r,i,p);case"x":return x(d,16,m,f,r,i,p);case"X":return x(d,16,m,f,r,i,p).toUpperCase();case"u":return x(d,10,m,f,r,i,p);case"i":case"d":return o=+d||0,d=(u=(o=Math.round(o-o%1))<0?"-":h)+v(String(Math.abs(o)),i,"0",!1),g(d,u,f,r,p);case"e":case"E":case"f":case"F":case"g":case"G":return u=(o=+d)<0?"-":h,l=["toExponential","toFixed","toPrecision"]["efg".indexOf(s.toLowerCase())],c=["toString","toUpperCase"]["eEfFgG".indexOf(s)%2],d=u+Math.abs(o)[l](i),g(d,u,f,r,p)[c]();default:return e}})}function qt(e,t,n,r,a,i,s,o){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=s,this.isLeapSecond=o}function zt(e){return e%4==0&&e%100!=0||e%400==0}function It(e,t){this.julianDate=e,this.offset=t}xt[7]=C/136,Et[7]=8*C/17,$e.fastSlerp=function(e,t,n,r){var a,i=$e.dot(e,t);0<=i?a=1:(a=-1,i=-i);for(var s=i-1,i=1-n,o=n*n,u=i*i,l=7;0<=l;--l)Ot[l]=(xt[l]*o-Et[l])*s,_t[l]=(xt[l]*u-Et[l])*s;n=a*n*(1+Ot[0]*(1+Ot[1]*(1+Ot[2]*(1+Ot[3]*(1+Ot[4]*(1+Ot[5]*(1+Ot[6]*(1+Ot[7])))))))),i*=1+_t[0]*(1+_t[1]*(1+_t[2]*(1+_t[3]*(1+_t[4]*(1+_t[5]*(1+_t[6]*(1+_t[7]))))))),i=$e.multiplyByScalar(e,i,gt);return $e.multiplyByScalar(t,n,r),$e.add(i,r,r)},$e.fastSquad=function(e,t,n,r,a,i){t=$e.fastSlerp(e,t,a,Ct),r=$e.fastSlerp(n,r,a,vt);return $e.fastSlerp(t,r,2*a*(1-a),i)},$e.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},$e.equalsEpsilon=function(e,t,n){return n=R.defaultValue(n,0),e===t||R.defined(e)&&R.defined(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},$e.ZERO=Object.freeze(new $e(0,0,0,0)),$e.IDENTITY=Object.freeze(new $e(0,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){return $e.equalsEpsilon(this,e,t)},$e.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var Pt=Object.freeze({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:2400000.5}),Dt=Object.freeze({UTC:0,TAI:1}),Ut=new qt,Nt=[31,28,31,30,31,30,31,31,30,31,30,31];function Vt(e,t){return Kt.compare(e.julianDate,t.julianDate)}var Ft=new It;function Lt(e){Ft.julianDate=e;var t=Kt.leapSeconds,n=At(t,Ft,Vt),r=t[n=(n=n<0?~n:n)>=t.length?t.length-1:n].offset;0<n&&r<Kt.secondsDifference(t[n].julianDate,e)&&(r=t[--n].offset),Kt.addSeconds(e,r,e)}function Bt(e,t){Ft.julianDate=e;var n=Kt.leapSeconds,r=At(n,Ft,Vt);if(0===(r=r<0?~r:r))return Kt.addSeconds(e,-n[0].offset,t);if(r>=n.length)return Kt.addSeconds(e,-n[r-1].offset,t);var a=Kt.secondsDifference(n[r].julianDate,e);return 0===a?Kt.addSeconds(e,-n[r].offset,t):a<=1?void 0:Kt.addSeconds(e,-n[--r].offset,t)}function Wt(e,t,n){var r=t/Pt.SECONDS_PER_DAY|0;return e+=r,(t-=Pt.SECONDS_PER_DAY*r)<0&&(e--,t+=Pt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function jt(e,t,n,r,a,i,s){var o=(t-14)/12|0,e=e+4800+o,n=(1461*e/4|0)+(367*(t-2-12*o)/12|0)-(3*((e+100)/100|0)/4|0)+n-32075;(r-=12)<0&&(r+=24);s=i+(r*Pt.SECONDS_PER_HOUR+a*Pt.SECONDS_PER_MINUTE+s*Pt.SECONDS_PER_MILLISECOND);return 43200<=s&&--n,[n,s]}var kt=/^(\d{4})$/,Yt=/^(\d{4})-(\d{2})$/,Zt=/^(\d{4})-?(\d{3})$/,Xt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Ht=/^(\d{4})-?(\d{2})-?(\d{2})$/,C=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Jt=/^(\d{2})(\.\d+)?/.source+C.source,Gt=/^(\d{2}):?(\d{2})(\.\d+)?/.source+C.source,Qt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+C.source;function Kt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=R.defaultValue(e,0),t=R.defaultValue(t,0),n=R.defaultValue(n,Dt.UTC);var r=0|e;Wt(r,t+=(e-r)*Pt.SECONDS_PER_DAY,this),n===Dt.UTC&&Lt(this)}Kt.fromGregorianDate=function(e,t){e=jt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return R.defined(t)?(Wt(e[0],e[1],t),Lt(t),t):new Kt(e[0],e[1],Dt.UTC)},Kt.fromDate=function(e,t){e=jt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return R.defined(t)?(Wt(e[0],e[1],t),Lt(t),t):new Kt(e[0],e[1],Dt.UTC)},Kt.fromIso8601=function(e,t){var n,r,a,i,s,o=(e=e.replace(",",".")).split("T"),u=1,l=1,c=0,d=0,f=0,h=0,p=o[0],e=o[1];if(null!==(o=p.match(Ht))?(a=+o[1],u=+o[2],l=+o[3]):null!==(o=p.match(Yt))?(a=+o[1],u=+o[2]):null!==(o=p.match(kt))?a=+o[1]:(null!==(o=p.match(Zt))?(a=+o[1],i=+o[2],r=zt(a)):null!==(o=p.match(Xt))&&(a=+o[1],i=7*+o[2]+(+o[3]||0)-new Date(Date.UTC(a,0,4)).getUTCDay()-3),(n=new Date(Date.UTC(a,0,1))).setUTCDate(i),u=n.getUTCMonth()+1,l=n.getUTCDate()),r=zt(a),R.defined(e)){null!==(o=e.match(Qt))?(c=+o[1],d=+o[2],f=+o[3],h=1e3*+(o[4]||0),s=5):null!==(o=e.match(Gt))?(c=+o[1],d=+o[2],f=60*+(o[3]||0),s=4):null!==(o=e.match(Jt))&&(c=+o[1],d=60*+(o[2]||0),s=3);var m=o[s],y=+o[s+1],w=+(o[s+2]||0);switch(m){case"+":c-=y,d-=w;break;case"-":c+=y,d+=w;break;case"Z":break;default:d+=new Date(Date.UTC(a,u-1,l,c,d)).getTimezoneOffset()}}m=60===f;for(m&&f--;60<=d;)d-=60,c++;for(;24<=c;)c-=24,l++;for(n=r&&2===u?29:Nt[u-1];n<l;)l-=n,12<++u&&(u-=12,a++),n=r&&2===u?29:Nt[u-1];for(;d<0;)d+=60,c--;for(;c<0;)c+=24,l--;for(;l<1;)--u<1&&(u+=12,a--),l+=n=r&&2===u?29:Nt[u-1];h=jt(a,u,l,c,d,f,h);return R.defined(t)?(Wt(h[0],h[1],t),Lt(t)):t=new Kt(h[0],h[1],Dt.UTC),m&&Kt.addSeconds(t,1,t),t},Kt.now=function(e){return Kt.fromDate(new Date,e)};var $t=new Kt(0,0,Dt.TAI);function en(e){e instanceof en?(this.scheme=e.scheme,this.authority=e.authority,this.path=e.path,this.query=e.query,this.fragment=e.fragment):e&&(e=tn.exec(e),this.scheme=e[1],this.authority=e[2],this.path=e[3],this.query=e[4],this.fragment=e[5])}Kt.toGregorianDate=function(e,t){var n=!1,r=Bt(e,$t);R.defined(r)||(Kt.addSeconds(e,-1,$t),r=Bt($t,$t),n=!0);var a=r.dayNumber,i=r.secondsOfDay;43200<=i&&(a+=1);var s=a+68569|0,o=4*s/146097|0,u=4e3*(1+(s=s-((146097*o+3)/4|0)|0))/1461001|0,e=80*(s=s-(1461*u/4|0)+31|0)/2447|0,r=s-(2447*e/80|0)|0,a=2+e-12*(s=e/11|0)|0,e=100*(o-49)+u+s|0,o=i/Pt.SECONDS_PER_HOUR|0,u=i-o*Pt.SECONDS_PER_HOUR,s=u/Pt.SECONDS_PER_MINUTE|0,i=0|(u-=s*Pt.SECONDS_PER_MINUTE),u=(u-i)/Pt.SECONDS_PER_MILLISECOND;return 23<(o+=12)&&(o-=24),n&&(i+=1),R.defined(t)?(t.year=e,t.month=a,t.day=r,t.hour=o,t.minute=s,t.second=i,t.millisecond=u,t.isLeapSecond=n,t):new qt(e,a,r,o,s,i,u,n)},Kt.toDate=function(e){var t=Kt.toGregorianDate(e,Ut),e=t.second;return t.isLeapSecond&&--e,new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,e,t.millisecond))},Kt.toIso8601=function(e,t){var n=Kt.toGregorianDate(e,Ut),r=n.year,a=n.month,i=n.day,s=n.hour,o=n.minute,e=n.second,n=n.millisecond;return 1e4===r&&1===a&&1===i&&0===s&&0===o&&0===e&&0===n&&(r=9999,a=12,i=31,s=24),R.defined(t)||0===n?R.defined(t)&&0!==t?Tt("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,a,i,s,o,e,(.01*n).toFixed(t).replace(".","").slice(0,t)):Tt("%04d-%02d-%02dT%02d:%02d:%02dZ",r,a,i,s,o,e):Tt("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,a,i,s,o,e,(.01*n).toString().replace(".",""))},Kt.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Kt(e.dayNumber,e.secondsOfDay,Dt.TAI)},Kt.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!=n?n:e.secondsOfDay-t.secondsOfDay},Kt.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},Kt.equalsEpsilon=function(e,t,n){return n=R.defaultValue(n,0),e===t||R.defined(e)&&R.defined(t)&&Math.abs(Kt.secondsDifference(e,t))<=n},Kt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/Pt.SECONDS_PER_DAY},Kt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*Pt.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},Kt.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/Pt.SECONDS_PER_DAY},Kt.computeTaiMinusUtc=function(e){Ft.julianDate=e;var t=Kt.leapSeconds,e=At(t,Ft,Vt);return e<0&&(e=~e,--e<0&&(e=0)),t[e].offset},Kt.addSeconds=function(e,t,n){return Wt(e.dayNumber,e.secondsOfDay+t,n)},Kt.addMinutes=function(e,t,n){t=e.secondsOfDay+t*Pt.SECONDS_PER_MINUTE;return Wt(e.dayNumber,t,n)},Kt.addHours=function(e,t,n){t=e.secondsOfDay+t*Pt.SECONDS_PER_HOUR;return Wt(e.dayNumber,t,n)},Kt.addDays=function(e,t,n){return Wt(e.dayNumber+t,e.secondsOfDay,n)},Kt.lessThan=function(e,t){return Kt.compare(e,t)<0},Kt.lessThanOrEquals=function(e,t){return Kt.compare(e,t)<=0},Kt.greaterThan=function(e,t){return 0<Kt.compare(e,t)},Kt.greaterThanOrEquals=function(e,t){return 0<=Kt.compare(e,t)},Kt.prototype.clone=function(e){return Kt.clone(this,e)},Kt.prototype.equals=function(e){return Kt.equals(this,e)},Kt.prototype.equalsEpsilon=function(e,t){return Kt.equalsEpsilon(this,e,t)},Kt.prototype.toString=function(){return Kt.toIso8601(this)},Kt.leapSeconds=[new It(new Kt(2441317,43210,Dt.TAI),10),new It(new Kt(2441499,43211,Dt.TAI),11),new It(new Kt(2441683,43212,Dt.TAI),12),new It(new Kt(2442048,43213,Dt.TAI),13),new It(new Kt(2442413,43214,Dt.TAI),14),new It(new Kt(2442778,43215,Dt.TAI),15),new It(new Kt(2443144,43216,Dt.TAI),16),new It(new Kt(2443509,43217,Dt.TAI),17),new It(new Kt(2443874,43218,Dt.TAI),18),new It(new Kt(2444239,43219,Dt.TAI),19),new It(new Kt(2444786,43220,Dt.TAI),20),new It(new Kt(2445151,43221,Dt.TAI),21),new It(new Kt(2445516,43222,Dt.TAI),22),new It(new Kt(2446247,43223,Dt.TAI),23),new It(new Kt(2447161,43224,Dt.TAI),24),new It(new Kt(2447892,43225,Dt.TAI),25),new It(new Kt(2448257,43226,Dt.TAI),26),new It(new Kt(2448804,43227,Dt.TAI),27),new It(new Kt(2449169,43228,Dt.TAI),28),new It(new Kt(2449534,43229,Dt.TAI),29),new It(new Kt(2450083,43230,Dt.TAI),30),new It(new Kt(2450630,43231,Dt.TAI),31),new It(new Kt(2451179,43232,Dt.TAI),32),new It(new Kt(2453736,43233,Dt.TAI),33),new It(new Kt(2454832,43234,Dt.TAI),34),new It(new Kt(2456109,43235,Dt.TAI),35),new It(new Kt(2457204,43236,Dt.TAI),36),new It(new Kt(2457754,43237,Dt.TAI),37)],en.prototype.scheme=null,en.prototype.authority=null,en.prototype.path="",en.prototype.query=null,en.prototype.fragment=null;var tn=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");en.prototype.getScheme=function(){return this.scheme},en.prototype.getAuthority=function(){return this.authority},en.prototype.getPath=function(){return this.path},en.prototype.getQuery=function(){return this.query},en.prototype.getFragment=function(){return this.fragment},en.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},en.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},en.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},en.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(an,on).replace(nn,sn)),this.path&&(this.path=this.path.replace(nn,sn)),this.query&&(this.query=this.query.replace(nn,sn)),this.fragment&&(this.fragment=this.fragment.replace(nn,sn))};var nn=/%[0-9a-z]{2}/gi,rn=/[a-zA-Z0-9\-\._~]/,an=/(.*@)?([^@:]*)(:.*)?/;function sn(e){var t=unescape(e);return rn.test(t)?t:e.toUpperCase()}function on(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}function un(e,t){if(null===e||"object"!=typeof e)return e;t=R.defaultValue(t,!1);var n,r,a=new e.constructor;for(n in e)e.hasOwnProperty(n)&&(r=e[n],t&&(r=un(r,t)),a[n]=r);return a}function ln(e,t,n){n=R.defaultValue(n,!1);var r,a,i,s={},o=R.defined(e),u=R.defined(t);if(o)for(r in e)e.hasOwnProperty(r)&&(a=e[r],u&&n&&"object"==typeof a&&t.hasOwnProperty(r)?(i=t[r],s[r]="object"==typeof i?ln(a,i,n):a):s[r]=a);if(u)for(r in t)t.hasOwnProperty(r)&&!s.hasOwnProperty(r)&&(i=t[r],s[r]=i);return s}function cn(e,t){var n;return"undefined"!=typeof document&&(n=document),cn._implementation(e,t,n)}en.prototype.resolve=function(e){var t=new en;return this.scheme?(t.scheme=this.scheme,t.authority=this.authority,t.path=this.path,t.query=this.query):(t.scheme=e.scheme,this.authority?(t.authority=this.authority,t.path=this.path,t.query=this.query):(t.authority=e.authority,""==this.path?(t.path=e.path,t.query=this.query||e.query):("/"==this.path.charAt(0)?t.path=this.path:e.authority&&""==e.path?t.path="/"+this.path:t.path=e.path.substring(0,e.path.lastIndexOf("/")+1)+this.path,t.removeDotSegments(),t.query=this.query))),t.fragment=this.fragment,t},en.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];for(r&&t.shift(),""==t[0]&&t.shift();t.length;)".."==(e=t.shift())?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},en.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},cn._implementation=function(e,t,n){if(!R.defined(t)){if(void 0===n)return e;t=R.defaultValue(n.baseURI,n.location.href)}t=new en(t);return new en(e).resolve(t).toString()};var dn,fn=/^blob:/i;function hn(e){return fn.test(e)}var pn=/^data:/i;function mn(e){return pn.test(e)}var yn=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),wn=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function Cn(e){e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT);var t=R.defaultValue(e.throttleByServer,!1),n=R.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=R.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=R.defaultValue(e.type,wn.OTHER),this.serverKey=void 0,this.state=yn.UNISSUED,this.deferred=void 0,this.cancelled=!1}function vn(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a,i=n[r],s=i.indexOf(": ");0<s&&(a=i.substring(0,s),s=i.substring(s+2),t[a]=s)}return t}(this.responseHeaders))}function gn(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function xn(e,t){return t-e}function En(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function On(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}Cn.prototype.cancel=function(){this.cancelled=!0},Cn.prototype.clone=function(e){return R.defined(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=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Cn(this)},vn.prototype.toString=function(){var e="Request has failed.";return R.defined(this.statusCode)&&(e+=" Status Code: "+this.statusCode),e},Object.defineProperties(gn.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),gn.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var n=this;return function(){n.removeEventListener(e,t)}},gn.prototype.removeEventListener=function(e,t){for(var n=this._listeners,r=this._scopes,a=-1,i=0;i<n.length;i++)if(n[i]===e&&r[i]===t){a=i;break}return-1!==a&&(this._insideRaiseEvent?(this._toRemove.push(a),n[a]=void 0,r[a]=void 0):(n.splice(a,1),r.splice(a,1)),!0)},gn.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;for(var e=this._listeners,t=this._scopes,n=e.length,r=0;r<n;r++){var a=e[r];R.defined(a)&&e[r].apply(t[r],arguments)}var i=this._toRemove;if(0<(n=i.length)){for(i.sort(xn),r=0;r<n;r++){var s=i[r];e.splice(s,1),t.splice(s,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(En.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){var t=this._length;if(e<t){for(var n=this._array,r=e;r<t;++r)n[r]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),En.prototype.reserve=function(e){e=R.defaultValue(e,this._length),this._array.length=e},En.prototype.heapify=function(e){e=R.defaultValue(e,0);for(var t=this._length,n=this._comparator,r=this._array,a=-1,i=!0;i;){var s=2*(e+1),o=s-1,a=o<t&&n(r[o],r[e])<0?o:e;(a=s<t&&n(r[s],r[a])<0?s:a)!==e?(On(r,a,e),e=a):i=!1}},En.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);0<=t;--t)this.heapify(t)},En.prototype.insert=function(e){var t,n=this._array,r=this._comparator,a=this._maximumLength,i=this._length++;for(i<n.length?n[i]=e:n.push(e);0!==i;){var s=Math.floor((i-1)/2);if(!(r(n[i],n[s])<0))break;On(n,i,s),i=s}return R.defined(a)&&this._length>a&&(t=n[a],this._length=a),t},En.prototype.pop=function(e){if(e=R.defaultValue(e,0),0!==this._length){var t=this._array,n=t[e];return On(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n}};var _n={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Sn=20,bn=new En({comparator:function(e,t){return e.priority-t.priority}});bn.maximumLength=Sn,bn.reserve(Sn);var Mn=[],An={},Rn="undefined"!=typeof document?new en(document.location.href):new en,Tn=new gn;function qn(){}function zn(e){R.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function In(e){var t=R.defaultValue(qn.requestsByServer[e],qn.maximumRequestsPerServer);return An[e]<t}function Pn(e){return e.state===yn.UNISSUED&&(e.state=yn.ISSUED,e.deferred=R.when.defer()),e.deferred.promise}function Dn(e){var t,n,r=Pn(e);return e.state=yn.ACTIVE,Mn.push(e),++_n.numberOfActiveRequests,++_n.numberOfActiveRequestsEver,++An[e.serverKey],e.requestFunction().then((n=e,function(e){var t;n.state!==yn.CANCELLED&&(t=n.deferred,--_n.numberOfActiveRequests,--An[n.serverKey],Tn.raiseEvent(),n.state=yn.RECEIVED,n.deferred=void 0,t.resolve(e))})).otherwise((t=e,function(e){t.state!==yn.CANCELLED&&(++_n.numberOfFailedRequests,--_n.numberOfActiveRequests,--An[t.serverKey],Tn.raiseEvent(e),t.state=yn.FAILED,t.deferred.reject(e))})),r}function Un(e){var t,n=e.state===yn.ACTIVE;e.state=yn.CANCELLED,++_n.numberOfCancelledRequests,R.defined(e.deferred)&&(t=e.deferred,e.deferred=void 0,t.reject()),n&&(--_n.numberOfActiveRequests,--An[e.serverKey],++_n.numberOfCancelledActiveRequests),R.defined(e.cancelFunction)&&e.cancelFunction()}qn.maximumRequests=50,qn.maximumRequestsPerServer=6,qn.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},qn.throttleRequests=!0,qn.debugShowStatistics=!1,qn.requestCompletedEvent=Tn,Object.defineProperties(qn,{statistics:{get:function(){return _n}},priorityHeapLength:{get:function(){return Sn},set:function(e){if(e<Sn)for(;bn.length>e;)Un(bn.pop());Sn=e,bn.maximumLength=e,bn.reserve(e)}}}),qn.update=function(){for(var e,t=0,n=Mn.length,r=0;r<n;++r)(e=Mn[r]).cancelled&&Un(e),e.state===yn.ACTIVE?0<t&&(Mn[r-t]=e):++t;Mn.length-=t;var a=bn.internalArray,i=bn.length;for(r=0;r<i;++r)zn(a[r]);bn.resort();for(var s=Math.max(qn.maximumRequests-Mn.length,0),o=0;o<s&&0<bn.length;)!(e=bn.pop()).cancelled&&(!e.throttleByServer||In(e.serverKey))?(Dn(e),++o):Un(e);!function(){if(!qn.debugShowStatistics)return;0===_n.numberOfActiveRequests&&0<_n.lastNumberOfActiveRequests&&(0<_n.numberOfAttemptedRequests&&(console.log("Number of attempted requests: "+_n.numberOfAttemptedRequests),_n.numberOfAttemptedRequests=0),0<_n.numberOfCancelledRequests&&(console.log("Number of cancelled requests: "+_n.numberOfCancelledRequests),_n.numberOfCancelledRequests=0),0<_n.numberOfCancelledActiveRequests&&(console.log("Number of cancelled active requests: "+_n.numberOfCancelledActiveRequests),_n.numberOfCancelledActiveRequests=0),0<_n.numberOfFailedRequests&&(console.log("Number of failed requests: "+_n.numberOfFailedRequests),_n.numberOfFailedRequests=0));_n.lastNumberOfActiveRequests=_n.numberOfActiveRequests}()},qn.getServerKey=function(e){var t=new en(e).resolve(Rn);t.normalize();e=t.authority;/:/.test(e)||(e=e+":"+("https"===t.scheme?"443":"80"));t=An[e];return R.defined(t)||(An[e]=0),e},qn.request=function(e){if(mn(e.url)||hn(e.url))return Tn.raiseEvent(),e.state=yn.RECEIVED,e.requestFunction();if(++_n.numberOfAttemptedRequests,R.defined(e.serverKey)||(e.serverKey=qn.getServerKey(e.url)),!qn.throttleRequests||!e.throttleByServer||In(e.serverKey)){if(!qn.throttleRequests||!e.throttle)return Dn(e);if(!(Mn.length>=qn.maximumRequests)){zn(e);var t=bn.insert(e);if(R.defined(t)){if(t===e)return;Un(t)}return Pn(e)}}},qn.clearForSpecs=function(){for(;0<bn.length;)Un(bn.pop());for(var e=Mn.length,t=0;t<e;++t)Un(Mn[t]);Mn.length=0,An={},_n.numberOfAttemptedRequests=0,_n.numberOfActiveRequests=0,_n.numberOfCancelledRequests=0,_n.numberOfCancelledActiveRequests=0,_n.numberOfFailedRequests=0,_n.numberOfActiveRequestsEver=0,_n.lastNumberOfActiveRequests=0},qn.numberOfActiveRequestsByServer=function(e){return An[e]},qn.requestHeap=bn;var Nn={},Vn={};Nn.add=function(e,t){t=e.toLowerCase()+":"+t;R.defined(Vn[t])||(Vn[t]=!0)},Nn.remove=function(e,t){t=e.toLowerCase()+":"+t;R.defined(Vn[t])&&delete Vn[t]},Nn.contains=function(e){e=function(e){var t=new en(e);if(t.normalize(),e=t.getAuthority(),R.defined(e)){if(-1===(e=-1!==e.indexOf("@")?e.split("@")[1]:e).indexOf(":")){t=t.getScheme();if("http"===(t=!R.defined(t)?(t=window.location.protocol).substring(0,t.length-1):t))e+=":80";else{if("https"!==t)return;e+=":443"}}return e}}(e);return!(!R.defined(e)||!R.defined(Vn[e]))},Nn.clear=function(){Vn={}};var Fn,Ln=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),(e.responseType="blob")===e.responseType}catch(e){return!1}}();function Bn(e,t,n,r){var a,i=e.query;if(!R.defined(i)||0===i.length)return 1;i=-1===i.indexOf("=")?((a={})[i]=void 0,a):function(e){var t={};if(""===e)return t;for(var n=e.replace(/\+/g,"%20").split(/[&;]/),r=0,a=n.length;r<a;++r){var i=n[r].split("="),s=decodeURIComponent(i[0]),o=i[1],o=R.defined(o)?decodeURIComponent(o):"",i=t[s];"string"==typeof i?t[s]=[i,o]:Array.isArray(i)?i.push(o):t[s]=o}return t}(i),t._queryParameters=n?Yn(i,t._queryParameters,r):i,e.query=void 0}function Wn(e,t){var n=t._queryParameters,t=Object.keys(n);1!==t.length||R.defined(n[t[0]])?e.query=function(e){var t,n="";for(t in e)if(e.hasOwnProperty(t)){var r=e[t],a=encodeURIComponent(t)+"=";if(Array.isArray(r))for(var i=0,s=r.length;i<s;++i)n+=a+encodeURIComponent(r[i])+"&";else n+=a+encodeURIComponent(r)+"&"}return n=n.slice(0,-1)}(n):e.query=t[0]}function jn(e,t){return R.defined(e)?R.defined(e.clone)?e.clone():un(e):t}function kn(e){if(e.state===yn.ISSUED||e.state===yn.ACTIVE)throw new L.RuntimeError("The Resource is already being fetched.");e.state=yn.UNISSUED,e.deferred=void 0}function Yn(e,t,n){if(!n)return ln(e,t);var r,a,i,s=un(e,!0);for(r in t)t.hasOwnProperty(r)&&(a=s[r],i=t[r],R.defined(a)?(Array.isArray(a)||(a=s[r]=[a]),s[r]=a.concat(i)):s[r]=Array.isArray(i)?i.slice():i);return s}function Zn(e){"string"==typeof(e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void 0,this._templateValues=jn(e.templateValues,{}),this._queryParameters=jn(e.queryParameters,{}),this.headers=jn(e.headers,{}),this.request=R.defaultValue(e.request,new Cn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=R.defaultValue(e.retryAttempts,0),this._retryCount=0;e=new en(e.url);Bn(e,this,!0,!0),e.fragment=void 0,this._url=e.toString()}function Xn(e){var n=e.resource,r=e.flipY,a=e.preferImageBitmap,i=n.request;i.url=n.url,i.requestFunction=function(){var e=!1;n.isDataUri||n.isBlobUri||(e=n.isCrossOriginUrl);var t=R.when.defer();return Zn._Implementations.createImage(i,e,t,r,a),t.promise};e=qn.request(i);if(R.defined(e))return e.otherwise(function(t){return i.state!==yn.FAILED?R.when.reject(t):n.retryOnError(t).then(function(e){return e?(i.state=yn.UNISSUED,i.deferred=void 0,Xn({resource:n,flipY:r,preferImageBitmap:a})):R.when.reject(t)})})}Zn.createIfNeeded=function(e){return e instanceof Zn?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new Zn({url:e})},Zn.supportsImageBitmapOptions=function(){if(R.defined(Fn))return Fn;if("function"!=typeof createImageBitmap)return Fn=R.when.resolve(!1);return Fn=Zn.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg=="}).then(function(e){return createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none"})}).then(function(e){return!0}).otherwise(function(){return!1})},Object.defineProperties(Zn,{isBlobSupported:{get:function(){return Ln}}}),Object.defineProperties(Zn.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){e=new en(e);Bn(e,this,!1),e.fragment=void 0,this._url=e.toString()}},extension:{get:function(){return e=this._url,(t=new en(e)).normalize(),e=t.path,e=-1===(t=(e=-1!==(t=e.lastIndexOf("/"))?e.substr(t+1):e).lastIndexOf("."))?"":e.substr(t+1);var e,t}},isDataUri:{get:function(){return mn(this._url)}},isBlobUri:{get:function(){return hn(this._url)}},isCrossOriginUrl:{get:function(){return function(e){(dn=!R.defined(dn)?document.createElement("a"):dn).href=window.location.href;var t=dn.host,n=dn.protocol;return dn.href=e,dn.href=dn.href,n!==dn.protocol||t!==dn.host}(this._url)}},hasHeaders:{get:function(){return 0<Object.keys(this.headers).length}}}),Zn.prototype.toString=function(){return this.getUrlComponent(!0,!0)},Zn.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var n=new en(this._url);e&&Wn(n,this);var n=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),r=this._templateValues,n=n.replace(/{(.*?)}/g,function(e,t){t=r[t];return R.defined(t)?encodeURIComponent(t):e});return n=t&&R.defined(this.proxy)?this.proxy.getURL(n):n},Zn.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Yn(this._queryParameters,e,!1):Yn(e,this._queryParameters,!1)},Zn.prototype.appendQueryParameters=function(e){this._queryParameters=Yn(e,this._queryParameters,!0)},Zn.prototype.setTemplateValues=function(e,t){this._templateValues=t?ln(this._templateValues,e):ln(e,this._templateValues)},Zn.prototype.getDerivedResource=function(e){var t,n=this.clone();return n._retryCount=0,R.defined(e.url)&&(Bn(t=new en(e.url),n,!0,R.defaultValue(e.preserveQueryParameters,!1)),t.fragment=void 0,n._url=t.resolve(new en(cn(this._url))).toString()),R.defined(e.queryParameters)&&(n._queryParameters=ln(e.queryParameters,n._queryParameters)),R.defined(e.templateValues)&&(n._templateValues=ln(e.templateValues,n.templateValues)),R.defined(e.headers)&&(n.headers=ln(e.headers,n.headers)),R.defined(e.proxy)&&(n.proxy=e.proxy),R.defined(e.request)&&(n.request=e.request),R.defined(e.retryCallback)&&(n.retryCallback=e.retryCallback),R.defined(e.retryAttempts)&&(n.retryAttempts=e.retryAttempts),n},Zn.prototype.retryOnError=function(e){var t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return R.when(!1);var n=this;return R.when(t(this,e)).then(function(e){return++n._retryCount,e})},Zn.prototype.clone=function(e){return(e=!R.defined(e)?new Zn({url:this._url}):e)._url=this._url,e._queryParameters=un(this._queryParameters),e._templateValues=un(this._templateValues),e.headers=un(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Zn.prototype.getBaseUri=function(e){return t=this.getUrlComponent(e),n=e,r="",-1!==(e=t.lastIndexOf("/"))&&(r=t.substring(0,e+1)),n&&(t=new en(t),R.defined(t.query)&&(r+="?"+t.query),R.defined(t.fragment)&&(r+="#"+t.fragment)),r;var t,n,r},Zn.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e+="/"),e)},Zn.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Zn.fetchArrayBuffer=function(e){return new Zn(e).fetchArrayBuffer()},Zn.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Zn.fetchBlob=function(e){return new Zn(e).fetchBlob()},Zn.prototype.fetchImage=function(e){e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT);var t=R.defaultValue(e.preferImageBitmap,!1),n=R.defaultValue(e.preferBlob,!1),r=R.defaultValue(e.flipY,!1);if(kn(this.request),!Ln||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Xn({resource:this,flipY:r,preferImageBitmap:t});var a,i,s,o=this.fetchBlob();return R.defined(o)?Zn.supportsImageBitmapOptions().then(function(e){return a=e&&t,o}).then(function(e){if(R.defined(e)){if(s=e,a)return Zn.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1});e=window.URL.createObjectURL(e);return Xn({resource:i=new Zn({url:e}),flipY:r,preferImageBitmap:!1})}}).then(function(e){if(R.defined(e))return e.blob=s,a||window.URL.revokeObjectURL(i.url),e}).otherwise(function(e){return R.defined(i)&&window.URL.revokeObjectURL(i.url),e.blob=s,R.when.reject(e)}):void 0},Zn.fetchImage=function(e){return new Zn(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Zn.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Zn.fetchText=function(e){return new Zn(e).fetchText()},Zn.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(R.defined(e))return e.then(function(e){if(R.defined(e))return JSON.parse(e)})},Zn.fetchJson=function(e){return new Zn(e).fetchJson()},Zn.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Zn.fetchXML=function(e){return new Zn(e).fetchXML()},Zn.prototype.fetchJsonp=function(e){var t;for(e=R.defaultValue(e,"callback"),kn(this.request);t="loadJsonp"+Math.random().toString().substring(2,8),R.defined(window[t]););return function n(r,a,i){var e={};e[a]=i;r.setQueryParameters(e);var s=r.request;s.url=r.url;s.requestFunction=function(){var t=R.when.defer();return window[i]=function(e){t.resolve(e);try{delete window[i]}catch(e){window[i]=void 0}},Zn._Implementations.loadAndExecuteScript(r.url,i,t),t.promise};var e=qn.request(s);if(!R.defined(e))return;return e.otherwise(function(t){return s.state!==yn.FAILED?R.when.reject(t):r.retryOnError(t).then(function(e){return e?(s.state=yn.UNISSUED,s.deferred=void 0,n(r,a,i)):R.when.reject(t)})})}(this,e,t)},Zn.fetchJsonp=function(e){return new Zn(e).fetchJsonp(e.callbackParameterName)},Zn.prototype._makeRequest=function(o){var u=this;kn(u.request);var l=u.request;l.url=u.url,l.requestFunction=function(){var e=o.responseType,t=ln(o.headers,u.headers),n=o.overrideMimeType,r=o.method,a=o.data,i=R.when.defer(),s=Zn._Implementations.loadWithXhr(u.url,e,r,a,t,i,n);return R.defined(s)&&R.defined(s.abort)&&(l.cancelFunction=function(){s.abort()}),i.promise};var e=qn.request(l);if(R.defined(e))return e.then(function(e){return l.cancelFunction=void 0,e}).otherwise(function(t){return l.cancelFunction=void 0,l.state!==yn.FAILED?R.when.reject(t):u.retryOnError(t).then(function(e){return e?(l.state=yn.UNISSUED,l.deferred=void 0,u.fetch(o)):R.when.reject(t)})})};var Hn=/^data:(.*?)(;base64)?,(.*)$/;function Jn(e,t){t=decodeURIComponent(t);return e?atob(t):t}function Gn(e,t){for(var n=Jn(e,t),t=new ArrayBuffer(n.length),r=new Uint8Array(t),a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return t}function Qn(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}Zn.prototype.fetch=function(e){return(e=jn(e,{})).method="GET",this._makeRequest(e)},Zn.fetch=function(e){return new Zn(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.delete=function(e){return(e=jn(e,{})).method="DELETE",this._makeRequest(e)},Zn.delete=function(e){return new Zn(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},Zn.prototype.head=function(e){return(e=jn(e,{})).method="HEAD",this._makeRequest(e)},Zn.head=function(e){return new Zn(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.options=function(e){return(e=jn(e,{})).method="OPTIONS",this._makeRequest(e)},Zn.options=function(e){return new Zn(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.post=function(e,t){return o.Check.defined("data",e),(t=jn(t,{})).method="POST",t.data=e,this._makeRequest(t)},Zn.post=function(e){return new Zn(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.put=function(e,t){return o.Check.defined("data",e),(t=jn(t,{})).method="PUT",t.data=e,this._makeRequest(t)},Zn.put=function(e){return new Zn(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Zn.prototype.patch=function(e,t){return o.Check.defined("data",e),(t=jn(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},Zn.patch=function(e){return new Zn(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},(Zn._Implementations={}).createImage=function(i,s,o,u,l){var c=i.url;Zn.supportsImageBitmapOptions().then(function(e){if(!e||!l)return r=c,e=s,t=o,(n=new Image).onload=function(){t.resolve(n)},n.onerror=function(e){t.reject(e)},e&&(Nn.contains(r)?n.crossOrigin="use-credentials":n.crossOrigin=""),void(n.src=r);var t,n,r=R.when.defer(),a=Zn._Implementations.loadWithXhr(c,"blob","GET",void 0,void 0,r,void 0,void 0,void 0);return R.defined(a)&&R.defined(a.abort)&&(i.cancelFunction=function(){a.abort()}),r.promise.then(function(e){return R.defined(e)?Zn.createImageBitmapFromBlob(e,{flipY:u,premultiplyAlpha:!1}):void o.reject(new L.RuntimeError("Successfully retrieved "+c+" but it contained no content."))}).then(o.resolve)}).otherwise(o.reject)},Zn.createImageBitmapFromBlob=function(e,t){return o.Check.defined("options",t),o.Check.typeOf.bool("options.flipY",t.flipY),o.Check.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none"})};var Kn="undefined"==typeof XMLHttpRequest;function $n(e){var t,n;e=R.defaultValue(e,R.defaultValue.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._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=R.defaultValue(e.addNewLeapSeconds,!0),R.defined(e.data)?tr(this,e.data):R.defined(e.url)?(t=Zn.createIfNeeded(e.url),(n=this)._downloadPromise=t.fetchJson().then(function(e){tr(n,e)}).otherwise(function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})):tr(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function er(e,t){return Kt.compare(e.julianDate,t)}function tr(e,t){if(R.defined(t.columnNames))if(R.defined(t.samples)){var n=t.columnNames.indexOf("modifiedJulianDateUtc"),r=t.columnNames.indexOf("xPoleWanderRadians"),a=t.columnNames.indexOf("yPoleWanderRadians"),i=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),o=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||r<0||a<0||i<0||s<0||o<0||u<0)e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns";else{var l,c=e._samples=t.samples,d=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=r,e._yPoleWanderRadiansColumn=a,e._ut1MinusUtcSecondsColumn=i,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=o,e._taiMinusUtcSecondsColumn=u,e._columnCount=t.columnNames.length,e._lastIndex=void 0;for(var f=e._addNewLeapSeconds,h=0,p=c.length;h<p;h+=e._columnCount){var m,y=c[h+n],w=c[h+u],C=new Kt(y+Pt.MODIFIED_JULIAN_DATE_DIFFERENCE,w,Dt.TAI);d.push(C),f&&(w===l||!R.defined(l)||(y=At(m=Kt.leapSeconds,C,er))<0&&(C=new It(C,w),m.splice(~y,0,C)),l=w)}}}else e._dataError="Error in loaded EOP data: The samples property is required.";else e._dataError="Error in loaded EOP data: The columnNames property is required."}function nr(e,t,n,r,a){r*=n;a.xPoleWander=t[r+e._xPoleWanderRadiansColumn],a.yPoleWander=t[r+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function rr(e,t,n){return t+e*(n-t)}function ar(e,t,n,r,a,i,s){var o=e._columnCount;if(i>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[a],l=t[i];if(u.equals(l)||r.equals(u))return nr(e,n,a,o,s),s;if(r.equals(l))return nr(e,n,i,o,s),s;var c=Kt.secondsDifference(r,u)/Kt.secondsDifference(l,u),d=a*o,t=i*o,u=n[d+e._ut1MinusUtcSecondsColumn],a=n[t+e._ut1MinusUtcSecondsColumn],i=a-u;return!(.5<i||i<-.5)||(o=n[d+e._taiMinusUtcSecondsColumn])!==(i=n[t+e._taiMinusUtcSecondsColumn])&&(l.equals(r)?u=a:a-=i-o),s.xPoleWander=rr(c,n[d+e._xPoleWanderRadiansColumn],n[t+e._xPoleWanderRadiansColumn]),s.yPoleWander=rr(c,n[d+e._yPoleWanderRadiansColumn],n[t+e._yPoleWanderRadiansColumn]),s.xPoleOffset=rr(c,n[d+e._xCelestialPoleOffsetRadiansColumn],n[t+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=rr(c,n[d+e._yCelestialPoleOffsetRadiansColumn],n[t+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=rr(c,u,a),s}function ir(e,t,n){this.heading=R.defaultValue(e,0),this.pitch=R.defaultValue(t,0),this.roll=R.defaultValue(n,0)}Zn._Implementations.loadWithXhr=function(e,a,i,t,n,s,r){var o=Hn.exec(e);if(null===o){if(Kn)return u=e,l=a,c=i,d=n,f=s,h=require("url").parse(u),u="https:"===h.protocol?require("https"):require("http"),p=require("zlib"),d={protocol:h.protocol,hostname:h.hostname,port:h.port,path:h.path,query:h.query,method:c,headers:d},void u.request(d).on("response",function(t){var n;t.statusCode<200||300<=t.statusCode?f.reject(new vn(t.statusCode,t,t.headers)):(n=[],t.on("data",function(e){n.push(e)}),t.on("end",function(){var e=Buffer.concat(n);"gzip"===t.headers["content-encoding"]?p.gunzip(e,function(e,t){e?f.reject(new L.RuntimeError("Error decompressing response.")):f.resolve(Qn(t,l))}):f.resolve(Qn(e,l))}))}).on("error",function(e){f.reject(new vn)}).end();var u,l,c,d,f,h,p,m=new XMLHttpRequest;if(Nn.contains(e)&&(m.withCredentials=!0),m.open(i,e,!0),R.defined(r)&&R.defined(m.overrideMimeType)&&m.overrideMimeType(r),R.defined(n))for(var y in n)n.hasOwnProperty(y)&&m.setRequestHeader(y,n[y]);R.defined(a)&&(m.responseType=a);var w=!1;return"string"==typeof e&&(w=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),m.onload=function(){if(!(m.status<200||300<=m.status)||w&&0===m.status){var e=m.response,t=m.responseType;if("HEAD"===i||"OPTIONS"===i){var n=m.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return n.forEach(function(e){var t=e.split(": "),e=t.shift();r[e]=t.join(": ")}),void s.resolve(r)}if(204===m.status)s.resolve();else if(!R.defined(e)||R.defined(a)&&t!==a)if("json"===a&&"string"==typeof e)try{s.resolve(JSON.parse(e))}catch(e){s.reject(e)}else(""===t||"document"===t)&&R.defined(m.responseXML)&&m.responseXML.hasChildNodes()?s.resolve(m.responseXML):""!==t&&"text"!==t||!R.defined(m.responseText)?s.reject(new L.RuntimeError("Invalid XMLHttpRequest response type.")):s.resolve(m.responseText);else s.resolve(e)}else s.reject(new vn(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(e){s.reject(new vn)},m.send(t),m}s.resolve(function(e,t){t=R.defaultValue(t,"");var n=e[1],r=!!e[2],a=e[3];switch(t){case"":case"text":return Jn(r,a);case"arraybuffer":return Gn(r,a);case"blob":var i=Gn(r,a);return new Blob([i],{type:n});case"document":return(new DOMParser).parseFromString(Jn(r,a),n);case"json":return JSON.parse(Jn(r,a))}}(o,a))},Zn._Implementations.loadAndExecuteScript=function(e,t,n){return function(e){var t=R.when.defer(),n=document.createElement("script");n.async=!0,n.src=e;var r=document.getElementsByTagName("head")[0];return n.onload=function(){n.onload=void 0,r.removeChild(n),t.resolve()},n.onerror=function(e){t.reject(e)},r.appendChild(n),t.promise}(e).otherwise(n.reject)},(Zn._DefaultImplementations={}).createImage=Zn._Implementations.createImage,Zn._DefaultImplementations.loadWithXhr=Zn._Implementations.loadWithXhr,Zn._DefaultImplementations.loadAndExecuteScript=Zn._Implementations.loadAndExecuteScript,Zn.DEFAULT=Object.freeze(new Zn({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),$n.NONE=Object.freeze({getPromiseToLoad:function(){return R.when.resolve()},compute:function(e,t){return R.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Rt(0,0,0,0,0),t}}),$n.prototype.getPromiseToLoad=function(){return R.when(this._downloadPromise)},$n.prototype.compute=function(e,t){if(R.defined(this._samples)){if(R.defined(t)||(t=new Rt(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;var n=this._dates,r=this._lastIndex,a=0,i=0;if(R.defined(r)){var s=n[r],o=n[r+1],u=Kt.lessThanOrEquals(s,e),l=!R.defined(o),s=l||Kt.greaterThanOrEquals(o,e);if(u&&s)return a=r,!l&&o.equals(e)&&++a,i=a+1,ar(this,n,this._samples,e,a,i,t),t}o=At(n,e,Kt.compare,this._dateColumn);return 0<=o?(o<n.length-1&&n[o+1].equals(e)&&++o,i=a=o):(a=(i=~o)-1)<0&&(a=0),this._lastIndex=a,ar(this,n,this._samples,e,a,i,t),t}if(R.defined(this._dataError))throw new L.RuntimeError(this._dataError)},ir.fromQuaternion=function(e,t){R.defined(t)||(t=new ir);var n=2*(e.w*e.y-e.z*e.x),r=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),i=1-2*(e.y*e.y+e.z*e.z),e=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(e,i),t.roll=Math.atan2(a,r),t.pitch=-F.CesiumMath.asinClamped(n),t},ir.fromDegrees=function(e,t,n,r){return(r=!R.defined(r)?new ir:r).heading=e*F.CesiumMath.RADIANS_PER_DEGREE,r.pitch=t*F.CesiumMath.RADIANS_PER_DEGREE,r.roll=n*F.CesiumMath.RADIANS_PER_DEGREE,r},ir.clone=function(e,t){if(R.defined(e))return R.defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new ir(e.heading,e.pitch,e.roll)},ir.equals=function(e,t){return e===t||R.defined(e)&&R.defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},ir.equalsEpsilon=function(e,t,n,r){return e===t||R.defined(e)&&R.defined(t)&&F.CesiumMath.equalsEpsilon(e.heading,t.heading,n,r)&&F.CesiumMath.equalsEpsilon(e.pitch,t.pitch,n,r)&&F.CesiumMath.equalsEpsilon(e.roll,t.roll,n,r)},ir.prototype.clone=function(e){return ir.clone(this,e)},ir.prototype.equals=function(e){return ir.equals(this,e)},ir.prototype.equalsEpsilon=function(e,t,n){return ir.equalsEpsilon(this,e,t,n)},ir.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"};var sr,or,ur,lr=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function cr(e){return"undefined"==typeof document?e:((sr=!R.defined(sr)?document.createElement("a"):sr).href=e,sr.href=sr.href,sr.href)}function dr(){if(R.defined(or))return or;var e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&R.defined(define.amd)&&!define.amd.toUrlUndefined&&R.defined(require.toUrl)?cn("..",pr("Core/buildModuleUrl.js")):function(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),r=lr.exec(r);if(null!==r)return r[1]}}();return(or=new Zn({url:cr(e)})).appendForwardSlash(),or}function fr(e){return cr(require.toUrl("../"+e))}function hr(e){return dr().getDerivedResource({url:e}).url}function pr(e){return(ur=!R.defined(ur)?"object"==typeof define&&R.defined(define.amd)&&!define.amd.toUrlUndefined&&R.defined(require.toUrl)?fr:hr:ur)(e)}function mr(e,t,n){this.x=e,this.y=t,this.s=n}function yr(e){e=R.defaultValue(e,R.defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=Zn.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=R.defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=R.defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new Kt(this._sampleZeroJulianEphemerisDate,0,Dt.TAI),this._stepSizeDays=R.defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=R.defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=R.defaultValue(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),r=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),i=0;i<=t;++i){n[i]=a,r[i]=i*this._stepSizeDays;for(var s=0;s<=t;++s)s!==i&&(n[i]*=i-s);n[i]=1/n[i]}this._work=new Array(t+1),this._coef=new Array(t+1)}pr._cesiumScriptRegex=lr,pr._buildModuleUrlFromBaseUrl=hr,pr._clearBaseResource=function(){or=void 0},pr.setBaseUrl=function(e){or=Zn.DEFAULT.getDerivedResource({url:e})},pr.getCesiumBaseUrl=dr;var wr=new Kt(0,0,Dt.TAI);function Cr(e,t,n){var r=wr;return r.dayNumber=t,r.secondsOfDay=n,Kt.daysDifference(r,e._sampleZeroDateTT)}function vr(s,o){if(s._chunkDownloadsInProgress[o])return s._chunkDownloadsInProgress[o];var u=R.when.defer();s._chunkDownloadsInProgress[o]=u;var e=s._xysFileUrlTemplate,e=R.defined(e)?e.getDerivedResource({templateValues:{0:o}}):new Zn({url:pr("Assets/IAU2006_XYS/IAU2006_XYS_"+o+".json")});return R.when(e.fetchJson(),function(e){s._chunkDownloadsInProgress[o]=!1;for(var t=s._samples,n=e.samples,r=o*s._samplesPerXysFile*3,a=0,i=n.length;a<i;++a)t[r+a]=n[a];u.resolve()}),u.promise}yr.prototype.preload=function(e,t,n,r){t=Cr(this,e,t),r=Cr(this,n,r),t=t/this._stepSizeDays-this._interpolationOrder/2|0;t<0&&(t=0);r=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;r>=this._totalSamples&&(r=this._totalSamples-1);for(var t=t/this._samplesPerXysFile|0,a=r/this._samplesPerXysFile|0,i=[],s=t;s<=a;++s)i.push(vr(this,s));return R.when.all(i)},yr.prototype.computeXysRadians=function(e,t,n){var r=Cr(this,e,t);if(!(r<0)){e=r/this._stepSizeDays|0;if(!(e>=this._totalSamples)){var a=this._interpolationOrder,i=e-(a/2|0),t=(i=i<0?0:i)+a;t>=this._totalSamples&&(i=(t=this._totalSamples-1)-a)<0&&(i=0);var e=!1,s=this._samples;if(R.defined(s[3*i])||(vr(this,i/this._samplesPerXysFile|0),e=!0),R.defined(s[3*t])||(vr(this,t/this._samplesPerXysFile|0),e=!0),!e){R.defined(n)?(n.x=0,n.y=0,n.s=0):n=new mr(0,0,0);for(var o,u=r-i*this._stepSizeDays,l=this._work,c=this._denominators,d=this._coef,f=this._xTable,h=0;h<=a;++h)l[h]=u-f[h];for(h=0;h<=a;++h){for(d[h]=1,o=0;o<=a;++o)o!==h&&(d[h]*=l[o]);d[h]*=c[h];var p=3*(i+h);n.x+=d[h]*s[p++],n.y+=d[h]*s[p++],n.s+=d[h]*s[p]}return n}}}};var gr={},xr={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"}},Er={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Or={},_r={east:new A.Cartesian3,north:new A.Cartesian3,up:new A.Cartesian3,west:new A.Cartesian3,south:new A.Cartesian3,down:new A.Cartesian3},Sr=new A.Cartesian3,br=new A.Cartesian3,Mr=new A.Cartesian3;gr.localFrameToFixedFrameGenerator=function(a,i){if(!xr.hasOwnProperty(a)||!xr[a].hasOwnProperty(i))throw new o.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");var e,s=xr[a][i],t=a+i;return R.defined(Or[t])?e=Or[t]:(e=function(e,t,n){var r;return R.defined(n)||(n=new j),A.Cartesian3.equalsEpsilon(e,A.Cartesian3.ZERO,F.CesiumMath.EPSILON14)?(A.Cartesian3.unpack(Er[a],0,Sr),A.Cartesian3.unpack(Er[i],0,br),A.Cartesian3.unpack(Er[s],0,Mr)):F.CesiumMath.equalsEpsilon(e.x,0,F.CesiumMath.EPSILON14)&&F.CesiumMath.equalsEpsilon(e.y,0,F.CesiumMath.EPSILON14)?(r=F.CesiumMath.sign(e.z),A.Cartesian3.unpack(Er[a],0,Sr),"east"!==a&&"west"!==a&&A.Cartesian3.multiplyByScalar(Sr,r,Sr),A.Cartesian3.unpack(Er[i],0,br),"east"!==i&&"west"!==i&&A.Cartesian3.multiplyByScalar(br,r,br),A.Cartesian3.unpack(Er[s],0,Mr),"east"!==s&&"west"!==s&&A.Cartesian3.multiplyByScalar(Mr,r,Mr)):((t=R.defaultValue(t,A.Ellipsoid.WGS84)).geodeticSurfaceNormal(e,_r.up),r=_r.up,(t=_r.east).x=-e.y,t.y=e.x,t.z=0,A.Cartesian3.normalize(t,_r.east),A.Cartesian3.cross(r,t,_r.north),A.Cartesian3.multiplyByScalar(_r.up,-1,_r.down),A.Cartesian3.multiplyByScalar(_r.east,-1,_r.west),A.Cartesian3.multiplyByScalar(_r.north,-1,_r.south),Sr=_r[a],br=_r[i],Mr=_r[s]),n[0]=Sr.x,n[1]=Sr.y,n[2]=Sr.z,n[3]=0,n[4]=br.x,n[5]=br.y,n[6]=br.z,n[7]=0,n[8]=Mr.x,n[9]=Mr.y,n[10]=Mr.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},Or[t]=e),e},gr.eastNorthUpToFixedFrame=gr.localFrameToFixedFrameGenerator("east","north"),gr.northEastDownToFixedFrame=gr.localFrameToFixedFrameGenerator("north","east"),gr.northUpEastToFixedFrame=gr.localFrameToFixedFrameGenerator("north","up"),gr.northWestUpToFixedFrame=gr.localFrameToFixedFrameGenerator("north","west");var Ar=new $e,Rr=new A.Cartesian3(1,1,1),Tr=new j;gr.headingPitchRollToFixedFrame=function(e,t,n,r,a){r=R.defaultValue(r,gr.eastNorthUpToFixedFrame);t=$e.fromHeadingPitchRoll(t,Ar),t=j.fromTranslationQuaternionRotationScale(A.Cartesian3.ZERO,t,Rr,Tr);return a=r(e,n,a),j.multiply(a,t,a)};var qr=new j,zr=new B;gr.headingPitchRollQuaternion=function(e,t,n,r,a){r=gr.headingPitchRollToFixedFrame(e,t,n,r,qr),r=j.getMatrix3(r,zr);return $e.fromRotationMatrix(r,a)};var Ir=new A.Cartesian3(1,1,1),Pr=new A.Cartesian3,Dr=new j,Ur=new j,Nr=new B,Vr=new $e;gr.fixedFrameToHeadingPitchRoll=function(e,t,n,r){t=R.defaultValue(t,A.Ellipsoid.WGS84),n=R.defaultValue(n,gr.eastNorthUpToFixedFrame),R.defined(r)||(r=new ir);var a=j.getTranslation(e,Pr);if(A.Cartesian3.equals(a,A.Cartesian3.ZERO))return r.heading=0,r.pitch=0,r.roll=0,r;t=j.inverseTransformation(n(a,t,Dr),Dr),e=j.setScale(e,Ir,Ur),e=j.setTranslation(e,A.Cartesian3.ZERO,e),t=j.multiply(t,e,t),t=$e.fromRotationMatrix(j.getMatrix3(t,Nr),Vr),t=$e.normalize(t,t);return ir.fromQuaternion(t,r)};var Fr=F.CesiumMath.TWO_PI/86400,Lr=new Kt;gr.computeTemeToPseudoFixedMatrix=function(e,t){var n=(Lr=Kt.addSeconds(e,-Kt.computeTaiMinusUtc(e),Lr)).dayNumber,r=Lr.secondsOfDay,e=n-2451545,e=43200<=r?(.5+e)/Pt.DAYS_PER_JULIAN_CENTURY:(e-.5)/Pt.DAYS_PER_JULIAN_CENTURY,n=(24110.54841+e*(8640184.812866+e*(.093104+-62e-7*e)))*Fr%F.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(n-2451545.5))*((r+.5*Pt.SECONDS_PER_DAY)%Pt.SECONDS_PER_DAY),r=Math.cos(n),n=Math.sin(n);return R.defined(t)?(t[0]=r,t[1]=-n,t[2]=0,t[3]=n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new B(r,n,0,-n,r,0,0,0,1)},gr.iau2006XysData=new yr,gr.earthOrientationParameters=$n.NONE;var Br=32.184;gr.preloadIcrfFixed=function(e){var t=e.start.dayNumber,n=e.start.secondsOfDay+Br,r=e.stop.dayNumber,e=e.stop.secondsOfDay+Br,r=gr.iau2006XysData.preload(t,n,r,e),e=gr.earthOrientationParameters.getPromiseToLoad();return R.when.all([r,e])},gr.computeIcrfToFixedMatrix=function(e,t){R.defined(t)||(t=new B);e=gr.computeFixedToIcrfMatrix(e,t);if(R.defined(e))return B.transpose(e,t)};var Wr=new mr(0,0,0),jr=new Rt(0,0,0,0,0),kr=new B,Yr=new B;gr.computeFixedToIcrfMatrix=function(e,t){R.defined(t)||(t=new B);var n=gr.earthOrientationParameters.compute(e,jr);if(R.defined(n)){var r=e.dayNumber,a=e.secondsOfDay+Br,i=gr.iau2006XysData.computeXysRadians(r,a,Wr);if(R.defined(i)){var s=i.x+n.xPoleOffset,o=i.y+n.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-o*o)),l=kr;l[0]=1-u*s*s,l[3]=-u*s*o,l[6]=s,l[1]=-u*s*o,l[4]=1-u*o*o,l[7]=o,l[2]=-s,l[5]=-o,l[8]=1-u*(s*s+o*o);s=B.fromRotationZ(-i.s,Yr),o=B.multiply(l,s,kr),i=e.dayNumber-2451545,l=(e.secondsOfDay-Kt.computeTaiMinusUtc(e)+n.ut1MinusUtc)/Pt.SECONDS_PER_DAY,s=(s=.779057273264+l+.00273781191135448*(i+l))%1*F.CesiumMath.TWO_PI,e=B.fromRotationZ(s,Yr),i=B.multiply(o,e,kr),l=Math.cos(n.xPoleWander),s=Math.cos(n.yPoleWander),o=Math.sin(n.xPoleWander),e=Math.sin(n.yPoleWander),n=r-2451545+a/Pt.SECONDS_PER_DAY,r=-47e-6*(n/=36525)*F.CesiumMath.RADIANS_PER_DEGREE/3600,a=Math.cos(r),n=Math.sin(r),r=Yr;return r[0]=l*a,r[1]=l*n,r[2]=o,r[3]=-s*n+e*o*a,r[4]=s*a+e*o*n,r[5]=-e*l,r[6]=-e*n-s*o*a,r[7]=e*a-s*o*n,r[8]=s*l,B.multiply(i,r,t)}}};var Zr=new W;gr.pointToWindowCoordinates=function(e,t,n,r){return(r=gr.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},gr.pointToGLWindowCoordinates=function(e,t,n,r){R.defined(r)||(r=new A.Cartesian2);var a=Zr;return j.multiplyByVector(e,W.fromElements(n.x,n.y,n.z,1,a),a),W.multiplyByScalar(a,1/a.w,a),j.multiplyByVector(t,a,a),A.Cartesian2.fromCartesian4(a,r)};var Xr=new A.Cartesian3,Hr=new A.Cartesian3,Jr=new A.Cartesian3;gr.rotationMatrixFromPositionVelocity=function(e,t,n,r){n=R.defaultValue(n,A.Ellipsoid.WGS84).geodeticSurfaceNormal(e,Xr),e=A.Cartesian3.cross(t,n,Hr);A.Cartesian3.equalsEpsilon(e,A.Cartesian3.ZERO,F.CesiumMath.EPSILON6)&&(e=A.Cartesian3.clone(A.Cartesian3.UNIT_X,e));n=A.Cartesian3.cross(e,t,Jr);return A.Cartesian3.normalize(n,n),A.Cartesian3.cross(t,n,e),A.Cartesian3.negate(e,e),A.Cartesian3.normalize(e,e),(r=!R.defined(r)?new B:r)[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=e.y,r[5]=e.z,r[6]=n.x,r[7]=n.y,r[8]=n.z,r};var Gr=new j(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Qr=new A.Cartographic,Kr=new A.Cartesian3,$r=new A.Cartesian3,ea=new B,ta=new j,na=new j;gr.basisTo2D=function(e,t,n){var r=j.getTranslation(t,$r),a=e.ellipsoid,i=a.cartesianToCartographic(r,Qr),i=e.project(i,Kr);A.Cartesian3.fromElements(i.z,i.x,i.y,i);a=gr.eastNorthUpToFixedFrame(r,a,ta),a=j.inverseTransformation(a,na),t=j.getMatrix3(t,ea),t=j.multiplyByMatrix3(a,t,n);return j.multiply(Gr,t,n),j.setTranslation(n,i,n),n},gr.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=gr.eastNorthUpToFixedFrame(t,r,ta),a=j.inverseTransformation(a,na),t=r.cartesianToCartographic(t,Qr),t=e.project(t,Kr);A.Cartesian3.fromElements(t.z,t.x,t.y,t);t=j.fromTranslation(t,ta);return j.multiply(Gr,a,n),j.multiply(t,n,n),n},e.BoundingSphere=T,e.Cartesian4=W,e.FeatureDetection=Ke,e.GeographicProjection=t,e.Intersect=a,e.Interval=i,e.Matrix3=B,e.Matrix4=j,e.Quaternion=$e,e.Resource=Zn,e.Transforms=gr,e.buildModuleUrl=pr}); diff --git a/public/Cesium/Workers/VertexFormat-81ec7207.js b/public/Cesium/Workers/VertexFormat-81ec7207.js new file mode 100644 index 0000000..9eccf89 --- /dev/null +++ b/public/Cesium/Workers/VertexFormat-81ec7207.js @@ -0,0 +1 @@ +define(["exports","./when-54335d57","./Check-24483042"],function(e,o,t){"use strict";function i(e){e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT),this.position=o.defaultValue(e.position,!1),this.normal=o.defaultValue(e.normal,!1),this.st=o.defaultValue(e.st,!1),this.bitangent=o.defaultValue(e.bitangent,!1),this.tangent=o.defaultValue(e.tangent,!1),this.color=o.defaultValue(e.color,!1)}i.POSITION_ONLY=Object.freeze(new i({position:!0})),i.POSITION_AND_NORMAL=Object.freeze(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=Object.freeze(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=Object.freeze(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=Object.freeze(new i({position:!0,color:!0})),i.ALL=Object.freeze(new i({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,t,n){return n=o.defaultValue(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},i.unpack=function(e,t,n){return t=o.defaultValue(t,0),(n=!o.defined(n)?new i:n).position=1===e[t++],n.normal=1===e[t++],n.st=1===e[t++],n.tangent=1===e[t++],n.bitangent=1===e[t++],n.color=1===e[t],n},i.clone=function(e,t){if(o.defined(e))return(t=!o.defined(t)?new i: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},e.VertexFormat=i}); diff --git a/public/Cesium/Workers/VertexFormat-e8cbf5b3.js b/public/Cesium/Workers/VertexFormat-e8cbf5b3.js deleted file mode 100644 index a3bb1c4..0000000 --- a/public/Cesium/Workers/VertexFormat-e8cbf5b3.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./when-208fe5b0","./Check-d18af7c4"],function(e,o,t){"use strict";function a(e){e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT),this.position=o.defaultValue(e.position,!1),this.normal=o.defaultValue(e.normal,!1),this.st=o.defaultValue(e.st,!1),this.bitangent=o.defaultValue(e.bitangent,!1),this.tangent=o.defaultValue(e.tangent,!1),this.color=o.defaultValue(e.color,!1)}a.POSITION_ONLY=Object.freeze(new a({position:!0})),a.POSITION_AND_NORMAL=Object.freeze(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=Object.freeze(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=Object.freeze(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=Object.freeze(new a({position:!0,color:!0})),a.ALL=Object.freeze(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,t,n){return n=o.defaultValue(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},a.unpack=function(e,t,n){return t=o.defaultValue(t,0),(n=!o.defined(n)?new a:n).position=1===e[t++],n.normal=1===e[t++],n.st=1===e[t++],n.tangent=1===e[t++],n.bitangent=1===e[t++],n.color=1===e[t],n},a.clone=function(e,t){if(o.defined(e))return(t=!o.defined(t)?new a: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},e.VertexFormat=a}); diff --git a/public/Cesium/Workers/WallGeometryLibrary-1012701b.js b/public/Cesium/Workers/WallGeometryLibrary-0e5f04d3.js similarity index 80% rename from public/Cesium/Workers/WallGeometryLibrary-1012701b.js rename to public/Cesium/Workers/WallGeometryLibrary-0e5f04d3.js index 4adbef9..d7fa356 100644 --- a/public/Cesium/Workers/WallGeometryLibrary-1012701b.js +++ b/public/Cesium/Workers/WallGeometryLibrary-0e5f04d3.js @@ -1 +1 @@ -define(["exports","./arrayRemoveDuplicates-0f62a181","./Cartesian2-8417ca3d","./when-208fe5b0","./Math-4e53b694","./PolylinePipeline-232a4d9a"],function(e,f,A,C,w,P){"use strict";var i={};var b=new A.Cartographic,M=new A.Cartographic;function E(e,i,t,a){var r=(i=f.arrayRemoveDuplicates(i,A.Cartesian3.equalsEpsilon)).length;if(!(r<2)){var n=C.defined(a),o=C.defined(t),l=new Array(r),s=new Array(r),h=new Array(r),g=i[0];l[0]=g;var p=e.cartesianToCartographic(g,b);o&&(p.height=t[0]),s[0]=p.height,h[0]=n?a[0]:0;for(var u,c,d=s[0]===h[0],v=1,y=1;y<r;++y){var m=i[y],P=e.cartesianToCartographic(m,M);o&&(P.height=t[y]),d=d&&0===P.height,u=p,c=P,w.CesiumMath.equalsEpsilon(u.latitude,c.latitude,w.CesiumMath.EPSILON10)&&w.CesiumMath.equalsEpsilon(u.longitude,c.longitude,w.CesiumMath.EPSILON10)?p.height<P.height&&(s[v-1]=P.height):(l[v]=m,s[v]=P.height,h[v]=n?a[y]:0,d=d&&s[v]===h[v],A.Cartographic.clone(P,p),++v)}if(!(d||v<2))return l.length=v,s.length=v,h.length=v,{positions:l,topHeights:s,bottomHeights:h}}}var F=new Array(2),H=new Array(2),L={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};i.computePositions=function(e,i,t,a,r,n){var o=E(e,i,t,a);if(C.defined(o)){i=o.positions,t=o.topHeights,a=o.bottomHeights;var l=i.length,o=l-2,s=w.CesiumMath.chordLength(r,e.maximumRadius),h=L;if(h.minDistance=s,h.ellipsoid=e,n){for(var g=0,p=0;p<l-1;p++)g+=P.PolylinePipeline.numberOfPoints(i[p],i[p+1],s)+1;var u=new Float64Array(3*g),c=new Float64Array(3*g),d=F,v=H;h.positions=d,h.height=v;var y=0;for(p=0;p<l-1;p++){d[0]=i[p],d[1]=i[p+1],v[0]=t[p],v[1]=t[p+1];var m=P.PolylinePipeline.generateArc(h);u.set(m,y),v[0]=a[p],v[1]=a[p+1],c.set(P.PolylinePipeline.generateArc(h),y),y+=m.length}}else h.positions=i,h.height=t,u=new Float64Array(P.PolylinePipeline.generateArc(h)),h.height=a,c=new Float64Array(P.PolylinePipeline.generateArc(h));return{bottomPositions:c,topPositions:u,numCorners:o}}},e.WallGeometryLibrary=i}); +define(["exports","./arrayRemoveDuplicates-3fea1e5f","./Cartesian2-8646c5a1","./when-54335d57","./Math-d6182036","./PolylinePipeline-3803a6c2"],function(e,f,A,C,w,P){"use strict";var i={};var M=new A.Cartographic,b=new A.Cartographic;function E(e,i,t,a){var r=(i=f.arrayRemoveDuplicates(i,A.Cartesian3.equalsEpsilon)).length;if(!(r<2)){var n=C.defined(a),o=C.defined(t),l=new Array(r),s=new Array(r),h=new Array(r),g=i[0];l[0]=g;var p=e.cartesianToCartographic(g,M);o&&(p.height=t[0]),s[0]=p.height,h[0]=n?a[0]:0;for(var u,c,d=s[0]===h[0],v=1,y=1;y<r;++y){var m=i[y],P=e.cartesianToCartographic(m,b);o&&(P.height=t[y]),d=d&&0===P.height,u=p,c=P,w.CesiumMath.equalsEpsilon(u.latitude,c.latitude,w.CesiumMath.EPSILON10)&&w.CesiumMath.equalsEpsilon(u.longitude,c.longitude,w.CesiumMath.EPSILON10)?p.height<P.height&&(s[v-1]=P.height):(l[v]=m,s[v]=P.height,h[v]=n?a[y]:0,d=d&&s[v]===h[v],A.Cartographic.clone(P,p),++v)}if(!(d||v<2))return l.length=v,s.length=v,h.length=v,{positions:l,topHeights:s,bottomHeights:h}}}var F=new Array(2),H=new Array(2),L={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};i.computePositions=function(e,i,t,a,r,n){var o=E(e,i,t,a);if(C.defined(o)){i=o.positions,t=o.topHeights,a=o.bottomHeights;var l=i.length,o=l-2,s=w.CesiumMath.chordLength(r,e.maximumRadius),h=L;if(h.minDistance=s,h.ellipsoid=e,n){for(var g=0,p=0;p<l-1;p++)g+=P.PolylinePipeline.numberOfPoints(i[p],i[p+1],s)+1;var u=new Float64Array(3*g),c=new Float64Array(3*g),d=F,v=H;h.positions=d,h.height=v;var y=0;for(p=0;p<l-1;p++){d[0]=i[p],d[1]=i[p+1],v[0]=t[p],v[1]=t[p+1];var m=P.PolylinePipeline.generateArc(h);u.set(m,y),v[0]=a[p],v[1]=a[p+1],c.set(P.PolylinePipeline.generateArc(h),y),y+=m.length}}else h.positions=i,h.height=t,u=new Float64Array(P.PolylinePipeline.generateArc(h)),h.height=a,c=new Float64Array(P.PolylinePipeline.generateArc(h));return{bottomPositions:c,topPositions:u,numCorners:o}}},e.WallGeometryLibrary=i}); diff --git a/public/Cesium/Workers/WebGLConstants-76bb35d1.js b/public/Cesium/Workers/WebGLConstants-95ceb4e9.js similarity index 100% rename from public/Cesium/Workers/WebGLConstants-76bb35d1.js rename to public/Cesium/Workers/WebGLConstants-95ceb4e9.js diff --git a/public/Cesium/Workers/WebMercatorProjection-ffb6b9f8.js b/public/Cesium/Workers/WebMercatorProjection-66cc0482.js similarity index 56% rename from public/Cesium/Workers/WebMercatorProjection-ffb6b9f8.js rename to public/Cesium/Workers/WebMercatorProjection-66cc0482.js index c3b17f9..c99159c 100644 --- a/public/Cesium/Workers/WebMercatorProjection-ffb6b9f8.js +++ b/public/Cesium/Workers/WebMercatorProjection-66cc0482.js @@ -1 +1 @@ -define(["exports","./Cartesian2-8417ca3d","./when-208fe5b0","./Check-d18af7c4","./Math-4e53b694"],function(e,o,r,t,i){"use strict";function n(e){this._ellipsoid=r.defaultValue(e,o.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(n.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),n.mercatorAngleToGeodeticLatitude=function(e){return i.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},n.geodeticLatitudeToMercatorAngle=function(e){n.MaximumLatitude<e?e=n.MaximumLatitude:e<-n.MaximumLatitude&&(e=-n.MaximumLatitude);e=Math.sin(e);return.5*Math.log((1+e)/(1-e))},n.MaximumLatitude=n.mercatorAngleToGeodeticLatitude(Math.PI),n.prototype.project=function(e,t){var i=this._semimajorAxis,a=e.longitude*i,i=n.geodeticLatitudeToMercatorAngle(e.latitude)*i,e=e.height;return r.defined(t)?(t.x=a,t.y=i,t.z=e,t):new o.Cartesian3(a,i,e)},n.prototype.unproject=function(e,t){var i=this._oneOverSemimajorAxis,a=e.x*i,i=n.mercatorAngleToGeodeticLatitude(e.y*i),e=e.z;return r.defined(t)?(t.longitude=a,t.latitude=i,t.height=e,t):new o.Cartographic(a,i,e)},e.WebMercatorProjection=n}); +define(["exports","./Cartesian2-8646c5a1","./when-54335d57","./Check-24483042","./Math-d6182036"],function(e,a,r,t,i){"use strict";function n(e){this._ellipsoid=r.defaultValue(e,a.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(n.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),n.mercatorAngleToGeodeticLatitude=function(e){return i.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},n.geodeticLatitudeToMercatorAngle=function(e){n.MaximumLatitude<e?e=n.MaximumLatitude:e<-n.MaximumLatitude&&(e=-n.MaximumLatitude);e=Math.sin(e);return.5*Math.log((1+e)/(1-e))},n.MaximumLatitude=n.mercatorAngleToGeodeticLatitude(Math.PI),n.prototype.project=function(e,t){var i=this._semimajorAxis,o=e.longitude*i,i=n.geodeticLatitudeToMercatorAngle(e.latitude)*i,e=e.height;return r.defined(t)?(t.x=o,t.y=i,t.z=e,t):new a.Cartesian3(o,i,e)},n.prototype.unproject=function(e,t){var i=this._oneOverSemimajorAxis,o=e.x*i,i=n.mercatorAngleToGeodeticLatitude(e.y*i),e=e.z;return r.defined(t)?(t.longitude=o,t.latitude=i,t.height=e,t):new a.Cartographic(o,i,e)},e.WebMercatorProjection=n}); diff --git a/public/Cesium/Workers/arrayRemoveDuplicates-0f62a181.js b/public/Cesium/Workers/arrayRemoveDuplicates-0f62a181.js deleted file mode 100644 index 79303fc..0000000 --- a/public/Cesium/Workers/arrayRemoveDuplicates-0f62a181.js +++ /dev/null @@ -1 +0,0 @@ -define(["exports","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694"],function(e,t,h,r){"use strict";var l=r.CesiumMath.EPSILON10;e.arrayRemoveDuplicates=function(e,t,r){if(h.defined(e)){r=h.defaultValue(r,!1);var n,f,i,a=e.length;if(a<2)return e;for(n=1;n<a&&!t(f=e[n-1],i=e[n],l);++n);if(n===a)return r&&t(e[0],e[e.length-1],l)?e.slice(1):e;for(var u=e.slice(0,n);n<a;++n)t(f,i=e[n],l)||(u.push(i),f=i);return r&&1<u.length&&t(u[0],u[u.length-1],l)&&u.shift(),u}}}); diff --git a/public/Cesium/Workers/arrayRemoveDuplicates-3fea1e5f.js b/public/Cesium/Workers/arrayRemoveDuplicates-3fea1e5f.js new file mode 100644 index 0000000..5303011 --- /dev/null +++ b/public/Cesium/Workers/arrayRemoveDuplicates-3fea1e5f.js @@ -0,0 +1 @@ +define(["exports","./Check-24483042","./when-54335d57","./Math-d6182036"],function(e,t,h,r){"use strict";var l=r.CesiumMath.EPSILON10;e.arrayRemoveDuplicates=function(e,t,r){if(h.defined(e)){r=h.defaultValue(r,!1);var n,i,f,u=e.length;if(u<2)return e;for(n=1;n<u&&!t(i=e[n-1],f=e[n],l);++n);if(n===u)return r&&t(e[0],e[e.length-1],l)?e.slice(1):e;for(var a=e.slice(0,n);n<u;++n)t(i,f=e[n],l)||(a.push(f),i=f);return r&&1<a.length&&t(a[0],a[a.length-1],l)&&a.shift(),a}}}); diff --git a/public/Cesium/Workers/cesiumWorkerBootstrapper.js b/public/Cesium/Workers/cesiumWorkerBootstrapper.js index 6458766..2f1ca42 100644 --- a/public/Cesium/Workers/cesiumWorkerBootstrapper.js +++ b/public/Cesium/Workers/cesiumWorkerBootstrapper.js @@ -1 +1 @@ -function setTimeout(e){e()}var requirejs,require,define;"undefined"==typeof self&&(self={}),self.onmessage=function(e){var t=e.data;require(t.loaderConfig,[t.workerModule],function(e){self.onmessage=e,CESIUM_BASE_URL=t.loaderConfig.baseUrl})},function(global){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.20",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e)for(var i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}function eachReverse(e,t){if(e)for(var i=e.length-1;-1<i&&(!e[i]||!t(e[i],i,e));--i);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){for(var i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(i,e,r,n){return e&&eachProp(e,function(e,t){!r&&hasProp(i,t)||(!n||"object"!=typeof e||!e||isArray(e)||isFunction(e)||e instanceof RegExp?i[t]=e:(i[t]||(i[t]={}),mixin(i[t],e,r,n)))}),i}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,i,r){t=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return t.requireType=e,t.requireModules=r,i&&(t.originalError=i),t}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o=defContextName;return isArray(e)||"string"==typeof e||(n=e,isArray(t)?(e=t,t=i,i=r):e=[]),n&&n.context&&(o=n.context),r=(r=getOwn(contexts,o))||(contexts[o]=req.s.newContext(o)),n&&r.configure(n),r.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require=require||req,req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(t){req[t]=function(){var e=contexts[defContextName];return e.require[t].apply(e,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(t,i,r){var e,n=t&&t.config||{};if(isBrowser)return e=req.createNode(n,i,r),n.onNodeCreated&&n.onNodeCreated(e,n,i,r),e.setAttribute("data-requirecontext",t.contextName),e.setAttribute("data-requiremodule",i),!e.attachEvent||e.attachEvent.toString&&e.attachEvent.toString().indexOf("[native code")<0||isOpera?(e.addEventListener("load",t.onScriptLoad,!1),e.addEventListener("error",t.onScriptError,!1)):(useInteractive=!0,e.attachEvent("onreadystatechange",t.onScriptLoad)),e.src=r,currentlyAddingScript=e,baseElement?head.insertBefore(e,baseElement):head.appendChild(e),currentlyAddingScript=null,e;if(isWebWorker)try{importScripts(r),t.completeLoad(i)}catch(e){t.onError(makeError("importscripts","importScripts failed for "+i+" at "+r,e,[i]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head=head||e.parentNode,dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||(mainScript=(src=mainScript.split("/")).pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,i,t){var r,n;"string"!=typeof e&&(t=i,i=e,e=null),isArray(i)||(t=i,i=null),!i&&isFunction(t)&&(i=[],t.length&&(t.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,t){i.push(t)}),i=(1===t.length?["require"]:["require","exports","module"]).concat(i))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript())&&(e=e||r.getAttribute("data-requiremodule"),n=contexts[r.getAttribute("data-requirecontext")]),n?(n.defQueue.push([e,i,t]),n.defQueueMap[e]=!0):globalDefQueue.push([e,i,t])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}function newContext(u){var t,e,f,c,i,m={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},d={},p={},r={},l=[],h={},n={},g={},x=1,v=1;function b(e,t,i){var r,n,o,a,s,u,c,d,p,f=t&&t.split("/"),l=m.map,h=l&&l["*"];if(e&&(t=(e=e.split("/")).length-1,m.nodeIdCompat&&jsSuffixRegExp.test(e[t])&&(e[t]=e[t].replace(jsSuffixRegExp,"")),function(e){for(var t,i=0;i<e.length;i++)"."===(t=e[i])?(e.splice(i,1),--i):".."===t&&(0===i||1===i&&".."===e[2]||".."===e[i-1]||0<i&&(e.splice(i-1,2),i-=2))}(e="."===e[0].charAt(0)&&f?f.slice(0,f.length-1).concat(e):e),e=e.join("/")),i&&l&&(f||h)){e:for(o=(n=e.split("/")).length;0<o;--o){if(s=n.slice(0,o).join("/"),f)for(a=f.length;0<a;--a)if(r=getOwn(l,f.slice(0,a).join("/")),r=r&&getOwn(r,s)){u=r,c=o;break e}!d&&h&&getOwn(h,s)&&(d=getOwn(h,s),p=o)}!u&&d&&(u=d,c=p),u&&(n.splice(0,c,u),e=n.join("/"))}return getOwn(m.pkgs,e)||e}function q(t){isBrowser&&each(scripts(),function(e){if(e.getAttribute("data-requiremodule")===t&&e.getAttribute("data-requirecontext")===f.contextName)return e.parentNode.removeChild(e),!0})}function E(e){var t=getOwn(m.paths,e);return t&&isArray(t)&&1<t.length&&(t.shift(),f.require.undef(e),f.makeRequire(null,{skipMap:!0})([e]),1)}function w(e){var t,i=e?e.indexOf("!"):-1;return-1<i&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function y(e,t,i,r){var n,o,a,s=null,u=t?t.name:null,c=e,d=!0,p="";return e||(d=!1,e="_@r"+(x+=1)),s=(a=w(e))[0],e=a[1],s&&(s=b(s,u,r),o=getOwn(h,s)),e&&(s?p=o&&o.normalize?o.normalize(e,function(e){return b(e,u,r)}):-1===e.indexOf("!")?b(e,u,r):e:(s=(a=w(p=b(e,u,r)))[0],p=a[1],i=!0,n=f.nameToUrl(p))),{prefix:s,name:p,parentMap:t,unnormalized:!!(i=!s||o||i?"":"_unnormalized"+(v+=1)),url:n,originalName:c,isDefine:d,id:(s?s+"!"+p:p)+i}}function S(e){var t=e.id;return getOwn(d,t)||(d[t]=new f.Module(e))}function k(e,t,i){var r=e.id,n=getOwn(d,r);!hasProp(h,r)||n&&!n.defineEmitComplete?(n=S(e)).error&&"error"===t?i(n.error):n.on(t,i):"defined"===t&&i(h[r])}function M(t,e){var i=t.requireModules,r=!1;e?e(t):(each(i,function(e){e=getOwn(d,e);e&&(e.error=t,e.events.error&&(r=!0,e.emit("error",t)))}),r||req.onError(t))}function O(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(f.defQueueMap[t]=!0),l.push(e)}),globalDefQueue=[])}function j(e){delete d[e],delete p[e]}function P(){var r,e=1e3*m.waitSeconds,n=e&&f.startTime+e<(new Date).getTime(),o=[],a=[],s=!1,u=!0;if(!t){if(t=!0,eachProp(p,function(e){var t=e.map,i=t.id;if(e.enabled&&(t.isDefine||a.push(e),!e.error))if(!e.inited&&n)E(i)?s=r=!0:(o.push(i),q(i));else if(!e.inited&&e.fetched&&t.isDefine&&(s=!0,!t.prefix))return u=!1}),n&&o.length)return(e=makeError("timeout","Load timeout for modules: "+o,null,o)).contextName=f.contextName,M(e),0;u&&each(a,function(e){!function r(n,o,a){var e=n.map.id;n.error?n.emit("error",n.error):(o[e]=!0,each(n.depMaps,function(e,t){var i=e.id,e=getOwn(d,i);!e||n.depMatched[t]||a[i]||(getOwn(o,i)?(n.defineDep(t,h[i]),n.check()):r(e,o,a))}),a[e]=!0)}(e,{},{})}),n&&!r||!s||!isBrowser&&!isWebWorker||i||(i=setTimeout(function(){i=0,P()},50)),t=!1}}function a(e){hasProp(h,e[0])||S(y(e[0],null,!0)).init(e[1],e[2])}function o(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function s(e){e=e.currentTarget||e.srcElement;return o(e,f.onScriptLoad,"load","onreadystatechange"),o(e,f.onScriptError,"error"),{node:e,id:e&&e.getAttribute("data-requiremodule")}}function R(){var e;for(O();l.length;){if(null===(e=l.shift())[0])return M(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1])),0;a(e)}f.defQueueMap={}}return c={require:function(e){return e.require||(e.require=f.makeRequire(e.map))},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?h[e.map.id]=e.exports:e.exports=h[e.map.id]={}},module:function(e){return e.module||(e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(m.config,e.map.id)||{}},exports:e.exports||(e.exports={})})}},(e=function(e){this.events=getOwn(r,e.id)||{},this.map=e,this.shim=getOwn(m.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,--this.depCount,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,f.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();f.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))}},load:function(){var e=this.map.url;n[e]||(n[e]=!0,f.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var t,e,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=f.execCb(i,o,r,n)}catch(e){t=e}else n=f.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&((e=this.module)?n=e.exports:this.usingExports&&(n=this.exports)),t)return t.requireMap=this.map,t.requireModules=this.map.isDefine?[this.map.id]:null,t.requireType=this.map.isDefine?"define":"require",M(this.error=t)}else n=o;this.exports=n,this.map.isDefine&&!this.ignore&&(h[i]=n,req.onResourceLoad&&req.onResourceLoad(f,this.map,this.depMaps)),j(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(f.defQueueMap,i)||this.fetch()}},callPlugin:function(){var s=this.map,u=s.id,e=y(s.prefix);this.depMaps.push(e),k(e,"defined",bind(this,function(e){var o,t,i=getOwn(g,this.map.id),r=this.map.name,n=this.map.parentMap?this.map.parentMap.name:null,a=f.makeRequire(s.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(e.normalize&&(r=e.normalize(r,function(e){return b(e,n,!0)})||""),k(t=y(s.prefix+"!"+r,this.map.parentMap),"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),void((r=getOwn(d,t.id))&&(this.depMaps.push(t),this.events.error&&r.on("error",bind(this,function(e){this.emit("error",e)})),r.enable()))):i?(this.map.url=f.nameToUrl(i),void this.load()):((o=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})})).error=bind(this,function(e){this.inited=!0,(this.error=e).requireModules=[u],eachProp(d,function(e){0===e.map.id.indexOf(u+"_unnormalized")&&j(e.map.id)}),M(e)}),o.fromText=bind(this,function(e,t){var i=s.name,r=y(i),n=useInteractive;t&&(e=t),n&&(useInteractive=!1),S(r),hasProp(m.config,u)&&(m.config[i]=m.config[u]);try{req.exec(e)}catch(e){return M(makeError("fromtexteval","fromText eval for "+u+" failed: "+e,e,[u]))}n&&(useInteractive=!0),this.depMaps.push(r),f.completeLoad(i),a([i],o)}),void e.load(s.name,a,o,m))})),f.enable(e,this),this.pluginMaps[e.id]=e},enable:function(){(p[this.map.id]=this).enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var i,r;if("string"==typeof e){if(e=y(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,r=getOwn(c,e.id))return void(this.depExports[t]=r(this));this.depCount+=1,k(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?k(e,"error",bind(this,this.errback)):this.events.error&&k(e,"error",bind(this,function(e){this.emit("error",e)}))}i=e.id,r=d[i],hasProp(c,i)||!r||r.enabled||f.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(d,e.id);t&&!t.enabled&&f.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){(this.events[e]||(this.events[e]=[])).push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},(f={config:m,contextName:u,registry:d,defined:h,urlFetched:n,defQueue:l,defQueueMap:{},Module:e,makeModuleMap:y,nextTick:req.nextTick,onError:M,configure:function(e){e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/");var i=m.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?(m[t]||(m[t]={}),mixin(m[t],e,!0,!0)):m[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(g[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){!(e=isArray(e)?{deps:e}:e).exports&&!e.init||e.exportsFn||(e.exportsFn=f.makeShimExports(e)),i[t]=e}),m.shim=i),e.packages&&each(e.packages,function(e){var t=(e="string"==typeof e?{name:e}:e).name;e.location&&(m.paths[t]=e.location),m.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(d,function(e,t){e.inited||e.map.unnormalized||(e.map=y(t,null,!0))}),(e.deps||e.callback)&&f.require(e.deps||[],e.callback)},makeShimExports:function(t){return function(){var e;return(e=t.init?t.init.apply(global,arguments):e)||t.exports&&getGlobal(t.exports)}},makeRequire:function(o,a){function s(e,t,i){var r,n;return a.enableBuildCallback&&t&&isFunction(t)&&(t.__requireJsBuild=!0),"string"==typeof e?isFunction(t)?M(makeError("requireargs","Invalid require call"),i):o&&hasProp(c,e)?c[e](d[o.id]):req.get?req.get(f,e,o,s):(r=y(e,o,!1,!0).id,hasProp(h,r)?h[r]:M(makeError("notloaded",'Module name "'+r+'" has not been loaded yet for context: '+u+(o?"":". Use require([])")))):(R(),f.nextTick(function(){R(),(n=S(y(null,o))).skipMap=a.skipMap,n.init(e,t,i,{enabled:!0}),P()}),s)}return a=a||{},mixin(s,{isBrowser:isBrowser,toUrl:function(e){var t,i=e.lastIndexOf("."),r=e.split("/")[0];return-1!==i&&(!("."===r||".."===r)||1<i)&&(t=e.substring(i,e.length),e=e.substring(0,i)),f.nameToUrl(b(e,o&&o.id,!0),t,!0)},defined:function(e){return hasProp(h,y(e,o,!1,!0).id)},specified:function(e){return e=y(e,o,!1,!0).id,hasProp(h,e)||hasProp(d,e)}}),o||(s.undef=function(i){O();var e=y(i,o,!0),t=getOwn(d,i);t.undefed=!0,q(i),delete h[i],delete n[e.url],delete r[i],eachReverse(l,function(e,t){e[0]===i&&l.splice(t,1)}),delete f.defQueueMap[i],t&&(t.events.defined&&(r[i]=t.events),j(i))}),s},enable:function(e){getOwn(d,e.id)&&S(e).enable()},completeLoad:function(e){var t,i,r,n=getOwn(m.shim,e)||{},o=n.exports;for(O();l.length;){if(null===(i=l.shift())[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);a(i)}if(f.defQueueMap={},r=getOwn(d,e),!t&&!hasProp(h,e)&&r&&!r.inited){if(!(!m.enforceDefine||o&&getGlobal(o)))return E(e)?void 0:M(makeError("nodefine","No define call for "+e,null,[e]));a([e,n.deps||[],n.exportsFn])}P()},nameToUrl:function(e,t,i){var r,n,o,a,s,u=getOwn(m.pkgs,e);if(u=getOwn(g,e=u?u:e))return f.nameToUrl(u,t,i);if(req.jsExtRegExp.test(e))a=e+(t||"");else{for(r=m.paths,o=(n=e.split("/")).length;0<o;--o)if(s=getOwn(r,n.slice(0,o).join("/"))){isArray(s)&&(s=s[0]),n.splice(0,o,s);break}a=n.join("/"),a=("/"===(a+=t||(/^data\:|\?/.test(a)||i?"":".js")).charAt(0)||a.match(/^[\w\+\.\-]+:/)?"":m.baseUrl)+a}return m.urlArgs?a+((-1===a.indexOf("?")?"?":"&")+m.urlArgs):a},load:function(e,t){req.load(f,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){"load"!==e.type&&!readyRegExp.test((e.currentTarget||e.srcElement).readyState)||(interactiveScript=null,e=s(e),f.completeLoad(e.id))},onScriptError:function(e){var t=s(e);if(!E(t.id))return M(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}}).require=f.makeRequire(),f}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript}}(this); \ No newline at end of file +function setTimeout(e){e()}var requirejs,require,define;"undefined"==typeof self&&(self={}),self.onmessage=function(e){var t=e.data;require(t.loaderConfig,[t.workerModule],function(e){self.onmessage=e,CESIUM_BASE_URL=t.loaderConfig.baseUrl})},function(global){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.20",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e)for(var i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}function eachReverse(e,t){if(e)for(var i=e.length-1;-1<i&&(!e[i]||!t(e[i],i,e));--i);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){for(var i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(i,e,r,n){return e&&eachProp(e,function(e,t){!r&&hasProp(i,t)||(!n||"object"!=typeof e||!e||isArray(e)||isFunction(e)||e instanceof RegExp?i[t]=e:(i[t]||(i[t]={}),mixin(i[t],e,r,n)))}),i}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,i,r){t=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return t.requireType=e,t.requireModules=r,i&&(t.originalError=i),t}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o=defContextName;return isArray(e)||"string"==typeof e||(n=e,isArray(t)?(e=t,t=i,i=r):e=[]),n&&n.context&&(o=n.context),r=(r=getOwn(contexts,o))||(contexts[o]=req.s.newContext(o)),n&&r.configure(n),r.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require=require||req,req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(t){req[t]=function(){var e=contexts[defContextName];return e.require[t].apply(e,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(t,i,r){var e,n=t&&t.config||{};if(isBrowser)return e=req.createNode(n,i,r),n.onNodeCreated&&n.onNodeCreated(e,n,i,r),e.setAttribute("data-requirecontext",t.contextName),e.setAttribute("data-requiremodule",i),!e.attachEvent||e.attachEvent.toString&&e.attachEvent.toString().indexOf("[native code")<0||isOpera?(e.addEventListener("load",t.onScriptLoad,!1),e.addEventListener("error",t.onScriptError,!1)):(useInteractive=!0,e.attachEvent("onreadystatechange",t.onScriptLoad)),e.src=r,currentlyAddingScript=e,baseElement?head.insertBefore(e,baseElement):head.appendChild(e),currentlyAddingScript=null,e;if(isWebWorker)try{importScripts(r),t.completeLoad(i)}catch(e){t.onError(makeError("importscripts","importScripts failed for "+i+" at "+r,e,[i]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head=head||e.parentNode,dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||(mainScript=(src=mainScript.split("/")).pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,i,t){var r,n;"string"!=typeof e&&(t=i,i=e,e=null),isArray(i)||(t=i,i=null),!i&&isFunction(t)&&(i=[],t.length&&(t.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,t){i.push(t)}),i=(1===t.length?["require"]:["require","exports","module"]).concat(i))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript())&&(e=e||r.getAttribute("data-requiremodule"),n=contexts[r.getAttribute("data-requirecontext")]),n?(n.defQueue.push([e,i,t]),n.defQueueMap[e]=!0):globalDefQueue.push([e,i,t])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}function newContext(u){var t,e,f,c,i,m={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},d={},p={},r={},l=[],h={},n={},g={},x=1,v=1;function b(e,t,i){var r,n,o,a,s,u,c,d,p,f=t&&t.split("/"),l=m.map,h=l&&l["*"];if(e&&(t=(e=e.split("/")).length-1,m.nodeIdCompat&&jsSuffixRegExp.test(e[t])&&(e[t]=e[t].replace(jsSuffixRegExp,"")),function(e){for(var t,i=0;i<e.length;i++)"."===(t=e[i])?(e.splice(i,1),--i):".."===t&&(0===i||1===i&&".."===e[2]||".."===e[i-1]||0<i&&(e.splice(i-1,2),i-=2))}(e="."===e[0].charAt(0)&&f?f.slice(0,f.length-1).concat(e):e),e=e.join("/")),i&&l&&(f||h)){e:for(o=(n=e.split("/")).length;0<o;--o){if(s=n.slice(0,o).join("/"),f)for(a=f.length;0<a;--a)if(r=(r=getOwn(l,f.slice(0,a).join("/")))&&getOwn(r,s)){u=r,c=o;break e}!d&&h&&getOwn(h,s)&&(d=getOwn(h,s),p=o)}!u&&d&&(u=d,c=p),u&&(n.splice(0,c,u),e=n.join("/"))}return getOwn(m.pkgs,e)||e}function q(t){isBrowser&&each(scripts(),function(e){if(e.getAttribute("data-requiremodule")===t&&e.getAttribute("data-requirecontext")===f.contextName)return e.parentNode.removeChild(e),!0})}function E(e){var t=getOwn(m.paths,e);return t&&isArray(t)&&1<t.length&&(t.shift(),f.require.undef(e),f.makeRequire(null,{skipMap:!0})([e]),1)}function w(e){var t,i=e?e.indexOf("!"):-1;return-1<i&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function y(e,t,i,r){var n,o,a,s=null,u=t?t.name:null,c=e,d=!0,p="";return e||(d=!1,e="_@r"+(x+=1)),s=(a=w(e))[0],e=a[1],s&&(s=b(s,u,r),o=getOwn(h,s)),e&&(s?p=o&&o.normalize?o.normalize(e,function(e){return b(e,u,r)}):-1===e.indexOf("!")?b(e,u,r):e:(s=(a=w(p=b(e,u,r)))[0],p=a[1],i=!0,n=f.nameToUrl(p))),{prefix:s,name:p,parentMap:t,unnormalized:!!(i=!s||o||i?"":"_unnormalized"+(v+=1)),url:n,originalName:c,isDefine:d,id:(s?s+"!"+p:p)+i}}function S(e){var t=e.id;return getOwn(d,t)||(d[t]=new f.Module(e))}function k(e,t,i){var r=e.id,n=getOwn(d,r);!hasProp(h,r)||n&&!n.defineEmitComplete?(n=S(e)).error&&"error"===t?i(n.error):n.on(t,i):"defined"===t&&i(h[r])}function M(t,e){var i=t.requireModules,r=!1;e?e(t):(each(i,function(e){e=getOwn(d,e);e&&(e.error=t,e.events.error&&(r=!0,e.emit("error",t)))}),r||req.onError(t))}function O(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(f.defQueueMap[t]=!0),l.push(e)}),globalDefQueue=[])}function j(e){delete d[e],delete p[e]}function P(){var r,e=1e3*m.waitSeconds,n=e&&f.startTime+e<(new Date).getTime(),o=[],a=[],s=!1,u=!0;if(!t){if(t=!0,eachProp(p,function(e){var t=e.map,i=t.id;if(e.enabled&&(t.isDefine||a.push(e),!e.error))if(!e.inited&&n)E(i)?s=r=!0:(o.push(i),q(i));else if(!e.inited&&e.fetched&&t.isDefine&&(s=!0,!t.prefix))return u=!1}),n&&o.length)return(e=makeError("timeout","Load timeout for modules: "+o,null,o)).contextName=f.contextName,M(e),0;u&&each(a,function(e){!function r(n,o,a){var e=n.map.id;n.error?n.emit("error",n.error):(o[e]=!0,each(n.depMaps,function(e,t){var i=e.id,e=getOwn(d,i);!e||n.depMatched[t]||a[i]||(getOwn(o,i)?(n.defineDep(t,h[i]),n.check()):r(e,o,a))}),a[e]=!0)}(e,{},{})}),n&&!r||!s||!isBrowser&&!isWebWorker||i||(i=setTimeout(function(){i=0,P()},50)),t=!1}}function a(e){hasProp(h,e[0])||S(y(e[0],null,!0)).init(e[1],e[2])}function o(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function s(e){e=e.currentTarget||e.srcElement;return o(e,f.onScriptLoad,"load","onreadystatechange"),o(e,f.onScriptError,"error"),{node:e,id:e&&e.getAttribute("data-requiremodule")}}function R(){var e;for(O();l.length;){if(null===(e=l.shift())[0])return M(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1])),0;a(e)}f.defQueueMap={}}return c={require:function(e){return e.require||(e.require=f.makeRequire(e.map))},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?h[e.map.id]=e.exports:e.exports=h[e.map.id]={}},module:function(e){return e.module||(e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(m.config,e.map.id)||{}},exports:e.exports||(e.exports={})})}},(e=function(e){this.events=getOwn(r,e.id)||{},this.map=e,this.shim=getOwn(m.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,--this.depCount,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,f.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();f.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))}},load:function(){var e=this.map.url;n[e]||(n[e]=!0,f.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var t,e=this.map.id,i=this.depExports,r=this.exports,n=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(n)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{r=f.execCb(e,n,i,r)}catch(e){t=e}else r=f.execCb(e,n,i,r);if(this.map.isDefine&&void 0===r&&((i=this.module)?r=i.exports:this.usingExports&&(r=this.exports)),t)return t.requireMap=this.map,t.requireModules=this.map.isDefine?[this.map.id]:null,t.requireType=this.map.isDefine?"define":"require",M(this.error=t)}else r=n;this.exports=r,this.map.isDefine&&!this.ignore&&(h[e]=r,req.onResourceLoad&&req.onResourceLoad(f,this.map,this.depMaps)),j(e),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(f.defQueueMap,e)||this.fetch()}},callPlugin:function(){var s=this.map,u=s.id,e=y(s.prefix);this.depMaps.push(e),k(e,"defined",bind(this,function(e){var o,t,i=getOwn(g,this.map.id),r=this.map.name,n=this.map.parentMap?this.map.parentMap.name:null,a=f.makeRequire(s.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(e.normalize&&(r=e.normalize(r,function(e){return b(e,n,!0)})||""),k(t=y(s.prefix+"!"+r,this.map.parentMap),"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),void((r=getOwn(d,t.id))&&(this.depMaps.push(t),this.events.error&&r.on("error",bind(this,function(e){this.emit("error",e)})),r.enable()))):i?(this.map.url=f.nameToUrl(i),void this.load()):((o=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})})).error=bind(this,function(e){this.inited=!0,(this.error=e).requireModules=[u],eachProp(d,function(e){0===e.map.id.indexOf(u+"_unnormalized")&&j(e.map.id)}),M(e)}),o.fromText=bind(this,function(e,t){var i=s.name,r=y(i),n=useInteractive;t&&(e=t),n&&(useInteractive=!1),S(r),hasProp(m.config,u)&&(m.config[i]=m.config[u]);try{req.exec(e)}catch(e){return M(makeError("fromtexteval","fromText eval for "+u+" failed: "+e,e,[u]))}n&&(useInteractive=!0),this.depMaps.push(r),f.completeLoad(i),a([i],o)}),void e.load(s.name,a,o,m))})),f.enable(e,this),this.pluginMaps[e.id]=e},enable:function(){(p[this.map.id]=this).enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var i,r;if("string"==typeof e){if(e=y(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,r=getOwn(c,e.id))return void(this.depExports[t]=r(this));this.depCount+=1,k(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?k(e,"error",bind(this,this.errback)):this.events.error&&k(e,"error",bind(this,function(e){this.emit("error",e)}))}i=e.id,r=d[i],hasProp(c,i)||!r||r.enabled||f.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(d,e.id);t&&!t.enabled&&f.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){(this.events[e]||(this.events[e]=[])).push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},(f={config:m,contextName:u,registry:d,defined:h,urlFetched:n,defQueue:l,defQueueMap:{},Module:e,makeModuleMap:y,nextTick:req.nextTick,onError:M,configure:function(e){e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/");var i=m.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?(m[t]||(m[t]={}),mixin(m[t],e,!0,!0)):m[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(g[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){!(e=isArray(e)?{deps:e}:e).exports&&!e.init||e.exportsFn||(e.exportsFn=f.makeShimExports(e)),i[t]=e}),m.shim=i),e.packages&&each(e.packages,function(e){var t=(e="string"==typeof e?{name:e}:e).name;e.location&&(m.paths[t]=e.location),m.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(d,function(e,t){e.inited||e.map.unnormalized||(e.map=y(t,null,!0))}),(e.deps||e.callback)&&f.require(e.deps||[],e.callback)},makeShimExports:function(t){return function(){var e;return(e=t.init?t.init.apply(global,arguments):e)||t.exports&&getGlobal(t.exports)}},makeRequire:function(o,a){function s(e,t,i){var r,n;return a.enableBuildCallback&&t&&isFunction(t)&&(t.__requireJsBuild=!0),"string"==typeof e?isFunction(t)?M(makeError("requireargs","Invalid require call"),i):o&&hasProp(c,e)?c[e](d[o.id]):req.get?req.get(f,e,o,s):(r=y(e,o,!1,!0).id,hasProp(h,r)?h[r]:M(makeError("notloaded",'Module name "'+r+'" has not been loaded yet for context: '+u+(o?"":". Use require([])")))):(R(),f.nextTick(function(){R(),(n=S(y(null,o))).skipMap=a.skipMap,n.init(e,t,i,{enabled:!0}),P()}),s)}return a=a||{},mixin(s,{isBrowser:isBrowser,toUrl:function(e){var t,i=e.lastIndexOf("."),r=e.split("/")[0];return-1!==i&&(!("."===r||".."===r)||1<i)&&(t=e.substring(i,e.length),e=e.substring(0,i)),f.nameToUrl(b(e,o&&o.id,!0),t,!0)},defined:function(e){return hasProp(h,y(e,o,!1,!0).id)},specified:function(e){return e=y(e,o,!1,!0).id,hasProp(h,e)||hasProp(d,e)}}),o||(s.undef=function(i){O();var e=y(i,o,!0),t=getOwn(d,i);t.undefed=!0,q(i),delete h[i],delete n[e.url],delete r[i],eachReverse(l,function(e,t){e[0]===i&&l.splice(t,1)}),delete f.defQueueMap[i],t&&(t.events.defined&&(r[i]=t.events),j(i))}),s},enable:function(e){getOwn(d,e.id)&&S(e).enable()},completeLoad:function(e){var t,i,r,n=getOwn(m.shim,e)||{},o=n.exports;for(O();l.length;){if(null===(i=l.shift())[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);a(i)}if(f.defQueueMap={},r=getOwn(d,e),!t&&!hasProp(h,e)&&r&&!r.inited){if(!(!m.enforceDefine||o&&getGlobal(o)))return E(e)?void 0:M(makeError("nodefine","No define call for "+e,null,[e]));a([e,n.deps||[],n.exportsFn])}P()},nameToUrl:function(e,t,i){var r,n,o,a,s,u=getOwn(m.pkgs,e);if(u=getOwn(g,e=u?u:e))return f.nameToUrl(u,t,i);if(req.jsExtRegExp.test(e))a=e+(t||"");else{for(r=m.paths,o=(n=e.split("/")).length;0<o;--o)if(s=getOwn(r,n.slice(0,o).join("/"))){isArray(s)&&(s=s[0]),n.splice(0,o,s);break}a=n.join("/"),a=("/"===(a+=t||(/^data\:|\?/.test(a)||i?"":".js")).charAt(0)||a.match(/^[\w\+\.\-]+:/)?"":m.baseUrl)+a}return m.urlArgs?a+((-1===a.indexOf("?")?"?":"&")+m.urlArgs):a},load:function(e,t){req.load(f,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){"load"!==e.type&&!readyRegExp.test((e.currentTarget||e.srcElement).readyState)||(interactiveScript=null,e=s(e),f.completeLoad(e.id))},onScriptError:function(e){var t=s(e);if(!E(t.id))return M(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}}).require=f.makeRequire(),f}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript}}(this); \ No newline at end of file diff --git a/public/Cesium/Workers/combineGeometry.js b/public/Cesium/Workers/combineGeometry.js index 0a253f5..1854f8a 100644 --- a/public/Cesium/Workers/combineGeometry.js +++ b/public/Cesium/Workers/combineGeometry.js @@ -1 +1 @@ -define(["./PrimitivePipeline-5ce755e1","./createTaskProcessorWorker","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryPipeline-5e672526","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./IndexDatatype-d47ad6f6","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./WebMercatorProjection-ffb6b9f8"],function(i,e,t,r,n,a,o,s,b,c,m,f,d,P,p,u,y,C,l){"use strict";return e(function(e,t){return e=i.PrimitivePipeline.unpackCombineGeometryParameters(e),e=i.PrimitivePipeline.combineGeometry(e),i.PrimitivePipeline.packCombineGeometryResults(e,t)})}); +define(["./PrimitivePipeline-c76ef883","./createTaskProcessorWorker","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Math-d6182036","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryPipeline-571ff4c9","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./IndexDatatype-82ceea78","./IntersectionTests-5394f658","./Plane-13ae4b1b","./WebMercatorProjection-66cc0482"],function(i,e,t,r,n,a,o,c,s,m,b,P,p,u,d,f,y,C,l){"use strict";return e(function(e,t){return e=i.PrimitivePipeline.unpackCombineGeometryParameters(e),e=i.PrimitivePipeline.combineGeometry(e),i.PrimitivePipeline.packCombineGeometryResults(e,t)})}); diff --git a/public/Cesium/Workers/createBoxGeometry.js b/public/Cesium/Workers/createBoxGeometry.js index ead1cd3..0dfac34 100644 --- a/public/Cesium/Workers/createBoxGeometry.js +++ b/public/Cesium/Workers/createBoxGeometry.js @@ -1 +1 @@ -define(["./BoxGeometry-c7d4febc","./when-208fe5b0","./GeometryOffsetAttribute-def3b741","./Check-d18af7c4","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Math-4e53b694","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./VertexFormat-e8cbf5b3"],function(r,o,e,t,b,n,f,a,c,m,d,i,u){"use strict";return function(e,t){return o.defined(t)&&(e=r.BoxGeometry.unpack(e,t)),r.BoxGeometry.createGeometry(e)}}); +define(["./BoxGeometry-0609cbde","./when-54335d57","./GeometryOffsetAttribute-718fa138","./Check-24483042","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Math-d6182036","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./VertexFormat-81ec7207"],function(r,a,e,t,o,n,c,m,i,u,d,f,s){"use strict";return function(e,t){return a.defined(t)&&(e=r.BoxGeometry.unpack(e,t)),r.BoxGeometry.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createBoxOutlineGeometry.js b/public/Cesium/Workers/createBoxOutlineGeometry.js index b69edc0..b0ce96b 100644 --- a/public/Cesium/Workers/createBoxOutlineGeometry.js +++ b/public/Cesium/Workers/createBoxOutlineGeometry.js @@ -1 +1 @@ -define(["./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./when-208fe5b0","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./Math-4e53b694","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1"],function(u,m,o,e,s,f,c,d,t,a,n){"use strict";var b=new o.Cartesian3;function r(e){var t=(e=f.defaultValue(e,f.defaultValue.EMPTY_OBJECT)).minimum,a=e.maximum;this._min=o.Cartesian3.clone(t),this._max=o.Cartesian3.clone(a),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}r.fromDimensions=function(e){var t=(e=f.defaultValue(e,f.defaultValue.EMPTY_OBJECT)).dimensions,t=o.Cartesian3.multiplyByScalar(t,.5,new o.Cartesian3);return new r({minimum:o.Cartesian3.negate(t,new o.Cartesian3),maximum:t,offsetAttribute:e.offsetAttribute})},r.fromAxisAlignedBoundingBox=function(e){return new r({minimum:e.minimum,maximum:e.maximum})},r.packedLength=2*o.Cartesian3.packedLength+1,r.pack=function(e,t,a){return a=f.defaultValue(a,0),o.Cartesian3.pack(e._min,t,a),o.Cartesian3.pack(e._max,t,a+o.Cartesian3.packedLength),t[a+2*o.Cartesian3.packedLength]=f.defaultValue(e._offsetAttribute,-1),t};var p=new o.Cartesian3,y=new o.Cartesian3,C={minimum:p,maximum:y,offsetAttribute:void 0};return r.unpack=function(e,t,a){t=f.defaultValue(t,0);var n=o.Cartesian3.unpack(e,t,p),i=o.Cartesian3.unpack(e,t+o.Cartesian3.packedLength,y),t=e[t+2*o.Cartesian3.packedLength];return f.defined(a)?(a._min=o.Cartesian3.clone(n,a._min),a._max=o.Cartesian3.clone(i,a._max),a._offsetAttribute=-1===t?void 0:t,a):(C.offsetAttribute=-1===t?void 0:t,new r(C))},r.createGeometry=function(e){var t=e._min,a=e._max;if(!o.Cartesian3.equals(t,a)){var n=new d.GeometryAttributes,i=new Uint16Array(24),r=new Float64Array(24);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=a.x,r[4]=t.y,r[5]=t.z,r[6]=a.x,r[7]=a.y,r[8]=t.z,r[9]=t.x,r[10]=a.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=a.z,r[15]=a.x,r[16]=t.y,r[17]=a.z,r[18]=a.x,r[19]=a.y,r[20]=a.z,r[21]=t.x,r[22]=a.y,r[23]=a.z,n.position=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:r}),i[0]=4,i[1]=5,i[2]=5,i[3]=6,i[4]=6,i[5]=7,i[6]=7,i[7]=4,i[8]=0,i[9]=1,i[10]=1,i[11]=2,i[12]=2,i[13]=3,i[14]=3,i[15]=0,i[16]=0,i[17]=4,i[18]=1,i[19]=5,i[20]=2,i[21]=6,i[22]=3,i[23]=7;a=o.Cartesian3.subtract(a,t,b),t=.5*o.Cartesian3.magnitude(a);return f.defined(e._offsetAttribute)&&(a=r.length,r=new Uint8Array(a/3),a=e._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,u.arrayFill(r,a),n.applyOffset=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})),new c.Geometry({attributes:n,indices:i,primitiveType:c.PrimitiveType.LINES,boundingSphere:new m.BoundingSphere(o.Cartesian3.ZERO,t),offsetAttribute:e._offsetAttribute})}},function(e,t){return f.defined(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}}); +define(["./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./when-54335d57","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./Math-d6182036","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9"],function(u,m,o,e,s,f,c,d,t,a,n){"use strict";var p=new o.Cartesian3;function r(e){var t=(e=f.defaultValue(e,f.defaultValue.EMPTY_OBJECT)).minimum,a=e.maximum;this._min=o.Cartesian3.clone(t),this._max=o.Cartesian3.clone(a),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}r.fromDimensions=function(e){var t=(e=f.defaultValue(e,f.defaultValue.EMPTY_OBJECT)).dimensions,t=o.Cartesian3.multiplyByScalar(t,.5,new o.Cartesian3);return new r({minimum:o.Cartesian3.negate(t,new o.Cartesian3),maximum:t,offsetAttribute:e.offsetAttribute})},r.fromAxisAlignedBoundingBox=function(e){return new r({minimum:e.minimum,maximum:e.maximum})},r.packedLength=2*o.Cartesian3.packedLength+1,r.pack=function(e,t,a){return a=f.defaultValue(a,0),o.Cartesian3.pack(e._min,t,a),o.Cartesian3.pack(e._max,t,a+o.Cartesian3.packedLength),t[a+2*o.Cartesian3.packedLength]=f.defaultValue(e._offsetAttribute,-1),t};var y=new o.Cartesian3,C=new o.Cartesian3,l={minimum:y,maximum:C,offsetAttribute:void 0};return r.unpack=function(e,t,a){t=f.defaultValue(t,0);var n=o.Cartesian3.unpack(e,t,y),i=o.Cartesian3.unpack(e,t+o.Cartesian3.packedLength,C),t=e[t+2*o.Cartesian3.packedLength];return f.defined(a)?(a._min=o.Cartesian3.clone(n,a._min),a._max=o.Cartesian3.clone(i,a._max),a._offsetAttribute=-1===t?void 0:t,a):(l.offsetAttribute=-1===t?void 0:t,new r(l))},r.createGeometry=function(e){var t=e._min,a=e._max;if(!o.Cartesian3.equals(t,a)){var n=new d.GeometryAttributes,i=new Uint16Array(24),r=new Float64Array(24);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=a.x,r[4]=t.y,r[5]=t.z,r[6]=a.x,r[7]=a.y,r[8]=t.z,r[9]=t.x,r[10]=a.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=a.z,r[15]=a.x,r[16]=t.y,r[17]=a.z,r[18]=a.x,r[19]=a.y,r[20]=a.z,r[21]=t.x,r[22]=a.y,r[23]=a.z,n.position=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:r}),i[0]=4,i[1]=5,i[2]=5,i[3]=6,i[4]=6,i[5]=7,i[6]=7,i[7]=4,i[8]=0,i[9]=1,i[10]=1,i[11]=2,i[12]=2,i[13]=3,i[14]=3,i[15]=0,i[16]=0,i[17]=4,i[18]=1,i[19]=5,i[20]=2,i[21]=6,i[22]=3,i[23]=7;a=o.Cartesian3.subtract(a,t,p),t=.5*o.Cartesian3.magnitude(a);return f.defined(e._offsetAttribute)&&(a=r.length,r=new Uint8Array(a/3),a=e._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,u.arrayFill(r,a),n.applyOffset=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})),new c.Geometry({attributes:n,indices:i,primitiveType:c.PrimitiveType.LINES,boundingSphere:new m.BoundingSphere(o.Cartesian3.ZERO,t),offsetAttribute:e._offsetAttribute})}},function(e,t){return f.defined(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createCircleGeometry.js b/public/Cesium/Workers/createCircleGeometry.js index 80d02c9..e239b07 100644 --- a/public/Cesium/Workers/createCircleGeometry.js +++ b/public/Cesium/Workers/createCircleGeometry.js @@ -1 +1 @@ -define(["./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./EllipseGeometry-42ee4ae7","./VertexFormat-e8cbf5b3","./Math-4e53b694","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./EllipseGeometryLibrary-2412418f","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryInstance-d919cab6","./GeometryPipeline-5e672526","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./IndexDatatype-d47ad6f6","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(r,e,o,n,a,t,i,s,l,d,m,u,c,p,y,_,h,G,x,f,g){"use strict";function b(e){var t=(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).radius,e={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 n.EllipseGeometry(e),this._workerName="createCircleGeometry"}b.packedLength=n.EllipseGeometry.packedLength,b.pack=function(e,t,i){return n.EllipseGeometry.pack(e._ellipseGeometry,t,i)};var E=new n.EllipseGeometry({center:new r.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),v={center:new r.Cartesian3,radius:void 0,ellipsoid:r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new a.VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return b.unpack=function(e,t,i){t=n.EllipseGeometry.unpack(e,t,E);return v.center=r.Cartesian3.clone(t._center,v.center),v.ellipsoid=r.Ellipsoid.clone(t._ellipsoid,v.ellipsoid),v.height=t._height,v.extrudedHeight=t._extrudedHeight,v.granularity=t._granularity,v.vertexFormat=a.VertexFormat.clone(t._vertexFormat,v.vertexFormat),v.stRotation=t._stRotation,v.shadowVolume=t._shadowVolume,o.defined(i)?(v.semiMajorAxis=t._semiMajorAxis,v.semiMinorAxis=t._semiMinorAxis,i._ellipseGeometry=new n.EllipseGeometry(v),i):(v.radius=t._semiMajorAxis,new b(v))},b.createGeometry=function(e){return n.EllipseGeometry.createGeometry(e._ellipseGeometry)},b.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,t=t(r,o),i=i(r,o);return new b({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:t,height:i,vertexFormat:a.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(b.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),function(e,t){return(e=o.defined(t)?b.unpack(e,t):e)._ellipseGeometry._center=r.Cartesian3.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=r.Ellipsoid.clone(e._ellipseGeometry._ellipsoid),b.createGeometry(e)}}); +define(["./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./EllipseGeometry-8e3bce61","./VertexFormat-81ec7207","./Math-d6182036","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./EllipseGeometryLibrary-e452d6b7","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryInstance-6aa9010a","./GeometryPipeline-571ff4c9","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./IndexDatatype-82ceea78","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(r,e,o,a,n,t,i,s,l,m,d,c,u,p,y,_,h,G,x,g,f){"use strict";function E(e){var t=(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).radius,e={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 a.EllipseGeometry(e),this._workerName="createCircleGeometry"}E.packedLength=a.EllipseGeometry.packedLength,E.pack=function(e,t,i){return a.EllipseGeometry.pack(e._ellipseGeometry,t,i)};var v=new a.EllipseGeometry({center:new r.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),w={center:new r.Cartesian3,radius:void 0,ellipsoid:r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new n.VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return E.unpack=function(e,t,i){t=a.EllipseGeometry.unpack(e,t,v);return w.center=r.Cartesian3.clone(t._center,w.center),w.ellipsoid=r.Ellipsoid.clone(t._ellipsoid,w.ellipsoid),w.height=t._height,w.extrudedHeight=t._extrudedHeight,w.granularity=t._granularity,w.vertexFormat=n.VertexFormat.clone(t._vertexFormat,w.vertexFormat),w.stRotation=t._stRotation,w.shadowVolume=t._shadowVolume,o.defined(i)?(w.semiMajorAxis=t._semiMajorAxis,w.semiMinorAxis=t._semiMinorAxis,i._ellipseGeometry=new a.EllipseGeometry(w),i):(w.radius=t._semiMajorAxis,new E(w))},E.createGeometry=function(e){return a.EllipseGeometry.createGeometry(e._ellipseGeometry)},E.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,t=t(r,o),i=i(r,o);return new E({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:t,height:i,vertexFormat:n.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(E.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}}),function(e,t){return(e=o.defined(t)?E.unpack(e,t):e)._ellipseGeometry._center=r.Cartesian3.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=r.Ellipsoid.clone(e._ellipseGeometry._ellipsoid),E.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createCircleOutlineGeometry.js b/public/Cesium/Workers/createCircleOutlineGeometry.js index fc605cb..b538ff6 100644 --- a/public/Cesium/Workers/createCircleOutlineGeometry.js +++ b/public/Cesium/Workers/createCircleOutlineGeometry.js @@ -1 +1 @@ -define(["./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./EllipseOutlineGeometry-ab13c628","./Math-4e53b694","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./EllipseGeometryLibrary-2412418f","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6"],function(r,e,l,n,i,t,s,o,a,d,u,m,c,p){"use strict";function y(e){var i=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).radius,e={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n.EllipseOutlineGeometry(e),this._workerName="createCircleOutlineGeometry"}y.packedLength=n.EllipseOutlineGeometry.packedLength,y.pack=function(e,i,t){return n.EllipseOutlineGeometry.pack(e._ellipseGeometry,i,t)};var f=new n.EllipseOutlineGeometry({center:new r.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),G={center:new r.Cartesian3,radius:void 0,ellipsoid:r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return y.unpack=function(e,i,t){i=n.EllipseOutlineGeometry.unpack(e,i,f);return G.center=r.Cartesian3.clone(i._center,G.center),G.ellipsoid=r.Ellipsoid.clone(i._ellipsoid,G.ellipsoid),G.height=i._height,G.extrudedHeight=i._extrudedHeight,G.granularity=i._granularity,G.numberOfVerticalLines=i._numberOfVerticalLines,l.defined(t)?(G.semiMajorAxis=i._semiMajorAxis,G.semiMinorAxis=i._semiMinorAxis,t._ellipseGeometry=new n.EllipseOutlineGeometry(G),t):(G.radius=i._semiMajorAxis,new y(G))},y.createGeometry=function(e){return n.EllipseOutlineGeometry.createGeometry(e._ellipseGeometry)},function(e,i){return(e=l.defined(i)?y.unpack(e,i):e)._ellipseGeometry._center=r.Cartesian3.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=r.Ellipsoid.clone(e._ellipseGeometry._ellipsoid),y.createGeometry(e)}}); +define(["./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./EllipseOutlineGeometry-61cb55e1","./Math-d6182036","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./EllipseGeometryLibrary-e452d6b7","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78"],function(r,e,l,n,i,t,s,o,a,u,d,c,m,p){"use strict";function y(e){var i=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).radius,e={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n.EllipseOutlineGeometry(e),this._workerName="createCircleOutlineGeometry"}y.packedLength=n.EllipseOutlineGeometry.packedLength,y.pack=function(e,i,t){return n.EllipseOutlineGeometry.pack(e._ellipseGeometry,i,t)};var G=new n.EllipseOutlineGeometry({center:new r.Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),_={center:new r.Cartesian3,radius:void 0,ellipsoid:r.Ellipsoid.clone(r.Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return y.unpack=function(e,i,t){i=n.EllipseOutlineGeometry.unpack(e,i,G);return _.center=r.Cartesian3.clone(i._center,_.center),_.ellipsoid=r.Ellipsoid.clone(i._ellipsoid,_.ellipsoid),_.height=i._height,_.extrudedHeight=i._extrudedHeight,_.granularity=i._granularity,_.numberOfVerticalLines=i._numberOfVerticalLines,l.defined(t)?(_.semiMajorAxis=i._semiMajorAxis,_.semiMinorAxis=i._semiMinorAxis,t._ellipseGeometry=new n.EllipseOutlineGeometry(_),t):(_.radius=i._semiMajorAxis,new y(_))},y.createGeometry=function(e){return n.EllipseOutlineGeometry.createGeometry(e._ellipseGeometry)},function(e,i){return(e=l.defined(i)?y.unpack(e,i):e)._ellipseGeometry._center=r.Cartesian3.clone(e._ellipseGeometry._center),e._ellipseGeometry._ellipsoid=r.Ellipsoid.clone(e._ellipseGeometry._ellipsoid),y.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createCoplanarPolygonGeometry.js b/public/Cesium/Workers/createCoplanarPolygonGeometry.js index cab3525..3fd7c4c 100644 --- a/public/Cesium/Workers/createCoplanarPolygonGeometry.js +++ b/public/Cesium/Workers/createCoplanarPolygonGeometry.js @@ -1 +1 @@ -define(["./arrayRemoveDuplicates-0f62a181","./BoundingRectangle-7ee12c46","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./CoplanarPolygonGeometryLibrary-6c63fe5e","./when-208fe5b0","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryInstance-d919cab6","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonGeometryLibrary-d175a7f1","./PolygonPipeline-bfd1975b","./VertexFormat-e8cbf5b3","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./OrientedBoundingBox-18b4901f","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./ArcType-dc1c5aee","./EllipsoidRhumbLine-8cb2e5a4"],function(h,e,L,E,t,T,f,l,D,_,C,v,k,V,x,R,s,a,n,r,o,i,p,y,c,m,u){"use strict";var I=new E.Cartesian3,P=new e.BoundingRectangle,M=new E.Cartesian2,H=new E.Cartesian2,w=new E.Cartesian3,A=new E.Cartesian3,F=new E.Cartesian3,G=new E.Cartesian3,B=new E.Cartesian3,O=new E.Cartesian3,z=new L.Quaternion,S=new L.Matrix3,N=new L.Matrix3,Q=new E.Cartesian3;function d(e){var t=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).polygonHierarchy,a=l.defaultValue(e.vertexFormat,s.VertexFormat.DEFAULT);this._vertexFormat=s.VertexFormat.clone(a),this._polygonHierarchy=t,this._stRotation=l.defaultValue(e.stRotation,0),this._ellipsoid=E.Ellipsoid.clone(l.defaultValue(e.ellipsoid,E.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=x.PolygonGeometryLibrary.computeHierarchyPackedLength(t)+s.VertexFormat.packedLength+E.Ellipsoid.packedLength+2}d.fromPositions=function(e){return new d({polygonHierarchy:{positions:(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},d.pack=function(e,t,a){return a=l.defaultValue(a,0),a=x.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,a),E.Ellipsoid.pack(e._ellipsoid,t,a),a+=E.Ellipsoid.packedLength,s.VertexFormat.pack(e._vertexFormat,t,a),a+=s.VertexFormat.packedLength,t[a++]=e._stRotation,t[a]=e.packedLength,t};var g=E.Ellipsoid.clone(E.Ellipsoid.UNIT_SPHERE),b=new s.VertexFormat,j={polygonHierarchy:{}};return d.unpack=function(e,t,a){t=l.defaultValue(t,0);var n=x.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;var r=E.Ellipsoid.unpack(e,t,g);t+=E.Ellipsoid.packedLength;var o=s.VertexFormat.unpack(e,t,b);t+=s.VertexFormat.packedLength;var i=e[t++],t=e[t];return(a=!l.defined(a)?new d(j):a)._polygonHierarchy=n,a._ellipsoid=E.Ellipsoid.clone(r,a._ellipsoid),a._vertexFormat=s.VertexFormat.clone(o,a._vertexFormat),a._stRotation=i,a.packedLength=t,a},d.createGeometry=function(e){var t=e._vertexFormat,a=e._polygonHierarchy,n=e._stRotation,r=a.positions;if(!((r=h.arrayRemoveDuplicates(r,E.Cartesian3.equalsEpsilon,!0)).length<3)){var o=w,i=A,l=F,s=B,p=O;if(f.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(r,G,s,p)){o=E.Cartesian3.cross(s,p,o);o=E.Cartesian3.normalize(o,o),E.Cartesian3.equalsEpsilon(G,E.Cartesian3.ZERO,V.CesiumMath.EPSILON6)||(y=e._ellipsoid.geodeticSurfaceNormal(G,Q),E.Cartesian3.dot(o,y)<0&&(o=E.Cartesian3.negate(o,o),s=E.Cartesian3.negate(s,s)));var y=f.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(G,s,p),c=f.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(G,s,p);t.tangent&&(i=E.Cartesian3.clone(s,i)),t.bitangent&&(l=E.Cartesian3.clone(p,l));var a=x.PolygonGeometryLibrary.polygonsFromHierarchy(a,y,!1),y=a.hierarchy,m=a.polygons;if(0!==y.length){for(var r=y[0].outerRing,a=L.BoundingSphere.fromPoints(r),u=x.PolygonGeometryLibrary.computeBoundingRectangle(o,c,r,n,P),d=[],g=0;g<m.length;g++){var b=new C.GeometryInstance({geometry:function(e,t,a,n,r,o,i,l){var s=e.positions,p=R.PolygonPipeline.triangulate(e.positions2D,e.holes);p.length<3&&(p=[0,1,2]),(e=k.IndexDatatype.createTypedArray(s.length,p.length)).set(p);var y=S;0!==n?(p=L.Quaternion.fromAxisAngle(o,n,z),y=L.Matrix3.fromQuaternion(p,y),(t.tangent||t.bitangent)&&(p=L.Quaternion.fromAxisAngle(o,-n,z),u=L.Matrix3.fromQuaternion(p,N),i=E.Cartesian3.normalize(L.Matrix3.multiplyByVector(u,i,i),i),t.bitangent&&(l=E.Cartesian3.normalize(E.Cartesian3.cross(o,i,l),l)))):y=L.Matrix3.clone(L.Matrix3.IDENTITY,y);var c=H;t.st&&(c.x=a.x,c.y=a.y);for(var m=s.length,u=3*m,d=new Float64Array(u),g=t.normal?new Float32Array(u):void 0,b=t.tangent?new Float32Array(u):void 0,h=t.bitangent?new Float32Array(u):void 0,f=t.st?new Float32Array(2*m):void 0,C=0,v=0,x=0,P=0,w=0,A=0;A<m;A++){var F,G=s[A];d[C++]=G.x,d[C++]=G.y,d[C++]=G.z,t.st&&(F=r(L.Matrix3.multiplyByVector(y,G,I),M),E.Cartesian2.subtract(F,c,F),G=V.CesiumMath.clamp(F.x/a.width,0,1),F=V.CesiumMath.clamp(F.y/a.height,0,1),f[w++]=G,f[w++]=F),t.normal&&(g[v++]=o.x,g[v++]=o.y,g[v++]=o.z),t.tangent&&(b[P++]=i.x,b[P++]=i.y,b[P++]=i.z),t.bitangent&&(h[x++]=l.x,h[x++]=l.y,h[x++]=l.z)}return u=new _.GeometryAttributes,t.position&&(u.position=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})),t.normal&&(u.normal=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g})),t.tangent&&(u.tangent=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(u.bitangent=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),t.st&&(u.st=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),new D.Geometry({attributes:u,indices:e,primitiveType:D.PrimitiveType.TRIANGLES})}(m[g],t,u,n,c,o,i,l)});d.push(b)}y=v.GeometryPipeline.combineInstances(d)[0];y.attributes.position.values=new Float64Array(y.attributes.position.values),y.indices=k.IndexDatatype.createTypedArray(y.attributes.position.values.length/3,y.indices);r=y.attributes;return t.position||delete r.position,new D.Geometry({attributes:r,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:a})}}}},function(e,t){return l.defined(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}}); +define(["./arrayRemoveDuplicates-3fea1e5f","./BoundingRectangle-07202124","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./CoplanarPolygonGeometryLibrary-32520d7a","./when-54335d57","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryInstance-6aa9010a","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonGeometryLibrary-2a7648d9","./PolygonPipeline-97a7160d","./VertexFormat-81ec7207","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./OrientedBoundingBox-eb360dc3","./EllipsoidTangentPlane-325a8e68","./IntersectionTests-5394f658","./Plane-13ae4b1b","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./ArcType-2b58731c","./EllipsoidRhumbLine-2b7999f3"],function(b,e,L,E,t,T,C,l,D,_,v,f,k,V,x,R,s,a,n,r,o,i,p,y,c,m,u){"use strict";var I=new E.Cartesian3,P=new e.BoundingRectangle,M=new E.Cartesian2,H=new E.Cartesian2,w=new E.Cartesian3,A=new E.Cartesian3,F=new E.Cartesian3,G=new E.Cartesian3,B=new E.Cartesian3,O=new E.Cartesian3,z=new L.Quaternion,S=new L.Matrix3,N=new L.Matrix3,Q=new E.Cartesian3;function d(e){var t=(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).polygonHierarchy,a=l.defaultValue(e.vertexFormat,s.VertexFormat.DEFAULT);this._vertexFormat=s.VertexFormat.clone(a),this._polygonHierarchy=t,this._stRotation=l.defaultValue(e.stRotation,0),this._ellipsoid=E.Ellipsoid.clone(l.defaultValue(e.ellipsoid,E.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=x.PolygonGeometryLibrary.computeHierarchyPackedLength(t)+s.VertexFormat.packedLength+E.Ellipsoid.packedLength+2}d.fromPositions=function(e){return new d({polygonHierarchy:{positions:(e=l.defaultValue(e,l.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},d.pack=function(e,t,a){return a=l.defaultValue(a,0),a=x.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,a),E.Ellipsoid.pack(e._ellipsoid,t,a),a+=E.Ellipsoid.packedLength,s.VertexFormat.pack(e._vertexFormat,t,a),a+=s.VertexFormat.packedLength,t[a++]=e._stRotation,t[a]=e.packedLength,t};var g=E.Ellipsoid.clone(E.Ellipsoid.UNIT_SPHERE),h=new s.VertexFormat,j={polygonHierarchy:{}};return d.unpack=function(e,t,a){t=l.defaultValue(t,0);var n=x.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;var r=E.Ellipsoid.unpack(e,t,g);t+=E.Ellipsoid.packedLength;var o=s.VertexFormat.unpack(e,t,h);t+=s.VertexFormat.packedLength;var i=e[t++],t=e[t];return(a=!l.defined(a)?new d(j):a)._polygonHierarchy=n,a._ellipsoid=E.Ellipsoid.clone(r,a._ellipsoid),a._vertexFormat=s.VertexFormat.clone(o,a._vertexFormat),a._stRotation=i,a.packedLength=t,a},d.createGeometry=function(e){var t=e._vertexFormat,a=e._polygonHierarchy,n=e._stRotation,r=a.positions;if(!((r=b.arrayRemoveDuplicates(r,E.Cartesian3.equalsEpsilon,!0)).length<3)){var o=w,i=A,l=F,s=B,p=O;if(C.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(r,G,s,p)){o=E.Cartesian3.cross(s,p,o);o=E.Cartesian3.normalize(o,o),E.Cartesian3.equalsEpsilon(G,E.Cartesian3.ZERO,V.CesiumMath.EPSILON6)||(y=e._ellipsoid.geodeticSurfaceNormal(G,Q),E.Cartesian3.dot(o,y)<0&&(o=E.Cartesian3.negate(o,o),s=E.Cartesian3.negate(s,s)));var y=C.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(G,s,p),c=C.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(G,s,p);t.tangent&&(i=E.Cartesian3.clone(s,i)),t.bitangent&&(l=E.Cartesian3.clone(p,l));var a=x.PolygonGeometryLibrary.polygonsFromHierarchy(a,y,!1),y=a.hierarchy,m=a.polygons;if(0!==y.length){for(var r=y[0].outerRing,a=L.BoundingSphere.fromPoints(r),u=x.PolygonGeometryLibrary.computeBoundingRectangle(o,c,r,n,P),d=[],g=0;g<m.length;g++){var h=new v.GeometryInstance({geometry:function(e,t,a,n,r,o,i,l){var s=e.positions,p=R.PolygonPipeline.triangulate(e.positions2D,e.holes);p.length<3&&(p=[0,1,2]),(e=k.IndexDatatype.createTypedArray(s.length,p.length)).set(p);var y=S;0!==n?(p=L.Quaternion.fromAxisAngle(o,n,z),y=L.Matrix3.fromQuaternion(p,y),(t.tangent||t.bitangent)&&(p=L.Quaternion.fromAxisAngle(o,-n,z),u=L.Matrix3.fromQuaternion(p,N),i=E.Cartesian3.normalize(L.Matrix3.multiplyByVector(u,i,i),i),t.bitangent&&(l=E.Cartesian3.normalize(E.Cartesian3.cross(o,i,l),l)))):y=L.Matrix3.clone(L.Matrix3.IDENTITY,y);var c=H;t.st&&(c.x=a.x,c.y=a.y);for(var m=s.length,u=3*m,d=new Float64Array(u),g=t.normal?new Float32Array(u):void 0,h=t.tangent?new Float32Array(u):void 0,b=t.bitangent?new Float32Array(u):void 0,C=t.st?new Float32Array(2*m):void 0,v=0,f=0,x=0,P=0,w=0,A=0;A<m;A++){var F,G=s[A];d[v++]=G.x,d[v++]=G.y,d[v++]=G.z,t.st&&(F=r(L.Matrix3.multiplyByVector(y,G,I),M),E.Cartesian2.subtract(F,c,F),G=V.CesiumMath.clamp(F.x/a.width,0,1),F=V.CesiumMath.clamp(F.y/a.height,0,1),C[w++]=G,C[w++]=F),t.normal&&(g[f++]=o.x,g[f++]=o.y,g[f++]=o.z),t.tangent&&(h[P++]=i.x,h[P++]=i.y,h[P++]=i.z),t.bitangent&&(b[x++]=l.x,b[x++]=l.y,b[x++]=l.z)}return u=new _.GeometryAttributes,t.position&&(u.position=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})),t.normal&&(u.normal=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g})),t.tangent&&(u.tangent=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),t.bitangent&&(u.bitangent=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:b})),t.st&&(u.st=new D.GeometryAttribute({componentDatatype:T.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:C})),new D.Geometry({attributes:u,indices:e,primitiveType:D.PrimitiveType.TRIANGLES})}(m[g],t,u,n,c,o,i,l)});d.push(h)}y=f.GeometryPipeline.combineInstances(d)[0];y.attributes.position.values=new Float64Array(y.attributes.position.values),y.indices=k.IndexDatatype.createTypedArray(y.attributes.position.values.length/3,y.indices);r=y.attributes;return t.position||delete r.position,new D.Geometry({attributes:r,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:a})}}}},function(e,t){return l.defined(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js b/public/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js index eff5765..5f997c8 100644 --- a/public/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js +++ b/public/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js @@ -1 +1 @@ -define(["./arrayRemoveDuplicates-0f62a181","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./CoplanarPolygonGeometryLibrary-6c63fe5e","./when-208fe5b0","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryInstance-d919cab6","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./PolygonGeometryLibrary-d175a7f1","./Math-4e53b694","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./OrientedBoundingBox-18b4901f","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./ArcType-dc1c5aee","./EllipsoidRhumbLine-8cb2e5a4","./PolygonPipeline-bfd1975b"],function(i,y,l,e,c,p,o,s,u,d,m,f,b,t,r,n,a,g,h,P,G,v,L,C,T){"use strict";function E(e){e=(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=b.PolygonGeometryLibrary.computeHierarchyPackedLength(e)+1}E.fromPositions=function(e){return new E({polygonHierarchy:{positions:(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).positions}})},E.pack=function(e,t,r){return r=o.defaultValue(r,0),t[r=b.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,r)]=e.packedLength,t};var k={polygonHierarchy:{}};return E.unpack=function(e,t,r){t=o.defaultValue(t,0);var n=b.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;t=e[t];return(r=!o.defined(r)?new E(k):r)._polygonHierarchy=n,r.packedLength=t,r},E.createGeometry=function(e){var t=e._polygonHierarchy,e=t.positions,e=i.arrayRemoveDuplicates(e,l.Cartesian3.equalsEpsilon,!0);if(!(e.length<3)&&p.CoplanarPolygonGeometryLibrary.validOutline(e)){var r=b.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(t,!1);if(0!==r.length){for(var n=[],o=0;o<r.length;o++){var a=new d.GeometryInstance({geometry:function(e){for(var t=e.length,r=new Float64Array(3*t),n=f.IndexDatatype.createTypedArray(t,2*t),o=0,a=0,i=0;i<t;i++){var y=e[i];r[o++]=y.x,r[o++]=y.y,r[o++]=y.z,n[a++]=i,n[a++]=(i+1)%t}var l=new u.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:c.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:r})});return new s.Geometry({attributes:l,indices:n,primitiveType:s.PrimitiveType.LINES})}(r[o])});n.push(a)}e=m.GeometryPipeline.combineInstances(n)[0],t=y.BoundingSphere.fromPoints(t.positions);return new s.Geometry({attributes:e.attributes,indices:e.indices,primitiveType:e.primitiveType,boundingSphere:t})}}},function(e,t){return(e=o.defined(t)?E.unpack(e,t):e)._ellipsoid=l.Ellipsoid.clone(e._ellipsoid),E.createGeometry(e)}}); +define(["./arrayRemoveDuplicates-3fea1e5f","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./CoplanarPolygonGeometryLibrary-32520d7a","./when-54335d57","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryInstance-6aa9010a","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./PolygonGeometryLibrary-2a7648d9","./Math-d6182036","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./OrientedBoundingBox-eb360dc3","./EllipsoidTangentPlane-325a8e68","./IntersectionTests-5394f658","./Plane-13ae4b1b","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./ArcType-2b58731c","./EllipsoidRhumbLine-2b7999f3","./PolygonPipeline-97a7160d"],function(i,y,l,e,c,p,o,s,u,d,m,g,f,t,r,n,a,h,b,P,G,v,L,C,T){"use strict";function E(e){e=(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=e,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=f.PolygonGeometryLibrary.computeHierarchyPackedLength(e)+1}E.fromPositions=function(e){return new E({polygonHierarchy:{positions:(e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT)).positions}})},E.pack=function(e,t,r){return r=o.defaultValue(r,0),t[r=f.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,r)]=e.packedLength,t};var k={polygonHierarchy:{}};return E.unpack=function(e,t,r){t=o.defaultValue(t,0);var n=f.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;t=e[t];return(r=!o.defined(r)?new E(k):r)._polygonHierarchy=n,r.packedLength=t,r},E.createGeometry=function(e){var t=e._polygonHierarchy,e=t.positions,e=i.arrayRemoveDuplicates(e,l.Cartesian3.equalsEpsilon,!0);if(!(e.length<3)&&p.CoplanarPolygonGeometryLibrary.validOutline(e)){var r=f.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(t,!1);if(0!==r.length){for(var n=[],o=0;o<r.length;o++){var a=new d.GeometryInstance({geometry:function(e){for(var t=e.length,r=new Float64Array(3*t),n=g.IndexDatatype.createTypedArray(t,2*t),o=0,a=0,i=0;i<t;i++){var y=e[i];r[o++]=y.x,r[o++]=y.y,r[o++]=y.z,n[a++]=i,n[a++]=(i+1)%t}var l=new u.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:c.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:r})});return new s.Geometry({attributes:l,indices:n,primitiveType:s.PrimitiveType.LINES})}(r[o])});n.push(a)}e=m.GeometryPipeline.combineInstances(n)[0],t=y.BoundingSphere.fromPoints(t.positions);return new s.Geometry({attributes:e.attributes,indices:e.indices,primitiveType:e.primitiveType,boundingSphere:t})}}},function(e,t){return(e=o.defined(t)?E.unpack(e,t):e)._ellipsoid=l.Ellipsoid.clone(e._ellipsoid),E.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createCorridorGeometry.js b/public/Cesium/Workers/createCorridorGeometry.js index 34e12e8..d347f4c 100644 --- a/public/Cesium/Workers/createCorridorGeometry.js +++ b/public/Cesium/Workers/createCorridorGeometry.js @@ -1 +1 @@ -define(["./GeometryOffsetAttribute-def3b741","./arrayRemoveDuplicates-0f62a181","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./PolylineVolumeGeometryLibrary-a2a20b2b","./CorridorGeometryLibrary-dd337458","./when-208fe5b0","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonPipeline-bfd1975b","./VertexFormat-e8cbf5b3","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./PolylinePipeline-232a4d9a","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4"],function(E,y,m,rt,t,at,f,it,ot,nt,st,lt,dt,V,F,e,r,a,i,o,n,s,l){"use strict";var ut=new rt.Cartesian3,mt=new rt.Cartesian3,yt=new rt.Cartesian3,ft=new rt.Cartesian3,L=new rt.Cartesian3,pt=new rt.Cartesian3,ct=new rt.Cartesian3,ht=new rt.Cartesian3;function p(t,e){for(var r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function gt(t,e,r,a,i,o){var n=t.normals,s=t.tangents,l=t.bitangents,t=rt.Cartesian3.normalize(rt.Cartesian3.cross(r,e,ct),ct);o.normal&&it.CorridorGeometryLibrary.addAttribute(n,e,a,i),o.tangent&&it.CorridorGeometryLibrary.addAttribute(s,t,a,i),o.bitangent&&it.CorridorGeometryLibrary.addAttribute(l,r,a,i)}function P(t,e,r){var a,i=t.positions,o=t.corners,n=t.endPositions,s=t.lefts,l=t.normals,d=new st.GeometryAttributes,u=0,m=0,y=0;for(D=0;D<i.length;D+=2)u+=a=i[D].length-3,y+=2*a,m+=i[D+1].length-3;for(u+=3,m+=3,D=0;D<o.length;D++){var f=o[D],p=o[D].leftPositions;ot.defined(p)?u+=a=p.length:m+=a=o[D].rightPositions.length,y+=a}var c,h=ot.defined(n);h&&(u+=c=n[0].length-3,m+=c,y+=6*(c/=3));var g,b,C,v,t=u+m,A=new Float64Array(t),_={normals:e.normal?new Float32Array(t):void 0,tangents:e.tangent?new Float32Array(t):void 0,bitangents:e.bitangent?new Float32Array(t):void 0},w=0,T=t-1,G=ut,E=mt,V=c/2,F=lt.IndexDatatype.createTypedArray(t/3,y),L=0;if(h)for(var P=yt,x=ft,N=n[0],G=rt.Cartesian3.fromArray(l,0,G),E=rt.Cartesian3.fromArray(s,0,E),D=0;D<V;D++)P=rt.Cartesian3.fromArray(N,3*(V-1-D),P),x=rt.Cartesian3.fromArray(N,3*(V+D),x),it.CorridorGeometryLibrary.addAttribute(A,x,w),it.CorridorGeometryLibrary.addAttribute(A,P,void 0,T),gt(_,G,E,w,T,e),v=(b=w/3)+1,C=(g=(T-2)/3)-1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;var M,O,I=0,S=0,R=i[I++],k=i[I++];for(A.set(R,w),A.set(k,T-k.length+1),E=rt.Cartesian3.fromArray(s,S,E),a=k.length-3,D=0;D<a;D+=3)M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,D,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a-D,ht),ht),gt(_,G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),E,w,T,e),v=(b=w/3)+1,C=(g=(T-2)/3)-1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;for(M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,a,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a,ht),ht),G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),S+=3,D=0;D<o.length;D++){var H,z,U,B=(f=o[D]).leftPositions,Y=f.rightPositions,W=pt,q=yt,J=ft;if(G=rt.Cartesian3.fromArray(l,S,G),ot.defined(B)){for(gt(_,G,E,void 0,T,e),T-=3,z=v,U=C,H=0;H<B.length/3;H++)W=rt.Cartesian3.fromArray(B,3*H,W),F[L++]=z,F[L++]=U-H-1,F[L++]=U-H,it.CorridorGeometryLibrary.addAttribute(A,W,void 0,T),q=rt.Cartesian3.fromArray(A,3*(U-H-1),q),J=rt.Cartesian3.fromArray(A,3*z,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.subtract(q,J,E),E),void 0,T,e),T-=3;W=rt.Cartesian3.fromArray(A,3*z,W),q=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*U,q),W,q),J=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*(U-H),J),W,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.add(q,J,E),E),w,void 0,e),w+=3}else{for(gt(_,G,E,w,void 0,e),w+=3,z=C,U=v,H=0;H<Y.length/3;H++)W=rt.Cartesian3.fromArray(Y,3*H,W),F[L++]=z,F[L++]=U+H,F[L++]=U+H+1,it.CorridorGeometryLibrary.addAttribute(A,W,w),q=rt.Cartesian3.fromArray(A,3*z,q),J=rt.Cartesian3.fromArray(A,3*(U+H),J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.subtract(q,J,E),E),w,void 0,e),w+=3;W=rt.Cartesian3.fromArray(A,3*z,W),q=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*(U+H),q),W,q),J=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*U,J),W,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.negate(rt.Cartesian3.add(J,q,E),E),E),void 0,T,e),T-=3}for(R=i[I++],k=i[I++],R.splice(0,3),k.splice(k.length-3,3),A.set(R,w),A.set(k,T-k.length+1),a=k.length-3,S+=3,E=rt.Cartesian3.fromArray(s,S,E),H=0;H<k.length;H+=3)M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,H,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a-H,ht),ht),gt(_,G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),E,w,T,e),b=(v=w/3)-1,g=(C=(T-2)/3)+1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3;w-=3,T+=3}if(gt(_,G=rt.Cartesian3.fromArray(l,l.length-3,G),E,w,T,e),h){w+=3,T-=3,P=yt,x=ft;var j=n[1];for(D=0;D<V;D++)P=rt.Cartesian3.fromArray(j,3*(c-D-1),P),x=rt.Cartesian3.fromArray(j,3*D,x),it.CorridorGeometryLibrary.addAttribute(A,P,void 0,T),it.CorridorGeometryLibrary.addAttribute(A,x,w),gt(_,G,E,w,T,e),b=(v=w/3)-1,g=(C=(T-2)/3)+1,F[L++]=g,F[L++]=b,F[L++]=C,F[L++]=C,F[L++]=b,F[L++]=v,w+=3,T-=3}if(d.position=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:A}),e.st){var K=new Float32Array(t/3*2),Q=0;if(h){u/=3,m/=3;var X,Z=Math.PI/(c+1),$=1/(u-c+1),tt=1/(m-c+1),et=c/2;for(D=1+et;D<c+1;D++)X=dt.CesiumMath.PI_OVER_TWO+Z*D,K[Q++]=tt*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=1;D<m-c+1;D++)K[Q++]=D*tt,K[Q++]=0;for(D=c;et<D;D--)X=dt.CesiumMath.PI_OVER_TWO-D*Z,K[Q++]=1-tt*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=et;0<D;D--)X=dt.CesiumMath.PI_OVER_TWO-Z*D,K[Q++]=1-$*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=u-c;0<D;D--)K[Q++]=D*$,K[Q++]=1;for(D=1;D<1+et;D++)X=dt.CesiumMath.PI_OVER_TWO+Z*D,K[Q++]=$*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X))}else{for($=1/((u/=3)-1),tt=1/((m/=3)-1),D=0;D<m;D++)K[Q++]=D*tt,K[Q++]=0;for(D=u;0<D;D--)K[Q++]=(D-1)*$,K[Q++]=1}d.st=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:K})}return e.normal&&(d.normal=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.normals})),e.tangent&&(d.tangent=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.tangents})),e.bitangent&&(d.bitangent=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.bitangents})),{attributes:d,indices:F}}function x(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(var a=3;a<t.length;a+=3){var i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function c(t,e){var r=new F.VertexFormat({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),a=t.ellipsoid,i=P(it.CorridorGeometryLibrary.computePositions(t),r,a),o=t.height,n=t.extrudedHeight,s=i.attributes,l=i.indices,d=s.position.values,u=d.length,m=new Float64Array(6*u),r=new Float64Array(u);r.set(d);i=new Float64Array(4*u),i=x(d=V.PolygonPipeline.scaleToGeodeticHeight(d,o,a),0,i);i=x(r=V.PolygonPipeline.scaleToGeodeticHeight(r,n,a),2*u,i),m.set(d),m.set(r,u),m.set(i,2*u),s.position.values=m;var s=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;var r,a=t.position.values;(e.normal||e.bitangent)&&(r=t.normal.values,l=t.bitangent.values);var i=t.position.values.length/18,o=3*i,n=2*i,s=2*o;if(e.normal||e.bitangent||e.tangent){for(var l,d=e.normal?new Float32Array(6*o):void 0,u=e.tangent?new Float32Array(6*o):void 0,m=e.bitangent?new Float32Array(6*o):void 0,y=ut,f=mt,p=yt,c=ft,h=L,g=pt,b=s,C=0;C<o;C+=3){var v=b+s,y=rt.Cartesian3.fromArray(a,C,y),f=rt.Cartesian3.fromArray(a,C+o,f),p=rt.Cartesian3.fromArray(a,(C+3)%o,p);f=rt.Cartesian3.subtract(f,y,f),p=rt.Cartesian3.subtract(p,y,p),c=rt.Cartesian3.normalize(rt.Cartesian3.cross(f,p,c),c),e.normal&&(it.CorridorGeometryLibrary.addAttribute(d,c,v),it.CorridorGeometryLibrary.addAttribute(d,c,v+3),it.CorridorGeometryLibrary.addAttribute(d,c,b),it.CorridorGeometryLibrary.addAttribute(d,c,b+3)),(e.tangent||e.bitangent)&&(g=rt.Cartesian3.fromArray(r,C,g),e.bitangent&&(it.CorridorGeometryLibrary.addAttribute(m,g,v),it.CorridorGeometryLibrary.addAttribute(m,g,v+3),it.CorridorGeometryLibrary.addAttribute(m,g,b),it.CorridorGeometryLibrary.addAttribute(m,g,b+3)),e.tangent&&(h=rt.Cartesian3.normalize(rt.Cartesian3.cross(g,c,h),h),it.CorridorGeometryLibrary.addAttribute(u,h,v),it.CorridorGeometryLibrary.addAttribute(u,h,v+3),it.CorridorGeometryLibrary.addAttribute(u,h,b),it.CorridorGeometryLibrary.addAttribute(u,h,b+3))),b+=6}if(e.normal){for(d.set(r),C=0;C<o;C+=3)d[C+o]=-r[C],d[C+o+1]=-r[C+1],d[C+o+2]=-r[C+2];t.normal.values=d}else t.normal=void 0;e.bitangent?(m.set(l),m.set(l,o),t.bitangent.values=m):t.bitangent=void 0,e.tangent&&(l=t.tangent.values,u.set(l),u.set(l,o),t.tangent.values=u)}if(e.st){var A=t.st.values,_=new Float32Array(6*n);_.set(A),_.set(A,n);for(var w=2*n,T=0;T<2;T++){for(_[w++]=A[0],_[w++]=A[1],C=2;C<n;C+=2){var G=A[C],E=A[C+1];_[w++]=G,_[w++]=E,_[w++]=G,_[w++]=E}_[w++]=A[0],_[w++]=A[1]}t.st.values=_}return t}(s,e),y=u/3;if(t.shadowVolume){for(var f=s.normal.values,u=f.length,i=new Float32Array(6*u),p=0;p<u;p++)f[p]=-f[p];i.set(f,u),i=x(f,4*u,i),s.extrudeDirection=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:i}),e.normal||(s.normal=void 0)}ot.defined(t.offsetAttribute)&&(e=new Uint8Array(6*y),e=t.offsetAttribute===E.GeometryOffsetAttribute.TOP?(e=E.arrayFill(e,1,0,y),E.arrayFill(e,1,2*y,4*y)):(t=t.offsetAttribute===E.GeometryOffsetAttribute.NONE?0:1,E.arrayFill(e,t)),s.applyOffset=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e}));var c=l.length,h=y+y,g=lt.IndexDatatype.createTypedArray(m.length/3,2*c+3*h);g.set(l);var b,C,v,A,_=c;for(p=0;p<c;p+=3){var w=l[p],T=l[p+1],G=l[p+2];g[_++]=G+y,g[_++]=T+y,g[_++]=w+y}for(p=0;p<h;p+=2)v=(b=p+h)+1,A=(C=b+h)+1,g[_++]=b,g[_++]=C,g[_++]=v,g[_++]=v,g[_++]=C,g[_++]=A;return{attributes:s,indices:g}}var h=new rt.Cartesian3,g=new rt.Cartesian3,b=new rt.Cartographic;function C(t,e,r,a,i,o){var n=rt.Cartesian3.subtract(e,t,h);rt.Cartesian3.normalize(n,n);var s=r.geodeticSurfaceNormal(t,g),l=rt.Cartesian3.cross(n,s,h);rt.Cartesian3.multiplyByScalar(l,a,l);var d=i.latitude,u=i.longitude,e=o.latitude,n=o.longitude;rt.Cartesian3.add(t,l,g),r.cartesianToCartographic(g,b);s=b.latitude,a=b.longitude,d=Math.min(d,s),u=Math.min(u,a),e=Math.max(e,s),n=Math.max(n,a);rt.Cartesian3.subtract(t,l,g),r.cartesianToCartographic(g,b),s=b.latitude,a=b.longitude,d=Math.min(d,s),u=Math.min(u,a),e=Math.max(e,s),n=Math.max(n,a),i.latitude=d,i.longitude=u,o.latitude=e,o.longitude=n}var v=new rt.Cartesian3,A=new rt.Cartesian3,_=new rt.Cartographic,w=new rt.Cartographic;function d(t,e,r,a,i){t=p(t,e);var o=y.arrayRemoveDuplicates(t,rt.Cartesian3.equalsEpsilon),n=o.length;if(n<2||r<=0)return new rt.Rectangle;var s,l,d=.5*r;_.latitude=Number.POSITIVE_INFINITY,_.longitude=Number.POSITIVE_INFINITY,w.latitude=Number.NEGATIVE_INFINITY,w.longitude=Number.NEGATIVE_INFINITY,a===f.CornerType.ROUNDED&&(m=o[0],rt.Cartesian3.subtract(m,o[1],v),rt.Cartesian3.normalize(v,v),rt.Cartesian3.multiplyByScalar(v,d,v),rt.Cartesian3.add(m,v,A),e.cartesianToCartographic(A,b),s=b.latitude,l=b.longitude,_.latitude=Math.min(_.latitude,s),_.longitude=Math.min(_.longitude,l),w.latitude=Math.max(w.latitude,s),w.longitude=Math.max(w.longitude,l));for(var u=0;u<n-1;++u)C(o[u],o[u+1],e,d,_,w);var m=o[n-1];rt.Cartesian3.subtract(m,o[n-2],v),rt.Cartesian3.normalize(v,v),rt.Cartesian3.multiplyByScalar(v,d,v),rt.Cartesian3.add(m,v,A),C(m,A,e,d,_,w),a===f.CornerType.ROUNDED&&(e.cartesianToCartographic(A,b),s=b.latitude,l=b.longitude,_.latitude=Math.min(_.latitude,s),_.longitude=Math.min(_.longitude,l),w.latitude=Math.max(w.latitude,s),w.longitude=Math.max(w.longitude,l));i=ot.defined(i)?i:new rt.Rectangle;return i.north=w.latitude,i.south=_.latitude,i.east=w.longitude,i.west=_.longitude,i}function T(t){var e=(t=ot.defaultValue(t,ot.defaultValue.EMPTY_OBJECT)).positions,r=t.width,a=ot.defaultValue(t.height,0),i=ot.defaultValue(t.extrudedHeight,a);this._positions=e,this._ellipsoid=rt.Ellipsoid.clone(ot.defaultValue(t.ellipsoid,rt.Ellipsoid.WGS84)),this._vertexFormat=F.VertexFormat.clone(ot.defaultValue(t.vertexFormat,F.VertexFormat.DEFAULT)),this._width=r,this._height=Math.max(a,i),this._extrudedHeight=Math.min(a,i),this._cornerType=ot.defaultValue(t.cornerType,f.CornerType.ROUNDED),this._granularity=ot.defaultValue(t.granularity,dt.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=ot.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*rt.Cartesian3.packedLength+rt.Ellipsoid.packedLength+F.VertexFormat.packedLength+7}T.pack=function(t,e,r){r=ot.defaultValue(r,0);var a=t._positions,i=a.length;e[r++]=i;for(var o=0;o<i;++o,r+=rt.Cartesian3.packedLength)rt.Cartesian3.pack(a[o],e,r);return rt.Ellipsoid.pack(t._ellipsoid,e,r),r+=rt.Ellipsoid.packedLength,F.VertexFormat.pack(t._vertexFormat,e,r),r+=F.VertexFormat.packedLength,e[r++]=t._width,e[r++]=t._height,e[r++]=t._extrudedHeight,e[r++]=t._cornerType,e[r++]=t._granularity,e[r++]=t._shadowVolume?1:0,e[r]=ot.defaultValue(t._offsetAttribute,-1),e};var G=rt.Ellipsoid.clone(rt.Ellipsoid.UNIT_SPHERE),N=new F.VertexFormat,D={positions:void 0,ellipsoid:G,vertexFormat:N,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return T.unpack=function(t,e,r){e=ot.defaultValue(e,0);for(var a=t[e++],i=new Array(a),o=0;o<a;++o,e+=rt.Cartesian3.packedLength)i[o]=rt.Cartesian3.unpack(t,e);var n=rt.Ellipsoid.unpack(t,e,G);e+=rt.Ellipsoid.packedLength;var s=F.VertexFormat.unpack(t,e,N);e+=F.VertexFormat.packedLength;var l=t[e++],d=t[e++],u=t[e++],m=t[e++],y=t[e++],f=1===t[e++],p=t[e];return ot.defined(r)?(r._positions=i,r._ellipsoid=rt.Ellipsoid.clone(n,r._ellipsoid),r._vertexFormat=F.VertexFormat.clone(s,r._vertexFormat),r._width=l,r._height=d,r._extrudedHeight=u,r._cornerType=m,r._granularity=y,r._shadowVolume=f,r._offsetAttribute=-1===p?void 0:p,r):(D.positions=i,D.width=l,D.height=d,D.extrudedHeight=u,D.cornerType=m,D.granularity=y,D.shadowVolume=f,D.offsetAttribute=-1===p?void 0:p,new T(D))},T.computeRectangle=function(t,e){var r=(t=ot.defaultValue(t,ot.defaultValue.EMPTY_OBJECT)).positions,a=t.width;return d(r,ot.defaultValue(t.ellipsoid,rt.Ellipsoid.WGS84),a,ot.defaultValue(t.cornerType,f.CornerType.ROUNDED),e)},T.createGeometry=function(t){var e=t._positions,r=t._width,a=t._ellipsoid,e=p(e,a),i=y.arrayRemoveDuplicates(e,rt.Cartesian3.equalsEpsilon);if(!(i.length<2||r<=0)){var o,n=t._height,s=t._extrudedHeight,l=!dt.CesiumMath.equalsEpsilon(n,s,0,dt.CesiumMath.EPSILON2),e=t._vertexFormat,r={ellipsoid:a,positions:i,width:r,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};l?(r.height=n,r.extrudedHeight=s,r.shadowVolume=t._shadowVolume,r.offsetAttribute=t._offsetAttribute,o=c(r,e)):((o=P(it.CorridorGeometryLibrary.computePositions(r),e,a)).attributes.position.values=V.PolygonPipeline.scaleToGeodeticHeight(o.attributes.position.values,n,a),ot.defined(t._offsetAttribute)&&(d=t._offsetAttribute===E.GeometryOffsetAttribute.NONE?0:1,u=o.attributes.position.values.length,u=new Uint8Array(u/3),E.arrayFill(u,d),o.attributes.applyOffset=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})));var d=o.attributes,u=m.BoundingSphere.fromVertices(d.position.values,void 0,3);return e.position||(o.attributes.position.values=void 0),new nt.Geometry({attributes:d,indices:o.indices,primitiveType:nt.PrimitiveType.TRIANGLES,boundingSphere:u,offsetAttribute:t._offsetAttribute})}},T.createShadowVolume=function(t,e,r){var a=t._granularity,i=t._ellipsoid,e=e(a,i),r=r(a,i);return new T({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:e,height:r,vertexFormat:F.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(T.prototype,{rectangle:{get:function(){return ot.defined(this._rectangle)||(this._rectangle=d(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return(t=ot.defined(e)?T.unpack(t,e):t)._ellipsoid=rt.Ellipsoid.clone(t._ellipsoid),T.createGeometry(t)}}); +define(["./GeometryOffsetAttribute-718fa138","./arrayRemoveDuplicates-3fea1e5f","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./PolylineVolumeGeometryLibrary-4d0ebb44","./CorridorGeometryLibrary-1ea8b9ee","./when-54335d57","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonPipeline-97a7160d","./VertexFormat-81ec7207","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-325a8e68","./IntersectionTests-5394f658","./Plane-13ae4b1b","./PolylinePipeline-3803a6c2","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3"],function(E,y,m,rt,t,at,f,it,ot,nt,st,lt,dt,V,F,e,r,a,i,o,n,s,l){"use strict";var ut=new rt.Cartesian3,mt=new rt.Cartesian3,yt=new rt.Cartesian3,ft=new rt.Cartesian3,L=new rt.Cartesian3,pt=new rt.Cartesian3,ct=new rt.Cartesian3,ht=new rt.Cartesian3;function p(t,e){for(var r=0;r<t.length;r++)t[r]=e.scaleToGeodeticSurface(t[r],t[r]);return t}function gt(t,e,r,a,i,o){var n=t.normals,s=t.tangents,l=t.bitangents,t=rt.Cartesian3.normalize(rt.Cartesian3.cross(r,e,ct),ct);o.normal&&it.CorridorGeometryLibrary.addAttribute(n,e,a,i),o.tangent&&it.CorridorGeometryLibrary.addAttribute(s,t,a,i),o.bitangent&&it.CorridorGeometryLibrary.addAttribute(l,r,a,i)}function P(t,e,r){var a,i=t.positions,o=t.corners,n=t.endPositions,s=t.lefts,l=t.normals,d=new st.GeometryAttributes,u=0,m=0,y=0;for(D=0;D<i.length;D+=2)u+=a=i[D].length-3,y+=2*a,m+=i[D+1].length-3;for(u+=3,m+=3,D=0;D<o.length;D++){var f=o[D],p=o[D].leftPositions;ot.defined(p)?u+=a=p.length:m+=a=o[D].rightPositions.length,y+=a}var c,h=ot.defined(n);h&&(u+=c=n[0].length-3,m+=c,y+=6*(c/=3));var g,C,b,v,t=u+m,A=new Float64Array(t),_={normals:e.normal?new Float32Array(t):void 0,tangents:e.tangent?new Float32Array(t):void 0,bitangents:e.bitangent?new Float32Array(t):void 0},w=0,T=t-1,G=ut,E=mt,V=c/2,F=lt.IndexDatatype.createTypedArray(t/3,y),L=0;if(h)for(var P=yt,x=ft,N=n[0],G=rt.Cartesian3.fromArray(l,0,G),E=rt.Cartesian3.fromArray(s,0,E),D=0;D<V;D++)P=rt.Cartesian3.fromArray(N,3*(V-1-D),P),x=rt.Cartesian3.fromArray(N,3*(V+D),x),it.CorridorGeometryLibrary.addAttribute(A,x,w),it.CorridorGeometryLibrary.addAttribute(A,P,void 0,T),gt(_,G,E,w,T,e),v=(C=w/3)+1,b=(g=(T-2)/3)-1,F[L++]=g,F[L++]=C,F[L++]=b,F[L++]=b,F[L++]=C,F[L++]=v,w+=3,T-=3;var M,O,I=0,S=0,R=i[I++],k=i[I++];for(A.set(R,w),A.set(k,T-k.length+1),E=rt.Cartesian3.fromArray(s,S,E),a=k.length-3,D=0;D<a;D+=3)M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,D,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a-D,ht),ht),gt(_,G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),E,w,T,e),v=(C=w/3)+1,b=(g=(T-2)/3)-1,F[L++]=g,F[L++]=C,F[L++]=b,F[L++]=b,F[L++]=C,F[L++]=v,w+=3,T-=3;for(M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,a,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a,ht),ht),G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),S+=3,D=0;D<o.length;D++){var H,z,U,B=(f=o[D]).leftPositions,Y=f.rightPositions,W=pt,q=yt,J=ft;if(G=rt.Cartesian3.fromArray(l,S,G),ot.defined(B)){for(gt(_,G,E,void 0,T,e),T-=3,z=v,U=b,H=0;H<B.length/3;H++)W=rt.Cartesian3.fromArray(B,3*H,W),F[L++]=z,F[L++]=U-H-1,F[L++]=U-H,it.CorridorGeometryLibrary.addAttribute(A,W,void 0,T),q=rt.Cartesian3.fromArray(A,3*(U-H-1),q),J=rt.Cartesian3.fromArray(A,3*z,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.subtract(q,J,E),E),void 0,T,e),T-=3;W=rt.Cartesian3.fromArray(A,3*z,W),q=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*U,q),W,q),J=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*(U-H),J),W,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.add(q,J,E),E),w,void 0,e),w+=3}else{for(gt(_,G,E,w,void 0,e),w+=3,z=b,U=v,H=0;H<Y.length/3;H++)W=rt.Cartesian3.fromArray(Y,3*H,W),F[L++]=z,F[L++]=U+H,F[L++]=U+H+1,it.CorridorGeometryLibrary.addAttribute(A,W,w),q=rt.Cartesian3.fromArray(A,3*z,q),J=rt.Cartesian3.fromArray(A,3*(U+H),J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.subtract(q,J,E),E),w,void 0,e),w+=3;W=rt.Cartesian3.fromArray(A,3*z,W),q=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*(U+H),q),W,q),J=rt.Cartesian3.subtract(rt.Cartesian3.fromArray(A,3*U,J),W,J),gt(_,G,E=rt.Cartesian3.normalize(rt.Cartesian3.negate(rt.Cartesian3.add(J,q,E),E),E),void 0,T,e),T-=3}for(R=i[I++],k=i[I++],R.splice(0,3),k.splice(k.length-3,3),A.set(R,w),A.set(k,T-k.length+1),a=k.length-3,S+=3,E=rt.Cartesian3.fromArray(s,S,E),H=0;H<k.length;H+=3)M=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(R,H,ct),ct),O=r.geodeticSurfaceNormal(rt.Cartesian3.fromArray(k,a-H,ht),ht),gt(_,G=rt.Cartesian3.normalize(rt.Cartesian3.add(M,O,G),G),E,w,T,e),C=(v=w/3)-1,F[L++]=g=(b=(T-2)/3)+1,F[L++]=C,F[L++]=b,F[L++]=b,F[L++]=C,F[L++]=v,w+=3,T-=3;w-=3,T+=3}if(gt(_,G=rt.Cartesian3.fromArray(l,l.length-3,G),E,w,T,e),h){w+=3,T-=3,P=yt,x=ft;var j=n[1];for(D=0;D<V;D++)P=rt.Cartesian3.fromArray(j,3*(c-D-1),P),x=rt.Cartesian3.fromArray(j,3*D,x),it.CorridorGeometryLibrary.addAttribute(A,P,void 0,T),it.CorridorGeometryLibrary.addAttribute(A,x,w),gt(_,G,E,w,T,e),C=(v=w/3)-1,F[L++]=g=(b=(T-2)/3)+1,F[L++]=C,F[L++]=b,F[L++]=b,F[L++]=C,F[L++]=v,w+=3,T-=3}if(d.position=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:A}),e.st){var K=new Float32Array(t/3*2),Q=0;if(h){u/=3,m/=3;var X,Z=Math.PI/(c+1),$=1/(u-c+1),tt=1/(m-c+1),et=c/2;for(D=1+et;D<c+1;D++)X=dt.CesiumMath.PI_OVER_TWO+Z*D,K[Q++]=tt*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=1;D<m-c+1;D++)K[Q++]=D*tt,K[Q++]=0;for(D=c;et<D;D--)X=dt.CesiumMath.PI_OVER_TWO-D*Z,K[Q++]=1-tt*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=et;0<D;D--)X=dt.CesiumMath.PI_OVER_TWO-Z*D,K[Q++]=1-$*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X));for(D=u-c;0<D;D--)K[Q++]=D*$,K[Q++]=1;for(D=1;D<1+et;D++)X=dt.CesiumMath.PI_OVER_TWO+Z*D,K[Q++]=$*(1+Math.cos(X)),K[Q++]=.5*(1+Math.sin(X))}else{for($=1/((u/=3)-1),tt=1/((m/=3)-1),D=0;D<m;D++)K[Q++]=D*tt,K[Q++]=0;for(D=u;0<D;D--)K[Q++]=(D-1)*$,K[Q++]=1}d.st=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:K})}return e.normal&&(d.normal=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.normals})),e.tangent&&(d.tangent=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.tangents})),e.bitangent&&(d.bitangent=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_.bitangents})),{attributes:d,indices:F}}function x(t,e,r){r[e++]=t[0],r[e++]=t[1],r[e++]=t[2];for(var a=3;a<t.length;a+=3){var i=t[a],o=t[a+1],n=t[a+2];r[e++]=i,r[e++]=o,r[e++]=n,r[e++]=i,r[e++]=o,r[e++]=n}return r[e++]=t[0],r[e++]=t[1],r[e++]=t[2],r}function c(t,e){var r=new F.VertexFormat({position:e.position,normal:e.normal||e.bitangent||t.shadowVolume,tangent:e.tangent,bitangent:e.normal||e.bitangent,st:e.st}),a=t.ellipsoid,i=P(it.CorridorGeometryLibrary.computePositions(t),r,a),o=t.height,n=t.extrudedHeight,s=i.attributes,l=i.indices,d=s.position.values,u=d.length,m=new Float64Array(6*u),r=new Float64Array(u);r.set(d);i=new Float64Array(4*u),i=x(d=V.PolygonPipeline.scaleToGeodeticHeight(d,o,a),0,i);i=x(r=V.PolygonPipeline.scaleToGeodeticHeight(r,n,a),2*u,i),m.set(d),m.set(r,u),m.set(i,2*u),s.position.values=m;var s=function(t,e){if(!(e.normal||e.tangent||e.bitangent||e.st))return t;var r,a=t.position.values;(e.normal||e.bitangent)&&(r=t.normal.values,l=t.bitangent.values);var i=t.position.values.length/18,o=3*i,n=2*i,s=2*o;if(e.normal||e.bitangent||e.tangent){for(var l,d=e.normal?new Float32Array(6*o):void 0,u=e.tangent?new Float32Array(6*o):void 0,m=e.bitangent?new Float32Array(6*o):void 0,y=ut,f=mt,p=yt,c=ft,h=L,g=pt,C=s,b=0;b<o;b+=3){var v=C+s,y=rt.Cartesian3.fromArray(a,b,y),f=rt.Cartesian3.fromArray(a,b+o,f),p=rt.Cartesian3.fromArray(a,(b+3)%o,p);f=rt.Cartesian3.subtract(f,y,f),p=rt.Cartesian3.subtract(p,y,p),c=rt.Cartesian3.normalize(rt.Cartesian3.cross(f,p,c),c),e.normal&&(it.CorridorGeometryLibrary.addAttribute(d,c,v),it.CorridorGeometryLibrary.addAttribute(d,c,v+3),it.CorridorGeometryLibrary.addAttribute(d,c,C),it.CorridorGeometryLibrary.addAttribute(d,c,C+3)),(e.tangent||e.bitangent)&&(g=rt.Cartesian3.fromArray(r,b,g),e.bitangent&&(it.CorridorGeometryLibrary.addAttribute(m,g,v),it.CorridorGeometryLibrary.addAttribute(m,g,v+3),it.CorridorGeometryLibrary.addAttribute(m,g,C),it.CorridorGeometryLibrary.addAttribute(m,g,C+3)),e.tangent&&(h=rt.Cartesian3.normalize(rt.Cartesian3.cross(g,c,h),h),it.CorridorGeometryLibrary.addAttribute(u,h,v),it.CorridorGeometryLibrary.addAttribute(u,h,v+3),it.CorridorGeometryLibrary.addAttribute(u,h,C),it.CorridorGeometryLibrary.addAttribute(u,h,C+3))),C+=6}if(e.normal){for(d.set(r),b=0;b<o;b+=3)d[b+o]=-r[b],d[b+o+1]=-r[b+1],d[b+o+2]=-r[b+2];t.normal.values=d}else t.normal=void 0;e.bitangent?(m.set(l),m.set(l,o),t.bitangent.values=m):t.bitangent=void 0,e.tangent&&(l=t.tangent.values,u.set(l),u.set(l,o),t.tangent.values=u)}if(e.st){var A=t.st.values,_=new Float32Array(6*n);_.set(A),_.set(A,n);for(var w=2*n,T=0;T<2;T++){for(_[w++]=A[0],_[w++]=A[1],b=2;b<n;b+=2){var G=A[b],E=A[b+1];_[w++]=G,_[w++]=E,_[w++]=G,_[w++]=E}_[w++]=A[0],_[w++]=A[1]}t.st.values=_}return t}(s,e),y=u/3;if(t.shadowVolume){for(var f=s.normal.values,u=f.length,i=new Float32Array(6*u),p=0;p<u;p++)f[p]=-f[p];i.set(f,u),i=x(f,4*u,i),s.extrudeDirection=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:i}),e.normal||(s.normal=void 0)}ot.defined(t.offsetAttribute)&&(e=new Uint8Array(6*y),e=t.offsetAttribute===E.GeometryOffsetAttribute.TOP?(e=E.arrayFill(e,1,0,y),E.arrayFill(e,1,2*y,4*y)):(t=t.offsetAttribute===E.GeometryOffsetAttribute.NONE?0:1,E.arrayFill(e,t)),s.applyOffset=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:e}));var c=l.length,h=y+y,g=lt.IndexDatatype.createTypedArray(m.length/3,2*c+3*h);g.set(l);var C,b,v,A,_=c;for(p=0;p<c;p+=3){var w=l[p],T=l[p+1],G=l[p+2];g[_++]=G+y,g[_++]=T+y,g[_++]=w+y}for(p=0;p<h;p+=2)v=(C=p+h)+1,A=(b=C+h)+1,g[_++]=C,g[_++]=b,g[_++]=v,g[_++]=v,g[_++]=b,g[_++]=A;return{attributes:s,indices:g}}var h=new rt.Cartesian3,g=new rt.Cartesian3,C=new rt.Cartographic;function b(t,e,r,a,i,o){var n=rt.Cartesian3.subtract(e,t,h);rt.Cartesian3.normalize(n,n);var s=r.geodeticSurfaceNormal(t,g),l=rt.Cartesian3.cross(n,s,h);rt.Cartesian3.multiplyByScalar(l,a,l);var d=i.latitude,u=i.longitude,e=o.latitude,n=o.longitude;rt.Cartesian3.add(t,l,g),r.cartesianToCartographic(g,C);s=C.latitude,a=C.longitude,d=Math.min(d,s),u=Math.min(u,a),e=Math.max(e,s),n=Math.max(n,a);rt.Cartesian3.subtract(t,l,g),r.cartesianToCartographic(g,C),s=C.latitude,a=C.longitude,d=Math.min(d,s),u=Math.min(u,a),e=Math.max(e,s),n=Math.max(n,a),i.latitude=d,i.longitude=u,o.latitude=e,o.longitude=n}var v=new rt.Cartesian3,A=new rt.Cartesian3,_=new rt.Cartographic,w=new rt.Cartographic;function d(t,e,r,a,i){t=p(t,e);var o=y.arrayRemoveDuplicates(t,rt.Cartesian3.equalsEpsilon),n=o.length;if(n<2||r<=0)return new rt.Rectangle;var s,l,d=.5*r;_.latitude=Number.POSITIVE_INFINITY,_.longitude=Number.POSITIVE_INFINITY,w.latitude=Number.NEGATIVE_INFINITY,w.longitude=Number.NEGATIVE_INFINITY,a===f.CornerType.ROUNDED&&(m=o[0],rt.Cartesian3.subtract(m,o[1],v),rt.Cartesian3.normalize(v,v),rt.Cartesian3.multiplyByScalar(v,d,v),rt.Cartesian3.add(m,v,A),e.cartesianToCartographic(A,C),s=C.latitude,l=C.longitude,_.latitude=Math.min(_.latitude,s),_.longitude=Math.min(_.longitude,l),w.latitude=Math.max(w.latitude,s),w.longitude=Math.max(w.longitude,l));for(var u=0;u<n-1;++u)b(o[u],o[u+1],e,d,_,w);var m=o[n-1];rt.Cartesian3.subtract(m,o[n-2],v),rt.Cartesian3.normalize(v,v),rt.Cartesian3.multiplyByScalar(v,d,v),rt.Cartesian3.add(m,v,A),b(m,A,e,d,_,w),a===f.CornerType.ROUNDED&&(e.cartesianToCartographic(A,C),s=C.latitude,l=C.longitude,_.latitude=Math.min(_.latitude,s),_.longitude=Math.min(_.longitude,l),w.latitude=Math.max(w.latitude,s),w.longitude=Math.max(w.longitude,l));i=ot.defined(i)?i:new rt.Rectangle;return i.north=w.latitude,i.south=_.latitude,i.east=w.longitude,i.west=_.longitude,i}function T(t){var e=(t=ot.defaultValue(t,ot.defaultValue.EMPTY_OBJECT)).positions,r=t.width,a=ot.defaultValue(t.height,0),i=ot.defaultValue(t.extrudedHeight,a);this._positions=e,this._ellipsoid=rt.Ellipsoid.clone(ot.defaultValue(t.ellipsoid,rt.Ellipsoid.WGS84)),this._vertexFormat=F.VertexFormat.clone(ot.defaultValue(t.vertexFormat,F.VertexFormat.DEFAULT)),this._width=r,this._height=Math.max(a,i),this._extrudedHeight=Math.min(a,i),this._cornerType=ot.defaultValue(t.cornerType,f.CornerType.ROUNDED),this._granularity=ot.defaultValue(t.granularity,dt.CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=ot.defaultValue(t.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this.packedLength=1+e.length*rt.Cartesian3.packedLength+rt.Ellipsoid.packedLength+F.VertexFormat.packedLength+7}T.pack=function(t,e,r){r=ot.defaultValue(r,0);var a=t._positions,i=a.length;e[r++]=i;for(var o=0;o<i;++o,r+=rt.Cartesian3.packedLength)rt.Cartesian3.pack(a[o],e,r);return rt.Ellipsoid.pack(t._ellipsoid,e,r),r+=rt.Ellipsoid.packedLength,F.VertexFormat.pack(t._vertexFormat,e,r),r+=F.VertexFormat.packedLength,e[r++]=t._width,e[r++]=t._height,e[r++]=t._extrudedHeight,e[r++]=t._cornerType,e[r++]=t._granularity,e[r++]=t._shadowVolume?1:0,e[r]=ot.defaultValue(t._offsetAttribute,-1),e};var G=rt.Ellipsoid.clone(rt.Ellipsoid.UNIT_SPHERE),N=new F.VertexFormat,D={positions:void 0,ellipsoid:G,vertexFormat:N,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};return T.unpack=function(t,e,r){e=ot.defaultValue(e,0);for(var a=t[e++],i=new Array(a),o=0;o<a;++o,e+=rt.Cartesian3.packedLength)i[o]=rt.Cartesian3.unpack(t,e);var n=rt.Ellipsoid.unpack(t,e,G);e+=rt.Ellipsoid.packedLength;var s=F.VertexFormat.unpack(t,e,N);e+=F.VertexFormat.packedLength;var l=t[e++],d=t[e++],u=t[e++],m=t[e++],y=t[e++],f=1===t[e++],p=t[e];return ot.defined(r)?(r._positions=i,r._ellipsoid=rt.Ellipsoid.clone(n,r._ellipsoid),r._vertexFormat=F.VertexFormat.clone(s,r._vertexFormat),r._width=l,r._height=d,r._extrudedHeight=u,r._cornerType=m,r._granularity=y,r._shadowVolume=f,r._offsetAttribute=-1===p?void 0:p,r):(D.positions=i,D.width=l,D.height=d,D.extrudedHeight=u,D.cornerType=m,D.granularity=y,D.shadowVolume=f,D.offsetAttribute=-1===p?void 0:p,new T(D))},T.computeRectangle=function(t,e){var r=(t=ot.defaultValue(t,ot.defaultValue.EMPTY_OBJECT)).positions,a=t.width;return d(r,ot.defaultValue(t.ellipsoid,rt.Ellipsoid.WGS84),a,ot.defaultValue(t.cornerType,f.CornerType.ROUNDED),e)},T.createGeometry=function(t){var e=t._positions,r=t._width,a=t._ellipsoid,e=p(e,a),i=y.arrayRemoveDuplicates(e,rt.Cartesian3.equalsEpsilon);if(!(i.length<2||r<=0)){var o,n=t._height,s=t._extrudedHeight,l=!dt.CesiumMath.equalsEpsilon(n,s,0,dt.CesiumMath.EPSILON2),e=t._vertexFormat,r={ellipsoid:a,positions:i,width:r,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};l?(r.height=n,r.extrudedHeight=s,r.shadowVolume=t._shadowVolume,r.offsetAttribute=t._offsetAttribute,o=c(r,e)):((o=P(it.CorridorGeometryLibrary.computePositions(r),e,a)).attributes.position.values=V.PolygonPipeline.scaleToGeodeticHeight(o.attributes.position.values,n,a),ot.defined(t._offsetAttribute)&&(d=t._offsetAttribute===E.GeometryOffsetAttribute.NONE?0:1,u=o.attributes.position.values.length,u=new Uint8Array(u/3),E.arrayFill(u,d),o.attributes.applyOffset=new nt.GeometryAttribute({componentDatatype:at.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})));var d=o.attributes,u=m.BoundingSphere.fromVertices(d.position.values,void 0,3);return e.position||(o.attributes.position.values=void 0),new nt.Geometry({attributes:d,indices:o.indices,primitiveType:nt.PrimitiveType.TRIANGLES,boundingSphere:u,offsetAttribute:t._offsetAttribute})}},T.createShadowVolume=function(t,e,r){var a=t._granularity,i=t._ellipsoid,e=e(a,i),r=r(a,i);return new T({positions:t._positions,width:t._width,cornerType:t._cornerType,ellipsoid:i,granularity:a,extrudedHeight:e,height:r,vertexFormat:F.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(T.prototype,{rectangle:{get:function(){return ot.defined(this._rectangle)||(this._rectangle=d(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}}),function(t,e){return(t=ot.defined(e)?T.unpack(t,e):t)._ellipsoid=rt.Ellipsoid.clone(t._ellipsoid),T.createGeometry(t)}}); diff --git a/public/Cesium/Workers/createCorridorOutlineGeometry.js b/public/Cesium/Workers/createCorridorOutlineGeometry.js index 1c7d8c9..5435f25 100644 --- a/public/Cesium/Workers/createCorridorOutlineGeometry.js +++ b/public/Cesium/Workers/createCorridorOutlineGeometry.js @@ -1 +1 @@ -define(["./GeometryOffsetAttribute-def3b741","./arrayRemoveDuplicates-0f62a181","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./PolylineVolumeGeometryLibrary-a2a20b2b","./CorridorGeometryLibrary-dd337458","./when-208fe5b0","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonPipeline-bfd1975b","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./PolylinePipeline-232a4d9a","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4"],function(v,u,p,M,e,R,B,U,F,Y,q,W,f,A,t,i,r,o,a,n,s,l){"use strict";var J=new M.Cartesian3,j=new M.Cartesian3,z=new M.Cartesian3;function _(e,t){var i,r=[],o=e.positions,a=e.corners,n=e.endPositions,s=new q.GeometryAttributes,l=0,d=0,u=0;for(L=0;L<o.length;L+=2)l+=i=o[L].length-3,u+=i/3*4,d+=o[L+1].length-3;for(l+=3,d+=3,L=0;L<a.length;L++){var p=a[L],f=a[L].leftPositions;F.defined(f)?l+=i=f.length:d+=i=a[L].rightPositions.length,u+=i/3*2}var h,y=F.defined(n);y&&(l+=h=n[0].length-3,d+=h,u+=4*(h/=3));var c,b,g,m,e=l+d,v=new Float64Array(e),A=0,_=e-1,E=h/2,C=W.IndexDatatype.createTypedArray(e/3,u+4),G=0;if(C[G++]=A/3,C[G++]=(_-2)/3,y){r.push(A/3);for(var T=J,P=j,w=n[0],L=0;L<E;L++)T=M.Cartesian3.fromArray(w,3*(E-1-L),T),P=M.Cartesian3.fromArray(w,3*(E+L),P),U.CorridorGeometryLibrary.addAttribute(v,P,A),U.CorridorGeometryLibrary.addAttribute(v,T,void 0,_),m=(b=A/3)+1,g=(c=(_-2)/3)-1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3}var D=0,k=o[D++],N=o[D++];for(v.set(k,A),v.set(N,_-N.length+1),i=N.length-3,r.push(A/3,(_-2)/3),L=0;L<i;L+=3)m=(b=A/3)+1,g=(c=(_-2)/3)-1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;for(L=0;L<a.length;L++){var O,V,x=(p=a[L]).leftPositions,H=p.rightPositions,I=z;if(F.defined(x)){for(_-=3,V=g,r.push(m),O=0;O<x.length/3;O++)I=M.Cartesian3.fromArray(x,3*O,I),C[G++]=V-O-1,C[G++]=V-O,U.CorridorGeometryLibrary.addAttribute(v,I,void 0,_),_-=3;r.push(V-Math.floor(x.length/6)),t===B.CornerType.BEVELED&&r.push((_-2)/3+1),A+=3}else{for(A+=3,V=m,r.push(g),O=0;O<H.length/3;O++)I=M.Cartesian3.fromArray(H,3*O,I),C[G++]=V+O,C[G++]=V+O+1,U.CorridorGeometryLibrary.addAttribute(v,I,A),A+=3;r.push(V+Math.floor(H.length/6)),t===B.CornerType.BEVELED&&r.push(A/3-1),_-=3}for(k=o[D++],N=o[D++],k.splice(0,3),N.splice(N.length-3,3),v.set(k,A),v.set(N,_-N.length+1),i=N.length-3,O=0;O<N.length;O+=3)b=(m=A/3)-1,c=(g=(_-2)/3)+1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;A-=3,_+=3,r.push(A/3,(_-2)/3)}if(y){A+=3,_-=3,T=J,P=j;var S=n[1];for(L=0;L<E;L++)T=M.Cartesian3.fromArray(S,3*(h-L-1),T),P=M.Cartesian3.fromArray(S,3*L,P),U.CorridorGeometryLibrary.addAttribute(v,T,void 0,_),U.CorridorGeometryLibrary.addAttribute(v,P,A),b=(m=A/3)-1,c=(g=(_-2)/3)+1,C[G++]=c,C[G++]=g,C[G++]=b,C[G++]=m,A+=3,_-=3;r.push(A/3)}else r.push(A/3,(_-2)/3);return C[G++]=A/3,C[G++]=(_-2)/3,s.position=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v}),{attributes:s,indices:C,wallIndices:r}}function h(e){var t=(e=F.defaultValue(e,F.defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=F.defaultValue(e.height,0),o=F.defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=M.Ellipsoid.clone(F.defaultValue(e.ellipsoid,M.Ellipsoid.WGS84)),this._width=i,this._height=Math.max(r,o),this._extrudedHeight=Math.min(r,o),this._cornerType=F.defaultValue(e.cornerType,B.CornerType.ROUNDED),this._granularity=F.defaultValue(e.granularity,f.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*M.Cartesian3.packedLength+M.Ellipsoid.packedLength+6}h.pack=function(e,t,i){i=F.defaultValue(i,0);var r=e._positions,o=r.length;t[i++]=o;for(var a=0;a<o;++a,i+=M.Cartesian3.packedLength)M.Cartesian3.pack(r[a],t,i);return M.Ellipsoid.pack(e._ellipsoid,t,i),i+=M.Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=F.defaultValue(e._offsetAttribute,-1),t};var y=M.Ellipsoid.clone(M.Ellipsoid.UNIT_SPHERE),c={positions:void 0,ellipsoid:y,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return h.unpack=function(e,t,i){t=F.defaultValue(t,0);for(var r=e[t++],o=new Array(r),a=0;a<r;++a,t+=M.Cartesian3.packedLength)o[a]=M.Cartesian3.unpack(e,t);var n=M.Ellipsoid.unpack(e,t,y);t+=M.Ellipsoid.packedLength;var s=e[t++],l=e[t++],d=e[t++],u=e[t++],p=e[t++],f=e[t];return F.defined(i)?(i._positions=o,i._ellipsoid=M.Ellipsoid.clone(n,i._ellipsoid),i._width=s,i._height=l,i._extrudedHeight=d,i._cornerType=u,i._granularity=p,i._offsetAttribute=-1===f?void 0:f,i):(c.positions=o,c.width=s,c.height=l,c.extrudedHeight=d,c.cornerType=u,c.granularity=p,c.offsetAttribute=-1===f?void 0:f,new h(c))},h.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,t=function(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(t,r),o=u.arrayRemoveDuplicates(t,M.Cartesian3.equalsEpsilon);if(!(o.length<2||i<=0)){var a,n=e._height,s=e._extrudedHeight,t=!f.CesiumMath.equalsEpsilon(n,s,0,f.CesiumMath.EPSILON2),i={ellipsoid:r,positions:o,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};t?(i.height=n,i.extrudedHeight=s,i.offsetAttribute=e._offsetAttribute,a=function(e){var t=e.ellipsoid,i=(l=_(U.CorridorGeometryLibrary.computePositions(e),e.cornerType)).wallIndices,r=e.height,o=e.extrudedHeight,a=l.attributes,n=l.indices,s=(d=a.position.values).length;(u=new Float64Array(s)).set(d);var l=new Float64Array(2*s),d=A.PolygonPipeline.scaleToGeodeticHeight(d,r,t),u=A.PolygonPipeline.scaleToGeodeticHeight(u,o,t);l.set(d),l.set(u,s),a.position.values=l,s/=3,F.defined(e.offsetAttribute)&&(u=new Uint8Array(2*s),u=e.offsetAttribute===v.GeometryOffsetAttribute.TOP?v.arrayFill(u,1,0,s):(e=e.offsetAttribute===v.GeometryOffsetAttribute.NONE?0:1,v.arrayFill(u,e)),a.applyOffset=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u}));var p=n.length,f=W.IndexDatatype.createTypedArray(l.length/3,2*(p+i.length));f.set(n);for(var h,y,c=p,b=0;b<p;b+=2){var g=n[b],m=n[b+1];f[c++]=g+s,f[c++]=m+s}for(b=0;b<i.length;b++)y=(h=i[b])+s,f[c++]=h,f[c++]=y;return{attributes:a,indices:f}}(i)):((a=_(U.CorridorGeometryLibrary.computePositions(i),i.cornerType)).attributes.position.values=A.PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,n,r),F.defined(e._offsetAttribute)&&(l=a.attributes.position.values.length,d=new Uint8Array(l/3),l=e._offsetAttribute===v.GeometryOffsetAttribute.NONE?0:1,v.arrayFill(d,l),a.attributes.applyOffset=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})));var l=a.attributes,d=p.BoundingSphere.fromVertices(l.position.values,void 0,3);return new Y.Geometry({attributes:l,indices:a.indices,primitiveType:Y.PrimitiveType.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=F.defined(t)?h.unpack(e,t):e)._ellipsoid=M.Ellipsoid.clone(e._ellipsoid),h.createGeometry(e)}}); +define(["./GeometryOffsetAttribute-718fa138","./arrayRemoveDuplicates-3fea1e5f","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./PolylineVolumeGeometryLibrary-4d0ebb44","./CorridorGeometryLibrary-1ea8b9ee","./when-54335d57","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonPipeline-97a7160d","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-325a8e68","./IntersectionTests-5394f658","./Plane-13ae4b1b","./PolylinePipeline-3803a6c2","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3"],function(v,u,p,M,e,R,B,U,F,Y,q,W,h,A,t,i,r,o,a,n,s,l){"use strict";var J=new M.Cartesian3,j=new M.Cartesian3,z=new M.Cartesian3;function _(e,t){var i,r=[],o=e.positions,a=e.corners,n=e.endPositions,s=new q.GeometryAttributes,l=0,d=0,u=0;for(L=0;L<o.length;L+=2)l+=i=o[L].length-3,u+=i/3*4,d+=o[L+1].length-3;for(l+=3,d+=3,L=0;L<a.length;L++){var p=a[L],h=a[L].leftPositions;F.defined(h)?l+=i=h.length:d+=i=a[L].rightPositions.length,u+=i/3*2}var f,y=F.defined(n);y&&(l+=f=n[0].length-3,d+=f,u+=4*(f/=3));var c,g,b,m,e=l+d,v=new Float64Array(e),A=0,_=e-1,E=f/2,C=W.IndexDatatype.createTypedArray(e/3,u+4),G=0;if(C[G++]=A/3,C[G++]=(_-2)/3,y){r.push(A/3);for(var T=J,P=j,w=n[0],L=0;L<E;L++)T=M.Cartesian3.fromArray(w,3*(E-1-L),T),P=M.Cartesian3.fromArray(w,3*(E+L),P),U.CorridorGeometryLibrary.addAttribute(v,P,A),U.CorridorGeometryLibrary.addAttribute(v,T,void 0,_),m=(g=A/3)+1,b=(c=(_-2)/3)-1,C[G++]=c,C[G++]=b,C[G++]=g,C[G++]=m,A+=3,_-=3}var D=0,k=o[D++],N=o[D++];for(v.set(k,A),v.set(N,_-N.length+1),i=N.length-3,r.push(A/3,(_-2)/3),L=0;L<i;L+=3)m=(g=A/3)+1,b=(c=(_-2)/3)-1,C[G++]=c,C[G++]=b,C[G++]=g,C[G++]=m,A+=3,_-=3;for(L=0;L<a.length;L++){var O,V,x=(p=a[L]).leftPositions,H=p.rightPositions,I=z;if(F.defined(x)){for(_-=3,V=b,r.push(m),O=0;O<x.length/3;O++)I=M.Cartesian3.fromArray(x,3*O,I),C[G++]=V-O-1,C[G++]=V-O,U.CorridorGeometryLibrary.addAttribute(v,I,void 0,_),_-=3;r.push(V-Math.floor(x.length/6)),t===B.CornerType.BEVELED&&r.push((_-2)/3+1),A+=3}else{for(A+=3,V=m,r.push(b),O=0;O<H.length/3;O++)I=M.Cartesian3.fromArray(H,3*O,I),C[G++]=V+O,C[G++]=V+O+1,U.CorridorGeometryLibrary.addAttribute(v,I,A),A+=3;r.push(V+Math.floor(H.length/6)),t===B.CornerType.BEVELED&&r.push(A/3-1),_-=3}for(k=o[D++],N=o[D++],k.splice(0,3),N.splice(N.length-3,3),v.set(k,A),v.set(N,_-N.length+1),i=N.length-3,O=0;O<N.length;O+=3)g=(m=A/3)-1,C[G++]=c=(b=(_-2)/3)+1,C[G++]=b,C[G++]=g,C[G++]=m,A+=3,_-=3;A-=3,_+=3,r.push(A/3,(_-2)/3)}if(y){A+=3,_-=3,T=J,P=j;var S=n[1];for(L=0;L<E;L++)T=M.Cartesian3.fromArray(S,3*(f-L-1),T),P=M.Cartesian3.fromArray(S,3*L,P),U.CorridorGeometryLibrary.addAttribute(v,T,void 0,_),U.CorridorGeometryLibrary.addAttribute(v,P,A),g=(m=A/3)-1,C[G++]=c=(b=(_-2)/3)+1,C[G++]=b,C[G++]=g,C[G++]=m,A+=3,_-=3;r.push(A/3)}else r.push(A/3,(_-2)/3);return C[G++]=A/3,C[G++]=(_-2)/3,s.position=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v}),{attributes:s,indices:C,wallIndices:r}}function f(e){var t=(e=F.defaultValue(e,F.defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=F.defaultValue(e.height,0),o=F.defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=M.Ellipsoid.clone(F.defaultValue(e.ellipsoid,M.Ellipsoid.WGS84)),this._width=i,this._height=Math.max(r,o),this._extrudedHeight=Math.min(r,o),this._cornerType=F.defaultValue(e.cornerType,B.CornerType.ROUNDED),this._granularity=F.defaultValue(e.granularity,h.CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*M.Cartesian3.packedLength+M.Ellipsoid.packedLength+6}f.pack=function(e,t,i){i=F.defaultValue(i,0);var r=e._positions,o=r.length;t[i++]=o;for(var a=0;a<o;++a,i+=M.Cartesian3.packedLength)M.Cartesian3.pack(r[a],t,i);return M.Ellipsoid.pack(e._ellipsoid,t,i),i+=M.Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=F.defaultValue(e._offsetAttribute,-1),t};var y=M.Ellipsoid.clone(M.Ellipsoid.UNIT_SPHERE),c={positions:void 0,ellipsoid:y,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};return f.unpack=function(e,t,i){t=F.defaultValue(t,0);for(var r=e[t++],o=new Array(r),a=0;a<r;++a,t+=M.Cartesian3.packedLength)o[a]=M.Cartesian3.unpack(e,t);var n=M.Ellipsoid.unpack(e,t,y);t+=M.Ellipsoid.packedLength;var s=e[t++],l=e[t++],d=e[t++],u=e[t++],p=e[t++],h=e[t];return F.defined(i)?(i._positions=o,i._ellipsoid=M.Ellipsoid.clone(n,i._ellipsoid),i._width=s,i._height=l,i._extrudedHeight=d,i._cornerType=u,i._granularity=p,i._offsetAttribute=-1===h?void 0:h,i):(c.positions=o,c.width=s,c.height=l,c.extrudedHeight=d,c.cornerType=u,c.granularity=p,c.offsetAttribute=-1===h?void 0:h,new f(c))},f.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,t=function(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}(t,r),o=u.arrayRemoveDuplicates(t,M.Cartesian3.equalsEpsilon);if(!(o.length<2||i<=0)){var a,n=e._height,s=e._extrudedHeight,t=!h.CesiumMath.equalsEpsilon(n,s,0,h.CesiumMath.EPSILON2),i={ellipsoid:r,positions:o,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};t?(i.height=n,i.extrudedHeight=s,i.offsetAttribute=e._offsetAttribute,a=function(e){var t=e.ellipsoid,i=(l=_(U.CorridorGeometryLibrary.computePositions(e),e.cornerType)).wallIndices,r=e.height,o=e.extrudedHeight,a=l.attributes,n=l.indices,s=(d=a.position.values).length;(u=new Float64Array(s)).set(d);var l=new Float64Array(2*s),d=A.PolygonPipeline.scaleToGeodeticHeight(d,r,t),u=A.PolygonPipeline.scaleToGeodeticHeight(u,o,t);l.set(d),l.set(u,s),a.position.values=l,s/=3,F.defined(e.offsetAttribute)&&(u=new Uint8Array(2*s),u=e.offsetAttribute===v.GeometryOffsetAttribute.TOP?v.arrayFill(u,1,0,s):(e=e.offsetAttribute===v.GeometryOffsetAttribute.NONE?0:1,v.arrayFill(u,e)),a.applyOffset=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:u}));var p=n.length,h=W.IndexDatatype.createTypedArray(l.length/3,2*(p+i.length));h.set(n);for(var f,y,c=p,g=0;g<p;g+=2){var b=n[g],m=n[g+1];h[c++]=b+s,h[c++]=m+s}for(g=0;g<i.length;g++)y=(f=i[g])+s,h[c++]=f,h[c++]=y;return{attributes:a,indices:h}}(i)):((a=_(U.CorridorGeometryLibrary.computePositions(i),i.cornerType)).attributes.position.values=A.PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,n,r),F.defined(e._offsetAttribute)&&(l=a.attributes.position.values.length,d=new Uint8Array(l/3),l=e._offsetAttribute===v.GeometryOffsetAttribute.NONE?0:1,v.arrayFill(d,l),a.attributes.applyOffset=new Y.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})));var l=a.attributes,d=p.BoundingSphere.fromVertices(l.position.values,void 0,3);return new Y.Geometry({attributes:l,indices:a.indices,primitiveType:Y.PrimitiveType.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=F.defined(t)?f.unpack(e,t):e)._ellipsoid=M.Ellipsoid.clone(e._ellipsoid),f.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createCylinderGeometry.js b/public/Cesium/Workers/createCylinderGeometry.js index 3699ed7..b0cb395 100644 --- a/public/Cesium/Workers/createCylinderGeometry.js +++ b/public/Cesium/Workers/createCylinderGeometry.js @@ -1 +1 @@ -define(["./CylinderGeometry-7778847f","./when-208fe5b0","./GeometryOffsetAttribute-def3b741","./Check-d18af7c4","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Math-4e53b694","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./CylinderGeometryLibrary-daf6cec5","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./VertexFormat-e8cbf5b3"],function(r,n,e,t,a,f,b,d,o,i,y,c,m,u,s){"use strict";return function(e,t){return n.defined(t)&&(e=r.CylinderGeometry.unpack(e,t)),r.CylinderGeometry.createGeometry(e)}}); +define(["./CylinderGeometry-a5313e27","./when-54335d57","./GeometryOffsetAttribute-718fa138","./Check-24483042","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Math-d6182036","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./CylinderGeometryLibrary-85e5e690","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./VertexFormat-81ec7207"],function(r,a,e,t,n,o,i,y,c,d,m,u,f,s,G){"use strict";return function(e,t){return a.defined(t)&&(e=r.CylinderGeometry.unpack(e,t)),r.CylinderGeometry.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createCylinderOutlineGeometry.js b/public/Cesium/Workers/createCylinderOutlineGeometry.js index 786981d..053a8db 100644 --- a/public/Cesium/Workers/createCylinderOutlineGeometry.js +++ b/public/Cesium/Workers/createCylinderOutlineGeometry.js @@ -1 +1 @@ -define(["./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./CylinderGeometryLibrary-daf6cec5","./when-208fe5b0","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1"],function(c,p,y,t,_,h,A,v,R,G,e,i,r){"use strict";var O=new y.Cartesian2;function s(t){var e=(t=A.defaultValue(t,A.defaultValue.EMPTY_OBJECT)).length,i=t.topRadius,r=t.bottomRadius,a=A.defaultValue(t.slices,128),n=Math.max(A.defaultValue(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=i,this._bottomRadius=r,this._slices=a,this._numberOfVerticalLines=n,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}s.packedLength=6,s.pack=function(t,e,i){return i=A.defaultValue(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=A.defaultValue(t._offsetAttribute,-1),e};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return s.unpack=function(t,e,i){e=A.defaultValue(e,0);var r=t[e++],a=t[e++],n=t[e++],o=t[e++],u=t[e++],e=t[e];return A.defined(i)?(i._length=r,i._topRadius=a,i._bottomRadius=n,i._slices=o,i._numberOfVerticalLines=u,i._offsetAttribute=-1===e?void 0:e,i):(f.length=r,f.topRadius=a,f.bottomRadius=n,f.slices=o,f.numberOfVerticalLines=u,f.offsetAttribute=-1===e?void 0:e,new s(f))},s.createGeometry=function(t){var e=t._length,i=t._topRadius,r=t._bottomRadius,a=t._slices,n=t._numberOfVerticalLines;if(!(e<=0||i<0||r<0||0===i&&0===r)){var o,u,s=2*a,f=h.CylinderGeometryLibrary.computePositions(e,i,r,a,!1),d=2*a;0<n&&(o=Math.min(n,a),u=Math.round(a/o),d+=o);for(var b=G.IndexDatatype.createTypedArray(s,2*d),l=0,m=0;m<a-1;m++)b[l++]=m,b[l++]=m+1,b[l++]=m+a,b[l++]=m+1+a;if(b[l++]=a-1,b[l++]=0,b[l++]=a+a-1,b[l++]=a,0<n)for(m=0;m<a;m+=u)b[l++]=m,b[l++]=m+a;n=new R.GeometryAttributes;n.position=new v.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),O.x=.5*e,O.y=Math.max(r,i);i=new p.BoundingSphere(y.Cartesian3.ZERO,y.Cartesian2.magnitude(O));return A.defined(t._offsetAttribute)&&(e=f.length,f=new Uint8Array(e/3),e=t._offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(f,e),n.applyOffset=new v.GeometryAttribute({componentDatatype:_.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})),new v.Geometry({attributes:n,indices:b,primitiveType:v.PrimitiveType.LINES,boundingSphere:i,offsetAttribute:t._offsetAttribute})}},function(t,e){return A.defined(e)&&(t=s.unpack(t,e)),s.createGeometry(t)}}); +define(["./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./CylinderGeometryLibrary-85e5e690","./when-54335d57","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9"],function(b,p,y,t,_,h,A,v,R,G,e,i,a){"use strict";var O=new y.Cartesian2;function s(t){var e=(t=A.defaultValue(t,A.defaultValue.EMPTY_OBJECT)).length,i=t.topRadius,a=t.bottomRadius,r=A.defaultValue(t.slices,128),n=Math.max(A.defaultValue(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=i,this._bottomRadius=a,this._slices=r,this._numberOfVerticalLines=n,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}s.packedLength=6,s.pack=function(t,e,i){return i=A.defaultValue(i,0),e[i++]=t._length,e[i++]=t._topRadius,e[i++]=t._bottomRadius,e[i++]=t._slices,e[i++]=t._numberOfVerticalLines,e[i]=A.defaultValue(t._offsetAttribute,-1),e};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return s.unpack=function(t,e,i){e=A.defaultValue(e,0);var a=t[e++],r=t[e++],n=t[e++],o=t[e++],u=t[e++],e=t[e];return A.defined(i)?(i._length=a,i._topRadius=r,i._bottomRadius=n,i._slices=o,i._numberOfVerticalLines=u,i._offsetAttribute=-1===e?void 0:e,i):(f.length=a,f.topRadius=r,f.bottomRadius=n,f.slices=o,f.numberOfVerticalLines=u,f.offsetAttribute=-1===e?void 0:e,new s(f))},s.createGeometry=function(t){var e=t._length,i=t._topRadius,a=t._bottomRadius,r=t._slices,n=t._numberOfVerticalLines;if(!(e<=0||i<0||a<0||0===i&&0===a)){var o,u,s=2*r,f=h.CylinderGeometryLibrary.computePositions(e,i,a,r,!1),d=2*r;0<n&&(o=Math.min(n,r),u=Math.round(r/o),d+=o);for(var l=G.IndexDatatype.createTypedArray(s,2*d),m=0,c=0;c<r-1;c++)l[m++]=c,l[m++]=c+1,l[m++]=c+r,l[m++]=c+1+r;if(l[m++]=r-1,l[m++]=0,l[m++]=r+r-1,l[m++]=r,0<n)for(c=0;c<r;c+=u)l[m++]=c,l[m++]=c+r;n=new R.GeometryAttributes;n.position=new v.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),O.x=.5*e,O.y=Math.max(a,i);i=new p.BoundingSphere(y.Cartesian3.ZERO,y.Cartesian2.magnitude(O));return A.defined(t._offsetAttribute)&&(e=f.length,f=new Uint8Array(e/3),e=t._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(f,e),n.applyOffset=new v.GeometryAttribute({componentDatatype:_.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})),new v.Geometry({attributes:n,indices:l,primitiveType:v.PrimitiveType.LINES,boundingSphere:i,offsetAttribute:t._offsetAttribute})}},function(t,e){return A.defined(e)&&(t=s.unpack(t,e)),s.createGeometry(t)}}); diff --git a/public/Cesium/Workers/createEllipseGeometry.js b/public/Cesium/Workers/createEllipseGeometry.js index d3d32eb..b65c606 100644 --- a/public/Cesium/Workers/createEllipseGeometry.js +++ b/public/Cesium/Workers/createEllipseGeometry.js @@ -1 +1 @@ -define(["./Cartesian2-8417ca3d","./when-208fe5b0","./EllipseGeometry-42ee4ae7","./Check-d18af7c4","./Math-4e53b694","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./EllipseGeometryLibrary-2412418f","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryInstance-d919cab6","./GeometryPipeline-5e672526","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./IndexDatatype-d47ad6f6","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./VertexFormat-e8cbf5b3"],function(r,n,a,e,t,i,o,s,d,f,b,c,l,m,p,y,u,G,C,E,A){"use strict";return function(e,t){return(e=n.defined(t)?a.EllipseGeometry.unpack(e,t):e)._center=r.Cartesian3.clone(e._center),e._ellipsoid=r.Ellipsoid.clone(e._ellipsoid),a.EllipseGeometry.createGeometry(e)}}); +define(["./Cartesian2-8646c5a1","./when-54335d57","./EllipseGeometry-8e3bce61","./Check-24483042","./Math-d6182036","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./EllipseGeometryLibrary-e452d6b7","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryInstance-6aa9010a","./GeometryPipeline-571ff4c9","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./IndexDatatype-82ceea78","./IntersectionTests-5394f658","./Plane-13ae4b1b","./VertexFormat-81ec7207"],function(r,a,n,e,t,i,o,c,s,l,d,m,b,f,p,y,u,G,C,E,A){"use strict";return function(e,t){return(e=a.defined(t)?n.EllipseGeometry.unpack(e,t):e)._center=r.Cartesian3.clone(e._center),e._ellipsoid=r.Ellipsoid.clone(e._ellipsoid),n.EllipseGeometry.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createEllipseOutlineGeometry.js b/public/Cesium/Workers/createEllipseOutlineGeometry.js index ed13f22..f15df86 100644 --- a/public/Cesium/Workers/createEllipseOutlineGeometry.js +++ b/public/Cesium/Workers/createEllipseOutlineGeometry.js @@ -1 +1 @@ -define(["./Cartesian2-8417ca3d","./when-208fe5b0","./EllipseOutlineGeometry-ab13c628","./Check-d18af7c4","./Math-4e53b694","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./EllipseGeometryLibrary-2412418f","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6"],function(r,n,i,e,t,a,o,l,s,b,f,d,c,u){"use strict";return function(e,t){return(e=n.defined(t)?i.EllipseOutlineGeometry.unpack(e,t):e)._center=r.Cartesian3.clone(e._center),e._ellipsoid=r.Ellipsoid.clone(e._ellipsoid),i.EllipseOutlineGeometry.createGeometry(e)}}); +define(["./Cartesian2-8646c5a1","./when-54335d57","./EllipseOutlineGeometry-61cb55e1","./Check-24483042","./Math-d6182036","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./EllipseGeometryLibrary-e452d6b7","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78"],function(r,n,i,e,t,a,o,l,c,s,d,u,m,p){"use strict";return function(e,t){return(e=n.defined(t)?i.EllipseOutlineGeometry.unpack(e,t):e)._center=r.Cartesian3.clone(e._center),e._ellipsoid=r.Ellipsoid.clone(e._ellipsoid),i.EllipseOutlineGeometry.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createEllipsoidGeometry.js b/public/Cesium/Workers/createEllipsoidGeometry.js index e523861..d5a45cf 100644 --- a/public/Cesium/Workers/createEllipsoidGeometry.js +++ b/public/Cesium/Workers/createEllipsoidGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./EllipsoidGeometry-cb484b79","./GeometryOffsetAttribute-def3b741","./Check-d18af7c4","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Math-4e53b694","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./VertexFormat-e8cbf5b3"],function(r,b,e,t,n,o,a,f,i,d,s,c,m,u){"use strict";return function(e,t){return r.defined(t)&&(e=b.EllipsoidGeometry.unpack(e,t)),b.EllipsoidGeometry.createGeometry(e)}}); +define(["./when-54335d57","./EllipsoidGeometry-8e9adb8a","./GeometryOffsetAttribute-718fa138","./Check-24483042","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Math-d6182036","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./VertexFormat-81ec7207"],function(r,a,e,t,n,o,i,c,d,s,m,u,f,y){"use strict";return function(e,t){return r.defined(t)&&(e=a.EllipsoidGeometry.unpack(e,t)),a.EllipsoidGeometry.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createEllipsoidOutlineGeometry.js b/public/Cesium/Workers/createEllipsoidOutlineGeometry.js index 486021e..808bdb6 100644 --- a/public/Cesium/Workers/createEllipsoidOutlineGeometry.js +++ b/public/Cesium/Workers/createEllipsoidOutlineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./EllipsoidOutlineGeometry-dd7f7ad1","./GeometryOffsetAttribute-def3b741","./Check-d18af7c4","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Math-4e53b694","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6"],function(r,n,e,t,i,d,f,a,o,b,u,s,m){"use strict";return function(e,t){return r.defined(e.buffer)&&(e=n.EllipsoidOutlineGeometry.unpack(e,t)),n.EllipsoidOutlineGeometry.createGeometry(e)}}); +define(["./when-54335d57","./EllipsoidOutlineGeometry-b505f2ae","./GeometryOffsetAttribute-718fa138","./Check-24483042","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Math-d6182036","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78"],function(r,a,e,t,n,i,o,u,c,d,f,s,m){"use strict";return function(e,t){return r.defined(e.buffer)&&(e=a.EllipsoidOutlineGeometry.unpack(e,t)),a.EllipsoidOutlineGeometry.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createFrustumGeometry.js b/public/Cesium/Workers/createFrustumGeometry.js index d28beb6..b173110 100644 --- a/public/Cesium/Workers/createFrustumGeometry.js +++ b/public/Cesium/Workers/createFrustumGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./FrustumGeometry-00e2e34e","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./Math-4e53b694","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./Plane-4aa8974d","./VertexFormat-e8cbf5b3"],function(r,n,e,t,a,u,b,o,m,f,s,c,d){"use strict";return function(e,t){return r.defined(t)&&(e=n.FrustumGeometry.unpack(e,t)),n.FrustumGeometry.createGeometry(e)}}); +define(["./when-54335d57","./FrustumGeometry-c7d19501","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./Math-d6182036","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./Plane-13ae4b1b","./VertexFormat-81ec7207"],function(r,a,e,t,n,u,o,c,m,s,d,i,b){"use strict";return function(e,t){return r.defined(t)&&(e=a.FrustumGeometry.unpack(e,t)),a.FrustumGeometry.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createFrustumOutlineGeometry.js b/public/Cesium/Workers/createFrustumOutlineGeometry.js index ed28b14..37dad94 100644 --- a/public/Cesium/Workers/createFrustumOutlineGeometry.js +++ b/public/Cesium/Workers/createFrustumOutlineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./FrustumGeometry-00e2e34e","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./Math-4e53b694","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./Plane-4aa8974d","./VertexFormat-e8cbf5b3"],function(o,m,s,e,h,f,d,g,t,r,n,a,u){"use strict";var c=0,i=1;function p(e){var t,r,n=e.frustum,a=e.orientation,u=e.origin,e=o.defaultValue(e._drawNearPlane,!0);n instanceof f.PerspectiveFrustum?(t=c,r=f.PerspectiveFrustum.packedLength):n instanceof f.OrthographicFrustum&&(t=i,r=f.OrthographicFrustum.packedLength),this._frustumType=t,this._frustum=n.clone(),this._origin=s.Cartesian3.clone(u),this._orientation=m.Quaternion.clone(a),this._drawNearPlane=e,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+r+s.Cartesian3.packedLength+m.Quaternion.packedLength}p.pack=function(e,t,r){r=o.defaultValue(r,0);var n=e._frustumType,a=e._frustum;return(t[r++]=n)===c?(f.PerspectiveFrustum.pack(a,t,r),r+=f.PerspectiveFrustum.packedLength):(f.OrthographicFrustum.pack(a,t,r),r+=f.OrthographicFrustum.packedLength),s.Cartesian3.pack(e._origin,t,r),r+=s.Cartesian3.packedLength,m.Quaternion.pack(e._orientation,t,r),t[r+=m.Quaternion.packedLength]=e._drawNearPlane?1:0,t};var _=new f.PerspectiveFrustum,k=new f.OrthographicFrustum,l=new m.Quaternion,y=new s.Cartesian3;return p.unpack=function(e,t,r){t=o.defaultValue(t,0);var n,a=e[t++];a===c?(n=f.PerspectiveFrustum.unpack(e,t,_),t+=f.PerspectiveFrustum.packedLength):(n=f.OrthographicFrustum.unpack(e,t,k),t+=f.OrthographicFrustum.packedLength);var u=s.Cartesian3.unpack(e,t,y);t+=s.Cartesian3.packedLength;var i=m.Quaternion.unpack(e,t,l),e=1===e[t+=m.Quaternion.packedLength];if(!o.defined(r))return new p({frustum:n,origin:u,orientation:i,_drawNearPlane:e});t=a===r._frustumType?r._frustum:void 0;return r._frustum=n.clone(t),r._frustumType=a,r._origin=s.Cartesian3.clone(u,r._origin),r._orientation=m.Quaternion.clone(i,r._orientation),r._drawNearPlane=e,r},p.createGeometry=function(e){var t=e._frustumType,r=e._frustum,n=e._origin,a=e._orientation,u=e._drawNearPlane,e=new Float64Array(24);f.FrustumGeometry._computeNearFarPlanes(n,a,t,r,e);for(var i,o,r=new g.GeometryAttributes({position:new d.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})}),s=u?2:1,c=new Uint16Array(8*(1+s)),p=u?0:1;p<2;++p)o=4*p,c[i=u?8*p:0]=o,c[i+1]=o+1,c[i+2]=o+1,c[i+3]=o+2,c[i+4]=o+2,c[i+5]=o+3,c[i+6]=o+3,c[i+7]=o;for(p=0;p<2;++p)o=4*p,c[i=8*(s+p)]=o,c[i+1]=o+4,c[i+2]=o+1,c[i+3]=o+5,c[i+4]=o+2,c[i+5]=o+6,c[i+6]=o+3,c[i+7]=o+7;return new d.Geometry({attributes:r,indices:c,primitiveType:d.PrimitiveType.LINES,boundingSphere:m.BoundingSphere.fromVertices(e)})},function(e,t){return o.defined(t)&&(e=p.unpack(e,t)),p.createGeometry(e)}}); +define(["./when-54335d57","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./FrustumGeometry-c7d19501","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./Math-d6182036","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./Plane-13ae4b1b","./VertexFormat-81ec7207"],function(o,m,c,e,h,d,f,g,t,r,n,a,u){"use strict";var s=0,i=1;function p(e){var t,r,n=e.frustum,a=e.orientation,u=e.origin,e=o.defaultValue(e._drawNearPlane,!0);n instanceof d.PerspectiveFrustum?(t=s,r=d.PerspectiveFrustum.packedLength):n instanceof d.OrthographicFrustum&&(t=i,r=d.OrthographicFrustum.packedLength),this._frustumType=t,this._frustum=n.clone(),this._origin=c.Cartesian3.clone(u),this._orientation=m.Quaternion.clone(a),this._drawNearPlane=e,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+r+c.Cartesian3.packedLength+m.Quaternion.packedLength}p.pack=function(e,t,r){r=o.defaultValue(r,0);var n=e._frustumType,a=e._frustum;return(t[r++]=n)===s?(d.PerspectiveFrustum.pack(a,t,r),r+=d.PerspectiveFrustum.packedLength):(d.OrthographicFrustum.pack(a,t,r),r+=d.OrthographicFrustum.packedLength),c.Cartesian3.pack(e._origin,t,r),r+=c.Cartesian3.packedLength,m.Quaternion.pack(e._orientation,t,r),t[r+=m.Quaternion.packedLength]=e._drawNearPlane?1:0,t};var _=new d.PerspectiveFrustum,k=new d.OrthographicFrustum,l=new m.Quaternion,y=new c.Cartesian3;return p.unpack=function(e,t,r){t=o.defaultValue(t,0);var n,a=e[t++];a===s?(n=d.PerspectiveFrustum.unpack(e,t,_),t+=d.PerspectiveFrustum.packedLength):(n=d.OrthographicFrustum.unpack(e,t,k),t+=d.OrthographicFrustum.packedLength);var u=c.Cartesian3.unpack(e,t,y);t+=c.Cartesian3.packedLength;var i=m.Quaternion.unpack(e,t,l),e=1===e[t+=m.Quaternion.packedLength];if(!o.defined(r))return new p({frustum:n,origin:u,orientation:i,_drawNearPlane:e});t=a===r._frustumType?r._frustum:void 0;return r._frustum=n.clone(t),r._frustumType=a,r._origin=c.Cartesian3.clone(u,r._origin),r._orientation=m.Quaternion.clone(i,r._orientation),r._drawNearPlane=e,r},p.createGeometry=function(e){var t=e._frustumType,r=e._frustum,n=e._origin,a=e._orientation,u=e._drawNearPlane,e=new Float64Array(24);d.FrustumGeometry._computeNearFarPlanes(n,a,t,r,e);for(var i,o,r=new g.GeometryAttributes({position:new f.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})}),c=u?2:1,s=new Uint16Array(8*(1+c)),p=u?0:1;p<2;++p)s[i=u?8*p:0]=o=4*p,s[i+1]=o+1,s[i+2]=o+1,s[i+3]=o+2,s[i+4]=o+2,s[i+5]=o+3,s[i+6]=o+3,s[i+7]=o;for(p=0;p<2;++p)s[i=8*(c+p)]=o=4*p,s[i+1]=o+4,s[i+2]=o+1,s[i+3]=o+5,s[i+4]=o+2,s[i+5]=o+6,s[i+6]=o+3,s[i+7]=o+7;return new f.Geometry({attributes:r,indices:s,primitiveType:f.PrimitiveType.LINES,boundingSphere:m.BoundingSphere.fromVertices(e)})},function(e,t){return o.defined(t)&&(e=p.unpack(e,t)),p.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createGeometry.js b/public/Cesium/Workers/createGeometry.js index 64f4061..c969a4b 100644 --- a/public/Cesium/Workers/createGeometry.js +++ b/public/Cesium/Workers/createGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./PrimitivePipeline-5ce755e1","./createTaskProcessorWorker","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./Math-4e53b694","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryPipeline-5e672526","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./IndexDatatype-d47ad6f6","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./WebMercatorProjection-ffb6b9f8"],function(c,d,e,r,t,n,a,o,i,f,s,u,b,m,p,l,y,P,k){"use strict";var C={};return e(function(e,r){for(var t=e.subTasks,n=t.length,a=new Array(n),o=0;o<n;o++){var i=t[o],f=i.geometry,s=i.moduleName;c.defined(s)?(s=function(e){var r=C[e];return c.defined(r)||("object"==typeof exports?C[r]=r=require("Workers/"+e):require(["Workers/"+e],function(e){C[r=e]=e})),r}(s),a[o]=s(f,i.offset)):a[o]=f}return c.when.all(a,function(e){return d.PrimitivePipeline.packCreateGeometryResults(e,r)})})}); +define(["./when-54335d57","./PrimitivePipeline-c76ef883","./createTaskProcessorWorker","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./Math-d6182036","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryPipeline-571ff4c9","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./IndexDatatype-82ceea78","./IntersectionTests-5394f658","./Plane-13ae4b1b","./WebMercatorProjection-66cc0482"],function(f,u,e,r,t,n,a,o,i,c,s,d,m,b,p,l,y,P,k){"use strict";var C={};return e(function(e,r){for(var t=e.subTasks,n=t.length,a=new Array(n),o=0;o<n;o++){var i=t[o],c=i.geometry,s=i.moduleName;f.defined(s)?(s=function(e){var r=C[e];return f.defined(r)||("object"==typeof exports?C[r]=r=require("Workers/"+e):require(["Workers/"+e],function(e){C[r=e]=e})),r}(s),a[o]=s(c,i.offset)):a[o]=c}return f.when.all(a,function(e){return u.PrimitivePipeline.packCreateGeometryResults(e,r)})})}); diff --git a/public/Cesium/Workers/createGroundPolylineGeometry.js b/public/Cesium/Workers/createGroundPolylineGeometry.js index d205c17..77c1f8e 100644 --- a/public/Cesium/Workers/createGroundPolylineGeometry.js +++ b/public/Cesium/Workers/createGroundPolylineGeometry.js @@ -1 +1 @@ -define(["./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./when-208fe5b0","./Math-4e53b694","./ArcType-dc1c5aee","./arrayRemoveDuplicates-0f62a181","./ComponentDatatype-9204e9f6","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4","./EncodedCartesian3-874933de","./GeometryAttribute-04a19cfe","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./WebMercatorProjection-ffb6b9f8","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1"],function(Oe,be,e,B,Pe,j,G,ke,M,V,Ae,Le,Y,r,a,t,n){"use strict";function i(e){e=B.defaultValue(e,B.defaultValue.EMPTY_OBJECT),this._ellipsoid=B.defaultValue(e.ellipsoid,be.Ellipsoid.WGS84),this._rectangle=B.defaultValue(e.rectangle,be.Rectangle.MAX_VALUE),this._projection=new Oe.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=B.defaultValue(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=B.defaultValue(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),i.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},i.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},i.prototype.rectangleToNativeRectangle=function(e,a){var t=Pe.CesiumMath.toDegrees(e.west),n=Pe.CesiumMath.toDegrees(e.south),i=Pe.CesiumMath.toDegrees(e.east),e=Pe.CesiumMath.toDegrees(e.north);return B.defined(a)?(a.west=t,a.south=n,a.east=i,a.north=e,a):new be.Rectangle(t,n,i,e)},i.prototype.tileXYToNativeRectangle=function(e,a,t,n){n=this.tileXYToRectangle(e,a,t,n);return n.west=Pe.CesiumMath.toDegrees(n.west),n.south=Pe.CesiumMath.toDegrees(n.south),n.east=Pe.CesiumMath.toDegrees(n.east),n.north=Pe.CesiumMath.toDegrees(n.north),n},i.prototype.tileXYToRectangle=function(e,a,t,n){var i=this._rectangle,r=this.getNumberOfXTilesAtLevel(t),s=this.getNumberOfYTilesAtLevel(t),t=i.width/r,r=e*t+i.west,e=(e+1)*t+i.west,t=i.height/s,s=i.north-a*t,t=i.north-(a+1)*t;return(n=!B.defined(n)?new be.Rectangle(r,t,e,s):n).west=r,n.south=t,n.east=e,n.north=s,n},i.prototype.positionToTileXY=function(e,a,t){var n=this._rectangle;if(be.Rectangle.contains(n,e)){var i=this.getNumberOfXTilesAtLevel(a),r=this.getNumberOfYTilesAtLevel(a),s=n.width/i,o=n.height/r,a=e.longitude;n.east<n.west&&(a+=Pe.CesiumMath.TWO_PI);s=(a-n.west)/s|0;i<=s&&(s=i-1);o=(n.north-e.latitude)/o|0;return(r<=o&&(o=r-1),B.defined(t))?(t.x=s,t.y=o,t):new be.Cartesian2(s,o)}};var s=new be.Cartesian3,o=new be.Cartesian3,l=new be.Cartographic,u=new be.Cartesian3,c=new be.Cartesian3,C=new Oe.BoundingSphere,p=new i,d=[new be.Cartographic,new be.Cartographic,new be.Cartographic,new be.Cartographic],h=new be.Cartesian2,Se={};function g(e){be.Cartographic.fromRadians(e.east,e.north,0,d[0]),be.Cartographic.fromRadians(e.west,e.north,0,d[1]),be.Cartographic.fromRadians(e.east,e.south,0,d[2]),be.Cartographic.fromRadians(e.west,e.south,0,d[3]);for(var a=0,t=0,n=0,i=0,r=Se._terrainHeightsMaxLevel,s=0;s<=r;++s){for(var o=!1,l=0;l<4;++l){var u=d[l];if(p.positionToTileXY(u,s,h),0===l)n=h.x,i=h.y;else if(n!==h.x||i!==h.y){o=!0;break}}if(o)break;a=n,t=i}if(0!==s)return{x:a,y:t,level:r<s?r:s-1}}Se.initialize=function(){var e=Se._initPromise;return B.defined(e)?e:(e=Oe.Resource.fetchJson(Oe.buildModuleUrl("Assets/approximateTerrainHeights.json")).then(function(e){Se._terrainHeights=e}),Se._initPromise=e)},Se.getMinimumMaximumHeights=function(e,a){a=B.defaultValue(a,be.Ellipsoid.WGS84);var t=g(e),n=Se._defaultMinTerrainHeight,i=Se._defaultMaxTerrainHeight;return B.defined(t)&&(t=t.level+"-"+t.x+"-"+t.y,t=Se._terrainHeights[t],B.defined(t)&&(n=t[0],i=t[1]),a.cartographicToCartesian(be.Rectangle.northeast(e,l),s),a.cartographicToCartesian(be.Rectangle.southwest(e,l),o),be.Cartesian3.midpoint(o,s,u),a=a.scaleToGeodeticSurface(u,c),n=B.defined(a)?(a=be.Cartesian3.distance(u,a),Math.min(n,-a)):Se._defaultMinTerrainHeight),{minimumTerrainHeight:n=Math.max(Se._defaultMinTerrainHeight,n),maximumTerrainHeight:i}},Se.getBoundingSphere=function(e,a){a=B.defaultValue(a,be.Ellipsoid.WGS84);var t=g(e),n=Se._defaultMaxTerrainHeight;B.defined(t)&&(i=t.level+"-"+t.x+"-"+t.y,i=Se._terrainHeights[i],B.defined(i)&&(n=i[1]));var i=Oe.BoundingSphere.fromRectangle3D(e,a,0);return Oe.BoundingSphere.fromRectangle3D(e,a,n,C),Oe.BoundingSphere.union(i,C,i)},Se._terrainHeightsMaxLevel=6,Se._defaultMaxTerrainHeight=9e3,Se._defaultMinTerrainHeight=-1e5,Se._terrainHeights=void 0,Se._initPromise=void 0,Object.defineProperties(Se,{initialized:{get:function(){return B.defined(Se._terrainHeights)}}});var F=[Oe.GeographicProjection,a.WebMercatorProjection],f=F.length,Ie=Math.cos(Pe.CesiumMath.toRadians(30)),m=Math.cos(Pe.CesiumMath.toRadians(150)),q=0,X=1e3;function w(e){var a=(e=B.defaultValue(e,B.defaultValue.EMPTY_OBJECT)).positions;this.width=B.defaultValue(e.width,1),this._positions=a,this.granularity=B.defaultValue(e.granularity,9999),this.loop=B.defaultValue(e.loop,!1),this.arcType=B.defaultValue(e.arcType,j.ArcType.GEODESIC),this._ellipsoid=be.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(w.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+be.Ellipsoid.packedLength+1+1}}}),w.setProjectionAndEllipsoid=function(e,a){for(var t=0,n=0;n<f;n++)if(a instanceof F[n]){t=n;break}e._projectionIndex=t,e._ellipsoid=a.ellipsoid};var y=new be.Cartesian3,v=new be.Cartesian3,T=new be.Cartesian3;function W(e,a,t,n,i){var r=Z(n,e,0,y),t=Z(n,e,t,v),a=Z(n,a,0,T),t=xe(t,r,v),r=xe(a,r,T);return be.Cartesian3.cross(r,t,i),be.Cartesian3.normalize(i,i)}var E=new be.Cartographic,_=new be.Cartesian3,O=new be.Cartesian3,b=new be.Cartesian3;function U(e,a,t,n,i,r,s,o,l,u,c){if(0!==i){var C;r===j.ArcType.GEODESIC?C=new M.EllipsoidGeodesic(e,a,s):r===j.ArcType.RHUMB&&(C=new V.EllipsoidRhumbLine(e,a,s));r=C.surfaceDistance;if(!(r<i))for(var p=W(e,a,n,s,b),i=Math.ceil(r/i),d=r/i,h=d,g=i-1,f=o.length,m=0;m<g;m++){var w=C.interpolateUsingSurfaceDistance(h,E),y=Z(s,w,t,_),v=Z(s,w,n,O);be.Cartesian3.pack(p,o,f),be.Cartesian3.pack(y,l,f),be.Cartesian3.pack(v,u,f),c.push(w.latitude),c.push(w.longitude),f+=3,h+=d}}}var P=new be.Cartographic;function Z(e,a,t,n){return be.Cartographic.clone(a,P),P.height=t,be.Cartographic.toCartesian(P,e,n)}function xe(e,a,t){return be.Cartesian3.subtract(e,a,t),be.Cartesian3.normalize(t,t),t}function k(e,a,t,n){return n=xe(e,a,n),n=be.Cartesian3.cross(n,t,n),n=be.Cartesian3.normalize(n,n),n=be.Cartesian3.cross(t,n,n)}w.pack=function(e,a,t){var n=B.defaultValue(t,0),i=e._positions,r=i.length;a[n++]=r;for(var s=0;s<r;++s){var o=i[s];be.Cartesian3.pack(o,a,n),n+=3}return a[n++]=e.granularity,a[n++]=e.loop?1:0,a[n++]=e.arcType,be.Ellipsoid.pack(e._ellipsoid,a,n),n+=be.Ellipsoid.packedLength,a[n++]=e._projectionIndex,a[n++]=e._scene3DOnly?1:0,a},w.unpack=function(e,a,t){for(var n=B.defaultValue(a,0),i=e[n++],r=new Array(i),s=0;s<i;s++)r[s]=be.Cartesian3.unpack(e,n),n+=3;var o=e[n++],l=1===e[n++],u=e[n++],c=be.Ellipsoid.unpack(e,n);n+=be.Ellipsoid.packedLength;var C=e[n++],a=1===e[n++];return(t=!B.defined(t)?new w({positions:r}):t)._positions=r,t.granularity=o,t.loop=l,t.arcType=u,t._ellipsoid=c,t._projectionIndex=C,t._scene3DOnly=a,t};var A=new be.Cartesian3,L=new be.Cartesian3,S=new be.Cartesian3,I=new be.Cartesian3;function J(e,a,t,n,i){t=xe(t,a,I),e=k(e,a,t,A),a=k(n,a,t,L);if(Pe.CesiumMath.equalsEpsilon(be.Cartesian3.dot(e,a),-1,Pe.CesiumMath.EPSILON5))return i=be.Cartesian3.cross(t,e,i),i=be.Cartesian3.normalize(i,i);i=be.Cartesian3.add(a,e,i),i=be.Cartesian3.normalize(i,i);t=be.Cartesian3.cross(t,i,S);return i=be.Cartesian3.dot(a,t)<0?be.Cartesian3.negate(i,i):i}var Q=r.Plane.fromPointNormal(be.Cartesian3.ZERO,be.Cartesian3.UNIT_Y),K=new be.Cartesian3,$=new be.Cartesian3,ee=new be.Cartesian3,ae=new be.Cartesian3,te=new be.Cartesian3,ne=new be.Cartesian3,ie=new be.Cartographic,re=new be.Cartographic,se=new be.Cartographic;w.createGeometry=function(e){var a,t,n,i,r,s=!e._scene3DOnly,o=e.loop,l=e._ellipsoid,u=e.granularity,c=e.arcType,C=new F[e._projectionIndex](l),p=q,d=X,h=e._positions,g=h.length;2===g&&(o=!1);for(var f,m,w,y=new V.EllipsoidRhumbLine(void 0,void 0,l),v=[h[0]],M=0;M<g-1;M++)t=h[M],n=h[M+1],f=Y.IntersectionTests.lineSegmentPlane(t,n,Q,ne),!B.defined(f)||be.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||be.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||(e.arcType===j.ArcType.GEODESIC?v.push(be.Cartesian3.clone(f)):e.arcType===j.ArcType.RHUMB&&(w=l.cartesianToCartographic(f,ie).longitude,i=l.cartesianToCartographic(t,ie),r=l.cartesianToCartographic(n,re),y.setEndPoints(i,r),m=y.findIntersectionWithLongitude(w,se),f=l.cartographicToCartesian(m,ne),!B.defined(f)||be.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||be.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||v.push(be.Cartesian3.clone(f)))),v.push(n);o&&(t=h[g-1],n=h[0],f=Y.IntersectionTests.lineSegmentPlane(t,n,Q,ne),!B.defined(f)||be.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||be.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||(e.arcType===j.ArcType.GEODESIC?v.push(be.Cartesian3.clone(f)):e.arcType===j.ArcType.RHUMB&&(w=l.cartesianToCartographic(f,ie).longitude,i=l.cartesianToCartographic(t,ie),r=l.cartesianToCartographic(n,re),y.setEndPoints(i,r),m=y.findIntersectionWithLongitude(w,se),f=l.cartographicToCartesian(m,ne),!B.defined(f)||be.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||be.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||v.push(be.Cartesian3.clone(f)))));var T=v.length,E=new Array(T);for(M=0;M<T;M++){var _=be.Cartographic.fromCartesian(v[M],l);_.height=0,E[M]=_}if(!((T=(E=G.arrayRemoveDuplicates(E,be.Cartographic.equalsEpsilon)).length)<2)){var O=[],b=[],P=[],k=[],A=K,L=$,S=ee,I=ae,x=te,N=E[0],R=E[1];for(A=Z(l,E[T-1],p,A),I=Z(l,R,p,I),L=Z(l,N,p,L),S=Z(l,N,d,S),x=o?J(A,L,S,I,x):W(N,R,d,l,x),be.Cartesian3.pack(x,b,0),be.Cartesian3.pack(L,P,0),be.Cartesian3.pack(S,k,0),O.push(N.latitude),O.push(N.longitude),U(N,R,p,d,u,c,l,b,P,k,O),M=1;M<T-1;++M){var A=be.Cartesian3.clone(L,A),L=be.Cartesian3.clone(I,L),D=E[M];Z(l,D,d,S),Z(l,E[M+1],p,I),J(A,L,S,I,x),a=b.length,be.Cartesian3.pack(x,b,a),be.Cartesian3.pack(L,P,a),be.Cartesian3.pack(S,k,a),O.push(D.latitude),O.push(D.longitude),U(E[M],E[M+1],p,d,u,c,l,b,P,k,O)}var z=E[T-1],H=E[T-2];if(L=Z(l,z,p,L),S=Z(l,z,d,S),x=o?(R=E[0],J(A=Z(l,H,p,A),L,S,I=Z(l,R,p,I),x)):W(H,z,d,l,x),a=b.length,be.Cartesian3.pack(x,b,a),be.Cartesian3.pack(L,P,a),be.Cartesian3.pack(S,k,a),O.push(z.latitude),O.push(z.longitude),o){for(U(z,N,p,d,u,c,l,b,P,k,O),a=b.length,M=0;M<3;++M)b[a+M]=b[M],P[a+M]=P[M],k[a+M]=k[M];O.push(N.latitude),O.push(N.longitude)}return function(e,a,t,n,i,r,s){var o,l,u,c,C,p,d=a._ellipsoid,h=t.length/3-1,g=8*h,f=4*g,m=36*h,w=new(65535<g?Uint32Array:Uint16Array)(m),y=new Float64Array(3*g),v=new Float32Array(f),M=new Float32Array(f),T=new Float32Array(f),E=new Float32Array(f),_=new Float32Array(f);s&&(u=new Float32Array(f),c=new Float32Array(f),C=new Float32Array(f),p=new Float32Array(2*g));var O=r.length/2,b=0,P=He;P.height=0;var k=Be;k.height=0;var A=je,L=Ge;if(s)for(l=0,o=1;o<O;o++)P.latitude=r[l],P.longitude=r[l+1],k.latitude=r[l+2],k.longitude=r[l+3],A=a.project(P,A),L=a.project(k,L),b+=be.Cartesian3.distance(A,L),l+=2;var S=n.length/3;L=be.Cartesian3.unpack(n,0,L);var I,x=0;for(l=3,o=1;o<S;o++)A=be.Cartesian3.clone(L,A),L=be.Cartesian3.unpack(n,l,L),x+=be.Cartesian3.distance(A,L),l+=3;l=3;var N=0,R=0,D=0,z=0,H=!1,B=be.Cartesian3.unpack(t,0,Ye),j=be.Cartesian3.unpack(n,0,Ge),G=be.Cartesian3.unpack(i,0,qe);e&&(_e=be.Cartesian3.unpack(t,t.length-6,Ve),Ne(G,_e,B,j)&&(G=be.Cartesian3.negate(G,G)));var V,Y,F,q,X,W,U,Z=0,J=0,Q=0;for(o=0;o<h;o++){var K=be.Cartesian3.clone(B,Ve),$=be.Cartesian3.clone(j,je),ee=be.Cartesian3.clone(G,Fe);H&&(ee=be.Cartesian3.negate(ee,ee)),B=be.Cartesian3.unpack(t,l,Ye),j=be.Cartesian3.unpack(n,l,Ge),G=be.Cartesian3.unpack(i,l,qe),H=Ne(G,K,B,j),P.latitude=r[N],P.longitude=r[N+1],k.latitude=r[N+2],k.longitude=r[N+3],s&&(Me=function(e,a){var t=Math.abs(e.longitude),n=Math.abs(a.longitude);{if(Pe.CesiumMath.equalsEpsilon(t,Pe.CesiumMath.PI,Pe.CesiumMath.EPSILON11)){var i=Pe.CesiumMath.sign(a.longitude);return e.longitude=i*(t-Pe.CesiumMath.EPSILON11),1}if(Pe.CesiumMath.equalsEpsilon(n,Pe.CesiumMath.PI,Pe.CesiumMath.EPSILON11)){e=Pe.CesiumMath.sign(e.longitude);return a.longitude=e*(n-Pe.CesiumMath.EPSILON11),2}}return 0}(P,k),V=a.project(P,Ke),(pe=xe(Y=a.project(k,$e),V,ca)).y=Math.abs(pe.y),F=ea,q=aa,0===Me||be.Cartesian3.dot(pe,be.Cartesian3.UNIT_Y)>Ie?(F=Re(a,P,ee,V,ea),q=Re(a,k,G,Y,aa)):1===Me?(q=Re(a,k,G,Y,aa),F.x=0,F.y=Pe.CesiumMath.sign(P.longitude-Math.abs(k.longitude)),F.z=0):(F=Re(a,P,ee,V,ea),q.x=0,q.y=Pe.CesiumMath.sign(P.longitude-k.longitude),q.z=0));var ae=be.Cartesian3.distance($,j),te=Ae.EncodedCartesian3.fromCartesian(K,la),ne=be.Cartesian3.subtract(B,K,ta),ie=be.Cartesian3.normalize(ne,ra),re=be.Cartesian3.subtract($,K,na);re=be.Cartesian3.normalize(re,re);var se=be.Cartesian3.cross(ie,re,ra);se=be.Cartesian3.normalize(se,se);var oe=be.Cartesian3.cross(re,ee,sa);oe=be.Cartesian3.normalize(oe,oe);var le=be.Cartesian3.subtract(j,B,ia);le=be.Cartesian3.normalize(le,le);var ue=be.Cartesian3.cross(G,le,oa);ue=be.Cartesian3.normalize(ue,ue);var ce=ae/x,Ce=Z/x,pe=0,de=0,he=0;for(s&&(pe=be.Cartesian3.distance(V,Y),X=Ae.EncodedCartesian3.fromCartesian(V,ua),W=be.Cartesian3.subtract(Y,V,ca),Te=(U=be.Cartesian3.normalize(W,Ca)).x,U.x=U.y,U.y=-Te,de=pe/b,he=J/b),I=0;I<8;I++){var ge=z+4*I,fe=R+2*I,me=ge+3,we=I<4?1:-1,ye=2===I||3===I||6===I||7===I?1:-1;be.Cartesian3.pack(te.high,v,ge),v[me]=ne.x,be.Cartesian3.pack(te.low,M,ge),M[me]=ne.y,be.Cartesian3.pack(oe,T,ge),T[me]=ne.z,be.Cartesian3.pack(ue,E,ge),E[me]=ce*we,be.Cartesian3.pack(se,_,ge);var ve=Ce*ye;0===ve&&ye<0&&(ve=9),_[me]=ve,s&&(u[ge]=X.high.x,u[ge+1]=X.high.y,u[ge+2]=X.low.x,u[ge+3]=X.low.y,C[ge]=-F.y,C[ge+1]=F.x,C[ge+2]=q.y,C[ge+3]=-q.x,c[ge]=W.x,c[ge+1]=W.y,c[ge+2]=U.x,c[ge+3]=U.y,p[fe]=de*we,0===(ve=he*ye)&&ye<0&&(ve=9),p[fe+1]=ve)}var Me=Je,ie=Qe,re=Ue,ee=Ze,le=be.Rectangle.fromCartographicArray(Xe,We),Te=Se.getMinimumMaximumHeights(le,d),le=Te.minimumTerrainHeight,Te=Te.maximumTerrainHeight;Q+=le,Q+=Te,De(K,$,le,Te,Me,re),De(B,j,le,Te,ie,ee);Te=be.Cartesian3.multiplyByScalar(se,Pe.CesiumMath.EPSILON5,pa);be.Cartesian3.add(Me,Te,Me),be.Cartesian3.add(ie,Te,ie),be.Cartesian3.add(re,Te,re),be.Cartesian3.add(ee,Te,ee),ze(Me,ie),ze(re,ee),be.Cartesian3.pack(Me,y,D),be.Cartesian3.pack(ie,y,D+3),be.Cartesian3.pack(ee,y,D+6),be.Cartesian3.pack(re,y,D+9),Te=be.Cartesian3.multiplyByScalar(se,-2*Pe.CesiumMath.EPSILON5,pa),be.Cartesian3.add(Me,Te,Me),be.Cartesian3.add(ie,Te,ie),be.Cartesian3.add(re,Te,re),be.Cartesian3.add(ee,Te,ee),ze(Me,ie),ze(re,ee),be.Cartesian3.pack(Me,y,D+12),be.Cartesian3.pack(ie,y,D+15),be.Cartesian3.pack(ee,y,D+18),be.Cartesian3.pack(re,y,D+21),N+=2,l+=3,R+=16,D+=24,z+=32,Z+=ae,J+=pe}var Ee=l=0;for(o=0;o<h;o++){for(I=0;I<ga;I++)w[l+I]=ha[I]+Ee;Ee+=8,l+=ga}e=da;Oe.BoundingSphere.fromVertices(t,be.Cartesian3.ZERO,3,e[0]),Oe.BoundingSphere.fromVertices(n,be.Cartesian3.ZERO,3,e[1]);var _e=Oe.BoundingSphere.fromBoundingSpheres(e);_e.radius+=Q/(2*h);e={position:new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:fa(v),startLoAndForwardOffsetY:fa(M),startNormalAndForwardOffsetZ:fa(T),endNormalAndTextureCoordinateNormalizationX:fa(E),rightNormalAndTextureCoordinateNormalizationY:fa(_)};s&&(e.startHiLo2D=fa(u),e.offsetAndRight2D=fa(c),e.startEndNormals2D=fa(C),e.texcoordNormalization2D=new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:p}));return new Le.Geometry({attributes:e,indices:w,boundingSphere:_e})}(o,C,P,k,b,O,s)}};var x=new be.Cartesian3,N=new Oe.Matrix3,R=new Oe.Quaternion;function Ne(e,a,t,n){a=xe(t,a,x),a=be.Cartesian3.dot(a,e);if(Ie<a||a<m){t=xe(n,t,I),a=a<m?Pe.CesiumMath.PI_OVER_TWO:-Pe.CesiumMath.PI_OVER_TWO,a=Oe.Quaternion.fromAxisAngle(t,a,R),a=Oe.Matrix3.fromQuaternion(a,N);return Oe.Matrix3.multiplyByVector(a,e,e),!0}return!1}var D=new be.Cartographic,z=new be.Cartesian3,H=new be.Cartesian3;function Re(e,a,t,n,i){var r=be.Cartographic.toCartesian(a,e._ellipsoid,z),s=be.Cartesian3.add(r,t,H),o=!1,l=e._ellipsoid,u=l.cartesianToCartographic(s,D);Math.abs(a.longitude-u.longitude)>Pe.CesiumMath.PI_OVER_TWO&&(o=!0,s=be.Cartesian3.subtract(r,t,H),u=l.cartesianToCartographic(s,D)),u.height=0;u=e.project(u,i);return(i=be.Cartesian3.subtract(u,n,i)).z=0,i=be.Cartesian3.normalize(i,i),o&&be.Cartesian3.negate(i,i),i}var oe=new be.Cartesian3,le=new be.Cartesian3;function De(e,a,t,n,i,r){var s=be.Cartesian3.subtract(a,e,oe);be.Cartesian3.normalize(s,s);t-=q,t=be.Cartesian3.multiplyByScalar(s,t,le);be.Cartesian3.add(e,t,i);n-=X,t=be.Cartesian3.multiplyByScalar(s,n,le);be.Cartesian3.add(a,t,r)}var ue=new be.Cartesian3;function ze(e,a){var t=r.Plane.getPointDistance(Q,e),n=r.Plane.getPointDistance(Q,a),i=ue;Pe.CesiumMath.equalsEpsilon(t,0,Pe.CesiumMath.EPSILON2)?(i=xe(a,e,i),be.Cartesian3.multiplyByScalar(i,Pe.CesiumMath.EPSILON2,i),be.Cartesian3.add(e,i,e)):Pe.CesiumMath.equalsEpsilon(n,0,Pe.CesiumMath.EPSILON2)&&(i=xe(e,a,i),be.Cartesian3.multiplyByScalar(i,Pe.CesiumMath.EPSILON2,i),be.Cartesian3.add(a,i,a))}var He=new be.Cartographic,Be=new be.Cartographic,je=new be.Cartesian3,Ge=new be.Cartesian3,Ve=new be.Cartesian3,Ye=new be.Cartesian3,Fe=new be.Cartesian3,qe=new be.Cartesian3,Xe=[He,Be],We=new be.Rectangle,Ue=new be.Cartesian3,Ze=new be.Cartesian3,Je=new be.Cartesian3,Qe=new be.Cartesian3,Ke=new be.Cartesian3,$e=new be.Cartesian3,ea=new be.Cartesian3,aa=new be.Cartesian3,ta=new be.Cartesian3,na=new be.Cartesian3,ia=new be.Cartesian3,ra=new be.Cartesian3,sa=new be.Cartesian3,oa=new be.Cartesian3,la=new Ae.EncodedCartesian3,ua=new Ae.EncodedCartesian3,ca=new be.Cartesian3,Ca=new be.Cartesian3,pa=new be.Cartesian3,da=[new Oe.BoundingSphere,new Oe.BoundingSphere],ha=[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],ga=ha.length;function fa(e){return new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}return w._projectNormal=Re,function(e,a){return Se.initialize().then(function(){return B.defined(a)&&(e=w.unpack(e,a)),w.createGeometry(e)})}}); +define(["./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./when-54335d57","./Math-d6182036","./ArcType-2b58731c","./arrayRemoveDuplicates-3fea1e5f","./ComponentDatatype-1a100acd","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3","./EncodedCartesian3-bf827957","./GeometryAttribute-374f805d","./IntersectionTests-5394f658","./Plane-13ae4b1b","./WebMercatorProjection-66cc0482","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9"],function(Oe,be,e,B,Pe,j,G,ke,M,V,Ae,Le,Y,r,a,t,n){"use strict";function i(e){e=B.defaultValue(e,B.defaultValue.EMPTY_OBJECT),this._ellipsoid=B.defaultValue(e.ellipsoid,be.Ellipsoid.WGS84),this._rectangle=B.defaultValue(e.rectangle,be.Rectangle.MAX_VALUE),this._projection=new Oe.GeographicProjection(this._ellipsoid),this._numberOfLevelZeroTilesX=B.defaultValue(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=B.defaultValue(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),i.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},i.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},i.prototype.rectangleToNativeRectangle=function(e,a){var t=Pe.CesiumMath.toDegrees(e.west),n=Pe.CesiumMath.toDegrees(e.south),i=Pe.CesiumMath.toDegrees(e.east),e=Pe.CesiumMath.toDegrees(e.north);return B.defined(a)?(a.west=t,a.south=n,a.east=i,a.north=e,a):new be.Rectangle(t,n,i,e)},i.prototype.tileXYToNativeRectangle=function(e,a,t,n){n=this.tileXYToRectangle(e,a,t,n);return n.west=Pe.CesiumMath.toDegrees(n.west),n.south=Pe.CesiumMath.toDegrees(n.south),n.east=Pe.CesiumMath.toDegrees(n.east),n.north=Pe.CesiumMath.toDegrees(n.north),n},i.prototype.tileXYToRectangle=function(e,a,t,n){var i=this._rectangle,r=this.getNumberOfXTilesAtLevel(t),s=this.getNumberOfYTilesAtLevel(t),t=i.width/r,r=e*t+i.west,e=(e+1)*t+i.west,t=i.height/s,s=i.north-a*t,t=i.north-(a+1)*t;return(n=!B.defined(n)?new be.Rectangle(r,t,e,s):n).west=r,n.south=t,n.east=e,n.north=s,n},i.prototype.positionToTileXY=function(e,a,t){var n=this._rectangle;if(be.Rectangle.contains(n,e)){var i=this.getNumberOfXTilesAtLevel(a),r=this.getNumberOfYTilesAtLevel(a),s=n.width/i,o=n.height/r,a=e.longitude;n.east<n.west&&(a+=Pe.CesiumMath.TWO_PI);s=(a-n.west)/s|0;i<=s&&(s=i-1);o=(n.north-e.latitude)/o|0;return(r<=o&&(o=r-1),B.defined(t))?(t.x=s,t.y=o,t):new be.Cartesian2(s,o)}};var s=new be.Cartesian3,o=new be.Cartesian3,l=new be.Cartographic,u=new be.Cartesian3,c=new be.Cartesian3,C=new Oe.BoundingSphere,p=new i,h=[new be.Cartographic,new be.Cartographic,new be.Cartographic,new be.Cartographic],d=new be.Cartesian2,Se={};function g(e){be.Cartographic.fromRadians(e.east,e.north,0,h[0]),be.Cartographic.fromRadians(e.west,e.north,0,h[1]),be.Cartographic.fromRadians(e.east,e.south,0,h[2]),be.Cartographic.fromRadians(e.west,e.south,0,h[3]);for(var a=0,t=0,n=0,i=0,r=Se._terrainHeightsMaxLevel,s=0;s<=r;++s){for(var o=!1,l=0;l<4;++l)if(p.positionToTileXY(h[l],s,d),0===l)n=d.x,i=d.y;else if(n!==d.x||i!==d.y){o=!0;break}if(o)break;a=n,t=i}if(0!==s)return{x:a,y:t,level:r<s?r:s-1}}Se.initialize=function(){var e=Se._initPromise;return B.defined(e)?e:(e=Oe.Resource.fetchJson(Oe.buildModuleUrl("Assets/approximateTerrainHeights.json")).then(function(e){Se._terrainHeights=e}),Se._initPromise=e)},Se.getMinimumMaximumHeights=function(e,a){a=B.defaultValue(a,be.Ellipsoid.WGS84);var t=g(e),n=Se._defaultMinTerrainHeight,i=Se._defaultMaxTerrainHeight;return B.defined(t)&&(t=t.level+"-"+t.x+"-"+t.y,t=Se._terrainHeights[t],B.defined(t)&&(n=t[0],i=t[1]),a.cartographicToCartesian(be.Rectangle.northeast(e,l),s),a.cartographicToCartesian(be.Rectangle.southwest(e,l),o),be.Cartesian3.midpoint(o,s,u),a=a.scaleToGeodeticSurface(u,c),n=B.defined(a)?(a=be.Cartesian3.distance(u,a),Math.min(n,-a)):Se._defaultMinTerrainHeight),{minimumTerrainHeight:n=Math.max(Se._defaultMinTerrainHeight,n),maximumTerrainHeight:i}},Se.getBoundingSphere=function(e,a){a=B.defaultValue(a,be.Ellipsoid.WGS84);var t=g(e),n=Se._defaultMaxTerrainHeight;B.defined(t)&&(i=t.level+"-"+t.x+"-"+t.y,i=Se._terrainHeights[i],B.defined(i)&&(n=i[1]));var i=Oe.BoundingSphere.fromRectangle3D(e,a,0);return Oe.BoundingSphere.fromRectangle3D(e,a,n,C),Oe.BoundingSphere.union(i,C,i)},Se._terrainHeightsMaxLevel=6,Se._defaultMaxTerrainHeight=9e3,Se._defaultMinTerrainHeight=-1e5,Se._terrainHeights=void 0,Se._initPromise=void 0,Object.defineProperties(Se,{initialized:{get:function(){return B.defined(Se._terrainHeights)}}});var F=[Oe.GeographicProjection,a.WebMercatorProjection],f=F.length,Ie=Math.cos(Pe.CesiumMath.toRadians(30)),m=Math.cos(Pe.CesiumMath.toRadians(150)),q=0,X=1e3;function w(e){var a=(e=B.defaultValue(e,B.defaultValue.EMPTY_OBJECT)).positions;this.width=B.defaultValue(e.width,1),this._positions=a,this.granularity=B.defaultValue(e.granularity,9999),this.loop=B.defaultValue(e.loop,!1),this.arcType=B.defaultValue(e.arcType,j.ArcType.GEODESIC),this._ellipsoid=be.Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(w.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+be.Ellipsoid.packedLength+1+1}}}),w.setProjectionAndEllipsoid=function(e,a){for(var t=0,n=0;n<f;n++)if(a instanceof F[n]){t=n;break}e._projectionIndex=t,e._ellipsoid=a.ellipsoid};var y=new be.Cartesian3,v=new be.Cartesian3,T=new be.Cartesian3;function W(e,a,t,n,i){var r=Z(n,e,0,y),t=Z(n,e,t,v),a=Z(n,a,0,T),t=xe(t,r,v),r=xe(a,r,T);return be.Cartesian3.cross(r,t,i),be.Cartesian3.normalize(i,i)}var E=new be.Cartographic,_=new be.Cartesian3,O=new be.Cartesian3,b=new be.Cartesian3;function U(e,a,t,n,i,r,s,o,l,u,c){if(0!==i){var C;r===j.ArcType.GEODESIC?C=new M.EllipsoidGeodesic(e,a,s):r===j.ArcType.RHUMB&&(C=new V.EllipsoidRhumbLine(e,a,s));r=C.surfaceDistance;if(!(r<i))for(var p=W(e,a,n,s,b),i=Math.ceil(r/i),h=r/i,d=h,g=i-1,f=o.length,m=0;m<g;m++){var w=C.interpolateUsingSurfaceDistance(d,E),y=Z(s,w,t,_),v=Z(s,w,n,O);be.Cartesian3.pack(p,o,f),be.Cartesian3.pack(y,l,f),be.Cartesian3.pack(v,u,f),c.push(w.latitude),c.push(w.longitude),f+=3,d+=h}}}var P=new be.Cartographic;function Z(e,a,t,n){return be.Cartographic.clone(a,P),P.height=t,be.Cartographic.toCartesian(P,e,n)}function xe(e,a,t){return be.Cartesian3.subtract(e,a,t),be.Cartesian3.normalize(t,t),t}function k(e,a,t,n){return n=xe(e,a,n),n=be.Cartesian3.cross(n,t,n),n=be.Cartesian3.normalize(n,n),n=be.Cartesian3.cross(t,n,n)}w.pack=function(e,a,t){var n=B.defaultValue(t,0),i=e._positions,r=i.length;a[n++]=r;for(var s=0;s<r;++s){var o=i[s];be.Cartesian3.pack(o,a,n),n+=3}return a[n++]=e.granularity,a[n++]=e.loop?1:0,a[n++]=e.arcType,be.Ellipsoid.pack(e._ellipsoid,a,n),n+=be.Ellipsoid.packedLength,a[n++]=e._projectionIndex,a[n++]=e._scene3DOnly?1:0,a},w.unpack=function(e,a,t){for(var n=B.defaultValue(a,0),i=e[n++],r=new Array(i),s=0;s<i;s++)r[s]=be.Cartesian3.unpack(e,n),n+=3;var o=e[n++],l=1===e[n++],u=e[n++],c=be.Ellipsoid.unpack(e,n);n+=be.Ellipsoid.packedLength;var C=e[n++],a=1===e[n++];return(t=!B.defined(t)?new w({positions:r}):t)._positions=r,t.granularity=o,t.loop=l,t.arcType=u,t._ellipsoid=c,t._projectionIndex=C,t._scene3DOnly=a,t};var A=new be.Cartesian3,L=new be.Cartesian3,S=new be.Cartesian3,I=new be.Cartesian3;function J(e,a,t,n,i){t=xe(t,a,I),e=k(e,a,t,A),a=k(n,a,t,L);if(Pe.CesiumMath.equalsEpsilon(be.Cartesian3.dot(e,a),-1,Pe.CesiumMath.EPSILON5))return i=be.Cartesian3.cross(t,e,i),i=be.Cartesian3.normalize(i,i);i=be.Cartesian3.add(a,e,i),i=be.Cartesian3.normalize(i,i);t=be.Cartesian3.cross(t,i,S);return i=be.Cartesian3.dot(a,t)<0?be.Cartesian3.negate(i,i):i}var Q=r.Plane.fromPointNormal(be.Cartesian3.ZERO,be.Cartesian3.UNIT_Y),K=new be.Cartesian3,$=new be.Cartesian3,ee=new be.Cartesian3,ae=new be.Cartesian3,te=new be.Cartesian3,ne=new be.Cartesian3,ie=new be.Cartographic,re=new be.Cartographic,se=new be.Cartographic;w.createGeometry=function(e){var a,t,n,i,r,s=!e._scene3DOnly,o=e.loop,l=e._ellipsoid,u=e.granularity,c=e.arcType,C=new F[e._projectionIndex](l),p=q,h=X,d=e._positions,g=d.length;2===g&&(o=!1);for(var f,m,w,y=new V.EllipsoidRhumbLine(void 0,void 0,l),v=[d[0]],M=0;M<g-1;M++)t=d[M],n=d[M+1],f=Y.IntersectionTests.lineSegmentPlane(t,n,Q,ne),!B.defined(f)||be.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||be.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||(e.arcType===j.ArcType.GEODESIC?v.push(be.Cartesian3.clone(f)):e.arcType===j.ArcType.RHUMB&&(w=l.cartesianToCartographic(f,ie).longitude,i=l.cartesianToCartographic(t,ie),r=l.cartesianToCartographic(n,re),y.setEndPoints(i,r),m=y.findIntersectionWithLongitude(w,se),f=l.cartographicToCartesian(m,ne),!B.defined(f)||be.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||be.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||v.push(be.Cartesian3.clone(f)))),v.push(n);o&&(t=d[g-1],n=d[0],f=Y.IntersectionTests.lineSegmentPlane(t,n,Q,ne),!B.defined(f)||be.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||be.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||(e.arcType===j.ArcType.GEODESIC?v.push(be.Cartesian3.clone(f)):e.arcType===j.ArcType.RHUMB&&(w=l.cartesianToCartographic(f,ie).longitude,i=l.cartesianToCartographic(t,ie),r=l.cartesianToCartographic(n,re),y.setEndPoints(i,r),m=y.findIntersectionWithLongitude(w,se),f=l.cartographicToCartesian(m,ne),!B.defined(f)||be.Cartesian3.equalsEpsilon(f,t,Pe.CesiumMath.EPSILON7)||be.Cartesian3.equalsEpsilon(f,n,Pe.CesiumMath.EPSILON7)||v.push(be.Cartesian3.clone(f)))));var T=v.length,E=new Array(T);for(M=0;M<T;M++){var _=be.Cartographic.fromCartesian(v[M],l);_.height=0,E[M]=_}if(!((T=(E=G.arrayRemoveDuplicates(E,be.Cartographic.equalsEpsilon)).length)<2)){var O=[],b=[],P=[],k=[],A=$,L=ee,S=ae,I=te,x=E[0],N=E[1];for(R=Z(l,E[T-1],p,R=K),S=Z(l,N,p,S),A=Z(l,x,p,A),L=Z(l,x,h,L),I=o?J(R,A,L,S,I):W(x,N,h,l,I),be.Cartesian3.pack(I,b,0),be.Cartesian3.pack(A,P,0),be.Cartesian3.pack(L,k,0),O.push(x.latitude),O.push(x.longitude),U(x,N,p,h,u,c,l,b,P,k,O),M=1;M<T-1;++M){var R=be.Cartesian3.clone(A,R),A=be.Cartesian3.clone(S,A),D=E[M];Z(l,D,h,L),Z(l,E[M+1],p,S),J(R,A,L,S,I),a=b.length,be.Cartesian3.pack(I,b,a),be.Cartesian3.pack(A,P,a),be.Cartesian3.pack(L,k,a),O.push(D.latitude),O.push(D.longitude),U(E[M],E[M+1],p,h,u,c,l,b,P,k,O)}var z=E[T-1],H=E[T-2];if(A=Z(l,z,p,A),L=Z(l,z,h,L),I=o?(N=E[0],J(R=Z(l,H,p,R),A,L,S=Z(l,N,p,S),I)):W(H,z,h,l,I),a=b.length,be.Cartesian3.pack(I,b,a),be.Cartesian3.pack(A,P,a),be.Cartesian3.pack(L,k,a),O.push(z.latitude),O.push(z.longitude),o){for(U(z,x,p,h,u,c,l,b,P,k,O),a=b.length,M=0;M<3;++M)b[a+M]=b[M],P[a+M]=P[M],k[a+M]=k[M];O.push(x.latitude),O.push(x.longitude)}return function(e,a,t,n,i,r,s){var o,l,u,c,C,p,h=a._ellipsoid,d=t.length/3-1,g=8*d,f=4*g,m=36*d,w=new(65535<g?Uint32Array:Uint16Array)(m),y=new Float64Array(3*g),v=new Float32Array(f),M=new Float32Array(f),T=new Float32Array(f),E=new Float32Array(f),_=new Float32Array(f);s&&(u=new Float32Array(f),c=new Float32Array(f),C=new Float32Array(f),p=new Float32Array(2*g));var O=r.length/2,b=0,P=He;P.height=0;var k=Be;k.height=0;var A=je,L=Ge;if(s)for(l=0,o=1;o<O;o++)P.latitude=r[l],P.longitude=r[l+1],k.latitude=r[l+2],k.longitude=r[l+3],A=a.project(P,A),L=a.project(k,L),b+=be.Cartesian3.distance(A,L),l+=2;var S=n.length/3;L=be.Cartesian3.unpack(n,0,L);var I,x=0;for(l=3,o=1;o<S;o++)A=be.Cartesian3.clone(L,A),L=be.Cartesian3.unpack(n,l,L),x+=be.Cartesian3.distance(A,L),l+=3;l=3;var N=0,R=0,D=0,z=0,H=!1,B=be.Cartesian3.unpack(t,0,Ye),j=be.Cartesian3.unpack(n,0,Ge),G=be.Cartesian3.unpack(i,0,qe);e&&(_e=be.Cartesian3.unpack(t,t.length-6,Ve),Ne(G,_e,B,j)&&(G=be.Cartesian3.negate(G,G)));var V,Y,F,q,X,W,U,Z=0,J=0,Q=0;for(o=0;o<d;o++){var K=be.Cartesian3.clone(B,Ve),$=be.Cartesian3.clone(j,je),ee=be.Cartesian3.clone(G,Fe);H&&(ee=be.Cartesian3.negate(ee,ee)),B=be.Cartesian3.unpack(t,l,Ye),j=be.Cartesian3.unpack(n,l,Ge),G=be.Cartesian3.unpack(i,l,qe),H=Ne(G,K,B,j),P.latitude=r[N],P.longitude=r[N+1],k.latitude=r[N+2],k.longitude=r[N+3],s&&(Me=function(e,a){var t=Math.abs(e.longitude),n=Math.abs(a.longitude);{if(Pe.CesiumMath.equalsEpsilon(t,Pe.CesiumMath.PI,Pe.CesiumMath.EPSILON11)){var i=Pe.CesiumMath.sign(a.longitude);return e.longitude=i*(t-Pe.CesiumMath.EPSILON11),1}if(Pe.CesiumMath.equalsEpsilon(n,Pe.CesiumMath.PI,Pe.CesiumMath.EPSILON11)){e=Pe.CesiumMath.sign(e.longitude);return a.longitude=e*(n-Pe.CesiumMath.EPSILON11),2}}return 0}(P,k),V=a.project(P,Ke),(pe=xe(Y=a.project(k,$e),V,ca)).y=Math.abs(pe.y),F=ea,q=aa,0===Me||be.Cartesian3.dot(pe,be.Cartesian3.UNIT_Y)>Ie?(F=Re(a,P,ee,V,ea),q=Re(a,k,G,Y,aa)):1===Me?(q=Re(a,k,G,Y,aa),F.x=0,F.y=Pe.CesiumMath.sign(P.longitude-Math.abs(k.longitude)),F.z=0):(F=Re(a,P,ee,V,ea),q.x=0,q.y=Pe.CesiumMath.sign(P.longitude-k.longitude),q.z=0));var ae=be.Cartesian3.distance($,j),te=Ae.EncodedCartesian3.fromCartesian(K,la),ne=be.Cartesian3.subtract(B,K,ta),ie=be.Cartesian3.normalize(ne,ra),re=be.Cartesian3.subtract($,K,na);re=be.Cartesian3.normalize(re,re);var se=be.Cartesian3.cross(ie,re,ra);se=be.Cartesian3.normalize(se,se);var oe=be.Cartesian3.cross(re,ee,sa);oe=be.Cartesian3.normalize(oe,oe);var le=be.Cartesian3.subtract(j,B,ia);le=be.Cartesian3.normalize(le,le);var ue=be.Cartesian3.cross(G,le,oa);ue=be.Cartesian3.normalize(ue,ue);var ce=ae/x,Ce=Z/x,pe=0,he=0,de=0;for(s&&(pe=be.Cartesian3.distance(V,Y),X=Ae.EncodedCartesian3.fromCartesian(V,ua),W=be.Cartesian3.subtract(Y,V,ca),Te=(U=be.Cartesian3.normalize(W,Ca)).x,U.x=U.y,U.y=-Te,he=pe/b,de=J/b),I=0;I<8;I++){var ge=z+4*I,fe=R+2*I,me=ge+3,we=I<4?1:-1,ye=2===I||3===I||6===I||7===I?1:-1;be.Cartesian3.pack(te.high,v,ge),v[me]=ne.x,be.Cartesian3.pack(te.low,M,ge),M[me]=ne.y,be.Cartesian3.pack(oe,T,ge),T[me]=ne.z,be.Cartesian3.pack(ue,E,ge),E[me]=ce*we,be.Cartesian3.pack(se,_,ge);var ve=Ce*ye;0===ve&&ye<0&&(ve=9),_[me]=ve,s&&(u[ge]=X.high.x,u[ge+1]=X.high.y,u[ge+2]=X.low.x,u[ge+3]=X.low.y,C[ge]=-F.y,C[ge+1]=F.x,C[ge+2]=q.y,C[ge+3]=-q.x,c[ge]=W.x,c[ge+1]=W.y,c[ge+2]=U.x,c[ge+3]=U.y,p[fe]=he*we,0===(ve=de*ye)&&ye<0&&(ve=9),p[fe+1]=ve)}var Me=Je,ie=Qe,re=Ue,ee=Ze,le=be.Rectangle.fromCartographicArray(Xe,We),Te=Se.getMinimumMaximumHeights(le,h),le=Te.minimumTerrainHeight,Te=Te.maximumTerrainHeight;Q+=le,Q+=Te,De(K,$,le,Te,Me,re),De(B,j,le,Te,ie,ee);Te=be.Cartesian3.multiplyByScalar(se,Pe.CesiumMath.EPSILON5,pa);be.Cartesian3.add(Me,Te,Me),be.Cartesian3.add(ie,Te,ie),be.Cartesian3.add(re,Te,re),be.Cartesian3.add(ee,Te,ee),ze(Me,ie),ze(re,ee),be.Cartesian3.pack(Me,y,D),be.Cartesian3.pack(ie,y,D+3),be.Cartesian3.pack(ee,y,D+6),be.Cartesian3.pack(re,y,D+9),Te=be.Cartesian3.multiplyByScalar(se,-2*Pe.CesiumMath.EPSILON5,pa),be.Cartesian3.add(Me,Te,Me),be.Cartesian3.add(ie,Te,ie),be.Cartesian3.add(re,Te,re),be.Cartesian3.add(ee,Te,ee),ze(Me,ie),ze(re,ee),be.Cartesian3.pack(Me,y,D+12),be.Cartesian3.pack(ie,y,D+15),be.Cartesian3.pack(ee,y,D+18),be.Cartesian3.pack(re,y,D+21),N+=2,l+=3,R+=16,D+=24,z+=32,Z+=ae,J+=pe}var Ee=l=0;for(o=0;o<d;o++){for(I=0;I<ga;I++)w[l+I]=da[I]+Ee;Ee+=8,l+=ga}e=ha;Oe.BoundingSphere.fromVertices(t,be.Cartesian3.ZERO,3,e[0]),Oe.BoundingSphere.fromVertices(n,be.Cartesian3.ZERO,3,e[1]);var _e=Oe.BoundingSphere.fromBoundingSpheres(e);_e.radius+=Q/(2*d);e={position:new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:fa(v),startLoAndForwardOffsetY:fa(M),startNormalAndForwardOffsetZ:fa(T),endNormalAndTextureCoordinateNormalizationX:fa(E),rightNormalAndTextureCoordinateNormalizationY:fa(_)};s&&(e.startHiLo2D=fa(u),e.offsetAndRight2D=fa(c),e.startEndNormals2D=fa(C),e.texcoordNormalization2D=new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.FLOAT,componentsPerAttribute:2,normalize:!1,values:p}));return new Le.Geometry({attributes:e,indices:w,boundingSphere:_e})}(o,C,P,k,b,O,s)}};var x=new be.Cartesian3,N=new Oe.Matrix3,R=new Oe.Quaternion;function Ne(e,a,t,n){a=xe(t,a,x),a=be.Cartesian3.dot(a,e);if(Ie<a||a<m){t=xe(n,t,I),a=a<m?Pe.CesiumMath.PI_OVER_TWO:-Pe.CesiumMath.PI_OVER_TWO,a=Oe.Quaternion.fromAxisAngle(t,a,R),a=Oe.Matrix3.fromQuaternion(a,N);return Oe.Matrix3.multiplyByVector(a,e,e),!0}return!1}var D=new be.Cartographic,z=new be.Cartesian3,H=new be.Cartesian3;function Re(e,a,t,n,i){var r=be.Cartographic.toCartesian(a,e._ellipsoid,z),s=be.Cartesian3.add(r,t,H),o=!1,l=e._ellipsoid,u=l.cartesianToCartographic(s,D);Math.abs(a.longitude-u.longitude)>Pe.CesiumMath.PI_OVER_TWO&&(o=!0,s=be.Cartesian3.subtract(r,t,H),u=l.cartesianToCartographic(s,D)),u.height=0;u=e.project(u,i);return(i=be.Cartesian3.subtract(u,n,i)).z=0,i=be.Cartesian3.normalize(i,i),o&&be.Cartesian3.negate(i,i),i}var oe=new be.Cartesian3,le=new be.Cartesian3;function De(e,a,t,n,i,r){var s=be.Cartesian3.subtract(a,e,oe);be.Cartesian3.normalize(s,s);t=be.Cartesian3.multiplyByScalar(s,t-q,le);be.Cartesian3.add(e,t,i);t=be.Cartesian3.multiplyByScalar(s,n-X,le);be.Cartesian3.add(a,t,r)}var ue=new be.Cartesian3;function ze(e,a){var t=r.Plane.getPointDistance(Q,e),n=r.Plane.getPointDistance(Q,a),i=ue;Pe.CesiumMath.equalsEpsilon(t,0,Pe.CesiumMath.EPSILON2)?(i=xe(a,e,i),be.Cartesian3.multiplyByScalar(i,Pe.CesiumMath.EPSILON2,i),be.Cartesian3.add(e,i,e)):Pe.CesiumMath.equalsEpsilon(n,0,Pe.CesiumMath.EPSILON2)&&(i=xe(e,a,i),be.Cartesian3.multiplyByScalar(i,Pe.CesiumMath.EPSILON2,i),be.Cartesian3.add(a,i,a))}var He=new be.Cartographic,Be=new be.Cartographic,je=new be.Cartesian3,Ge=new be.Cartesian3,Ve=new be.Cartesian3,Ye=new be.Cartesian3,Fe=new be.Cartesian3,qe=new be.Cartesian3,Xe=[He,Be],We=new be.Rectangle,Ue=new be.Cartesian3,Ze=new be.Cartesian3,Je=new be.Cartesian3,Qe=new be.Cartesian3,Ke=new be.Cartesian3,$e=new be.Cartesian3,ea=new be.Cartesian3,aa=new be.Cartesian3,ta=new be.Cartesian3,na=new be.Cartesian3,ia=new be.Cartesian3,ra=new be.Cartesian3,sa=new be.Cartesian3,oa=new be.Cartesian3,la=new Ae.EncodedCartesian3,ua=new Ae.EncodedCartesian3,ca=new be.Cartesian3,Ca=new be.Cartesian3,pa=new be.Cartesian3,ha=[new Oe.BoundingSphere,new Oe.BoundingSphere],da=[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],ga=da.length;function fa(e){return new Le.GeometryAttribute({componentDatatype:ke.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}return w._projectNormal=Re,function(e,a){return Se.initialize().then(function(){return B.defined(a)&&(e=w.unpack(e,a)),w.createGeometry(e)})}}); diff --git a/public/Cesium/Workers/createPlaneGeometry.js b/public/Cesium/Workers/createPlaneGeometry.js index c380f72..0d4f174 100644 --- a/public/Cesium/Workers/createPlaneGeometry.js +++ b/public/Cesium/Workers/createPlaneGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./VertexFormat-e8cbf5b3","./Math-4e53b694","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1"],function(n,o,m,e,i,u,p,a,t,r,y){"use strict";function c(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);e=n.defaultValue(e.vertexFormat,a.VertexFormat.DEFAULT);this._vertexFormat=e,this._workerName="createPlaneGeometry"}c.packedLength=a.VertexFormat.packedLength,c.pack=function(e,t,r){return r=n.defaultValue(r,0),a.VertexFormat.pack(e._vertexFormat,t,r),t};var s=new a.VertexFormat,b={vertexFormat:s};c.unpack=function(e,t,r){t=n.defaultValue(t,0);t=a.VertexFormat.unpack(e,t,s);return n.defined(r)?(r._vertexFormat=a.VertexFormat.clone(t,r._vertexFormat),r):new c(b)};var A=new m.Cartesian3(-.5,-.5,0),l=new m.Cartesian3(.5,.5,0);return c.createGeometry=function(e){var t,r,n=e._vertexFormat,a=new p.GeometryAttributes;return n.position&&((e=new Float64Array(12))[0]=A.x,e[1]=A.y,e[2]=0,e[3]=l.x,e[4]=A.y,e[5]=0,e[6]=l.x,e[7]=l.y,e[8]=0,e[9]=A.x,e[10]=l.y,e[11]=0,a.position=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),n.normal&&((e=new Float32Array(12))[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,a.normal=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),n.st&&((t=new Float32Array(8))[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,a.st=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})),n.tangent&&((t=new Float32Array(12))[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,a.tangent=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),n.bitangent&&((r=new Float32Array(12))[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,a.bitangent=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r})),(r=new Uint16Array(6))[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3),new u.Geometry({attributes:a,indices:r,primitiveType:u.PrimitiveType.TRIANGLES,boundingSphere:new o.BoundingSphere(m.Cartesian3.ZERO,Math.sqrt(2))})},function(e,t){return n.defined(t)&&(e=c.unpack(e,t)),c.createGeometry(e)}}); +define(["./when-54335d57","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./VertexFormat-81ec7207","./Math-d6182036","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9"],function(n,o,m,e,i,u,p,a,t,r,c){"use strict";function y(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);e=n.defaultValue(e.vertexFormat,a.VertexFormat.DEFAULT);this._vertexFormat=e,this._workerName="createPlaneGeometry"}y.packedLength=a.VertexFormat.packedLength,y.pack=function(e,t,r){return r=n.defaultValue(r,0),a.VertexFormat.pack(e._vertexFormat,t,r),t};var s=new a.VertexFormat,A={vertexFormat:s};y.unpack=function(e,t,r){t=n.defaultValue(t,0);t=a.VertexFormat.unpack(e,t,s);return n.defined(r)?(r._vertexFormat=a.VertexFormat.clone(t,r._vertexFormat),r):new y(A)};var l=new m.Cartesian3(-.5,-.5,0),F=new m.Cartesian3(.5,.5,0);return y.createGeometry=function(e){var t,r,n=e._vertexFormat,a=new p.GeometryAttributes;return n.position&&((e=new Float64Array(12))[0]=l.x,e[1]=l.y,e[2]=0,e[3]=F.x,e[4]=l.y,e[5]=0,e[6]=F.x,e[7]=F.y,e[8]=0,e[9]=l.x,e[10]=F.y,e[11]=0,a.position=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),n.normal&&((e=new Float32Array(12))[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,a.normal=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),n.st&&((t=new Float32Array(8))[0]=0,t[1]=0,t[2]=1,t[3]=0,t[4]=1,t[5]=1,t[6]=0,t[7]=1,a.st=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:t})),n.tangent&&((t=new Float32Array(12))[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,a.tangent=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),n.bitangent&&((r=new Float32Array(12))[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,a.bitangent=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:r})),(r=new Uint16Array(6))[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3),new u.Geometry({attributes:a,indices:r,primitiveType:u.PrimitiveType.TRIANGLES,boundingSphere:new o.BoundingSphere(m.Cartesian3.ZERO,Math.sqrt(2))})},function(e,t){return n.defined(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createPlaneOutlineGeometry.js b/public/Cesium/Workers/createPlaneOutlineGeometry.js index 38ee3b2..762bdb9 100644 --- a/public/Cesium/Workers/createPlaneOutlineGeometry.js +++ b/public/Cesium/Workers/createPlaneOutlineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./Math-4e53b694","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1"],function(r,a,i,e,o,u,c,t,n,s){"use strict";function y(){this._workerName="createPlaneOutlineGeometry"}y.packedLength=0,y.pack=function(e,t){return t},y.unpack=function(e,t,n){return r.defined(n)?n:new y};var b=new i.Cartesian3(-.5,-.5,0),m=new i.Cartesian3(.5,.5,0);return y.createGeometry=function(){var e=new c.GeometryAttributes,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=b.x,n[1]=b.y,n[2]=b.z,n[3]=m.x,n[4]=b.y,n[5]=b.z,n[6]=m.x,n[7]=m.y,n[8]=b.z,n[9]=b.x,n[10]=m.y,n[11]=b.z,e.position=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.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 u.Geometry({attributes:e,indices:t,primitiveType:u.PrimitiveType.LINES,boundingSphere:new a.BoundingSphere(i.Cartesian3.ZERO,Math.sqrt(2))})},function(e,t){return r.defined(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}}); +define(["./when-54335d57","./Transforms-79117a7b","./Cartesian2-8646c5a1","./Check-24483042","./ComponentDatatype-1a100acd","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./Math-d6182036","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9"],function(r,a,i,e,o,u,c,t,n,s){"use strict";function y(){this._workerName="createPlaneOutlineGeometry"}y.packedLength=0,y.pack=function(e,t){return t},y.unpack=function(e,t,n){return r.defined(n)?n:new y};var m=new i.Cartesian3(-.5,-.5,0),p=new i.Cartesian3(.5,.5,0);return y.createGeometry=function(){var e=new c.GeometryAttributes,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=m.x,n[1]=m.y,n[2]=m.z,n[3]=p.x,n[4]=m.y,n[5]=m.z,n[6]=p.x,n[7]=p.y,n[8]=m.z,n[9]=m.x,n[10]=p.y,n[11]=m.z,e.position=new u.GeometryAttribute({componentDatatype:o.ComponentDatatype.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 u.Geometry({attributes:e,indices:t,primitiveType:u.PrimitiveType.LINES,boundingSphere:new a.BoundingSphere(i.Cartesian3.ZERO,Math.sqrt(2))})},function(e,t){return r.defined(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createPolygonGeometry.js b/public/Cesium/Workers/createPolygonGeometry.js index b596554..2d1cf65 100644 --- a/public/Cesium/Workers/createPolygonGeometry.js +++ b/public/Cesium/Workers/createPolygonGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./ArcType-dc1c5aee","./GeometryOffsetAttribute-def3b741","./BoundingRectangle-7ee12c46","./Transforms-a73b3b3b","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./EllipsoidGeodesic-8015072b","./EllipsoidTangentPlane-9123a53b","./GeometryAttribute-04a19cfe","./GeometryInstance-d919cab6","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonGeometryLibrary-d175a7f1","./PolygonPipeline-bfd1975b","./VertexFormat-e8cbf5b3","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./arrayRemoveDuplicates-0f62a181","./EllipsoidRhumbLine-8cb2e5a4","./GeometryAttributes-b0b294d8"],function(z,W,c,Y,e,U,t,j,y,A,Q,E,G,O,q,V,F,f,r,o,a,i,n,s,l,u,p){"use strict";var K=new W.Cartographic,Z=new W.Cartographic;var D=new e.BoundingRectangle,J=new W.Cartesian3,X=new W.Cartesian3,$=new W.Cartesian3,ee=new W.Cartesian3,te=new W.Cartesian3,re=new W.Cartesian3,oe=new W.Cartesian3,ae=new W.Cartesian3,ie=new W.Cartesian3,ne=new W.Cartesian2,se=new W.Cartesian2,le=new W.Cartesian3,ue=new U.Quaternion,pe=new U.Matrix3,ce=new U.Matrix3;function L(e){var t,r=e.vertexFormat,o=e.geometry,a=e.shadowVolume,i=o.attributes.position.values,n=i.length,s=e.wall,l=e.top||s,u=e.bottom||s;if(r.st||r.normal||r.tangent||r.bitangent||a){var p=e.boundingRectangle,c=e.tangentPlane,y=e.ellipsoid,m=e.stRotation,g=e.perPositionHeight,d=ne;d.x=p.x,d.y=p.y;var h,f=r.st?new Float32Array(n/3*2):void 0;r.normal&&(h=g&&l&&!s?o.attributes.normal.values:new Float32Array(n));var b,_=r.tangent?new Float32Array(n):void 0,v=r.bitangent?new Float32Array(n):void 0,P=a?new Float32Array(n):void 0,C=0,w=0,x=X,T=$,I=ee,A=!0,E=pe,G=ce;G=0!==m?(b=U.Quaternion.fromAxisAngle(c._plane.normal,m,ue),E=U.Matrix3.fromQuaternion(b,E),b=U.Quaternion.fromAxisAngle(c._plane.normal,-m,ue),U.Matrix3.fromQuaternion(b,G)):(E=U.Matrix3.clone(U.Matrix3.IDENTITY,E),U.Matrix3.clone(U.Matrix3.IDENTITY,G));var O=0,V=0;l&&u&&(O=n/2,V=n/3,n/=2);for(var F=0;F<n;F+=3){var D,L,N,H,R,M,S,B,k=W.Cartesian3.fromArray(i,F,le);r.st&&(D=U.Matrix3.multiplyByVector(E,k,J),D=y.scaleToGeodeticSurface(D,D),L=c.projectPointOntoPlane(D,se),W.Cartesian2.subtract(L,d,L),N=q.CesiumMath.clamp(L.x/p.width,0,1),H=q.CesiumMath.clamp(L.y/p.height,0,1),u&&(f[C+V]=N,f[C+1+V]=H),l&&(f[C]=N,f[C+1]=H),C+=2),(r.normal||r.tangent||r.bitangent||a)&&(R=w+1,M=w+2,s?(F+3<n&&(S=W.Cartesian3.fromArray(i,F+3,te),A&&(B=W.Cartesian3.fromArray(i,F+n,re),g&&(t=k,D=S,L=B,N=void 0,N=(H=y).cartesianToCartographic(t,K).height,(t=H.cartesianToCartographic(D,Z)).height=N,H.cartographicToCartesian(t,D),(D=H.cartesianToCartographic(L,Z)).height=N-100,H.cartographicToCartesian(D,L)),W.Cartesian3.subtract(S,k,S),W.Cartesian3.subtract(B,k,B),x=W.Cartesian3.normalize(W.Cartesian3.cross(B,S,x),x),A=!1),W.Cartesian3.equalsEpsilon(S,k,q.CesiumMath.EPSILON10)&&(A=!0)),(r.tangent||r.bitangent)&&(I=y.geodeticSurfaceNormal(k,I),r.tangent&&(T=W.Cartesian3.normalize(W.Cartesian3.cross(I,x,T),T)))):(x=y.geodeticSurfaceNormal(k,x),(r.tangent||r.bitangent)&&(g&&(oe=W.Cartesian3.fromArray(h,w,oe),ae=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,oe,ae),ae=W.Cartesian3.normalize(U.Matrix3.multiplyByVector(G,ae,ae),ae),r.bitangent&&(ie=W.Cartesian3.normalize(W.Cartesian3.cross(oe,ae,ie),ie))),T=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,x,T),T=W.Cartesian3.normalize(U.Matrix3.multiplyByVector(G,T,T),T),r.bitangent&&(I=W.Cartesian3.normalize(W.Cartesian3.cross(x,T,I),I)))),r.normal&&(e.wall?(h[w+O]=x.x,h[R+O]=x.y,h[M+O]=x.z):u&&(h[w+O]=-x.x,h[R+O]=-x.y,h[M+O]=-x.z),(l&&!g||s)&&(h[w]=x.x,h[R]=x.y,h[M]=x.z)),a&&(s&&(x=y.geodeticSurfaceNormal(k,x)),P[w+O]=-x.x,P[R+O]=-x.y,P[M+O]=-x.z),r.tangent&&(e.wall?(_[w+O]=T.x,_[R+O]=T.y,_[M+O]=T.z):u&&(_[w+O]=-T.x,_[R+O]=-T.y,_[M+O]=-T.z),l&&(g?(_[w]=ae.x,_[R]=ae.y,_[M]=ae.z):(_[w]=T.x,_[R]=T.y,_[M]=T.z))),r.bitangent&&(u&&(v[w+O]=I.x,v[R+O]=I.y,v[M+O]=I.z),l&&(g?(v[w]=ie.x,v[R]=ie.y,v[M]=ie.z):(v[w]=I.x,v[R]=I.y,v[M]=I.z))),w+=3)}r.st&&(o.attributes.st=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),r.normal&&(o.attributes.normal=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(o.attributes.tangent=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_})),r.bitangent&&(o.attributes.bitangent=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})),a&&(o.attributes.extrudeDirection=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:P}))}return e.extrude&&z.defined(e.offsetAttribute)&&(m=i.length/3,b=new Uint8Array(m),e.offsetAttribute===Y.GeometryOffsetAttribute.TOP?l&&u||s?b=Y.arrayFill(b,1,0,m/2):l&&(b=Y.arrayFill(b,1)):(m=e.offsetAttribute===Y.GeometryOffsetAttribute.NONE?0:1,b=Y.arrayFill(b,m)),o.attributes.applyOffset=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})),o}var m=new W.Cartographic,g=new W.Cartographic,d={westOverIDL:0,eastOverIDL:0},h=new y.EllipsoidGeodesic;function b(e,t,r,o,a){if(a=z.defaultValue(a,new W.Rectangle),!z.defined(e)||e.length<3)return a.west=0,a.north=0,a.south=0,a.east=0,a;if(r===c.ArcType.RHUMB)return W.Rectangle.fromCartesianArray(e,t,a);h.ellipsoid.equals(t)||(h=new y.EllipsoidGeodesic(void 0,void 0,t)),a.west=Number.POSITIVE_INFINITY,a.east=Number.NEGATIVE_INFINITY,a.south=Number.POSITIVE_INFINITY,a.north=Number.NEGATIVE_INFINITY,d.westOverIDL=Number.POSITIVE_INFINITY,d.eastOverIDL=Number.NEGATIVE_INFINITY;for(var i,n=1/q.CesiumMath.chordLength(o,t.maximumRadius),s=e.length,l=t.cartesianToCartographic(e[0],g),u=m,p=1;p<s;p++)i=u,u=l,l=t.cartesianToCartographic(e[p],i),h.setEndPoints(u,l),v(h,n,a,d);return i=u,u=l,l=t.cartesianToCartographic(e[0],i),h.setEndPoints(u,l),v(h,n,a,d),a.east-a.west>d.eastOverIDL-d.westOverIDL&&(a.west=d.westOverIDL,a.east=d.eastOverIDL,a.east>q.CesiumMath.PI&&(a.east=a.east-q.CesiumMath.TWO_PI),a.west>q.CesiumMath.PI&&(a.west=a.west-q.CesiumMath.TWO_PI)),a}var _=new W.Cartographic;function v(e,t,r,o){for(var a=e.surfaceDistance,i=Math.ceil(a*t),n=0<i?a/(i-1):Number.POSITIVE_INFINITY,s=0,l=0;l<i;l++){var u=e.interpolateUsingSurfaceDistance(s,_);s+=n;var p=u.longitude,u=u.latitude;r.west=Math.min(r.west,p),r.east=Math.max(r.east,p),r.south=Math.min(r.south,u),r.north=Math.max(r.north,u);p=0<=p?p:p+q.CesiumMath.TWO_PI;o.westOverIDL=Math.min(o.westOverIDL,p),o.eastOverIDL=Math.max(o.eastOverIDL,p)}}var N=[];function P(e){var t,r=e.polygonHierarchy,o=z.defaultValue(e.vertexFormat,f.VertexFormat.DEFAULT),a=z.defaultValue(e.ellipsoid,W.Ellipsoid.WGS84),i=z.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),n=z.defaultValue(e.stRotation,0),s=z.defaultValue(e.perPositionHeight,!1),l=s&&z.defined(e.extrudedHeight),u=z.defaultValue(e.height,0),p=z.defaultValue(e.extrudedHeight,u);l||(t=Math.max(u,p),p=Math.min(u,p),u=t),this._vertexFormat=f.VertexFormat.clone(o),this._ellipsoid=W.Ellipsoid.clone(a),this._granularity=i,this._stRotation=n,this._height=u,this._extrudedHeight=p,this._closeTop=z.defaultValue(e.closeTop,!0),this._closeBottom=z.defaultValue(e.closeBottom,!0),this._polygonHierarchy=r,this._perPositionHeight=s,this._perPositionHeightExtrude=l,this._shadowVolume=z.defaultValue(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=z.defaultValue(e.arcType,c.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this.packedLength=V.PolygonGeometryLibrary.computeHierarchyPackedLength(r)+W.Ellipsoid.packedLength+f.VertexFormat.packedLength+12}P.fromPositions=function(e){return new P({polygonHierarchy:{positions:(e=z.defaultValue(e,z.defaultValue.EMPTY_OBJECT)).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})},P.pack=function(e,t,r){return r=z.defaultValue(r,0),r=V.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,r),W.Ellipsoid.pack(e._ellipsoid,t,r),r+=W.Ellipsoid.packedLength,f.VertexFormat.pack(e._vertexFormat,t,r),r+=f.VertexFormat.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r++]=e._shadowVolume?1:0,t[r++]=z.defaultValue(e._offsetAttribute,-1),t[r++]=e._arcType,t[r]=e.packedLength,t};var C=W.Ellipsoid.clone(W.Ellipsoid.UNIT_SPHERE),w=new f.VertexFormat,x={polygonHierarchy:{}};return P.unpack=function(e,t,r){t=z.defaultValue(t,0);var o=V.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=o.startingIndex,delete o.startingIndex;var a=W.Ellipsoid.unpack(e,t,C);t+=W.Ellipsoid.packedLength;var i=f.VertexFormat.unpack(e,t,w);t+=f.VertexFormat.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t++],p=1===e[t++],c=1===e[t++],y=1===e[t++],m=1===e[t++],g=1===e[t++],d=e[t++],h=e[t++],t=e[t];return(r=!z.defined(r)?new P(x):r)._polygonHierarchy=o,r._ellipsoid=W.Ellipsoid.clone(a,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(i,r._vertexFormat),r._height=n,r._extrudedHeight=s,r._granularity=l,r._stRotation=u,r._perPositionHeightExtrude=p,r._perPositionHeight=c,r._closeTop=y,r._closeBottom=m,r._shadowVolume=g,r._offsetAttribute=-1===d?void 0:d,r._arcType=h,r.packedLength=t,r},P.computeRectangle=function(e,t){var r=z.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),o=z.defaultValue(e.arcType,c.ArcType.GEODESIC),a=e.polygonHierarchy,e=z.defaultValue(e.ellipsoid,W.Ellipsoid.WGS84);return b(a.positions,e,o,r,t)},P.createGeometry=function(e){var t=e._vertexFormat,r=e._ellipsoid,o=e._granularity,a=e._stRotation,i=e._polygonHierarchy,n=e._perPositionHeight,s=e._closeTop,l=e._closeBottom,u=e._arcType;if(!((g=i.positions).length<3)){var p=A.EllipsoidTangentPlane.fromPoints(g,r),i=V.PolygonGeometryLibrary.polygonsFromHierarchy(i,p.projectPointsOntoPlane.bind(p),!n,r),c=i.hierarchy,y=i.polygons;if(0!==c.length){var m,g=c[0].outerRing,g=V.PolygonGeometryLibrary.computeBoundingRectangle(p.plane.normal,p.projectPointOntoPlane.bind(p),g,a,D),d=[],h=e._height,f=e._extrudedHeight,b={perPositionHeight:n,vertexFormat:t,geometry:void 0,tangentPlane:p,boundingRectangle:g,ellipsoid:r,stRotation:a,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u};if(e._perPositionHeightExtrude||!q.CesiumMath.equalsEpsilon(h,f,0,q.CesiumMath.EPSILON2))for(b.extrude=!0,b.top=s,b.bottom=l,b.shadowVolume=e._shadowVolume,b.offsetAttribute=e._offsetAttribute,m=0;m<y.length;m++){var _,v=function(e,t,r,o,a,i,n,s,l){var u={walls:[]};if(i||n){var p=V.PolygonGeometryLibrary.createGeometryFromPositions(e,t,r,a,s,l),t=p.attributes.position.values,c=p.indices;if(i&&n){var y,i=t.concat(t),m=i.length/3;(y=O.IndexDatatype.createTypedArray(m,2*c.length)).set(c);for(var g=c.length,d=m/2,h=0;h<g;h+=3){var f=y[h]+d,b=y[h+1]+d,_=y[h+2]+d;y[h+g]=_,y[h+1+g]=b,y[h+2+g]=f}p.attributes.position.values=i,a&&s.normal&&(s=p.attributes.normal.values,p.attributes.normal.values=new Float32Array(i.length),p.attributes.normal.values.set(s)),p.indices=y}else if(n){for(m=t.length/3,y=O.IndexDatatype.createTypedArray(m,c.length),h=0;h<c.length;h+=3)y[h]=c[h+2],y[h+1]=c[h+1],y[h+2]=c[h];p.indices=y}u.topAndBottom=new E.GeometryInstance({geometry:p})}var p=o.outerRing,v=A.EllipsoidTangentPlane.fromPoints(p,e).projectPointsOntoPlane(p,N);F.PolygonPipeline.computeWindingOrder2D(v)===F.WindingOrder.CLOCKWISE&&(p=p.slice().reverse());var P=V.PolygonGeometryLibrary.computeWallGeometry(p,e,r,a,l);u.walls.push(new E.GeometryInstance({geometry:P}));var C=o.holes;for(h=0;h<C.length;h++){var w=C[h],v=A.EllipsoidTangentPlane.fromPoints(w,e).projectPointsOntoPlane(w,N);F.PolygonPipeline.computeWindingOrder2D(v)===F.WindingOrder.COUNTER_CLOCKWISE&&(w=w.slice().reverse()),P=V.PolygonGeometryLibrary.computeWallGeometry(w,e,r,a,l),u.walls.push(new E.GeometryInstance({geometry:P}))}return u}(r,y[m],o,c[m],n,s,l,t,u);s&&l?(_=v.topAndBottom,b.geometry=V.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(_.geometry,h,f,r,n)):s?((_=v.topAndBottom).geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(_.geometry.attributes.position.values,h,r,!n),b.geometry=_.geometry):l&&((_=v.topAndBottom).geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(_.geometry.attributes.position.values,f,r,!0),b.geometry=_.geometry),(s||l)&&(b.wall=!1,_.geometry=L(b),d.push(_));var P=v.walls;b.wall=!0;for(var C=0;C<P.length;C++){var w=P[C];b.geometry=V.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(w.geometry,h,f,r,n),w.geometry=L(b),d.push(w)}}else for(m=0;m<y.length;m++){var x,T,I=new E.GeometryInstance({geometry:V.PolygonGeometryLibrary.createGeometryFromPositions(r,y[m],o,n,t,u)});I.geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(I.geometry.attributes.position.values,h,r,!n),b.geometry=I.geometry,I.geometry=L(b),z.defined(e._offsetAttribute)&&(T=I.geometry.attributes.position.values.length,x=new Uint8Array(T/3),T=e._offsetAttribute===Y.GeometryOffsetAttribute.NONE?0:1,Y.arrayFill(x,T),I.geometry.attributes.applyOffset=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})),d.push(I)}p=G.GeometryPipeline.combineInstances(d)[0];p.attributes.position.values=new Float64Array(p.attributes.position.values),p.indices=O.IndexDatatype.createTypedArray(p.attributes.position.values.length/3,p.indices);g=p.attributes,a=U.BoundingSphere.fromVertices(g.position.values);return t.position||delete g.position,new Q.Geometry({attributes:g,indices:p.indices,primitiveType:p.primitiveType,boundingSphere:a,offsetAttribute:e._offsetAttribute})}}},P.createShadowVolume=function(e,t,r){var o=e._granularity,a=e._ellipsoid,t=t(o,a),r=r(o,a);return new P({polygonHierarchy:e._polygonHierarchy,ellipsoid:a,stRotation:e._stRotation,granularity:o,perPositionHeight:!1,extrudedHeight:t,height:r,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(P.prototype,{rectangle:{get:function(){var e;return z.defined(this._rectangle)||(e=this._polygonHierarchy.positions,this._rectangle=b(e,this._ellipsoid,this._arcType,this._granularity)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return z.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];var r=e._ellipsoid,o=e._polygonHierarchy.positions,e=e.rectangle;return Q.Geometry._textureCoordinateRotationPoints(o,t,r,e)}(this)),this._textureCoordinateRotationPoints}}}),function(e,t){return(e=z.defined(t)?P.unpack(e,t):e)._ellipsoid=W.Ellipsoid.clone(e._ellipsoid),P.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./ArcType-2b58731c","./GeometryOffsetAttribute-718fa138","./BoundingRectangle-07202124","./Transforms-79117a7b","./Check-24483042","./ComponentDatatype-1a100acd","./EllipsoidGeodesic-cc216670","./EllipsoidTangentPlane-325a8e68","./GeometryAttribute-374f805d","./GeometryInstance-6aa9010a","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonGeometryLibrary-2a7648d9","./PolygonPipeline-97a7160d","./VertexFormat-81ec7207","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./IntersectionTests-5394f658","./Plane-13ae4b1b","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./arrayRemoveDuplicates-3fea1e5f","./EllipsoidRhumbLine-2b7999f3","./GeometryAttributes-caa08d6c"],function(z,W,c,Y,e,U,t,j,y,A,Q,E,G,O,q,V,F,f,r,a,o,i,n,s,l,u,p){"use strict";var K=new W.Cartographic,Z=new W.Cartographic;var D=new e.BoundingRectangle,J=new W.Cartesian3,X=new W.Cartesian3,$=new W.Cartesian3,ee=new W.Cartesian3,te=new W.Cartesian3,re=new W.Cartesian3,ae=new W.Cartesian3,oe=new W.Cartesian3,ie=new W.Cartesian3,ne=new W.Cartesian2,se=new W.Cartesian2,le=new W.Cartesian3,ue=new U.Quaternion,pe=new U.Matrix3,ce=new U.Matrix3;function L(e){var t,r=e.vertexFormat,a=e.geometry,o=e.shadowVolume,i=a.attributes.position.values,n=i.length,s=e.wall,l=e.top||s,u=e.bottom||s;if(r.st||r.normal||r.tangent||r.bitangent||o){var p=e.boundingRectangle,c=e.tangentPlane,y=e.ellipsoid,m=e.stRotation,g=e.perPositionHeight,d=ne;d.x=p.x,d.y=p.y;var h,f=r.st?new Float32Array(n/3*2):void 0;r.normal&&(h=g&&l&&!s?a.attributes.normal.values:new Float32Array(n));var b,_=r.tangent?new Float32Array(n):void 0,v=r.bitangent?new Float32Array(n):void 0,P=o?new Float32Array(n):void 0,C=0,w=0,x=X,T=$,I=ee,A=!0,E=pe,G=ce;G=0!==m?(b=U.Quaternion.fromAxisAngle(c._plane.normal,m,ue),E=U.Matrix3.fromQuaternion(b,E),b=U.Quaternion.fromAxisAngle(c._plane.normal,-m,ue),U.Matrix3.fromQuaternion(b,G)):(E=U.Matrix3.clone(U.Matrix3.IDENTITY,E),U.Matrix3.clone(U.Matrix3.IDENTITY,G));var O=0,V=0;l&&u&&(O=n/2,V=n/3,n/=2);for(var F=0;F<n;F+=3){var D,L,N,H,R,M,S,B,k=W.Cartesian3.fromArray(i,F,le);r.st&&(D=U.Matrix3.multiplyByVector(E,k,J),D=y.scaleToGeodeticSurface(D,D),L=c.projectPointOntoPlane(D,se),W.Cartesian2.subtract(L,d,L),N=q.CesiumMath.clamp(L.x/p.width,0,1),H=q.CesiumMath.clamp(L.y/p.height,0,1),u&&(f[C+V]=N,f[C+1+V]=H),l&&(f[C]=N,f[C+1]=H),C+=2),(r.normal||r.tangent||r.bitangent||o)&&(R=w+1,M=w+2,s?(F+3<n&&(S=W.Cartesian3.fromArray(i,F+3,te),A&&(B=W.Cartesian3.fromArray(i,F+n,re),g&&(t=k,D=S,L=B,N=void 0,N=(H=y).cartesianToCartographic(t,K).height,(t=H.cartesianToCartographic(D,Z)).height=N,H.cartographicToCartesian(t,D),(D=H.cartesianToCartographic(L,Z)).height=N-100,H.cartographicToCartesian(D,L)),W.Cartesian3.subtract(S,k,S),W.Cartesian3.subtract(B,k,B),x=W.Cartesian3.normalize(W.Cartesian3.cross(B,S,x),x),A=!1),W.Cartesian3.equalsEpsilon(S,k,q.CesiumMath.EPSILON10)&&(A=!0)),(r.tangent||r.bitangent)&&(I=y.geodeticSurfaceNormal(k,I),r.tangent&&(T=W.Cartesian3.normalize(W.Cartesian3.cross(I,x,T),T)))):(x=y.geodeticSurfaceNormal(k,x),(r.tangent||r.bitangent)&&(g&&(ae=W.Cartesian3.fromArray(h,w,ae),oe=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,ae,oe),oe=W.Cartesian3.normalize(U.Matrix3.multiplyByVector(G,oe,oe),oe),r.bitangent&&(ie=W.Cartesian3.normalize(W.Cartesian3.cross(ae,oe,ie),ie))),T=W.Cartesian3.cross(W.Cartesian3.UNIT_Z,x,T),T=W.Cartesian3.normalize(U.Matrix3.multiplyByVector(G,T,T),T),r.bitangent&&(I=W.Cartesian3.normalize(W.Cartesian3.cross(x,T,I),I)))),r.normal&&(e.wall?(h[w+O]=x.x,h[R+O]=x.y,h[M+O]=x.z):u&&(h[w+O]=-x.x,h[R+O]=-x.y,h[M+O]=-x.z),(l&&!g||s)&&(h[w]=x.x,h[R]=x.y,h[M]=x.z)),o&&(s&&(x=y.geodeticSurfaceNormal(k,x)),P[w+O]=-x.x,P[R+O]=-x.y,P[M+O]=-x.z),r.tangent&&(e.wall?(_[w+O]=T.x,_[R+O]=T.y,_[M+O]=T.z):u&&(_[w+O]=-T.x,_[R+O]=-T.y,_[M+O]=-T.z),l&&(g?(_[w]=oe.x,_[R]=oe.y,_[M]=oe.z):(_[w]=T.x,_[R]=T.y,_[M]=T.z))),r.bitangent&&(u&&(v[w+O]=I.x,v[R+O]=I.y,v[M+O]=I.z),l&&(g?(v[w]=ie.x,v[R]=ie.y,v[M]=ie.z):(v[w]=I.x,v[R]=I.y,v[M]=I.z))),w+=3)}r.st&&(a.attributes.st=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f})),r.normal&&(a.attributes.normal=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(a.attributes.tangent=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_})),r.bitangent&&(a.attributes.bitangent=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})),o&&(a.attributes.extrudeDirection=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:P}))}return e.extrude&&z.defined(e.offsetAttribute)&&(m=i.length/3,b=new Uint8Array(m),e.offsetAttribute===Y.GeometryOffsetAttribute.TOP?l&&u||s?b=Y.arrayFill(b,1,0,m/2):l&&(b=Y.arrayFill(b,1)):(m=e.offsetAttribute===Y.GeometryOffsetAttribute.NONE?0:1,b=Y.arrayFill(b,m)),a.attributes.applyOffset=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})),a}var m=new W.Cartographic,g=new W.Cartographic,d={westOverIDL:0,eastOverIDL:0},h=new y.EllipsoidGeodesic;function b(e,t,r,a,o){if(o=z.defaultValue(o,new W.Rectangle),!z.defined(e)||e.length<3)return o.west=0,o.north=0,o.south=0,o.east=0,o;if(r===c.ArcType.RHUMB)return W.Rectangle.fromCartesianArray(e,t,o);h.ellipsoid.equals(t)||(h=new y.EllipsoidGeodesic(void 0,void 0,t)),o.west=Number.POSITIVE_INFINITY,o.east=Number.NEGATIVE_INFINITY,o.south=Number.POSITIVE_INFINITY,o.north=Number.NEGATIVE_INFINITY,d.westOverIDL=Number.POSITIVE_INFINITY,d.eastOverIDL=Number.NEGATIVE_INFINITY;for(var i,n=1/q.CesiumMath.chordLength(a,t.maximumRadius),s=e.length,l=t.cartesianToCartographic(e[0],g),u=m,p=1;p<s;p++)i=u,u=l,l=t.cartesianToCartographic(e[p],i),h.setEndPoints(u,l),v(h,n,o,d);return i=u,u=l,l=t.cartesianToCartographic(e[0],i),h.setEndPoints(u,l),v(h,n,o,d),o.east-o.west>d.eastOverIDL-d.westOverIDL&&(o.west=d.westOverIDL,o.east=d.eastOverIDL,o.east>q.CesiumMath.PI&&(o.east=o.east-q.CesiumMath.TWO_PI),o.west>q.CesiumMath.PI&&(o.west=o.west-q.CesiumMath.TWO_PI)),o}var _=new W.Cartographic;function v(e,t,r,a){for(var o=e.surfaceDistance,i=Math.ceil(o*t),n=0<i?o/(i-1):Number.POSITIVE_INFINITY,s=0,l=0;l<i;l++){var u=e.interpolateUsingSurfaceDistance(s,_);s+=n;var p=u.longitude,u=u.latitude;r.west=Math.min(r.west,p),r.east=Math.max(r.east,p),r.south=Math.min(r.south,u),r.north=Math.max(r.north,u);p=0<=p?p:p+q.CesiumMath.TWO_PI;a.westOverIDL=Math.min(a.westOverIDL,p),a.eastOverIDL=Math.max(a.eastOverIDL,p)}}var N=[];function P(e){var t,r=e.polygonHierarchy,a=z.defaultValue(e.vertexFormat,f.VertexFormat.DEFAULT),o=z.defaultValue(e.ellipsoid,W.Ellipsoid.WGS84),i=z.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),n=z.defaultValue(e.stRotation,0),s=z.defaultValue(e.perPositionHeight,!1),l=s&&z.defined(e.extrudedHeight),u=z.defaultValue(e.height,0),p=z.defaultValue(e.extrudedHeight,u);l||(t=Math.max(u,p),p=Math.min(u,p),u=t),this._vertexFormat=f.VertexFormat.clone(a),this._ellipsoid=W.Ellipsoid.clone(o),this._granularity=i,this._stRotation=n,this._height=u,this._extrudedHeight=p,this._closeTop=z.defaultValue(e.closeTop,!0),this._closeBottom=z.defaultValue(e.closeBottom,!0),this._polygonHierarchy=r,this._perPositionHeight=s,this._perPositionHeightExtrude=l,this._shadowVolume=z.defaultValue(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=z.defaultValue(e.arcType,c.ArcType.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this.packedLength=V.PolygonGeometryLibrary.computeHierarchyPackedLength(r)+W.Ellipsoid.packedLength+f.VertexFormat.packedLength+12}P.fromPositions=function(e){return new P({polygonHierarchy:{positions:(e=z.defaultValue(e,z.defaultValue.EMPTY_OBJECT)).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})},P.pack=function(e,t,r){return r=z.defaultValue(r,0),r=V.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,r),W.Ellipsoid.pack(e._ellipsoid,t,r),r+=W.Ellipsoid.packedLength,f.VertexFormat.pack(e._vertexFormat,t,r),r+=f.VertexFormat.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._perPositionHeightExtrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r++]=e._shadowVolume?1:0,t[r++]=z.defaultValue(e._offsetAttribute,-1),t[r++]=e._arcType,t[r]=e.packedLength,t};var C=W.Ellipsoid.clone(W.Ellipsoid.UNIT_SPHERE),w=new f.VertexFormat,x={polygonHierarchy:{}};return P.unpack=function(e,t,r){t=z.defaultValue(t,0);var a=V.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=a.startingIndex,delete a.startingIndex;var o=W.Ellipsoid.unpack(e,t,C);t+=W.Ellipsoid.packedLength;var i=f.VertexFormat.unpack(e,t,w);t+=f.VertexFormat.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t++],p=1===e[t++],c=1===e[t++],y=1===e[t++],m=1===e[t++],g=1===e[t++],d=e[t++],h=e[t++],t=e[t];return(r=!z.defined(r)?new P(x):r)._polygonHierarchy=a,r._ellipsoid=W.Ellipsoid.clone(o,r._ellipsoid),r._vertexFormat=f.VertexFormat.clone(i,r._vertexFormat),r._height=n,r._extrudedHeight=s,r._granularity=l,r._stRotation=u,r._perPositionHeightExtrude=p,r._perPositionHeight=c,r._closeTop=y,r._closeBottom=m,r._shadowVolume=g,r._offsetAttribute=-1===d?void 0:d,r._arcType=h,r.packedLength=t,r},P.computeRectangle=function(e,t){var r=z.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),a=z.defaultValue(e.arcType,c.ArcType.GEODESIC),o=e.polygonHierarchy,e=z.defaultValue(e.ellipsoid,W.Ellipsoid.WGS84);return b(o.positions,e,a,r,t)},P.createGeometry=function(e){var t=e._vertexFormat,r=e._ellipsoid,a=e._granularity,o=e._stRotation,i=e._polygonHierarchy,n=e._perPositionHeight,s=e._closeTop,l=e._closeBottom,u=e._arcType;if(!((g=i.positions).length<3)){var p=A.EllipsoidTangentPlane.fromPoints(g,r),i=V.PolygonGeometryLibrary.polygonsFromHierarchy(i,p.projectPointsOntoPlane.bind(p),!n,r),c=i.hierarchy,y=i.polygons;if(0!==c.length){var m,g=c[0].outerRing,g=V.PolygonGeometryLibrary.computeBoundingRectangle(p.plane.normal,p.projectPointOntoPlane.bind(p),g,o,D),d=[],h=e._height,f=e._extrudedHeight,b={perPositionHeight:n,vertexFormat:t,geometry:void 0,tangentPlane:p,boundingRectangle:g,ellipsoid:r,stRotation:o,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u};if(e._perPositionHeightExtrude||!q.CesiumMath.equalsEpsilon(h,f,0,q.CesiumMath.EPSILON2))for(b.extrude=!0,b.top=s,b.bottom=l,b.shadowVolume=e._shadowVolume,b.offsetAttribute=e._offsetAttribute,m=0;m<y.length;m++){var _,v=function(e,t,r,a,o,i,n,s,l){var u={walls:[]};if(i||n){var p=V.PolygonGeometryLibrary.createGeometryFromPositions(e,t,r,o,s,l),t=p.attributes.position.values,c=p.indices;if(i&&n){var y,i=t.concat(t),m=i.length/3;(y=O.IndexDatatype.createTypedArray(m,2*c.length)).set(c);for(var g=c.length,d=m/2,h=0;h<g;h+=3){var f=y[h]+d,b=y[h+1]+d,_=y[h+2]+d;y[h+g]=_,y[h+1+g]=b,y[h+2+g]=f}p.attributes.position.values=i,o&&s.normal&&(s=p.attributes.normal.values,p.attributes.normal.values=new Float32Array(i.length),p.attributes.normal.values.set(s)),p.indices=y}else if(n){for(m=t.length/3,y=O.IndexDatatype.createTypedArray(m,c.length),h=0;h<c.length;h+=3)y[h]=c[h+2],y[h+1]=c[h+1],y[h+2]=c[h];p.indices=y}u.topAndBottom=new E.GeometryInstance({geometry:p})}var p=a.outerRing,v=A.EllipsoidTangentPlane.fromPoints(p,e).projectPointsOntoPlane(p,N);F.PolygonPipeline.computeWindingOrder2D(v)===F.WindingOrder.CLOCKWISE&&(p=p.slice().reverse());var P=V.PolygonGeometryLibrary.computeWallGeometry(p,e,r,o,l);u.walls.push(new E.GeometryInstance({geometry:P}));var C=a.holes;for(h=0;h<C.length;h++){var w=C[h],v=A.EllipsoidTangentPlane.fromPoints(w,e).projectPointsOntoPlane(w,N);F.PolygonPipeline.computeWindingOrder2D(v)===F.WindingOrder.COUNTER_CLOCKWISE&&(w=w.slice().reverse()),P=V.PolygonGeometryLibrary.computeWallGeometry(w,e,r,o,l),u.walls.push(new E.GeometryInstance({geometry:P}))}return u}(r,y[m],a,c[m],n,s,l,t,u);s&&l?(_=v.topAndBottom,b.geometry=V.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(_.geometry,h,f,r,n)):s?((_=v.topAndBottom).geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(_.geometry.attributes.position.values,h,r,!n),b.geometry=_.geometry):l&&((_=v.topAndBottom).geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(_.geometry.attributes.position.values,f,r,!0),b.geometry=_.geometry),(s||l)&&(b.wall=!1,_.geometry=L(b),d.push(_));var P=v.walls;b.wall=!0;for(var C=0;C<P.length;C++){var w=P[C];b.geometry=V.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(w.geometry,h,f,r,n),w.geometry=L(b),d.push(w)}}else for(m=0;m<y.length;m++){var x,T,I=new E.GeometryInstance({geometry:V.PolygonGeometryLibrary.createGeometryFromPositions(r,y[m],a,n,t,u)});I.geometry.attributes.position.values=F.PolygonPipeline.scaleToGeodeticHeight(I.geometry.attributes.position.values,h,r,!n),b.geometry=I.geometry,I.geometry=L(b),z.defined(e._offsetAttribute)&&(T=I.geometry.attributes.position.values.length,x=new Uint8Array(T/3),T=e._offsetAttribute===Y.GeometryOffsetAttribute.NONE?0:1,Y.arrayFill(x,T),I.geometry.attributes.applyOffset=new Q.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})),d.push(I)}p=G.GeometryPipeline.combineInstances(d)[0];p.attributes.position.values=new Float64Array(p.attributes.position.values),p.indices=O.IndexDatatype.createTypedArray(p.attributes.position.values.length/3,p.indices);g=p.attributes,o=U.BoundingSphere.fromVertices(g.position.values);return t.position||delete g.position,new Q.Geometry({attributes:g,indices:p.indices,primitiveType:p.primitiveType,boundingSphere:o,offsetAttribute:e._offsetAttribute})}}},P.createShadowVolume=function(e,t,r){var a=e._granularity,o=e._ellipsoid,t=t(a,o),r=r(a,o);return new P({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:a,perPositionHeight:!1,extrudedHeight:t,height:r,vertexFormat:f.VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(P.prototype,{rectangle:{get:function(){var e;return z.defined(this._rectangle)||(e=this._polygonHierarchy.positions,this._rectangle=b(e,this._ellipsoid,this._arcType,this._granularity)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return z.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];var r=e._ellipsoid,a=e._polygonHierarchy.positions,e=e.rectangle;return Q.Geometry._textureCoordinateRotationPoints(a,t,r,e)}(this)),this._textureCoordinateRotationPoints}}}),function(e,t){return(e=z.defined(t)?P.unpack(e,t):e)._ellipsoid=W.Ellipsoid.clone(e._ellipsoid),P.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createPolygonOutlineGeometry.js b/public/Cesium/Workers/createPolygonOutlineGeometry.js index f7d5429..d458315 100644 --- a/public/Cesium/Workers/createPolygonOutlineGeometry.js +++ b/public/Cesium/Workers/createPolygonOutlineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./ArcType-dc1c5aee","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./EllipsoidTangentPlane-9123a53b","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryInstance-d919cab6","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonGeometryLibrary-d175a7f1","./PolygonPipeline-bfd1975b","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./arrayRemoveDuplicates-0f62a181","./EllipsoidRhumbLine-8cb2e5a4"],function(m,d,E,b,P,e,A,_,v,G,L,T,H,C,O,D,t,i,r,o,n,a,l,s){"use strict";var x=[],I=[];function f(e){var t,i=e.polygonHierarchy,r=m.defaultValue(e.ellipsoid,d.Ellipsoid.WGS84),o=m.defaultValue(e.granularity,C.CesiumMath.RADIANS_PER_DEGREE),n=m.defaultValue(e.perPositionHeight,!1),a=n&&m.defined(e.extrudedHeight),l=m.defaultValue(e.arcType,E.ArcType.GEODESIC),s=m.defaultValue(e.height,0),y=m.defaultValue(e.extrudedHeight,s);a||(t=Math.max(s,y),y=Math.min(s,y),s=t),this._ellipsoid=d.Ellipsoid.clone(r),this._granularity=o,this._height=s,this._extrudedHeight=y,this._arcType=l,this._polygonHierarchy=i,this._perPositionHeight=n,this._perPositionHeightExtrude=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=O.PolygonGeometryLibrary.computeHierarchyPackedLength(i)+d.Ellipsoid.packedLength+8}f.pack=function(e,t,i){return i=m.defaultValue(i,0),i=O.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),d.Ellipsoid.pack(e._ellipsoid,t,i),i+=d.Ellipsoid.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=m.defaultValue(e._offsetAttribute,-1),t[i]=e.packedLength,t};var g=d.Ellipsoid.clone(d.Ellipsoid.UNIT_SPHERE),c={polygonHierarchy:{}};return f.unpack=function(e,t,i){t=m.defaultValue(t,0);var r=O.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var o=d.Ellipsoid.unpack(e,t,g);t+=d.Ellipsoid.packedLength;var n=e[t++],a=e[t++],l=e[t++],s=1===e[t++],y=1===e[t++],u=e[t++],p=e[t++],t=e[t];return(i=!m.defined(i)?new f(c):i)._polygonHierarchy=r,i._ellipsoid=d.Ellipsoid.clone(o,i._ellipsoid),i._height=n,i._extrudedHeight=a,i._granularity=l,i._perPositionHeight=y,i._perPositionHeightExtrude=s,i._arcType=u,i._offsetAttribute=-1===p?void 0:p,i.packedLength=t,i},f.fromPositions=function(e){return new f({polygonHierarchy:{positions:(e=m.defaultValue(e,m.defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},f.createGeometry=function(e){var t=e._ellipsoid,i=e._granularity,r=e._polygonHierarchy,o=e._perPositionHeight,n=e._arcType,a=O.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!o,t);if(0!==a.length){var l,s,y,u,p,d,f=[],g=C.CesiumMath.chordLength(i,t.maximumRadius),c=e._height,h=e._extrudedHeight;if(e._perPositionHeightExtrude||!C.CesiumMath.equalsEpsilon(c,h,0,C.CesiumMath.EPSILON2))for(l=0;l<a.length;l++)(u=function(e,t,i,r,o){var n,a=_.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,x);D.PolygonPipeline.computeWindingOrder2D(a)===D.WindingOrder.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l=t.length,s=new Array(l),y=0;if(r)for(n=new Float64Array(2*l*3*2),b=0;b<l;++b){s[b]=y/3;var u=t[b],p=t[(b+1)%l];n[y++]=u.x,n[y++]=u.y,n[y++]=u.z,n[y++]=p.x,n[y++]=p.y,n[y++]=p.z}else{var d,f=0;if(o===E.ArcType.GEODESIC)for(b=0;b<l;b++)f+=O.PolygonGeometryLibrary.subdivideLineCount(t[b],t[(b+1)%l],i);else if(o===E.ArcType.RHUMB)for(b=0;b<l;b++)f+=O.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[b],t[(b+1)%l],i);for(n=new Float64Array(3*f*2),b=0;b<l;++b){s[b]=y/3,o===E.ArcType.GEODESIC?d=O.PolygonGeometryLibrary.subdivideLine(t[b],t[(b+1)%l],i,I):o===E.ArcType.RHUMB&&(d=O.PolygonGeometryLibrary.subdivideRhumbLine(e,t[b],t[(b+1)%l],i,I));for(var g=d.length,c=0;c<g;++c)n[y++]=d[c]}}for(var l=n.length/6,h=s.length,r=2*(2*l+h),m=H.IndexDatatype.createTypedArray(l+h,r),y=0,b=0;b<l;++b)m[y++]=b,m[y++]=(b+1)%l,m[y++]=b+l,m[y++]=(b+1)%l+l;for(b=0;b<h;b++){var P=s[b];m[y++]=P,m[y++]=P+l}return new L.GeometryInstance({geometry:new v.Geometry({attributes:new G.GeometryAttributes({position:new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:v.PrimitiveType.LINES})})}(t,a[l],g,o,n)).geometry=O.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(u.geometry,c,h,t,o),m.defined(e._offsetAttribute)&&(s=u.geometry.attributes.position.values.length/3,y=new Uint8Array(s),y=e._offsetAttribute===b.GeometryOffsetAttribute.TOP?b.arrayFill(y,1,0,s/2):(d=e._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(y,d)),u.geometry.attributes.applyOffset=new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})),f.push(u);else for(l=0;l<a.length;l++)(u=function(e,t,i,r,o){var n,a=_.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,x);D.PolygonPipeline.computeWindingOrder2D(a)===D.WindingOrder.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l=t.length,s=0;if(r)for(n=new Float64Array(2*l*3),h=0;h<l;h++){var y=t[h],u=t[(h+1)%l];n[s++]=y.x,n[s++]=y.y,n[s++]=y.z,n[s++]=u.x,n[s++]=u.y,n[s++]=u.z}else{var p,d=0;if(o===E.ArcType.GEODESIC)for(h=0;h<l;h++)d+=O.PolygonGeometryLibrary.subdivideLineCount(t[h],t[(h+1)%l],i);else if(o===E.ArcType.RHUMB)for(h=0;h<l;h++)d+=O.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[h],t[(h+1)%l],i);for(n=new Float64Array(3*d),h=0;h<l;h++){o===E.ArcType.GEODESIC?p=O.PolygonGeometryLibrary.subdivideLine(t[h],t[(h+1)%l],i,I):o===E.ArcType.RHUMB&&(p=O.PolygonGeometryLibrary.subdivideRhumbLine(e,t[h],t[(h+1)%l],i,I));for(var f=p.length,g=0;g<f;++g)n[s++]=p[g]}}for(var r=2*(l=n.length/3),c=H.IndexDatatype.createTypedArray(l,r),s=0,h=0;h<l-1;h++)c[s++]=h,c[s++]=h+1;return c[s++]=l-1,c[s++]=0,new L.GeometryInstance({geometry:new v.Geometry({attributes:new G.GeometryAttributes({position:new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})}),indices:c,primitiveType:v.PrimitiveType.LINES})})}(t,a[l],g,o,n)).geometry.attributes.position.values=D.PolygonPipeline.scaleToGeodeticHeight(u.geometry.attributes.position.values,c,t,!o),m.defined(e._offsetAttribute)&&(p=u.geometry.attributes.position.values.length,p=new Uint8Array(p/3),d=e._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(p,d),u.geometry.attributes.applyOffset=new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})),f.push(u);r=T.GeometryPipeline.combineInstances(f)[0],i=P.BoundingSphere.fromVertices(r.attributes.position.values);return new v.Geometry({attributes:r.attributes,indices:r.indices,primitiveType:r.primitiveType,boundingSphere:i,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=m.defined(t)?f.unpack(e,t):e)._ellipsoid=d.Ellipsoid.clone(e._ellipsoid),f.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./ArcType-2b58731c","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Check-24483042","./ComponentDatatype-1a100acd","./EllipsoidTangentPlane-325a8e68","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryInstance-6aa9010a","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonGeometryLibrary-2a7648d9","./PolygonPipeline-97a7160d","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./IntersectionTests-5394f658","./Plane-13ae4b1b","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./arrayRemoveDuplicates-3fea1e5f","./EllipsoidRhumbLine-2b7999f3"],function(m,d,E,b,P,e,A,_,v,G,L,T,H,C,O,D,t,i,r,o,n,a,l,s){"use strict";var x=[],I=[];function c(e){var t,i=e.polygonHierarchy,r=m.defaultValue(e.ellipsoid,d.Ellipsoid.WGS84),o=m.defaultValue(e.granularity,C.CesiumMath.RADIANS_PER_DEGREE),n=m.defaultValue(e.perPositionHeight,!1),a=n&&m.defined(e.extrudedHeight),l=m.defaultValue(e.arcType,E.ArcType.GEODESIC),s=m.defaultValue(e.height,0),y=m.defaultValue(e.extrudedHeight,s);a||(t=Math.max(s,y),y=Math.min(s,y),s=t),this._ellipsoid=d.Ellipsoid.clone(r),this._granularity=o,this._height=s,this._extrudedHeight=y,this._arcType=l,this._polygonHierarchy=i,this._perPositionHeight=n,this._perPositionHeightExtrude=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=O.PolygonGeometryLibrary.computeHierarchyPackedLength(i)+d.Ellipsoid.packedLength+8}c.pack=function(e,t,i){return i=m.defaultValue(i,0),i=O.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),d.Ellipsoid.pack(e._ellipsoid,t,i),i+=d.Ellipsoid.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=m.defaultValue(e._offsetAttribute,-1),t[i]=e.packedLength,t};var g=d.Ellipsoid.clone(d.Ellipsoid.UNIT_SPHERE),f={polygonHierarchy:{}};return c.unpack=function(e,t,i){t=m.defaultValue(t,0);var r=O.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var o=d.Ellipsoid.unpack(e,t,g);t+=d.Ellipsoid.packedLength;var n=e[t++],a=e[t++],l=e[t++],s=1===e[t++],y=1===e[t++],u=e[t++],p=e[t++],t=e[t];return(i=!m.defined(i)?new c(f):i)._polygonHierarchy=r,i._ellipsoid=d.Ellipsoid.clone(o,i._ellipsoid),i._height=n,i._extrudedHeight=a,i._granularity=l,i._perPositionHeight=y,i._perPositionHeightExtrude=s,i._arcType=u,i._offsetAttribute=-1===p?void 0:p,i.packedLength=t,i},c.fromPositions=function(e){return new c({polygonHierarchy:{positions:(e=m.defaultValue(e,m.defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},c.createGeometry=function(e){var t=e._ellipsoid,i=e._granularity,r=e._polygonHierarchy,o=e._perPositionHeight,n=e._arcType,a=O.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!o,t);if(0!==a.length){var l,s,y,u,p,d,c=[],g=C.CesiumMath.chordLength(i,t.maximumRadius),f=e._height,h=e._extrudedHeight;if(e._perPositionHeightExtrude||!C.CesiumMath.equalsEpsilon(f,h,0,C.CesiumMath.EPSILON2))for(l=0;l<a.length;l++)(u=function(e,t,i,r,o){var n,a=_.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,x);D.PolygonPipeline.computeWindingOrder2D(a)===D.WindingOrder.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l=t.length,s=new Array(l),y=0;if(r)for(n=new Float64Array(2*l*3*2),b=0;b<l;++b){s[b]=y/3;var u=t[b],p=t[(b+1)%l];n[y++]=u.x,n[y++]=u.y,n[y++]=u.z,n[y++]=p.x,n[y++]=p.y,n[y++]=p.z}else{var d,c=0;if(o===E.ArcType.GEODESIC)for(b=0;b<l;b++)c+=O.PolygonGeometryLibrary.subdivideLineCount(t[b],t[(b+1)%l],i);else if(o===E.ArcType.RHUMB)for(b=0;b<l;b++)c+=O.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[b],t[(b+1)%l],i);for(n=new Float64Array(3*c*2),b=0;b<l;++b){s[b]=y/3,o===E.ArcType.GEODESIC?d=O.PolygonGeometryLibrary.subdivideLine(t[b],t[(b+1)%l],i,I):o===E.ArcType.RHUMB&&(d=O.PolygonGeometryLibrary.subdivideRhumbLine(e,t[b],t[(b+1)%l],i,I));for(var g=d.length,f=0;f<g;++f)n[y++]=d[f]}}for(var l=n.length/6,h=s.length,m=H.IndexDatatype.createTypedArray(l+h,2*(2*l+h)),y=0,b=0;b<l;++b)m[y++]=b,m[y++]=(b+1)%l,m[y++]=b+l,m[y++]=(b+1)%l+l;for(b=0;b<h;b++){var P=s[b];m[y++]=P,m[y++]=P+l}return new L.GeometryInstance({geometry:new v.Geometry({attributes:new G.GeometryAttributes({position:new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})}),indices:m,primitiveType:v.PrimitiveType.LINES})})}(t,a[l],g,o,n)).geometry=O.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(u.geometry,f,h,t,o),m.defined(e._offsetAttribute)&&(s=u.geometry.attributes.position.values.length/3,y=new Uint8Array(s),y=e._offsetAttribute===b.GeometryOffsetAttribute.TOP?b.arrayFill(y,1,0,s/2):(d=e._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(y,d)),u.geometry.attributes.applyOffset=new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})),c.push(u);else for(l=0;l<a.length;l++)(u=function(e,t,i,r,o){var n,a=_.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,x);D.PolygonPipeline.computeWindingOrder2D(a)===D.WindingOrder.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l=t.length,s=0;if(r)for(n=new Float64Array(2*l*3),h=0;h<l;h++){var y=t[h],u=t[(h+1)%l];n[s++]=y.x,n[s++]=y.y,n[s++]=y.z,n[s++]=u.x,n[s++]=u.y,n[s++]=u.z}else{var p,d=0;if(o===E.ArcType.GEODESIC)for(h=0;h<l;h++)d+=O.PolygonGeometryLibrary.subdivideLineCount(t[h],t[(h+1)%l],i);else if(o===E.ArcType.RHUMB)for(h=0;h<l;h++)d+=O.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[h],t[(h+1)%l],i);for(n=new Float64Array(3*d),h=0;h<l;h++){o===E.ArcType.GEODESIC?p=O.PolygonGeometryLibrary.subdivideLine(t[h],t[(h+1)%l],i,I):o===E.ArcType.RHUMB&&(p=O.PolygonGeometryLibrary.subdivideRhumbLine(e,t[h],t[(h+1)%l],i,I));for(var c=p.length,g=0;g<c;++g)n[s++]=p[g]}}for(var l=n.length/3,f=H.IndexDatatype.createTypedArray(l,2*l),s=0,h=0;h<l-1;h++)f[s++]=h,f[s++]=h+1;return f[s++]=l-1,f[s++]=0,new L.GeometryInstance({geometry:new v.Geometry({attributes:new G.GeometryAttributes({position:new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})}),indices:f,primitiveType:v.PrimitiveType.LINES})})}(t,a[l],g,o,n)).geometry.attributes.position.values=D.PolygonPipeline.scaleToGeodeticHeight(u.geometry.attributes.position.values,f,t,!o),m.defined(e._offsetAttribute)&&(p=u.geometry.attributes.position.values.length,p=new Uint8Array(p/3),d=e._offsetAttribute===b.GeometryOffsetAttribute.NONE?0:1,b.arrayFill(p,d),u.geometry.attributes.applyOffset=new v.GeometryAttribute({componentDatatype:A.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})),c.push(u);r=T.GeometryPipeline.combineInstances(c)[0],i=P.BoundingSphere.fromVertices(r.attributes.position.values);return new v.Geometry({attributes:r.attributes,indices:r.indices,primitiveType:r.primitiveType,boundingSphere:i,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=m.defined(t)?c.unpack(e,t):e)._ellipsoid=d.Ellipsoid.clone(e._ellipsoid),c.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createPolylineGeometry.js b/public/Cesium/Workers/createPolylineGeometry.js index 57eae31..3a12d99 100644 --- a/public/Cesium/Workers/createPolylineGeometry.js +++ b/public/Cesium/Workers/createPolylineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./ArcType-dc1c5aee","./arrayRemoveDuplicates-0f62a181","./Transforms-a73b3b3b","./Color-b0d12252","./ComponentDatatype-9204e9f6","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolylinePipeline-232a4d9a","./VertexFormat-e8cbf5b3","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(Y,q,z,J,j,K,Q,e,X,Z,$,ee,te,y,t,r,a,o,n,i){"use strict";var re=[];function m(e){var t=(e=Y.defaultValue(e,Y.defaultValue.EMPTY_OBJECT)).positions,r=e.colors,a=Y.defaultValue(e.width,1),o=Y.defaultValue(e.colorsPerVertex,!1);this._positions=t,this._colors=r,this._width=a,this._colorsPerVertex=o,this._vertexFormat=y.VertexFormat.clone(Y.defaultValue(e.vertexFormat,y.VertexFormat.DEFAULT)),this._arcType=Y.defaultValue(e.arcType,z.ArcType.GEODESIC),this._granularity=Y.defaultValue(e.granularity,ee.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=q.Ellipsoid.clone(Y.defaultValue(e.ellipsoid,q.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";t=1+t.length*q.Cartesian3.packedLength;t+=Y.defined(r)?1+r.length*K.Color.packedLength:1,this.packedLength=t+q.Ellipsoid.packedLength+y.VertexFormat.packedLength+4}m.pack=function(e,t,r){var a;r=Y.defaultValue(r,0);var o=e._positions,n=o.length;for(t[r++]=n,a=0;a<n;++a,r+=q.Cartesian3.packedLength)q.Cartesian3.pack(o[a],t,r);var i=e._colors,n=Y.defined(i)?i.length:0;for(t[r++]=n,a=0;a<n;++a,r+=K.Color.packedLength)K.Color.pack(i[a],t,r);return q.Ellipsoid.pack(e._ellipsoid,t,r),r+=q.Ellipsoid.packedLength,y.VertexFormat.pack(e._vertexFormat,t,r),r+=y.VertexFormat.packedLength,t[r++]=e._width,t[r++]=e._colorsPerVertex?1:0,t[r++]=e._arcType,t[r]=e._granularity,t};var f=q.Ellipsoid.clone(q.Ellipsoid.UNIT_SPHERE),h=new y.VertexFormat,C={positions:void 0,colors:void 0,ellipsoid:f,vertexFormat:h,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};m.unpack=function(e,t,r){t=Y.defaultValue(t,0);for(var a=e[t++],o=new Array(a),n=0;n<a;++n,t+=q.Cartesian3.packedLength)o[n]=q.Cartesian3.unpack(e,t);var i=0<(a=e[t++])?new Array(a):void 0;for(n=0;n<a;++n,t+=K.Color.packedLength)i[n]=K.Color.unpack(e,t);var l=q.Ellipsoid.unpack(e,t,f);t+=q.Ellipsoid.packedLength;var s=y.VertexFormat.unpack(e,t,h);t+=y.VertexFormat.packedLength;var p=e[t++],d=1===e[t++],c=e[t++],u=e[t];return Y.defined(r)?(r._positions=o,r._colors=i,r._ellipsoid=q.Ellipsoid.clone(l,r._ellipsoid),r._vertexFormat=y.VertexFormat.clone(s,r._vertexFormat),r._width=p,r._colorsPerVertex=d,r._arcType=c,r._granularity=u,r):(C.positions=o,C.colors=i,C.width=p,C.colorsPerVertex=d,C.arcType=c,C.granularity=u,new m(C))};var ae=new q.Cartesian3,oe=new q.Cartesian3,ne=new q.Cartesian3,ie=new q.Cartesian3;return m.createGeometry=function(e){var t=e._width,r=e._vertexFormat,a=e._colors,o=e._colorsPerVertex,n=e._arcType,i=e._granularity,l=e._ellipsoid,s=J.arrayRemoveDuplicates(e._positions,q.Cartesian3.equalsEpsilon);if(!((E=s.length)<2||t<=0)){if(n===z.ArcType.GEODESIC||n===z.ArcType.RHUMB){var p,d=n===z.ArcType.GEODESIC?(p=ee.CesiumMath.chordLength(i,l.maximumRadius),te.PolylinePipeline.numberOfPoints):(p=i,te.PolylinePipeline.numberOfPointsRhumbLine),c=te.PolylinePipeline.extractHeights(s,l);if(Y.defined(a)){for(var u=1,y=0;y<E-1;++y)u+=d(s[y],s[y+1],p);var m=new Array(u),f=0;for(y=0;y<E-1;++y){var h=s[y],C=s[y+1],v=a[y],g=d(h,C,p);if(o&&y<u)for(var b=function(e,t,r){var a=re;a.length=r;var o=e.red,n=e.green,i=e.blue,l=e.alpha,s=t.red,p=t.green,d=t.blue,c=t.alpha;if(K.Color.equals(e,t)){for(h=0;h<r;h++)a[h]=K.Color.clone(e);return a}for(var u=(s-o)/r,y=(p-n)/r,m=(d-i)/r,f=(c-l)/r,h=0;h<r;h++)a[h]=new K.Color(o+h*u,n+h*y,i+h*m,l+h*f);return a}(v,a[y+1],g),_=b.length,A=0;A<_;++A)m[f++]=b[A];else for(A=0;A<g;++A)m[f++]=K.Color.clone(v)}m[f]=K.Color.clone(a[a.length-1]),a=m,re.length=0}s=n===z.ArcType.GEODESIC?te.PolylinePipeline.generateCartesianArc({positions:s,minDistance:p,ellipsoid:l,height:c}):te.PolylinePipeline.generateCartesianRhumbArc({positions:s,granularity:p,ellipsoid:l,height:c})}var E,P,w,T,l=4*(E=s.length)-4,x=new Float64Array(3*l),k=new Float64Array(3*l),D=new Float64Array(3*l),V=new Float32Array(2*l),L=r.st?new Float32Array(2*l):void 0,F=Y.defined(a)?new Uint8Array(4*l):void 0,G=0,O=0,R=0,I=0;for(A=0;A<E;++A){0===A?(P=ae,q.Cartesian3.subtract(s[0],s[1],P),q.Cartesian3.add(s[0],P,P)):P=s[A-1],q.Cartesian3.clone(P,ne),q.Cartesian3.clone(s[A],oe),A===E-1?(P=ae,q.Cartesian3.subtract(s[E-1],s[E-2],P),q.Cartesian3.add(s[E-1],P,P)):P=s[A+1],q.Cartesian3.clone(P,ie),Y.defined(F)&&(w=0===A||o?a[A]:a[A-1],A!==E-1&&(T=a[A]));for(var S=A===E-1?2:4,B=0===A?2:0;B<S;++B){q.Cartesian3.pack(oe,x,G),q.Cartesian3.pack(ne,k,G),q.Cartesian3.pack(ie,D,G),G+=3;var U=B-2<0?-1:1;V[O++]=B%2*2-1,V[O++]=U*t,r.st&&(L[R++]=A/(E-1),L[R++]=Math.max(V[O-2],0)),Y.defined(F)&&(U=B<2?w:T,F[I++]=K.Color.floatToByte(U.red),F[I++]=K.Color.floatToByte(U.green),F[I++]=K.Color.floatToByte(U.blue),F[I++]=K.Color.floatToByte(U.alpha))}}c=new Z.GeometryAttributes;c.position=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:x}),c.prevPosition=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k}),c.nextPosition=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:D}),c.expandAndWidth=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V}),r.st&&(c.st=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:L})),Y.defined(F)&&(c.color=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:F,normalize:!0}));var N=$.IndexDatatype.createTypedArray(l,6*E-6),M=0,H=0,W=E-1;for(A=0;A<W;++A)N[H++]=M,N[H++]=M+2,N[H++]=M+1,N[H++]=M+1,N[H++]=M+2,N[H++]=M+3,M+=4;return new X.Geometry({attributes:c,indices:N,primitiveType:X.PrimitiveType.TRIANGLES,boundingSphere:j.BoundingSphere.fromPoints(s),geometryType:X.GeometryType.POLYLINES})}},function(e,t){return(e=Y.defined(t)?m.unpack(e,t):e)._ellipsoid=q.Ellipsoid.clone(e._ellipsoid),m.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./ArcType-2b58731c","./arrayRemoveDuplicates-3fea1e5f","./Transforms-79117a7b","./Color-98c5f877","./ComponentDatatype-1a100acd","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./PolylinePipeline-3803a6c2","./VertexFormat-81ec7207","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(Y,q,z,J,j,K,Q,e,X,Z,$,ee,te,y,t,r,a,o,n,i){"use strict";var re=[];function m(e){var t=(e=Y.defaultValue(e,Y.defaultValue.EMPTY_OBJECT)).positions,r=e.colors,a=Y.defaultValue(e.width,1),o=Y.defaultValue(e.colorsPerVertex,!1);this._positions=t,this._colors=r,this._width=a,this._colorsPerVertex=o,this._vertexFormat=y.VertexFormat.clone(Y.defaultValue(e.vertexFormat,y.VertexFormat.DEFAULT)),this._arcType=Y.defaultValue(e.arcType,z.ArcType.GEODESIC),this._granularity=Y.defaultValue(e.granularity,ee.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=q.Ellipsoid.clone(Y.defaultValue(e.ellipsoid,q.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";t=1+t.length*q.Cartesian3.packedLength;t+=Y.defined(r)?1+r.length*K.Color.packedLength:1,this.packedLength=t+q.Ellipsoid.packedLength+y.VertexFormat.packedLength+4}m.pack=function(e,t,r){var a;r=Y.defaultValue(r,0);var o=e._positions,n=o.length;for(t[r++]=n,a=0;a<n;++a,r+=q.Cartesian3.packedLength)q.Cartesian3.pack(o[a],t,r);var i=e._colors,n=Y.defined(i)?i.length:0;for(t[r++]=n,a=0;a<n;++a,r+=K.Color.packedLength)K.Color.pack(i[a],t,r);return q.Ellipsoid.pack(e._ellipsoid,t,r),r+=q.Ellipsoid.packedLength,y.VertexFormat.pack(e._vertexFormat,t,r),r+=y.VertexFormat.packedLength,t[r++]=e._width,t[r++]=e._colorsPerVertex?1:0,t[r++]=e._arcType,t[r]=e._granularity,t};var h=q.Ellipsoid.clone(q.Ellipsoid.UNIT_SPHERE),f=new y.VertexFormat,C={positions:void 0,colors:void 0,ellipsoid:h,vertexFormat:f,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};m.unpack=function(e,t,r){t=Y.defaultValue(t,0);for(var a=e[t++],o=new Array(a),n=0;n<a;++n,t+=q.Cartesian3.packedLength)o[n]=q.Cartesian3.unpack(e,t);var i=0<(a=e[t++])?new Array(a):void 0;for(n=0;n<a;++n,t+=K.Color.packedLength)i[n]=K.Color.unpack(e,t);var l=q.Ellipsoid.unpack(e,t,h);t+=q.Ellipsoid.packedLength;var s=y.VertexFormat.unpack(e,t,f);t+=y.VertexFormat.packedLength;var p=e[t++],c=1===e[t++],d=e[t++],u=e[t];return Y.defined(r)?(r._positions=o,r._colors=i,r._ellipsoid=q.Ellipsoid.clone(l,r._ellipsoid),r._vertexFormat=y.VertexFormat.clone(s,r._vertexFormat),r._width=p,r._colorsPerVertex=c,r._arcType=d,r._granularity=u,r):(C.positions=o,C.colors=i,C.width=p,C.colorsPerVertex=c,C.arcType=d,C.granularity=u,new m(C))};var ae=new q.Cartesian3,oe=new q.Cartesian3,ne=new q.Cartesian3,ie=new q.Cartesian3;return m.createGeometry=function(e){var t=e._width,r=e._vertexFormat,a=e._colors,o=e._colorsPerVertex,n=e._arcType,i=e._granularity,l=e._ellipsoid,s=J.arrayRemoveDuplicates(e._positions,q.Cartesian3.equalsEpsilon);if(!((P=s.length)<2||t<=0)){if(n===z.ArcType.GEODESIC||n===z.ArcType.RHUMB){var p,c=n===z.ArcType.GEODESIC?(p=ee.CesiumMath.chordLength(i,l.maximumRadius),te.PolylinePipeline.numberOfPoints):(p=i,te.PolylinePipeline.numberOfPointsRhumbLine),d=te.PolylinePipeline.extractHeights(s,l);if(Y.defined(a)){for(var u=1,y=0;y<P-1;++y)u+=c(s[y],s[y+1],p);var m=new Array(u),h=0;for(y=0;y<P-1;++y){var f=s[y],C=s[y+1],v=a[y],g=c(f,C,p);if(o&&y<u)for(var _=function(e,t,r){var a=re;a.length=r;var o=e.red,n=e.green,i=e.blue,l=e.alpha,s=t.red,p=t.green,c=t.blue,d=t.alpha;if(K.Color.equals(e,t)){for(f=0;f<r;f++)a[f]=K.Color.clone(e);return a}for(var u=(s-o)/r,y=(p-n)/r,m=(c-i)/r,h=(d-l)/r,f=0;f<r;f++)a[f]=new K.Color(o+f*u,n+f*y,i+f*m,l+f*h);return a}(v,a[y+1],g),A=_.length,E=0;E<A;++E)m[h++]=_[E];else for(E=0;E<g;++E)m[h++]=K.Color.clone(v)}m[h]=K.Color.clone(a[a.length-1]),a=m,re.length=0}s=n===z.ArcType.GEODESIC?te.PolylinePipeline.generateCartesianArc({positions:s,minDistance:p,ellipsoid:l,height:d}):te.PolylinePipeline.generateCartesianRhumbArc({positions:s,granularity:p,ellipsoid:l,height:d})}var P,b,w,T,l=4*(P=s.length)-4,x=new Float64Array(3*l),k=new Float64Array(3*l),D=new Float64Array(3*l),V=new Float32Array(2*l),L=r.st?new Float32Array(2*l):void 0,F=Y.defined(a)?new Uint8Array(4*l):void 0,G=0,O=0,R=0,I=0;for(E=0;E<P;++E){0===E?(q.Cartesian3.subtract(s[0],s[1],b=ae),q.Cartesian3.add(s[0],b,b)):b=s[E-1],q.Cartesian3.clone(b,ne),q.Cartesian3.clone(s[E],oe),E===P-1?(q.Cartesian3.subtract(s[P-1],s[P-2],b=ae),q.Cartesian3.add(s[P-1],b,b)):b=s[E+1],q.Cartesian3.clone(b,ie),Y.defined(F)&&(w=0===E||o?a[E]:a[E-1],E!==P-1&&(T=a[E]));for(var S=E===P-1?2:4,B=0===E?2:0;B<S;++B){q.Cartesian3.pack(oe,x,G),q.Cartesian3.pack(ne,k,G),q.Cartesian3.pack(ie,D,G),G+=3;var U=B-2<0?-1:1;V[O++]=B%2*2-1,V[O++]=U*t,r.st&&(L[R++]=E/(P-1),L[R++]=Math.max(V[O-2],0)),Y.defined(F)&&(F[I++]=K.Color.floatToByte((U=B<2?w:T).red),F[I++]=K.Color.floatToByte(U.green),F[I++]=K.Color.floatToByte(U.blue),F[I++]=K.Color.floatToByte(U.alpha))}}d=new Z.GeometryAttributes;d.position=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:x}),d.prevPosition=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k}),d.nextPosition=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:D}),d.expandAndWidth=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V}),r.st&&(d.st=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:L})),Y.defined(F)&&(d.color=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:F,normalize:!0}));var N=$.IndexDatatype.createTypedArray(l,6*P-6),M=0,H=0,W=P-1;for(E=0;E<W;++E)N[H++]=M,N[H++]=M+2,N[H++]=M+1,N[H++]=M+1,N[H++]=M+2,N[H++]=M+3,M+=4;return new X.Geometry({attributes:d,indices:N,primitiveType:X.PrimitiveType.TRIANGLES,boundingSphere:j.BoundingSphere.fromPoints(s),geometryType:X.GeometryType.POLYLINES})}},function(e,t){return(e=Y.defined(t)?m.unpack(e,t):e)._ellipsoid=q.Ellipsoid.clone(e._ellipsoid),m.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createPolylineVolumeGeometry.js b/public/Cesium/Workers/createPolylineVolumeGeometry.js index a8c0a0b..53c1dd8 100644 --- a/public/Cesium/Workers/createPolylineVolumeGeometry.js +++ b/public/Cesium/Workers/createPolylineVolumeGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./arrayRemoveDuplicates-0f62a181","./BoundingRectangle-7ee12c46","./Transforms-a73b3b3b","./ComponentDatatype-9204e9f6","./PolylineVolumeGeometryLibrary-a2a20b2b","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonPipeline-bfd1975b","./VertexFormat-e8cbf5b3","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./PolylinePipeline-232a4d9a","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de"],function(u,c,r,a,G,A,o,e,R,D,I,O,i,S,g,t,n,l,s,p,d,y,m,h,f){"use strict";var b={};function B(e,t){u.defined(b[e])||(b[e]=!0,console.warn(u.defaultValue(t,e)))}function v(e){var t=(e=u.defaultValue(e,u.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=c.Ellipsoid.clone(u.defaultValue(e.ellipsoid,c.Ellipsoid.WGS84)),this._cornerType=u.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._vertexFormat=g.VertexFormat.clone(u.defaultValue(e.vertexFormat,g.VertexFormat.DEFAULT)),this._granularity=u.defaultValue(e.granularity,i.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";t=1+t.length*c.Cartesian3.packedLength;t+=1+n.length*c.Cartesian2.packedLength,this.packedLength=t+c.Ellipsoid.packedLength+g.VertexFormat.packedLength+2}B.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.",B.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",B.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",B.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",v.pack=function(e,t,n){var i;n=u.defaultValue(n,0);var r=e._positions,a=r.length;for(t[n++]=a,i=0;i<a;++i,n+=c.Cartesian3.packedLength)c.Cartesian3.pack(r[i],t,n);var o=e._shape,a=o.length;for(t[n++]=a,i=0;i<a;++i,n+=c.Cartesian2.packedLength)c.Cartesian2.pack(o[i],t,n);return c.Ellipsoid.pack(e._ellipsoid,t,n),n+=c.Ellipsoid.packedLength,g.VertexFormat.pack(e._vertexFormat,t,n),n+=g.VertexFormat.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var E=c.Ellipsoid.clone(c.Ellipsoid.UNIT_SPHERE),P=new g.VertexFormat,_={polylinePositions:void 0,shapePositions:void 0,ellipsoid:E,vertexFormat:P,cornerType:void 0,granularity:void 0};v.unpack=function(e,t,n){t=u.defaultValue(t,0);for(var i=e[t++],r=new Array(i),a=0;a<i;++a,t+=c.Cartesian3.packedLength)r[a]=c.Cartesian3.unpack(e,t);var i=e[t++],o=new Array(i);for(a=0;a<i;++a,t+=c.Cartesian2.packedLength)o[a]=c.Cartesian2.unpack(e,t);var l=c.Ellipsoid.unpack(e,t,E);t+=c.Ellipsoid.packedLength;var s=g.VertexFormat.unpack(e,t,P);t+=g.VertexFormat.packedLength;var p=e[t++],d=e[t];return u.defined(n)?(n._positions=r,n._shape=o,n._ellipsoid=c.Ellipsoid.clone(l,n._ellipsoid),n._vertexFormat=g.VertexFormat.clone(s,n._vertexFormat),n._cornerType=p,n._granularity=d,n):(_.polylinePositions=r,_.shapePositions=o,_.cornerType=p,_.granularity=d,new v(_))};var x=new a.BoundingRectangle;return v.createGeometry=function(e){var t=e._positions,n=r.arrayRemoveDuplicates(t,c.Cartesian3.equalsEpsilon),i=e._shape,i=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i);if(!(n.length<2||i.length<3)){S.PolygonPipeline.computeWindingOrder2D(i)===S.WindingOrder.CLOCKWISE&&i.reverse();t=a.BoundingRectangle.fromPoints(i,x);return function(e,t,n,i){var r=new D.GeometryAttributes;i.position&&(r.position=new R.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));var a,o,l,s,p,d=t.length,u=e.length/3,c=(u-2*d)/(2*d),g=S.PolygonPipeline.triangulate(t),y=(c-1)*d*6+2*g.length,m=O.IndexDatatype.createTypedArray(u,y),h=2*d,f=0;for(C=0;C<c-1;C++){for(a=0;a<d-1;a++)p=(o=2*a+C*d*2)+h,s=(l=o+1)+h,m[f++]=l,m[f++]=o,m[f++]=s,m[f++]=s,m[f++]=o,m[f++]=p;s=(l=(o=2*d-2+C*d*2)+1)+h,p=o+h,m[f++]=l,m[f++]=o,m[f++]=s,m[f++]=s,m[f++]=o,m[f++]=p}if(i.st||i.tangent||i.bitangent){for(var b,v,E=new Float32Array(2*u),P=1/(c-1),_=1/n.height,x=n.height/2,k=0,C=0;C<c;C++){for(b=C*P,v=_*(t[0].y+x),E[k++]=b,E[k++]=v,a=1;a<d;a++)v=_*(t[a].y+x),E[k++]=b,E[k++]=v,E[k++]=b,E[k++]=v;v=_*(t[0].y+x),E[k++]=b,E[k++]=v}for(a=0;a<d;a++)b=0,v=_*(t[a].y+x),E[k++]=b,E[k++]=v;for(a=0;a<d;a++)b=(c-1)*P,v=_*(t[a].y+x),E[k++]=b,E[k++]=v;r.st=new R.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}var V=u-2*d;for(C=0;C<g.length;C+=3){var L=g[C]+V,w=g[C+1]+V,F=g[C+2]+V;m[f++]=L,m[f++]=w,m[f++]=F,m[f++]=F+d,m[f++]=w+d,m[f++]=L+d}var T=new R.Geometry({attributes:r,indices:m,boundingSphere:G.BoundingSphere.fromVertices(e),primitiveType:R.PrimitiveType.TRIANGLES});if(i.normal&&(T=I.GeometryPipeline.computeNormal(T)),i.tangent||i.bitangent){try{T=I.GeometryPipeline.computeTangentAndBitangent(T)}catch(e){B("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(T.attributes.tangent=void 0),i.bitangent||(T.attributes.bitangent=void 0),i.st||(T.attributes.st=void 0)}return T}(o.PolylineVolumeGeometryLibrary.computePositions(n,i,t,e,!0),i,t,e._vertexFormat)}},function(e,t){return(e=u.defined(t)?v.unpack(e,t):e)._ellipsoid=c.Ellipsoid.clone(e._ellipsoid),v.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./arrayRemoveDuplicates-3fea1e5f","./BoundingRectangle-07202124","./Transforms-79117a7b","./ComponentDatatype-1a100acd","./PolylineVolumeGeometryLibrary-4d0ebb44","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonPipeline-97a7160d","./VertexFormat-81ec7207","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-325a8e68","./IntersectionTests-5394f658","./Plane-13ae4b1b","./PolylinePipeline-3803a6c2","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957"],function(c,u,r,a,T,G,o,e,A,R,D,I,i,O,g,t,n,l,s,p,d,y,m,h,f){"use strict";var v={};function S(e,t){c.defined(v[e])||(v[e]=!0,console.warn(c.defaultValue(t,e)))}function b(e){var t=(e=c.defaultValue(e,c.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=u.Ellipsoid.clone(c.defaultValue(e.ellipsoid,u.Ellipsoid.WGS84)),this._cornerType=c.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._vertexFormat=g.VertexFormat.clone(c.defaultValue(e.vertexFormat,g.VertexFormat.DEFAULT)),this._granularity=c.defaultValue(e.granularity,i.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";t=1+t.length*u.Cartesian3.packedLength;t+=1+n.length*u.Cartesian2.packedLength,this.packedLength=t+u.Ellipsoid.packedLength+g.VertexFormat.packedLength+2}S.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.",S.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",S.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",S.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",b.pack=function(e,t,n){var i;n=c.defaultValue(n,0);var r=e._positions,a=r.length;for(t[n++]=a,i=0;i<a;++i,n+=u.Cartesian3.packedLength)u.Cartesian3.pack(r[i],t,n);var o=e._shape,a=o.length;for(t[n++]=a,i=0;i<a;++i,n+=u.Cartesian2.packedLength)u.Cartesian2.pack(o[i],t,n);return u.Ellipsoid.pack(e._ellipsoid,t,n),n+=u.Ellipsoid.packedLength,g.VertexFormat.pack(e._vertexFormat,t,n),n+=g.VertexFormat.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var E=u.Ellipsoid.clone(u.Ellipsoid.UNIT_SPHERE),P=new g.VertexFormat,_={polylinePositions:void 0,shapePositions:void 0,ellipsoid:E,vertexFormat:P,cornerType:void 0,granularity:void 0};b.unpack=function(e,t,n){t=c.defaultValue(t,0);for(var i=e[t++],r=new Array(i),a=0;a<i;++a,t+=u.Cartesian3.packedLength)r[a]=u.Cartesian3.unpack(e,t);var i=e[t++],o=new Array(i);for(a=0;a<i;++a,t+=u.Cartesian2.packedLength)o[a]=u.Cartesian2.unpack(e,t);var l=u.Ellipsoid.unpack(e,t,E);t+=u.Ellipsoid.packedLength;var s=g.VertexFormat.unpack(e,t,P);t+=g.VertexFormat.packedLength;var p=e[t++],d=e[t];return c.defined(n)?(n._positions=r,n._shape=o,n._ellipsoid=u.Ellipsoid.clone(l,n._ellipsoid),n._vertexFormat=g.VertexFormat.clone(s,n._vertexFormat),n._cornerType=p,n._granularity=d,n):(_.polylinePositions=r,_.shapePositions=o,_.cornerType=p,_.granularity=d,new b(_))};var x=new a.BoundingRectangle;return b.createGeometry=function(e){var t=e._positions,n=r.arrayRemoveDuplicates(t,u.Cartesian3.equalsEpsilon),i=e._shape,i=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i);if(!(n.length<2||i.length<3)){O.PolygonPipeline.computeWindingOrder2D(i)===O.WindingOrder.CLOCKWISE&&i.reverse();t=a.BoundingRectangle.fromPoints(i,x);return function(e,t,n,i){var r=new R.GeometryAttributes;i.position&&(r.position=new A.GeometryAttribute({componentDatatype:G.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));var a,o,l,s,p,d=t.length,c=e.length/3,u=(c-2*d)/(2*d),g=O.PolygonPipeline.triangulate(t),y=(u-1)*d*6+2*g.length,m=I.IndexDatatype.createTypedArray(c,y),h=2*d,f=0;for(C=0;C<u-1;C++){for(a=0;a<d-1;a++)p=(o=2*a+C*d*2)+h,s=(l=o+1)+h,m[f++]=l,m[f++]=o,m[f++]=s,m[f++]=s,m[f++]=o,m[f++]=p;s=(l=(o=2*d-2+C*d*2)+1)+h,p=o+h,m[f++]=l,m[f++]=o,m[f++]=s,m[f++]=s,m[f++]=o,m[f++]=p}if(i.st||i.tangent||i.bitangent){for(var v,b,E=new Float32Array(2*c),P=1/(u-1),_=1/n.height,x=n.height/2,k=0,C=0;C<u;C++){for(b=_*(t[0].y+x),E[k++]=v=C*P,E[k++]=b,a=1;a<d;a++)b=_*(t[a].y+x),E[k++]=v,E[k++]=b,E[k++]=v,E[k++]=b;b=_*(t[0].y+x),E[k++]=v,E[k++]=b}for(a=0;a<d;a++)b=_*(t[a].y+x),E[k++]=v=0,E[k++]=b;for(a=0;a<d;a++)b=_*(t[a].y+x),E[k++]=v=(u-1)*P,E[k++]=b;r.st=new A.GeometryAttribute({componentDatatype:G.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}var V=c-2*d;for(C=0;C<g.length;C+=3){var L=g[C]+V,w=g[C+1]+V,F=g[C+2]+V;m[f++]=L,m[f++]=w,m[f++]=F,m[f++]=F+d,m[f++]=w+d,m[f++]=L+d}if(e=new A.Geometry({attributes:r,indices:m,boundingSphere:T.BoundingSphere.fromVertices(e),primitiveType:A.PrimitiveType.TRIANGLES}),i.normal&&(e=D.GeometryPipeline.computeNormal(e)),i.tangent||i.bitangent){try{e=D.GeometryPipeline.computeTangentAndBitangent(e)}catch(e){S("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}(o.PolylineVolumeGeometryLibrary.computePositions(n,i,t,e,!0),i,t,e._vertexFormat)}},function(e,t){return(e=c.defined(t)?b.unpack(e,t):e)._ellipsoid=u.Ellipsoid.clone(e._ellipsoid),b.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createPolylineVolumeOutlineGeometry.js b/public/Cesium/Workers/createPolylineVolumeOutlineGeometry.js index 16a0ffd..9edf01e 100644 --- a/public/Cesium/Workers/createPolylineVolumeOutlineGeometry.js +++ b/public/Cesium/Workers/createPolylineVolumeOutlineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./arrayRemoveDuplicates-0f62a181","./BoundingRectangle-7ee12c46","./Transforms-a73b3b3b","./ComponentDatatype-9204e9f6","./PolylineVolumeGeometryLibrary-a2a20b2b","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonPipeline-bfd1975b","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./PolylinePipeline-232a4d9a","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4"],function(d,u,t,r,c,y,o,e,h,f,g,a,l,i,n,s,p,m,b,E,v){"use strict";function P(e){var i=(e=d.defaultValue(e,d.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=i,this._shape=n,this._ellipsoid=u.Ellipsoid.clone(d.defaultValue(e.ellipsoid,u.Ellipsoid.WGS84)),this._cornerType=d.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._granularity=d.defaultValue(e.granularity,a.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";i=1+i.length*u.Cartesian3.packedLength;i+=1+n.length*u.Cartesian2.packedLength,this.packedLength=i+u.Ellipsoid.packedLength+2}P.pack=function(e,i,n){var a;n=d.defaultValue(n,0);var t=e._positions,r=t.length;for(i[n++]=r,a=0;a<r;++a,n+=u.Cartesian3.packedLength)u.Cartesian3.pack(t[a],i,n);var o=e._shape,r=o.length;for(i[n++]=r,a=0;a<r;++a,n+=u.Cartesian2.packedLength)u.Cartesian2.pack(o[a],i,n);return u.Ellipsoid.pack(e._ellipsoid,i,n),n+=u.Ellipsoid.packedLength,i[n++]=e._cornerType,i[n]=e._granularity,i};var _=u.Ellipsoid.clone(u.Ellipsoid.UNIT_SPHERE),k={polylinePositions:void 0,shapePositions:void 0,ellipsoid:_,height:void 0,cornerType:void 0,granularity:void 0};P.unpack=function(e,i,n){i=d.defaultValue(i,0);for(var a=e[i++],t=new Array(a),r=0;r<a;++r,i+=u.Cartesian3.packedLength)t[r]=u.Cartesian3.unpack(e,i);var a=e[i++],o=new Array(a);for(r=0;r<a;++r,i+=u.Cartesian2.packedLength)o[r]=u.Cartesian2.unpack(e,i);var l=u.Ellipsoid.unpack(e,i,_);i+=u.Ellipsoid.packedLength;var s=e[i++],p=e[i];return d.defined(n)?(n._positions=t,n._shape=o,n._ellipsoid=u.Ellipsoid.clone(l,n._ellipsoid),n._cornerType=s,n._granularity=p,n):(k.polylinePositions=t,k.shapePositions=o,k.cornerType=s,k.granularity=p,new P(k))};var C=new r.BoundingRectangle;return P.createGeometry=function(e){var i=e._positions,n=t.arrayRemoveDuplicates(i,u.Cartesian3.equalsEpsilon),a=e._shape,a=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(a);if(!(n.length<2||a.length<3)){l.PolygonPipeline.computeWindingOrder2D(a)===l.WindingOrder.CLOCKWISE&&a.reverse();i=r.BoundingRectangle.fromPoints(a,C);return function(e,i){var n=new f.GeometryAttributes;n.position=new h.GeometryAttribute({componentDatatype:y.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});var a=i.length,i=n.position.values.length/3,t=e.length/3/a,r=g.IndexDatatype.createTypedArray(i,2*a*(1+t)),o=0,l=0,s=l*a;for(u=0;u<a-1;u++)r[o++]=u+s,r[o++]=u+s+1;for(r[o++]=a-1+s,r[o++]=s,s=(l=t-1)*a,u=0;u<a-1;u++)r[o++]=u+s,r[o++]=u+s+1;for(r[o++]=a-1+s,r[o++]=s,l=0;l<t-1;l++)for(var p=a*l,d=p+a,u=0;u<a;u++)r[o++]=u+p,r[o++]=u+d;return new h.Geometry({attributes:n,indices:g.IndexDatatype.createTypedArray(i,r),boundingSphere:c.BoundingSphere.fromVertices(e),primitiveType:h.PrimitiveType.LINES})}(o.PolylineVolumeGeometryLibrary.computePositions(n,a,i,e,!1),a)}},function(e,i){return(e=d.defined(i)?P.unpack(e,i):e)._ellipsoid=u.Ellipsoid.clone(e._ellipsoid),P.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./arrayRemoveDuplicates-3fea1e5f","./BoundingRectangle-07202124","./Transforms-79117a7b","./ComponentDatatype-1a100acd","./PolylineVolumeGeometryLibrary-4d0ebb44","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonPipeline-97a7160d","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-325a8e68","./IntersectionTests-5394f658","./Plane-13ae4b1b","./PolylinePipeline-3803a6c2","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3"],function(d,c,a,r,u,y,o,e,h,g,f,t,l,i,n,s,p,m,E,v,P){"use strict";function _(e){var i=(e=d.defaultValue(e,d.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=i,this._shape=n,this._ellipsoid=c.Ellipsoid.clone(d.defaultValue(e.ellipsoid,c.Ellipsoid.WGS84)),this._cornerType=d.defaultValue(e.cornerType,o.CornerType.ROUNDED),this._granularity=d.defaultValue(e.granularity,t.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";i=1+i.length*c.Cartesian3.packedLength;i+=1+n.length*c.Cartesian2.packedLength,this.packedLength=i+c.Ellipsoid.packedLength+2}_.pack=function(e,i,n){var t;n=d.defaultValue(n,0);var a=e._positions,r=a.length;for(i[n++]=r,t=0;t<r;++t,n+=c.Cartesian3.packedLength)c.Cartesian3.pack(a[t],i,n);var o=e._shape,r=o.length;for(i[n++]=r,t=0;t<r;++t,n+=c.Cartesian2.packedLength)c.Cartesian2.pack(o[t],i,n);return c.Ellipsoid.pack(e._ellipsoid,i,n),n+=c.Ellipsoid.packedLength,i[n++]=e._cornerType,i[n]=e._granularity,i};var k=c.Ellipsoid.clone(c.Ellipsoid.UNIT_SPHERE),C={polylinePositions:void 0,shapePositions:void 0,ellipsoid:k,height:void 0,cornerType:void 0,granularity:void 0};_.unpack=function(e,i,n){i=d.defaultValue(i,0);for(var t=e[i++],a=new Array(t),r=0;r<t;++r,i+=c.Cartesian3.packedLength)a[r]=c.Cartesian3.unpack(e,i);var t=e[i++],o=new Array(t);for(r=0;r<t;++r,i+=c.Cartesian2.packedLength)o[r]=c.Cartesian2.unpack(e,i);var l=c.Ellipsoid.unpack(e,i,k);i+=c.Ellipsoid.packedLength;var s=e[i++],p=e[i];return d.defined(n)?(n._positions=a,n._shape=o,n._ellipsoid=c.Ellipsoid.clone(l,n._ellipsoid),n._cornerType=s,n._granularity=p,n):(C.polylinePositions=a,C.shapePositions=o,C.cornerType=s,C.granularity=p,new _(C))};var b=new r.BoundingRectangle;return _.createGeometry=function(e){var i=e._positions,n=a.arrayRemoveDuplicates(i,c.Cartesian3.equalsEpsilon),t=e._shape,t=o.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(t);if(!(n.length<2||t.length<3)){l.PolygonPipeline.computeWindingOrder2D(t)===l.WindingOrder.CLOCKWISE&&t.reverse();i=r.BoundingRectangle.fromPoints(t,b);return function(e,i){var n=new g.GeometryAttributes;n.position=new h.GeometryAttribute({componentDatatype:y.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e});var t=i.length,i=n.position.values.length/3,a=e.length/3/t,r=f.IndexDatatype.createTypedArray(i,2*t*(1+a)),o=0,l=0,s=l*t;for(c=0;c<t-1;c++)r[o++]=c+s,r[o++]=c+s+1;for(r[o++]=t-1+s,r[o++]=s,s=(l=a-1)*t,c=0;c<t-1;c++)r[o++]=c+s,r[o++]=c+s+1;for(r[o++]=t-1+s,r[o++]=s,l=0;l<a-1;l++)for(var p=t*l,d=p+t,c=0;c<t;c++)r[o++]=c+p,r[o++]=c+d;return new h.Geometry({attributes:n,indices:f.IndexDatatype.createTypedArray(i,r),boundingSphere:u.BoundingSphere.fromVertices(e),primitiveType:h.PrimitiveType.LINES})}(o.PolylineVolumeGeometryLibrary.computePositions(n,t,i,e,!1),t)}},function(e,i){return(e=d.defined(i)?_.unpack(e,i):e)._ellipsoid=c.Ellipsoid.clone(e._ellipsoid),_.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createRectangleGeometry.js b/public/Cesium/Workers/createRectangleGeometry.js index 43128f9..53b02fb 100644 --- a/public/Cesium/Workers/createRectangleGeometry.js +++ b/public/Cesium/Workers/createRectangleGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./GeometryInstance-d919cab6","./GeometryPipeline-5e672526","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonPipeline-bfd1975b","./RectangleGeometryLibrary-b88eec5f","./VertexFormat-e8cbf5b3","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./AttributeCompression-f02ec82f","./EncodedCartesian3-874933de","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./EllipsoidRhumbLine-8cb2e5a4"],function(Q,W,J,N,t,j,Z,r,K,$,tt,et,at,S,rt,e,a,n,i,o,s,l){"use strict";var nt=new W.Cartesian3,it=new W.Cartesian3,ot=new W.Cartesian3,st=new W.Cartesian3,d=new W.Rectangle,I=new W.Cartesian2,p=new N.BoundingSphere,g=new N.BoundingSphere;function lt(t,e){var a=new Z.Geometry({attributes:new r.GeometryAttributes,primitiveType:Z.PrimitiveType.TRIANGLES});return a.attributes.position=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(a.attributes.normal=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(a.attributes.tangent=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(a.attributes.bitangent=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),a}var ut=new W.Cartesian3,ct=new W.Cartesian3;function mt(t,e){var a=t._vertexFormat,r=t._ellipsoid,n=e.height,i=e.width,o=e.northCap,s=e.southCap,l=0,u=n,c=n,t=0;o&&(--c,t+=l=1),s&&(--u,--c,t+=1),t+=i*c;for(var m=a.position?new Float64Array(3*t):void 0,d=a.st?new Float32Array(2*t):void 0,p=0,g=0,y=nt,f=I,h=Number.MAX_VALUE,b=Number.MAX_VALUE,v=-Number.MAX_VALUE,_=-Number.MAX_VALUE,A=l;A<u;++A)for(var x=0;x<i;++x)S.RectangleGeometryLibrary.computePosition(e,r,a.st,A,x,y,f),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z,a.st&&(d[g++]=f.x,d[g++]=f.y,h=Math.min(h,f.x),b=Math.min(b,f.y),v=Math.max(v,f.x),_=Math.max(_,f.y));if(o&&(S.RectangleGeometryLibrary.computePosition(e,r,a.st,0,0,y,f),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z,a.st&&(d[g++]=f.x,d[g++]=f.y,h=f.x,b=f.y,v=f.x,_=f.y)),s&&(S.RectangleGeometryLibrary.computePosition(e,r,a.st,n-1,0,y,f),m[p++]=y.x,m[p++]=y.y,m[p]=y.z,a.st&&(d[g++]=f.x,d[g]=f.y,h=Math.min(h,f.x),b=Math.min(b,f.y),v=Math.max(v,f.x),_=Math.max(_,f.y))),a.st&&(h<0||b<0||1<v||1<_))for(var w=0;w<d.length;w+=2)d[w]=(d[w]-h)/(v-h),d[w+1]=(d[w+1]-b)/(_-b);l=function(t,e,a,r){var n=t.length,i=e.normal?new Float32Array(n):void 0,o=e.tangent?new Float32Array(n):void 0,s=e.bitangent?new Float32Array(n):void 0,l=0,u=st,c=ot,m=it;if(e.normal||e.tangent||e.bitangent)for(var d=0;d<n;d+=3){var p=W.Cartesian3.fromArray(t,d,nt),g=l+1,y=l+2,m=a.geodeticSurfaceNormal(p,m);(e.tangent||e.bitangent)&&(W.Cartesian3.cross(W.Cartesian3.UNIT_Z,m,c),N.Matrix3.multiplyByVector(r,c,c),W.Cartesian3.normalize(c,c),e.bitangent&&W.Cartesian3.normalize(W.Cartesian3.cross(m,c,u),u)),e.normal&&(i[l]=m.x,i[g]=m.y,i[y]=m.z),e.tangent&&(o[l]=c.x,o[g]=c.y,o[y]=c.z),e.bitangent&&(s[l]=u.x,s[g]=u.y,s[y]=u.z),l+=3}return lt(e,{positions:t,normals:i,tangents:o,bitangents:s})}(m,a,r,e.tangentRotationMatrix),n=6*(i-1)*(c-1);o&&(n+=3*(i-1)),s&&(n+=3*(i-1));for(var C=tt.IndexDatatype.createTypedArray(t,n),R=0,E=0,F=0;F<c-1;++F){for(var G=0;G<i-1;++G){var P=R+i,V=P+1,L=R+1;C[E++]=R,C[E++]=P,C[E++]=L,C[E++]=L,C[E++]=P,C[E++]=V,++R}++R}if(o||s){var D,M,T=t-1,O=t-1;if(o&&s&&(T=t-2),R=0,o)for(F=0;F<i-1;F++)M=(D=R)+1,C[E++]=T,C[E++]=D,C[E++]=M,++R;if(s)for(R=(c-1)*i,F=0;F<i-1;F++)M=(D=R)+1,C[E++]=D,C[E++]=O,C[E++]=M,++R}return l.indices=C,a.st&&(l.attributes.st=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:d})),l}function dt(t,e,a,r,n){return t[e++]=r[a],t[e++]=r[a+1],t[e++]=r[a+2],t[e++]=n[a],t[e++]=n[a+1],t[e]=n[a+2],t}function pt(t,e,a,r){return t[e++]=r[a],t[e++]=r[a+1],t[e++]=r[a],t[e]=r[a+1],t}var gt=new rt.VertexFormat;function y(t,e){var a=t._shadowVolume,r=t._offsetAttribute,n=t._vertexFormat,i=t._extrudedHeight,o=t._surfaceHeight,s=t._ellipsoid,l=e.height,u=e.width;a&&((b=rt.VertexFormat.clone(n,gt)).normal=!0,t._vertexFormat=b);var c=mt(t,e);a&&(t._vertexFormat=n);var m=at.PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,o,s,!1),d=2*(z=(m=new Float64Array(m)).length),p=new Float64Array(d);p.set(m);var g=at.PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,i,s);p.set(g,z),c.attributes.position.values=p;var y,f,h,b=n.normal?new Float32Array(d):void 0,t=n.tangent?new Float32Array(d):void 0,o=n.bitangent?new Float32Array(d):void 0,i=n.st?new Float32Array(d/3*2):void 0;if(n.normal){for(f=c.attributes.normal.values,b.set(f),_=0;_<z;_++)f[_]=-f[_];b.set(f,z),c.attributes.normal.values=b}if(a){f=c.attributes.normal.values,n.normal||(c.attributes.normal=void 0);for(var v=new Float32Array(d),_=0;_<z;_++)f[_]=-f[_];v.set(f,z),c.attributes.extrudeDirection=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})}p=Q.defined(r);if(p&&(b=z/3*2,v=new Uint8Array(b),v=r===J.GeometryOffsetAttribute.TOP?J.arrayFill(v,1,0,b/2):(h=r===J.GeometryOffsetAttribute.NONE?0:1,J.arrayFill(v,h)),c.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})),n.tangent){var A=c.attributes.tangent.values;for(t.set(A),_=0;_<z;_++)A[_]=-A[_];t.set(A,z),c.attributes.tangent.values=t}n.bitangent&&(E=c.attributes.bitangent.values,o.set(E),o.set(E,z),c.attributes.bitangent.values=o),n.st&&(y=c.attributes.st.values,i.set(y),i.set(y,z/3*2),c.attributes.st.values=i);var x=c.indices,w=x.length,C=z/3,R=tt.IndexDatatype.createTypedArray(d/3,2*w);for(R.set(x),_=0;_<w;_+=3)R[_+w]=x[_+2]+C,R[_+1+w]=x[_+1]+C,R[_+2+w]=x[_]+C;c.indices=R;var t=e.northCap,E=e.southCap,o=l,i=2,d=0,e=4,l=4;t&&(--i,--o,d+=1,e-=2,--l),E&&(--i,--o,d+=1,e-=2,--l);var l=2*((d+=i*u+2*o-e)+l),F=new Float64Array(3*l),G=a?new Float32Array(3*l):void 0,P=p?new Uint8Array(l):void 0,V=n.st?new Float32Array(2*l):void 0,L=r===J.GeometryOffsetAttribute.TOP;p&&!L&&(h=r===J.GeometryOffsetAttribute.ALL?1:0,P=J.arrayFill(P,h));var D=0,M=0,T=0,O=0,N=u*o;for(_=0;_<N;_+=u)F=dt(F,D,I=3*_,m,g),D+=6,n.st&&(V=pt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);if(E){var S=t?1+N:N,I=3*S;for(_=0;_<2;_++)F=dt(F,D,I,m,g),D+=6,n.st&&(V=pt(V,M,2*S,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1)}else for(_=N-u;_<N;_++)F=dt(F,D,I=3*_,m,g),D+=6,n.st&&(V=pt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);for(_=N-1;0<_;_-=u)F=dt(F,D,I=3*_,m,g),D+=6,n.st&&(V=pt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);if(t){var k=N;for(I=3*k,_=0;_<2;_++)F=dt(F,D,I,m,g),D+=6,n.st&&(V=pt(V,M,2*k,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1)}else for(_=u-1;0<=_;_--)F=dt(F,D,I=3*_,m,g),D+=6,n.st&&(V=pt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);s=function(t,e,a){var r=t.length,n=e.normal?new Float32Array(r):void 0,i=e.tangent?new Float32Array(r):void 0,o=e.bitangent?new Float32Array(r):void 0,s=0,l=0,u=0,c=!0,m=st,d=ot,p=it;if(e.normal||e.tangent||e.bitangent)for(var g=0;g<r;g+=6){var y,f=W.Cartesian3.fromArray(t,g,nt),h=W.Cartesian3.fromArray(t,(g+6)%r,ut);c&&(y=W.Cartesian3.fromArray(t,(g+3)%r,ct),W.Cartesian3.subtract(h,f,h),W.Cartesian3.subtract(y,f,y),p=W.Cartesian3.normalize(W.Cartesian3.cross(y,h,p),p),c=!1),W.Cartesian3.equalsEpsilon(h,f,et.CesiumMath.EPSILON10)&&(c=!0),(e.tangent||e.bitangent)&&(m=a.geodeticSurfaceNormal(f,m),e.tangent&&(d=W.Cartesian3.normalize(W.Cartesian3.cross(m,p,d),d))),e.normal&&(n[s++]=p.x,n[s++]=p.y,n[s++]=p.z,n[s++]=p.x,n[s++]=p.y,n[s++]=p.z),e.tangent&&(i[l++]=d.x,i[l++]=d.y,i[l++]=d.z,i[l++]=d.x,i[l++]=d.y,i[l++]=d.z),e.bitangent&&(o[u++]=m.x,o[u++]=m.y,o[u++]=m.z,o[u++]=m.x,o[u++]=m.y,o[u++]=m.z)}return lt(e,{positions:t,normals:n,tangents:i,bitangents:o})}(F,n,s);n.st&&(s.attributes.st=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V})),a&&(s.attributes.extrudeDirection=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),p&&(s.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:P}));var H=tt.IndexDatatype.createTypedArray(l,6*d),z=F.length/3,B=0;for(_=0;_<z-1;_+=2){var U,Y=((U=_)+2)%z,q=W.Cartesian3.fromArray(F,3*U,ut),X=W.Cartesian3.fromArray(F,3*Y,ct);W.Cartesian3.equalsEpsilon(q,X,et.CesiumMath.EPSILON10)||(X=(2+(q=(U+1)%z))%z,H[B++]=U,H[B++]=q,H[B++]=Y,H[B++]=Y,H[B++]=q,H[B++]=X)}return s.indices=H,(s=$.GeometryPipeline.combineInstances([new K.GeometryInstance({geometry:c}),new K.GeometryInstance({geometry:s})]))[0]}var u=[new W.Cartesian3,new W.Cartesian3,new W.Cartesian3,new W.Cartesian3],f=new W.Cartographic,h=new W.Cartographic;function c(t,e,a,r,n){if(0===a)return W.Rectangle.clone(t,n);var i=S.RectangleGeometryLibrary.computeOptions(t,e,a,0,d,f),t=i.height,e=i.width,a=u;return S.RectangleGeometryLibrary.computePosition(i,r,!1,0,0,a[0]),S.RectangleGeometryLibrary.computePosition(i,r,!1,0,e-1,a[1]),S.RectangleGeometryLibrary.computePosition(i,r,!1,t-1,0,a[2]),S.RectangleGeometryLibrary.computePosition(i,r,!1,t-1,e-1,a[3]),W.Rectangle.fromCartesianArray(a,r,n)}function b(t){var e=(t=Q.defaultValue(t,Q.defaultValue.EMPTY_OBJECT)).rectangle,a=Q.defaultValue(t.height,0),r=Q.defaultValue(t.extrudedHeight,a);this._rectangle=W.Rectangle.clone(e),this._granularity=Q.defaultValue(t.granularity,et.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=W.Ellipsoid.clone(Q.defaultValue(t.ellipsoid,W.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(a,r),this._rotation=Q.defaultValue(t.rotation,0),this._stRotation=Q.defaultValue(t.stRotation,0),this._vertexFormat=rt.VertexFormat.clone(Q.defaultValue(t.vertexFormat,rt.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(a,r),this._shadowVolume=Q.defaultValue(t.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}b.packedLength=W.Rectangle.packedLength+W.Ellipsoid.packedLength+rt.VertexFormat.packedLength+7,b.pack=function(t,e,a){return a=Q.defaultValue(a,0),W.Rectangle.pack(t._rectangle,e,a),a+=W.Rectangle.packedLength,W.Ellipsoid.pack(t._ellipsoid,e,a),a+=W.Ellipsoid.packedLength,rt.VertexFormat.pack(t._vertexFormat,e,a),a+=rt.VertexFormat.packedLength,e[a++]=t._granularity,e[a++]=t._surfaceHeight,e[a++]=t._rotation,e[a++]=t._stRotation,e[a++]=t._extrudedHeight,e[a++]=t._shadowVolume?1:0,e[a]=Q.defaultValue(t._offsetAttribute,-1),e};var v=new W.Rectangle,_=W.Ellipsoid.clone(W.Ellipsoid.UNIT_SPHERE),A={rectangle:v,ellipsoid:_,vertexFormat:gt,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};b.unpack=function(t,e,a){e=Q.defaultValue(e,0);var r=W.Rectangle.unpack(t,e,v);e+=W.Rectangle.packedLength;var n=W.Ellipsoid.unpack(t,e,_);e+=W.Ellipsoid.packedLength;var i=rt.VertexFormat.unpack(t,e,gt);e+=rt.VertexFormat.packedLength;var o=t[e++],s=t[e++],l=t[e++],u=t[e++],c=t[e++],m=1===t[e++],e=t[e];return Q.defined(a)?(a._rectangle=W.Rectangle.clone(r,a._rectangle),a._ellipsoid=W.Ellipsoid.clone(n,a._ellipsoid),a._vertexFormat=rt.VertexFormat.clone(i,a._vertexFormat),a._granularity=o,a._surfaceHeight=s,a._rotation=l,a._stRotation=u,a._extrudedHeight=c,a._shadowVolume=m,a._offsetAttribute=-1===e?void 0:e,a):(A.granularity=o,A.height=s,A.rotation=l,A.stRotation=u,A.extrudedHeight=c,A.shadowVolume=m,A.offsetAttribute=-1===e?void 0:e,new b(A))},b.computeRectangle=function(t,e){var a=(t=Q.defaultValue(t,Q.defaultValue.EMPTY_OBJECT)).rectangle,r=Q.defaultValue(t.granularity,et.CesiumMath.RADIANS_PER_DEGREE),n=Q.defaultValue(t.ellipsoid,W.Ellipsoid.WGS84);return c(a,r,Q.defaultValue(t.rotation,0),n,e)};var x=new N.Matrix3,w=new N.Quaternion,C=new W.Cartographic;b.createGeometry=function(t){if(!et.CesiumMath.equalsEpsilon(t._rectangle.north,t._rectangle.south,et.CesiumMath.EPSILON10)&&!et.CesiumMath.equalsEpsilon(t._rectangle.east,t._rectangle.west,et.CesiumMath.EPSILON10)){var e=t._rectangle,a=t._ellipsoid,r=t._rotation,n=t._stRotation,i=t._vertexFormat,o=S.RectangleGeometryLibrary.computeOptions(e,t._granularity,r,n,d,f,h),s=x;0!==n||0!==r?(c=W.Rectangle.center(e,C),m=a.geodeticSurfaceNormalCartographic(c,ut),N.Quaternion.fromAxisAngle(m,-n,w),N.Matrix3.fromQuaternion(w,s)):N.Matrix3.clone(N.Matrix3.IDENTITY,s);var l,u,c=t._surfaceHeight,m=t._extrudedHeight,n=!et.CesiumMath.equalsEpsilon(c,m,0,et.CesiumMath.EPSILON2);return o.lonScalar=1/t._rectangle.width,o.latScalar=1/t._rectangle.height,o.tangentRotationMatrix=s,e=t._rectangle,c=n?(l=y(t,o),n=N.BoundingSphere.fromRectangle3D(e,a,c,g),u=N.BoundingSphere.fromRectangle3D(e,a,m,p),N.BoundingSphere.union(n,u)):((l=mt(t,o)).attributes.position.values=at.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,c,a,!1),Q.defined(t._offsetAttribute)&&(u=l.attributes.position.values.length,o=new Uint8Array(u/3),u=t._offsetAttribute===J.GeometryOffsetAttribute.NONE?0:1,J.arrayFill(o,u),l.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),N.BoundingSphere.fromRectangle3D(e,a,c)),i.position||delete l.attributes.position,new Z.Geometry({attributes:l.attributes,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:c,offsetAttribute:t._offsetAttribute})}},b.createShadowVolume=function(t,e,a){var r=t._granularity,n=t._ellipsoid,e=e(r,n),a=a(r,n);return new b({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:n,stRotation:t._stRotation,granularity:r,extrudedHeight:a,height:e,vertexFormat:rt.VertexFormat.POSITION_ONLY,shadowVolume:!0})};var m=new W.Rectangle,R=[new W.Cartesian2,new W.Cartesian2,new W.Cartesian2],E=new Z.Matrix2,F=new W.Cartographic;return Object.defineProperties(b.prototype,{rectangle:{get:function(){return Q.defined(this._rotatedRectangle)||(this._rotatedRectangle=c(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return Q.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];var e=W.Rectangle.clone(t._rectangle,m),a=t._granularity,r=t._ellipsoid,e=c(e,a,t._rotation-t._stRotation,r,m),n=R;n[0].x=e.west,n[0].y=e.south,n[1].x=e.west,n[1].y=e.north,n[2].x=e.east,n[2].y=e.south;for(var i=t.rectangle,o=Z.Matrix2.fromRotation(t._stRotation,E),s=W.Rectangle.center(i,F),l=0;l<3;++l){var u=n[l];u.x-=s.longitude,u.y-=s.latitude,Z.Matrix2.multiplyByVector(o,u,u),u.x+=s.longitude,u.y+=s.latitude,u.x=(u.x-i.west)/i.width,u.y=(u.y-i.south)/i.height}return a=n[0],r=n[1],e=n[2],t=new Array(6),W.Cartesian2.pack(a,t),W.Cartesian2.pack(r,t,2),W.Cartesian2.pack(e,t,4),t}(this)),this._textureCoordinateRotationPoints}}}),function(t,e){return(t=Q.defined(e)?b.unpack(t,e):t)._ellipsoid=W.Ellipsoid.clone(t._ellipsoid),t._rectangle=W.Rectangle.clone(t._rectangle),b.createGeometry(t)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./Check-24483042","./ComponentDatatype-1a100acd","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./GeometryInstance-6aa9010a","./GeometryPipeline-571ff4c9","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonPipeline-97a7160d","./RectangleGeometryLibrary-57cd4923","./VertexFormat-81ec7207","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./AttributeCompression-10c27d9c","./EncodedCartesian3-bf827957","./IntersectionTests-5394f658","./Plane-13ae4b1b","./EllipsoidRhumbLine-2b7999f3"],function(Q,W,J,N,t,j,Z,r,K,$,tt,et,at,S,rt,e,a,n,i,o,s,l){"use strict";var nt=new W.Cartesian3,it=new W.Cartesian3,ot=new W.Cartesian3,st=new W.Cartesian3,p=new W.Rectangle,I=new W.Cartesian2,d=new N.BoundingSphere,g=new N.BoundingSphere;function lt(t,e){var a=new Z.Geometry({attributes:new r.GeometryAttributes,primitiveType:Z.PrimitiveType.TRIANGLES});return a.attributes.position=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(a.attributes.normal=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(a.attributes.tangent=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(a.attributes.bitangent=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),a}var ut=new W.Cartesian3,ct=new W.Cartesian3;function mt(t,e){var a=t._vertexFormat,r=t._ellipsoid,n=e.height,i=e.width,o=e.northCap,s=e.southCap,l=0,u=n,c=n,t=0;o&&(--c,t+=l=1),s&&(--u,--c,t+=1),t+=i*c;for(var m=a.position?new Float64Array(3*t):void 0,p=a.st?new Float32Array(2*t):void 0,d=0,g=0,y=nt,f=I,h=Number.MAX_VALUE,b=Number.MAX_VALUE,v=-Number.MAX_VALUE,_=-Number.MAX_VALUE,A=l;A<u;++A)for(var x=0;x<i;++x)S.RectangleGeometryLibrary.computePosition(e,r,a.st,A,x,y,f),m[d++]=y.x,m[d++]=y.y,m[d++]=y.z,a.st&&(p[g++]=f.x,p[g++]=f.y,h=Math.min(h,f.x),b=Math.min(b,f.y),v=Math.max(v,f.x),_=Math.max(_,f.y));if(o&&(S.RectangleGeometryLibrary.computePosition(e,r,a.st,0,0,y,f),m[d++]=y.x,m[d++]=y.y,m[d++]=y.z,a.st&&(p[g++]=f.x,p[g++]=f.y,h=f.x,b=f.y,v=f.x,_=f.y)),s&&(S.RectangleGeometryLibrary.computePosition(e,r,a.st,n-1,0,y,f),m[d++]=y.x,m[d++]=y.y,m[d]=y.z,a.st&&(p[g++]=f.x,p[g]=f.y,h=Math.min(h,f.x),b=Math.min(b,f.y),v=Math.max(v,f.x),_=Math.max(_,f.y))),a.st&&(h<0||b<0||1<v||1<_))for(var w=0;w<p.length;w+=2)p[w]=(p[w]-h)/(v-h),p[w+1]=(p[w+1]-b)/(_-b);l=function(t,e,a,r){var n=t.length,i=e.normal?new Float32Array(n):void 0,o=e.tangent?new Float32Array(n):void 0,s=e.bitangent?new Float32Array(n):void 0,l=0,u=st,c=ot,m=it;if(e.normal||e.tangent||e.bitangent)for(var p=0;p<n;p+=3){var d=W.Cartesian3.fromArray(t,p,nt),g=l+1,y=l+2,m=a.geodeticSurfaceNormal(d,m);(e.tangent||e.bitangent)&&(W.Cartesian3.cross(W.Cartesian3.UNIT_Z,m,c),N.Matrix3.multiplyByVector(r,c,c),W.Cartesian3.normalize(c,c),e.bitangent&&W.Cartesian3.normalize(W.Cartesian3.cross(m,c,u),u)),e.normal&&(i[l]=m.x,i[g]=m.y,i[y]=m.z),e.tangent&&(o[l]=c.x,o[g]=c.y,o[y]=c.z),e.bitangent&&(s[l]=u.x,s[g]=u.y,s[y]=u.z),l+=3}return lt(e,{positions:t,normals:i,tangents:o,bitangents:s})}(m,a,r,e.tangentRotationMatrix),n=6*(i-1)*(c-1);o&&(n+=3*(i-1)),s&&(n+=3*(i-1));for(var C=tt.IndexDatatype.createTypedArray(t,n),R=0,E=0,F=0;F<c-1;++F){for(var G=0;G<i-1;++G){var P=R+i,V=P+1,L=R+1;C[E++]=R,C[E++]=P,C[E++]=L,C[E++]=L,C[E++]=P,C[E++]=V,++R}++R}if(o||s){var D,M,T=t-1,O=t-1;if(o&&s&&(T=t-2),R=0,o)for(F=0;F<i-1;F++)M=(D=R)+1,C[E++]=T,C[E++]=D,C[E++]=M,++R;if(s)for(R=(c-1)*i,F=0;F<i-1;F++)M=(D=R)+1,C[E++]=D,C[E++]=O,C[E++]=M,++R}return l.indices=C,a.st&&(l.attributes.st=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:p})),l}function pt(t,e,a,r,n){return t[e++]=r[a],t[e++]=r[a+1],t[e++]=r[a+2],t[e++]=n[a],t[e++]=n[a+1],t[e]=n[a+2],t}function dt(t,e,a,r){return t[e++]=r[a],t[e++]=r[a+1],t[e++]=r[a],t[e]=r[a+1],t}var gt=new rt.VertexFormat;function y(t,e){var a=t._shadowVolume,r=t._offsetAttribute,n=t._vertexFormat,i=t._extrudedHeight,o=t._surfaceHeight,s=t._ellipsoid,l=e.height,u=e.width;a&&((b=rt.VertexFormat.clone(n,gt)).normal=!0,t._vertexFormat=b);var c=mt(t,e);a&&(t._vertexFormat=n);var m=at.PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,o,s,!1),p=2*(z=(m=new Float64Array(m)).length),d=new Float64Array(p);d.set(m);var g=at.PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,i,s);d.set(g,z),c.attributes.position.values=d;var y,f,h,b=n.normal?new Float32Array(p):void 0,t=n.tangent?new Float32Array(p):void 0,o=n.bitangent?new Float32Array(p):void 0,i=n.st?new Float32Array(p/3*2):void 0;if(n.normal){for(f=c.attributes.normal.values,b.set(f),_=0;_<z;_++)f[_]=-f[_];b.set(f,z),c.attributes.normal.values=b}if(a){f=c.attributes.normal.values,n.normal||(c.attributes.normal=void 0);for(var v=new Float32Array(p),_=0;_<z;_++)f[_]=-f[_];v.set(f,z),c.attributes.extrudeDirection=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v})}d=Q.defined(r);if(d&&(b=z/3*2,v=new Uint8Array(b),v=r===J.GeometryOffsetAttribute.TOP?J.arrayFill(v,1,0,b/2):(h=r===J.GeometryOffsetAttribute.NONE?0:1,J.arrayFill(v,h)),c.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})),n.tangent){var A=c.attributes.tangent.values;for(t.set(A),_=0;_<z;_++)A[_]=-A[_];t.set(A,z),c.attributes.tangent.values=t}n.bitangent&&(E=c.attributes.bitangent.values,o.set(E),o.set(E,z),c.attributes.bitangent.values=o),n.st&&(y=c.attributes.st.values,i.set(y),i.set(y,z/3*2),c.attributes.st.values=i);var x=c.indices,w=x.length,C=z/3,R=tt.IndexDatatype.createTypedArray(p/3,2*w);for(R.set(x),_=0;_<w;_+=3)R[_+w]=x[_+2]+C,R[_+1+w]=x[_+1]+C,R[_+2+w]=x[_]+C;c.indices=R;var t=e.northCap,E=e.southCap,o=l,i=2,p=0,e=4,l=4;t&&(--i,--o,p+=1,e-=2,--l),E&&(--i,--o,p+=1,e-=2,--l);var l=2*((p+=i*u+2*o-e)+l),F=new Float64Array(3*l),G=a?new Float32Array(3*l):void 0,P=d?new Uint8Array(l):void 0,V=n.st?new Float32Array(2*l):void 0,L=r===J.GeometryOffsetAttribute.TOP;d&&!L&&(h=r===J.GeometryOffsetAttribute.ALL?1:0,P=J.arrayFill(P,h));var D=0,M=0,T=0,O=0,N=u*o;for(_=0;_<N;_+=u)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);if(E){var S=t?1+N:N,I=3*S;for(_=0;_<2;_++)F=pt(F,D,I,m,g),D+=6,n.st&&(V=dt(V,M,2*S,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1)}else for(_=N-u;_<N;_++)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);for(_=N-1;0<_;_-=u)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);if(t){var k=N;for(I=3*k,_=0;_<2;_++)F=pt(F,D,I,m,g),D+=6,n.st&&(V=dt(V,M,2*k,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1)}else for(_=u-1;0<=_;_--)F=pt(F,D,I=3*_,m,g),D+=6,n.st&&(V=dt(V,M,2*_,y),M+=4),a&&(T+=3,G[T++]=f[I],G[T++]=f[I+1],G[T++]=f[I+2]),L&&(P[O++]=1,O+=1);s=function(t,e,a){var r=t.length,n=e.normal?new Float32Array(r):void 0,i=e.tangent?new Float32Array(r):void 0,o=e.bitangent?new Float32Array(r):void 0,s=0,l=0,u=0,c=!0,m=st,p=ot,d=it;if(e.normal||e.tangent||e.bitangent)for(var g=0;g<r;g+=6){var y,f=W.Cartesian3.fromArray(t,g,nt),h=W.Cartesian3.fromArray(t,(g+6)%r,ut);c&&(y=W.Cartesian3.fromArray(t,(g+3)%r,ct),W.Cartesian3.subtract(h,f,h),W.Cartesian3.subtract(y,f,y),d=W.Cartesian3.normalize(W.Cartesian3.cross(y,h,d),d),c=!1),W.Cartesian3.equalsEpsilon(h,f,et.CesiumMath.EPSILON10)&&(c=!0),(e.tangent||e.bitangent)&&(m=a.geodeticSurfaceNormal(f,m),e.tangent&&(p=W.Cartesian3.normalize(W.Cartesian3.cross(m,d,p),p))),e.normal&&(n[s++]=d.x,n[s++]=d.y,n[s++]=d.z,n[s++]=d.x,n[s++]=d.y,n[s++]=d.z),e.tangent&&(i[l++]=p.x,i[l++]=p.y,i[l++]=p.z,i[l++]=p.x,i[l++]=p.y,i[l++]=p.z),e.bitangent&&(o[u++]=m.x,o[u++]=m.y,o[u++]=m.z,o[u++]=m.x,o[u++]=m.y,o[u++]=m.z)}return lt(e,{positions:t,normals:n,tangents:i,bitangents:o})}(F,n,s);n.st&&(s.attributes.st=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:V})),a&&(s.attributes.extrudeDirection=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),d&&(s.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:P}));var H=tt.IndexDatatype.createTypedArray(l,6*p),z=F.length/3,B=0;for(_=0;_<z-1;_+=2){var U,Y=((U=_)+2)%z,q=W.Cartesian3.fromArray(F,3*U,ut),X=W.Cartesian3.fromArray(F,3*Y,ct);W.Cartesian3.equalsEpsilon(q,X,et.CesiumMath.EPSILON10)||(X=(2+(q=(U+1)%z))%z,H[B++]=U,H[B++]=q,H[B++]=Y,H[B++]=Y,H[B++]=q,H[B++]=X)}return s.indices=H,(s=$.GeometryPipeline.combineInstances([new K.GeometryInstance({geometry:c}),new K.GeometryInstance({geometry:s})]))[0]}var u=[new W.Cartesian3,new W.Cartesian3,new W.Cartesian3,new W.Cartesian3],f=new W.Cartographic,h=new W.Cartographic;function c(t,e,a,r,n){if(0===a)return W.Rectangle.clone(t,n);var i=S.RectangleGeometryLibrary.computeOptions(t,e,a,0,p,f),t=i.height,e=i.width,a=u;return S.RectangleGeometryLibrary.computePosition(i,r,!1,0,0,a[0]),S.RectangleGeometryLibrary.computePosition(i,r,!1,0,e-1,a[1]),S.RectangleGeometryLibrary.computePosition(i,r,!1,t-1,0,a[2]),S.RectangleGeometryLibrary.computePosition(i,r,!1,t-1,e-1,a[3]),W.Rectangle.fromCartesianArray(a,r,n)}function b(t){var e=(t=Q.defaultValue(t,Q.defaultValue.EMPTY_OBJECT)).rectangle,a=Q.defaultValue(t.height,0),r=Q.defaultValue(t.extrudedHeight,a);this._rectangle=W.Rectangle.clone(e),this._granularity=Q.defaultValue(t.granularity,et.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=W.Ellipsoid.clone(Q.defaultValue(t.ellipsoid,W.Ellipsoid.WGS84)),this._surfaceHeight=Math.max(a,r),this._rotation=Q.defaultValue(t.rotation,0),this._stRotation=Q.defaultValue(t.stRotation,0),this._vertexFormat=rt.VertexFormat.clone(Q.defaultValue(t.vertexFormat,rt.VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(a,r),this._shadowVolume=Q.defaultValue(t.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=t.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}b.packedLength=W.Rectangle.packedLength+W.Ellipsoid.packedLength+rt.VertexFormat.packedLength+7,b.pack=function(t,e,a){return a=Q.defaultValue(a,0),W.Rectangle.pack(t._rectangle,e,a),a+=W.Rectangle.packedLength,W.Ellipsoid.pack(t._ellipsoid,e,a),a+=W.Ellipsoid.packedLength,rt.VertexFormat.pack(t._vertexFormat,e,a),a+=rt.VertexFormat.packedLength,e[a++]=t._granularity,e[a++]=t._surfaceHeight,e[a++]=t._rotation,e[a++]=t._stRotation,e[a++]=t._extrudedHeight,e[a++]=t._shadowVolume?1:0,e[a]=Q.defaultValue(t._offsetAttribute,-1),e};var v=new W.Rectangle,_=W.Ellipsoid.clone(W.Ellipsoid.UNIT_SPHERE),A={rectangle:v,ellipsoid:_,vertexFormat:gt,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};b.unpack=function(t,e,a){e=Q.defaultValue(e,0);var r=W.Rectangle.unpack(t,e,v);e+=W.Rectangle.packedLength;var n=W.Ellipsoid.unpack(t,e,_);e+=W.Ellipsoid.packedLength;var i=rt.VertexFormat.unpack(t,e,gt);e+=rt.VertexFormat.packedLength;var o=t[e++],s=t[e++],l=t[e++],u=t[e++],c=t[e++],m=1===t[e++],e=t[e];return Q.defined(a)?(a._rectangle=W.Rectangle.clone(r,a._rectangle),a._ellipsoid=W.Ellipsoid.clone(n,a._ellipsoid),a._vertexFormat=rt.VertexFormat.clone(i,a._vertexFormat),a._granularity=o,a._surfaceHeight=s,a._rotation=l,a._stRotation=u,a._extrudedHeight=c,a._shadowVolume=m,a._offsetAttribute=-1===e?void 0:e,a):(A.granularity=o,A.height=s,A.rotation=l,A.stRotation=u,A.extrudedHeight=c,A.shadowVolume=m,A.offsetAttribute=-1===e?void 0:e,new b(A))},b.computeRectangle=function(t,e){var a=(t=Q.defaultValue(t,Q.defaultValue.EMPTY_OBJECT)).rectangle,r=Q.defaultValue(t.granularity,et.CesiumMath.RADIANS_PER_DEGREE),n=Q.defaultValue(t.ellipsoid,W.Ellipsoid.WGS84);return c(a,r,Q.defaultValue(t.rotation,0),n,e)};var x=new N.Matrix3,w=new N.Quaternion,C=new W.Cartographic;b.createGeometry=function(t){if(!et.CesiumMath.equalsEpsilon(t._rectangle.north,t._rectangle.south,et.CesiumMath.EPSILON10)&&!et.CesiumMath.equalsEpsilon(t._rectangle.east,t._rectangle.west,et.CesiumMath.EPSILON10)){var e=t._rectangle,a=t._ellipsoid,r=t._rotation,n=t._stRotation,i=t._vertexFormat,o=S.RectangleGeometryLibrary.computeOptions(e,t._granularity,r,n,p,f,h),s=x;0!==n||0!==r?(c=W.Rectangle.center(e,C),m=a.geodeticSurfaceNormalCartographic(c,ut),N.Quaternion.fromAxisAngle(m,-n,w),N.Matrix3.fromQuaternion(w,s)):N.Matrix3.clone(N.Matrix3.IDENTITY,s);var l,u,c=t._surfaceHeight,m=t._extrudedHeight,n=!et.CesiumMath.equalsEpsilon(c,m,0,et.CesiumMath.EPSILON2);return o.lonScalar=1/t._rectangle.width,o.latScalar=1/t._rectangle.height,o.tangentRotationMatrix=s,e=t._rectangle,c=n?(l=y(t,o),n=N.BoundingSphere.fromRectangle3D(e,a,c,g),u=N.BoundingSphere.fromRectangle3D(e,a,m,d),N.BoundingSphere.union(n,u)):((l=mt(t,o)).attributes.position.values=at.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,c,a,!1),Q.defined(t._offsetAttribute)&&(u=l.attributes.position.values.length,o=new Uint8Array(u/3),u=t._offsetAttribute===J.GeometryOffsetAttribute.NONE?0:1,J.arrayFill(o,u),l.attributes.applyOffset=new Z.GeometryAttribute({componentDatatype:j.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),N.BoundingSphere.fromRectangle3D(e,a,c)),i.position||delete l.attributes.position,new Z.Geometry({attributes:l.attributes,indices:l.indices,primitiveType:l.primitiveType,boundingSphere:c,offsetAttribute:t._offsetAttribute})}},b.createShadowVolume=function(t,e,a){var r=t._granularity,n=t._ellipsoid,e=e(r,n),a=a(r,n);return new b({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:n,stRotation:t._stRotation,granularity:r,extrudedHeight:a,height:e,vertexFormat:rt.VertexFormat.POSITION_ONLY,shadowVolume:!0})};var m=new W.Rectangle,R=[new W.Cartesian2,new W.Cartesian2,new W.Cartesian2],E=new Z.Matrix2,F=new W.Cartographic;return Object.defineProperties(b.prototype,{rectangle:{get:function(){return Q.defined(this._rotatedRectangle)||(this._rotatedRectangle=c(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return Q.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];var e=W.Rectangle.clone(t._rectangle,m),a=t._granularity,r=t._ellipsoid,e=c(e,a,t._rotation-t._stRotation,r,m),n=R;n[0].x=e.west,n[0].y=e.south,n[1].x=e.west,n[1].y=e.north,n[2].x=e.east,n[2].y=e.south;for(var i=t.rectangle,o=Z.Matrix2.fromRotation(t._stRotation,E),s=W.Rectangle.center(i,F),l=0;l<3;++l){var u=n[l];u.x-=s.longitude,u.y-=s.latitude,Z.Matrix2.multiplyByVector(o,u,u),u.x+=s.longitude,u.y+=s.latitude,u.x=(u.x-i.west)/i.width,u.y=(u.y-i.south)/i.height}return a=n[0],r=n[1],e=n[2],t=new Array(6),W.Cartesian2.pack(a,t),W.Cartesian2.pack(r,t,2),W.Cartesian2.pack(e,t,4),t}(this)),this._textureCoordinateRotationPoints}}}),function(t,e){return(t=Q.defined(e)?b.unpack(t,e):t)._ellipsoid=W.Ellipsoid.clone(t._ellipsoid),t._rectangle=W.Rectangle.clone(t._rectangle),b.createGeometry(t)}}); diff --git a/public/Cesium/Workers/createRectangleOutlineGeometry.js b/public/Cesium/Workers/createRectangleOutlineGeometry.js index 57f02b3..46f5607 100644 --- a/public/Cesium/Workers/createRectangleOutlineGeometry.js +++ b/public/Cesium/Workers/createRectangleOutlineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./ComponentDatatype-9204e9f6","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolygonPipeline-bfd1975b","./RectangleGeometryLibrary-b88eec5f","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./EllipsoidRhumbLine-8cb2e5a4"],function(p,s,d,c,m,e,_,v,E,f,g,A,t,i,a){"use strict";var h=new c.BoundingSphere,y=new c.BoundingSphere,G=new s.Cartesian3,b=new s.Rectangle;function R(e,t){var i=e._ellipsoid,a=t.height,r=t.width,n=t.northCap,o=t.southCap,l=a,u=2,s=0,e=4;n&&(--u,--l,s+=1,e-=2),o&&(--u,--l,s+=1,e-=2),s+=u*r+2*l-e;var p,d=new Float64Array(3*s),c=0,f=0,g=G;if(n)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,0,g),d[c++]=g.x,d[c++]=g.y,d[c++]=g.z;else for(p=0;p<r;p++)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),d[c++]=g.x,d[c++]=g.y,d[c++]=g.z;for(p=r-1,f=1;f<a;f++)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),d[c++]=g.x,d[c++]=g.y,d[c++]=g.z;if(f=a-1,!o)for(p=r-2;0<=p;p--)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),d[c++]=g.x,d[c++]=g.y,d[c++]=g.z;for(p=0,f=a-2;0<f;f--)A.RectangleGeometryLibrary.computePosition(t,i,!1,f,p,g),d[c++]=g.x,d[c++]=g.y,d[c++]=g.z;for(var o=d.length/3*2,h=E.IndexDatatype.createTypedArray(d.length/3,o),y=0,b=0;b<d.length/3-1;b++)h[y++]=b,h[y++]=b+1;h[y++]=d.length/3-1,h[y++]=0;o=new _.Geometry({attributes:new v.GeometryAttributes,primitiveType:_.PrimitiveType.LINES});return o.attributes.position=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d}),o.indices=h,o}function P(e){var t=(e=p.defaultValue(e,p.defaultValue.EMPTY_OBJECT)).rectangle,i=p.defaultValue(e.granularity,f.CesiumMath.RADIANS_PER_DEGREE),a=p.defaultValue(e.ellipsoid,s.Ellipsoid.WGS84),r=p.defaultValue(e.rotation,0),n=p.defaultValue(e.height,0),o=p.defaultValue(e.extrudedHeight,n);this._rectangle=s.Rectangle.clone(t),this._granularity=i,this._ellipsoid=a,this._surfaceHeight=Math.max(n,o),this._rotation=r,this._extrudedHeight=Math.min(n,o),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}P.packedLength=s.Rectangle.packedLength+s.Ellipsoid.packedLength+5,P.pack=function(e,t,i){return i=p.defaultValue(i,0),s.Rectangle.pack(e._rectangle,t,i),i+=s.Rectangle.packedLength,s.Ellipsoid.pack(e._ellipsoid,t,i),i+=s.Ellipsoid.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=p.defaultValue(e._offsetAttribute,-1),t};var w=new s.Rectangle,L=s.Ellipsoid.clone(s.Ellipsoid.UNIT_SPHERE),C={rectangle:w,ellipsoid:L,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};P.unpack=function(e,t,i){t=p.defaultValue(t,0);var a=s.Rectangle.unpack(e,t,w);t+=s.Rectangle.packedLength;var r=s.Ellipsoid.unpack(e,t,L);t+=s.Ellipsoid.packedLength;var n=e[t++],o=e[t++],l=e[t++],u=e[t++],t=e[t];return p.defined(i)?(i._rectangle=s.Rectangle.clone(a,i._rectangle),i._ellipsoid=s.Ellipsoid.clone(r,i._ellipsoid),i._surfaceHeight=o,i._rotation=l,i._extrudedHeight=u,i._offsetAttribute=-1===t?void 0:t,i):(C.granularity=n,C.height=o,C.rotation=l,C.extrudedHeight=u,C.offsetAttribute=-1===t?void 0:t,new P(C))};var D=new s.Cartographic;return P.createGeometry=function(e){var t=e._rectangle,i=e._ellipsoid,a=A.RectangleGeometryLibrary.computeOptions(t,e._granularity,e._rotation,0,b,D);if(!f.CesiumMath.equalsEpsilon(t.north,t.south,f.CesiumMath.EPSILON10)&&!f.CesiumMath.equalsEpsilon(t.east,t.west,f.CesiumMath.EPSILON10)){var r,n,o,l,u=e._surfaceHeight,s=e._extrudedHeight;return u=!f.CesiumMath.equalsEpsilon(u,s,0,f.CesiumMath.EPSILON2)?(n=function(e,t){var i=e._surfaceHeight,a=e._extrudedHeight,r=e._ellipsoid,n=a,o=i,l=R(e,t),a=t.height,i=t.width,u=(e=g.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,o,r,!1)).length;(o=new Float64Array(2*u)).set(e),n=g.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,n,r),o.set(n,u),l.attributes.position.values=o,r=t.northCap,n=t.southCap,t=4,r&&--t,n&&--t;for(var t=2*(o.length/3+t),s=E.IndexDatatype.createTypedArray(o.length/3,t),u=o.length/6,p=0,d=0;d<u-1;d++)s[p++]=d,s[p++]=d+1,s[p++]=d+u,s[p++]=d+u+1;return s[p++]=u-1,s[p++]=0,s[p++]=u+u-1,s[p++]=u,s[p++]=0,s[p++]=u,a=r?a-1:(r=i-1,s[p++]=r,s[p++]=r+u,i+a-2),s[p++]=a,s[p++]=a+u,n||(a=i+a-1,s[p++]=a,s[p]=a+u),l.indices=s,l}(e,a),p.defined(e._offsetAttribute)&&(r=n.attributes.position.values.length/3,o=new Uint8Array(r),o=e._offsetAttribute===d.GeometryOffsetAttribute.TOP?d.arrayFill(o,1,0,r/2):(l=e._offsetAttribute===d.GeometryOffsetAttribute.NONE?0:1,d.arrayFill(o,l)),n.attributes.applyOffset=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),o=c.BoundingSphere.fromRectangle3D(t,i,u,y),s=c.BoundingSphere.fromRectangle3D(t,i,s,h),c.BoundingSphere.union(o,s)):((n=R(e,a)).attributes.position.values=g.PolygonPipeline.scaleToGeodeticHeight(n.attributes.position.values,u,i,!1),p.defined(e._offsetAttribute)&&(a=n.attributes.position.values.length,a=new Uint8Array(a/3),l=e._offsetAttribute===d.GeometryOffsetAttribute.NONE?0:1,d.arrayFill(a,l),n.attributes.applyOffset=new _.GeometryAttribute({componentDatatype:m.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),c.BoundingSphere.fromRectangle3D(t,i,u)),new _.Geometry({attributes:n.attributes,indices:n.indices,primitiveType:_.PrimitiveType.LINES,boundingSphere:u,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=p.defined(t)?P.unpack(e,t):e)._ellipsoid=s.Ellipsoid.clone(e._ellipsoid),e._rectangle=s.Rectangle.clone(e._rectangle),P.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./ComponentDatatype-1a100acd","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./PolygonPipeline-97a7160d","./RectangleGeometryLibrary-57cd4923","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./EllipsoidRhumbLine-2b7999f3"],function(p,s,c,d,b,e,_,v,E,g,f,A,t,i,a){"use strict";var h=new d.BoundingSphere,y=new d.BoundingSphere,G=new s.Cartesian3,m=new s.Rectangle;function R(e,t){var i=e._ellipsoid,a=t.height,r=t.width,n=t.northCap,o=t.southCap,l=a,u=2,s=0,e=4;n&&(--u,--l,s+=1,e-=2),o&&(--u,--l,s+=1,e-=2),s+=u*r+2*l-e;var p,c=new Float64Array(3*s),d=0,g=0,f=G;if(n)A.RectangleGeometryLibrary.computePosition(t,i,!1,g,0,f),c[d++]=f.x,c[d++]=f.y,c[d++]=f.z;else for(p=0;p<r;p++)A.RectangleGeometryLibrary.computePosition(t,i,!1,g,p,f),c[d++]=f.x,c[d++]=f.y,c[d++]=f.z;for(p=r-1,g=1;g<a;g++)A.RectangleGeometryLibrary.computePosition(t,i,!1,g,p,f),c[d++]=f.x,c[d++]=f.y,c[d++]=f.z;if(g=a-1,!o)for(p=r-2;0<=p;p--)A.RectangleGeometryLibrary.computePosition(t,i,!1,g,p,f),c[d++]=f.x,c[d++]=f.y,c[d++]=f.z;for(p=0,g=a-2;0<g;g--)A.RectangleGeometryLibrary.computePosition(t,i,!1,g,p,f),c[d++]=f.x,c[d++]=f.y,c[d++]=f.z;for(var o=c.length/3*2,h=E.IndexDatatype.createTypedArray(c.length/3,o),y=0,m=0;m<c.length/3-1;m++)h[y++]=m,h[y++]=m+1;h[y++]=c.length/3-1,h[y++]=0;o=new _.Geometry({attributes:new v.GeometryAttributes,primitiveType:_.PrimitiveType.LINES});return o.attributes.position=new _.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c}),o.indices=h,o}function P(e){var t=(e=p.defaultValue(e,p.defaultValue.EMPTY_OBJECT)).rectangle,i=p.defaultValue(e.granularity,g.CesiumMath.RADIANS_PER_DEGREE),a=p.defaultValue(e.ellipsoid,s.Ellipsoid.WGS84),r=p.defaultValue(e.rotation,0),n=p.defaultValue(e.height,0),o=p.defaultValue(e.extrudedHeight,n);this._rectangle=s.Rectangle.clone(t),this._granularity=i,this._ellipsoid=a,this._surfaceHeight=Math.max(n,o),this._rotation=r,this._extrudedHeight=Math.min(n,o),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}P.packedLength=s.Rectangle.packedLength+s.Ellipsoid.packedLength+5,P.pack=function(e,t,i){return i=p.defaultValue(i,0),s.Rectangle.pack(e._rectangle,t,i),i+=s.Rectangle.packedLength,s.Ellipsoid.pack(e._ellipsoid,t,i),i+=s.Ellipsoid.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=p.defaultValue(e._offsetAttribute,-1),t};var w=new s.Rectangle,L=s.Ellipsoid.clone(s.Ellipsoid.UNIT_SPHERE),C={rectangle:w,ellipsoid:L,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};P.unpack=function(e,t,i){t=p.defaultValue(t,0);var a=s.Rectangle.unpack(e,t,w);t+=s.Rectangle.packedLength;var r=s.Ellipsoid.unpack(e,t,L);t+=s.Ellipsoid.packedLength;var n=e[t++],o=e[t++],l=e[t++],u=e[t++],t=e[t];return p.defined(i)?(i._rectangle=s.Rectangle.clone(a,i._rectangle),i._ellipsoid=s.Ellipsoid.clone(r,i._ellipsoid),i._surfaceHeight=o,i._rotation=l,i._extrudedHeight=u,i._offsetAttribute=-1===t?void 0:t,i):(C.granularity=n,C.height=o,C.rotation=l,C.extrudedHeight=u,C.offsetAttribute=-1===t?void 0:t,new P(C))};var D=new s.Cartographic;return P.createGeometry=function(e){var t=e._rectangle,i=e._ellipsoid,a=A.RectangleGeometryLibrary.computeOptions(t,e._granularity,e._rotation,0,m,D);if(!g.CesiumMath.equalsEpsilon(t.north,t.south,g.CesiumMath.EPSILON10)&&!g.CesiumMath.equalsEpsilon(t.east,t.west,g.CesiumMath.EPSILON10)){var r,n,o,l,u=e._surfaceHeight,s=e._extrudedHeight;return u=!g.CesiumMath.equalsEpsilon(u,s,0,g.CesiumMath.EPSILON2)?(n=function(e,t){var i=e._surfaceHeight,a=e._extrudedHeight,r=e._ellipsoid,n=a,o=i,l=R(e,t),a=t.height,i=t.width,u=(e=f.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,o,r,!1)).length;(o=new Float64Array(2*u)).set(e),n=f.PolygonPipeline.scaleToGeodeticHeight(l.attributes.position.values,n,r),o.set(n,u),l.attributes.position.values=o,r=t.northCap,n=t.southCap,t=4,r&&--t,n&&--t;for(var t=2*(o.length/3+t),s=E.IndexDatatype.createTypedArray(o.length/3,t),u=o.length/6,p=0,c=0;c<u-1;c++)s[p++]=c,s[p++]=c+1,s[p++]=c+u,s[p++]=c+u+1;return s[p++]=u-1,s[p++]=0,s[p++]=u+u-1,s[p++]=u,s[p++]=0,s[p++]=u,a=r?a-1:(s[p++]=r=i-1,s[p++]=r+u,i+a-2),s[p++]=a,s[p++]=a+u,n||(s[p++]=a=i+a-1,s[p]=a+u),l.indices=s,l}(e,a),p.defined(e._offsetAttribute)&&(r=n.attributes.position.values.length/3,o=new Uint8Array(r),o=e._offsetAttribute===c.GeometryOffsetAttribute.TOP?c.arrayFill(o,1,0,r/2):(l=e._offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(o,l)),n.attributes.applyOffset=new _.GeometryAttribute({componentDatatype:b.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})),o=d.BoundingSphere.fromRectangle3D(t,i,u,y),s=d.BoundingSphere.fromRectangle3D(t,i,s,h),d.BoundingSphere.union(o,s)):((n=R(e,a)).attributes.position.values=f.PolygonPipeline.scaleToGeodeticHeight(n.attributes.position.values,u,i,!1),p.defined(e._offsetAttribute)&&(a=n.attributes.position.values.length,a=new Uint8Array(a/3),l=e._offsetAttribute===c.GeometryOffsetAttribute.NONE?0:1,c.arrayFill(a,l),n.attributes.applyOffset=new _.GeometryAttribute({componentDatatype:b.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})),d.BoundingSphere.fromRectangle3D(t,i,u)),new _.Geometry({attributes:n.attributes,indices:n.indices,primitiveType:_.PrimitiveType.LINES,boundingSphere:u,offsetAttribute:e._offsetAttribute})}},function(e,t){return(e=p.defined(t)?P.unpack(e,t):e)._ellipsoid=s.Ellipsoid.clone(e._ellipsoid),e._rectangle=s.Rectangle.clone(e._rectangle),P.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createSimplePolylineGeometry.js b/public/Cesium/Workers/createSimplePolylineGeometry.js index 54e64fd..bc3a757 100644 --- a/public/Cesium/Workers/createSimplePolylineGeometry.js +++ b/public/Cesium/Workers/createSimplePolylineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./ArcType-dc1c5aee","./Transforms-a73b3b3b","./Color-b0d12252","./ComponentDatatype-9204e9f6","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./PolylinePipeline-232a4d9a","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(L,V,x,S,I,R,e,O,M,U,N,F,o,t,r,a,l,i){"use strict";function y(e){var o=(e=L.defaultValue(e,L.defaultValue.EMPTY_OBJECT)).positions,t=e.colors,r=L.defaultValue(e.colorsPerVertex,!1);this._positions=o,this._colors=t,this._colorsPerVertex=r,this._arcType=L.defaultValue(e.arcType,x.ArcType.GEODESIC),this._granularity=L.defaultValue(e.granularity,N.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=L.defaultValue(e.ellipsoid,V.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";o=1+o.length*V.Cartesian3.packedLength;o+=L.defined(t)?1+t.length*I.Color.packedLength:1,this.packedLength=o+V.Ellipsoid.packedLength+3}y.pack=function(e,o,t){var r;t=L.defaultValue(t,0);var a=e._positions,l=a.length;for(o[t++]=l,r=0;r<l;++r,t+=V.Cartesian3.packedLength)V.Cartesian3.pack(a[r],o,t);var i=e._colors,l=L.defined(i)?i.length:0;for(o[t++]=l,r=0;r<l;++r,t+=I.Color.packedLength)I.Color.pack(i[r],o,t);return V.Ellipsoid.pack(e._ellipsoid,o,t),t+=V.Ellipsoid.packedLength,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o},y.unpack=function(e,o,t){o=L.defaultValue(o,0);for(var r=e[o++],a=new Array(r),l=0;l<r;++l,o+=V.Cartesian3.packedLength)a[l]=V.Cartesian3.unpack(e,o);var i=0<(r=e[o++])?new Array(r):void 0;for(l=0;l<r;++l,o+=I.Color.packedLength)i[l]=I.Color.unpack(e,o);var n=V.Ellipsoid.unpack(e,o);o+=V.Ellipsoid.packedLength;var s=1===e[o++],p=e[o++],d=e[o];return L.defined(t)?(t._positions=a,t._colors=i,t._ellipsoid=n,t._colorsPerVertex=s,t._arcType=p,t._granularity=d,t):new y({positions:a,colors:i,ellipsoid:n,colorsPerVertex:s,arcType:p,granularity:d})};var H=new Array(2),W=new Array(2),Y={positions:H,height:W,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return y.createGeometry=function(e){var o=e._positions,t=e._colors,r=e._colorsPerVertex,a=e._arcType,l=e._granularity,e=e._ellipsoid,i=N.CesiumMath.chordLength(l,e.maximumRadius),n=L.defined(t)&&!r,s=o.length,p=0;if(a===x.ArcType.GEODESIC||a===x.ArcType.RHUMB){var d,y,f=a===x.ArcType.GEODESIC?(d=N.CesiumMath.chordLength(l,e.maximumRadius),y=F.PolylinePipeline.numberOfPoints,F.PolylinePipeline.generateArc):(d=l,y=F.PolylinePipeline.numberOfPointsRhumbLine,F.PolylinePipeline.generateRhumbArc),c=F.PolylinePipeline.extractHeights(o,e),u=Y;if(a===x.ArcType.GEODESIC?u.minDistance=i:u.granularity=l,u.ellipsoid=e,n){for(var h=0,C=0;C<s-1;C++)h+=y(o[C],o[C+1],d)+1;B=new Float64Array(3*h),A=new Uint8Array(4*h),u.positions=H,u.height=W;var T=0;for(C=0;C<s-1;++C){H[0]=o[C],H[1]=o[C+1],W[0]=c[C],W[1]=c[C+1];var g=f(u);if(L.defined(t))for(var m=g.length/3,b=t[C],P=0;P<m;++P)A[T++]=I.Color.floatToByte(b.red),A[T++]=I.Color.floatToByte(b.green),A[T++]=I.Color.floatToByte(b.blue),A[T++]=I.Color.floatToByte(b.alpha);B.set(g,p),p+=g.length}}else if(u.positions=o,u.height=c,B=new Float64Array(f(u)),L.defined(t)){for(A=new Uint8Array(B.length/3*4),C=0;C<s-1;++C)p=function(e,o,t,r,a,l,i){var n=F.PolylinePipeline.numberOfPoints(e,o,a),s=t.red,p=t.green,d=t.blue,y=t.alpha,f=r.red,e=r.green,o=r.blue,a=r.alpha;if(I.Color.equals(t,r)){for(g=0;g<n;g++)l[i++]=I.Color.floatToByte(s),l[i++]=I.Color.floatToByte(p),l[i++]=I.Color.floatToByte(d),l[i++]=I.Color.floatToByte(y);return i}for(var c=(f-s)/n,u=(e-p)/n,h=(o-d)/n,C=(a-y)/n,T=i,g=0;g<n;g++)l[T++]=I.Color.floatToByte(s+g*c),l[T++]=I.Color.floatToByte(p+g*u),l[T++]=I.Color.floatToByte(d+g*h),l[T++]=I.Color.floatToByte(y+g*C);return T}(o[C],o[C+1],t[C],t[C+1],i,A,p);var _=t[s-1];A[p++]=I.Color.floatToByte(_.red),A[p++]=I.Color.floatToByte(_.green),A[p++]=I.Color.floatToByte(_.blue),A[p++]=I.Color.floatToByte(_.alpha)}}else{var v=n?2*s-2:s,B=new Float64Array(3*v),A=L.defined(t)?new Uint8Array(4*v):void 0,E=0,k=0;for(C=0;C<s;++C){var G=o[C];if(n&&0<C&&(V.Cartesian3.pack(G,B,E),E+=3,b=t[C-1],A[k++]=I.Color.floatToByte(b.red),A[k++]=I.Color.floatToByte(b.green),A[k++]=I.Color.floatToByte(b.blue),A[k++]=I.Color.floatToByte(b.alpha)),n&&C===s-1)break;V.Cartesian3.pack(G,B,E),E+=3,L.defined(t)&&(b=t[C],A[k++]=I.Color.floatToByte(b.red),A[k++]=I.Color.floatToByte(b.green),A[k++]=I.Color.floatToByte(b.blue),A[k++]=I.Color.floatToByte(b.alpha))}}e=new M.GeometryAttributes;e.position=new O.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:B}),L.defined(t)&&(e.color=new O.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0}));var _=2*((v=B.length/3)-1),w=U.IndexDatatype.createTypedArray(v,_),D=0;for(C=0;C<v-1;++C)w[D++]=C,w[D++]=C+1;return new O.Geometry({attributes:e,indices:w,primitiveType:O.PrimitiveType.LINES,boundingSphere:S.BoundingSphere.fromPoints(o)})},function(e,o){return(e=L.defined(o)?y.unpack(e,o):e)._ellipsoid=V.Ellipsoid.clone(e._ellipsoid),y.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./ArcType-2b58731c","./Transforms-79117a7b","./Color-98c5f877","./ComponentDatatype-1a100acd","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./PolylinePipeline-3803a6c2","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(L,V,x,S,I,R,e,O,M,U,N,F,o,t,r,a,l,i){"use strict";function d(e){var o=(e=L.defaultValue(e,L.defaultValue.EMPTY_OBJECT)).positions,t=e.colors,r=L.defaultValue(e.colorsPerVertex,!1);this._positions=o,this._colors=t,this._colorsPerVertex=r,this._arcType=L.defaultValue(e.arcType,x.ArcType.GEODESIC),this._granularity=L.defaultValue(e.granularity,N.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=L.defaultValue(e.ellipsoid,V.Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";o=1+o.length*V.Cartesian3.packedLength;o+=L.defined(t)?1+t.length*I.Color.packedLength:1,this.packedLength=o+V.Ellipsoid.packedLength+3}d.pack=function(e,o,t){var r;t=L.defaultValue(t,0);var a=e._positions,l=a.length;for(o[t++]=l,r=0;r<l;++r,t+=V.Cartesian3.packedLength)V.Cartesian3.pack(a[r],o,t);var i=e._colors,l=L.defined(i)?i.length:0;for(o[t++]=l,r=0;r<l;++r,t+=I.Color.packedLength)I.Color.pack(i[r],o,t);return V.Ellipsoid.pack(e._ellipsoid,o,t),t+=V.Ellipsoid.packedLength,o[t++]=e._colorsPerVertex?1:0,o[t++]=e._arcType,o[t]=e._granularity,o},d.unpack=function(e,o,t){o=L.defaultValue(o,0);for(var r=e[o++],a=new Array(r),l=0;l<r;++l,o+=V.Cartesian3.packedLength)a[l]=V.Cartesian3.unpack(e,o);var i=0<(r=e[o++])?new Array(r):void 0;for(l=0;l<r;++l,o+=I.Color.packedLength)i[l]=I.Color.unpack(e,o);var n=V.Ellipsoid.unpack(e,o);o+=V.Ellipsoid.packedLength;var s=1===e[o++],p=e[o++],c=e[o];return L.defined(t)?(t._positions=a,t._colors=i,t._ellipsoid=n,t._colorsPerVertex=s,t._arcType=p,t._granularity=c,t):new d({positions:a,colors:i,ellipsoid:n,colorsPerVertex:s,arcType:p,granularity:c})};var H=new Array(2),W=new Array(2),Y={positions:H,height:W,ellipsoid:void 0,minDistance:void 0,granularity:void 0};return d.createGeometry=function(e){var o=e._positions,t=e._colors,r=e._colorsPerVertex,a=e._arcType,l=e._granularity,e=e._ellipsoid,i=N.CesiumMath.chordLength(l,e.maximumRadius),n=L.defined(t)&&!r,s=o.length,p=0;if(a===x.ArcType.GEODESIC||a===x.ArcType.RHUMB){var c,d,y=a===x.ArcType.GEODESIC?(c=N.CesiumMath.chordLength(l,e.maximumRadius),d=F.PolylinePipeline.numberOfPoints,F.PolylinePipeline.generateArc):(c=l,d=F.PolylinePipeline.numberOfPointsRhumbLine,F.PolylinePipeline.generateRhumbArc),f=F.PolylinePipeline.extractHeights(o,e),u=Y;if(a===x.ArcType.GEODESIC?u.minDistance=i:u.granularity=l,u.ellipsoid=e,n){for(var h=0,C=0;C<s-1;C++)h+=d(o[C],o[C+1],c)+1;B=new Float64Array(3*h),A=new Uint8Array(4*h),u.positions=H,u.height=W;var T=0;for(C=0;C<s-1;++C){H[0]=o[C],H[1]=o[C+1],W[0]=f[C],W[1]=f[C+1];var g=y(u);if(L.defined(t))for(var m=g.length/3,P=t[C],_=0;_<m;++_)A[T++]=I.Color.floatToByte(P.red),A[T++]=I.Color.floatToByte(P.green),A[T++]=I.Color.floatToByte(P.blue),A[T++]=I.Color.floatToByte(P.alpha);B.set(g,p),p+=g.length}}else if(u.positions=o,u.height=f,B=new Float64Array(y(u)),L.defined(t)){for(A=new Uint8Array(B.length/3*4),C=0;C<s-1;++C)p=function(e,o,t,r,a,l,i){var n=F.PolylinePipeline.numberOfPoints(e,o,a),s=t.red,p=t.green,c=t.blue,d=t.alpha,y=r.red,e=r.green,o=r.blue,a=r.alpha;if(I.Color.equals(t,r)){for(g=0;g<n;g++)l[i++]=I.Color.floatToByte(s),l[i++]=I.Color.floatToByte(p),l[i++]=I.Color.floatToByte(c),l[i++]=I.Color.floatToByte(d);return i}for(var f=(y-s)/n,u=(e-p)/n,h=(o-c)/n,C=(a-d)/n,T=i,g=0;g<n;g++)l[T++]=I.Color.floatToByte(s+g*f),l[T++]=I.Color.floatToByte(p+g*u),l[T++]=I.Color.floatToByte(c+g*h),l[T++]=I.Color.floatToByte(d+g*C);return T}(o[C],o[C+1],t[C],t[C+1],i,A,p);var v=t[s-1];A[p++]=I.Color.floatToByte(v.red),A[p++]=I.Color.floatToByte(v.green),A[p++]=I.Color.floatToByte(v.blue),A[p++]=I.Color.floatToByte(v.alpha)}}else{var b=n?2*s-2:s,B=new Float64Array(3*b),A=L.defined(t)?new Uint8Array(4*b):void 0,E=0,k=0;for(C=0;C<s;++C){var G=o[C];if(n&&0<C&&(V.Cartesian3.pack(G,B,E),E+=3,P=t[C-1],A[k++]=I.Color.floatToByte(P.red),A[k++]=I.Color.floatToByte(P.green),A[k++]=I.Color.floatToByte(P.blue),A[k++]=I.Color.floatToByte(P.alpha)),n&&C===s-1)break;V.Cartesian3.pack(G,B,E),E+=3,L.defined(t)&&(P=t[C],A[k++]=I.Color.floatToByte(P.red),A[k++]=I.Color.floatToByte(P.green),A[k++]=I.Color.floatToByte(P.blue),A[k++]=I.Color.floatToByte(P.alpha))}}v=new M.GeometryAttributes;v.position=new O.GeometryAttribute({componentDatatype:R.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:B}),L.defined(t)&&(v.color=new O.GeometryAttribute({componentDatatype:R.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0})),b=B.length/3;var w=U.IndexDatatype.createTypedArray(b,2*(b-1)),D=0;for(C=0;C<b-1;++C)w[D++]=C,w[D++]=C+1;return new O.Geometry({attributes:v,indices:w,primitiveType:O.PrimitiveType.LINES,boundingSphere:S.BoundingSphere.fromPoints(o)})},function(e,o){return(e=L.defined(o)?d.unpack(e,o):e)._ellipsoid=V.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createSphereGeometry.js b/public/Cesium/Workers/createSphereGeometry.js index a587653..358b000 100644 --- a/public/Cesium/Workers/createSphereGeometry.js +++ b/public/Cesium/Workers/createSphereGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./Check-d18af7c4","./EllipsoidGeometry-cb484b79","./VertexFormat-e8cbf5b3","./Math-4e53b694","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6"],function(i,a,e,o,n,t,r,s,d,c,l,m,u,p){"use strict";function f(e){var t=i.defaultValue(e.radius,1),e={radii:new a.Cartesian3(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new o.EllipsoidGeometry(e),this._workerName="createSphereGeometry"}f.packedLength=o.EllipsoidGeometry.packedLength,f.pack=function(e,t,r){return o.EllipsoidGeometry.pack(e._ellipsoidGeometry,t,r)};var y=new o.EllipsoidGeometry,G={radius:void 0,radii:new a.Cartesian3,vertexFormat:new n.VertexFormat,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(e,t,r){t=o.EllipsoidGeometry.unpack(e,t,y);return G.vertexFormat=n.VertexFormat.clone(t._vertexFormat,G.vertexFormat),G.stackPartitions=t._stackPartitions,G.slicePartitions=t._slicePartitions,i.defined(r)?(a.Cartesian3.clone(t._radii,G.radii),r._ellipsoidGeometry=new o.EllipsoidGeometry(G),r):(G.radius=t._radii.x,new f(G))},f.createGeometry=function(e){return o.EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},function(e,t){return i.defined(t)&&(e=f.unpack(e,t)),f.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./Check-24483042","./EllipsoidGeometry-8e9adb8a","./VertexFormat-81ec7207","./Math-d6182036","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78"],function(i,a,e,o,n,t,r,s,c,d,l,m,u,p){"use strict";function y(e){var t=i.defaultValue(e.radius,1),e={radii:new a.Cartesian3(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new o.EllipsoidGeometry(e),this._workerName="createSphereGeometry"}y.packedLength=o.EllipsoidGeometry.packedLength,y.pack=function(e,t,r){return o.EllipsoidGeometry.pack(e._ellipsoidGeometry,t,r)};var G=new o.EllipsoidGeometry,f={radius:void 0,radii:new a.Cartesian3,vertexFormat:new n.VertexFormat,stackPartitions:void 0,slicePartitions:void 0};return y.unpack=function(e,t,r){t=o.EllipsoidGeometry.unpack(e,t,G);return f.vertexFormat=n.VertexFormat.clone(t._vertexFormat,f.vertexFormat),f.stackPartitions=t._stackPartitions,f.slicePartitions=t._slicePartitions,i.defined(r)?(a.Cartesian3.clone(t._radii,f.radii),r._ellipsoidGeometry=new o.EllipsoidGeometry(f),r):(f.radius=t._radii.x,new y(f))},y.createGeometry=function(e){return o.EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},function(e,t){return i.defined(t)&&(e=y.unpack(e,t)),y.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createSphereOutlineGeometry.js b/public/Cesium/Workers/createSphereOutlineGeometry.js index cfb5266..9a0b340 100644 --- a/public/Cesium/Workers/createSphereOutlineGeometry.js +++ b/public/Cesium/Workers/createSphereOutlineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./Check-d18af7c4","./EllipsoidOutlineGeometry-dd7f7ad1","./Math-4e53b694","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6"],function(r,n,e,s,i,t,o,a,d,l,u,c,m){"use strict";function p(e){var i=r.defaultValue(e.radius,1),e={radii:new n.Cartesian3(i,i,i),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new s.EllipsoidOutlineGeometry(e),this._workerName="createSphereOutlineGeometry"}p.packedLength=s.EllipsoidOutlineGeometry.packedLength,p.pack=function(e,i,t){return s.EllipsoidOutlineGeometry.pack(e._ellipsoidGeometry,i,t)};var f=new s.EllipsoidOutlineGeometry,y={radius:void 0,radii:new n.Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,i,t){i=s.EllipsoidOutlineGeometry.unpack(e,i,f);return y.stackPartitions=i._stackPartitions,y.slicePartitions=i._slicePartitions,y.subdivisions=i._subdivisions,r.defined(t)?(n.Cartesian3.clone(i._radii,y.radii),t._ellipsoidGeometry=new s.EllipsoidOutlineGeometry(y),t):(y.radius=i._radii.x,new p(y))},p.createGeometry=function(e){return s.EllipsoidOutlineGeometry.createGeometry(e._ellipsoidGeometry)},function(e,i){return r.defined(i)&&(e=p.unpack(e,i)),p.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./Check-24483042","./EllipsoidOutlineGeometry-b505f2ae","./Math-d6182036","./GeometryOffsetAttribute-718fa138","./Transforms-79117a7b","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78"],function(r,n,e,a,i,t,s,o,d,l,u,c,m){"use strict";function p(e){var i=r.defaultValue(e.radius,1),e={radii:new n.Cartesian3(i,i,i),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new a.EllipsoidOutlineGeometry(e),this._workerName="createSphereOutlineGeometry"}p.packedLength=a.EllipsoidOutlineGeometry.packedLength,p.pack=function(e,i,t){return a.EllipsoidOutlineGeometry.pack(e._ellipsoidGeometry,i,t)};var y=new a.EllipsoidOutlineGeometry,G={radius:void 0,radii:new n.Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,i,t){i=a.EllipsoidOutlineGeometry.unpack(e,i,y);return G.stackPartitions=i._stackPartitions,G.slicePartitions=i._slicePartitions,G.subdivisions=i._subdivisions,r.defined(t)?(n.Cartesian3.clone(i._radii,G.radii),t._ellipsoidGeometry=new a.EllipsoidOutlineGeometry(G),t):(G.radius=i._radii.x,new p(G))},p.createGeometry=function(e){return a.EllipsoidOutlineGeometry.createGeometry(e._ellipsoidGeometry)},function(e,i){return r.defined(i)&&(e=p.unpack(e,i)),p.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createTaskProcessorWorker.js b/public/Cesium/Workers/createTaskProcessorWorker.js index 9b2c3eb..c2a26f3 100644 --- a/public/Cesium/Workers/createTaskProcessorWorker.js +++ b/public/Cesium/Workers/createTaskProcessorWorker.js @@ -1 +1 @@ -define(["./when-208fe5b0"],function(f){"use strict";return function(r){var o;return function(e){var s=e.data,a=[],i={id:s.id,result:void 0,error:void 0};return f.when(function(e,r,n){try{return e(r,n)}catch(e){return f.when.reject(e)}}(r,s.parameters,a)).then(function(e){i.result=e}).otherwise(function(e){e instanceof Error?i.error={name:e.name,message:e.message,stack:e.stack}:i.error=e}).always(function(){f.defined(o)||(o=f.defaultValue(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{o(i,a)}catch(e){i.result=void 0,i.error="postMessage failed with error: "+(n=(r=e).name,t=r.message,t=f.defined(n)&&f.defined(t)?n+": "+t:r.toString(),r=r.stack,f.defined(r)&&(t+="\n"+r),t)+"\n with responseMessage: "+JSON.stringify(i),o(i)}var r,n,t})}}}); +define(["./when-54335d57"],function(f){"use strict";return function(r){var o;return function(e){var s=e.data,a=[],i={id:s.id,result:void 0,error:void 0};return f.when(function(e,r,n){try{return e(r,n)}catch(e){return f.when.reject(e)}}(r,s.parameters,a)).then(function(e){i.result=e}).otherwise(function(e){e instanceof Error?i.error={name:e.name,message:e.message,stack:e.stack}:i.error=e}).always(function(){f.defined(o)||(o=f.defaultValue(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{o(i,a)}catch(e){i.result=void 0,i.error="postMessage failed with error: "+(n=(r=e).name,t=r.message,t=f.defined(n)&&f.defined(t)?n+": "+t:r.toString(),r=r.stack,f.defined(r)&&(t+="\n"+r),t)+"\n with responseMessage: "+JSON.stringify(i),o(i)}var r,n,t})}}}); diff --git a/public/Cesium/Workers/createVectorTileClampedPolylines.js b/public/Cesium/Workers/createVectorTileClampedPolylines.js new file mode 100644 index 0000000..2658507 --- /dev/null +++ b/public/Cesium/Workers/createVectorTileClampedPolylines.js @@ -0,0 +1 @@ +define(["./AttributeCompression-10c27d9c","./Cartesian2-8646c5a1","./IndexDatatype-82ceea78","./Math-d6182036","./createTaskProcessorWorker","./Check-24483042","./when-54335d57","./WebGLConstants-95ceb4e9"],function(B,R,U,T,a,e,t,r){"use strict";var V=32767,i=Math.cos(T.CesiumMath.toRadians(150)),W=new R.Cartographic,q=new R.Cartesian3;var z=new R.Cartographic,L=new R.Cartographic;function _(a){var e=8*a,t=3*e,r=4*e;this.startEllipsoidNormals=new Float32Array(t),this.endEllipsoidNormals=new Float32Array(t),this.startPositionAndHeights=new Float32Array(r),this.startFaceNormalAndVertexCornerIds=new Float32Array(r),this.endPositionAndHeights=new Float32Array(r),this.endFaceNormalAndHalfWidths=new Float32Array(r),this.vertexBatchIds=new Uint16Array(e),this.indices=U.IndexDatatype.createTypedArray(e,36*a),this.vec3Offset=0,this.vec4Offset=0,this.batchIdOffset=0,this.indexOffset=0,this.volumeStartIndex=0}var o=new R.Cartesian3,d=new R.Cartesian3;function H(a,e,t,r,s){var n=R.Cartesian3.subtract(t,e,d),t=R.Cartesian3.subtract(e,a,o);return R.Cartesian3.normalize(n,n),R.Cartesian3.normalize(t,t),R.Cartesian3.dot(n,t)<i&&(t=R.Cartesian3.multiplyByScalar(t,-1,o)),R.Cartesian3.add(n,t,s),R.Cartesian3.equals(s,R.Cartesian3.ZERO)&&(s=R.Cartesian3.subtract(a,e)),R.Cartesian3.cross(s,r,s),R.Cartesian3.cross(r,s,s),R.Cartesian3.normalize(s,s),s}var O=[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],P=O.length,S=new R.Cartesian3,D=new R.Cartesian3,M=new R.Cartesian3,G=new R.Cartesian3,Z=new R.Cartesian3;_.prototype.addVolume=function(a,e,t,r,s,n,i,o,d,l){for(var c=R.Cartesian3.add(e,d,S),h=l.geodeticSurfaceNormal(c,D),c=R.Cartesian3.add(t,d,S),f=l.geodeticSurfaceNormal(c,G),u=H(a,e,t,h,M),C=H(r,t,e,f,Z),p=this.startEllipsoidNormals,m=this.endEllipsoidNormals,A=this.startPositionAndHeights,v=this.startFaceNormalAndVertexCornerIds,w=this.endPositionAndHeights,b=this.endFaceNormalAndHalfWidths,g=this.vertexBatchIds,N=this.batchIdOffset,y=this.vec3Offset,k=this.vec4Offset,I=0;I<8;I++)R.Cartesian3.pack(h,p,y),R.Cartesian3.pack(f,m,y),R.Cartesian3.pack(e,A,k),A[k+3]=s,R.Cartesian3.pack(t,w,k),w[k+3]=n,R.Cartesian3.pack(u,v,k),v[k+3]=I,R.Cartesian3.pack(C,b,k),b[k+3]=i,g[N++]=o,y+=3,k+=4;this.batchIdOffset=N,this.vec3Offset=y,this.vec4Offset=k;var x=this.indices,E=this.volumeStartIndex,F=this.indexOffset;for(I=0;I<P;I++)x[F+I]=O[I]+E;this.volumeStartIndex+=8,this.indexOffset+=P};var Y=new R.Rectangle,j=new R.Ellipsoid,J=new R.Cartesian3,K=new R.Cartesian3,Q=new R.Cartesian3,X=new R.Cartesian3,$=new R.Cartesian3;return a(function(a,e){var t=new Uint16Array(a.positions),r=new Uint16Array(a.widths),s=new Uint32Array(a.counts),n=new Uint16Array(a.batchIds),i=Y,o=j,d=J,l=new Float64Array(a.packedBuffer),c=0,h=l[c++],f=l[c++];R.Rectangle.unpack(l,2,i),c+=R.Rectangle.packedLength,R.Ellipsoid.unpack(l,c,o),c+=R.Ellipsoid.packedLength,R.Cartesian3.unpack(l,c,d);var a=t.length/3,l=t.subarray(0,a),c=t.subarray(a,2*a),u=t.subarray(2*a,3*a);B.AttributeCompression.zigZagDeltaDecode(l,c,u),function(a,e,t,r){for(var s=r.length,n=a.length,i=new Uint8Array(n),o=z,d=L,l=0,c=0;c<s;c++){for(var h=r[c],f=h,u=1;u<h;u++){var C=l+u,p=C-1;d.longitude=a[C],d.latitude=e[C],o.longitude=a[p],o.latitude=e[p],R.Cartographic.equals(d,o)&&(f--,i[p]=1)}r[c]=f,l+=h}for(var m=0,A=0;A<n;A++)1!==i[A]&&(a[m]=a[A],e[m]=e[A],t[m]=t[A],m++)}(l,c,u,s);for(var C=s.length,p=0,m=0;m<C;m++)p+=s[m]-1;var A=new _(p),v=function(a,e,t,r,s,n,i,o){for(var d=a.length,l=new Float32Array(3*d),c=0;c<d;++c){var h=a[c],f=e[c],u=t[c],h=T.CesiumMath.lerp(r.west,r.east,h/V),f=T.CesiumMath.lerp(r.south,r.north,f/V),u=T.CesiumMath.lerp(s,n,u/V),u=R.Cartographic.fromRadians(h,f,u,W),u=i.cartographicToCartesian(u,q),u=R.Cartesian3.subtract(u,o,q);R.Cartesian3.pack(u,l,3*c)}return l}(l,c,u,i,h,f,o,d),w=0,b=0;for(m=0;m<C;m++){for(var g=s[m]-1,N=.5*r[m],y=n[m],k=w,I=0;I<g;I++){var x=R.Cartesian3.unpack(v,w,Q),E=R.Cartesian3.unpack(v,w+3,X),F=u[b],H=u[b+1],F=T.CesiumMath.lerp(h,f,F/V),H=T.CesiumMath.lerp(h,f,H/V);b++;var O,P,S,D=K,M=$;0===I?(P=R.Cartesian3.unpack(v,O=k+3*g,K),R.Cartesian3.equals(P,x)?R.Cartesian3.unpack(v,O-3,D):(S=R.Cartesian3.subtract(x,E,K),D=R.Cartesian3.add(S,x,K))):R.Cartesian3.unpack(v,w-3,D),I===g-1?(S=R.Cartesian3.unpack(v,k,$),R.Cartesian3.equals(S,E)?R.Cartesian3.unpack(v,k+3,M):(S=R.Cartesian3.subtract(E,x,$),M=R.Cartesian3.add(S,E,$))):R.Cartesian3.unpack(v,w+6,M),A.addVolume(D,x,E,M,F,H,N,y,d,o),w+=3}w+=3,b++}return i=A.indices,e.push(A.startEllipsoidNormals.buffer),e.push(A.endEllipsoidNormals.buffer),e.push(A.startPositionAndHeights.buffer),e.push(A.startFaceNormalAndVertexCornerIds.buffer),e.push(A.endPositionAndHeights.buffer),e.push(A.endFaceNormalAndHalfWidths.buffer),e.push(A.vertexBatchIds.buffer),e.push(i.buffer),{indexDatatype:2===i.BYTES_PER_ELEMENT?U.IndexDatatype.UNSIGNED_SHORT:U.IndexDatatype.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:i.buffer}})}); diff --git a/public/Cesium/Workers/createVectorTileGeometries.js b/public/Cesium/Workers/createVectorTileGeometries.js index e7c2e30..001e772 100644 --- a/public/Cesium/Workers/createVectorTileGeometries.js +++ b/public/Cesium/Workers/createVectorTileGeometries.js @@ -1 +1 @@ -define(["./Transforms-a73b3b3b","./BoxGeometry-c7d4febc","./Cartesian2-8417ca3d","./Color-b0d12252","./CylinderGeometry-7778847f","./when-208fe5b0","./EllipsoidGeometry-cb484b79","./IndexDatatype-d47ad6f6","./createTaskProcessorWorker","./Check-d18af7c4","./Math-4e53b694","./RuntimeError-7f634f5d","./GeometryOffsetAttribute-def3b741","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./VertexFormat-e8cbf5b3","./CylinderGeometryLibrary-daf6cec5"],function(S,k,T,V,M,F,B,w,e,t,n,r,a,i,o,d,s,c,f){"use strict";function R(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var l=new T.Cartesian3,u=S.Matrix4.packedLength+T.Cartesian3.packedLength,h=S.Matrix4.packedLength+2,b=S.Matrix4.packedLength+T.Cartesian3.packedLength,p=T.Cartesian3.packedLength+1,y={modelMatrix:new S.Matrix4,boundingVolume:new S.BoundingSphere};function A(e,t){var n=t*u,t=T.Cartesian3.unpack(e,n,l);n+=T.Cartesian3.packedLength;n=S.Matrix4.unpack(e,n,y.modelMatrix);S.Matrix4.multiplyByScale(n,t,n);n=y.boundingVolume;return T.Cartesian3.clone(T.Cartesian3.ZERO,n.center),n.radius=Math.sqrt(3),y}function O(e,t){var n=t*h,r=e[n++],t=e[n++],t=T.Cartesian3.fromElements(r,r,t,l),n=S.Matrix4.unpack(e,n,y.modelMatrix);S.Matrix4.multiplyByScale(n,t,n);n=y.boundingVolume;return T.Cartesian3.clone(T.Cartesian3.ZERO,n.center),n.radius=Math.sqrt(2),y}function L(e,t){var n=t*b,t=T.Cartesian3.unpack(e,n,l);n+=T.Cartesian3.packedLength;n=S.Matrix4.unpack(e,n,y.modelMatrix);S.Matrix4.multiplyByScale(n,t,n);n=y.boundingVolume;return T.Cartesian3.clone(T.Cartesian3.ZERO,n.center),n.radius=1,y}function E(e,t){var n=t*p,t=e[n++],n=T.Cartesian3.unpack(e,n,l),n=S.Matrix4.fromTranslation(n,y.modelMatrix);S.Matrix4.multiplyByUniformScale(n,t,n);n=y.boundingVolume;return T.Cartesian3.clone(T.Cartesian3.ZERO,n.center),n.radius=1,y}var Z=new T.Cartesian3;function U(e,t,n,r,a){if(F.defined(t)){for(var i=n.length,o=r.attributes.position.values,d=r.indices,s=e.positions,c=e.vertexBatchIds,f=e.indices,l=e.batchIds,u=e.batchTableColors,h=e.batchedIndices,b=e.indexOffsets,p=e.indexCounts,y=e.boundingVolumes,x=e.modelMatrix,g=e.center,C=e.positionOffset,m=e.batchIdIndex,v=e.indexOffset,I=e.batchedIndicesOffset,k=0;k<i;++k){var M=a(t,k),B=M.modelMatrix;S.Matrix4.multiply(x,B,B);for(var w=n[k],A=o.length,O=0;O<A;O+=3){var L=T.Cartesian3.unpack(o,O,Z);S.Matrix4.multiplyByPoint(B,L,L),T.Cartesian3.subtract(L,g,L),T.Cartesian3.pack(L,s,3*C+O),c[m++]=w}for(var E=d.length,U=0;U<E;++U)f[v+U]=d[U]+C;var G=k+I;h[G]=new R({offset:v,count:E,color:V.Color.fromRgba(u[w]),batchIds:[w]}),l[G]=w,b[G]=v,p[G]=E,y[G]=S.BoundingSphere.transform(M.boundingVolume,B),C+=A/3,v+=E}e.positionOffset=C,e.batchIdIndex=m,e.indexOffset=v,e.batchedIndicesOffset+=i}}var G=new T.Cartesian3,D=new S.Matrix4;function P(e,t,n){var r=n.length,a=2+r*S.BoundingSphere.packedLength+1+function(e){for(var t=e.length,n=0,r=0;r<t;++r)n+=V.Color.packedLength+3+e[r].batchIds.length;return n}(t),i=new Float64Array(a),o=0;i[o++]=e,i[o++]=r;for(var d=0;d<r;++d)S.BoundingSphere.pack(n[d],i,o),o+=S.BoundingSphere.packedLength;var s=t.length;i[o++]=s;for(var c=0;c<s;++c){var f=t[c];V.Color.pack(f.color,i,o),o+=V.Color.packedLength,i[o++]=f.offset,i[o++]=f.count;var l=f.batchIds,u=l.length;i[o++]=u;for(var h=0;h<u;++h)i[o++]=l[h]}return i}return e(function(e,t){var n=F.defined(e.boxes)?new Float32Array(e.boxes):void 0,r=F.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,a=F.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,i=F.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,o=F.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,d=F.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,s=F.defined(e.spheres)?new Float32Array(e.spheres):void 0,c=F.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,f=F.defined(n)?r.length:0,l=F.defined(a)?i.length:0,u=F.defined(o)?d.length:0,h=F.defined(s)?c.length:0,b=k.BoxGeometry.getUnitBox(),p=M.CylinderGeometry.getUnitCylinder(),y=B.EllipsoidGeometry.getUnitEllipsoid(),x=b.attributes.position.values,g=p.attributes.position.values,C=y.attributes.position.values,m=x.length*f;m+=g.length*l,m+=C.length*(u+h);var v=b.indices,I=p.indices,x=y.indices,g=v.length*f;return g+=I.length*l,g+=x.length*(u+h),C=new Float32Array(m),v=new Uint16Array(m/3),I=w.IndexDatatype.createTypedArray(m/3,g),x=f+l+u+h,m=new Uint16Array(x),g=new Array(x),f=new Uint32Array(x),l=new Uint32Array(x),u=new Array(x),h=e.packedBuffer,x=new Float64Array(h),h=0,T.Cartesian3.unpack(x,0,G),h+=T.Cartesian3.packedLength,S.Matrix4.unpack(x,h,D),U(e={batchTableColors:new Uint32Array(e.batchTableColors),positions:C,vertexBatchIds:v,indices:I,batchIds:m,batchedIndices:g,indexOffsets:f,indexCounts:l,boundingVolumes:u,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:D,center:G},n,r,b,A),U(e,a,i,p,O),U(e,o,d,y,L),U(e,s,c,y,E),u=P(I.BYTES_PER_ELEMENT,g,u),t.push(C.buffer,v.buffer,I.buffer),t.push(m.buffer,f.buffer,l.buffer),t.push(u.buffer),{positions:C.buffer,vertexBatchIds:v.buffer,indices:I.buffer,indexOffsets:f.buffer,indexCounts:l.buffer,batchIds:m.buffer,packedBuffer:u.buffer}})}); +define(["./Transforms-79117a7b","./BoxGeometry-0609cbde","./Cartesian2-8646c5a1","./Color-98c5f877","./CylinderGeometry-a5313e27","./when-54335d57","./EllipsoidGeometry-8e9adb8a","./IndexDatatype-82ceea78","./createTaskProcessorWorker","./Check-24483042","./Math-d6182036","./RuntimeError-88a32665","./GeometryOffsetAttribute-718fa138","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./VertexFormat-81ec7207","./CylinderGeometryLibrary-85e5e690"],function(S,k,T,V,M,F,B,w,e,t,n,r,a,i,o,s,d,c,f){"use strict";function R(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var l=new T.Cartesian3,u=S.Matrix4.packedLength+T.Cartesian3.packedLength,h=S.Matrix4.packedLength+2,p=S.Matrix4.packedLength+T.Cartesian3.packedLength,b=T.Cartesian3.packedLength+1,y={modelMatrix:new S.Matrix4,boundingVolume:new S.BoundingSphere};function A(e,t){var n=t*u,t=T.Cartesian3.unpack(e,n,l);n+=T.Cartesian3.packedLength;n=S.Matrix4.unpack(e,n,y.modelMatrix);S.Matrix4.multiplyByScale(n,t,n);n=y.boundingVolume;return T.Cartesian3.clone(T.Cartesian3.ZERO,n.center),n.radius=Math.sqrt(3),y}function O(e,t){var n=t*h,r=e[n++],t=e[n++],t=T.Cartesian3.fromElements(r,r,t,l),n=S.Matrix4.unpack(e,n,y.modelMatrix);S.Matrix4.multiplyByScale(n,t,n);n=y.boundingVolume;return T.Cartesian3.clone(T.Cartesian3.ZERO,n.center),n.radius=Math.sqrt(2),y}function L(e,t){var n=t*p,t=T.Cartesian3.unpack(e,n,l);n+=T.Cartesian3.packedLength;n=S.Matrix4.unpack(e,n,y.modelMatrix);S.Matrix4.multiplyByScale(n,t,n);n=y.boundingVolume;return T.Cartesian3.clone(T.Cartesian3.ZERO,n.center),n.radius=1,y}function E(e,t){var n=t*b,t=e[n++],n=T.Cartesian3.unpack(e,n,l),n=S.Matrix4.fromTranslation(n,y.modelMatrix);S.Matrix4.multiplyByUniformScale(n,t,n);n=y.boundingVolume;return T.Cartesian3.clone(T.Cartesian3.ZERO,n.center),n.radius=1,y}var Z=new T.Cartesian3;function U(e,t,n,r,a){if(F.defined(t)){for(var i=n.length,o=r.attributes.position.values,s=r.indices,d=e.positions,c=e.vertexBatchIds,f=e.indices,l=e.batchIds,u=e.batchTableColors,h=e.batchedIndices,p=e.indexOffsets,b=e.indexCounts,y=e.boundingVolumes,x=e.modelMatrix,g=e.center,C=e.positionOffset,m=e.batchIdIndex,v=e.indexOffset,I=e.batchedIndicesOffset,k=0;k<i;++k){var M=a(t,k),B=M.modelMatrix;S.Matrix4.multiply(x,B,B);for(var w=n[k],A=o.length,O=0;O<A;O+=3){var L=T.Cartesian3.unpack(o,O,Z);S.Matrix4.multiplyByPoint(B,L,L),T.Cartesian3.subtract(L,g,L),T.Cartesian3.pack(L,d,3*C+O),c[m++]=w}for(var E=s.length,U=0;U<E;++U)f[v+U]=s[U]+C;var G=k+I;h[G]=new R({offset:v,count:E,color:V.Color.fromRgba(u[w]),batchIds:[w]}),l[G]=w,p[G]=v,b[G]=E,y[G]=S.BoundingSphere.transform(M.boundingVolume,B),C+=A/3,v+=E}e.positionOffset=C,e.batchIdIndex=m,e.indexOffset=v,e.batchedIndicesOffset+=i}}var G=new T.Cartesian3,D=new S.Matrix4;function P(e,t,n){var r=n.length,a=2+r*S.BoundingSphere.packedLength+1+function(e){for(var t=e.length,n=0,r=0;r<t;++r)n+=V.Color.packedLength+3+e[r].batchIds.length;return n}(t),i=new Float64Array(a),o=0;i[o++]=e,i[o++]=r;for(var s=0;s<r;++s)S.BoundingSphere.pack(n[s],i,o),o+=S.BoundingSphere.packedLength;var d=t.length;i[o++]=d;for(var c=0;c<d;++c){var f=t[c];V.Color.pack(f.color,i,o),o+=V.Color.packedLength,i[o++]=f.offset,i[o++]=f.count;var l=f.batchIds,u=l.length;i[o++]=u;for(var h=0;h<u;++h)i[o++]=l[h]}return i}return e(function(e,t){var n=F.defined(e.boxes)?new Float32Array(e.boxes):void 0,r=F.defined(e.boxBatchIds)?new Uint16Array(e.boxBatchIds):void 0,a=F.defined(e.cylinders)?new Float32Array(e.cylinders):void 0,i=F.defined(e.cylinderBatchIds)?new Uint16Array(e.cylinderBatchIds):void 0,o=F.defined(e.ellipsoids)?new Float32Array(e.ellipsoids):void 0,s=F.defined(e.ellipsoidBatchIds)?new Uint16Array(e.ellipsoidBatchIds):void 0,d=F.defined(e.spheres)?new Float32Array(e.spheres):void 0,c=F.defined(e.sphereBatchIds)?new Uint16Array(e.sphereBatchIds):void 0,f=F.defined(n)?r.length:0,l=F.defined(a)?i.length:0,u=F.defined(o)?s.length:0,h=F.defined(d)?c.length:0,p=k.BoxGeometry.getUnitBox(),b=M.CylinderGeometry.getUnitCylinder(),y=B.EllipsoidGeometry.getUnitEllipsoid(),x=p.attributes.position.values,g=b.attributes.position.values,C=y.attributes.position.values,m=x.length*f;m+=g.length*l,m+=C.length*(u+h);var v=p.indices,I=b.indices,x=y.indices,g=v.length*f;return g+=I.length*l,g+=x.length*(u+h),C=new Float32Array(m),v=new Uint16Array(m/3),I=w.IndexDatatype.createTypedArray(m/3,g),x=f+l+u+h,m=new Uint16Array(x),g=new Array(x),f=new Uint32Array(x),l=new Uint32Array(x),u=new Array(x),h=e.packedBuffer,x=new Float64Array(h),h=0,T.Cartesian3.unpack(x,0,G),h+=T.Cartesian3.packedLength,S.Matrix4.unpack(x,h,D),U(e={batchTableColors:new Uint32Array(e.batchTableColors),positions:C,vertexBatchIds:v,indices:I,batchIds:m,batchedIndices:g,indexOffsets:f,indexCounts:l,boundingVolumes:u,positionOffset:0,batchIdIndex:0,indexOffset:0,batchedIndicesOffset:0,modelMatrix:D,center:G},n,r,p,A),U(e,a,i,b,O),U(e,o,s,y,L),U(e,d,c,y,E),u=P(I.BYTES_PER_ELEMENT,g,u),t.push(C.buffer,v.buffer,I.buffer),t.push(m.buffer,f.buffer,l.buffer),t.push(u.buffer),{positions:C.buffer,vertexBatchIds:v.buffer,indices:I.buffer,indexOffsets:f.buffer,indexCounts:l.buffer,batchIds:m.buffer,packedBuffer:u.buffer}})}); diff --git a/public/Cesium/Workers/createVectorTilePoints.js b/public/Cesium/Workers/createVectorTilePoints.js index 60f00ea..8760e39 100644 --- a/public/Cesium/Workers/createVectorTilePoints.js +++ b/public/Cesium/Workers/createVectorTilePoints.js @@ -1 +1 @@ -define(["./AttributeCompression-f02ec82f","./Cartesian2-8417ca3d","./Math-4e53b694","./createTaskProcessorWorker","./Check-d18af7c4","./when-208fe5b0"],function(d,g,b,a,e,r){"use strict";var w=32767,k=new g.Cartographic,v=new g.Cartesian3,y=new g.Rectangle,A=new g.Ellipsoid,M={min:void 0,max:void 0};return a(function(a,e){var r=new Uint16Array(a.positions);!function(a){a=new Float64Array(a);var e=0;M.min=a[e++],M.max=a[e++],g.Rectangle.unpack(a,2,y),e+=g.Rectangle.packedLength,g.Ellipsoid.unpack(a,e,A)}(a.packedBuffer);var t=y,n=A,i=M.min,s=M.max,o=r.length/3,c=r.subarray(0,o),u=r.subarray(o,2*o),p=r.subarray(2*o,3*o);d.AttributeCompression.zigZagDeltaDecode(c,u,p);for(var f=new Float64Array(r.length),h=0;h<o;++h){var l=c[h],m=u[h],C=p[h],l=b.CesiumMath.lerp(t.west,t.east,l/w),m=b.CesiumMath.lerp(t.south,t.north,m/w),C=b.CesiumMath.lerp(i,s,C/w),C=g.Cartographic.fromRadians(l,m,C,k),C=n.cartographicToCartesian(C,v);g.Cartesian3.pack(C,f,3*h)}return e.push(f.buffer),{positions:f.buffer}})}); +define(["./AttributeCompression-10c27d9c","./Cartesian2-8646c5a1","./Math-d6182036","./createTaskProcessorWorker","./Check-24483042","./when-54335d57"],function(C,g,w,a,e,r){"use strict";var k=32767,v=new g.Cartographic,b=new g.Cartesian3,y=new g.Rectangle,A=new g.Ellipsoid,M={min:void 0,max:void 0};return a(function(a,e){var r=new Uint16Array(a.positions);!function(a){a=new Float64Array(a);var e=0;M.min=a[e++],M.max=a[e++],g.Rectangle.unpack(a,2,y),e+=g.Rectangle.packedLength,g.Ellipsoid.unpack(a,e,A)}(a.packedBuffer);var t=y,n=A,i=M.min,s=M.max,o=r.length/3,c=r.subarray(0,o),u=r.subarray(o,2*o),p=r.subarray(2*o,3*o);C.AttributeCompression.zigZagDeltaDecode(c,u,p);for(var h=new Float64Array(r.length),l=0;l<o;++l){var d=c[l],f=u[l],m=p[l],d=w.CesiumMath.lerp(t.west,t.east,d/k),f=w.CesiumMath.lerp(t.south,t.north,f/k),m=w.CesiumMath.lerp(i,s,m/k),m=g.Cartographic.fromRadians(d,f,m,v),m=n.cartographicToCartesian(m,b);g.Cartesian3.pack(m,h,3*l)}return e.push(h.buffer),{positions:h.buffer}})}); diff --git a/public/Cesium/Workers/createVectorTilePolygons.js b/public/Cesium/Workers/createVectorTilePolygons.js index bcc2202..901769a 100644 --- a/public/Cesium/Workers/createVectorTilePolygons.js +++ b/public/Cesium/Workers/createVectorTilePolygons.js @@ -1 +1 @@ -define(["./AttributeCompression-f02ec82f","./Cartesian2-8417ca3d","./Color-b0d12252","./when-208fe5b0","./IndexDatatype-d47ad6f6","./Math-4e53b694","./OrientedBoundingBox-18b4901f","./createTaskProcessorWorker","./Check-d18af7c4","./Transforms-a73b3b3b","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(ye,Ie,me,we,ve,xe,Ae,e,a,r,n,t,i,o,s){"use strict";var Ee=new Ie.Cartesian3,Ne=new Ie.Ellipsoid,Te=new Ie.Rectangle,ke={min:void 0,max:void 0,indexBytesPerElement:void 0};function Be(e,a,r){var n=a.length,t=2+n*Ae.OrientedBoundingBox.packedLength+1+function(e){for(var a=e.length,r=0,n=0;n<a;++n)r+=me.Color.packedLength+3+e[n].batchIds.length;return r}(r),i=new Float64Array(t),o=0;i[o++]=e,i[o++]=n;for(var s=0;s<n;++s)Ae.OrientedBoundingBox.pack(a[s],i,o),o+=Ae.OrientedBoundingBox.packedLength;var f=r.length;i[o++]=f;for(var d=0;d<f;++d){var c=r[d];me.Color.pack(c.color,i,o),o+=me.Color.packedLength,i[o++]=c.offset,i[o++]=c.count;var u=c.batchIds,h=u.length;i[o++]=h;for(var l=0;l<h;++l)i[o++]=u[l]}return i}var Le=new Ie.Cartesian3,Oe=new Ie.Cartesian3,Ue=new Ie.Cartesian3,Pe=new Ie.Cartesian3,Fe=new Ie.Cartesian3,Se=new Ie.Cartographic,Re=new Ie.Rectangle;return e(function(e,a){var r;t=e.packedBuffer,r=new Float64Array(t),t=0,ke.indexBytesPerElement=r[t++],ke.min=r[t++],ke.max=r[t++],Ie.Cartesian3.unpack(r,3,Ee),t+=Ie.Cartesian3.packedLength,Ie.Ellipsoid.unpack(r,t,Ne),t+=Ie.Ellipsoid.packedLength,Ie.Rectangle.unpack(r,t,Te);var n=new(2===ke.indexBytesPerElement?Uint16Array:Uint32Array)(e.indices),t=new Uint16Array(e.positions),i=new Uint32Array(e.counts),o=new Uint32Array(e.indexCounts),s=new Uint32Array(e.batchIds),f=new Uint32Array(e.batchTableColors),d=new Array(i.length),c=Ee,u=Ne,h=Te,l=ke.min,g=ke.max,p=e.minimumHeights,b=e.maximumHeights;we.defined(p)&&we.defined(b)&&(p=new Float32Array(p),b=new Float32Array(b));var C=t.length/2,y=t.subarray(0,C),I=t.subarray(C,2*C);ye.AttributeCompression.zigZagDeltaDecode(y,I);for(var m=new Float64Array(3*C),w=0;w<C;++w){var v=y[w],x=I[w],v=xe.CesiumMath.lerp(h.west,h.east,v/32767),x=xe.CesiumMath.lerp(h.south,h.north,x/32767),x=Ie.Cartographic.fromRadians(v,x,0,Se),x=u.cartographicToCartesian(x,Le);Ie.Cartesian3.pack(x,m,3*w)}var A=i.length,E=new Array(A),N=new Array(A),T=0,k=0;for(w=0;w<A;++w)E[w]=T,N[w]=k,T+=i[w],k+=o[w];var B=new Float32Array(3*C*2),L=new Uint16Array(2*C),O=new Uint32Array(N.length),U=new Uint32Array(o.length),P=[],F={};for(w=0;w<A;++w)_=f[w],we.defined(F[_])?(F[_].positionLength+=i[w],F[_].indexLength+=o[w],F[_].batchIds.push(w)):F[_]={positionLength:i[w],indexLength:o[w],offset:0,indexOffset:0,batchIds:[w]};var S,R=0,D=0;for(_ in F)F.hasOwnProperty(_)&&((G=F[_]).offset=R,G.indexOffset=D,R+=2*G.positionLength,D+=S=2*G.indexLength+6*G.positionLength,G.indexLength=S);var M=[];for(_ in F)F.hasOwnProperty(_)&&(G=F[_],M.push({color:me.Color.fromRgba(parseInt(_)),offset:G.indexOffset,count:G.indexLength,batchIds:G.batchIds}));for(w=0;w<A;++w){var _,G,Y=(G=F[_=f[w]]).offset,V=3*Y,H=Y,W=E[w],z=i[w],Z=s[w],j=l,q=g;we.defined(p)&&we.defined(b)&&(j=p[w],q=b[w]);for(var J=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,Q=Number.POSITIVE_INFINITY,X=Number.NEGATIVE_INFINITY,$=0;$<z;++$){var ee=Ie.Cartesian3.unpack(m,3*W+3*$,Le);u.scaleToGeodeticSurface(ee,ee);var ae=u.cartesianToCartographic(ee,Se),re=ae.latitude,ne=ae.longitude,J=Math.min(re,J),K=Math.max(re,K),Q=Math.min(ne,Q),X=Math.max(ne,X),ae=u.geodeticSurfaceNormal(ee,Oe),re=Ie.Cartesian3.multiplyByScalar(ae,j,Ue),ne=Ie.Cartesian3.add(ee,re,Pe),re=Ie.Cartesian3.multiplyByScalar(ae,q,re),re=Ie.Cartesian3.add(ee,re,Fe);Ie.Cartesian3.subtract(re,c,re),Ie.Cartesian3.subtract(ne,c,ne),Ie.Cartesian3.pack(re,B,V),Ie.Cartesian3.pack(ne,B,V+3),L[H]=Z,L[H+1]=Z,V+=6,H+=2}(h=Re).west=Q,h.east=X,h.south=J,h.north=K,d[w]=Ae.OrientedBoundingBox.fromRectangle(h,l,g,u);var te=G.indexOffset,ie=N[w],oe=o[w];for(O[w]=te,$=0;$<oe;$+=3){var se=n[ie+$]-W,fe=n[ie+$+1]-W,de=n[ie+$+2]-W;P[te++]=2*se+Y,P[te++]=2*fe+Y,P[te++]=2*de+Y,P[te++]=2*de+1+Y,P[te++]=2*fe+1+Y,P[te++]=2*se+1+Y}for($=0;$<z;++$){var ce=$,ue=($+1)%z;P[te++]=2*ce+1+Y,P[te++]=2*ue+Y,P[te++]=2*ce+Y,P[te++]=2*ce+1+Y,P[te++]=2*ue+1+Y,P[te++]=2*ue+Y}G.offset+=2*z,G.indexOffset=te,U[w]=te-O[w]}for(var P=ve.IndexDatatype.createTypedArray(B.length/3,P),he=M.length,le=0;le<he;++le){for(var ge=M[le].batchIds,pe=0,be=ge.length,Ce=0;Ce<be;++Ce)pe+=U[ge[Ce]];M[le].count=pe}return t=Be(2===P.BYTES_PER_ELEMENT?ve.IndexDatatype.UNSIGNED_SHORT:ve.IndexDatatype.UNSIGNED_INT,d,M),a.push(B.buffer,P.buffer,O.buffer,U.buffer,L.buffer,t.buffer),{positions:B.buffer,indices:P.buffer,indexOffsets:O.buffer,indexCounts:U.buffer,batchIds:L.buffer,packedBuffer:t.buffer}})}); +define(["./AttributeCompression-10c27d9c","./Cartesian2-8646c5a1","./Color-98c5f877","./when-54335d57","./IndexDatatype-82ceea78","./Math-d6182036","./OrientedBoundingBox-eb360dc3","./createTaskProcessorWorker","./Check-24483042","./Transforms-79117a7b","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-325a8e68","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(ye,Ie,me,we,ve,xe,Ae,e,a,r,n,t,i,o,s){"use strict";var Ee=new Ie.Cartesian3,Ne=new Ie.Ellipsoid,Te=new Ie.Rectangle,ke={min:void 0,max:void 0,indexBytesPerElement:void 0};function Be(e,a,r){var n=a.length,t=2+n*Ae.OrientedBoundingBox.packedLength+1+function(e){for(var a=e.length,r=0,n=0;n<a;++n)r+=me.Color.packedLength+3+e[n].batchIds.length;return r}(r),i=new Float64Array(t),o=0;i[o++]=e,i[o++]=n;for(var s=0;s<n;++s)Ae.OrientedBoundingBox.pack(a[s],i,o),o+=Ae.OrientedBoundingBox.packedLength;var f=r.length;i[o++]=f;for(var d=0;d<f;++d){var c=r[d];me.Color.pack(c.color,i,o),o+=me.Color.packedLength,i[o++]=c.offset,i[o++]=c.count;var u=c.batchIds,h=u.length;i[o++]=h;for(var l=0;l<h;++l)i[o++]=u[l]}return i}var Le=new Ie.Cartesian3,Oe=new Ie.Cartesian3,Ue=new Ie.Cartesian3,Pe=new Ie.Cartesian3,Fe=new Ie.Cartesian3,Se=new Ie.Cartographic,Re=new Ie.Rectangle;return e(function(e,a){var r;t=e.packedBuffer,r=new Float64Array(t),t=0,ke.indexBytesPerElement=r[t++],ke.min=r[t++],ke.max=r[t++],Ie.Cartesian3.unpack(r,3,Ee),t+=Ie.Cartesian3.packedLength,Ie.Ellipsoid.unpack(r,t,Ne),t+=Ie.Ellipsoid.packedLength,Ie.Rectangle.unpack(r,t,Te);var n=new(2===ke.indexBytesPerElement?Uint16Array:Uint32Array)(e.indices),t=new Uint16Array(e.positions),i=new Uint32Array(e.counts),o=new Uint32Array(e.indexCounts),s=new Uint32Array(e.batchIds),f=new Uint32Array(e.batchTableColors),d=new Array(i.length),c=Ee,u=Ne,h=Te,l=ke.min,g=ke.max,p=e.minimumHeights,b=e.maximumHeights;we.defined(p)&&we.defined(b)&&(p=new Float32Array(p),b=new Float32Array(b));var C=t.length/2,y=t.subarray(0,C),I=t.subarray(C,2*C);ye.AttributeCompression.zigZagDeltaDecode(y,I);for(var m=new Float64Array(3*C),w=0;w<C;++w){var v=y[w],x=I[w],v=xe.CesiumMath.lerp(h.west,h.east,v/32767),x=xe.CesiumMath.lerp(h.south,h.north,x/32767),x=Ie.Cartographic.fromRadians(v,x,0,Se),x=u.cartographicToCartesian(x,Le);Ie.Cartesian3.pack(x,m,3*w)}var A=i.length,E=new Array(A),N=new Array(A),T=0,k=0;for(w=0;w<A;++w)E[w]=T,N[w]=k,T+=i[w],k+=o[w];var B=new Float32Array(3*C*2),L=new Uint16Array(2*C),O=new Uint32Array(N.length),U=new Uint32Array(o.length),P=[],F={};for(w=0;w<A;++w)_=f[w],we.defined(F[_])?(F[_].positionLength+=i[w],F[_].indexLength+=o[w],F[_].batchIds.push(w)):F[_]={positionLength:i[w],indexLength:o[w],offset:0,indexOffset:0,batchIds:[w]};var S,R=0,D=0;for(_ in F)F.hasOwnProperty(_)&&((G=F[_]).offset=R,G.indexOffset=D,R+=2*G.positionLength,D+=S=2*G.indexLength+6*G.positionLength,G.indexLength=S);var M=[];for(_ in F)F.hasOwnProperty(_)&&(G=F[_],M.push({color:me.Color.fromRgba(parseInt(_)),offset:G.indexOffset,count:G.indexLength,batchIds:G.batchIds}));for(w=0;w<A;++w){var _,G,Y=(G=F[_=f[w]]).offset,V=3*Y,H=Y,W=E[w],z=i[w],Z=s[w],j=l,q=g;we.defined(p)&&we.defined(b)&&(j=p[w],q=b[w]);for(var J=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,Q=Number.POSITIVE_INFINITY,X=Number.NEGATIVE_INFINITY,$=0;$<z;++$){var ee=Ie.Cartesian3.unpack(m,3*W+3*$,Le);u.scaleToGeodeticSurface(ee,ee);var ae=u.cartesianToCartographic(ee,Se),re=ae.latitude,ne=ae.longitude,J=Math.min(re,J),K=Math.max(re,K),Q=Math.min(ne,Q),X=Math.max(ne,X),ae=u.geodeticSurfaceNormal(ee,Oe),re=Ie.Cartesian3.multiplyByScalar(ae,j,Ue),ne=Ie.Cartesian3.add(ee,re,Pe),re=Ie.Cartesian3.multiplyByScalar(ae,q,re),re=Ie.Cartesian3.add(ee,re,Fe);Ie.Cartesian3.subtract(re,c,re),Ie.Cartesian3.subtract(ne,c,ne),Ie.Cartesian3.pack(re,B,V),Ie.Cartesian3.pack(ne,B,V+3),L[H]=Z,L[H+1]=Z,V+=6,H+=2}(h=Re).west=Q,h.east=X,h.south=J,h.north=K,d[w]=Ae.OrientedBoundingBox.fromRectangle(h,l,g,u);var te=G.indexOffset,ie=N[w],oe=o[w];for(O[w]=te,$=0;$<oe;$+=3){var se=n[ie+$]-W,fe=n[ie+$+1]-W,de=n[ie+$+2]-W;P[te++]=2*se+Y,P[te++]=2*fe+Y,P[te++]=2*de+Y,P[te++]=2*de+1+Y,P[te++]=2*fe+1+Y,P[te++]=2*se+1+Y}for($=0;$<z;++$){var ce=$,ue=($+1)%z;P[te++]=2*ce+1+Y,P[te++]=2*ue+Y,P[te++]=2*ce+Y,P[te++]=2*ce+1+Y,P[te++]=2*ue+1+Y,P[te++]=2*ue+Y}G.offset+=2*z,G.indexOffset=te,U[w]=te-O[w]}for(var P=ve.IndexDatatype.createTypedArray(B.length/3,P),he=M.length,le=0;le<he;++le){for(var ge=M[le].batchIds,pe=0,be=ge.length,Ce=0;Ce<be;++Ce)pe+=U[ge[Ce]];M[le].count=pe}return t=Be(2===P.BYTES_PER_ELEMENT?ve.IndexDatatype.UNSIGNED_SHORT:ve.IndexDatatype.UNSIGNED_INT,d,M),a.push(B.buffer,P.buffer,O.buffer,U.buffer,L.buffer,t.buffer),{positions:B.buffer,indices:P.buffer,indexOffsets:O.buffer,indexCounts:U.buffer,batchIds:L.buffer,packedBuffer:t.buffer}})}); diff --git a/public/Cesium/Workers/createVectorTilePolylines.js b/public/Cesium/Workers/createVectorTilePolylines.js index 3a39cdf..3b7ce52 100644 --- a/public/Cesium/Workers/createVectorTilePolylines.js +++ b/public/Cesium/Workers/createVectorTilePolylines.js @@ -1 +1 @@ -define(["./AttributeCompression-f02ec82f","./Cartesian2-8417ca3d","./IndexDatatype-d47ad6f6","./Math-4e53b694","./createTaskProcessorWorker","./Check-d18af7c4","./when-208fe5b0","./WebGLConstants-76bb35d1"],function(P,L,S,_,a,e,r,n){"use strict";var G=32767,W=new L.Cartographic,B=new L.Cartesian3;var z=new L.Rectangle,H=new L.Ellipsoid,O=new L.Cartesian3,Y={min:void 0,max:void 0};var Z=new L.Cartesian3,j=new L.Cartesian3,q=new L.Cartesian3,J=new L.Cartesian3,K=new L.Cartesian3;return a(function(a,e){var r=new Uint16Array(a.positions),n=new Uint16Array(a.widths),t=new Uint32Array(a.counts),i=new Uint16Array(a.batchIds);!function(a){a=new Float64Array(a);var e=0;Y.min=a[e++],Y.max=a[e++],L.Rectangle.unpack(a,2,z),e+=L.Rectangle.packedLength,L.Ellipsoid.unpack(a,e,H),e+=L.Ellipsoid.packedLength,L.Cartesian3.unpack(a,e,O)}(a.packedBuffer);for(var s=O,u=function(a,e,r,n,t){var i=a.length/3,s=a.subarray(0,i),u=a.subarray(i,2*i),c=a.subarray(2*i,3*i);P.AttributeCompression.zigZagDeltaDecode(s,u,c);for(var o=new Float64Array(a.length),f=0;f<i;++f){var p=s[f],C=u[f],d=c[f],p=_.CesiumMath.lerp(e.west,e.east,p/G),C=_.CesiumMath.lerp(e.south,e.north,C/G),d=_.CesiumMath.lerp(r,n,d/G),d=L.Cartographic.fromRadians(p,C,d,W),d=t.cartographicToCartesian(d,B);L.Cartesian3.pack(d,o,3*f)}return o}(r,z,Y.min,Y.max,H),r=4*(a=u.length/3)-4,c=new Float32Array(3*r),o=new Float32Array(3*r),f=new Float32Array(3*r),p=new Float32Array(2*r),C=new Uint16Array(r),d=0,b=0,w=0,h=0,l=t.length,y=0;y<l;++y){for(var k,v=t[y],A=n[y],g=i[y],m=0;m<v;++m){0===m?(E=L.Cartesian3.unpack(u,3*h,Z),x=L.Cartesian3.unpack(u,3*(h+1),j),k=L.Cartesian3.subtract(E,x,q),L.Cartesian3.add(E,k,k)):k=L.Cartesian3.unpack(u,3*(h+m-1),q);var x,E,D,I=L.Cartesian3.unpack(u,3*(h+m),J);m===v-1?(x=L.Cartesian3.unpack(u,3*(h+v-1),Z),E=L.Cartesian3.unpack(u,3*(h+v-2),j),D=L.Cartesian3.subtract(x,E,K),L.Cartesian3.add(x,D,D)):D=L.Cartesian3.unpack(u,3*(h+m+1),K),L.Cartesian3.subtract(k,s,k),L.Cartesian3.subtract(I,s,I),L.Cartesian3.subtract(D,s,D);for(var T=m===v-1?2:4,U=0===m?2:0;U<T;++U){L.Cartesian3.pack(I,c,d),L.Cartesian3.pack(k,o,d),L.Cartesian3.pack(D,f,d),d+=3;var F=U-2<0?-1:1;p[b++]=U%2*2-1,p[b++]=F*A,C[w++]=g}}h+=v}var N=S.IndexDatatype.createTypedArray(r,6*a-6),R=0,M=0,l=a-1;for(y=0;y<l;++y)N[M++]=R,N[M++]=R+2,N[M++]=R+1,N[M++]=R+1,N[M++]=R+2,N[M++]=R+3,R+=4;return e.push(c.buffer,o.buffer,f.buffer),e.push(p.buffer,C.buffer,N.buffer),{indexDatatype:2===N.BYTES_PER_ELEMENT?S.IndexDatatype.UNSIGNED_SHORT:S.IndexDatatype.UNSIGNED_INT,currentPositions:c.buffer,previousPositions:o.buffer,nextPositions:f.buffer,expandAndWidth:p.buffer,batchIds:C.buffer,indices:N.buffer}})}); +define(["./Cartesian2-8646c5a1","./AttributeCompression-10c27d9c","./Math-d6182036","./IndexDatatype-82ceea78","./createTaskProcessorWorker","./Check-24483042","./when-54335d57","./WebGLConstants-95ceb4e9"],function(P,L,S,_,a,e,r,n){"use strict";var G=32767,W=new P.Cartographic,B=new P.Cartesian3;var z=new P.Rectangle,H=new P.Ellipsoid,O=new P.Cartesian3,Y={min:void 0,max:void 0};var Z=new P.Cartesian3,j=new P.Cartesian3,q=new P.Cartesian3,J=new P.Cartesian3,K=new P.Cartesian3;return a(function(a,e){var r=new Uint16Array(a.positions),n=new Uint16Array(a.widths),t=new Uint32Array(a.counts),i=new Uint16Array(a.batchIds);!function(a){a=new Float64Array(a);var e=0;Y.min=a[e++],Y.max=a[e++],P.Rectangle.unpack(a,2,z),e+=P.Rectangle.packedLength,P.Ellipsoid.unpack(a,e,H),e+=P.Ellipsoid.packedLength,P.Cartesian3.unpack(a,e,O)}(a.packedBuffer);for(var s=O,u=function(a,e,r,n,t){var i=a.length/3,s=a.subarray(0,i),u=a.subarray(i,2*i),c=a.subarray(2*i,3*i);L.AttributeCompression.zigZagDeltaDecode(s,u,c);for(var o=new Float64Array(a.length),p=0;p<i;++p){var f=s[p],C=u[p],d=c[p],f=S.CesiumMath.lerp(e.west,e.east,f/G),C=S.CesiumMath.lerp(e.south,e.north,C/G),d=S.CesiumMath.lerp(r,n,d/G),d=P.Cartographic.fromRadians(f,C,d,W),d=t.cartographicToCartesian(d,B);P.Cartesian3.pack(d,o,3*p)}return o}(r,z,Y.min,Y.max,H),r=4*(a=u.length/3)-4,c=new Float32Array(3*r),o=new Float32Array(3*r),p=new Float32Array(3*r),f=new Float32Array(2*r),C=new Uint16Array(r),d=0,b=0,w=0,h=0,l=t.length,y=0;y<l;++y){for(var k,v=t[y],A=n[y],g=i[y],m=0;m<v;++m){0===m?(E=P.Cartesian3.unpack(u,3*h,Z),x=P.Cartesian3.unpack(u,3*(h+1),j),k=P.Cartesian3.subtract(E,x,q),P.Cartesian3.add(E,k,k)):k=P.Cartesian3.unpack(u,3*(h+m-1),q);var x,E,D,I=P.Cartesian3.unpack(u,3*(h+m),J);m===v-1?(x=P.Cartesian3.unpack(u,3*(h+v-1),Z),E=P.Cartesian3.unpack(u,3*(h+v-2),j),D=P.Cartesian3.subtract(x,E,K),P.Cartesian3.add(x,D,D)):D=P.Cartesian3.unpack(u,3*(h+m+1),K),P.Cartesian3.subtract(k,s,k),P.Cartesian3.subtract(I,s,I),P.Cartesian3.subtract(D,s,D);for(var T=m===v-1?2:4,U=0===m?2:0;U<T;++U){P.Cartesian3.pack(I,c,d),P.Cartesian3.pack(k,o,d),P.Cartesian3.pack(D,p,d),d+=3;var F=U-2<0?-1:1;f[b++]=U%2*2-1,f[b++]=F*A,C[w++]=g}}h+=v}var N=_.IndexDatatype.createTypedArray(r,6*a-6),R=0,M=0,l=a-1;for(y=0;y<l;++y)N[M++]=R,N[M++]=R+2,N[M++]=R+1,N[M++]=R+1,N[M++]=R+2,N[M++]=R+3,R+=4;return e.push(c.buffer,o.buffer,p.buffer),e.push(f.buffer,C.buffer,N.buffer),{indexDatatype:2===N.BYTES_PER_ELEMENT?_.IndexDatatype.UNSIGNED_SHORT:_.IndexDatatype.UNSIGNED_INT,currentPositions:c.buffer,previousPositions:o.buffer,nextPositions:p.buffer,expandAndWidth:f.buffer,batchIds:C.buffer,indices:N.buffer}})}); diff --git a/public/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js b/public/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js index 8717e1f..9db22fd 100644 --- a/public/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +++ b/public/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js @@ -1 +1 @@ -define(["./EllipsoidTangentPlane-9123a53b","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./when-208fe5b0","./TerrainEncoding-73cbc4e6","./Math-4e53b694","./OrientedBoundingBox-18b4901f","./RuntimeError-7f634f5d","./WebMercatorProjection-ffb6b9f8","./createTaskProcessorWorker","./Check-d18af7c4","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./AttributeCompression-f02ec82f","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1"],function(Et,Tt,Ct,vt,Mt,Nt,bt,xt,St,t,e,i,n,a,r,o){"use strict";var wt=Uint16Array.BYTES_PER_ELEMENT,Pt=Int32Array.BYTES_PER_ELEMENT,Bt=Uint32Array.BYTES_PER_ELEMENT,yt=Float32Array.BYTES_PER_ELEMENT,At=Float64Array.BYTES_PER_ELEMENT;function Rt(t,e,i){i=vt.defaultValue(i,Nt.CesiumMath);for(var n=t.length,a=0;a<n;++a)if(i.equalsEpsilon(t[a],e,Nt.CesiumMath.EPSILON12))return a;return-1}var _t=new Ct.Cartographic,Wt=new Ct.Cartesian3,Ft=new Ct.Cartesian3,Ot=new Ct.Cartesian3,Yt=new Tt.Matrix4;function kt(t,e,i,n,a,r,o,s,u,h){for(var c=o.length,d=0;d<c;++d){var g=o[d],l=g.cartographic,m=g.index,p=t.length,I=l.longitude,f=l.latitude,f=Nt.CesiumMath.clamp(f,-Nt.CesiumMath.PI_OVER_TWO,Nt.CesiumMath.PI_OVER_TWO),l=l.height-r.skirtHeight;r.hMin=Math.min(r.hMin,l),Ct.Cartographic.fromRadians(I,f,l,_t),u&&(_t.longitude+=s),u?d===c-1?_t.latitude+=h:0===d&&(_t.latitude-=h):_t.latitude+=s;f=r.ellipsoid.cartographicToCartesian(_t);t.push(f),e.push(l),i.push(Ct.Cartesian2.clone(i[m])),0<n.length&&n.push(n[m]),Tt.Matrix4.multiplyByPoint(r.toENU,f,Wt);l=r.minimum,f=r.maximum;Ct.Cartesian3.minimumByComponent(Wt,l,l),Ct.Cartesian3.maximumByComponent(Wt,f,f);f=r.lastBorderPoint;vt.defined(f)&&(f=f.index,a.push(f,p-1,p,p,m,f)),r.lastBorderPoint=g}}return t(function(t,e){t.ellipsoid=Ct.Ellipsoid.clone(t.ellipsoid),t.rectangle=Ct.Rectangle.clone(t.rectangle);var i=function(t,e,i,n,a,r,o,s,u,h){var c,d,g,l,m;ct=vt.defined(n)?(c=n.west,d=n.south,g=n.east,l=n.north,m=n.width,n.height):(c=Nt.CesiumMath.toRadians(a.west),d=Nt.CesiumMath.toRadians(a.south),g=Nt.CesiumMath.toRadians(a.east),l=Nt.CesiumMath.toRadians(a.north),m=Nt.CesiumMath.toRadians(n.width),Nt.CesiumMath.toRadians(n.height));var p,I,f=[d,l],E=[c,g],T=Tt.Transforms.eastNorthUpToFixedFrame(e,i),C=Tt.Matrix4.inverseTransformation(T,Yt);s&&(p=St.WebMercatorProjection.geodeticLatitudeToMercatorAngle(d),I=1/(St.WebMercatorProjection.geodeticLatitudeToMercatorAngle(l)-p));var v=new DataView(t),M=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,b=Ft;b.x=Number.POSITIVE_INFINITY,b.y=Number.POSITIVE_INFINITY,b.z=Number.POSITIVE_INFINITY;var x=Ot;x.x=Number.NEGATIVE_INFINITY,x.y=Number.NEGATIVE_INFINITY,x.z=Number.NEGATIVE_INFINITY;var S,w,P=0,B=0,y=0;for(w=0;w<4;++w){var A=P;S=v.getUint32(A,!0),A+=Bt;var R=Nt.CesiumMath.toRadians(180*v.getFloat64(A,!0));A+=At,-1===Rt(E,R)&&E.push(R);R=Nt.CesiumMath.toRadians(180*v.getFloat64(A,!0));A+=At,-1===Rt(f,R)&&f.push(R),A+=2*At;R=v.getInt32(A,!0);A+=Pt,B+=R,R=v.getInt32(A,!0),y+=3*R,P+=S+Bt}var _=[],W=[],F=new Array(B),O=new Array(B),Y=new Array(B),k=s?new Array(B):[],U=new Array(y),V=[],H=[],L=[],D=[],G=0,j=0;for(w=P=0;w<4;++w){S=v.getUint32(P,!0);var z=P+=Bt,q=Nt.CesiumMath.toRadians(180*v.getFloat64(P,!0));P+=At;var J=Nt.CesiumMath.toRadians(180*v.getFloat64(P,!0));P+=At;var K=Nt.CesiumMath.toRadians(180*v.getFloat64(P,!0)),Q=.5*K;P+=At;var X=Nt.CesiumMath.toRadians(180*v.getFloat64(P,!0)),Z=.5*X;P+=At;var $=v.getInt32(P,!0);P+=Pt;var tt=v.getInt32(P,!0);P+=Pt,P+=Pt;for(var et=new Array($),it=0;it<$;++it){var nt=q+v.getUint8(P++)*K;_t.longitude=nt;var at=J+v.getUint8(P++)*X;_t.latitude=at;var rt=v.getFloat32(P,!0);if(P+=yt,0!==rt&&rt<h&&(rt*=-Math.pow(2,u)),rt*=6371010*r,_t.height=rt,-1!==Rt(E,nt)||-1!==Rt(f,at)){var ot=Rt(_,_t,Ct.Cartographic);if(-1!==ot){et[it]=W[ot];continue}_.push(Ct.Cartographic.clone(_t)),W.push(G)}et[it]=G,Math.abs(nt-c)<Q?V.push({index:G,cartographic:Ct.Cartographic.clone(_t)}):Math.abs(nt-g)<Q?L.push({index:G,cartographic:Ct.Cartographic.clone(_t)}):Math.abs(at-d)<Z?H.push({index:G,cartographic:Ct.Cartographic.clone(_t)}):Math.abs(at-l)<Z&&D.push({index:G,cartographic:Ct.Cartographic.clone(_t)}),M=Math.min(rt,M),N=Math.max(rt,N),Y[G]=rt;rt=i.cartographicToCartesian(_t);F[G]=rt,s&&(k[G]=(St.WebMercatorProjection.geodeticLatitudeToMercatorAngle(at)-p)*I),Tt.Matrix4.multiplyByPoint(C,rt,Wt),Ct.Cartesian3.minimumByComponent(Wt,b,b),Ct.Cartesian3.maximumByComponent(Wt,x,x);nt=(nt-c)/(g-c);nt=Nt.CesiumMath.clamp(nt,0,1);at=(at-d)/(l-d);at=Nt.CesiumMath.clamp(at,0,1),O[G]=new Ct.Cartesian2(nt,at),++G}for(var st=3*tt,ut=0;ut<st;++ut,++j)U[j]=et[v.getUint16(P,!0)],P+=wt;if(S!==P-z)throw new xt.RuntimeError("Invalid terrain tile.")}F.length=G,O.length=G,Y.length=G,s&&(k.length=G);var ht=G,a=j,t={hMin:M,lastBorderPoint:void 0,skirtHeight:o,toENU:C,ellipsoid:i,minimum:b,maximum:x};V.sort(function(t,e){return e.cartographic.latitude-t.cartographic.latitude}),H.sort(function(t,e){return t.cartographic.longitude-e.cartographic.longitude}),L.sort(function(t,e){return t.cartographic.latitude-e.cartographic.latitude}),D.sort(function(t,e){return e.cartographic.longitude-t.cartographic.longitude});o=1e-5;{var ct;kt(F,Y,O,k,U,t,V,-o*m,!0,-o*ct),kt(F,Y,O,k,U,t,H,-o*ct,!1),kt(F,Y,O,k,U,t,L,o*m,!0,o*ct),kt(F,Y,O,k,U,t,D,o*ct,!1),0<V.length&&0<D.length&&(gt=V[0].index,lt=D[D.length-1].index,ct=F.length-1,U.push(lt,ct,ht,ht,gt,lt))}B=F.length;var dt,gt=Tt.BoundingSphere.fromPoints(F);vt.defined(n)&&(dt=bt.OrientedBoundingBox.fromRectangle(n,M,N,i));for(var lt=new Mt.EllipsoidalOccluder(i).computeHorizonCullingPointPossiblyUnderEllipsoid(e,F,M),n=new Et.AxisAlignedBoundingBox(b,x,e),mt=new Mt.TerrainEncoding(n,t.hMin,N,T,!1,s),pt=new Float32Array(B*mt.getStride()),It=0,ft=0;ft<B;++ft)It=mt.encode(pt,It,F[ft],O[ft],Y[ft],void 0,k[ft]);e=V.map(function(t){return t.index}).reverse(),n=H.map(function(t){return t.index}).reverse(),t=L.map(function(t){return t.index}).reverse(),T=D.map(function(t){return t.index}).reverse();return n.unshift(t[t.length-1]),n.push(e[0]),T.unshift(e[e.length-1]),T.push(t[0]),{vertices:pt,indices:new Uint16Array(U),maximumHeight:N,minimumHeight:M,encoding:mt,boundingSphere3D:gt,orientedBoundingBox:dt,occludeePointInScaledSpace:lt,vertexCountWithoutSkirts:ht,indexCountWithoutSkirts:a,westIndicesSouthToNorth:e,southIndicesEastToWest:n,eastIndicesNorthToSouth:t,northIndicesWestToEast:T}}(t.buffer,t.relativeToCenter,t.ellipsoid,t.rectangle,t.nativeRectangle,t.exaggeration,t.skirtHeight,t.includeWebMercatorT,t.negativeAltitudeExponentBias,t.negativeElevationThreshold),n=i.vertices;return e.push(n.buffer),t=i.indices,e.push(t.buffer),{vertices:n.buffer,indices:t.buffer,numberOfAttributes:i.encoding.getStride(),minimumHeight:i.minimumHeight,maximumHeight:i.maximumHeight,boundingSphere3D:i.boundingSphere3D,orientedBoundingBox:i.orientedBoundingBox,occludeePointInScaledSpace:i.occludeePointInScaledSpace,encoding:i.encoding,vertexCountWithoutSkirts:i.vertexCountWithoutSkirts,indexCountWithoutSkirts:i.indexCountWithoutSkirts,westIndicesSouthToNorth:i.westIndicesSouthToNorth,southIndicesEastToWest:i.southIndicesEastToWest,eastIndicesNorthToSouth:i.eastIndicesNorthToSouth,northIndicesWestToEast:i.northIndicesWestToEast}})}); +define(["./EllipsoidTangentPlane-325a8e68","./Transforms-79117a7b","./Cartesian2-8646c5a1","./when-54335d57","./TerrainEncoding-c552e269","./Math-d6182036","./OrientedBoundingBox-eb360dc3","./RuntimeError-88a32665","./WebMercatorProjection-66cc0482","./createTaskProcessorWorker","./Check-24483042","./IntersectionTests-5394f658","./Plane-13ae4b1b","./AttributeCompression-10c27d9c","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9"],function(Tt,Ct,ft,vt,Mt,Nt,xt,bt,St,t,e,i,n,a,r,o){"use strict";var wt=Uint16Array.BYTES_PER_ELEMENT,Pt=Int32Array.BYTES_PER_ELEMENT,Bt=Uint32Array.BYTES_PER_ELEMENT,yt=Float32Array.BYTES_PER_ELEMENT,At=Float64Array.BYTES_PER_ELEMENT;function Rt(t,e,i){i=vt.defaultValue(i,Nt.CesiumMath);for(var n=t.length,a=0;a<n;++a)if(i.equalsEpsilon(t[a],e,Nt.CesiumMath.EPSILON12))return a;return-1}var _t=new ft.Cartographic,Wt=new ft.Cartesian3,Ft=new ft.Cartesian3,Ot=new ft.Cartesian3,Yt=new Ct.Matrix4;function kt(t,e,i,n,a,r,o,s,u,h){for(var c=o.length,d=0;d<c;++d){var g=o[d],l=g.cartographic,m=g.index,p=t.length,I=l.longitude,E=l.latitude,E=Nt.CesiumMath.clamp(E,-Nt.CesiumMath.PI_OVER_TWO,Nt.CesiumMath.PI_OVER_TWO),l=l.height-r.skirtHeight;r.hMin=Math.min(r.hMin,l),ft.Cartographic.fromRadians(I,E,l,_t),u&&(_t.longitude+=s),u?d===c-1?_t.latitude+=h:0===d&&(_t.latitude-=h):_t.latitude+=s;E=r.ellipsoid.cartographicToCartesian(_t);t.push(E),e.push(l),i.push(ft.Cartesian2.clone(i[m])),0<n.length&&n.push(n[m]),Ct.Matrix4.multiplyByPoint(r.toENU,E,Wt);l=r.minimum,E=r.maximum;ft.Cartesian3.minimumByComponent(Wt,l,l),ft.Cartesian3.maximumByComponent(Wt,E,E);E=r.lastBorderPoint;vt.defined(E)&&(E=E.index,a.push(E,p-1,p,p,m,E)),r.lastBorderPoint=g}}return t(function(t,e){t.ellipsoid=ft.Ellipsoid.clone(t.ellipsoid),t.rectangle=ft.Rectangle.clone(t.rectangle);var i=function(t,e,i,n,a,r,o,s,u,h){var c,d,g,l,m;ct=vt.defined(n)?(c=n.west,d=n.south,g=n.east,l=n.north,m=n.width,n.height):(c=Nt.CesiumMath.toRadians(a.west),d=Nt.CesiumMath.toRadians(a.south),g=Nt.CesiumMath.toRadians(a.east),l=Nt.CesiumMath.toRadians(a.north),m=Nt.CesiumMath.toRadians(n.width),Nt.CesiumMath.toRadians(n.height));var p,I,E=[d,l],T=[c,g],C=Ct.Transforms.eastNorthUpToFixedFrame(e,i),f=Ct.Matrix4.inverseTransformation(C,Yt);s&&(p=St.WebMercatorProjection.geodeticLatitudeToMercatorAngle(d),I=1/(St.WebMercatorProjection.geodeticLatitudeToMercatorAngle(l)-p));var v=new DataView(t),M=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,x=Ft;x.x=Number.POSITIVE_INFINITY,x.y=Number.POSITIVE_INFINITY,x.z=Number.POSITIVE_INFINITY;var b=Ot;b.x=Number.NEGATIVE_INFINITY,b.y=Number.NEGATIVE_INFINITY,b.z=Number.NEGATIVE_INFINITY;var S,w,P=0,B=0,y=0;for(w=0;w<4;++w){var A=P;S=v.getUint32(A,!0),A+=Bt;var R=Nt.CesiumMath.toRadians(180*v.getFloat64(A,!0));A+=At,-1===Rt(T,R)&&T.push(R);R=Nt.CesiumMath.toRadians(180*v.getFloat64(A,!0));A+=At,-1===Rt(E,R)&&E.push(R),A+=2*At;R=v.getInt32(A,!0);A+=Pt,B+=R,R=v.getInt32(A,!0),y+=3*R,P+=S+Bt}var _=[],W=[],F=new Array(B),O=new Array(B),Y=new Array(B),k=s?new Array(B):[],U=new Array(y),V=[],H=[],L=[],D=[],G=0,j=0;for(w=P=0;w<4;++w){S=v.getUint32(P,!0);var z=P+=Bt,q=Nt.CesiumMath.toRadians(180*v.getFloat64(P,!0));P+=At;var J=Nt.CesiumMath.toRadians(180*v.getFloat64(P,!0));P+=At;var K=Nt.CesiumMath.toRadians(180*v.getFloat64(P,!0)),Q=.5*K;P+=At;var X=Nt.CesiumMath.toRadians(180*v.getFloat64(P,!0)),Z=.5*X;P+=At;var $=v.getInt32(P,!0);P+=Pt;var tt=v.getInt32(P,!0);P+=Pt,P+=Pt;for(var et=new Array($),it=0;it<$;++it){var nt=q+v.getUint8(P++)*K;_t.longitude=nt;var at=J+v.getUint8(P++)*X;_t.latitude=at;var rt=v.getFloat32(P,!0);if(P+=yt,0!==rt&&rt<h&&(rt*=-Math.pow(2,u)),rt*=6371010*r,_t.height=rt,-1!==Rt(T,nt)||-1!==Rt(E,at)){var ot=Rt(_,_t,ft.Cartographic);if(-1!==ot){et[it]=W[ot];continue}_.push(ft.Cartographic.clone(_t)),W.push(G)}et[it]=G,Math.abs(nt-c)<Q?V.push({index:G,cartographic:ft.Cartographic.clone(_t)}):Math.abs(nt-g)<Q?L.push({index:G,cartographic:ft.Cartographic.clone(_t)}):Math.abs(at-d)<Z?H.push({index:G,cartographic:ft.Cartographic.clone(_t)}):Math.abs(at-l)<Z&&D.push({index:G,cartographic:ft.Cartographic.clone(_t)}),M=Math.min(rt,M),N=Math.max(rt,N),Y[G]=rt;rt=i.cartographicToCartesian(_t);F[G]=rt,s&&(k[G]=(St.WebMercatorProjection.geodeticLatitudeToMercatorAngle(at)-p)*I),Ct.Matrix4.multiplyByPoint(f,rt,Wt),ft.Cartesian3.minimumByComponent(Wt,x,x),ft.Cartesian3.maximumByComponent(Wt,b,b);nt=(nt-c)/(g-c);nt=Nt.CesiumMath.clamp(nt,0,1);at=(at-d)/(l-d);at=Nt.CesiumMath.clamp(at,0,1),O[G]=new ft.Cartesian2(nt,at),++G}for(var st=3*tt,ut=0;ut<st;++ut,++j)U[j]=et[v.getUint16(P,!0)],P+=wt;if(S!==P-z)throw new bt.RuntimeError("Invalid terrain tile.")}F.length=G,O.length=G,Y.length=G,s&&(k.length=G);var ht=G,a=j,t={hMin:M,lastBorderPoint:void 0,skirtHeight:o,toENU:f,ellipsoid:i,minimum:x,maximum:b};V.sort(function(t,e){return e.cartographic.latitude-t.cartographic.latitude}),H.sort(function(t,e){return t.cartographic.longitude-e.cartographic.longitude}),L.sort(function(t,e){return t.cartographic.latitude-e.cartographic.latitude}),D.sort(function(t,e){return e.cartographic.longitude-t.cartographic.longitude});o=1e-5;{var ct;kt(F,Y,O,k,U,t,V,-o*m,!0,-o*ct),kt(F,Y,O,k,U,t,H,-o*ct,!1),kt(F,Y,O,k,U,t,L,o*m,!0,o*ct),kt(F,Y,O,k,U,t,D,o*ct,!1),0<V.length&&0<D.length&&(gt=V[0].index,lt=D[D.length-1].index,ct=F.length-1,U.push(lt,ct,ht,ht,gt,lt))}B=F.length;var dt,gt=Ct.BoundingSphere.fromPoints(F);vt.defined(n)&&(dt=xt.OrientedBoundingBox.fromRectangle(n,M,N,i));for(var lt=new Mt.EllipsoidalOccluder(i).computeHorizonCullingPointPossiblyUnderEllipsoid(e,F,M),n=new Tt.AxisAlignedBoundingBox(x,b,e),mt=new Mt.TerrainEncoding(n,t.hMin,N,C,!1,s),pt=new Float32Array(B*mt.getStride()),It=0,Et=0;Et<B;++Et)It=mt.encode(pt,It,F[Et],O[Et],Y[Et],void 0,k[Et]);e=V.map(function(t){return t.index}).reverse(),n=H.map(function(t){return t.index}).reverse(),t=L.map(function(t){return t.index}).reverse(),C=D.map(function(t){return t.index}).reverse();return n.unshift(t[t.length-1]),n.push(e[0]),C.unshift(e[e.length-1]),C.push(t[0]),{vertices:pt,indices:new Uint16Array(U),maximumHeight:N,minimumHeight:M,encoding:mt,boundingSphere3D:gt,orientedBoundingBox:dt,occludeePointInScaledSpace:lt,vertexCountWithoutSkirts:ht,indexCountWithoutSkirts:a,westIndicesSouthToNorth:e,southIndicesEastToWest:n,eastIndicesNorthToSouth:t,northIndicesWestToEast:C}}(t.buffer,t.relativeToCenter,t.ellipsoid,t.rectangle,t.nativeRectangle,t.exaggeration,t.skirtHeight,t.includeWebMercatorT,t.negativeAltitudeExponentBias,t.negativeElevationThreshold),n=i.vertices;return e.push(n.buffer),t=i.indices,e.push(t.buffer),{vertices:n.buffer,indices:t.buffer,numberOfAttributes:i.encoding.getStride(),minimumHeight:i.minimumHeight,maximumHeight:i.maximumHeight,boundingSphere3D:i.boundingSphere3D,orientedBoundingBox:i.orientedBoundingBox,occludeePointInScaledSpace:i.occludeePointInScaledSpace,encoding:i.encoding,vertexCountWithoutSkirts:i.vertexCountWithoutSkirts,indexCountWithoutSkirts:i.indexCountWithoutSkirts,westIndicesSouthToNorth:i.westIndicesSouthToNorth,southIndicesEastToWest:i.southIndicesEastToWest,eastIndicesNorthToSouth:i.eastIndicesNorthToSouth,northIndicesWestToEast:i.northIndicesWestToEast}})}); diff --git a/public/Cesium/Workers/createVerticesFromHeightmap.js b/public/Cesium/Workers/createVerticesFromHeightmap.js index a4be455..20abee9 100644 --- a/public/Cesium/Workers/createVerticesFromHeightmap.js +++ b/public/Cesium/Workers/createVerticesFromHeightmap.js @@ -1 +1 @@ -define(["./Cartesian2-8417ca3d","./EllipsoidTangentPlane-9123a53b","./Transforms-a73b3b3b","./when-208fe5b0","./Check-d18af7c4","./TerrainEncoding-73cbc4e6","./Math-4e53b694","./OrientedBoundingBox-18b4901f","./WebMercatorProjection-ffb6b9f8","./RuntimeError-7f634f5d","./createTaskProcessorWorker","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./AttributeCompression-f02ec82f","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1"],function(Se,Pe,Ee,Ce,e,Fe,Le,Oe,Ne,n,t,a,i,r,s,l){"use strict";var o=Object.freeze({NONE:0,LERC:1}),ze={};ze.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Re=new Se.Cartesian3,_e=new Ee.Matrix4,He=new Se.Cartesian3,Ye=new Se.Cartesian3;ze.computeVertices=function(e){var t,a,i,r=Math.cos,n=Math.sin,s=Math.sqrt,l=Math.atan,o=Math.exp,f=Le.CesiumMath.PI_OVER_TWO,u=Le.CesiumMath.toRadians,c=e.heightmap,d=e.width,h=e.height,m=e.skirtHeight,g=Ce.defaultValue(e.isGeographic,!0),p=Ce.defaultValue(e.ellipsoid,Se.Ellipsoid.WGS84),w=1/p.maximumRadius,x=e.nativeRectangle,k=e.rectangle,y=Ce.defined(k)?(t=k.west,a=k.south,i=k.east,k.north):g?(t=u(x.west),a=u(x.south),i=u(x.east),u(x.north)):(t=x.west*w,a=f-2*l(o(-x.south*w)),i=x.east*w,f-2*l(o(-x.north*w))),b=e.relativeToCenter,I=Ce.defined(b),b=I?b:Se.Cartesian3.ZERO,U=Ce.defaultValue(e.exaggeration,1),v=Ce.defaultValue(e.includeWebMercatorT,!1),T=Ce.defaultValue(e.structure,ze.DEFAULT_STRUCTURE),M=Ce.defaultValue(T.heightScale,ze.DEFAULT_STRUCTURE.heightScale),V=Ce.defaultValue(T.heightOffset,ze.DEFAULT_STRUCTURE.heightOffset),A=Ce.defaultValue(T.elementsPerHeight,ze.DEFAULT_STRUCTURE.elementsPerHeight),B=Ce.defaultValue(T.stride,ze.DEFAULT_STRUCTURE.stride),D=Ce.defaultValue(T.elementMultiplier,ze.DEFAULT_STRUCTURE.elementMultiplier),S=Ce.defaultValue(T.isBigEndian,ze.DEFAULT_STRUCTURE.isBigEndian),P=Se.Rectangle.computeWidth(x),E=Se.Rectangle.computeHeight(x),C=P/(d-1),F=E/(h-1);g||(P*=w,E*=w);var L,O,e=p.radiiSquared,N=e.x,z=e.y,R=e.z,_=65536,H=-65536,T=Ee.Transforms.eastNorthUpToFixedFrame(b,p),Y=Ee.Matrix4.inverseTransformation(T,_e);v&&(L=Ne.WebMercatorProjection.geodeticLatitudeToMercatorAngle(a),O=1/(Ne.WebMercatorProjection.geodeticLatitudeToMercatorAngle(y)-L));var W=He;W.x=Number.POSITIVE_INFINITY,W.y=Number.POSITIVE_INFINITY,W.z=Number.POSITIVE_INFINITY;var X=Ye;X.x=Number.NEGATIVE_INFINITY,X.y=Number.NEGATIVE_INFINITY,X.z=Number.NEGATIVE_INFINITY;var Z=Number.POSITIVE_INFINITY,j=d*h,G=j+(0<m?2*d+2*h:0),q=new Array(G),Q=new Array(G),J=new Array(G),K=v?new Array(G):[],$=0,ee=h,te=0,ae=d;0<m&&(--$,++ee,--te,++ae);for(var ie=$;ie<ee;++ie){var re=ie;h<=(re=re<0?0:re)&&(re=h-1);var ne=x.north-F*re,se=((ne=g?u(ne):f-2*l(o(-ne*w)))-a)/(y-a),se=Le.CesiumMath.clamp(se,0,1),le=ie===$,oe=ie===ee-1;0<m&&(le?ne+=1e-5*E:oe&&(ne-=1e-5*E));var fe,ue=r(ne),ce=n(ne),de=R*ce;v&&(fe=(Ne.WebMercatorProjection.geodeticLatitudeToMercatorAngle(ne)-L)*O);for(var he=te;he<ae;++he){var me=he,ge=re*(d*B)+(me=d<=(me=me<0?0:me)?d-1:me)*B;if(1===A)we=c[ge];else{var pe,we=0;if(S)for(pe=0;pe<A;++pe)we=we*D+c[ge+pe];else for(pe=A-1;0<=pe;--pe)we=we*D+c[ge+pe]}we=(we*M+V)*U;var H=Math.max(H,we),_=Math.min(_,we),xe=x.west+C*me;g?xe=u(xe):xe*=w;var ke=(xe-t)/(i-t),ke=Le.CesiumMath.clamp(ke,0,1),ye=re*d+me;if(0<m){var be=he===te,Ie=he===ae-1,Ue=le||oe||be||Ie;if((le||oe)&&(be||Ie))continue;Ue&&(we-=m,be?(ye=h-re-1+j,xe-=1e-5*P):oe?ye=j+h+(d-me-1):Ie?(ye=j+h+d+re,xe+=1e-5*P):le&&(ye=j+h+d+h+me))}var ve=ue*r(xe),Ue=ue*n(xe),be=N*ve,Ie=z*Ue,me=1/s(be*ve+Ie*Ue+de*ce),xe=be*me,be=Ie*me,Ie=de*me,me=new Se.Cartesian3;me.x=xe+ve*we,me.y=be+Ue*we,me.z=Ie+ce*we,q[ye]=me,Q[ye]=we,J[ye]=new Se.Cartesian2(ke,se),v&&(K[ye]=fe),Ee.Matrix4.multiplyByPoint(Y,me,Re),Se.Cartesian3.minimumByComponent(Re,W,W),Se.Cartesian3.maximumByComponent(Re,X,X),Z=Math.min(Z,we)}}var Te,Me,e=Ee.BoundingSphere.fromPoints(q);Ce.defined(k)&&(Te=Oe.OrientedBoundingBox.fromRectangle(k,_,H,p)),I&&(Me=new Fe.EllipsoidalOccluder(p).computeHorizonCullingPointPossiblyUnderEllipsoid(b,q,_));for(var b=new Pe.AxisAlignedBoundingBox(W,X,b),Ve=new Fe.TerrainEncoding(b,Z,H,T,!1,v),Ae=new Float32Array(G*Ve.getStride()),Be=0,De=0;De<G;++De)Be=Ve.encode(Ae,Be,q[De],J[De],Q[De],void 0,K[De]);return{vertices:Ae,maximumHeight:H,minimumHeight:_,encoding:Ve,boundingSphere3D:e,orientedBoundingBox:Te,occludeePointInScaledSpace:Me}};var f,u,c,d,h,B,m,w,x,k,g,p={};f={defaultNoDataValue:-34027999387901484e22,decode:function(e,t){var a=(t=t||{}).encodedMaskData||null===t.encodedMaskData,i=h(e,t.inputOffset||0,a),e=null!==t.noDataValue?t.noDataValue:f.defaultNoDataValue,a=u(i,t.pixelType||Float32Array,t.encodedMaskData,e,t.returnMask),e={width:i.width,height:i.height,pixelData:a.resultPixels,minValue:a.minValue,maxValue:i.pixels.maxValue,noDataValue:e};return a.resultMask&&(e.maskData=a.resultMask),t.returnEncodedMask&&i.mask&&(e.encodedMaskData=i.mask.bitset||null),t.returnFileInfo&&(e.fileInfo=c(i),t.computeUsedBitDepths&&(e.fileInfo.bitDepths=d(i))),e}},u=function(e,t,a,i,r){var n,s,l,o=0,f=e.pixels.numBlocksX,u=e.pixels.numBlocksY,c=Math.floor(e.width/f),d=Math.floor(e.height/u),h=2*e.maxZError,m=Number.MAX_VALUE;a=a||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),r&&a&&(l=new Uint8Array(e.width*e.height));for(var g,p,w=new Float32Array(c*d),x=0;x<=u;x++){var k=x!==u?d:e.height%u;if(0!==k)for(var y=0;y<=f;y++){var b=y!==f?c:e.width%f;if(0!==b){var I,U,v,T,M=x*e.width*d+y*c,V=e.width-b,A=e.pixels.blocks[o];if(A.encoding<2?(I=0===A.encoding?A.rawData:(B(A.stuffedData,A.bitsPerPixel,A.numValidPixels,A.offset,h,w,e.pixels.maxValue),w),U=0):v=2===A.encoding?0:A.offset,a)for(p=0;p<k;p++){for(7&M&&(T=a[M>>3],T<<=7&M),g=0;g<b;g++)128&(T=!(7&M)?a[M>>3]:T)?(l&&(l[M]=1),m=(n=A.encoding<2?I[U++]:v)<m?n:m,s[M++]=n):(l&&(l[M]=0),s[M++]=i),T<<=1;M+=V}else if(A.encoding<2)for(p=0;p<k;p++){for(g=0;g<b;g++)m=(n=I[U++])<m?n:m,s[M++]=n;M+=V}else for(m=v<m?v:m,p=0;p<k;p++){for(g=0;g<b;g++)s[M++]=v;M+=V}if(1===A.encoding&&U!==A.numValidPixels)throw"Block and Mask do not match";o++}}}return{resultPixels:s,resultMask:l,minValue:m}},c=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},d=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,a={},i=0;i<t;i++){var r=e.pixels.blocks[i];0===r.encoding?a.float32=!0:1===r.encoding?a[r.bitsPerPixel]=!0:a[0]=!0}return Object.keys(a)},h=function(e,t,a){var i={},r=new Uint8Array(e,t,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,r),"CntZImage"!==i.fileIdentifierString.trim())throw"Unexpected file identifier string: "+i.fileIdentifierString;t+=10;var n=new DataView(e,t,24);if(i.fileVersion=n.getInt32(0,!0),i.imageType=n.getInt32(4,!0),i.height=n.getUint32(8,!0),i.width=n.getUint32(12,!0),i.maxZError=n.getFloat64(16,!0),t+=24,!a)if(n=new DataView(e,t,16),i.mask={},i.mask.numBlocksY=n.getUint32(0,!0),i.mask.numBlocksX=n.getUint32(4,!0),i.mask.numBytes=n.getUint32(8,!0),i.mask.maxValue=n.getFloat32(12,!0),t+=16,0<i.mask.numBytes){var s=new Uint8Array(Math.ceil(i.width*i.height/8)),l=(n=new DataView(e,t,i.mask.numBytes)).getInt16(0,!0),o=2,f=0;do{if(0<l)for(;l--;)s[f++]=n.getUint8(o++);else for(var u=n.getUint8(o++),l=-l;l--;)s[f++]=u}while(l=n.getInt16(o,!0),(o+=2)<i.mask.numBytes);if(-32768!==l||f<s.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=s,t+=i.mask.numBytes}else 0==(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)&&(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));n=new DataView(e,t,16),i.pixels={},i.pixels.numBlocksY=n.getUint32(0,!0),i.pixels.numBlocksX=n.getUint32(4,!0),i.pixels.numBytes=n.getUint32(8,!0),i.pixels.maxValue=n.getFloat32(12,!0),t+=16;var r=i.pixels.numBlocksX,a=i.pixels.numBlocksY,c=r+(0<i.width%r?1:0),d=a+(0<i.height%a?1:0);i.pixels.blocks=new Array(c*d);for(var h=0,m=0;m<d;m++)for(var g=0;g<c;g++){var p=0,w=e.byteLength-t;n=new DataView(e,t,Math.min(10,w));var x={};i.pixels.blocks[h++]=x;var k,w=n.getUint8(0);if(p++,x.encoding=63&w,3<x.encoding)throw"Invalid block encoding ("+x.encoding+")";if(2!==x.encoding){if(0!==w&&2!==w){if(w>>=6,2===(x.offsetType=w))x.offset=n.getInt8(1),p++;else if(1===w)x.offset=n.getInt16(1,!0),p+=2;else{if(0!==w)throw"Invalid block offset type";x.offset=n.getFloat32(1,!0),p+=4}if(1===x.encoding)if(w=n.getUint8(p),p++,x.bitsPerPixel=63&w,w>>=6,2===(x.numValidPixelsType=w))x.numValidPixels=n.getUint8(p),p++;else if(1===w)x.numValidPixels=n.getUint16(p,!0),p+=2;else{if(0!==w)throw"Invalid valid pixel count type";x.numValidPixels=n.getUint32(p,!0),p+=4}}if(t+=p,3!==x.encoding)if(0===x.encoding){var y=(i.pixels.numBytes-1)/4;if(y!==Math.floor(y))throw"uncompressed block has invalid length";k=new ArrayBuffer(4*y),new Uint8Array(k).set(new Uint8Array(e,t,4*y));var b=new Float32Array(k);x.rawData=b,t+=4*y}else 1===x.encoding&&(b=Math.ceil(x.numValidPixels*x.bitsPerPixel/8),y=Math.ceil(b/4),k=new ArrayBuffer(4*y),new Uint8Array(k).set(new Uint8Array(e,t,b)),x.stuffedData=new Uint32Array(k),t+=b)}else t++}return i.eofOffset=t,i},B=function(e,t,a,i,r,n,s){var l,o,f,u,c=(1<<t)-1,d=0,h=0,m=Math.ceil((s-i)/r),g=4*e.length-Math.ceil(t*a/8);for(e[e.length-1]<<=8*g,l=0;l<a;l++)0===h&&(u=e[d++],h=32),t<=h?(f=u>>>h-t&c,h-=t):(f=(u&c)<<(o=t-h)&c,f+=(u=e[d++])>>>(h=32-o)),n[l]=f<m?i+f*r:s;return n},w=f,x=function(){var y=function(e,t,a,i,r,n,s,l){var o,f,u,c,d,h=(1<<a)-1,m=0,g=0,p=4*e.length-Math.ceil(a*i/8);if(e[e.length-1]<<=8*p,r)for(o=0;o<i;o++)0===g&&(u=e[m++],g=32),a<=g?(f=u>>>g-a&h,g-=a):(f=(u&h)<<(c=a-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=r[f];else for(d=Math.ceil((l-n)/s),o=0;o<i;o++)0===g&&(u=e[m++],g=32),a<=g?(f=u>>>g-a&h,g-=a):(f=(u&h)<<(c=a-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=f<d?n+f*s:l},b=function(e,t,a,i,r,n){var s,l,o=(1<<t)-1,f=0,u=0,c=0,d=0,h=[],m=4*e.length-Math.ceil(t*a/8);e[e.length-1]<<=8*m;for(var g=Math.ceil((n-i)/r),u=0;u<a;u++)0===c&&(l=e[f++],c=32),t<=c?(d=l>>>c-t&o,c-=t):(d=(l&o)<<(s=t-c)&o,d+=(l=e[f++])>>>(c=32-s)),h[u]=d<g?i+d*r:n;return h.unshift(i),h},I=function(e,t,a,i,r,n,s,l){var o,f,u,c=(1<<a)-1,d=0,h=0,m=0;if(r)for(p=0;p<i;p++)0===h&&(f=e[d++],h=32,m=0),a<=h?(o=f>>>m&c,h-=a,m+=a):(o=f>>>m&c,h=32-(u=a-h),o|=((f=e[d++])&(1<<u)-1)<<a-u,m=u),t[p]=r[o];else for(var g=Math.ceil((l-n)/s),p=0;p<i;p++)0===h&&(f=e[d++],h=32,m=0),a<=h?(o=f>>>m&c,h-=a,m+=a):(o=f>>>m&c,h=32-(u=a-h),o|=((f=e[d++])&(1<<u)-1)<<a-u,m=u),t[p]=o<g?n+o*s:l;return t},U=function(e,t,a,i,r,n){for(var s,l,o=(1<<t)-1,f=0,u=0,c=0,d=0,h=0,m=[],g=Math.ceil((n-i)/r),u=0;u<a;u++)0===c&&(l=e[f++],c=32,h=0),t<=c?(d=l>>>h&o,c-=t,h+=t):(d=l>>>h&o,c=32-(s=t-c),d|=((l=e[f++])&(1<<s)-1)<<t-s,h=s),m[u]=d<g?i+d*r:n;return m.unshift(i),m},v=function(e,t,a,i){var r,n,s,l,o=(1<<a)-1,f=0,u=0,c=4*e.length-Math.ceil(a*i/8);for(e[e.length-1]<<=8*c,r=0;r<i;r++)0===u&&(s=e[f++],u=32),a<=u?(n=s>>>u-a&o,u-=a):(n=(s&o)<<(l=a-u)&o,n+=(s=e[f++])>>>(u=32-l)),t[r]=n;return t},T=function(e,t,a,i){for(var r,n,s,l=(1<<a)-1,o=0,f=0,u=0,c=0;c<i;c++)0===f&&(n=e[o++],f=32,u=0),a<=f?(r=n>>>u&l,f-=a,u+=a):(r=n>>>u&l,f=32-(s=a-f),r|=((n=e[o++])&(1<<s)-1)<<a-s,u=s),t[c]=r;return t},z={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,a=65535,i=e.length,r=Math.floor(i/2),n=0;r;){var s=359<=r?359:r;for(r-=s;t+=e[n++]<<8,a+=t+=e[n++],--s;);t=(65535&t)+(t>>>16),a=(65535&a)+(a>>>16)}return 1&i&&(a+=t+=e[n]<<8),((a=(65535&a)+(a>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var a=t.ptr,i=new Uint8Array(e,a,6),r={};if(r.fileIdentifierString=String.fromCharCode.apply(null,i),0!==r.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+r.fileIdentifierString;a+=6;var n=new DataView(e,a,8),i=n.getInt32(0,!0);if(r.fileVersion=i,a+=4,3<=i&&(r.checksum=n.getUint32(4,!0),a+=4),n=new DataView(e,a,12),r.height=n.getUint32(0,!0),r.width=n.getUint32(4,!0),a+=8,4<=i?(r.numDims=n.getUint32(8,!0),a+=4):r.numDims=1,n=new DataView(e,a,40),r.numValidPixel=n.getUint32(0,!0),r.microBlockSize=n.getInt32(4,!0),r.blobSize=n.getInt32(8,!0),r.imageType=n.getInt32(12,!0),r.maxZError=n.getFloat64(16,!0),r.zMin=n.getFloat64(24,!0),r.zMax=n.getFloat64(32,!0),a+=40,t.headerInfo=r,t.ptr=a,3<=i&&(i=4<=i?52:48,this.computeChecksumFletcher32(new Uint8Array(e,a-i,r.blobSize-14))!==r.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var a=t.headerInfo,i=this.getDataTypeArray(a.imageType),r=a.numDims*this.getDataTypeSize(a.imageType),n=this.readSubArray(e,t.ptr,i,r),s=this.readSubArray(e,t.ptr+r,i,r);t.ptr+=2*r;for(var l=!0,o=0;o<a.numDims;o++)if(n[o]!==s[o]){l=!1;break}return a.minValues=n,a.maxValues=s,l},readSubArray:function(e,t,a,i){var r=a===Uint8Array?new Uint8Array(e,t,i):(r=new ArrayBuffer(i),new Uint8Array(r).set(new Uint8Array(e,t,i)),new a(r));return r},readMask:function(e,t){var a=t.ptr,i=t.headerInfo,r=i.width*i.height,i=i.numValidPixel,n=new DataView(e,a,4),s={};if(s.numBytes=n.getUint32(0,!0),a+=4,(0===i||r===i)&&0!==s.numBytes)throw"invalid mask";if(0===i)o=new Uint8Array(Math.ceil(r/8)),s.bitset=o,d=new Uint8Array(r),t.pixels.resultMask=d,a+=s.numBytes;else if(0<s.numBytes){var l,o=new Uint8Array(Math.ceil(r/8)),f=(n=new DataView(e,a,s.numBytes)).getInt16(0,!0),u=2,c=0;do{if(0<f)for(;f--;)o[c++]=n.getUint8(u++);else for(l=n.getUint8(u++),f=-f;f--;)o[c++]=l}while(f=n.getInt16(u,!0),(u+=2)<s.numBytes);if(-32768!==f||c<o.length)throw"Unexpected end of mask RLE encoding";for(var d=new Uint8Array(r),h=0,m=0,m=0;m<r;m++)7&m?(h=o[m>>3],h<<=7&m):h=o[m>>3],128&h&&(d[m]=1);t.pixels.resultMask=d,s.bitset=o,a+=s.numBytes}return t.ptr=a,t.mask=s,!0},readDataOneSweep:function(e,t,a){var i=t.ptr,r=t.headerInfo,n=r.numDims,s=r.width*r.height,l=r.imageType,r=r.numValidPixel*z.getDataTypeSize(l)*n,o=t.pixels.resultMask,f=a===Uint8Array?new Uint8Array(e,i,r):(l=new ArrayBuffer(r),new Uint8Array(l).set(new Uint8Array(e,i,r)),new a(l));if(f.length===s*n)t.pixels.resultPixels=f;else{t.pixels.resultPixels=new a(s*n);var u,c=0,d=0,h=0;if(1<n)for(h=0;h<n;h++)for(u=h*s,d=0;d<s;d++)o[d]&&(t.pixels.resultPixels[u+d]=f[c++]);else for(d=0;d<s;d++)o[d]&&(t.pixels.resultPixels[d]=f[c++])}return i+=r,t.ptr=i,!0},readHuffmanTree:function(e,t){var a=this.HUFFMAN_LUT_BITS_MAX,i=new DataView(e,t.ptr,16);if(t.ptr+=16,i.getInt32(0,!0)<2)throw"unsupported Huffman version";var r=i.getInt32(4,!0),n=i.getInt32(8,!0),s=i.getInt32(12,!0);if(s<=n)return!1;var l=new Uint32Array(s-n);z.decodeBits(e,t,l);for(var o,f,u,c=[],d=n;d<s;d++)c[o=d-(d<r?0:r)]={first:l[d-n],second:null};var h=e.byteLength-t.ptr,i=Math.ceil(h/4),i=new ArrayBuffer(4*i);new Uint8Array(i).set(new Uint8Array(e,t.ptr,h));var m=new Uint32Array(i),g=0,p=0,w=m[0];for(d=n;d<s;d++)0<(u=c[o=d-(d<r?0:r)].first)&&(c[o].second=w<<g>>>32-u,u<=32-g?32===(g+=u)&&(g=0,w=m[++p]):(g+=u-32,w=m[++p],c[o].second|=w>>>32-g));var x=0,k=0,y=new V;for(d=0;d<c.length;d++)void 0!==c[d]&&(x=Math.max(x,c[d].first));k=a<=x?a:x,30<=x&&console.log("WARning, large NUM LUT BITS IS "+x);var b,I,U,v,T,M=[];for(d=n;d<s;d++)if(0<(u=c[o=d-(d<r?0:r)].first))if(b=[u,o],u<=k)for(I=c[o].second<<k-u,U=1<<k-u,f=0;f<U;f++)M[I|f]=b;else for(I=c[o].second,T=y,v=u-1;0<=v;v--)T=I>>>v&1?(T.right||(T.right=new V),T.right):(T.left||(T.left=new V),T.left),0!==v||T.val||(T.val=b[1]);return{decodeLut:M,numBitsLUTQick:k,numBitsLUT:x,tree:y,stuffedData:m,srcPtr:p,bitPos:g}},readHuffman:function(e,t,a){var i,r,n,s,l,o,f,u,c,d=t.headerInfo,h=d.numDims,m=t.headerInfo.height,g=t.headerInfo.width,p=g*m,e=this.readHuffmanTree(e,t),w=e.decodeLut,x=e.tree,k=e.stuffedData,y=e.srcPtr,b=e.bitPos,I=e.numBitsLUTQick,U=e.numBitsLUT,v=0===t.headerInfo.imageType?128:0,T=t.pixels.resultMask,M=0;0<b&&(y++,b=0);for(var V=k[y],A=1===t.encodeMode,B=new a(p*h),D=B,S=0;S<d.numDims;S++){if(1<h&&(D=new a(B.buffer,p*S,p),M=0),t.headerInfo.numValidPixel===g*m)for(o=u=0;o<m;o++)for(f=0;f<g;f++,u++){if(r=0,l=s=V<<b>>>32-I,w[l=32-b<I?s|=k[y+1]>>>64-b-I:l])r=w[l][1],b+=w[l][0];else for(l=s=V<<b>>>32-U,32-b<U&&(l=s|=k[y+1]>>>64-b-U),i=x,c=0;c<U;c++)if(!(i=s>>>U-c-1&1?i.right:i.left).left&&!i.right){r=i.val,b=b+c+1;break}32<=b&&(b-=32,V=k[++y]),n=r-v,A?(n+=!(0<f)&&0<o?D[u-g]:M,n&=255,M=D[u]=n):D[u]=n}else for(o=u=0;o<m;o++)for(f=0;f<g;f++,u++)if(T[u]){if(r=0,l=s=V<<b>>>32-I,w[l=32-b<I?s|=k[y+1]>>>64-b-I:l])r=w[l][1],b+=w[l][0];else for(l=s=V<<b>>>32-U,32-b<U&&(l=s|=k[y+1]>>>64-b-U),i=x,c=0;c<U;c++)if(!(i=s>>>U-c-1&1?i.right:i.left).left&&!i.right){r=i.val,b=b+c+1;break}32<=b&&(b-=32,V=k[++y]),n=r-v,A?(!(0<f&&T[u-1])&&0<o&&T[u-g]?n+=D[u-g]:n+=M,n&=255,M=D[u]=n):D[u]=n}t.ptr=t.ptr+4*(y+1)+(0<b?4:0)}t.pixels.resultPixels=B},decodeBits:function(e,t,a,i,r){var n=t.headerInfo,s=n.fileVersion,l=0,o=5<=e.byteLength-t.ptr?5:e.byteLength-t.ptr,f=new DataView(e,t.ptr,o),u=f.getUint8(0);l++;var c=u>>6,d=0==c?4:3-c,o=0<(32&u),c=31&u,u=0;if(1==d)u=f.getUint8(l),l++;else if(2==d)u=f.getUint16(l,!0),l+=2;else{if(4!=d)throw"Invalid valid pixel count type";u=f.getUint32(l,!0),l+=4}var h,m,g,p,w,x,k,d=2*n.maxZError,n=1<n.numDims?n.maxValues[r]:n.zMax;if(o){for(t.counter.lut++,x=f.getUint8(l),l++,p=Math.ceil((x-1)*c/8),w=Math.ceil(p/4),m=new ArrayBuffer(4*w),g=new Uint8Array(m),t.ptr+=l,g.set(new Uint8Array(e,t.ptr,p)),f=new Uint32Array(m),t.ptr+=p,k=0;x-1>>>k;)k++;p=Math.ceil(u*k/8),w=Math.ceil(p/4),m=new ArrayBuffer(4*w),(g=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,p)),h=new Uint32Array(m),t.ptr+=p,f=(3<=s?U:b)(f,c,x-1,i,d,n),(3<=s?I:y)(h,a,k,u,f)}else t.counter.bitstuffer++,k=c,t.ptr+=l,0<k&&(p=Math.ceil(u*k/8),w=Math.ceil(p/4),m=new ArrayBuffer(4*w),(g=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,p)),h=new Uint32Array(m),t.ptr+=p,3<=s?null===i?T(h,a,k,u):I(h,a,k,u,!1,i,d,n):null===i?v(h,a,k,u):y(h,a,k,u,!1,i,d,n))},readTiles:function(e,t,a){var i=t.headerInfo,r=i.width,n=i.height,s=i.microBlockSize,l=i.imageType,o=z.getDataTypeSize(l),f=Math.ceil(r/s),u=Math.ceil(n/s);t.pixels.numBlocksY=u,t.pixels.numBlocksX=f;for(var c,d,h,m,g,p,w,x,k,y,b,I,U,v,T=t.pixels.ptr=0,M=0,V=0,A=0,B=0,D=0,S=0,P=0,E=new a(s*s),C=n%s||s,F=r%s||s,L=i.numDims,O=t.pixels.resultMask,N=t.pixels.resultPixels,V=0;V<u;V++)for(c=V!==u-1?s:C,A=0;A<f;A++)for(B=V*r*s+A*s,p=r-(d=A!==f-1?s:F),v=0;v<L;v++){if(1<L&&(N=new a(t.pixels.resultPixels.buffer,r*n*v*o,r*n)),h=e.byteLength-t.ptr,k={},P=0,P++,g=(m=(x=new DataView(e,t.ptr,Math.min(10,h))).getUint8(0))>>6&255,(m>>2&15)!=(A*s>>3&15))throw"integrity issue";if(3<(b=3&m))throw t.ptr+=P,"Invalid block encoding ("+b+")";if(2!=b)if(0==b){if(t.counter.uncompressed++,t.ptr+=P,D=(D=c*d*o)<(w=e.byteLength-t.ptr)?D:w,I=new ArrayBuffer(D%o==0?D:D+o-D%o),new Uint8Array(I).set(new Uint8Array(e,t.ptr,D)),y=new a(I),S=0,O)for(T=0;T<c;T++){for(M=0;M<d;M++)O[B]&&(N[B]=y[S++]),B++;B+=p}else for(T=0;T<c;T++){for(M=0;M<d;M++)N[B++]=y[S++];B+=p}t.ptr+=S*o}else if(I=z.getDataTypeUsed(l,g),U=z.getOnePixel(k,P,I,x),P+=z.getDataTypeSize(I),3==b)if(t.ptr+=P,t.counter.constantoffset++,O)for(T=0;T<c;T++){for(M=0;M<d;M++)O[B]&&(N[B]=U),B++;B+=p}else for(T=0;T<c;T++){for(M=0;M<d;M++)N[B++]=U;B+=p}else if(t.ptr+=P,z.decodeBits(e,t,E,U,v),P=0,O)for(T=0;T<c;T++){for(M=0;M<d;M++)O[B]&&(N[B]=E[P++]),B++;B+=p}else for(T=0;T<c;T++){for(M=0;M<d;M++)N[B++]=E[P++];B+=p}else t.counter.constant++,t.ptr+=P}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:z.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t,a=e.headerInfo.zMax,i=e.headerInfo.numDims,r=e.headerInfo.height*e.headerInfo.width,n=r*i,s=0,l=0,o=e.pixels.resultMask;if(o)if(1<i)for(s=0;s<i;s++)for(t=s*r,l=0;l<r;l++)o[l]&&(e.pixels.resultPixels[t+l]=a);else for(l=0;l<r;l++)o[l]&&(e.pixels.resultPixels[l]=a);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(a);else for(l=0;l<n;l++)e.pixels.resultPixels[l]=a},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:t=Float32Array;break;case 7:t=Float64Array;break;default:t=Float32Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:t="F32";break;case 7:t="F64";break;default:t="F32"}return t},isValidPixelValue:function(e,t){if(null===t)return!1;var a;switch(e){case 0:a=-128<=t&&t<=127;break;case 1:a=0<=t&&t<=255;break;case 2:a=-32768<=t&&t<=32767;break;case 3:a=0<=t&&t<=65536;break;case 4:a=-2147483648<=t&&t<=2147483647;break;case 5:a=0<=t&&t<=4294967296;break;case 6:a=-34027999387901484e22<=t&&t<=34027999387901484e22;break;case 7:a=5e-324<=t&&t<=17976931348623157e292;break;default:a=!1}return a},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var a=e;switch(e){case 2:case 4:a=e-t;break;case 3:case 5:a=e-2*t;break;case 6:a=0===t?e:1===t?2:1;break;case 7:a=0===t?e:e-2*t+1;break;default:a=e}return a},getOnePixel:function(e,t,a,i){var r=0;switch(a){case 0:r=i.getInt8(t);break;case 1:r=i.getUint8(t);break;case 2:r=i.getInt16(t,!0);break;case 3:r=i.getUint16(t,!0);break;case 4:r=i.getInt32(t,!0);break;case 5:r=i.getUInt32(t,!0);break;case 6:r=i.getFloat32(t,!0);break;case 7:r=i.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return r}},V=function(e,t,a){this.val=e,this.left=t,this.right=a};return{decode:function(e,t){var a=(t=t||{}).noDataValue,i=0,r={};if(r.ptr=t.inputOffset||0,r.pixels={},z.readHeaderInfo(e,r)){var n=r.headerInfo,s=n.fileVersion,l=z.getDataTypeArray(n.imageType);z.readMask(e,r),n.numValidPixel===n.width*n.height||r.pixels.resultMask||(r.pixels.resultMask=t.maskData);var o,f=n.width*n.height;if(r.pixels.resultPixels=new l(f*n.numDims),r.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==n.numValidPixel)if(n.zMax===n.zMin)z.constructConstantSurface(r);else if(4<=s&&z.checkMinMaxRanges(e,r))z.constructConstantSurface(r);else{var u=new DataView(e,r.ptr,2),c=u.getUint8(0);if(r.ptr++,c)z.readDataOneSweep(e,r,l);else if(1<s&&n.imageType<=1&&Math.abs(n.maxZError-.5)<1e-5){u=u.getUint8(1);if(r.ptr++,2<(r.encodeMode=u)||s<4&&1<u)throw"Invalid Huffman flag "+u;u?z.readHuffman(e,r,l):z.readTiles(e,r,l)}else z.readTiles(e,r,l)}r.eofOffset=r.ptr,t.inputOffset?(o=r.headerInfo.blobSize+t.inputOffset-r.ptr,1<=Math.abs(o)&&(r.eofOffset=t.inputOffset+r.headerInfo.blobSize)):(o=r.headerInfo.blobSize-r.ptr,1<=Math.abs(o)&&(r.eofOffset=r.headerInfo.blobSize));var d={width:n.width,height:n.height,pixelData:r.pixels.resultPixels,minValue:n.zMin,maxValue:n.zMax,validPixelCount:n.numValidPixel,dimCount:n.numDims,dimStats:{minValues:n.minValues,maxValues:n.maxValues},maskData:r.pixels.resultMask};if(r.pixels.resultMask&&z.isValidPixelValue(n.imageType,a)){for(var h=r.pixels.resultMask,i=0;i<f;i++)h[i]||(d.pixelData[i]=a);d.noDataValue=a}return r.noDataValue=a,t.returnFileInfo&&(d.fileInfo=z.formatFileInfo(r)),d}},getBandCount:function(e){for(var t=0,a=0,i={ptr:0,pixels:{}};a<e.byteLength-58;)z.readHeaderInfo(e,i),a+=i.headerInfo.blobSize,t++,i.ptr=a;return t}}}(),m=new ArrayBuffer(4),g=new Uint8Array(m),k=(new Uint32Array(m)[0]=1)===g[0],g={decode:function(e,t){if(!k)throw"Big endian system is not supported.";var a,i,r=(t=t||{}).inputOffset||0,n=new Uint8Array(e,r,10),n=String.fromCharCode.apply(null,n);if("CntZImage"===n.trim())a=w,i=1;else{if("Lerc2"!==n.substring(0,5))throw"Unexpected file identifier string: "+n;a=x,i=2}for(var s,l,o,f,u,c,d=0,h=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};r<h;){var p=a.decode(e,{inputOffset:r,encodedMaskData:s,maskData:o,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null}),r=p.fileInfo.eofOffset;0===d&&(s=p.encodedMaskData,o=p.maskData,g.width=p.width,g.height=p.height,g.dimCount=p.dimCount||1,g.pixelType=p.pixelType||p.fileInfo.pixelType,g.mask=p.maskData),1<i&&p.fileInfo.mask&&0<p.fileInfo.mask.numBytes&&m.push(p.maskData),d++,g.pixels.push(p.pixelData),g.statistics.push({minValue:p.minValue,maxValue:p.maxValue,noDataValue:p.noDataValue,dimStats:p.dimStats})}if(1<i&&1<m.length){for(c=g.width*g.height,g.bandMasks=m,(o=new Uint8Array(c)).set(m[0]),f=1;f<m.length;f++)for(l=m[f],u=0;u<c;u++)o[u]=o[u]&l[u];g.maskData=o}return g}},p.Lerc=g;var y=p.Lerc;return t(function(e,t){if(e.encoding===o.LERC){var a;try{a=y.decode(e.heightmap)}catch(e){throw new n.RuntimeError(e)}if(a.statistics[0].minValue===Number.MAX_VALUE)throw new n.RuntimeError("Invalid tile data");e.heightmap=a.pixels[0],e.width=a.width,e.height=a.height}e.ellipsoid=Se.Ellipsoid.clone(e.ellipsoid),e.rectangle=Se.Rectangle.clone(e.rectangle);var i=ze.computeVertices(e),r=i.vertices;return t.push(r.buffer),{vertices:r.buffer,numberOfAttributes:i.encoding.getStride(),minimumHeight:i.minimumHeight,maximumHeight:i.maximumHeight,gridWidth:e.width,gridHeight:e.height,boundingSphere3D:i.boundingSphere3D,orientedBoundingBox:i.orientedBoundingBox,occludeePointInScaledSpace:i.occludeePointInScaledSpace,encoding:i.encoding,westIndicesSouthToNorth:i.westIndicesSouthToNorth,southIndicesEastToWest:i.southIndicesEastToWest,eastIndicesNorthToSouth:i.eastIndicesNorthToSouth,northIndicesWestToEast:i.northIndicesWestToEast}})}); +define(["./Cartesian2-8646c5a1","./EllipsoidTangentPlane-325a8e68","./Transforms-79117a7b","./when-54335d57","./Check-24483042","./TerrainEncoding-c552e269","./Math-d6182036","./OrientedBoundingBox-eb360dc3","./WebMercatorProjection-66cc0482","./RuntimeError-88a32665","./createTaskProcessorWorker","./IntersectionTests-5394f658","./Plane-13ae4b1b","./AttributeCompression-10c27d9c","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9"],function(Se,Pe,Ee,Ce,e,Fe,Le,Oe,Ne,r,t,a,i,n,s,l){"use strict";var o=Object.freeze({NONE:0,LERC:1}),ze={};ze.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Re=new Se.Cartesian3,_e=new Ee.Matrix4,He=new Se.Cartesian3,Ye=new Se.Cartesian3;ze.computeVertices=function(e){var t,a,i,r=Math.cos,n=Math.sin,s=Math.sqrt,l=Math.atan,o=Math.exp,f=Le.CesiumMath.PI_OVER_TWO,u=Le.CesiumMath.toRadians,c=e.heightmap,d=e.width,h=e.height,m=e.skirtHeight,g=Ce.defaultValue(e.isGeographic,!0),p=Ce.defaultValue(e.ellipsoid,Se.Ellipsoid.WGS84),w=1/p.maximumRadius,x=e.nativeRectangle,k=e.rectangle,y=Ce.defined(k)?(t=k.west,a=k.south,i=k.east,k.north):g?(t=u(x.west),a=u(x.south),i=u(x.east),u(x.north)):(t=x.west*w,a=f-2*l(o(-x.south*w)),i=x.east*w,f-2*l(o(-x.north*w))),I=e.relativeToCenter,b=Ce.defined(I),I=b?I:Se.Cartesian3.ZERO,U=Ce.defaultValue(e.exaggeration,1),v=Ce.defaultValue(e.includeWebMercatorT,!1),T=Ce.defaultValue(e.structure,ze.DEFAULT_STRUCTURE),M=Ce.defaultValue(T.heightScale,ze.DEFAULT_STRUCTURE.heightScale),V=Ce.defaultValue(T.heightOffset,ze.DEFAULT_STRUCTURE.heightOffset),A=Ce.defaultValue(T.elementsPerHeight,ze.DEFAULT_STRUCTURE.elementsPerHeight),B=Ce.defaultValue(T.stride,ze.DEFAULT_STRUCTURE.stride),D=Ce.defaultValue(T.elementMultiplier,ze.DEFAULT_STRUCTURE.elementMultiplier),S=Ce.defaultValue(T.isBigEndian,ze.DEFAULT_STRUCTURE.isBigEndian),P=Se.Rectangle.computeWidth(x),E=Se.Rectangle.computeHeight(x),C=P/(d-1),F=E/(h-1);g||(P*=w,E*=w);var L,O,e=p.radiiSquared,N=e.x,z=e.y,R=e.z,_=65536,H=-65536,T=Ee.Transforms.eastNorthUpToFixedFrame(I,p),Y=Ee.Matrix4.inverseTransformation(T,_e);v&&(L=Ne.WebMercatorProjection.geodeticLatitudeToMercatorAngle(a),O=1/(Ne.WebMercatorProjection.geodeticLatitudeToMercatorAngle(y)-L));var W=He;W.x=Number.POSITIVE_INFINITY,W.y=Number.POSITIVE_INFINITY,W.z=Number.POSITIVE_INFINITY;var X=Ye;X.x=Number.NEGATIVE_INFINITY,X.y=Number.NEGATIVE_INFINITY,X.z=Number.NEGATIVE_INFINITY;var Z=Number.POSITIVE_INFINITY,j=d*h,G=j+(0<m?2*d+2*h:0),q=new Array(G),Q=new Array(G),J=new Array(G),K=v?new Array(G):[],$=0,ee=h,te=0,ae=d;0<m&&(--$,++ee,--te,++ae);for(var ie=$;ie<ee;++ie){var re=ie;h<=(re=re<0?0:re)&&(re=h-1);var ne=x.north-F*re,ne=g?u(ne):f-2*l(o(-ne*w)),se=Le.CesiumMath.clamp(se=(ne-a)/(y-a),0,1),le=ie===$,oe=ie===ee-1;0<m&&(le?ne+=1e-5*E:oe&&(ne-=1e-5*E));var fe,ue=r(ne),ce=n(ne),de=R*ce;v&&(fe=(Ne.WebMercatorProjection.geodeticLatitudeToMercatorAngle(ne)-L)*O);for(var he=te;he<ae;++he){var me=he,ge=re*(d*B)+(me=d<=(me=me<0?0:me)?d-1:me)*B;if(1===A)we=c[ge];else{var pe,we=0;if(S)for(pe=0;pe<A;++pe)we=we*D+c[ge+pe];else for(pe=A-1;0<=pe;--pe)we=we*D+c[ge+pe]}we=(we*M+V)*U;var H=Math.max(H,we),_=Math.min(_,we),xe=x.west+C*me;g?xe=u(xe):xe*=w;var ke=Le.CesiumMath.clamp(ke=(xe-t)/(i-t),0,1),ye=re*d+me;if(0<m){var Ie=he===te,be=he===ae-1,Ue=le||oe||Ie||be;if((le||oe)&&(Ie||be))continue;Ue&&(we-=m,Ie?(ye=h-re-1+j,xe-=1e-5*P):oe?ye=j+h+(d-me-1):be?(ye=j+h+d+re,xe+=1e-5*P):le&&(ye=j+h+d+h+me))}var ve=ue*r(xe),Ue=ue*n(xe),Ie=N*ve,be=z*Ue,me=1/s(Ie*ve+be*Ue+de*ce),xe=Ie*me,Ie=be*me,be=de*me,me=new Se.Cartesian3;me.x=xe+ve*we,me.y=Ie+Ue*we,me.z=be+ce*we,q[ye]=me,Q[ye]=we,J[ye]=new Se.Cartesian2(ke,se),v&&(K[ye]=fe),Ee.Matrix4.multiplyByPoint(Y,me,Re),Se.Cartesian3.minimumByComponent(Re,W,W),Se.Cartesian3.maximumByComponent(Re,X,X),Z=Math.min(Z,we)}}var Te,Me,e=Ee.BoundingSphere.fromPoints(q);Ce.defined(k)&&(Te=Oe.OrientedBoundingBox.fromRectangle(k,_,H,p)),b&&(Me=new Fe.EllipsoidalOccluder(p).computeHorizonCullingPointPossiblyUnderEllipsoid(I,q,_));for(var I=new Pe.AxisAlignedBoundingBox(W,X,I),Ve=new Fe.TerrainEncoding(I,Z,H,T,!1,v),Ae=new Float32Array(G*Ve.getStride()),Be=0,De=0;De<G;++De)Be=Ve.encode(Ae,Be,q[De],J[De],Q[De],void 0,K[De]);return{vertices:Ae,maximumHeight:H,minimumHeight:_,encoding:Ve,boundingSphere3D:e,orientedBoundingBox:Te,occludeePointInScaledSpace:Me}};var f,u,c,d,h,B,m,g,w,x,k,p={};f={defaultNoDataValue:-34027999387901484e22,decode:function(e,t){var a=(t=t||{}).encodedMaskData||null===t.encodedMaskData,i=h(e,t.inputOffset||0,a),e=null!==t.noDataValue?t.noDataValue:f.defaultNoDataValue,a=u(i,t.pixelType||Float32Array,t.encodedMaskData,e,t.returnMask),e={width:i.width,height:i.height,pixelData:a.resultPixels,minValue:a.minValue,maxValue:i.pixels.maxValue,noDataValue:e};return a.resultMask&&(e.maskData=a.resultMask),t.returnEncodedMask&&i.mask&&(e.encodedMaskData=i.mask.bitset||null),t.returnFileInfo&&(e.fileInfo=c(i),t.computeUsedBitDepths&&(e.fileInfo.bitDepths=d(i))),e}},u=function(e,t,a,i,r){var n,s,l,o=0,f=e.pixels.numBlocksX,u=e.pixels.numBlocksY,c=Math.floor(e.width/f),d=Math.floor(e.height/u),h=2*e.maxZError,m=Number.MAX_VALUE;a=a||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),r&&a&&(l=new Uint8Array(e.width*e.height));for(var g,p,w=new Float32Array(c*d),x=0;x<=u;x++){var k=x!==u?d:e.height%u;if(0!==k)for(var y=0;y<=f;y++){var I=y!==f?c:e.width%f;if(0!==I){var b,U,v,T,M=x*e.width*d+y*c,V=e.width-I,A=e.pixels.blocks[o];if(A.encoding<2?(b=0===A.encoding?A.rawData:(B(A.stuffedData,A.bitsPerPixel,A.numValidPixels,A.offset,h,w,e.pixels.maxValue),w),U=0):v=2===A.encoding?0:A.offset,a)for(p=0;p<k;p++){for(7&M&&(T=a[M>>3],T<<=7&M),g=0;g<I;g++)128&(T=!(7&M)?a[M>>3]:T)?(l&&(l[M]=1),m=(n=A.encoding<2?b[U++]:v)<m?n:m,s[M++]=n):(l&&(l[M]=0),s[M++]=i),T<<=1;M+=V}else if(A.encoding<2)for(p=0;p<k;p++){for(g=0;g<I;g++)m=(n=b[U++])<m?n:m,s[M++]=n;M+=V}else for(m=v<m?v:m,p=0;p<k;p++){for(g=0;g<I;g++)s[M++]=v;M+=V}if(1===A.encoding&&U!==A.numValidPixels)throw"Block and Mask do not match";o++}}}return{resultPixels:s,resultMask:l,minValue:m}},c=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},d=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,a={},i=0;i<t;i++){var r=e.pixels.blocks[i];0===r.encoding?a.float32=!0:1===r.encoding?a[r.bitsPerPixel]=!0:a[0]=!0}return Object.keys(a)},h=function(e,t,a){var i={},r=new Uint8Array(e,t,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,r),"CntZImage"!==i.fileIdentifierString.trim())throw"Unexpected file identifier string: "+i.fileIdentifierString;t+=10;var n=new DataView(e,t,24);if(i.fileVersion=n.getInt32(0,!0),i.imageType=n.getInt32(4,!0),i.height=n.getUint32(8,!0),i.width=n.getUint32(12,!0),i.maxZError=n.getFloat64(16,!0),t+=24,!a)if(n=new DataView(e,t,16),i.mask={},i.mask.numBlocksY=n.getUint32(0,!0),i.mask.numBlocksX=n.getUint32(4,!0),i.mask.numBytes=n.getUint32(8,!0),i.mask.maxValue=n.getFloat32(12,!0),t+=16,0<i.mask.numBytes){var s=new Uint8Array(Math.ceil(i.width*i.height/8)),l=(n=new DataView(e,t,i.mask.numBytes)).getInt16(0,!0),o=2,f=0;do{if(0<l)for(;l--;)s[f++]=n.getUint8(o++);else for(var u=n.getUint8(o++),l=-l;l--;)s[f++]=u}while(l=n.getInt16(o,!0),(o+=2)<i.mask.numBytes);if(-32768!==l||f<s.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=s,t+=i.mask.numBytes}else 0==(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)&&(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));n=new DataView(e,t,16),i.pixels={},i.pixels.numBlocksY=n.getUint32(0,!0),i.pixels.numBlocksX=n.getUint32(4,!0),i.pixels.numBytes=n.getUint32(8,!0),i.pixels.maxValue=n.getFloat32(12,!0),t+=16;var r=i.pixels.numBlocksX,a=i.pixels.numBlocksY,c=r+(0<i.width%r?1:0),d=a+(0<i.height%a?1:0);i.pixels.blocks=new Array(c*d);for(var h=0,m=0;m<d;m++)for(var g=0;g<c;g++){var p=0,w=e.byteLength-t;n=new DataView(e,t,Math.min(10,w));var x={};i.pixels.blocks[h++]=x;var k,w=n.getUint8(0);if(p++,x.encoding=63&w,3<x.encoding)throw"Invalid block encoding ("+x.encoding+")";if(2!==x.encoding){if(0!==w&&2!==w){if(w>>=6,2===(x.offsetType=w))x.offset=n.getInt8(1),p++;else if(1===w)x.offset=n.getInt16(1,!0),p+=2;else{if(0!==w)throw"Invalid block offset type";x.offset=n.getFloat32(1,!0),p+=4}if(1===x.encoding)if(w=n.getUint8(p),p++,x.bitsPerPixel=63&w,w>>=6,2===(x.numValidPixelsType=w))x.numValidPixels=n.getUint8(p),p++;else if(1===w)x.numValidPixels=n.getUint16(p,!0),p+=2;else{if(0!==w)throw"Invalid valid pixel count type";x.numValidPixels=n.getUint32(p,!0),p+=4}}if(t+=p,3!==x.encoding)if(0===x.encoding){var y=(i.pixels.numBytes-1)/4;if(y!==Math.floor(y))throw"uncompressed block has invalid length";k=new ArrayBuffer(4*y),new Uint8Array(k).set(new Uint8Array(e,t,4*y));var I=new Float32Array(k);x.rawData=I,t+=4*y}else 1===x.encoding&&(I=Math.ceil(x.numValidPixels*x.bitsPerPixel/8),y=Math.ceil(I/4),k=new ArrayBuffer(4*y),new Uint8Array(k).set(new Uint8Array(e,t,I)),x.stuffedData=new Uint32Array(k),t+=I)}else t++}return i.eofOffset=t,i},B=function(e,t,a,i,r,n,s){var l,o,f,u,c=(1<<t)-1,d=0,h=0,m=Math.ceil((s-i)/r),g=4*e.length-Math.ceil(t*a/8);for(e[e.length-1]<<=8*g,l=0;l<a;l++)0===h&&(u=e[d++],h=32),t<=h?(f=u>>>h-t&c,h-=t):(f=(u&c)<<(o=t-h)&c,f+=(u=e[d++])>>>(h=32-o)),n[l]=f<m?i+f*r:s;return n},w=f,x=function(){var y=function(e,t,a,i,r,n,s,l){var o,f,u,c,d,h=(1<<a)-1,m=0,g=0,p=4*e.length-Math.ceil(a*i/8);if(e[e.length-1]<<=8*p,r)for(o=0;o<i;o++)0===g&&(u=e[m++],g=32),a<=g?(f=u>>>g-a&h,g-=a):(f=(u&h)<<(c=a-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=r[f];else for(d=Math.ceil((l-n)/s),o=0;o<i;o++)0===g&&(u=e[m++],g=32),a<=g?(f=u>>>g-a&h,g-=a):(f=(u&h)<<(c=a-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=f<d?n+f*s:l},I=function(e,t,a,i,r,n){var s,l,o=(1<<t)-1,f=0,u=0,c=0,d=0,h=[],m=4*e.length-Math.ceil(t*a/8);e[e.length-1]<<=8*m;for(var g=Math.ceil((n-i)/r),u=0;u<a;u++)0===c&&(l=e[f++],c=32),t<=c?(d=l>>>c-t&o,c-=t):(d=(l&o)<<(s=t-c)&o,d+=(l=e[f++])>>>(c=32-s)),h[u]=d<g?i+d*r:n;return h.unshift(i),h},b=function(e,t,a,i,r,n,s,l){var o,f,u,c=(1<<a)-1,d=0,h=0,m=0;if(r)for(p=0;p<i;p++)0===h&&(f=e[d++],h=32,m=0),a<=h?(o=f>>>m&c,h-=a,m+=a):(o=f>>>m&c,h=32-(u=a-h),o|=((f=e[d++])&(1<<u)-1)<<a-u,m=u),t[p]=r[o];else for(var g=Math.ceil((l-n)/s),p=0;p<i;p++)0===h&&(f=e[d++],h=32,m=0),a<=h?(o=f>>>m&c,h-=a,m+=a):(o=f>>>m&c,h=32-(u=a-h),o|=((f=e[d++])&(1<<u)-1)<<a-u,m=u),t[p]=o<g?n+o*s:l;return t},U=function(e,t,a,i,r,n){for(var s,l,o=(1<<t)-1,f=0,u=0,c=0,d=0,h=0,m=[],g=Math.ceil((n-i)/r),u=0;u<a;u++)0===c&&(l=e[f++],c=32,h=0),t<=c?(d=l>>>h&o,c-=t,h+=t):(d=l>>>h&o,c=32-(s=t-c),d|=((l=e[f++])&(1<<s)-1)<<t-s,h=s),m[u]=d<g?i+d*r:n;return m.unshift(i),m},v=function(e,t,a,i){var r,n,s,l,o=(1<<a)-1,f=0,u=0,c=4*e.length-Math.ceil(a*i/8);for(e[e.length-1]<<=8*c,r=0;r<i;r++)0===u&&(s=e[f++],u=32),a<=u?(n=s>>>u-a&o,u-=a):(n=(s&o)<<(l=a-u)&o,n+=(s=e[f++])>>>(u=32-l)),t[r]=n;return t},T=function(e,t,a,i){for(var r,n,s,l=(1<<a)-1,o=0,f=0,u=0,c=0;c<i;c++)0===f&&(n=e[o++],f=32,u=0),a<=f?(r=n>>>u&l,f-=a,u+=a):(r=n>>>u&l,f=32-(s=a-f),r|=((n=e[o++])&(1<<s)-1)<<a-s,u=s),t[c]=r;return t},z={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,a=65535,i=e.length,r=Math.floor(i/2),n=0;r;){var s=359<=r?359:r;for(r-=s;t+=e[n++]<<8,a+=t+=e[n++],--s;);t=(65535&t)+(t>>>16),a=(65535&a)+(a>>>16)}return 1&i&&(a+=t+=e[n]<<8),((a=(65535&a)+(a>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var a=t.ptr,i=new Uint8Array(e,a,6),r={};if(r.fileIdentifierString=String.fromCharCode.apply(null,i),0!==r.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+r.fileIdentifierString;a+=6;var n=new DataView(e,a,8),i=n.getInt32(0,!0);if(a+=4,3<=(r.fileVersion=i)&&(r.checksum=n.getUint32(4,!0),a+=4),n=new DataView(e,a,12),r.height=n.getUint32(0,!0),r.width=n.getUint32(4,!0),a+=8,4<=i?(r.numDims=n.getUint32(8,!0),a+=4):r.numDims=1,n=new DataView(e,a,40),r.numValidPixel=n.getUint32(0,!0),r.microBlockSize=n.getInt32(4,!0),r.blobSize=n.getInt32(8,!0),r.imageType=n.getInt32(12,!0),r.maxZError=n.getFloat64(16,!0),r.zMin=n.getFloat64(24,!0),r.zMax=n.getFloat64(32,!0),a+=40,t.headerInfo=r,t.ptr=a,3<=i&&this.computeChecksumFletcher32(new Uint8Array(e,a-(4<=i?52:48),r.blobSize-14))!==r.checksum)throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var a=t.headerInfo,i=this.getDataTypeArray(a.imageType),r=a.numDims*this.getDataTypeSize(a.imageType),n=this.readSubArray(e,t.ptr,i,r),s=this.readSubArray(e,t.ptr+r,i,r);t.ptr+=2*r;for(var l=!0,o=0;o<a.numDims;o++)if(n[o]!==s[o]){l=!1;break}return a.minValues=n,a.maxValues=s,l},readSubArray:function(e,t,a,i){var r=a===Uint8Array?new Uint8Array(e,t,i):(r=new ArrayBuffer(i),new Uint8Array(r).set(new Uint8Array(e,t,i)),new a(r));return r},readMask:function(e,t){var a=t.ptr,i=t.headerInfo,r=i.width*i.height,i=i.numValidPixel,n=new DataView(e,a,4),s={};if(s.numBytes=n.getUint32(0,!0),a+=4,(0===i||r===i)&&0!==s.numBytes)throw"invalid mask";if(0===i)o=new Uint8Array(Math.ceil(r/8)),s.bitset=o,d=new Uint8Array(r),t.pixels.resultMask=d,a+=s.numBytes;else if(0<s.numBytes){var l,o=new Uint8Array(Math.ceil(r/8)),f=(n=new DataView(e,a,s.numBytes)).getInt16(0,!0),u=2,c=0;do{if(0<f)for(;f--;)o[c++]=n.getUint8(u++);else for(l=n.getUint8(u++),f=-f;f--;)o[c++]=l}while(f=n.getInt16(u,!0),(u+=2)<s.numBytes);if(-32768!==f||c<o.length)throw"Unexpected end of mask RLE encoding";for(var d=new Uint8Array(r),h=0,m=0,m=0;m<r;m++)7&m?(h=o[m>>3],h<<=7&m):h=o[m>>3],128&h&&(d[m]=1);t.pixels.resultMask=d,s.bitset=o,a+=s.numBytes}return t.ptr=a,t.mask=s,!0},readDataOneSweep:function(e,t,a){var i=t.ptr,r=t.headerInfo,n=r.numDims,s=r.width*r.height,l=r.imageType,r=r.numValidPixel*z.getDataTypeSize(l)*n,o=t.pixels.resultMask,f=a===Uint8Array?new Uint8Array(e,i,r):(l=new ArrayBuffer(r),new Uint8Array(l).set(new Uint8Array(e,i,r)),new a(l));if(f.length===s*n)t.pixels.resultPixels=f;else{t.pixels.resultPixels=new a(s*n);var u,c=0,d=0,h=0;if(1<n)for(h=0;h<n;h++)for(u=h*s,d=0;d<s;d++)o[d]&&(t.pixels.resultPixels[u+d]=f[c++]);else for(d=0;d<s;d++)o[d]&&(t.pixels.resultPixels[d]=f[c++])}return t.ptr=i+=r,!0},readHuffmanTree:function(e,t){var a=this.HUFFMAN_LUT_BITS_MAX,i=new DataView(e,t.ptr,16);if(t.ptr+=16,i.getInt32(0,!0)<2)throw"unsupported Huffman version";var r=i.getInt32(4,!0),n=i.getInt32(8,!0),s=i.getInt32(12,!0);if(s<=n)return!1;var l=new Uint32Array(s-n);z.decodeBits(e,t,l);for(var o,f,u,c=[],d=n;d<s;d++)c[o=d-(d<r?0:r)]={first:l[d-n],second:null};var h=e.byteLength-t.ptr,i=Math.ceil(h/4),i=new ArrayBuffer(4*i);new Uint8Array(i).set(new Uint8Array(e,t.ptr,h));var m=new Uint32Array(i),g=0,p=0,w=m[0];for(d=n;d<s;d++)0<(u=c[o=d-(d<r?0:r)].first)&&(c[o].second=w<<g>>>32-u,u<=32-g?32===(g+=u)&&(g=0,w=m[++p]):(w=m[++p],c[o].second|=w>>>32-(g+=u-32)));var x=0,k=0,y=new V;for(d=0;d<c.length;d++)void 0!==c[d]&&(x=Math.max(x,c[d].first));k=a<=x?a:x,30<=x&&console.log("WARning, large NUM LUT BITS IS "+x);var I,b,U,v,T,M=[];for(d=n;d<s;d++)if(0<(u=c[o=d-(d<r?0:r)].first))if(I=[u,o],u<=k)for(b=c[o].second<<k-u,U=1<<k-u,f=0;f<U;f++)M[b|f]=I;else for(b=c[o].second,T=y,v=u-1;0<=v;v--)T=b>>>v&1?(T.right||(T.right=new V),T.right):(T.left||(T.left=new V),T.left),0!==v||T.val||(T.val=I[1]);return{decodeLut:M,numBitsLUTQick:k,numBitsLUT:x,tree:y,stuffedData:m,srcPtr:p,bitPos:g}},readHuffman:function(e,t,a){var i,r,n,s,l,o,f,u,c,d=t.headerInfo,h=d.numDims,m=t.headerInfo.height,g=t.headerInfo.width,p=g*m,e=this.readHuffmanTree(e,t),w=e.decodeLut,x=e.tree,k=e.stuffedData,y=e.srcPtr,I=e.bitPos,b=e.numBitsLUTQick,U=e.numBitsLUT,v=0===t.headerInfo.imageType?128:0,T=t.pixels.resultMask,M=0;0<I&&(y++,I=0);for(var V=k[y],A=1===t.encodeMode,B=new a(p*h),D=B,S=0;S<d.numDims;S++){if(1<h&&(D=new a(B.buffer,p*S,p),M=0),t.headerInfo.numValidPixel===g*m)for(o=u=0;o<m;o++)for(f=0;f<g;f++,u++){if(r=0,l=s=V<<I>>>32-b,w[l=32-I<b?s|=k[y+1]>>>64-I-b:l])r=w[l][1],I+=w[l][0];else for(l=s=V<<I>>>32-U,32-I<U&&(l=s|=k[y+1]>>>64-I-U),i=x,c=0;c<U;c++)if(!(i=s>>>U-c-1&1?i.right:i.left).left&&!i.right){r=i.val,I=I+c+1;break}32<=I&&(I-=32,V=k[++y]),n=r-v,A?(n+=!(0<f)&&0<o?D[u-g]:M,n&=255,M=D[u]=n):D[u]=n}else for(o=u=0;o<m;o++)for(f=0;f<g;f++,u++)if(T[u]){if(r=0,l=s=V<<I>>>32-b,w[l=32-I<b?s|=k[y+1]>>>64-I-b:l])r=w[l][1],I+=w[l][0];else for(l=s=V<<I>>>32-U,32-I<U&&(l=s|=k[y+1]>>>64-I-U),i=x,c=0;c<U;c++)if(!(i=s>>>U-c-1&1?i.right:i.left).left&&!i.right){r=i.val,I=I+c+1;break}32<=I&&(I-=32,V=k[++y]),n=r-v,A?(!(0<f&&T[u-1])&&0<o&&T[u-g]?n+=D[u-g]:n+=M,n&=255,M=D[u]=n):D[u]=n}t.ptr=t.ptr+4*(y+1)+(0<I?4:0)}t.pixels.resultPixels=B},decodeBits:function(e,t,a,i,r){var n=t.headerInfo,s=n.fileVersion,l=0,o=5<=e.byteLength-t.ptr?5:e.byteLength-t.ptr,f=new DataView(e,t.ptr,o),u=f.getUint8(0);l++;var c=u>>6,d=0==c?4:3-c,o=0<(32&u),c=31&u,u=0;if(1==d)u=f.getUint8(l),l++;else if(2==d)u=f.getUint16(l,!0),l+=2;else{if(4!=d)throw"Invalid valid pixel count type";u=f.getUint32(l,!0),l+=4}var h,m,g,p,w,x,k,d=2*n.maxZError,n=1<n.numDims?n.maxValues[r]:n.zMax;if(o){for(t.counter.lut++,x=f.getUint8(l),l++,p=Math.ceil((x-1)*c/8),w=Math.ceil(p/4),m=new ArrayBuffer(4*w),g=new Uint8Array(m),t.ptr+=l,g.set(new Uint8Array(e,t.ptr,p)),f=new Uint32Array(m),t.ptr+=p,k=0;x-1>>>k;)k++;p=Math.ceil(u*k/8),w=Math.ceil(p/4),m=new ArrayBuffer(4*w),(g=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,p)),h=new Uint32Array(m),t.ptr+=p,f=(3<=s?U:I)(f,c,x-1,i,d,n),(3<=s?b:y)(h,a,k,u,f)}else t.counter.bitstuffer++,k=c,t.ptr+=l,0<k&&(p=Math.ceil(u*k/8),w=Math.ceil(p/4),m=new ArrayBuffer(4*w),(g=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,p)),h=new Uint32Array(m),t.ptr+=p,3<=s?null===i?T(h,a,k,u):b(h,a,k,u,!1,i,d,n):null===i?v(h,a,k,u):y(h,a,k,u,!1,i,d,n))},readTiles:function(e,t,a){var i=t.headerInfo,r=i.width,n=i.height,s=i.microBlockSize,l=i.imageType,o=z.getDataTypeSize(l),f=Math.ceil(r/s),u=Math.ceil(n/s);t.pixels.numBlocksY=u,t.pixels.numBlocksX=f;for(var c,d,h,m,g,p,w,x,k,y,I,b,U,v,T=t.pixels.ptr=0,M=0,V=0,A=0,B=0,D=0,S=0,P=0,E=new a(s*s),C=n%s||s,F=r%s||s,L=i.numDims,O=t.pixels.resultMask,N=t.pixels.resultPixels,V=0;V<u;V++)for(c=V!==u-1?s:C,A=0;A<f;A++)for(B=V*r*s+A*s,p=r-(d=A!==f-1?s:F),v=0;v<L;v++){if(1<L&&(N=new a(t.pixels.resultPixels.buffer,r*n*v*o,r*n)),h=e.byteLength-t.ptr,k={},P=0,P++,g=(m=(x=new DataView(e,t.ptr,Math.min(10,h))).getUint8(0))>>6&255,(m>>2&15)!=(A*s>>3&15))throw"integrity issue";if(3<(I=3&m))throw t.ptr+=P,"Invalid block encoding ("+I+")";if(2!=I)if(0==I){if(t.counter.uncompressed++,t.ptr+=P,D=(D=c*d*o)<(w=e.byteLength-t.ptr)?D:w,b=new ArrayBuffer(D%o==0?D:D+o-D%o),new Uint8Array(b).set(new Uint8Array(e,t.ptr,D)),y=new a(b),S=0,O)for(T=0;T<c;T++){for(M=0;M<d;M++)O[B]&&(N[B]=y[S++]),B++;B+=p}else for(T=0;T<c;T++){for(M=0;M<d;M++)N[B++]=y[S++];B+=p}t.ptr+=S*o}else if(b=z.getDataTypeUsed(l,g),U=z.getOnePixel(k,P,b,x),P+=z.getDataTypeSize(b),3==I)if(t.ptr+=P,t.counter.constantoffset++,O)for(T=0;T<c;T++){for(M=0;M<d;M++)O[B]&&(N[B]=U),B++;B+=p}else for(T=0;T<c;T++){for(M=0;M<d;M++)N[B++]=U;B+=p}else if(t.ptr+=P,z.decodeBits(e,t,E,U,v),P=0,O)for(T=0;T<c;T++){for(M=0;M<d;M++)O[B]&&(N[B]=E[P++]),B++;B+=p}else for(T=0;T<c;T++){for(M=0;M<d;M++)N[B++]=E[P++];B+=p}else t.counter.constant++,t.ptr+=P}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:z.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t,a=e.headerInfo.zMax,i=e.headerInfo.numDims,r=e.headerInfo.height*e.headerInfo.width,n=r*i,s=0,l=0,o=e.pixels.resultMask;if(o)if(1<i)for(s=0;s<i;s++)for(t=s*r,l=0;l<r;l++)o[l]&&(e.pixels.resultPixels[t+l]=a);else for(l=0;l<r;l++)o[l]&&(e.pixels.resultPixels[l]=a);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(a);else for(l=0;l<n;l++)e.pixels.resultPixels[l]=a},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:t=Float32Array;break;case 7:t=Float64Array;break;default:t=Float32Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:t="F32";break;case 7:t="F64";break;default:t="F32"}return t},isValidPixelValue:function(e,t){if(null===t)return!1;var a;switch(e){case 0:a=-128<=t&&t<=127;break;case 1:a=0<=t&&t<=255;break;case 2:a=-32768<=t&&t<=32767;break;case 3:a=0<=t&&t<=65536;break;case 4:a=-2147483648<=t&&t<=2147483647;break;case 5:a=0<=t&&t<=4294967296;break;case 6:a=-34027999387901484e22<=t&&t<=34027999387901484e22;break;case 7:a=5e-324<=t&&t<=17976931348623157e292;break;default:a=!1}return a},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var a=e;switch(e){case 2:case 4:a=e-t;break;case 3:case 5:a=e-2*t;break;case 6:a=0===t?e:1===t?2:1;break;case 7:a=0===t?e:e-2*t+1;break;default:a=e}return a},getOnePixel:function(e,t,a,i){var r=0;switch(a){case 0:r=i.getInt8(t);break;case 1:r=i.getUint8(t);break;case 2:r=i.getInt16(t,!0);break;case 3:r=i.getUint16(t,!0);break;case 4:r=i.getInt32(t,!0);break;case 5:r=i.getUInt32(t,!0);break;case 6:r=i.getFloat32(t,!0);break;case 7:r=i.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return r}},V=function(e,t,a){this.val=e,this.left=t,this.right=a};return{decode:function(e,t){var a=(t=t||{}).noDataValue,i=0,r={};if(r.ptr=t.inputOffset||0,r.pixels={},z.readHeaderInfo(e,r)){var n=r.headerInfo,s=n.fileVersion,l=z.getDataTypeArray(n.imageType);z.readMask(e,r),n.numValidPixel===n.width*n.height||r.pixels.resultMask||(r.pixels.resultMask=t.maskData);var o,f=n.width*n.height;if(r.pixels.resultPixels=new l(f*n.numDims),r.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==n.numValidPixel)if(n.zMax===n.zMin)z.constructConstantSurface(r);else if(4<=s&&z.checkMinMaxRanges(e,r))z.constructConstantSurface(r);else{var u=new DataView(e,r.ptr,2),c=u.getUint8(0);if(r.ptr++,c)z.readDataOneSweep(e,r,l);else if(1<s&&n.imageType<=1&&Math.abs(n.maxZError-.5)<1e-5){u=u.getUint8(1);if(r.ptr++,2<(r.encodeMode=u)||s<4&&1<u)throw"Invalid Huffman flag "+u;u?z.readHuffman(e,r,l):z.readTiles(e,r,l)}else z.readTiles(e,r,l)}r.eofOffset=r.ptr,t.inputOffset?(o=r.headerInfo.blobSize+t.inputOffset-r.ptr,1<=Math.abs(o)&&(r.eofOffset=t.inputOffset+r.headerInfo.blobSize)):(o=r.headerInfo.blobSize-r.ptr,1<=Math.abs(o)&&(r.eofOffset=r.headerInfo.blobSize));var d={width:n.width,height:n.height,pixelData:r.pixels.resultPixels,minValue:n.zMin,maxValue:n.zMax,validPixelCount:n.numValidPixel,dimCount:n.numDims,dimStats:{minValues:n.minValues,maxValues:n.maxValues},maskData:r.pixels.resultMask};if(r.pixels.resultMask&&z.isValidPixelValue(n.imageType,a)){for(var h=r.pixels.resultMask,i=0;i<f;i++)h[i]||(d.pixelData[i]=a);d.noDataValue=a}return r.noDataValue=a,t.returnFileInfo&&(d.fileInfo=z.formatFileInfo(r)),d}},getBandCount:function(e){for(var t=0,a=0,i={ptr:0,pixels:{}};a<e.byteLength-58;)z.readHeaderInfo(e,i),a+=i.headerInfo.blobSize,t++,i.ptr=a;return t}}}(),m=new ArrayBuffer(4),g=new Uint8Array(m),k=(new Uint32Array(m)[0]=1)===g[0],p.Lerc={decode:function(e,t){if(!k)throw"Big endian system is not supported.";var a,i,r=(t=t||{}).inputOffset||0,n=new Uint8Array(e,r,10),n=String.fromCharCode.apply(null,n);if("CntZImage"===n.trim())a=w,i=1;else{if("Lerc2"!==n.substring(0,5))throw"Unexpected file identifier string: "+n;a=x,i=2}for(var s,l,o,f,u,c,d=0,h=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};r<h;){var p=a.decode(e,{inputOffset:r,encodedMaskData:s,maskData:o,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null}),r=p.fileInfo.eofOffset;0===d&&(s=p.encodedMaskData,o=p.maskData,g.width=p.width,g.height=p.height,g.dimCount=p.dimCount||1,g.pixelType=p.pixelType||p.fileInfo.pixelType,g.mask=p.maskData),1<i&&p.fileInfo.mask&&0<p.fileInfo.mask.numBytes&&m.push(p.maskData),d++,g.pixels.push(p.pixelData),g.statistics.push({minValue:p.minValue,maxValue:p.maxValue,noDataValue:p.noDataValue,dimStats:p.dimStats})}if(1<i&&1<m.length){for(c=g.width*g.height,g.bandMasks=m,(o=new Uint8Array(c)).set(m[0]),f=1;f<m.length;f++)for(l=m[f],u=0;u<c;u++)o[u]=o[u]&l[u];g.maskData=o}return g}};var y=p.Lerc;return t(function(e,t){if(e.encoding===o.LERC){try{i=y.decode(e.heightmap)}catch(e){throw new r.RuntimeError(e)}if(i.statistics[0].minValue===Number.MAX_VALUE)throw new r.RuntimeError("Invalid tile data");e.heightmap=i.pixels[0],e.width=i.width,e.height=i.height}e.ellipsoid=Se.Ellipsoid.clone(e.ellipsoid),e.rectangle=Se.Rectangle.clone(e.rectangle);var a=ze.computeVertices(e),i=a.vertices;return t.push(i.buffer),{vertices:i.buffer,numberOfAttributes:a.encoding.getStride(),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight,gridWidth:e.width,gridHeight:e.height,boundingSphere3D:a.boundingSphere3D,orientedBoundingBox:a.orientedBoundingBox,occludeePointInScaledSpace:a.occludeePointInScaledSpace,encoding:a.encoding,westIndicesSouthToNorth:a.westIndicesSouthToNorth,southIndicesEastToWest:a.southIndicesEastToWest,eastIndicesNorthToSouth:a.eastIndicesNorthToSouth,northIndicesWestToEast:a.northIndicesWestToEast}})}); diff --git a/public/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js b/public/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js index b24ce5e..4f54760 100644 --- a/public/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/public/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -1 +1 @@ -define(["./AttributeCompression-f02ec82f","./EllipsoidTangentPlane-9123a53b","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./when-208fe5b0","./TerrainEncoding-73cbc4e6","./IndexDatatype-d47ad6f6","./Math-4e53b694","./OrientedBoundingBox-18b4901f","./Check-d18af7c4","./WebMercatorProjection-ffb6b9f8","./createTaskProcessorWorker","./IntersectionTests-7d224a2f","./Plane-4aa8974d","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1"],function(ie,oe,ae,se,de,ce,ue,he,le,e,Ie,t,r,n,i,o,a){"use strict";function me(){e.DeveloperError.throwInstantiationError()}Object.defineProperties(me.prototype,{errorEvent:{get:e.DeveloperError.throwInstantiationError},credit:{get:e.DeveloperError.throwInstantiationError},tilingScheme:{get:e.DeveloperError.throwInstantiationError},ready:{get:e.DeveloperError.throwInstantiationError},readyPromise:{get:e.DeveloperError.throwInstantiationError},hasWaterMask:{get:e.DeveloperError.throwInstantiationError},hasVertexNormals:{get:e.DeveloperError.throwInstantiationError},availability:{get:e.DeveloperError.throwInstantiationError}});var s=[];me.getRegularGridIndices=function(e,t){var r=s[e];de.defined(r)||(s[e]=r=[]);var n=r[t];return de.defined(n)||m(e,t,n=e*t<he.CesiumMath.SIXTY_FOUR_KILOBYTES?r[t]=new Uint16Array((e-1)*(t-1)*6):r[t]=new Uint32Array((e-1)*(t-1)*6),0),n};var d=[];me.getRegularGridIndicesAndEdgeIndices=function(e,t){var r=d[e];de.defined(r)||(d[e]=r=[]);var n,i,o,a,s=r[t];return de.defined(s)||(n=me.getRegularGridIndices(e,t),i=(a=I(e,t)).westIndicesSouthToNorth,o=a.southIndicesEastToWest,e=a.eastIndicesNorthToSouth,a=a.northIndicesWestToEast,s=r[t]={indices:n,westIndicesSouthToNorth:i,southIndicesEastToWest:o,eastIndicesNorthToSouth:e,northIndicesWestToEast:a}),s};var l=[];function I(e,t){for(var r=new Array(t),n=new Array(e),i=new Array(t),o=new Array(e),a=0;a<e;++a)n[o[a]=a]=e*t-1-a;for(a=0;a<t;++a)i[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:i,northIndicesWestToEast:o}}function m(e,t,r,n){for(var i=0,o=0;o<t-1;++o){for(var a=0;a<e-1;++a){var s=i+e,d=s+1,c=i+1;r[n++]=i,r[n++]=s,r[n++]=c,r[n++]=c,r[n++]=s,r[n++]=d,++i}++i}}function c(e,t,r,n){for(var i=e[0],o=e.length,a=1;a<o;++a){var s=e[a];r[n++]=i,r[n++]=s,r[n++]=t,r[n++]=t,r[n++]=s,r[n++]=t+1,i=s,++t}return n}me.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){var r=l[e];de.defined(r)||(l[e]=r=[]);var n,i,o,a,s,d,c,u,h=r[t];return de.defined(h)||(o=(n=e*t)+(d=2*e+2*t),u=(i=(e-1)*(t-1)*6)+6*Math.max(0,d-4),a=(c=I(e,t)).westIndicesSouthToNorth,s=c.southIndicesEastToWest,d=c.eastIndicesNorthToSouth,c=c.northIndicesWestToEast,m(e,t,u=ue.IndexDatatype.createTypedArray(o,u),0),me.addSkirtIndices(a,s,d,c,n,u,i),h=r[t]={indices:u,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:d,northIndicesWestToEast:c,indexCountWithoutSkirts:i}),h},me.addSkirtIndices=function(e,t,r,n,i,o,a){a=c(e,i,o,a),a=c(t,i+=e.length,o,a),a=c(r,i+=t.length,o,a),c(n,i+=r.length,o,a)},me.heightmapTerrainQuality=.25,me.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*me.heightmapTerrainQuality/(t*r)},me.prototype.requestTileGeometry=e.DeveloperError.throwInstantiationError,me.prototype.getLevelMaximumGeometricError=e.DeveloperError.throwInstantiationError,me.prototype.getTileDataAvailable=e.DeveloperError.throwInstantiationError,me.prototype.loadTileDataAvailability=e.DeveloperError.throwInstantiationError;var ge=32767,Te=new se.Cartesian3,pe=new se.Cartesian3,fe=new se.Cartesian3,Ee=new se.Cartographic,ye=new se.Cartesian2,ve=new se.Cartesian3,Ne=new ae.Matrix4,we=new ae.Matrix4;function xe(e,t,r,n,i,o,a,s,d){var c=Number.POSITIVE_INFINITY,u=i.north,h=i.south,l=i.east,I=i.west;l<I&&(l+=he.CesiumMath.TWO_PI);for(var m=e.length,g=0;g<m;++g){var T=e[g],p=r[T],T=n[T];Ee.longitude=he.CesiumMath.lerp(I,l,T.x),Ee.latitude=he.CesiumMath.lerp(h,u,T.y),Ee.height=p-t;p=o.cartographicToCartesian(Ee,Te);ae.Matrix4.multiplyByPoint(a,p,p),se.Cartesian3.minimumByComponent(p,s,s),se.Cartesian3.maximumByComponent(p,d,d),c=Math.min(c,Ee.height)}return c}function be(e,t,r,n,i,o,a,s,d,c,u,h,l,I,m){var g=de.defined(a),T=d.north,p=d.south,f=d.east,E=d.west;f<E&&(f+=he.CesiumMath.TWO_PI);for(var y=r.length,v=0;v<y;++v){var N=r[v],w=i[N],x=o[N];Ee.longitude=he.CesiumMath.lerp(E,f,x.x)+I,Ee.latitude=he.CesiumMath.lerp(p,T,x.y)+m,Ee.height=w-c;var b,M,C=s.cartographicToCartesian(Ee,Te);g&&(b=2*N,ye.x=a[b],ye.y=a[1+b],1!==u&&(w=ie.AttributeCompression.octDecode(ye.x,ye.y,ve),N=ae.Transforms.eastNorthUpToFixedFrame(Te,s,we),b=ae.Matrix4.inverseTransformation(N,Ne),ae.Matrix4.multiplyByPointAsVector(b,w,w),w.z*=u,se.Cartesian3.normalize(w,w),ae.Matrix4.multiplyByPointAsVector(N,w,w),se.Cartesian3.normalize(w,w),ie.AttributeCompression.octEncode(w,ye))),n.hasWebMercatorT&&(M=(Ie.WebMercatorProjection.geodeticLatitudeToMercatorAngle(Ee.latitude)-h)*l),t=n.encode(e,t,C,x,Ee.height,ye,M)}}function Me(e,t){var r;return"function"==typeof e.slice&&"function"!=typeof(r=e.slice()).sort&&(r=void 0),(r=!de.defined(r)?Array.prototype.slice.call(e):r).sort(t),r}return t(function(e,t){var r,n,i=(ne=e.quantizedVertices).length/3,o=e.octEncodedNormals,a=e.westIndices.length+e.eastIndices.length+e.southIndices.length+e.northIndices.length,s=e.includeWebMercatorT,d=se.Rectangle.clone(e.rectangle),c=d.west,u=d.south,h=d.east,l=d.north,I=se.Ellipsoid.clone(e.ellipsoid),m=e.exaggeration,g=e.minimumHeight*m,T=e.maximumHeight*m,p=e.relativeToCenter,f=ae.Transforms.eastNorthUpToFixedFrame(p,I),E=ae.Matrix4.inverseTransformation(f,new ae.Matrix4);s&&(r=Ie.WebMercatorProjection.geodeticLatitudeToMercatorAngle(u),n=1/(Ie.WebMercatorProjection.geodeticLatitudeToMercatorAngle(l)-r));var y=ne.subarray(0,i),v=ne.subarray(i,2*i),N=ne.subarray(2*i,3*i),w=de.defined(o),x=new Array(i),b=new Array(i),M=new Array(i),C=s?new Array(i):[],S=pe;S.x=Number.POSITIVE_INFINITY,S.y=Number.POSITIVE_INFINITY,S.z=Number.POSITIVE_INFINITY;var A=fe;A.x=Number.NEGATIVE_INFINITY,A.y=Number.NEGATIVE_INFINITY,A.z=Number.NEGATIVE_INFINITY;for(var P=Number.POSITIVE_INFINITY,W=Number.NEGATIVE_INFINITY,D=Number.POSITIVE_INFINITY,B=Number.NEGATIVE_INFINITY,F=0;F<i;++F){var k=y[F],V=v[F],_=k/ge,H=V/ge,k=he.CesiumMath.lerp(g,T,N[F]/ge);Ee.longitude=he.CesiumMath.lerp(c,h,_),Ee.latitude=he.CesiumMath.lerp(u,l,H),Ee.height=k;P=Math.min(Ee.longitude,P),W=Math.max(Ee.longitude,W),D=Math.min(Ee.latitude,D),B=Math.max(Ee.latitude,B),V=I.cartographicToCartesian(Ee);x[F]=new se.Cartesian2(_,H),b[F]=k,M[F]=V,s&&(C[F]=(Ie.WebMercatorProjection.geodeticLatitudeToMercatorAngle(Ee.latitude)-r)*n),ae.Matrix4.multiplyByPoint(E,V,Te),se.Cartesian3.minimumByComponent(Te,S,S),se.Cartesian3.maximumByComponent(Te,A,A)}var O,G,Y,z=Me(e.westIndices,function(e,t){return x[e].y-x[t].y}),R=Me(e.eastIndices,function(e,t){return x[t].y-x[e].y}),L=Me(e.southIndices,function(e,t){return x[t].x-x[e].x}),U=Me(e.northIndices,function(e,t){return x[e].x-x[t].x});1!==m&&(G=ae.BoundingSphere.fromPoints(M),O=le.OrientedBoundingBox.fromRectangle(d,g,T,I)),(1!==m||g<0)&&(Y=new ce.EllipsoidalOccluder(I).computeHorizonCullingPointPossiblyUnderEllipsoid(p,M,g));var j=g,j=Math.min(j,xe(e.westIndices,e.westSkirtHeight,b,x,d,I,E,S,A));j=Math.min(j,xe(e.southIndices,e.southSkirtHeight,b,x,d,I,E,S,A)),j=Math.min(j,xe(e.eastIndices,e.eastSkirtHeight,b,x,d,I,E,S,A)),j=Math.min(j,xe(e.northIndices,e.northSkirtHeight,b,x,d,I,E,S,A));for(var q,Q,K,X=new oe.AxisAlignedBoundingBox(S,A,p),Z=new ce.TerrainEncoding(X,j,T,f,w,s),J=Z.getStride(),$=new Float32Array(i*J+a*J),ee=0,te=0;te<i;++te)w&&(K=2*te,ye.x=o[K],ye.y=o[1+K],1!==m&&(q=ie.AttributeCompression.octDecode(ye.x,ye.y,ve),Q=ae.Transforms.eastNorthUpToFixedFrame(M[te],I,we),K=ae.Matrix4.inverseTransformation(Q,Ne),ae.Matrix4.multiplyByPointAsVector(K,q,q),q.z*=m,se.Cartesian3.normalize(q,q),ae.Matrix4.multiplyByPointAsVector(Q,q,q),se.Cartesian3.normalize(q,q),ie.AttributeCompression.octEncode(q,ye))),ee=Z.encode($,ee,M[te],x[te],b[te],ye,C[te]);var re=Math.max(0,2*(a-4)),ne=e.indices.length+3*re;return(X=ue.IndexDatatype.createTypedArray(i+a,ne)).set(e.indices,0),re=-(j=1e-4*(W-P)),a=j,j=-(ne=f=1e-4*(B-D)),be($,f=i*J,z,Z,b,x,o,I,d,e.westSkirtHeight,m,r,n,re,0),be($,f+=e.westIndices.length*J,L,Z,b,x,o,I,d,e.southSkirtHeight,m,r,n,0,j),be($,f+=e.southIndices.length*J,R,Z,b,x,o,I,d,e.eastSkirtHeight,m,r,n,a,0),be($,f+=e.eastIndices.length*J,U,Z,b,x,o,I,d,e.northSkirtHeight,m,r,n,0,ne),me.addSkirtIndices(z,L,R,U,i,X,e.indices.length),t.push($.buffer,X.buffer),{vertices:$.buffer,indices:X.buffer,westIndicesSouthToNorth:z,southIndicesEastToWest:L,eastIndicesNorthToSouth:R,northIndicesWestToEast:U,vertexStride:J,center:p,minimumHeight:g,maximumHeight:T,boundingSphere:G,orientedBoundingBox:O,occludeePointInScaledSpace:Y,encoding:Z,indexCountWithoutSkirts:e.indices.length}})}); +define(["./AttributeCompression-10c27d9c","./EllipsoidTangentPlane-325a8e68","./Transforms-79117a7b","./Cartesian2-8646c5a1","./when-54335d57","./TerrainEncoding-c552e269","./IndexDatatype-82ceea78","./Math-d6182036","./OrientedBoundingBox-eb360dc3","./Check-24483042","./WebMercatorProjection-66cc0482","./createTaskProcessorWorker","./IntersectionTests-5394f658","./Plane-13ae4b1b","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9"],function(ie,oe,ae,se,de,ce,ue,he,le,e,Ie,t,r,n,i,o,a){"use strict";function me(){e.DeveloperError.throwInstantiationError()}Object.defineProperties(me.prototype,{errorEvent:{get:e.DeveloperError.throwInstantiationError},credit:{get:e.DeveloperError.throwInstantiationError},tilingScheme:{get:e.DeveloperError.throwInstantiationError},ready:{get:e.DeveloperError.throwInstantiationError},readyPromise:{get:e.DeveloperError.throwInstantiationError},hasWaterMask:{get:e.DeveloperError.throwInstantiationError},hasVertexNormals:{get:e.DeveloperError.throwInstantiationError},availability:{get:e.DeveloperError.throwInstantiationError}});var s=[];me.getRegularGridIndices=function(e,t){var r=s[e];de.defined(r)||(s[e]=r=[]);var n=r[t];return de.defined(n)||m(e,t,n=e*t<he.CesiumMath.SIXTY_FOUR_KILOBYTES?r[t]=new Uint16Array((e-1)*(t-1)*6):r[t]=new Uint32Array((e-1)*(t-1)*6),0),n};var d=[];me.getRegularGridIndicesAndEdgeIndices=function(e,t){var r=d[e];de.defined(r)||(d[e]=r=[]);var n,i,o,a,s=r[t];return de.defined(s)||(n=me.getRegularGridIndices(e,t),i=(a=I(e,t)).westIndicesSouthToNorth,o=a.southIndicesEastToWest,e=a.eastIndicesNorthToSouth,a=a.northIndicesWestToEast,s=r[t]={indices:n,westIndicesSouthToNorth:i,southIndicesEastToWest:o,eastIndicesNorthToSouth:e,northIndicesWestToEast:a}),s};var l=[];function I(e,t){for(var r=new Array(t),n=new Array(e),i=new Array(t),o=new Array(e),a=0;a<e;++a)n[o[a]=a]=e*t-1-a;for(a=0;a<t;++a)i[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:i,northIndicesWestToEast:o}}function m(e,t,r,n){for(var i=0,o=0;o<t-1;++o){for(var a=0;a<e-1;++a){var s=i+e,d=s+1,c=i+1;r[n++]=i,r[n++]=s,r[n++]=c,r[n++]=c,r[n++]=s,r[n++]=d,++i}++i}}function c(e,t,r,n){for(var i=e[0],o=e.length,a=1;a<o;++a){var s=e[a];r[n++]=i,r[n++]=s,r[n++]=t,r[n++]=t,r[n++]=s,r[n++]=t+1,i=s,++t}return n}me.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){var r=l[e];de.defined(r)||(l[e]=r=[]);var n,i,o,a,s,d,c,u,h=r[t];return de.defined(h)||(o=(n=e*t)+(d=2*e+2*t),u=(i=(e-1)*(t-1)*6)+6*Math.max(0,d-4),a=(c=I(e,t)).westIndicesSouthToNorth,s=c.southIndicesEastToWest,d=c.eastIndicesNorthToSouth,c=c.northIndicesWestToEast,m(e,t,u=ue.IndexDatatype.createTypedArray(o,u),0),me.addSkirtIndices(a,s,d,c,n,u,i),h=r[t]={indices:u,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:d,northIndicesWestToEast:c,indexCountWithoutSkirts:i}),h},me.addSkirtIndices=function(e,t,r,n,i,o,a){a=c(e,i,o,a),a=c(t,i+=e.length,o,a),a=c(r,i+=t.length,o,a),c(n,i+=r.length,o,a)},me.heightmapTerrainQuality=.25,me.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*me.heightmapTerrainQuality/(t*r)},me.prototype.requestTileGeometry=e.DeveloperError.throwInstantiationError,me.prototype.getLevelMaximumGeometricError=e.DeveloperError.throwInstantiationError,me.prototype.getTileDataAvailable=e.DeveloperError.throwInstantiationError,me.prototype.loadTileDataAvailability=e.DeveloperError.throwInstantiationError;var ge=32767,Te=new se.Cartesian3,pe=new se.Cartesian3,Ee=new se.Cartesian3,ye=new se.Cartographic,fe=new se.Cartesian2,ve=new se.Cartesian3,Ne=new ae.Matrix4,we=new ae.Matrix4;function xe(e,t,r,n,i,o,a,s,d){var c=Number.POSITIVE_INFINITY,u=i.north,h=i.south,l=i.east,I=i.west;l<I&&(l+=he.CesiumMath.TWO_PI);for(var m=e.length,g=0;g<m;++g){var T=e[g],p=r[T],T=n[T];ye.longitude=he.CesiumMath.lerp(I,l,T.x),ye.latitude=he.CesiumMath.lerp(h,u,T.y),ye.height=p-t;p=o.cartographicToCartesian(ye,Te);ae.Matrix4.multiplyByPoint(a,p,p),se.Cartesian3.minimumByComponent(p,s,s),se.Cartesian3.maximumByComponent(p,d,d),c=Math.min(c,ye.height)}return c}function Me(e,t,r,n,i,o,a,s,d,c,u,h,l,I,m){var g=de.defined(a),T=d.north,p=d.south,E=d.east,y=d.west;E<y&&(E+=he.CesiumMath.TWO_PI);for(var f=r.length,v=0;v<f;++v){var N=r[v],w=i[N],x=o[N];ye.longitude=he.CesiumMath.lerp(y,E,x.x)+I,ye.latitude=he.CesiumMath.lerp(p,T,x.y)+m,ye.height=w-c;var M,C,b=s.cartographicToCartesian(ye,Te);g&&(fe.x=a[M=2*N],fe.y=a[1+M],1!==u&&(w=ie.AttributeCompression.octDecode(fe.x,fe.y,ve),N=ae.Transforms.eastNorthUpToFixedFrame(Te,s,we),M=ae.Matrix4.inverseTransformation(N,Ne),ae.Matrix4.multiplyByPointAsVector(M,w,w),w.z*=u,se.Cartesian3.normalize(w,w),ae.Matrix4.multiplyByPointAsVector(N,w,w),se.Cartesian3.normalize(w,w),ie.AttributeCompression.octEncode(w,fe))),n.hasWebMercatorT&&(C=(Ie.WebMercatorProjection.geodeticLatitudeToMercatorAngle(ye.latitude)-h)*l),t=n.encode(e,t,b,x,ye.height,fe,C)}}function Ce(e,t){var r;return"function"==typeof e.slice&&"function"!=typeof(r=e.slice()).sort&&(r=void 0),(r=!de.defined(r)?Array.prototype.slice.call(e):r).sort(t),r}return t(function(e,t){var r,n,i=(ne=e.quantizedVertices).length/3,o=e.octEncodedNormals,a=e.westIndices.length+e.eastIndices.length+e.southIndices.length+e.northIndices.length,s=e.includeWebMercatorT,d=se.Rectangle.clone(e.rectangle),c=d.west,u=d.south,h=d.east,l=d.north,I=se.Ellipsoid.clone(e.ellipsoid),m=e.exaggeration,g=e.minimumHeight*m,T=e.maximumHeight*m,p=e.relativeToCenter,E=ae.Transforms.eastNorthUpToFixedFrame(p,I),y=ae.Matrix4.inverseTransformation(E,new ae.Matrix4);s&&(r=Ie.WebMercatorProjection.geodeticLatitudeToMercatorAngle(u),n=1/(Ie.WebMercatorProjection.geodeticLatitudeToMercatorAngle(l)-r));var f=ne.subarray(0,i),v=ne.subarray(i,2*i),N=ne.subarray(2*i,3*i),w=de.defined(o),x=new Array(i),M=new Array(i),C=new Array(i),b=s?new Array(i):[],S=pe;S.x=Number.POSITIVE_INFINITY,S.y=Number.POSITIVE_INFINITY,S.z=Number.POSITIVE_INFINITY;var A=Ee;A.x=Number.NEGATIVE_INFINITY,A.y=Number.NEGATIVE_INFINITY,A.z=Number.NEGATIVE_INFINITY;for(var P=Number.POSITIVE_INFINITY,W=Number.NEGATIVE_INFINITY,D=Number.POSITIVE_INFINITY,B=Number.NEGATIVE_INFINITY,F=0;F<i;++F){var k=f[F],V=v[F],_=k/ge,H=V/ge,k=he.CesiumMath.lerp(g,T,N[F]/ge);ye.longitude=he.CesiumMath.lerp(c,h,_),ye.latitude=he.CesiumMath.lerp(u,l,H),ye.height=k;P=Math.min(ye.longitude,P),W=Math.max(ye.longitude,W),D=Math.min(ye.latitude,D),B=Math.max(ye.latitude,B),V=I.cartographicToCartesian(ye);x[F]=new se.Cartesian2(_,H),M[F]=k,C[F]=V,s&&(b[F]=(Ie.WebMercatorProjection.geodeticLatitudeToMercatorAngle(ye.latitude)-r)*n),ae.Matrix4.multiplyByPoint(y,V,Te),se.Cartesian3.minimumByComponent(Te,S,S),se.Cartesian3.maximumByComponent(Te,A,A)}var O,G,Y,z=Ce(e.westIndices,function(e,t){return x[e].y-x[t].y}),R=Ce(e.eastIndices,function(e,t){return x[t].y-x[e].y}),L=Ce(e.southIndices,function(e,t){return x[t].x-x[e].x}),U=Ce(e.northIndices,function(e,t){return x[e].x-x[t].x});1!==m&&(G=ae.BoundingSphere.fromPoints(C),O=le.OrientedBoundingBox.fromRectangle(d,g,T,I)),(1!==m||g<0)&&(Y=new ce.EllipsoidalOccluder(I).computeHorizonCullingPointPossiblyUnderEllipsoid(p,C,g));var j=g,j=Math.min(j,xe(e.westIndices,e.westSkirtHeight,M,x,d,I,y,S,A));j=Math.min(j,xe(e.southIndices,e.southSkirtHeight,M,x,d,I,y,S,A)),j=Math.min(j,xe(e.eastIndices,e.eastSkirtHeight,M,x,d,I,y,S,A)),j=Math.min(j,xe(e.northIndices,e.northSkirtHeight,M,x,d,I,y,S,A));for(var q,Q,K,X=new oe.AxisAlignedBoundingBox(S,A,p),Z=new ce.TerrainEncoding(X,j,T,E,w,s),J=Z.getStride(),$=new Float32Array(i*J+a*J),ee=0,te=0;te<i;++te)w&&(fe.x=o[K=2*te],fe.y=o[1+K],1!==m&&(q=ie.AttributeCompression.octDecode(fe.x,fe.y,ve),Q=ae.Transforms.eastNorthUpToFixedFrame(C[te],I,we),K=ae.Matrix4.inverseTransformation(Q,Ne),ae.Matrix4.multiplyByPointAsVector(K,q,q),q.z*=m,se.Cartesian3.normalize(q,q),ae.Matrix4.multiplyByPointAsVector(Q,q,q),se.Cartesian3.normalize(q,q),ie.AttributeCompression.octEncode(q,fe))),ee=Z.encode($,ee,C[te],x[te],M[te],fe,b[te]);var re=Math.max(0,2*(a-4)),ne=e.indices.length+3*re;return(X=ue.IndexDatatype.createTypedArray(i+a,ne)).set(e.indices,0),re=j=1e-4*(W-P),ne=-(a=E=1e-4*(B-D)),Me($,E=i*J,z,Z,M,x,o,I,d,e.westSkirtHeight,m,r,n,-j,0),Me($,E+=e.westIndices.length*J,L,Z,M,x,o,I,d,e.southSkirtHeight,m,r,n,0,ne),Me($,E+=e.southIndices.length*J,R,Z,M,x,o,I,d,e.eastSkirtHeight,m,r,n,re,0),Me($,E+=e.eastIndices.length*J,U,Z,M,x,o,I,d,e.northSkirtHeight,m,r,n,0,a),me.addSkirtIndices(z,L,R,U,i,X,e.indices.length),t.push($.buffer,X.buffer),{vertices:$.buffer,indices:X.buffer,westIndicesSouthToNorth:z,southIndicesEastToWest:L,eastIndicesNorthToSouth:R,northIndicesWestToEast:U,vertexStride:J,center:p,minimumHeight:g,maximumHeight:T,boundingSphere:G,orientedBoundingBox:O,occludeePointInScaledSpace:Y,encoding:Z,indexCountWithoutSkirts:e.indices.length}})}); diff --git a/public/Cesium/Workers/createWallGeometry.js b/public/Cesium/Workers/createWallGeometry.js index 1b80b1e..97f8341 100644 --- a/public/Cesium/Workers/createWallGeometry.js +++ b/public/Cesium/Workers/createWallGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./Transforms-a73b3b3b","./ComponentDatatype-9204e9f6","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./VertexFormat-e8cbf5b3","./WallGeometryLibrary-1012701b","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./arrayRemoveDuplicates-0f62a181","./PolylinePipeline-232a4d9a","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(S,I,N,M,e,W,B,U,q,p,J,t,a,i,n,r,o,s,m){"use strict";var Y=new I.Cartesian3,Z=new I.Cartesian3,j=new I.Cartesian3,K=new I.Cartesian3,Q=new I.Cartesian3,X=new I.Cartesian3,$=new I.Cartesian3;function d(e){var t=(e=S.defaultValue(e,S.defaultValue.EMPTY_OBJECT)).positions,a=e.maximumHeights,i=e.minimumHeights,n=S.defaultValue(e.vertexFormat,p.VertexFormat.DEFAULT),r=S.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),e=S.defaultValue(e.ellipsoid,I.Ellipsoid.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=a,this._vertexFormat=p.VertexFormat.clone(n),this._granularity=r,this._ellipsoid=I.Ellipsoid.clone(e),this._workerName="createWallGeometry";t=1+t.length*I.Cartesian3.packedLength+2;S.defined(i)&&(t+=i.length),S.defined(a)&&(t+=a.length),this.packedLength=t+I.Ellipsoid.packedLength+p.VertexFormat.packedLength+1}d.pack=function(e,t,a){var i;a=S.defaultValue(a,0);var n=e._positions,r=n.length;for(t[a++]=r,i=0;i<r;++i,a+=I.Cartesian3.packedLength)I.Cartesian3.pack(n[i],t,a);var o=e._minimumHeights,r=S.defined(o)?o.length:0;if(t[a++]=r,S.defined(o))for(i=0;i<r;++i)t[a++]=o[i];var s=e._maximumHeights;if(r=S.defined(s)?s.length:0,t[a++]=r,S.defined(s))for(i=0;i<r;++i)t[a++]=s[i];return I.Ellipsoid.pack(e._ellipsoid,t,a),a+=I.Ellipsoid.packedLength,p.VertexFormat.pack(e._vertexFormat,t,a),t[a+=p.VertexFormat.packedLength]=e._granularity,t};var c=I.Ellipsoid.clone(I.Ellipsoid.UNIT_SPHERE),y=new p.VertexFormat,f={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:c,vertexFormat:y,granularity:void 0};return d.unpack=function(e,t,a){t=S.defaultValue(t,0);for(var i,n,r=e[t++],o=new Array(r),s=0;s<r;++s,t+=I.Cartesian3.packedLength)o[s]=I.Cartesian3.unpack(e,t);if(0<(r=e[t++]))for(i=new Array(r),s=0;s<r;++s)i[s]=e[t++];if(0<(r=e[t++]))for(n=new Array(r),s=0;s<r;++s)n[s]=e[t++];var m=I.Ellipsoid.unpack(e,t,c);t+=I.Ellipsoid.packedLength;var l=p.VertexFormat.unpack(e,t,y),u=e[t+=p.VertexFormat.packedLength];return S.defined(a)?(a._positions=o,a._minimumHeights=i,a._maximumHeights=n,a._ellipsoid=I.Ellipsoid.clone(m,a._ellipsoid),a._vertexFormat=p.VertexFormat.clone(l,a._vertexFormat),a._granularity=u,a):(f.positions=o,f.minimumHeights=i,f.maximumHeights=n,f.granularity=u,new d(f))},d.fromConstantHeights=function(e){var t=(e=S.defaultValue(e,S.defaultValue.EMPTY_OBJECT)).positions,a=e.minimumHeight,i=e.maximumHeight,n=S.defined(a),r=S.defined(i);if(n||r)for(var o=t.length,s=n?new Array(o):void 0,m=r?new Array(o):void 0,l=0;l<o;++l)n&&(s[l]=a),r&&(m[l]=i);return new d({positions:t,maximumHeights:m,minimumHeights:s,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},d.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,i=e._maximumHeights,n=e._vertexFormat,r=e._granularity,o=e._ellipsoid,i=J.WallGeometryLibrary.computePositions(o,t,i,a,r,!0);if(S.defined(i)){for(var s=i.bottomPositions,m=i.topPositions,a=i.numCorners,l=m.length,r=2*l,u=n.position?new Float64Array(r):void 0,p=n.normal?new Float32Array(r):void 0,d=n.tangent?new Float32Array(r):void 0,c=n.bitangent?new Float32Array(r):void 0,y=n.st?new Float32Array(r/3*2):void 0,f=0,g=0,h=0,v=0,C=0,b=$,x=X,A=Q,_=!0,E=0,w=1/((l/=3)-a-1),F=0;F<l;++F){var L,k=3*F,H=I.Cartesian3.fromArray(m,k,Y),V=I.Cartesian3.fromArray(s,k,Z);n.position&&(u[f++]=V.x,u[f++]=V.y,u[f++]=V.z,u[f++]=H.x,u[f++]=H.y,u[f++]=H.z),n.st&&(y[C++]=E,y[C++]=0,y[C++]=E,y[C++]=1),(n.normal||n.tangent||n.bitangent)&&(L=I.Cartesian3.clone(I.Cartesian3.ZERO,K),V=I.Cartesian3.subtract(H,o.geodeticSurfaceNormal(H,Z),Z),F+1<l&&(L=I.Cartesian3.fromArray(m,3+k,K)),_&&(k=I.Cartesian3.subtract(L,H,j),V=I.Cartesian3.subtract(V,H,Y),b=I.Cartesian3.normalize(I.Cartesian3.cross(V,k,b),b),_=!1),I.Cartesian3.equalsEpsilon(H,L,q.CesiumMath.EPSILON10)?_=!0:(E+=w,n.tangent&&(x=I.Cartesian3.normalize(I.Cartesian3.subtract(L,H,x),x)),n.bitangent&&(A=I.Cartesian3.normalize(I.Cartesian3.cross(b,x,A),A))),n.normal&&(p[g++]=b.x,p[g++]=b.y,p[g++]=b.z,p[g++]=b.x,p[g++]=b.y,p[g++]=b.z),n.tangent&&(d[v++]=x.x,d[v++]=x.y,d[v++]=x.z,d[v++]=x.x,d[v++]=x.y,d[v++]=x.z),n.bitangent&&(c[h++]=A.x,c[h++]=A.y,c[h++]=A.z,c[h++]=A.x,c[h++]=A.y,c[h++]=A.z))}i=new B.GeometryAttributes;n.position&&(i.position=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&(i.normal=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),n.tangent&&(i.tangent=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),n.bitangent&&(i.bitangent=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),n.st&&(i.st=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:y}));var G=r/3;r-=6*(a+1);var D=U.IndexDatatype.createTypedArray(G,r),P=0;for(F=0;F<G-2;F+=2){var T=F,z=F+2,O=I.Cartesian3.fromArray(u,3*T,Y),R=I.Cartesian3.fromArray(u,3*z,Z);I.Cartesian3.equalsEpsilon(O,R,q.CesiumMath.EPSILON10)||(O=F+1,R=F+3,D[P++]=O,D[P++]=T,D[P++]=R,D[P++]=R,D[P++]=T,D[P++]=z)}return new W.Geometry({attributes:i,indices:D,primitiveType:W.PrimitiveType.TRIANGLES,boundingSphere:new N.BoundingSphere.fromVertices(u)})}},function(e,t){return(e=S.defined(t)?d.unpack(e,t):e)._ellipsoid=I.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./Transforms-79117a7b","./ComponentDatatype-1a100acd","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./VertexFormat-81ec7207","./WallGeometryLibrary-0e5f04d3","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./arrayRemoveDuplicates-3fea1e5f","./PolylinePipeline-3803a6c2","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(S,I,N,M,e,W,B,U,q,p,J,t,a,i,n,r,o,s,m){"use strict";var Y=new I.Cartesian3,Z=new I.Cartesian3,j=new I.Cartesian3,K=new I.Cartesian3,Q=new I.Cartesian3,X=new I.Cartesian3,$=new I.Cartesian3;function d(e){var t=(e=S.defaultValue(e,S.defaultValue.EMPTY_OBJECT)).positions,a=e.maximumHeights,i=e.minimumHeights,n=S.defaultValue(e.vertexFormat,p.VertexFormat.DEFAULT),r=S.defaultValue(e.granularity,q.CesiumMath.RADIANS_PER_DEGREE),e=S.defaultValue(e.ellipsoid,I.Ellipsoid.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=a,this._vertexFormat=p.VertexFormat.clone(n),this._granularity=r,this._ellipsoid=I.Ellipsoid.clone(e),this._workerName="createWallGeometry";t=1+t.length*I.Cartesian3.packedLength+2;S.defined(i)&&(t+=i.length),S.defined(a)&&(t+=a.length),this.packedLength=t+I.Ellipsoid.packedLength+p.VertexFormat.packedLength+1}d.pack=function(e,t,a){var i;a=S.defaultValue(a,0);var n=e._positions,r=n.length;for(t[a++]=r,i=0;i<r;++i,a+=I.Cartesian3.packedLength)I.Cartesian3.pack(n[i],t,a);var o=e._minimumHeights,r=S.defined(o)?o.length:0;if(t[a++]=r,S.defined(o))for(i=0;i<r;++i)t[a++]=o[i];var s=e._maximumHeights;if(r=S.defined(s)?s.length:0,t[a++]=r,S.defined(s))for(i=0;i<r;++i)t[a++]=s[i];return I.Ellipsoid.pack(e._ellipsoid,t,a),a+=I.Ellipsoid.packedLength,p.VertexFormat.pack(e._vertexFormat,t,a),t[a+=p.VertexFormat.packedLength]=e._granularity,t};var c=I.Ellipsoid.clone(I.Ellipsoid.UNIT_SPHERE),y=new p.VertexFormat,g={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:c,vertexFormat:y,granularity:void 0};return d.unpack=function(e,t,a){t=S.defaultValue(t,0);for(var i,n,r=e[t++],o=new Array(r),s=0;s<r;++s,t+=I.Cartesian3.packedLength)o[s]=I.Cartesian3.unpack(e,t);if(0<(r=e[t++]))for(i=new Array(r),s=0;s<r;++s)i[s]=e[t++];if(0<(r=e[t++]))for(n=new Array(r),s=0;s<r;++s)n[s]=e[t++];var m=I.Ellipsoid.unpack(e,t,c);t+=I.Ellipsoid.packedLength;var l=p.VertexFormat.unpack(e,t,y),u=e[t+=p.VertexFormat.packedLength];return S.defined(a)?(a._positions=o,a._minimumHeights=i,a._maximumHeights=n,a._ellipsoid=I.Ellipsoid.clone(m,a._ellipsoid),a._vertexFormat=p.VertexFormat.clone(l,a._vertexFormat),a._granularity=u,a):(g.positions=o,g.minimumHeights=i,g.maximumHeights=n,g.granularity=u,new d(g))},d.fromConstantHeights=function(e){var t=(e=S.defaultValue(e,S.defaultValue.EMPTY_OBJECT)).positions,a=e.minimumHeight,i=e.maximumHeight,n=S.defined(a),r=S.defined(i);if(n||r)for(var o=t.length,s=n?new Array(o):void 0,m=r?new Array(o):void 0,l=0;l<o;++l)n&&(s[l]=a),r&&(m[l]=i);return new d({positions:t,maximumHeights:m,minimumHeights:s,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},d.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,i=e._maximumHeights,n=e._vertexFormat,r=e._granularity,o=e._ellipsoid,i=J.WallGeometryLibrary.computePositions(o,t,i,a,r,!0);if(S.defined(i)){for(var s=i.bottomPositions,m=i.topPositions,a=i.numCorners,l=m.length,r=2*l,u=n.position?new Float64Array(r):void 0,p=n.normal?new Float32Array(r):void 0,d=n.tangent?new Float32Array(r):void 0,c=n.bitangent?new Float32Array(r):void 0,y=n.st?new Float32Array(r/3*2):void 0,g=0,f=0,h=0,C=0,v=0,x=$,A=X,b=Q,_=!0,E=0,w=1/((l/=3)-a-1),F=0;F<l;++F){var L,k=3*F,H=I.Cartesian3.fromArray(m,k,Y),V=I.Cartesian3.fromArray(s,k,Z);n.position&&(u[g++]=V.x,u[g++]=V.y,u[g++]=V.z,u[g++]=H.x,u[g++]=H.y,u[g++]=H.z),n.st&&(y[v++]=E,y[v++]=0,y[v++]=E,y[v++]=1),(n.normal||n.tangent||n.bitangent)&&(L=I.Cartesian3.clone(I.Cartesian3.ZERO,K),V=I.Cartesian3.subtract(H,o.geodeticSurfaceNormal(H,Z),Z),F+1<l&&(L=I.Cartesian3.fromArray(m,3+k,K)),_&&(k=I.Cartesian3.subtract(L,H,j),V=I.Cartesian3.subtract(V,H,Y),x=I.Cartesian3.normalize(I.Cartesian3.cross(V,k,x),x),_=!1),I.Cartesian3.equalsEpsilon(H,L,q.CesiumMath.EPSILON10)?_=!0:(E+=w,n.tangent&&(A=I.Cartesian3.normalize(I.Cartesian3.subtract(L,H,A),A)),n.bitangent&&(b=I.Cartesian3.normalize(I.Cartesian3.cross(x,A,b),b))),n.normal&&(p[f++]=x.x,p[f++]=x.y,p[f++]=x.z,p[f++]=x.x,p[f++]=x.y,p[f++]=x.z),n.tangent&&(d[C++]=A.x,d[C++]=A.y,d[C++]=A.z,d[C++]=A.x,d[C++]=A.y,d[C++]=A.z),n.bitangent&&(c[h++]=b.x,c[h++]=b.y,c[h++]=b.z,c[h++]=b.x,c[h++]=b.y,c[h++]=b.z))}i=new B.GeometryAttributes;n.position&&(i.position=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:u})),n.normal&&(i.normal=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:p})),n.tangent&&(i.tangent=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:d})),n.bitangent&&(i.bitangent=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:c})),n.st&&(i.st=new W.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:y}));var G=r/3,D=U.IndexDatatype.createTypedArray(G,r-=6*(a+1)),P=0;for(F=0;F<G-2;F+=2){var T=F,z=F+2,O=I.Cartesian3.fromArray(u,3*T,Y),R=I.Cartesian3.fromArray(u,3*z,Z);I.Cartesian3.equalsEpsilon(O,R,q.CesiumMath.EPSILON10)||(R=F+3,D[P++]=F+1,D[P++]=T,D[P++]=R,D[P++]=R,D[P++]=T,D[P++]=z)}return new W.Geometry({attributes:i,indices:D,primitiveType:W.PrimitiveType.TRIANGLES,boundingSphere:new N.BoundingSphere.fromVertices(u)})}},function(e,t){return(e=S.defined(t)?d.unpack(e,t):e)._ellipsoid=I.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}}); diff --git a/public/Cesium/Workers/createWallOutlineGeometry.js b/public/Cesium/Workers/createWallOutlineGeometry.js index 9171885..bc3d2df 100644 --- a/public/Cesium/Workers/createWallOutlineGeometry.js +++ b/public/Cesium/Workers/createWallOutlineGeometry.js @@ -1 +1 @@ -define(["./when-208fe5b0","./Cartesian2-8417ca3d","./Transforms-a73b3b3b","./ComponentDatatype-9204e9f6","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./WallGeometryLibrary-1012701b","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./arrayRemoveDuplicates-0f62a181","./PolylinePipeline-232a4d9a","./EllipsoidGeodesic-8015072b","./EllipsoidRhumbLine-8cb2e5a4","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(v,b,C,H,e,A,k,w,G,L,i,t,a,n,r,o,s,l){"use strict";var x=new b.Cartesian3,P=new b.Cartesian3;function m(e){var i=(e=v.defaultValue(e,v.defaultValue.EMPTY_OBJECT)).positions,t=e.maximumHeights,a=e.minimumHeights,n=v.defaultValue(e.granularity,G.CesiumMath.RADIANS_PER_DEGREE),e=v.defaultValue(e.ellipsoid,b.Ellipsoid.WGS84);this._positions=i,this._minimumHeights=a,this._maximumHeights=t,this._granularity=n,this._ellipsoid=b.Ellipsoid.clone(e),this._workerName="createWallOutlineGeometry";i=1+i.length*b.Cartesian3.packedLength+2;v.defined(a)&&(i+=a.length),v.defined(t)&&(i+=t.length),this.packedLength=i+b.Ellipsoid.packedLength+1}m.pack=function(e,i,t){var a;t=v.defaultValue(t,0);var n=e._positions,r=n.length;for(i[t++]=r,a=0;a<r;++a,t+=b.Cartesian3.packedLength)b.Cartesian3.pack(n[a],i,t);var o=e._minimumHeights,r=v.defined(o)?o.length:0;if(i[t++]=r,v.defined(o))for(a=0;a<r;++a)i[t++]=o[a];var s=e._maximumHeights;if(r=v.defined(s)?s.length:0,i[t++]=r,v.defined(s))for(a=0;a<r;++a)i[t++]=s[a];return b.Ellipsoid.pack(e._ellipsoid,i,t),i[t+=b.Ellipsoid.packedLength]=e._granularity,i};var u=b.Ellipsoid.clone(b.Ellipsoid.UNIT_SPHERE),p={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:u,granularity:void 0};return m.unpack=function(e,i,t){i=v.defaultValue(i,0);for(var a,n,r=e[i++],o=new Array(r),s=0;s<r;++s,i+=b.Cartesian3.packedLength)o[s]=b.Cartesian3.unpack(e,i);if(0<(r=e[i++]))for(a=new Array(r),s=0;s<r;++s)a[s]=e[i++];if(0<(r=e[i++]))for(n=new Array(r),s=0;s<r;++s)n[s]=e[i++];var l=b.Ellipsoid.unpack(e,i,u),d=e[i+=b.Ellipsoid.packedLength];return v.defined(t)?(t._positions=o,t._minimumHeights=a,t._maximumHeights=n,t._ellipsoid=b.Ellipsoid.clone(l,t._ellipsoid),t._granularity=d,t):(p.positions=o,p.minimumHeights=a,p.maximumHeights=n,p.granularity=d,new m(p))},m.fromConstantHeights=function(e){var i=(e=v.defaultValue(e,v.defaultValue.EMPTY_OBJECT)).positions,t=e.minimumHeight,a=e.maximumHeight,n=v.defined(t),r=v.defined(a);if(n||r)for(var o=i.length,s=n?new Array(o):void 0,l=r?new Array(o):void 0,d=0;d<o;++d)n&&(s[d]=t),r&&(l[d]=a);return new m({positions:i,maximumHeights:l,minimumHeights:s,ellipsoid:e.ellipsoid})},m.createGeometry=function(e){var i=e._positions,t=e._minimumHeights,a=e._maximumHeights,n=e._granularity,e=e._ellipsoid,t=L.WallGeometryLibrary.computePositions(e,i,a,t,n,!1);if(v.defined(t)){var r=t.bottomPositions,o=t.topPositions,s=o.length,n=2*s,l=new Float64Array(n),d=0;for(s/=3,c=0;c<s;++c){var m=3*c,u=b.Cartesian3.fromArray(o,m,x),m=b.Cartesian3.fromArray(r,m,P);l[d++]=m.x,l[d++]=m.y,l[d++]=m.z,l[d++]=u.x,l[d++]=u.y,l[d++]=u.z}for(var t=new k.GeometryAttributes({position:new A.GeometryAttribute({componentDatatype:H.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})}),p=n/3,n=2*p-4+p,f=w.IndexDatatype.createTypedArray(p,n),h=0,c=0;c<p-2;c+=2){var g=c,y=c+2,_=b.Cartesian3.fromArray(l,3*g,x),E=b.Cartesian3.fromArray(l,3*y,P);b.Cartesian3.equalsEpsilon(_,E,G.CesiumMath.EPSILON10)||(_=c+1,E=c+3,f[h++]=_,f[h++]=g,f[h++]=_,f[h++]=E,f[h++]=g,f[h++]=y)}return f[h++]=p-2,f[h++]=p-1,new A.Geometry({attributes:t,indices:f,primitiveType:A.PrimitiveType.LINES,boundingSphere:new C.BoundingSphere.fromVertices(l)})}},function(e,i){return(e=v.defined(i)?m.unpack(e,i):e)._ellipsoid=b.Ellipsoid.clone(e._ellipsoid),m.createGeometry(e)}}); +define(["./when-54335d57","./Cartesian2-8646c5a1","./Transforms-79117a7b","./ComponentDatatype-1a100acd","./Check-24483042","./GeometryAttribute-374f805d","./GeometryAttributes-caa08d6c","./IndexDatatype-82ceea78","./Math-d6182036","./WallGeometryLibrary-0e5f04d3","./RuntimeError-88a32665","./WebGLConstants-95ceb4e9","./arrayRemoveDuplicates-3fea1e5f","./PolylinePipeline-3803a6c2","./EllipsoidGeodesic-cc216670","./EllipsoidRhumbLine-2b7999f3","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(v,C,H,A,e,b,k,w,G,L,i,t,a,n,r,o,s,l){"use strict";var x=new C.Cartesian3,P=new C.Cartesian3;function d(e){var i=(e=v.defaultValue(e,v.defaultValue.EMPTY_OBJECT)).positions,t=e.maximumHeights,a=e.minimumHeights,n=v.defaultValue(e.granularity,G.CesiumMath.RADIANS_PER_DEGREE),e=v.defaultValue(e.ellipsoid,C.Ellipsoid.WGS84);this._positions=i,this._minimumHeights=a,this._maximumHeights=t,this._granularity=n,this._ellipsoid=C.Ellipsoid.clone(e),this._workerName="createWallOutlineGeometry";i=1+i.length*C.Cartesian3.packedLength+2;v.defined(a)&&(i+=a.length),v.defined(t)&&(i+=t.length),this.packedLength=i+C.Ellipsoid.packedLength+1}d.pack=function(e,i,t){var a;t=v.defaultValue(t,0);var n=e._positions,r=n.length;for(i[t++]=r,a=0;a<r;++a,t+=C.Cartesian3.packedLength)C.Cartesian3.pack(n[a],i,t);var o=e._minimumHeights,r=v.defined(o)?o.length:0;if(i[t++]=r,v.defined(o))for(a=0;a<r;++a)i[t++]=o[a];var s=e._maximumHeights;if(r=v.defined(s)?s.length:0,i[t++]=r,v.defined(s))for(a=0;a<r;++a)i[t++]=s[a];return C.Ellipsoid.pack(e._ellipsoid,i,t),i[t+=C.Ellipsoid.packedLength]=e._granularity,i};var u=C.Ellipsoid.clone(C.Ellipsoid.UNIT_SPHERE),p={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:u,granularity:void 0};return d.unpack=function(e,i,t){i=v.defaultValue(i,0);for(var a,n,r=e[i++],o=new Array(r),s=0;s<r;++s,i+=C.Cartesian3.packedLength)o[s]=C.Cartesian3.unpack(e,i);if(0<(r=e[i++]))for(a=new Array(r),s=0;s<r;++s)a[s]=e[i++];if(0<(r=e[i++]))for(n=new Array(r),s=0;s<r;++s)n[s]=e[i++];var l=C.Ellipsoid.unpack(e,i,u),m=e[i+=C.Ellipsoid.packedLength];return v.defined(t)?(t._positions=o,t._minimumHeights=a,t._maximumHeights=n,t._ellipsoid=C.Ellipsoid.clone(l,t._ellipsoid),t._granularity=m,t):(p.positions=o,p.minimumHeights=a,p.maximumHeights=n,p.granularity=m,new d(p))},d.fromConstantHeights=function(e){var i=(e=v.defaultValue(e,v.defaultValue.EMPTY_OBJECT)).positions,t=e.minimumHeight,a=e.maximumHeight,n=v.defined(t),r=v.defined(a);if(n||r)for(var o=i.length,s=n?new Array(o):void 0,l=r?new Array(o):void 0,m=0;m<o;++m)n&&(s[m]=t),r&&(l[m]=a);return new d({positions:i,maximumHeights:l,minimumHeights:s,ellipsoid:e.ellipsoid})},d.createGeometry=function(e){var i=e._positions,t=e._minimumHeights,a=e._maximumHeights,n=e._granularity,e=e._ellipsoid,t=L.WallGeometryLibrary.computePositions(e,i,a,t,n,!1);if(v.defined(t)){var r=t.bottomPositions,o=t.topPositions,s=o.length,n=2*s,l=new Float64Array(n),m=0;for(s/=3,c=0;c<s;++c){var d=3*c,u=C.Cartesian3.fromArray(o,d,x),d=C.Cartesian3.fromArray(r,d,P);l[m++]=d.x,l[m++]=d.y,l[m++]=d.z,l[m++]=u.x,l[m++]=u.y,l[m++]=u.z}for(var t=new k.GeometryAttributes({position:new b.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:l})}),p=n/3,f=w.IndexDatatype.createTypedArray(p,n=2*p-4+p),h=0,c=0;c<p-2;c+=2){var g=c,y=c+2,_=C.Cartesian3.fromArray(l,3*g,x),E=C.Cartesian3.fromArray(l,3*y,P);C.Cartesian3.equalsEpsilon(_,E,G.CesiumMath.EPSILON10)||(_=c+3,f[h++]=E=c+1,f[h++]=g,f[h++]=E,f[h++]=_,f[h++]=g,f[h++]=y)}return f[h++]=p-2,f[h++]=p-1,new b.Geometry({attributes:t,indices:f,primitiveType:b.PrimitiveType.LINES,boundingSphere:new H.BoundingSphere.fromVertices(l)})}},function(e,i){return(e=v.defined(i)?d.unpack(e,i):e)._ellipsoid=C.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}}); diff --git a/public/Cesium/Workers/decodeDraco.js b/public/Cesium/Workers/decodeDraco.js index cbc663a..c599c3e 100644 --- a/public/Cesium/Workers/decodeDraco.js +++ b/public/Cesium/Workers/decodeDraco.js @@ -1 +1 @@ -define(["./ComponentDatatype-9204e9f6","./when-208fe5b0","./IndexDatatype-d47ad6f6","./RuntimeError-7f634f5d","./createTaskProcessorWorker","./Check-d18af7c4","./WebGLConstants-76bb35d1","./Math-4e53b694"],function(d,c,f,y,t,e,r,n){"use strict";var A;function b(e,t,r){var n,o=e.num_points(),a=r.num_components(),i=new A.AttributeQuantizationTransform;if(i.InitFromAttribute(r)){for(var u=new Array(a),s=0;s<a;++s)u[s]=i.min_value(s);n={quantizationBits:i.quantization_bits(),minValues:u,range:i.range(),octEncoded:!1}}A.destroy(i),(i=new A.AttributeOctahedronTransform).InitFromAttribute(r)&&(n={quantizationBits:i.quantization_bits(),octEncoded:!0}),A.destroy(i);o*=a,t=c.defined(n)?function(e,t,r,n,o){var a,i;n.quantizationBits<=8?(i=new A.DracoUInt8Array,a=new Uint8Array(o),t.GetAttributeUInt8ForAllPoints(e,r,i)):(i=new A.DracoUInt16Array,a=new Uint16Array(o),t.GetAttributeUInt16ForAllPoints(e,r,i));for(var u=0;u<o;++u)a[u]=i.GetValue(u);return A.destroy(i),a}(e,t,r,n,o):function(e,t,r,n){var o,a;switch(r.data_type()){case 1:case 11:a=new A.DracoInt8Array,o=new Int8Array(n),t.GetAttributeInt8ForAllPoints(e,r,a);break;case 2:a=new A.DracoUInt8Array,o=new Uint8Array(n),t.GetAttributeUInt8ForAllPoints(e,r,a);break;case 3:a=new A.DracoInt16Array,o=new Int16Array(n),t.GetAttributeInt16ForAllPoints(e,r,a);break;case 4:a=new A.DracoUInt16Array,o=new Uint16Array(n),t.GetAttributeUInt16ForAllPoints(e,r,a);break;case 5:case 7:a=new A.DracoInt32Array,o=new Int32Array(n),t.GetAttributeInt32ForAllPoints(e,r,a);break;case 6:case 8:a=new A.DracoUInt32Array,o=new Uint32Array(n),t.GetAttributeUInt32ForAllPoints(e,r,a);break;case 9:case 10:a=new A.DracoFloat32Array,o=new Float32Array(n),t.GetAttributeFloatForAllPoints(e,r,a)}for(var i=0;i<n;++i)o[i]=a.GetValue(i);return A.destroy(a),o}(e,t,r,o),o=d.ComponentDatatype.fromTypedArray(t);return{array:t,data:{componentsPerAttribute:a,componentDatatype:o,byteOffset:r.byte_offset(),byteStride:d.ComponentDatatype.getSizeInBytes(o)*a,normalized:r.normalized(),quantization:n}}}function o(e){var t=new A.Decoder,r=["POSITION","NORMAL","COLOR","TEX_COORD"];if(e.dequantizeInShader)for(var n=0;n<r.length;++n)t.SkipAttributeTransform(A[r[n]]);var o=e.bufferView,a=new A.DecoderBuffer;if(a.Init(e.array,o.byteLength),t.GetEncodedGeometryType(a)!==A.TRIANGULAR_MESH)throw new y.RuntimeError("Unsupported draco mesh geometry type.");var i=new A.Mesh,o=t.DecodeBufferToMesh(a,i);if(!o.ok()||0===i.ptr)throw new y.RuntimeError("Error decoding draco mesh geometry: "+o.error_msg());A.destroy(a);var u,s,d={},c=e.compressedAttributes;for(u in c)c.hasOwnProperty(u)&&(s=c[u],s=t.GetAttributeByUniqueId(i,s),d[u]=b(i,t,s));e={indexArray:function(e,t){for(var r=e.num_points(),n=e.num_faces(),o=new A.DracoInt32Array,a=3*n,i=f.IndexDatatype.createTypedArray(r,a),u=0,s=0;s<n;++s)t.GetFaceFromMesh(e,s,o),i[u+0]=o.GetValue(0),i[u+1]=o.GetValue(1),i[u+2]=o.GetValue(2),u+=3;return A.destroy(o),{typedArray:i,numberOfIndices:a}}(i,t),attributeData:d};return A.destroy(i),A.destroy(t),e}function a(e){return(c.defined(e.primitive)?o:function(e){var t=new A.Decoder;e.dequantizeInShader&&(t.SkipAttributeTransform(A.POSITION),t.SkipAttributeTransform(A.NORMAL));var r=new A.DecoderBuffer;if(r.Init(e.buffer,e.buffer.length),t.GetEncodedGeometryType(r)!==A.POINT_CLOUD)throw new y.RuntimeError("Draco geometry type must be POINT_CLOUD.");var n=new A.PointCloud,o=t.DecodeBufferToPointCloud(r,n);if(!o.ok()||0===n.ptr)throw new y.RuntimeError("Error decoding draco point cloud: "+o.error_msg());A.destroy(r);var a,i,u={},s=e.properties;for(a in s)s.hasOwnProperty(a)&&(i=s[a],i=t.GetAttributeByUniqueId(n,i),u[a]=b(n,t,i));return A.destroy(n),A.destroy(t),u})(e)}function i(e){A=e,self.onmessage=t(a),self.postMessage(!0)}return function(e){var t=e.data.webAssemblyConfig;if(c.defined(t))return require([t.modulePath],function(e){c.defined(t.wasmBinaryFile)?(e=!c.defined(e)?self.DracoDecoderModule:e)(t).then(function(e){i(e)}):i(e())})}}); +define(["./ComponentDatatype-1a100acd","./when-54335d57","./IndexDatatype-82ceea78","./RuntimeError-88a32665","./createTaskProcessorWorker","./Check-24483042","./WebGLConstants-95ceb4e9","./Math-d6182036"],function(d,c,y,f,t,e,r,n){"use strict";var A;function m(e,t,r){var n,o=e.num_points(),a=r.num_components(),i=new A.AttributeQuantizationTransform;if(i.InitFromAttribute(r)){for(var u=new Array(a),s=0;s<a;++s)u[s]=i.min_value(s);n={quantizationBits:i.quantization_bits(),minValues:u,range:i.range(),octEncoded:!1}}A.destroy(i),(i=new A.AttributeOctahedronTransform).InitFromAttribute(r)&&(n={quantizationBits:i.quantization_bits(),octEncoded:!0}),A.destroy(i);o*=a,t=c.defined(n)?function(e,t,r,n,o){var a,i;n.quantizationBits<=8?(i=new A.DracoUInt8Array,a=new Uint8Array(o),t.GetAttributeUInt8ForAllPoints(e,r,i)):(i=new A.DracoUInt16Array,a=new Uint16Array(o),t.GetAttributeUInt16ForAllPoints(e,r,i));for(var u=0;u<o;++u)a[u]=i.GetValue(u);return A.destroy(i),a}(e,t,r,n,o):function(e,t,r,n){var o,a;switch(r.data_type()){case 1:case 11:a=new A.DracoInt8Array,o=new Int8Array(n),t.GetAttributeInt8ForAllPoints(e,r,a);break;case 2:a=new A.DracoUInt8Array,o=new Uint8Array(n),t.GetAttributeUInt8ForAllPoints(e,r,a);break;case 3:a=new A.DracoInt16Array,o=new Int16Array(n),t.GetAttributeInt16ForAllPoints(e,r,a);break;case 4:a=new A.DracoUInt16Array,o=new Uint16Array(n),t.GetAttributeUInt16ForAllPoints(e,r,a);break;case 5:case 7:a=new A.DracoInt32Array,o=new Int32Array(n),t.GetAttributeInt32ForAllPoints(e,r,a);break;case 6:case 8:a=new A.DracoUInt32Array,o=new Uint32Array(n),t.GetAttributeUInt32ForAllPoints(e,r,a);break;case 9:case 10:a=new A.DracoFloat32Array,o=new Float32Array(n),t.GetAttributeFloatForAllPoints(e,r,a)}for(var i=0;i<n;++i)o[i]=a.GetValue(i);return A.destroy(a),o}(e,t,r,o),o=d.ComponentDatatype.fromTypedArray(t);return{array:t,data:{componentsPerAttribute:a,componentDatatype:o,byteOffset:r.byte_offset(),byteStride:d.ComponentDatatype.getSizeInBytes(o)*a,normalized:r.normalized(),quantization:n}}}function o(e){var t=new A.Decoder,r=["POSITION","NORMAL","COLOR","TEX_COORD"];if(e.dequantizeInShader)for(var n=0;n<r.length;++n)t.SkipAttributeTransform(A[r[n]]);var o=e.bufferView,a=new A.DecoderBuffer;if(a.Init(e.array,o.byteLength),t.GetEncodedGeometryType(a)!==A.TRIANGULAR_MESH)throw new f.RuntimeError("Unsupported draco mesh geometry type.");var i=new A.Mesh,o=t.DecodeBufferToMesh(a,i);if(!o.ok()||0===i.ptr)throw new f.RuntimeError("Error decoding draco mesh geometry: "+o.error_msg());A.destroy(a);var u,s,d={},c=e.compressedAttributes;for(u in c)c.hasOwnProperty(u)&&(s=c[u],s=t.GetAttributeByUniqueId(i,s),d[u]=m(i,t,s));e={indexArray:function(e,t){for(var r=e.num_points(),n=e.num_faces(),o=new A.DracoInt32Array,a=3*n,i=y.IndexDatatype.createTypedArray(r,a),u=0,s=0;s<n;++s)t.GetFaceFromMesh(e,s,o),i[u+0]=o.GetValue(0),i[u+1]=o.GetValue(1),i[u+2]=o.GetValue(2),u+=3;return A.destroy(o),{typedArray:i,numberOfIndices:a}}(i,t),attributeData:d};return A.destroy(i),A.destroy(t),e}function a(e){return(c.defined(e.primitive)?o:function(e){var t=new A.Decoder;e.dequantizeInShader&&(t.SkipAttributeTransform(A.POSITION),t.SkipAttributeTransform(A.NORMAL));var r=new A.DecoderBuffer;if(r.Init(e.buffer,e.buffer.length),t.GetEncodedGeometryType(r)!==A.POINT_CLOUD)throw new f.RuntimeError("Draco geometry type must be POINT_CLOUD.");var n=new A.PointCloud,o=t.DecodeBufferToPointCloud(r,n);if(!o.ok()||0===n.ptr)throw new f.RuntimeError("Error decoding draco point cloud: "+o.error_msg());A.destroy(r);var a,i,u={},s=e.properties;for(a in s)s.hasOwnProperty(a)&&(i=s[a],i=t.GetAttributeByUniqueId(n,i),u[a]=m(n,t,i));return A.destroy(n),A.destroy(t),u})(e)}function i(e){A=e,self.onmessage=t(a),self.postMessage(!0)}return function(e){var t=e.data.webAssemblyConfig;if(c.defined(t))return require([t.modulePath],function(e){c.defined(t.wasmBinaryFile)?(e=!c.defined(e)?self.DracoDecoderModule:e)(t).then(function(e){i(e)}):i(e())})}}); diff --git a/public/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js b/public/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js index 25dd899..284d823 100644 --- a/public/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js +++ b/public/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js @@ -1 +1 @@ -define(["./Check-d18af7c4","./RuntimeError-7f634f5d","./when-208fe5b0","./createTaskProcessorWorker"],function(e,k,i,t){"use strict";var h=1953029805,c=2917034100;function b(e,t){if(b.passThroughDataForTesting)return t;var i=e.byteLength;if(0===i||i%4!=0)throw new k.RuntimeError("The length of key must be greater than 0 and a multiple of 4.");var n=new DataView(t),r=n.getUint32(0,!0);if(r===h||r===c)return t;for(var a,o=new DataView(e),s=0,f=t.byteLength,l=f-f%8,u=i,d=8;s<l;)for(a=d=(d+8)%24;s<l&&a<u;)n.setUint32(s,n.getUint32(s,!0)^o.getUint32(a,!0),!0),n.setUint32(s+4,n.getUint32(s+4,!0)^o.getUint32(a+4,!0),!0),s+=8,a+=24;if(s<f)for(u<=a&&(a=d=(d+8)%24);s<f;)n.setUint8(s,n.getUint8(s)^o.getUint8(a)),s++,a++}function n(e,t){return 0!=(e&t)}b.passThroughDataForTesting=!1;var r=[1,2,4,8];function _(e,t,i,n,r,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=i,this.terrainVersion=n,this.imageryProvider=r,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}_.clone=function(e,t){return i.defined(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 _(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t},_.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},_.prototype.hasSubtree=function(){return n(this._bits,16)},_.prototype.hasImagery=function(){return n(this._bits,64)},_.prototype.hasTerrain=function(){return n(this._bits,128)},_.prototype.hasChildren=function(){return n(this._bits,15)},_.prototype.hasChild=function(e){return n(this._bits,r[e])},_.prototype.getChildBitmask=function(){return 15&this._bits};var o=function n(r,a,o){function s(i,e){if(!a[i]){if(!r[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(f)return f(i,!0);t=new Error("Cannot find module '"+i+"'");throw t.code="MODULE_NOT_FOUND",t}t=a[i]={exports:{}};r[i][0].call(t.exports,function(e){var t=r[i][1][e];return s(t||e)},t,t.exports,n,r,a,o)}return a[i].exports}for(var f="function"==typeof require&&require,e=0;e<o.length;e++)s(o[e]);return s}({1:[function(e,t,i){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+n),r);else for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){for(var t,i,n,r=0,a=0,o=e.length;a<o;a++)r+=e[a].length;for(n=new Uint8Array(r),a=t=0,o=e.length;a<o;a++)i=e[a],n.set(i,t),t+=i.length;return n}},a={arraySet:function(e,t,i,n,r){for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,r)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(n)},{}],2:[function(e,t,i){var f=e("./common"),r=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var l=new f.Buf8(256),n=0;n<256;n++)l[n]=252<=n?6:248<=n?5:240<=n?4:224<=n?3:192<=n?2:1;function u(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&r))return String.fromCharCode.apply(null,f.shrinkBuf(e,t));for(var i="",n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i}l[254]=l[254]=1,i.string2buf=function(e){for(var t,i,n,r,a=e.length,o=0,s=0;s<a;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(n-56320),s++),o+=i<128?1:i<2048?2:i<65536?3:4;for(t=new f.Buf8(o),s=r=0;r<o;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(n-56320),s++),i<128?t[r++]=i:(i<2048?t[r++]=192|i>>>6:(i<65536?t[r++]=224|i>>>12:(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63),t[r++]=128|i>>>6&63),t[r++]=128|63&i);return t},i.buf2binstring=function(e){return u(e,e.length)},i.binstring2buf=function(e){for(var t=new f.Buf8(e.length),i=0,n=t.length;i<n;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){for(var i,n,r=t||e.length,a=new Array(2*r),o=0,s=0;s<r;)if((i=e[s++])<128)a[o++]=i;else if(4<(n=l[i]))a[o++]=65533,s+=n-1;else{for(i&=2===n?31:3===n?15:7;1<n&&s<r;)i=i<<6|63&e[s++],n--;1<n?a[o++]=65533:i<65536?a[o++]=i:(i-=65536,a[o++]=55296|i>>10&1023,a[o++]=56320|1023&i)}return u(a,o)},i.utf8border=function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+l[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){t.exports=function(e,t,i,n){for(var r=65535&e|0,a=e>>>16&65535|0,o=0;0!==i;){for(o=2e3<i?2e3:i,i-=o;a=a+(r=r+t[n++]|0)|0,--o;);r%=65521,a%=65521}return r|a<<16|0}},{}],4:[function(e,t,i){t.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_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}},{}],5:[function(e,t,i){var s=function(){for(var e=[],t=0;t<256;t++){for(var i=t,n=0;n<8;n++)i=1&i?3988292384^i>>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t,i,n){var r=s,a=n+i;e^=-1;for(var o=n;o<a;o++)e=e>>>8^r[255&(e^t[o])];return-1^e}},{}],6:[function(e,t,i){t.exports=function(){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}},{}],7:[function(e,t,i){t.exports=function(e,t){var i,n,r,a,o,s,f=e.state,l=e.next_in,u=e.input,d=l+(e.avail_in-5),h=e.next_out,c=e.output,b=h-(t-e.avail_out),m=h+(e.avail_out-257),w=f.dmax,g=f.wsize,v=f.whave,k=f.wnext,_=f.window,p=f.hold,y=f.bits,x=f.lencode,E=f.distcode,S=(1<<f.lenbits)-1,T=(1<<f.distbits)-1;e:do{y<15&&(p+=u[l++]<<y,y+=8,p+=u[l++]<<y,y+=8),i=x[p&S];t:for(;;){if(p>>>=n=i>>>24,y-=n,0===(n=i>>>16&255))c[h++]=65535&i;else{if(!(16&n)){if(0==(64&n)){i=x[(65535&i)+(p&(1<<n)-1)];continue t}if(32&n){f.mode=12;break e}e.msg="invalid literal/length code",f.mode=30;break e}r=65535&i,(n&=15)&&(y<n&&(p+=u[l++]<<y,y+=8),r+=p&(1<<n)-1,p>>>=n,y-=n),y<15&&(p+=u[l++]<<y,y+=8,p+=u[l++]<<y,y+=8),i=E[p&T];i:for(;;){if(p>>>=n=i>>>24,y-=n,!(16&(n=i>>>16&255))){if(0==(64&n)){i=E[(65535&i)+(p&(1<<n)-1)];continue i}e.msg="invalid distance code",f.mode=30;break e}if(a=65535&i,y<(n&=15)&&(p+=u[l++]<<y,(y+=8)<n&&(p+=u[l++]<<y,y+=8)),w<(a+=p&(1<<n)-1)){e.msg="invalid distance too far back",f.mode=30;break e}if(p>>>=n,y-=n,(n=h-b)<a){if(n=a-n,v<n&&f.sane){e.msg="invalid distance too far back",f.mode=30;break e}if(s=_,(o=0)===k){if(o+=g-n,n<r){for(r-=n;c[h++]=_[o++],--n;);o=h-a,s=c}}else if(k<n){if(o+=g+k-n,(n-=k)<r){for(r-=n;c[h++]=_[o++],--n;);if(o=0,k<r){for(n=k,r-=n;c[h++]=_[o++],--n;);o=h-a,s=c}}}else if(o+=k-n,n<r){for(r-=n;c[h++]=_[o++],--n;);o=h-a,s=c}for(;2<r;)c[h++]=s[o++],c[h++]=s[o++],c[h++]=s[o++],r-=3;r&&(c[h++]=s[o++],1<r&&(c[h++]=s[o++]))}else{for(o=h-a;c[h++]=c[o++],c[h++]=c[o++],c[h++]=c[o++],r-=3,2<r;);r&&(c[h++]=c[o++],1<r&&(c[h++]=c[o++]))}break}}break}}while(l<d&&h<m);l-=r=y>>3,p&=(1<<(y-=r<<3))-1,e.next_in=l,e.next_out=h,e.avail_in=l<d?d-l+5:5-(l-d),e.avail_out=h<m?m-h+257:257-(h-m),f.hold=p,f.bits=y}},{}],8:[function(e,t,i){var B=e("../utils/common"),U=e("./adler32"),Z=e("./crc32"),I=e("./inffast"),D=e("./inftrees"),N=1,O=2,z=0,C=-2,F=1,n=852,r=592;function L(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){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 B.Buf16(320),this.work=new B.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=F,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new B.Buf32(n),t.distcode=t.distdyn=new B.Buf32(r),t.sane=1,t.back=-1,z):C}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):C}function f(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?C:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,s(e))):C}function l(e,t){var i;return e?(i=new a,(e.state=i).window=null,(t=f(e,t))!==z&&(e.state=null),t):C}var H,P,M=!0;function V(e,t,i,n){var r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new B.Buf8(r.wsize)),n>=r.wsize?(B.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(n<(e=r.wsize-r.wnext)&&(e=n),B.arraySet(r.window,t,i-n,e,r.wnext),(n-=e)?(B.arraySet(r.window,t,i-n,n,0),r.wnext=n,r.whave=r.wsize):(r.wnext+=e,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=e))),0}i.inflateReset=s,i.inflateReset2=f,i.inflateResetKeep=o,i.inflateInit=function(e){return l(e,15)},i.inflateInit2=l,i.inflate=function(e,t){var i,n,r,a,o,s,f,l,u,d,h,c,b,m,w,g,v,k,_,p,y,x,E,S,T=0,R=new B.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return C;12===(i=e.state).mode&&(i.mode=13),o=e.next_out,r=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=i.hold,u=i.bits,d=s,h=f,x=z;e:for(;;)switch(i.mode){case F:if(0===i.wrap){i.mode=13;break}for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(2&i.wrap&&35615===l){R[i.check=0]=255&l,R[1]=l>>>8&255,i.check=Z(i.check,R,2,0),u=l=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&l)){e.msg="unknown compression method",i.mode=30;break}if(u-=4,y=8+(15&(l>>>=4)),0===i.wbits)i.wbits=y;else if(y>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<<y,e.adler=i.check=1,i.mode=512&l?10:12,u=l=0;break;case 2:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(i.flags=l,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&(R[0]=255&l,R[1]=l>>>8&255,i.check=Z(i.check,R,2,0)),u=l=0,i.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.head&&(i.head.time=l),512&i.flags&&(R[0]=255&l,R[1]=l>>>8&255,R[2]=l>>>16&255,R[3]=l>>>24&255,i.check=Z(i.check,R,4,0)),u=l=0,i.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&(R[0]=255&l,R[1]=l>>>8&255,i.check=Z(i.check,R,2,0)),u=l=0,i.mode=5;case 5:if(1024&i.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&(R[0]=255&l,R[1]=l>>>8&255,i.check=Z(i.check,R,2,0)),u=l=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((c=s<(c=i.length)?s:c)&&(i.head&&(y=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),B.arraySet(i.head.extra,n,a,c,y)),512&i.flags&&(i.check=Z(i.check,n,c,a)),s-=c,a+=c,i.length-=c),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===s)break e;for(c=0;y=n[a+c++],i.head&&y&&i.length<65536&&(i.head.name+=String.fromCharCode(y)),y&&c<s;);if(512&i.flags&&(i.check=Z(i.check,n,c,a)),s-=c,a+=c,y)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===s)break e;for(c=0;y=n[a+c++],i.head&&y&&i.length<65536&&(i.head.comment+=String.fromCharCode(y)),y&&c<s;);if(512&i.flags&&(i.check=Z(i.check,n,c,a)),s-=c,a+=c,y)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(65535&i.check)){e.msg="header crc mismatch",i.mode=30;break}u=l=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}e.adler=i.check=L(l),u=l=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,i.hold=l,i.bits=u,2;e.adler=i.check=1,i.mode=12;case 12:if(5===t||6===t)break e;case 13:if(i.last){l>>>=7&u,u-=7&u,i.mode=27;break}for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}switch(i.last=1&l,--u,3&(l>>>=1)){case 0:i.mode=14;break;case 1:if(!function(e){if(M){var t;for(H=new B.Buf32(512),P=new B.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(D(N,e.lens,0,288,H,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;D(O,e.lens,0,32,P,0,e.work,{bits:5}),M=!1}e.lencode=H,e.lenbits=9,e.distcode=P,e.distbits=5}(i),i.mode=20,6!==t)break;l>>>=2,u-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}l>>>=2,u-=2;break;case 14:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&l,u=l=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(c=i.length){if(0===(c=f<(c=s<c?s:c)?f:c))break e;B.arraySet(r,n,a,c,o),s-=c,a+=c,f-=c,o+=c,i.length-=c;break}i.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(i.nlen=257+(31&l),l>>>=5,u-=5,i.ndist=1+(31&l),l>>>=5,u-=5,i.ncode=4+(15&l),l>>>=4,u-=4,286<i.nlen||30<i.ndist){e.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.lens[A[i.have++]]=7&l,l>>>=3,u-=3}for(;i.have<19;)i.lens[A[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,E={bits:i.lenbits},x=D(0,i.lens,0,19,i.lencode,0,i.work,E),i.lenbits=E.bits,x){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;g=(T=i.lencode[l&(1<<i.lenbits)-1])>>>16&255,v=65535&T,!((w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(v<16)l>>>=w,u-=w,i.lens[i.have++]=v;else{if(16===v){for(S=w+2;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l>>>=w,u-=w,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}y=i.lens[i.have-1],c=3+(3&l),l>>>=2,u-=2}else if(17===v){for(S=w+3;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=w,y=0,c=3+(7&(l>>>=w)),l>>>=3,u-=3}else{for(S=w+7;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=w,y=0,c=11+(127&(l>>>=w)),l>>>=7,u-=7}if(i.have+c>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;c--;)i.lens[i.have++]=y}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,E={bits:i.lenbits},x=D(N,i.lens,0,i.nlen,i.lencode,0,i.work,E),i.lenbits=E.bits,x){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,E={bits:i.distbits},x=D(O,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,E),i.distbits=E.bits,x){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=s&&258<=f){e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,i.hold=l,i.bits=u,I(e,h),o=e.next_out,r=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=i.hold,u=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;g=(T=i.lencode[l&(1<<i.lenbits)-1])>>>16&255,v=65535&T,!((w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(g&&0==(240&g)){for(k=w,_=g,p=v;g=(T=i.lencode[p+((l&(1<<k+_)-1)>>k)])>>>16&255,v=65535&T,!(k+(w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=k,u-=k,i.back+=k}if(l>>>=w,u-=w,i.back+=w,i.length=v,0===g){i.mode=26;break}if(32&g){i.back=-1,i.mode=12;break}if(64&g){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&g,i.mode=22;case 22:if(i.extra){for(S=i.extra;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,u-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;g=(T=i.distcode[l&(1<<i.distbits)-1])>>>16&255,v=65535&T,!((w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(0==(240&g)){for(k=w,_=g,p=v;g=(T=i.distcode[p+((l&(1<<k+_)-1)>>k)])>>>16&255,v=65535&T,!(k+(w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=k,u-=k,i.back+=k}if(l>>>=w,u-=w,i.back+=w,64&g){e.msg="invalid distance code",i.mode=30;break}i.offset=v,i.extra=15&g,i.mode=24;case 24:if(i.extra){for(S=i.extra;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,u-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===f)break e;if(c=h-f,i.offset>c){if(c=i.offset-c,c>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}b=c>i.wnext?(c-=i.wnext,i.wsize-c):i.wnext-c,c>i.length&&(c=i.length),m=i.window}else m=r,b=o-i.offset,c=i.length;for(f<c&&(c=f),f-=c,i.length-=c;r[o++]=m[b++],--c;);0===i.length&&(i.mode=21);break;case 26:if(0===f)break e;r[o++]=i.length,f--,i.mode=21;break;case 27:if(i.wrap){for(;u<32;){if(0===s)break e;s--,l|=n[a++]<<u,u+=8}if(h-=f,e.total_out+=h,i.total+=h,h&&(e.adler=i.check=(i.flags?Z:U)(i.check,r,h,o-h)),h=f,(i.flags?l:L(l))!==i.check){e.msg="incorrect data check",i.mode=30;break}u=l=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=30;break}u=l=0}i.mode=29;case 29:x=1;break e;case 30:x=-3;break e;case 31:return-4;case 32:default:return C}return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,i.hold=l,i.bits=u,(i.wsize||h!==e.avail_out&&i.mode<30&&(i.mode<27||4!==t))&&V(e,e.output,e.next_out,h-e.avail_out),d-=e.avail_in,h-=e.avail_out,e.total_in+=d,e.total_out+=h,i.total+=h,i.wrap&&h&&(e.adler=i.check=(i.flags?Z:U)(i.check,r,h,e.next_out-h)),e.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),x=(0==d&&0===h||4===t)&&x===z?-5:x},i.inflateEnd=function(e){if(!e||!e.state)return C;var t=e.state;return t.window&&(t.window=null),e.state=null,z},i.inflateGetHeader=function(e,t){return!e||!e.state||0==(2&(e=e.state).wrap)?C:((e.head=t).done=!1,z)},i.inflateSetDictionary=function(e,t){var i,n=t.length;return!e||!e.state||0!==(i=e.state).wrap&&11!==i.mode?C:11===i.mode&&U(1,t,n,0)!==i.check?-3:V(e,t,n,n)?(i.mode=31,-4):(i.havedict=1,z)},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){var N=e("../utils/common"),O=[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],z=[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],C=[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],F=[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];t.exports=function(e,t,i,n,r,a,o,s){for(var f,l,u,d,h,c,b,m,w,g=s.bits,v=0,k=0,_=0,p=0,y=0,x=0,E=0,S=0,T=0,R=0,A=null,B=0,U=new N.Buf16(16),Z=new N.Buf16(16),I=null,D=0,v=0;v<=15;v++)U[v]=0;for(k=0;k<n;k++)U[t[i+k]]++;for(y=g,p=15;1<=p&&0===U[p];p--);if(p<y&&(y=p),0===p)return r[a++]=20971520,r[a++]=20971520,s.bits=1,0;for(_=1;_<p&&0===U[_];_++);for(y<_&&(y=_),v=S=1;v<=15;v++)if(S<<=1,(S-=U[v])<0)return-1;if(0<S&&(0===e||1!==p))return-1;for(Z[1]=0,v=1;v<15;v++)Z[v+1]=Z[v]+U[v];for(k=0;k<n;k++)0!==t[i+k]&&(o[Z[t[i+k]]++]=k);if(c=0===e?(A=I=o,19):1===e?(A=O,B-=257,I=z,D-=257,256):(A=C,I=F,-1),v=_,h=a,E=k=R=0,u=-1,d=(T=1<<(x=y))-1,1===e&&852<T||2===e&&592<T)return 1;for(;;){for(b=v-E,w=o[k]<c?(m=0,o[k]):o[k]>c?(m=I[D+o[k]],A[B+o[k]]):(m=96,0),f=1<<v-E,l=1<<x,_=l;r[h+(R>>E)+(l-=f)]=b<<24|m<<16|w|0,0!==l;);for(f=1<<v-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,k++,0==--U[v]){if(v===p)break;v=t[i+o[k]]}if(y<v&&(R&d)!==u){for(h+=_,S=1<<(x=v-(E=0===E?y:E));x+E<p&&!((S-=U[x+E])<=0);)x++,S<<=1;if(T+=1<<x,1===e&&852<T||2===e&&592<T)return 1;r[u=R&d]=y<<24|x<<16|h-a|0}}return 0!==R&&(r[h+R]=v-E<<24|64<<16|0),s.bits=y,0}},{"../utils/common":1}],10:[function(e,t,i){t.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"}},{}],11:[function(e,t,i){t.exports=function(){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}},{}],"/lib/inflate.js":[function(e,t,i){var d=e("./zlib/inflate"),h=e("./utils/common"),c=e("./utils/strings"),b=e("./zlib/constants"),n=e("./zlib/messages"),r=e("./zlib/zstream"),a=e("./zlib/gzheader"),m=Object.prototype.toString;function o(e){if(!(this instanceof o))return new o(e);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0;t=d.inflateInit2(this.strm,t.windowBits);if(t!==b.Z_OK)throw new Error(n[t]);this.header=new a,d.inflateGetHeader(this.strm,this.header)}function s(e,t){t=new o(t);if(t.push(e,!0),t.err)throw t.msg||n[t.err];return t.result}o.prototype.push=function(e,t){var i,n,r,a,o,s=this.strm,f=this.options.chunkSize,l=this.options.dictionary,u=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?b.Z_FINISH:b.Z_NO_FLUSH,"string"==typeof e?s.input=c.binstring2buf(e):"[object ArrayBuffer]"===m.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new h.Buf8(f),s.next_out=0,s.avail_out=f),(i=d.inflate(s,b.Z_NO_FLUSH))===b.Z_NEED_DICT&&l&&(o="string"==typeof l?c.string2buf(l):"[object ArrayBuffer]"===m.call(l)?new Uint8Array(l):l,i=d.inflateSetDictionary(this.strm,o)),i===b.Z_BUF_ERROR&&!0===u&&(i=b.Z_OK,u=!1),i!==b.Z_STREAM_END&&i!==b.Z_OK)return this.onEnd(i),!(this.ended=!0)}while(s.next_out&&(0!==s.avail_out&&i!==b.Z_STREAM_END&&(0!==s.avail_in||n!==b.Z_FINISH&&n!==b.Z_SYNC_FLUSH)||("string"===this.options.to?(r=c.utf8border(s.output,s.next_out),a=s.next_out-r,o=c.buf2string(s.output,r),s.next_out=a,s.avail_out=f-a,a&&h.arraySet(s.output,s.output,r,a,0),this.onData(o)):this.onData(h.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(u=!0),(0<s.avail_in||0===s.avail_out)&&i!==b.Z_STREAM_END);return(n=i===b.Z_STREAM_END?b.Z_FINISH:n)===b.Z_FINISH?(i=d.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===b.Z_OK):n!==b.Z_SYNC_FLUSH||(this.onEnd(b.Z_OK),!(s.avail_out=0))},o.prototype.onData=function(e){this.chunks.push(e)},o.prototype.onEnd=function(e){e===b.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=o,i.inflate=s,i.inflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},i.ungzip=s},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js"),p=Uint16Array.BYTES_PER_ELEMENT,y=Int32Array.BYTES_PER_ELEMENT,x=Uint32Array.BYTES_PER_ELEMENT,s={METADATA:0,TERRAIN:1,DBROOT:2};s.fromString=function(e){return"Metadata"===e?s.METADATA:"Terrain"===e?s.TERRAIN:"DbRoot"===e?s.DBROOT:void 0};var E=32301;var f=1953029805,l=2917034100;return t(function(e,t){var i=s.fromString(e.type),n=e.buffer;b(e.key,n);var r=function(e){var t=new DataView(e),i=0,n=t.getUint32(0,!0);if(i+=x,n!==f&&n!==l)throw new k.RuntimeError("Invalid magic");n=t.getUint32(i,n===f);i+=x;i=new Uint8Array(e,i),i=o.inflate(i);if(i.length===n)return i;throw new k.RuntimeError("Size of packet doesn't match header")}(n),n=r.buffer,a=r.length;switch(i){case s.METADATA:return function(e,t,i){var n=new DataView(e),r=0,a=n.getUint32(r,!0);if(r+=x,a!==E)throw new k.RuntimeError("Invalid magic");var o=n.getUint32(r,!0);if(r+=x,1!==o)throw new k.RuntimeError("Invalid data type. Must be 1 for QuadTreePacket");var s=n.getUint32(r,!0);if(r+=x,2!==s)throw new k.RuntimeError("Invalid QuadTreePacket version. Only version 2 is supported.");var f=n.getInt32(r,!0);r+=y;e=n.getInt32(r,!0);if(r+=y,32!==e)throw new k.RuntimeError("Invalid instance size.");a=n.getInt32(r,!0);r+=y;o=n.getInt32(r,!0);r+=y;s=n.getInt32(r,!0);if(a!==f*e+(r+=y))throw new k.RuntimeError("Invalid dataBufferOffset");if(a+o+s!==t)throw new k.RuntimeError("Invalid packet offsets");for(var l=[],u=0;u<f;++u){var d=n.getUint8(r);++r,++r;var h=n.getUint16(r,!0);r+=p;var c=n.getUint16(r,!0);r+=p;var b=n.getUint16(r,!0);r+=p,r+=p,r+=p,r+=y,r+=y,r+=8;var m=n.getUint8(r++),w=n.getUint8(r++);r+=p,l.push(new _(d,h,c,b,m,w))}var g=[],v=0;s=0,t=l[v++];""===i?++s:g[i]=t;return function e(t,i,n){var r=!1;if(4===n){if(i.hasSubtree())return;r=!0}for(var a=0;a<4;++a){var o=t+a.toString();if(r)g[o]=null;else if(n<4)if(i.hasChild(a)){if(v===f)return void console.log("Incorrect number of instances");var s=l[v++];g[o]=s,e(o,s,n+1)}else g[o]=null}}(i,t,s),g}(n,a,e.quadKey);case s.TERRAIN:return function(e,t,i){var n=new DataView(e),r=0,a=[];for(;r<t;){for(var o=r,s=0;s<4;++s){var f=n.getUint32(r,!0);r+=x,r+=f}o=e.slice(o,r);i.push(o),a.push(o)}return a}(n,a,t);case s.DBROOT:return t.push(n),{buffer:n}}})}); +define(["./Check-24483042","./RuntimeError-88a32665","./when-54335d57","./createTaskProcessorWorker"],function(e,k,i,t){"use strict";var h=1953029805,c=2917034100;function b(e,t){if(b.passThroughDataForTesting)return t;var i=e.byteLength;if(0===i||i%4!=0)throw new k.RuntimeError("The length of key must be greater than 0 and a multiple of 4.");var n=new DataView(t),r=n.getUint32(0,!0);if(r===h||r===c)return t;for(var a,o=new DataView(e),s=0,f=t.byteLength,l=f-f%8,u=i,d=8;s<l;)for(a=d=(d+8)%24;s<l&&a<u;)n.setUint32(s,n.getUint32(s,!0)^o.getUint32(a,!0),!0),n.setUint32(s+4,n.getUint32(s+4,!0)^o.getUint32(a+4,!0),!0),s+=8,a+=24;if(s<f)for(u<=a&&(a=d=(d+8)%24);s<f;)n.setUint8(s,n.getUint8(s)^o.getUint8(a)),s++,a++}function n(e,t){return 0!=(e&t)}b.passThroughDataForTesting=!1;var r=[1,2,4,8];function _(e,t,i,n,r,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=i,this.terrainVersion=n,this.imageryProvider=r,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}_.clone=function(e,t){return i.defined(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 _(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t},_.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},_.prototype.hasSubtree=function(){return n(this._bits,16)},_.prototype.hasImagery=function(){return n(this._bits,64)},_.prototype.hasTerrain=function(){return n(this._bits,128)},_.prototype.hasChildren=function(){return n(this._bits,15)},_.prototype.hasChild=function(e){return n(this._bits,r[e])},_.prototype.getChildBitmask=function(){return 15&this._bits};var o=function n(r,a,o){function s(i,e){if(!a[i]){if(!r[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(f)return f(i,!0);t=new Error("Cannot find module '"+i+"'");throw t.code="MODULE_NOT_FOUND",t}t=a[i]={exports:{}};r[i][0].call(t.exports,function(e){var t=r[i][1][e];return s(t||e)},t,t.exports,n,r,a,o)}return a[i].exports}for(var f="function"==typeof require&&require,e=0;e<o.length;e++)s(o[e]);return s}({1:[function(e,t,i){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+n),r);else for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){for(var t,i,n,r=0,a=0,o=e.length;a<o;a++)r+=e[a].length;for(n=new Uint8Array(r),a=t=0,o=e.length;a<o;a++)i=e[a],n.set(i,t),t+=i.length;return n}},a={arraySet:function(e,t,i,n,r){for(var a=0;a<n;a++)e[r+a]=t[i+a]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,r)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(n)},{}],2:[function(e,t,i){var f=e("./common"),r=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var l=new f.Buf8(256),n=0;n<256;n++)l[n]=252<=n?6:248<=n?5:240<=n?4:224<=n?3:192<=n?2:1;function u(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&r))return String.fromCharCode.apply(null,f.shrinkBuf(e,t));for(var i="",n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i}l[254]=l[254]=1,i.string2buf=function(e){for(var t,i,n,r,a=e.length,o=0,s=0;s<a;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(n-56320),s++),o+=i<128?1:i<2048?2:i<65536?3:4;for(t=new f.Buf8(o),s=r=0;r<o;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(n-56320),s++),i<128?t[r++]=i:(i<2048?t[r++]=192|i>>>6:(i<65536?t[r++]=224|i>>>12:(t[r++]=240|i>>>18,t[r++]=128|i>>>12&63),t[r++]=128|i>>>6&63),t[r++]=128|63&i);return t},i.buf2binstring=function(e){return u(e,e.length)},i.binstring2buf=function(e){for(var t=new f.Buf8(e.length),i=0,n=t.length;i<n;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){for(var i,n,r=t||e.length,a=new Array(2*r),o=0,s=0;s<r;)if((i=e[s++])<128)a[o++]=i;else if(4<(n=l[i]))a[o++]=65533,s+=n-1;else{for(i&=2===n?31:3===n?15:7;1<n&&s<r;)i=i<<6|63&e[s++],n--;1<n?a[o++]=65533:i<65536?a[o++]=i:(i-=65536,a[o++]=55296|i>>10&1023,a[o++]=56320|1023&i)}return u(a,o)},i.utf8border=function(e,t){for(var i=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=i&&128==(192&e[i]);)i--;return!(i<0)&&0!==i&&i+l[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){t.exports=function(e,t,i,n){for(var r=65535&e|0,a=e>>>16&65535|0,o=0;0!==i;){for(i-=o=2e3<i?2e3:i;a=a+(r=r+t[n++]|0)|0,--o;);r%=65521,a%=65521}return r|a<<16|0}},{}],4:[function(e,t,i){t.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_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}},{}],5:[function(e,t,i){var s=function(){for(var e=[],t=0;t<256;t++){for(var i=t,n=0;n<8;n++)i=1&i?3988292384^i>>>1:i>>>1;e[t]=i}return e}();t.exports=function(e,t,i,n){var r=s,a=n+i;e^=-1;for(var o=n;o<a;o++)e=e>>>8^r[255&(e^t[o])];return-1^e}},{}],6:[function(e,t,i){t.exports=function(){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}},{}],7:[function(e,t,i){t.exports=function(e,t){var i,n,r,a,o,s,f=e.state,l=e.next_in,u=e.input,d=l+(e.avail_in-5),h=e.next_out,c=e.output,b=h-(t-e.avail_out),m=h+(e.avail_out-257),w=f.dmax,g=f.wsize,v=f.whave,k=f.wnext,_=f.window,p=f.hold,y=f.bits,x=f.lencode,E=f.distcode,S=(1<<f.lenbits)-1,T=(1<<f.distbits)-1;e:do{y<15&&(p+=u[l++]<<y,y+=8,p+=u[l++]<<y,y+=8),i=x[p&S];t:for(;;){if(p>>>=n=i>>>24,y-=n,0===(n=i>>>16&255))c[h++]=65535&i;else{if(!(16&n)){if(0==(64&n)){i=x[(65535&i)+(p&(1<<n)-1)];continue t}if(32&n){f.mode=12;break e}e.msg="invalid literal/length code",f.mode=30;break e}r=65535&i,(n&=15)&&(y<n&&(p+=u[l++]<<y,y+=8),r+=p&(1<<n)-1,p>>>=n,y-=n),y<15&&(p+=u[l++]<<y,y+=8,p+=u[l++]<<y,y+=8),i=E[p&T];i:for(;;){if(p>>>=n=i>>>24,y-=n,!(16&(n=i>>>16&255))){if(0==(64&n)){i=E[(65535&i)+(p&(1<<n)-1)];continue i}e.msg="invalid distance code",f.mode=30;break e}if(a=65535&i,y<(n&=15)&&(p+=u[l++]<<y,(y+=8)<n&&(p+=u[l++]<<y,y+=8)),w<(a+=p&(1<<n)-1)){e.msg="invalid distance too far back",f.mode=30;break e}if(p>>>=n,y-=n,(n=h-b)<a){if(v<(n=a-n)&&f.sane){e.msg="invalid distance too far back",f.mode=30;break e}if(s=_,(o=0)===k){if(o+=g-n,n<r){for(r-=n;c[h++]=_[o++],--n;);o=h-a,s=c}}else if(k<n){if(o+=g+k-n,(n-=k)<r){for(r-=n;c[h++]=_[o++],--n;);if(o=0,k<r){for(r-=n=k;c[h++]=_[o++],--n;);o=h-a,s=c}}}else if(o+=k-n,n<r){for(r-=n;c[h++]=_[o++],--n;);o=h-a,s=c}for(;2<r;)c[h++]=s[o++],c[h++]=s[o++],c[h++]=s[o++],r-=3;r&&(c[h++]=s[o++],1<r&&(c[h++]=s[o++]))}else{for(o=h-a;c[h++]=c[o++],c[h++]=c[o++],c[h++]=c[o++],2<(r-=3););r&&(c[h++]=c[o++],1<r&&(c[h++]=c[o++]))}break}}break}}while(l<d&&h<m);p&=(1<<(y-=(r=y>>3)<<3))-1,e.next_in=l-=r,e.next_out=h,e.avail_in=l<d?d-l+5:5-(l-d),e.avail_out=h<m?m-h+257:257-(h-m),f.hold=p,f.bits=y}},{}],8:[function(e,t,i){var B=e("../utils/common"),U=e("./adler32"),Z=e("./crc32"),I=e("./inffast"),D=e("./inftrees"),N=1,O=2,z=0,C=-2,F=1,n=852,r=592;function L(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){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 B.Buf16(320),this.work=new B.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=F,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new B.Buf32(n),t.distcode=t.distdyn=new B.Buf32(r),t.sane=1,t.back=-1,z):C}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):C}function f(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?C:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,s(e))):C}function l(e,t){var i;return e?(i=new a,(e.state=i).window=null,(t=f(e,t))!==z&&(e.state=null),t):C}var H,P,M=!0;function V(e,t,i,n){var r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new B.Buf8(r.wsize)),n>=r.wsize?(B.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(e=r.wsize-r.wnext,B.arraySet(r.window,t,i-n,e=n<e?n:e,r.wnext),(n-=e)?(B.arraySet(r.window,t,i-n,n,0),r.wnext=n,r.whave=r.wsize):(r.wnext+=e,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=e))),0}i.inflateReset=s,i.inflateReset2=f,i.inflateResetKeep=o,i.inflateInit=function(e){return l(e,15)},i.inflateInit2=l,i.inflate=function(e,t){var i,n,r,a,o,s,f,l,u,d,h,c,b,m,w,g,v,k,_,p,y,x,E,S,T=0,R=new B.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return C;12===(i=e.state).mode&&(i.mode=13),o=e.next_out,r=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=i.hold,u=i.bits,d=s,h=f,x=z;e:for(;;)switch(i.mode){case F:if(0===i.wrap){i.mode=13;break}for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(2&i.wrap&&35615===l){R[i.check=0]=255&l,R[1]=l>>>8&255,i.check=Z(i.check,R,2,0),u=l=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&l)){e.msg="unknown compression method",i.mode=30;break}if(u-=4,y=8+(15&(l>>>=4)),0===i.wbits)i.wbits=y;else if(y>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<<y,e.adler=i.check=1,i.mode=512&l?10:12,u=l=0;break;case 2:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(i.flags=l,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&(R[0]=255&l,R[1]=l>>>8&255,i.check=Z(i.check,R,2,0)),u=l=0,i.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.head&&(i.head.time=l),512&i.flags&&(R[0]=255&l,R[1]=l>>>8&255,R[2]=l>>>16&255,R[3]=l>>>24&255,i.check=Z(i.check,R,4,0)),u=l=0,i.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&(R[0]=255&l,R[1]=l>>>8&255,i.check=Z(i.check,R,2,0)),u=l=0,i.mode=5;case 5:if(1024&i.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&(R[0]=255&l,R[1]=l>>>8&255,i.check=Z(i.check,R,2,0)),u=l=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((c=s<(c=i.length)?s:c)&&(i.head&&(y=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),B.arraySet(i.head.extra,n,a,c,y)),512&i.flags&&(i.check=Z(i.check,n,c,a)),s-=c,a+=c,i.length-=c),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===s)break e;for(c=0;y=n[a+c++],i.head&&y&&i.length<65536&&(i.head.name+=String.fromCharCode(y)),y&&c<s;);if(512&i.flags&&(i.check=Z(i.check,n,c,a)),s-=c,a+=c,y)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===s)break e;for(c=0;y=n[a+c++],i.head&&y&&i.length<65536&&(i.head.comment+=String.fromCharCode(y)),y&&c<s;);if(512&i.flags&&(i.check=Z(i.check,n,c,a)),s-=c,a+=c,y)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(65535&i.check)){e.msg="header crc mismatch",i.mode=30;break}u=l=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}e.adler=i.check=L(l),u=l=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,i.hold=l,i.bits=u,2;e.adler=i.check=1,i.mode=12;case 12:if(5===t||6===t)break e;case 13:if(i.last){l>>>=7&u,u-=7&u,i.mode=27;break}for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}switch(i.last=1&l,--u,3&(l>>>=1)){case 0:i.mode=14;break;case 1:if(!function(e){if(M){var t;for(H=new B.Buf32(512),P=new B.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(D(N,e.lens,0,288,H,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;D(O,e.lens,0,32,P,0,e.work,{bits:5}),M=!1}e.lencode=H,e.lenbits=9,e.distcode=P,e.distbits=5}(i),i.mode=20,6!==t)break;l>>>=2,u-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}l>>>=2,u-=2;break;case 14:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&l,u=l=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(c=i.length){if(0===(c=f<(c=s<c?s:c)?f:c))break e;B.arraySet(r,n,a,c,o),s-=c,a+=c,f-=c,o+=c,i.length-=c;break}i.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(i.nlen=257+(31&l),l>>>=5,u-=5,i.ndist=1+(31&l),l>>>=5,u-=5,i.ncode=4+(15&l),l>>>=4,u-=4,286<i.nlen||30<i.ndist){e.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.lens[A[i.have++]]=7&l,l>>>=3,u-=3}for(;i.have<19;)i.lens[A[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,E={bits:i.lenbits},x=D(0,i.lens,0,19,i.lencode,0,i.work,E),i.lenbits=E.bits,x){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;g=(T=i.lencode[l&(1<<i.lenbits)-1])>>>16&255,v=65535&T,!((w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(v<16)l>>>=w,u-=w,i.lens[i.have++]=v;else{if(16===v){for(S=w+2;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l>>>=w,u-=w,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}y=i.lens[i.have-1],c=3+(3&l),l>>>=2,u-=2}else if(17===v){for(S=w+3;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=w,y=0,c=3+(7&(l>>>=w)),l>>>=3,u-=3}else{for(S=w+7;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=w,y=0,c=11+(127&(l>>>=w)),l>>>=7,u-=7}if(i.have+c>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;c--;)i.lens[i.have++]=y}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,E={bits:i.lenbits},x=D(N,i.lens,0,i.nlen,i.lencode,0,i.work,E),i.lenbits=E.bits,x){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,E={bits:i.distbits},x=D(O,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,E),i.distbits=E.bits,x){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=s&&258<=f){e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,i.hold=l,i.bits=u,I(e,h),o=e.next_out,r=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=i.hold,u=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;g=(T=i.lencode[l&(1<<i.lenbits)-1])>>>16&255,v=65535&T,!((w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(g&&0==(240&g)){for(k=w,_=g,p=v;g=(T=i.lencode[p+((l&(1<<k+_)-1)>>k)])>>>16&255,v=65535&T,!(k+(w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=k,u-=k,i.back+=k}if(l>>>=w,u-=w,i.back+=w,i.length=v,0===g){i.mode=26;break}if(32&g){i.back=-1,i.mode=12;break}if(64&g){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&g,i.mode=22;case 22:if(i.extra){for(S=i.extra;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,u-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;g=(T=i.distcode[l&(1<<i.distbits)-1])>>>16&255,v=65535&T,!((w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(0==(240&g)){for(k=w,_=g,p=v;g=(T=i.distcode[p+((l&(1<<k+_)-1)>>k)])>>>16&255,v=65535&T,!(k+(w=T>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=k,u-=k,i.back+=k}if(l>>>=w,u-=w,i.back+=w,64&g){e.msg="invalid distance code",i.mode=30;break}i.offset=v,i.extra=15&g,i.mode=24;case 24:if(i.extra){for(S=i.extra;u<S;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,u-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===f)break e;if(i.offset>(c=h-f)){if((c=i.offset-c)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}b=c>i.wnext?(c-=i.wnext,i.wsize-c):i.wnext-c,c>i.length&&(c=i.length),m=i.window}else m=r,b=o-i.offset,c=i.length;for(f-=c=f<c?f:c,i.length-=c;r[o++]=m[b++],--c;);0===i.length&&(i.mode=21);break;case 26:if(0===f)break e;r[o++]=i.length,f--,i.mode=21;break;case 27:if(i.wrap){for(;u<32;){if(0===s)break e;s--,l|=n[a++]<<u,u+=8}if(h-=f,e.total_out+=h,i.total+=h,h&&(e.adler=i.check=(i.flags?Z:U)(i.check,r,h,o-h)),h=f,(i.flags?l:L(l))!==i.check){e.msg="incorrect data check",i.mode=30;break}u=l=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=30;break}u=l=0}i.mode=29;case 29:x=1;break e;case 30:x=-3;break e;case 31:return-4;case 32:default:return C}return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,i.hold=l,i.bits=u,(i.wsize||h!==e.avail_out&&i.mode<30&&(i.mode<27||4!==t))&&V(e,e.output,e.next_out,h-e.avail_out),d-=e.avail_in,h-=e.avail_out,e.total_in+=d,e.total_out+=h,i.total+=h,i.wrap&&h&&(e.adler=i.check=(i.flags?Z:U)(i.check,r,h,e.next_out-h)),e.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),x=(0==d&&0===h||4===t)&&x===z?-5:x},i.inflateEnd=function(e){if(!e||!e.state)return C;var t=e.state;return t.window&&(t.window=null),e.state=null,z},i.inflateGetHeader=function(e,t){return!e||!e.state||0==(2&(e=e.state).wrap)?C:((e.head=t).done=!1,z)},i.inflateSetDictionary=function(e,t){var i,n=t.length;return!e||!e.state||0!==(i=e.state).wrap&&11!==i.mode?C:11===i.mode&&U(1,t,n,0)!==i.check?-3:V(e,t,n,n)?(i.mode=31,-4):(i.havedict=1,z)},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){var N=e("../utils/common"),O=[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],z=[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],C=[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],F=[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];t.exports=function(e,t,i,n,r,a,o,s){for(var f,l,u,d,h,c,b,m,w,g=s.bits,v=0,k=0,_=0,p=0,y=0,x=0,E=0,S=0,T=0,R=0,A=null,B=0,U=new N.Buf16(16),Z=new N.Buf16(16),I=null,D=0,v=0;v<=15;v++)U[v]=0;for(k=0;k<n;k++)U[t[i+k]]++;for(y=g,p=15;1<=p&&0===U[p];p--);if(p<y&&(y=p),0===p)return r[a++]=20971520,r[a++]=20971520,s.bits=1,0;for(_=1;_<p&&0===U[_];_++);for(y<_&&(y=_),v=S=1;v<=15;v++)if(S<<=1,(S-=U[v])<0)return-1;if(0<S&&(0===e||1!==p))return-1;for(Z[1]=0,v=1;v<15;v++)Z[v+1]=Z[v]+U[v];for(k=0;k<n;k++)0!==t[i+k]&&(o[Z[t[i+k]]++]=k);if(c=0===e?(A=I=o,19):1===e?(A=O,B-=257,I=z,D-=257,256):(A=C,I=F,-1),v=_,h=a,E=k=R=0,u=-1,d=(T=1<<(x=y))-1,1===e&&852<T||2===e&&592<T)return 1;for(;;){for(w=o[k]<c?(m=0,o[k]):o[k]>c?(m=I[D+o[k]],A[B+o[k]]):(m=96,0),f=1<<(b=v-E),_=l=1<<x;r[h+(R>>E)+(l-=f)]=b<<24|m<<16|w|0,0!==l;);for(f=1<<v-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,k++,0==--U[v]){if(v===p)break;v=t[i+o[k]]}if(y<v&&(R&d)!==u){for(h+=_,S=1<<(x=v-(E=0===E?y:E));x+E<p&&!((S-=U[x+E])<=0);)x++,S<<=1;if(T+=1<<x,1===e&&852<T||2===e&&592<T)return 1;r[u=R&d]=y<<24|x<<16|h-a|0}}return 0!==R&&(r[h+R]=v-E<<24|64<<16|0),s.bits=y,0}},{"../utils/common":1}],10:[function(e,t,i){t.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"}},{}],11:[function(e,t,i){t.exports=function(){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}},{}],"/lib/inflate.js":[function(e,t,i){var d=e("./zlib/inflate"),h=e("./utils/common"),c=e("./utils/strings"),b=e("./zlib/constants"),n=e("./zlib/messages"),r=e("./zlib/zstream"),a=e("./zlib/gzheader"),m=Object.prototype.toString;function o(e){if(!(this instanceof o))return new o(e);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0;t=d.inflateInit2(this.strm,t.windowBits);if(t!==b.Z_OK)throw new Error(n[t]);this.header=new a,d.inflateGetHeader(this.strm,this.header)}function s(e,t){t=new o(t);if(t.push(e,!0),t.err)throw t.msg||n[t.err];return t.result}o.prototype.push=function(e,t){var i,n,r,a,o,s=this.strm,f=this.options.chunkSize,l=this.options.dictionary,u=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?b.Z_FINISH:b.Z_NO_FLUSH,"string"==typeof e?s.input=c.binstring2buf(e):"[object ArrayBuffer]"===m.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new h.Buf8(f),s.next_out=0,s.avail_out=f),(i=d.inflate(s,b.Z_NO_FLUSH))===b.Z_NEED_DICT&&l&&(o="string"==typeof l?c.string2buf(l):"[object ArrayBuffer]"===m.call(l)?new Uint8Array(l):l,i=d.inflateSetDictionary(this.strm,o)),i===b.Z_BUF_ERROR&&!0===u&&(i=b.Z_OK,u=!1),i!==b.Z_STREAM_END&&i!==b.Z_OK)return this.onEnd(i),!(this.ended=!0)}while(s.next_out&&(0!==s.avail_out&&i!==b.Z_STREAM_END&&(0!==s.avail_in||n!==b.Z_FINISH&&n!==b.Z_SYNC_FLUSH)||("string"===this.options.to?(r=c.utf8border(s.output,s.next_out),a=s.next_out-r,o=c.buf2string(s.output,r),s.next_out=a,s.avail_out=f-a,a&&h.arraySet(s.output,s.output,r,a,0),this.onData(o)):this.onData(h.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(u=!0),(0<s.avail_in||0===s.avail_out)&&i!==b.Z_STREAM_END);return(n=i===b.Z_STREAM_END?b.Z_FINISH:n)===b.Z_FINISH?(i=d.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===b.Z_OK):n!==b.Z_SYNC_FLUSH||(this.onEnd(b.Z_OK),!(s.avail_out=0))},o.prototype.onData=function(e){this.chunks.push(e)},o.prototype.onEnd=function(e){e===b.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=o,i.inflate=s,i.inflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},i.ungzip=s},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js"),p=Uint16Array.BYTES_PER_ELEMENT,y=Int32Array.BYTES_PER_ELEMENT,x=Uint32Array.BYTES_PER_ELEMENT,s={METADATA:0,TERRAIN:1,DBROOT:2};s.fromString=function(e){return"Metadata"===e?s.METADATA:"Terrain"===e?s.TERRAIN:"DbRoot"===e?s.DBROOT:void 0};var E=32301;var f=1953029805,l=2917034100;return t(function(e,t){var i=s.fromString(e.type),n=e.buffer;b(e.key,n);var r=function(e){var t=new DataView(e),i=0,n=t.getUint32(0,!0);if(i+=x,n!==f&&n!==l)throw new k.RuntimeError("Invalid magic");n=t.getUint32(i,n===f);i+=x;i=new Uint8Array(e,i),i=o.inflate(i);if(i.length===n)return i;throw new k.RuntimeError("Size of packet doesn't match header")}(n),n=r.buffer,a=r.length;switch(i){case s.METADATA:return function(e,t,i){var n=new DataView(e),r=0,a=n.getUint32(r,!0);if(r+=x,a!==E)throw new k.RuntimeError("Invalid magic");var o=n.getUint32(r,!0);if(r+=x,1!==o)throw new k.RuntimeError("Invalid data type. Must be 1 for QuadTreePacket");var s=n.getUint32(r,!0);if(r+=x,2!==s)throw new k.RuntimeError("Invalid QuadTreePacket version. Only version 2 is supported.");var f=n.getInt32(r,!0);r+=y;e=n.getInt32(r,!0);if(r+=y,32!==e)throw new k.RuntimeError("Invalid instance size.");a=n.getInt32(r,!0);r+=y;o=n.getInt32(r,!0);r+=y;s=n.getInt32(r,!0);if(a!==f*e+(r+=y))throw new k.RuntimeError("Invalid dataBufferOffset");if(a+o+s!==t)throw new k.RuntimeError("Invalid packet offsets");for(var l=[],u=0;u<f;++u){var d=n.getUint8(r);++r,++r;var h=n.getUint16(r,!0);r+=p;var c=n.getUint16(r,!0);r+=p;var b=n.getUint16(r,!0);r+=p,r+=p,r+=p,r+=y,r+=y,r+=8;var m=n.getUint8(r++),w=n.getUint8(r++);r+=p,l.push(new _(d,h,c,b,m,w))}var g=[],v=0;s=0,t=l[v++];""===i?++s:g[i]=t;return function e(t,i,n){var r=!1;if(4===n){if(i.hasSubtree())return;r=!0}for(var a=0;a<4;++a){var o=t+a.toString();if(r)g[o]=null;else if(n<4)if(i.hasChild(a)){if(v===f)return void console.log("Incorrect number of instances");var s=l[v++];e(o,g[o]=s,n+1)}else g[o]=null}}(i,t,s),g}(n,a,e.quadKey);case s.TERRAIN:return function(e,t,i){var n=new DataView(e),r=0,a=[];for(;r<t;){for(var o=r,s=0;s<4;++s){var f=n.getUint32(r,!0);r+=x,r+=f}o=e.slice(o,r);i.push(o),a.push(o)}return a}(n,a,t);case s.DBROOT:return t.push(n),{buffer:n}}})}); diff --git a/public/Cesium/Workers/transcodeCRNToDXT.js b/public/Cesium/Workers/transcodeCRNToDXT.js index daa0881..52a1605 100644 --- a/public/Cesium/Workers/transcodeCRNToDXT.js +++ b/public/Cesium/Workers/transcodeCRNToDXT.js @@ -1 +1 @@ -define(["./when-208fe5b0","./WebGLConstants-76bb35d1","./RuntimeError-7f634f5d","./createTaskProcessorWorker"],function(when,WebGLConstants,RuntimeError,createTaskProcessorWorker){"use strict";function CompressedTextureBuffer(e,r,t,n){this._format=e,this._width=r,this._height=t,this._buffer=n}Object.defineProperties(CompressedTextureBuffer.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),CompressedTextureBuffer.clone=function(e){if(when.defined(e))return new CompressedTextureBuffer(e._format,e._width,e._height,e._buffer)},CompressedTextureBuffer.prototype.clone=function(){return CompressedTextureBuffer.clone(this)};var PixelDatatype={UNSIGNED_BYTE:WebGLConstants.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:WebGLConstants.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:WebGLConstants.WebGLConstants.UNSIGNED_INT,FLOAT:WebGLConstants.WebGLConstants.FLOAT,HALF_FLOAT:WebGLConstants.WebGLConstants.HALF_FLOAT_OES,UNSIGNED_INT_24_8:WebGLConstants.WebGLConstants.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:WebGLConstants.WebGLConstants.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_6_5,toWebGLConstant:function(e,r){switch(e){case PixelDatatype.UNSIGNED_BYTE:return WebGLConstants.WebGLConstants.UNSIGNED_BYTE;case PixelDatatype.UNSIGNED_SHORT:return WebGLConstants.WebGLConstants.UNSIGNED_SHORT;case PixelDatatype.UNSIGNED_INT:return WebGLConstants.WebGLConstants.UNSIGNED_INT;case PixelDatatype.FLOAT:return WebGLConstants.WebGLConstants.FLOAT;case PixelDatatype.HALF_FLOAT:return r.webgl2?WebGLConstants.WebGLConstants.HALF_FLOAT:WebGLConstants.WebGLConstants.HALF_FLOAT_OES;case PixelDatatype.UNSIGNED_INT_24_8:return WebGLConstants.WebGLConstants.UNSIGNED_INT_24_8;case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:return WebGLConstants.WebGLConstants.UNSIGNED_SHORT_4_4_4_4;case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:return WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_5_5_1;case PixelDatatype.UNSIGNED_SHORT_5_6_5:return PixelDatatype.UNSIGNED_SHORT_5_6_5}},isPacked:function(e){return e===PixelDatatype.UNSIGNED_INT_24_8||e===PixelDatatype.UNSIGNED_SHORT_4_4_4_4||e===PixelDatatype.UNSIGNED_SHORT_5_5_5_1||e===PixelDatatype.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case PixelDatatype.UNSIGNED_BYTE:return 1;case PixelDatatype.UNSIGNED_SHORT:case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:case PixelDatatype.UNSIGNED_SHORT_5_6_5:case PixelDatatype.HALF_FLOAT:return 2;case PixelDatatype.UNSIGNED_INT:case PixelDatatype.FLOAT:case PixelDatatype.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===PixelDatatype.UNSIGNED_BYTE||e===PixelDatatype.UNSIGNED_SHORT||e===PixelDatatype.UNSIGNED_INT||e===PixelDatatype.FLOAT||e===PixelDatatype.HALF_FLOAT||e===PixelDatatype.UNSIGNED_INT_24_8||e===PixelDatatype.UNSIGNED_SHORT_4_4_4_4||e===PixelDatatype.UNSIGNED_SHORT_5_5_5_1||e===PixelDatatype.UNSIGNED_SHORT_5_6_5}},PixelDatatype$1=Object.freeze(PixelDatatype),PixelFormat={DEPTH_COMPONENT:WebGLConstants.WebGLConstants.DEPTH_COMPONENT,DEPTH_STENCIL:WebGLConstants.WebGLConstants.DEPTH_STENCIL,ALPHA:WebGLConstants.WebGLConstants.ALPHA,RGB:WebGLConstants.WebGLConstants.RGB,RGBA:WebGLConstants.WebGLConstants.RGBA,LUMINANCE:WebGLConstants.WebGLConstants.LUMINANCE,LUMINANCE_ALPHA:WebGLConstants.WebGLConstants.LUMINANCE_ALPHA,RGB_DXT1:WebGLConstants.WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:WebGLConstants.WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:WebGLConstants.WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:WebGLConstants.WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case PixelFormat.RGB:return 3;case PixelFormat.RGBA:return 4;case PixelFormat.LUMINANCE_ALPHA:return 2;case PixelFormat.ALPHA:case PixelFormat.LUMINANCE:default:return 1}},validate:function(e){return e===PixelFormat.DEPTH_COMPONENT||e===PixelFormat.DEPTH_STENCIL||e===PixelFormat.ALPHA||e===PixelFormat.RGB||e===PixelFormat.RGBA||e===PixelFormat.LUMINANCE||e===PixelFormat.LUMINANCE_ALPHA||e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5||e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1||e===PixelFormat.RGB_ETC1},isColorFormat:function(e){return e===PixelFormat.ALPHA||e===PixelFormat.RGB||e===PixelFormat.RGBA||e===PixelFormat.LUMINANCE||e===PixelFormat.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===PixelFormat.DEPTH_COMPONENT||e===PixelFormat.DEPTH_STENCIL},isCompressedFormat:function(e){return e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5||e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1||e===PixelFormat.RGB_ETC1},isDXTFormat:function(e){return e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5},isPVRTCFormat:function(e){return e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===PixelFormat.RGB_ETC1},compressedTextureSizeInBytes:function(e,r,t){switch(e){case PixelFormat.RGB_DXT1:case PixelFormat.RGBA_DXT1:case PixelFormat.RGB_ETC1:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*8;case PixelFormat.RGBA_DXT3:case PixelFormat.RGBA_DXT5:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case PixelFormat.RGB_PVRTC_4BPPV1:case PixelFormat.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(r,8)*Math.max(t,8)*4+7)/8);case PixelFormat.RGB_PVRTC_2BPPV1:case PixelFormat.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(r,16)*Math.max(t,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(e,r,t,n){e=PixelFormat.componentsLength(e);return(e=PixelDatatype$1.isPacked(r)?1:e)*PixelDatatype$1.sizeInBytes(r)*t*n},alignmentInBytes:function(e,r,t){t=PixelFormat.textureSizeInBytes(e,r,t,1)%4;return 0==t?4:2==t?2:1},createTypedArray:function(e,r,t,n){var i=PixelDatatype$1.sizeInBytes(r),r=i===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:i===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:i===Float32Array.BYTES_PER_ELEMENT&&r===PixelDatatype$1.FLOAT?Float32Array:Uint32Array;return new r(PixelFormat.componentsLength(e)*t*n)},flipY:function(e,r,t,n,i){if(1===i)return e;for(var a=PixelFormat.createTypedArray(r,t,n,i),o=PixelFormat.componentsLength(r),u=n*o,f=0;f<i;++f)for(var l=f*n*o,s=(i-f-1)*n*o,c=0;c<u;++c)a[s+c]=e[l+c];return a},toInternalFormat:function(e,r,t){if(!t.webgl2)return e;if(e===PixelFormat.DEPTH_STENCIL)return WebGLConstants.WebGLConstants.DEPTH24_STENCIL8;if(e===PixelFormat.DEPTH_COMPONENT){if(r===PixelDatatype$1.UNSIGNED_SHORT)return WebGLConstants.WebGLConstants.DEPTH_COMPONENT16;if(r===PixelDatatype$1.UNSIGNED_INT)return WebGLConstants.WebGLConstants.DEPTH_COMPONENT24}if(r===PixelDatatype$1.FLOAT)switch(e){case PixelFormat.RGBA:return WebGLConstants.WebGLConstants.RGBA32F;case PixelFormat.RGB:return WebGLConstants.WebGLConstants.RGB32F;case PixelFormat.RG:return WebGLConstants.WebGLConstants.RG32F;case PixelFormat.R:return WebGLConstants.WebGLConstants.R32F}if(r===PixelDatatype$1.HALF_FLOAT)switch(e){case PixelFormat.RGBA:return WebGLConstants.WebGLConstants.RGBA16F;case PixelFormat.RGB:return WebGLConstants.WebGLConstants.RGB16F;case PixelFormat.RG:return WebGLConstants.WebGLConstants.RG16F;case PixelFormat.R:return WebGLConstants.WebGLConstants.R16F}return e}},PixelFormat$1=Object.freeze(PixelFormat),Module,Module=Module||((void 0!==Module?Module:null)||{}),moduleOverrides={},key;for(key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath,TRY_USE_DUMP,key;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(e,r){nodeFS=nodeFS||require("fs"),e=(nodePath=nodePath||require("path")).normalize(e);e=nodeFS.readFileSync(e);return r?e:e.toString()},Module.readBinary=function(e){e=Module.read(e,!0);return assert((e=!e.buffer?new Uint8Array(e):e).buffer),e},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(1<process.argv.length?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"};else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));e=read(e,"binary");return assert("object"==typeof e),e},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e,r){quit(e)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";Module.read=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),Module.readAsync=function(e,r,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console?(Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)})):(TRY_USE_DUMP=!1,Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})),ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}function globalEval(e){eval.call(null,e)}for(key in!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(e,r){throw r}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var moduleOverrides=void 0,Runtime={setTempRet0:function(e){return tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"!==e[0])return 0;var r=parseInt(e.substr(1));return assert(r%8==0),r/8}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,r){return"double"===r||"i64"===r?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,r,t){return t||"i64"!=e&&"double"!=e?e?Math.min(r||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(r,8):8},dynCall:function(e,r,t){return t&&t.length?Module["dynCall_"+e].apply(null,[r].concat(t)):Module["dynCall_"+e].call(null,r)},functionPointers:[],addFunction:function(e){for(var r=0;r<Runtime.functionPointers.length;r++)if(!Runtime.functionPointers[r])return Runtime.functionPointers[r]=e,2*(1+r);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(r,t){assert(t),Runtime.funcWrappers[t]||(Runtime.funcWrappers[t]={});var e=Runtime.funcWrappers[t];return e[r]||(1===t.length?e[r]=function(){return Runtime.dynCall(t,r)}:2===t.length?e[r]=function(e){return Runtime.dynCall(t,r,[e])}:e[r]=function(){return Runtime.dynCall(t,r,Array.prototype.slice.call(arguments))}),e[r]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var r=STACKTOP;return STACKTOP=(STACKTOP=STACKTOP+e|0)+15&-16,r},staticAlloc:function(e){var r=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+e|0)+15&-16,r},dynamicAlloc:function(e){var r=HEAP32[DYNAMICTOP_PTR>>2],e=-16&(r+e+15|0);if((HEAP32[DYNAMICTOP_PTR>>2]=e,TOTAL_MEMORY<=e)&&!enlargeMemory())return HEAP32[DYNAMICTOP_PTR>>2]=r,0;return r},alignMemory:function(e,r){return e=Math.ceil(e/(r||16))*(r||16)},makeBigInt:function(e,r,t){return t?+(e>>>0)+4294967296*(r>>>0):+(e>>>0)+4294967296*(0|r)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,cwrap,ccall;function assert(e,r){e||abort("Assertion failed: "+r)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,r,t,n){switch(t="*"===(t=t||"i8").charAt(t.length-1)?"i32":t){case"i1":case"i8":HEAP8[e>>0]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":tempI64=[r>>>0,(tempDouble=r,1<=+Math_abs(tempDouble)?0<tempDouble?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;default:abort("invalid type for setValue: "+t)}}function getValue(e,r,t){switch(r="*"===(r=r||"i8").charAt(r.length-1)?"i32":r){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+r)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r},stringToC:function(e){var r,t=0;return null!=e&&0!==e&&(r=1+(e.length<<2),stringToUTF8(e,t=Runtime.stackAlloc(r),r)),t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,r,t,n,i){var e=getCFunc(e),a=[],o=0;if(n)for(var u=0;u<n.length;u++){var f=toC[t[u]];f?(0===o&&(o=Runtime.stackSave()),a[u]=f(n[u])):a[u]=n[u]}e=e.apply(null,a);if("string"===r&&(e=Pointer_stringify(e)),0!==o){if(i&&i.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(o)});Runtime.stackRestore(o)}return e};var sourceRegex=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;function parseJSFunc(e){e=e.toString().match(sourceRegex).slice(1);return{arguments:e[0],body:e[1],returnValue:e[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource)for(var e in JSsource={},JSfuncs)JSfuncs.hasOwnProperty(e)&&(JSsource[e]=parseJSFunc(JSfuncs[e]))}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,r){return"$"+r}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i],convertCode;"number"!==type&&(convertCode=JSsource[type+"ToC"],funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"=("+convertCode.returnValue+");")}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue,strgfy;return funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",numericRet||(strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue,funcstr+="ret = "+strgfy+"(ret);"),numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(e,r,t,n){var i,a="number"==typeof e?(i=!0,e):(i=!1,e.length),o="string"==typeof r?r:null,u=t==ALLOC_NONE?n:["function"==typeof _malloc?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===t?ALLOC_STATIC:t](Math.max(a,o?1:r.length));if(i){var f,n=u;for(assert(0==(3&u)),f=u+(-4&a);n<f;n+=4)HEAP32[n>>2]=0;for(f=u+a;n<f;)HEAP8[n++>>0]=0;return u}if("i8"===o)return e.subarray||e.slice?HEAPU8.set(e,u):HEAPU8.set(new Uint8Array(e),u),u;for(var l,s,c,_=0;_<a;){var d=e[_];"function"==typeof d&&(d=Runtime.getFunctionIndex(d)),0!==(l=o||r[_])?(setValue(u+_,d,l="i64"==l?"i32":l),c!==l&&(s=Runtime.getNativeTypeSize(l),c=l),_+=s):_++}return u}function getMemory(e){return staticSealed?runtimeInitialized?_malloc(e):Runtime.dynamicAlloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,r){if(0===r||!e)return"";for(var t,n=0,i=0;n|=t=HEAPU8[e+i>>0],(0!=t||r)&&(i++,!r||i!=r););r=r||i;var a="";if(n<128){for(var o;0<r;)o=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(r,1024))),a=a?a+o:o,e+=1024,r-=1024;return a}return Module.UTF8ToString(e)}function AsciiToString(e){for(var r="";;){var t=HEAP8[e++>>0];if(!t)return r;r+=String.fromCharCode(t)}}function stringToAscii(e,r){return writeAsciiToMemory(e,r,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,r){for(var t=r;e[t];)++t;if(16<t-r&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(r,t));for(var n,i,a,o,u,f="";;){if(!(o=e[r++]))return f;128&o?(u=63&e[r++],192!=(224&o)?(a=63&e[r++],(o=224==(240&o)?(15&o)<<12|u<<6|a:(n=63&e[r++],240==(248&o)?(7&o)<<18|u<<12|a<<6|n:(i=63&e[r++],248==(252&o)?(3&o)<<24|u<<18|a<<12|n<<6|i:(1&o)<<30|u<<24|a<<18|n<<12|i<<6|63&e[r++])))<65536?f+=String.fromCharCode(o):(i=o-65536,f+=String.fromCharCode(55296|i>>10,56320|1023&i))):f+=String.fromCharCode((31&o)<<6|u)):f+=String.fromCharCode(o)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,r,t,n){if(!(0<n))return 0;for(var i=t,a=t+n-1,o=0;o<e.length;++o){var u=e.charCodeAt(o);if((u=55296<=u&&u<=57343?65536+((1023&u)<<10)|1023&e.charCodeAt(++o):u)<=127){if(a<=t)break;r[t++]=u}else if(u<=2047){if(a<=t+1)break;r[t++]=192|u>>6,r[t++]=128|63&u}else if(u<=65535){if(a<=t+2)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|63&u}else if(u<=2097151){if(a<=t+3)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}else if(u<=67108863){if(a<=t+4)break;r[t++]=248|u>>24,r[t++]=128|u>>18&63,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}else{if(a<=t+5)break;r[t++]=252|u>>30,r[t++]=128|u>>24&63,r[t++]=128|u>>18&63,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}}return r[t]=0,t-i}function stringToUTF8(e,r,t){return stringToUTF8Array(e,HEAPU8,r,t)}function lengthBytesUTF8(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);(n=55296<=n&&n<=57343?65536+((1023&n)<<10)|1023&e.charCodeAt(++t):n)<=127?++r:r+=n<=2047?2:n<=65535?3:n<=2097151?4:n<=67108863?5:6}return r}function demangle(e){var r=Module.___cxa_demangle||Module.__cxa_demangle;if(r){try{var t=e.substr(1),n=lengthBytesUTF8(t)+1,i=_malloc(n);stringToUTF8(t,i,n);var a=_malloc(4),o=r(i,0,0,a);if(0===getValue(a,"i32")&&o)return Pointer_stringify(o)}catch(e){}finally{i&&_free(i),a&&_free(a),o&&_free(o)}return e}return Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var r=demangle(e);return e===r?e:e+" ["+r+"]"})}function jsStackTrace(){var r=new Error;if(!r.stack){try{throw new Error(0)}catch(e){r=e}if(!r.stack)return"(no stack trace available)"}return r.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le"),Module.stackTrace=stackTrace;var WASM_PAGE_SIZE=65536,ASMJS_PAGE_SIZE=16777216,MIN_TOTAL_MEMORY=16777216,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR,byteLength;function alignUp(e,r){return 0<e%r&&(e+=r-e%r),e}function updateGlobalBuffer(e){Module.buffer=buffer=e}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){var e=Module.usingWasm?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE,r=2147483648-e;if(HEAP32[DYNAMICTOP_PTR>>2]>r)return!1;var t=TOTAL_MEMORY;for(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,MIN_TOTAL_MEMORY);TOTAL_MEMORY<HEAP32[DYNAMICTOP_PTR>>2];)TOTAL_MEMORY=TOTAL_MEMORY<=536870912?alignUp(2*TOTAL_MEMORY,e):Math.min(alignUp((3*TOTAL_MEMORY+2147483648)/4,e),r);var n=Module.reallocBuffer(TOTAL_MEMORY);return n&&n.byteLength==TOTAL_MEMORY?(updateGlobalBuffer(n),updateGlobalBufferViews(),!0):(TOTAL_MEMORY=t,!1)}STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1,Module.reallocBuffer||(Module.reallocBuffer=function(e){var r,t;try{ArrayBuffer.transfer?t=ArrayBuffer.transfer(buffer,e):(r=HEAP8,t=new ArrayBuffer(e),new Int8Array(t).set(r))}catch(e){return!1}return!!_emscripten_replace_memory(t)&&t});try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),buffer=Module.buffer||new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews(),HEAP32[0]=1668509029,HEAP16[1]=25459,115!==HEAPU8[2]||99!==HEAPU8[3])throw"Runtime error: expected the system to be little-endian!";function callRuntimeCallbacks(e){for(;0<e.length;){var r,t=e.shift();"function"!=typeof t?"number"==typeof(r=t.func)?void 0===t.arg?Module.dynCall_v(r):Module.dynCall_vi(r,t.arg):r(void 0===t.arg?null:t.arg):t()}}Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,r,t){t=0<t?t:lengthBytesUTF8(e)+1,t=new Array(t),e=stringToUTF8Array(e,t,0,t.length);return r&&(t.length=e),t}function intArrayToString(e){for(var r=[],t=0;t<e.length;t++){var n=e[t];255<n&&(n&=255),r.push(String.fromCharCode(n))}return r.join("")}function writeStringToMemory(e,r,t){var n,i;Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),t&&(i=r+lengthBytesUTF8(e),n=HEAP8[i]),stringToUTF8(e,r,1/0),t&&(HEAP8[i]=n)}function writeArrayToMemory(e,r){HEAP8.set(e,r)}function writeAsciiToMemory(e,r,t){for(var n=0;n<e.length;++n)HEAP8[r++>>0]=e.charCodeAt(n);t||(HEAP8[r>>0]=0)}Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,r){var t=65535&e,n=65535&r;return t*n+((e>>>16)*n+t*(r>>>16)<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var r=0;r<32;r++)if(e&1<<31-r)return r;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_min=Math.min,runDependencies=0,dependenciesFulfilled=null;function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){var r;runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&dependenciesFulfilled&&(r=dependenciesFulfilled,dependenciesFulfilled=null,r())}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={},STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+6192,__ATINIT__.push(),allocate([228,2,0,0,81,16,0,0,12,3,0,0,177,16,0,0,32,0,0,0,0,0,0,0,12,3,0,0,94,16,0,0,48,0,0,0,0,0,0,0,228,2,0,0,127,16,0,0,12,3,0,0,140,16,0,0,16,0,0,0,0,0,0,0,12,3,0,0,183,17,0,0,32,0,0,0,0,0,0,0,12,3,0,0,147,17,0,0,72,0,0,0,0,0,0,0,108,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,32,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,1,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,40,20,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,16,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,56,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,83,116,57,101,120,99,101,112,116,105,111,110,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}STATICTOP+=16;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var r in EXCEPTIONS.infos)if(EXCEPTIONS.infos[r].adjusted===e)return r;return e},addRef:function(e){e&&EXCEPTIONS.infos[e].refcount++},decRef:function(e){var r;e&&(assert(0<(r=EXCEPTIONS.infos[e]).refcount),r.refcount--,0!==r.refcount||r.rethrown||(r.destructor&&Module.dynCall_vi(r.destructor,e),delete EXCEPTIONS.infos[e],___cxa_free_exception(e)))},clearRef:function(e){e&&(EXCEPTIONS.infos[e].refcount=0)}};function ___cxa_begin_catch(e){var r=EXCEPTIONS.infos[e];return r&&!r.caught&&(r.caught=!0,__ZSt18uncaught_exceptionv.uncaught_exception--),r&&(r.rethrown=!1),EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,r){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Module.dynCall_v(r),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,r,t){return HEAPU8.set(HEAPU8.subarray(r,r+t),e),e}var SYSCALLS={varargs:0,get:function(e){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var e=SYSCALLS.get(),r=SYSCALLS.get();return assert(0<=e?0===r:-1===r),e},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall6(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD();return FS.close(t),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC),PTHREAD_SPECIFIC={};function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}var PTHREAD_SPECIFIC_NEXT_KEY=1,ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _pthread_key_create(e,r){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function ___resumeException(e){throw EXCEPTIONS.last||(EXCEPTIONS.last=e),e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function ___cxa_find_matching_catch(){if(!(n=EXCEPTIONS.last))return 0|(Runtime.setTempRet0(0),0);var e=EXCEPTIONS.infos[n],r=e.type;if(!r)return 0|(Runtime.setTempRet0(0),n);var t=Array.prototype.slice.call(arguments);Module.___cxa_is_pointer_type(r),___cxa_find_matching_catch.buffer||(___cxa_find_matching_catch.buffer=_malloc(4)),HEAP32[___cxa_find_matching_catch.buffer>>2]=n;for(var n=___cxa_find_matching_catch.buffer,i=0;i<t.length;i++)if(t[i]&&Module.___cxa_can_catch(t[i],r,n))return n=HEAP32[n>>2],e.adjusted=n,0|(Runtime.setTempRet0(t[i]),n);return n=HEAP32[n>>2],0|(Runtime.setTempRet0(r),n)}function ___gxx_personality_v0(){}function _pthread_setspecific(e,r){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=r,0):ERRNO_CODES.EINVAL}function ___syscall140(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),a=SYSCALLS.get(),n=n;return FS.llseek(t,n,a),HEAP32[i>>2]=t.position,t.getdents&&0===n&&0===a&&(t.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.get(),n=SYSCALLS.get(),i=SYSCALLS.get(),a=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,r){var t=___syscall146.buffers[e];assert(t),0===r||10===r?((1===e?Module.print:Module.printErr)(UTF8ArrayToString(t,0)),t.length=0):t.push(r)});for(var o=0;o<i;o++){for(var u=HEAP32[n+8*o>>2],f=HEAP32[n+(8*o+4)>>2],l=0;l<f;l++)___syscall146.printChar(t,HEAPU8[u+l]);a+=f}return a}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,r){SYSCALLS.varargs=r;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,r,t,n){try{return Module.dynCall_iiii(e,r,t,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiiii(e,r,t,n,i,a){try{Module.dynCall_viiiii(e,r,t,n,i,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_vi(e,r){try{Module.dynCall_vi(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_ii(e,r){try{return Module.dynCall_ii(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viii(e,r,t,n){try{Module.dynCall_viii(e,r,t,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiiiii(e,r,t,n,i,a,o){try{Module.dynCall_viiiiii(e,r,t,n,i,a,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiii(e,r,t,n,i){try{Module.dynCall_viiii(e,r,t,n,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}__ATEXIT__.push(function(){var e=Module._fflush;e&&e(0);var r=___syscall146.printChar;r&&((e=___syscall146.buffers)[1].length&&r(1,10),e[2].length&&r(2,10))}),DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,enlargeMemory:enlargeMemory,getTotalMemory:getTotalMemory,abortOnCannotGrowMemory:abortOnCannotGrowMemory,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_getspecific:_pthread_getspecific,___syscall54:___syscall54,_pthread_setspecific:_pthread_setspecific,___gxx_personality_v0:___gxx_personality_v0,___syscall6:___syscall6,___setErrNo:___setErrNo,_abort:_abort,___cxa_begin_catch:___cxa_begin_catch,_pthread_once:_pthread_once,_emscripten_memcpy_big:_emscripten_memcpy_big,_pthread_key_create:_pthread_key_create,___syscall140:___syscall140,___resumeException:___resumeException,___cxa_find_matching_catch:___cxa_find_matching_catch,___syscall146:___syscall146,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,DYNAMICTOP_PTR:DYNAMICTOP_PTR,tempDoublePtr:tempDoublePtr,ABORT:ABORT,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,cttz_i8:cttz_i8};var asm=function(e,r,t){var n=e.Int8Array,ce=new n(t),i=e.Int16Array,W=new i(t),a=e.Int32Array,_e=new a(t),o=e.Uint8Array,de=new o(t),u=e.Uint16Array,Ee=new u(t),f=e.Uint32Array;new f(t);var l=e.Float32Array;new l(t);var s=e.Float64Array,k=new s(t),c=e.byteLength,_=0|r.DYNAMICTOP_PTR,g=0|r.tempDoublePtr;r.ABORT;var Te=0|r.STACKTOP;r.STACK_MAX;var d=0|r.cttz_i8;e.NaN,e.Infinity;var L=0;e.Math.floor,e.Math.abs,e.Math.sqrt,e.Math.pow,e.Math.cos,e.Math.sin,e.Math.tan,e.Math.acos,e.Math.asin,e.Math.atan,e.Math.atan2,e.Math.exp,e.Math.log,e.Math.ceil;var ie=e.Math.imul;e.Math.min,e.Math.max;var T=e.Math.clz32,E=r.abort;r.assert;var A=r.enlargeMemory,M=r.getTotalMemory,b=r.abortOnCannotGrowMemory;r.invoke_iiii,r.invoke_viiiii,r.invoke_vi,r.invoke_ii,r.invoke_viii,r.invoke_v,r.invoke_viiiiii,r.invoke_viiii;var m=r._pthread_getspecific,S=r.___syscall54,P=r._pthread_setspecific;r.___gxx_personality_v0;var R=r.___syscall6,h=r.___setErrNo,p=r._abort;r.___cxa_begin_catch;var C=r._pthread_once,N=r._emscripten_memcpy_big,y=r._pthread_key_create,O=r.___syscall140;r.___resumeException,r.___cxa_find_matching_catch;var v=r.___syscall146;function I(e){e|=0;var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0,d=0,E=0,T=0,A=0,M=0,b=0,m=0,S=0,P=Te;Te=Te+16|0,_=P;do{if(e>>>0<245){if(e=(l=e>>>0<11?16:e+11&-8)>>>3,3&(t=(c=0|_e[1144])>>>e)|0)return n=0|_e[(t=(e=4616+((r=(1&t^1)+e|0)<<1<<2)|0)+8|0)>>2],(0|e)==(0|(a=0|_e[(i=n+8|0)>>2]))?_e[1144]=c&~(1<<r):(_e[a+12>>2]=e,_e[t>>2]=a),S=r<<3,_e[n+4>>2]=3|S,_e[(S=n+S+4|0)>>2]=1|_e[S>>2],Te=P,0|(S=i);if((s=0|_e[1146])>>>0<l>>>0){if(0|t)return r=((r=t<<e&((r=2<<e)|0-r))&0-r)-1|0,i=0|_e[(e=(r=4616+((n=((t=(r>>>=o=r>>>12&16)>>>5&8)|o|(i=(r>>>=t)>>>2&4)|(e=(r>>>=i)>>>1&2)|(n=(r>>>=e)>>>1&1))+(r>>>n)|0)<<1<<2)|0)+8|0)>>2],(0|r)==(0|(t=0|_e[(o=i+8|0)>>2]))?(e=c&~(1<<n),_e[1144]=e):(_e[t+12>>2]=r,_e[e>>2]=t,e=c),a=(n<<3)-l|0,_e[i+4>>2]=3|l,_e[(n=i+l|0)+4>>2]=1|a,_e[n+a>>2]=a,0|s&&(i=0|_e[1149],t=4616+((r=s>>>3)<<1<<2)|0,e&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=e|r,e=(r=t)+8|0),_e[e>>2]=i,_e[r+12>>2]=i,_e[i+8>>2]=r,_e[i+12>>2]=t),_e[1146]=a,_e[1149]=n,Te=P,0|(S=o);if(u=0|_e[1145]){if(t=(u&0-u)-1|0,e=0|_e[4880+(((a=(t>>>=o=t>>>12&16)>>>5&8)|o|(f=(t>>>=a)>>>2&4)|(n=(t>>>=f)>>>1&2)|(e=(t>>>=n)>>>1&1))+(t>>>e)<<2)>>2],t=(-8&_e[e+4>>2])-l|0,n=0|_e[e+16+((0==(0|_e[e+16>>2])&1)<<2)>>2]){for(;t=(f=(o=(-8&_e[n+4>>2])-l|0)>>>0<t>>>0)?o:t,e=f?n:e,n=0|_e[n+16+((0==(0|_e[n+16>>2])&1)<<2)>>2],0!=(0|n););f=e,a=t}else f=e,a=t;if(f>>>0<(o=f+l|0)>>>0){i=0|_e[f+24>>2],r=0|_e[f+12>>2];do{if((0|r)==(0|f)){if(e=f+20|0,r=0|_e[e>>2],!r&&!(r=0|_e[(e=f+16|0)>>2])){t=0;break}for(;;)if(0|(n=0|_e[(t=r+20|0)>>2]))r=n,e=t;else{if(!(n=0|_e[(t=r+16|0)>>2]))break;r=n,e=t}_e[e>>2]=0,t=r}else t=0|_e[f+8>>2],_e[t+12>>2]=r,_e[r+8>>2]=t,t=r}while(0);do{if(0|i){if(r=0|_e[f+28>>2],(0|f)==(0|_e[(e=4880+(r<<2)|0)>>2])){if(!(_e[e>>2]=t)){_e[1145]=u&~(1<<r);break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|f)&1)<<2)>>2]=t))break;_e[t+24>>2]=i,0|(r=0|_e[f+16>>2])&&(_e[t+16>>2]=r,_e[r+24>>2]=t),0|(r=0|_e[f+20>>2])&&(_e[t+20>>2]=r,_e[r+24>>2]=t)}}while(0);return a>>>0<16?(S=a+l|0,_e[f+4>>2]=3|S,_e[(S=f+S+4|0)>>2]=1|_e[S>>2]):(_e[f+4>>2]=3|l,_e[o+4>>2]=1|a,_e[o+a>>2]=a,0|s&&(n=0|_e[1149],t=4616+((r=s>>>3)<<1<<2)|0,c&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=c|r,e=(r=t)+8|0),_e[e>>2]=n,_e[r+12>>2]=n,_e[n+8>>2]=r,_e[n+12>>2]=t),_e[1146]=a,_e[1149]=o),Te=P,0|(S=f+8|0)}c=l}else c=l}else c=l}else if(e>>>0<=4294967231)if(l=-8&(e=e+11|0),f=0|_e[1145]){n=0-l|0,u=(e>>>=8)?16777215<l>>>0?31:l>>>((u=14-((s=((m=e<<(c=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|c|(u=((m<<=s)+245760|0)>>>16&2))+(m<<u>>>15)|0)+7|0)&1|u<<1:0,t=0|_e[4880+(u<<2)>>2];e:do{if(t)for(o=l<<(31==((e=0)|u)?0:25-(u>>>1)|0),a=0;;){if((i=(-8&_e[t+4>>2])-l|0)>>>0<n>>>0){if(!i){n=0,i=e=t,m=61;break e}e=t,n=i}if(a=0==(0|(i=0|_e[t+20>>2]))|(0|i)==(0|(t=0|_e[t+16+(o>>>31<<2)>>2]))?a:i,i=0==(0|t)){t=a,m=57;break}o<<=1&(1^i)}else e=t=0,m=57}while(0);if(57==(0|m)){if(0==(0|t)&0==(0|e)){if(!(e=f&((e=2<<u)|0-e))){c=l;break}c=(e&0-e)-1|0,t=(e=0)|_e[4880+(((a=(c>>>=o=c>>>12&16)>>>5&8)|o|(u=(c>>>=a)>>>2&4)|(s=(c>>>=u)>>>1&2)|(t=(c>>>=s)>>>1&1))+(c>>>t)<<2)>>2]}t?(i=t,m=61):(u=e,o=n)}if(61==(0|m))for(;;){if(m=0,t=(c=(t=(-8&_e[i+4>>2])-l|0)>>>0<n>>>0)?t:n,e=c?i:e,!(i=0|_e[i+16+((0==(0|_e[i+16>>2])&1)<<2)>>2])){u=e,o=t;break}n=t,m=61}if(0!=(0|u)&&o>>>0<((0|_e[1146])-l|0)>>>0){if((a=u+l|0)>>>0<=u>>>0)return Te=P,(S=0)|S;i=0|_e[u+24>>2],r=0|_e[u+12>>2];do{if((0|r)==(0|u)){if(e=u+20|0,r=0|_e[e>>2],!r&&!(r=0|_e[(e=u+16|0)>>2])){r=0;break}for(;;)if(0|(n=0|_e[(t=r+20|0)>>2]))r=n,e=t;else{if(!(n=0|_e[(t=r+16|0)>>2]))break;r=n,e=t}_e[e>>2]=0}else S=0|_e[u+8>>2],_e[S+12>>2]=r,_e[r+8>>2]=S}while(0);do{if(i){if(e=0|_e[u+28>>2],(0|u)==(0|_e[(t=4880+(e<<2)|0)>>2])){if(!(_e[t>>2]=r)){n=f&~(1<<e),_e[1145]=n;break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|u)&1)<<2)>>2]=r)){n=f;break}_e[r+24>>2]=i,0|(e=0|_e[u+16>>2])&&(_e[r+16>>2]=e,_e[e+24>>2]=r),n=((e=0|_e[u+20>>2])&&(_e[r+20>>2]=e,_e[e+24>>2]=r),f)}else n=f}while(0);do{if(16<=o>>>0){if(_e[u+4>>2]=3|l,_e[a+4>>2]=1|o,r=(_e[a+o>>2]=o)>>>3,o>>>0<256){t=4616+(r<<1<<2)|0,(e=0|_e[1144])&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=e|r,e=(r=t)+8|0),_e[e>>2]=a,_e[r+12>>2]=a,_e[a+8>>2]=r,_e[a+12>>2]=t;break}if(t=4880+((r=(r=o>>>8)?16777215<o>>>0?31:o>>>((r=14-((b=((S=r<<(m=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(r=((S<<=b)+245760|0)>>>16&2))+(S<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,_e[a+28>>2]=r,_e[(e=a+16|0)+4>>2]=0,_e[e>>2]=0,!(n&(e=1<<r))){_e[1145]=n|e,_e[t>>2]=a,_e[a+24>>2]=t,_e[a+12>>2]=a,_e[a+8>>2]=a;break}for(e=o<<(31==(0|r)?0:25-(r>>>1)|0),t=0|_e[t>>2];;){if((-8&_e[t+4>>2]|0)==(0|o)){m=97;break}if(!(r=0|_e[(n=t+16+(e>>>31<<2)|0)>>2])){m=96;break}e<<=1,t=r}if(96==(0|m)){_e[n>>2]=a,_e[a+24>>2]=t,_e[a+12>>2]=a,_e[a+8>>2]=a;break}if(97==(0|m)){S=0|_e[(m=t+8|0)>>2],_e[S+12>>2]=a,_e[m>>2]=a,_e[a+8>>2]=S,_e[a+12>>2]=t,_e[a+24>>2]=0;break}}else S=o+l|0,_e[u+4>>2]=3|S,_e[(S=u+S+4|0)>>2]=1|_e[S>>2]}while(0);return Te=P,0|(S=u+8|0)}c=l}else c=l;else c=-1}while(0);if(c>>>0<=(t=0|_e[1146])>>>0)return r=t-c|0,e=0|_e[1149],15<r>>>0?(S=e+c|0,_e[1149]=S,_e[1146]=r,_e[S+4>>2]=1|r,_e[S+r>>2]=r,_e[e+4>>2]=3|c):(_e[1146]=0,_e[1149]=0,_e[e+4>>2]=3|t,_e[(S=e+t+4|0)>>2]=1|_e[S>>2]),Te=P,0|(S=e+8|0);if(c>>>0<(o=0|_e[1147])>>>0)return b=o-c|0,_e[1147]=b,m=(S=0|_e[1150])+c|0,_e[1150]=m,_e[m+4>>2]=1|b,_e[S+4>>2]=3|c,Te=P,0|(S=S+8|0);if(u=c+48|0,(l=(a=(e=0|_e[1262]?0|_e[1264]:(_e[1264]=4096,_e[1263]=4096,_e[1265]=-1,_e[1266]=-1,_e[1267]=0,_e[1255]=0,e=-16&_^1431655768,_e[_>>2]=e,_e[1262]=e,4096))+(f=c+47|0)|0)&(i=0-e|0))>>>0<=c>>>0)return Te=P,(S=0)|S;if(0|(e=0|_e[1254])&&(_=(s=0|_e[1252])+l|0)>>>0<=s>>>0|e>>>0<_>>>0)return Te=P,(S=0)|S;e:do{if(4&_e[1255])r=0,m=133;else{t=0|_e[1150];r:do{if(t){for(n=5024;!((e=0|_e[n>>2])>>>0<=t>>>0&&(e+(0|_e[(T=n+4|0)>>2])|0)>>>0>t>>>0);){if(!(e=0|_e[n+8>>2])){m=118;break r}n=e}if((r=a-o&i)>>>0<2147483647)if((0|(e=0|me(0|r)))==((0|_e[n>>2])+(0|_e[T>>2])|0)){if(-1!=(0|e)){o=r,a=e,m=135;break e}}else n=e,m=126;else r=0}else m=118}while(0);do{if(118==(0|m))if(-1!=(0|(t=0|me(0)))&&(r=t,E=(r=(0==((E=(d=0|_e[1263])+-1|0)&r|0)?0:(E+r&0-d)-r|0)+l|0)+(d=0|_e[1252])|0,c>>>0<r>>>0&r>>>0<2147483647)){if(0|(T=0|_e[1254])&&E>>>0<=d>>>0|T>>>0<E>>>0){r=0;break}if((0|(e=0|me(0|r)))==(0|t)){o=r,a=t,m=135;break e}n=e,m=126}else r=0}while(0);do{if(126==(0|m)){if(t=0-r|0,!(r>>>0<u>>>0&r>>>0<2147483647&-1!=(0|n))){if(-1==(0|n)){r=0;break}o=r,a=n,m=135;break e}if(2147483647<=(e=f-r+(e=0|_e[1264])&0-e)>>>0){o=r,a=n,m=135;break e}if(-1==(0|me(0|e))){me(0|t),r=0;break}o=e+r|0,a=n,m=135;break e}}while(0);_e[1255]=4|_e[1255],m=133}}while(0);if(133==(0|m)&&l>>>0<2147483647&&!(-1==(0|(b=0|me(0|l)))|1^(M=(c+40|0)>>>0<(A=(T=0|me(0))-b|0)>>>0)|b>>>0<T>>>0&-1!=(0|b)&-1!=(0|T)^1)&&(o=M?A:r,a=b,m=135),135==(0|m)){r=(0|_e[1252])+o|0,(_e[1252]=r)>>>0>(0|_e[1253])>>>0&&(_e[1253]=r),f=0|_e[1150];do{if(f){for(r=5024;;){if((0|a)==((e=0|_e[r>>2])+(n=0|_e[(t=r+4|0)>>2])|0)){m=145;break}if(!(i=0|_e[r+8>>2]))break;r=i}if(145==(0|m)&&0==(8&_e[r+12>>2]|0)&&f>>>0<a>>>0&e>>>0<=f>>>0){_e[t>>2]=n+o,m=f+(S=0==(7&(S=f+8|0)|0)?0:0-S&7)|0,S=(0|_e[1147])+(o-S)|0,_e[1150]=m,_e[1147]=S,_e[m+4>>2]=1|S,_e[m+S+4>>2]=40,_e[1151]=_e[1266];break}for(a>>>0<(0|_e[1148])>>>0&&(_e[1148]=a),t=a+o|0,r=5024;;){if((0|_e[r>>2])==(0|t)){m=153;break}if(!(e=0|_e[r+8>>2]))break;r=e}if(153==(0|m)&&0==(8&_e[r+12>>2]|0)){_e[r>>2]=a,_e[(s=r+4|0)>>2]=(0|_e[s>>2])+o,l=(s=a+(0==(7&(s=a+8|0)|0)?0:0-s&7)|0)+c|0,u=(r=t+(0==(7&(r=t+8|0)|0)?0:0-r&7)|0)-s-c|0,_e[s+4>>2]=3|c;do{if((0|r)!=(0|f)){if((0|r)==(0|_e[1149])){S=(0|_e[1146])+u|0,_e[1146]=S,_e[1149]=l,_e[l+4>>2]=1|S,_e[l+S>>2]=S;break}if(1==(3&(e=0|_e[r+4>>2])|0)){o=-8&e,n=e>>>3;e:do{if(e>>>0<256){if(e=0|_e[r+8>>2],(0|(t=0|_e[r+12>>2]))==(0|e)){_e[1144]=_e[1144]&~(1<<n);break}_e[e+12>>2]=t,_e[t+8>>2]=e;break}a=0|_e[r+24>>2],e=0|_e[r+12>>2];do{if((0|e)==(0|r)){if(!(e=0|_e[(t=(n=r+16|0)+4|0)>>2])){if(!(e=0|_e[n>>2])){e=0;break}t=n}for(;;)if(0|(i=0|_e[(n=e+20|0)>>2]))e=i,t=n;else{if(!(i=0|_e[(n=e+16|0)>>2]))break;e=i,t=n}_e[t>>2]=0}else S=0|_e[r+8>>2],_e[S+12>>2]=e,_e[e+8>>2]=S}while(0);if(!a)break;n=4880+((t=0|_e[r+28>>2])<<2)|0;do{if((0|r)==(0|_e[n>>2])){if(0|(_e[n>>2]=e))break;_e[1145]=_e[1145]&~(1<<t);break e}if(!(_e[a+16+(((0|_e[a+16>>2])!=(0|r)&1)<<2)>>2]=e))break e}while(0)}while((_e[e+24>>2]=a,0|(n=0|_e[(t=r+16|0)>>2])&&(_e[e+16>>2]=n,_e[n+24>>2]=e),t=0|_e[t+4>>2])&&(_e[e+20>>2]=t,_e[t+24>>2]=e,0));r=r+o|0,i=o+u|0}else i=u;if(_e[(r=r+4|0)>>2]=-2&_e[r>>2],_e[l+4>>2]=1|i,r=(_e[l+i>>2]=i)>>>3,i>>>0<256){t=4616+(r<<1<<2)|0,(e=0|_e[1144])&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=e|r,e=(r=t)+8|0),_e[e>>2]=l,_e[r+12>>2]=l,_e[l+8>>2]=r,_e[l+12>>2]=t;break}r=i>>>8;do{if(r){if(16777215<i>>>0){r=31;break}r=i>>>((r=14-((b=((S=r<<(m=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(r=((S<<=b)+245760|0)>>>16&2))+(S<<r>>>15)|0)+7|0)&1|r<<1}else r=0}while(0);if(n=4880+(r<<2)|0,_e[l+28>>2]=r,_e[(e=l+16|0)+4>>2]=0,!((e=(_e[e>>2]=0)|_e[1145])&(t=1<<r))){_e[1145]=e|t,_e[n>>2]=l,_e[l+24>>2]=n,_e[l+12>>2]=l,_e[l+8>>2]=l;break}for(e=i<<(31==(0|r)?0:25-(r>>>1)|0),t=0|_e[n>>2];;){if((-8&_e[t+4>>2]|0)==(0|i)){m=194;break}if(!(r=0|_e[(n=t+16+(e>>>31<<2)|0)>>2])){m=193;break}e<<=1,t=r}if(193==(0|m)){_e[n>>2]=l,_e[l+24>>2]=t,_e[l+12>>2]=l,_e[l+8>>2]=l;break}if(194==(0|m)){S=0|_e[(m=t+8|0)>>2],_e[S+12>>2]=l,_e[m>>2]=l,_e[l+8>>2]=S,_e[l+12>>2]=t,_e[l+24>>2]=0;break}}else S=(0|_e[1147])+u|0,_e[1147]=S,_e[1150]=l,_e[l+4>>2]=1|S}while(0);return Te=P,0|(S=s+8|0)}for(r=5024;!((e=0|_e[r>>2])>>>0<=f>>>0&&f>>>0<(S=e+(0|_e[r+4>>2])|0)>>>0);)r=0|_e[r+8>>2];for(i=S+-47|0,e=i+8|0,e=i+(0==(7&e|0)?0:0-e&7)|0,i=f+16|0,e=e>>>0<i>>>0?f:e,r=e+8|0,t=a+8|0,t=0==(7&t|0)?0:0-t&7,m=a+t|0,t=o+-40-t|0,_e[1150]=m,_e[1147]=t,_e[m+4>>2]=1|t,_e[m+t+4>>2]=40,_e[1151]=_e[1266],t=e+4|0,_e[t>>2]=27,_e[r>>2]=_e[1256],_e[r+4>>2]=_e[1257],_e[r+8>>2]=_e[1258],_e[r+12>>2]=_e[1259],_e[1256]=a,_e[1257]=o,_e[1259]=0,_e[1258]=r,r=e+24|0;_e[(r=(m=r)+4|0)>>2]=7,(m+8|0)>>>0<S>>>0;);if((0|e)!=(0|f)){if(a=e-f|0,_e[t>>2]=-2&_e[t>>2],_e[f+4>>2]=1|a,r=(_e[e>>2]=a)>>>3,a>>>0<256){t=4616+(r<<1<<2)|0,(e=0|_e[1144])&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=e|r,e=(r=t)+8|0),_e[e>>2]=f,_e[r+12>>2]=f,_e[f+8>>2]=r,_e[f+12>>2]=t;break}if(n=4880+((t=(r=a>>>8)?16777215<a>>>0?31:a>>>((t=14-((b=((S=r<<(m=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(t=((S<<=b)+245760|0)>>>16&2))+(S<<t>>>15)|0)+7|0)&1|t<<1:0)<<2)|0,_e[f+28>>2]=t,_e[f+20>>2]=0,!((r=(_e[i>>2]=0)|_e[1145])&(e=1<<t))){_e[1145]=r|e,_e[n>>2]=f,_e[f+24>>2]=n,_e[f+12>>2]=f,_e[f+8>>2]=f;break}for(e=a<<(31==(0|t)?0:25-(t>>>1)|0),t=0|_e[n>>2];;){if((-8&_e[t+4>>2]|0)==(0|a)){m=216;break}if(!(r=0|_e[(n=t+16+(e>>>31<<2)|0)>>2])){m=215;break}e<<=1,t=r}if(215==(0|m)){_e[n>>2]=f,_e[f+24>>2]=t,_e[f+12>>2]=f,_e[f+8>>2]=f;break}if(216==(0|m)){S=0|_e[(m=t+8|0)>>2],_e[S+12>>2]=f,_e[m>>2]=f,_e[f+8>>2]=S,_e[f+12>>2]=t,_e[f+24>>2]=0;break}}}else{for(S=0|_e[1148],0==(0|S)|a>>>0<S>>>0&&(_e[1148]=a),_e[1256]=a,_e[1257]=o,_e[1259]=0,_e[1153]=_e[1262],_e[1152]=-1,r=0;_e[(S=4616+(r<<1<<2)|0)+12>>2]=S,_e[S+8>>2]=S,r=r+1|0,32!=(0|r););m=a+(S=0==(7&(S=a+8|0)|0)?0:0-S&7)|0,S=o+-40-S|0,_e[1150]=m,_e[1147]=S,_e[m+4>>2]=1|S,_e[m+S+4>>2]=40,_e[1151]=_e[1266]}}while(0);if(c>>>0<(r=0|_e[1147])>>>0)return b=r-c|0,_e[1147]=b,m=(S=0|_e[1150])+c|0,_e[1150]=m,_e[m+4>>2]=1|b,_e[S+4>>2]=3|c,Te=P,0|(S=S+8|0)}return _e[(S=296)>>2]=12,Te=P,(S=0)|S}function D(e,r,t,n,i,a){e|=0,r=+r,t|=0,n|=0,i|=0,a|=0;var o,u=0,f=0,l=0,s=0,c=0,_=0,d=0,E=0,T=0,A=0,M=0,b=0,m=0,S=0,P=0,R=0,h=0,p=0,C=0,N=0,y=0,O=0,v=Te;Te=Te+560|0,l=v+8|0,y=O=(M=v)+524|0,N=(s=v+512|0)+12|(_e[M>>2]=0),ke(r),h=(0|L)<0?(r=-r,p=1,2087):(p=0!=(2049&i|0)&1,0==(2048&i|0)?0==(1&i|0)?2088:2093:2090),ke(r),C=2146435072&L;do{if(C>>>0<2146435072|2146435072==(0|C)&!1){if((u=0!=(E=2*(o=M,+ + +function e(r,t){r=+r;t|=0;var n=0,i=0,a=0;k[g>>3]=r;n=0|_e[g>>2];i=0|_e[g+4>>2];a=0|ye(0|n,0|i,52);switch(2047&a){case 0:n=0!=r?(r=+e(0x10000000000000000*r,t),(0|_e[t>>2])-64|0):0,_e[t>>2]=n;break;case 2047:break;default:_e[t>>2]=(2047&a)-1022,_e[g>>2]=n,_e[g+4>>2]=-2146435073&i|1071644672,r=+k[g>>3]}return+r}(+r,o|=0))))&&(_e[M>>2]=(0|_e[M>>2])-1),97==(0|(m=32|a))){d=0==(0|(T=32&a))?h:h+9|0,_=2|p,u=12-n|0;do{if(!(11<n>>>0|0==(0|u))){for(r=8;u=u+-1|0,r*=16,0!=(0|u););if(45==(0|ce[d>>0])){r=-(r+(-E-r));break}r=E+r-r;break}}while(r=E,0);for(f=0|_e[M>>2],u=(0|f)<0?0-f|0:f,u=0|fe(u,((0|u)<0)<<31>>31,N),(0|u)==(0|N)&&(ce[(u=s+11|0)>>0]=48),ce[u+-1>>0]=43+(f>>31&2),c=u+-2|0,ce[c>>0]=a+15,s=(0|n)<1,l=0==(8&i|0),u=O;C=~~r,f=u+1|0,ce[u>>0]=de[2122+C>>0]|T,r=16*(r-(0|C)),u=1!=(f-y|0)||l&s&0==r?f:(ce[f>>0]=46,u+2|0),0!=r;);C=u-y|0,se(e,32,t,u=(y=N-c|0)+_+(N=0!=(0|n)&(C+-2|0)<(0|n)?n+2|0:C)|0,i),Ie(e,d,_),se(e,48,t,u,65536^i),Ie(e,O,C),se(e,48,N-C|0,0,0),Ie(e,c,y),se(e,32,t,u,8192^i);break}for(f=(0|n)<0?6:n,u?(u=(0|_e[M>>2])-28|0,_e[M>>2]=u,r=268435456*E):(r=E,u=0|_e[M>>2]),C=(0|u)<0?l:l+288|0,l=C;P=~~r>>>0,_e[l>>2]=P,l=l+4|0,r=1e9*(r-(P>>>0)),0!=r;);if(0<(0|u))for(s=C,_=l;;){if(c=(0|u)<29?u:29,s>>>0<=(u=_+-4|0)>>>0){for(l=0;b=0|he(0|(S=0|ge(0|(S=0|Ne(0|_e[u>>2],0,0|c)),0|L,0|l,0)),0|(P=L),1e9,0),_e[u>>2]=b,l=0|Fe(0|S,0|P,1e9,0),u=u+-4|0,s>>>0<=u>>>0;);l&&(_e[(s=s+-4|0)>>2]=l)}for(l=_;!(l>>>0<=s>>>0||0|_e[(u=l+-4|0)>>2]);)l=u;if(u=(0|_e[M>>2])-c|0,!(0<(0|(_e[M>>2]=u))))break;_=l}else s=C;if((0|u)<0){n=1+((f+25|0)/9|0)|0,A=102==(0|m);do{if(T=(0|(T=0-u|0))<9?T:9,s>>>0<l>>>0){for(c=(1<<T)-1|0,_=1e9>>>T,d=0,u=s;P=0|_e[u>>2],_e[u>>2]=(P>>>T)+d,d=0|ie(P&c,_),u=u+4|0,u>>>0<l>>>0;);u=0==(0|_e[s>>2])?s+4|0:s,u=d?(_e[l>>2]=d,s=u,l+4|0):(s=u,l)}else s=0==(0|_e[s>>2])?s+4|0:s,u=l}while(l=(0|n)<(u-(l=A?C:s)>>2|0)?l+(n<<2)|0:u,u=(0|_e[M>>2])+T|0,(0|(_e[M>>2]=u))<0);u=s,n=l}else u=s,n=l;if(P=C,u>>>0<n>>>0){if(l=9*(P-u>>2)|0,10<=(c=0|_e[u>>2])>>>0)for(s=10;s=10*s|0,l=l+1|0,s>>>0<=c>>>0;);}else l=0;if((0|(s=f-(102!=(0|m)?l:0)+(((b=0!=(0|f))&(A=103==(0|m)))<<31>>31)|0))<((9*(n-P>>2)|0)-9|0)){if(T=C+4+(((0|(s=s+9216|0))/9|0)-1024<<2)|0,(0|(s=1+((0|s)%9|0)|0))<9)for(c=10;c=10*c|0,s=s+1|0,9!=(0|s););else c=10;if((s=(T+4|0)==(0|n))&0==(0|(d=((_=0|_e[T>>2])>>>0)%(c>>>0)|0)))s=T;else if(E=0==(1&((_>>>0)/(c>>>0)|0)|0)?9007199254740992:9007199254740994,r=d>>>0<(S=(0|c)/2|0)>>>0?.5:s&(0|d)==(0|S)?1:1.5,p&&(r=(S=45==(0|ce[h>>0]))?-r:r,E=S?-E:E),s=_-d|0,_e[T>>2]=s,E+r!=E){if(S=s+c|0,999999999<(_e[T>>2]=S)>>>0)for(l=T;(s=l+-4|0)>>>(_e[l>>2]=0)<u>>>0&&(_e[(u=u+-4|0)>>2]=0),S=1+(0|_e[s>>2])|0,999999999<(_e[s>>2]=S)>>>0;)l=s;else s=T;if(l=9*(P-u>>2)|0,10<=(_=0|_e[u>>2])>>>0)for(c=10;c=10*c|0,l=l+1|0,c>>>0<=_>>>0;);}else s=T;s=(s=s+4|0)>>>0<n>>>0?s:n,S=u}else s=n,S=u;for(m=s;;){if(m>>>0<=S>>>0){M=0;break}if(0|_e[(u=m+-4|0)>>2]){M=1;break}m=u}n=0-l|0;do{if(A){if(f=(0|l)<(0|(u=(1&(1^b))+f|0))&-5<(0|l)?(c=a+-1|0,u+-1-l|0):(c=a+-2|0,u+-1|0),!(u=8&i)){if(M&&0!=(0|(R=0|_e[m+-4>>2])))if((R>>>0)%10|0)s=0;else for(s=0,u=10;u=10*u|0,s=s+1|0,!((R>>>0)%(u>>>0)|0););else s=9;if(u=(9*(m-P>>2)|0)-9|0,102==(32|c)){f=(0|f)<(0|(T=0<(0|(T=u-s|0))?T:0))?f:T,T=0;break}f=(0|f)<(0|(T=0<(0|(T=u+l-s|0))?T:0))?f:T,T=0;break}T=u}else c=a,T=8&i}while(0);if(_=0!=(0|(A=f|T))&1,d=102==(32|c))u=(b=0)<(0|l)?l:0;else{if(((s=N)-(u=0|fe(u=(0|l)<0?n:l,((0|u)<0)<<31>>31,N))|0)<2)for(;ce[(u=u+-1|0)>>0]=48,(s-u|0)<2;);ce[u+-1>>0]=43+(l>>31&2),ce[(u=u+-2|0)>>0]=c,u=s-(b=u)|0}if(se(e,32,t,u=p+1+f+_+u|0,i),Ie(e,h,p),se(e,48,t,u,65536^i),d){_=T=O+9|0,d=O+8|0,s=c=C>>>0<S>>>0?C:S;do{if(l=0|fe(0|_e[s>>2],0,T),(0|s)==(0|c))(0|l)==(0|T)&&(ce[d>>0]=48,l=d);else if(O>>>0<l>>>0)for(ne(0|O,48,l-y|0);l=l+-1|0,O>>>0<l>>>0;);}while(Ie(e,l,_-l|0),(s=s+4|0)>>>0<=C>>>0);if(0|A&&Ie(e,2138,1),s>>>0<m>>>0&0<(0|f))for(;;){if(O>>>0<(l=0|fe(0|_e[s>>2],0,T))>>>0)for(ne(0|O,48,l-y|0);l=l+-1|0,O>>>0<l>>>0;);if(Ie(e,l,(0|f)<9?f:9),l=f+-9|0,!((s=s+4|0)>>>0<m>>>0&9<(0|f))){f=l;break}f=l}se(e,48,f+9|0,9,0)}else{if(A=M?m:S+4|0,-1<(0|f)){T=0==(0|T),n=M=O+9|0,_=0-y|0,d=O+8|0,c=S;do{(0|(l=0|fe(0|_e[c>>2],0,M)))==(0|M)&&(ce[d>>0]=48,l=d);do{if((0|c)==(0|S)){if(s=l+1|0,Ie(e,l,1),T&(0|f)<1){l=s;break}Ie(e,2138,1),l=s}else{if(l>>>0<=O>>>0)break;for(ne(0|O,48,l+_|0);l=l+-1|0,O>>>0<l>>>0;);}}while(0)}while(Ie(e,l,(0|(y=n-l|0))<(0|f)?y:f),(c=c+4|0)>>>0<A>>>0&-1<(0|(f=f-y|0)))}se(e,48,f+18|0,18,0),Ie(e,b,N-b|0)}se(e,32,t,u,8192^i)}else O=0!=(32&a|0),se(e,32,t,u=p+3|0,-65537&i),Ie(e,h,p),Ie(e,r!=r|!1?O?2114:2118:O?2106:2110,3),se(e,32,t,u,8192^i)}while(0);return Te=v,0|((0|u)<(0|t)?t:u)}function w(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;var a,o,u,f,l,s,c,_,d,E=0,T=0,A=0,M=0,b=0,m=0,S=0,P=0,R=0,h=0,p=0,C=0,N=0,y=Te;Te=Te+64|0,f=(c=y)+24|0,_=y+8|0,d=y+20|0,_e[(s=y+16|0)>>2]=r,a=0!=(0|e),u=o=40+f|0,f=39+f|0,l=4+_|0,m=E=T=0;e:for(;;){do{if(-1<(0|E)){if((2147483647-E|0)<(0|T)){_e[(E=296)>>2]=75,E=-1;break}E=T+E|0;break}}while(0);if(!((T=0|ce[r>>0])<<24>>24)){N=87;break}A=r;r:for(;;){switch(T<<24>>24){case 37:T=A,N=9;break r;case 0:T=A;break r}C=A+1|0,_e[s>>2]=C,T=0|ce[C>>0],A=C}r:do{if(9==(0|N))for(;;){if(37!=((N=0)|ce[A+1>>0]))break r;if(T=T+1|0,A=A+2|0,_e[s>>2]=A,37!=(0|ce[A>>0]))break;N=9}}while(0);if(T=T-r|0,a&&Ie(e,r,T),0|T)r=A;else{(T=(0|ce[(M=A+1|0)>>0])-48|0)>>>0<10?(p=(C=36==(0|ce[A+2>>0]))?T:-1,m=C?1:m,M=C?A+3|0:M):p=-1,_e[s>>2]=M,A=((T=0|ce[M>>0])<<24>>24)-32|0;r:do{if(A>>>0<32)for(b=0,S=T;;){if(!(75913&(T=1<<A))){T=S;break r}if(b|=T,M=M+1|0,_e[s>>2]=M,32<=(A=((T=0|ce[M>>0])<<24>>24)-32|0)>>>0)break;S=T}else b=0}while(0);if(T<<24>>24==42){if((T=(0|ce[(A=M+1|0)>>0])-48|0)>>>0<10&&36==(0|ce[M+2>>0]))_e[i+(T<<2)>>2]=10,T=0|_e[n+((0|ce[A>>0])-48<<3)>>2],m=1,M=M+3|0;else{if(0|m){E=-1;break}M=(m=a?(m=3+(0|_e[t>>2])&-4,T=0|_e[m>>2],_e[t>>2]=m+4,0):T=0,A)}_e[s>>2]=M,T=(C=(0|T)<0)?0-T|0:T,b=C?8192|b:b}else{if((0|(T=0|Se(s)))<0){E=-1;break}M=0|_e[s>>2]}do{if(46==(0|ce[M>>0])){if(42!=(0|ce[M+1>>0])){_e[s>>2]=M+1,A=0|Se(s),M=0|_e[s>>2];break}if((A=(0|ce[(S=M+2|0)>>0])-48|0)>>>0<10&&36==(0|ce[M+3>>0])){_e[i+(A<<2)>>2]=10,A=0|_e[n+((0|ce[S>>0])-48<<3)>>2],M=M+4|0,_e[s>>2]=M;break}if(0|m){E=-1;break e}a?(C=3+(0|_e[t>>2])&-4,A=0|_e[C>>2],_e[t>>2]=C+4):A=0,M=_e[s>>2]=S}else A=-1}while(0);for(h=0;;){if(57<((0|ce[M>>0])-65|0)>>>0){E=-1;break e}if(C=M+1|0,_e[s>>2]=C,!(((P=255&(S=0|ce[(0|ce[M>>0])-65+(1606+(58*h|0))>>0]))+-1|0)>>>0<8))break;h=P,M=C}if(!(S<<24>>24)){E=-1;break}R=-1<(0|p);do{if(S<<24>>24==19){if(R){E=-1;break e}N=49}else{if(R){_e[i+(p<<2)>>2]=P,p=0|_e[(R=n+(p<<3)|0)+4>>2],_e[(N=c)>>2]=_e[R>>2],_e[N+4>>2]=p,N=49;break}if(!a){E=0;break e}H(c,P,t)}}while(0);if(49!=(0|N)||(N=0,a)){M=0!=(0|h)&3==(15&(M=0|ce[M>>0])|0)?-33&M:M,R=-65537&b,p=0==(8192&b|0)?b:R;r:do{switch(0|M){case 110:switch((255&h)<<24>>24){case 0:case 1:_e[_e[c>>2]>>2]=E,T=0,r=C;continue e;case 2:T=0|_e[c>>2],_e[T>>2]=E,_e[T+4>>2]=((0|E)<0)<<31>>31,T=0,r=C;continue e;case 3:W[_e[c>>2]>>1]=E,T=0,r=C;continue e;case 4:ce[_e[c>>2]>>0]=E,T=0,r=C;continue e;case 6:_e[_e[c>>2]>>2]=E,T=0,r=C;continue e;case 7:T=0|_e[c>>2],_e[T>>2]=E,_e[T+4>>2]=((0|E)<0)<<31>>31,T=0,r=C;continue e;default:T=0,r=C;continue e}case 112:M=120,A=8<A>>>0?A:8,r=8|p,N=61;break;case 88:case 120:r=p,N=61;break;case 111:S=2070,A=(b=0)==(8&p|0)|(0|(R=u-(P=0|function(e,r,t){if(t|=0,!(0==(0|(e|=0))&0==(0|(r|=0))))for(;ce[(t=t+-1|0)>>0]=7&e|48,e=0|ye(0|e,0|r,3),r=L,!(0==(0|e)&0==(0|r)););return 0|t}(r=0|_e[(M=c)>>2],M=0|_e[M+4>>2],o))|0))<(0|A)?A:R+1|0,R=p,N=67;break;case 105:case 100:if(r=0|_e[(M=c)>>2],(0|(M=0|_e[M+4>>2]))<0){r=0|ve(0,0,0|r,0|M),M=L,_e[(b=c)>>2]=r,_e[b+4>>2]=M,b=1,S=2070,N=66;break r}b=0!=(2049&p|0)&1,S=0==(2048&p|0)?0==(1&p|0)?2070:2072:2071,N=66;break r;case 117:S=2070,r=(b=0)|_e[(M=c)>>2],M=0|_e[M+4>>2],N=66;break;case 99:ce[f>>0]=_e[c>>2],r=f,b=0,S=2070,P=o,M=1,A=R;break;case 109:M=0|(0|function(e,r){e|=0,r|=0;var t=0,n=0;n=0;for(;;){if((0|de[2140+n>>0])==(0|e)){e=2;break}if(87==(0|(t=n+1|0))){t=2228,n=87,e=5;break}n=t}2==(0|e)&&(n?(t=2228,e=5):t=2228);if(5==(0|e))for(;;){for(;t=(e=t)+1|0,0!=(0|ce[e>>0]););if(!(n=n+-1|0))break;e=5}return 0|function(e,r){return 0|function(e,r){e|=0,r=(r|=0)?0|function(e,r,t){r|=0,t|=0;var n=0,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0;_=1794895138+(0|_e[(e|=0)>>2])|0,a=0|Ge(0|_e[e+8>>2],_),n=0|Ge(0|_e[e+12>>2],_),i=0|Ge(0|_e[e+16>>2],_);t:do{if(a>>>0<r>>>2>>>0&&(c=r-(a<<2)|0,n>>>0<c>>>0&i>>>0<c>>>0)&&0==(3&(i|n)|0)){for(c=n>>>2,s=i>>>2,l=0;;){if(n=0|Ge(0|_e[e+((i=(o=(f=l+(u=a>>>1)|0)<<1)+c|0)<<2)>>2],_),!((i=0|Ge(0|_e[e+(i+1<<2)>>2],_))>>>0<r>>>0&n>>>0<(r-i|0)>>>0)){n=0;break t}if(0|ce[e+(i+n)>>0]){n=0;break t}if(!(n=0|function(e,r){r|=0;var t=0,n=0;if(t=0|ce[(e|=0)>>0],n=0|ce[r>>0],t<<24>>24==0||t<<24>>24!=n<<24>>24)e=n;else{for(;r=r+1|0,t=0|ce[(e=e+1|0)>>0],n=0|ce[r>>0],t<<24>>24!=0&&t<<24>>24==n<<24>>24;);e=n}return(255&t)-(255&e)|0}(t,e+i|0)))break;if(n=(0|n)<0,1==(0|a)){n=0;break t}l=n?l:f,a=n?u:a-u|0}i=0|Ge(0|_e[e+((n=o+s|0)<<2)>>2],_),n=(n=0|Ge(0|_e[e+(n+1<<2)>>2],_))>>>0<r>>>0&i>>>0<(r-n|0)>>>0&&0==(0|ce[e+(n+i)>>0])?e+n|0:0}else n=0}while(0);return 0|n}(0|_e[r>>2],0|_e[r+4>>2],e):0;return 0|(0|r?r:e)}(e|=0,r|=0)}(t,0|_e[r+20>>2])}(0|_e[(M=296)>>2]|0,0|_e[105])),N=71;break;case 115:M=0|(M=0|_e[c>>2])?M:2080,N=71;break;case 67:_e[_>>2]=_e[c>>2],_e[l>>2]=0,P=-1,M=_e[c>>2]=_,N=75;break;case 83:r=0|_e[c>>2],N=A?(P=A,M=r,75):(se(e,32,T,0,p),r=0,84);break;case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:T=0|D(e,+k[c>>3],T,A,p,M),r=C;continue e;default:b=0,S=2070,P=o,M=A,A=p}}while(0);r:do{if(61==(0|N))P=0|function(e,r,t,n){if(t|=0,n|=0,!(0==(0|(e|=0))&0==(0|(r|=0))))for(;ce[(t=t+-1|0)>>0]=0|de[2122+(15&e)>>0]|n,e=0|ye(0|e,0|r,4),r=L,!(0==(0|e)&0==(0|r)););return 0|t}(h=0|_e[(p=c)>>2],p=0|_e[p+4>>2],o,32&M),b=(S=0==(8&r|0)|0==(0|h)&0==(0|p))?0:2,S=S?2070:2070+(M>>4)|0,R=r,r=h,M=p,N=67;else if(66==(0|N))P=0|fe(r,M,o),R=p,N=67;else if(71==(0|N))S=2070,P=(h=(b=N=0)==(0|(p=0|function(e,r,t){e|=0;var n=0,i=0,a=0,o=0;a=255&(r|=0),n=0!=(0|(t|=0));t:do{if(n&0!=(3&e|0))for(i=255&r;;){if((0|ce[e>>0])==i<<24>>24){o=6;break t}if(!((n=0!=(0|(t=t+-1|0)))&0!=(3&(e=e+1|0)|0))){o=5;break}}else o=5}while(0);5==(0|o)&&(n?o=6:t=0);t:do{if(6==(0|o)&&(i=255&r,(0|ce[e>>0])!=i<<24>>24)){n=0|ie(a,16843009);n:do{if(3<t>>>0){for(;!((-2139062144&(a=_e[e>>2]^n)^-2139062144)&a+-16843009|0);)if(e=e+4|0,(t=t+-4|0)>>>0<=3){o=11;break n}}else o=11}while(0);if(11==(0|o)&&!t){t=0;break}for(;;){if((0|ce[e>>0])==i<<24>>24)break t;if(e=e+1|0,!(t=t+-1|0)){t=0;break}}}}while(0);return 0|(0|t?e:0)}(r=M,0,A))))?M+A|0:p,M=h?A:p-M|0,A=R;else if(75==(0|N)){for(S=M,A=r=N=0;(b=0|_e[S>>2])&&!((0|(A=0|De(d,b)))<0|(P-r|0)>>>0<A>>>0)&&(r=A+r|0)>>>0<P>>>0;)S=S+4|0;if((0|A)<0){E=-1;break e}if(se(e,32,T,r,p),r)for(b=0;;){if(!(A=0|_e[M>>2])){N=84;break r}if((0|r)<(0|(b=(A=0|De(d,A))+b|0))){N=84;break r}if(Ie(e,d,A),r>>>0<=b>>>0){N=84;break}M=M+4|0}else r=0,N=84}}while(0);if(67==(0|N))p=(N=0)!=(0|A)|(M=0!=(0|r)|0!=(0|M)),M=u-P+(1&(1^M))|0,r=p?P:o,P=o,M=!p||(0|M)<(0|A)?A:M,A=-1<(0|A)?-65537&R:R;else if(84==(0|N)){N=0,se(e,32,T,r,8192^p),T=(0|r)<(0|T)?T:r,r=C;continue}se(e,32,T=(0|T)<(0|(p=(R=(0|M)<(0|(h=P-r|0))?h:M)+b|0))?p:T,p,A),Ie(e,S,b),se(e,48,T,p,65536^A),se(e,48,R,h,0),Ie(e,r,h),se(e,32,T,p,8192^A),r=C}else T=0,r=C}}e:do{if(87==(0|N)&&!e)if(m){for(E=1;r=0|_e[i+(E<<2)>>2];)if(H(n+(E<<3)|0,r,t),10<=(0|(E=E+1|0))){E=1;break e}for(;;){if(0|_e[i+(E<<2)>>2]){E=-1;break e}if(10<=(0|(E=E+1|0))){E=1;break}}}else E=0}while(0);return Te=y,0|E}function V(e,r){r|=0;var t,n,i,a,o,u,f,l,s,c,_,d,E,T,A=0,M=0,b=0,m=0,S=0,P=0,R=0,h=0,p=0,C=0,N=Te;if(Te=Te+704|0,E=N+144|0,d=N+128|0,_=N+112|0,c=N+96|0,s=N+80|0,l=N+64|0,f=N+48|0,T=N+32|0,t=N+16|0,i=(P=N)+184|0,C=N+160|0,!(a=0|function(e,r){e|=0;var t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0;if(Te=(l=Te)+528|0,a=(o=l)+16|0,!(r|=0))return Te=l,(f=0)|f;if(r>>>0<=16)return f=0|Q(e,r),Te=l,0|f;if(u=0|Q(e,r+-16|0),(0|(r=0|_e[(f=e+20|0)>>2]))<16)for(n=e+4|0,i=e+8|0,t=e+16|0;e=(0|(e=0|_e[n>>2]))==(0|_e[i>>2])?0:(_e[n>>2]=e+1,0|de[e>>0]),r=r+8|0,33<=(0|(_e[f>>2]=r))&&(_e[o>>2]=866,_e[o+4>>2]=3208,_e[o+8>>2]=1366,Ce(a,812,o),Me(a),r=0|_e[f>>2]),e=e<<32-r|_e[t>>2],_e[t>>2]=e,(0|r)<16;);else e=0|_e[(t=e=e+16|0)>>2];return _e[t>>2]=e<<16,_e[f>>2]=r+-16,Te=l,0|(f=e>>>16|u<<16)}(e|=0,14)))return function(e){var r=0,t=0,n=0,i=0,a=0,o=0;Te=(o=Te)+544|0,a=o+16|0,i=(n=o)+32|0,(_e[(e|=0)>>2]=0)|(t=0|_e[(r=e+4|0)>>2])&&(7&t?(_e[n>>2]=866,_e[n+4>>2]=2506,_e[n+8>>2]=1232,Ce(i,812,n),Me(i)):ue(t,0,0,1,0),_e[r>>2]=0,_e[e+8>>2]=0,_e[e+12>>2]=0);if(ce[e+16>>0]=0,!(r=0|_e[(e=e+20|0)>>2]))return Te=o;Z(r),7&r?(_e[a>>2]=866,_e[4+a>>2]=2506,_e[8+a>>2]=1232,Ce(i,812,a),Me(i)):ue(r,0,0,1,0);_e[e>>2]=0,Te=o}(r),Te=N,0|(C=1);if(o=r+4|0,(0|(A=0|_e[(u=r+8|0)>>2]))!=(0|a)){if(A>>>0<=a>>>0){do{if((0|_e[r+12>>2])>>>0<a>>>0){if(0|X(o,a,(A+1|0)==(0|a),1,0)){A=0|_e[u>>2];break}return ce[r+16>>0]=1,Te=N,(C=0)|C}}while(0);ne((0|_e[o>>2])+A|0,0,a-A|0)}_e[u>>2]=a}if(ne(0|_e[o>>2],0,0|a),(0|(A=0|_e[(n=e+20|0)>>2]))<5)for(m=e+4|0,S=e+8|0,b=e+16|0;M=(0|(M=0|_e[m>>2]))==(0|_e[S>>2])?0:(_e[m>>2]=M+1,0|de[M>>0]),A=A+8|0,33<=(0|(_e[n>>2]=A))&&(_e[P>>2]=866,_e[P+4>>2]=3208,_e[P+8>>2]=1366,Ce(i,812,P),Me(i),A=0|_e[n>>2]),M=M<<32-A|_e[b>>2],_e[b>>2]=M,(0|A)<5;);else M=0|_e[(b=M=e+16|0)>>2];if(h=M>>>27,_e[b>>2]=M<<5,_e[n>>2]=A+-5,20<(h+-1|0)>>>0)return Te=N,(C=0)|C;_e[C+20>>2]=0,_e[C>>2]=0,_e[C+4>>2]=0,_e[C+8>>2]=0,_e[C+12>>2]=0,A=C+4|(ce[C+16>>0]=0),M=C+8|0;e:do{if(0|X(A,21,0,1,0)){m=0|_e[M>>2],ne((R=0|_e[A>>2])+m|0,0,21-m|0),_e[M>>2]=21,m=e+4|0,S=e+8|0,P=e+16|0,b=0;do{if((0|(A=0|_e[n>>2]))<3)for(;M=(0|(M=0|_e[m>>2]))==(0|_e[S>>2])?0:(_e[m>>2]=M+1,0|de[M>>0]),A=A+8|0,33<=(0|(_e[n>>2]=A))&&(_e[t>>2]=866,_e[4+t>>2]=3208,_e[8+t>>2]=1366,Ce(i,812,t),Me(i),A=0|_e[n>>2]),M=M<<32-A|_e[P>>2],_e[P>>2]=M,(0|A)<3;);else M=0|_e[P>>2]}while(_e[P>>2]=M<<3,_e[n>>2]=A+-3,ce[R+(0|de[1327+b>>0])>>0]=M>>>29,(0|(b=b+1|0))!=(0|h));if(0|$(C)){P=e+4|0,R=e+8|0,h=e+16|0,A=0;r:do{S=a-A|0,b=0|Ae(e,C);t:do{if(b>>>0<17)(0|_e[u>>2])>>>0<=A>>>0&&(_e[T>>2]=866,_e[4+T>>2]=910,_e[8+T>>2]=1497,Ce(i,812,T),Me(i)),ce[(0|_e[o>>2])+A>>0]=b,A=A+1|0;else switch(0|b){case 17:if((0|(M=0|_e[n>>2]))<3)for(;b=(0|(b=0|_e[P>>2]))==(0|_e[R>>2])?0:(_e[P>>2]=b+1,0|de[b>>0]),M=M+8|0,33<=(0|(_e[n>>2]=M))&&(_e[f>>2]=866,_e[4+f>>2]=3208,_e[8+f>>2]=1366,Ce(i,812,f),Me(i),M=0|_e[n>>2]),b=b<<32-M|_e[h>>2],_e[h>>2]=b,(0|M)<3;);else b=0|_e[h>>2];if(_e[h>>2]=b<<3,_e[n>>2]=M+-3,M=S>>>0<(b=3+(b>>>29)|0)>>>0){A=0;break e}A=(M?0:b)+A|0;break t;case 18:if((0|(M=0|_e[n>>2]))<7)for(;b=(0|(b=0|_e[P>>2]))==(0|_e[R>>2])?0:(_e[P>>2]=b+1,0|de[b>>0]),M=M+8|0,33<=(0|(_e[n>>2]=M))&&(_e[l>>2]=866,_e[4+l>>2]=3208,_e[8+l>>2]=1366,Ce(i,812,l),Me(i),M=0|_e[n>>2]),b=b<<32-M|_e[h>>2],_e[h>>2]=b,(0|M)<7;);else b=0|_e[h>>2];if(_e[h>>2]=b<<7,_e[n>>2]=M+-7,M=S>>>0<(b=11+(b>>>25)|0)>>>0){A=0;break e}A=(M?0:b)+A|0;break t;default:if(2<=(b+-19|0)>>>0){p=81;break r}if(M=0|_e[n>>2],19==(0|b)){if((0|M)<2)for(b=M;m=(0|(M=0|_e[P>>2]))==(0|_e[R>>2])?0:(_e[P>>2]=M+1,0|de[M>>0]),M=b+8|0,33<=(0|(_e[n>>2]=M))&&(_e[s>>2]=866,_e[4+s>>2]=3208,_e[8+s>>2]=1366,Ce(i,812,s),Me(i),M=0|_e[n>>2]),b=m<<32-M|_e[h>>2],_e[h>>2]=b,(0|M)<2;)b=M;else b=0|_e[h>>2];_e[h>>2]=b<<2,b>>>=30,m=3,M=M+-2|0}else{if((0|M)<6)for(;b=(0|(b=0|_e[P>>2]))==(0|_e[R>>2])?0:(_e[P>>2]=b+1,0|de[b>>0]),M=M+8|0,33<=(0|(_e[n>>2]=M))&&(_e[c>>2]=866,_e[4+c>>2]=3208,_e[8+c>>2]=1366,Ce(i,812,c),Me(i),M=0|_e[n>>2]),b=b<<32-M|_e[h>>2],_e[h>>2]=b,(0|M)<6;);else b=0|_e[h>>2];_e[h>>2]=b<<6,b>>>=26,m=7,M=M+-6|0}if(_e[n>>2]=M,0==(0|A)|S>>>0<(b=b+m|0)>>>0){A=0;break e}if(M=A+-1|0,(0|_e[u>>2])>>>0<=M>>>0&&(_e[_>>2]=866,_e[4+_>>2]=910,_e[8+_>>2]=1497,Ce(i,812,_),Me(i)),!((m=0|ce[(0|_e[o>>2])+M>>0])<<24>>24)){A=0;break e}if((M=b+A|0)>>>0<=A>>>0)break t;for(;(0|_e[u>>2])>>>0<=A>>>0&&(_e[d>>2]=866,_e[4+d>>2]=910,_e[8+d>>2]=1497,Ce(i,812,d),Me(i)),ce[(0|_e[o>>2])+A>>0]=m,A=A+1|0,(0|A)!=(0|M););A=M}}while(0)}while(A>>>0<a>>>0);if(81==(0|p)){_e[E>>2]=866,_e[4+E>>2]=3149,_e[8+E>>2]=1348,Ce(i,812,E),Me(i),A=0;break}A=(0|a)==(0|A)?0|$(r):0}else A=0}else ce[C+16>>0]=1,A=0}while(0);return re(C),Te=N,0|(C=A)}function G(e,r,t,n){e|=0,t|=0;var i,a,o,u,f,l,s,c,_=0,d=0,E=0,T=0,A=0,M=0,b=0,m=0,S=0,P=0,R=0,h=0,p=0,C=0,N=0,y=0,O=0,v=0,k=0,g=Te;if(Te=Te+880|0,v=g+144|0,c=g+128|0,s=g+112|0,l=g+96|0,y=g+80|0,C=g+64|0,h=g+48|0,p=g+32|0,m=g+16|0,u=(b=g)+360|0,f=g+296|0,k=g+224|0,R=g+156|0,0==(0|(r|=0))|11<(n|=0)>>>0)return Te=g,(k=0)|k;for(_e[e>>2]=r,_=k,d=_+68|0;_=_+4|(_e[_>>2]=0),(0|_)<(0|d););for(_=0;d=k+((255&(O=0|ce[t+_>>0]))<<2)|0,O<<24>>24&&(_e[d>>2]=1+(0|_e[d>>2])),_=_+1|0,(0|_)!=(0|r););for(T=E=d=0,A=-1,M=1;(_=0|_e[k+(M<<2)>>2])?(d=_+(_e[f+((S=M+-1|0)<<2)>>2]=d)|0,O=16-M|0,_e[e+28+(S<<2)>>2]=1+(d+-1<<O|(1<<O)-1),_e[e+96+(S<<2)>>2]=E,S=_+(_e[R+(M<<2)>>2]=E)|0,T=M>>>0<T>>>0?T:M,A=A>>>0<M>>>0?A:M):(_e[e+28+(M+-1<<2)>>2]=0,S=E),17!=(0|(M=M+1|0));)d<<=1,E=S;_e[e+4>>2]=S,d=e+172|0;do{if(S>>>0>(0|_e[d>>2])>>>0){_=(_=S+-1|0)&S?(_|=_>>>16,_|=_>>>8,_|=_>>>4,r>>>0<(_=1+((_|=_>>>2)>>>1|_)|0)>>>0?r:_):S,_e[d>>2]=_,_=0|_e[(E=e+176|0)>>2];do{if(0|_){if(O=0|_e[_+-4>>2],_=_+-8|0,0!=(0|O)&&(0|O)==(0|~_e[_>>2])||(_e[b>>2]=866,_e[b+4>>2]=651,_e[b+8>>2]=1579,Ce(u,812,b),Me(u)),7&_){_e[m>>2]=866,_e[m+4>>2]=2506,_e[m+8>>2]=1232,Ce(u,812,m),Me(u);break}ue(_,0,0,1,0);break}}while(0);if(d=0|te(8+((_=0|(_=0|_e[d>>2])?_:1)<<1)|0,0)){_e[d+4>>2]=_,_e[d>>2]=~_,_e[E>>2]=d+8,P=24;break}n=_e[E>>2]=0;break}}while(P=24,0);e:do{if(24==(0|P)){for(O=e+24|0,ce[O>>0]=A,ce[e+25>>0]=T,E=e+176|0,d=0;_=255&(N=0|ce[t+d>>0]),N<<24>>24&&(0|_e[k+(_<<2)>>2]||(_e[p>>2]=866,_e[p+4>>2]=2276,_e[p+8>>2]=977,Ce(u,812,p),Me(u)),_=0|_e[(N=R+(_<<2)|0)>>2],_e[N>>2]=_+1,S>>>0<=_>>>0&&(_e[h>>2]=866,_e[h+4>>2]=2280,_e[h+8>>2]=990,Ce(u,812,h),Me(u)),W[(0|_e[E>>2])+(_<<1)>>1]=d),d=d+1|0,(0|d)!=(0|r););if(o=(0|de[O>>0])>>>0<n>>>0?n:0,a=0!=(0|(_e[(N=e+8|0)>>2]=o))){i=1<<o,_=e+164|0;do{if(i>>>0>(0|_e[_>>2])>>>0){_e[_>>2]=i,_=0|_e[(E=e+168|0)>>2];do{if(0|_){if(p=0|_e[_+-4>>2],_=_+-8|0,0!=(0|p)&&(0|p)==(0|~_e[_>>2])||(_e[C>>2]=866,_e[C+4>>2]=651,_e[C+8>>2]=1579,Ce(u,812,C),Me(u)),7&_){_e[y>>2]=866,_e[y+4>>2]=2506,_e[y+8>>2]=1232,Ce(u,812,y),Me(u);break}ue(_,0,0,1,0);break}}while(0);if(d=0|te((_=i<<2)+8|0,0)){y=d+8|0,_e[d+4>>2]=i,_e[d>>2]=~i,d=_e[E>>2]=y;break}n=_e[E>>2]=0;break e}}while(_=i<<2,d=0|_e[(E=d=e+168|0)>>2],0);ne(0|d,-1,0|_),h=e+176|0,R=1;do{if(0|_e[k+(R<<2)>>2]&&(C=1<<(p=o-R|0),d=0|_e[f+((_=R+-1|0)<<2)>>2],16<=_>>>0&&(_e[l>>2]=866,_e[4+l>>2]=1960,_e[8+l>>2]=1453,Ce(u,812,l),Me(u)),d>>>0<=(r=0==(0|(r=0|_e[e+28+(_<<2)>>2]))?-1:(r+-1|0)>>>(16-R|0))>>>0)){S=(0|_e[e+96+(_<<2)>>2])-d|0,P=R<<16;do{for(_=0|Ee[(0|_e[h>>2])+(S+d<<1)>>1],(0|de[t+_>>0])!=(0|R)&&(_e[s>>2]=866,_e[4+s>>2]=2322,_e[8+s>>2]=1019,Ce(u,812,s),Me(u)),m=d<<p,M=_|P,A=0;i>>>0<=(b=A+m|0)>>>0&&(_e[c>>2]=866,_e[4+c>>2]=2328,_e[8+c>>2]=1053,Ce(u,812,c),Me(u)),_=0|_e[E>>2],-1!=(0|_e[_+(b<<2)>>2])&&(_e[v>>2]=866,_e[v+4>>2]=2330,_e[v+8>>2]=1076,Ce(u,812,v),Me(u),_=0|_e[E>>2]),_e[_+(b<<2)>>2]=M,A=A+1|0,A>>>0<C>>>0;);}while((d=d+1|0)>>>0<=r>>>0)}}while((R=R+1|0)>>>0<=o>>>0)}_e[(_=e+96|0)>>2]=(0|_e[_>>2])-(0|_e[f>>2]),_e[(_=e+100|0)>>2]=(0|_e[_>>2])-(0|_e[4+f>>2]),_e[(_=e+104|0)>>2]=(0|_e[_>>2])-(0|_e[8+f>>2]),_e[(_=e+108|0)>>2]=(0|_e[_>>2])-(0|_e[12+f>>2]),_e[(_=e+112|0)>>2]=(0|_e[_>>2])-(0|_e[16+f>>2]),_e[(_=e+116|0)>>2]=(0|_e[_>>2])-(0|_e[20+f>>2]),_e[(_=e+120|0)>>2]=(0|_e[_>>2])-(0|_e[24+f>>2]),_e[(_=e+124|0)>>2]=(0|_e[_>>2])-(0|_e[28+f>>2]),_e[(_=e+128|0)>>2]=(0|_e[_>>2])-(0|_e[32+f>>2]),_e[(_=e+132|0)>>2]=(0|_e[_>>2])-(0|_e[36+f>>2]),_e[(_=e+136|0)>>2]=(0|_e[_>>2])-(0|_e[40+f>>2]),_e[(_=e+140|0)>>2]=(0|_e[_>>2])-(0|_e[44+f>>2]),_e[(_=e+144|0)>>2]=(0|_e[_>>2])-(0|_e[48+f>>2]),_e[(_=e+148|0)>>2]=(0|_e[_>>2])-(0|_e[52+f>>2]),_e[(_=e+152|0)>>2]=(0|_e[_>>2])-(0|_e[56+f>>2]),_e[(_=e+156|0)>>2]=(0|_e[_>>2])-(0|_e[60+f>>2]),_e[(_=e+16|0)>>2]=0,_e[(d=e+20|0)>>2]=de[O>>0];r:do{if(a){do{if(!n)break r}while(n=(v=n)+-1|0,!(0|_e[k+(v<<2)>>2]));if(_e[_>>2]=_e[e+28+(n<<2)>>2],n=o+1|0,(_e[d>>2]=n)>>>0<=T>>>0){for(;!(0|_e[k+(n<<2)>>2]);)if(T>>>0<(n=n+1|0)>>>0)break r;_e[d>>2]=n}}}while(0);_e[e+92>>2]=-1,_e[e+160>>2]=1048575,_e[e+12>>2]=32-(0|_e[N>>2]),n=1}}while(0);return Te=g,0|(k=n)}function F(e){var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=0;if(e|=0){t=e+-8|0,i=0|_e[1148],f=t+(r=-8&(e=0|_e[e+-4>>2]))|0;do{if(1&e)o=u=t;else{if(n=0|_e[t>>2],!(3&e))return;if(a=n+r|0,(o=t+(0-n)|0)>>>0<i>>>0)return;if((0|o)==(0|_e[1149])){if(3==(3&(r=0|_e[(e=f+4|0)>>2])|0))return _e[1146]=a,_e[e>>2]=-2&r,_e[o+4>>2]=1|a,void(_e[o+a>>2]=a);u=o,r=a;break}if(t=n>>>3,n>>>0<256){if(e=0|_e[o+8>>2],(0|(r=0|_e[o+12>>2]))==(0|e)){_e[1144]=_e[1144]&~(1<<t),u=o,r=a;break}_e[e+12>>2]=r,_e[r+8>>2]=e,u=o,r=a;break}i=0|_e[o+24>>2],e=0|_e[o+12>>2];do{if((0|e)==(0|o)){if(!(e=0|_e[(r=(t=o+16|0)+4|0)>>2])){if(!(e=0|_e[t>>2])){e=0;break}r=t}for(;;)if(0|(n=0|_e[(t=e+20|0)>>2]))e=n,r=t;else{if(!(n=0|_e[(t=e+16|0)>>2]))break;e=n,r=t}_e[r>>2]=0}else u=0|_e[o+8>>2],_e[u+12>>2]=e,_e[e+8>>2]=u}while(0);if(i){if(r=0|_e[o+28>>2],(0|o)==(0|_e[(t=4880+(r<<2)|0)>>2])){if(!(_e[t>>2]=e)){_e[1145]=_e[1145]&~(1<<r),u=o,r=a;break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|o)&1)<<2)>>2]=e)){u=o,r=a;break}_e[e+24>>2]=i,0|(t=0|_e[(r=o+16|0)>>2])&&(_e[e+16>>2]=t,_e[t+24>>2]=e),r=(u=((r=0|_e[r+4>>2])&&(_e[e+20>>2]=r,_e[r+24>>2]=e),o),a)}else u=o,r=a}}while(0);if(!(f>>>0<=o>>>0)&&1&(n=0|_e[(e=f+4|0)>>2])){if(2&n)_e[e>>2]=-2&n,_e[u+4>>2]=1|r,i=_e[o+r>>2]=r;else{if(e=0|_e[1149],(0|f)==(0|_e[1150]))return f=(0|_e[1147])+r|0,_e[1147]=f,_e[1150]=u,_e[u+4>>2]=1|f,(0|u)!=(0|e)?void 0:(_e[1149]=0,void(_e[1146]=0));if((0|f)==(0|e))return f=(0|_e[1146])+r|0,_e[1146]=f,_e[1149]=o,_e[u+4>>2]=1|f,void(_e[o+f>>2]=f);i=(-8&n)+r|0,t=n>>>3;do{if(n>>>0<256){if(r=0|_e[f+8>>2],(0|(e=0|_e[f+12>>2]))==(0|r)){_e[1144]=_e[1144]&~(1<<t);break}_e[r+12>>2]=e,_e[e+8>>2]=r;break}a=0|_e[f+24>>2],e=0|_e[f+12>>2];do{if((0|e)==(0|f)){if(!(e=0|_e[(r=(t=f+16|0)+4|0)>>2])){if(!(e=0|_e[t>>2])){t=0;break}r=t}for(;;)if(0|(n=0|_e[(t=e+20|0)>>2]))e=n,r=t;else{if(!(n=0|_e[(t=e+16|0)>>2]))break;e=n,r=t}_e[r>>2]=0,t=e}else t=0|_e[f+8>>2],_e[t+12>>2]=e,_e[e+8>>2]=t,t=e}while(0);if(0|a){if(e=0|_e[f+28>>2],(0|f)==(0|_e[(r=4880+(e<<2)|0)>>2])){if(!(_e[r>>2]=t)){_e[1145]=_e[1145]&~(1<<e);break}}else if(!(_e[a+16+(((0|_e[a+16>>2])!=(0|f)&1)<<2)>>2]=t))break;_e[t+24>>2]=a,0|(r=0|_e[(e=f+16|0)>>2])&&(_e[t+16>>2]=r,_e[r+24>>2]=t),0|(e=0|_e[e+4>>2])&&(_e[t+20>>2]=e,_e[e+24>>2]=t)}}while(0);if(_e[u+4>>2]=1|i,_e[o+i>>2]=i,(0|u)==(0|_e[1149]))return void(_e[1146]=i)}if(e=i>>>3,i>>>0<256)return t=4616+(e<<1<<2)|0,(r=0|_e[1144])&(e=1<<e)?e=0|_e[(r=t+8|0)>>2]:(_e[1144]=r|e,r=(e=t)+8|0),_e[r>>2]=u,_e[e+12>>2]=u,_e[u+8>>2]=e,void(_e[u+12>>2]=t);n=4880+((e=(e=i>>>8)?16777215<i>>>0?31:i>>>((e=14-((a=((f=e<<(o=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|o|(e=((f<<=a)+245760|0)>>>16&2))+(f<<e>>>15)|0)+7|0)&1|e<<1:0)<<2)|0,_e[u+28>>2]=e,_e[u+20>>2]=0,r=(_e[u+16>>2]=0)|_e[1145],t=1<<e;do{if(r&t){for(r=i<<(31==(0|e)?0:25-(e>>>1)|0),t=0|_e[n>>2];;){if((-8&_e[t+4>>2]|0)==(0|i)){e=73;break}if(!(e=0|_e[(n=t+16+(r>>>31<<2)|0)>>2])){e=72;break}r<<=1,t=e}if(72==(0|e)){_e[n>>2]=u,_e[u+24>>2]=t,_e[u+12>>2]=u,_e[u+8>>2]=u;break}if(73==(0|e)){f=0|_e[(o=t+8|0)>>2],_e[f+12>>2]=u,_e[o>>2]=u,_e[u+8>>2]=f,_e[u+12>>2]=t,_e[u+24>>2]=0;break}}else _e[1145]=r|t,_e[n>>2]=u,_e[u+24>>2]=n,_e[u+12>>2]=u,_e[u+8>>2]=u}while(0);if(f=(0|_e[1152])-1|0,!(_e[1152]=f)){for(e=5032;e=0|_e[e>>2];)e=e+8|0;_e[1152]=-1}}}}function x(e,r){var t=0,n=0,i=0,a=0,o=0,u=0,f=0,f=(e|=0)+(r|=0)|0,t=0|_e[e+4>>2];do{if(1&t)u=e,t=r;else{if(n=0|_e[e>>2],!(3&t))return;if(o=n+r|0,(0|(a=e+(0-n)|0))==(0|_e[1149])){if(3==(3&(t=0|_e[(e=f+4|0)>>2])|0))return _e[1146]=o,_e[e>>2]=-2&t,_e[a+4>>2]=1|o,void(_e[a+o>>2]=o);u=a,t=o;break}if(r=n>>>3,n>>>0<256){if(e=0|_e[a+8>>2],(0|(t=0|_e[a+12>>2]))==(0|e)){_e[1144]=_e[1144]&~(1<<r),u=a,t=o;break}_e[e+12>>2]=t,_e[t+8>>2]=e,u=a,t=o;break}i=0|_e[a+24>>2],e=0|_e[a+12>>2];do{if((0|e)==(0|a)){if(!(e=0|_e[(t=(r=a+16|0)+4|0)>>2])){if(!(e=0|_e[r>>2])){e=0;break}t=r}for(;;)if(0|(n=0|_e[(r=e+20|0)>>2]))e=n,t=r;else{if(!(n=0|_e[(r=e+16|0)>>2]))break;e=n,t=r}_e[t>>2]=0}else u=0|_e[a+8>>2],_e[u+12>>2]=e,_e[e+8>>2]=u}while(0);if(i){if(t=0|_e[a+28>>2],(0|a)==(0|_e[(r=4880+(t<<2)|0)>>2])){if(!(_e[r>>2]=e)){_e[1145]=_e[1145]&~(1<<t),u=a,t=o;break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|a)&1)<<2)>>2]=e)){u=a,t=o;break}_e[e+24>>2]=i,0|(r=0|_e[(t=a+16|0)>>2])&&(_e[e+16>>2]=r,_e[r+24>>2]=e),t=(u=((t=0|_e[t+4>>2])&&(_e[e+20>>2]=t,_e[t+24>>2]=e),a),o)}else u=a,t=o}}while(0);if(2&(n=0|_e[(e=f+4|0)>>2]))_e[e>>2]=-2&n,_e[u+4>>2]=1|t,_e[u+t>>2]=t;else{if(e=0|_e[1149],(0|f)==(0|_e[1150]))return f=(0|_e[1147])+t|0,_e[1147]=f,_e[1150]=u,_e[u+4>>2]=1|f,(0|u)==(0|e)&&(_e[1149]=0,void(_e[1146]=0));if((0|f)==(0|e))return f=(0|_e[1146])+t|0,_e[1146]=f,_e[1149]=u,_e[u+4>>2]=1|f,void(_e[u+f>>2]=f);a=(-8&n)+t|0,r=n>>>3;do{if(n>>>0<256){if(t=0|_e[f+8>>2],(0|(e=0|_e[f+12>>2]))==(0|t)){_e[1144]=_e[1144]&~(1<<r);break}_e[t+12>>2]=e,_e[e+8>>2]=t;break}i=0|_e[f+24>>2],e=0|_e[f+12>>2];do{if((0|e)==(0|f)){if(!(e=0|_e[(t=(r=f+16|0)+4|0)>>2])){if(!(e=0|_e[r>>2])){r=0;break}t=r}for(;;)if(0|(n=0|_e[(r=e+20|0)>>2]))e=n,t=r;else{if(!(n=0|_e[(r=e+16|0)>>2]))break;e=n,t=r}_e[t>>2]=0,r=e}else r=0|_e[f+8>>2],_e[r+12>>2]=e,_e[e+8>>2]=r,r=e}while(0);if(0|i){if(e=0|_e[f+28>>2],(0|f)==(0|_e[(t=4880+(e<<2)|0)>>2])){if(!(_e[t>>2]=r)){_e[1145]=_e[1145]&~(1<<e);break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|f)&1)<<2)>>2]=r))break;_e[r+24>>2]=i,0|(t=0|_e[(e=f+16|0)>>2])&&(_e[r+16>>2]=t,_e[t+24>>2]=r),0|(e=0|_e[e+4>>2])&&(_e[r+20>>2]=e,_e[e+24>>2]=r)}}while(0);if(_e[u+4>>2]=1|a,_e[u+a>>2]=a,(0|u)==(0|_e[1149]))return void(_e[1146]=a);t=a}if(e=t>>>3,t>>>0<256)return r=4616+(e<<1<<2)|0,(t=0|_e[1144])&(e=1<<e)?e=0|_e[(t=r+8|0)>>2]:(_e[1144]=t|e,t=(e=r)+8|0),_e[t>>2]=u,_e[e+12>>2]=u,_e[u+8>>2]=e,void(_e[u+12>>2]=r);if(i=4880+((e=(e=t>>>8)?16777215<t>>>0?31:t>>>((e=14-((a=((f=e<<(o=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|o|(e=((f<<=a)+245760|0)>>>16&2))+(f<<e>>>15)|0)+7|0)&1|e<<1:0)<<2)|0,_e[u+28>>2]=e,_e[u+20>>2]=0,!((r=(_e[u+16>>2]=0)|_e[1145])&(n=1<<e)))return _e[1145]=r|n,_e[i>>2]=u,_e[u+24>>2]=i,_e[u+12>>2]=u,void(_e[u+8>>2]=u);for(r=t<<(31==(0|e)?0:25-(e>>>1)|0),n=0|_e[i>>2];;){if((-8&_e[n+4>>2]|0)==(0|t)){e=69;break}if(!(e=0|_e[(i=n+16+(r>>>31<<2)|0)>>2])){e=68;break}r<<=1,n=e}68==(0|e)?(_e[i>>2]=u,_e[u+24>>2]=n,_e[u+12>>2]=u,_e[u+8>>2]=u):69==(0|e)&&(f=0|_e[(o=n+8|0)>>2],_e[f+12>>2]=u,_e[o>>2]=u,_e[u+8>>2]=f,_e[u+12>>2]=n,_e[u+24>>2]=0)}function B(e,r,t,n,i){i|=0;var a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0,d=0,E=0,s=e|=0,o=t|=0,u=_=n|=0;if(!(l=f=r|=0))return a=0!=(0|i),u?(a&&(_e[i>>2]=0|e,_e[i+4>>2]=0&r),(i=_=0)|(L=_,i)):(a&&(_e[i>>2]=(s>>>0)%(o>>>0),_e[i+4>>2]=0),(_=0)|(L=_,i=(s>>>0)/(o>>>0)>>>0));a=0==(0|u);do{if(o){if(!a){if((a=(0|T(0|u))-(0|T(0|l))|0)>>>0<=31){e=s>>>((o=c=a+1|0)>>>0)&(r=a-31>>31)|l<<(u=31-a|0),r&=l>>>(c>>>0),a=0,u=s<<u;break}return i?(_e[i>>2]=0|e,_e[i+4>>2]=f|0&r,(i=_=0)|(L=_,i)):(i=_=0)|(L=_,i)}if((a=o-1|0)&o|0){e=(c=32-(u=33+(0|T(0|o))-(0|T(0|l))|0)|0)-1>>31&l>>>((d=u-32|0)>>>0)|(l<<c|s>>>((o=u)>>>0))&(r=d>>31),r&=l>>>(u>>>0),a=s<<(E=64-u|0)&(f=c>>31),u=(l<<E|s>>>(d>>>0))&f|s<<c&u-33>>31;break}return 0|i&&(_e[i>>2]=a&s,_e[i+4>>2]=0),1==(0|o)?0|(L=d=f|0&r,E=0|e):(E=0|Pe(0|o),0|(L=d=l>>>(E>>>0)|0,E=l<<32-E|s>>>(E>>>0)|0))}if(a)return 0|i&&(_e[i>>2]=(l>>>0)%(o>>>0),_e[i+4>>2]=0),(d=0)|(L=d,E=(l>>>0)/(o>>>0)>>>0);if(!s)return 0|i&&(_e[i>>2]=0,_e[i+4>>2]=(l>>>0)%(u>>>0)),(d=0)|(L=d,E=(l>>>0)/(u>>>0)>>>0);if(!((a=u-1|0)&u))return 0|i&&(_e[i>>2]=0|e,_e[i+4>>2]=a&l|0&r),E=l>>>(((d=0)|Pe(0|u))>>>0),0|(L=d,E);if((a=(0|T(0|u))-(0|T(0|l))|0)>>>0<=30){e=l<<(u=31-a|0)|s>>>((o=r=a+1|0)>>>0),r=l>>>(r>>>0),a=0,u=s<<u;break}return i&&(_e[i>>2]=0|e,_e[i+4>>2]=f|0&r),(E=d=0)|(L=d,E)}while(0);if(o){for(c=0|t,s=_|0&n,l=0|ge(0|c,0|s,-1,-1),t=L,f=u,u=0;f=a>>>31|(n=f)<<1,a=u|a<<1,ve(0|l,0|t,0|(n=e<<1|n>>>31|0),0|(_=e>>>31|r<<1|0)),u=1&(d=(E=L)>>31|((0|E)<0?-1:0)<<1),e=0|ve(0|n,0|_,d&c|0,(((0|E)<0?-1:0)>>31|((0|E)<0?-1:0)<<1)&s|0),r=L,o=o-1|0,0!=(0|o););l=f,f=0}else l=u,u=f=0;return(o=0)|i&&(_e[i>>2]=e,_e[i+4>>2]=r),0|(L=d=(0|a)>>>31|(l|o)<<1|0&(o<<1|a>>>31)|f,E=-2&(a<<1|0)|u)}function Ae(e,r){e|=0;var t,n,i,a,o,u,f,l=0,s=0,c=0,_=0,d=0,E=0,T=Te;Te=Te+576|0,i=T+48|0,o=T+32|0,a=T+16|0,f=(n=T)+64|0,u=0|_e[(r|=0)+20>>2],(0|(t=0|_e[(E=e+20|0)>>2]))<24?(s=(l=0|_e[(d=e+4|0)>>2])>>>0<(c=0|_e[e+8>>2])>>>0,(0|t)<16?(s?(_=(0|de[l>>0])<<8,l=l+1|0):_=0,l>>>0<c>>>0?(c=0|de[l>>0],l=l+1|0):c=0,_e[d>>2]=l,_e[E>>2]=16+t,s=16,l=c|_):(l=s?(_e[d>>2]=l+1,0|de[l>>0]):0,_e[E>>2]=8+t,s=24),c=_e[(d=e+16|0)>>2]|l<<s-t,_e[d>>2]=c):c=0|_e[(d=c=e+16|0)>>2],_=1+(c>>>16)|0;do{if(!(_>>>0<=(0|_e[16+u>>2])>>>0)){for(s=0|_e[20+u>>2];_>>>0>(0|_e[28+u+((l=s+-1|0)<<2)>>2])>>>0;)s=s+1|0;if((l=(c>>>(32-s|0))+(0|_e[96+u+(l<<2)>>2])|0)>>>0<(0|_e[r>>2])>>>0){l=0|Ee[(0|_e[176+u>>2])+(l<<1)>>1];break}return _e[i>>2]=866,_e[4+i>>2]=3275,_e[8+i>>2]=1348,Ce(f,812,i),Me(f),Te=T,(E=0)|E}}while(-1==(0|(s=0|_e[(0|_e[168+u>>2])+(c>>>(32-(0|_e[8+u>>2])|0)<<2)>>2]))&&(_e[n>>2]=866,_e[n+4>>2]=3253,_e[n+8>>2]=1393,Ce(f,812,n),Me(f)),l=65535&s,s>>>=16,(0|_e[r+8>>2])>>>0<=l>>>0&&(_e[a>>2]=866,_e[4+a>>2]=909,_e[8+a>>2]=1497,Ce(f,812,a),Me(f)),(0|de[(0|_e[r+4>>2])+l>>0])!=(0|s)&&(_e[o>>2]=866,_e[4+o>>2]=3257,_e[8+o>>2]=1410,Ce(f,812,o),Me(f)),0);return _e[d>>2]=_e[d>>2]<<s,_e[E>>2]=(0|_e[E>>2])-s,Te=T,0|(E=l)}function U(e){var r,t,n,i,a=0,o=0,u=0,f=Te;if(Te=Te+576|0,u=f+48|0,n=f+32|0,t=f+16|0,i=(r=f)+64|0,(_e[(e|=0)>>2]=0)|(o=0|_e[(a=e+284|0)>>2])&&(7&o?(_e[r>>2]=866,_e[r+4>>2]=2506,_e[r+8>>2]=1232,Ce(i,812,r),Me(i)):ue(o,0,0,1,0),_e[a>>2]=0,_e[e+288>>2]=0,_e[e+292>>2]=0),(ce[e+296>>0]=0)|(o=0|_e[(a=e+268|0)>>2])&&(7&o?(_e[t>>2]=866,_e[4+t>>2]=2506,_e[8+t>>2]=1232,Ce(i,812,t),Me(i)):ue(o,0,0,1,0),_e[a>>2]=0,_e[e+272>>2]=0,_e[e+276>>2]=0),(ce[e+280>>0]=0)|(o=0|_e[(a=e+252|0)>>2])&&(7&o?(_e[n>>2]=866,_e[4+n>>2]=2506,_e[8+n>>2]=1232,Ce(i,812,n),Me(i)):ue(o,0,0,1,0),_e[a>>2]=0,_e[e+256>>2]=0,_e[e+260>>2]=0),!(o=(ce[e+264>>0]=0)|_e[(a=e+236|0)>>2]))return re(u=e+212|(ce[(u=e+248|0)>>0]=0)),re(u=e+188|0),re(u=e+164|0),re(u=e+140|0),re(u=e+116|0),void(Te=f);7&o?(_e[u>>2]=866,_e[u+4>>2]=2506,_e[u+8>>2]=1232,Ce(i,812,u),Me(i)):ue(o,0,0,1,0),_e[a>>2]=0,_e[e+240>>2]=0,_e[e+244>>2]=0,re(u=e+212|(ce[(u=e+248|0)>>0]=0)),re(u=e+188|0),re(u=e+164|0),re(u=e+140|0),re(u=e+116|0),Te=f}function H(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,a=0;e:do{if(r>>>0<=20){switch(0|r){case 9:n=3+(0|_e[t>>2])&-4,r=0|_e[n>>2],_e[t>>2]=n+4,_e[e>>2]=r;break e;case 10:n=3+(0|_e[t>>2])&-4,r=0|_e[n>>2],_e[t>>2]=n+4,_e[(n=e)>>2]=r,_e[n+4>>2]=((0|r)<0)<<31>>31;break e;case 11:n=3+(0|_e[t>>2])&-4,r=0|_e[n>>2],_e[t>>2]=n+4,_e[(n=e)>>2]=r,_e[n+4>>2]=0;break e;case 12:n=7+(0|_e[t>>2])&-8,i=0|_e[(r=n)>>2],r=0|_e[r+4>>2],_e[t>>2]=n+8,_e[(n=e)>>2]=i,_e[n+4>>2]=r;break e;case 13:i=3+(0|_e[t>>2])&-4,n=0|_e[i>>2],_e[t>>2]=i+4,n=(65535&n)<<16>>16,_e[(i=e)>>2]=n,_e[i+4>>2]=((0|n)<0)<<31>>31;break e;case 14:i=3+(0|_e[t>>2])&-4,n=0|_e[i>>2],_e[t>>2]=i+4,_e[(i=e)>>2]=65535&n,_e[i+4>>2]=0;break e;case 15:i=3+(0|_e[t>>2])&-4,n=0|_e[i>>2],_e[t>>2]=i+4,n=(255&n)<<24>>24,_e[(i=e)>>2]=n,_e[i+4>>2]=((0|n)<0)<<31>>31;break e;case 16:i=3+(0|_e[t>>2])&-4,n=0|_e[i>>2],_e[t>>2]=i+4,_e[(i=e)>>2]=255&n,_e[i+4>>2]=0;break e;case 17:case 18:i=7+(0|_e[t>>2])&-8,a=+k[i>>3],_e[t>>2]=i+8,k[e>>3]=a;break e;default:break e}}}while(0)}function X(e,r,t,n,i){r|=0,t|=0,n|=0,i|=0;var a,o,u,f,l,s=0,c=0,_=0,d=0,E=Te;if(Te=Te+576|0,f=E+48|0,a=E+32|0,c=E+16|0,u=(s=E)+64|0,l=E+60|0,d=(e|=0)+8|0,(0|_e[(o=e+4|0)>>2])>>>0>(0|_e[d>>2])>>>0&&(_e[s>>2]=866,_e[s+4>>2]=2123,_e[s+8>>2]=845,Ce(u,812,s),Me(u)),(2147418112/(n>>>0)|0)>>>0<=r>>>0&&(_e[c>>2]=866,_e[c+4>>2]=2124,_e[c+8>>2]=885,Ce(u,812,c),Me(u)),r>>>0<=(s=0|_e[d>>2])>>>0)return Te=E,0|(d=1);if(10==(0|(t=9==(0|(t=t&&0!=((_=r+-1|0)&r|0)?(r=_>>>16|_,r|=r>>>8,r|=r>>>4,(r=1+((r|=r>>>2)>>>1|r)|0)?9:(r=0,10)):9))&&r>>>0<=s>>>0?10:t))&&(_e[a>>2]=866,_e[4+a>>2]=2133,_e[8+a>>2]=933,Ce(u,812,a),Me(u)),_=0|ie(r,n),i)if(c=0|te(_,l)){Ze[0&i](c,0|_e[e>>2],0|_e[o>>2]),s=0|_e[e>>2];do{if(0|s){if(7&s){_e[f>>2]=866,_e[4+f>>2]=2506,_e[8+f>>2]=1232,Ce(u,812,f),Me(u);break}ue(s,0,0,1,0);break}}while(0);_e[e>>2]=c,t=20}else r=0;else(s=0|function(e,r,t,n){r|=0,t|=0,n|=0;var i=0,a=0,o=0,u=0,f=0,l=0;if(Te=(l=Te)+560|0,f=l+32|0,a=l+16|0,o=(i=l)+48|0,u=l+44|0,7&(e|=0)|0)return _e[i>>2]=866,_e[i+4>>2]=2506,_e[i+8>>2]=1210,Ce(o,812,i),Me(o),Te=l,(f=0)|f;if(2147418112<r>>>0)return _e[a>>2]=866,_e[4+a>>2]=2506,_e[8+a>>2]=1103,Ce(o,812,a),Me(o),Te=l,(f=0)|f;_e[u>>2]=r,e=0|ue(e,r,u,n,0),0|t&&(_e[t>>2]=_e[u>>2]);7&e|0&&(_e[f>>2]=866,_e[f+4>>2]=2558,_e[f+8>>2]=1156,Ce(o,812,f),Me(o));return Te=l,0|(f=e)}(0|_e[e>>2],_,l,1))?(_e[e>>2]=s,t=20):r=0;return 20==(0|t)&&(_>>>0<(s=0|_e[l>>2])>>>0&&(r=(s>>>0)/(n>>>0)|0),_e[d>>2]=r,r=1),Te=E,0|(d=r)}function Y(e,r,t,n,i,a,o){r|=0,t|=0,n|=0,i|=0,a|=0,o|=0;var u,f=0,l=0,s=0|_e[(e|=0)+88>>2];if(f=((1<(f=(de[12+s>>0]<<8|de[13+s>>0])>>>o)>>>0?f:1)+3|0)>>>2,l=((1<(l=(de[14+s>>0]<<8|de[15+s>>0])>>>o)>>>0?l:1)+3|0)>>>2,o=0|ce[(s=18+s|0)>>0],o=0|ie(f,o<<24>>24==0|o<<24>>24==9?8:16),a){if(!(0==(3&a|0)&o>>>0<=a>>>0))return(i=0)|i;o=a}if((0|ie(o,l))>>>0>i>>>0)return(i=0)|i;if(a=(f+1|0)>>>1,u=(l+1|0)>>>1,!t)return(i=0)|i;switch(_e[e+92>>2]=r,_e[e+96>>2]=r,_e[e+104>>2]=t,_e[e+100>>2]=r+t,_e[e+108>>2]=0,(_e[e+112>>2]=0)|ce[s>>0]){case 0:if(!(0|function(e,r,t,n,i,a,o,u){r|=0,t|=0,n|=0,i|=0,a|=0,o|=0,u|=0;var f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k,g,L,I,D,w,G,F,x,B,U,H,W,V,X,Y,K=0,z=0,j=0,J=0,$=0,Z=0,q=0,Q=0,ee=0,re=0,te=0,ne=Te;if(Te=Te+656|0,X=ne+112|0,W=ne+96|0,H=ne+80|0,U=ne+64|0,B=ne+48|0,Y=ne+32|0,V=ne+16|0,G=(x=ne)+144|0,F=ne+128|0,y=0|_e[(N=(e|=0)+240|0)>>2],v=0|_e[(O=e+256|0)>>2],k=255&(w=0|ce[17+(0|_e[e+88>>2])>>0]),!(w<<24>>24))return Te=ne,1;L=0==(0|u),D=(I=o+-1|0)<<4,w=u+-1|0,S=0!=(1&a|0),P=n<<1,R=e+92|0,h=e+116|0,p=e+140|0,C=e+236|0,m=0!=(1&i|0),b=e+188|0,E=e+252|0,T=1+(g=n>>>2)|0,A=2+g|0,M=3+g|0,t=a=ee=0,i=1;do{if(!L)for(q=0|_e[r+(ee<<2)>>2],Q=0;;){if(z=0==(0|(_=1&Q)),c=(_<<5^32)-16|0,_=(_<<1^2)-1|0,d=S&(e=(0|Q)==(0|w)),(0|(K=z?0:I))!=(0|(s=z?o:-1)))for(l=S&e^1,Z=z?q:q+D|0;;){for(1==(0|i)&&(i=512|Ae(R,h)),f=7&i,i>>>=3,z=0|de[1539+f>>0],e=0;t=($=(J=(j=(0|Ae(R,p))+t|0)-y|0)>>31)&j|J&~$,(0|_e[N>>2])>>>0<=t>>>0&&(_e[x>>2]=866,_e[x+4>>2]=910,_e[x+8>>2]=1497,Ce(G,812,x),Me(G)),_e[F+(e<<2)>>2]=_e[(0|_e[C>>2])+(t<<2)>>2],e=e+1|0,e>>>0<z>>>0;);if(d|($=m&(0|K)==(0|I))){J=0;do{e=Z+(0|ie(J,n))|0,j=0==(0|J)|l,z=J<<1,a=(a=(re=(te=(0|Ae(R,b))+a|0)-v|0)>>31)&te|re&~a;do{if($){if(!j){a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a;break}_e[e>>2]=_e[F+((0|de[1547+(f<<2)+z>>0])<<2)>>2],(0|_e[O>>2])>>>0<=a>>>0&&(_e[W>>2]=866,_e[4+W>>2]=910,_e[8+W>>2]=1497,Ce(G,812,W),Me(G)),_e[e+4>>2]=_e[(0|_e[E>>2])+(a<<2)>>2],a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a}else j&&(_e[e>>2]=_e[F+((0|de[1547+(f<<2)+z>>0])<<2)>>2],(0|_e[O>>2])>>>0<=a>>>0&&(_e[H>>2]=866,_e[4+H>>2]=910,_e[8+H>>2]=1497,Ce(G,812,H),Me(G)),_e[e+4>>2]=_e[(0|_e[E>>2])+(a<<2)>>2]),e=e+8|0,a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a,j&&(_e[e>>2]=_e[F+((0|de[1547+(f<<2)+(1|z)>>0])<<2)>>2],(0|_e[O>>2])>>>0<=a>>>0&&(_e[X>>2]=866,_e[4+X>>2]=910,_e[8+X>>2]=1497,Ce(G,812,X),Me(G)),_e[e+4>>2]=_e[(0|_e[E>>2])+(a<<2)>>2])}while(0)}while(2!=(0|(J=J+1|0)))}else _e[Z>>2]=_e[F+((0|de[1547+(f<<2)>>0])<<2)>>2],a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a,(0|_e[O>>2])>>>0<=a>>>0&&(_e[V>>2]=866,_e[4+V>>2]=910,_e[8+V>>2]=1497,Ce(G,812,V),Me(G)),_e[Z+4>>2]=_e[(0|_e[E>>2])+(a<<2)>>2],_e[Z+8>>2]=_e[F+((0|de[1547+(f<<2)+1>>0])<<2)>>2],a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a,(0|_e[O>>2])>>>0<=a>>>0&&(_e[Y>>2]=866,_e[4+Y>>2]=910,_e[8+Y>>2]=1497,Ce(G,812,Y),Me(G)),_e[Z+12>>2]=_e[(0|_e[E>>2])+(a<<2)>>2],_e[Z+(g<<2)>>2]=_e[F+((0|de[1547+(f<<2)+2>>0])<<2)>>2],a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a,(0|_e[O>>2])>>>0<=a>>>0&&(_e[B>>2]=866,_e[4+B>>2]=910,_e[8+B>>2]=1497,Ce(G,812,B),Me(G)),_e[Z+(T<<2)>>2]=_e[(0|_e[E>>2])+(a<<2)>>2],_e[Z+(A<<2)>>2]=_e[F+((0|de[1547+(f<<2)+3>>0])<<2)>>2],a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a,(0|_e[O>>2])>>>0<=a>>>0&&(_e[U>>2]=866,_e[4+U>>2]=910,_e[8+U>>2]=1497,Ce(G,812,U),Me(G)),_e[Z+(M<<2)>>2]=_e[(0|_e[E>>2])+(a<<2)>>2];if((0|(K=_+K|0))==(0|s))break;Z=Z+c|0}if((0|(Q=Q+1|0))==(0|u))break;q=q+P|0}}while((0|(ee=ee+1|0))!=(0|k));return Te=ne,1}(e,n,i,o,f,l,a,u)))return(i=0)|i;break;case 4:case 6:case 5:case 3:case 2:if(!(0|function(e,r,t,n,i,a,o,u){r|=0,t|=0,n|=0,i|=0,a|=0,o|=0,u|=0;var f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k,g,L,I,D,w,G,F,x,B,U,H,W,V,X,Y,K,z,j=0,J=0,$=0,Z=0,q=0,Q=0,ee=0,re=0,te=0,ne=0,ie=0,ae=0,oe=0,ue=0,fe=0,le=0,se=Te;if(Te=Te+640|0,Y=se+80|0,X=se+64|0,V=se+48|0,z=se+32|0,K=se+16|0,U=(W=se)+128|0,H=se+112|0,b=se+96|0,S=0|_e[(m=(e|=0)+240|0)>>2],R=0|_e[(P=e+256|0)>>2],p=0|_e[(h=e+272|0)>>2],B=0|_e[e+88>>2],C=(0|de[63+B>>0])<<8|0|de[64+B>>0],N=255&(B=0|ce[17+B>>0]),!(B<<24>>24))return Te=se,1;y=0==(0|u),v=(O=o+-1|0)<<5,k=u+-1|0,g=n<<1,L=e+92|0,I=e+116|0,D=e+164|0,w=e+268|0,G=e+140|0,F=e+236|0,x=e+212|0,B=e+188|0,M=0==(1&i|0),A=0==(1&a|0),E=e+288|0,T=e+284|0,d=e+252|0,t=i=a=e=le=0,j=1;do{if(!y)for(ue=0|_e[r+(le<<2)>>2],fe=0;;){if($=0==(0|(_=1&fe)),c=(_<<6^64)-32|0,_=(_<<1^2)-1|0,(0|(J=$?0:O))!=(0|(l=$?o:-1)))for(s=A|(0|fe)!=(0|k),oe=$?ue:ue+v|0;;){for(1==(0|j)&&(j=512|Ae(L,I)),f=7&j,j>>>=3,Z=0|de[1539+f>>0],$=0;a=(ae=(ie=(ne=(0|Ae(L,D))+a|0)-p|0)>>31)&ne|ie&~ae,(0|_e[h>>2])>>>0<=a>>>0&&(_e[W>>2]=866,_e[W+4>>2]=910,_e[W+8>>2]=1497,Ce(U,812,W),Me(U)),_e[b+($<<2)>>2]=Ee[(0|_e[w>>2])+(a<<1)>>1],$=$+1|0,$>>>0<Z>>>0;);for($=0;t=(ae=(ie=(ne=(0|Ae(L,G))+t|0)-S|0)>>31)&ne|ie&~ae,(0|_e[m>>2])>>>0<=t>>>0&&(_e[K>>2]=866,_e[4+K>>2]=910,_e[8+K>>2]=1497,Ce(U,812,K),Me(U)),_e[H+($<<2)>>2]=_e[(0|_e[F>>2])+(t<<2)>>2],$=$+1|0,$>>>0<Z>>>0;);for(ae=M|(0|J)!=(0|O),ne=0,ie=oe;;){if(ee=s|0==(0|ne),re=ne<<1,ae)for(q=0,Q=ie;e=(e=(Z=(te=(0|Ae(L,x))+e|0)-C|0)>>31)&te|Z&~e,i=(i=(te=(Z=(0|Ae(L,B))+i|0)-R|0)>>31)&Z|te&~i,ee&&($=0|de[q+re+(1547+(f<<2))>>0],Z=3*e|0,(0|_e[E>>2])>>>0<=Z>>>0&&(_e[z>>2]=866,_e[4+z>>2]=910,_e[8+z>>2]=1497,Ce(U,812,z),Me(U)),te=(0|_e[T>>2])+(Z<<1)|0,_e[Q>>2]=(0|Ee[te>>1])<<16|_e[b+($<<2)>>2],_e[Q+4>>2]=(0|Ee[te+4>>1])<<16|0|Ee[te+2>>1],_e[Q+8>>2]=_e[H+($<<2)>>2],(0|_e[P>>2])>>>0<=i>>>0&&(_e[V>>2]=866,_e[4+V>>2]=910,_e[8+V>>2]=1497,Ce(U,812,V),Me(U)),_e[Q+12>>2]=_e[(0|_e[d>>2])+(i<<2)>>2]),2!=(0|(q=q+1|0));)Q=Q+16|0;else for(te=1^ee,ee=1547+(f<<2)+re|0,q=0,Q=ie;e=(e=(Z=(re=(0|Ae(L,x))+e|0)-C|0)>>31)&re|Z&~e,i=(i=(re=(Z=(0|Ae(L,B))+i|0)-R|0)>>31)&Z|re&~i,0!=(0|q)|te||($=0|de[ee>>0],Z=3*e|0,(0|_e[E>>2])>>>0<=Z>>>0&&(_e[X>>2]=866,_e[4+X>>2]=910,_e[8+X>>2]=1497,Ce(U,812,X),Me(U)),re=(0|_e[T>>2])+(Z<<1)|0,_e[Q>>2]=(0|Ee[re>>1])<<16|_e[b+($<<2)>>2],_e[Q+4>>2]=(0|Ee[re+4>>1])<<16|0|Ee[re+2>>1],_e[Q+8>>2]=_e[H+($<<2)>>2],(0|_e[P>>2])>>>0<=i>>>0&&(_e[Y>>2]=866,_e[4+Y>>2]=910,_e[8+Y>>2]=1497,Ce(U,812,Y),Me(U)),_e[Q+12>>2]=_e[(0|_e[d>>2])+(i<<2)>>2]),2!=(0|(q=q+1|0));)Q=Q+16|0;if(2==(0|(ne=ne+1|0)))break;ie=ie+n|0}if((0|(J=_+J|0))==(0|l))break;oe=oe+c|0}if((0|(fe=fe+1|0))==(0|u))break;ue=ue+g|0}}while((0|(le=le+1|0))!=(0|N));return Te=se,1}(e,n,i,o,f,l,a,u)))return(i=0)|i;break;case 9:if(!(0|function(e,r,t,n,i,a,o,u){r|=0,t|=0,n|=0,i|=0,a|=0,o|=0,u|=0;var f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k,g,L,I,D,w,G,F=0,x=0,B=0,U=0,H=0,W=0,V=0,X=0,Y=0,K=0,z=0,j=0,J=Te;if(Te=Te+592|0,D=J+48|0,G=J+32|0,w=J+16|0,g=(I=J)+80|0,L=J+64|0,b=0|_e[(M=(e|=0)+272|0)>>2],k=0|_e[e+88>>2],m=(0|de[63+k>>0])<<8|0|de[64+k>>0],S=255&(k=0|ce[17+k>>0]),!(k<<24>>24))return Te=J,1;P=0==(0|u),h=(R=o+-1|0)<<4,p=u+-1|0,C=n<<1,N=e+92|0,y=e+116|0,O=e+164|0,v=e+268|0,k=e+212|0,A=0==(1&i|0),T=0==(1&a|0),E=e+288|0,d=e+284|0,t=i=j=0,a=1;do{if(!P)for(K=0|_e[r+(j<<2)>>2],z=0;;){if(F=0==(0|(_=1&z)),c=(_<<5^32)-16|0,_=(_<<1^2)-1|0,(0|(e=F?0:R))!=(0|(l=F?o:-1)))for(s=T|(0|z)!=(0|p),Y=F?K:K+h|0;;){for(1==(0|a)&&(a=512|Ae(N,y)),f=7&a,a>>>=3,x=0|de[1539+f>>0],F=0;t=(X=(V=(W=(0|Ae(N,O))+t|0)-b|0)>>31)&W|V&~X,(0|_e[M>>2])>>>0<=t>>>0&&(_e[I>>2]=866,_e[I+4>>2]=910,_e[I+8>>2]=1497,Ce(g,812,I),Me(g)),_e[L+(F<<2)>>2]=Ee[(0|_e[v>>2])+(t<<1)>>1],F=F+1|0,F>>>0<x>>>0;);for(X=A|(0|e)!=(0|R),W=0,V=Y;H=s|0==(0|W),x=W<<1,U=(U=(B=(F=(0|Ae(N,k))+i|0)-m|0)>>31)&F|B&~U,X?(H&&(i=0|de[1547+(f<<2)+x>>0],F=3*U|0,(0|_e[E>>2])>>>0<=F>>>0&&(_e[w>>2]=866,_e[4+w>>2]=910,_e[8+w>>2]=1497,Ce(g,812,w),Me(g)),B=(0|_e[d>>2])+(F<<1)|0,_e[V>>2]=(0|Ee[B>>1])<<16|_e[L+(i<<2)>>2],_e[V+4>>2]=(0|Ee[B+4>>1])<<16|0|Ee[B+2>>1]),B=V+8|0,i=(i=(U=(F=(0|Ae(N,k))+U|0)-m|0)>>31)&F|U&~i,H&&(F=0|de[1547+(f<<2)+(1|x)>>0],x=3*i|0,(0|_e[E>>2])>>>0<=x>>>0&&(_e[D>>2]=866,_e[4+D>>2]=910,_e[8+D>>2]=1497,Ce(g,812,D),Me(g)),H=(0|_e[d>>2])+(x<<1)|0,_e[B>>2]=(0|Ee[H>>1])<<16|_e[L+(F<<2)>>2],_e[V+12>>2]=(0|Ee[H+4>>1])<<16|0|Ee[H+2>>1])):(H&&(i=0|de[1547+(f<<2)+x>>0],F=3*U|0,(0|_e[E>>2])>>>0<=F>>>0&&(_e[G>>2]=866,_e[4+G>>2]=910,_e[8+G>>2]=1497,Ce(g,812,G),Me(g)),H=(0|_e[d>>2])+(F<<1)|0,_e[V>>2]=(0|Ee[H>>1])<<16|_e[L+(i<<2)>>2],_e[V+4>>2]=(0|Ee[H+4>>1])<<16|0|Ee[H+2>>1]),i=(i=(H=(U=(0|Ae(N,k))+U|0)-m|0)>>31)&U|H&~i),2!=(0|(W=W+1|0));)V=V+n|0;if((0|(e=_+e|0))==(0|l))break;Y=Y+c|0}if((0|(z=z+1|0))==(0|u))break;K=K+C|0}}while((0|(j=j+1|0))!=(0|S));return Te=J,1}(e,n,i,o,f,l,a,u)))return(i=0)|i;break;case 8:case 7:if(!(0|function(e,r,t,n,i,a,o,u){r|=0,t|=0,n|=0,i|=0,a|=0,o|=0,u|=0;var f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k,g,L,I,D,w,G,F,x,B,U=0,H=0,W=0,V=0,X=0,Y=0,K=0,z=0,j=0,J=0,$=0,Z=0,q=0,Q=0,ee=0,re=0,te=0,ne=0,ie=0,ae=Te;if(Te=Te+640|0,F=ae+80|0,G=ae+64|0,w=ae+48|0,B=ae+32|0,x=ae+16|0,L=(D=ae)+128|0,I=ae+112|0,M=ae+96|0,m=0|_e[(b=(e|=0)+272|0)>>2],g=0|_e[e+88>>2],S=(0|de[63+g>>0])<<8|0|de[64+g>>0],P=255&(g=0|ce[17+g>>0]),!(g<<24>>24))return Te=ae,1;R=0==(0|u),p=(h=o+-1|0)<<5,C=u+-1|0,N=n<<1,y=e+92|0,O=e+116|0,v=e+164|0,k=e+268|0,g=e+212|0,A=0==(1&i|0),T=0==(1&a|0),E=e+288|0,d=e+284|0,t=i=a=e=ie=0,U=1;do{if(!R)for(te=0|_e[r+(ie<<2)>>2],ne=0;;){if(W=0==(0|(_=1&ne)),c=(_<<6^64)-32|0,_=(_<<1^2)-1|0,(0|(H=W?0:h))!=(0|(l=W?o:-1)))for(s=T|(0|ne)!=(0|C),re=W?te:te+p|0;;){for(1==(0|U)&&(U=512|Ae(y,O)),f=7&U,U>>>=3,V=0|de[1539+f>>0],W=0;t=(ee=(Q=(q=(0|Ae(y,v))+t|0)-m|0)>>31)&q|Q&~ee,(0|_e[b>>2])>>>0<=t>>>0&&(_e[D>>2]=866,_e[D+4>>2]=910,_e[D+8>>2]=1497,Ce(L,812,D),Me(L)),_e[I+(W<<2)>>2]=Ee[(0|_e[k>>2])+(t<<1)>>1],W=W+1|0,W>>>0<V>>>0;);for(W=0;a=(ee=(Q=(q=(0|Ae(y,v))+a|0)-m|0)>>31)&q|Q&~ee,(0|_e[b>>2])>>>0<=a>>>0&&(_e[x>>2]=866,_e[4+x>>2]=910,_e[8+x>>2]=1497,Ce(L,812,x),Me(L)),_e[M+(W<<2)>>2]=Ee[(0|_e[k>>2])+(a<<1)>>1],W=W+1|0,W>>>0<V>>>0;);for(ee=A|(0|H)!=(0|h),q=0,Q=re;;){if(J=s|0==(0|q),$=q<<1,ee)for(z=0,j=Q;i=(i=(K=(Z=(0|Ae(y,g))+i|0)-S|0)>>31)&Z|K&~i,e=(e=(Z=(K=(0|Ae(y,g))+e|0)-S|0)>>31)&K|Z&~e,J&&(K=0|de[z+$+(1547+(f<<2))>>0],V=3*i|0,(W=0|_e[E>>2])>>>0<=V>>>0&&(_e[B>>2]=866,_e[4+B>>2]=910,_e[8+B>>2]=1497,Ce(L,812,B),Me(L),W=0|_e[E>>2]),V=(X=0|_e[d>>2])+(V<<1)|0,Z=(W=(Y=3*e|0)>>>0<W>>>0?X:(_e[w>>2]=866,_e[4+w>>2]=910,_e[8+w>>2]=1497,Ce(L,812,w),Me(L),0|_e[d>>2]))+(Y<<1)|0,_e[j>>2]=(0|Ee[V>>1])<<16|_e[I+(K<<2)>>2],_e[j+4>>2]=(0|Ee[V+4>>1])<<16|0|Ee[V+2>>1],_e[j+8>>2]=(0|Ee[Z>>1])<<16|_e[M+(K<<2)>>2],_e[j+12>>2]=(0|Ee[Z+4>>1])<<16|0|Ee[Z+2>>1]),2!=(0|(z=z+1|0));)j=j+16|0;else for(Z=1^J,J=1547+(f<<2)+$|0,z=0,j=Q;i=(i=(K=($=(0|Ae(y,g))+i|0)-S|0)>>31)&$|K&~i,e=(e=($=(K=(0|Ae(y,g))+e|0)-S|0)>>31)&K|$&~e,0!=(0|z)|Z||(K=0|de[J>>0],V=3*i|0,(W=0|_e[E>>2])>>>0<=V>>>0&&(_e[G>>2]=866,_e[4+G>>2]=910,_e[8+G>>2]=1497,Ce(L,812,G),Me(L),W=0|_e[E>>2]),V=(X=0|_e[d>>2])+(V<<1)|0,$=(W=(Y=3*e|0)>>>0<W>>>0?X:(_e[F>>2]=866,_e[4+F>>2]=910,_e[8+F>>2]=1497,Ce(L,812,F),Me(L),0|_e[d>>2]))+(Y<<1)|0,_e[j>>2]=(0|Ee[V>>1])<<16|_e[I+(K<<2)>>2],_e[j+4>>2]=(0|Ee[V+4>>1])<<16|0|Ee[V+2>>1],_e[j+8>>2]=(0|Ee[$>>1])<<16|_e[M+(K<<2)>>2],_e[j+12>>2]=(0|Ee[$+4>>1])<<16|0|Ee[$+2>>1]),2!=(0|(z=z+1|0));)j=j+16|0;if(2==(0|(q=q+1|0)))break;Q=Q+n|0}if((0|(H=_+H|0))==(0|l))break;re=re+c|0}if((0|(ne=ne+1|0))==(0|u))break;te=te+N|0}}while((0|(ie=ie+1|0))!=(0|P));return Te=ae,1}(e,n,i,o,f,l,a,u)))return(i=0)|i;break;default:return(i=0)|i}return 0|(i=1)}function K(e,r,t){e|=0,r|=0;var n,i,a;if(8192<=(0|(t|=0)))return 0|N(0|e,0|r,0|t);if(a=0|e,i=e+t|0,(3&e)==(3&r)){for(;3&e;){if(!t)return 0|a;ce[e>>0]=0|ce[r>>0],e=e+1|0,r=r+1|0,t=t-1|0}for(n=(t=-4&i|0)-64|0;(0|e)<=(0|n);)_e[e>>2]=_e[r>>2],_e[e+4>>2]=_e[r+4>>2],_e[e+8>>2]=_e[r+8>>2],_e[e+12>>2]=_e[r+12>>2],_e[e+16>>2]=_e[r+16>>2],_e[e+20>>2]=_e[r+20>>2],_e[e+24>>2]=_e[r+24>>2],_e[e+28>>2]=_e[r+28>>2],_e[e+32>>2]=_e[r+32>>2],_e[e+36>>2]=_e[r+36>>2],_e[e+40>>2]=_e[r+40>>2],_e[e+44>>2]=_e[r+44>>2],_e[e+48>>2]=_e[r+48>>2],_e[e+52>>2]=_e[r+52>>2],_e[e+56>>2]=_e[r+56>>2],_e[e+60>>2]=_e[r+60>>2],e=e+64|0,r=r+64|0;for(;(0|e)<(0|t);)_e[e>>2]=_e[r>>2],e=e+4|0,r=r+4|0}else for(t=i-4|0;(0|e)<(0|t);)ce[e>>0]=0|ce[r>>0],ce[e+1>>0]=0|ce[r+1>>0],ce[e+2>>0]=0|ce[r+2>>0],ce[e+3>>0]=0|ce[r+3>>0],e=e+4|0,r=r+4|0;for(;(0|e)<(0|i);)ce[e>>0]=0|ce[r>>0],e=e+1|0,r=r+1|0;return 0|a}function z(e,r,t){r|=0,t|=0;var n,i,a,o,u,f=0,l=0,s=0,c=0,_=0,d=Te;Te=Te+48|0,o=d+16|0,l=(s=d)+32|0,f=0|_e[(i=(e|=0)+28|0)>>2],_e[l>>2]=f,f=(0|_e[(a=e+20|0)>>2])-f|0,_e[l+4>>2]=f,_e[l+8>>2]=r,f=f+(_e[l+12>>2]=t)|0,n=e+60|0,_e[s>>2]=_e[n>>2],_e[s+4>>2]=l,_e[s+8>>2]=2,s=0|Le(0|v(146,0|s));e:do{if((0|f)!=(0|s)){for(r=2;!((0|s)<0);)if(f=f-s|0,r=((u=(_=0|_e[l+4>>2])>>>0<s>>>0)<<31>>31)+r|0,_=s-(u?_:0)|0,_e[(l=u?l+8|0:l)>>2]=(0|_e[l>>2])+_,_e[(u=l+4|0)>>2]=(0|_e[u>>2])-_,_e[o>>2]=_e[n>>2],_e[4+o>>2]=l,_e[8+o>>2]=r,(0|f)==(0|(s=0|Le(0|v(146,0|o))))){c=3;break e}_e[e+16>>2]=0,_e[i>>2]=0,_e[a>>2]=0,_e[e>>2]=32|_e[e>>2],t=2==(0|r)?0:t-(0|_e[l+4>>2])|0}else c=3}while(0);return 3==(0|c)&&(_=0|_e[e+44>>2],_e[e+16>>2]=_+(0|_e[e+48>>2]),_e[i>>2]=_,_e[a>>2]=_),Te=d,0|t}function j(e,r,t){e|=0,r|=0,t|=0;var n,i,a,o,u,f,l,s,c,_=0,d=0,E=Te;for(Te=Te+224|0,f=E+120|0,l=E+80|0,s=E,c=E+136|0,_=l,d=_+40|0;_=_+4|(_e[_>>2]=0),(0|_)<(0|d););return _e[f>>2]=_e[t>>2],t=(0|w(0,r,f,s,l))<0?-1:(_e[e+76>>2],u=32&(t=0|_e[e>>2]),(0|ce[e+74>>0])<1&&(_e[e>>2]=-33&t),0|_e[(_=e+48|0)>>2]?t=0|w(e,r,f,s,l):(n=0|_e[(d=e+44|0)>>2],_e[d>>2]=c,_e[(i=e+28|0)>>2]=c,_e[(a=e+20|0)>>2]=c,_e[_>>2]=80,_e[(o=e+16|0)>>2]=80+c,t=0|w(e,r,f,s,l),n&&(ze[7&_e[e+36>>2]](e,0,0),t=0==(0|_e[a>>2])?-1:t,_e[d>>2]=n,_e[_>>2]=0,_e[o>>2]=0,_e[i>>2]=0,_e[a>>2]=0)),_=0|_e[e>>2],_e[e>>2]=_|u,0==(32&_|0)?t:-1),Te=E,0|t}function J(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,a,o,u,f,l,s,c=0,_=Te;for(Te=Te+64|0,l=_,f=0|_e[e>>2],s=e+(0|_e[f-8>>2])|0,f=0|_e[f-4>>2],_e[l>>2]=t,_e[l+4>>2]=e,_e[l+8>>2]=r,_e[l+12>>2]=n,e=l+16|0,r=l+20|0,n=l+24|0,i=l+28|0,a=l+32|0,o=l+40|0,c=e,u=c+36|0;c=c+4|(_e[c>>2]=0),(0|c)<(0|u););W[e+36>>1]=0,ce[e+38>>0]=0;e:do{if(0|we(f,t))_e[l+48>>2]=1,Qe[3&_e[20+(0|_e[f>>2])>>2]](f,l,s,s,1,0),e=1==(0|_e[n>>2])?s:0;else{switch(je[3&_e[24+(0|_e[f>>2])>>2]](f,l,s,1,0),0|_e[l+36>>2]){case 0:e=1==(0|_e[o>>2])&1==(0|_e[i>>2])&1==(0|_e[a>>2])?0|_e[r>>2]:0;break e;case 1:break;default:e=0;break e}if(1!=(0|_e[n>>2])&&!(0==(0|_e[o>>2])&1==(0|_e[i>>2])&1==(0|_e[a>>2]))){e=0;break}e=0|_e[e>>2]}}while(0);return Te=_,0|e}function $(e){var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=Te;if(Te=Te+544|0,o=f+16|0,i=(r=f)+32|0,8192<=((t=0|_e[(a=(e|=0)+8|0)>>2])+-1|0)>>>0&&(_e[r>>2]=866,_e[r+4>>2]=3006,_e[r+8>>2]=1257,Ce(i,812,r),Me(i)),_e[e>>2]=t,u=(r=0|_e[(n=e+20|0)>>2])?t:((r=0|te(180,0))?(_e[(u=r+164|0)>>2]=0,_e[u+4>>2]=0,_e[u+8>>2]=0,_e[u+12>>2]=0):r=0,_e[n>>2]=r,0|_e[e>>2]),o=0|_e[a>>2]?u:(_e[o>>2]=866,_e[o+4>>2]=910,_e[o+8>>2]=1497,Ce(i,812,o),Me(i),0|_e[e>>2]),i=0|_e[e+4>>2],!(16<o>>>0))return e=(e=0)|G(r,u,i,e),Te=f,0|e;for(t=o,n=0;a=n+1|0,3<t>>>0;)t>>>=1,n=a;return e=0|G(r,u,i,e=255&((e=n+2+(32!=(0|a)&1<<a>>>0<o>>>0&1)|0)>>>0<11?e:11)),Te=f,0|e}function Z(e){var r,t,n,i,a,o=0,u=0,f=Te;Te=Te+576|0,i=f+48|0,a=f+32|0,t=f+16|0,n=(r=f)+64|0,o=0|_e[(e|=0)+168>>2];do{if(0|o){if(u=0|_e[o+-4>>2],o=o+-8|0,0!=(0|u)&&(0|u)==(0|~_e[o>>2])||(_e[r>>2]=866,_e[r+4>>2]=651,_e[r+8>>2]=1579,Ce(n,812,r),Me(n)),7&o){_e[t>>2]=866,_e[4+t>>2]=2506,_e[8+t>>2]=1232,Ce(n,812,t),Me(n);break}ue(o,0,0,1,0);break}}while(0);Te=((o=0|_e[e+176>>2])&&(u=0|_e[o+-4>>2],o=o+-8|0,0!=(0|u)&&(0|u)==(0|~_e[o>>2])||(_e[a>>2]=866,_e[4+a>>2]=651,_e[8+a>>2]=1579,Ce(n,812,a),Me(n)),7&o?(_e[i>>2]=866,_e[4+i>>2]=2506,_e[8+i>>2]=1232,Ce(n,812,i),Me(n)):ue(o,0,0,1,0)),f)}function q(e,r,t){var n;return!(0!=(0|(e|=0))&73<(r|=0)>>>0&0!=(0|(t|=0)))||40!=(0|_e[t>>2])||18552!=((0|de[e>>0])<<8|0|de[e+1>>0]|0)||((0|de[e+2>>0])<<8|0|de[e+3>>0])>>>0<74||((0|de[e+7>>0])<<16|(0|de[e+6>>0])<<24|(0|de[e+8>>0])<<8|0|de[e+9>>0])>>>0>r>>>0?(t=0)|t:(_e[t+4>>2]=(0|de[e+12>>0])<<8|0|de[e+13>>0],_e[t+8>>2]=(0|de[e+14>>0])<<8|0|de[e+15>>0],_e[t+12>>2]=de[e+16>>0],_e[t+16>>2]=de[e+17>>0],r=e+18|0,_e[(n=t+32|0)>>2]=de[r>>0],r=(_e[4+n>>2]=0)|ce[r>>0],_e[t+20>>2]=r<<24>>24==0|r<<24>>24==9?8:16,_e[t+24>>2]=(0|de[e+26>>0])<<16|(0|de[e+25>>0])<<24|(0|de[e+27>>0])<<8|0|de[e+28>>0],_e[t+28>>2]=(0|de[e+30>>0])<<16|(0|de[e+29>>0])<<24|(0|de[e+31>>0])<<8|0|de[e+32>>0],0|(t=1))}function Q(e,r){e|=0;var t,n,i=0,a=0,o=0,u=0,f=0,l=Te;if(Te=Te+544|0,f=l+16|0,u=(i=l)+32|0,33<=(r|=0)>>>0&&(_e[i>>2]=866,_e[i+4>>2]=3199,_e[i+8>>2]=1350,Ce(u,812,i),Me(u)),(0|r)<=(0|(i=0|_e[(n=e+20|0)>>2])))return u=i,f=(a=0|_e[(o=a=e+16|0)>>2])>>>(f=32-r|0),a<<=r,_e[o>>2]=a,r=u-r|0,_e[n>>2]=r,Te=l,0|f;for(a=e+4|0,o=e+8|0,t=e+16|0;e=(0|(e=0|_e[a>>2]))==(0|_e[o>>2])?0:(_e[a>>2]=e+1,0|de[e>>0]),i=i+8|0,33<=(0|(_e[n>>2]=i))&&(_e[f>>2]=866,_e[f+4>>2]=3208,_e[f+8>>2]=1366,Ce(u,812,f),Me(u),i=0|_e[n>>2]),e=e<<32-i|_e[t>>2],_e[t>>2]=e,(0|i)<(0|r););return f=e>>>(f=32-r|0),u=e<<r,_e[t>>2]=u,r=i-r|0,_e[n>>2]=r,Te=l,0|f}function ee(e,r,t){e|=0,r|=0;var n,i=0,a=0,o=0,u=0;(a=0|_e[(i=(t|=0)+16|0)>>2])?o=5:0|be(t)?i=0:(a=0|_e[i>>2],o=5);e:do{if(5==(0|o)){if((a-(i=u=0|_e[(n=t+20|0)>>2])|0)>>>0<r>>>0){i=0|ze[7&_e[t+36>>2]](t,e,r);break}r:do{if(-1<(0|ce[t+75>>0])){for(u=r;;){if(!u){o=0,a=e;break r}if(10==(0|ce[e+(a=u+-1|0)>>0]))break;u=a}if((i=0|ze[7&_e[t+36>>2]](t,e,u))>>>0<u>>>0)break e;a=e+(o=u)|0,r=r-u|0,i=0|_e[n>>2]}else o=0,a=e}while(0);K(0|i,0|a,0|r),_e[n>>2]=(0|_e[n>>2])+r,i=o+r|0}}while(0);return 0|i}function re(e){var r,t=0,n=0,i=0,a=Te;Te=Te+544|0,i=a+16|0,r=(n=a)+32|0,t=0|_e[(e|=0)+20>>2];do{if(0|t){if(Z(t),7&t){_e[n>>2]=866,_e[n+4>>2]=2506,_e[n+8>>2]=1232,Ce(r,812,n),Me(r);break}ue(t,0,0,1,0);break}}while(0);if(!(n=0|_e[(t=e+4|0)>>2]))return ce[(i=e+16|0)>>0]=0,void(Te=a);7&n?(_e[i>>2]=866,_e[i+4>>2]=2506,_e[i+8>>2]=1232,Ce(r,812,i),Me(r)):ue(n,0,0,1,0),_e[t>>2]=0,_e[e+8>>2]=0,_e[e+12>>2]=0,ce[(i=e+16|0)>>0]=0,Te=a}function te(e,r){r|=0;var t,n,i,a=0,o=0,u=0,f=Te;return Te=Te+560|0,u=f+32|0,i=f+16|0,n=(a=f)+48|0,t=f+44|0,2147418112<(o=0|(o=(e|=0)+3&-4)?o:4)>>>0?(_e[a>>2]=866,_e[a+4>>2]=2506,_e[a+8>>2]=1103,Ce(n,812,a),Me(n),Te=f,(u=0)|u):(e=0|ue(0,_e[t>>2]=o,t,1,0),a=0|_e[t>>2],0|r&&(_e[r>>2]=a),0==(0|e)|a>>>0<o>>>0?(_e[i>>2]=866,_e[4+i>>2]=2506,_e[8+i>>2]=1129,Ce(n,812,i),Me(n),e=0):7&e&&(_e[u>>2]=866,_e[u+4>>2]=2533,_e[u+8>>2]=1156,Ce(n,812,u),Me(n)),Te=f,0|(u=e))}function ne(e,r,t){r|=0;var n,i,a,o=(e|=0)+(t|=0)|0;if(r&=255,67<=(0|t)){for(;3&e;)ce[e>>0]=r,e=e+1|0;for(i=(n=-4&o|0)-64|0,a=r|r<<8|r<<16|r<<24;(0|e)<=(0|i);)_e[e>>2]=a,_e[e+4>>2]=a,_e[e+8>>2]=a,_e[e+12>>2]=a,_e[e+16>>2]=a,_e[e+20>>2]=a,_e[e+24>>2]=a,_e[e+28>>2]=a,_e[e+32>>2]=a,_e[e+36>>2]=a,_e[e+40>>2]=a,_e[e+44>>2]=a,_e[e+48>>2]=a,_e[e+52>>2]=a,_e[e+56>>2]=a,_e[e+60>>2]=a,e=e+64|0;for(;(0|e)<(0|n);)_e[e>>2]=a,e=e+4|0}for(;(0|e)<(0|o);)ce[e>>0]=r,e=e+1|0;return o-t|0}function ae(e,r,t,n,i){e|=0,t|=0,n|=0,i|=0;var a,o,u,f;ce[(r|=0)+53>>0]=1;do{if((0|_e[r+4>>2])==(0|n)){if(ce[r+52>>0]=1,u=r+54|0,f=r+48|0,o=r+24|0,e=r+36|0,!(a=0|_e[(n=r+16|0)>>2])){if(_e[n>>2]=t,_e[o>>2]=i,!((_e[e>>2]=1)==(0|_e[f>>2])&1==(0|i)))break;ce[u>>0]=1;break}if((0|a)!=(0|t)){_e[e>>2]=1+(0|_e[e>>2]),ce[u>>0]=1;break}2==(0|(e=0|_e[o>>2]))&&(e=_e[o>>2]=i),1==(0|_e[f>>2])&1==(0|e)&&(ce[u>>0]=1)}}while(0)}function oe(e,r){e|=0;var t,n,i=0,a=0,o=0,u=0,f=Te;Te=Te+16|0,n=255&(r|=0),ce[(t=f)>>0]=n,(o=0|_e[(a=e+16|0)>>2])?u=4:0|be(e)?i=-1:(o=0|_e[a>>2],u=4);do{if(4==(0|u)){if((a=0|_e[(u=e+20|0)>>2])>>>0<o>>>0&&(0|(i=255&r))!=(0|ce[e+75>>0])){_e[u>>2]=a+1,ce[a>>0]=n;break}i=1==(0|ze[7&_e[e+36>>2]](e,t,1))?0|de[t>>0]:-1}}while(0);return Te=f,0|i}function ue(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;do{if(e){if(!r){if(F(e),!t){r=0;break}r=_e[t>>2]=0;break}n?e=0==(0|(r=0|function(e,r){r|=0;var t=0,n=0;if(!(e|=0))return 0|(r=0|I(r));if(4294967231<r>>>0)return _e[(r=296)>>2]=12,(r=0)|r;if(0|(t=0|function(e,r){r|=0;var t,n,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=(e|=0)+(i=-8&(l=0|_e[(s=e+4|0)>>2]))|0;if(!(3&l))return!(r>>>0<256)&&(r+4|0)>>>0<=i>>>0&&(i-r|0)>>>0<=_e[1264]<<1>>>0?0|e:(e=0)|e;if(r>>>0<=i>>>0)return(i=i-r|0)>>>0<=15||(f=e+r|0,_e[s>>2]=1&l|r|2,_e[f+4>>2]=3|i,_e[(s=f+i+4|0)>>2]=1|_e[s>>2],x(f,i)),0|e;if((0|c)==(0|_e[1150]))return i=(f=(0|_e[1147])+i|0)-r|0,a=e+r|0,f>>>0<=r>>>0?(e=0)|e:(_e[s>>2]=1&l|r|2,_e[a+4>>2]=1|i,_e[1150]=a,_e[1147]=i,0|e);if((0|c)==(0|_e[1149]))return(o=(0|_e[1146])+i|0)>>>0<r>>>0?(e=0)|e:(a=1&l,15<(i=o-r|0)>>>0?(f=(l=e+r|0)+i|0,_e[s>>2]=a|r|2,_e[l+4>>2]=1|i,_e[f>>2]=i,_e[(a=f+4|0)>>2]=-2&_e[a>>2],a=l):(_e[s>>2]=a|o|2,_e[(a=e+o+4|0)>>2]=1|_e[a>>2],i=a=0),_e[1146]=i,_e[1149]=a,0|e);if(2&(a=0|_e[4+c>>2])|0)return(e=0)|e;if((n=(-8&a)+i|0)>>>0<r>>>0)return(e=0)|e;f=n-r|0,o=a>>>3;do{if(a>>>0<256){if(a=0|_e[8+c>>2],(0|(i=0|_e[12+c>>2]))==(0|a)){_e[1144]=_e[1144]&~(1<<o);break}_e[a+12>>2]=i,_e[i+8>>2]=a;break}t=0|_e[24+c>>2],i=0|_e[12+c>>2];do{if((0|i)==(0|c)){if(i=0|_e[(a=(o=16+c|0)+4|0)>>2])u=a;else{if(!(i=0|_e[o>>2])){o=0;break}u=o}for(;;)if(0|(a=0|_e[(o=i+20|0)>>2]))i=a,u=o;else{if(!(o=0|_e[(a=i+16|0)>>2]))break;i=o,u=a}_e[u>>2]=0,o=i}else o=0|_e[8+c>>2],_e[o+12>>2]=i,_e[i+8>>2]=o,o=i}while(0);if(0|t){if(i=0|_e[28+c>>2],(0|c)==(0|_e[(a=4880+(i<<2)|0)>>2])){if(!(_e[a>>2]=o)){_e[1145]=_e[1145]&~(1<<i);break}}else if(!(_e[16+t+(((0|_e[16+t>>2])!=(0|c)&1)<<2)>>2]=o))break;_e[o+24>>2]=t,0|(a=0|_e[(i=16+c|0)>>2])&&(_e[o+16>>2]=a,_e[a+24>>2]=o),0|(i=0|_e[i+4>>2])&&(_e[o+20>>2]=i,_e[i+24>>2]=o)}}while(0);return i=1&l,f>>>0<16?(_e[s>>2]=n|i|2,_e[(s=e+n+4|0)>>2]=1|_e[s>>2]):(l=e+r|0,_e[s>>2]=i|r|2,_e[l+4>>2]=3|f,_e[(s=l+f+4|0)>>2]=1|_e[s>>2],x(l,f)),0|e}(e+-8|0,r>>>0<11?16:r+11&-8)))return 0|(r=t+8|0);return(t=0|I(r))?(n=0|_e[e+-4>>2],K(0|t,0|e,0|((n=(-8&n)-(0==(3&n|0)?8:4)|0)>>>0<r>>>0?n:r)),F(e),0|(r=t)):(r=0)|r}(e,r)))?e:r:r=0,t&&(i=0|pe(e),_e[t>>2]=i)}else r=0|I(r),t&&(e=r?0|pe(r):0,_e[t>>2]=e)}while(0);return 0|r}function fe(e,r,t){t|=0;var n;if(0<(r|=0)>>>0|0==(0|r)&4294967295<(e|=0)>>>0){for(;n=0|he(0|e,0|r,10,0),ce[(t=t+-1|0)>>0]=255&n|48,e=0|Fe(0|(n=e),0|r,10,0),9<r>>>0|9==(0|r)&4294967295<n>>>0;)r=L;r=e}else r=e;if(r)for(;ce[(t=t+-1|0)>>0]=(r>>>0)%10|48,!(r>>>0<10);)r=(r>>>0)/10|0;return 0|t}function le(e,r,t,n){e|=0,t|=0,n|=0;var i=0|_e[(e=(r|=0)+16|0)>>2],a=r+36|0,o=r+24|0;do{if(i){if((0|i)!=(0|t)){_e[a>>2]=1+(0|_e[a>>2]),_e[o>>2]=2,ce[r+54>>0]=1;break}2==(0|_e[o>>2])&&(_e[o>>2]=n)}else _e[e>>2]=t,_e[o>>2]=n,_e[a>>2]=1}while(0)}function Me(e){e|=0;var r=0,t=0,n=0|_e[119];_e[76+n>>2];do{if((0|function(e,r){r|=0;var t=0;return t=0|function(e){var r=0,t=0,n=0,n=e|=0;e:do{if(3&n)for(r=n;;){if(!(0|ce[e>>0])){e=r;break e}if(!(3&(r=e=e+1|0))){t=4;break}}else t=4}while(0);if(4==(0|t)){for(;!((-2139062144&(r=0|_e[e>>2])^-2139062144)&r+-16843009);)e=e+4|0;if((255&r)<<24>>24)for(;e=e+1|0,0!=(0|ce[e>>0]););}return e-n|0}(e=e|0),((0|function(e,r,t,n){e|=0,n|=0;var i=0;i=0|ie(t|=0,r|=0),t=0==(0|r)?0:t,e=(_e[n+76>>2],0|ee(e,i,n));(0|e)!=(0|i)&&(t=(e>>>0)/(r>>>0)|0);return 0|t}(e,1,t,r))!=(0|t))<<31>>31|0}(e,n))<0)e=1;else{if(10!=(0|ce[75+n>>0])&&(t=0|_e[(r=20+n|0)>>2])>>>0<(0|_e[16+n>>2])>>>0){_e[r>>2]=t+1,ce[t>>0]=10,e=0;break}e=(0|oe(n,10))<0}}while(0);return e<<31>>31|0}function se(e,r,t,n,i){e|=0,r|=0;var a,o=Te;if(Te=Te+256|0,a=o,(0|(n|=0))<(0|(t|=0))&0==(73728&(i|=0)|0)){if(ne(0|a,0|r,0|((i=t-n|0)>>>0<256?i:256)),255<i>>>0){for(r=t-n|0;Ie(e,a,256),i=i+-256|0,255<i>>>0;);i=255&r}Ie(e,a,i)}Te=o}function be(e){var r=0,t=0|ce[(r=(e|=0)+74|0)>>0];return ce[r>>0]=255+t|t,0|(e=8&(r=0|_e[e>>2])?(_e[e>>2]=32|r,-1):(_e[e+8>>2]=0,t=(_e[e+4>>2]=0)|_e[e+44>>2],_e[e+28>>2]=t,_e[e+20>>2]=t,_e[e+16>>2]=t+(0|_e[e+48>>2]),0))}function me(e){var r=0,t=0;return 0<(0|(t=(e|=0)+15&-16|0))&(0|(e=(r=0|_e[_>>2])+t|0))<(0|r)|(0|e)<0?(b(),h(12),-1):(0|(_e[_>>2]=e))>(0|M())&&0==(0|A())?(_e[_>>2]=r,h(12),-1):0|r}function Se(e){var r=0,t=0,n=0,t=0|_e[(e|=0)>>2];if((n=(0|ce[t>>0])-48|0)>>>0<10)for(r=0;r=n+(10*r|0)|0,t=t+1|0,_e[e>>2]=t,n=(0|ce[t>>0])-48|0,n>>>0<10;);else r=0;return 0|r}function Pe(e){var r=0;return(0|(r=0|ce[d+(255&(e|=0))>>0]))<8?0|r:(0|(r=0|ce[d+(e>>8&255)>>0]))<8?r+8|0:(0|(r=0|ce[d+(e>>16&255)>>0]))<8?r+16|0:24+(0|ce[d+(e>>>24)>>0])|0}function Re(e,r,t,n){t|=0,n|=0;var i=0;(0|_e[(r|=0)+4>>2])==(0|t)&&1!=(0|_e[(i=r+28|0)>>2])&&(_e[i>>2]=n)}function he(e,r,t,n){var i,a=Te;return Te=Te+16|0,B(e|=0,r|=0,t|=0,n|=0,i=0|a),Te=a,0|(L=0|_e[4+i>>2],0|_e[i>>2])}function pe(e){var r;return(e|=0)?0|(1==(0|(e=3&(r=0|_e[e+-4>>2])))?0:(-8&r)-(0==(0|e)?8:4)|0):0}function Ce(e,r,t){e|=0,r|=0,t|=0;var n=0,i=Te;return Te=Te+16|0,_e[(n=i)>>2]=t,t=0|(e=e,r=r,n=n,0|function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,a=0,o=0,u=0,f=0,l=0,s=Te;for(Te=Te+128|0,a=s+124|0,l=s,o=l,u=604,i=o+124|0;_e[o>>2]=_e[u>>2],o=o+4|0,u=u+4|0,(0|o)<(0|i););return 2147483646<(r+-1|0)>>>0?r?(_e[(r=296)>>2]=75,r=-1):(e=a,r=1,f=4):f=4,4==(0|f)&&(f=(f=-2-e|0)>>>0<r>>>0?f:r,_e[l+48>>2]=f,_e[(a=l+20|0)>>2]=e,r=(_e[l+44>>2]=e)+f|0,_e[(e=l+16|0)>>2]=r,_e[l+28>>2]=r,r=0|j(l,t,n),f&&(l=0|_e[a>>2],ce[l+(((0|l)==(0|_e[e>>2]))<<31>>31)>>0]=0)),Te=s,0|r}(e|=0,2147483647,r|=0,n|=0)),Te=i,0|t}function Ne(e,r,t){return e|=0,r|=0,(0|(t|=0))<32?(L=r<<t|(e&(1<<t)-1<<32-t)>>>32-t,e<<t):(L=e<<t-32,0)}function ye(e,r,t){return e|=0,r|=0,(0|(t|=0))<32?(L=r>>>t,e>>>t|(r&(1<<t)-1)<<32-t):r>>>t-32|(L=0)}function Oe(e,r){e|=0,r|=0;var t=Te;Te=Te+16|0,_e[t>>2]=r,j(r=0|_e[26],e,t),function(e,r){var t=0,n=0,i=0,a=0,o=255&(e|=0),t=255&e;_e[(r|=0)+76>>2],a=3;do{if(3==(0|a)){if((0|t)!=(0|ce[r+75>>0])&&(i=0|_e[(n=r+20|0)>>2])>>>0<(0|_e[r+16>>2])>>>0){_e[n>>2]=i+1,ce[i>>0]=o;break}t=0|oe(r,e)}}while(0)}(10,r),p()}function ve(e,r,t,n){return 0|(L=n=(r|=0)-(n|=0)-((e|=0)>>>0<(t|=0)>>>0|0)>>>0,e-t>>>0|0)}function ke(e){e=+e;var r;return k[g>>3]=e,r=0|_e[g>>2],L=0|_e[g+4>>2],0|r}function ge(e,r,t,n){return 0|(L=(r|=0)+(n|=0)+((t=(e|=0)+(t|=0)>>>0)>>>0<e>>>0|0)>>>0,0|t)}function Le(e){return 4294963200<(e|=0)>>>0&&(_e[74]=0-e,e=-1),0|e}function Ie(e,r,t){r|=0,t|=0,32&_e[(e|=0)>>2]||ee(r,t,e)}function De(e,r){return r|=0,0|(e=(e|=0)?0|function(e,r){e|=0,r|=0;do{if(e){if(r>>>0<128){ce[e>>0]=r,e=1;break}if(!(0|_e[_e[420>>2]>>2])){if(57216==(-128&r|0)){ce[e>>0]=r,e=1;break}_e[(e=296)>>2]=84,e=-1;break}if(r>>>0<2048){ce[e>>0]=r>>>6|192,ce[e+1>>0]=63&r|128,e=2;break}if(r>>>0<55296|57344==(-8192&r|0)){ce[e>>0]=r>>>12|224,ce[e+1>>0]=r>>>6&63|128,ce[e+2>>0]=63&r|128,e=3;break}if((r+-65536|0)>>>0<1048576){ce[e>>0]=r>>>18|240,ce[e+1>>0]=r>>>12&63|128,ce[e+2>>0]=r>>>6&63|128,ce[e+3>>0]=63&r|128,e=4;break}_e[(e=296)>>2]=84,e=-1;break}}while(e=1,0);return 0|e}(e,r):0)}function we(e,r){return(0|(e|=0))==(0|(r|=0))|0}function Ge(e,r){var t=0|xe(0|(e|=0));return 0|(0==(0|(r|=0))?e:t)}function Fe(e,r,t,n){return 0|B(e|=0,r|=0,t|=0,n|=0,0)}function xe(e){return(255&(e|=0))<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function Be(e,r,t,n,i,a){E(6)}function Ue(e,r,t,n,i){E(1)}function He(e){e=e|=0,F(e|=0)}function We(e,r,t,n){E(7)}function Ve(e,r,t){return E(0),0}function Xe(e){}function Ye(e){E(2)}function Ke(){E(5)}r.__ZSt18uncaught_exceptionv;var ze=[Ve,z,function(e,r,t){e|=0,r|=0,t|=0;var n,i,a=Te;return Te=Te+32|0,n=(i=a)+20|0,_e[i>>2]=_e[e+60>>2],_e[i+4>>2]=0,_e[i+8>>2]=r,_e[i+12>>2]=n,_e[i+16>>2]=t,e=(0|Le(0|O(140,0|i)))<0?_e[n>>2]=-1:0|_e[n>>2],Te=a,0|e},function(e,r,t){r|=0,t|=0;var n=0,i=Te;return Te=Te+32|0,n=i,_e[(e|=0)+36>>2]=1,0==(64&_e[e>>2]|0)&&(_e[n>>2]=_e[e+60>>2],_e[n+4>>2]=21523,_e[n+8>>2]=i+16,0|S(54,0|n))&&(ce[e+75>>0]=-1),n=0|z(e,r,t),Te=i,0|n},function(e,r,t){r|=0,t|=0;var n=0,i=0;return K(0|(i=0|_e[(n=(e|=0)+20|0)>>2]),0|r,0|(e=t>>>0<(e=(0|_e[e+16>>2])-i|0)>>>0?t:e)),_e[n>>2]=(0|_e[n>>2])+e,0|t},function(e,r,t){t|=0;var n,i,a=0,o=Te;if(Te=Te+64|0,i=o,0|we(e|=0,r|=0))r=1;else if(0!=(0|r)&&0!=(0|(a=0|J(r,32,16,0)))){for(r=i+4|0,n=r+52|0;r=r+4|(_e[r>>2]=0),(0|r)<(0|n););_e[i>>2]=a,_e[i+8>>2]=e,_e[i+12>>2]=-1,_e[i+48>>2]=1,er[3&_e[28+(0|_e[a>>2])>>2]](a,i,0|_e[t>>2],1),r=1==(0|_e[i+24>>2])?(_e[t>>2]=_e[i+16>>2],1):0}else r=0;return Te=o,0|r},Ve,Ve],je=[Ue,function(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0;var a=0;do{if(0|we(e,0|_e[r+8>>2]))Re(0,r,t,n);else if(0|we(e,0|_e[r>>2])){if(e=r+32|0,(0|_e[r+16>>2])!=(0|t)&&(0|_e[(a=r+20|0)>>2])!=(0|t)){_e[e>>2]=n,_e[a>>2]=t,_e[(n=r+40|0)>>2]=1+(0|_e[n>>2]),1==(0|_e[r+36>>2])&&2==(0|_e[r+24>>2])&&(ce[r+54>>0]=1),_e[r+44>>2]=4;break}1==(0|n)&&(_e[e>>2]=1)}}while(0)},function(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;var a,o=0,u=0,f=0;do{if(0|we(e,0|_e[r+8>>2]))Re(0,r,t,n);else{if(o=e+8|0,!(0|we(e,0|_e[r>>2]))){f=0|_e[o>>2],je[3&_e[24+(0|_e[f>>2])>>2]](f,r,t,n,i);break}if(e=r+32|0,(0|_e[r+16>>2])!=(0|t)&&(0|_e[(u=r+20|0)>>2])!=(0|t)){if(_e[e>>2]=n,4==(0|_e[(n=r+44|0)>>2]))break;ce[(e=r+52|0)>>0]=0,o=(ce[(a=r+53|0)>>0]=0)|_e[o>>2],Qe[3&_e[20+(0|_e[o>>2])>>2]](o,r,t,t,1,i),0|ce[a>>0]?0|ce[e>>0]?e=3:(e=3,f=11):(e=4,f=11),11==(0|f)&&(_e[u>>2]=t,_e[(a=r+40|0)>>2]=1+(0|_e[a>>2]),1==(0|_e[r+36>>2])&&2==(0|_e[r+24>>2])&&(ce[r+54>>0]=1)),_e[n>>2]=e;break}1==(0|n)&&(_e[e>>2]=1)}}while(0)},Ue],Je=[Ye,Xe,He,Xe,Xe,He,function(e){var r=Te;Te=Te+16|0,F(e|=0),0|P(0|_e[1285],0)?Oe(4406,r):Te=r},Ye],$e=[function(e){return E(3),0},function(e){var r,t,n=Te;return Te=Te+16|0,r=n,e=0|(t=0|_e[(e|=0)+60>>2],0|(t|=0)),_e[r>>2]=e,e=0|Le(0|R(6,0|r)),Te=n,0|e}],Ze=[function(e,r,t){E(4)}],qe=[Ke,function(){var e,r,t,n,i=0,a=0,o=0,u=Te;Te=Te+48|0,n=u+32|0,r=u+24|0,o=u+16|0,u=(t=u)+36|0,0|(i=0|function(){var e=0,r=0;{if(Te=(e=Te)+16|0,!(0|C(5136,2)))return r=0|m(0|_e[1285]),Te=e,0|r;Oe(4307,e)}return 0}())&&0|(a=0|_e[i>>2])&&(1126902528==(-256&(e=0|_e[(i=a+48|0)>>2])|0)&1129074247==(0|(i=0|_e[i+4>>2]))||(_e[r>>2]=4168,Oe(4118,r)),i=1126902529==(0|e)&1129074247==(0|i)?0|_e[a+44>>2]:a+80|0,_e[u>>2]=i,a=0|_e[a>>2],i=0|_e[a+4>>2],0|ze[7&_e[16+(0|_e[2])>>2]](8,a,u)?(o=0|_e[u>>2],o=0|$e[1&_e[8+(0|_e[o>>2])>>2]](o),_e[t>>2]=4168,_e[t+4>>2]=i,_e[t+8>>2]=o,Oe(4032,t)):(_e[o>>2]=4168,_e[o+4>>2]=i,Oe(4077,o))),Oe(4156,n)},function(){var e=Te;Te=Te+16|0,0|y(5140,6)?Oe(4356,e):Te=e},Ke],Qe=[Be,function(e,r,t,n,i,a){t|=0,n|=0,i|=0,0|we(e|=0,0|_e[(r|=0)+8>>2])&&ae(0,r,t,n,i)},function(e,r,t,n,i,a){t|=0,n|=0,i|=0,a|=0,0|we(e|=0,0|_e[(r|=0)+8>>2])?ae(0,r,t,n,i):(e=0|_e[e+8>>2],Qe[3&_e[20+(0|_e[e>>2])>>2]](e,r,t,n,i,a))},Be],er=[We,function(e,r,t,n){t|=0,n|=0,0|we(e|=0,0|_e[(r|=0)+8>>2])&&le(0,r,t,n)},function(e,r,t,n){t|=0,n|=0,0|we(e|=0,0|_e[(r|=0)+8>>2])?le(0,r,t,n):(e=0|_e[e+8>>2],er[3&_e[28+(0|_e[e>>2])>>2]](e,r,t,n))},We];return{stackSave:function(){return 0|Te},_i64Subtract:ve,_crn_get_bytes_per_block:function(e,r){e|=0,r|=0;var t,n,i=0,a=Te;switch(Te=Te+576|0,n=a+40|0,t=a+56|0,_e[(i=a)>>2]=40,q(e,r,i),e=0|_e[(r=i+32|0)+4>>2],0|_e[r>>2]){case 0:if(!e)return Te=a,0|(i=8);e=14;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:e=e?14:13;break;case 9:case 10:if(!e)return Te=a,0|(i=8);e=14;break;default:e=14}return 13==(0|e)?(Te=a,0|(i=16)):14==(0|e)?(_e[n>>2]=866,_e[4+n>>2]=2672,_e[8+n>>2]=1251,Ce(t,812,n),Me(t),Te=a,(i=0)|i):0},setThrew:function(e,r){},dynCall_viii:function(e,r,t,n){r|=0,t|=0,n|=0,Ze[0&(e|=0)](0|r,0|t,0|n)},_bitshift64Lshr:ye,_bitshift64Shl:Ne,dynCall_viiii:function(e,r,t,n,i){r|=0,t|=0,n|=0,i|=0,er[3&(e|=0)](0|r,0|t,0|n,0|i)},setTempRet0:function(e){L=e|=0},_crn_decompress:function(e,r,t,n,i,a){e|=0,r|=0,t|=0,n|=0,i|=0,a|=0;var o,u,f,l=0,s=0,c=0,_=0,d=0,E=Te;switch(Te=Te+592|0,f=E+56|0,c=E+40|0,o=E+72|0,u=(d=E)+68|0,_e[d>>2]=40,q(e,r,d),l=(0|_e[d+4>>2])>>>i,s=(0|_e[d+8>>2])>>>i,n=0|_e[(d=d+32|0)+4>>2],0|_e[d>>2]){case 0:n?_=14:d=8;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:_=n?14:13;break;case 9:case 10:n?_=14:d=8;break;default:_=14}13==(0|_)?d=16:14==(0|_)&&(_e[c>>2]=866,_e[c+4>>2]=2672,_e[c+8>>2]=1251,Ce(o,812,c),Me(o),d=0),_e[u>>2]=t,_=0|function(e,r){var t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0,d=0;if(Te=(_=Te)+528|0,u=(s=_)+16|0,0==(0|(e|=0))|(r|=0)>>>0<62)return Te=_,(d=0)|d;if(!(f=0|te(300,0)))return Te=_,(d=0)|d;_e[f>>2]=519686845,_e[4+f>>2]=0,_e[8+f>>2]=0,l=88+f|0,t=136+f|0,n=160+f|0,i=184+f|0,a=208+f|0,o=232+f|0,_e[(c=252+f|0)>>2]=0,_e[c+4>>2]=0,_e[c+8>>2]=0,ce[c+12>>0]=0,_e[(c=268+f|0)>>2]=0,_e[c+4>>2]=0,_e[c+8>>2]=0,ce[c+12>>0]=0,_e[(c=284+f|0)>>2]=0,_e[c+4>>2]=0,_e[c+8>>2]=0,ce[c+12>>0]=0,d=44+(c=l)|0;for(;_e[c>>2]=0,c=c+4|0,(0|c)<(0|d););if(ce[44+l>>0]=0,_e[t>>2]=0,_e[4+t>>2]=0,_e[8+t>>2]=0,_e[12+t>>2]=0,_e[16+t>>2]=0,ce[20+t>>0]=0,_e[n>>2]=0,_e[4+n>>2]=0,_e[8+n>>2]=0,_e[12+n>>2]=0,_e[16+n>>2]=0,ce[20+n>>0]=0,_e[i>>2]=0,_e[4+i>>2]=0,_e[8+i>>2]=0,_e[12+i>>2]=0,_e[16+i>>2]=0,ce[20+i>>0]=0,_e[a>>2]=0,_e[4+a>>2]=0,_e[8+a>>2]=0,_e[12+a>>2]=0,_e[16+a>>2]=0,ce[20+a>>0]=0,_e[o>>2]=0,_e[4+o>>2]=0,_e[8+o>>2]=0,_e[12+o>>2]=0,ce[16+o>>0]=0,0|function(e,r,t){e|=0;var n=0,i=0;if(!(0==(0|(r|=0))|(t|=0)>>>0<74||18552!=((0|de[r>>0])<<8|0|de[r+1>>0]|0))&&74<=((0|de[r+2>>0])<<8|0|de[r+3>>0])>>>0&&((0|de[r+7>>0])<<16|(0|de[r+6>>0])<<24|(0|de[r+8>>0])<<8|0|de[r+9>>0])>>>0<=t>>>0){if(_e[(n=e+88|0)>>2]=r,_e[e+4>>2]=r,_e[e+8>>2]=t,!(0|function(e){var r=0,t=0,n=0,i=0;if(i=92+(e|=0)|0,t=0|_e[(n=e+88|0)>>2],r=(0|_e[e+4>>2])+((0|de[68+t>>0])<<8|(0|de[67+t>>0])<<16|0|de[69+t>>0])|0,!(t=(0|de[65+t>>0])<<8|0|de[66+t>>0]))return(i=0)|i;if(_e[i>>2]=r,_e[e+96>>2]=r,_e[e+104>>2]=t,_e[e+100>>2]=r+t,_e[e+108>>2]=0,_e[e+112>>2]=0,!(0|V(i,e+116|0)))return(i=0)|i;r=0|_e[n>>2];do{if((0|de[r+39>>0])<<8|0|de[r+40>>0]){if(!(0|V(i,e+140|0)))return(i=0)|i;if(0|V(i,e+188|0)){r=0|_e[n>>2];break}return(i=0)|i}if(!((0|de[r+55>>0])<<8|0|de[r+56>>0]))return(i=0)|i}while(0);if((0|de[r+55>>0])<<8|0|de[r+56>>0]|0){if(!(0|V(i,e+164|0)))return(i=0)|i;if(!(0|V(i,e+212|0)))return(i=0)|i}return 0|(i=1)}(e)))return(i=0)|i;if(r=0|_e[n>>2],(0|de[r+39>>0])<<8|0|de[r+40>>0]?0|function(e){var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0,d=0;if(Te=(d=Te)+576|0,i=(o=d)+64|0,_=d+16|0,r=0|_e[(n=88+(e|=0)|0)>>2],c=(0|de[r+39>>0])<<8|0|de[r+40>>0],l=e+236|0,(0|(t=0|_e[(a=e+240|0)>>2]))!=(0|c)){if(t>>>0<=c>>>0){do{if((0|_e[e+244>>2])>>>0<c>>>0){if(0|X(l,c,(t+1|0)==(0|c),4,0)){r=0|_e[a>>2];break}return ce[e+248>>0]=1,Te=d,(_=0)|_}}while(r=t,0);ne((0|_e[l>>2])+(r<<2)|0,0,c-r<<2|0),r=0|_e[n>>2]}_e[a>>2]=c}if(s=e+92|0,t=(0|_e[e+4>>2])+((0|de[r+34>>0])<<8|(0|de[r+33>>0])<<16|0|de[r+35>>0])|0,!(r=(0|de[r+37>>0])<<8|(0|de[r+36>>0])<<16|0|de[r+38>>0]))return Te=d,(_=0)|_;if(_e[s>>2]=t,_e[e+96>>2]=t,_e[e+104>>2]=r,_e[e+100>>2]=t+r,_e[e+108>>2]=0,_e[e+112>>2]=0,u=_+20|0,_e[_>>2]=0,_e[_+4>>2]=0,_e[_+8>>2]=0,_e[_+12>>2]=0,ce[_+16>>0]=0,f=_+24|0,_e[_+44>>2]=0,_e[u>>2]=0,_e[u+4>>2]=0,_e[u+8>>2]=0,_e[u+12>>2]=0,_e[u+16>>2]=0,ce[u+20>>0]=0,0|V(s,_)&&0|V(s,f))if(0|_e[a>>2]||(_e[o>>2]=866,_e[o+4>>2]=910,_e[o+8>>2]=1497,Ce(i,812,o),Me(i)),c)for(t=(u=o=0)|_e[l>>2],a=i=r=e=n=0;;){if(o=(0|Ae(s,_))+o&31,a=(0|Ae(s,f))+a&63,i=(0|Ae(s,_))+i&31,r=(0|Ae(s,_))+r|0,e=(0|Ae(s,f))+e&63,n=(0|Ae(s,_))+n&31,_e[t>>2]=a<<5|o<<11|i|r<<27|e<<21|n<<16,c>>>0<=(u=u+1|0)>>>0){r=1;break}t=t+4|0,r&=31}else r=1;else r=0;return re(_+24|0),re(_),Te=d,0|(_=r)}(e)&&0|function(e){var r,t,n,i,a,o,u,f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k=0,g=0,L=0,I=0,D=0,w=0,G=0,F=0,x=0,B=Te;if(Te=Te+1008|0,D=(w=B)+496|0,F=B+472|0,E=B+276|0,T=B+80|0,A=B+16|0,g=0|_e[(e|=0)+88>>2],_=(0|de[g+47>>0])<<8|0|de[g+48>>0],d=e+92|0,k=(0|_e[e+4>>2])+((0|de[g+42>>0])<<8|(0|de[g+41>>0])<<16|0|de[g+43>>0])|0,!(g=(0|de[g+45>>0])<<8|(0|de[g+44>>0])<<16|0|de[g+46>>0]))return Te=B,(F=0)|F;if(_e[d>>2]=k,_e[e+96>>2]=k,_e[e+104>>2]=g,_e[e+100>>2]=k+g,_e[e+108>>2]=0,_e[e+112>>2]=0,_e[F+20>>2]=0,_e[F>>2]=0,_e[F+4>>2]=0,_e[F+8>>2]=0,_e[F+12>>2]=0,(ce[F+16>>0]=0)|V(d,F)){for(k=0,L=g=-3;_e[E+(k<<2)>>2]=L,_e[T+(k<<2)>>2]=g,I=2<(0|L),49!=(0|(k=k+1|0));)g=(1&I)+g|0,L=I?-3:L+1|0;for(k=A,g=k+64|0;k=k+4|(_e[k>>2]=0),(0|k)<(0|g););L=e+252|0,k=0|_e[(g=e+256|0)>>2];e:do{if((0|k)==(0|_))G=13;else{if(k>>>0<=_>>>0){do{if((0|_e[e+260>>2])>>>0<_>>>0){if(0|X(L,_,(k+1|0)==(0|_),4,0)){k=0|_e[g>>2];break}ce[e+264>>0]=1,k=0;break e}}while(0);ne((0|_e[L>>2])+(k<<2)|0,0,_-k<<2|0)}_e[g>>2]=_,G=13}}while(0);do{if(13==(0|G)){if(!_){_e[w>>2]=866,_e[w+4>>2]=910,_e[w+8>>2]=1497,Ce(D,812,w),Me(D),k=1;break}for(e=4+A|0,D=8+A|0,w=12+A|0,G=16+A|0,r=20+A|0,t=24+A|0,n=28+A|0,i=32+A|0,a=36+A|0,o=40+A|0,u=44+A|0,f=48+A|0,l=52+A|0,s=56+A|0,c=60+A|0,k=(I=0)|_e[L>>2],g=0|_e[e>>2],L=0|_e[A>>2];v=0|Ae(d,F),L=L+(0|_e[E+(v<<2)>>2])&3,g=g+(0|_e[T+(v<<2)>>2])&3,v=0|Ae(d,F),x=(0|_e[D>>2])+(0|_e[E+(v<<2)>>2])&3,_e[D>>2]=x,v=(0|_e[w>>2])+(0|_e[T+(v<<2)>>2])&3,_e[w>>2]=v,y=0|Ae(d,F),O=(0|_e[G>>2])+(0|_e[E+(y<<2)>>2])&3,_e[G>>2]=O,y=(0|_e[r>>2])+(0|_e[T+(y<<2)>>2])&3,_e[r>>2]=y,C=0|Ae(d,F),N=(0|_e[t>>2])+(0|_e[E+(C<<2)>>2])&3,_e[t>>2]=N,C=(0|_e[n>>2])+(0|_e[T+(C<<2)>>2])&3,_e[n>>2]=C,h=0|Ae(d,F),p=(0|_e[i>>2])+(0|_e[E+(h<<2)>>2])&3,_e[i>>2]=p,h=(0|_e[a>>2])+(0|_e[T+(h<<2)>>2])&3,_e[a>>2]=h,P=0|Ae(d,F),R=(0|_e[o>>2])+(0|_e[E+(P<<2)>>2])&3,_e[o>>2]=R,P=(0|_e[u>>2])+(0|_e[T+(P<<2)>>2])&3,_e[u>>2]=P,m=0|Ae(d,F),S=(0|_e[f>>2])+(0|_e[E+(m<<2)>>2])&3,_e[f>>2]=S,m=(0|_e[l>>2])+(0|_e[T+(m<<2)>>2])&3,_e[l>>2]=m,M=0|Ae(d,F),b=(0|_e[s>>2])+(0|_e[E+(M<<2)>>2])&3,_e[s>>2]=b,M=(0|_e[c>>2])+(0|_e[T+(M<<2)>>2])&3,_e[c>>2]=M,_e[k>>2]=(0|de[1441+g>>0])<<2|0|de[1441+L>>0]|(0|de[1441+x>>0])<<4|(0|de[1441+v>>0])<<6|(0|de[1441+O>>0])<<8|(0|de[1441+y>>0])<<10|(0|de[1441+N>>0])<<12|(0|de[1441+C>>0])<<14|(0|de[1441+p>>0])<<16|(0|de[1441+h>>0])<<18|(0|de[1441+R>>0])<<20|(0|de[1441+P>>0])<<22|(0|de[1441+S>>0])<<24|(0|de[1441+m>>0])<<26|(0|de[1441+b>>0])<<28|(0|de[1441+M>>0])<<30,!(_>>>0<=(I=I+1|0)>>>0);)k=k+4|0;_e[A>>2]=L,_e[e>>2]=g,k=1}}while(0)}else k=0;return re(F),Te=B,0|(x=k)}(e)&&(r=0|_e[n>>2],i=11):i=11,11==(0|i)){if(!((0|de[r+55>>0])<<8|0|de[r+56>>0]))return 0|(i=1);if(0|function(e){var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0;if(Te=(l=Te)+560|0,n=(i=l)+40|0,f=l+16|0,t=0|_e[88+(e|=0)>>2],o=(0|de[t+55>>0])<<8|0|de[t+56>>0],u=e+92|0,r=(0|_e[e+4>>2])+((0|de[t+50>>0])<<8|(0|de[t+49>>0])<<16|0|de[t+51>>0])|0,!(t=(0|de[t+53>>0])<<8|(0|de[t+52>>0])<<16|0|de[t+54>>0]))return Te=l,(f=0)|f;_e[u>>2]=r,_e[e+96>>2]=r,_e[e+104>>2]=t,_e[e+100>>2]=r+t,_e[e+108>>2]=0,_e[e+112>>2]=0,_e[f+20>>2]=0,_e[f>>2]=0,_e[f+4>>2]=0,_e[f+8>>2]=0,_e[f+12>>2]=0,ce[f+16>>0]=0;e:do{if(0|V(u,f)){if(a=e+268|0,(0|(r=0|_e[(t=e+272|0)>>2]))!=(0|o)){if(r>>>0<=o>>>0){do{if((0|_e[e+276>>2])>>>0<o>>>0){if(0|X(a,o,(r+1|0)==(0|o),2,0)){r=0|_e[t>>2];break}ce[e+280>>0]=1,r=0;break e}}while(0);ne((0|_e[a>>2])+(r<<1)|0,0,o-r<<1|0)}_e[t>>2]=o}if(!o){_e[i>>2]=866,_e[i+4>>2]=910,_e[i+8>>2]=1497,Ce(n,812,i),Me(n),r=1;break}for(r=(n=e=t=0)|_e[a>>2];;){if(a=0|Ae(u,f),n=a+n&255,e=(0|Ae(u,f))+e&255,W[r>>1]=e<<8|n,o>>>0<=(t=t+1|0)>>>0){r=1;break}r=r+2|0}}else r=0}while(0);return re(f),Te=l,0|(f=r)}(e)&&0|function(e){var r,t,n,i,a,o,u,f,l,s,c,_,d,E,T,A,M,b,m,S,P,R=0,h=0,p=0,C=0,N=0,y=0,O=0,v=0,k=0,g=0,L=0,I=0,D=0,w=0,G=0,F=0,x=0,B=0,U=0,H=Te;if(Te=Te+2416|0,N=(y=H)+1904|0,B=H+1880|0,b=H+980|0,m=H+80|0,S=H+16|0,h=0|_e[(e|=0)+88>>2],A=(0|de[h+63>>0])<<8|0|de[h+64>>0],M=e+92|0,R=(0|_e[e+4>>2])+((0|de[h+58>>0])<<8|(0|de[h+57>>0])<<16|0|de[h+59>>0])|0,!(h=(0|de[h+61>>0])<<8|(0|de[h+60>>0])<<16|0|de[h+62>>0]))return Te=H,(B=0)|B;if(_e[M>>2]=R,_e[e+96>>2]=R,_e[e+104>>2]=h,_e[e+100>>2]=R+h,_e[e+108>>2]=0,_e[e+112>>2]=0,_e[B+20>>2]=0,_e[B>>2]=0,_e[B+4>>2]=0,_e[B+8>>2]=0,_e[B+12>>2]=0,(ce[B+16>>0]=0)|V(M,B)){for(R=0,p=h=-7;_e[b+(R<<2)>>2]=p,_e[m+(R<<2)>>2]=h,C=6<(0|p),225!=(0|(R=R+1|0));)h=(1&C)+h|0,p=C?-7:p+1|0;for(R=S,h=R+64|0;R=R+4|(_e[R>>2]=0),(0|R)<(0|h););C=e+284|0,h=3*A|0,R=0|_e[(p=e+288|0)>>2];e:do{if((0|R)==(0|h))O=13;else{if(R>>>0<=h>>>0){do{if((0|_e[e+292>>2])>>>0<h>>>0){if(0|X(C,h,(R+1|0)==(0|h),2,0)){R=0|_e[p>>2];break}ce[e+296>>0]=1,R=0;break e}}while(0);ne((0|_e[C>>2])+(R<<1)|0,0,h-R<<1|0)}_e[p>>2]=h,O=13}}while(0);do{if(13==(0|O)){if(!A){_e[y>>2]=866,_e[y+4>>2]=910,_e[y+8>>2]=1497,Ce(N,812,y),Me(N),R=1;break}for(r=4+S|0,t=8+S|0,n=12+S|0,i=16+S|0,a=20+S|0,o=24+S|0,u=28+S|0,f=32+S|0,l=36+S|0,s=40+S|0,c=44+S|0,_=48+S|0,d=52+S|0,E=56+S|0,T=60+S|0,R=(x=0)|_e[C>>2],h=0|_e[S>>2],p=0|_e[r>>2],C=0|_e[t>>2],e=0|_e[n>>2],N=0|_e[i>>2],y=0|_e[a>>2],O=0|_e[o>>2],v=0|_e[u>>2],k=0|_e[f>>2],g=0|_e[l>>2],L=0|_e[s>>2],I=0|_e[c>>2],F=G=w=D=0;U=0|Ae(M,B),h=h+(0|_e[b+(U<<2)>>2])&7,p=p+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),C=C+(0|_e[b+(U<<2)>>2])&7,e=e+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),N=N+(0|_e[b+(U<<2)>>2])&7,y=y+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),O=O+(0|_e[b+(U<<2)>>2])&7,v=v+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),k=k+(0|_e[b+(U<<2)>>2])&7,g=g+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),L=L+(0|_e[b+(U<<2)>>2])&7,I=I+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),D=D+(0|_e[b+(U<<2)>>2])&7,w=w+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),G=G+(0|_e[b+(U<<2)>>2])&7,F=F+(0|_e[m+(U<<2)>>2])&7,U=0|de[1445+y>>0],W[R>>1]=(0|de[1445+p>>0])<<3|0|de[1445+h>>0]|(0|de[1445+C>>0])<<6|(0|de[1445+e>>0])<<9|(0|de[1445+N>>0])<<12|U<<15,P=0|de[1445+L>>0],W[R+2>>1]=(0|de[1445+O>>0])<<2|U>>>1|(0|de[1445+v>>0])<<5|(0|de[1445+k>>0])<<8|(0|de[1445+g>>0])<<11|P<<14,W[R+4>>1]=(0|de[1445+I>>0])<<1|P>>>2|(0|de[1445+D>>0])<<4|(0|de[1445+w>>0])<<7|(0|de[1445+G>>0])<<10|(0|de[1445+F>>0])<<13,!(A>>>0<=(x=x+1|0)>>>0);)R=R+6|0;_e[S>>2]=h,_e[r>>2]=p,_e[t>>2]=C,_e[n>>2]=e,_e[i>>2]=N,_e[a>>2]=y,_e[o>>2]=O,_e[u>>2]=v,_e[f>>2]=k,_e[l>>2]=g,_e[s>>2]=L,_e[c>>2]=I,_e[_>>2]=D,_e[d>>2]=w,_e[E>>2]=G,_e[T>>2]=F,R=1}}while(0)}else R=0;return re(B),Te=H,0|(U=R)}(e))return 0|(i=1)}return(i=0)|i}return _e[e+88>>2]=0,(i=0)|i}(f,e,r))return Te=_,0|(d=f);return U(f),Te=(7&f?(_e[s>>2]=866,_e[s+4>>2]=2506,_e[s+8>>2]=1232,Ce(u,812,s),Me(u)):ue(f,0,0,1,0),_),(d=0)|d}(e,r),r=a+i|0;do{if(i>>>0<r>>>0){if(!_){for(n=t;n=n+(0|ie(0|ie((l+3|0)>>>2,d),(s+3|0)>>>2))|0,(0|(i=i+1|0))!=(0|r);)s>>>=1,l>>>=1;_e[u>>2]=n;break}for(e=s,n=t;s=0|ie((l+3|0)>>>2,d),15<i>>>0|(c=0|ie(s,(e+3|0)>>>2))>>>0<8||519686845!=(0|_e[_>>2])||(function(e,r,t,n,i){r|=0,t|=0,n|=0,i|=0;var a=0,o=0,u=0,f=0,l=0,s=0;Te=(s=Te)+528|0,f=(l=s)+16|0,o=0|_e[88+(e|=0)>>2],u=(0|de[70+o+(i<<2)+1>>0])<<16|(0|de[70+o+(i<<2)>>0])<<24|(0|de[70+o+(i<<2)+2>>0])<<8|0|de[70+o+(i<<2)+3>>0],a=(a=i+1|0)>>>0<(0|de[16+o>>0])>>>0?(0|de[70+o+(a<<2)+1>>0])<<16|(0|de[70+o+(a<<2)>>0])<<24|(0|de[70+o+(a<<2)+2>>0])<<8|0|de[70+o+(a<<2)+3>>0]:0|_e[e+8>>2];if(u>>>0<a>>>0)return f=0|_e[(f=e+4|0)>>2],l=0|Y(e,f=f+u|0,l=a-u|0,r,t,n,i),Te=s;_e[l>>2]=866,_e[l+4>>2]=3694,_e[l+8>>2]=1508,Ce(f,812,l),Me(f),f=0|_e[(f=e+4|0)>>2],l=0|Y(e,f=f+u|0,l=a-u|0,r,t,n,i),Te=s}(_,u,c,s,i),n=0|_e[u>>2]),n=n+c|0,_e[u>>2]=n,(0|(i=i+1|0))!=(0|r);)e>>>=1,l>>>=1}}while(0);Te=(_&&519686845==(0|_e[_>>2])&&(U(_),7&_?(_e[f>>2]=866,_e[4+f>>2]=2506,_e[8+f>>2]=1232,Ce(o,812,f),Me(o)):ue(_,0,0,1,0)),E)},_memset:ne,_sbrk:me,_memcpy:K,stackAlloc:function(e){var r=Te;return Te=(Te=Te+(e|=0)|0)+15&-16,0|r},_crn_get_height:function(e,r){e|=0,r|=0;var t,n=Te;return Te=Te+48|0,_e[(t=n)>>2]=40,q(e,r,t),Te=n,0|_e[t+8>>2]},dynCall_vi:function(e,r){r|=0,Je[7&(e|=0)](0|r)},getTempRet0:function(){return 0|L},_crn_get_levels:function(e,r){e|=0,r|=0;var t,n=Te;return Te=Te+48|0,_e[(t=n)>>2]=40,q(e,r,t),Te=n,0|_e[t+12>>2]},_crn_get_uncompressed_size:function(e,r,t){e|=0,r|=0,t|=0;var n,i,a,o,u=0,f=Te;switch(Te=Te+576|0,a=f+40|0,i=f+56|0,_e[(o=f)>>2]=40,q(e,r,o),n=(3+((0|_e[o+4>>2])>>>t)|0)>>>2,r=(3+((0|_e[o+8>>2])>>>t)|0)>>>2,e=0|_e[(t=o+32|0)+4>>2],0|_e[t>>2]){case 0:e?u=14:e=8;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:u=e?14:13;break;case 9:case 10:e?u=14:e=8;break;default:u=14}return 13==(0|u)?e=16:14==(0|u)&&(_e[a>>2]=866,_e[4+a>>2]=2672,_e[8+a>>2]=1251,Ce(i,812,a),Me(i),e=0),o=0|ie(0|ie(r,n),e),Te=f,0|o},_i64Add:ge,dynCall_iiii:function(e,r,t,n){return r|=0,t|=0,n|=0,0|ze[7&(e|=0)](0|r,0|t,0|n)},_emscripten_get_global_libc:function(){return 5072},dynCall_ii:function(e,r){return r|=0,0|$e[1&(e|=0)](0|r)},___udivdi3:Fe,_llvm_bswap_i32:xe,dynCall_viiiii:function(e,r,t,n,i,a){r|=0,t|=0,n|=0,i|=0,a|=0,je[3&(e|=0)](0|r,0|t,0|n,0|i,0|a)},___cxa_can_catch:function(e,r,t){e|=0,r|=0,t|=0;var n,i=Te;return Te=Te+16|0,_e[(n=i)>>2]=_e[t>>2],(e=0|ze[7&_e[16+(0|_e[e>>2])>>2]](e,r,n))&&(_e[t>>2]=_e[n>>2]),Te=i,1&e|0},_free:F,runPostSets:function(){},dynCall_viiiiii:function(e,r,t,n,i,a,o){r|=0,t|=0,n|=0,i|=0,a|=0,o|=0,Qe[3&(e|=0)](0|r,0|t,0|n,0|i,0|a,0|o)},establishStackSpace:function(e,r){Te=e|=0},___uremdi3:he,___cxa_is_pointer_type:function(e){return 1&(e=(e|=0)?0!=(0|J(e,32,88,0)):0)|0},stackRestore:function(e){Te=e|=0},_malloc:I,_emscripten_replace_memory:function(e){return!(16777215&c(e)||c(e)<=16777215||2147483648<c(e))&&(ce=new n(e),W=new i(e),_e=new a(e),de=new o(e),Ee=new u(e),new f(e),new l(e),k=new s(e),!0)},dynCall_v:function(e){qe[3&(e|=0)]()},_crn_get_width:function(e,r){e|=0,r|=0;var t,n=Te;return Te=Te+48|0,_e[(t=n)>>2]=40,q(e,r,t),Te=n,0|_e[t+4>>2]},_crn_get_dxt_format:function(e,r){e|=0,r|=0;var t,n=Te;return Te=Te+48|0,_e[(t=n)>>2]=40,q(e,r,t),Te=n,0|_e[t+32>>2]}}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module.stackSave=asm.stackSave,Module.getTempRet0=asm.getTempRet0,Module._memset=asm._memset,Module.setThrew=asm.setThrew,Module._bitshift64Lshr=asm._bitshift64Lshr,Module._bitshift64Shl=asm._bitshift64Shl,Module.setTempRet0=asm.setTempRet0,Module._crn_decompress=asm._crn_decompress,Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,Module._sbrk=asm._sbrk,Module._memcpy=asm._memcpy,Module.stackAlloc=asm.stackAlloc,Module._crn_get_height=asm._crn_get_height,Module._i64Subtract=asm._i64Subtract,Module._crn_get_levels=asm._crn_get_levels,Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,Module._i64Add=asm._i64Add,Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,Module.___udivdi3=asm.___udivdi3,Module._llvm_bswap_i32=asm._llvm_bswap_i32,Module.___cxa_can_catch=asm.___cxa_can_catch;var _free=Module._free=asm._free;Module.runPostSets=asm.runPostSets,Module.establishStackSpace=asm.establishStackSpace,Module.___uremdi3=asm.___uremdi3,Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,Module.stackRestore=asm.stackRestore;var _malloc=Module._malloc=asm._malloc,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,initialStackTop;function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function r(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,0<runDependencies||(preRun(),0<runDependencies||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),r()},1)):r()))}function exit(e,r){r&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE&&process.exit(e),Module.quit(e,new ExitStatus(e)))}Module._crn_get_width=asm._crn_get_width,Module._crn_get_dxt_format=asm._crn_get_dxt_format,Module.dynCall_iiii=asm.dynCall_iiii,Module.dynCall_viiiii=asm.dynCall_viiiii,Module.dynCall_vi=asm.dynCall_vi,Module.dynCall_ii=asm.dynCall_ii,Module.dynCall_viii=asm.dynCall_viii,Module.dynCall_v=asm.dynCall_v,Module.dynCall_viiiiii=asm.dynCall_viiiiii,Module.dynCall_viiii=asm.dynCall_viiii,Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus,dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){e=e||[],ensureInitRuntime();var r=e.length+1;function t(){for(var e=0;e<3;e++)n.push(0)}var n=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];t();for(var i=0;i<r-1;i+=1)n.push(allocate(intArrayFromString(e[i]),"i8",ALLOC_NORMAL)),t();n.push(0),n=allocate(n,"i32",ALLOC_NORMAL);try{exit(Module._main(r,n,0),!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);var a=e;e&&"object"==typeof e&&e.stack&&(a=[e,e.stack]),Module.printErr("exception thrown: "+a),Module.quit(1,e)}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];function abort(r){Module.onAbort&&Module.onAbort(r),r=void 0!==r?(Module.print(r),Module.printErr(r),JSON.stringify(r)):"",ABORT=!0;var t="abort("+r+") at "+stackTrace()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";throw abortDecorators&&abortDecorators.forEach(function(e){t=e(t,r)}),t}if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);0<Module.preInit.length;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run();var crunch=Module,CRN_FORMAT={cCRNFmtInvalid:-1,cCRNFmtDXT1:0,cCRNFmtDXT3:1,cCRNFmtDXT5:2},DXT_FORMAT_MAP={},dst,dxtData;DXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT1]=PixelFormat$1.RGB_DXT1,DXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT3]=PixelFormat$1.RGBA_DXT3,DXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT5]=PixelFormat$1.RGBA_DXT5;var cachedDstSize=0;function arrayBufferCopy(e,r,t,n){for(var i=t/4,a=n%4,o=new Uint32Array(e.buffer,0,(n-a)/4),u=new Uint32Array(r.buffer),f=0;f<o.length;f++)u[i+f]=o[f];for(f=n-a;f<n;f++)r[t+f]=e[f]}function transcodeCRNToDXT(e,r){var t=e.byteLength,n=new Uint8Array(e),e=crunch._malloc(t);arrayBufferCopy(n,crunch.HEAPU8,e,t);var n=crunch._crn_get_dxt_format(e,t),i=DXT_FORMAT_MAP[n];if(!when.defined(i))throw new RuntimeError.RuntimeError("Unsupported compressed format.");for(var a=crunch._crn_get_levels(e,t),o=crunch._crn_get_width(e,t),u=crunch._crn_get_height(e,t),f=0,l=0;l<a;++l)f+=PixelFormat$1.compressedTextureSizeInBytes(i,o>>l,u>>l);cachedDstSize<f&&(when.defined(dst)&&crunch._free(dst),dst=crunch._malloc(f),dxtData=new Uint8Array(crunch.HEAPU8.buffer,dst,f),cachedDstSize=f),crunch._crn_decompress(e,t,dst,f,0,a),crunch._free(e);t=PixelFormat$1.compressedTextureSizeInBytes(i,o,u),e=dxtData.subarray(0,t),t=new Uint8Array(t);return t.set(e,0),r.push(t.buffer),new CompressedTextureBuffer(i,o,u,t)}var transcodeCRNToDXT$1=createTaskProcessorWorker(transcodeCRNToDXT);return transcodeCRNToDXT$1}); +define(["./when-54335d57","./WebGLConstants-95ceb4e9","./RuntimeError-88a32665","./createTaskProcessorWorker"],function(when,WebGLConstants,RuntimeError,createTaskProcessorWorker){"use strict";function CompressedTextureBuffer(e,r,t,n){this._format=e,this._width=r,this._height=t,this._buffer=n}Object.defineProperties(CompressedTextureBuffer.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),CompressedTextureBuffer.clone=function(e){if(when.defined(e))return new CompressedTextureBuffer(e._format,e._width,e._height,e._buffer)},CompressedTextureBuffer.prototype.clone=function(){return CompressedTextureBuffer.clone(this)};var PixelDatatype={UNSIGNED_BYTE:WebGLConstants.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:WebGLConstants.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:WebGLConstants.WebGLConstants.UNSIGNED_INT,FLOAT:WebGLConstants.WebGLConstants.FLOAT,HALF_FLOAT:WebGLConstants.WebGLConstants.HALF_FLOAT_OES,UNSIGNED_INT_24_8:WebGLConstants.WebGLConstants.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:WebGLConstants.WebGLConstants.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_6_5,toWebGLConstant:function(e,r){switch(e){case PixelDatatype.UNSIGNED_BYTE:return WebGLConstants.WebGLConstants.UNSIGNED_BYTE;case PixelDatatype.UNSIGNED_SHORT:return WebGLConstants.WebGLConstants.UNSIGNED_SHORT;case PixelDatatype.UNSIGNED_INT:return WebGLConstants.WebGLConstants.UNSIGNED_INT;case PixelDatatype.FLOAT:return WebGLConstants.WebGLConstants.FLOAT;case PixelDatatype.HALF_FLOAT:return r.webgl2?WebGLConstants.WebGLConstants.HALF_FLOAT:WebGLConstants.WebGLConstants.HALF_FLOAT_OES;case PixelDatatype.UNSIGNED_INT_24_8:return WebGLConstants.WebGLConstants.UNSIGNED_INT_24_8;case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:return WebGLConstants.WebGLConstants.UNSIGNED_SHORT_4_4_4_4;case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:return WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_5_5_1;case PixelDatatype.UNSIGNED_SHORT_5_6_5:return PixelDatatype.UNSIGNED_SHORT_5_6_5}},isPacked:function(e){return e===PixelDatatype.UNSIGNED_INT_24_8||e===PixelDatatype.UNSIGNED_SHORT_4_4_4_4||e===PixelDatatype.UNSIGNED_SHORT_5_5_5_1||e===PixelDatatype.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case PixelDatatype.UNSIGNED_BYTE:return 1;case PixelDatatype.UNSIGNED_SHORT:case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:case PixelDatatype.UNSIGNED_SHORT_5_6_5:case PixelDatatype.HALF_FLOAT:return 2;case PixelDatatype.UNSIGNED_INT:case PixelDatatype.FLOAT:case PixelDatatype.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===PixelDatatype.UNSIGNED_BYTE||e===PixelDatatype.UNSIGNED_SHORT||e===PixelDatatype.UNSIGNED_INT||e===PixelDatatype.FLOAT||e===PixelDatatype.HALF_FLOAT||e===PixelDatatype.UNSIGNED_INT_24_8||e===PixelDatatype.UNSIGNED_SHORT_4_4_4_4||e===PixelDatatype.UNSIGNED_SHORT_5_5_5_1||e===PixelDatatype.UNSIGNED_SHORT_5_6_5}},PixelDatatype$1=Object.freeze(PixelDatatype),PixelFormat={DEPTH_COMPONENT:WebGLConstants.WebGLConstants.DEPTH_COMPONENT,DEPTH_STENCIL:WebGLConstants.WebGLConstants.DEPTH_STENCIL,ALPHA:WebGLConstants.WebGLConstants.ALPHA,RGB:WebGLConstants.WebGLConstants.RGB,RGBA:WebGLConstants.WebGLConstants.RGBA,LUMINANCE:WebGLConstants.WebGLConstants.LUMINANCE,LUMINANCE_ALPHA:WebGLConstants.WebGLConstants.LUMINANCE_ALPHA,RGB_DXT1:WebGLConstants.WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:WebGLConstants.WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:WebGLConstants.WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:WebGLConstants.WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:WebGLConstants.WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case PixelFormat.RGB:return 3;case PixelFormat.RGBA:return 4;case PixelFormat.LUMINANCE_ALPHA:return 2;case PixelFormat.ALPHA:case PixelFormat.LUMINANCE:default:return 1}},validate:function(e){return e===PixelFormat.DEPTH_COMPONENT||e===PixelFormat.DEPTH_STENCIL||e===PixelFormat.ALPHA||e===PixelFormat.RGB||e===PixelFormat.RGBA||e===PixelFormat.LUMINANCE||e===PixelFormat.LUMINANCE_ALPHA||e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5||e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1||e===PixelFormat.RGB_ETC1},isColorFormat:function(e){return e===PixelFormat.ALPHA||e===PixelFormat.RGB||e===PixelFormat.RGBA||e===PixelFormat.LUMINANCE||e===PixelFormat.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===PixelFormat.DEPTH_COMPONENT||e===PixelFormat.DEPTH_STENCIL},isCompressedFormat:function(e){return e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5||e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1||e===PixelFormat.RGB_ETC1},isDXTFormat:function(e){return e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5},isPVRTCFormat:function(e){return e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===PixelFormat.RGB_ETC1},compressedTextureSizeInBytes:function(e,r,t){switch(e){case PixelFormat.RGB_DXT1:case PixelFormat.RGBA_DXT1:case PixelFormat.RGB_ETC1:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*8;case PixelFormat.RGBA_DXT3:case PixelFormat.RGBA_DXT5:return Math.floor((r+3)/4)*Math.floor((t+3)/4)*16;case PixelFormat.RGB_PVRTC_4BPPV1:case PixelFormat.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(r,8)*Math.max(t,8)*4+7)/8);case PixelFormat.RGB_PVRTC_2BPPV1:case PixelFormat.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(r,16)*Math.max(t,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(e,r,t,n){e=PixelFormat.componentsLength(e);return(e=PixelDatatype$1.isPacked(r)?1:e)*PixelDatatype$1.sizeInBytes(r)*t*n},alignmentInBytes:function(e,r,t){t=PixelFormat.textureSizeInBytes(e,r,t,1)%4;return 0==t?4:2==t?2:1},createTypedArray:function(e,r,t,n){var i=PixelDatatype$1.sizeInBytes(r),r=i===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:i===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:i===Float32Array.BYTES_PER_ELEMENT&&r===PixelDatatype$1.FLOAT?Float32Array:Uint32Array;return new r(PixelFormat.componentsLength(e)*t*n)},flipY:function(e,r,t,n,i){if(1===i)return e;for(var a=PixelFormat.createTypedArray(r,t,n,i),o=PixelFormat.componentsLength(r),u=n*o,f=0;f<i;++f)for(var l=f*n*o,s=(i-f-1)*n*o,c=0;c<u;++c)a[s+c]=e[l+c];return a},toInternalFormat:function(e,r,t){if(!t.webgl2)return e;if(e===PixelFormat.DEPTH_STENCIL)return WebGLConstants.WebGLConstants.DEPTH24_STENCIL8;if(e===PixelFormat.DEPTH_COMPONENT){if(r===PixelDatatype$1.UNSIGNED_SHORT)return WebGLConstants.WebGLConstants.DEPTH_COMPONENT16;if(r===PixelDatatype$1.UNSIGNED_INT)return WebGLConstants.WebGLConstants.DEPTH_COMPONENT24}if(r===PixelDatatype$1.FLOAT)switch(e){case PixelFormat.RGBA:return WebGLConstants.WebGLConstants.RGBA32F;case PixelFormat.RGB:return WebGLConstants.WebGLConstants.RGB32F;case PixelFormat.RG:return WebGLConstants.WebGLConstants.RG32F;case PixelFormat.R:return WebGLConstants.WebGLConstants.R32F}if(r===PixelDatatype$1.HALF_FLOAT)switch(e){case PixelFormat.RGBA:return WebGLConstants.WebGLConstants.RGBA16F;case PixelFormat.RGB:return WebGLConstants.WebGLConstants.RGB16F;case PixelFormat.RG:return WebGLConstants.WebGLConstants.RG16F;case PixelFormat.R:return WebGLConstants.WebGLConstants.R16F}return e}},PixelFormat$1=Object.freeze(PixelFormat),Module,Module=Module||((void 0!==Module?Module:null)||{}),moduleOverrides={},key;for(key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath,TRY_USE_DUMP,key;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(e,r){nodeFS=nodeFS||require("fs"),e=(nodePath=nodePath||require("path")).normalize(e);e=nodeFS.readFileSync(e);return r?e:e.toString()},Module.readBinary=function(e){e=Module.read(e,!0);return assert((e=!e.buffer?new Uint8Array(e):e).buffer),e},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(1<process.argv.length?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"};else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));e=read(e,"binary");return assert("object"==typeof e),e},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e,r){quit(e)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";Module.read=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),Module.readAsync=function(e,r,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console?(Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)})):(TRY_USE_DUMP=!1,Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})),ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}function globalEval(e){eval.call(null,e)}for(key in!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(e,r){throw r}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var moduleOverrides=void 0,Runtime={setTempRet0:function(e){return tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"!==e[0])return 0;var r=parseInt(e.substr(1));return assert(r%8==0),r/8}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,r){return"double"===r||"i64"===r?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,r,t){return t||"i64"!=e&&"double"!=e?e?Math.min(r||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(r,8):8},dynCall:function(e,r,t){return t&&t.length?Module["dynCall_"+e].apply(null,[r].concat(t)):Module["dynCall_"+e].call(null,r)},functionPointers:[],addFunction:function(e){for(var r=0;r<Runtime.functionPointers.length;r++)if(!Runtime.functionPointers[r])return Runtime.functionPointers[r]=e,2*(1+r);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(r,t){assert(t),Runtime.funcWrappers[t]||(Runtime.funcWrappers[t]={});var e=Runtime.funcWrappers[t];return e[r]||(1===t.length?e[r]=function(){return Runtime.dynCall(t,r)}:2===t.length?e[r]=function(e){return Runtime.dynCall(t,r,[e])}:e[r]=function(){return Runtime.dynCall(t,r,Array.prototype.slice.call(arguments))}),e[r]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var r=STACKTOP;return STACKTOP=(STACKTOP=STACKTOP+e|0)+15&-16,r},staticAlloc:function(e){var r=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+e|0)+15&-16,r},dynamicAlloc:function(e){var r=HEAP32[DYNAMICTOP_PTR>>2],e=-16&(r+e+15|0);if((HEAP32[DYNAMICTOP_PTR>>2]=e,TOTAL_MEMORY<=e)&&!enlargeMemory())return HEAP32[DYNAMICTOP_PTR>>2]=r,0;return r},alignMemory:function(e,r){return e=Math.ceil(e/(r||16))*(r||16)},makeBigInt:function(e,r,t){return t?+(e>>>0)+4294967296*(r>>>0):+(e>>>0)+4294967296*(0|r)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,cwrap,ccall;function assert(e,r){e||abort("Assertion failed: "+r)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,r,t,n){switch(t="*"===(t=t||"i8").charAt(t.length-1)?"i32":t){case"i1":case"i8":HEAP8[e>>0]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":tempI64=[r>>>0,(tempDouble=r,1<=+Math_abs(tempDouble)?0<tempDouble?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;default:abort("invalid type for setValue: "+t)}}function getValue(e,r,t){switch(r="*"===(r=r||"i8").charAt(r.length-1)?"i32":r){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+r)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r},stringToC:function(e){var r,t=0;return null!=e&&0!==e&&(r=1+(e.length<<2),stringToUTF8(e,t=Runtime.stackAlloc(r),r)),t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,r,t,n,i){var e=getCFunc(e),a=[],o=0;if(n)for(var u=0;u<n.length;u++){var f=toC[t[u]];f?(0===o&&(o=Runtime.stackSave()),a[u]=f(n[u])):a[u]=n[u]}e=e.apply(null,a);if("string"===r&&(e=Pointer_stringify(e)),0!==o){if(i&&i.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(o)});Runtime.stackRestore(o)}return e};var sourceRegex=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;function parseJSFunc(e){e=e.toString().match(sourceRegex).slice(1);return{arguments:e[0],body:e[1],returnValue:e[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource)for(var e in JSsource={},JSfuncs)JSfuncs.hasOwnProperty(e)&&(JSsource[e]=parseJSFunc(JSfuncs[e]))}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,r){return"$"+r}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i],convertCode;"number"!==type&&(convertCode=JSsource[type+"ToC"],funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"=("+convertCode.returnValue+");")}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue,strgfy;return funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",numericRet||(strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue,funcstr+="ret = "+strgfy+"(ret);"),numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(e,r,t,n){var i,a="number"==typeof e?(i=!0,e):(i=!1,e.length),o="string"==typeof r?r:null,u=t==ALLOC_NONE?n:["function"==typeof _malloc?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===t?ALLOC_STATIC:t](Math.max(a,o?1:r.length));if(i){var f,n=u;for(assert(0==(3&u)),f=u+(-4&a);n<f;n+=4)HEAP32[n>>2]=0;for(f=u+a;n<f;)HEAP8[n++>>0]=0;return u}if("i8"===o)return e.subarray||e.slice?HEAPU8.set(e,u):HEAPU8.set(new Uint8Array(e),u),u;for(var l,s,c,_=0;_<a;){var d=e[_];"function"==typeof d&&(d=Runtime.getFunctionIndex(d)),0!==(l=o||r[_])?(setValue(u+_,d,l="i64"==l?"i32":l),c!==l&&(s=Runtime.getNativeTypeSize(l),c=l),_+=s):_++}return u}function getMemory(e){return staticSealed?runtimeInitialized?_malloc(e):Runtime.dynamicAlloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,r){if(0===r||!e)return"";for(var t,n=0,i=0;n|=t=HEAPU8[e+i>>0],(0!=t||r)&&(i++,!r||i!=r););r=r||i;var a="";if(n<128){for(var o;0<r;)o=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(r,1024))),a=a?a+o:o,e+=1024,r-=1024;return a}return Module.UTF8ToString(e)}function AsciiToString(e){for(var r="";;){var t=HEAP8[e++>>0];if(!t)return r;r+=String.fromCharCode(t)}}function stringToAscii(e,r){return writeAsciiToMemory(e,r,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,r){for(var t=r;e[t];)++t;if(16<t-r&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(r,t));for(var n,i,a,o,u,f="";;){if(!(o=e[r++]))return f;128&o?(u=63&e[r++],192!=(224&o)?(a=63&e[r++],(o=224==(240&o)?(15&o)<<12|u<<6|a:(n=63&e[r++],240==(248&o)?(7&o)<<18|u<<12|a<<6|n:(i=63&e[r++],248==(252&o)?(3&o)<<24|u<<18|a<<12|n<<6|i:(1&o)<<30|u<<24|a<<18|n<<12|i<<6|63&e[r++])))<65536?f+=String.fromCharCode(o):(i=o-65536,f+=String.fromCharCode(55296|i>>10,56320|1023&i))):f+=String.fromCharCode((31&o)<<6|u)):f+=String.fromCharCode(o)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,r,t,n){if(!(0<n))return 0;for(var i=t,a=t+n-1,o=0;o<e.length;++o){var u=e.charCodeAt(o);if((u=55296<=u&&u<=57343?65536+((1023&u)<<10)|1023&e.charCodeAt(++o):u)<=127){if(a<=t)break;r[t++]=u}else if(u<=2047){if(a<=t+1)break;r[t++]=192|u>>6,r[t++]=128|63&u}else if(u<=65535){if(a<=t+2)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|63&u}else if(u<=2097151){if(a<=t+3)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}else if(u<=67108863){if(a<=t+4)break;r[t++]=248|u>>24,r[t++]=128|u>>18&63,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}else{if(a<=t+5)break;r[t++]=252|u>>30,r[t++]=128|u>>24&63,r[t++]=128|u>>18&63,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}}return r[t]=0,t-i}function stringToUTF8(e,r,t){return stringToUTF8Array(e,HEAPU8,r,t)}function lengthBytesUTF8(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);(n=55296<=n&&n<=57343?65536+((1023&n)<<10)|1023&e.charCodeAt(++t):n)<=127?++r:r+=n<=2047?2:n<=65535?3:n<=2097151?4:n<=67108863?5:6}return r}function demangle(e){var r=Module.___cxa_demangle||Module.__cxa_demangle;if(r){try{var t=e.substr(1),n=lengthBytesUTF8(t)+1,i=_malloc(n);stringToUTF8(t,i,n);var a=_malloc(4),o=r(i,0,0,a);if(0===getValue(a,"i32")&&o)return Pointer_stringify(o)}catch(e){}finally{i&&_free(i),a&&_free(a),o&&_free(o)}return e}return Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var r=demangle(e);return e===r?e:e+" ["+r+"]"})}function jsStackTrace(){var r=new Error;if(!r.stack){try{throw new Error(0)}catch(e){r=e}if(!r.stack)return"(no stack trace available)"}return r.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le"),Module.stackTrace=stackTrace;var WASM_PAGE_SIZE=65536,ASMJS_PAGE_SIZE=16777216,MIN_TOTAL_MEMORY=16777216,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR,byteLength;function alignUp(e,r){return 0<e%r&&(e+=r-e%r),e}function updateGlobalBuffer(e){Module.buffer=buffer=e}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){var e=Module.usingWasm?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE,r=2147483648-e;if(HEAP32[DYNAMICTOP_PTR>>2]>r)return!1;var t=TOTAL_MEMORY;for(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,MIN_TOTAL_MEMORY);TOTAL_MEMORY<HEAP32[DYNAMICTOP_PTR>>2];)TOTAL_MEMORY=TOTAL_MEMORY<=536870912?alignUp(2*TOTAL_MEMORY,e):Math.min(alignUp((3*TOTAL_MEMORY+2147483648)/4,e),r);var n=Module.reallocBuffer(TOTAL_MEMORY);return n&&n.byteLength==TOTAL_MEMORY?(updateGlobalBuffer(n),updateGlobalBufferViews(),!0):(TOTAL_MEMORY=t,!1)}STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1,Module.reallocBuffer||(Module.reallocBuffer=function(e){var r,t;try{ArrayBuffer.transfer?t=ArrayBuffer.transfer(buffer,e):(r=HEAP8,t=new ArrayBuffer(e),new Int8Array(t).set(r))}catch(e){return!1}return!!_emscripten_replace_memory(t)&&t});try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),buffer=Module.buffer||new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews(),HEAP32[0]=1668509029,HEAP16[1]=25459,115!==HEAPU8[2]||99!==HEAPU8[3])throw"Runtime error: expected the system to be little-endian!";function callRuntimeCallbacks(e){for(;0<e.length;){var r,t=e.shift();"function"!=typeof t?"number"==typeof(r=t.func)?void 0===t.arg?Module.dynCall_v(r):Module.dynCall_vi(r,t.arg):r(void 0===t.arg?null:t.arg):t()}}Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,r,t){t=0<t?t:lengthBytesUTF8(e)+1,t=new Array(t),e=stringToUTF8Array(e,t,0,t.length);return r&&(t.length=e),t}function intArrayToString(e){for(var r=[],t=0;t<e.length;t++){var n=e[t];255<n&&(n&=255),r.push(String.fromCharCode(n))}return r.join("")}function writeStringToMemory(e,r,t){var n,i;Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),t&&(i=r+lengthBytesUTF8(e),n=HEAP8[i]),stringToUTF8(e,r,1/0),t&&(HEAP8[i]=n)}function writeArrayToMemory(e,r){HEAP8.set(e,r)}function writeAsciiToMemory(e,r,t){for(var n=0;n<e.length;++n)HEAP8[r++>>0]=e.charCodeAt(n);t||(HEAP8[r>>0]=0)}Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,r){var t=65535&e,n=65535&r;return t*n+((e>>>16)*n+t*(r>>>16)<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var r=0;r<32;r++)if(e&1<<31-r)return r;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_min=Math.min,runDependencies=0,dependenciesFulfilled=null;function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){var r;runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&dependenciesFulfilled&&(r=dependenciesFulfilled,dependenciesFulfilled=null,r())}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={},STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+6192,__ATINIT__.push(),allocate([228,2,0,0,81,16,0,0,12,3,0,0,177,16,0,0,32,0,0,0,0,0,0,0,12,3,0,0,94,16,0,0,48,0,0,0,0,0,0,0,228,2,0,0,127,16,0,0,12,3,0,0,140,16,0,0,16,0,0,0,0,0,0,0,12,3,0,0,183,17,0,0,32,0,0,0,0,0,0,0,12,3,0,0,147,17,0,0,72,0,0,0,0,0,0,0,108,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,32,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,1,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,40,20,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,16,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,56,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,83,116,57,101,120,99,101,112,116,105,111,110,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}STATICTOP+=16;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var r in EXCEPTIONS.infos)if(EXCEPTIONS.infos[r].adjusted===e)return r;return e},addRef:function(e){e&&EXCEPTIONS.infos[e].refcount++},decRef:function(e){var r;e&&(assert(0<(r=EXCEPTIONS.infos[e]).refcount),r.refcount--,0!==r.refcount||r.rethrown||(r.destructor&&Module.dynCall_vi(r.destructor,e),delete EXCEPTIONS.infos[e],___cxa_free_exception(e)))},clearRef:function(e){e&&(EXCEPTIONS.infos[e].refcount=0)}};function ___cxa_begin_catch(e){var r=EXCEPTIONS.infos[e];return r&&!r.caught&&(r.caught=!0,__ZSt18uncaught_exceptionv.uncaught_exception--),r&&(r.rethrown=!1),EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,r){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Module.dynCall_v(r),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,r,t){return HEAPU8.set(HEAPU8.subarray(r,r+t),e),e}var SYSCALLS={varargs:0,get:function(e){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var e=SYSCALLS.get(),r=SYSCALLS.get();return assert(0<=e?0===r:-1===r),e},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall6(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD();return FS.close(t),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC),PTHREAD_SPECIFIC={};function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}var PTHREAD_SPECIFIC_NEXT_KEY=1,ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _pthread_key_create(e,r){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function ___resumeException(e){throw EXCEPTIONS.last||(EXCEPTIONS.last=e),e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function ___cxa_find_matching_catch(){if(!(n=EXCEPTIONS.last))return 0|(Runtime.setTempRet0(0),0);var e=EXCEPTIONS.infos[n],r=e.type;if(!r)return 0|(Runtime.setTempRet0(0),n);var t=Array.prototype.slice.call(arguments);Module.___cxa_is_pointer_type(r),___cxa_find_matching_catch.buffer||(___cxa_find_matching_catch.buffer=_malloc(4)),HEAP32[___cxa_find_matching_catch.buffer>>2]=n;for(var n=___cxa_find_matching_catch.buffer,i=0;i<t.length;i++)if(t[i]&&Module.___cxa_can_catch(t[i],r,n))return n=HEAP32[n>>2],e.adjusted=n,0|(Runtime.setTempRet0(t[i]),n);return n=HEAP32[n>>2],0|(Runtime.setTempRet0(r),n)}function ___gxx_personality_v0(){}function _pthread_setspecific(e,r){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=r,0):ERRNO_CODES.EINVAL}function ___syscall140(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),a=SYSCALLS.get(),o=n;return FS.llseek(t,o,a),HEAP32[i>>2]=t.position,t.getdents&&0===o&&0===a&&(t.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.get(),n=SYSCALLS.get(),i=SYSCALLS.get(),a=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,r){var t=___syscall146.buffers[e];assert(t),0===r||10===r?((1===e?Module.print:Module.printErr)(UTF8ArrayToString(t,0)),t.length=0):t.push(r)});for(var o=0;o<i;o++){for(var u=HEAP32[n+8*o>>2],f=HEAP32[n+(8*o+4)>>2],l=0;l<f;l++)___syscall146.printChar(t,HEAPU8[u+l]);a+=f}return a}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,r){SYSCALLS.varargs=r;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,r,t,n){try{return Module.dynCall_iiii(e,r,t,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiiii(e,r,t,n,i,a){try{Module.dynCall_viiiii(e,r,t,n,i,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_vi(e,r){try{Module.dynCall_vi(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_ii(e,r){try{return Module.dynCall_ii(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viii(e,r,t,n){try{Module.dynCall_viii(e,r,t,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiiiii(e,r,t,n,i,a,o){try{Module.dynCall_viiiiii(e,r,t,n,i,a,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiii(e,r,t,n,i){try{Module.dynCall_viiii(e,r,t,n,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}__ATEXIT__.push(function(){var e=Module._fflush;e&&e(0);var r=___syscall146.printChar;r&&((e=___syscall146.buffers)[1].length&&r(1,10),e[2].length&&r(2,10))}),DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,enlargeMemory:enlargeMemory,getTotalMemory:getTotalMemory,abortOnCannotGrowMemory:abortOnCannotGrowMemory,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_getspecific:_pthread_getspecific,___syscall54:___syscall54,_pthread_setspecific:_pthread_setspecific,___gxx_personality_v0:___gxx_personality_v0,___syscall6:___syscall6,___setErrNo:___setErrNo,_abort:_abort,___cxa_begin_catch:___cxa_begin_catch,_pthread_once:_pthread_once,_emscripten_memcpy_big:_emscripten_memcpy_big,_pthread_key_create:_pthread_key_create,___syscall140:___syscall140,___resumeException:___resumeException,___cxa_find_matching_catch:___cxa_find_matching_catch,___syscall146:___syscall146,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,DYNAMICTOP_PTR:DYNAMICTOP_PTR,tempDoublePtr:tempDoublePtr,ABORT:ABORT,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,cttz_i8:cttz_i8};var asm=function(e,r,t){var n=e.Int8Array,ce=new n(t),i=e.Int16Array,W=new i(t),a=e.Int32Array,_e=new a(t),o=e.Uint8Array,de=new o(t),u=e.Uint16Array,Ee=new u(t),f=e.Uint32Array;new f(t);var l=e.Float32Array;new l(t);var s=e.Float64Array,k=new s(t),c=e.byteLength,_=0|r.DYNAMICTOP_PTR,g=0|r.tempDoublePtr;r.ABORT;var Te=0|r.STACKTOP;r.STACK_MAX;var d=0|r.cttz_i8;e.NaN,e.Infinity;var L=0;e.Math.floor,e.Math.abs,e.Math.sqrt,e.Math.pow,e.Math.cos,e.Math.sin,e.Math.tan,e.Math.acos,e.Math.asin,e.Math.atan,e.Math.atan2,e.Math.exp,e.Math.log,e.Math.ceil;var ie=e.Math.imul;e.Math.min,e.Math.max;var T=e.Math.clz32,E=r.abort;r.assert;var A=r.enlargeMemory,M=r.getTotalMemory,b=r.abortOnCannotGrowMemory;r.invoke_iiii,r.invoke_viiiii,r.invoke_vi,r.invoke_ii,r.invoke_viii,r.invoke_v,r.invoke_viiiiii,r.invoke_viiii;var m=r._pthread_getspecific,S=r.___syscall54,P=r._pthread_setspecific;r.___gxx_personality_v0;var R=r.___syscall6,h=r.___setErrNo,p=r._abort;r.___cxa_begin_catch;var C=r._pthread_once,N=r._emscripten_memcpy_big,y=r._pthread_key_create,O=r.___syscall140;r.___resumeException,r.___cxa_find_matching_catch;var v=r.___syscall146;function I(e){e|=0;var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0,d=0,E=0,T=0,A=0,M=0,b=0,m=0,S=0,P=Te;Te=Te+16|0,_=P;do{if(e>>>0<245){if(3&(t=(c=0|_e[1144])>>>(e=(l=e>>>0<11?16:e+11&-8)>>>3))|0)return n=0|_e[(t=(e=4616+((r=(1&t^1)+e|0)<<1<<2)|0)+8|0)>>2],(0|e)==(0|(a=0|_e[(i=n+8|0)>>2]))?_e[1144]=c&~(1<<r):(_e[a+12>>2]=e,_e[t>>2]=a),_e[n+4>>2]=3|(S=r<<3),_e[(S=n+S+4|0)>>2]=1|_e[S>>2],Te=P,0|(S=i);if((s=0|_e[1146])>>>0<l>>>0){if(0|t)return r=((r=t<<e&((r=2<<e)|0-r))&0-r)-1|0,i=0|_e[(e=(r=4616+((n=((t=(r>>>=o=r>>>12&16)>>>5&8)|o|(i=(r>>>=t)>>>2&4)|(e=(r>>>=i)>>>1&2)|(n=(r>>>=e)>>>1&1))+(r>>>n)|0)<<1<<2)|0)+8|0)>>2],(0|r)==(0|(t=0|_e[(o=i+8|0)>>2]))?_e[1144]=e=c&~(1<<n):(_e[t+12>>2]=r,_e[e>>2]=t,e=c),a=(n<<3)-l|0,_e[i+4>>2]=3|l,_e[(n=i+l|0)+4>>2]=1|a,_e[n+a>>2]=a,0|s&&(i=0|_e[1149],t=4616+((r=s>>>3)<<1<<2)|0,e&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=e|r,e=(r=t)+8|0),_e[e>>2]=i,_e[r+12>>2]=i,_e[i+8>>2]=r,_e[i+12>>2]=t),_e[1146]=a,_e[1149]=n,Te=P,0|(S=o);if(u=0|_e[1145]){if(t=(u&0-u)-1|0,e=0|_e[4880+(((a=(t>>>=o=t>>>12&16)>>>5&8)|o|(f=(t>>>=a)>>>2&4)|(n=(t>>>=f)>>>1&2)|(e=(t>>>=n)>>>1&1))+(t>>>e)<<2)>>2],t=(-8&_e[e+4>>2])-l|0,n=0|_e[e+16+((0==(0|_e[e+16>>2])&1)<<2)>>2]){for(;t=(f=(o=(-8&_e[n+4>>2])-l|0)>>>0<t>>>0)?o:t,e=f?n:e,0!=(0|(n=0|_e[n+16+((0==(0|_e[n+16>>2])&1)<<2)>>2])););f=e,a=t}else f=e,a=t;if(f>>>0<(o=f+l|0)>>>0){i=0|_e[f+24>>2],r=0|_e[f+12>>2];do{if((0|r)==(0|f)){if(!(r=0|_e[(e=f+20|0)>>2])&&!(r=0|_e[(e=f+16|0)>>2])){t=0;break}for(;;)if(0|(n=0|_e[(t=r+20|0)>>2]))r=n,e=t;else{if(!(n=0|_e[(t=r+16|0)>>2]))break;r=n,e=t}_e[e>>2]=0,t=r}else t=0|_e[f+8>>2],_e[t+12>>2]=r,_e[r+8>>2]=t,t=r}while(0);do{if(0|i){if(r=0|_e[f+28>>2],(0|f)==(0|_e[(e=4880+(r<<2)|0)>>2])){if(!(_e[e>>2]=t)){_e[1145]=u&~(1<<r);break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|f)&1)<<2)>>2]=t))break;_e[t+24>>2]=i,0|(r=0|_e[f+16>>2])&&(_e[t+16>>2]=r,_e[r+24>>2]=t),0|(r=0|_e[f+20>>2])&&(_e[t+20>>2]=r,_e[r+24>>2]=t)}}while(0);return a>>>0<16?(_e[f+4>>2]=3|(S=a+l|0),_e[(S=f+S+4|0)>>2]=1|_e[S>>2]):(_e[f+4>>2]=3|l,_e[o+4>>2]=1|a,_e[o+a>>2]=a,0|s&&(n=0|_e[1149],t=4616+((r=s>>>3)<<1<<2)|0,c&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=c|r,e=(r=t)+8|0),_e[e>>2]=n,_e[r+12>>2]=n,_e[n+8>>2]=r,_e[n+12>>2]=t),_e[1146]=a,_e[1149]=o),Te=P,0|(S=f+8|0)}c=l}else c=l}else c=l}else if(e>>>0<=4294967231)if(l=-8&(e=e+11|0),f=0|_e[1145]){n=0-l|0,u=(e>>>=8)?16777215<l>>>0?31:l>>>((u=14-((s=((m=e<<(c=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|c|(u=((m<<=s)+245760|0)>>>16&2))+(m<<u>>>15)|0)+7|0)&1|u<<1:0,t=0|_e[4880+(u<<2)>>2];e:do{if(t)for(o=l<<(31==((e=0)|u)?0:25-(u>>>1)|0),a=0;;){if((i=(-8&_e[t+4>>2])-l|0)>>>0<n>>>0){if(!i){n=0,i=e=t,m=61;break e}e=t,n=i}if(a=0==(0|(i=0|_e[t+20>>2]))|(0|i)==(0|(t=0|_e[t+16+(o>>>31<<2)>>2]))?a:i,i=0==(0|t)){t=a,m=57;break}o<<=1&(1^i)}else e=t=0,m=57}while(0);if(57==(0|m)){if(0==(0|t)&0==(0|e)){if(!(e=f&((e=2<<u)|0-e))){c=l;break}c=(e&0-e)-1|0,t=(e=0)|_e[4880+(((a=(c>>>=o=c>>>12&16)>>>5&8)|o|(u=(c>>>=a)>>>2&4)|(s=(c>>>=u)>>>1&2)|(t=(c>>>=s)>>>1&1))+(c>>>t)<<2)>>2]}t?(i=t,m=61):(u=e,o=n)}if(61==(0|m))for(;;){if(t=(c=(t=(-8&_e[i+4>>2])-l|(m=0))>>>0<n>>>0)?t:n,e=c?i:e,!(i=0|_e[i+16+((0==(0|_e[i+16>>2])&1)<<2)>>2])){u=e,o=t;break}n=t,m=61}if(0!=(0|u)&&o>>>0<((0|_e[1146])-l|0)>>>0){if((a=u+l|0)>>>0<=u>>>0)return Te=P,(S=0)|S;i=0|_e[u+24>>2],r=0|_e[u+12>>2];do{if((0|r)==(0|u)){if(!(r=0|_e[(e=u+20|0)>>2])&&!(r=0|_e[(e=u+16|0)>>2])){r=0;break}for(;;)if(0|(n=0|_e[(t=r+20|0)>>2]))r=n,e=t;else{if(!(n=0|_e[(t=r+16|0)>>2]))break;r=n,e=t}_e[e>>2]=0}else S=0|_e[u+8>>2],_e[S+12>>2]=r,_e[r+8>>2]=S}while(0);do{if(i){if(e=0|_e[u+28>>2],(0|u)==(0|_e[(t=4880+(e<<2)|0)>>2])){if(!(_e[t>>2]=r)){_e[1145]=n=f&~(1<<e);break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|u)&1)<<2)>>2]=r)){n=f;break}_e[r+24>>2]=i,0|(e=0|_e[u+16>>2])&&(_e[r+16>>2]=e,_e[e+24>>2]=r),n=((e=0|_e[u+20>>2])&&(_e[r+20>>2]=e,_e[e+24>>2]=r),f)}else n=f}while(0);do{if(16<=o>>>0){if(_e[u+4>>2]=3|l,_e[a+4>>2]=1|o,r=(_e[a+o>>2]=o)>>>3,o>>>0<256){t=4616+(r<<1<<2)|0,(e=0|_e[1144])&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=e|r,e=(r=t)+8|0),_e[e>>2]=a,_e[r+12>>2]=a,_e[a+8>>2]=r,_e[a+12>>2]=t;break}if(t=4880+((r=(r=o>>>8)?16777215<o>>>0?31:o>>>((r=14-((b=((S=r<<(m=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(r=((S<<=b)+245760|0)>>>16&2))+(S<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,_e[a+28>>2]=r,_e[(e=a+16|0)+4>>2]=0,_e[e>>2]=0,!(n&(e=1<<r))){_e[1145]=n|e,_e[t>>2]=a,_e[a+24>>2]=t,_e[a+12>>2]=a,_e[a+8>>2]=a;break}for(e=o<<(31==(0|r)?0:25-(r>>>1)|0),t=0|_e[t>>2];;){if((-8&_e[t+4>>2]|0)==(0|o)){m=97;break}if(!(r=0|_e[(n=t+16+(e>>>31<<2)|0)>>2])){m=96;break}e<<=1,t=r}if(96==(0|m)){_e[n>>2]=a,_e[a+24>>2]=t,_e[a+12>>2]=a,_e[a+8>>2]=a;break}if(97==(0|m)){S=0|_e[(m=t+8|0)>>2],_e[S+12>>2]=a,_e[m>>2]=a,_e[a+8>>2]=S,_e[a+12>>2]=t,_e[a+24>>2]=0;break}}else _e[u+4>>2]=3|(S=o+l|0),_e[(S=u+S+4|0)>>2]=1|_e[S>>2]}while(0);return Te=P,0|(S=u+8|0)}c=l}else c=l;else c=-1}while(0);if(c>>>0<=(t=0|_e[1146])>>>0)return e=0|_e[1149],15<(r=t-c|0)>>>0?(_e[1149]=S=e+c|0,_e[1146]=r,_e[S+4>>2]=1|r,_e[S+r>>2]=r,_e[e+4>>2]=3|c):(_e[1146]=0,_e[1149]=0,_e[e+4>>2]=3|t,_e[(S=e+t+4|0)>>2]=1|_e[S>>2]),Te=P,0|(S=e+8|0);if(c>>>0<(o=0|_e[1147])>>>0)return _e[1147]=b=o-c|0,S=0|_e[1150],_e[1150]=m=S+c|0,_e[m+4>>2]=1|b,_e[S+4>>2]=3|c,Te=P,0|(S=S+8|0);if(u=c+48|0,(l=(a=(e=0|_e[1262]?0|_e[1264]:(_e[1264]=4096,_e[1263]=4096,_e[1265]=-1,_e[1266]=-1,_e[1267]=0,_e[1255]=0,_e[_>>2]=e=-16&_^1431655768,_e[1262]=e,4096))+(f=c+47|0)|0)&(i=0-e|0))>>>0<=c>>>0)return Te=P,(S=0)|S;if(0|(e=0|_e[1254])&&(_=(s=0|_e[1252])+l|0)>>>0<=s>>>0|e>>>0<_>>>0)return Te=P,(S=0)|S;e:do{if(4&_e[1255])r=0,m=133;else{t=0|_e[1150];r:do{if(t){for(n=5024;!((e=0|_e[n>>2])>>>0<=t>>>0&&(e+(0|_e[(T=n+4|0)>>2])|0)>>>0>t>>>0);){if(!(e=0|_e[n+8>>2])){m=118;break r}n=e}if((r=a-o&i)>>>0<2147483647)if((0|(e=0|me(0|r)))==((0|_e[n>>2])+(0|_e[T>>2])|0)){if(-1!=(0|e)){o=r,a=e,m=135;break e}}else n=e,m=126;else r=0}else m=118}while(0);do{if(118==(0|m))if(-1!=(0|(t=0|me(0)))&&(E=(r=(0==((E=(d=0|_e[1263])+-1|0)&(r=t)|0)?0:(E+r&0-d)-r|0)+l|0)+(d=0|_e[1252])|0,c>>>0<r>>>0&r>>>0<2147483647)){if(0|(T=0|_e[1254])&&E>>>0<=d>>>0|T>>>0<E>>>0){r=0;break}if((0|(e=0|me(0|r)))==(0|t)){o=r,a=t,m=135;break e}n=e,m=126}else r=0}while(0);do{if(126==(0|m)){if(t=0-r|0,!(r>>>0<u>>>0&r>>>0<2147483647&-1!=(0|n))){if(-1==(0|n)){r=0;break}o=r,a=n,m=135;break e}if(2147483647<=(e=f-r+(e=0|_e[1264])&0-e)>>>0){o=r,a=n,m=135;break e}if(-1==(0|me(0|e))){me(0|t),r=0;break}o=e+r|0,a=n,m=135;break e}}while(0);_e[1255]=4|_e[1255],m=133}}while(0);if(133==(0|m)&&l>>>0<2147483647&&!(-1==(0|(b=0|me(0|l)))|1^(M=(c+40|0)>>>0<(A=(T=0|me(0))-b|0)>>>0)|b>>>0<T>>>0&-1!=(0|b)&-1!=(0|T)^1)&&(o=M?A:r,a=b,m=135),135==(0|m)){r=(0|_e[1252])+o|0,(_e[1252]=r)>>>0>(0|_e[1253])>>>0&&(_e[1253]=r),f=0|_e[1150];do{if(f){for(r=5024;;){if((0|a)==((e=0|_e[r>>2])+(n=0|_e[(t=r+4|0)>>2])|0)){m=145;break}if(!(i=0|_e[r+8>>2]))break;r=i}if(145==(0|m)&&0==(8&_e[r+12>>2]|0)&&f>>>0<a>>>0&e>>>0<=f>>>0){_e[t>>2]=n+o,m=f+(S=0==(7&(S=f+8|0)|0)?0:0-S&7)|0,S=(0|_e[1147])+(o-S)|0,_e[1150]=m,_e[1147]=S,_e[m+4>>2]=1|S,_e[m+S+4>>2]=40,_e[1151]=_e[1266];break}for(a>>>0<(0|_e[1148])>>>0&&(_e[1148]=a),t=a+o|0,r=5024;;){if((0|_e[r>>2])==(0|t)){m=153;break}if(!(e=0|_e[r+8>>2]))break;r=e}if(153==(0|m)&&0==(8&_e[r+12>>2]|0)){_e[r>>2]=a,_e[(s=r+4|0)>>2]=(0|_e[s>>2])+o,l=(s=a+(0==(7&(s=a+8|0)|0)?0:0-s&7)|0)+c|0,u=(r=t+(0==(7&(r=t+8|0)|0)?0:0-r&7)|0)-s-c|0,_e[s+4>>2]=3|c;do{if((0|r)!=(0|f)){if((0|r)==(0|_e[1149])){S=(0|_e[1146])+u|0,_e[1146]=S,_e[1149]=l,_e[l+4>>2]=1|S,_e[l+S>>2]=S;break}if(1==(3&(e=0|_e[r+4>>2])|0)){o=-8&e,n=e>>>3;e:do{if(e>>>0<256){if(e=0|_e[r+8>>2],(0|(t=0|_e[r+12>>2]))==(0|e)){_e[1144]=_e[1144]&~(1<<n);break}_e[e+12>>2]=t,_e[t+8>>2]=e;break}a=0|_e[r+24>>2],e=0|_e[r+12>>2];do{if((0|e)==(0|r)){if(!(e=0|_e[(t=(n=r+16|0)+4|0)>>2])){if(!(e=0|_e[n>>2])){e=0;break}t=n}for(;;)if(0|(i=0|_e[(n=e+20|0)>>2]))e=i,t=n;else{if(!(i=0|_e[(n=e+16|0)>>2]))break;e=i,t=n}_e[t>>2]=0}else S=0|_e[r+8>>2],_e[S+12>>2]=e,_e[e+8>>2]=S}while(0);if(!a)break;n=4880+((t=0|_e[r+28>>2])<<2)|0;do{if((0|r)==(0|_e[n>>2])){if(0|(_e[n>>2]=e))break;_e[1145]=_e[1145]&~(1<<t);break e}if(!(_e[a+16+(((0|_e[a+16>>2])!=(0|r)&1)<<2)>>2]=e))break e}while(0)}while((_e[e+24>>2]=a,0|(n=0|_e[(t=r+16|0)>>2])&&(_e[e+16>>2]=n,_e[n+24>>2]=e),t=0|_e[t+4>>2])&&(_e[e+20>>2]=t,_e[t+24>>2]=e,0));r=r+o|0,i=o+u|0}else i=u;if(_e[(r=r+4|0)>>2]=-2&_e[r>>2],_e[l+4>>2]=1|i,r=(_e[l+i>>2]=i)>>>3,i>>>0<256){t=4616+(r<<1<<2)|0,(e=0|_e[1144])&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=e|r,e=(r=t)+8|0),_e[e>>2]=l,_e[r+12>>2]=l,_e[l+8>>2]=r,_e[l+12>>2]=t;break}r=i>>>8;do{if(r){if(16777215<i>>>0){r=31;break}r=i>>>((r=14-((b=((S=r<<(m=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(r=((S<<=b)+245760|0)>>>16&2))+(S<<r>>>15)|0)+7|0)&1|r<<1}else r=0}while(0);if(n=4880+(r<<2)|0,_e[l+28>>2]=r,_e[(e=l+16|0)+4>>2]=0,!((e=(_e[e>>2]=0)|_e[1145])&(t=1<<r))){_e[1145]=e|t,_e[n>>2]=l,_e[l+24>>2]=n,_e[l+12>>2]=l,_e[l+8>>2]=l;break}for(e=i<<(31==(0|r)?0:25-(r>>>1)|0),t=0|_e[n>>2];;){if((-8&_e[t+4>>2]|0)==(0|i)){m=194;break}if(!(r=0|_e[(n=t+16+(e>>>31<<2)|0)>>2])){m=193;break}e<<=1,t=r}if(193==(0|m)){_e[n>>2]=l,_e[l+24>>2]=t,_e[l+12>>2]=l,_e[l+8>>2]=l;break}if(194==(0|m)){S=0|_e[(m=t+8|0)>>2],_e[S+12>>2]=l,_e[m>>2]=l,_e[l+8>>2]=S,_e[l+12>>2]=t,_e[l+24>>2]=0;break}}else S=(0|_e[1147])+u|0,_e[1147]=S,_e[1150]=l,_e[l+4>>2]=1|S}while(0);return Te=P,0|(S=s+8|0)}for(r=5024;!((e=0|_e[r>>2])>>>0<=f>>>0&&f>>>0<(S=e+(0|_e[r+4>>2])|0)>>>0);)r=0|_e[r+8>>2];for(r=(e=(e=(i=S+-47|0)+(0==(7&(e=i+8|0)|0)?0:0-e&7)|0)>>>0<(i=f+16|0)>>>0?f:e)+8|0,m=a+(t=0==(7&(t=a+8|0)|0)?0:0-t&7)|0,t=o+-40-t|0,_e[1150]=m,_e[1147]=t,_e[m+4>>2]=1|t,_e[m+t+4>>2]=40,_e[1151]=_e[1266],_e[(t=e+4|0)>>2]=27,_e[r>>2]=_e[1256],_e[r+4>>2]=_e[1257],_e[r+8>>2]=_e[1258],_e[r+12>>2]=_e[1259],_e[1256]=a,_e[1257]=o,_e[1259]=0,_e[1258]=r,r=e+24|0;_e[(r=(m=r)+4|0)>>2]=7,(m+8|0)>>>0<S>>>0;);if((0|e)!=(0|f)){if(a=e-f|0,_e[t>>2]=-2&_e[t>>2],_e[f+4>>2]=1|a,r=(_e[e>>2]=a)>>>3,a>>>0<256){t=4616+(r<<1<<2)|0,(e=0|_e[1144])&(r=1<<r)?r=0|_e[(e=t+8|0)>>2]:(_e[1144]=e|r,e=(r=t)+8|0),_e[e>>2]=f,_e[r+12>>2]=f,_e[f+8>>2]=r,_e[f+12>>2]=t;break}if(n=4880+((t=(r=a>>>8)?16777215<a>>>0?31:a>>>((t=14-((b=((S=r<<(m=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(t=((S<<=b)+245760|0)>>>16&2))+(S<<t>>>15)|0)+7|0)&1|t<<1:0)<<2)|0,_e[f+28>>2]=t,_e[f+20>>2]=0,!((r=(_e[i>>2]=0)|_e[1145])&(e=1<<t))){_e[1145]=r|e,_e[n>>2]=f,_e[f+24>>2]=n,_e[f+12>>2]=f,_e[f+8>>2]=f;break}for(e=a<<(31==(0|t)?0:25-(t>>>1)|0),t=0|_e[n>>2];;){if((-8&_e[t+4>>2]|0)==(0|a)){m=216;break}if(!(r=0|_e[(n=t+16+(e>>>31<<2)|0)>>2])){m=215;break}e<<=1,t=r}if(215==(0|m)){_e[n>>2]=f,_e[f+24>>2]=t,_e[f+12>>2]=f,_e[f+8>>2]=f;break}if(216==(0|m)){S=0|_e[(m=t+8|0)>>2],_e[S+12>>2]=f,_e[m>>2]=f,_e[f+8>>2]=S,_e[f+12>>2]=t,_e[f+24>>2]=0;break}}}else{for(0==(0|(S=0|_e[1148]))|a>>>0<S>>>0&&(_e[1148]=a),_e[1256]=a,_e[1257]=o,_e[1259]=0,_e[1153]=_e[1262],_e[1152]=-1,r=0;_e[(S=4616+(r<<1<<2)|0)+12>>2]=S,_e[S+8>>2]=S,32!=(0|(r=r+1|0)););m=a+(S=0==(7&(S=a+8|0)|0)?0:0-S&7)|0,S=o+-40-S|0,_e[1150]=m,_e[1147]=S,_e[m+4>>2]=1|S,_e[m+S+4>>2]=40,_e[1151]=_e[1266]}}while(0);if(c>>>0<(r=0|_e[1147])>>>0)return _e[1147]=b=r-c|0,S=0|_e[1150],_e[1150]=m=S+c|0,_e[m+4>>2]=1|b,_e[S+4>>2]=3|c,Te=P,0|(S=S+8|0)}return _e[(S=296)>>2]=12,Te=P,(S=0)|S}function D(e,r,t,n,i,a){e|=0,r=+r,t|=0,n|=0,i|=0,a|=0;var o,u=0,f=0,l=0,s=0,c=0,_=0,d=0,E=0,T=0,A=0,M=0,b=0,m=0,S=0,P=0,R=0,h=0,p=0,C=0,N=0,y=0,O=0,v=Te;Te=Te+560|0,l=v+8|0,y=O=(M=v)+524|0,N=(s=v+512|0)+12|(_e[M>>2]=0),ke(r),h=(0|L)<0?(r=-r,p=1,2087):(p=0!=(2049&i|0)&1,0==(2048&i|0)?0==(1&i|0)?2088:2093:2090),ke(r),C=2146435072&L;do{if(C>>>0<2146435072|2146435072==(0|C)&!1){if((u=0!=(E=2*(o=M,+ + +function e(r,t){r=+r;t|=0;var n=0,i=0,a=0;k[g>>3]=r;n=0|_e[g>>2];i=0|_e[g+4>>2];a=0|ye(0|n,0|i,52);switch(2047&a){case 0:n=0!=r?(r=+e(0x10000000000000000*r,t),(0|_e[t>>2])-64|0):0,_e[t>>2]=n;break;case 2047:break;default:_e[t>>2]=(2047&a)-1022,_e[g>>2]=n,_e[g+4>>2]=-2146435073&i|1071644672,r=+k[g>>3]}return+r}(+r,o|=0))))&&(_e[M>>2]=(0|_e[M>>2])-1),97==(0|(m=32|a))){d=0==(0|(T=32&a))?h:h+9|0,_=2|p,u=12-n|0;do{if(!(11<n>>>0|0==(0|u))){for(r=8;r*=16,0!=(0|(u=u+-1|0)););if(45==(0|ce[d>>0])){r=-(r+(-E-r));break}r=E+r-r;break}}while(r=E,0);for((0|(u=0|fe(u=(0|(f=0|_e[M>>2]))<0?0-f|0:f,((0|u)<0)<<31>>31,N)))==(0|N)&&(ce[(u=s+11|0)>>0]=48),ce[u+-1>>0]=43+(f>>31&2),ce[(c=u+-2|0)>>0]=a+15,s=(0|n)<1,l=0==(8&i|0),u=O;f=u+1|0,ce[u>>0]=de[2122+(C=~~r)>>0]|T,r=16*(r-(0|C)),u=1!=(f-y|0)||l&s&0==r?f:(ce[f>>0]=46,u+2|0),0!=r;);C=u-y|0,se(e,32,t,u=(y=N-c|0)+_+(N=0!=(0|n)&(C+-2|0)<(0|n)?n+2|0:C)|0,i),Ie(e,d,_),se(e,48,t,u,65536^i),Ie(e,O,C),se(e,48,N-C|0,0,0),Ie(e,c,y),se(e,32,t,u,8192^i);break}for(f=(0|n)<0?6:n,u?(u=(0|_e[M>>2])-28|0,_e[M>>2]=u,r=268435456*E):(r=E,u=0|_e[M>>2]),l=C=(0|u)<0?l:l+288|0;_e[l>>2]=P=~~r>>>0,l=l+4|0,0!=(r=1e9*(r-(P>>>0))););if(0<(0|u))for(s=C,_=l;;){if(c=(0|u)<29?u:29,s>>>0<=(u=_+-4|0)>>>0){for(l=0;b=0|he(0|(S=0|ge(0|(S=0|Ne(0|_e[u>>2],0,0|c)),0|L,0|l,0)),0|(P=L),1e9,0),_e[u>>2]=b,l=0|Fe(0|S,0|P,1e9,0),s>>>0<=(u=u+-4|0)>>>0;);l&&(_e[(s=s+-4|0)>>2]=l)}for(l=_;!(l>>>0<=s>>>0||0|_e[(u=l+-4|0)>>2]);)l=u;if(u=(0|_e[M>>2])-c|0,!(0<(0|(_e[M>>2]=u))))break;_=l}else s=C;if((0|u)<0){n=1+((f+25|0)/9|0)|0,A=102==(0|m);do{if(T=(0|(T=0-u|0))<9?T:9,s>>>0<l>>>0){for(c=(1<<T)-1|0,_=1e9>>>T,d=0,u=s;P=0|_e[u>>2],_e[u>>2]=(P>>>T)+d,d=0|ie(P&c,_),(u=u+4|0)>>>0<l>>>0;);u=0==(0|_e[s>>2])?s+4|0:s,u=d?(_e[l>>2]=d,s=u,l+4|0):(s=u,l)}else s=0==(0|_e[s>>2])?s+4|0:s,u=l}while(l=(0|n)<(u-(l=A?C:s)>>2|0)?l+(n<<2)|0:u,u=(0|_e[M>>2])+T|0,(0|(_e[M>>2]=u))<0);u=s,n=l}else u=s,n=l;if(P=C,u>>>0<n>>>0){if(l=9*(P-u>>2)|0,10<=(c=0|_e[u>>2])>>>0)for(s=10;l=l+1|0,(s=10*s|0)>>>0<=c>>>0;);}else l=0;if((0|(s=f-(102!=(0|m)?l:0)+(((b=0!=(0|f))&(A=103==(0|m)))<<31>>31)|0))<((9*(n-P>>2)|0)-9|0)){if(T=C+4+(((0|(s=s+9216|0))/9|0)-1024<<2)|0,(0|(s=1+((0|s)%9|0)|0))<9)for(c=10;c=10*c|0,9!=(0|(s=s+1|0)););else c=10;if((s=(T+4|0)==(0|n))&0==(0|(d=((_=0|_e[T>>2])>>>0)%(c>>>0)|0)))s=T;else if(E=0==(1&((_>>>0)/(c>>>0)|0)|0)?9007199254740992:9007199254740994,r=d>>>0<(S=(0|c)/2|0)>>>0?.5:s&(0|d)==(0|S)?1:1.5,p&&(r=(S=45==(0|ce[h>>0]))?-r:r,E=S?-E:E),_e[T>>2]=s=_-d|0,E+r!=E){if(999999999<(_e[T>>2]=S=s+c|0)>>>0)for(l=T;(s=l+-4|0)>>>(_e[l>>2]=0)<u>>>0&&(_e[(u=u+-4|0)>>2]=0),S=1+(0|_e[s>>2])|0,999999999<(_e[s>>2]=S)>>>0;)l=s;else s=T;if(l=9*(P-u>>2)|0,10<=(_=0|_e[u>>2])>>>0)for(c=10;l=l+1|0,(c=10*c|0)>>>0<=_>>>0;);}else s=T;s=(s=s+4|0)>>>0<n>>>0?s:n,S=u}else s=n,S=u;for(m=s;;){if(m>>>0<=S>>>0){M=0;break}if(0|_e[(u=m+-4|0)>>2]){M=1;break}m=u}n=0-l|0;do{if(A){if(f=(0|l)<(0|(u=(1&(1^b))+f|0))&-5<(0|l)?(c=a+-1|0,u+-1-l|0):(c=a+-2|0,u+-1|0),!(u=8&i)){if(M&&0!=(0|(R=0|_e[m+-4>>2])))if((R>>>0)%10|0)s=0;else for(s=0,u=10;s=s+1|0,!((R>>>0)%((u=10*u|0)>>>0)|0););else s=9;if(u=(9*(m-P>>2)|0)-9|0,102==(32|c)){f=(0|f)<(0|(T=0<(0|(T=u-s|0))?T:0))?f:T,T=0;break}f=(0|f)<(0|(T=0<(0|(T=u+l-s|0))?T:0))?f:T,T=0;break}T=u}else c=a,T=8&i}while(0);if(_=0!=(0|(A=f|T))&1,d=102==(32|c))u=(b=0)<(0|l)?l:0;else{if(((s=N)-(u=0|fe(u=(0|l)<0?n:l,((0|u)<0)<<31>>31,N))|0)<2)for(;ce[(u=u+-1|0)>>0]=48,(s-u|0)<2;);ce[u+-1>>0]=43+(l>>31&2),ce[(u=u+-2|0)>>0]=c,u=s-(b=u)|0}if(se(e,32,t,u=p+1+f+_+u|0,i),Ie(e,h,p),se(e,48,t,u,65536^i),d){_=T=O+9|0,d=O+8|0,s=c=C>>>0<S>>>0?C:S;do{if(l=0|fe(0|_e[s>>2],0,T),(0|s)==(0|c))(0|l)==(0|T)&&(ce[d>>0]=48,l=d);else if(O>>>0<l>>>0)for(ne(0|O,48,l-y|0);O>>>0<(l=l+-1|0)>>>0;);}while(Ie(e,l,_-l|0),(s=s+4|0)>>>0<=C>>>0);if(0|A&&Ie(e,2138,1),s>>>0<m>>>0&0<(0|f))for(;;){if(O>>>0<(l=0|fe(0|_e[s>>2],0,T))>>>0)for(ne(0|O,48,l-y|0);O>>>0<(l=l+-1|0)>>>0;);if(Ie(e,l,(0|f)<9?f:9),l=f+-9|0,!((s=s+4|0)>>>0<m>>>0&9<(0|f))){f=l;break}f=l}se(e,48,f+9|0,9,0)}else{if(A=M?m:S+4|0,-1<(0|f)){T=0==(0|T),n=M=O+9|0,_=0-y|0,d=O+8|0,c=S;do{(0|(l=0|fe(0|_e[c>>2],0,M)))==(0|M)&&(ce[d>>0]=48,l=d);do{if((0|c)==(0|S)){if(s=l+1|0,Ie(e,l,1),T&(0|f)<1){l=s;break}Ie(e,2138,1),l=s}else{if(l>>>0<=O>>>0)break;for(ne(0|O,48,l+_|0);O>>>0<(l=l+-1|0)>>>0;);}}while(0)}while(Ie(e,l,(0|(y=n-l|0))<(0|f)?y:f),(c=c+4|0)>>>0<A>>>0&-1<(0|(f=f-y|0)))}se(e,48,f+18|0,18,0),Ie(e,b,N-b|0)}se(e,32,t,u,8192^i)}else O=0!=(32&a|0),se(e,32,t,u=p+3|0,-65537&i),Ie(e,h,p),Ie(e,r!=r|!1?O?2114:2118:O?2106:2110,3),se(e,32,t,u,8192^i)}while(0);return Te=v,0|((0|u)<(0|t)?t:u)}function w(e,r,t,n,i){e|=0,t|=0,n|=0,i|=0;var a,o,u,f,l,s,c,_,d,E,T=0,A=0,M=0,b=0,m=0,S=0,P=0,R=0,h=0,p=0,C=0,N=0,y=0,O=Te;Te=Te+64|0,f=(c=O)+24|0,_=O+8|0,d=O+20|0,_e[(s=O+16|0)>>2]=r|=0,a=0!=(0|e),u=o=40+f|0,f=39+f|0,l=4+_|0,S=T=A=0;e:for(;;){do{if(-1<(0|T)){if((2147483647-T|0)<(0|A)){_e[(T=296)>>2]=75,T=-1;break}T=A+T|0;break}}while(0);if(!((A=0|ce[r>>0])<<24>>24)){y=87;break}M=r;r:for(;;){switch(A<<24>>24){case 37:A=M,y=9;break r;case 0:A=M;break r}_e[s>>2]=N=M+1|0,A=0|ce[N>>0],M=N}r:do{if(9==(0|y))for(;;){if(37!=((y=0)|ce[M+1>>0]))break r;if(A=A+1|0,_e[s>>2]=M=M+2|0,37!=(0|ce[M>>0]))break;y=9}}while(0);if(A=A-r|0,a&&Ie(e,r,A),0|A)r=M;else{(A=(0|ce[(b=M+1|0)>>0])-48|0)>>>0<10?(C=(N=36==(0|ce[M+2>>0]))?A:-1,S=N?1:S,b=N?M+3|0:b):C=-1,_e[s>>2]=b,M=((A=0|ce[b>>0])<<24>>24)-32|0;r:do{if(M>>>0<32)for(m=0,P=A;;){if(!(75913&(A=1<<M))){A=P;break r}if(m|=A,_e[s>>2]=b=b+1|0,32<=(M=((A=0|ce[b>>0])<<24>>24)-32|0)>>>0)break;P=A}else m=0}while(0);if(A<<24>>24==42){if((A=(0|ce[(M=b+1|0)>>0])-48|0)>>>0<10&&36==(0|ce[b+2>>0]))_e[i+(A<<2)>>2]=10,A=0|_e[n+((0|ce[M>>0])-48<<3)>>2],S=1,b=b+3|0;else{if(0|S){T=-1;break}b=(S=a?(S=3+(0|_e[t>>2])&-4,A=0|_e[S>>2],_e[t>>2]=S+4,0):A=0,M)}_e[s>>2]=b,A=(N=(0|A)<0)?0-A|0:A,m=N?8192|m:m}else{if((0|(A=0|Se(s)))<0){T=-1;break}b=0|_e[s>>2]}do{if(46==(0|ce[b>>0])){if(42!=(0|ce[b+1>>0])){_e[s>>2]=b+1,M=0|Se(s),b=0|_e[s>>2];break}if((M=(0|ce[(P=b+2|0)>>0])-48|0)>>>0<10&&36==(0|ce[b+3>>0])){_e[i+(M<<2)>>2]=10,M=0|_e[n+((0|ce[P>>0])-48<<3)>>2],_e[s>>2]=b=b+4|0;break}if(0|S){T=-1;break e}a?(N=3+(0|_e[t>>2])&-4,M=0|_e[N>>2],_e[t>>2]=N+4):M=0,b=_e[s>>2]=P}else M=-1}while(0);for(p=0;;){if(57<((0|ce[b>>0])-65|0)>>>0){T=-1;break e}if(_e[s>>2]=N=b+1|0,!(((R=255&(P=0|ce[(0|ce[b>>0])-65+(1606+(58*p|0))>>0]))+-1|0)>>>0<8))break;p=R,b=N}if(!(P<<24>>24)){T=-1;break}h=-1<(0|C);do{if(P<<24>>24==19){if(h){T=-1;break e}y=49}else{if(h){_e[i+(C<<2)>>2]=R,C=0|_e[(h=n+(C<<3)|0)+4>>2],_e[(y=c)>>2]=_e[h>>2],_e[y+4>>2]=C,y=49;break}if(!a){T=0;break e}H(c,R,t)}}while(0);if(49!=(0|y)||(y=0,a)){b=0!=(0|p)&3==(15&(b=0|ce[b>>0])|0)?-33&b:b,h=-65537&m,C=0==(8192&m|0)?m:h;r:do{switch(0|b){case 110:switch((255&p)<<24>>24){case 0:case 1:_e[_e[c>>2]>>2]=T,A=0,r=N;continue e;case 2:A=0|_e[c>>2],_e[A>>2]=T,_e[A+4>>2]=((0|T)<0)<<31>>31,A=0,r=N;continue e;case 3:W[_e[c>>2]>>1]=T,A=0,r=N;continue e;case 4:ce[_e[c>>2]>>0]=T,A=0,r=N;continue e;case 6:_e[_e[c>>2]>>2]=T,A=0,r=N;continue e;case 7:A=0|_e[c>>2],_e[A>>2]=T,_e[A+4>>2]=((0|T)<0)<<31>>31,A=0,r=N;continue e;default:A=0,r=N;continue e}case 112:b=120,M=8<M>>>0?M:8,r=8|C,y=61;break;case 88:case 120:r=C,y=61;break;case 111:P=2070,M=(m=0)==(8&C|0)|(0|(h=u-(R=0|function(e,r,t){if(t|=0,!(0==(0|(e|=0))&0==(0|(r|=0))))for(;ce[(t=t+-1|0)>>0]=7&e|48,e=0|ye(0|e,0|r,3),r=L,!(0==(0|e)&0==(0|r)););return 0|t}(r=0|_e[(b=c)>>2],b=0|_e[b+4>>2],o))|0))<(0|M)?M:h+1|0,h=C,y=67;break;case 105:case 100:if(r=0|_e[(b=c)>>2],(0|(b=0|_e[b+4>>2]))<0){r=0|ve(0,0,0|r,0|b),b=L,_e[(m=c)>>2]=r,_e[m+4>>2]=b,m=1,P=2070,y=66;break r}m=0!=(2049&C|0)&1,P=0==(2048&C|0)?0==(1&C|0)?2070:2072:2071,y=66;break r;case 117:P=2070,r=(m=0)|_e[(b=c)>>2],b=0|_e[b+4>>2],y=66;break;case 99:ce[f>>0]=_e[c>>2],r=f,m=0,P=2070,R=o,b=1,M=h;break;case 109:b=0|(E=0|_e[(b=296)>>2],0|function(e,r){e|=0,r|=0;var t=0,n=0;n=0;for(;;){if((0|de[2140+n>>0])==(0|e)){e=2;break}if(87==(0|(t=n+1|0))){t=2228,n=87,e=5;break}n=t}2==(0|e)&&(n?(t=2228,e=5):t=2228);if(5==(0|e))for(;;){for(;t=(e=t)+1|0,0!=(0|ce[e>>0]););if(!(n=n+-1|0))break;e=5}return 0|function(e,r){return 0|function(e,r){e|=0,r=(r|=0)?0|function(e,r,t){r|=0,t|=0;var n=0,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0;_=1794895138+(0|_e[(e|=0)>>2])|0,a=0|Ge(0|_e[e+8>>2],_),n=0|Ge(0|_e[e+12>>2],_),i=0|Ge(0|_e[e+16>>2],_);t:do{if(a>>>0<r>>>2>>>0&&(c=r-(a<<2)|0,n>>>0<c>>>0&i>>>0<c>>>0)&&0==(3&(i|n)|0)){for(c=n>>>2,s=i>>>2,l=0;;){if(n=0|Ge(0|_e[e+((i=(o=(f=l+(u=a>>>1)|0)<<1)+c|0)<<2)>>2],_),!((i=0|Ge(0|_e[e+(i+1<<2)>>2],_))>>>0<r>>>0&n>>>0<(r-i|0)>>>0)){n=0;break t}if(0|ce[e+(i+n)>>0]){n=0;break t}if(!(n=0|function(e,r){r|=0;var t=0,n=0;if(t=0|ce[(e|=0)>>0],n=0|ce[r>>0],t<<24>>24==0||t<<24>>24!=n<<24>>24)e=n;else{for(;r=r+1|0,t=0|ce[(e=e+1|0)>>0],n=0|ce[r>>0],t<<24>>24!=0&&t<<24>>24==n<<24>>24;);e=n}return(255&t)-(255&e)|0}(t,e+i|0)))break;if(n=(0|n)<0,1==(0|a)){n=0;break t}l=n?l:f,a=n?u:a-u|0}i=0|Ge(0|_e[e+((n=o+s|0)<<2)>>2],_),n=(n=0|Ge(0|_e[e+(n+1<<2)>>2],_))>>>0<r>>>0&i>>>0<(r-n|0)>>>0&&0==(0|ce[e+(n+i)>>0])?e+n|0:0}else n=0}while(0);return 0|n}(0|_e[r>>2],0|_e[r+4>>2],e):0;return 0|(0|r?r:e)}(e|=0,r|=0)}(t,0|_e[r+20>>2])}(E|=0,0|_e[105])),y=71;break;case 115:b=0|(b=0|_e[c>>2])?b:2080,y=71;break;case 67:_e[_>>2]=_e[c>>2],_e[l>>2]=0,R=-1,b=_e[c>>2]=_,y=75;break;case 83:r=0|_e[c>>2],y=M?(R=M,b=r,75):(se(e,32,A,0,C),r=0,84);break;case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:A=0|D(e,+k[c>>3],A,M,C,b),r=N;continue e;default:m=0,P=2070,R=o,b=M,M=C}}while(0);r:do{if(61==(0|y))R=0|function(e,r,t,n){if(t|=0,n|=0,!(0==(0|(e|=0))&0==(0|(r|=0))))for(;ce[(t=t+-1|0)>>0]=0|de[2122+(15&e)>>0]|n,e=0|ye(0|e,0|r,4),r=L,!(0==(0|e)&0==(0|r)););return 0|t}(p=0|_e[(C=c)>>2],C=0|_e[C+4>>2],o,32&b),m=(P=0==(8&r|0)|0==(0|p)&0==(0|C))?0:2,P=P?2070:2070+(b>>4)|0,h=r,r=p,b=C,y=67;else if(66==(0|y))R=0|fe(r,b,o),h=C,y=67;else if(71==(0|y))P=2070,R=(p=(m=y=0)==(0|(C=0|function(e,r,t){e|=0;var n=0,i=0,a=0,o=0;a=255&(r|=0),n=0!=(0|(t|=0));t:do{if(n&0!=(3&e|0))for(i=255&r;;){if((0|ce[e>>0])==i<<24>>24){o=6;break t}if(!((n=0!=(0|(t=t+-1|0)))&0!=(3&(e=e+1|0)|0))){o=5;break}}else o=5}while(0);5==(0|o)&&(n?o=6:t=0);t:do{if(6==(0|o)&&(i=255&r,(0|ce[e>>0])!=i<<24>>24)){n=0|ie(a,16843009);n:do{if(3<t>>>0){for(;!((-2139062144&(a=_e[e>>2]^n)^-2139062144)&a+-16843009|0);)if(e=e+4|0,(t=t+-4|0)>>>0<=3){o=11;break n}}else o=11}while(0);if(11==(0|o)&&!t){t=0;break}for(;;){if((0|ce[e>>0])==i<<24>>24)break t;if(e=e+1|0,!(t=t+-1|0)){t=0;break}}}}while(0);return 0|(0|t?e:0)}(r=b,0,M))))?b+M|0:C,b=p?M:C-b|0,M=h;else if(75==(0|y)){for(P=b,M=r=y=0;(m=0|_e[P>>2])&&!((0|(M=0|De(d,m)))<0|(R-r|0)>>>0<M>>>0)&&(r=M+r|0)>>>0<R>>>0;)P=P+4|0;if((0|M)<0){T=-1;break e}if(se(e,32,A,r,C),r)for(m=0;;){if(!(M=0|_e[b>>2])){y=84;break r}if((0|r)<(0|(m=(M=0|De(d,M))+m|0))){y=84;break r}if(Ie(e,d,M),r>>>0<=m>>>0){y=84;break}b=b+4|0}else r=0,y=84}}while(0);if(67==(0|y))C=(y=0)!=(0|M)|(b=0!=(0|r)|0!=(0|b)),b=u-R+(1&(1^b))|0,r=C?R:o,R=o,b=!C||(0|b)<(0|M)?M:b,M=-1<(0|M)?-65537&h:h;else if(84==(0|y)){y=0,se(e,32,A,r,8192^C),A=(0|r)<(0|A)?A:r,r=N;continue}se(e,32,A=(0|A)<(0|(C=(h=(0|b)<(0|(p=R-r|0))?p:b)+m|0))?C:A,C,M),Ie(e,P,m),se(e,48,A,C,65536^M),se(e,48,h,p,0),Ie(e,r,p),se(e,32,A,C,8192^M),r=N}else A=0,r=N}}e:do{if(87==(0|y)&&!e)if(S){for(T=1;r=0|_e[i+(T<<2)>>2];)if(H(n+(T<<3)|0,r,t),10<=(0|(T=T+1|0))){T=1;break e}for(;;){if(0|_e[i+(T<<2)>>2]){T=-1;break e}if(10<=(0|(T=T+1|0))){T=1;break}}}else T=0}while(0);return Te=O,0|T}function V(e,r){r|=0;var t,n,i,a,o,u,f,l,s,c,_,d,E,T,A=0,M=0,b=0,m=0,S=0,P=0,R=0,h=0,p=0,C=0,N=Te;if(Te=Te+704|0,E=N+144|0,d=N+128|0,_=N+112|0,c=N+96|0,s=N+80|0,l=N+64|0,f=N+48|0,T=N+32|0,t=N+16|0,i=(P=N)+184|0,C=N+160|0,!(a=0|function(e,r){e|=0;var t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0;if(Te=(l=Te)+528|0,a=(o=l)+16|0,!(r|=0))return Te=l,(f=0)|f;if(r>>>0<=16)return f=0|Q(e,r),Te=l,0|f;if(u=0|Q(e,r+-16|0),(0|(r=0|_e[(f=e+20|0)>>2]))<16)for(n=e+4|0,i=e+8|0,t=e+16|0;e=(0|(e=0|_e[n>>2]))==(0|_e[i>>2])?0:(_e[n>>2]=e+1,0|de[e>>0]),r=r+8|0,33<=(0|(_e[f>>2]=r))&&(_e[o>>2]=866,_e[o+4>>2]=3208,_e[o+8>>2]=1366,Ce(a,812,o),Me(a),r=0|_e[f>>2]),e=e<<32-r|_e[t>>2],_e[t>>2]=e,(0|r)<16;);else e=0|_e[(t=e=e+16|0)>>2];return _e[t>>2]=e<<16,_e[f>>2]=r+-16,Te=l,0|(f=e>>>16|u<<16)}(e|=0,14)))return function(e){var r=0,t=0,n=0,i=0,a=0,o=0;Te=(o=Te)+544|0,a=o+16|0,i=(n=o)+32|0,(_e[(e|=0)>>2]=0)|(t=0|_e[(r=e+4|0)>>2])&&(7&t?(_e[n>>2]=866,_e[n+4>>2]=2506,_e[n+8>>2]=1232,Ce(i,812,n),Me(i)):ue(t,0,0,1,0),_e[r>>2]=0,_e[e+8>>2]=0,_e[e+12>>2]=0);ce[e+16>>0]=0,Te=((r=0|_e[(e=e+20|0)>>2])&&(Z(r),7&r?(_e[a>>2]=866,_e[4+a>>2]=2506,_e[8+a>>2]=1232,Ce(i,812,a),Me(i)):ue(r,0,0,1,0),_e[e>>2]=0),o)}(r),Te=N,0|(C=1);if(o=r+4|0,(0|(A=0|_e[(u=r+8|0)>>2]))!=(0|a)){if(A>>>0<=a>>>0){do{if((0|_e[r+12>>2])>>>0<a>>>0){if(0|X(o,a,(A+1|0)==(0|a),1,0)){A=0|_e[u>>2];break}return ce[r+16>>0]=1,Te=N,(C=0)|C}}while(0);ne((0|_e[o>>2])+A|0,0,a-A|0)}_e[u>>2]=a}if(ne(0|_e[o>>2],0,0|a),(0|(A=0|_e[(n=e+20|0)>>2]))<5)for(m=e+4|0,S=e+8|0,b=e+16|0;M=(0|(M=0|_e[m>>2]))==(0|_e[S>>2])?0:(_e[m>>2]=M+1,0|de[M>>0]),33<=(0|(_e[n>>2]=A=A+8|0))&&(_e[P>>2]=866,_e[P+4>>2]=3208,_e[P+8>>2]=1366,Ce(i,812,P),Me(i),A=0|_e[n>>2]),M=M<<32-A|_e[b>>2],_e[b>>2]=M,(0|A)<5;);else M=0|_e[(b=M=e+16|0)>>2];if(h=M>>>27,_e[b>>2]=M<<5,_e[n>>2]=A+-5,20<(h+-1|0)>>>0)return Te=N,(C=0)|C;_e[C+20>>2]=0,_e[C>>2]=0,_e[C+4>>2]=0,_e[C+8>>2]=0,_e[C+12>>2]=0,A=C+4|(ce[C+16>>0]=0),M=C+8|0;e:do{if(0|X(A,21,0,1,0)){m=0|_e[M>>2],ne((R=0|_e[A>>2])+m|0,0,21-m|0),_e[M>>2]=21,m=e+4|0,S=e+8|0,P=e+16|0,b=0;do{if((0|(A=0|_e[n>>2]))<3)for(;M=(0|(M=0|_e[m>>2]))==(0|_e[S>>2])?0:(_e[m>>2]=M+1,0|de[M>>0]),33<=(0|(_e[n>>2]=A=A+8|0))&&(_e[t>>2]=866,_e[4+t>>2]=3208,_e[8+t>>2]=1366,Ce(i,812,t),Me(i),A=0|_e[n>>2]),M=M<<32-A|_e[P>>2],_e[P>>2]=M,(0|A)<3;);else M=0|_e[P>>2]}while(_e[P>>2]=M<<3,_e[n>>2]=A+-3,ce[R+(0|de[1327+b>>0])>>0]=M>>>29,(0|(b=b+1|0))!=(0|h));if(0|$(C)){P=e+4|0,R=e+8|0,h=e+16|0,A=0;r:do{S=a-A|0,b=0|Ae(e,C);t:do{if(b>>>0<17)(0|_e[u>>2])>>>0<=A>>>0&&(_e[T>>2]=866,_e[4+T>>2]=910,_e[8+T>>2]=1497,Ce(i,812,T),Me(i)),ce[(0|_e[o>>2])+A>>0]=b,A=A+1|0;else switch(0|b){case 17:if((0|(M=0|_e[n>>2]))<3)for(;b=(0|(b=0|_e[P>>2]))==(0|_e[R>>2])?0:(_e[P>>2]=b+1,0|de[b>>0]),33<=(0|(_e[n>>2]=M=M+8|0))&&(_e[f>>2]=866,_e[4+f>>2]=3208,_e[8+f>>2]=1366,Ce(i,812,f),Me(i),M=0|_e[n>>2]),b=b<<32-M|_e[h>>2],_e[h>>2]=b,(0|M)<3;);else b=0|_e[h>>2];if(_e[h>>2]=b<<3,_e[n>>2]=M+-3,M=S>>>0<(b=3+(b>>>29)|0)>>>0){A=0;break e}A=(M?0:b)+A|0;break t;case 18:if((0|(M=0|_e[n>>2]))<7)for(;b=(0|(b=0|_e[P>>2]))==(0|_e[R>>2])?0:(_e[P>>2]=b+1,0|de[b>>0]),33<=(0|(_e[n>>2]=M=M+8|0))&&(_e[l>>2]=866,_e[4+l>>2]=3208,_e[8+l>>2]=1366,Ce(i,812,l),Me(i),M=0|_e[n>>2]),b=b<<32-M|_e[h>>2],_e[h>>2]=b,(0|M)<7;);else b=0|_e[h>>2];if(_e[h>>2]=b<<7,_e[n>>2]=M+-7,M=S>>>0<(b=11+(b>>>25)|0)>>>0){A=0;break e}A=(M?0:b)+A|0;break t;default:if(2<=(b+-19|0)>>>0){p=81;break r}if(M=0|_e[n>>2],19==(0|b)){if((0|M)<2)for(b=M;m=(0|(M=0|_e[P>>2]))==(0|_e[R>>2])?0:(_e[P>>2]=M+1,0|de[M>>0]),33<=(0|(_e[n>>2]=M=b+8|0))&&(_e[s>>2]=866,_e[4+s>>2]=3208,_e[8+s>>2]=1366,Ce(i,812,s),Me(i),M=0|_e[n>>2]),b=m<<32-M|_e[h>>2],_e[h>>2]=b,(0|M)<2;)b=M;else b=0|_e[h>>2];_e[h>>2]=b<<2,b>>>=30,m=3,M=M+-2|0}else{if((0|M)<6)for(;b=(0|(b=0|_e[P>>2]))==(0|_e[R>>2])?0:(_e[P>>2]=b+1,0|de[b>>0]),33<=(0|(_e[n>>2]=M=M+8|0))&&(_e[c>>2]=866,_e[4+c>>2]=3208,_e[8+c>>2]=1366,Ce(i,812,c),Me(i),M=0|_e[n>>2]),b=b<<32-M|_e[h>>2],_e[h>>2]=b,(0|M)<6;);else b=0|_e[h>>2];_e[h>>2]=b<<6,b>>>=26,m=7,M=M+-6|0}if(_e[n>>2]=M,0==(0|A)|S>>>0<(b=b+m|0)>>>0){A=0;break e}if((0|_e[u>>2])>>>0<=(M=A+-1|0)>>>0&&(_e[_>>2]=866,_e[4+_>>2]=910,_e[8+_>>2]=1497,Ce(i,812,_),Me(i)),!((m=0|ce[(0|_e[o>>2])+M>>0])<<24>>24)){A=0;break e}if((M=b+A|0)>>>0<=A>>>0)break t;for(;(0|_e[u>>2])>>>0<=A>>>0&&(_e[d>>2]=866,_e[4+d>>2]=910,_e[8+d>>2]=1497,Ce(i,812,d),Me(i)),ce[(0|_e[o>>2])+A>>0]=m,(0|(A=A+1|0))!=(0|M););A=M}}while(0)}while(A>>>0<a>>>0);if(81==(0|p)){_e[E>>2]=866,_e[4+E>>2]=3149,_e[8+E>>2]=1348,Ce(i,812,E),Me(i),A=0;break}A=(0|a)==(0|A)?0|$(r):0}else A=0}else ce[C+16>>0]=1,A=0}while(0);return re(C),Te=N,0|(C=A)}function G(e,r,t,n){e|=0,t|=0;var i,a,o,u,f,l,s,c,_=0,d=0,E=0,T=0,A=0,M=0,b=0,m=0,S=0,P=0,R=0,h=0,p=0,C=0,N=0,y=0,O=0,v=0,k=0,g=Te;if(Te=Te+880|0,v=g+144|0,c=g+128|0,s=g+112|0,l=g+96|0,y=g+80|0,C=g+64|0,h=g+48|0,p=g+32|0,m=g+16|0,u=(b=g)+360|0,f=g+296|0,k=g+224|0,R=g+156|0,0==(0|(r|=0))|11<(n|=0)>>>0)return Te=g,(k=0)|k;for(_e[e>>2]=r,d=(_=k)+68|0;(0|(_=_+4|(_e[_>>2]=0)))<(0|d););for(_=0;d=k+((255&(O=0|ce[t+_>>0]))<<2)|0,O<<24>>24&&(_e[d>>2]=1+(0|_e[d>>2])),(0|(_=_+1|0))!=(0|r););for(T=E=d=0,A=-1,M=1;(_=0|_e[k+(M<<2)>>2])?(_e[f+((S=M+-1|0)<<2)>>2]=d,_e[e+28+(S<<2)>>2]=1+((d=_+d|0)+-1<<(O=16-M|0)|(1<<O)-1),_e[e+96+(S<<2)>>2]=E,S=_+(_e[R+(M<<2)>>2]=E)|0,T=M>>>0<T>>>0?T:M,A=A>>>0<M>>>0?A:M):(_e[e+28+(M+-1<<2)>>2]=0,S=E),17!=(0|(M=M+1|0));)d<<=1,E=S;_e[e+4>>2]=S,d=e+172|0;do{if(S>>>0>(0|_e[d>>2])>>>0){_=(_=S+-1|0)&S?(_|=_>>>16,_|=_>>>8,_|=_>>>4,r>>>0<(_=1+((_|=_>>>2)>>>1|_)|0)>>>0?r:_):S,_e[d>>2]=_,_=0|_e[(E=e+176|0)>>2];do{if(0|_){if(O=0|_e[_+-4>>2],_=_+-8|0,0!=(0|O)&&(0|O)==(0|~_e[_>>2])||(_e[b>>2]=866,_e[b+4>>2]=651,_e[b+8>>2]=1579,Ce(u,812,b),Me(u)),7&_){_e[m>>2]=866,_e[m+4>>2]=2506,_e[m+8>>2]=1232,Ce(u,812,m),Me(u);break}ue(_,0,0,1,0);break}}while(0);if(d=0|te(8+((_=0|(_=0|_e[d>>2])?_:1)<<1)|0,0)){_e[d+4>>2]=_,_e[d>>2]=~_,_e[E>>2]=d+8,P=24;break}n=_e[E>>2]=0;break}}while(P=24,0);e:do{if(24==(0|P)){for(ce[(O=e+24|0)>>0]=A,ce[e+25>>0]=T,E=e+176|0,d=0;_=255&(N=0|ce[t+d>>0]),N<<24>>24&&(0|_e[k+(_<<2)>>2]||(_e[p>>2]=866,_e[p+4>>2]=2276,_e[p+8>>2]=977,Ce(u,812,p),Me(u)),_=0|_e[(N=R+(_<<2)|0)>>2],_e[N>>2]=_+1,S>>>0<=_>>>0&&(_e[h>>2]=866,_e[h+4>>2]=2280,_e[h+8>>2]=990,Ce(u,812,h),Me(u)),W[(0|_e[E>>2])+(_<<1)>>1]=d),(0|(d=d+1|0))!=(0|r););if(o=(0|de[O>>0])>>>0<n>>>0?n:0,a=0!=(0|(_e[(N=e+8|0)>>2]=o))){i=1<<o,_=e+164|0;do{if(i>>>0>(0|_e[_>>2])>>>0){_e[_>>2]=i,_=0|_e[(E=e+168|0)>>2];do{if(0|_){if(p=0|_e[_+-4>>2],_=_+-8|0,0!=(0|p)&&(0|p)==(0|~_e[_>>2])||(_e[C>>2]=866,_e[C+4>>2]=651,_e[C+8>>2]=1579,Ce(u,812,C),Me(u)),7&_){_e[y>>2]=866,_e[y+4>>2]=2506,_e[y+8>>2]=1232,Ce(u,812,y),Me(u);break}ue(_,0,0,1,0);break}}while(0);if(d=0|te((_=i<<2)+8|0,0)){y=d+8|0,_e[d+4>>2]=i,_e[d>>2]=~i,d=_e[E>>2]=y;break}n=_e[E>>2]=0;break e}}while(_=i<<2,d=0|_e[(E=d=e+168|0)>>2],0);ne(0|d,-1,0|_),h=e+176|0,R=1;do{if(0|_e[k+(R<<2)>>2]&&(C=1<<(p=o-R|0),d=0|_e[f+((_=R+-1|0)<<2)>>2],16<=_>>>0&&(_e[l>>2]=866,_e[4+l>>2]=1960,_e[8+l>>2]=1453,Ce(u,812,l),Me(u)),d>>>0<=(r=0==(0|(r=0|_e[e+28+(_<<2)>>2]))?-1:(r+-1|0)>>>(16-R|0))>>>0)){S=(0|_e[e+96+(_<<2)>>2])-d|0,P=R<<16;do{for(_=0|Ee[(0|_e[h>>2])+(S+d<<1)>>1],(0|de[t+_>>0])!=(0|R)&&(_e[s>>2]=866,_e[4+s>>2]=2322,_e[8+s>>2]=1019,Ce(u,812,s),Me(u)),m=d<<p,M=_|P,A=0;i>>>0<=(b=A+m|0)>>>0&&(_e[c>>2]=866,_e[4+c>>2]=2328,_e[8+c>>2]=1053,Ce(u,812,c),Me(u)),_=0|_e[E>>2],-1!=(0|_e[_+(b<<2)>>2])&&(_e[v>>2]=866,_e[v+4>>2]=2330,_e[v+8>>2]=1076,Ce(u,812,v),Me(u),_=0|_e[E>>2]),_e[_+(b<<2)>>2]=M,(A=A+1|0)>>>0<C>>>0;);}while((d=d+1|0)>>>0<=r>>>0)}}while((R=R+1|0)>>>0<=o>>>0)}_e[(_=e+96|0)>>2]=(0|_e[_>>2])-(0|_e[f>>2]),_e[(_=e+100|0)>>2]=(0|_e[_>>2])-(0|_e[4+f>>2]),_e[(_=e+104|0)>>2]=(0|_e[_>>2])-(0|_e[8+f>>2]),_e[(_=e+108|0)>>2]=(0|_e[_>>2])-(0|_e[12+f>>2]),_e[(_=e+112|0)>>2]=(0|_e[_>>2])-(0|_e[16+f>>2]),_e[(_=e+116|0)>>2]=(0|_e[_>>2])-(0|_e[20+f>>2]),_e[(_=e+120|0)>>2]=(0|_e[_>>2])-(0|_e[24+f>>2]),_e[(_=e+124|0)>>2]=(0|_e[_>>2])-(0|_e[28+f>>2]),_e[(_=e+128|0)>>2]=(0|_e[_>>2])-(0|_e[32+f>>2]),_e[(_=e+132|0)>>2]=(0|_e[_>>2])-(0|_e[36+f>>2]),_e[(_=e+136|0)>>2]=(0|_e[_>>2])-(0|_e[40+f>>2]),_e[(_=e+140|0)>>2]=(0|_e[_>>2])-(0|_e[44+f>>2]),_e[(_=e+144|0)>>2]=(0|_e[_>>2])-(0|_e[48+f>>2]),_e[(_=e+148|0)>>2]=(0|_e[_>>2])-(0|_e[52+f>>2]),_e[(_=e+152|0)>>2]=(0|_e[_>>2])-(0|_e[56+f>>2]),_e[(_=e+156|0)>>2]=(0|_e[_>>2])-(0|_e[60+f>>2]),_e[(_=e+16|0)>>2]=0,_e[(d=e+20|0)>>2]=de[O>>0];r:do{if(a){do{if(!n)break r}while(n=(v=n)+-1|0,!(0|_e[k+(v<<2)>>2]));if(_e[_>>2]=_e[e+28+(n<<2)>>2],(_e[d>>2]=n=o+1|0)>>>0<=T>>>0){for(;!(0|_e[k+(n<<2)>>2]);)if(T>>>0<(n=n+1|0)>>>0)break r;_e[d>>2]=n}}}while(0);_e[e+92>>2]=-1,_e[e+160>>2]=1048575,_e[e+12>>2]=32-(0|_e[N>>2]),n=1}}while(0);return Te=g,0|(k=n)}function F(e){var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=0;if(e|=0){i=0|_e[1148],f=(t=e+-8|0)+(r=-8&(e=0|_e[e+-4>>2]))|0;do{if(1&e)o=u=t;else{if(n=0|_e[t>>2],!(3&e))return;if(a=n+r|0,(o=t+(0-n)|0)>>>0<i>>>0)return;if((0|o)==(0|_e[1149])){if(3==(3&(r=0|_e[(e=f+4|0)>>2])|0))return _e[1146]=a,_e[e>>2]=-2&r,_e[o+4>>2]=1|a,void(_e[o+a>>2]=a);u=o,r=a;break}if(t=n>>>3,n>>>0<256){if(e=0|_e[o+8>>2],(0|(r=0|_e[o+12>>2]))==(0|e)){_e[1144]=_e[1144]&~(1<<t),u=o,r=a;break}_e[e+12>>2]=r,_e[r+8>>2]=e,u=o,r=a;break}i=0|_e[o+24>>2],e=0|_e[o+12>>2];do{if((0|e)==(0|o)){if(!(e=0|_e[(r=(t=o+16|0)+4|0)>>2])){if(!(e=0|_e[t>>2])){e=0;break}r=t}for(;;)if(0|(n=0|_e[(t=e+20|0)>>2]))e=n,r=t;else{if(!(n=0|_e[(t=e+16|0)>>2]))break;e=n,r=t}_e[r>>2]=0}else u=0|_e[o+8>>2],_e[u+12>>2]=e,_e[e+8>>2]=u}while(0);if(i){if(r=0|_e[o+28>>2],(0|o)==(0|_e[(t=4880+(r<<2)|0)>>2])){if(!(_e[t>>2]=e)){_e[1145]=_e[1145]&~(1<<r),u=o,r=a;break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|o)&1)<<2)>>2]=e)){u=o,r=a;break}_e[e+24>>2]=i,0|(t=0|_e[(r=o+16|0)>>2])&&(_e[e+16>>2]=t,_e[t+24>>2]=e),r=(u=((r=0|_e[r+4>>2])&&(_e[e+20>>2]=r,_e[r+24>>2]=e),o),a)}else u=o,r=a}}while(0);if(!(f>>>0<=o>>>0)&&1&(n=0|_e[(e=f+4|0)>>2])){if(2&n)_e[e>>2]=-2&n,_e[u+4>>2]=1|r,i=_e[o+r>>2]=r;else{if(e=0|_e[1149],(0|f)==(0|_e[1150]))return f=(0|_e[1147])+r|0,_e[1147]=f,_e[1150]=u,_e[u+4>>2]=1|f,(0|u)!=(0|e)?void 0:(_e[1149]=0,void(_e[1146]=0));if((0|f)==(0|e))return f=(0|_e[1146])+r|0,_e[1146]=f,_e[1149]=o,_e[u+4>>2]=1|f,void(_e[o+f>>2]=f);i=(-8&n)+r|0,t=n>>>3;do{if(n>>>0<256){if(r=0|_e[f+8>>2],(0|(e=0|_e[f+12>>2]))==(0|r)){_e[1144]=_e[1144]&~(1<<t);break}_e[r+12>>2]=e,_e[e+8>>2]=r;break}a=0|_e[f+24>>2],e=0|_e[f+12>>2];do{if((0|e)==(0|f)){if(!(e=0|_e[(r=(t=f+16|0)+4|0)>>2])){if(!(e=0|_e[t>>2])){t=0;break}r=t}for(;;)if(0|(n=0|_e[(t=e+20|0)>>2]))e=n,r=t;else{if(!(n=0|_e[(t=e+16|0)>>2]))break;e=n,r=t}_e[r>>2]=0,t=e}else t=0|_e[f+8>>2],_e[t+12>>2]=e,_e[e+8>>2]=t,t=e}while(0);if(0|a){if(e=0|_e[f+28>>2],(0|f)==(0|_e[(r=4880+(e<<2)|0)>>2])){if(!(_e[r>>2]=t)){_e[1145]=_e[1145]&~(1<<e);break}}else if(!(_e[a+16+(((0|_e[a+16>>2])!=(0|f)&1)<<2)>>2]=t))break;_e[t+24>>2]=a,0|(r=0|_e[(e=f+16|0)>>2])&&(_e[t+16>>2]=r,_e[r+24>>2]=t),0|(e=0|_e[e+4>>2])&&(_e[t+20>>2]=e,_e[e+24>>2]=t)}}while(0);if(_e[u+4>>2]=1|i,_e[o+i>>2]=i,(0|u)==(0|_e[1149]))return void(_e[1146]=i)}if(e=i>>>3,i>>>0<256)return t=4616+(e<<1<<2)|0,(r=0|_e[1144])&(e=1<<e)?e=0|_e[(r=t+8|0)>>2]:(_e[1144]=r|e,r=(e=t)+8|0),_e[r>>2]=u,_e[e+12>>2]=u,_e[u+8>>2]=e,void(_e[u+12>>2]=t);n=4880+((e=(e=i>>>8)?16777215<i>>>0?31:i>>>((e=14-((a=((f=e<<(o=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|o|(e=((f<<=a)+245760|0)>>>16&2))+(f<<e>>>15)|0)+7|0)&1|e<<1:0)<<2)|0,_e[u+28>>2]=e,_e[u+20>>2]=0,r=(_e[u+16>>2]=0)|_e[1145],t=1<<e;do{if(r&t){for(r=i<<(31==(0|e)?0:25-(e>>>1)|0),t=0|_e[n>>2];;){if((-8&_e[t+4>>2]|0)==(0|i)){e=73;break}if(!(e=0|_e[(n=t+16+(r>>>31<<2)|0)>>2])){e=72;break}r<<=1,t=e}if(72==(0|e)){_e[n>>2]=u,_e[u+24>>2]=t,_e[u+12>>2]=u,_e[u+8>>2]=u;break}if(73==(0|e)){f=0|_e[(o=t+8|0)>>2],_e[f+12>>2]=u,_e[o>>2]=u,_e[u+8>>2]=f,_e[u+12>>2]=t,_e[u+24>>2]=0;break}}else _e[1145]=r|t,_e[n>>2]=u,_e[u+24>>2]=n,_e[u+12>>2]=u,_e[u+8>>2]=u}while(0);if(f=(0|_e[1152])-1|0,!(_e[1152]=f)){for(e=5032;e=0|_e[e>>2];)e=e+8|0;_e[1152]=-1}}}}function x(e,r){var t=0,n=0,i=0,a=0,o=0,u=0,f=0,f=(e|=0)+(r|=0)|0,t=0|_e[e+4>>2];do{if(1&t)u=e,t=r;else{if(n=0|_e[e>>2],!(3&t))return;if(o=n+r|0,(0|(a=e+(0-n)|0))==(0|_e[1149])){if(3==(3&(t=0|_e[(e=f+4|0)>>2])|0))return _e[1146]=o,_e[e>>2]=-2&t,_e[a+4>>2]=1|o,void(_e[a+o>>2]=o);u=a,t=o;break}if(r=n>>>3,n>>>0<256){if(e=0|_e[a+8>>2],(0|(t=0|_e[a+12>>2]))==(0|e)){_e[1144]=_e[1144]&~(1<<r),u=a,t=o;break}_e[e+12>>2]=t,_e[t+8>>2]=e,u=a,t=o;break}i=0|_e[a+24>>2],e=0|_e[a+12>>2];do{if((0|e)==(0|a)){if(!(e=0|_e[(t=(r=a+16|0)+4|0)>>2])){if(!(e=0|_e[r>>2])){e=0;break}t=r}for(;;)if(0|(n=0|_e[(r=e+20|0)>>2]))e=n,t=r;else{if(!(n=0|_e[(r=e+16|0)>>2]))break;e=n,t=r}_e[t>>2]=0}else u=0|_e[a+8>>2],_e[u+12>>2]=e,_e[e+8>>2]=u}while(0);if(i){if(t=0|_e[a+28>>2],(0|a)==(0|_e[(r=4880+(t<<2)|0)>>2])){if(!(_e[r>>2]=e)){_e[1145]=_e[1145]&~(1<<t),u=a,t=o;break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|a)&1)<<2)>>2]=e)){u=a,t=o;break}_e[e+24>>2]=i,0|(r=0|_e[(t=a+16|0)>>2])&&(_e[e+16>>2]=r,_e[r+24>>2]=e),t=(u=((t=0|_e[t+4>>2])&&(_e[e+20>>2]=t,_e[t+24>>2]=e),a),o)}else u=a,t=o}}while(0);if(2&(n=0|_e[(e=f+4|0)>>2]))_e[e>>2]=-2&n,_e[u+4>>2]=1|t,_e[u+t>>2]=t;else{if(e=0|_e[1149],(0|f)==(0|_e[1150]))return f=(0|_e[1147])+t|0,_e[1147]=f,_e[1150]=u,_e[u+4>>2]=1|f,(0|u)==(0|e)&&(_e[1149]=0,void(_e[1146]=0));if((0|f)==(0|e))return f=(0|_e[1146])+t|0,_e[1146]=f,_e[1149]=u,_e[u+4>>2]=1|f,void(_e[u+f>>2]=f);a=(-8&n)+t|0,r=n>>>3;do{if(n>>>0<256){if(t=0|_e[f+8>>2],(0|(e=0|_e[f+12>>2]))==(0|t)){_e[1144]=_e[1144]&~(1<<r);break}_e[t+12>>2]=e,_e[e+8>>2]=t;break}i=0|_e[f+24>>2],e=0|_e[f+12>>2];do{if((0|e)==(0|f)){if(!(e=0|_e[(t=(r=f+16|0)+4|0)>>2])){if(!(e=0|_e[r>>2])){r=0;break}t=r}for(;;)if(0|(n=0|_e[(r=e+20|0)>>2]))e=n,t=r;else{if(!(n=0|_e[(r=e+16|0)>>2]))break;e=n,t=r}_e[t>>2]=0,r=e}else r=0|_e[f+8>>2],_e[r+12>>2]=e,_e[e+8>>2]=r,r=e}while(0);if(0|i){if(e=0|_e[f+28>>2],(0|f)==(0|_e[(t=4880+(e<<2)|0)>>2])){if(!(_e[t>>2]=r)){_e[1145]=_e[1145]&~(1<<e);break}}else if(!(_e[i+16+(((0|_e[i+16>>2])!=(0|f)&1)<<2)>>2]=r))break;_e[r+24>>2]=i,0|(t=0|_e[(e=f+16|0)>>2])&&(_e[r+16>>2]=t,_e[t+24>>2]=r),0|(e=0|_e[e+4>>2])&&(_e[r+20>>2]=e,_e[e+24>>2]=r)}}while(0);if(_e[u+4>>2]=1|a,_e[u+a>>2]=a,(0|u)==(0|_e[1149]))return void(_e[1146]=a);t=a}if(e=t>>>3,t>>>0<256)return r=4616+(e<<1<<2)|0,(t=0|_e[1144])&(e=1<<e)?e=0|_e[(t=r+8|0)>>2]:(_e[1144]=t|e,t=(e=r)+8|0),_e[t>>2]=u,_e[e+12>>2]=u,_e[u+8>>2]=e,void(_e[u+12>>2]=r);if(i=4880+((e=(e=t>>>8)?16777215<t>>>0?31:t>>>((e=14-((a=((f=e<<(o=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|o|(e=((f<<=a)+245760|0)>>>16&2))+(f<<e>>>15)|0)+7|0)&1|e<<1:0)<<2)|0,_e[u+28>>2]=e,_e[u+20>>2]=0,!((r=(_e[u+16>>2]=0)|_e[1145])&(n=1<<e)))return _e[1145]=r|n,_e[i>>2]=u,_e[u+24>>2]=i,_e[u+12>>2]=u,void(_e[u+8>>2]=u);for(r=t<<(31==(0|e)?0:25-(e>>>1)|0),n=0|_e[i>>2];;){if((-8&_e[n+4>>2]|0)==(0|t)){e=69;break}if(!(e=0|_e[(i=n+16+(r>>>31<<2)|0)>>2])){e=68;break}r<<=1,n=e}68==(0|e)?(_e[i>>2]=u,_e[u+24>>2]=n,_e[u+12>>2]=u,_e[u+8>>2]=u):69==(0|e)&&(f=0|_e[(o=n+8|0)>>2],_e[f+12>>2]=u,_e[o>>2]=u,_e[u+8>>2]=f,_e[u+12>>2]=n,_e[u+24>>2]=0)}function B(e,r,t,n,i){i|=0;var a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0,d=0,E=0,s=e|=0,o=t|=0,u=_=n|=0;if(!(l=f=r|=0))return a=0!=(0|i),u?(a&&(_e[i>>2]=0|e,_e[i+4>>2]=0&r),(i=_=0)|(L=_,i)):(a&&(_e[i>>2]=(s>>>0)%(o>>>0),_e[i+4>>2]=0),(_=0)|(L=_,i=(s>>>0)/(o>>>0)>>>0));a=0==(0|u);do{if(o){if(!a){if((a=(0|T(0|u))-(0|T(0|l))|0)>>>0<=31){e=s>>>((o=c=a+1|0)>>>0)&(r=a-31>>31)|l<<(u=31-a|0),r&=l>>>(c>>>0),a=0,u=s<<u;break}return i?(_e[i>>2]=0|e,_e[i+4>>2]=f|0&r,(i=_=0)|(L=_,i)):(i=_=0)|(L=_,i)}if((a=o-1|0)&o|0){e=(c=32-(u=33+(0|T(0|o))-(0|T(0|l))|0)|0)-1>>31&l>>>((d=u-32|0)>>>0)|(l<<c|s>>>((o=u)>>>0))&(r=d>>31),r&=l>>>(u>>>0),a=s<<(E=64-u|0)&(f=c>>31),u=(l<<E|s>>>(d>>>0))&f|s<<c&u-33>>31;break}return 0|i&&(_e[i>>2]=a&s,_e[i+4>>2]=0),1==(0|o)?0|(L=d=f|0&r,E=0|e):(E=0|Pe(0|o),0|(L=d=l>>>(E>>>0)|0,E=l<<32-E|s>>>(E>>>0)|0))}if(a)return 0|i&&(_e[i>>2]=(l>>>0)%(o>>>0),_e[i+4>>2]=0),(d=0)|(L=d,E=(l>>>0)/(o>>>0)>>>0);if(!s)return 0|i&&(_e[i>>2]=0,_e[i+4>>2]=(l>>>0)%(u>>>0)),(d=0)|(L=d,E=(l>>>0)/(u>>>0)>>>0);if(!((a=u-1|0)&u))return 0|i&&(_e[i>>2]=0|e,_e[i+4>>2]=a&l|0&r),E=l>>>(((d=0)|Pe(0|u))>>>0),0|(L=d,E);if((a=(0|T(0|u))-(0|T(0|l))|0)>>>0<=30){e=l<<(u=31-a|0)|s>>>((o=r=a+1|0)>>>0),r=l>>>(r>>>0),a=0,u=s<<u;break}return i&&(_e[i>>2]=0|e,_e[i+4>>2]=f|0&r),(E=d=0)|(L=d,E)}while(0);if(o){for(l=0|ge(0|(c=0|t),0|(s=_|0&n),-1,-1),t=L,f=u,u=0;f=a>>>31|(n=f)<<1,a=u|a<<1,ve(0|l,0|t,0|(n=e<<1|n>>>31|0),0|(_=e>>>31|r<<1|0)),u=1&(d=(E=L)>>31|((0|E)<0?-1:0)<<1),e=0|ve(0|n,0|_,d&c|0,(((0|E)<0?-1:0)>>31|((0|E)<0?-1:0)<<1)&s|0),r=L,0!=(0|(o=o-1|0)););l=f,f=0}else l=u,u=f=0;return(o=0)|i&&(_e[i>>2]=e,_e[i+4>>2]=r),0|(L=d=(0|a)>>>31|(l|o)<<1|0&(o<<1|a>>>31)|f,E=-2&(a<<1|0)|u)}function Ae(e,r){var t,n,i,a,o,u,f,l=0,s=0,c=0,_=0,d=0,E=0,T=Te;Te=Te+576|0,i=T+48|0,o=T+32|0,a=T+16|0,f=(n=T)+64|0,u=0|_e[(r|=0)+20>>2],(0|(t=0|_e[(E=(e|=0)+20|0)>>2]))<24?(s=(l=0|_e[(d=e+4|0)>>2])>>>0<(c=0|_e[e+8>>2])>>>0,(0|t)<16?(s?(_=(0|de[l>>0])<<8,l=l+1|0):_=0,l>>>0<c>>>0?(c=0|de[l>>0],l=l+1|0):c=0,_e[d>>2]=l,_e[E>>2]=16+t,s=16,l=c|_):(l=s?(_e[d>>2]=l+1,0|de[l>>0]):0,_e[E>>2]=8+t,s=24),c=_e[(d=e+16|0)>>2]|l<<s-t,_e[d>>2]=c):c=0|_e[(d=c=e+16|0)>>2],_=1+(c>>>16)|0;do{if(!(_>>>0<=(0|_e[16+u>>2])>>>0)){for(s=0|_e[20+u>>2];_>>>0>(0|_e[28+u+((l=s+-1|0)<<2)>>2])>>>0;)s=s+1|0;if((l=(c>>>(32-s|0))+(0|_e[96+u+(l<<2)>>2])|0)>>>0<(0|_e[r>>2])>>>0){l=0|Ee[(0|_e[176+u>>2])+(l<<1)>>1];break}return _e[i>>2]=866,_e[4+i>>2]=3275,_e[8+i>>2]=1348,Ce(f,812,i),Me(f),Te=T,(E=0)|E}}while(-1==(0|(s=0|_e[(0|_e[168+u>>2])+(c>>>(32-(0|_e[8+u>>2])|0)<<2)>>2]))&&(_e[n>>2]=866,_e[n+4>>2]=3253,_e[n+8>>2]=1393,Ce(f,812,n),Me(f)),l=65535&s,s>>>=16,(0|_e[r+8>>2])>>>0<=l>>>0&&(_e[a>>2]=866,_e[4+a>>2]=909,_e[8+a>>2]=1497,Ce(f,812,a),Me(f)),(0|de[(0|_e[r+4>>2])+l>>0])!=(0|s)&&(_e[o>>2]=866,_e[4+o>>2]=3257,_e[8+o>>2]=1410,Ce(f,812,o),Me(f)),0);return _e[d>>2]=_e[d>>2]<<s,_e[E>>2]=(0|_e[E>>2])-s,Te=T,0|(E=l)}function U(e){var r,t,n,i,a=0,o=0,u=0,f=Te;if(Te=Te+576|0,u=f+48|0,n=f+32|0,t=f+16|0,i=(r=f)+64|0,(_e[(e|=0)>>2]=0)|(o=0|_e[(a=e+284|0)>>2])&&(7&o?(_e[r>>2]=866,_e[r+4>>2]=2506,_e[r+8>>2]=1232,Ce(i,812,r),Me(i)):ue(o,0,0,1,0),_e[a>>2]=0,_e[e+288>>2]=0,_e[e+292>>2]=0),(ce[e+296>>0]=0)|(o=0|_e[(a=e+268|0)>>2])&&(7&o?(_e[t>>2]=866,_e[4+t>>2]=2506,_e[8+t>>2]=1232,Ce(i,812,t),Me(i)):ue(o,0,0,1,0),_e[a>>2]=0,_e[e+272>>2]=0,_e[e+276>>2]=0),(ce[e+280>>0]=0)|(o=0|_e[(a=e+252|0)>>2])&&(7&o?(_e[n>>2]=866,_e[4+n>>2]=2506,_e[8+n>>2]=1232,Ce(i,812,n),Me(i)):ue(o,0,0,1,0),_e[a>>2]=0,_e[e+256>>2]=0,_e[e+260>>2]=0),!(o=(ce[e+264>>0]=0)|_e[(a=e+236|0)>>2]))return re(u=e+212|(ce[(u=e+248|0)>>0]=0)),re(u=e+188|0),re(u=e+164|0),re(u=e+140|0),re(u=e+116|0),void(Te=f);7&o?(_e[u>>2]=866,_e[u+4>>2]=2506,_e[u+8>>2]=1232,Ce(i,812,u),Me(i)):ue(o,0,0,1,0),_e[a>>2]=0,_e[e+240>>2]=0,_e[e+244>>2]=0,re(u=e+212|(ce[(u=e+248|0)>>0]=0)),re(u=e+188|0),re(u=e+164|0),re(u=e+140|0),re(u=e+116|0),Te=f}function H(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,a=0;e:do{if(r>>>0<=20){switch(0|r){case 9:n=3+(0|_e[t>>2])&-4,r=0|_e[n>>2],_e[t>>2]=n+4,_e[e>>2]=r;break e;case 10:n=3+(0|_e[t>>2])&-4,r=0|_e[n>>2],_e[t>>2]=n+4,_e[(n=e)>>2]=r,_e[n+4>>2]=((0|r)<0)<<31>>31;break e;case 11:n=3+(0|_e[t>>2])&-4,r=0|_e[n>>2],_e[t>>2]=n+4,_e[(n=e)>>2]=r,_e[n+4>>2]=0;break e;case 12:n=7+(0|_e[t>>2])&-8,i=0|_e[(r=n)>>2],r=0|_e[r+4>>2],_e[t>>2]=n+8,_e[(n=e)>>2]=i,_e[n+4>>2]=r;break e;case 13:i=3+(0|_e[t>>2])&-4,n=0|_e[i>>2],_e[t>>2]=i+4,_e[(i=e)>>2]=n=(65535&n)<<16>>16,_e[i+4>>2]=((0|n)<0)<<31>>31;break e;case 14:i=3+(0|_e[t>>2])&-4,n=0|_e[i>>2],_e[t>>2]=i+4,_e[(i=e)>>2]=65535&n,_e[i+4>>2]=0;break e;case 15:i=3+(0|_e[t>>2])&-4,n=0|_e[i>>2],_e[t>>2]=i+4,_e[(i=e)>>2]=n=(255&n)<<24>>24,_e[i+4>>2]=((0|n)<0)<<31>>31;break e;case 16:i=3+(0|_e[t>>2])&-4,n=0|_e[i>>2],_e[t>>2]=i+4,_e[(i=e)>>2]=255&n,_e[i+4>>2]=0;break e;case 17:case 18:i=7+(0|_e[t>>2])&-8,a=+k[i>>3],_e[t>>2]=i+8,k[e>>3]=a;break e;default:break e}}}while(0)}function X(e,r,t,n,i){r|=0,t|=0,n|=0,i|=0;var a,o,u,f,l,s=0,c=0,_=0,d=0,E=Te;if(Te=Te+576|0,f=E+48|0,a=E+32|0,c=E+16|0,u=(s=E)+64|0,l=E+60|0,(0|_e[(o=(e|=0)+4|0)>>2])>>>0>(0|_e[(d=e+8|0)>>2])>>>0&&(_e[s>>2]=866,_e[s+4>>2]=2123,_e[s+8>>2]=845,Ce(u,812,s),Me(u)),(2147418112/(n>>>0)|0)>>>0<=r>>>0&&(_e[c>>2]=866,_e[c+4>>2]=2124,_e[c+8>>2]=885,Ce(u,812,c),Me(u)),r>>>0<=(s=0|_e[d>>2])>>>0)return Te=E,0|(d=1);if(10==(0|(t=9==(0|(t=t&&0!=((_=r+-1|0)&r|0)?(r=_>>>16|_,r|=r>>>8,r|=r>>>4,(r=1+((r|=r>>>2)>>>1|r)|0)?9:(r=0,10)):9))&&r>>>0<=s>>>0?10:t))&&(_e[a>>2]=866,_e[4+a>>2]=2133,_e[8+a>>2]=933,Ce(u,812,a),Me(u)),_=0|ie(r,n),i)if(c=0|te(_,l)){Ze[0&i](c,0|_e[e>>2],0|_e[o>>2]),s=0|_e[e>>2];do{if(0|s){if(7&s){_e[f>>2]=866,_e[4+f>>2]=2506,_e[8+f>>2]=1232,Ce(u,812,f),Me(u);break}ue(s,0,0,1,0);break}}while(0);_e[e>>2]=c,t=20}else r=0;else(s=0|function(e,r,t,n){r|=0,t|=0,n|=0;var i=0,a=0,o=0,u=0,f=0,l=0;if(Te=(l=Te)+560|0,f=l+32|0,a=l+16|0,o=(i=l)+48|0,u=l+44|0,7&(e|=0)|0)return _e[i>>2]=866,_e[i+4>>2]=2506,_e[i+8>>2]=1210,Ce(o,812,i),Me(o),Te=l,(f=0)|f;if(2147418112<r>>>0)return _e[a>>2]=866,_e[4+a>>2]=2506,_e[8+a>>2]=1103,Ce(o,812,a),Me(o),Te=l,(f=0)|f;_e[u>>2]=r,e=0|ue(e,r,u,n,0),0|t&&(_e[t>>2]=_e[u>>2]);7&e|0&&(_e[f>>2]=866,_e[f+4>>2]=2558,_e[f+8>>2]=1156,Ce(o,812,f),Me(o));return Te=l,0|(f=e)}(0|_e[e>>2],_,l,1))?(_e[e>>2]=s,t=20):r=0;return 20==(0|t)&&(s=0|_e[l>>2],_e[d>>2]=r=_>>>0<s>>>0?(s>>>0)/(n>>>0)|0:r,r=1),Te=E,0|(d=r)}function Y(e,r,t,n,i,a,o){r|=0,t|=0,n|=0,i|=0,a|=0;var u,f=0,l=0,s=0|_e[(e|=0)+88>>2],f=(de[12+s>>0]<<8|de[13+s>>0])>>>(o|=0);if(l=((1<(l=(de[14+s>>0]<<8|de[15+s>>0])>>>o)>>>0?l:1)+3|0)>>>2,o=0|ce[(s=18+s|0)>>0],o=0|ie(f=((1<f>>>0?f:1)+3|0)>>>2,o<<24>>24==0|o<<24>>24==9?8:16),a){if(!(0==(3&a|0)&o>>>0<=a>>>0))return(i=0)|i;o=a}if((0|ie(o,l))>>>0>i>>>0)return(i=0)|i;if(a=(f+1|0)>>>1,u=(l+1|0)>>>1,!t)return(i=0)|i;switch(_e[e+92>>2]=r,_e[e+96>>2]=r,_e[e+104>>2]=t,_e[e+100>>2]=r+t,_e[e+108>>2]=0,(_e[e+112>>2]=0)|ce[s>>0]){case 0:if(!(0|function(e,r,t,n,i,a,o,u){r|=0,t|=0;var f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k,g,L,I,D,w,G,F,x,B,U,H,W,V,X,Y,K=0,z=0,j=0,J=0,$=0,Z=0,q=0,Q=0,ee=0,re=0,te=0,ne=Te;if(Te=Te+656|0,X=ne+112|0,W=ne+96|0,H=ne+80|0,U=ne+64|0,B=ne+48|0,Y=ne+32|0,V=ne+16|0,G=(x=ne)+144|0,F=ne+128|0,y=0|_e[(N=(e|=0)+240|0)>>2],v=0|_e[(O=e+256|0)>>2],k=255&(w=0|ce[17+(0|_e[e+88>>2])>>0]),!(w<<24>>24))return Te=ne,1;L=0==(0|(u|=0)),D=(I=(o|=0)+-1|0)<<4,w=u+-1|0,S=0!=(1&(a|=0)|0),P=(n|=0)<<1,R=e+92|0,h=e+116|0,p=e+140|0,C=e+236|0,m=0!=(1&(i|=0)|0),b=e+188|0,E=e+252|0,T=1+(g=n>>>2)|0,A=2+g|0,M=3+g|0,t=a=ee=0,i=1;do{if(!L)for(q=0|_e[r+(ee<<2)>>2],Q=0;;){if(z=0==(0|(_=1&Q)),c=(_<<5^32)-16|0,_=(_<<1^2)-1|0,d=S&(e=(0|Q)==(0|w)),(0|(K=z?0:I))!=(0|(s=z?o:-1)))for(l=S&e^1,Z=z?q:q+D|0;;){for(f=7&(i=1==(0|i)?512|Ae(R,h):i),i>>>=3,z=0|de[1539+f>>0],e=0;j=(0|Ae(R,p))+t|0,(0|_e[N>>2])>>>0<=(t=($=(J=j-y|0)>>31)&j|J&~$)>>>0&&(_e[x>>2]=866,_e[x+4>>2]=910,_e[x+8>>2]=1497,Ce(G,812,x),Me(G)),_e[F+(e<<2)>>2]=_e[(0|_e[C>>2])+(t<<2)>>2],(e=e+1|0)>>>0<z>>>0;);if(d|($=m&(0|K)==(0|I))){J=0;do{e=Z+(0|ie(J,n))|0,j=0==(0|J)|l,z=J<<1,a=(a=(re=(te=(0|Ae(R,b))+a|0)-v|0)>>31)&te|re&~a;do{if($){if(!j){a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a;break}_e[e>>2]=_e[F+((0|de[1547+(f<<2)+z>>0])<<2)>>2],(0|_e[O>>2])>>>0<=a>>>0&&(_e[W>>2]=866,_e[4+W>>2]=910,_e[8+W>>2]=1497,Ce(G,812,W),Me(G)),_e[e+4>>2]=_e[(0|_e[E>>2])+(a<<2)>>2],a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a}else j&&(_e[e>>2]=_e[F+((0|de[1547+(f<<2)+z>>0])<<2)>>2],(0|_e[O>>2])>>>0<=a>>>0&&(_e[H>>2]=866,_e[4+H>>2]=910,_e[8+H>>2]=1497,Ce(G,812,H),Me(G)),_e[e+4>>2]=_e[(0|_e[E>>2])+(a<<2)>>2]),e=e+8|0,a=(a=(te=(re=(0|Ae(R,b))+a|0)-v|0)>>31)&re|te&~a,j&&(_e[e>>2]=_e[F+((0|de[1547+(f<<2)+(1|z)>>0])<<2)>>2],(0|_e[O>>2])>>>0<=a>>>0&&(_e[X>>2]=866,_e[4+X>>2]=910,_e[8+X>>2]=1497,Ce(G,812,X),Me(G)),_e[e+4>>2]=_e[(0|_e[E>>2])+(a<<2)>>2])}while(0)}while(2!=(0|(J=J+1|0)))}else _e[Z>>2]=_e[F+((0|de[1547+(f<<2)>>0])<<2)>>2],re=(0|Ae(R,b))+a|0,(0|_e[O>>2])>>>0<=(a=(a=(te=re-v|0)>>31)&re|te&~a)>>>0&&(_e[V>>2]=866,_e[4+V>>2]=910,_e[8+V>>2]=1497,Ce(G,812,V),Me(G)),_e[Z+4>>2]=_e[(0|_e[E>>2])+(a<<2)>>2],_e[Z+8>>2]=_e[F+((0|de[1547+(f<<2)+1>>0])<<2)>>2],re=(0|Ae(R,b))+a|0,(0|_e[O>>2])>>>0<=(a=(a=(te=re-v|0)>>31)&re|te&~a)>>>0&&(_e[Y>>2]=866,_e[4+Y>>2]=910,_e[8+Y>>2]=1497,Ce(G,812,Y),Me(G)),_e[Z+12>>2]=_e[(0|_e[E>>2])+(a<<2)>>2],_e[Z+(g<<2)>>2]=_e[F+((0|de[1547+(f<<2)+2>>0])<<2)>>2],re=(0|Ae(R,b))+a|0,(0|_e[O>>2])>>>0<=(a=(a=(te=re-v|0)>>31)&re|te&~a)>>>0&&(_e[B>>2]=866,_e[4+B>>2]=910,_e[8+B>>2]=1497,Ce(G,812,B),Me(G)),_e[Z+(T<<2)>>2]=_e[(0|_e[E>>2])+(a<<2)>>2],_e[Z+(A<<2)>>2]=_e[F+((0|de[1547+(f<<2)+3>>0])<<2)>>2],re=(0|Ae(R,b))+a|0,(0|_e[O>>2])>>>0<=(a=(a=(te=re-v|0)>>31)&re|te&~a)>>>0&&(_e[U>>2]=866,_e[4+U>>2]=910,_e[8+U>>2]=1497,Ce(G,812,U),Me(G)),_e[Z+(M<<2)>>2]=_e[(0|_e[E>>2])+(a<<2)>>2];if((0|(K=_+K|0))==(0|s))break;Z=Z+c|0}if((0|(Q=Q+1|0))==(0|u))break;q=q+P|0}}while((0|(ee=ee+1|0))!=(0|k));return Te=ne,1}(e,n,i,o,f,l,a,u)))return(i=0)|i;break;case 4:case 6:case 5:case 3:case 2:if(!(0|function(e,r,t,n,i,a,o,u){r|=0,t|=0;var f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k,g,L,I,D,w,G,F,x,B,U,H,W,V,X,Y,K,z,j=0,J=0,$=0,Z=0,q=0,Q=0,ee=0,re=0,te=0,ne=0,ie=0,ae=0,oe=0,ue=0,fe=0,le=0,se=Te;if(Te=Te+640|0,Y=se+80|0,X=se+64|0,V=se+48|0,z=se+32|0,K=se+16|0,U=(W=se)+128|0,H=se+112|0,b=se+96|0,S=0|_e[(m=(e|=0)+240|0)>>2],R=0|_e[(P=e+256|0)>>2],p=0|_e[(h=e+272|0)>>2],B=0|_e[e+88>>2],C=(0|de[63+B>>0])<<8|0|de[64+B>>0],N=255&(B=0|ce[17+B>>0]),!(B<<24>>24))return Te=se,1;y=0==(0|(u|=0)),v=(O=(o|=0)+-1|0)<<5,k=u+-1|0,g=(n|=0)<<1,L=e+92|0,I=e+116|0,D=e+164|0,w=e+268|0,G=e+140|0,F=e+236|0,x=e+212|0,B=e+188|0,M=0==(1&(i|=0)|0),A=0==(1&(a|=0)|0),E=e+288|0,T=e+284|0,d=e+252|0,t=i=a=e=le=0,j=1;do{if(!y)for(ue=0|_e[r+(le<<2)>>2],fe=0;;){if($=0==(0|(_=1&fe)),c=(_<<6^64)-32|0,_=(_<<1^2)-1|0,(0|(J=$?0:O))!=(0|(l=$?o:-1)))for(s=A|(0|fe)!=(0|k),oe=$?ue:ue+v|0;;){for(f=7&(j=1==(0|j)?512|Ae(L,I):j),j>>>=3,Z=0|de[1539+f>>0],$=0;ne=(0|Ae(L,D))+a|0,(0|_e[h>>2])>>>0<=(a=(ae=(ie=ne-p|0)>>31)&ne|ie&~ae)>>>0&&(_e[W>>2]=866,_e[W+4>>2]=910,_e[W+8>>2]=1497,Ce(U,812,W),Me(U)),_e[b+($<<2)>>2]=Ee[(0|_e[w>>2])+(a<<1)>>1],($=$+1|0)>>>0<Z>>>0;);for($=0;ne=(0|Ae(L,G))+t|0,(0|_e[m>>2])>>>0<=(t=(ae=(ie=ne-S|0)>>31)&ne|ie&~ae)>>>0&&(_e[K>>2]=866,_e[4+K>>2]=910,_e[8+K>>2]=1497,Ce(U,812,K),Me(U)),_e[H+($<<2)>>2]=_e[(0|_e[F>>2])+(t<<2)>>2],($=$+1|0)>>>0<Z>>>0;);for(ae=M|(0|J)!=(0|O),ne=0,ie=oe;;){if(ee=s|0==(0|ne),re=ne<<1,ae)for(q=0,Q=ie;e=(e=(Z=(te=(0|Ae(L,x))+e|0)-C|0)>>31)&te|Z&~e,i=(i=(te=(Z=(0|Ae(L,B))+i|0)-R|0)>>31)&Z|te&~i,ee&&($=0|de[q+re+(1547+(f<<2))>>0],(0|_e[E>>2])>>>0<=(Z=3*e|0)>>>0&&(_e[z>>2]=866,_e[4+z>>2]=910,_e[8+z>>2]=1497,Ce(U,812,z),Me(U)),te=(0|_e[T>>2])+(Z<<1)|0,_e[Q>>2]=(0|Ee[te>>1])<<16|_e[b+($<<2)>>2],_e[Q+4>>2]=(0|Ee[te+4>>1])<<16|0|Ee[te+2>>1],_e[Q+8>>2]=_e[H+($<<2)>>2],(0|_e[P>>2])>>>0<=i>>>0&&(_e[V>>2]=866,_e[4+V>>2]=910,_e[8+V>>2]=1497,Ce(U,812,V),Me(U)),_e[Q+12>>2]=_e[(0|_e[d>>2])+(i<<2)>>2]),2!=(0|(q=q+1|0));)Q=Q+16|0;else for(te=1^ee,ee=1547+(f<<2)+re|0,q=0,Q=ie;e=(e=(Z=(re=(0|Ae(L,x))+e|0)-C|0)>>31)&re|Z&~e,i=(i=(re=(Z=(0|Ae(L,B))+i|0)-R|0)>>31)&Z|re&~i,0!=(0|q)|te||($=0|de[ee>>0],(0|_e[E>>2])>>>0<=(Z=3*e|0)>>>0&&(_e[X>>2]=866,_e[4+X>>2]=910,_e[8+X>>2]=1497,Ce(U,812,X),Me(U)),re=(0|_e[T>>2])+(Z<<1)|0,_e[Q>>2]=(0|Ee[re>>1])<<16|_e[b+($<<2)>>2],_e[Q+4>>2]=(0|Ee[re+4>>1])<<16|0|Ee[re+2>>1],_e[Q+8>>2]=_e[H+($<<2)>>2],(0|_e[P>>2])>>>0<=i>>>0&&(_e[Y>>2]=866,_e[4+Y>>2]=910,_e[8+Y>>2]=1497,Ce(U,812,Y),Me(U)),_e[Q+12>>2]=_e[(0|_e[d>>2])+(i<<2)>>2]),2!=(0|(q=q+1|0));)Q=Q+16|0;if(2==(0|(ne=ne+1|0)))break;ie=ie+n|0}if((0|(J=_+J|0))==(0|l))break;oe=oe+c|0}if((0|(fe=fe+1|0))==(0|u))break;ue=ue+g|0}}while((0|(le=le+1|0))!=(0|N));return Te=se,1}(e,n,i,o,f,l,a,u)))return(i=0)|i;break;case 9:if(!(0|function(e,r,t,n,i,a,o,u){r|=0,t|=0;var f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k,g,L,I,D,w,G,F=0,x=0,B=0,U=0,H=0,W=0,V=0,X=0,Y=0,K=0,z=0,j=0,J=Te;if(Te=Te+592|0,D=J+48|0,G=J+32|0,w=J+16|0,g=(I=J)+80|0,L=J+64|0,b=0|_e[(M=(e|=0)+272|0)>>2],k=0|_e[e+88>>2],m=(0|de[63+k>>0])<<8|0|de[64+k>>0],S=255&(k=0|ce[17+k>>0]),!(k<<24>>24))return Te=J,1;P=0==(0|(u|=0)),h=(R=(o|=0)+-1|0)<<4,p=u+-1|0,C=(n|=0)<<1,N=e+92|0,y=e+116|0,O=e+164|0,v=e+268|0,k=e+212|0,A=0==(1&(i|=0)|0),T=0==(1&(a|=0)|0),E=e+288|0,d=e+284|0,t=i=j=0,a=1;do{if(!P)for(K=0|_e[r+(j<<2)>>2],z=0;;){if(F=0==(0|(_=1&z)),c=(_<<5^32)-16|0,_=(_<<1^2)-1|0,(0|(e=F?0:R))!=(0|(l=F?o:-1)))for(s=T|(0|z)!=(0|p),Y=F?K:K+h|0;;){for(f=7&(a=1==(0|a)?512|Ae(N,y):a),a>>>=3,x=0|de[1539+f>>0],F=0;W=(0|Ae(N,O))+t|0,(0|_e[M>>2])>>>0<=(t=(X=(V=W-b|0)>>31)&W|V&~X)>>>0&&(_e[I>>2]=866,_e[I+4>>2]=910,_e[I+8>>2]=1497,Ce(g,812,I),Me(g)),_e[L+(F<<2)>>2]=Ee[(0|_e[v>>2])+(t<<1)>>1],(F=F+1|0)>>>0<x>>>0;);for(X=A|(0|e)!=(0|R),W=0,V=Y;H=s|0==(0|W),x=W<<1,U=(U=(B=(F=(0|Ae(N,k))+i|0)-m|0)>>31)&F|B&~U,X?(H&&(i=0|de[1547+(f<<2)+x>>0],(0|_e[E>>2])>>>0<=(F=3*U|0)>>>0&&(_e[w>>2]=866,_e[4+w>>2]=910,_e[8+w>>2]=1497,Ce(g,812,w),Me(g)),B=(0|_e[d>>2])+(F<<1)|0,_e[V>>2]=(0|Ee[B>>1])<<16|_e[L+(i<<2)>>2],_e[V+4>>2]=(0|Ee[B+4>>1])<<16|0|Ee[B+2>>1]),B=V+8|0,i=(i=(U=(F=(0|Ae(N,k))+U|0)-m|0)>>31)&F|U&~i,H&&(F=0|de[1547+(f<<2)+(1|x)>>0],(0|_e[E>>2])>>>0<=(x=3*i|0)>>>0&&(_e[D>>2]=866,_e[4+D>>2]=910,_e[8+D>>2]=1497,Ce(g,812,D),Me(g)),H=(0|_e[d>>2])+(x<<1)|0,_e[B>>2]=(0|Ee[H>>1])<<16|_e[L+(F<<2)>>2],_e[V+12>>2]=(0|Ee[H+4>>1])<<16|0|Ee[H+2>>1])):(H&&(i=0|de[1547+(f<<2)+x>>0],(0|_e[E>>2])>>>0<=(F=3*U|0)>>>0&&(_e[G>>2]=866,_e[4+G>>2]=910,_e[8+G>>2]=1497,Ce(g,812,G),Me(g)),H=(0|_e[d>>2])+(F<<1)|0,_e[V>>2]=(0|Ee[H>>1])<<16|_e[L+(i<<2)>>2],_e[V+4>>2]=(0|Ee[H+4>>1])<<16|0|Ee[H+2>>1]),i=(i=(H=(U=(0|Ae(N,k))+U|0)-m|0)>>31)&U|H&~i),2!=(0|(W=W+1|0));)V=V+n|0;if((0|(e=_+e|0))==(0|l))break;Y=Y+c|0}if((0|(z=z+1|0))==(0|u))break;K=K+C|0}}while((0|(j=j+1|0))!=(0|S));return Te=J,1}(e,n,i,o,f,l,a,u)))return(i=0)|i;break;case 8:case 7:if(!(0|function(e,r,t,n,i,a,o,u){r|=0,t|=0;var f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k,g,L,I,D,w,G,F,x,B,U=0,H=0,W=0,V=0,X=0,Y=0,K=0,z=0,j=0,J=0,$=0,Z=0,q=0,Q=0,ee=0,re=0,te=0,ne=0,ie=0,ae=Te;if(Te=Te+640|0,F=ae+80|0,G=ae+64|0,w=ae+48|0,B=ae+32|0,x=ae+16|0,L=(D=ae)+128|0,I=ae+112|0,M=ae+96|0,m=0|_e[(b=(e|=0)+272|0)>>2],g=0|_e[e+88>>2],S=(0|de[63+g>>0])<<8|0|de[64+g>>0],P=255&(g=0|ce[17+g>>0]),!(g<<24>>24))return Te=ae,1;R=0==(0|(u|=0)),p=(h=(o|=0)+-1|0)<<5,C=u+-1|0,N=(n|=0)<<1,y=e+92|0,O=e+116|0,v=e+164|0,k=e+268|0,g=e+212|0,A=0==(1&(i|=0)|0),T=0==(1&(a|=0)|0),E=e+288|0,d=e+284|0,t=i=a=e=ie=0,U=1;do{if(!R)for(te=0|_e[r+(ie<<2)>>2],ne=0;;){if(W=0==(0|(_=1&ne)),c=(_<<6^64)-32|0,_=(_<<1^2)-1|0,(0|(H=W?0:h))!=(0|(l=W?o:-1)))for(s=T|(0|ne)!=(0|C),re=W?te:te+p|0;;){for(f=7&(U=1==(0|U)?512|Ae(y,O):U),U>>>=3,V=0|de[1539+f>>0],W=0;q=(0|Ae(y,v))+t|0,(0|_e[b>>2])>>>0<=(t=(ee=(Q=q-m|0)>>31)&q|Q&~ee)>>>0&&(_e[D>>2]=866,_e[D+4>>2]=910,_e[D+8>>2]=1497,Ce(L,812,D),Me(L)),_e[I+(W<<2)>>2]=Ee[(0|_e[k>>2])+(t<<1)>>1],(W=W+1|0)>>>0<V>>>0;);for(W=0;q=(0|Ae(y,v))+a|0,(0|_e[b>>2])>>>0<=(a=(ee=(Q=q-m|0)>>31)&q|Q&~ee)>>>0&&(_e[x>>2]=866,_e[4+x>>2]=910,_e[8+x>>2]=1497,Ce(L,812,x),Me(L)),_e[M+(W<<2)>>2]=Ee[(0|_e[k>>2])+(a<<1)>>1],(W=W+1|0)>>>0<V>>>0;);for(ee=A|(0|H)!=(0|h),q=0,Q=re;;){if(J=s|0==(0|q),$=q<<1,ee)for(z=0,j=Q;i=(i=(K=(Z=(0|Ae(y,g))+i|0)-S|0)>>31)&Z|K&~i,e=(e=(Z=(K=(0|Ae(y,g))+e|0)-S|0)>>31)&K|Z&~e,J&&(K=0|de[z+$+(1547+(f<<2))>>0],(W=0|_e[E>>2])>>>0<=(V=3*i|0)>>>0&&(_e[B>>2]=866,_e[4+B>>2]=910,_e[8+B>>2]=1497,Ce(L,812,B),Me(L),W=0|_e[E>>2]),V=(X=0|_e[d>>2])+(V<<1)|0,Z=(W=(Y=3*e|0)>>>0<W>>>0?X:(_e[w>>2]=866,_e[4+w>>2]=910,_e[8+w>>2]=1497,Ce(L,812,w),Me(L),0|_e[d>>2]))+(Y<<1)|0,_e[j>>2]=(0|Ee[V>>1])<<16|_e[I+(K<<2)>>2],_e[j+4>>2]=(0|Ee[V+4>>1])<<16|0|Ee[V+2>>1],_e[j+8>>2]=(0|Ee[Z>>1])<<16|_e[M+(K<<2)>>2],_e[j+12>>2]=(0|Ee[Z+4>>1])<<16|0|Ee[Z+2>>1]),2!=(0|(z=z+1|0));)j=j+16|0;else for(Z=1^J,J=1547+(f<<2)+$|0,z=0,j=Q;i=(i=(K=($=(0|Ae(y,g))+i|0)-S|0)>>31)&$|K&~i,e=(e=($=(K=(0|Ae(y,g))+e|0)-S|0)>>31)&K|$&~e,0!=(0|z)|Z||(K=0|de[J>>0],(W=0|_e[E>>2])>>>0<=(V=3*i|0)>>>0&&(_e[G>>2]=866,_e[4+G>>2]=910,_e[8+G>>2]=1497,Ce(L,812,G),Me(L),W=0|_e[E>>2]),V=(X=0|_e[d>>2])+(V<<1)|0,$=(W=(Y=3*e|0)>>>0<W>>>0?X:(_e[F>>2]=866,_e[4+F>>2]=910,_e[8+F>>2]=1497,Ce(L,812,F),Me(L),0|_e[d>>2]))+(Y<<1)|0,_e[j>>2]=(0|Ee[V>>1])<<16|_e[I+(K<<2)>>2],_e[j+4>>2]=(0|Ee[V+4>>1])<<16|0|Ee[V+2>>1],_e[j+8>>2]=(0|Ee[$>>1])<<16|_e[M+(K<<2)>>2],_e[j+12>>2]=(0|Ee[$+4>>1])<<16|0|Ee[$+2>>1]),2!=(0|(z=z+1|0));)j=j+16|0;if(2==(0|(q=q+1|0)))break;Q=Q+n|0}if((0|(H=_+H|0))==(0|l))break;re=re+c|0}if((0|(ne=ne+1|0))==(0|u))break;te=te+N|0}}while((0|(ie=ie+1|0))!=(0|P));return Te=ae,1}(e,n,i,o,f,l,a,u)))return(i=0)|i;break;default:return(i=0)|i}return 0|(i=1)}function K(e,r,t){e|=0,r|=0;var n,i,a;if(8192<=(0|(t|=0)))return 0|N(0|e,0|r,0|t);if(a=0|e,i=e+t|0,(3&e)==(3&r)){for(;3&e;){if(!t)return 0|a;ce[e>>0]=0|ce[r>>0],e=e+1|0,r=r+1|0,t=t-1|0}for(n=(t=-4&i|0)-64|0;(0|e)<=(0|n);)_e[e>>2]=_e[r>>2],_e[e+4>>2]=_e[r+4>>2],_e[e+8>>2]=_e[r+8>>2],_e[e+12>>2]=_e[r+12>>2],_e[e+16>>2]=_e[r+16>>2],_e[e+20>>2]=_e[r+20>>2],_e[e+24>>2]=_e[r+24>>2],_e[e+28>>2]=_e[r+28>>2],_e[e+32>>2]=_e[r+32>>2],_e[e+36>>2]=_e[r+36>>2],_e[e+40>>2]=_e[r+40>>2],_e[e+44>>2]=_e[r+44>>2],_e[e+48>>2]=_e[r+48>>2],_e[e+52>>2]=_e[r+52>>2],_e[e+56>>2]=_e[r+56>>2],_e[e+60>>2]=_e[r+60>>2],e=e+64|0,r=r+64|0;for(;(0|e)<(0|t);)_e[e>>2]=_e[r>>2],e=e+4|0,r=r+4|0}else for(t=i-4|0;(0|e)<(0|t);)ce[e>>0]=0|ce[r>>0],ce[e+1>>0]=0|ce[r+1>>0],ce[e+2>>0]=0|ce[r+2>>0],ce[e+3>>0]=0|ce[r+3>>0],e=e+4|0,r=r+4|0;for(;(0|e)<(0|i);)ce[e>>0]=0|ce[r>>0],e=e+1|0,r=r+1|0;return 0|a}function z(e,r,t){r|=0,t|=0;var n,i,a,o,u,f=0,l=0,s=0,c=0,_=0,d=Te;Te=Te+48|0,o=d+16|0,f=0|_e[(i=(e|=0)+28|0)>>2],_e[(l=(s=d)+32|0)>>2]=f,f=(0|_e[(a=e+20|0)>>2])-f|0,_e[l+4>>2]=f,_e[l+8>>2]=r,f=f+(_e[l+12>>2]=t)|0,_e[s>>2]=_e[(n=e+60|0)>>2],_e[s+4>>2]=l,_e[s+8>>2]=2,s=0|Le(0|v(146,0|s));e:do{if((0|f)!=(0|s)){for(r=2;!((0|s)<0);)if(f=f-s|0,r=((u=(_=0|_e[l+4>>2])>>>0<s>>>0)<<31>>31)+r|0,_e[(l=u?l+8|0:l)>>2]=(0|_e[l>>2])+(_=s-(u?_:0)|0),_e[(u=l+4|0)>>2]=(0|_e[u>>2])-_,_e[o>>2]=_e[n>>2],_e[4+o>>2]=l,_e[8+o>>2]=r,(0|f)==(0|(s=0|Le(0|v(146,0|o))))){c=3;break e}_e[e+16>>2]=0,_e[i>>2]=0,_e[a>>2]=0,_e[e>>2]=32|_e[e>>2],t=2==(0|r)?0:t-(0|_e[l+4>>2])|0}else c=3}while(0);return 3==(0|c)&&(_=0|_e[e+44>>2],_e[e+16>>2]=_+(0|_e[e+48>>2]),_e[i>>2]=_,_e[a>>2]=_),Te=d,0|t}function j(e,r,t){e|=0,r|=0,t|=0;var n,i,a,o,u,f,l,s,c,_=0,d=0,E=Te;for(Te=Te+224|0,f=E+120|0,c=(s=E)+136|0,d=(_=l=E+80|0)+40|0;(0|(_=_+4|(_e[_>>2]=0)))<(0|d););return _e[f>>2]=_e[t>>2],t=(0|w(0,r,f,s,l))<0?-1:(_e[e+76>>2],u=32&(t=0|_e[e>>2]),(0|ce[e+74>>0])<1&&(_e[e>>2]=-33&t),0|_e[(_=e+48|0)>>2]?t=0|w(e,r,f,s,l):(n=0|_e[(d=e+44|0)>>2],_e[d>>2]=c,_e[(i=e+28|0)>>2]=c,_e[(a=e+20|0)>>2]=c,_e[_>>2]=80,_e[(o=e+16|0)>>2]=80+c,t=0|w(e,r,f,s,l),n&&(ze[7&_e[e+36>>2]](e,0,0),t=0==(0|_e[a>>2])?-1:t,_e[d>>2]=n,_e[_>>2]=0,_e[o>>2]=0,_e[i>>2]=0,_e[a>>2]=0)),_=0|_e[e>>2],_e[e>>2]=_|u,0==(32&_|0)?t:-1),Te=E,0|t}function J(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,a,o,u,f,l,s,c=0,_=Te;for(Te=Te+64|0,f=0|_e[e>>2],s=e+(0|_e[f-8>>2])|0,f=0|_e[f-4>>2],_e[(l=_)>>2]=t,_e[l+4>>2]=e,_e[l+8>>2]=r,_e[l+12>>2]=n,r=l+20|0,n=l+24|0,i=l+28|0,a=l+32|0,o=l+40|0,u=(c=e=l+16|0)+36|0;(0|(c=c+4|(_e[c>>2]=0)))<(0|u););W[e+36>>1]=0,ce[e+38>>0]=0;e:do{if(0|we(f,t))_e[l+48>>2]=1,Qe[3&_e[20+(0|_e[f>>2])>>2]](f,l,s,s,1,0),e=1==(0|_e[n>>2])?s:0;else{switch(je[3&_e[24+(0|_e[f>>2])>>2]](f,l,s,1,0),0|_e[l+36>>2]){case 0:e=1==(0|_e[o>>2])&1==(0|_e[i>>2])&1==(0|_e[a>>2])?0|_e[r>>2]:0;break e;case 1:break;default:e=0;break e}if(1!=(0|_e[n>>2])&&!(0==(0|_e[o>>2])&1==(0|_e[i>>2])&1==(0|_e[a>>2]))){e=0;break}e=0|_e[e>>2]}}while(0);return Te=_,0|e}function $(e){var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=Te;if(Te=Te+544|0,o=f+16|0,i=(r=f)+32|0,8192<=((t=0|_e[(a=(e|=0)+8|0)>>2])+-1|0)>>>0&&(_e[r>>2]=866,_e[r+4>>2]=3006,_e[r+8>>2]=1257,Ce(i,812,r),Me(i)),_e[e>>2]=t,u=(r=0|_e[(n=e+20|0)>>2])?t:((r=0|te(180,0))?(_e[(u=r+164|0)>>2]=0,_e[u+4>>2]=0,_e[u+8>>2]=0,_e[u+12>>2]=0):r=0,_e[n>>2]=r,0|_e[e>>2]),o=0|_e[a>>2]?u:(_e[o>>2]=866,_e[o+4>>2]=910,_e[o+8>>2]=1497,Ce(i,812,o),Me(i),0|_e[e>>2]),i=0|_e[e+4>>2],!(16<o>>>0))return e=(e=0)|G(r,u,i,e),Te=f,0|e;for(t=o,n=0;a=n+1|0,3<t>>>0;)t>>>=1,n=a;return e=0|G(r,u,i,e=255&((e=n+2+(32!=(0|a)&1<<a>>>0<o>>>0&1)|0)>>>0<11?e:11)),Te=f,0|e}function Z(e){var r,t,n,i,a,o=0,u=0,f=Te;Te=Te+576|0,i=f+48|0,a=f+32|0,t=f+16|0,n=(r=f)+64|0,o=0|_e[(e|=0)+168>>2];do{if(0|o){if(u=0|_e[o+-4>>2],o=o+-8|0,0!=(0|u)&&(0|u)==(0|~_e[o>>2])||(_e[r>>2]=866,_e[r+4>>2]=651,_e[r+8>>2]=1579,Ce(n,812,r),Me(n)),7&o){_e[t>>2]=866,_e[4+t>>2]=2506,_e[8+t>>2]=1232,Ce(n,812,t),Me(n);break}ue(o,0,0,1,0);break}}while(0);Te=((o=0|_e[e+176>>2])&&(u=0|_e[o+-4>>2],o=o+-8|0,0!=(0|u)&&(0|u)==(0|~_e[o>>2])||(_e[a>>2]=866,_e[4+a>>2]=651,_e[8+a>>2]=1579,Ce(n,812,a),Me(n)),7&o?(_e[i>>2]=866,_e[4+i>>2]=2506,_e[8+i>>2]=1232,Ce(n,812,i),Me(n)):ue(o,0,0,1,0)),f)}function q(e,r,t){var n;return!(0!=(0|(e|=0))&73<(r|=0)>>>0&0!=(0|(t|=0)))||40!=(0|_e[t>>2])||18552!=((0|de[e>>0])<<8|0|de[e+1>>0]|0)||((0|de[e+2>>0])<<8|0|de[e+3>>0])>>>0<74||((0|de[e+7>>0])<<16|(0|de[e+6>>0])<<24|(0|de[e+8>>0])<<8|0|de[e+9>>0])>>>0>r>>>0?(t=0)|t:(_e[t+4>>2]=(0|de[e+12>>0])<<8|0|de[e+13>>0],_e[t+8>>2]=(0|de[e+14>>0])<<8|0|de[e+15>>0],_e[t+12>>2]=de[e+16>>0],_e[t+16>>2]=de[e+17>>0],_e[(n=t+32|0)>>2]=de[(r=e+18|0)>>0],r=(_e[4+n>>2]=0)|ce[r>>0],_e[t+20>>2]=r<<24>>24==0|r<<24>>24==9?8:16,_e[t+24>>2]=(0|de[e+26>>0])<<16|(0|de[e+25>>0])<<24|(0|de[e+27>>0])<<8|0|de[e+28>>0],_e[t+28>>2]=(0|de[e+30>>0])<<16|(0|de[e+29>>0])<<24|(0|de[e+31>>0])<<8|0|de[e+32>>0],0|(t=1))}function Q(e,r){e|=0;var t,n,i=0,a=0,o=0,u=0,f=0,l=Te;if(Te=Te+544|0,f=l+16|0,u=(i=l)+32|0,33<=(r|=0)>>>0&&(_e[i>>2]=866,_e[i+4>>2]=3199,_e[i+8>>2]=1350,Ce(u,812,i),Me(u)),(0|r)<=(0|(i=0|_e[(n=e+20|0)>>2])))return u=i,f=(a=0|_e[(o=a=e+16|0)>>2])>>>(f=32-r|0),_e[o>>2]=a<<=r,_e[n>>2]=r=u-r|0,Te=l,0|f;for(a=e+4|0,o=e+8|0,t=e+16|0;e=(0|(e=0|_e[a>>2]))==(0|_e[o>>2])?0:(_e[a>>2]=e+1,0|de[e>>0]),33<=(0|(_e[n>>2]=i=i+8|0))&&(_e[f>>2]=866,_e[f+4>>2]=3208,_e[f+8>>2]=1366,Ce(u,812,f),Me(u),i=0|_e[n>>2]),e=e<<32-i|_e[t>>2],_e[t>>2]=e,(0|i)<(0|r););return f=e>>>(f=32-r|0),_e[t>>2]=u=e<<r,_e[n>>2]=r=i-r|0,Te=l,0|f}function ee(e,r,t){e|=0,r|=0;var n,i=0,a=0,o=0,u=0;(a=0|_e[(i=(t|=0)+16|0)>>2])?o=5:0|be(t)?i=0:(a=0|_e[i>>2],o=5);e:do{if(5==(0|o)){if((a-(i=u=0|_e[(n=t+20|0)>>2])|0)>>>0<r>>>0){i=0|ze[7&_e[t+36>>2]](t,e,r);break}r:do{if(-1<(0|ce[t+75>>0])){for(u=r;;){if(!u){o=0,a=e;break r}if(10==(0|ce[e+(a=u+-1|0)>>0]))break;u=a}if((i=0|ze[7&_e[t+36>>2]](t,e,u))>>>0<u>>>0)break e;a=e+(o=u)|0,r=r-u|0,i=0|_e[n>>2]}else o=0,a=e}while(0);K(0|i,0|a,0|r),_e[n>>2]=(0|_e[n>>2])+r,i=o+r|0}}while(0);return 0|i}function re(e){var r,t=0,n=0,i=0,a=Te;Te=Te+544|0,i=a+16|0,r=(n=a)+32|0,t=0|_e[(e|=0)+20>>2];do{if(0|t){if(Z(t),7&t){_e[n>>2]=866,_e[n+4>>2]=2506,_e[n+8>>2]=1232,Ce(r,812,n),Me(r);break}ue(t,0,0,1,0);break}}while(0);if(!(n=0|_e[(t=e+4|0)>>2]))return ce[(i=e+16|0)>>0]=0,void(Te=a);7&n?(_e[i>>2]=866,_e[i+4>>2]=2506,_e[i+8>>2]=1232,Ce(r,812,i),Me(r)):ue(n,0,0,1,0),_e[t>>2]=0,_e[e+8>>2]=0,_e[e+12>>2]=0,ce[(i=e+16|0)>>0]=0,Te=a}function te(e,r){r|=0;var t,n,i,a=0,o=0,u=0,f=Te;return Te=Te+560|0,u=f+32|0,i=f+16|0,n=(a=f)+48|0,t=f+44|0,2147418112<(o=0|(o=(e|=0)+3&-4)?o:4)>>>0?(_e[a>>2]=866,_e[a+4>>2]=2506,_e[a+8>>2]=1103,Ce(n,812,a),Me(n),Te=f,(u=0)|u):(e=0|ue(0,_e[t>>2]=o,t,1,0),a=0|_e[t>>2],0|r&&(_e[r>>2]=a),0==(0|e)|a>>>0<o>>>0?(_e[i>>2]=866,_e[4+i>>2]=2506,_e[8+i>>2]=1129,Ce(n,812,i),Me(n),e=0):7&e&&(_e[u>>2]=866,_e[u+4>>2]=2533,_e[u+8>>2]=1156,Ce(n,812,u),Me(n)),Te=f,0|(u=e))}function ne(e,r,t){r|=0;var n,i,a,o=(e|=0)+(t|=0)|0;if(r&=255,67<=(0|t)){for(;3&e;)ce[e>>0]=r,e=e+1|0;for(i=(n=-4&o|0)-64|0,a=r|r<<8|r<<16|r<<24;(0|e)<=(0|i);)_e[e>>2]=a,_e[e+4>>2]=a,_e[e+8>>2]=a,_e[e+12>>2]=a,_e[e+16>>2]=a,_e[e+20>>2]=a,_e[e+24>>2]=a,_e[e+28>>2]=a,_e[e+32>>2]=a,_e[e+36>>2]=a,_e[e+40>>2]=a,_e[e+44>>2]=a,_e[e+48>>2]=a,_e[e+52>>2]=a,_e[e+56>>2]=a,_e[e+60>>2]=a,e=e+64|0;for(;(0|e)<(0|n);)_e[e>>2]=a,e=e+4|0}for(;(0|e)<(0|o);)ce[e>>0]=r,e=e+1|0;return o-t|0}function ae(e,r,t,n,i){e|=0,t|=0,n|=0,i|=0;var a,o,u,f;ce[(r|=0)+53>>0]=1;do{if((0|_e[r+4>>2])==(0|n)){if(ce[r+52>>0]=1,u=r+54|0,f=r+48|0,o=r+24|0,e=r+36|0,!(a=0|_e[(n=r+16|0)>>2])){if(_e[n>>2]=t,_e[o>>2]=i,!((_e[e>>2]=1)==(0|_e[f>>2])&1==(0|i)))break;ce[u>>0]=1;break}if((0|a)!=(0|t)){_e[e>>2]=1+(0|_e[e>>2]),ce[u>>0]=1;break}2==(0|(e=0|_e[o>>2]))&&(e=_e[o>>2]=i),1==(0|_e[f>>2])&1==(0|e)&&(ce[u>>0]=1)}}while(0)}function oe(e,r){e|=0;var t,n,i=0,a=0,o=0,u=0,f=Te;Te=Te+16|0,ce[(t=f)>>0]=n=255&(r|=0),(o=0|_e[(a=e+16|0)>>2])?u=4:0|be(e)?i=-1:(o=0|_e[a>>2],u=4);do{if(4==(0|u)){if((a=0|_e[(u=e+20|0)>>2])>>>0<o>>>0&&(0|(i=255&r))!=(0|ce[e+75>>0])){_e[u>>2]=a+1,ce[a>>0]=n;break}i=1==(0|ze[7&_e[e+36>>2]](e,t,1))?0|de[t>>0]:-1}}while(0);return Te=f,0|i}function ue(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;do{if(e){if(!r){if(F(e),!t){r=0;break}r=_e[t>>2]=0;break}n?e=0==(0|(r=0|function(e,r){r|=0;var t=0,n=0;if(!(e|=0))return 0|(r=0|I(r));if(4294967231<r>>>0)return _e[(r=296)>>2]=12,(r=0)|r;if(0|(t=0|function(e,r){r|=0;var t,n,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=(e|=0)+(i=-8&(l=0|_e[(s=e+4|0)>>2]))|0;if(!(3&l))return!(r>>>0<256)&&(r+4|0)>>>0<=i>>>0&&(i-r|0)>>>0<=_e[1264]<<1>>>0?0|e:(e=0)|e;if(r>>>0<=i>>>0)return(i=i-r|0)>>>0<=15||(f=e+r|0,_e[s>>2]=1&l|r|2,_e[f+4>>2]=3|i,_e[(s=f+i+4|0)>>2]=1|_e[s>>2],x(f,i)),0|e;if((0|c)==(0|_e[1150]))return i=(f=(0|_e[1147])+i|0)-r|0,a=e+r|0,f>>>0<=r>>>0?(e=0)|e:(_e[s>>2]=1&l|r|2,_e[a+4>>2]=1|i,_e[1150]=a,_e[1147]=i,0|e);if((0|c)==(0|_e[1149]))return(o=(0|_e[1146])+i|0)>>>0<r>>>0?(e=0)|e:(a=1&l,15<(i=o-r|0)>>>0?(f=(l=e+r|0)+i|0,_e[s>>2]=a|r|2,_e[l+4>>2]=1|i,_e[f>>2]=i,_e[(a=f+4|0)>>2]=-2&_e[a>>2],a=l):(_e[s>>2]=a|o|2,_e[(a=e+o+4|0)>>2]=1|_e[a>>2],i=a=0),_e[1146]=i,_e[1149]=a,0|e);if(2&(a=0|_e[4+c>>2])|0)return(e=0)|e;if((n=(-8&a)+i|0)>>>0<r>>>0)return(e=0)|e;f=n-r|0,o=a>>>3;do{if(a>>>0<256){if(a=0|_e[8+c>>2],(0|(i=0|_e[12+c>>2]))==(0|a)){_e[1144]=_e[1144]&~(1<<o);break}_e[a+12>>2]=i,_e[i+8>>2]=a;break}t=0|_e[24+c>>2],i=0|_e[12+c>>2];do{if((0|i)==(0|c)){if(i=0|_e[(a=(o=16+c|0)+4|0)>>2])u=a;else{if(!(i=0|_e[o>>2])){o=0;break}u=o}for(;;)if(0|(a=0|_e[(o=i+20|0)>>2]))i=a,u=o;else{if(!(o=0|_e[(a=i+16|0)>>2]))break;i=o,u=a}_e[u>>2]=0,o=i}else o=0|_e[8+c>>2],_e[o+12>>2]=i,_e[i+8>>2]=o,o=i}while(0);if(0|t){if(i=0|_e[28+c>>2],(0|c)==(0|_e[(a=4880+(i<<2)|0)>>2])){if(!(_e[a>>2]=o)){_e[1145]=_e[1145]&~(1<<i);break}}else if(!(_e[16+t+(((0|_e[16+t>>2])!=(0|c)&1)<<2)>>2]=o))break;_e[o+24>>2]=t,0|(a=0|_e[(i=16+c|0)>>2])&&(_e[o+16>>2]=a,_e[a+24>>2]=o),0|(i=0|_e[i+4>>2])&&(_e[o+20>>2]=i,_e[i+24>>2]=o)}}while(0);return i=1&l,f>>>0<16?(_e[s>>2]=n|i|2,_e[(s=e+n+4|0)>>2]=1|_e[s>>2]):(l=e+r|0,_e[s>>2]=i|r|2,_e[l+4>>2]=3|f,_e[(s=l+f+4|0)>>2]=1|_e[s>>2],x(l,f)),0|e}(e+-8|0,r>>>0<11?16:r+11&-8)))return 0|(r=t+8|0);return(t=0|I(r))?(n=0|_e[e+-4>>2],K(0|t,0|e,0|((n=(-8&n)-(0==(3&n|0)?8:4)|0)>>>0<r>>>0?n:r)),F(e),0|(r=t)):0|(r=0)}(e,r)))?e:r:r=0,t&&(i=0|pe(e),_e[t>>2]=i)}else r=0|I(r),t&&(e=r?0|pe(r):0,_e[t>>2]=e)}while(0);return 0|r}function fe(e,r,t){t|=0;var n;if(0<(r|=0)>>>0|0==(0|r)&4294967295<(e|=0)>>>0){for(;n=0|he(0|e,0|r,10,0),ce[(t=t+-1|0)>>0]=255&n|48,e=0|Fe(0|(n=e),0|r,10,0),9<r>>>0|9==(0|r)&4294967295<n>>>0;)r=L;r=e}else r=e;if(r)for(;ce[(t=t+-1|0)>>0]=(r>>>0)%10|48,!(r>>>0<10);)r=(r>>>0)/10|0;return 0|t}function le(e,r,t,n){e|=0,t|=0,n|=0;var i=0|_e[(e=(r|=0)+16|0)>>2],a=r+36|0,o=r+24|0;do{if(i){if((0|i)!=(0|t)){_e[a>>2]=1+(0|_e[a>>2]),_e[o>>2]=2,ce[r+54>>0]=1;break}2==(0|_e[o>>2])&&(_e[o>>2]=n)}else _e[e>>2]=t,_e[o>>2]=n,_e[a>>2]=1}while(0)}function Me(e){e|=0;var r=0,t=0,n=0|_e[119];_e[76+n>>2];do{if((0|function(e,r){r|=0;var t=0;return t=0|function(e){var r=0,t=0,n=0,n=e|=0;e:do{if(3&n)for(r=n;;){if(!(0|ce[e>>0])){e=r;break e}if(!(3&(r=e=e+1|0))){t=4;break}}else t=4}while(0);if(4==(0|t)){for(;!((-2139062144&(r=0|_e[e>>2])^-2139062144)&r+-16843009);)e=e+4|0;if((255&r)<<24>>24)for(;0!=(0|ce[(e=e+1|0)>>0]););}return e-n|0}(e|=0),((0|function(e,r,t,n){e|=0,n|=0;var i=0;i=0|ie(t|=0,r|=0),t=0==(0|r)?0:t,e=(_e[n+76>>2],0|ee(e,i,n));(0|e)!=(0|i)&&(t=(e>>>0)/(r>>>0)|0);return 0|t}(e,1,t,r))!=(0|t))<<31>>31|0}(e,n))<0)e=1;else{if(10!=(0|ce[75+n>>0])&&(t=0|_e[(r=20+n|0)>>2])>>>0<(0|_e[16+n>>2])>>>0){_e[r>>2]=t+1,ce[t>>0]=10,e=0;break}e=(0|oe(n,10))<0}}while(0);return e<<31>>31|0}function se(e,r,t,n,i){e|=0,r|=0;var a,o=Te;if(Te=Te+256|0,a=o,(0|(n|=0))<(0|(t|=0))&0==(73728&(i|=0)|0)){if(ne(0|a,0|r,0|((i=t-n|0)>>>0<256?i:256)),255<i>>>0){for(r=t-n|0;Ie(e,a,256),255<(i=i+-256|0)>>>0;);i=255&r}Ie(e,a,i)}Te=o}function be(e){var r=0,t=0|ce[(r=(e|=0)+74|0)>>0];return ce[r>>0]=255+t|t,0|(e=8&(r=0|_e[e>>2])?(_e[e>>2]=32|r,-1):(_e[e+8>>2]=0,t=(_e[e+4>>2]=0)|_e[e+44>>2],_e[e+28>>2]=t,_e[e+20>>2]=t,_e[e+16>>2]=t+(0|_e[e+48>>2]),0))}function me(e){var r=0,t=0;return 0<(0|(t=(e|=0)+15&-16|0))&(0|(e=(r=0|_e[_>>2])+t|0))<(0|r)|(0|e)<0?(b(),h(12),-1):(0|(_e[_>>2]=e))>(0|M())&&0==(0|A())?(_e[_>>2]=r,h(12),-1):0|r}function Se(e){var r=0,t=0,n=0,t=0|_e[(e|=0)>>2];if((n=(0|ce[t>>0])-48|0)>>>0<10)for(r=0;r=n+(10*r|0)|0,_e[e>>2]=t=t+1|0,(n=(0|ce[t>>0])-48|0)>>>0<10;);else r=0;return 0|r}function Pe(e){var r=0;return(0|(r=0|ce[d+(255&(e|=0))>>0]))<8?0|r:(0|(r=0|ce[d+(e>>8&255)>>0]))<8?r+8|0:(0|(r=0|ce[d+(e>>16&255)>>0]))<8?r+16|0:24+(0|ce[d+(e>>>24)>>0])|0}function Re(e,r,t,n){n|=0;var i=0;(0|_e[(r|=0)+4>>2])==(0|(t|=0))&&1!=(0|_e[(i=r+28|0)>>2])&&(_e[i>>2]=n)}function he(e,r,t,n){var i,a=Te;return Te=Te+16|0,B(e|=0,r|=0,t|=0,n|=0,i=0|a),Te=a,0|(L=0|_e[4+i>>2],0|_e[i>>2])}function pe(e){var r;return(e|=0)?0|(1==(0|(e=3&(r=0|_e[e+-4>>2])))?0:(-8&r)-(0==(0|e)?8:4)|0):0}function Ce(e,r,t){e|=0,r|=0;var n=0,i=Te;return Te=Te+16|0,_e[(n=i)>>2]=t|=0,t=0|(e=e,r=r,n=n,0|function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,a=0,o=0,u=0,f=0,l=0,s=Te;for(Te=Te+128|0,a=s+124|0,u=604,i=(o=l=s)+124|0;_e[o>>2]=_e[u>>2],u=u+4|0,(0|(o=o+4|0))<(0|i););return 2147483646<(r+-1|0)>>>0?r?(_e[(r=296)>>2]=75,r=-1):(e=a,r=1,f=4):f=4,4==(0|f)&&(_e[l+48>>2]=f=(f=-2-e|0)>>>0<r>>>0?f:r,_e[(a=l+20|0)>>2]=e,r=(_e[l+44>>2]=e)+f|0,_e[(e=l+16|0)>>2]=r,_e[l+28>>2]=r,r=0|j(l,t,n),f&&(l=0|_e[a>>2],ce[l+(((0|l)==(0|_e[e>>2]))<<31>>31)>>0]=0)),Te=s,0|r}(e|=0,2147483647,r|=0,n|=0)),Te=i,0|t}function Ne(e,r,t){return e|=0,r|=0,(0|(t|=0))<32?(L=r<<t|(e&(1<<t)-1<<32-t)>>>32-t,e<<t):(L=e<<t-32,0)}function ye(e,r,t){return e|=0,r|=0,(0|(t|=0))<32?(L=r>>>t,e>>>t|(r&(1<<t)-1)<<32-t):r>>>t-32|(L=0)}function Oe(e,r){e|=0;var t=Te;Te=Te+16|0,_e[t>>2]=r|=0,j(r=0|_e[26],e,t),function(e,r){var t=0,n=0,i=0,a=0,o=255&(e|=0),t=255&e;_e[(r|=0)+76>>2],a=3;do{if(3==(0|a)){if((0|t)!=(0|ce[r+75>>0])&&(i=0|_e[(n=r+20|0)>>2])>>>0<(0|_e[r+16>>2])>>>0){_e[n>>2]=i+1,ce[i>>0]=o;break}t=0|oe(r,e)}}while(0)}(10,r),p()}function ve(e,r,t,n){return 0|(L=n=(r|=0)-(n|=0)-((e|=0)>>>0<(t|=0)>>>0|0)>>>0,e-t>>>0|0)}function ke(e){var r;return k[g>>3]=e=+e,r=0|_e[g>>2],L=0|_e[g+4>>2],0|r}function ge(e,r,t,n){return 0|(L=(r|=0)+(n|=0)+((t=(e|=0)+(t|=0)>>>0)>>>0<e>>>0|0)>>>0,0|t)}function Le(e){return 4294963200<(e|=0)>>>0&&(_e[74]=0-e,e=-1),0|e}function Ie(e,r,t){r|=0,t|=0,32&_e[(e|=0)>>2]||ee(r,t,e)}function De(e,r){return r|=0,0|(e=(e|=0)?0|function(e,r){e|=0,r|=0;do{if(e){if(r>>>0<128){ce[e>>0]=r,e=1;break}if(!(0|_e[_e[420>>2]>>2])){if(57216==(-128&r|0)){ce[e>>0]=r,e=1;break}_e[(e=296)>>2]=84,e=-1;break}if(r>>>0<2048){ce[e>>0]=r>>>6|192,ce[e+1>>0]=63&r|128,e=2;break}if(r>>>0<55296|57344==(-8192&r|0)){ce[e>>0]=r>>>12|224,ce[e+1>>0]=r>>>6&63|128,ce[e+2>>0]=63&r|128,e=3;break}if((r+-65536|0)>>>0<1048576){ce[e>>0]=r>>>18|240,ce[e+1>>0]=r>>>12&63|128,ce[e+2>>0]=r>>>6&63|128,ce[e+3>>0]=63&r|128,e=4;break}_e[(e=296)>>2]=84,e=-1;break}}while(e=1,0);return 0|e}(e,r):0)}function we(e,r){return(0|(e|=0))==(0|(r|=0))|0}function Ge(e,r){var t=0|xe(0|(e|=0));return 0|(0==(0|(r|=0))?e:t)}function Fe(e,r,t,n){return 0|B(e|=0,r|=0,t|=0,n|=0,0)}function xe(e){return(255&(e|=0))<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function Be(e,r,t,n,i,a){E(6)}function Ue(e,r,t,n,i){E(1)}function He(e){e=e|=0,F(e|=0)}function We(e,r,t,n){E(7)}function Ve(e,r,t){return E(0),0}function Xe(e){}function Ye(e){E(2)}function Ke(){E(5)}r.__ZSt18uncaught_exceptionv;var ze=[Ve,z,function(e,r,t){r|=0,t|=0;var n,i,a=Te;return Te=Te+32|0,n=(i=a)+20|0,_e[i>>2]=_e[(e|=0)+60>>2],_e[i+4>>2]=0,_e[i+8>>2]=r,_e[i+12>>2]=n,_e[i+16>>2]=t,e=(0|Le(0|O(140,0|i)))<0?_e[n>>2]=-1:0|_e[n>>2],Te=a,0|e},function(e,r,t){r|=0,t|=0;var n=0,i=Te;return Te=Te+32|0,n=i,_e[(e|=0)+36>>2]=1,0==(64&_e[e>>2]|0)&&(_e[n>>2]=_e[e+60>>2],_e[n+4>>2]=21523,_e[n+8>>2]=i+16,0|S(54,0|n))&&(ce[e+75>>0]=-1),n=0|z(e,r,t),Te=i,0|n},function(e,r,t){var n=0,i=0;return K(0|(i=0|_e[(n=(e|=0)+20|0)>>2]),0|(r|=0),0|(e=(t|=0)>>>0<(e=(0|_e[e+16>>2])-i|0)>>>0?t:e)),_e[n>>2]=(0|_e[n>>2])+e,0|t},function(e,r,t){t|=0;var n,i,a=0,o=Te;if(Te=Te+64|0,i=o,0|we(e|=0,r|=0))r=1;else if(0!=(0|r)&&0!=(0|(a=0|J(r,32,16,0)))){for(n=(r=i+4|0)+52|0;(0|(r=r+4|(_e[r>>2]=0)))<(0|n););_e[i>>2]=a,_e[i+8>>2]=e,_e[i+12>>2]=-1,_e[i+48>>2]=1,er[3&_e[28+(0|_e[a>>2])>>2]](a,i,0|_e[t>>2],1),r=1==(0|_e[i+24>>2])?(_e[t>>2]=_e[i+16>>2],1):0}else r=0;return Te=o,0|r},Ve,Ve],je=[Ue,function(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0;var a=0;do{if(0|we(e,0|_e[r+8>>2]))Re(0,r,t,n);else if(0|we(e,0|_e[r>>2])){if(e=r+32|0,(0|_e[r+16>>2])!=(0|t)&&(0|_e[(a=r+20|0)>>2])!=(0|t)){_e[e>>2]=n,_e[a>>2]=t,_e[(n=r+40|0)>>2]=1+(0|_e[n>>2]),1==(0|_e[r+36>>2])&&2==(0|_e[r+24>>2])&&(ce[r+54>>0]=1),_e[r+44>>2]=4;break}1==(0|n)&&(_e[e>>2]=1)}}while(0)},function(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;var a,o=0,u=0,f=0;do{if(0|we(e,0|_e[r+8>>2]))Re(0,r,t,n);else{if(o=e+8|0,!(0|we(e,0|_e[r>>2]))){f=0|_e[o>>2],je[3&_e[24+(0|_e[f>>2])>>2]](f,r,t,n,i);break}if(e=r+32|0,(0|_e[r+16>>2])!=(0|t)&&(0|_e[(u=r+20|0)>>2])!=(0|t)){if(_e[e>>2]=n,4==(0|_e[(n=r+44|0)>>2]))break;ce[(e=r+52|0)>>0]=0,o=(ce[(a=r+53|0)>>0]=0)|_e[o>>2],Qe[3&_e[20+(0|_e[o>>2])>>2]](o,r,t,t,1,i),0|ce[a>>0]?0|ce[e>>0]?e=3:(e=3,f=11):(e=4,f=11),11==(0|f)&&(_e[u>>2]=t,_e[(a=r+40|0)>>2]=1+(0|_e[a>>2]),1==(0|_e[r+36>>2])&&2==(0|_e[r+24>>2])&&(ce[r+54>>0]=1)),_e[n>>2]=e;break}1==(0|n)&&(_e[e>>2]=1)}}while(0)},Ue],Je=[Ye,Xe,He,Xe,Xe,He,function(e){var r=Te;Te=Te+16|0,F(e|=0),0|P(0|_e[1285],0)?Oe(4406,r):Te=r},Ye],$e=[function(e){return E(3),0},function(e){var r,t=Te;return Te=Te+16|0,e=0|(r=0|_e[(e|=0)+60>>2],0|(r|=0)),_e[(r=t)>>2]=e,e=0|Le(0|R(6,0|r)),Te=t,0|e}],Ze=[function(e,r,t){E(4)}],qe=[Ke,function(){var e,r,t,n,i=0,a=0,o=0,u=Te;Te=Te+48|0,n=u+32|0,r=u+24|0,o=u+16|0,u=(t=u)+36|0,0|(i=0|function(){var e=0,r=0;{if(Te=(e=Te)+16|0,!(0|C(5136,2)))return r=0|m(0|_e[1285]),Te=e,0|r;Oe(4307,e)}return 0}())&&0|(a=0|_e[i>>2])&&(1126902528==(-256&(e=0|_e[(i=a+48|0)>>2])|0)&1129074247==(0|(i=0|_e[i+4>>2]))||(_e[r>>2]=4168,Oe(4118,r)),i=1126902529==(0|e)&1129074247==(0|i)?0|_e[a+44>>2]:a+80|0,_e[u>>2]=i,a=0|_e[a>>2],i=0|_e[a+4>>2],0|ze[7&_e[16+(0|_e[2])>>2]](8,a,u)?(o=0|_e[u>>2],o=0|$e[1&_e[8+(0|_e[o>>2])>>2]](o),_e[t>>2]=4168,_e[t+4>>2]=i,_e[t+8>>2]=o,Oe(4032,t)):(_e[o>>2]=4168,_e[o+4>>2]=i,Oe(4077,o))),Oe(4156,n)},function(){var e=Te;Te=Te+16|0,0|y(5140,6)?Oe(4356,e):Te=e},Ke],Qe=[Be,function(e,r,t,n,i,a){t|=0,n|=0,i|=0,0|we(e|=0,0|_e[(r|=0)+8>>2])&&ae(0,r,t,n,i)},function(e,r,t,n,i,a){t|=0,n|=0,i|=0,a|=0,0|we(e|=0,0|_e[(r|=0)+8>>2])?ae(0,r,t,n,i):(e=0|_e[e+8>>2],Qe[3&_e[20+(0|_e[e>>2])>>2]](e,r,t,n,i,a))},Be],er=[We,function(e,r,t,n){t|=0,n|=0,0|we(e|=0,0|_e[(r|=0)+8>>2])&&le(0,r,t,n)},function(e,r,t,n){t|=0,n|=0,0|we(e|=0,0|_e[(r|=0)+8>>2])?le(0,r,t,n):(e=0|_e[e+8>>2],er[3&_e[28+(0|_e[e>>2])>>2]](e,r,t,n))},We];return{stackSave:function(){return 0|Te},_i64Subtract:ve,_crn_get_bytes_per_block:function(e,r){e|=0,r|=0;var t,n,i=0,a=Te;switch(Te=Te+576|0,n=a+40|0,t=a+56|0,_e[(i=a)>>2]=40,q(e,r,i),e=0|_e[(r=i+32|0)+4>>2],0|_e[r>>2]){case 0:if(!e)return Te=a,0|(i=8);e=14;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:e=e?14:13;break;case 9:case 10:if(!e)return Te=a,0|(i=8);e=14;break;default:e=14}return 13==(0|e)?(Te=a,0|(i=16)):14==(0|e)?(_e[n>>2]=866,_e[4+n>>2]=2672,_e[8+n>>2]=1251,Ce(t,812,n),Me(t),Te=a,(i=0)|i):0},setThrew:function(e,r){},dynCall_viii:function(e,r,t,n){Ze[0&(e|=0)](0|(r|=0),0|(t|=0),0|(n|=0))},_bitshift64Lshr:ye,_bitshift64Shl:Ne,dynCall_viiii:function(e,r,t,n,i){er[3&(e|=0)](0|(r|=0),0|(t|=0),0|(n|=0),0|(i|=0))},setTempRet0:function(e){L=e|=0},_crn_decompress:function(e,r,t,n,i,a){e|=0,r|=0,t|=0,n|=0,i|=0,a|=0;var o,u,f,l=0,s=0,c=0,_=0,d=0,E=Te;switch(Te=Te+592|0,f=E+56|0,c=E+40|0,o=E+72|0,u=(d=E)+68|0,_e[d>>2]=40,q(e,r,d),l=(0|_e[d+4>>2])>>>i,s=(0|_e[d+8>>2])>>>i,n=0|_e[(d=d+32|0)+4>>2],0|_e[d>>2]){case 0:n?_=14:d=8;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:_=n?14:13;break;case 9:case 10:n?_=14:d=8;break;default:_=14}13==(0|_)?d=16:14==(0|_)&&(_e[c>>2]=866,_e[c+4>>2]=2672,_e[c+8>>2]=1251,Ce(o,812,c),Me(o),d=0),_e[u>>2]=t,_=0|function(e,r){var t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0,d=0;if(Te=(_=Te)+528|0,u=(s=_)+16|0,0==(0|(e|=0))|(r|=0)>>>0<62)return Te=_,(d=0)|d;if(!(f=0|te(300,0)))return Te=_,(d=0)|d;_e[f>>2]=519686845,_e[4+f>>2]=0,_e[8+f>>2]=0,l=88+f|0,t=136+f|0,n=160+f|0,i=184+f|0,a=208+f|0,o=232+f|0,_e[(c=252+f|0)>>2]=0,_e[c+4>>2]=0,_e[c+8>>2]=0,ce[c+12>>0]=0,_e[(c=268+f|0)>>2]=0,_e[c+4>>2]=0,_e[c+8>>2]=0,ce[c+12>>0]=0,_e[(c=284+f|0)>>2]=0,_e[c+4>>2]=0,_e[c+8>>2]=0,ce[c+12>>0]=0,d=44+(c=l)|0;for(;_e[c>>2]=0,c=c+4|0,(0|c)<(0|d););if(ce[44+l>>0]=0,_e[t>>2]=0,_e[4+t>>2]=0,_e[8+t>>2]=0,_e[12+t>>2]=0,_e[16+t>>2]=0,ce[20+t>>0]=0,_e[n>>2]=0,_e[4+n>>2]=0,_e[8+n>>2]=0,_e[12+n>>2]=0,_e[16+n>>2]=0,ce[20+n>>0]=0,_e[i>>2]=0,_e[4+i>>2]=0,_e[8+i>>2]=0,_e[12+i>>2]=0,_e[16+i>>2]=0,ce[20+i>>0]=0,_e[a>>2]=0,_e[4+a>>2]=0,_e[8+a>>2]=0,_e[12+a>>2]=0,_e[16+a>>2]=0,ce[20+a>>0]=0,_e[o>>2]=0,_e[4+o>>2]=0,_e[8+o>>2]=0,_e[12+o>>2]=0,ce[16+o>>0]=0,0|function(e,r,t){e|=0;var n=0,i=0;if(!(0==(0|(r|=0))|(t|=0)>>>0<74||18552!=((0|de[r>>0])<<8|0|de[r+1>>0]|0))&&74<=((0|de[r+2>>0])<<8|0|de[r+3>>0])>>>0&&((0|de[r+7>>0])<<16|(0|de[r+6>>0])<<24|(0|de[r+8>>0])<<8|0|de[r+9>>0])>>>0<=t>>>0){if(_e[(n=e+88|0)>>2]=r,_e[e+4>>2]=r,_e[e+8>>2]=t,!(0|function(e){var r=0,t=0,n=0,i=0;if(i=92+(e|=0)|0,t=0|_e[(n=e+88|0)>>2],r=(0|_e[e+4>>2])+((0|de[68+t>>0])<<8|(0|de[67+t>>0])<<16|0|de[69+t>>0])|0,!(t=(0|de[65+t>>0])<<8|0|de[66+t>>0]))return(i=0)|i;if(_e[i>>2]=r,_e[e+96>>2]=r,_e[e+104>>2]=t,_e[e+100>>2]=r+t,_e[e+108>>2]=0,_e[e+112>>2]=0,!(0|V(i,e+116|0)))return(i=0)|i;r=0|_e[n>>2];do{if((0|de[r+39>>0])<<8|0|de[r+40>>0]){if(!(0|V(i,e+140|0)))return(i=0)|i;if(0|V(i,e+188|0)){r=0|_e[n>>2];break}return(i=0)|i}if(!((0|de[r+55>>0])<<8|0|de[r+56>>0]))return(i=0)|i}while(0);if((0|de[r+55>>0])<<8|0|de[r+56>>0]|0){if(!(0|V(i,e+164|0)))return(i=0)|i;if(!(0|V(i,e+212|0)))return(i=0)|i}return 0|(i=1)}(e)))return(i=0)|i;if(r=0|_e[n>>2],(0|de[r+39>>0])<<8|0|de[r+40>>0]?0|function(e){var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0,s=0,c=0,_=0,d=0;if(Te=(d=Te)+576|0,i=(o=d)+64|0,_=d+16|0,r=0|_e[(n=88+(e|=0)|0)>>2],c=(0|de[r+39>>0])<<8|0|de[r+40>>0],l=e+236|0,(0|(t=0|_e[(a=e+240|0)>>2]))!=(0|c)){if(t>>>0<=c>>>0){do{if((0|_e[e+244>>2])>>>0<c>>>0){if(0|X(l,c,(t+1|0)==(0|c),4,0)){r=0|_e[a>>2];break}return ce[e+248>>0]=1,Te=d,(_=0)|_}}while(r=t,0);ne((0|_e[l>>2])+(r<<2)|0,0,c-r<<2|0),r=0|_e[n>>2]}_e[a>>2]=c}if(s=e+92|0,t=(0|_e[e+4>>2])+((0|de[r+34>>0])<<8|(0|de[r+33>>0])<<16|0|de[r+35>>0])|0,!(r=(0|de[r+37>>0])<<8|(0|de[r+36>>0])<<16|0|de[r+38>>0]))return Te=d,(_=0)|_;if(_e[s>>2]=t,_e[e+96>>2]=t,_e[e+104>>2]=r,_e[e+100>>2]=t+r,_e[e+108>>2]=0,_e[e+112>>2]=0,u=_+20|0,_e[_>>2]=0,_e[_+4>>2]=0,_e[_+8>>2]=0,_e[_+12>>2]=0,ce[_+16>>0]=0,f=_+24|0,_e[_+44>>2]=0,_e[u>>2]=0,_e[u+4>>2]=0,_e[u+8>>2]=0,_e[u+12>>2]=0,_e[u+16>>2]=0,ce[u+20>>0]=0,0|V(s,_)&&0|V(s,f))if(0|_e[a>>2]||(_e[o>>2]=866,_e[o+4>>2]=910,_e[o+8>>2]=1497,Ce(i,812,o),Me(i)),c)for(t=(u=o=0)|_e[l>>2],a=i=r=e=n=0;;){if(o=(0|Ae(s,_))+o&31,a=(0|Ae(s,f))+a&63,i=(0|Ae(s,_))+i&31,r=(0|Ae(s,_))+r|0,e=(0|Ae(s,f))+e&63,n=(0|Ae(s,_))+n&31,_e[t>>2]=a<<5|o<<11|i|r<<27|e<<21|n<<16,c>>>0<=(u=u+1|0)>>>0){r=1;break}t=t+4|0,r&=31}else r=1;else r=0;return re(_+24|0),re(_),Te=d,0|(_=r)}(e)&&0|function(e){var r,t,n,i,a,o,u,f,l,s,c,_,d,E,T,A,M,b,m,S,P,R,h,p,C,N,y,O,v,k=0,g=0,L=0,I=0,D=0,w=0,G=0,F=0,x=0,B=Te;if(Te=Te+1008|0,D=(w=B)+496|0,F=B+472|0,E=B+276|0,T=B+80|0,A=B+16|0,g=0|_e[(e|=0)+88>>2],_=(0|de[g+47>>0])<<8|0|de[g+48>>0],k=(0|_e[e+4>>2])+((0|de[g+42>>0])<<8|(0|de[g+41>>0])<<16|0|de[g+43>>0])|0,!(g=(0|de[g+45>>0])<<8|(0|de[g+44>>0])<<16|0|de[g+46>>0]))return Te=B,(F=0)|F;if(_e[(d=e+92|0)>>2]=k,_e[e+96>>2]=k,_e[e+104>>2]=g,_e[e+100>>2]=k+g,_e[e+108>>2]=0,_e[e+112>>2]=0,_e[F+20>>2]=0,_e[F>>2]=0,_e[F+4>>2]=0,_e[F+8>>2]=0,_e[F+12>>2]=0,(ce[F+16>>0]=0)|V(d,F)){for(k=0,L=g=-3;_e[E+(k<<2)>>2]=L,_e[T+(k<<2)>>2]=g,I=2<(0|L),49!=(0|(k=k+1|0));)g=(1&I)+g|0,L=I?-3:L+1|0;for(g=(k=A)+64|0;(0|(k=k+4|(_e[k>>2]=0)))<(0|g););L=e+252|0,k=0|_e[(g=e+256|0)>>2];e:do{if((0|k)==(0|_))G=13;else{if(k>>>0<=_>>>0){do{if((0|_e[e+260>>2])>>>0<_>>>0){if(0|X(L,_,(k+1|0)==(0|_),4,0)){k=0|_e[g>>2];break}ce[e+264>>0]=1,k=0;break e}}while(0);ne((0|_e[L>>2])+(k<<2)|0,0,_-k<<2|0)}_e[g>>2]=_,G=13}}while(0);do{if(13==(0|G)){if(!_){_e[w>>2]=866,_e[w+4>>2]=910,_e[w+8>>2]=1497,Ce(D,812,w),Me(D),k=1;break}for(D=8+A|0,w=12+A|0,G=16+A|0,r=20+A|0,t=24+A|0,n=28+A|0,i=32+A|0,a=36+A|0,o=40+A|0,u=44+A|0,f=48+A|0,l=52+A|0,s=56+A|0,c=60+A|0,k=(I=0)|_e[L>>2],g=0|_e[(e=4+A|0)>>2],L=0|_e[A>>2];v=0|Ae(d,F),L=L+(0|_e[E+(v<<2)>>2])&3,g=g+(0|_e[T+(v<<2)>>2])&3,v=0|Ae(d,F),x=(0|_e[D>>2])+(0|_e[E+(v<<2)>>2])&3,_e[D>>2]=x,v=(0|_e[w>>2])+(0|_e[T+(v<<2)>>2])&3,_e[w>>2]=v,y=0|Ae(d,F),O=(0|_e[G>>2])+(0|_e[E+(y<<2)>>2])&3,_e[G>>2]=O,y=(0|_e[r>>2])+(0|_e[T+(y<<2)>>2])&3,_e[r>>2]=y,C=0|Ae(d,F),N=(0|_e[t>>2])+(0|_e[E+(C<<2)>>2])&3,_e[t>>2]=N,C=(0|_e[n>>2])+(0|_e[T+(C<<2)>>2])&3,_e[n>>2]=C,h=0|Ae(d,F),p=(0|_e[i>>2])+(0|_e[E+(h<<2)>>2])&3,_e[i>>2]=p,h=(0|_e[a>>2])+(0|_e[T+(h<<2)>>2])&3,_e[a>>2]=h,P=0|Ae(d,F),R=(0|_e[o>>2])+(0|_e[E+(P<<2)>>2])&3,_e[o>>2]=R,P=(0|_e[u>>2])+(0|_e[T+(P<<2)>>2])&3,_e[u>>2]=P,m=0|Ae(d,F),S=(0|_e[f>>2])+(0|_e[E+(m<<2)>>2])&3,_e[f>>2]=S,m=(0|_e[l>>2])+(0|_e[T+(m<<2)>>2])&3,_e[l>>2]=m,M=0|Ae(d,F),b=(0|_e[s>>2])+(0|_e[E+(M<<2)>>2])&3,_e[s>>2]=b,M=(0|_e[c>>2])+(0|_e[T+(M<<2)>>2])&3,_e[c>>2]=M,_e[k>>2]=(0|de[1441+g>>0])<<2|0|de[1441+L>>0]|(0|de[1441+x>>0])<<4|(0|de[1441+v>>0])<<6|(0|de[1441+O>>0])<<8|(0|de[1441+y>>0])<<10|(0|de[1441+N>>0])<<12|(0|de[1441+C>>0])<<14|(0|de[1441+p>>0])<<16|(0|de[1441+h>>0])<<18|(0|de[1441+R>>0])<<20|(0|de[1441+P>>0])<<22|(0|de[1441+S>>0])<<24|(0|de[1441+m>>0])<<26|(0|de[1441+b>>0])<<28|(0|de[1441+M>>0])<<30,!(_>>>0<=(I=I+1|0)>>>0);)k=k+4|0;_e[A>>2]=L,_e[e>>2]=g,k=1}}while(0)}else k=0;return re(F),Te=B,0|(x=k)}(e)&&(r=0|_e[n>>2],i=11):i=11,11==(0|i)){if(!((0|de[r+55>>0])<<8|0|de[r+56>>0]))return 0|(i=1);if(0|function(e){var r=0,t=0,n=0,i=0,a=0,o=0,u=0,f=0,l=0;if(Te=(l=Te)+560|0,n=(i=l)+40|0,f=l+16|0,t=0|_e[88+(e|=0)>>2],o=(0|de[t+55>>0])<<8|0|de[t+56>>0],u=e+92|0,r=(0|_e[e+4>>2])+((0|de[t+50>>0])<<8|(0|de[t+49>>0])<<16|0|de[t+51>>0])|0,!(t=(0|de[t+53>>0])<<8|(0|de[t+52>>0])<<16|0|de[t+54>>0]))return Te=l,(f=0)|f;_e[u>>2]=r,_e[e+96>>2]=r,_e[e+104>>2]=t,_e[e+100>>2]=r+t,_e[e+108>>2]=0,_e[e+112>>2]=0,_e[f+20>>2]=0,_e[f>>2]=0,_e[f+4>>2]=0,_e[f+8>>2]=0,_e[f+12>>2]=0,ce[f+16>>0]=0;e:do{if(0|V(u,f)){if(a=e+268|0,(0|(r=0|_e[(t=e+272|0)>>2]))!=(0|o)){if(r>>>0<=o>>>0){do{if((0|_e[e+276>>2])>>>0<o>>>0){if(0|X(a,o,(r+1|0)==(0|o),2,0)){r=0|_e[t>>2];break}ce[e+280>>0]=1,r=0;break e}}while(0);ne((0|_e[a>>2])+(r<<1)|0,0,o-r<<1|0)}_e[t>>2]=o}if(!o){_e[i>>2]=866,_e[i+4>>2]=910,_e[i+8>>2]=1497,Ce(n,812,i),Me(n),r=1;break}for(r=(n=e=t=0)|_e[a>>2];;){if(a=0|Ae(u,f),n=a+n&255,e=(0|Ae(u,f))+e&255,W[r>>1]=e<<8|n,o>>>0<=(t=t+1|0)>>>0){r=1;break}r=r+2|0}}else r=0}while(0);return re(f),Te=l,0|(f=r)}(e)&&0|function(e){var r,t,n,i,a,o,u,f,l,s,c,_,d,E,T,A,M,b,m,S,P,R=0,h=0,p=0,C=0,N=0,y=0,O=0,v=0,k=0,g=0,L=0,I=0,D=0,w=0,G=0,F=0,x=0,B=0,U=0,H=Te;if(Te=Te+2416|0,N=(y=H)+1904|0,B=H+1880|0,b=H+980|0,m=H+80|0,S=H+16|0,h=0|_e[(e|=0)+88>>2],A=(0|de[h+63>>0])<<8|0|de[h+64>>0],R=(0|_e[e+4>>2])+((0|de[h+58>>0])<<8|(0|de[h+57>>0])<<16|0|de[h+59>>0])|0,!(h=(0|de[h+61>>0])<<8|(0|de[h+60>>0])<<16|0|de[h+62>>0]))return Te=H,(B=0)|B;if(_e[(M=e+92|0)>>2]=R,_e[e+96>>2]=R,_e[e+104>>2]=h,_e[e+100>>2]=R+h,_e[e+108>>2]=0,_e[e+112>>2]=0,_e[B+20>>2]=0,_e[B>>2]=0,_e[B+4>>2]=0,_e[B+8>>2]=0,_e[B+12>>2]=0,(ce[B+16>>0]=0)|V(M,B)){for(R=0,p=h=-7;_e[b+(R<<2)>>2]=p,_e[m+(R<<2)>>2]=h,C=6<(0|p),225!=(0|(R=R+1|0));)h=(1&C)+h|0,p=C?-7:p+1|0;for(h=(R=S)+64|0;(0|(R=R+4|(_e[R>>2]=0)))<(0|h););C=e+284|0,h=3*A|0,R=0|_e[(p=e+288|0)>>2];e:do{if((0|R)==(0|h))O=13;else{if(R>>>0<=h>>>0){do{if((0|_e[e+292>>2])>>>0<h>>>0){if(0|X(C,h,(R+1|0)==(0|h),2,0)){R=0|_e[p>>2];break}ce[e+296>>0]=1,R=0;break e}}while(0);ne((0|_e[C>>2])+(R<<1)|0,0,h-R<<1|0)}_e[p>>2]=h,O=13}}while(0);do{if(13==(0|O)){if(!A){_e[y>>2]=866,_e[y+4>>2]=910,_e[y+8>>2]=1497,Ce(N,812,y),Me(N),R=1;break}for(_=48+S|0,d=52+S|0,E=56+S|0,T=60+S|0,R=(x=0)|_e[C>>2],h=0|_e[S>>2],p=0|_e[(r=4+S|0)>>2],C=0|_e[(t=8+S|0)>>2],e=0|_e[(n=12+S|0)>>2],N=0|_e[(i=16+S|0)>>2],y=0|_e[(a=20+S|0)>>2],O=0|_e[(o=24+S|0)>>2],v=0|_e[(u=28+S|0)>>2],k=0|_e[(f=32+S|0)>>2],g=0|_e[(l=36+S|0)>>2],L=0|_e[(s=40+S|0)>>2],I=0|_e[(c=44+S|0)>>2],F=G=w=D=0;U=0|Ae(M,B),h=h+(0|_e[b+(U<<2)>>2])&7,p=p+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),C=C+(0|_e[b+(U<<2)>>2])&7,e=e+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),N=N+(0|_e[b+(U<<2)>>2])&7,y=y+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),O=O+(0|_e[b+(U<<2)>>2])&7,v=v+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),k=k+(0|_e[b+(U<<2)>>2])&7,g=g+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),L=L+(0|_e[b+(U<<2)>>2])&7,I=I+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),D=D+(0|_e[b+(U<<2)>>2])&7,w=w+(0|_e[m+(U<<2)>>2])&7,U=0|Ae(M,B),G=G+(0|_e[b+(U<<2)>>2])&7,F=F+(0|_e[m+(U<<2)>>2])&7,U=0|de[1445+y>>0],W[R>>1]=(0|de[1445+p>>0])<<3|0|de[1445+h>>0]|(0|de[1445+C>>0])<<6|(0|de[1445+e>>0])<<9|(0|de[1445+N>>0])<<12|U<<15,P=0|de[1445+L>>0],W[R+2>>1]=(0|de[1445+O>>0])<<2|U>>>1|(0|de[1445+v>>0])<<5|(0|de[1445+k>>0])<<8|(0|de[1445+g>>0])<<11|P<<14,W[R+4>>1]=(0|de[1445+I>>0])<<1|P>>>2|(0|de[1445+D>>0])<<4|(0|de[1445+w>>0])<<7|(0|de[1445+G>>0])<<10|(0|de[1445+F>>0])<<13,!(A>>>0<=(x=x+1|0)>>>0);)R=R+6|0;_e[S>>2]=h,_e[r>>2]=p,_e[t>>2]=C,_e[n>>2]=e,_e[i>>2]=N,_e[a>>2]=y,_e[o>>2]=O,_e[u>>2]=v,_e[f>>2]=k,_e[l>>2]=g,_e[s>>2]=L,_e[c>>2]=I,_e[_>>2]=D,_e[d>>2]=w,_e[E>>2]=G,_e[T>>2]=F,R=1}}while(0)}else R=0;return re(B),Te=H,0|(U=R)}(e))return 0|(i=1)}return(i=0)|i}return _e[e+88>>2]=0,0|(i=0)}(f,e,r))return Te=_,0|(d=f);return U(f),Te=(7&f?(_e[s>>2]=866,_e[s+4>>2]=2506,_e[s+8>>2]=1232,Ce(u,812,s),Me(u)):ue(f,0,0,1,0),_),(d=0)|d}(e,r),r=a+i|0;do{if(i>>>0<r>>>0){if(!_){for(n=t;n=n+(0|ie(0|ie((l+3|0)>>>2,d),(s+3|0)>>>2))|0,(0|(i=i+1|0))!=(0|r);)s>>>=1,l>>>=1;_e[u>>2]=n;break}for(e=s,n=t;s=0|ie((l+3|0)>>>2,d),15<i>>>0|(c=0|ie(s,(e+3|0)>>>2))>>>0<8||519686845!=(0|_e[_>>2])||(function(e,r,t,n,i){r|=0,t|=0,n|=0,i|=0;var a=0,o=0,u=0,f=0,l=0,s=0;Te=(s=Te)+528|0,f=(l=s)+16|0,o=0|_e[88+(e|=0)>>2],u=(0|de[70+o+(i<<2)+1>>0])<<16|(0|de[70+o+(i<<2)>>0])<<24|(0|de[70+o+(i<<2)+2>>0])<<8|0|de[70+o+(i<<2)+3>>0],a=(a=i+1|0)>>>0<(0|de[16+o>>0])>>>0?(0|de[70+o+(a<<2)+1>>0])<<16|(0|de[70+o+(a<<2)>>0])<<24|(0|de[70+o+(a<<2)+2>>0])<<8|0|de[70+o+(a<<2)+3>>0]:0|_e[e+8>>2];if(u>>>0<a>>>0)return f=0|_e[(f=e+4|0)>>2],l=0|Y(e,f=f+u|0,l=a-u|0,r,t,n,i),Te=s;_e[l>>2]=866,_e[l+4>>2]=3694,_e[l+8>>2]=1508,Ce(f,812,l),Me(f),f=0|_e[(f=e+4|0)>>2],l=0|Y(e,f=f+u|0,l=a-u|0,r,t,n,i),Te=s}(_,u,c,s,i),n=0|_e[u>>2]),_e[u>>2]=n=n+c|0,(0|(i=i+1|0))!=(0|r);)e>>>=1,l>>>=1}}while(0);Te=(_&&519686845==(0|_e[_>>2])&&(U(_),7&_?(_e[f>>2]=866,_e[4+f>>2]=2506,_e[8+f>>2]=1232,Ce(o,812,f),Me(o)):ue(_,0,0,1,0)),E)},_memset:ne,_sbrk:me,_memcpy:K,stackAlloc:function(e){var r=Te;return Te=(Te=Te+(e|=0)|0)+15&-16,0|r},_crn_get_height:function(e,r){e|=0,r|=0;var t,n=Te;return Te=Te+48|0,_e[(t=n)>>2]=40,q(e,r,t),Te=n,0|_e[t+8>>2]},dynCall_vi:function(e,r){Je[7&(e|=0)](0|(r|=0))},getTempRet0:function(){return 0|L},_crn_get_levels:function(e,r){e|=0,r|=0;var t,n=Te;return Te=Te+48|0,_e[(t=n)>>2]=40,q(e,r,t),Te=n,0|_e[t+12>>2]},_crn_get_uncompressed_size:function(e,r,t){e|=0,r|=0,t|=0;var n,i,a,o,u=0,f=Te;switch(Te=Te+576|0,a=f+40|0,i=f+56|0,_e[(o=f)>>2]=40,q(e,r,o),n=(3+((0|_e[o+4>>2])>>>t)|0)>>>2,r=(3+((0|_e[o+8>>2])>>>t)|0)>>>2,e=0|_e[(t=o+32|0)+4>>2],0|_e[t>>2]){case 0:e?u=14:e=8;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:u=e?14:13;break;case 9:case 10:e?u=14:e=8;break;default:u=14}return 13==(0|u)?e=16:14==(0|u)&&(_e[a>>2]=866,_e[4+a>>2]=2672,_e[8+a>>2]=1251,Ce(i,812,a),Me(i),e=0),o=0|ie(0|ie(r,n),e),Te=f,0|o},_i64Add:ge,dynCall_iiii:function(e,r,t,n){return 0|ze[7&(e|=0)](0|(r|=0),0|(t|=0),0|(n|=0))},_emscripten_get_global_libc:function(){return 5072},dynCall_ii:function(e,r){return 0|$e[1&(e|=0)](0|(r|=0))},___udivdi3:Fe,_llvm_bswap_i32:xe,dynCall_viiiii:function(e,r,t,n,i,a){je[3&(e|=0)](0|(r|=0),0|(t|=0),0|(n|=0),0|(i|=0),0|(a|=0))},___cxa_can_catch:function(e,r,t){e|=0,r|=0;var n,i=Te;return Te=Te+16|0,_e[(n=i)>>2]=_e[(t|=0)>>2],(e=0|ze[7&_e[16+(0|_e[e>>2])>>2]](e,r,n))&&(_e[t>>2]=_e[n>>2]),Te=i,1&e|0},_free:F,runPostSets:function(){},dynCall_viiiiii:function(e,r,t,n,i,a,o){Qe[3&(e|=0)](0|(r|=0),0|(t|=0),0|(n|=0),0|(i|=0),0|(a|=0),0|(o|=0))},establishStackSpace:function(e,r){Te=e|=0},___uremdi3:he,___cxa_is_pointer_type:function(e){return 1&(e=(e|=0)?0!=(0|J(e,32,88,0)):0)|0},stackRestore:function(e){Te=e|=0},_malloc:I,_emscripten_replace_memory:function(e){return!(16777215&c(e)||c(e)<=16777215||2147483648<c(e))&&(ce=new n(e),W=new i(e),_e=new a(e),de=new o(e),Ee=new u(e),new f(e),new l(e),k=new s(e),!0)},dynCall_v:function(e){qe[3&(e|=0)]()},_crn_get_width:function(e,r){e|=0,r|=0;var t,n=Te;return Te=Te+48|0,_e[(t=n)>>2]=40,q(e,r,t),Te=n,0|_e[t+4>>2]},_crn_get_dxt_format:function(e,r){e|=0,r|=0;var t,n=Te;return Te=Te+48|0,_e[(t=n)>>2]=40,q(e,r,t),Te=n,0|_e[t+32>>2]}}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module.stackSave=asm.stackSave,Module.getTempRet0=asm.getTempRet0,Module._memset=asm._memset,Module.setThrew=asm.setThrew,Module._bitshift64Lshr=asm._bitshift64Lshr,Module._bitshift64Shl=asm._bitshift64Shl,Module.setTempRet0=asm.setTempRet0,Module._crn_decompress=asm._crn_decompress,Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,Module._sbrk=asm._sbrk,Module._memcpy=asm._memcpy,Module.stackAlloc=asm.stackAlloc,Module._crn_get_height=asm._crn_get_height,Module._i64Subtract=asm._i64Subtract,Module._crn_get_levels=asm._crn_get_levels,Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,Module._i64Add=asm._i64Add,Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,Module.___udivdi3=asm.___udivdi3,Module._llvm_bswap_i32=asm._llvm_bswap_i32,Module.___cxa_can_catch=asm.___cxa_can_catch;var _free=Module._free=asm._free;Module.runPostSets=asm.runPostSets,Module.establishStackSpace=asm.establishStackSpace,Module.___uremdi3=asm.___uremdi3,Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,Module.stackRestore=asm.stackRestore;var _malloc=Module._malloc=asm._malloc,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,initialStackTop;function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function r(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,0<runDependencies||(preRun(),0<runDependencies||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),r()},1)):r()))}function exit(e,r){r&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE&&process.exit(e),Module.quit(e,new ExitStatus(e)))}Module._crn_get_width=asm._crn_get_width,Module._crn_get_dxt_format=asm._crn_get_dxt_format,Module.dynCall_iiii=asm.dynCall_iiii,Module.dynCall_viiiii=asm.dynCall_viiiii,Module.dynCall_vi=asm.dynCall_vi,Module.dynCall_ii=asm.dynCall_ii,Module.dynCall_viii=asm.dynCall_viii,Module.dynCall_v=asm.dynCall_v,Module.dynCall_viiiiii=asm.dynCall_viiiiii,Module.dynCall_viiii=asm.dynCall_viiii,Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus,dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){e=e||[],ensureInitRuntime();var r=e.length+1;function t(){for(var e=0;e<3;e++)n.push(0)}var n=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];t();for(var i=0;i<r-1;i+=1)n.push(allocate(intArrayFromString(e[i]),"i8",ALLOC_NORMAL)),t();n.push(0),n=allocate(n,"i32",ALLOC_NORMAL);try{exit(Module._main(r,n,0),!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);var a=e;e&&"object"==typeof e&&e.stack&&(a=[e,e.stack]),Module.printErr("exception thrown: "+a),Module.quit(1,e)}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];function abort(r){Module.onAbort&&Module.onAbort(r),r=void 0!==r?(Module.print(r),Module.printErr(r),JSON.stringify(r)):"",ABORT=!0;var t="abort("+r+") at "+stackTrace()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";throw abortDecorators&&abortDecorators.forEach(function(e){t=e(t,r)}),t}if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);0<Module.preInit.length;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run();var crunch=Module,CRN_FORMAT={cCRNFmtInvalid:-1,cCRNFmtDXT1:0,cCRNFmtDXT3:1,cCRNFmtDXT5:2},DXT_FORMAT_MAP={},dst,dxtData;DXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT1]=PixelFormat$1.RGB_DXT1,DXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT3]=PixelFormat$1.RGBA_DXT3,DXT_FORMAT_MAP[CRN_FORMAT.cCRNFmtDXT5]=PixelFormat$1.RGBA_DXT5;var cachedDstSize=0;function arrayBufferCopy(e,r,t,n){for(var i=t/4,a=n%4,o=new Uint32Array(e.buffer,0,(n-a)/4),u=new Uint32Array(r.buffer),f=0;f<o.length;f++)u[i+f]=o[f];for(f=n-a;f<n;f++)r[t+f]=e[f]}function transcodeCRNToDXT(e,r){var t=e.byteLength,n=new Uint8Array(e),e=crunch._malloc(t);arrayBufferCopy(n,crunch.HEAPU8,e,t);var n=crunch._crn_get_dxt_format(e,t),i=DXT_FORMAT_MAP[n];if(!when.defined(i))throw new RuntimeError.RuntimeError("Unsupported compressed format.");for(var a=crunch._crn_get_levels(e,t),o=crunch._crn_get_width(e,t),u=crunch._crn_get_height(e,t),f=0,l=0;l<a;++l)f+=PixelFormat$1.compressedTextureSizeInBytes(i,o>>l,u>>l);cachedDstSize<f&&(when.defined(dst)&&crunch._free(dst),dst=crunch._malloc(f),dxtData=new Uint8Array(crunch.HEAPU8.buffer,dst,f),cachedDstSize=f),crunch._crn_decompress(e,t,dst,f,0,a),crunch._free(e);t=PixelFormat$1.compressedTextureSizeInBytes(i,o,u),e=dxtData.subarray(0,t),t=new Uint8Array(t);return t.set(e,0),r.push(t.buffer),new CompressedTextureBuffer(i,o,u,t)}var transcodeCRNToDXT$1=createTaskProcessorWorker(transcodeCRNToDXT);return transcodeCRNToDXT$1}); diff --git a/public/Cesium/Workers/transferTypedArrayTest.js b/public/Cesium/Workers/transferTypedArrayTest.js index 0a6642b..7783baa 100644 --- a/public/Cesium/Workers/transferTypedArrayTest.js +++ b/public/Cesium/Workers/transferTypedArrayTest.js @@ -1 +1 @@ -"undefined"==typeof self&&(self={}),self.onmessage=function(e){var s=e.data.array,a=self.webkitPostMessage||self.postMessage;try{a({array:s},[s.buffer])}catch(e){a({})}}; \ No newline at end of file +"undefined"==typeof self&&(self={}),self.onmessage=function(s){var e=s.data.array,s=self.webkitPostMessage||self.postMessage;try{s({array:e},[e.buffer])}catch(e){s({})}}; \ No newline at end of file diff --git a/public/Cesium/Workers/upsampleQuantizedTerrainMesh.js b/public/Cesium/Workers/upsampleQuantizedTerrainMesh.js index 943e815..fcb0926 100644 --- a/public/Cesium/Workers/upsampleQuantizedTerrainMesh.js +++ b/public/Cesium/Workers/upsampleQuantizedTerrainMesh.js @@ -1 +1 @@ -define(["./AttributeCompression-f02ec82f","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./when-208fe5b0","./TerrainEncoding-73cbc4e6","./IndexDatatype-d47ad6f6","./Check-d18af7c4","./Math-4e53b694","./OrientedBoundingBox-18b4901f","./createTaskProcessorWorker","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(s,oe,ae,c,pe,de,e,fe,le,t,i,n,r,h,u,o){"use strict";var ge={clipTriangleAtAxisAlignedThreshold:function(e,t,i,n,s,r){var h,u;c.defined(r)?r.length=0:r=[];var o,a,p,d,f,l,g=t?(h=i<e,u=n<e,s<e):(h=e<i,u=e<n,e<s),t=h+u+g;return 1===t?h?(o=(e-i)/(n-i),a=(e-i)/(s-i),r.push(1),r.push(2),1!==a&&(r.push(-1),r.push(0),r.push(2),r.push(a)),1!==o&&(r.push(-1),r.push(0),r.push(1),r.push(o))):u?(p=(e-n)/(s-n),d=(e-n)/(i-n),r.push(2),r.push(0),1!==d&&(r.push(-1),r.push(1),r.push(0),r.push(d)),1!==p&&(r.push(-1),r.push(1),r.push(2),r.push(p))):g&&(f=(e-s)/(i-s),l=(e-s)/(n-s),r.push(0),r.push(1),1!==l&&(r.push(-1),r.push(2),r.push(1),r.push(l)),1!==f&&(r.push(-1),r.push(2),r.push(0),r.push(f))):2===t?h||i===e?u||n===e?g||s===e||(a=(e-i)/(s-i),p=(e-n)/(s-n),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(a),r.push(-1),r.push(1),r.push(2),r.push(p)):(l=(e-s)/(n-s),o=(e-i)/(n-i),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(l),r.push(-1),r.push(0),r.push(1),r.push(o)):(d=(e-n)/(i-n),f=(e-s)/(i-s),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(d),r.push(-1),r.push(2),r.push(0),r.push(f)):3!==t&&(r.push(0),r.push(1),r.push(2)),r},computeBarycentricCoordinates:function(e,t,i,n,s,r,h,u,o){var a=i-h,i=h-s,s=r-u,r=n-u,n=1/(s*a+i*r),u=t-u,h=e-h,i=(s*h+i*u)*n,u=(-r*h+a*u)*n,n=1-i-u;return c.defined(o)?(o.x=i,o.y=u,o.z=n,o):new ae.Cartesian3(i,u,n)},computeLineSegmentLineSegmentIntersection:function(e,t,i,n,s,r,h,u,o){var a=(h-s)*(t-r)-(u-r)*(e-s),p=(i-e)*(t-r)-(n-t)*(e-s),s=(u-r)*(i-e)-(h-s)*(n-t);if(0!=s){a=a/s,s=p/s;return 0<=a&&a<=1&&0<=s&&s<=1?((o=!c.defined(o)?new ae.Cartesian2:o).x=e+a*(i-e),o.y=t+a*(n-t),o):void 0}}},ce=32767,me=16383,xe=[],we=[],Ce=[],ve=new ae.Cartographic,ye=new ae.Cartesian3,Be=[],Ie=[],be=[],Ae=[],Te=[],ze=new ae.Cartesian3,Me=new oe.BoundingSphere,Ne=new le.OrientedBoundingBox,Ve=new ae.Cartesian2,Ee=new ae.Cartesian3;function Re(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}Re.prototype.clone=function(e){return(e=!c.defined(e)?new Re:e).uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},Re.prototype.initializeIndexed=function(e,t,i,n,s){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=i,this.normalBuffer=n,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},Re.prototype.initializeFromClipResult=function(e,t,i){var n=t+1;return-1!==e[t]?i[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=i[e[n]],++n,this.second=i[e[n]],++n,this.ratio=e[n],++n),n},Re.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},Re.prototype.isIndexed=function(){return c.defined(this.index)},Re.prototype.getH=function(){return c.defined(this.index)?this.heightBuffer[this.index]:fe.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},Re.prototype.getU=function(){return c.defined(this.index)?this.uBuffer[this.index]:fe.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},Re.prototype.getV=function(){return c.defined(this.index)?this.vBuffer[this.index]:fe.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};var a=new ae.Cartesian2,p=-1,d=[new ae.Cartesian3,new ae.Cartesian3],f=[new ae.Cartesian3,new ae.Cartesian3];function l(e,t){var i=d[++p],n=f[p],i=s.AttributeCompression.octDecode(e.first.getNormalX(),e.first.getNormalY(),i),n=s.AttributeCompression.octDecode(e.second.getNormalX(),e.second.getNormalY(),n);return ye=ae.Cartesian3.lerp(i,n,e.ratio,ye),ae.Cartesian3.normalize(ye,ye),s.AttributeCompression.octEncode(ye,t),--p,t}Re.prototype.getNormalX=function(){return c.defined(this.index)?this.normalBuffer[2*this.index]:(a=l(this,a)).x},Re.prototype.getNormalY=function(){return c.defined(this.index)?this.normalBuffer[2*this.index+1]:(a=l(this,a)).y};var m=[];function He(e,t,i,n,s,r,h,u,o){if(0!==h.length){for(var a=0,p=0;p<h.length;)p=m[a++].initializeFromClipResult(h,p,u);for(var d=0;d<a;++d){var f,l,g=m[d];g.isIndexed()?(g.newIndex=r[g.index],g.uBuffer=e,g.vBuffer=t,g.heightBuffer=i,o&&(g.normalBuffer=n)):(f=g.getKey(),c.defined(r[f])?g.newIndex=r[f]:(l=e.length,e.push(g.getU()),t.push(g.getV()),i.push(g.getH()),o&&(n.push(g.getNormalX()),n.push(g.getNormalY())),g.newIndex=l,r[f]=l))}3===a?(s.push(m[0].newIndex),s.push(m[1].newIndex),s.push(m[2].newIndex)):4===a&&(s.push(m[0].newIndex),s.push(m[1].newIndex),s.push(m[2].newIndex),s.push(m[0].newIndex),s.push(m[2].newIndex),s.push(m[3].newIndex))}}return m.push(new Re),m.push(new Re),m.push(new Re),m.push(new Re),t(function(e,t){var i=e.isEastChild,n=e.isNorthChild,s=i?me:0,r=i?ce:me,h=n?me:0,u=n?ce:me,o=Be,a=Ie,p=be,d=Te;o.length=0,a.length=0,p.length=0,d.length=0;var f=Ae;f.length=0;for(var l={},g=e.vertices,c=(c=e.indices).subarray(0,e.indexCountWithoutSkirts),m=pe.TerrainEncoding.clone(e.encoding),x=m.hasVertexNormals,w=e.exaggeration,C=0,v=e.vertexCountWithoutSkirts,y=e.minimumHeight,B=e.maximumHeight,I=new Array(v),b=new Array(v),A=new Array(v),T=x?new Array(2*v):void 0,z=0,M=0;z<v;++z,M+=2){var N=m.decodeTextureCoordinates(g,z,Ve),V=m.decodeHeight(g,z)/w,E=fe.CesiumMath.clamp(N.x*ce|0,0,ce),R=fe.CesiumMath.clamp(N.y*ce|0,0,ce);A[z]=fe.CesiumMath.clamp((V-y)/(B-y)*ce|0,0,ce),ce-(E=E<20?0:E)<20&&(E=ce),ce-(R=R<20?0:R)<20&&(R=ce),I[z]=E,b[z]=R,x&&(N=m.getOctEncodedNormal(g,z,Ee),T[M]=N.x,T[M+1]=N.y),(i&&me<=E||!i&&E<=me)&&(n&&me<=R||!n&&R<=me)&&(l[z]=C,o.push(E),a.push(R),p.push(A[z]),x&&(d.push(T[M]),d.push(T[M+1])),++C)}var H=[];H.push(new Re),H.push(new Re),H.push(new Re);var O=[];for(O.push(new Re),O.push(new Re),O.push(new Re),z=0;z<c.length;z+=3){var S=c[z],U=c[z+1],F=c[z+2],P=I[S],k=I[U],D=I[F];H[0].initializeIndexed(I,b,A,T,S),H[1].initializeIndexed(I,b,A,T,U),H[2].initializeIndexed(I,b,A,T,F);k=ge.clipTriangleAtAxisAlignedThreshold(me,i,P,k,D,xe);k.length<=0||(D=O[0].initializeFromClipResult(k,0,H))>=k.length||(D=O[1].initializeFromClipResult(k,D,H))>=k.length||(D=O[2].initializeFromClipResult(k,D,H),He(o,a,p,d,f,l,ge.clipTriangleAtAxisAlignedThreshold(me,n,O[0].getV(),O[1].getV(),O[2].getV(),we),O,x),D<k.length&&(O[2].clone(O[1]),O[2].initializeFromClipResult(k,D,H),He(o,a,p,d,f,l,ge.clipTriangleAtAxisAlignedThreshold(me,n,O[0].getV(),O[1].getV(),O[2].getV(),we),O,x)))}var W=i?-ce:0,X=n?-ce:0,K=[],L=[],Y=[],_=[],G=Number.MAX_VALUE,J=-G,Z=Ce;Z.length=0;var j=ae.Ellipsoid.clone(e.ellipsoid),q=(ue=ae.Rectangle.clone(e.childRectangle)).north,Q=ue.south,$=ue.east,ee=ue.west;for($<ee&&($+=fe.CesiumMath.TWO_PI),z=0;z<o.length;++z)E=(E=Math.round(o[z]))<=s?(K.push(z),0):r<=E?(Y.push(z),ce):2*E+W,o[z]=E,R=(R=Math.round(a[z]))<=h?(L.push(z),0):u<=R?(_.push(z),ce):2*R+X,a[z]=R,(V=fe.CesiumMath.lerp(y,B,p[z]/ce))<G&&(G=V),J<V&&(J=V),p[z]=V,ve.longitude=fe.CesiumMath.lerp(ee,$,E/ce),ve.latitude=fe.CesiumMath.lerp(Q,q,R/ce),ve.height=V,j.cartographicToCartesian(ve,ye),Z.push(ye.x),Z.push(ye.y),Z.push(ye.z);var te=oe.BoundingSphere.fromVertices(Z,ae.Cartesian3.ZERO,3,Me),ie=le.OrientedBoundingBox.fromRectangle(ue,G,J,j,Ne),e=new pe.EllipsoidalOccluder(j).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(te.center,Z,3,te.center,G,ze),ne=J-G,se=new Uint16Array(o.length+a.length+p.length);for(z=0;z<o.length;++z)se[z]=o[z];var re=o.length;for(z=0;z<a.length;++z)se[re+z]=a[z];for(re+=a.length,z=0;z<p.length;++z)se[re+z]=ce*(p[z]-G)/ne;var he,ue=de.IndexDatatype.createTypedArray(o.length,f);return x?(he=new Uint8Array(d),t.push(se.buffer,ue.buffer,he.buffer),he=he.buffer):t.push(se.buffer,ue.buffer),{vertices:se.buffer,encodedNormals:he,indices:ue.buffer,minimumHeight:G,maximumHeight:J,westIndices:K,southIndices:L,eastIndices:Y,northIndices:_,boundingSphere:te,orientedBoundingBox:ie,horizonOcclusionPoint:e}})}); +define(["./AttributeCompression-10c27d9c","./Transforms-79117a7b","./Cartesian2-8646c5a1","./when-54335d57","./TerrainEncoding-c552e269","./IndexDatatype-82ceea78","./Check-24483042","./Math-d6182036","./OrientedBoundingBox-eb360dc3","./createTaskProcessorWorker","./RuntimeError-88a32665","./ComponentDatatype-1a100acd","./WebGLConstants-95ceb4e9","./EllipsoidTangentPlane-325a8e68","./IntersectionTests-5394f658","./Plane-13ae4b1b"],function(s,oe,ae,g,pe,de,e,le,fe,t,i,n,r,h,u,o){"use strict";var ce={clipTriangleAtAxisAlignedThreshold:function(e,t,i,n,s,r){var h,u;g.defined(r)?r.length=0:r=[];var o,a,p,d,l,f,c=t?(h=i<e,u=n<e,s<e):(h=e<i,u=e<n,e<s),t=h+u+c;return 1===t?h?(o=(e-i)/(n-i),a=(e-i)/(s-i),r.push(1),r.push(2),1!==a&&(r.push(-1),r.push(0),r.push(2),r.push(a)),1!==o&&(r.push(-1),r.push(0),r.push(1),r.push(o))):u?(p=(e-n)/(s-n),d=(e-n)/(i-n),r.push(2),r.push(0),1!==d&&(r.push(-1),r.push(1),r.push(0),r.push(d)),1!==p&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(l=(e-s)/(i-s),f=(e-s)/(n-s),r.push(0),r.push(1),1!==f&&(r.push(-1),r.push(2),r.push(1),r.push(f)),1!==l&&(r.push(-1),r.push(2),r.push(0),r.push(l))):2===t?h||i===e?u||n===e?c||s===e||(a=(e-i)/(s-i),p=(e-n)/(s-n),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(a),r.push(-1),r.push(1),r.push(2),r.push(p)):(f=(e-s)/(n-s),o=(e-i)/(n-i),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(f),r.push(-1),r.push(0),r.push(1),r.push(o)):(d=(e-n)/(i-n),l=(e-s)/(i-s),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(d),r.push(-1),r.push(2),r.push(0),r.push(l)):3!==t&&(r.push(0),r.push(1),r.push(2)),r},computeBarycentricCoordinates:function(e,t,i,n,s,r,h,u,o){var a=i-h,i=h-s,s=r-u,r=n-u,n=1/(s*a+i*r),u=t-u,h=e-h,i=(s*h+i*u)*n,u=(-r*h+a*u)*n,n=1-i-u;return g.defined(o)?(o.x=i,o.y=u,o.z=n,o):new ae.Cartesian3(i,u,n)},computeLineSegmentLineSegmentIntersection:function(e,t,i,n,s,r,h,u,o){var a=(h-s)*(t-r)-(u-r)*(e-s),p=(i-e)*(t-r)-(n-t)*(e-s),s=(u-r)*(i-e)-(h-s)*(n-t);if(0!=s){a=a/s,s=p/s;return 0<=a&&a<=1&&0<=s&&s<=1?((o=!g.defined(o)?new ae.Cartesian2:o).x=e+a*(i-e),o.y=t+a*(n-t),o):void 0}}},ge=32767,me=16383,xe=[],we=[],Ce=[],ve=new ae.Cartographic,ye=new ae.Cartesian3,Be=[],Ie=[],Ae=[],be=[],Te=[],ze=new ae.Cartesian3,Me=new oe.BoundingSphere,Ne=new fe.OrientedBoundingBox,Ve=new ae.Cartesian2,Ee=new ae.Cartesian3;function Re(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}Re.prototype.clone=function(e){return(e=!g.defined(e)?new Re:e).uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},Re.prototype.initializeIndexed=function(e,t,i,n,s){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=i,this.normalBuffer=n,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},Re.prototype.initializeFromClipResult=function(e,t,i){var n=t+1;return-1!==e[t]?i[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=i[e[n]],this.second=i[e[++n]],this.ratio=e[++n],++n),n},Re.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},Re.prototype.isIndexed=function(){return g.defined(this.index)},Re.prototype.getH=function(){return g.defined(this.index)?this.heightBuffer[this.index]:le.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},Re.prototype.getU=function(){return g.defined(this.index)?this.uBuffer[this.index]:le.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},Re.prototype.getV=function(){return g.defined(this.index)?this.vBuffer[this.index]:le.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};var a=new ae.Cartesian2,p=-1,d=[new ae.Cartesian3,new ae.Cartesian3],l=[new ae.Cartesian3,new ae.Cartesian3];function f(e,t){var i=d[++p],n=l[p],i=s.AttributeCompression.octDecode(e.first.getNormalX(),e.first.getNormalY(),i),n=s.AttributeCompression.octDecode(e.second.getNormalX(),e.second.getNormalY(),n);return ye=ae.Cartesian3.lerp(i,n,e.ratio,ye),ae.Cartesian3.normalize(ye,ye),s.AttributeCompression.octEncode(ye,t),--p,t}Re.prototype.getNormalX=function(){return g.defined(this.index)?this.normalBuffer[2*this.index]:(a=f(this,a)).x},Re.prototype.getNormalY=function(){return g.defined(this.index)?this.normalBuffer[2*this.index+1]:(a=f(this,a)).y};var m=[];function He(e,t,i,n,s,r,h,u,o){if(0!==h.length){for(var a=0,p=0;p<h.length;)p=m[a++].initializeFromClipResult(h,p,u);for(var d=0;d<a;++d){var l,f,c=m[d];c.isIndexed()?(c.newIndex=r[c.index],c.uBuffer=e,c.vBuffer=t,c.heightBuffer=i,o&&(c.normalBuffer=n)):(l=c.getKey(),g.defined(r[l])?c.newIndex=r[l]:(f=e.length,e.push(c.getU()),t.push(c.getV()),i.push(c.getH()),o&&(n.push(c.getNormalX()),n.push(c.getNormalY())),c.newIndex=f,r[l]=f))}3===a?(s.push(m[0].newIndex),s.push(m[1].newIndex),s.push(m[2].newIndex)):4===a&&(s.push(m[0].newIndex),s.push(m[1].newIndex),s.push(m[2].newIndex),s.push(m[0].newIndex),s.push(m[2].newIndex),s.push(m[3].newIndex))}}return m.push(new Re),m.push(new Re),m.push(new Re),m.push(new Re),t(function(e,t){var i=e.isEastChild,n=e.isNorthChild,s=i?me:0,r=i?ge:me,h=n?me:0,u=n?ge:me,o=Be,a=Ie,p=Ae,d=Te;o.length=0,a.length=0,p.length=0,d.length=0;var l=be;l.length=0;for(var f={},c=e.vertices,g=(g=e.indices).subarray(0,e.indexCountWithoutSkirts),m=pe.TerrainEncoding.clone(e.encoding),x=m.hasVertexNormals,w=e.exaggeration,C=0,v=e.vertexCountWithoutSkirts,y=e.minimumHeight,B=e.maximumHeight,I=new Array(v),A=new Array(v),b=new Array(v),T=x?new Array(2*v):void 0,z=0,M=0;z<v;++z,M+=2){var N=m.decodeTextureCoordinates(c,z,Ve),V=m.decodeHeight(c,z)/w,E=le.CesiumMath.clamp(N.x*ge|0,0,ge),R=le.CesiumMath.clamp(N.y*ge|0,0,ge);b[z]=le.CesiumMath.clamp((V-y)/(B-y)*ge|0,0,ge),ge-(E=E<20?0:E)<20&&(E=ge),ge-(R=R<20?0:R)<20&&(R=ge),I[z]=E,A[z]=R,x&&(N=m.getOctEncodedNormal(c,z,Ee),T[M]=N.x,T[M+1]=N.y),(i&&me<=E||!i&&E<=me)&&(n&&me<=R||!n&&R<=me)&&(f[z]=C,o.push(E),a.push(R),p.push(b[z]),x&&(d.push(T[M]),d.push(T[M+1])),++C)}var H=[];H.push(new Re),H.push(new Re),H.push(new Re);var O=[];for(O.push(new Re),O.push(new Re),O.push(new Re),z=0;z<g.length;z+=3){var S=g[z],U=g[z+1],F=g[z+2],P=I[S],k=I[U],D=I[F];H[0].initializeIndexed(I,A,b,T,S),H[1].initializeIndexed(I,A,b,T,U),H[2].initializeIndexed(I,A,b,T,F);k=ce.clipTriangleAtAxisAlignedThreshold(me,i,P,k,D,xe);k.length<=0||(D=O[0].initializeFromClipResult(k,0,H))>=k.length||(D=O[1].initializeFromClipResult(k,D,H))>=k.length||(D=O[2].initializeFromClipResult(k,D,H),He(o,a,p,d,l,f,ce.clipTriangleAtAxisAlignedThreshold(me,n,O[0].getV(),O[1].getV(),O[2].getV(),we),O,x),D<k.length&&(O[2].clone(O[1]),O[2].initializeFromClipResult(k,D,H),He(o,a,p,d,l,f,ce.clipTriangleAtAxisAlignedThreshold(me,n,O[0].getV(),O[1].getV(),O[2].getV(),we),O,x)))}var W=i?-ge:0,X=n?-ge:0,K=[],L=[],Y=[],_=[],G=Number.MAX_VALUE,J=-G,Z=Ce;Z.length=0;var j=ae.Ellipsoid.clone(e.ellipsoid),q=(ue=ae.Rectangle.clone(e.childRectangle)).north,Q=ue.south,$=ue.east,ee=ue.west;for($<ee&&($+=le.CesiumMath.TWO_PI),z=0;z<o.length;++z)E=(E=Math.round(o[z]))<=s?(K.push(z),0):r<=E?(Y.push(z),ge):2*E+W,o[z]=E,R=(R=Math.round(a[z]))<=h?(L.push(z),0):u<=R?(_.push(z),ge):2*R+X,a[z]=R,(V=le.CesiumMath.lerp(y,B,p[z]/ge))<G&&(G=V),J<V&&(J=V),p[z]=V,ve.longitude=le.CesiumMath.lerp(ee,$,E/ge),ve.latitude=le.CesiumMath.lerp(Q,q,R/ge),ve.height=V,j.cartographicToCartesian(ve,ye),Z.push(ye.x),Z.push(ye.y),Z.push(ye.z);var te=oe.BoundingSphere.fromVertices(Z,ae.Cartesian3.ZERO,3,Me),ie=fe.OrientedBoundingBox.fromRectangle(ue,G,J,j,Ne),e=new pe.EllipsoidalOccluder(j).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(te.center,Z,3,te.center,G,ze),ne=J-G,se=new Uint16Array(o.length+a.length+p.length);for(z=0;z<o.length;++z)se[z]=o[z];var re=o.length;for(z=0;z<a.length;++z)se[re+z]=a[z];for(re+=a.length,z=0;z<p.length;++z)se[re+z]=ge*(p[z]-G)/ne;var he,ue=de.IndexDatatype.createTypedArray(o.length,l);return x?(he=new Uint8Array(d),t.push(se.buffer,ue.buffer,he.buffer),he=he.buffer):t.push(se.buffer,ue.buffer),{vertices:se.buffer,encodedNormals:he,indices:ue.buffer,minimumHeight:G,maximumHeight:J,westIndices:K,southIndices:L,eastIndices:Y,northIndices:_,boundingSphere:te,orientedBoundingBox:ie,horizonOcclusionPoint:e}})}); diff --git a/public/Cesium/Workers/when-208fe5b0.js b/public/Cesium/Workers/when-54335d57.js similarity index 77% rename from public/Cesium/Workers/when-208fe5b0.js rename to public/Cesium/Workers/when-54335d57.js index dd7839b..c9e97a4 100644 --- a/public/Cesium/Workers/when-208fe5b0.js +++ b/public/Cesium/Workers/when-54335d57.js @@ -1 +1 @@ -define(["exports"],function(n){"use strict";function r(n,r){return null!=n?n:r}var t,e,h;function j(n,r,t,e){return l(n).then(r,t,e)}function l(n){var r,t,n=n instanceof a?n:u(n)?(r=m(),n.then(function(n){r.resolve(n)},function(n){r.reject(n)},function(n){r.progress(n)}),r.promise):(t=n,new a(function(n){try{return l(n?n(t):t)}catch(n){return p(n)}}));return n}function a(n){this.then=n}function p(t){return new a(function(n,r){try{return r?l(r(t)):p(t)}catch(n){return p(n)}})}function m(){var n=new a(u),i=[],c=[],e=function(r,t,e){var u=m(),o="function"==typeof e?function(n){try{u.progress(e(n))}catch(n){u.progress(n)}}:function(n){u.progress(n)};return i.push(function(n){n.then(r,t).then(u.resolve,u.reject,o)}),c.push(o),u.promise},r=function(n){return v(c,n),n},t=function(n){return n=l(n),e=n.then,t=l,r=w,v(i,n),c=i=h,n};return{then:u,resolve:o,reject:f,progress:s,promise:n,resolver:{resolve:o,reject:f,progress:s}};function u(n,r,t){return e(n,r,t)}function o(n){return t(n)}function f(n){return t(p(n))}function s(n){return r(n)}}function u(n){return n&&"function"==typeof n.then}function o(n,p,v,g,y){return f(2,arguments),j(n,function(n){var r,t,e,u,o=n.length>>>0,i=Math.max(0,Math.min(p,o)),c=[],f=o-i+1,s=[],h=m();if(i)for(e=h.progress,t=function(n){s.push(n),--f||(r=t=w,h.reject(s))},r=function(n){c.push(n),--i||(r=t=w,h.resolve(c))},u=0;u<o;++u)u in n&&j(n[u],a,l,e);else h.resolve(c);return h.then(v,g,y);function l(n){t(n)}function a(n){r(n)}})}function i(n,r,t,e){return f(1,arguments),c(n,s).then(r,t,e)}function c(n,c){return j(n,function(n){var r,t,e,u=r=n.length>>>0,o=[],i=m();if(u)for(t=function(n,r){j(n,c).then(function(n){o[r]=n,--u||i.resolve(o)},i.reject)},e=0;e<r;e++)e in n?t(n[e],e):--u;else i.resolve(o);return i.promise})}function v(n,r){for(var t,e=0;t=n[e++];)t(r)}function f(n,r){for(var t,e=r.length;n<e;)if(null!=(t=r[--e])&&"function"!=typeof t)throw new Error("arg "+e+" must be a function")}function w(){}function s(n){return n}r.EMPTY_OBJECT=Object.freeze({}),j.defer=m,j.resolve=l,j.reject=function(n){return j(n,p)},j.join=function(){return c(arguments,s)},j.all=i,j.map=c,j.reduce=function(n,o){var r=e.call(arguments,1);return j(n,function(n){var u=n.length;return r[0]=function(n,t,e){return j(n,function(r){return j(t,function(n){return o(r,n,e,u)})})},t.apply(n,r)})},j.any=function(n,r,t,e){return o(n,1,function(n){return r?r(n[0]):n[0]},t,e)},j.some=o,j.chain=function(n,r,t){var e=2<arguments.length;return j(n,function(n){return n=e?t:n,r.resolve(n),n},function(n){return r.reject(n),p(n)},r.progress)},j.isPromise=u,a.prototype={always:function(n,r){return this.then(n,n,r)},otherwise:function(n){return this.then(h,n)},yield:function(n){return this.then(function(){return n})},spread:function(r){return this.then(function(n){return i(n,function(n){return r.apply(h,n)})})}},e=[].slice,t=[].reduce||function(n){var r,t=0,e=Object(this),u=e.length>>>0,o=arguments;if(o.length<=1)for(;;){if(t in e){r=e[t++];break}if(++t>=u)throw new TypeError}else r=o[1];for(;t<u;++t)t in e&&(r=n(r,e[t],t,e));return r},n.defaultValue=r,n.defined=function(n){return null!=n},n.when=j}); +define(["exports"],function(n){"use strict";function r(n,r){return null!=n?n:r}var t,e,h;function j(n,r,t,e){return l(n).then(r,t,e)}function l(n){var r,t,n=n instanceof a?n:u(n)?(r=m(),n.then(function(n){r.resolve(n)},function(n){r.reject(n)},function(n){r.progress(n)}),r.promise):(t=n,new a(function(n){try{return l(n?n(t):t)}catch(n){return p(n)}}));return n}function a(n){this.then=n}function p(t){return new a(function(n,r){try{return r?l(r(t)):p(t)}catch(n){return p(n)}})}function m(){var n=new a(u),i=[],c=[],e=function(r,t,e){var u=m(),o="function"==typeof e?function(n){try{u.progress(e(n))}catch(n){u.progress(n)}}:function(n){u.progress(n)};return i.push(function(n){n.then(r,t).then(u.resolve,u.reject,o)}),c.push(o),u.promise},r=function(n){return v(c,n),n},t=function(n){return n=l(n),e=n.then,t=l,r=w,v(i,n),c=i=h,n};return{then:u,resolve:o,reject:f,progress:s,promise:n,resolver:{resolve:o,reject:f,progress:s}};function u(n,r,t){return e(n,r,t)}function o(n){return t(n)}function f(n){return t(p(n))}function s(n){return r(n)}}function u(n){return n&&"function"==typeof n.then}function o(n,p,v,g,y){return f(2,arguments),j(n,function(n){var r,t,e,u,o=n.length>>>0,i=Math.max(0,Math.min(p,o)),c=[],f=o-i+1,s=[],h=m();if(i)for(e=h.progress,t=function(n){s.push(n),--f||(r=t=w,h.reject(s))},r=function(n){c.push(n),--i||(r=t=w,h.resolve(c))},u=0;u<o;++u)u in n&&j(n[u],a,l,e);else h.resolve(c);return h.then(v,g,y);function l(n){t(n)}function a(n){r(n)}})}function i(n,r,t,e){return f(1,arguments),c(n,s).then(r,t,e)}function c(n,c){return j(n,function(n){var r,t,e,u=r=n.length>>>0,o=[],i=m();if(u)for(t=function(n,r){j(n,c).then(function(n){o[r]=n,--u||i.resolve(o)},i.reject)},e=0;e<r;e++)e in n?t(n[e],e):--u;else i.resolve(o);return i.promise})}function v(n,r){for(var t,e=0;t=n[e++];)t(r)}function f(n,r){for(var t,e=r.length;n<e;)if(null!=(t=r[--e])&&"function"!=typeof t)throw new Error("arg "+e+" must be a function")}function w(){}function s(n){return n}r.EMPTY_OBJECT=Object.freeze({}),j.defer=m,j.resolve=l,j.reject=function(n){return j(n,p)},j.join=function(){return c(arguments,s)},j.all=i,j.map=c,j.reduce=function(n,o){var r=e.call(arguments,1);return j(n,function(n){var u=n.length;return r[0]=function(n,t,e){return j(n,function(r){return j(t,function(n){return o(r,n,e,u)})})},t.apply(n,r)})},j.any=function(n,r,t,e){return o(n,1,function(n){return r?r(n[0]):n[0]},t,e)},j.some=o,j.chain=function(n,r,t){var e=2<arguments.length;return j(n,function(n){return r.resolve(n=e?t:n),n},function(n){return r.reject(n),p(n)},r.progress)},j.isPromise=u,a.prototype={always:function(n,r){return this.then(n,n,r)},otherwise:function(n){return this.then(h,n)},yield:function(n){return this.then(function(){return n})},spread:function(r){return this.then(function(n){return i(n,function(n){return r.apply(h,n)})})}},e=[].slice,t=[].reduce||function(n){var r,t=0,e=Object(this),u=e.length>>>0,o=arguments;if(o.length<=1)for(;;){if(t in e){r=e[t++];break}if(++t>=u)throw new TypeError}else r=o[1];for(;t<u;++t)t in e&&(r=n(r,e[t],t,e));return r},n.defaultValue=r,n.defined=function(n){return null!=n},n.when=j}); diff --git a/public/favicon.ico b/public/favicon.ico index f3865b0389e4e89f23ac810783d5f071d4d43b8c..df36fcfb72584e00488330b560ebcf34a41c64c2 100644 GIT binary patch literal 4286 zcmds*O-Phc6o&64GDVCEQHxsW(p4>LW*W<827=Unuo8sGpRux(DN@jWP-e29Wl%wj zY84_aq9}^Am9-cWTD5GGEo#+5Fi2wX_P*bo+xO!)p*7B;iKlbFd(U~_d(U?#hLj56 zPhFkj-|A6~Qk#@g^#D^U0XT1cu=c-vu1+SElX9NR;kzAUV(q0|dl0|%h|dI$%VICy zJnu2^L*Te9JrJMGh%-P79CL0}dq92RGU6gI{v2~|)p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kev<ISBgE$F{SFy+(=9Z)f)De0Se}ZDZW}Z3B zElCeVrw;K0Fdl_Cg=gZOFXXc3pL)Q05CAuT+XucQ<8g~3dteP~|7s7c6QYP;fy;mF zMN;>tV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?<QnEgvj4i?s}Yk=qA2z`-^*<eK3c)MS4JOdbsTQEOa0) z0NWqlna2rzs>5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7<X*Er!BfRbvU93$DH%#v6dRt^6HBxz1xBNHx=$&_Gv<&J}Ljk zJN<Fzx(`Oe@KgQ0F$<14=XV#WK`o#6Ku>z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{T<?%b6i9IjI)Ls)S{-*mq<@~R{?$}ZKjf;^k75i_}(2MXt}^SEBVg7AI@28 zo_uPg2V)_e-`2Ois=PYoe%9u*n9({PFR)OnHJPi{dNx>Kx<YG`4QQ>D#iCLfl2<BD h7L=-;Q>vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S literal 4286 zcmbuDYgAO%700hl(xy#Q)AwVo#C+_h<U^~*l~`b<iAf+UjnRlnN=h^~tN4ypgn)>m ziRM*TOl?sjhC&sPm&^bWHAW+fh#IQ~5h2Vlyk}r$7zSqUKmUEW7ac(g$#wl^U(aLj zefHV=oV(DpN&I*J{hIu0|Gh`kexYgFZwZ^Ua3byMVc$>h8e*tn;=ceigWD;;Zy@ig zec~F&o?+^xypudg7LxZ#KKX=H81K@yfIL8C?6>mAoKJZ-nM;aDdmtFpoqcXJcDLeU zTa%)p%YiO$F9w4FUB(z==TQETOxO=&&Lqkiq?q{HJuX-;S0k-58-LAvAM>)(Fgr5^ z&ywdq-iU?!-a$&m9u!_U4tq~0bY1sxp7{I_5nW>k+US*W<PIWnw)ObD$UpxX7UjK% zr*<ad@qfo-R{B~zA?!>rSgYEkPul*ncPsYPe1c9-4^_ZMWM4$*m_A6qF>W=b`%0%B z3DyieNu6R-<ajXsTVC`b&b3^nD!9oia!ViBr}l~RHR3tf(tuZU-^JtU@#C^NnqRXx z_oeJNaqQX!s#HEKq8yPAW*g-nNK0LZ4GU>o=8vX#B5e|j7qT~_##Tqwu#=f2#0TU5 z_fVF*d>+JGc73aL-|U~P<8S-7!O`1A6R?uWMCF1=gBZ$zoZ7?RXx*|-vGYW_<jTmn zN&k)$B?#)epLSll!LHbsI;~)Bqx{Qiyk7DzJhdxv+_9IOm-S_wvLL-G7fEHi@pML# zss%F^QZMuWlZGoDvIQt7cM)^#Qs+*ho}PX$wjC=Rmwj1Ra(O1&-94~5zd&AX5;{B% zWYtt6D&vh19TJz!({fy*n@lIB{S|s}5T5#@3IzOcG7qHoMvJAnCh2=E{~!3u*^WT4 zpSIUwy)_KS8?xaW9KhR0aykEc-OBhC#s7rIFGmxW8TRFD+CAuQM@vZpY`II(drA4I zVimjh?GPQNZHedHJsVKfbV+pKi)%<>cnRX@A?N(dckrLz~-)rG?vv*C2DEd2Y(t z%_oD1?H`bX{q1$I?_UYqzQt%MS_5B;s#zSWKZ|E~r*JQ?uS0x@WPV7l%7O3dxQO)1 zXk|Oq5}{=2g?HE&M6JD^`@Tt?moiWC;&k(uoTct9vHfFms?T;7w!CFr{}TEThqj8% z80>9BK-aPBl=Y^4T#HSWIq(kn5%hMU^0PJAP!@*dePLLh@-WsP2*;L#QMlTEQtYTZ zA<D={$?L=Q=cKucNX`F*RQEO4Ubk=f&~+jM`k)VzkCM}Jz6+A;HdiMQ7(m16op{f} zxR*s>S<=IJIdUr2d@vKK<zdMBJPtl@JNg5Ic=u?&+6So>i76j(PS!59ccj1d672aa zhSo3kg*@iM#WHpSa>uSL-l6Wk8rv1s)>~JJ+yirID;$ZLVTheQ4S$|B6^mjYLP}vc z(#pb7Rl803Dfg$;$pYS!|7&fM`G<(q;B6#(z-8yY$J6fO>pn;>6s|^}O~p&qL?`cg z*>k_+B5F#P;4SN;NG**(+_D*nq3zhnX^44pDpqcKMESMd8VN@ok38<9n|a^ncJT}f zQUkKccZk$rV$knJ+rcer@73DP7|;htX)-)lkE^{7db{Dhb^^_oWPDT-h17}&tl2&j zF;P>o{P{<aneZnph?<U9=1oIVP8c>YHYJuA#?gv^yAAq4AI+&}Eq~4Wf0XYY*V+9e z?W<g1OqiSEhof{I?0L&^sNh9x<esl92*<0j(;4^QBReG;&BbqEYg{B=eC&5vym|)D zgK%uM{t>nN7s64T0C(MCG43G|#I!FtSmp1iSMd(n12Yb$AB;yc_vm=R%di&DN6E+Y zkhAVN<ZYaf*7N1ieNNOJ%|TA`9PCY-150i+tVQ#2CjS+s+uy0a2R^4g$vxA)NI3)b z?vr~)kHL+8@ZC;YcvdO$mY}sH9s|y1ssSXI9R(}V!u&PINKJQFXF(tOMl{d98}Gp1 zaB8*akQmE36p{xw*&o@r6x}B?A$8n&Y)9x^+HSS1hvYaPsk>j3;cqc{H<&}&>uo#< zd%>!2;DhAJ($INahrQtM@HSObHG0TwqU;Sjz!#%UzRxx?NQ3UWL!9?|sILDT1LNE< z$0^&Z_#ycz>yH;4kV<YBTcbVFPUL(4Lj(f>sWZocB>E5+dM=pyZz&lE&XIcYHl8wV ze_-ey&Gc}a;lqz8-y|M?cN4l!>@s3OKa?*wt<&^F`iSgZSJg+%$FHbDeRpo66rIC% z#(I%)<h$era$XM%=#taU(>Z7@PgDBUKC82GXwSu_^f_yCnE#g{b2#@Li6)|JER!Sp zWW2!?%0zOWd*~1Ndf@MDV4k1hnRrYg@6r}zAJ17o$BNwqavxE8Mi>}pgE4;+<*&#y zWDBv7Gvu;?yq6N`lQF*}GH0At#y3p#8Qe+vb8@f2&nTsB!fQqU6yCnP0$G9qO$+PS wv?(r4o7|{r-xH2#+HFD#|BPUw-QqF(MIJHcH5z(Er|1?NVhbq@k83i%1}O7D761SM diff --git a/src/App.vue b/src/App.vue index 4e8e541..5c53ebf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,15 +1,18 @@ <template> - <!-- <img alt="Vue logo" src="./assets/logo.png" /> --> - <div id="app"> - <HelloWorld msg="Hello Vue 3 + Vite" /> - </div> + <!-- <img alt="Vue logo" src="./assets/logo.png"> --> + <HelloWorld msg="Hello Vue 3 + TypeScript + Vite" /> </template> -<script setup> +<script lang="ts"> +import { defineComponent } from 'vue' import HelloWorld from './components/HelloWorld.vue' -// This starter template is using Vue 3 experimental <script setup> SFCs -// Check out https://github.com/vuejs/rfcs/blob/script-setup-2/active-rfcs/0000-script-setup.md +export default defineComponent({ + name: 'App', + components: { + HelloWorld + } +}) </script> <style> @@ -19,7 +22,10 @@ import HelloWorld from './components/HelloWorld.vue' -moz-osx-font-smoothing: grayscale; text-align: center; color: #2c3e50; - height: 100vh; /* margin-top: 60px; */ + width: 100%; + height: 100%; + margin: 0; + overflow: hidden; } </style> diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue index fa5e09e..b143210 100644 --- a/src/components/HelloWorld.vue +++ b/src/components/HelloWorld.vue @@ -2,30 +2,122 @@ <!-- <h1>{{ msg }}</h1> <p> - <a href="https://vitejs.dev/guide/features.html" target="_blank">Vite Documentation</a> | - <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a> + Recommended IDE setup: + <a href="https://code.visualstudio.com/" target="_blank">VSCode</a> + + + <a + href="https://marketplace.visualstudio.com/items?itemName=octref.vetur" + target="_blank" + > + Vetur + </a> + or + <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a> + (if using + <code><script setup></code>) </p> - <button @click="state.count++">count is: {{ state.count }}</button> + <p>See <code>README.md</code> for more information.</p> + + <p> + <a href="https://vitejs.dev/guide/features.html" target="_blank"> + Vite Docs + </a> + | + <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a> + </p> + + <button @click="count++">count is: {{ count }}</button> <p> Edit <code>components/HelloWorld.vue</code> to test hot module replacement. </p> --> - <vc-viewer></vc-viewer> + <div class="home viewer"> + <vc-viewer @ready="onViewerReady"> + <vc-entity + ref="entity" + :billboard="billboard" + :position="{ lng: 108, lat: 32 }" + :point="point" + :label="label" + @click="onEntityEvt" + @mouseover="onEntityEvt" + @mouseout="onEntityEvt" + > + <vc-graphics-rectangle + :coordinates="[130, 20, 80, 25]" + material="green" + /> + </vc-entity> + <vc-layer-imagery> + <vc-provider-imagery-osm /> + </vc-layer-imagery> + <vc-navigation /> + </vc-viewer> + </div> </template> -<script setup> -import { defineProps, reactive } from 'vue' - -defineProps({ - msg: String +<script lang="ts"> +import { ref, defineComponent } from 'vue' +export default defineComponent({ + name: 'HelloWorld', + props: { + msg: { + type: String, + required: true, + }, + }, + setup: () => { + const count = ref(0) + const point = { + pixelSize: 28, + color: 'red', + } + const label = { + text: 'Hello VueCesium', + pixelOffset: [0, 80], + fillColor: 'red', + } + const billboard = ref({ + image: 'https://zouyaoji.top/vue-cesium/favicon.png', + scale: 0.5, + }) + const onEntityEvt = e => { + console.log(e) + if (e.type === 'onmouseover') { + billboard.value = { + image: 'https://zouyaoji.top/vue-cesium/favicon.png', + scale: 0.6 + } + } else if (e.type === 'onmouseout') { + billboard.value = { + image: 'https://zouyaoji.top/vue-cesium/favicon.png', + scale: 0.5 + } + } + } + return { count, point, label, billboard, onEntityEvt } + }, }) - -const state = reactive({ count: 0 }) </script> <style scoped> a { color: #42b983; } + +label { + margin: 0 0.5em; + font-weight: bold; +} + +code { + background-color: #eee; + padding: 2px 4px; + border-radius: 4px; + color: #304455; +} +.viewer { + height: 100vh; +} </style> diff --git a/src/main.js b/src/main.js deleted file mode 100644 index 82aea9c..0000000 --- a/src/main.js +++ /dev/null @@ -1,15 +0,0 @@ -import { createApp } from 'vue' -import VueCesium from 'vue-cesium' -import 'vue-cesium/lib/theme-default/index.css' -import App from './App.vue' - -// ts -// if (typeof (window as any).global === 'undefined') { -// (window as any).global = window; -// } - -window.global = window - -createApp(App).use(VueCesium, { - cesiumPath: './Cesium/Cesium.js' -}).mount('#app') diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..d72157e --- /dev/null +++ b/src/main.ts @@ -0,0 +1,18 @@ +import { createApp } from 'vue' +import App from './App.vue' +import VueCesium from 'vue-cesium' +import 'vue-cesium/lib/theme-default/index.css' + +if (typeof (window as any).global === 'undefined') { + (window as any).global = window +} +const app = createApp(App) +app.use(VueCesium, { + // cesiumPath 是指引用的Cesium.js路径,如 + // cesiumPath: /static/Cesium/Cesium.js + // cesiumPath: 'https://unpkg.com/cesium/Build/Cesium/Cesium.js' + cesiumPath: './Cesium/Cesium.js', + // 使用Cesium ion的数据源需要到https://cesium.com/ion/申请一个账户,获取Access Token。不指定的话可能导致 CesiumIon 的在线影像、地形加载失败 + // accessToken: 'Your Cesium Ion defaultAccessToken' +}) +app.mount('#app') diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts new file mode 100644 index 0000000..ac1ded7 --- /dev/null +++ b/src/shims-vue.d.ts @@ -0,0 +1,5 @@ +declare module '*.vue' { + import { DefineComponent } from 'vue' + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/src/vue-cesium.d.ts b/src/vue-cesium.d.ts new file mode 100644 index 0000000..fc110ee --- /dev/null +++ b/src/vue-cesium.d.ts @@ -0,0 +1,42445 @@ +declare module '*.vue' { + import { App, defineComponent } from 'vue' + const component: ReturnType<typeof defineComponent> & { + install(app: App): void + } + export default component +} + +declare type Nullable<T> = T | null; + +declare type CustomizedHTMLElement<T> = HTMLElement & T + +declare type Indexable<T> = { + [key: string]: T +} + +declare type Hash<T> = Indexable<T> + +declare type TimeoutHandle = ReturnType<typeof global.setTimeout> +declare namespace Cesium { + function createDefaultImageryProviderViewModels (): Array<ProviderViewModel> + function createDefaultTerrainProviderViewModels (): Array<ProviderViewModel> + function sprintf (...args: any[]): string + function appendForwardSlash (url: string): string + const knockout: any + const when: any + const Uri: any + interface Viewer { + viewerWidgetResized?: Event + _selectionIndicator?: SelectionIndicator + _infoBox?: InfoBox + _geocoder?: Geocoder + _homeButton?: HomeButton + _sceneModePicker?: SceneModePicker + _projectionPicker?: ProjectionPicker + _baseLayerPicker?: BaseLayerPicker + _baseLayerPickerDropDown?: Element + _navigationHelpButton?: NavigationHelpButton + _animation?: Animation + _timeline?: Timeline + _fullscreenButton?: FullscreenButton + _vrButton?: VRButton + _terrainExaggeration: number + _eventHelper?: EventHelper + _toolbar?: Element + _onInfoBoxCameraClicked?(val: InfoBoxViewModel): void + _onInfoBoxClockClicked?(val: InfoBoxViewModel): void + _clearObjects?: () => void + _clearTrackedObject?(val: InfoBoxViewModel): void + } + + interface Timeline { + makeLabel?(time: JulianDate): string + addEventListener?(type, listener, useCapture): void + } + + interface Scene { + frameState: any + _performanceDisplay: any + } + + interface Globe { + pickTriangle?(ray: Ray, scene: Scene, projection: MapProjection, cullBackFaces: boolean): { + intersection: Cartesian3 + v0: Cartesian3 + v1: Cartesian3 + v2: Cartesian3 + } | undefined + } + + class GlobeSurfaceTile { + pickTriangle?(ray: Ray, mode: SceneMode, projection: MapProjection, cullBackFaces: boolean): { + intersection: Cartesian3 + v0: Cartesian3 + v1: Cartesian3 + v2: Cartesian3 + } | undefined + } + + interface ImageryLayer { + /** + * Specify the relative order of the layers. + */ + sortOrder?: number + } + + interface ImageryLayerCollection { + _layers: ImageryLayer[] + _update (): void + } + + + // eslint-disable-next-line no-var + var SuperMapImageryProvider: any + // eslint-disable-next-line no-var + var TiandituImageryProvider: any + // eslint-disable-next-line no-var + var BaiduMapImageryProvider: any +} + +// eslint-disable-next-line no-var +declare var XE: any +// eslint-disable-next-line no-var +declare var XbsjCesium: any +// eslint-disable-next-line no-var +declare var XbsjEarth: any +/* eslint-disable */ +declare namespace Cesium { + +/** + * Private interfaces to support PropertyBag being a dictionary-like object. + */ +interface DictionaryLike { + [index: string]: any +} + +/** + * Enum containing WebGL Constant values by name. +for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context +(For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}). + +These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/} +and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/} +specifications. + */ +export enum WebGLConstants { + 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 = 34000, + 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_RGB_ETC1_WEBGL = 36196, + 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 = 33000, + 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 +}/** + * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps +retrieved from Elevation Tiles of an an ArcGIS ImageService. + * @example + * var terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({ + url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer', + token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..' +}); +viewer.terrainProvider = terrainProvider; + + + * @param options - Object with the following properties: + * @param options.url - The URL of the ArcGIS ImageServer service. + * @param [options.token] - The authorization token to use to connect to the service. + * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified, + this parameter is ignored and the tiling scheme's ellipsoid is used instead. + If neither parameter is specified, the WGS84 ellipsoid is used. + */ +export class ArcGISTiledElevationTerrainProvider { + constructor(options: { + url: Resource | string | Promise<Resource> | Promise<string> + token?: string + ellipsoid?: Ellipsoid + }); + /** + * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + errorEvent: Event; + /** + * Gets the credit to display when this terrain provider is active. Typically this is used to credit + the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. + */ + credit: Credit; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. + */ + tilingScheme: GeographicTilingScheme; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets a value indicating whether or not the provider includes a water mask. The water mask + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. + */ + hasWaterMask: boolean; + /** + * Gets a value indicating whether or not the requested tiles include vertex normals. + This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true. + */ + hasVertexNormals: boolean; + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + at points and in rectangles. This function should not be called before + {@link TerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. + */ + availability: TileAvailability; + /** + * Requests the geometry for a given tile. This function should not be called before + {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain + data and indicates that all child tiles are available. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the requested geometry. If this method + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. + */ + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined; + /** + * Gets the maximum geometric error allowed in a tile at a given level. + * @param level - The tile level for which to get the maximum geometric error. + * @returns The maximum geometric error. + */ + getLevelMaximumGeometricError(level: number): number; + /** + * Determines whether data for a tile is available to be loaded. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if not supported, otherwise true or false. + */ + getTileDataAvailable(x: number, y: number, level: number): boolean; + /** + * Makes sure we load availability data for a tile + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + */ + loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>; +} + +/** + * ArcType defines the path that should be taken connecting vertices. + */ +export enum ArcType { + /** + * Straight line that does not conform to the surface of the ellipsoid. + */ + NONE = 0, + /** + * Follow geodesic path. + */ + GEODESIC = 1, + /** + * Follow rhumb or loxodrome path. + */ + RHUMB = 2 +} + +/** + * A collection of key-value pairs that is stored as a hash for easy +lookup but also provides an array for fast iteration. + */ +export class AssociativeArray { + constructor(); + /** + * Gets the number of items in the collection. + */ + length: number; + /** + * Gets an unordered array of all values in the collection. + This is a live array that will automatically reflect the values in the collection, + it should not be modified directly. + */ + values: any[]; + /** + * Determines if the provided key is in the array. + * @param key - The key to check. + * @returns <code>true</code> if the key is in the array, <code>false</code> otherwise. + */ + contains(key: string | number): boolean; + /** + * Associates the provided key with the provided value. If the key already + exists, it is overwritten with the new value. + * @param key - A unique identifier. + * @param value - The value to associate with the provided key. + */ + set(key: string | number, value: any): void; + /** + * Retrieves the value associated with the provided key. + * @param key - The key whose value is to be retrieved. + * @returns The associated value, or undefined if the key does not exist in the collection. + */ + get(key: string | number): any; + /** + * Removes a key-value pair from the collection. + * @param key - The key to be removed. + * @returns True if it was removed, false if the key was not in the collection. + */ + remove(key: string | number): boolean; + /** + * Clears the collection. + */ + removeAll(): void; +} + +/** + * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes. + * @param [minimum = Cartesian3.ZERO] - The minimum point along the x, y, and z axes. + * @param [maximum = Cartesian3.ZERO] - The maximum point along the x, y, and z axes. + * @param [center] - The center of the box; automatically computed if not supplied. + */ +export class AxisAlignedBoundingBox { + constructor(minimum?: Cartesian3, maximum?: Cartesian3, center?: Cartesian3); + /** + * The minimum point defining the bounding box. + */ + minimum: Cartesian3; + /** + * The maximum point defining the bounding box. + */ + maximum: Cartesian3; + /** + * The center point of the bounding box. + */ + center: Cartesian3; + /** + * Computes an instance of an AxisAlignedBoundingBox. The box is determined by + finding the points spaced the farthest apart on the x, y, and z axes. + * @example + * // Compute an axis aligned bounding box enclosing two points. + var box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]); + * @param positions - List of points that the bounding box will enclose. Each point must have a <code>x</code>, <code>y</code>, and <code>z</code> properties. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided. + */ + static fromPoints(positions: Cartesian3[], result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + /** + * Duplicates a AxisAlignedBoundingBox instance. + * @param box - The bounding box to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined) + */ + static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + /** + * Compares the provided AxisAlignedBoundingBox componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first AxisAlignedBoundingBox. + * @param [right] - The second AxisAlignedBoundingBox. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: AxisAlignedBoundingBox, right?: AxisAlignedBoundingBox): boolean; + /** + * Determines which side of a plane a box is located. + * @param box - The bounding box to test. + * @param plane - The plane to test against. + * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane + the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is + on the opposite side, and {@link Intersect.INTERSECTING} if the box + intersects the plane. + */ + static intersectPlane(box: AxisAlignedBoundingBox, plane: Plane): Intersect; + /** + * Duplicates this AxisAlignedBoundingBox instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided. + */ + clone(result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + /** + * Determines which side of a plane this box is located. + * @param plane - The plane to test against. + * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane + the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is + on the opposite side, and {@link Intersect.INTERSECTING} if the box + intersects the plane. + */ + intersectPlane(plane: Plane): Intersect; + /** + * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side AxisAlignedBoundingBox. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: AxisAlignedBoundingBox): boolean; +} + +/** + * Computes the barycentric coordinates for a point with respect to a triangle. + * @example + * // Returns Cartesian3.UNIT_X +var p = new Cesium.Cartesian3(-1.0, 0.0, 0.0); +var b = Cesium.barycentricCoordinates(p, + new Cesium.Cartesian3(-1.0, 0.0, 0.0), + new Cesium.Cartesian3( 1.0, 0.0, 0.0), + new Cesium.Cartesian3( 0.0, 1.0, 1.0)); + * @param point - The point to test. + * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis. + * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis. + * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ +export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3; + +/** + * Finds an item in a sorted array. + * @example + * // Create a comparator function to search through an array of numbers. +function comparator(a, b) { + return a - b; +}; +var numbers = [0, 2, 4, 6, 8]; +var index = Cesium.binarySearch(numbers, 6, comparator); // 3 + * @param array - The sorted array to search. + * @param itemToFind - The item to find in the array. + * @param comparator - The function to use to compare the item to + elements in the array. + * @returns The index of <code>itemToFind</code> in the array, if it exists. If <code>itemToFind</code> + does not exist, the return value is a negative number which is the bitwise complement (~) + of the index before which the itemToFind should be inserted in order to maintain the + sorted order of the array. + */ +export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number; + +/** + * A function used to compare two items while performing a binary search. + * @example + * function compareNumbers(a, b) { + return a - b; +} + * @param a - An item in the array. + * @param b - The item being searched for. + */ +export type binarySearchComparator = (a: any, b: any) => number; + +/** + * Provides geocoding through Bing Maps. + * @param options - Object with the following properties: + * @param options.key - A key to use with the Bing Maps geocoding service + */ +export class BingMapsGeocoderService { + constructor(options: { + key: string + }); + /** + * The URL endpoint for the Bing geocoder service + */ + readonly url: string; + /** + * The key for the Bing geocoder service + */ + readonly key: string; + /** + * @param query - The query to be sent to the geocoder service + */ + geocode(query: string): Promise<GeocoderService.Result[]>; +} + +/** + * A bounding rectangle given by a corner, width and height. + * @param [x = 0.0] - The x coordinate of the rectangle. + * @param [y = 0.0] - The y coordinate of the rectangle. + * @param [width = 0.0] - The width of the rectangle. + * @param [height = 0.0] - The height of the rectangle. + */ +export class BoundingRectangle { + constructor(x?: number, y?: number, width?: number, height?: number); + /** + * The x coordinate of the rectangle. + */ + x: number; + /** + * The y coordinate of the rectangle. + */ + y: number; + /** + * The width of the rectangle. + */ + width: number; + /** + * The height of the rectangle. + */ + height: number; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: BoundingRectangle, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: BoundingRectangle): BoundingRectangle; + /** + * Computes a bounding rectangle enclosing the list of 2D points. + The rectangle is oriented with the corner at the bottom left. + * @param positions - List of points that the bounding rectangle will enclose. Each point must have <code>x</code> and <code>y</code> properties. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. + */ + static fromPoints(positions: Cartesian2[], result?: BoundingRectangle): BoundingRectangle; + /** + * Computes a bounding rectangle from a rectangle. + * @param rectangle - The valid rectangle used to create a bounding rectangle. + * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. + */ + static fromRectangle(rectangle: Rectangle, projection?: any, result?: BoundingRectangle): BoundingRectangle; + /** + * Duplicates a BoundingRectangle instance. + * @param rectangle - The bounding rectangle to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined) + */ + static clone(rectangle: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle; + /** + * Computes a bounding rectangle that is the union of the left and right bounding rectangles. + * @param left - A rectangle to enclose in bounding rectangle. + * @param right - A rectangle to enclose in a bounding rectangle. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. + */ + static union(left: BoundingRectangle, right: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle; + /** + * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point. + * @param rectangle - A rectangle to expand. + * @param point - A point to enclose in a bounding rectangle. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. + */ + static expand(rectangle: BoundingRectangle, point: Cartesian2, result?: BoundingRectangle): BoundingRectangle; + /** + * Determines if two rectangles intersect. + * @param left - A rectangle to check for intersection. + * @param right - The other rectangle to check for intersection. + * @returns <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise. + */ + static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect; + /** + * Compares the provided BoundingRectangles componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first BoundingRectangle. + * @param [right] - The second BoundingRectangle. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: BoundingRectangle, right?: BoundingRectangle): boolean; + /** + * Duplicates this BoundingRectangle instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. + */ + clone(result?: BoundingRectangle): BoundingRectangle; + /** + * Determines if this rectangle intersects with another. + * @param right - A rectangle to check for intersection. + * @returns <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise. + */ + intersect(right: BoundingRectangle): Intersect; + /** + * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side BoundingRectangle. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: BoundingRectangle): boolean; +} + +/** + * A bounding sphere with a center and a radius. + * @param [center = Cartesian3.ZERO] - The center of the bounding sphere. + * @param [radius = 0.0] - The radius of the bounding sphere. + */ +export class BoundingSphere { + constructor(center?: Cartesian3, radius?: number); + /** + * The center point of the sphere. + */ + center: Cartesian3; + /** + * The radius of the sphere. + */ + radius: number; + /** + * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points. + The bounding sphere is computed by running two algorithms, a naive algorithm and + Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit. + * @param [positions] - An array of points that the bounding sphere will enclose. Each point must have <code>x</code>, <code>y</code>, and <code>z</code> properties. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if one was not provided. + */ + static fromPoints(positions?: Cartesian3[], result?: BoundingSphere): BoundingSphere; + /** + * Computes a bounding sphere from a rectangle projected in 2D. + * @param [rectangle] - The rectangle around which to create a bounding sphere. + * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static fromRectangle2D(rectangle?: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere; + /** + * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the + object's minimum and maximum heights over the rectangle. + * @param [rectangle] - The rectangle around which to create a bounding sphere. + * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D. + * @param [minimumHeight = 0.0] - The minimum height over the rectangle. + * @param [maximumHeight = 0.0] - The maximum height over the rectangle. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static fromRectangleWithHeights2D(rectangle?: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere; + /** + * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points + on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids. + * @param [rectangle] - The valid rectangle used to create a bounding sphere. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle. + * @param [surfaceHeight = 0.0] - The height above the surface of the ellipsoid. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static fromRectangle3D(rectangle?: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere; + /** + * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are + stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two + algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to + ensure a tight fit. + * @example + * // Compute the bounding sphere from 3 positions, each specified relative to a center. + // In addition to the X, Y, and Z coordinates, the points array contains two additional + // elements per point which are ignored for the purpose of computing the bounding sphere. + var center = new Cesium.Cartesian3(1.0, 2.0, 3.0); + var points = [1.0, 2.0, 3.0, 0.1, 0.2, + 4.0, 5.0, 6.0, 0.1, 0.2, + 7.0, 8.0, 9.0, 0.1, 0.2]; + var sphere = Cesium.BoundingSphere.fromVertices(points, center, 5); + * @param [positions] - An array of points that the bounding sphere will enclose. Each point + is formed from three elements in the array in the order X, Y, Z. + * @param [center = Cartesian3.ZERO] - The position to which the positions are relative, which need not be the + origin of the coordinate system. This is useful when the positions are to be used for + relative-to-center (RTC) rendering. + * @param [stride = 3] - The number of array elements per vertex. It must be at least 3, but it may + be higher. Regardless of the value of this parameter, the X coordinate of the first position + is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index + 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If + the stride is 5, however, two array elements are skipped and the next position begins at array + index 5. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if one was not provided. + */ + static fromVertices(positions?: number[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere; + /** + * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are + stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two + algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to + ensure a tight fit. + * @param [positionsHigh] - An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point + is formed from three elements in the array in the order X, Y, Z. + * @param [positionsLow] - An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point + is formed from three elements in the array in the order X, Y, Z. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if one was not provided. + */ + static fromEncodedCartesianVertices(positionsHigh?: number[], positionsLow?: number[], result?: BoundingSphere): BoundingSphere; + /** + * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere + tighly and fully encompases the box. + * @example + * // Create a bounding sphere around the unit cube + var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); + * @param [corner] - The minimum height over the rectangle. + * @param [oppositeCorner] - The maximum height over the rectangle. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static fromCornerPoints(corner?: Cartesian3, oppositeCorner?: Cartesian3, result?: BoundingSphere): BoundingSphere; + /** + * Creates a bounding sphere encompassing an ellipsoid. + * @example + * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); + * @param ellipsoid - The ellipsoid around which to create a bounding sphere. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static fromEllipsoid(ellipsoid: Ellipsoid, result?: BoundingSphere): BoundingSphere; + /** + * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres. + * @param [boundingSpheres] - The array of bounding spheres. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static fromBoundingSpheres(boundingSpheres?: BoundingSphere[], result?: BoundingSphere): BoundingSphere; + /** + * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box. + * @param orientedBoundingBox - The oriented bounding box. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static fromOrientedBoundingBox(orientedBoundingBox: OrientedBoundingBox, result?: BoundingSphere): BoundingSphere; + /** + * Duplicates a BoundingSphere instance. + * @param sphere - The bounding sphere to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined) + */ + static clone(sphere: BoundingSphere, result?: BoundingSphere): BoundingSphere; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: BoundingSphere): BoundingSphere; + /** + * Computes a bounding sphere that contains both the left and right bounding spheres. + * @param left - A sphere to enclose in a bounding sphere. + * @param right - A sphere to enclose in a bounding sphere. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static union(left: BoundingSphere, right: BoundingSphere, result?: BoundingSphere): BoundingSphere; + /** + * Computes a bounding sphere by enlarging the provided sphere to contain the provided point. + * @param sphere - A sphere to expand. + * @param point - A point to enclose in a bounding sphere. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static expand(sphere: BoundingSphere, point: Cartesian3, result?: BoundingSphere): BoundingSphere; + /** + * Determines which side of a plane a sphere is located. + * @param sphere - The bounding sphere to test. + * @param plane - The plane to test against. + * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane + the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is + on the opposite side, and {@link Intersect.INTERSECTING} if the sphere + intersects the plane. + */ + static intersectPlane(sphere: BoundingSphere, plane: Plane): Intersect; + /** + * Applies a 4x4 affine transformation matrix to a bounding sphere. + * @param sphere - The bounding sphere to apply the transformation to. + * @param transform - The transformation matrix to apply to the bounding sphere. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static transform(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere; + /** + * Computes the estimated distance squared from the closest point on a bounding sphere to a point. + * @example + * // Sort bounding spheres from back to front + spheres.sort(function(a, b) { + return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC); + }); + * @param sphere - The sphere. + * @param cartesian - The point + * @returns The estimated distance squared from the bounding sphere to the point. + */ + static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number; + /** + * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale + The transformation matrix is not verified to have a uniform scale of 1. + This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}. + * @example + * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid); + var boundingSphere = new Cesium.BoundingSphere(); + var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); + * @param sphere - The bounding sphere to apply the transformation to. + * @param transform - The transformation matrix to apply to the bounding sphere. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere; + /** + * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction + plus/minus the radius of the bounding sphere. + <br> + If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the + closest and farthest planes from position that intersect the bounding sphere. + * @param sphere - The bounding sphere to calculate the distance to. + * @param position - The position to calculate the distance from. + * @param direction - The direction from position. + * @param [result] - A Interval to store the nearest and farthest distances. + * @returns The nearest and farthest distances on the bounding sphere from position in direction. + */ + static computePlaneDistances(sphere: BoundingSphere, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval; + /** + * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates. + * @param sphere - The bounding sphere to transform to 2D. + * @param [projection = GeographicProjection] - The projection to 2D. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + static projectTo2D(sphere: BoundingSphere, projection?: any, result?: BoundingSphere): BoundingSphere; + /** + * Determines whether or not a sphere is hidden from view by the occluder. + * @param sphere - The bounding sphere surrounding the occludee object. + * @param occluder - The occluder. + * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>. + */ + static isOccluded(sphere: BoundingSphere, occluder: Occluder): boolean; + /** + * Compares the provided BoundingSphere componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first BoundingSphere. + * @param [right] - The second BoundingSphere. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: BoundingSphere, right?: BoundingSphere): boolean; + /** + * Determines which side of a plane the sphere is located. + * @param plane - The plane to test against. + * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane + the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is + on the opposite side, and {@link Intersect.INTERSECTING} if the sphere + intersects the plane. + */ + intersectPlane(plane: Plane): Intersect; + /** + * Computes the estimated distance squared from the closest point on a bounding sphere to a point. + * @example + * // Sort bounding spheres from back to front + spheres.sort(function(a, b) { + return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC); + }); + * @param cartesian - The point + * @returns The estimated distance squared from the bounding sphere to the point. + */ + distanceSquaredTo(cartesian: Cartesian3): number; + /** + * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction + plus/minus the radius of the bounding sphere. + <br> + If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the + closest and farthest planes from position that intersect the bounding sphere. + * @param position - The position to calculate the distance from. + * @param direction - The direction from position. + * @param [result] - A Interval to store the nearest and farthest distances. + * @returns The nearest and farthest distances on the bounding sphere from position in direction. + */ + computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval; + /** + * Determines whether or not a sphere is hidden from view by the occluder. + * @param occluder - The occluder. + * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>. + */ + isOccluded(occluder: Occluder): boolean; + /** + * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side BoundingSphere. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: BoundingSphere): boolean; + /** + * Duplicates this BoundingSphere instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new BoundingSphere instance if none was provided. + */ + clone(result?: BoundingSphere): BoundingSphere; + /** + * Computes the radius of the BoundingSphere. + * @returns The radius of the BoundingSphere. + */ + volume(): number; +} + +/** + * Describes a cube centered at the origin. + * @example + * var box = new Cesium.BoxGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0), + minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0) +}); +var geometry = Cesium.BoxGeometry.createGeometry(box); + * @param options - Object with the following properties: + * @param options.minimum - The minimum x, y, and z coordinates of the box. + * @param options.maximum - The maximum x, y, and z coordinates of the box. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ +export class BoxGeometry { + constructor(options: { + minimum: Cartesian3 + maximum: Cartesian3 + vertexFormat?: VertexFormat + }); + /** + * Creates a cube centered at the origin given its dimensions. + * @example + * var box = Cesium.BoxGeometry.fromDimensions({ + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0) + }); + var geometry = Cesium.BoxGeometry.createGeometry(box); + * @param options - Object with the following properties: + * @param options.dimensions - The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ + static fromDimensions(options: { + dimensions: Cartesian3 + vertexFormat?: VertexFormat + }): BoxGeometry; + /** + * Creates a cube from the dimensions of an AxisAlignedBoundingBox. + * @example + * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ])); + var box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb); + * @param boundingBox - A description of the AxisAlignedBoundingBox. + */ + static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxGeometry; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: BoxGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new BoxGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: BoxGeometry): BoxGeometry; + /** + * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere. + * @param boxGeometry - A description of the box. + * @returns The computed vertices and indices. + */ + static createGeometry(boxGeometry: BoxGeometry): Geometry | undefined; +} + +/** + * A description of the outline of a cube centered at the origin. + * @example + * var box = new Cesium.BoxOutlineGeometry({ + maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0), + minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0) +}); +var geometry = Cesium.BoxOutlineGeometry.createGeometry(box); + * @param options - Object with the following properties: + * @param options.minimum - The minimum x, y, and z coordinates of the box. + * @param options.maximum - The maximum x, y, and z coordinates of the box. + */ +export class BoxOutlineGeometry { + constructor(options: { + minimum: Cartesian3 + maximum: Cartesian3 + }); + /** + * Creates an outline of a cube centered at the origin given its dimensions. + * @example + * var box = Cesium.BoxOutlineGeometry.fromDimensions({ + dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0) + }); + var geometry = Cesium.BoxOutlineGeometry.createGeometry(box); + * @param options - Object with the following properties: + * @param options.dimensions - The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively. + */ + static fromDimensions(options: { + dimensions: Cartesian3 + }): BoxOutlineGeometry; + /** + * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox. + * @example + * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ])); + var box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb); + + + * @param boundingBox - A description of the AxisAlignedBoundingBox. + */ + static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxOutlineGeometry; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: BoxOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new BoxOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: BoxOutlineGeometry): BoxOutlineGeometry; + /** + * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere. + * @param boxGeometry - A description of the box outline. + * @returns The computed vertices and indices. + */ + static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry | undefined; +} + +/** + * Given a relative URL under the Cesium base URL, returns an absolute URL. + * @example + * var viewer = new Cesium.Viewer("cesiumContainer", { + imageryProvider: new Cesium.TileMapServiceImageryProvider({ + url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"), + }), + baseLayerPicker: false, +}); + * @param relativeUrl - The relative path. + * @returns The absolutely URL representation of the provided path. + */ +export function buildModuleUrl(relativeUrl: string): string; + +/** + * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}. + * @param requestID - The value returned by {@link requestAnimationFrame}. + */ +export function cancelAnimationFrame(requestID: number): void; + +/** + * A 2D Cartesian point. + * @param [x = 0.0] - The X component. + * @param [y = 0.0] - The Y component. + */ +export class Cartesian2 { + constructor(x?: number, y?: number); + /** + * The X component. + */ + x: number; + /** + * The Y component. + */ + y: number; + /** + * Creates a Cartesian2 instance from x and y coordinates. + * @param x - The x coordinate. + * @param y - The y coordinate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. + */ + static fromElements(x: number, y: number, result?: Cartesian2): Cartesian2; + /** + * Duplicates a Cartesian2 instance. + * @param cartesian - The Cartesian to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined) + */ + static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2; + /** + * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the + x and y properties of the Cartesian3 and drops z. + * @param cartesian - The Cartesian3 instance to create a Cartesian2 instance from. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. + */ + static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; + /** + * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the + x and y properties of the Cartesian4 and drops z and w. + * @param cartesian - The Cartesian4 instance to create a Cartesian2 instance from. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. + */ + static fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Cartesian2, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2; + /** + * Flattens an array of Cartesian2s into and array of components. + * @param array - The array of cartesians to pack. + * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements. + * @returns The packed array. + */ + static packArray(array: Cartesian2[], result?: number[]): number[]; + /** + * Unpacks an array of cartesian components into and array of Cartesian2s. + * @param array - The array of components to unpack. + * @param [result] - The array onto which to store the result. + * @returns The unpacked array. + */ + static unpackArray(array: number[], result?: Cartesian2[]): Cartesian2[]; + /** + * Creates a Cartesian2 from two consecutive elements in an array. + * @example + * // Create a Cartesian2 with (1.0, 2.0) + var v = [1.0, 2.0]; + var p = Cesium.Cartesian2.fromArray(v); + + // Create a Cartesian2 with (1.0, 2.0) using an offset into an array + var v2 = [0.0, 0.0, 1.0, 2.0]; + var p2 = Cesium.Cartesian2.fromArray(v2, 2); + * @param array - The array whose two consecutive elements correspond to the x and y components, respectively. + * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. + */ + static fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2; + /** + * Computes the value of the maximum component for the supplied Cartesian. + * @param cartesian - The cartesian to use. + * @returns The value of the maximum component. + */ + static maximumComponent(cartesian: Cartesian2): number; + /** + * Computes the value of the minimum component for the supplied Cartesian. + * @param cartesian - The cartesian to use. + * @returns The value of the minimum component. + */ + static minimumComponent(cartesian: Cartesian2): number; + /** + * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians. + * @param first - A cartesian to compare. + * @param second - A cartesian to compare. + * @param result - The object into which to store the result. + * @returns A cartesian with the minimum components. + */ + static minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians. + * @param first - A cartesian to compare. + * @param second - A cartesian to compare. + * @param result - The object into which to store the result. + * @returns A cartesian with the maximum components. + */ + static maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Computes the provided Cartesian's squared magnitude. + * @param cartesian - The Cartesian instance whose squared magnitude is to be computed. + * @returns The squared magnitude. + */ + static magnitudeSquared(cartesian: Cartesian2): number; + /** + * Computes the Cartesian's magnitude (length). + * @param cartesian - The Cartesian instance whose magnitude is to be computed. + * @returns The magnitude. + */ + static magnitude(cartesian: Cartesian2): number; + /** + * Computes the distance between two points. + * @example + * // Returns 1.0 + var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0)); + * @param left - The first point to compute the distance from. + * @param right - The second point to compute the distance to. + * @returns The distance between two points. + */ + static distance(left: Cartesian2, right: Cartesian2): number; + /** + * Computes the squared distance between two points. Comparing squared distances + using this function is more efficient than comparing distances using {@link Cartesian2#distance}. + * @example + * // Returns 4.0, not 2.0 + var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0)); + * @param left - The first point to compute the distance from. + * @param right - The second point to compute the distance to. + * @returns The distance between two points. + */ + static distanceSquared(left: Cartesian2, right: Cartesian2): number; + /** + * Computes the normalized form of the supplied Cartesian. + * @param cartesian - The Cartesian to be normalized. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Computes the dot (scalar) product of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @returns The dot product. + */ + static dot(left: Cartesian2, right: Cartesian2): number; + /** + * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0 + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @returns The cross product. + */ + static cross(left: Cartesian2, right: Cartesian2): number; + /** + * Computes the componentwise product of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Computes the componentwise quotient of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divideComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Computes the componentwise sum of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Computes the componentwise difference of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Multiplies the provided Cartesian componentwise by the provided scalar. + * @param cartesian - The Cartesian to be scaled. + * @param scalar - The scalar to multiply with. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2; + /** + * Divides the provided Cartesian componentwise by the provided scalar. + * @param cartesian - The Cartesian to be divided. + * @param scalar - The scalar to divide by. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2; + /** + * Negates the provided Cartesian. + * @param cartesian - The Cartesian to be negated. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Computes the absolute value of the provided Cartesian. + * @param cartesian - The Cartesian whose absolute value is to be computed. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Computes the linear interpolation or extrapolation at t using the provided cartesians. + * @param start - The value corresponding to t at 0.0. + * @param end - The value corresponding to t at 1.0. + * @param t - The point along t at which to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2; + /** + * Returns the angle, in radians, between the provided Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @returns The angle between the Cartesians. + */ + static angleBetween(left: Cartesian2, right: Cartesian2): number; + /** + * Returns the axis that is most orthogonal to the provided Cartesian. + * @param cartesian - The Cartesian on which to find the most orthogonal axis. + * @param result - The object onto which to store the result. + * @returns The most orthogonal axis. + */ + static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Compares the provided Cartesians componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first Cartesian. + * @param [right] - The second Cartesian. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: Cartesian2, right?: Cartesian2): boolean; + /** + * Compares the provided Cartesians componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [left] - The first Cartesian. + * @param [right] - The second Cartesian. + * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Cartesian2, right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * An immutable Cartesian2 instance initialized to (0.0, 0.0). + */ + static readonly ZERO: Cartesian2; + /** + * An immutable Cartesian2 instance initialized to (1.0, 0.0). + */ + static readonly UNIT_X: Cartesian2; + /** + * An immutable Cartesian2 instance initialized to (0.0, 1.0). + */ + static readonly UNIT_Y: Cartesian2; + /** + * Duplicates this Cartesian2 instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. + */ + clone(result?: Cartesian2): Cartesian2; + /** + * Compares this Cartesian against the provided Cartesian componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side Cartesian. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: Cartesian2): boolean; + /** + * Compares this Cartesian against the provided Cartesian componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [right] - The right hand side Cartesian. + * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * Creates a string representing this Cartesian in the format '(x, y)'. + * @returns A string representing the provided Cartesian in the format '(x, y)'. + */ + toString(): string; +} + +/** + * A 3D Cartesian point. + * @param [x = 0.0] - The X component. + * @param [y = 0.0] - The Y component. + * @param [z = 0.0] - The Z component. + */ +export class Cartesian3 { + constructor(x?: number, y?: number, z?: number); + /** + * The X component. + */ + x: number; + /** + * The Y component. + */ + y: number; + /** + * The Z component. + */ + z: number; + /** + * Converts the provided Spherical into Cartesian3 coordinates. + * @param spherical - The Spherical to be converted to Cartesian3. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ + static fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3; + /** + * Creates a Cartesian3 instance from x, y and z coordinates. + * @param x - The x coordinate. + * @param y - The y coordinate. + * @param z - The z coordinate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ + static fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3; + /** + * Duplicates a Cartesian3 instance. + * @param cartesian - The Cartesian to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined) + */ + static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the + x, y, and z properties of the Cartesian4 and drops w. + * @param cartesian - The Cartesian4 instance to create a Cartesian3 instance from. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ + static fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Cartesian3, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3; + /** + * Flattens an array of Cartesian3s into an array of components. + * @param array - The array of cartesians to pack. + * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements. + * @returns The packed array. + */ + static packArray(array: Cartesian3[], result?: number[]): number[]; + /** + * Unpacks an array of cartesian components into an array of Cartesian3s. + * @param array - The array of components to unpack. + * @param [result] - The array onto which to store the result. + * @returns The unpacked array. + */ + static unpackArray(array: number[], result?: Cartesian3[]): Cartesian3[]; + /** + * Creates a Cartesian3 from three consecutive elements in an array. + * @example + * // Create a Cartesian3 with (1.0, 2.0, 3.0) + var v = [1.0, 2.0, 3.0]; + var p = Cesium.Cartesian3.fromArray(v); + + // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array + var v2 = [0.0, 0.0, 1.0, 2.0, 3.0]; + var p2 = Cesium.Cartesian3.fromArray(v2, 2); + * @param array - The array whose three consecutive elements correspond to the x, y, and z components, respectively. + * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ + static fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3; + /** + * Computes the value of the maximum component for the supplied Cartesian. + * @param cartesian - The cartesian to use. + * @returns The value of the maximum component. + */ + static maximumComponent(cartesian: Cartesian3): number; + /** + * Computes the value of the minimum component for the supplied Cartesian. + * @param cartesian - The cartesian to use. + * @returns The value of the minimum component. + */ + static minimumComponent(cartesian: Cartesian3): number; + /** + * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians. + * @param first - A cartesian to compare. + * @param second - A cartesian to compare. + * @param result - The object into which to store the result. + * @returns A cartesian with the minimum components. + */ + static minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians. + * @param first - A cartesian to compare. + * @param second - A cartesian to compare. + * @param result - The object into which to store the result. + * @returns A cartesian with the maximum components. + */ + static maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the provided Cartesian's squared magnitude. + * @param cartesian - The Cartesian instance whose squared magnitude is to be computed. + * @returns The squared magnitude. + */ + static magnitudeSquared(cartesian: Cartesian3): number; + /** + * Computes the Cartesian's magnitude (length). + * @param cartesian - The Cartesian instance whose magnitude is to be computed. + * @returns The magnitude. + */ + static magnitude(cartesian: Cartesian3): number; + /** + * Computes the distance between two points. + * @example + * // Returns 1.0 + var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); + * @param left - The first point to compute the distance from. + * @param right - The second point to compute the distance to. + * @returns The distance between two points. + */ + static distance(left: Cartesian3, right: Cartesian3): number; + /** + * Computes the squared distance between two points. Comparing squared distances + using this function is more efficient than comparing distances using {@link Cartesian3#distance}. + * @example + * // Returns 4.0, not 2.0 + var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); + * @param left - The first point to compute the distance from. + * @param right - The second point to compute the distance to. + * @returns The distance between two points. + */ + static distanceSquared(left: Cartesian3, right: Cartesian3): number; + /** + * Computes the normalized form of the supplied Cartesian. + * @param cartesian - The Cartesian to be normalized. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the dot (scalar) product of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @returns The dot product. + */ + static dot(left: Cartesian3, right: Cartesian3): number; + /** + * Computes the componentwise product of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the componentwise quotient of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the componentwise sum of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the componentwise difference of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Multiplies the provided Cartesian componentwise by the provided scalar. + * @param cartesian - The Cartesian to be scaled. + * @param scalar - The scalar to multiply with. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3; + /** + * Divides the provided Cartesian componentwise by the provided scalar. + * @param cartesian - The Cartesian to be divided. + * @param scalar - The scalar to divide by. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3; + /** + * Negates the provided Cartesian. + * @param cartesian - The Cartesian to be negated. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the absolute value of the provided Cartesian. + * @param cartesian - The Cartesian whose absolute value is to be computed. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the linear interpolation or extrapolation at t using the provided cartesians. + * @param start - The value corresponding to t at 0.0. + * @param end - The value corresponding to t at 1.0. + * @param t - The point along t at which to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3; + /** + * Returns the angle, in radians, between the provided Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @returns The angle between the Cartesians. + */ + static angleBetween(left: Cartesian3, right: Cartesian3): number; + /** + * Returns the axis that is most orthogonal to the provided Cartesian. + * @param cartesian - The Cartesian on which to find the most orthogonal axis. + * @param result - The object onto which to store the result. + * @returns The most orthogonal axis. + */ + static mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Projects vector a onto vector b + * @param a - The vector that needs projecting + * @param b - The vector to project onto + * @param result - The result cartesian + * @returns The modified result parameter + */ + static projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Compares the provided Cartesians componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first Cartesian. + * @param [right] - The second Cartesian. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: Cartesian3, right?: Cartesian3): boolean; + /** + * Compares the provided Cartesians componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [left] - The first Cartesian. + * @param [right] - The second Cartesian. + * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Cartesian3, right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * Computes the cross (outer) product of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The cross product. + */ + static cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the midpoint between the right and left Cartesian. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The midpoint. + */ + static midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Returns a Cartesian3 position from longitude and latitude values given in degrees. + * @example + * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); + * @param longitude - The longitude, in degrees + * @param latitude - The latitude, in degrees + * @param [height = 0.0] - The height, in meters, above the ellipsoid. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies. + * @param [result] - The object onto which to store the result. + * @returns The position + */ + static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + /** + * Returns a Cartesian3 position from longitude and latitude values given in radians. + * @example + * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); + * @param longitude - The longitude, in radians + * @param latitude - The latitude, in radians + * @param [height = 0.0] - The height, in meters, above the ellipsoid. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies. + * @param [result] - The object onto which to store the result. + * @returns The position + */ + static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + /** + * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees. + * @example + * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); + * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...]. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie. + * @param [result] - An array of Cartesian3 objects to store the result. + * @returns The array of positions. + */ + static fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + /** + * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians. + * @example + * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); + * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...]. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie. + * @param [result] - An array of Cartesian3 objects to store the result. + * @returns The array of positions. + */ + static fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + /** + * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees. + * @example + * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); + * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...]. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies. + * @param [result] - An array of Cartesian3 objects to store the result. + * @returns The array of positions. + */ + static fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + /** + * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians. + * @example + * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); + * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...]. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies. + * @param [result] - An array of Cartesian3 objects to store the result. + * @returns The array of positions. + */ + static fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + /** + * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0). + */ + static readonly ZERO: Cartesian3; + /** + * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0). + */ + static readonly UNIT_X: Cartesian3; + /** + * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0). + */ + static readonly UNIT_Y: Cartesian3; + /** + * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0). + */ + static readonly UNIT_Z: Cartesian3; + /** + * Duplicates this Cartesian3 instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ + clone(result?: Cartesian3): Cartesian3; + /** + * Compares this Cartesian against the provided Cartesian componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side Cartesian. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: Cartesian3): boolean; + /** + * Compares this Cartesian against the provided Cartesian componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [right] - The right hand side Cartesian. + * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * Creates a string representing this Cartesian in the format '(x, y, z)'. + * @returns A string representing this Cartesian in the format '(x, y, z)'. + */ + toString(): string; +} + +/** + * A 4D Cartesian point. + * @param [x = 0.0] - The X component. + * @param [y = 0.0] - The Y component. + * @param [z = 0.0] - The Z component. + * @param [w = 0.0] - The W component. + */ +export class Cartesian4 { + constructor(x?: number, y?: number, z?: number, w?: number); + /** + * The X component. + */ + x: number; + /** + * The Y component. + */ + y: number; + /** + * The Z component. + */ + z: number; + /** + * The W component. + */ + w: number; + /** + * Creates a Cartesian4 instance from x, y, z and w coordinates. + * @param x - The x coordinate. + * @param y - The y coordinate. + * @param z - The z coordinate. + * @param w - The w coordinate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. + */ + static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4; + /** + * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>, + and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively. + * @param color - The source color. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. + */ + static fromColor(color: Color, result?: Cartesian4): Cartesian4; + /** + * Duplicates a Cartesian4 instance. + * @param cartesian - The Cartesian to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined) + */ + static clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Cartesian4, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4; + /** + * Flattens an array of Cartesian4s into and array of components. + * @param array - The array of cartesians to pack. + * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements. + * @returns The packed array. + */ + static packArray(array: Cartesian4[], result?: number[]): number[]; + /** + * Unpacks an array of cartesian components into and array of Cartesian4s. + * @param array - The array of components to unpack. + * @param [result] - The array onto which to store the result. + * @returns The unpacked array. + */ + static unpackArray(array: number[], result?: Cartesian4[]): Cartesian4[]; + /** + * Creates a Cartesian4 from four consecutive elements in an array. + * @example + * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) + var v = [1.0, 2.0, 3.0, 4.0]; + var p = Cesium.Cartesian4.fromArray(v); + + // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array + var v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0]; + var p2 = Cesium.Cartesian4.fromArray(v2, 2); + * @param array - The array whose four consecutive elements correspond to the x, y, z, and w components, respectively. + * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. + */ + static fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4; + /** + * Computes the value of the maximum component for the supplied Cartesian. + * @param cartesian - The cartesian to use. + * @returns The value of the maximum component. + */ + static maximumComponent(cartesian: Cartesian4): number; + /** + * Computes the value of the minimum component for the supplied Cartesian. + * @param cartesian - The cartesian to use. + * @returns The value of the minimum component. + */ + static minimumComponent(cartesian: Cartesian4): number; + /** + * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians. + * @param first - A cartesian to compare. + * @param second - A cartesian to compare. + * @param result - The object into which to store the result. + * @returns A cartesian with the minimum components. + */ + static minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians. + * @param first - A cartesian to compare. + * @param second - A cartesian to compare. + * @param result - The object into which to store the result. + * @returns A cartesian with the maximum components. + */ + static maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Computes the provided Cartesian's squared magnitude. + * @param cartesian - The Cartesian instance whose squared magnitude is to be computed. + * @returns The squared magnitude. + */ + static magnitudeSquared(cartesian: Cartesian4): number; + /** + * Computes the Cartesian's magnitude (length). + * @param cartesian - The Cartesian instance whose magnitude is to be computed. + * @returns The magnitude. + */ + static magnitude(cartesian: Cartesian4): number; + /** + * Computes the 4-space distance between two points. + * @example + * // Returns 1.0 + var d = Cesium.Cartesian4.distance( + new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0), + new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); + * @param left - The first point to compute the distance from. + * @param right - The second point to compute the distance to. + * @returns The distance between two points. + */ + static distance(left: Cartesian4, right: Cartesian4): number; + /** + * Computes the squared distance between two points. Comparing squared distances + using this function is more efficient than comparing distances using {@link Cartesian4#distance}. + * @example + * // Returns 4.0, not 2.0 + var d = Cesium.Cartesian4.distance( + new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0), + new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); + * @param left - The first point to compute the distance from. + * @param right - The second point to compute the distance to. + * @returns The distance between two points. + */ + static distanceSquared(left: Cartesian4, right: Cartesian4): number; + /** + * Computes the normalized form of the supplied Cartesian. + * @param cartesian - The Cartesian to be normalized. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Computes the dot (scalar) product of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @returns The dot product. + */ + static dot(left: Cartesian4, right: Cartesian4): number; + /** + * Computes the componentwise product of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Computes the componentwise quotient of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divideComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Computes the componentwise sum of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Computes the componentwise difference of two Cartesians. + * @param left - The first Cartesian. + * @param right - The second Cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Multiplies the provided Cartesian componentwise by the provided scalar. + * @param cartesian - The Cartesian to be scaled. + * @param scalar - The scalar to multiply with. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4; + /** + * Divides the provided Cartesian componentwise by the provided scalar. + * @param cartesian - The Cartesian to be divided. + * @param scalar - The scalar to divide by. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4; + /** + * Negates the provided Cartesian. + * @param cartesian - The Cartesian to be negated. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Computes the absolute value of the provided Cartesian. + * @param cartesian - The Cartesian whose absolute value is to be computed. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Computes the linear interpolation or extrapolation at t using the provided cartesians. + * @param start - The value corresponding to t at 0.0. + * @param end - The value corresponding to t at 1.0. + * @param t - The point along t at which to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4; + /** + * Returns the axis that is most orthogonal to the provided Cartesian. + * @param cartesian - The Cartesian on which to find the most orthogonal axis. + * @param result - The object onto which to store the result. + * @returns The most orthogonal axis. + */ + static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Compares the provided Cartesians componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first Cartesian. + * @param [right] - The second Cartesian. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: Cartesian4, right?: Cartesian4): boolean; + /** + * Compares the provided Cartesians componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [left] - The first Cartesian. + * @param [right] - The second Cartesian. + * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Cartesian4, right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0). + */ + static readonly ZERO: Cartesian4; + /** + * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0). + */ + static readonly UNIT_X: Cartesian4; + /** + * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0). + */ + static readonly UNIT_Y: Cartesian4; + /** + * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0). + */ + static readonly UNIT_Z: Cartesian4; + /** + * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0). + */ + static readonly UNIT_W: Cartesian4; + /** + * Duplicates this Cartesian4 instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. + */ + clone(result?: Cartesian4): Cartesian4; + /** + * Compares this Cartesian against the provided Cartesian componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side Cartesian. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: Cartesian4): boolean; + /** + * Compares this Cartesian against the provided Cartesian componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [right] - The right hand side Cartesian. + * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * Creates a string representing this Cartesian in the format '(x, y, z, w)'. + * @returns A string representing the provided Cartesian in the format '(x, y, z, w)'. + */ + toString(): string; + /** + * Packs an arbitrary floating point value to 4 values representable using uint8. + * @param value - A floating point number. + * @param [result] - The Cartesian4 that will contain the packed float. + * @returns A Cartesian4 representing the float packed to values in x, y, z, and w. + */ + static packFloat(value: number, result?: Cartesian4): Cartesian4; +} + +/** + * A position defined by longitude, latitude, and height. + * @param [longitude = 0.0] - The longitude, in radians. + * @param [latitude = 0.0] - The latitude, in radians. + * @param [height = 0.0] - The height, in meters, above the ellipsoid. + */ +export class Cartographic { + constructor(longitude?: number, latitude?: number, height?: number); + /** + * The longitude, in radians. + */ + longitude: number; + /** + * The latitude, in radians. + */ + latitude: number; + /** + * The height, in meters, above the ellipsoid. + */ + height: number; + /** + * Creates a new Cartographic instance from longitude and latitude + specified in radians. + * @param longitude - The longitude, in radians. + * @param latitude - The latitude, in radians. + * @param [height = 0.0] - The height, in meters, above the ellipsoid. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if one was not provided. + */ + static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic; + /** + * Creates a new Cartographic instance from longitude and latitude + specified in degrees. The values in the resulting object will + be in radians. + * @param longitude - The longitude, in degrees. + * @param latitude - The latitude, in degrees. + * @param [height = 0.0] - The height, in meters, above the ellipsoid. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if one was not provided. + */ + static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic; + /** + * Creates a new Cartographic instance from a Cartesian position. The values in the + resulting object will be in radians. + * @param cartesian - The Cartesian position to convert to cartographic representation. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid. + */ + static fromCartesian(cartesian: Cartesian3, ellipsoid?: Ellipsoid, result?: Cartographic): Cartographic; + /** + * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted + object should be in radians. + * @param cartographic - Input to be converted into a Cartesian3 output. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies. + * @param [result] - The object onto which to store the result. + * @returns The position + */ + static toCartesian(cartographic: Cartographic, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + /** + * Duplicates a Cartographic instance. + * @param cartographic - The cartographic to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined) + */ + static clone(cartographic: Cartographic, result?: Cartographic): Cartographic; + /** + * Compares the provided cartographics componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first cartographic. + * @param [right] - The second cartographic. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: Cartographic, right?: Cartographic): boolean; + /** + * Compares the provided cartographics componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [left] - The first cartographic. + * @param [right] - The second cartographic. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Cartographic, right?: Cartographic, epsilon?: number): boolean; + /** + * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0). + */ + static readonly ZERO: Cartographic; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if one was not provided. + */ + clone(result?: Cartographic): Cartographic; + /** + * Compares the provided against this cartographic componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The second cartographic. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(right?: Cartographic): boolean; + /** + * Compares the provided against this cartographic componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [right] - The second cartographic. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: Cartographic, epsilon?: number): boolean; + /** + * Creates a string representing this cartographic in the format '(longitude, latitude, height)'. + * @returns A string representing the provided cartographic in the format '(longitude, latitude, height)'. + */ + toString(): string; +} + +/** + * Geocodes queries containing longitude and latitude coordinates and an optional height. +Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters. + */ +export class CartographicGeocoderService { + constructor(); + /** + * @param query - The query to be sent to the geocoder service + */ + geocode(query: string): Promise<GeocoderService.Result[]>; +} + +/** + * A Catmull-Rom spline is a cubic spline where the tangent at control points, +except the first and last, are computed using the previous and next control points. +Catmull-Rom splines are in the class C<sup>1</sup>. + * @example + * // spline above the earth from Philadelphia to Los Angeles +var spline = new Cesium.CatmullRomSpline({ + times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ] +}); + +var p0 = spline.evaluate(times[i]); // equal to positions[i] +var p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i] + * @param options - Object with the following properties: + * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. + The values are in no way connected to the clock time. They are the parameterization for the curve. + * @param options.points - The array of {@link Cartesian3} control points. + * @param [options.firstTangent] - The tangent of the curve at the first control point. + If the tangent is not given, it will be estimated. + * @param [options.lastTangent] - The tangent of the curve at the last control point. + If the tangent is not given, it will be estimated. + */ +export class CatmullRomSpline { + constructor(options: { + times: number[] + points: Cartesian3[] + firstTangent?: Cartesian3 + lastTangent?: Cartesian3 + }); + /** + * An array of times for the control points. + */ + readonly times: number[]; + /** + * An array of {@link Cartesian3} control points. + */ + readonly points: Cartesian3[]; + /** + * The tangent at the first control point. + */ + readonly firstTangent: Cartesian3; + /** + * The tangent at the last control point. + */ + readonly lastTangent: Cartesian3; + /** + * Finds an index <code>i</code> in <code>times</code> such that the parameter + <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>. + * @param time - The time. + * @returns The index for the element at the start of the interval. + */ + findTimeInterval(time: number): number; + /** + * Wraps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, wrapped around to the updated animation. + */ + wrapTime(time: number): number; + /** + * Clamps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, clamped to the animation period. + */ + clampTime(time: number): number; + /** + * Evaluates the curve at a given time. + * @param time - The time at which to evaluate the curve. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance of the point on the curve at the given time. + */ + evaluate(time: number, result?: Cartesian3): Cartesian3; +} + +/** + * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format. + * @example + * // Create Arctic DEM terrain with normals. +var viewer = new Cesium.Viewer('cesiumContainer', { + terrainProvider : new Cesium.CesiumTerrainProvider({ + url : Cesium.IonResource.fromAssetId(3956), + requestVertexNormals : true + }) +}); + * @param options - Object with the following properties: + * @param options.url - The URL of the Cesium terrain server. + * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available. + * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server, if available. + * @param [options.requestMetadata = true] - Flag that indicates if the client should request per tile metadata from the server, if available. + * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @param [options.credit] - A credit for the data source, which is displayed on the canvas. + */ +export class CesiumTerrainProvider { + constructor(options: { + url: Resource | string | Promise<Resource> | Promise<string> + requestVertexNormals?: boolean + requestWaterMask?: boolean + requestMetadata?: boolean + ellipsoid?: Ellipsoid + credit?: Credit | string + }); + /** + * Requests the geometry for a given tile. This function should not be called before + {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and + may optionally include a water mask and an indication of which child tiles are available. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the requested geometry. If this method + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. + */ + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined; + /** + * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + errorEvent: Event; + /** + * Gets the credit to display when this terrain provider is active. Typically this is used to credit + the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true. + */ + credit: Credit; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link CesiumTerrainProvider#ready} returns true. + */ + tilingScheme: GeographicTilingScheme; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets a value indicating whether or not the provider includes a water mask. The water mask + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link CesiumTerrainProvider#ready} returns true. + */ + hasWaterMask: boolean; + /** + * Gets a value indicating whether or not the requested tiles include vertex normals. + This function should not be called before {@link CesiumTerrainProvider#ready} returns true. + */ + hasVertexNormals: boolean; + /** + * Gets a value indicating whether or not the requested tiles include metadata. + This function should not be called before {@link CesiumTerrainProvider#ready} returns true. + */ + hasMetadata: boolean; + /** + * Boolean flag that indicates if the client should request vertex normals from the server. + Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and + if the server provides vertex normals. + */ + requestVertexNormals: boolean; + /** + * Boolean flag that indicates if the client should request a watermask from the server. + Watermask data is appended to the standard tile mesh data only if the client requests the watermask and + if the server provides a watermask. + */ + requestWaterMask: boolean; + /** + * Boolean flag that indicates if the client should request metadata from the server. + Metadata is appended to the standard tile mesh data only if the client requests the metadata and + if the server provides a metadata. + */ + requestMetadata: boolean; + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + at points and in rectangles. This function should not be called before + {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. Note that this reflects tiles that are known to be available currently. + Additional tiles may be discovered to be available in the future, e.g. if availability information + exists deeper in the tree rather than it all being discoverable at the root. However, a tile that + is available now will not become unavailable in the future. + */ + availability: TileAvailability; + /** + * Gets the maximum geometric error allowed in a tile at a given level. + * @param level - The tile level for which to get the maximum geometric error. + * @returns The maximum geometric error. + */ + getLevelMaximumGeometricError(level: number): number; + /** + * Determines whether data for a tile is available to be loaded. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if not supported or availability is unknown, otherwise true or false. + */ + getTileDataAvailable(x: number, y: number, level: number): boolean; + /** + * Makes sure we load availability data for a tile + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + */ + loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>; +} + +/** + * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. + * @example + * // Create a circle. +var circle = new Cesium.CircleGeometry({ + center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), + radius : 100000.0 +}); +var geometry = Cesium.CircleGeometry.createGeometry(circle); + * @param options - Object with the following properties: + * @param options.center - The circle's center point in the fixed frame. + * @param options.radius - The radius in meters. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on. + * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface. + * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface. + * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. + */ +export class CircleGeometry { + constructor(options: { + center: Cartesian3 + radius: number + ellipsoid?: Ellipsoid + height?: number + granularity?: number + vertexFormat?: VertexFormat + extrudedHeight?: number + stRotation?: number + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: CircleGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new CircleGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: CircleGeometry): CircleGeometry; + /** + * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere. + * @param circleGeometry - A description of the circle. + * @returns The computed vertices and indices. + */ + static createGeometry(circleGeometry: CircleGeometry): Geometry | undefined; +} + +/** + * A description of the outline of a circle on the ellipsoid. + * @example + * // Create a circle. +var circle = new Cesium.CircleOutlineGeometry({ + center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), + radius : 100000.0 +}); +var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle); + * @param options - Object with the following properties: + * @param options.center - The circle's center point in the fixed frame. + * @param options.radius - The radius in meters. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on. + * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface. + * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians. + * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface. + * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom of an extruded circle. + */ +export class CircleOutlineGeometry { + constructor(options: { + center: Cartesian3 + radius: number + ellipsoid?: Ellipsoid + height?: number + granularity?: number + extrudedHeight?: number + numberOfVerticalLines?: number + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: CircleOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new CircleOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): CircleOutlineGeometry; + /** + * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere. + * @param circleGeometry - A description of the circle. + * @returns The computed vertices and indices. + */ + static createGeometry(circleGeometry: CircleOutlineGeometry): Geometry | undefined; +} + +/** + * A simple clock for keeping track of simulated time. + * @example + * // Create a clock that loops on Christmas day 2013 and runs in real-time. +var clock = new Cesium.Clock({ + startTime : Cesium.JulianDate.fromIso8601("2013-12-25"), + currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"), + stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"), + clockRange : Cesium.ClockRange.LOOP_STOP, + clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER +}); + * @param [options] - Object with the following properties: + * @param [options.startTime] - The start time of the clock. + * @param [options.stopTime] - The stop time of the clock. + * @param [options.currentTime] - The current time. + * @param [options.multiplier = 1.0] - Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards. + * @param [options.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER] - Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent. + * @param [options.clockRange = ClockRange.UNBOUNDED] - Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached. + * @param [options.canAnimate = true] - Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered, for example. The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true. + * @param [options.shouldAnimate = false] - Indicates whether {@link Clock#tick} should attempt to advance time. The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true. + */ +export class Clock { + constructor(options?: { + startTime?: JulianDate + stopTime?: JulianDate + currentTime?: JulianDate + multiplier?: number + clockStep?: ClockStep + clockRange?: ClockRange + canAnimate?: boolean + shouldAnimate?: boolean + }); + /** + * The start time of the clock. + */ + startTime: JulianDate; + /** + * The stop time of the clock. + */ + stopTime: JulianDate; + /** + * Determines how the clock should behave when + {@link Clock#startTime} or {@link Clock#stopTime} + is reached. + */ + clockRange: ClockRange; + /** + * Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered, + for example. The clock will only advance time when both + {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true. + */ + canAnimate: boolean; + /** + * An {@link Event} that is fired whenever {@link Clock#tick} is called. + */ + onTick: Event; + /** + * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached. + */ + onStop: Event; + /** + * The current time. + Changing this property will change + {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to + {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. + */ + currentTime: JulianDate; + /** + * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards. + If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance. + If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the + elapsed system time since the last call to {@link Clock#tick}. + Changing this property will change + {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to + {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. + */ + multiplier: number; + /** + * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent. + Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set + {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and + {@link Clock#currentTime} to the current system clock time. + */ + clockStep: ClockStep; + /** + * Indicates whether {@link Clock#tick} should attempt to advance time. + The clock will only advance time when both + {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true. + Changing this property will change + {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to + {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}. + */ + shouldAnimate: boolean; + /** + * Advances the clock from the current time based on the current configuration options. + tick should be called every frame, regardless of whether animation is taking place + or not. To control animation, use the {@link Clock#shouldAnimate} property. + * @returns The new value of the {@link Clock#currentTime} property. + */ + tick(): JulianDate; +} + +/** + * Constants used by {@link Clock#tick} to determine behavior +when {@link Clock#startTime} or {@link Clock#stopTime} is reached. + */ +export enum ClockRange { + /** + * {@link Clock#tick} will always advances the clock in its current direction. + */ + UNBOUNDED = 0, + /** + * When {@link Clock#startTime} or {@link Clock#stopTime} is reached, + {@link Clock#tick} will not advance {@link Clock#currentTime} any further. + */ + CLAMPED = 1, + /** + * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance + {@link Clock#currentTime} to the opposite end of the interval. When + time is moving backwards, {@link Clock#tick} will not advance past + {@link Clock#startTime} + */ + LOOP_STOP = 2 +} + +/** + * Constants to determine how much time advances with each call +to {@link Clock#tick}. + */ +export enum ClockStep { + /** + * {@link Clock#tick} advances the current time by a fixed step, + which is the number of seconds specified by {@link Clock#multiplier}. + */ + TICK_DEPENDENT = 0, + /** + * {@link Clock#tick} advances the current time by the amount of system + time elapsed since the previous call multiplied by {@link Clock#multiplier}. + */ + SYSTEM_CLOCK_MULTIPLIER = 1, + /** + * {@link Clock#tick} sets the clock to the current system time; + ignoring all other settings. + */ + SYSTEM_CLOCK = 2 +} + +/** + * Clones an object, returning a new object containing the same properties. + * @param object - The object to clone. + * @param [deep = false] - If true, all properties will be deep cloned recursively. + * @returns The cloned object. + */ +export function clone(object: any, deep?: boolean): any; + +/** + * A color, specified using red, green, blue, and alpha values, +which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity). + * @param [red = 1.0] - The red component. + * @param [green = 1.0] - The green component. + * @param [blue = 1.0] - The blue component. + * @param [alpha = 1.0] - The alpha component. + */ +export class Color { + constructor(red?: number, green?: number, blue?: number, alpha?: number); + /** + * The red component. + */ + red: number; + /** + * The green component. + */ + green: number; + /** + * The blue component. + */ + blue: number; + /** + * The alpha component. + */ + alpha: number; + /** + * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>, + and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively. + * @param cartesian - The source cartesian. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Color instance if one was not provided. + */ + static fromCartesian4(cartesian: Cartesian4, result?: Color): Color; + /** + * Creates a new Color specified using red, green, blue, and alpha values + that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0. + * @param [red = 255] - The red component. + * @param [green = 255] - The green component. + * @param [blue = 255] - The blue component. + * @param [alpha = 255] - The alpha component. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Color instance if one was not provided. + */ + static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color; + /** + * Creates a new Color that has the same red, green, and blue components + of the specified color, but with the specified alpha value. + * @example + * var translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9); + * @param color - The base color + * @param alpha - The new alpha component. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Color instance if one was not provided. + */ + static fromAlpha(color: Color, alpha: number, result?: Color): Color; + /** + * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness + of the system. + * @example + * var color = Cesium.Color.fromRgba(0x67ADDFFF); + * @param rgba - A single numeric unsigned 32-bit RGBA value. + * @param [result] - The object to store the result in, if undefined a new instance will be created. + * @returns The color object. + */ + static fromRgba(rgba: number, result?: Color): Color; + /** + * Creates a Color instance from hue, saturation, and lightness. + * @param [hue = 0] - The hue angle 0...1 + * @param [saturation = 0] - The saturation value 0...1 + * @param [lightness = 0] - The lightness value 0...1 + * @param [alpha = 1.0] - The alpha component 0...1 + * @param [result] - The object to store the result in, if undefined a new instance will be created. + * @returns The color object. + */ + static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number, result?: Color): Color; + /** + * Creates a random color using the provided options. For reproducible random colors, you should + call {@link Math#setRandomNumberSeed} once at the beginning of your application. + * @example + * //Create a completely random color + var color = Cesium.Color.fromRandom(); + + //Create a random shade of yellow. + var color = Cesium.Color.fromRandom({ + red : 1.0, + green : 1.0, + alpha : 1.0 + }); + + //Create a random bright color. + var color = Cesium.Color.fromRandom({ + minimumRed : 0.75, + minimumGreen : 0.75, + minimumBlue : 0.75, + alpha : 1.0 + }); + * @param [options] - Object with the following properties: + * @param [options.red] - If specified, the red component to use instead of a randomized value. + * @param [options.minimumRed = 0.0] - The maximum red value to generate if none was specified. + * @param [options.maximumRed = 1.0] - The minimum red value to generate if none was specified. + * @param [options.green] - If specified, the green component to use instead of a randomized value. + * @param [options.minimumGreen = 0.0] - The maximum green value to generate if none was specified. + * @param [options.maximumGreen = 1.0] - The minimum green value to generate if none was specified. + * @param [options.blue] - If specified, the blue component to use instead of a randomized value. + * @param [options.minimumBlue = 0.0] - The maximum blue value to generate if none was specified. + * @param [options.maximumBlue = 1.0] - The minimum blue value to generate if none was specified. + * @param [options.alpha] - If specified, the alpha component to use instead of a randomized value. + * @param [options.minimumAlpha = 0.0] - The maximum alpha value to generate if none was specified. + * @param [options.maximumAlpha = 1.0] - The minimum alpha value to generate if none was specified. + * @param [result] - The object to store the result in, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. + */ + static fromRandom(options?: { + red?: number + minimumRed?: number + maximumRed?: number + green?: number + minimumGreen?: number + maximumGreen?: number + blue?: number + minimumBlue?: number + maximumBlue?: number + alpha?: number + minimumAlpha?: number + maximumAlpha?: number + }, result?: Color): Color; + /** + * Creates a Color instance from a CSS color value. + * @example + * var cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF'); + var green = Cesium.Color.fromCssColorString('green'); + * @param color - The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format. + * @param [result] - The object to store the result in, if undefined a new instance will be created. + * @returns The color object, or undefined if the string was not a valid CSS color. + */ + static fromCssColorString(color: string, result?: Color): Color; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Color, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Color instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Color): Color; + /** + * Converts a 'byte' color component in the range of 0 to 255 into + a 'float' color component in the range of 0 to 1.0. + * @param number - The number to be converted. + * @returns The converted number. + */ + static byteToFloat(number: number): number; + /** + * Converts a 'float' color component in the range of 0 to 1.0 into + a 'byte' color component in the range of 0 to 255. + * @param number - The number to be converted. + * @returns The converted number. + */ + static floatToByte(number: number): number; + /** + * Duplicates a Color. + * @param color - The Color to duplicate. + * @param [result] - The object to store the result in, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined) + */ + static clone(color: Color, result?: Color): Color; + /** + * Returns true if the first Color equals the second color. + * @param left - The first Color to compare for equality. + * @param right - The second Color to compare for equality. + * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>. + */ + static equals(left: Color, right: Color): boolean; + /** + * Returns a duplicate of a Color instance. + * @param [result] - The object to store the result in, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. + */ + clone(result?: Color): Color; + /** + * Returns true if this Color equals other. + * @param other - The Color to compare for equality. + * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>. + */ + equals(other: Color): boolean; + /** + * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon. + * @param other - The Color to compare for equality. + * @param [epsilon = 0.0] - The epsilon to use for equality testing. + * @returns <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>. + */ + equalsEpsilon(other: Color, epsilon?: number): boolean; + /** + * Creates a string representing this Color in the format '(red, green, blue, alpha)'. + * @returns A string representing this Color in the format '(red, green, blue, alpha)'. + */ + toString(): string; + /** + * Creates a string containing the CSS color value for this color. + * @returns The CSS equivalent of this color. + */ + toCssColorString(): string; + /** + * Creates a string containing CSS hex string color value for this color. + * @returns The CSS hex string equivalent of this color. + */ + toCssHexString(): string; + /** + * Converts this color to an array of red, green, blue, and alpha values + that are in the range of 0 to 255. + * @param [result] - The array to store the result in, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. + */ + toBytes(result?: number[]): number[]; + /** + * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness + of the system. + * @example + * var rgba = Cesium.Color.BLUE.toRgba(); + * @returns A single numeric unsigned 32-bit RGBA value. + */ + toRgba(): number; + /** + * Brightens this color by the provided magnitude. + * @example + * var brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color()); + * @param magnitude - A positive number indicating the amount to brighten. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + brighten(magnitude: number, result: Color): Color; + /** + * Darkens this color by the provided magnitude. + * @example + * var darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color()); + * @param magnitude - A positive number indicating the amount to darken. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + darken(magnitude: number, result: Color): Color; + /** + * Creates a new Color that has the same red, green, and blue components + as this Color, but with the specified alpha value. + * @example + * var translucentRed = Cesium.Color.RED.withAlpha(0.9); + * @param alpha - The new alpha component. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Color instance if one was not provided. + */ + withAlpha(alpha: number, result?: Color): Color; + /** + * Computes the componentwise sum of two Colors. + * @param left - The first Color. + * @param right - The second Color. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static add(left: Color, right: Color, result: Color): Color; + /** + * Computes the componentwise difference of two Colors. + * @param left - The first Color. + * @param right - The second Color. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static subtract(left: Color, right: Color, result: Color): Color; + /** + * Computes the componentwise product of two Colors. + * @param left - The first Color. + * @param right - The second Color. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiply(left: Color, right: Color, result: Color): Color; + /** + * Computes the componentwise quotient of two Colors. + * @param left - The first Color. + * @param right - The second Color. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divide(left: Color, right: Color, result: Color): Color; + /** + * Computes the componentwise modulus of two Colors. + * @param left - The first Color. + * @param right - The second Color. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static mod(left: Color, right: Color, result: Color): Color; + /** + * Computes the linear interpolation or extrapolation at t between the provided colors. + * @param start - The color corresponding to t at 0.0. + * @param end - The color corresponding to t at 1.0. + * @param t - The point along t at which to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static lerp(start: Color, end: Color, t: number, result: Color): Color; + /** + * Multiplies the provided Color componentwise by the provided scalar. + * @param color - The Color to be scaled. + * @param scalar - The scalar to multiply with. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScalar(color: Color, scalar: number, result: Color): Color; + /** + * Divides the provided Color componentwise by the provided scalar. + * @param color - The Color to be divided. + * @param scalar - The scalar to divide with. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divideByScalar(color: Color, scalar: number, result: Color): Color; + /** + * An immutable Color instance initialized to CSS color #F0F8FF + <span class="colorSwath" style="background: #F0F8FF;"></span> + */ + static readonly ALICEBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #FAEBD7 + <span class="colorSwath" style="background: #FAEBD7;"></span> + */ + static readonly ANTIQUEWHITE: Color; + /** + * An immutable Color instance initialized to CSS color #00FFFF + <span class="colorSwath" style="background: #00FFFF;"></span> + */ + static readonly AQUA: Color; + /** + * An immutable Color instance initialized to CSS color #7FFFD4 + <span class="colorSwath" style="background: #7FFFD4;"></span> + */ + static readonly AQUAMARINE: Color; + /** + * An immutable Color instance initialized to CSS color #F0FFFF + <span class="colorSwath" style="background: #F0FFFF;"></span> + */ + static readonly AZURE: Color; + /** + * An immutable Color instance initialized to CSS color #F5F5DC + <span class="colorSwath" style="background: #F5F5DC;"></span> + */ + static readonly BEIGE: Color; + /** + * An immutable Color instance initialized to CSS color #FFE4C4 + <span class="colorSwath" style="background: #FFE4C4;"></span> + */ + static readonly BISQUE: Color; + /** + * An immutable Color instance initialized to CSS color #000000 + <span class="colorSwath" style="background: #000000;"></span> + */ + static readonly BLACK: Color; + /** + * An immutable Color instance initialized to CSS color #FFEBCD + <span class="colorSwath" style="background: #FFEBCD;"></span> + */ + static readonly BLANCHEDALMOND: Color; + /** + * An immutable Color instance initialized to CSS color #0000FF + <span class="colorSwath" style="background: #0000FF;"></span> + */ + static readonly BLUE: Color; + /** + * An immutable Color instance initialized to CSS color #8A2BE2 + <span class="colorSwath" style="background: #8A2BE2;"></span> + */ + static readonly BLUEVIOLET: Color; + /** + * An immutable Color instance initialized to CSS color #A52A2A + <span class="colorSwath" style="background: #A52A2A;"></span> + */ + static readonly BROWN: Color; + /** + * An immutable Color instance initialized to CSS color #DEB887 + <span class="colorSwath" style="background: #DEB887;"></span> + */ + static readonly BURLYWOOD: Color; + /** + * An immutable Color instance initialized to CSS color #5F9EA0 + <span class="colorSwath" style="background: #5F9EA0;"></span> + */ + static readonly CADETBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #7FFF00 + <span class="colorSwath" style="background: #7FFF00;"></span> + */ + static readonly CHARTREUSE: Color; + /** + * An immutable Color instance initialized to CSS color #D2691E + <span class="colorSwath" style="background: #D2691E;"></span> + */ + static readonly CHOCOLATE: Color; + /** + * An immutable Color instance initialized to CSS color #FF7F50 + <span class="colorSwath" style="background: #FF7F50;"></span> + */ + static readonly CORAL: Color; + /** + * An immutable Color instance initialized to CSS color #6495ED + <span class="colorSwath" style="background: #6495ED;"></span> + */ + static readonly CORNFLOWERBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #FFF8DC + <span class="colorSwath" style="background: #FFF8DC;"></span> + */ + static readonly CORNSILK: Color; + /** + * An immutable Color instance initialized to CSS color #DC143C + <span class="colorSwath" style="background: #DC143C;"></span> + */ + static readonly CRIMSON: Color; + /** + * An immutable Color instance initialized to CSS color #00FFFF + <span class="colorSwath" style="background: #00FFFF;"></span> + */ + static readonly CYAN: Color; + /** + * An immutable Color instance initialized to CSS color #00008B + <span class="colorSwath" style="background: #00008B;"></span> + */ + static readonly DARKBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #008B8B + <span class="colorSwath" style="background: #008B8B;"></span> + */ + static readonly DARKCYAN: Color; + /** + * An immutable Color instance initialized to CSS color #B8860B + <span class="colorSwath" style="background: #B8860B;"></span> + */ + static readonly DARKGOLDENROD: Color; + /** + * An immutable Color instance initialized to CSS color #A9A9A9 + <span class="colorSwath" style="background: #A9A9A9;"></span> + */ + static readonly DARKGRAY: Color; + /** + * An immutable Color instance initialized to CSS color #006400 + <span class="colorSwath" style="background: #006400;"></span> + */ + static readonly DARKGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #A9A9A9 + <span class="colorSwath" style="background: #A9A9A9;"></span> + */ + static readonly DARKGREY: Color; + /** + * An immutable Color instance initialized to CSS color #BDB76B + <span class="colorSwath" style="background: #BDB76B;"></span> + */ + static readonly DARKKHAKI: Color; + /** + * An immutable Color instance initialized to CSS color #8B008B + <span class="colorSwath" style="background: #8B008B;"></span> + */ + static readonly DARKMAGENTA: Color; + /** + * An immutable Color instance initialized to CSS color #556B2F + <span class="colorSwath" style="background: #556B2F;"></span> + */ + static readonly DARKOLIVEGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #FF8C00 + <span class="colorSwath" style="background: #FF8C00;"></span> + */ + static readonly DARKORANGE: Color; + /** + * An immutable Color instance initialized to CSS color #9932CC + <span class="colorSwath" style="background: #9932CC;"></span> + */ + static readonly DARKORCHID: Color; + /** + * An immutable Color instance initialized to CSS color #8B0000 + <span class="colorSwath" style="background: #8B0000;"></span> + */ + static readonly DARKRED: Color; + /** + * An immutable Color instance initialized to CSS color #E9967A + <span class="colorSwath" style="background: #E9967A;"></span> + */ + static readonly DARKSALMON: Color; + /** + * An immutable Color instance initialized to CSS color #8FBC8F + <span class="colorSwath" style="background: #8FBC8F;"></span> + */ + static readonly DARKSEAGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #483D8B + <span class="colorSwath" style="background: #483D8B;"></span> + */ + static readonly DARKSLATEBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #2F4F4F + <span class="colorSwath" style="background: #2F4F4F;"></span> + */ + static readonly DARKSLATEGRAY: Color; + /** + * An immutable Color instance initialized to CSS color #2F4F4F + <span class="colorSwath" style="background: #2F4F4F;"></span> + */ + static readonly DARKSLATEGREY: Color; + /** + * An immutable Color instance initialized to CSS color #00CED1 + <span class="colorSwath" style="background: #00CED1;"></span> + */ + static readonly DARKTURQUOISE: Color; + /** + * An immutable Color instance initialized to CSS color #9400D3 + <span class="colorSwath" style="background: #9400D3;"></span> + */ + static readonly DARKVIOLET: Color; + /** + * An immutable Color instance initialized to CSS color #FF1493 + <span class="colorSwath" style="background: #FF1493;"></span> + */ + static readonly DEEPPINK: Color; + /** + * An immutable Color instance initialized to CSS color #00BFFF + <span class="colorSwath" style="background: #00BFFF;"></span> + */ + static readonly DEEPSKYBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #696969 + <span class="colorSwath" style="background: #696969;"></span> + */ + static readonly DIMGRAY: Color; + /** + * An immutable Color instance initialized to CSS color #696969 + <span class="colorSwath" style="background: #696969;"></span> + */ + static readonly DIMGREY: Color; + /** + * An immutable Color instance initialized to CSS color #1E90FF + <span class="colorSwath" style="background: #1E90FF;"></span> + */ + static readonly DODGERBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #B22222 + <span class="colorSwath" style="background: #B22222;"></span> + */ + static readonly FIREBRICK: Color; + /** + * An immutable Color instance initialized to CSS color #FFFAF0 + <span class="colorSwath" style="background: #FFFAF0;"></span> + */ + static readonly FLORALWHITE: Color; + /** + * An immutable Color instance initialized to CSS color #228B22 + <span class="colorSwath" style="background: #228B22;"></span> + */ + static readonly FORESTGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #FF00FF + <span class="colorSwath" style="background: #FF00FF;"></span> + */ + static readonly FUCHSIA: Color; + /** + * An immutable Color instance initialized to CSS color #DCDCDC + <span class="colorSwath" style="background: #DCDCDC;"></span> + */ + static readonly GAINSBORO: Color; + /** + * An immutable Color instance initialized to CSS color #F8F8FF + <span class="colorSwath" style="background: #F8F8FF;"></span> + */ + static readonly GHOSTWHITE: Color; + /** + * An immutable Color instance initialized to CSS color #FFD700 + <span class="colorSwath" style="background: #FFD700;"></span> + */ + static readonly GOLD: Color; + /** + * An immutable Color instance initialized to CSS color #DAA520 + <span class="colorSwath" style="background: #DAA520;"></span> + */ + static readonly GOLDENROD: Color; + /** + * An immutable Color instance initialized to CSS color #808080 + <span class="colorSwath" style="background: #808080;"></span> + */ + static readonly GRAY: Color; + /** + * An immutable Color instance initialized to CSS color #008000 + <span class="colorSwath" style="background: #008000;"></span> + */ + static readonly GREEN: Color; + /** + * An immutable Color instance initialized to CSS color #ADFF2F + <span class="colorSwath" style="background: #ADFF2F;"></span> + */ + static readonly GREENYELLOW: Color; + /** + * An immutable Color instance initialized to CSS color #808080 + <span class="colorSwath" style="background: #808080;"></span> + */ + static readonly GREY: Color; + /** + * An immutable Color instance initialized to CSS color #F0FFF0 + <span class="colorSwath" style="background: #F0FFF0;"></span> + */ + static readonly HONEYDEW: Color; + /** + * An immutable Color instance initialized to CSS color #FF69B4 + <span class="colorSwath" style="background: #FF69B4;"></span> + */ + static readonly HOTPINK: Color; + /** + * An immutable Color instance initialized to CSS color #CD5C5C + <span class="colorSwath" style="background: #CD5C5C;"></span> + */ + static readonly INDIANRED: Color; + /** + * An immutable Color instance initialized to CSS color #4B0082 + <span class="colorSwath" style="background: #4B0082;"></span> + */ + static readonly INDIGO: Color; + /** + * An immutable Color instance initialized to CSS color #FFFFF0 + <span class="colorSwath" style="background: #FFFFF0;"></span> + */ + static readonly IVORY: Color; + /** + * An immutable Color instance initialized to CSS color #F0E68C + <span class="colorSwath" style="background: #F0E68C;"></span> + */ + static readonly KHAKI: Color; + /** + * An immutable Color instance initialized to CSS color #E6E6FA + <span class="colorSwath" style="background: #E6E6FA;"></span> + */ + static readonly LAVENDER: Color; + /** + * An immutable Color instance initialized to CSS color #FFF0F5 + <span class="colorSwath" style="background: #FFF0F5;"></span> + */ + static readonly LAVENDAR_BLUSH: Color; + /** + * An immutable Color instance initialized to CSS color #7CFC00 + <span class="colorSwath" style="background: #7CFC00;"></span> + */ + static readonly LAWNGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #FFFACD + <span class="colorSwath" style="background: #FFFACD;"></span> + */ + static readonly LEMONCHIFFON: Color; + /** + * An immutable Color instance initialized to CSS color #ADD8E6 + <span class="colorSwath" style="background: #ADD8E6;"></span> + */ + static readonly LIGHTBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #F08080 + <span class="colorSwath" style="background: #F08080;"></span> + */ + static readonly LIGHTCORAL: Color; + /** + * An immutable Color instance initialized to CSS color #E0FFFF + <span class="colorSwath" style="background: #E0FFFF;"></span> + */ + static readonly LIGHTCYAN: Color; + /** + * An immutable Color instance initialized to CSS color #FAFAD2 + <span class="colorSwath" style="background: #FAFAD2;"></span> + */ + static readonly LIGHTGOLDENRODYELLOW: Color; + /** + * An immutable Color instance initialized to CSS color #D3D3D3 + <span class="colorSwath" style="background: #D3D3D3;"></span> + */ + static readonly LIGHTGRAY: Color; + /** + * An immutable Color instance initialized to CSS color #90EE90 + <span class="colorSwath" style="background: #90EE90;"></span> + */ + static readonly LIGHTGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #D3D3D3 + <span class="colorSwath" style="background: #D3D3D3;"></span> + */ + static readonly LIGHTGREY: Color; + /** + * An immutable Color instance initialized to CSS color #FFB6C1 + <span class="colorSwath" style="background: #FFB6C1;"></span> + */ + static readonly LIGHTPINK: Color; + /** + * An immutable Color instance initialized to CSS color #20B2AA + <span class="colorSwath" style="background: #20B2AA;"></span> + */ + static readonly LIGHTSEAGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #87CEFA + <span class="colorSwath" style="background: #87CEFA;"></span> + */ + static readonly LIGHTSKYBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #778899 + <span class="colorSwath" style="background: #778899;"></span> + */ + static readonly LIGHTSLATEGRAY: Color; + /** + * An immutable Color instance initialized to CSS color #778899 + <span class="colorSwath" style="background: #778899;"></span> + */ + static readonly LIGHTSLATEGREY: Color; + /** + * An immutable Color instance initialized to CSS color #B0C4DE + <span class="colorSwath" style="background: #B0C4DE;"></span> + */ + static readonly LIGHTSTEELBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #FFFFE0 + <span class="colorSwath" style="background: #FFFFE0;"></span> + */ + static readonly LIGHTYELLOW: Color; + /** + * An immutable Color instance initialized to CSS color #00FF00 + <span class="colorSwath" style="background: #00FF00;"></span> + */ + static readonly LIME: Color; + /** + * An immutable Color instance initialized to CSS color #32CD32 + <span class="colorSwath" style="background: #32CD32;"></span> + */ + static readonly LIMEGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #FAF0E6 + <span class="colorSwath" style="background: #FAF0E6;"></span> + */ + static readonly LINEN: Color; + /** + * An immutable Color instance initialized to CSS color #FF00FF + <span class="colorSwath" style="background: #FF00FF;"></span> + */ + static readonly MAGENTA: Color; + /** + * An immutable Color instance initialized to CSS color #800000 + <span class="colorSwath" style="background: #800000;"></span> + */ + static readonly MAROON: Color; + /** + * An immutable Color instance initialized to CSS color #66CDAA + <span class="colorSwath" style="background: #66CDAA;"></span> + */ + static readonly MEDIUMAQUAMARINE: Color; + /** + * An immutable Color instance initialized to CSS color #0000CD + <span class="colorSwath" style="background: #0000CD;"></span> + */ + static readonly MEDIUMBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #BA55D3 + <span class="colorSwath" style="background: #BA55D3;"></span> + */ + static readonly MEDIUMORCHID: Color; + /** + * An immutable Color instance initialized to CSS color #9370DB + <span class="colorSwath" style="background: #9370DB;"></span> + */ + static readonly MEDIUMPURPLE: Color; + /** + * An immutable Color instance initialized to CSS color #3CB371 + <span class="colorSwath" style="background: #3CB371;"></span> + */ + static readonly MEDIUMSEAGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #7B68EE + <span class="colorSwath" style="background: #7B68EE;"></span> + */ + static readonly MEDIUMSLATEBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #00FA9A + <span class="colorSwath" style="background: #00FA9A;"></span> + */ + static readonly MEDIUMSPRINGGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #48D1CC + <span class="colorSwath" style="background: #48D1CC;"></span> + */ + static readonly MEDIUMTURQUOISE: Color; + /** + * An immutable Color instance initialized to CSS color #C71585 + <span class="colorSwath" style="background: #C71585;"></span> + */ + static readonly MEDIUMVIOLETRED: Color; + /** + * An immutable Color instance initialized to CSS color #191970 + <span class="colorSwath" style="background: #191970;"></span> + */ + static readonly MIDNIGHTBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #F5FFFA + <span class="colorSwath" style="background: #F5FFFA;"></span> + */ + static readonly MINTCREAM: Color; + /** + * An immutable Color instance initialized to CSS color #FFE4E1 + <span class="colorSwath" style="background: #FFE4E1;"></span> + */ + static readonly MISTYROSE: Color; + /** + * An immutable Color instance initialized to CSS color #FFE4B5 + <span class="colorSwath" style="background: #FFE4B5;"></span> + */ + static readonly MOCCASIN: Color; + /** + * An immutable Color instance initialized to CSS color #FFDEAD + <span class="colorSwath" style="background: #FFDEAD;"></span> + */ + static readonly NAVAJOWHITE: Color; + /** + * An immutable Color instance initialized to CSS color #000080 + <span class="colorSwath" style="background: #000080;"></span> + */ + static readonly NAVY: Color; + /** + * An immutable Color instance initialized to CSS color #FDF5E6 + <span class="colorSwath" style="background: #FDF5E6;"></span> + */ + static readonly OLDLACE: Color; + /** + * An immutable Color instance initialized to CSS color #808000 + <span class="colorSwath" style="background: #808000;"></span> + */ + static readonly OLIVE: Color; + /** + * An immutable Color instance initialized to CSS color #6B8E23 + <span class="colorSwath" style="background: #6B8E23;"></span> + */ + static readonly OLIVEDRAB: Color; + /** + * An immutable Color instance initialized to CSS color #FFA500 + <span class="colorSwath" style="background: #FFA500;"></span> + */ + static readonly ORANGE: Color; + /** + * An immutable Color instance initialized to CSS color #FF4500 + <span class="colorSwath" style="background: #FF4500;"></span> + */ + static readonly ORANGERED: Color; + /** + * An immutable Color instance initialized to CSS color #DA70D6 + <span class="colorSwath" style="background: #DA70D6;"></span> + */ + static readonly ORCHID: Color; + /** + * An immutable Color instance initialized to CSS color #EEE8AA + <span class="colorSwath" style="background: #EEE8AA;"></span> + */ + static readonly PALEGOLDENROD: Color; + /** + * An immutable Color instance initialized to CSS color #98FB98 + <span class="colorSwath" style="background: #98FB98;"></span> + */ + static readonly PALEGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #AFEEEE + <span class="colorSwath" style="background: #AFEEEE;"></span> + */ + static readonly PALETURQUOISE: Color; + /** + * An immutable Color instance initialized to CSS color #DB7093 + <span class="colorSwath" style="background: #DB7093;"></span> + */ + static readonly PALEVIOLETRED: Color; + /** + * An immutable Color instance initialized to CSS color #FFEFD5 + <span class="colorSwath" style="background: #FFEFD5;"></span> + */ + static readonly PAPAYAWHIP: Color; + /** + * An immutable Color instance initialized to CSS color #FFDAB9 + <span class="colorSwath" style="background: #FFDAB9;"></span> + */ + static readonly PEACHPUFF: Color; + /** + * An immutable Color instance initialized to CSS color #CD853F + <span class="colorSwath" style="background: #CD853F;"></span> + */ + static readonly PERU: Color; + /** + * An immutable Color instance initialized to CSS color #FFC0CB + <span class="colorSwath" style="background: #FFC0CB;"></span> + */ + static readonly PINK: Color; + /** + * An immutable Color instance initialized to CSS color #DDA0DD + <span class="colorSwath" style="background: #DDA0DD;"></span> + */ + static readonly PLUM: Color; + /** + * An immutable Color instance initialized to CSS color #B0E0E6 + <span class="colorSwath" style="background: #B0E0E6;"></span> + */ + static readonly POWDERBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #800080 + <span class="colorSwath" style="background: #800080;"></span> + */ + static readonly PURPLE: Color; + /** + * An immutable Color instance initialized to CSS color #FF0000 + <span class="colorSwath" style="background: #FF0000;"></span> + */ + static readonly RED: Color; + /** + * An immutable Color instance initialized to CSS color #BC8F8F + <span class="colorSwath" style="background: #BC8F8F;"></span> + */ + static readonly ROSYBROWN: Color; + /** + * An immutable Color instance initialized to CSS color #4169E1 + <span class="colorSwath" style="background: #4169E1;"></span> + */ + static readonly ROYALBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #8B4513 + <span class="colorSwath" style="background: #8B4513;"></span> + */ + static readonly SADDLEBROWN: Color; + /** + * An immutable Color instance initialized to CSS color #FA8072 + <span class="colorSwath" style="background: #FA8072;"></span> + */ + static readonly SALMON: Color; + /** + * An immutable Color instance initialized to CSS color #F4A460 + <span class="colorSwath" style="background: #F4A460;"></span> + */ + static readonly SANDYBROWN: Color; + /** + * An immutable Color instance initialized to CSS color #2E8B57 + <span class="colorSwath" style="background: #2E8B57;"></span> + */ + static readonly SEAGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #FFF5EE + <span class="colorSwath" style="background: #FFF5EE;"></span> + */ + static readonly SEASHELL: Color; + /** + * An immutable Color instance initialized to CSS color #A0522D + <span class="colorSwath" style="background: #A0522D;"></span> + */ + static readonly SIENNA: Color; + /** + * An immutable Color instance initialized to CSS color #C0C0C0 + <span class="colorSwath" style="background: #C0C0C0;"></span> + */ + static readonly SILVER: Color; + /** + * An immutable Color instance initialized to CSS color #87CEEB + <span class="colorSwath" style="background: #87CEEB;"></span> + */ + static readonly SKYBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #6A5ACD + <span class="colorSwath" style="background: #6A5ACD;"></span> + */ + static readonly SLATEBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #708090 + <span class="colorSwath" style="background: #708090;"></span> + */ + static readonly SLATEGRAY: Color; + /** + * An immutable Color instance initialized to CSS color #708090 + <span class="colorSwath" style="background: #708090;"></span> + */ + static readonly SLATEGREY: Color; + /** + * An immutable Color instance initialized to CSS color #FFFAFA + <span class="colorSwath" style="background: #FFFAFA;"></span> + */ + static readonly SNOW: Color; + /** + * An immutable Color instance initialized to CSS color #00FF7F + <span class="colorSwath" style="background: #00FF7F;"></span> + */ + static readonly SPRINGGREEN: Color; + /** + * An immutable Color instance initialized to CSS color #4682B4 + <span class="colorSwath" style="background: #4682B4;"></span> + */ + static readonly STEELBLUE: Color; + /** + * An immutable Color instance initialized to CSS color #D2B48C + <span class="colorSwath" style="background: #D2B48C;"></span> + */ + static readonly TAN: Color; + /** + * An immutable Color instance initialized to CSS color #008080 + <span class="colorSwath" style="background: #008080;"></span> + */ + static readonly TEAL: Color; + /** + * An immutable Color instance initialized to CSS color #D8BFD8 + <span class="colorSwath" style="background: #D8BFD8;"></span> + */ + static readonly THISTLE: Color; + /** + * An immutable Color instance initialized to CSS color #FF6347 + <span class="colorSwath" style="background: #FF6347;"></span> + */ + static readonly TOMATO: Color; + /** + * An immutable Color instance initialized to CSS color #40E0D0 + <span class="colorSwath" style="background: #40E0D0;"></span> + */ + static readonly TURQUOISE: Color; + /** + * An immutable Color instance initialized to CSS color #EE82EE + <span class="colorSwath" style="background: #EE82EE;"></span> + */ + static readonly VIOLET: Color; + /** + * An immutable Color instance initialized to CSS color #F5DEB3 + <span class="colorSwath" style="background: #F5DEB3;"></span> + */ + static readonly WHEAT: Color; + /** + * An immutable Color instance initialized to CSS color #FFFFFF + <span class="colorSwath" style="background: #FFFFFF;"></span> + */ + static readonly WHITE: Color; + /** + * An immutable Color instance initialized to CSS color #F5F5F5 + <span class="colorSwath" style="background: #F5F5F5;"></span> + */ + static readonly WHITESMOKE: Color; + /** + * An immutable Color instance initialized to CSS color #FFFF00 + <span class="colorSwath" style="background: #FFFF00;"></span> + */ + static readonly YELLOW: Color; + /** + * An immutable Color instance initialized to CSS color #9ACD32 + <span class="colorSwath" style="background: #9ACD32;"></span> + */ + static readonly YELLOWGREEN: Color; + /** + * An immutable Color instance initialized to CSS transparent. + <span class="colorSwath" style="background: transparent;"></span> + */ + static readonly TRANSPARENT: Color; +} + +/** + * Value and type information for per-instance geometry color. + * @example + * var instance = new Cesium.GeometryInstance({ + geometry : Cesium.BoxGeometry.fromDimensions({ + dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + id : 'box', + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha) + } +}); + * @param [red = 1.0] - The red component. + * @param [green = 1.0] - The green component. + * @param [blue = 1.0] - The blue component. + * @param [alpha = 1.0] - The alpha component. + */ +export class ColorGeometryInstanceAttribute { + constructor(red?: number, green?: number, blue?: number, alpha?: number); + /** + * The values for the attributes stored in a typed array. + */ + value: Uint8Array; + /** + * The datatype of each component in the attribute, e.g., individual elements in + {@link ColorGeometryInstanceAttribute#value}. + */ + readonly componentDatatype: ComponentDatatype; + /** + * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}. + */ + readonly componentsPerAttribute: number; + /** + * When <code>true</code> and <code>componentDatatype</code> is an integer format, + indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. + */ + readonly normalize: boolean; + /** + * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}. + * @example + * var instance = new Cesium.GeometryInstance({ + geometry : geometry, + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE), + } + }); + * @param color - The color. + * @returns The new {@link ColorGeometryInstanceAttribute} instance. + */ + static fromColor(color: Color): ColorGeometryInstanceAttribute; + /** + * Converts a color to a typed array that can be used to assign a color attribute. + * @example + * var attributes = primitive.getGeometryInstanceAttributes('an id'); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color); + * @param color - The color. + * @param [result] - The array to store the result in, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. + */ + static toValue(color: Color, result?: Uint8Array): Uint8Array; + /** + * Compares the provided ColorGeometryInstanceAttributes and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first ColorGeometryInstanceAttribute. + * @param [right] - The second ColorGeometryInstanceAttribute. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: ColorGeometryInstanceAttribute, right?: ColorGeometryInstanceAttribute): boolean; +} + +/** + * Merges two objects, copying their properties onto a new combined object. When two objects have the same +property, the value of the property on the first object is used. If either object is undefined, +it will be treated as an empty object. + * @example + * var object1 = { + propOne : 1, + propTwo : { + value1 : 10 + } +} +var object2 = { + propTwo : 2 +} +var final = Cesium.combine(object1, object2); + +// final === { +// propOne : 1, +// propTwo : { +// value1 : 10 +// } +// } + * @param [object1] - The first object to merge. + * @param [object2] - The second object to merge. + * @param [deep = false] - Perform a recursive merge. + * @returns The combined object containing all properties from both objects. + */ +export function combine(object1?: any, object2?: any, deep?: boolean): any; + +/** + * WebGL component datatypes. Components are intrinsics, +which form attributes, which form vertices. + */ +export enum ComponentDatatype { + /** + * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type + of an element in <code>Int8Array</code>. + */ + BYTE = WebGLConstants.BYTE, + /** + * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type + of an element in <code>Uint8Array</code>. + */ + UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE, + /** + * 16-bit signed short corresponding to <code>SHORT</code> and the type + of an element in <code>Int16Array</code>. + */ + SHORT = WebGLConstants.SHORT, + /** + * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type + of an element in <code>Uint16Array</code>. + */ + UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT, + /** + * 32-bit signed int corresponding to <code>INT</code> and the type + of an element in <code>Int32Array</code>. + */ + INT = WebGLConstants.INT, + /** + * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type + of an element in <code>Uint32Array</code>. + */ + UNSIGNED_INT = WebGLConstants.UNSIGNED_INT, + /** + * 32-bit floating-point corresponding to <code>FLOAT</code> and the type + of an element in <code>Float32Array</code>. + */ + FLOAT = WebGLConstants.FLOAT, + /** + * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL; + this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute}) + and the type of an element in <code>Float64Array</code>. + */ + DOUBLE = WebGLConstants.DOUBLE +} + +/** + * Describes a compressed texture and contains a compressed texture buffer. + * @param internalFormat - The pixel format of the compressed texture. + * @param width - The width of the texture. + * @param height - The height of the texture. + * @param buffer - The compressed texture buffer. + */ +export class CompressedTextureBuffer { + constructor(internalFormat: PixelFormat, width: number, height: number, buffer: Uint8Array); + /** + * The format of the compressed texture. + */ + readonly internalFormat: PixelFormat; + /** + * The width of the texture. + */ + readonly width: number; + /** + * The height of the texture. + */ + readonly height: number; + /** + * The compressed texture buffer. + */ + readonly bufferView: Uint8Array; + /** + * Creates a shallow clone of a compressed texture buffer. + * @param object - The compressed texture buffer to be cloned. + * @returns A shallow clone of the compressed texture buffer. + */ + static clone(object: CompressedTextureBuffer): CompressedTextureBuffer; + /** + * Creates a shallow clone of this compressed texture buffer. + * @returns A shallow clone of the compressed texture buffer. + */ + clone(): CompressedTextureBuffer; +} + +/** + * A description of a polygon composed of arbitrary coplanar positions. + * @example + * var polygonGeometry = new Cesium.CoplanarPolygonGeometry({ + polygonHierarchy: new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArrayHeights([ + -90.0, 30.0, 0.0, + -90.0, 30.0, 300000.0, + -80.0, 30.0, 300000.0, + -80.0, 30.0, 0.0 + ])) +}); + * @param options - Object with the following properties: + * @param options.polygonHierarchy - A polygon hierarchy that can include holes. + * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + */ +export class CoplanarPolygonGeometry { + constructor(options: { + polygonHierarchy: PolygonHierarchy + stRotation?: number + vertexFormat?: VertexFormat + ellipsoid?: Ellipsoid + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * A description of a coplanar polygon from an array of positions. + * @example + * // create a polygon from points + var polygon = Cesium.CoplanarPolygonGeometry.fromPositions({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + }); + var geometry = Cesium.PolygonGeometry.createGeometry(polygon); + * @param options - Object with the following properties: + * @param options.positions - An array of positions that defined the corner points of the polygon. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + */ + static fromPositions(options: { + positions: Cartesian3[] + vertexFormat?: VertexFormat + stRotation?: number + ellipsoid?: Ellipsoid + }): CoplanarPolygonGeometry; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry; + /** + * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere. + * @param polygonGeometry - A description of the polygon. + * @returns The computed vertices and indices. + */ + static createGeometry(polygonGeometry: CoplanarPolygonGeometry): Geometry | undefined; +} + +/** + * A description of the outline of a polygon composed of arbitrary coplanar positions. + * @example + * var polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArrayHeights([ + -90.0, 30.0, 0.0, + -90.0, 30.0, 1000.0, + -80.0, 30.0, 1000.0, + -80.0, 30.0, 0.0 + ]) +}); +var geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline); + * @param options - Object with the following properties: + * @param options.polygonHierarchy - A polygon hierarchy that can include holes. + */ +export class CoplanarPolygonOutlineGeometry { + constructor(options: { + polygonHierarchy: PolygonHierarchy + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * A description of a coplanar polygon outline from an array of positions. + * @param options - Object with the following properties: + * @param options.positions - An array of positions that defined the corner points of the polygon. + */ + static fromPositions(options: { + positions: Cartesian3[] + }): CoplanarPolygonOutlineGeometry; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: CoplanarPolygonOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonOutlineGeometry): CoplanarPolygonOutlineGeometry; + /** + * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere. + * @param polygonGeometry - A description of the polygon. + * @returns The computed vertices and indices. + */ + static createGeometry(polygonGeometry: CoplanarPolygonOutlineGeometry): Geometry | undefined; +} + +/** + * Style options for corners. + */ +export enum CornerType { + /** + * <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" /> + + Corner has a smooth edge. + */ + ROUNDED = 0, + /** + * <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" /> + + Corner point is the intersection of adjacent edges. + */ + MITERED = 1, + /** + * <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" /> + + Corner is clipped. + */ + BEVELED = 2 +} + +/** + * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. + * @example + * var corridor = new Cesium.CorridorGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]), + width : 100000 +}); + * @param options - Object with the following properties: + * @param options.positions - An array of positions that define the center of the corridor. + * @param options.width - The distance between the edges of the corridor in meters. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.height = 0] - The distance in meters between the ellipsoid surface and the positions. + * @param [options.extrudedHeight] - The distance in meters between the ellipsoid surface and the extruded face. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners. + */ +export class CorridorGeometry { + constructor(options: { + positions: Cartesian3[] + width: number + ellipsoid?: Ellipsoid + granularity?: number + height?: number + extrudedHeight?: number + vertexFormat?: VertexFormat + cornerType?: CornerType + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: CorridorGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new CorridorGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry; + /** + * Computes the bounding rectangle given the provided options + * @param options - Object with the following properties: + * @param options.positions - An array of positions that define the center of the corridor. + * @param options.width - The distance between the edges of the corridor in meters. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners. + * @param [result] - An object in which to store the result. + * @returns The result rectangle. + */ + static computeRectangle(options: { + positions: Cartesian3[] + width: number + ellipsoid?: Ellipsoid + cornerType?: CornerType + }, result?: Rectangle): Rectangle; + /** + * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere. + * @param corridorGeometry - A description of the corridor. + * @returns The computed vertices and indices. + */ + static createGeometry(corridorGeometry: CorridorGeometry): Geometry | undefined; +} + +/** + * A description of a corridor outline. + * @example + * var corridor = new Cesium.CorridorOutlineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]), + width : 100000 +}); + * @param options - Object with the following properties: + * @param options.positions - An array of positions that define the center of the corridor outline. + * @param options.width - The distance between the edges of the corridor outline. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.height = 0] - The distance in meters between the positions and the ellipsoid surface. + * @param [options.extrudedHeight] - The distance in meters between the extruded face and the ellipsoid surface. + * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners. + */ +export class CorridorOutlineGeometry { + constructor(options: { + positions: Cartesian3[] + width: number + ellipsoid?: Ellipsoid + granularity?: number + height?: number + extrudedHeight?: number + cornerType?: CornerType + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: CorridorOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry; + /** + * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere. + * @param corridorOutlineGeometry - A description of the corridor. + * @returns The computed vertices and indices. + */ + static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined; +} + +/** + * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time. + * @example + * this.guid = Cesium.createGuid(); + */ +export function createGuid(): string; + +/** + * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}. + * @example + * // Create Cesium World Terrain with default settings +var viewer = new Cesium.Viewer('cesiumContainer', { + terrainProvider : Cesium.createWorldTerrain(); +}); + * @example + * // Create Cesium World Terrain with water and normals. +var viewer = new Cesium.Viewer('cesiumContainer', { + terrainProvider : Cesium.createWorldTerrain({ + requestWaterMask : true, + requestVertexNormals : true + }); +}); + * @param [options] - Object with the following properties: + * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available. + * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available. + */ +export function createWorldTerrain(options?: { + requestVertexNormals?: boolean + requestWaterMask?: boolean +}): CesiumTerrainProvider; + +/** + * A credit contains data pertaining to how to display attributions/credits for certain content on the screen. + * @example + * //Create a credit with a tooltip, image and link +var credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>'); + * @param html - An string representing an html code snippet + * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover + */ +export class Credit { + constructor(html: string, showOnScreen?: boolean); + /** + * The credit content + */ + readonly html: string; + /** + * Whether the credit should be displayed on screen or in a lightbox + */ + readonly showOnScreen: boolean; + /** + * Gets the credit element + */ + readonly element: HTMLElement; + /** + * Returns true if the credits are equal + * @param left - The first credit + * @param right - The second credit + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left: Credit, right: Credit): boolean; + /** + * Returns true if the credits are equal + * @param credit - The credit to compare to. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(credit: Credit): boolean; + /** + * Duplicates a Credit instance. + * @param [credit] - The Credit to duplicate. + * @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined) + */ + static clone(credit?: Credit): Credit; +} + +/** + * Defines functions for 3rd order polynomial functions of one variable with only real coefficients. + */ +export namespace CubicRealPolynomial { + /** + * Provides the discriminant of the cubic equation from the supplied coefficients. + * @param a - The coefficient of the 3rd order monomial. + * @param b - The coefficient of the 2nd order monomial. + * @param c - The coefficient of the 1st order monomial. + * @param d - The coefficient of the 0th order monomial. + * @returns The value of the discriminant. + */ + function computeDiscriminant(a: number, b: number, c: number, d: number): number; + /** + * Provides the real valued roots of the cubic polynomial with the provided coefficients. + * @param a - The coefficient of the 3rd order monomial. + * @param b - The coefficient of the 2nd order monomial. + * @param c - The coefficient of the 1st order monomial. + * @param d - The coefficient of the 0th order monomial. + * @returns The real valued roots. + */ + function computeRealRoots(a: number, b: number, c: number, d: number): number[]; +} + +/** + * The culling volume defined by planes. + * @param [planes] - An array of clipping planes. + */ +export class CullingVolume { + constructor(planes?: Cartesian4[]); + /** + * Each plane is represented by a Cartesian4 object, where the x, y, and z components + define the unit vector normal to the plane, and the w component is the distance of the + plane from the origin. + */ + planes: Cartesian4[]; + /** + * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere. + The planes are aligned to the x, y, and z axes in world coordinates. + * @param boundingSphere - The bounding sphere used to create the culling volume. + * @param [result] - The object onto which to store the result. + * @returns The culling volume created from the bounding sphere. + */ + static fromBoundingSphere(boundingSphere: BoundingSphere, result?: CullingVolume): CullingVolume; + /** + * Determines whether a bounding volume intersects the culling volume. + * @param boundingVolume - The bounding volume whose intersection with the culling volume is to be tested. + * @returns Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE. + */ + computeVisibility(boundingVolume: any): Intersect; +} + +/** + * A description of a cylinder. + * @example + * // create cylinder geometry +var cylinder = new Cesium.CylinderGeometry({ + length: 200000, + topRadius: 80000, + bottomRadius: 200000, +}); +var geometry = Cesium.CylinderGeometry.createGeometry(cylinder); + * @param options - Object with the following properties: + * @param options.length - The length of the cylinder. + * @param options.topRadius - The radius of the top of the cylinder. + * @param options.bottomRadius - The radius of the bottom of the cylinder. + * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ +export class CylinderGeometry { + constructor(options: { + length: number + topRadius: number + bottomRadius: number + slices?: number + vertexFormat?: VertexFormat + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: CylinderGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new CylinderGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry; + /** + * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere. + * @param cylinderGeometry - A description of the cylinder. + * @returns The computed vertices and indices. + */ + static createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined; +} + +/** + * A description of the outline of a cylinder. + * @example + * // create cylinder geometry +var cylinder = new Cesium.CylinderOutlineGeometry({ + length: 200000, + topRadius: 80000, + bottomRadius: 200000, +}); +var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder); + * @param options - Object with the following properties: + * @param options.length - The length of the cylinder. + * @param options.topRadius - The radius of the top of the cylinder. + * @param options.bottomRadius - The radius of the bottom of the cylinder. + * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder. + * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surfaces of the cylinder. + */ +export class CylinderOutlineGeometry { + constructor(options: { + length: number + topRadius: number + bottomRadius: number + slices?: number + numberOfVerticalLines?: number + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: CylinderOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry; + /** + * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere. + * @param cylinderGeometry - A description of the cylinder outline. + * @returns The computed vertices and indices. + */ + static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry | undefined; +} + +/** + * A simple proxy that appends the desired resource as the sole query parameter +to the given proxy URL. + * @param proxy - The proxy URL that will be used to requests all resources. + */ +export class DefaultProxy extends Proxy { + constructor(proxy: string); + /** + * Get the final URL to use to request a given resource. + * @param resource - The resource to request. + * @returns proxied resource + */ + getURL(resource: string): string; +} + +/** + * Returns the first parameter if not undefined, otherwise the second parameter. +Useful for setting a default value for a parameter. + * @example + * param = Cesium.defaultValue(param, 'default'); + * @returns Returns the first parameter if not undefined, otherwise the second parameter. + */ +export function defaultValue(a: any, b: any): any; + +/** + * @example + * if (Cesium.defined(positions)) { + doSomething(); +} else { + doSomethingElse(); +} + * @param value - The object. + * @returns Returns true if the object is defined, returns false otherwise. + */ +export function defined(value: any): boolean; + +/** + * Destroys an object. Each of the object's functions, including functions in its prototype, +is replaced with a function that throws a {@link DeveloperError}, except for the object's +<code>isDestroyed</code> function, which is set to a function that returns <code>true</code>. +The object's properties are removed with <code>delete</code>. +<br /><br /> +This function is used by objects that hold native resources, e.g., WebGL resources, which +need to be explicitly released. Client code calls an object's <code>destroy</code> function, +which then releases the native resource and calls <code>destroyObject</code> to put itself +in a destroyed state. + * @example + * // How a texture would destroy itself. +this.destroy = function () { + _gl.deleteTexture(_texture); + return Cesium.destroyObject(this); +}; + * @param object - The object to destroy. + * @param [message] - The message to include in the exception that is thrown if + a destroyed object's function is called. + */ +export function destroyObject(object: any, message?: string): void; + +/** + * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument, +argument out of range, etc. This exception should only be thrown during development; +it usually indicates a bug in the calling code. This exception should never be +caught; instead the calling code should strive not to generate it. +<br /><br /> +On the other hand, a {@link RuntimeError} indicates an exception that may +be thrown at runtime, e.g., out of memory, that the calling code should be prepared +to catch. + * @param [message] - The error message for this exception. + */ +export class DeveloperError extends Error { + constructor(message?: string); + /** + * 'DeveloperError' indicating that this exception was thrown due to a developer error. + */ + readonly name: string; + /** + * The explanation for why this exception was thrown. + */ + readonly message: string; + /** + * The stack trace of this exception, if available. + */ + readonly stack: string; +} + +/** + * Determines visibility based on the distance to the camera. + * @example + * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters. +billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0); + * @param [near = 0.0] - The smallest distance in the interval where the object is visible. + * @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible. + */ +export class DistanceDisplayCondition { + constructor(near?: number, far?: number); + /** + * The smallest distance in the interval where the object is visible. + */ + near: number; + /** + * The largest distance in the interval where the object is visible. + */ + far: number; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: DistanceDisplayCondition, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new DistanceDisplayCondition instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: DistanceDisplayCondition): DistanceDisplayCondition; + /** + * Determines if two distance display conditions are equal. + * @param left - A distance display condition. + * @param right - Another distance display condition. + * @returns Whether the two distance display conditions are equal. + */ + static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean; + /** + * Duplicates a distance display condition instance. + * @param [value] - The distance display condition to duplicate. + * @param [result] - The result onto which to store the result. + * @returns The duplicated instance. + */ + static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition; + /** + * Duplicates this instance. + * @param [result] - The result onto which to store the result. + * @returns The duplicated instance. + */ + clone(result?: DistanceDisplayCondition): DistanceDisplayCondition; + /** + * Determines if this distance display condition is equal to another. + * @param other - Another distance display condition. + * @returns Whether this distance display condition is equal to the other. + */ + equals(other: DistanceDisplayCondition): boolean; +} + +/** + * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition. + * @example + * var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.BoxGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, + minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0), + maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0) + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + id : 'box', + attributes : { + distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0) + } +}); + * @param [near = 0.0] - The near distance. + * @param [far = Number.MAX_VALUE] - The far distance. + */ +export class DistanceDisplayConditionGeometryInstanceAttribute { + constructor(near?: number, far?: number); + /** + * The values for the attributes stored in a typed array. + */ + value: Float32Array; + /** + * The datatype of each component in the attribute, e.g., individual elements in + {@link DistanceDisplayConditionGeometryInstanceAttribute#value}. + */ + readonly componentDatatype: ComponentDatatype; + /** + * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}. + */ + readonly componentsPerAttribute: number; + /** + * When <code>true</code> and <code>componentDatatype</code> is an integer format, + indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. + */ + readonly normalize: boolean; + /** + * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}. + * @example + * var distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0); + var instance = new Cesium.GeometryInstance({ + geometry : geometry, + attributes : { + distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition) + } + }); + * @param distanceDisplayCondition - The distance display condition. + * @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance. + */ + static fromDistanceDisplayCondition(distanceDisplayCondition: DistanceDisplayCondition): DistanceDisplayConditionGeometryInstanceAttribute; + /** + * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute. + * @example + * var attributes = primitive.getGeometryInstanceAttributes('an id'); + attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition); + * @param distanceDisplayCondition - The distance display condition value. + * @param [result] - The array to store the result in, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. + */ + static toValue(distanceDisplayCondition: DistanceDisplayCondition, result?: Float32Array): Float32Array; +} + +/** + * Easing functions for use with TweenCollection. These function are from +{@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the +{@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}. + */ +export namespace EasingFunction { + /** + * Linear easing. + */ + const LINEAR_NONE: EasingFunction.Callback + /** + * Quadratic in. + */ + const QUADRATIC_IN: EasingFunction.Callback + /** + * Quadratic out. + */ + const QUADRATIC_OUT: EasingFunction.Callback + /** + * Quadratic in then out. + */ + const QUADRATIC_IN_OUT: EasingFunction.Callback + /** + * Cubic in. + */ + const CUBIC_IN: EasingFunction.Callback + /** + * Cubic out. + */ + const CUBIC_OUT: EasingFunction.Callback + /** + * Cubic in then out. + */ + const CUBIC_IN_OUT: EasingFunction.Callback + /** + * Quartic in. + */ + const QUARTIC_IN: EasingFunction.Callback + /** + * Quartic out. + */ + const QUARTIC_OUT: EasingFunction.Callback + /** + * Quartic in then out. + */ + const QUARTIC_IN_OUT: EasingFunction.Callback + /** + * Quintic in. + */ + const QUINTIC_IN: EasingFunction.Callback + /** + * Quintic out. + */ + const QUINTIC_OUT: EasingFunction.Callback + /** + * Quintic in then out. + */ + const QUINTIC_IN_OUT: EasingFunction.Callback + /** + * Sinusoidal in. + */ + const SINUSOIDAL_IN: EasingFunction.Callback + /** + * Sinusoidal out. + */ + const SINUSOIDAL_OUT: EasingFunction.Callback + /** + * Sinusoidal in then out. + */ + const SINUSOIDAL_IN_OUT: EasingFunction.Callback + /** + * Exponential in. + */ + const EXPONENTIAL_IN: EasingFunction.Callback + /** + * Exponential out. + */ + const EXPONENTIAL_OUT: EasingFunction.Callback + /** + * Exponential in then out. + */ + const EXPONENTIAL_IN_OUT: EasingFunction.Callback + /** + * Circular in. + */ + const CIRCULAR_IN: EasingFunction.Callback + /** + * Circular out. + */ + const CIRCULAR_OUT: EasingFunction.Callback + /** + * Circular in then out. + */ + const CIRCULAR_IN_OUT: EasingFunction.Callback + /** + * Elastic in. + */ + const ELASTIC_IN: EasingFunction.Callback + /** + * Elastic out. + */ + const ELASTIC_OUT: EasingFunction.Callback + /** + * Elastic in then out. + */ + const ELASTIC_IN_OUT: EasingFunction.Callback + /** + * Back in. + */ + const BACK_IN: EasingFunction.Callback + /** + * Back out. + */ + const BACK_OUT: EasingFunction.Callback + /** + * Back in then out. + */ + const BACK_IN_OUT: EasingFunction.Callback + /** + * Bounce in. + */ + const BOUNCE_IN: EasingFunction.Callback + /** + * Bounce out. + */ + const BOUNCE_OUT: EasingFunction.Callback + /** + * Bounce in then out. + */ + const BOUNCE_IN_OUT: EasingFunction.Callback + /** + * Function interface for implementing a custom easing function. + * @example + * function quadraticIn(time) { + return time * time; + } + * @example + * function quadraticOut(time) { + return time * (2.0 - time); + } + * @param time - The time in the range <code>[0, 1]</code>. + */ + type Callback = (time: number) => number; +} + +/** + * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. + * @example + * // Create an ellipse. +var ellipse = new Cesium.EllipseGeometry({ + center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), + semiMajorAxis : 500000.0, + semiMinorAxis : 300000.0, + rotation : Cesium.Math.toRadians(60.0) +}); +var geometry = Cesium.EllipseGeometry.createGeometry(ellipse); + * @param options - Object with the following properties: + * @param options.center - The ellipse's center point in the fixed frame. + * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters. + * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on. + * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface. + * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface. + * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north. + * @param [options.stRotation = 0.0] - The rotation of the texture coordinates counter-clockwise from north. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ +export class EllipseGeometry { + constructor(options: { + center: Cartesian3 + semiMajorAxis: number + semiMinorAxis: number + ellipsoid?: Ellipsoid + height?: number + extrudedHeight?: number + rotation?: number + stRotation?: number + granularity?: number + vertexFormat?: VertexFormat + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: EllipseGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new EllipseGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry; + /** + * Computes the bounding rectangle based on the provided options + * @param options - Object with the following properties: + * @param options.center - The ellipse's center point in the fixed frame. + * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters. + * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on. + * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians. + * @param [result] - An object in which to store the result + * @returns The result rectangle + */ + static computeRectangle(options: { + center: Cartesian3 + semiMajorAxis: number + semiMinorAxis: number + ellipsoid?: Ellipsoid + rotation?: number + granularity?: number + }, result?: Rectangle): Rectangle; + /** + * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere. + * @param ellipseGeometry - A description of the ellipse. + * @returns The computed vertices and indices. + */ + static createGeometry(ellipseGeometry: EllipseGeometry): Geometry | undefined; +} + +/** + * A description of the outline of an ellipse on an ellipsoid. + * @example + * var ellipse = new Cesium.EllipseOutlineGeometry({ + center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), + semiMajorAxis : 500000.0, + semiMinorAxis : 300000.0, + rotation : Cesium.Math.toRadians(60.0) +}); +var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse); + * @param options - Object with the following properties: + * @param options.center - The ellipse's center point in the fixed frame. + * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters. + * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on. + * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface. + * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface. + * @param [options.rotation = 0.0] - The angle from north (counter-clockwise) in radians. + * @param [options.granularity = 0.02] - The angular distance between points on the ellipse in radians. + * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surface of an extruded ellipse. + */ +export class EllipseOutlineGeometry { + constructor(options: { + center: Cartesian3 + semiMajorAxis: number + semiMinorAxis: number + ellipsoid?: Ellipsoid + height?: number + extrudedHeight?: number + rotation?: number + granularity?: number + numberOfVerticalLines?: number + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: EllipseOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry; + /** + * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere. + * @param ellipseGeometry - A description of the ellipse. + * @returns The computed vertices and indices. + */ + static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry | undefined; +} + +/** + * A quadratic surface defined in Cartesian coordinates by the equation +<code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>. Primarily used +by Cesium to represent the shape of planetary bodies. + +Rather than constructing this object directly, one of the provided +constants is normally used. + * @param [x = 0] - The radius in the x direction. + * @param [y = 0] - The radius in the y direction. + * @param [z = 0] - The radius in the z direction. + */ +export class Ellipsoid { + constructor(x?: number, y?: number, z?: number); + /** + * Gets the radii of the ellipsoid. + */ + readonly radii: Cartesian3; + /** + * Gets the squared radii of the ellipsoid. + */ + readonly radiiSquared: Cartesian3; + /** + * Gets the radii of the ellipsoid raise to the fourth power. + */ + readonly radiiToTheFourth: Cartesian3; + /** + * Gets one over the radii of the ellipsoid. + */ + readonly oneOverRadii: Cartesian3; + /** + * Gets one over the squared radii of the ellipsoid. + */ + readonly oneOverRadiiSquared: Cartesian3; + /** + * Gets the minimum radius of the ellipsoid. + */ + readonly minimumRadius: number; + /** + * Gets the maximum radius of the ellipsoid. + */ + readonly maximumRadius: number; + /** + * Duplicates an Ellipsoid instance. + * @param ellipsoid - The ellipsoid to duplicate. + * @param [result] - The object onto which to store the result, or undefined if a new + instance should be created. + * @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined) + */ + static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid; + /** + * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. + * @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions. + * @param [result] - The object onto which to store the result, or undefined if a new + instance should be created. + * @returns A new Ellipsoid instance. + */ + static fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid; + /** + * An Ellipsoid instance initialized to the WGS84 standard. + */ + static readonly WGS84: Ellipsoid; + /** + * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0). + */ + static readonly UNIT_SPHERE: Ellipsoid; + /** + * An Ellipsoid instance initialized to a sphere with the lunar radius. + */ + static readonly MOON: Ellipsoid; + /** + * Duplicates an Ellipsoid instance. + * @param [result] - The object onto which to store the result, or undefined if a new + instance should be created. + * @returns The cloned Ellipsoid. + */ + clone(result?: Ellipsoid): Ellipsoid; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Ellipsoid, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Ellipsoid instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid; + /** + * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position. + * @param cartesian - The Cartesian for which to to determine the geocentric normal. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if none was provided. + */ + geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position. + * @param cartographic - The cartographic position for which to to determine the geodetic normal. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if none was provided. + */ + geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + /** + * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position. + * @param cartesian - The Cartesian position for which to to determine the surface normal. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found. + */ + geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Converts the provided cartographic to Cartesian representation. + * @example + * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid. + var position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000); + var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position); + * @param cartographic - The cartographic position. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if none was provided. + */ + cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + /** + * Converts the provided array of cartographics to an array of Cartesians. + * @example + * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid. + var positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0), + new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100), + new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)]; + var cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions); + * @param cartographics - An array of cartographic positions. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Array instance if none was provided. + */ + cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[]; + /** + * Converts the provided cartesian to cartographic representation. + The cartesian is undefined at the center of the ellipsoid. + * @example + * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid. + var position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73); + var cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position); + * @param cartesian - The Cartesian position to convert to cartographic representation. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid. + */ + cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic; + /** + * Converts the provided array of cartesians to an array of cartographics. + * @example + * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid. + var positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73), + new Cesium.Cartesian3(17832.13, 83234.53, 952313.73), + new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)] + var cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions); + * @param cartesians - An array of Cartesian positions. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Array instance if none was provided. + */ + cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[]; + /** + * Scales the provided Cartesian position along the geodetic surface normal + so that it is on the surface of this ellipsoid. If the position is + at the center of the ellipsoid, this function returns undefined. + * @param cartesian - The Cartesian position to scale. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center. + */ + scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Scales the provided Cartesian position along the geocentric surface normal + so that it is on the surface of this ellipsoid. + * @param cartesian - The Cartesian position to scale. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian3 instance if none was provided. + */ + scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying + its components by the result of {@link Ellipsoid#oneOverRadii}. + * @param position - The position to transform. + * @param [result] - The position to which to copy the result, or undefined to create and + return a new instance. + * @returns The position expressed in the scaled space. The returned instance is the + one passed as the result parameter if it is not undefined, or a new instance of it is. + */ + transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying + its components by the result of {@link Ellipsoid#radii}. + * @param position - The position to transform. + * @param [result] - The position to which to copy the result, or undefined to create and + return a new instance. + * @returns The position expressed in the unscaled space. The returned instance is the + one passed as the result parameter if it is not undefined, or a new instance of it is. + */ + transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The other Ellipsoid. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: Ellipsoid): boolean; + /** + * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'. + * @returns A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'. + */ + toString(): string; + /** + * Computes a point which is the intersection of the surface normal with the z-axis. + * @param position - the position. must be on the surface of the ellipsoid. + * @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid. + In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center. + In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis). + Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2 + * @param [result] - The cartesian to which to copy the result, or undefined to create and + return a new instance. + * @returns the intersection point if it's inside the ellipsoid, undefined otherwise + */ + getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined; + /** + * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using + Gauss-Legendre 10th order quadrature. + * @param rectangle - The rectangle used for computing the surface area. + * @returns The approximate area of the rectangle on the surface of this ellipsoid. + */ + surfaceArea(rectangle: Rectangle): number; +} + +/** + * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points. + * @param [start] - The initial planetodetic point on the path. + * @param [end] - The final planetodetic point on the path. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the geodesic lies. + */ +export class EllipsoidGeodesic { + constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid); + /** + * Gets the ellipsoid. + */ + readonly ellipsoid: Ellipsoid; + /** + * Gets the surface distance between the start and end point + */ + readonly surfaceDistance: number; + /** + * Gets the initial planetodetic point on the path. + */ + readonly start: Cartographic; + /** + * Gets the final planetodetic point on the path. + */ + readonly end: Cartographic; + /** + * Gets the heading at the initial point. + */ + readonly startHeading: number; + /** + * Gets the heading at the final point. + */ + readonly endHeading: number; + /** + * Sets the start and end points of the geodesic + * @param start - The initial planetodetic point on the path. + * @param end - The final planetodetic point on the path. + */ + setEndPoints(start: Cartographic, end: Cartographic): void; + /** + * Provides the location of a point at the indicated portion along the geodesic. + * @param fraction - The portion of the distance between the initial and final points. + * @param [result] - The object in which to store the result. + * @returns The location of the point along the geodesic. + */ + interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic; + /** + * Provides the location of a point at the indicated distance along the geodesic. + * @param distance - The distance from the inital point to the point of interest along the geodesic + * @param [result] - The object in which to store the result. + * @returns The location of the point along the geodesic. + */ + interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic; +} + +/** + * A description of an ellipsoid centered at the origin. + * @example + * var ellipsoid = new Cesium.EllipsoidGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0) +}); +var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid); + * @param [options] - Object with the following properties: + * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions. + * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions. + * @param [options.minimumClock = 0.0] - The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis. + * @param [options.maximumClock = 2*PI] - The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis. + * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis. + * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis. + * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks. + * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ +export class EllipsoidGeometry { + constructor(options?: { + radii?: Cartesian3 + innerRadii?: Cartesian3 + minimumClock?: number + maximumClock?: number + minimumCone?: number + maximumCone?: number + stackPartitions?: number + slicePartitions?: number + vertexFormat?: VertexFormat + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: EllipsoidGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new EllipsoidGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry; + /** + * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere. + * @param ellipsoidGeometry - A description of the ellipsoid. + * @returns The computed vertices and indices. + */ + static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry | undefined; +} + +/** + * A description of the outline of an ellipsoid centered at the origin. + * @example + * var ellipsoid = new Cesium.EllipsoidOutlineGeometry({ + radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0), + stackPartitions: 6, + slicePartitions: 5 +}); +var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid); + * @param [options] - Object with the following properties: + * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions. + * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions. + * @param [options.minimumClock = 0.0] - The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis. + * @param [options.maximumClock = 2*PI] - The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis. + * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis. + * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis. + * @param [options.stackPartitions = 10] - The count of stacks for the ellipsoid (1 greater than the number of parallel lines). + * @param [options.slicePartitions = 8] - The count of slices for the ellipsoid (Equal to the number of radial lines). + * @param [options.subdivisions = 128] - The number of points per line, determining the granularity of the curvature. + */ +export class EllipsoidOutlineGeometry { + constructor(options?: { + radii?: Cartesian3 + innerRadii?: Cartesian3 + minimumClock?: number + maximumClock?: number + minimumCone?: number + maximumCone?: number + stackPartitions?: number + slicePartitions?: number + subdivisions?: number + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: EllipsoidOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry; + /** + * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere. + * @param ellipsoidGeometry - A description of the ellipsoid outline. + * @returns The computed vertices and indices. + */ + static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry | undefined; +} + +/** + * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points. + * @param [start] - The initial planetodetic point on the path. + * @param [end] - The final planetodetic point on the path. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies. + */ +export class EllipsoidRhumbLine { + constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid); + /** + * Gets the ellipsoid. + */ + readonly ellipsoid: Ellipsoid; + /** + * Gets the surface distance between the start and end point + */ + readonly surfaceDistance: number; + /** + * Gets the initial planetodetic point on the path. + */ + readonly start: Cartographic; + /** + * Gets the final planetodetic point on the path. + */ + readonly end: Cartographic; + /** + * Gets the heading from the start point to the end point. + */ + readonly heading: number; + /** + * Create a rhumb line using an initial position with a heading and distance. + * @param start - The initial planetodetic point on the path. + * @param heading - The heading in radians. + * @param distance - The rhumb line distance between the start and end point. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies. + * @param [result] - The object in which to store the result. + * @returns The EllipsoidRhumbLine object. + */ + static fromStartHeadingDistance(start: Cartographic, heading: number, distance: number, ellipsoid?: Ellipsoid, result?: EllipsoidRhumbLine): EllipsoidRhumbLine; + /** + * Sets the start and end points of the rhumb line. + * @param start - The initial planetodetic point on the path. + * @param end - The final planetodetic point on the path. + */ + setEndPoints(start: Cartographic, end: Cartographic): void; + /** + * Provides the location of a point at the indicated portion along the rhumb line. + * @param fraction - The portion of the distance between the initial and final points. + * @param [result] - The object in which to store the result. + * @returns The location of the point along the rhumb line. + */ + interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic; + /** + * Provides the location of a point at the indicated distance along the rhumb line. + * @param distance - The distance from the inital point to the point of interest along the rhumbLine. + * @param [result] - The object in which to store the result. + * @returns The location of the point along the rhumb line. + */ + interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic; + /** + * Provides the location of a point at the indicated longitude along the rhumb line. + If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line. + * @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading. + * @param [result] - The object in which to store the result. + * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections. + */ + findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic; + /** + * Provides the location of a point at the indicated latitude along the rhumb line. + If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line. + * @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading. + * @param [result] - The object in which to store the result. + * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections. + */ + findIntersectionWithLatitude(intersectionLatitude: number, result?: Cartographic): Cartographic; +} + +/** + * A plane tangent to the provided ellipsoid at the provided origin. +If origin is not on the surface of the ellipsoid, it's surface projection will be used. +If origin is at the center of the ellipsoid, an exception will be thrown. + * @param origin - The point on the surface of the ellipsoid where the tangent plane touches. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use. + */ +export class EllipsoidTangentPlane { + constructor(origin: Cartesian3, ellipsoid?: Ellipsoid); + /** + * Gets the ellipsoid. + */ + ellipsoid: Ellipsoid; + /** + * Gets the origin. + */ + origin: Cartesian3; + /** + * Gets the plane which is tangent to the ellipsoid. + */ + readonly plane: Plane; + /** + * Gets the local X-axis (east) of the tangent plane. + */ + readonly xAxis: Cartesian3; + /** + * Gets the local Y-axis (north) of the tangent plane. + */ + readonly yAxis: Cartesian3; + /** + * Gets the local Z-axis (up) of the tangent plane. + */ + readonly zAxis: Cartesian3; + /** + * Creates a new instance from the provided ellipsoid and the center + point of the provided Cartesians. + * @param cartesians - The list of positions surrounding the center point. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use. + * @returns The new instance of EllipsoidTangentPlane. + */ + static fromPoints(cartesians: Cartesian3[], ellipsoid?: Ellipsoid): EllipsoidTangentPlane; + /** + * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin. + * @param cartesian - The point to project. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point + */ + projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; + /** + * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin. + The resulting array may be shorter than the input array - if a single projection is impossible it will not be included. + * @param cartesians - The array of points to project. + * @param [result] - The array of Cartesian2 instances onto which to store results. + * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided. + */ + projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[]; + /** + * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal. + * @param cartesian - The point to project. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if none was provided. + */ + projectPointToNearestOnPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; + /** + * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal. + * @param cartesians - The array of points to project. + * @param [result] - The array of Cartesian2 instances onto which to store results. + * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as <code>cartesians</code>. + */ + projectPointsToNearestOnPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[]; + /** + * Computes the projection of the provided 2D position onto the 3D ellipsoid. + * @param cartesian - The points to project. + * @param [result] - The Cartesian3 instance to store result. + * @returns The modified result parameter or a new Cartesian3 instance if none was provided. + */ + projectPointOntoEllipsoid(cartesian: Cartesian2, result?: Cartesian3): Cartesian3; + /** + * Computes the projection of the provided 2D positions onto the 3D ellipsoid. + * @param cartesians - The array of points to project. + * @param [result] - The array of Cartesian3 instances onto which to store results. + * @returns The modified result parameter or a new array of Cartesian3 instances if none was provided. + */ + projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[]; +} + +/** + * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal +surface. + * @param [options] - Object with the following properties: + * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal +surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme} +is used. + * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified, +this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither +parameter is specified, the WGS84 ellipsoid is used. + */ +export class EllipsoidTerrainProvider { + constructor(options?: { + tilingScheme?: TilingScheme + ellipsoid?: Ellipsoid + }); + /** + * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + errorEvent: Event; + /** + * Gets the credit to display when this terrain provider is active. Typically this is used to credit + the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true. + */ + credit: Credit; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link EllipsoidTerrainProvider#ready} returns true. + */ + tilingScheme: GeographicTilingScheme; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets a value indicating whether or not the provider includes a water mask. The water mask + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link EllipsoidTerrainProvider#ready} returns true. + */ + hasWaterMask: boolean; + /** + * Gets a value indicating whether or not the requested tiles include vertex normals. + This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true. + */ + hasVertexNormals: boolean; + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + at points and in rectangles. This function should not be called before + {@link TerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. + */ + availability: TileAvailability; + /** + * Requests the geometry for a given tile. This function should not be called before + {@link TerrainProvider#ready} returns true. The result includes terrain + data and indicates that all child tiles are available. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the requested geometry. If this method + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. + */ + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined; + /** + * Gets the maximum geometric error allowed in a tile at a given level. + * @param level - The tile level for which to get the maximum geometric error. + * @returns The maximum geometric error. + */ + getLevelMaximumGeometricError(level: number): number; + /** + * Determines whether data for a tile is available to be loaded. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if not supported, otherwise true or false. + */ + getTileDataAvailable(x: number, y: number, level: number): boolean; + /** + * Makes sure we load availability data for a tile + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + */ + loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>; +} + +/** + * A generic utility class for managing subscribers for a particular event. +This class is usually instantiated inside of a container class and +exposed as a property for others to subscribe to. + * @example + * MyObject.prototype.myListener = function(arg1, arg2) { + this.myArg1Copy = arg1; + this.myArg2Copy = arg2; +} + +var myObjectInstance = new MyObject(); +var evt = new Cesium.Event(); +evt.addEventListener(MyObject.prototype.myListener, myObjectInstance); +evt.raiseEvent('1', '2'); +evt.removeEventListener(MyObject.prototype.myListener); + */ +export class Event { + constructor(); + /** + * The number of listeners currently subscribed to the event. + */ + readonly numberOfListeners: number; + /** + * Registers a callback function to be executed whenever the event is raised. + An optional scope can be provided to serve as the <code>this</code> pointer + in which the function will execute. + * @param listener - The function to be executed when the event is raised. + * @param [scope] - An optional object scope to serve as the <code>this</code> + pointer in which the listener function will execute. + * @returns A function that will remove this event listener when invoked. + */ + addEventListener(listener: (...params: any[]) => any, scope?: any): Event.RemoveCallback; + /** + * Unregisters a previously registered callback. + * @param listener - The function to be unregistered. + * @param [scope] - The scope that was originally passed to addEventListener. + * @returns <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event. + */ + removeEventListener(listener: (...params: any[]) => any, scope?: any): boolean; + /** + * Raises the event by calling each registered listener with all supplied arguments. + * @param arguments - This method takes any number of parameters and passes them through to the listener functions. + */ + raiseEvent(...arguments: any[]): void; +} + +export namespace Event { + /** + * A function that removes a listener. + */ + type RemoveCallback = () => void; +} + +/** + * A convenience object that simplifies the common pattern of attaching event listeners +to several events, then removing all those listeners at once later, for example, in +a destroy method. + * @example + * var helper = new Cesium.EventHelper(); + +helper.add(someObject.event, listener1, this); +helper.add(otherObject.event, listener2, this); + +// later... +helper.removeAll(); + */ +export class EventHelper { + constructor(); + /** + * Adds a listener to an event, and records the registration to be cleaned up later. + * @param event - The event to attach to. + * @param listener - The function to be executed when the event is raised. + * @param [scope] - An optional object scope to serve as the <code>this</code> + pointer in which the listener function will execute. + * @returns A function that will remove this event listener when invoked. + */ + add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback; + /** + * Unregisters all previously added listeners. + */ + removeAll(): void; +} + +export namespace EventHelper { + /** + * A function that removes a listener. + */ + type RemoveCallback = () => void; +} + +/** + * Constants to determine how an interpolated value is extrapolated +when querying outside the bounds of available data. + */ +export enum ExtrapolationType { + /** + * No extrapolation occurs. + */ + NONE = 0, + /** + * The first or last value is used when outside the range of sample data. + */ + HOLD = 1, + /** + * The value is extrapolated. + */ + EXTRAPOLATE = 2 +} + +/** + * A set of functions to detect whether the current browser supports +various features. + */ +export namespace FeatureDetection { + /** + * Detects whether the current browser supports the full screen standard. + * @returns true if the browser supports the full screen standard, false if not. + */ + function supportsFullscreen(): boolean; + /** + * Detects whether the current browser supports typed arrays. + * @returns true if the browser supports typed arrays, false if not. + */ + function supportsTypedArrays(): boolean; + /** + * Detects whether the current browser supports Web Workers. + * @returns true if the browsers supports Web Workers, false if not. + */ + function supportsWebWorkers(): boolean; + /** + * Detects whether the current browser supports Web Assembly. + * @returns true if the browsers supports Web Assembly, false if not. + */ + function supportsWebAssembly(): boolean; +} + +/** + * Formats an error object into a String. If available, uses name, message, and stack +properties, otherwise, falls back on toString(). + * @param object - The item to find in the array. + * @returns A string containing the formatted error. + */ +export function formatError(object: any): string; + +/** + * Describes a frustum at the given the origin and orientation. + * @param options - Object with the following properties: + * @param options.frustum - The frustum. + * @param options.origin - The origin of the frustum. + * @param options.orientation - The orientation of the frustum. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ +export class FrustumGeometry { + constructor(options: { + frustum: PerspectiveFrustum | OrthographicFrustum + origin: Cartesian3 + orientation: Quaternion + vertexFormat?: VertexFormat + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + */ + static unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void; + /** + * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere. + * @param frustumGeometry - A description of the frustum. + * @returns The computed vertices and indices. + */ + static createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined; +} + +/** + * A description of the outline of a frustum with the given the origin and orientation. + * @param options - Object with the following properties: + * @param options.frustum - The frustum. + * @param options.origin - The origin of the frustum. + * @param options.orientation - The orientation of the frustum. + */ +export class FrustumOutlineGeometry { + constructor(options: { + frustum: PerspectiveFrustum | OrthographicFrustum + origin: Cartesian3 + orientation: Quaternion + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + */ + static unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void; + /** + * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere. + * @param frustumGeometry - A description of the frustum. + * @returns The computed vertices and indices. + */ + static createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined; +} + +/** + * Browser-independent functions for working with the standard fullscreen API. + */ +export namespace Fullscreen { + /** + * The element that is currently fullscreen, if any. To simply check if the + browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}. + */ + const element: any + /** + * The name of the event on the document that is fired when fullscreen is + entered or exited. This event name is intended for use with addEventListener. + In your event handler, to determine if the browser is in fullscreen mode or not, + use {@link Fullscreen#fullscreen}. + */ + const changeEventName: string + /** + * The name of the event that is fired when a fullscreen error + occurs. This event name is intended for use with addEventListener. + */ + const errorEventName: string + /** + * Determine whether the browser will allow an element to be made fullscreen, or not. + For example, by default, iframes cannot go fullscreen unless the containing page + adds an "allowfullscreen" attribute (or prefixed equivalent). + */ + const enabled: boolean + /** + * Determines if the browser is currently in fullscreen mode. + */ + const fullscreen: boolean + /** + * Detects whether the browser supports the standard fullscreen API. + * @returns <code>true</code> if the browser supports the standard fullscreen API, + <code>false</code> otherwise. + */ + function supportsFullscreen(): boolean; + /** + * Asynchronously requests the browser to enter fullscreen mode on the given element. + If fullscreen mode is not supported by the browser, does nothing. + * @example + * // Put the entire page into fullscreen. + Cesium.Fullscreen.requestFullscreen(document.body) + + // Place only the Cesium canvas into fullscreen. + Cesium.Fullscreen.requestFullscreen(scene.canvas) + * @param element - The HTML element which will be placed into fullscreen mode. + * @param [vrDevice] - The HMDVRDevice device. + */ + function requestFullscreen(element: any, vrDevice?: any): void; + /** + * Asynchronously exits fullscreen mode. If the browser is not currently + in fullscreen, or if fullscreen mode is not supported by the browser, does nothing. + */ + function exitFullscreen(): void; +} + +export namespace GeocoderService { + /** + * @property displayName - The display name for a location + * @property destination - The bounding box for a location + */ + type Result = { + displayName: string + destination: Rectangle | Cartesian3 + }; +} + +/** + * Provides geocoding through an external service. This type describes an interface and +is not intended to be used. + */ +export class GeocoderService { + constructor(); + /** + * @param query - The query to be sent to the geocoder service + * @param [type = GeocodeType.SEARCH] - The type of geocode to perform. + */ + geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>; +} + +/** + * The type of geocoding to be performed by a {@link GeocoderService}. + */ +export enum GeocodeType { + /** + * Perform a search where the input is considered complete. + */ + SEARCH = 0, + /** + * Perform an auto-complete using partial input, typically + reserved for providing possible results as a user is typing. + */ + AUTOCOMPLETE = 1 +} + +/** + * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying +them by the {@link Ellipsoid#maximumRadius}. This projection +is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It +is also known as EPSG:4326. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid. + */ +export class GeographicProjection { + constructor(ellipsoid?: Ellipsoid); + /** + * Gets the {@link Ellipsoid}. + */ + readonly ellipsoid: Ellipsoid; + /** + * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters. + X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the + ellipsoid. Z is the unmodified height. + * @param cartographic - The coordinates to project. + * @param [result] - An instance into which to copy the result. If this parameter is + undefined, a new instance is created and returned. + * @returns The projected coordinates. If the result parameter is not undefined, the + coordinates are copied there and that instance is returned. Otherwise, a new instance is + created and returned. + */ + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + /** + * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic} + coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively, + divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate. + * @param cartesian - The Cartesian position to unproject with height (z) in meters. + * @param [result] - An instance into which to copy the result. If this parameter is + undefined, a new instance is created and returned. + * @returns The unprojected coordinates. If the result parameter is not undefined, the + coordinates are copied there and that instance is returned. Otherwise, a new instance is + created and returned. + */ + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; +} + +/** + * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where +longitude and latitude are directly mapped to X and Y. This projection is commonly +known as geographic, equirectangular, equidistant cylindrical, or plate carrée. + * @param [options] - Object with the following properties: + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to +the WGS84 ellipsoid. + * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme. + * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of +the tile tree. + * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of +the tile tree. + */ +export class GeographicTilingScheme { + constructor(options?: { + ellipsoid?: Ellipsoid + rectangle?: Rectangle + numberOfLevelZeroTilesX?: number + numberOfLevelZeroTilesY?: number + }); + /** + * Gets the ellipsoid that is tiled by this tiling scheme. + */ + ellipsoid: Ellipsoid; + /** + * Gets the rectangle, in radians, covered by this tiling scheme. + */ + rectangle: Rectangle; + /** + * Gets the map projection used by this tiling scheme. + */ + projection: MapProjection; + /** + * Gets the total number of tiles in the X direction at a specified level-of-detail. + * @param level - The level-of-detail. + * @returns The number of tiles in the X direction at the given level. + */ + getNumberOfXTilesAtLevel(level: number): number; + /** + * Gets the total number of tiles in the Y direction at a specified level-of-detail. + * @param level - The level-of-detail. + * @returns The number of tiles in the Y direction at the given level. + */ + getNumberOfYTilesAtLevel(level: number): number; + /** + * Transforms a rectangle specified in geodetic radians to the native coordinate system + of this tiling scheme. + * @param rectangle - The rectangle to transform. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the native rectangle if 'result' + is undefined. + */ + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + /** + * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates + of the tiling scheme. + * @param x - The integer x coordinate of the tile. + * @param y - The integer y coordinate of the tile. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the rectangle + if 'result' is undefined. + */ + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + /** + * Converts tile x, y coordinates and level to a cartographic rectangle in radians. + * @param x - The integer x coordinate of the tile. + * @param y - The integer y coordinate of the tile. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the rectangle + if 'result' is undefined. + */ + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + /** + * Calculates the tile x, y coordinates of the tile containing + a given cartographic position. + * @param position - The position. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the tile x, y coordinates + if 'result' is undefined. + */ + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; +} + +/** + * A geometry representation with attributes forming vertices and optional index data +defining primitives. Geometries and an {@link Appearance}, which describes the shading, +can be assigned to a {@link Primitive} for visualization. A <code>Primitive</code> can +be created from many heterogeneous - in many cases - geometries for performance. +<p> +Geometries can be transformed and optimized using functions in {@link GeometryPipeline}. +</p> + * @example + * // Create geometry with a position attribute and indexed lines. +var positions = new Float64Array([ + 0.0, 0.0, 0.0, + 7500000.0, 0.0, 0.0, + 0.0, 7500000.0, 0.0 +]); + +var geometry = new Cesium.Geometry({ + attributes : { + position : new Cesium.GeometryAttribute({ + componentDatatype : Cesium.ComponentDatatype.DOUBLE, + componentsPerAttribute : 3, + values : positions + }) + }, + indices : new Uint16Array([0, 1, 1, 2, 2, 0]), + primitiveType : Cesium.PrimitiveType.LINES, + boundingSphere : Cesium.BoundingSphere.fromVertices(positions) +}); + * @param options - Object with the following properties: + * @param options.attributes - Attributes, which make up the geometry's vertices. + * @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry. + * @param [options.indices] - Optional index data that determines the primitives in the geometry. + * @param [options.boundingSphere] - An optional bounding sphere that fully enclosed the geometry. + */ +export class Geometry { + constructor(options: { + attributes: GeometryAttributes + primitiveType?: PrimitiveType + indices?: Uint16Array | Uint32Array + boundingSphere?: BoundingSphere + }); + /** + * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a + {@link GeometryAttribute} containing the attribute's data. + <p> + Attributes are always stored non-interleaved in a Geometry. + </p> + <p> + There are reserved attribute names with well-known semantics. The following attributes + are created by a Geometry (depending on the provided {@link VertexFormat}. + <ul> + <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> + <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> + <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> + <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> + <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> + </ul> + </p> + <p> + The following attribute names are generally not created by a Geometry, but are added + to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare + the geometry for rendering. + <ul> + <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li> + <li><code>position3DLow</code> - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li> + <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li> + <li><code>position2DLow</code> - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li> + <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li> + <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li> + </ul> + </p> + * @example + * geometry.attributes.position = new Cesium.GeometryAttribute({ + componentDatatype : Cesium.ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : new Float32Array(0) + }); + */ + attributes: GeometryAttributes; + /** + * Optional index data that - along with {@link Geometry#primitiveType} - + determines the primitives in the geometry. + */ + indices: any[]; + /** + * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES}, + but can varying based on the specific geometry. + */ + primitiveType: PrimitiveType; + /** + * An optional bounding sphere that fully encloses the geometry. This is + commonly used for culling. + */ + boundingSphere: BoundingSphere; + /** + * Computes the number of vertices in a geometry. The runtime is linear with + respect to the number of attributes in a vertex, not the number of vertices. + * @example + * var numVertices = Cesium.Geometry.computeNumberOfVertices(geometry); + * @param geometry - The geometry. + * @returns The number of vertices in the geometry. + */ + static computeNumberOfVertices(geometry: Geometry): number; +} + +/** + * Values and type information for geometry attributes. A {@link Geometry} +generally contains one or more attributes. All attributes together form +the geometry's vertices. + * @example + * var geometry = new Cesium.Geometry({ + attributes : { + position : new Cesium.GeometryAttribute({ + componentDatatype : Cesium.ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : new Float32Array([ + 0.0, 0.0, 0.0, + 7500000.0, 0.0, 0.0, + 0.0, 7500000.0, 0.0 + ]) + }) + }, + primitiveType : Cesium.PrimitiveType.LINE_LOOP +}); + * @param [options] - Object with the following properties: + * @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values. + * @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes. + * @param [options.normalize = false] - When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering. + * @param [options.values] - The values for the attributes stored in a typed array. + */ +export class GeometryAttribute { + constructor(options?: { + componentDatatype?: ComponentDatatype + componentsPerAttribute?: number + normalize?: boolean + values?: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array + }); + /** + * The datatype of each component in the attribute, e.g., individual elements in + {@link GeometryAttribute#values}. + */ + componentDatatype: ComponentDatatype; + /** + * A number between 1 and 4 that defines the number of components in an attributes. + For example, a position attribute with x, y, and z components would have 3 as + shown in the code example. + * @example + * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT; + attribute.componentsPerAttribute = 3; + attribute.values = new Float32Array([ + 0.0, 0.0, 0.0, + 7500000.0, 0.0, 0.0, + 0.0, 7500000.0, 0.0 + ]); + */ + componentsPerAttribute: number; + /** + * When <code>true</code> and <code>componentDatatype</code> is an integer format, + indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. + <p> + This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}. + </p> + * @example + * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE; + attribute.componentsPerAttribute = 4; + attribute.normalize = true; + attribute.values = new Uint8Array([ + Cesium.Color.floatToByte(color.red), + Cesium.Color.floatToByte(color.green), + Cesium.Color.floatToByte(color.blue), + Cesium.Color.floatToByte(color.alpha) + ]); + */ + normalize: boolean; + /** + * The values for the attributes stored in a typed array. In the code example, + every three elements in <code>values</code> defines one attributes since + <code>componentsPerAttribute</code> is 3. + * @example + * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT; + attribute.componentsPerAttribute = 3; + attribute.values = new Float32Array([ + 0.0, 0.0, 0.0, + 7500000.0, 0.0, 0.0, + 0.0, 7500000.0, 0.0 + ]); + */ + values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; +} + +/** + * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a +{@link GeometryAttribute} containing the attribute's data. +<p> +Attributes are always stored non-interleaved in a Geometry. +</p> + */ +export class GeometryAttributes { + constructor(); + /** + * The 3D position attribute. + <p> + 64-bit floating-point (for precision). 3 components per attribute. + </p> + */ + position: GeometryAttribute; + /** + * The normal attribute (normalized), which is commonly used for lighting. + <p> + 32-bit floating-point. 3 components per attribute. + </p> + */ + normal: GeometryAttribute; + /** + * The 2D texture coordinate attribute. + <p> + 32-bit floating-point. 2 components per attribute + </p> + */ + st: GeometryAttribute; + /** + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. + <p> + 32-bit floating-point. 3 components per attribute. + </p> + */ + bitangent: GeometryAttribute; + /** + * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. + <p> + 32-bit floating-point. 3 components per attribute. + </p> + */ + tangent: GeometryAttribute; + /** + * The color attribute. + <p> + 8-bit unsigned integer. 4 components per attribute. + </p> + */ + color: GeometryAttribute; +} + +/** + * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance} +for asynchronous geometry creation. + */ +export class GeometryFactory { + constructor(); + /** + * Returns a geometry. + * @param geometryFactory - A description of the circle. + * @returns The computed vertices and indices. + */ + static createGeometry(geometryFactory: GeometryFactory): Geometry | undefined; +} + +/** + * Geometry instancing allows one {@link Geometry} object to be positions in several +different locations and colored uniquely. For example, one {@link BoxGeometry} can +be instanced several times, each with a different <code>modelMatrix</code> to change +its position, rotation, and scale. + * @example + * // Create geometry for a box, and two instances that refer to it. +// One instance positions the box on the bottom and colored aqua. +// The other instance positions the box on the top and color white. +var geometry = Cesium.BoxGeometry.fromDimensions({ + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, + dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) +}); +var instanceBottom = new Cesium.GeometryInstance({ + geometry : geometry, + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) + }, + id : 'bottom' +}); +var instanceTop = new Cesium.GeometryInstance({ + geometry : geometry, + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) + }, + id : 'top' +}); + * @param options - Object with the following properties: + * @param options.geometry - The geometry to instance. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates. + * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick} or get/set per-instance attributes with {@link Primitive#getGeometryInstanceAttributes}. + * @param [options.attributes] - Per-instance attributes like a show or color attribute shown in the example below. + */ +export class GeometryInstance { + constructor(options: { + geometry: Geometry | GeometryFactory + modelMatrix?: Matrix4 + id?: any + attributes?: any + }); + /** + * The geometry being instanced. + */ + geometry: Geometry; + /** + * The 4x4 transformation matrix that transforms the geometry from model to world coordinates. + When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. + */ + modelMatrix: Matrix4; + /** + * User-defined object returned when the instance is picked or used to get/set per-instance attributes. + */ + id: any; + /** + * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}. + {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance. + */ + attributes: any; +} + +/** + * Values and type information for per-instance geometry attributes. + * @example + * var instance = new Cesium.GeometryInstance({ + geometry : Cesium.BoxGeometry.fromDimensions({ + dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0) + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + id : 'box', + attributes : { + color : new Cesium.GeometryInstanceAttribute({ + componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, + componentsPerAttribute : 4, + normalize : true, + value : [255, 255, 0, 255] + }) + } +}); + * @param options - Object with the following properties: + * @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values. + * @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes. + * @param [options.normalize = false] - When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering. + * @param options.value - The value for the attribute. + */ +export class GeometryInstanceAttribute { + constructor(options: { + componentDatatype: ComponentDatatype + componentsPerAttribute: number + normalize?: boolean + value: number[] + }); + /** + * The datatype of each component in the attribute, e.g., individual elements in + {@link GeometryInstanceAttribute#value}. + */ + componentDatatype: ComponentDatatype; + /** + * A number between 1 and 4 that defines the number of components in an attributes. + For example, a position attribute with x, y, and z components would have 3 as + shown in the code example. + * @example + * show : new Cesium.GeometryInstanceAttribute({ + componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, + componentsPerAttribute : 1, + normalize : true, + value : [1.0] + }) + */ + componentsPerAttribute: number; + /** + * When <code>true</code> and <code>componentDatatype</code> is an integer format, + indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. + <p> + This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}. + </p> + * @example + * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE; + attribute.componentsPerAttribute = 4; + attribute.normalize = true; + attribute.value = [ + Cesium.Color.floatToByte(color.red), + Cesium.Color.floatToByte(color.green), + Cesium.Color.floatToByte(color.blue), + Cesium.Color.floatToByte(color.alpha) + ]; + */ + normalize: boolean; + /** + * The values for the attributes stored in a typed array. In the code example, + every three elements in <code>values</code> defines one attributes since + <code>componentsPerAttribute</code> is 3. + * @example + * show : new Cesium.GeometryInstanceAttribute({ + componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE, + componentsPerAttribute : 1, + normalize : true, + value : [1.0] + }) + */ + value: number[]; +} + +/** + * Content pipeline functions for geometries. + */ +export namespace GeometryPipeline { + /** + * Converts a geometry's triangle indices to line indices. If the geometry has an <code>indices</code> + and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>, + <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed. + <p> + This is commonly used to create a wireframe geometry for visual debugging. + </p> + * @example + * geometry = Cesium.GeometryPipeline.toWireframe(geometry); + * @param geometry - The geometry to modify. + * @returns The modified <code>geometry</code> argument, with its triangle indices converted to lines. + */ + function toWireframe(geometry: Geometry): Geometry; + /** + * Creates a new {@link Geometry} with <code>LINES</code> representing the provided + attribute (<code>attributeName</code>) for the provided geometry. This is used to + visualize vector attributes like normals, tangents, and bitangents. + * @example + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); + * @param geometry - The <code>Geometry</code> instance with the attribute. + * @param [attributeName = 'normal'] - The name of the attribute. + * @param [length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction. + * @returns A new <code>Geometry</code> instance with line segments for the vector. + */ + function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry; + /** + * Creates an object that maps attribute names to unique locations (indices) + for matching vertex attributes and shader programs. + * @example + * var attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry); + // Example output + // { + // 'position' : 0, + // 'normal' : 1 + // } + * @param geometry - The geometry, which is not modified, to create the object for. + * @returns An object with attribute name / index pairs. + */ + function createAttributeLocations(geometry: Geometry): any; + /** + * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache. + * @example + * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); + * @param geometry - The geometry to modify. + * @returns The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache. + */ + function reorderForPreVertexCache(geometry: Geometry): Geometry; + /** + * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's + post vertex-shader cache by using the Tipsify algorithm. If the geometry <code>primitiveType</code> + is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect. + * @example + * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); + * @param geometry - The geometry to modify. + * @param [cacheCapacity = 24] - The number of vertices that can be held in the GPU's vertex cache. + * @returns The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache. + */ + function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry; + /** + * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the + <code>indices</code> fit into unsigned shorts. This is used to meet the WebGL requirements + when unsigned int indices are not supported. + <p> + If the geometry does not have any <code>indices</code>, this function has no effect. + </p> + * @example + * var geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry); + * @param geometry - The geometry to be split into multiple geometries. + * @returns An array of geometries, each with indices that fit into unsigned shorts. + */ + function fitToUnsignedShortIndices(geometry: Geometry): Geometry[]; + /** + * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code> + attribute with separate <code>position3D</code> and <code>position2D</code> attributes. + <p> + If the geometry does not have a <code>position</code>, this function has no effect. + </p> + * @example + * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D'); + * @param geometry - The geometry to modify. + * @param attributeName - The name of the attribute. + * @param attributeName3D - The name of the attribute in 3D. + * @param attributeName2D - The name of the attribute in 2D. + * @param [projection = new GeographicProjection()] - The projection to use. + * @returns The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes. + */ + function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry; + /** + * Encodes floating-point geometry attribute values as two separate attributes to improve + rendering precision. + <p> + This is commonly used to create high-precision position vertex attributes. + </p> + * @example + * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow'); + * @param geometry - The geometry to modify. + * @param attributeName - The name of the attribute. + * @param attributeHighName - The name of the attribute for the encoded high bits. + * @param attributeLowName - The name of the attribute for the encoded low bits. + * @returns The modified <code>geometry</code> argument, with its encoded attribute. + */ + function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry; + /** + * Transforms a geometry instance to world coordinates. This changes + the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the + following attributes if they are present: <code>position</code>, <code>normal</code>, + <code>tangent</code>, and <code>bitangent</code>. + * @example + * Cesium.GeometryPipeline.transformToWorldCoordinates(instance); + * @param instance - The geometry instance to modify. + * @returns The modified <code>instance</code> argument, with its attributes transforms to world coordinates. + */ + function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance; + /** + * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of + all triangles incident to the vertex. The result is a new <code>normal</code> attribute added to the geometry. + This assumes a counter-clockwise winding order. + * @example + * Cesium.GeometryPipeline.computeNormal(geometry); + * @param geometry - The geometry to modify. + * @returns The modified <code>geometry</code> argument with the computed <code>normal</code> attribute. + */ + function computeNormal(geometry: Geometry): Geometry; + /** + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. + This assumes a counter-clockwise winding order. + <p> + Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + for an Arbitrary Mesh</a> by Eric Lengyel. + </p> + * @example + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); + * @param geometry - The geometry to modify. + * @returns The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. + */ + function computeTangentAndBitangent(geometry: Geometry): Geometry; + /** + * Compresses and packs geometry normal attribute values to save memory. + * @example + * geometry = Cesium.GeometryPipeline.compressVertices(geometry); + * @param geometry - The geometry to modify. + * @returns The modified <code>geometry</code> argument, with its normals compressed and packed. + */ + function compressVertices(geometry: Geometry): Geometry; +} + +/** + * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri. + * @example + * //absolute Uri will be "https://test.com/awesome.png"; +var absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com'); + * @param relative - The relative Uri. + * @param [base] - The base Uri. + * @returns The absolute Uri of the given relative Uri. + */ +export function getAbsoluteUri(relative: string, base?: string): string; + +/** + * Given a URI, returns the base path of the URI. + * @example + * // basePath will be "/Gallery/"; +var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false'); + +// basePath will be "/Gallery/?value=true&example=false"; +var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true); + * @param uri - The Uri. + * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri + * @returns The base path of the Uri. + */ +export function getBaseUri(uri: string, includeQuery?: boolean): string; + +/** + * Given a URI, returns the extension of the URI. + * @example + * //extension will be "czml"; +var extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false'); + * @param uri - The Uri. + * @returns The extension of the Uri. + */ +export function getExtensionFromUri(uri: string): string; + +/** + * Given a URI, returns the last segment of the URI, removing any path or query information. + * @example + * //fileName will be"simple.czml"; +var fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false'); + * @param uri - The Uri. + * @returns The last segment of the Uri. + */ +export function getFilenameFromUri(uri: string): string; + +/** + * Extract a pixel array from a loaded image. Draws the image +into a canvas so it can read the pixels back. + * @param image - The image to extract pixels from. + * @param width - The width of the image. If not defined, then image.width is assigned. + * @param height - The height of the image. If not defined, then image.height is assigned. + * @returns The pixels of the image. + */ +export function getImagePixels(image: HTMLImageElement, width: number, height: number): ImageData; + +/** + * Gets a timestamp that can be used in measuring the time between events. Timestamps +are expressed in milliseconds, but it is not specified what the milliseconds are +measured from. This function uses performance.now() if it is available, or Date.now() +otherwise. + * @returns The timestamp in milliseconds since some unspecified reference time. + */ +export function getTimestamp(): number; + +/** + * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider + and GoogleEarthEnterpriseTerrainProvider to share metadata requests. + * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery + */ +export class GoogleEarthEnterpriseMetadata { + constructor(resourceOrUrl: Resource | string); + /** + * True if imagery is available. + */ + imageryPresent: boolean; + /** + * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both. + */ + protoImagery: boolean; + /** + * True if terrain is available. + */ + terrainPresent: boolean; + /** + * Exponent used to compute constant to calculate negative height values. + */ + negativeAltitudeExponentBias: number; + /** + * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias. + */ + negativeAltitudeThreshold: number; + /** + * Dictionary of provider id to copyright strings. + */ + providers: any; + /** + * Key used to decode packets + */ + key: ArrayBuffer; + /** + * Gets the name of the Google Earth Enterprise server. + */ + readonly url: string; + /** + * Gets the proxy used for metadata requests. + */ + readonly proxy: Proxy; + /** + * Gets the resource used for metadata requests. + */ + readonly resource: Resource; + /** + * Gets a promise that resolves to true when the metadata is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Converts a tiles (x, y, level) position into a quadkey used to request an image + from a Google Earth Enterprise server. + * @param x - The tile's x coordinate. + * @param y - The tile's y coordinate. + * @param level - The tile's zoom level. + */ + static tileXYToQuadKey(x: number, y: number, level: number): void; + /** + * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the + (x, y, level) position. + * @param quadkey - The tile's quad key + */ + static quadKeyToTileXY(quadkey: string): void; +} + +/** + * Terrain data for a single tile from a Google Earth Enterprise server. + * @example + * var buffer = ... +var childTileMask = ... +var terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({ + buffer : heightBuffer, + childTileMask : childTileMask +}); + * @param options - Object with the following properties: + * @param options.buffer - The buffer containing terrain data. + * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values. + * @param options.negativeElevationThreshold - Threshold for negative values + * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. + If a child's bit is set, geometry will be requested for that tile as well when it + is needed. If the bit is cleared, the child tile is not requested and geometry is + instead upsampled from the parent. The bit values are as follows: + <table> + <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr> + <tr><td>0</td><td>1</td><td>Southwest</td></tr> + <tr><td>1</td><td>2</td><td>Southeast</td></tr> + <tr><td>2</td><td>4</td><td>Northeast</td></tr> + <tr><td>3</td><td>8</td><td>Northwest</td></tr> + </table> + * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; + otherwise, false. + * @param [options.credits] - Array of credits for this tile. + */ +export class GoogleEarthEnterpriseTerrainData { + constructor(options: { + buffer: ArrayBuffer + negativeAltitudeExponentBias: number + negativeElevationThreshold: number + childTileMask?: number + createdByUpsampling?: boolean + credits?: Credit[] + }); + /** + * An array of credits for this tile + */ + credits: Credit[]; + /** + * The water mask included in this terrain data, if any. A water mask is a rectangular + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + */ + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + /** + * Computes the terrain height at a specified longitude and latitude. + * @param rectangle - The rectangle covered by this terrain data. + * @param longitude - The longitude in radians. + * @param latitude - The latitude in radians. + * @returns The terrain height at the specified position. If the position + is outside the rectangle, this method will extrapolate the height, which is likely to be wildly + incorrect for positions far outside the rectangle. + */ + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + /** + * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the + height samples in this instance, interpolated if necessary. + * @param tilingScheme - The tiling scheme of this terrain data. + * @param thisX - The X coordinate of this tile in the tiling scheme. + * @param thisY - The Y coordinate of this tile in the tiling scheme. + * @param thisLevel - The level of this tile in the tiling scheme. + * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. + * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. + * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. + * @returns A promise for upsampled heightmap terrain data for the descendant tile, + or undefined if too many asynchronous upsample operations are in progress and the request has been + deferred. + */ + upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined; + /** + * Determines if a given child tile is available, based on the + {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed + to be one of the four children of this tile. If non-child tile coordinates are + given, the availability of the southeast child tile is returned. + * @param thisX - The tile X coordinate of this (the parent) tile. + * @param thisY - The tile Y coordinate of this (the parent) tile. + * @param childX - The tile X coordinate of the child tile to check for availability. + * @param childY - The tile Y coordinate of the child tile to check for availability. + * @returns True if the child tile is available; otherwise, false. + */ + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + /** + * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution + terrain data. If this value is false, the data was obtained from some other source, such + as by downloading it from a remote server. This method should return true for instances + returned from a call to {@link HeightmapTerrainData#upsample}. + * @returns True if this instance was created by upsampling; otherwise, false. + */ + wasCreatedByUpsampling(): boolean; +} + +/** + * Provides tiled terrain using the Google Earth Enterprise REST API. + * @example + * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d'); +var gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({ + metadata : geeMetadata +}); + * @param options - Object with the following properties: + * @param options.url - The url of the Google Earth Enterprise server hosting the imagery. + * @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider. + * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @param [options.credit] - A credit for the data source, which is displayed on the canvas. + */ +export class GoogleEarthEnterpriseTerrainProvider { + constructor(options: { + url: Resource | string + metadata: GoogleEarthEnterpriseMetadata + ellipsoid?: Ellipsoid + credit?: Credit | string + }); + /** + * Gets the name of the Google Earth Enterprise server url hosting the imagery. + */ + readonly url: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this terrain provider is active. Typically this is used to credit + the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the provider includes a water mask. The water mask + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. + */ + hasWaterMask: boolean; + /** + * Gets a value indicating whether or not the requested tiles include vertex normals. + This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. + */ + hasVertexNormals: boolean; + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + at points and in rectangles. This function should not be called before + {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. + */ + availability: TileAvailability; + /** + * Requests the geometry for a given tile. This function should not be called before + {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and + may optionally include a water mask and an indication of which child tiles are available. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the requested geometry. If this method + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. + */ + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined; + /** + * Gets the maximum geometric error allowed in a tile at a given level. + * @param level - The tile level for which to get the maximum geometric error. + * @returns The maximum geometric error. + */ + getLevelMaximumGeometricError(level: number): number; + /** + * Determines whether data for a tile is available to be loaded. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if not supported, otherwise true or false. + */ + getTileDataAvailable(x: number, y: number, level: number): boolean; + /** + * Makes sure we load availability data for a tile + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + */ + loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>; +} + +/** + * Represents a Gregorian date in a more precise format than the JavaScript Date object. +In addition to submillisecond precision, this object can also represent leap seconds. + * @param [year] - The year as a whole number. + * @param [month] - The month as a whole number with range [1, 12]. + * @param [day] - The day of the month as a whole number starting at 1. + * @param [hour] - The hour as a whole number with range [0, 23]. + * @param [minute] - The minute of the hour as a whole number with range [0, 59]. + * @param [second] - The second of the minute as a whole number with range [0, 60], with 60 representing a leap second. + * @param [millisecond] - The millisecond of the second as a floating point number with range [0.0, 1000.0). + * @param [isLeapSecond] - Whether this time is during a leap second. + */ +export class GregorianDate { + constructor(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, isLeapSecond?: boolean); + /** + * Gets or sets the year as a whole number. + */ + year: number; + /** + * Gets or sets the month as a whole number with range [1, 12]. + */ + month: number; + /** + * Gets or sets the day of the month as a whole number starting at 1. + */ + day: number; + /** + * Gets or sets the hour as a whole number with range [0, 23]. + */ + hour: number; + /** + * Gets or sets the minute of the hour as a whole number with range [0, 59]. + */ + minute: number; + /** + * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second. + */ + second: number; + /** + * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0). + */ + millisecond: number; + /** + * Gets or sets whether this time is during a leap second. + */ + isLeapSecond: boolean; +} + +/** + * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}. + * @example + * var positions = Cesium.Cartesian3.fromDegreesArray([ + -112.1340164450331, 36.05494287836128, + -112.08821010582645, 36.097804071380715, + -112.13296079730024, 36.168769146801104 +]); + +var geometry = new Cesium.GroundPolylineGeometry({ + positions : positions +}); + * @param options - Options with the following properties: + * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored. + * @param [options.width = 1.0] - The screen space width in pixels. + * @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation. + * @param [options.loop = false] - Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop. + * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}. + */ +export class GroundPolylineGeometry { + constructor(options: { + positions: Cartesian3[] + width?: number + granularity?: number + loop?: boolean + arcType?: ArcType + }); + /** + * The screen space width in pixels. + */ + width: number; + /** + * The distance interval used for interpolating options.points. Zero indicates no interpolation. + Default of 9999.0 allows centimeter accuracy with 32 bit floating point. + */ + granularity: boolean; + /** + * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop. + If the geometry has two positions this parameter will be ignored. + */ + loop: boolean; + /** + * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}. + */ + arcType: ArcType; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + */ + static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void; +} + +/** + * Defines a heading angle, pitch angle, and range in a local frame. +Heading is the rotation from the local north direction where a positive angle is increasing eastward. +Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch +angles are below the plane. Range is the distance from the center of the frame. + * @param [heading = 0.0] - The heading angle in radians. + * @param [pitch = 0.0] - The pitch angle in radians. + * @param [range = 0.0] - The distance from the center in meters. + */ +export class HeadingPitchRange { + constructor(heading?: number, pitch?: number, range?: number); + /** + * Heading is the rotation from the local north direction where a positive angle is increasing eastward. + */ + heading: number; + /** + * Pitch is the rotation from the local xy-plane. Positive pitch angles + are above the plane. Negative pitch angles are below the plane. + */ + pitch: number; + /** + * Range is the distance from the center of the local frame. + */ + range: number; + /** + * Duplicates a HeadingPitchRange instance. + * @param hpr - The HeadingPitchRange to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined) + */ + static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange; +} + +/** + * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the +negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about +the positive x axis. + * @param [heading = 0.0] - The heading component in radians. + * @param [pitch = 0.0] - The pitch component in radians. + * @param [roll = 0.0] - The roll component in radians. + */ +export class HeadingPitchRoll { + constructor(heading?: number, pitch?: number, roll?: number); + /** + * Gets or sets the heading. + */ + heading: number; + /** + * Gets or sets the pitch. + */ + pitch: number; + /** + * Gets or sets the roll. + */ + roll: number; + /** + * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles ) + * @param quaternion - The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians. + * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned. + * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. + */ + static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll; + /** + * Returns a new HeadingPitchRoll instance from angles given in degrees. + * @param heading - the heading in degrees + * @param pitch - the pitch in degrees + * @param roll - the heading in degrees + * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned. + * @returns A new HeadingPitchRoll instance + */ + static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll; + /** + * Duplicates a HeadingPitchRoll instance. + * @param headingPitchRoll - The HeadingPitchRoll to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined) + */ + static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll; + /** + * Compares the provided HeadingPitchRolls componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first HeadingPitchRoll. + * @param [right] - The second HeadingPitchRoll. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean; + /** + * Compares the provided HeadingPitchRolls componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [left] - The first HeadingPitchRoll. + * @param [right] - The second HeadingPitchRoll. + * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: HeadingPitchRoll, right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * Duplicates this HeadingPitchRoll instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. + */ + clone(result?: HeadingPitchRoll): HeadingPitchRoll; + /** + * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side HeadingPitchRoll. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: HeadingPitchRoll): boolean; + /** + * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [right] - The right hand side HeadingPitchRoll. + * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians. + * @returns A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'. + */ + toString(): string; +} + +/** + * The encoding that is used for a heightmap + */ +export enum HeightmapEncoding { + /** + * No encoding + */ + NONE = 0, + /** + * LERC encoding + */ + LERC = 1 +} + +/** + * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap +is a rectangular array of heights in row-major order from north to south and west to east. + * @example + * var buffer = ... +var heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth); +var childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0]; +var waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1); +var terrainData = new Cesium.HeightmapTerrainData({ + buffer : heightBuffer, + width : 65, + height : 65, + childTileMask : childTileMask, + waterMask : waterMask +}); + * @param options - Object with the following properties: + * @param options.buffer - The buffer containing height data. + * @param options.width - The width (longitude direction) of the heightmap, in samples. + * @param options.height - The height (latitude direction) of the heightmap, in samples. + * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. + If a child's bit is set, geometry will be requested for that tile as well when it + is needed. If the bit is cleared, the child tile is not requested and geometry is + instead upsampled from the parent. The bit values are as follows: + <table> + <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr> + <tr><td>0</td><td>1</td><td>Southwest</td></tr> + <tr><td>1</td><td>2</td><td>Southeast</td></tr> + <tr><td>2</td><td>4</td><td>Northwest</td></tr> + <tr><td>3</td><td>8</td><td>Northeast</td></tr> + </table> + * @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + * @param [options.structure] - An object describing the structure of the height data. + * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain + the height above the heightOffset, in meters. The heightOffset is added to the resulting + height after multiplying by the scale. + * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final + height in meters. The offset is added after the height sample is multiplied by the + heightScale. + * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height + sample. This is usually 1, indicating that each element is a separate height sample. If + it is greater than 1, that number of elements together form the height sample, which is + computed according to the structure.elementMultiplier and structure.isBigEndian properties. + * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of + one height to the first element of the next height. + * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the + stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier + is 256, the height is computed as follows: + `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256` + This is assuming that the isBigEndian property is false. If it is true, the order of the + elements is reversed. + * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the + stride property is greater than 1. If this property is false, the first element is the + low-order element. If it is true, the first element is the high-order element. + * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower + than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height + buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is + not specified, no minimum value is enforced. + * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher + than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height + buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger + than 65535. If this parameter is not specified, no maximum value is enforced. + * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer. + * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; + otherwise, false. + */ +export class HeightmapTerrainData { + constructor(options: { + buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array + width: number + height: number + childTileMask?: number + waterMask?: Uint8Array + structure?: { + heightScale?: number + heightOffset?: number + elementsPerHeight?: number + stride?: number + elementMultiplier?: number + isBigEndian?: boolean + lowestEncodedHeight?: number + highestEncodedHeight?: number + } + encoding?: HeightmapEncoding + createdByUpsampling?: boolean + }); + /** + * An array of credits for this tile. + */ + credits: Credit[]; + /** + * The water mask included in this terrain data, if any. A water mask is a square + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + */ + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + /** + * Computes the terrain height at a specified longitude and latitude. + * @param rectangle - The rectangle covered by this terrain data. + * @param longitude - The longitude in radians. + * @param latitude - The latitude in radians. + * @returns The terrain height at the specified position. If the position + is outside the rectangle, this method will extrapolate the height, which is likely to be wildly + incorrect for positions far outside the rectangle. + */ + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + /** + * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the + height samples in this instance, interpolated if necessary. + * @param tilingScheme - The tiling scheme of this terrain data. + * @param thisX - The X coordinate of this tile in the tiling scheme. + * @param thisY - The Y coordinate of this tile in the tiling scheme. + * @param thisLevel - The level of this tile in the tiling scheme. + * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. + * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. + * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. + * @returns A promise for upsampled heightmap terrain data for the descendant tile, + or undefined if too many asynchronous upsample operations are in progress and the request has been + deferred. + */ + upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined; + /** + * Determines if a given child tile is available, based on the + {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed + to be one of the four children of this tile. If non-child tile coordinates are + given, the availability of the southeast child tile is returned. + * @param thisX - The tile X coordinate of this (the parent) tile. + * @param thisY - The tile Y coordinate of this (the parent) tile. + * @param childX - The tile X coordinate of the child tile to check for availability. + * @param childY - The tile Y coordinate of the child tile to check for availability. + * @returns True if the child tile is available; otherwise, false. + */ + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + /** + * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution + terrain data. If this value is false, the data was obtained from some other source, such + as by downloading it from a remote server. This method should return true for instances + returned from a call to {@link HeightmapTerrainData#upsample}. + * @returns True if this instance was created by upsampling; otherwise, false. + */ + wasCreatedByUpsampling(): boolean; +} + +/** + * An {@link InterpolationAlgorithm} for performing Hermite interpolation. + */ +export namespace HermitePolynomialApproximation { + /** + * Given the desired degree, returns the number of data points required for interpolation. + * @param degree - The desired degree of interpolation. + * @param [inputOrder = 0] - The order of the inputs (0 means just the data, 1 means the data and its derivative, etc). + * @returns The number of required data points needed for the desired degree of interpolation. + */ + function getRequiredDataPoints(degree: number, inputOrder?: number): number; + /** + * Interpolates values using Hermite Polynomial Approximation. + * @param x - The independent variable for which the dependent variables will be interpolated. + * @param xTable - The array of independent variables to use to interpolate. The values + in this array must be in increasing order and the same value must not occur twice in the array. + * @param yTable - The array of dependent variables to use to interpolate. For a set of three + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + * @param yStride - The number of dependent variable values in yTable corresponding to + each independent variable value in xTable. + * @param [result] - An existing array into which to store the result. + * @returns The array of interpolated values, or the result parameter if one was provided. + */ + function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[]; + /** + * Interpolates values using Hermite Polynomial Approximation. + * @param x - The independent variable for which the dependent variables will be interpolated. + * @param xTable - The array of independent variables to use to interpolate. The values + in this array must be in increasing order and the same value must not occur twice in the array. + * @param yTable - The array of dependent variables to use to interpolate. For a set of three + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + * @param yStride - The number of dependent variable values in yTable corresponding to + each independent variable value in xTable. + * @param inputOrder - The number of derivatives supplied for input. + * @param outputOrder - The number of derivatives desired for output. + * @param [result] - An existing array into which to store the result. + * @returns The array of interpolated values, or the result parameter if one was provided. + */ + function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[]; +} + +/** + * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times +must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming +tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and +<code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>, +respectively. + * @example + * // Create a G<sup>1</sup> continuous Hermite spline +var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; +var spline = new Cesium.HermiteSpline({ + times : times, + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ], + outTangents : [ + new Cesium.Cartesian3(1125196, -161816, 270551), + new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5), + new Cesium.Cartesian3(-2096917, 48379.5, -292683.5), + new Cesium.Cartesian3(-890902.5, 408999.5, -447115) + ], + inTangents : [ + new Cesium.Cartesian3(-1993381, -731813, 368057), + new Cesium.Cartesian3(-4193834, 96759, -585367), + new Cesium.Cartesian3(-1781805, 817999, -894230), + new Cesium.Cartesian3(1165345, 112641, 47281) + ] +}); + +var p0 = spline.evaluate(times[0]); + * @param options - Object with the following properties: + * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. + The values are in no way connected to the clock time. They are the parameterization for the curve. + * @param options.points - The array of {@link Cartesian3} control points. + * @param options.inTangents - The array of {@link Cartesian3} incoming tangents at each control point. + * @param options.outTangents - The array of {@link Cartesian3} outgoing tangents at each control point. + */ +export class HermiteSpline { + constructor(options: { + times: number[] + points: Cartesian3[] + inTangents: Cartesian3[] + outTangents: Cartesian3[] + }); + /** + * An array of times for the control points. + */ + readonly times: number[]; + /** + * An array of {@link Cartesian3} control points. + */ + readonly points: Cartesian3[]; + /** + * An array of {@link Cartesian3} incoming tangents at each control point. + */ + readonly inTangents: Cartesian3[]; + /** + * An array of {@link Cartesian3} outgoing tangents at each control point. + */ + readonly outTangents: Cartesian3[]; + /** + * Creates a spline where the tangents at each control point are the same. + The curves are guaranteed to be at least in the class C<sup>1</sup>. + * @example + * var points = [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ]; + + // Add tangents + var tangents = new Array(points.length); + tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551); + var temp = new Cesium.Cartesian3(); + for (var i = 1; i < tangents.length - 1; ++i) { + tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3()); + } + tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281); + + var spline = Cesium.HermiteSpline.createC1({ + times : times, + points : points, + tangents : tangents + }); + * @param options - Object with the following properties: + * @param options.times - The array of control point times. + * @param options.points - The array of control points. + * @param options.tangents - The array of tangents at the control points. + * @returns A hermite spline. + */ + static createC1(options: { + times: number[] + points: Cartesian3[] + tangents: Cartesian3[] + }): HermiteSpline; + /** + * Creates a natural cubic spline. The tangents at the control points are generated + to create a curve in the class C<sup>2</sup>. + * @example + * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles. + var spline = Cesium.HermiteSpline.createNaturalCubic({ + times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ] + }); + * @param options - Object with the following properties: + * @param options.times - The array of control point times. + * @param options.points - The array of control points. + * @returns A hermite spline or a linear spline if less than 3 control points were given. + */ + static createNaturalCubic(options: { + times: number[] + points: Cartesian3[] + }): HermiteSpline | LinearSpline; + /** + * Creates a clamped cubic spline. The tangents at the interior control points are generated + to create a curve in the class C<sup>2</sup>. + * @example + * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles. + var spline = Cesium.HermiteSpline.createClampedCubic({ + times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ], + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ], + firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551), + lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281) + }); + * @param options - Object with the following properties: + * @param options.times - The array of control point times. + * @param options.points - The array of control points. + * @param options.firstTangent - The outgoing tangent of the first control point. + * @param options.lastTangent - The incoming tangent of the last control point. + * @returns A hermite spline or a linear spline if less than 3 control points were given. + */ + static createClampedCubic(options: { + times: number[] + points: Cartesian3[] + firstTangent: Cartesian3 + lastTangent: Cartesian3 + }): HermiteSpline | LinearSpline; + /** + * Finds an index <code>i</code> in <code>times</code> such that the parameter + <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>. + * @param time - The time. + * @returns The index for the element at the start of the interval. + */ + findTimeInterval(time: number): number; + /** + * Wraps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, wrapped around to the updated animation. + */ + wrapTime(time: number): number; + /** + * Clamps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, clamped to the animation period. + */ + clampTime(time: number): number; + /** + * Evaluates the curve at a given time. + * @param time - The time at which to evaluate the curve. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance of the point on the curve at the given time. + */ + evaluate(time: number, result?: Cartesian3): Cartesian3; +} + +/** + * Constants for WebGL index datatypes. These corresponds to the +<code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}. + */ +export enum IndexDatatype { + /** + * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type + of an element in <code>Uint8Array</code>. + */ + UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE, + /** + * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type + of an element in <code>Uint16Array</code>. + */ + UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT, + /** + * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type + of an element in <code>Uint32Array</code>. + */ + UNSIGNED_INT = WebGLConstants.UNSIGNED_INT +} + +export namespace InterpolationAlgorithm { + /** + * Gets the name of this interpolation algorithm. + */ + var type: string + /** + * Given the desired degree, returns the number of data points required for interpolation. + * @param degree - The desired degree of interpolation. + * @returns The number of required data points needed for the desired degree of interpolation. + */ + function getRequiredDataPoints(degree: number): number; + /** + * Performs zero order interpolation. + * @param x - The independent variable for which the dependent variables will be interpolated. + * @param xTable - The array of independent variables to use to interpolate. The values + in this array must be in increasing order and the same value must not occur twice in the array. + * @param yTable - The array of dependent variables to use to interpolate. For a set of three + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + * @param yStride - The number of dependent variable values in yTable corresponding to + each independent variable value in xTable. + * @param [result] - An existing array into which to store the result. + * @returns The array of interpolated values, or the result parameter if one was provided. + */ + function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[]; + /** + * Performs higher order interpolation. Not all interpolators need to support high-order interpolation, + if this function remains undefined on implementing objects, interpolateOrderZero will be used instead. + * @param x - The independent variable for which the dependent variables will be interpolated. + * @param xTable - The array of independent variables to use to interpolate. The values + in this array must be in increasing order and the same value must not occur twice in the array. + * @param yTable - The array of dependent variables to use to interpolate. For a set of three + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + * @param yStride - The number of dependent variable values in yTable corresponding to + each independent variable value in xTable. + * @param inputOrder - The number of derivatives supplied for input. + * @param outputOrder - The number of derivatives desired for output. + * @param [result] - An existing array into which to store the result. + * @returns The array of interpolated values, or the result parameter if one was provided. + */ + function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[]; +} + +/** + * The interface for interpolation algorithms. + */ +export interface InterpolationAlgorithm { +} + +/** + * This enumerated type is used in determining where, relative to the frustum, an +object is located. The object can either be fully contained within the frustum (INSIDE), +partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely +outside of the frustum's 6 planes (OUTSIDE). + */ +export enum Intersect { + /** + * Represents that an object is not contained within the frustum. + */ + OUTSIDE = -1, + /** + * Represents that an object intersects one of the frustum's planes. + */ + INTERSECTING = 0, + /** + * Represents that an object is fully within the frustum. + */ + INSIDE = 1 +} + +/** + * Contains functions for operating on 2D triangles. + */ +export namespace Intersections2D { + /** + * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting + polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2, + 3, or 4 vertices. + * @example + * var result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4); + // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5] + * @param threshold - The threshold coordinate value at which to clip the triangle. + * @param keepAbove - true to keep the portion of the triangle above the threshold, or false + to keep the portion below. + * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order. + * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order. + * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order. + * @param [result] - The array into which to copy the result. If this parameter is not supplied, + a new array is constructed and returned. + * @returns The polygon that results after the clip, specified as a list of + vertices. The vertices are specified in counter-clockwise order. + Each vertex is either an index from the existing list (identified as + a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle. + For new vertices, the -1 is followed by three additional numbers: the + index of each of the two original vertices forming the line segment that + the new vertex lies on, and the fraction of the distance from the first + vertex to the second one. + */ + function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[]; + /** + * Compute the barycentric coordinates of a 2D position within a 2D triangle. + * @example + * var result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5); + // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0); + * @param x - The x coordinate of the position for which to find the barycentric coordinates. + * @param y - The y coordinate of the position for which to find the barycentric coordinates. + * @param x1 - The x coordinate of the triangle's first vertex. + * @param y1 - The y coordinate of the triangle's first vertex. + * @param x2 - The x coordinate of the triangle's second vertex. + * @param y2 - The y coordinate of the triangle's second vertex. + * @param x3 - The x coordinate of the triangle's third vertex. + * @param y3 - The y coordinate of the triangle's third vertex. + * @param [result] - The instance into to which to copy the result. If this parameter + is undefined, a new instance is created and returned. + * @returns The barycentric coordinates of the position within the triangle. + */ + function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3; + /** + * Compute the intersection between 2 line segments + * @example + * var result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1); + // result === new Cesium.Cartesian2(0.0, 1.0); + * @param x00 - The x coordinate of the first line's first vertex. + * @param y00 - The y coordinate of the first line's first vertex. + * @param x01 - The x coordinate of the first line's second vertex. + * @param y01 - The y coordinate of the first line's second vertex. + * @param x10 - The x coordinate of the second line's first vertex. + * @param y10 - The y coordinate of the second line's first vertex. + * @param x11 - The x coordinate of the second line's second vertex. + * @param y11 - The y coordinate of the second line's second vertex. + * @param [result] - The instance into to which to copy the result. If this parameter + is undefined, a new instance is created and returned. + * @returns The intersection point, undefined if there is no intersection point or lines are coincident. + */ + function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2; +} + +/** + * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids. + */ +export namespace IntersectionTests { + /** + * Computes the intersection of a ray and a plane. + * @param ray - The ray. + * @param plane - The plane. + * @param [result] - The object onto which to store the result. + * @returns The intersection point or undefined if there is no intersections. + */ + function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3; + /** + * Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray. + + Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf| + Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore. + * @param ray - The ray. + * @param p0 - The first vertex of the triangle. + * @param p1 - The second vertex of the triangle. + * @param p2 - The third vertex of the triangle. + * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle + and return undefined for intersections with the back face. + * @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection. + */ + function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number; + /** + * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate. + + Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf| + Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore. + * @param ray - The ray. + * @param p0 - The first vertex of the triangle. + * @param p1 - The second vertex of the triangle. + * @param p2 - The third vertex of the triangle. + * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle + and return undefined for intersections with the back face. + * @param [result] - The <code>Cartesian3</code> onto which to store the result. + * @returns The intersection point or undefined if there is no intersections. + */ + function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3; + /** + * Computes the intersection of a line segment and a triangle. + * @param v0 - The an end point of the line segment. + * @param v1 - The other end point of the line segment. + * @param p0 - The first vertex of the triangle. + * @param p1 - The second vertex of the triangle. + * @param p2 - The third vertex of the triangle. + * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle + and return undefined for intersections with the back face. + * @param [result] - The <code>Cartesian3</code> onto which to store the result. + * @returns The intersection point or undefined if there is no intersections. + */ + function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3; + /** + * Computes the intersection points of a ray with a sphere. + * @param ray - The ray. + * @param sphere - The sphere. + * @param [result] - The result onto which to store the result. + * @returns The interval containing scalar points along the ray or undefined if there are no intersections. + */ + function raySphere(ray: Ray, sphere: BoundingSphere, result?: Interval): Interval; + /** + * Computes the intersection points of a line segment with a sphere. + * @param p0 - An end point of the line segment. + * @param p1 - The other end point of the line segment. + * @param sphere - The sphere. + * @param [result] - The result onto which to store the result. + * @returns The interval containing scalar points along the ray or undefined if there are no intersections. + */ + function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: Interval): Interval; + /** + * Computes the intersection points of a ray with an ellipsoid. + * @param ray - The ray. + * @param ellipsoid - The ellipsoid. + * @returns The interval containing scalar points along the ray or undefined if there are no intersections. + */ + function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): Interval; + /** + * Provides the point along the ray which is nearest to the ellipsoid. + * @param ray - The ray. + * @param ellipsoid - The ellipsoid. + * @returns The nearest planetodetic point on the ray. + */ + function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3; + /** + * Computes the intersection of a line segment and a plane. + * @example + * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); + var normal = ellipsoid.geodeticSurfaceNormal(origin); + var plane = Cesium.Plane.fromPointNormal(origin, normal); + + var p0 = new Cesium.Cartesian3(...); + var p1 = new Cesium.Cartesian3(...); + + // find the intersection of the line segment from p0 to p1 and the tangent plane at origin. + var intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane); + * @param endPoint0 - An end point of the line segment. + * @param endPoint1 - The other end point of the line segment. + * @param plane - The plane. + * @param [result] - The object onto which to store the result. + * @returns The intersection point or undefined if there is no intersection. + */ + function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3; + /** + * Computes the intersection of a triangle and a plane + * @example + * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); + var normal = ellipsoid.geodeticSurfaceNormal(origin); + var plane = Cesium.Plane.fromPointNormal(origin, normal); + + var p0 = new Cesium.Cartesian3(...); + var p1 = new Cesium.Cartesian3(...); + var p2 = new Cesium.Cartesian3(...); + + // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane + var triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane); + * @param p0 - First point of the triangle + * @param p1 - Second point of the triangle + * @param p2 - Third point of the triangle + * @param plane - Intersection plane + * @returns An object with properties <code>positions</code> and <code>indices</code>, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists) + */ + function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any; +} + +/** + * Represents the closed interval [start, stop]. + * @param [start = 0.0] - The beginning of the interval. + * @param [stop = 0.0] - The end of the interval. + */ +export class Interval { + constructor(start?: number, stop?: number); + /** + * The beginning of the interval. + */ + start: number; + /** + * The end of the interval. + */ + stop: number; +} + +/** + * Default settings for accessing the Cesium ion API. + +An ion access token is only required if you are using any ion related APIs. +A default access token is provided for evaluation purposes only. +Sign up for a free ion account and get your own access token at {@link https://cesium.com} + */ +export namespace Ion { + /** + * Gets or sets the default Cesium ion access token. + */ + var defaultAccessToken: string + /** + * Gets or sets the default Cesium ion server. + */ + var defaultServer: string | Resource +} + +/** + * Provides geocoding through Cesium ion. + * @param options - Object with the following properties: + * @param options.scene - The scene + * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use. + * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server. + */ +export class IonGeocoderService { + constructor(options: { + scene: Scene + accessToken?: string + server?: string | Resource + }); + /** + * @param query - The query to be sent to the geocoder service + * @param [type = GeocodeType.SEARCH] - The type of geocode to perform. + */ + geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>; +} + +/** + * A {@link Resource} instance that encapsulates Cesium ion asset access. +This object is normally not instantiated directly, use {@link IonResource.fromAssetId}. + * @param endpoint - The result of the Cesium ion asset endpoint service. + * @param endpointResource - The resource used to retreive the endpoint. + */ +export class IonResource extends Resource { + constructor(endpoint: any, endpointResource: Resource); + /** + * Asynchronously creates an instance. + * @example + * //Load a Cesium3DTileset with asset ID of 124624234 + viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) })); + * @example + * //Load a CZML file with asset ID of 10890 + Cesium.IonResource.fromAssetId(10890) + .then(function (resource) { + viewer.dataSources.add(Cesium.CzmlDataSource.load(resource)); + }); + * @param assetId - The Cesium ion asset id. + * @param [options] - An object with the following properties: + * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use. + * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server. + * @returns A Promise to am instance representing the Cesium ion Asset. + */ + static fromAssetId(assetId: number, options?: { + accessToken?: string + server?: string | Resource + }): Promise<IonResource>; + /** + * Gets the credits required for attribution of the asset. + */ + readonly credits: Credit[]; + /** + * Duplicates a Resource instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Resource instance if one was not provided. + */ + clone(result?: Resource): Resource; + /** + * Asynchronously loads the given image resource. Returns a promise that will resolve to + an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if <code>preferImageBitmap</code> is true and the browser supports <code>createImageBitmap</code> or otherwise an + {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load. + * @example + * // load a single image asynchronously + resource.fetchImage().then(function(image) { + // use the loaded image + }).otherwise(function(error) { + // an error occurred + }); + + // load several images in parallel + when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) { + // images is an array containing all the loaded images + }); + * @param [options] - An object with the following properties. + * @param [options.preferBlob = false] - If true, we will load the image via a blob. + * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned. + * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetchImage(options?: { + preferBlob?: boolean + preferImageBitmap?: boolean + flipY?: boolean + }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined; +} + +/** + * Determines if a given date is a leap year. + * @example + * var leapYear = Cesium.isLeapYear(2000); // true + * @param year - The year to be tested. + * @returns True if <code>year</code> is a leap year. + */ +export function isLeapYear(year: number): boolean; + +/** + * Constants related to ISO8601 support. + */ +export namespace Iso8601 { + /** + * A {@link JulianDate} representing the earliest time representable by an ISO8601 date. + This is equivalent to the date string '0000-01-01T00:00:00Z' + */ + const MINIMUM_VALUE: JulianDate + /** + * A {@link JulianDate} representing the latest time representable by an ISO8601 date. + This is equivalent to the date string '9999-12-31T24:00:00Z' + */ + const MAXIMUM_VALUE: JulianDate + /** + * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval. + This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z' + */ + const MAXIMUM_INTERVAL: JulianDate +} + +/** + * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC). +For increased precision, this class stores the whole number part of the date and the seconds +part of the date in separate components. In order to be safe for arithmetic and represent +leap seconds, the date is always stored in the International Atomic Time standard +{@link TimeStandard.TAI}. + * @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly. + * @param [secondsOfDay = 0.0] - The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly. + * @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined. + */ +export class JulianDate { + constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard); + /** + * Gets or sets the number of whole days. + */ + dayNumber: number; + /** + * Gets or sets the number of seconds into the current day. + */ + secondsOfDay: number; + /** + * Creates a new instance from a GregorianDate. + * @param date - A GregorianDate. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate; + /** + * Creates a new instance from a JavaScript Date. + * @param date - A JavaScript Date. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fromDate(date: Date, result?: JulianDate): JulianDate; + /** + * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date. + This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601 + specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations. + * @param iso8601String - An ISO 8601 date. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate; + /** + * Creates a new instance that represents the current system time. + This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static now(result?: JulianDate): JulianDate; + /** + * Creates a {@link GregorianDate} from the provided instance. + * @param julianDate - The date to be converted. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate; + /** + * Creates a JavaScript Date from the provided instance. + Since JavaScript dates are only accurate to the nearest millisecond and + cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead. + If the provided JulianDate is during a leap second, the previous second is used. + * @param julianDate - The date to be converted. + * @returns A new instance representing the provided date. + */ + static toDate(julianDate: JulianDate): Date; + /** + * Creates an ISO8601 representation of the provided date. + * @param julianDate - The date to be converted. + * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used. + * @returns The ISO8601 representation of the provided date. + */ + static toIso8601(julianDate: JulianDate, precision?: number): string; + /** + * Duplicates a JulianDate instance. + * @param julianDate - The date to duplicate. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined. + */ + static clone(julianDate: JulianDate, result?: JulianDate): JulianDate; + /** + * Compares two instances. + * @param left - The first instance. + * @param right - The second instance. + * @returns A negative value if left is less than right, a positive value if left is greater than right, or zero if left and right are equal. + */ + static compare(left: JulianDate, right: JulianDate): number; + /** + * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first instance. + * @param [right] - The second instance. + * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>. + */ + static equals(left?: JulianDate, right?: JulianDate): boolean; + /** + * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of + each other. That is, in order for the dates to be considered equal (and for + this function to return <code>true</code>), the absolute value of the difference between them, in + seconds, must be less than <code>epsilon</code>. + * @param [left] - The first instance. + * @param [right] - The second instance. + * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances. + * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>. + */ + static equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean; + /** + * Computes the total number of whole and fractional days represented by the provided instance. + * @param julianDate - The date. + * @returns The Julian date as single floating point number. + */ + static totalDays(julianDate: JulianDate): number; + /** + * Computes the difference in seconds between the provided instance. + * @param left - The first instance. + * @param right - The second instance. + * @returns The difference, in seconds, when subtracting <code>right</code> from <code>left</code>. + */ + static secondsDifference(left: JulianDate, right: JulianDate): number; + /** + * Computes the difference in days between the provided instance. + * @param left - The first instance. + * @param right - The second instance. + * @returns The difference, in days, when subtracting <code>right</code> from <code>left</code>. + */ + static daysDifference(left: JulianDate, right: JulianDate): number; + /** + * Computes the number of seconds the provided instance is ahead of UTC. + * @param julianDate - The date. + * @returns The number of seconds the provided instance is ahead of UTC + */ + static computeTaiMinusUtc(julianDate: JulianDate): number; + /** + * Adds the provided number of seconds to the provided date instance. + * @param julianDate - The date. + * @param seconds - The number of seconds to add or subtract. + * @param result - An existing instance to use for the result. + * @returns The modified result parameter. + */ + static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate; + /** + * Adds the provided number of minutes to the provided date instance. + * @param julianDate - The date. + * @param minutes - The number of minutes to add or subtract. + * @param result - An existing instance to use for the result. + * @returns The modified result parameter. + */ + static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate; + /** + * Adds the provided number of hours to the provided date instance. + * @param julianDate - The date. + * @param hours - The number of hours to add or subtract. + * @param result - An existing instance to use for the result. + * @returns The modified result parameter. + */ + static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate; + /** + * Adds the provided number of days to the provided date instance. + * @param julianDate - The date. + * @param days - The number of days to add or subtract. + * @param result - An existing instance to use for the result. + * @returns The modified result parameter. + */ + static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate; + /** + * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise. + * @param left - The first instance. + * @param right - The second instance. + * @returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise. + */ + static lessThan(left: JulianDate, right: JulianDate): boolean; + /** + * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise. + * @param left - The first instance. + * @param right - The second instance. + * @returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise. + */ + static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean; + /** + * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise. + * @param left - The first instance. + * @param right - The second instance. + * @returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise. + */ + static greaterThan(left: JulianDate, right: JulianDate): boolean; + /** + * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise. + * @param left - The first instance. + * @param right - The second instance. + * @returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise. + */ + static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean; + /** + * Duplicates this instance. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + clone(result?: JulianDate): JulianDate; + /** + * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The second instance. + * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>. + */ + equals(right?: JulianDate): boolean; + /** + * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of + each other. That is, in order for the dates to be considered equal (and for + this function to return <code>true</code>), the absolute value of the difference between them, in + seconds, must be less than <code>epsilon</code>. + * @param [right] - The second instance. + * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances. + * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>. + */ + equalsEpsilon(right?: JulianDate, epsilon?: number): boolean; + /** + * Creates a string representing this date in ISO8601 format. + * @returns A string representing this date in ISO8601 format. + */ + toString(): string; + /** + * Gets or sets the list of leap seconds used throughout Cesium. + */ + static leapSeconds: LeapSecond[]; +} + +/** + * This enumerated type is for representing keyboard modifiers. These are keys +that are held down in addition to other event types. + */ +export enum KeyboardEventModifier { + /** + * Represents the shift key being held down. + */ + SHIFT = 0, + /** + * Represents the control key being held down. + */ + CTRL = 1, + /** + * Represents the alt key being held down. + */ + ALT = 2 +} + +/** + * An {@link InterpolationAlgorithm} for performing Lagrange interpolation. + */ +export namespace LagrangePolynomialApproximation { + /** + * Given the desired degree, returns the number of data points required for interpolation. + * @param degree - The desired degree of interpolation. + * @returns The number of required data points needed for the desired degree of interpolation. + */ + function getRequiredDataPoints(degree: number): number; + /** + * Interpolates values using Lagrange Polynomial Approximation. + * @param x - The independent variable for which the dependent variables will be interpolated. + * @param xTable - The array of independent variables to use to interpolate. The values + in this array must be in increasing order and the same value must not occur twice in the array. + * @param yTable - The array of dependent variables to use to interpolate. For a set of three + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + * @param yStride - The number of dependent variable values in yTable corresponding to + each independent variable value in xTable. + * @param [result] - An existing array into which to store the result. + * @returns The array of interpolated values, or the result parameter if one was provided. + */ + function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[]; +} + +/** + * Describes a single leap second, which is constructed from a {@link JulianDate} and a +numerical offset representing the number of seconds TAI is ahead of the UTC time standard. + * @param [date] - A Julian date representing the time of the leap second. + * @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date. + */ +export class LeapSecond { + constructor(date?: JulianDate, offset?: number); + /** + * Gets or sets the date at which this leap second occurs. + */ + julianDate: JulianDate; + /** + * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time + of this leap second. + */ + offset: number; +} + +/** + * An {@link InterpolationAlgorithm} for performing linear interpolation. + */ +export namespace LinearApproximation { + /** + * Given the desired degree, returns the number of data points required for interpolation. + Since linear interpolation can only generate a first degree polynomial, this function + always returns 2. + * @param degree - The desired degree of interpolation. + * @returns This function always returns 2. + */ + function getRequiredDataPoints(degree: number): number; + /** + * Interpolates values using linear approximation. + * @param x - The independent variable for which the dependent variables will be interpolated. + * @param xTable - The array of independent variables to use to interpolate. The values + in this array must be in increasing order and the same value must not occur twice in the array. + * @param yTable - The array of dependent variables to use to interpolate. For a set of three + dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}. + * @param yStride - The number of dependent variable values in yTable corresponding to + each independent variable value in xTable. + * @param [result] - An existing array into which to store the result. + * @returns The array of interpolated values, or the result parameter if one was provided. + */ + function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[]; +} + +/** + * A spline that uses piecewise linear interpolation to create a curve. + * @example + * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; +var spline = new Cesium.LinearSpline({ + times : times, + points : [ + new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), + new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), + new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), + new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), + new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0) + ] +}); + +var p0 = spline.evaluate(times[0]); + * @param options - Object with the following properties: + * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. + The values are in no way connected to the clock time. They are the parameterization for the curve. + * @param options.points - The array of {@link Cartesian3} control points. + */ +export class LinearSpline { + constructor(options: { + times: number[] + points: Cartesian3[] + }); + /** + * An array of times for the control points. + */ + readonly times: number[]; + /** + * An array of {@link Cartesian3} control points. + */ + readonly points: Cartesian3[]; + /** + * Finds an index <code>i</code> in <code>times</code> such that the parameter + <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>. + * @param time - The time. + * @returns The index for the element at the start of the interval. + */ + findTimeInterval(time: number): number; + /** + * Wraps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, wrapped around to the updated animation. + */ + wrapTime(time: number): number; + /** + * Clamps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, clamped to the animation period. + */ + clampTime(time: number): number; + /** + * Evaluates the curve at a given time. + * @param time - The time at which to evaluate the curve. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance of the point on the curve at the given time. + */ + evaluate(time: number, result?: Cartesian3): Cartesian3; +} + +/** + * Asynchronously loads and parses the given URL to a CRN file or parses the raw binary data of a CRN file. +Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded, +or reject if the URL failed to load or failed to parse the data. The data is loaded +using XMLHttpRequest, which means that in order to make requests to another origin, +the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * // load a single URL asynchronously +Cesium.loadCRN('some/url').then(function(textureData) { + var width = textureData.width; + var height = textureData.height; + var format = textureData.internalFormat; + var arrayBufferView = textureData.bufferView; + // use the data to create a texture +}).otherwise(function(error) { + // an error occurred +}); + * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer. + * @returns A promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ +export function loadCRN(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise<CompressedTextureBuffer> | undefined; + +/** + * Asynchronously loads and parses the given URL to a KTX file or parses the raw binary data of a KTX file. +Returns a promise that will resolve to an object containing the image buffer, width, height and format once loaded, +or reject if the URL failed to load or failed to parse the data. The data is loaded +using XMLHttpRequest, which means that in order to make requests to another origin, +the server must have Cross-Origin Resource Sharing (CORS) headers enabled. +<p> +The following are part of the KTX format specification but are not supported: +<ul> + <li>Big-endian files</li> + <li>Metadata</li> + <li>3D textures</li> + <li>Texture Arrays</li> + <li>Cubemaps</li> + <li>Mipmaps</li> +</ul> +</p> + * @example + * // load a single URL asynchronously +Cesium.loadKTX('some/url').then(function(ktxData) { + var width = ktxData.width; + var height = ktxData.height; + var format = ktxData.internalFormat; + var arrayBufferView = ktxData.bufferView; + // use the data to create a texture +}).otherwise(function(error) { + // an error occurred +}); + * @param resourceOrUrlOrBuffer - The URL of the binary data or an ArrayBuffer. + * @returns A promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ +export function loadKTX(resourceOrUrlOrBuffer: Resource | string | ArrayBuffer): Promise<CompressedTextureBuffer> | undefined; + +/** + * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a +flat map like Cesium's 2D and Columbus View modes. + */ +export class MapProjection { + constructor(); + /** + * Gets the {@link Ellipsoid}. + */ + readonly ellipsoid: Ellipsoid; + /** + * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters. + * @param cartographic - The coordinates to project. + * @param [result] - An instance into which to copy the result. If this parameter is + undefined, a new instance is created and returned. + * @returns The projected coordinates. If the result parameter is not undefined, the + coordinates are copied there and that instance is returned. Otherwise, a new instance is + created and returned. + */ + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + /** + * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic} + coordinates, in radians. + * @param cartesian - The Cartesian position to unproject with height (z) in meters. + * @param [result] - An instance into which to copy the result. If this parameter is + undefined, a new instance is created and returned. + * @returns The unprojected coordinates. If the result parameter is not undefined, the + coordinates are copied there and that instance is returned. Otherwise, a new instance is + created and returned. + */ + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; +} + +/** + * Math functions. + */ +export namespace Math { + /** + * 0.1 + */ + const EPSILON1 = 0.1 + /** + * 0.01 + */ + const EPSILON2 = 0.01 + /** + * 0.001 + */ + const EPSILON3 = 0.001 + /** + * 0.0001 + */ + const EPSILON4 = 0.0001 + /** + * 0.00001 + */ + const EPSILON5 = 0.00001 + /** + * 0.000001 + */ + const EPSILON6 = 0.000001 + /** + * 0.0000001 + */ + const EPSILON7 = 1e-7 + /** + * 0.00000001 + */ + const EPSILON8 = 1e-8 + /** + * 0.000000001 + */ + const EPSILON9 = 1e-9 + /** + * 0.0000000001 + */ + const EPSILON10 = 1e-10 + /** + * 0.00000000001 + */ + const EPSILON11 = 1e-11 + /** + * 0.000000000001 + */ + const EPSILON12 = 1e-12 + /** + * 0.0000000000001 + */ + const EPSILON13 = 1e-13 + /** + * 0.00000000000001 + */ + const EPSILON14 = 1e-14 + /** + * 0.000000000000001 + */ + const EPSILON15 = 1e-15 + /** + * 0.0000000000000001 + */ + const EPSILON16 = 1e-16 + /** + * 0.00000000000000001 + */ + const EPSILON17 = 1e-17 + /** + * 0.000000000000000001 + */ + const EPSILON18 = 1e-18 + /** + * 0.0000000000000000001 + */ + const EPSILON19 = 1e-19 + /** + * 0.00000000000000000001 + */ + const EPSILON20 = 1e-20 + /** + * 0.000000000000000000001 + */ + const EPSILON21 = 1e-21 + /** + * The gravitational parameter of the Earth in meters cubed + per second squared as defined by the WGS84 model: 3.986004418e14 + */ + const GRAVITATIONALPARAMETER = 398600441800000 + /** + * Radius of the sun in meters: 6.955e8 + */ + const SOLAR_RADIUS = 695500000 + /** + * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on + Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000", + Celestial Mechanics 82: 83-110, 2002. + */ + const LUNAR_RADIUS = 1737400 + /** + * 64 * 1024 + */ + const SIXTY_FOUR_KILOBYTES: number + /** + * 4 * 1024 * 1024 * 1024 + */ + const FOUR_GIGABYTES: number + /** + * Returns the sign of the value; 1 if the value is positive, -1 if the value is + negative, or 0 if the value is 0. + * @param value - The value to return the sign of. + * @returns The sign of value. + */ + function sign(value: number): number; + /** + * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. + This is similar to {@link Math#sign} except that returns 1.0 instead of + 0.0 when the input value is 0.0. + * @param value - The value to return the sign of. + * @returns The sign of value. + */ + function signNotZero(value: number): number; + /** + * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum] + * @param value - The scalar value in the range [-1.0, 1.0] + * @param [rangeMaximum = 255] - The maximum value in the mapped range, 255 by default. + * @returns A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0. + */ + function toSNorm(value: number, rangeMaximum?: number): number; + /** + * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0]. + * @param value - SNORM value in the range [0, rangeMaximum] + * @param [rangeMaximum = 255] - The maximum value in the SNORM range, 255 by default. + * @returns Scalar in the range [-1.0, 1.0]. + */ + function fromSNorm(value: number, rangeMaximum?: number): number; + /** + * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0] + * @param value - The scalar value in the range [rangeMinimum, rangeMaximum] + * @param rangeMinimum - The minimum value in the mapped range. + * @param rangeMaximum - The maximum value in the mapped range. + * @returns A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0. + */ + function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number; + /** + * Returns the hyperbolic sine of a number. + The hyperbolic sine of <em>value</em> is defined to be + (<em>e<sup>x</sup> - e<sup>-x</sup></em>)/2.0 + where <i>e</i> is Euler's number, approximately 2.71828183. + + <p>Special cases: + <ul> + <li>If the argument is NaN, then the result is NaN.</li> + + <li>If the argument is infinite, then the result is an infinity + with the same sign as the argument.</li> + + <li>If the argument is zero, then the result is a zero with the + same sign as the argument.</li> + </ul> + </p> + * @param value - The number whose hyperbolic sine is to be returned. + * @returns The hyperbolic sine of <code>value</code>. + */ + function sinh(value: number): number; + /** + * Returns the hyperbolic cosine of a number. + The hyperbolic cosine of <strong>value</strong> is defined to be + (<em>e<sup>x</sup> + e<sup>-x</sup></em>)/2.0 + where <i>e</i> is Euler's number, approximately 2.71828183. + + <p>Special cases: + <ul> + <li>If the argument is NaN, then the result is NaN.</li> + + <li>If the argument is infinite, then the result is positive infinity.</li> + + <li>If the argument is zero, then the result is 1.0.</li> + </ul> + </p> + * @param value - The number whose hyperbolic cosine is to be returned. + * @returns The hyperbolic cosine of <code>value</code>. + */ + function cosh(value: number): number; + /** + * Computes the linear interpolation of two values. + * @example + * var n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0 + * @param p - The start value to interpolate. + * @param q - The end value to interpolate. + * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>. + * @returns The linearly interpolated value. + */ + function lerp(p: number, q: number, time: number): number; + /** + * pi + */ + const PI: number + /** + * 1/pi + */ + const ONE_OVER_PI: number + /** + * pi/2 + */ + const PI_OVER_TWO: number + /** + * pi/3 + */ + const PI_OVER_THREE: number + /** + * pi/4 + */ + const PI_OVER_FOUR: number + /** + * pi/6 + */ + const PI_OVER_SIX: number + /** + * 3pi/2 + */ + const THREE_PI_OVER_TWO: number + /** + * 2pi + */ + const TWO_PI: number + /** + * 1/2pi + */ + const ONE_OVER_TWO_PI: number + /** + * The number of radians in a degree. + */ + const RADIANS_PER_DEGREE: number + /** + * The number of degrees in a radian. + */ + const DEGREES_PER_RADIAN: number + /** + * The number of radians in an arc second. + */ + const RADIANS_PER_ARCSECOND: number + /** + * Converts degrees to radians. + * @param degrees - The angle to convert in degrees. + * @returns The corresponding angle in radians. + */ + function toRadians(degrees: number): number; + /** + * Converts radians to degrees. + * @param radians - The angle to convert in radians. + * @returns The corresponding angle in degrees. + */ + function toDegrees(radians: number): number; + /** + * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>). + * @example + * // Convert 270 degrees to -90 degrees longitude + var longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0)); + * @param angle - The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>). + * @returns The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>). + */ + function convertLongitudeRange(angle: number): number; + /** + * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>). + Useful for sanitizing data before use in objects requiring correct range. + * @example + * // Clamp 108 degrees latitude to 90 degrees latitude + var latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0)); + * @param angle - The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>). + * @returns The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>). + */ + function clampToLatitudeRange(angle: number): number; + /** + * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle. + * @param angle - in radians + * @returns The angle in the range [<code>-Math.PI</code>, <code>Math.PI</code>]. + */ + function negativePiToPi(angle: number): number; + /** + * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle. + * @param angle - in radians + * @returns The angle in the range [0, <code>Math.TWO_PI</code>]. + */ + function zeroToTwoPi(angle: number): number; + /** + * The modulo operation that also works for negative dividends. + * @param m - The dividend. + * @param n - The divisor. + * @returns The remainder. + */ + function mod(m: number, n: number): number; + /** + * Determines if two values are equal using an absolute or relative tolerance test. This is useful + to avoid problems due to roundoff error when comparing floating-point values directly. The values are + first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed. + Use this test if you are unsure of the magnitudes of left and right. + * @example + * var a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true + var b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false + var c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true + var d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false + * @param left - The first value to compare. + * @param right - The other value to compare. + * @param [relativeEpsilon = 0] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test. + * @param [absoluteEpsilon = relativeEpsilon] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test. + * @returns <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>. + */ + function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean; + /** + * Determines if the left value is less than the right value. If the two values are within + <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false. + * @param left - The first number to compare. + * @param right - The second number to compare. + * @param absoluteEpsilon - The absolute epsilon to use in comparison. + * @returns <code>true</code> if <code>left</code> is less than <code>right</code> by more than + <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two + values are nearly equal. + */ + function lessThan(left: number, right: number, absoluteEpsilon: number): boolean; + /** + * Determines if the left value is less than or equal to the right value. If the two values are within + <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true. + * @param left - The first number to compare. + * @param right - The second number to compare. + * @param absoluteEpsilon - The absolute epsilon to use in comparison. + * @returns <code>true</code> if <code>left</code> is less than <code>right</code> or if the + the values are nearly equal. + */ + function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean; + /** + * Determines if the left value is greater the right value. If the two values are within + <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false. + * @param left - The first number to compare. + * @param right - The second number to compare. + * @param absoluteEpsilon - The absolute epsilon to use in comparison. + * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> by more than + <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two + values are nearly equal. + */ + function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean; + /** + * Determines if the left value is greater than or equal to the right value. If the two values are within + <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true. + * @param left - The first number to compare. + * @param right - The second number to compare. + * @param absoluteEpsilon - The absolute epsilon to use in comparison. + * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> or if the + the values are nearly equal. + */ + function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean; + /** + * Computes the factorial of the provided number. + * @example + * //Compute 7!, which is equal to 5040 + var computedFactorial = Cesium.Math.factorial(7); + * @param n - The number whose factorial is to be computed. + * @returns The factorial of the provided number or undefined if the number is less than 0. + */ + function factorial(n: number): number; + /** + * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value. + * @example + * var n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6 + var n = Cesium.Math.incrementWrap(10, 10, 0); // returns 0 + * @param [n] - The number to be incremented. + * @param [maximumValue] - The maximum incremented value before rolling over to the minimum value. + * @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded. + * @returns The incremented number. + */ + function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number; + /** + * Determines if a non-negative integer is a power of two. + The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript. + * @example + * var t = Cesium.Math.isPowerOfTwo(16); // true + var f = Cesium.Math.isPowerOfTwo(20); // false + * @param n - The integer to test in the range [0, (2^32)-1]. + * @returns <code>true</code> if the number if a power of two; otherwise, <code>false</code>. + */ + function isPowerOfTwo(n: number): boolean; + /** + * Computes the next power-of-two integer greater than or equal to the provided non-negative integer. + The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript. + * @example + * var n = Cesium.Math.nextPowerOfTwo(29); // 32 + var m = Cesium.Math.nextPowerOfTwo(32); // 32 + * @param n - The integer to test in the range [0, 2^31]. + * @returns The next power-of-two integer. + */ + function nextPowerOfTwo(n: number): number; + /** + * Computes the previous power-of-two integer less than or equal to the provided non-negative integer. + The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript. + * @example + * var n = Cesium.Math.previousPowerOfTwo(29); // 16 + var m = Cesium.Math.previousPowerOfTwo(32); // 32 + * @param n - The integer to test in the range [0, (2^32)-1]. + * @returns The previous power-of-two integer. + */ + function previousPowerOfTwo(n: number): number; + /** + * Constraint a value to lie between two values. + * @param value - The value to constrain. + * @param min - The minimum value. + * @param max - The maximum value. + * @returns The value clamped so that min <= value <= max. + */ + function clamp(value: number, min: number, max: number): number; + /** + * Sets the seed used by the random number generator + in {@link Math#nextRandomNumber}. + * @param seed - An integer used as the seed. + */ + function setRandomNumberSeed(seed: number): void; + /** + * Generates a random floating point number in the range of [0.0, 1.0) + using a Mersenne twister. + * @returns A random number in the range of [0.0, 1.0). + */ + function nextRandomNumber(): number; + /** + * Generates a random number between two numbers. + * @param min - The minimum value. + * @param max - The maximum value. + * @returns A random number between the min and max. + */ + function randomBetween(min: number, max: number): number; + /** + * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0] + so that the function will never return NaN. + * @param value - The value for which to compute acos. + * @returns The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0, + whichever is closer, if the value is outside the range. + */ + function acosClamped(value: number): number; + /** + * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0] + so that the function will never return NaN. + * @param value - The value for which to compute asin. + * @returns The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0, + whichever is closer, if the value is outside the range. + */ + function asinClamped(value: number): number; + /** + * Finds the chord length between two points given the circle's radius and the angle between the points. + * @param angle - The angle between the two points. + * @param radius - The radius of the circle. + * @returns The chord length. + */ + function chordLength(angle: number, radius: number): number; + /** + * Finds the logarithm of a number to a base. + * @param number - The number. + * @param base - The base. + * @returns The result. + */ + function logBase(number: number, base: number): number; + /** + * Finds the cube root of a number. + Returns NaN if <code>number</code> is not provided. + * @param [number] - The number. + * @returns The result. + */ + function cbrt(number?: number): number; + /** + * Finds the base 2 logarithm of a number. + * @param number - The number. + * @returns The result. + */ + function log2(number: number): number; + /** + * Computes a fast approximation of Atan for input in the range [-1, 1]. + + Based on Michal Drobot's approximation from ShaderFastLibs, + which in turn is based on "Efficient approximations for the arctangent function," + Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. + Adapted from ShaderFastLibs under MIT License. + * @param x - An input number in the range [-1, 1] + * @returns An approximation of atan(x) + */ + function fastApproximateAtan(x: number): number; + /** + * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars. + + Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html + * @param x - An input number that isn't zero if y is zero. + * @param y - An input number that isn't zero if x is zero. + * @returns An approximation of atan2(x, y) + */ + function fastApproximateAtan2(x: number, y: number): number; +} + +export interface Matrix2 extends ArrayLike<number> { +} + +/** + * A 2x2 matrix, indexable as a column-major order array. +Constructor parameters are in row-major order for code readability. + * @param [column0Row0 = 0.0] - The value for column 0, row 0. + * @param [column1Row0 = 0.0] - The value for column 1, row 0. + * @param [column0Row1 = 0.0] - The value for column 0, row 1. + * @param [column1Row1 = 0.0] - The value for column 1, row 1. + */ +export class Matrix2 implements ArrayLike<number> { + constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Matrix2, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Matrix2 instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2; + /** + * Duplicates a Matrix2 instance. + * @param matrix - The matrix to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined) + */ + static clone(matrix: Matrix2, result?: Matrix2): Matrix2; + /** + * Creates a Matrix2 from 4 consecutive elements in an array. + * @example + * // Create the Matrix2: + // [1.0, 2.0] + // [1.0, 2.0] + + var v = [1.0, 1.0, 2.0, 2.0]; + var m = Cesium.Matrix2.fromArray(v); + + // Create same Matrix2 with using an offset into an array + var v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0]; + var m2 = Cesium.Matrix2.fromArray(v2, 2); + * @param array - The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order. + * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix2 instance if one was not provided. + */ + static fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2; + /** + * Creates a Matrix2 instance from a column-major order array. + * @param values - The column-major order array. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. + */ + static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2; + /** + * Creates a Matrix2 instance from a row-major order array. + The resulting matrix will be in column-major order. + * @param values - The row-major order array. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. + */ + static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2; + /** + * Computes a Matrix2 instance representing a non-uniform scale. + * @example + * // Creates + // [7.0, 0.0] + // [0.0, 8.0] + var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0)); + * @param scale - The x and y scale factors. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. + */ + static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2; + /** + * Computes a Matrix2 instance representing a uniform scale. + * @example + * // Creates + // [2.0, 0.0] + // [0.0, 2.0] + var m = Cesium.Matrix2.fromUniformScale(2.0); + * @param scale - The uniform scale factor. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. + */ + static fromUniformScale(scale: number, result?: Matrix2): Matrix2; + /** + * Creates a rotation matrix. + * @example + * // Rotate a point 45 degrees counterclockwise. + var p = new Cesium.Cartesian2(5, 6); + var m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0)); + var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2()); + * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix2 instance if one was not provided. + */ + static fromRotation(angle: number, result?: Matrix2): Matrix2; + /** + * Creates an Array from the provided Matrix2 instance. + The array will be in column-major order. + * @param matrix - The matrix to use.. + * @param [result] - The Array onto which to store the result. + * @returns The modified Array parameter or a new Array instance if one was not provided. + */ + static toArray(matrix: Matrix2, result?: number[]): number[]; + /** + * Computes the array index of the element at the provided row and column. + * @example + * var myMatrix = new Cesium.Matrix2(); + var column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0); + var column1Row0 = myMatrix[column1Row0Index] + myMatrix[column1Row0Index] = 10.0; + * @param row - The zero-based index of the row. + * @param column - The zero-based index of the column. + * @returns The index of the element at the provided row and column. + */ + static getElementIndex(row: number, column: number): number; + /** + * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance. + * @param matrix - The matrix to use. + * @param index - The zero-based index of the column to retrieve. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2; + /** + * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance. + * @param matrix - The matrix to use. + * @param index - The zero-based index of the column to set. + * @param cartesian - The Cartesian whose values will be assigned to the specified column. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2; + /** + * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance. + * @param matrix - The matrix to use. + * @param index - The zero-based index of the row to retrieve. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2; + /** + * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance. + * @param matrix - The matrix to use. + * @param index - The zero-based index of the row to set. + * @param cartesian - The Cartesian whose values will be assigned to the specified row. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2; + /** + * Extracts the non-uniform scale assuming the matrix is an affine transformation. + * @param matrix - The matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2; + /** + * Computes the maximum scale assuming the matrix is an affine transformation. + The maximum scale is the maximum length of the column vectors. + * @param matrix - The matrix. + * @returns The maximum scale. + */ + static getMaximumScale(matrix: Matrix2): number; + /** + * Computes the product of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + /** + * Computes the sum of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + /** + * Computes the difference of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + /** + * Computes the product of a matrix and a column vector. + * @param matrix - The matrix. + * @param cartesian - The column. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2; + /** + * Computes the product of a matrix and a scalar. + * @param matrix - The matrix. + * @param scalar - The number to multiply by. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2; + /** + * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix. + * @example + * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m); + Cesium.Matrix2.multiplyByScale(m, scale, m); + * @param matrix - The matrix on the left-hand side. + * @param scale - The non-uniform scale on the right-hand side. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2; + /** + * Creates a negated copy of the provided matrix. + * @param matrix - The matrix to negate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static negate(matrix: Matrix2, result: Matrix2): Matrix2; + /** + * Computes the transpose of the provided matrix. + * @param matrix - The matrix to transpose. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static transpose(matrix: Matrix2, result: Matrix2): Matrix2; + /** + * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements. + * @param matrix - The matrix with signed elements. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static abs(matrix: Matrix2, result: Matrix2): Matrix2; + /** + * Compares the provided matrices componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first matrix. + * @param [right] - The second matrix. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: Matrix2, right?: Matrix2): boolean; + /** + * Compares the provided matrices componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [left] - The first matrix. + * @param [right] - The second matrix. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Matrix2, right?: Matrix2, epsilon?: number): boolean; + /** + * An immutable Matrix2 instance initialized to the identity matrix. + */ + static readonly IDENTITY: Matrix2; + /** + * An immutable Matrix2 instance initialized to the zero matrix. + */ + static readonly ZERO: Matrix2; + /** + * The index into Matrix2 for column 0, row 0. + * @example + * var matrix = new Cesium.Matrix2(); + matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0 + */ + static readonly COLUMN0ROW0: number; + /** + * The index into Matrix2 for column 0, row 1. + * @example + * var matrix = new Cesium.Matrix2(); + matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0 + */ + static readonly COLUMN0ROW1: number; + /** + * The index into Matrix2 for column 1, row 0. + * @example + * var matrix = new Cesium.Matrix2(); + matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0 + */ + static readonly COLUMN1ROW0: number; + /** + * The index into Matrix2 for column 1, row 1. + * @example + * var matrix = new Cesium.Matrix2(); + matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0 + */ + static readonly COLUMN1ROW1: number; + /** + * Gets the number of items in the collection. + */ + length: number; + /** + * Duplicates the provided Matrix2 instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix2 instance if one was not provided. + */ + clone(result?: Matrix2): Matrix2; + /** + * Compares this matrix to the provided matrix componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side matrix. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: Matrix2): boolean; + /** + * Compares this matrix to the provided matrix componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [right] - The right hand side matrix. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: Matrix2, epsilon?: number): boolean; + /** + * Creates a string representing this Matrix with each row being + on a separate line and in the format '(column0, column1)'. + * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'. + */ + toString(): string; +} + +export interface Matrix3 extends ArrayLike<number> { +} + +/** + * A 3x3 matrix, indexable as a column-major order array. +Constructor parameters are in row-major order for code readability. + * @param [column0Row0 = 0.0] - The value for column 0, row 0. + * @param [column1Row0 = 0.0] - The value for column 1, row 0. + * @param [column2Row0 = 0.0] - The value for column 2, row 0. + * @param [column0Row1 = 0.0] - The value for column 0, row 1. + * @param [column1Row1 = 0.0] - The value for column 1, row 1. + * @param [column2Row1 = 0.0] - The value for column 2, row 1. + * @param [column0Row2 = 0.0] - The value for column 0, row 2. + * @param [column1Row2 = 0.0] - The value for column 1, row 2. + * @param [column2Row2 = 0.0] - The value for column 2, row 2. + */ +export class Matrix3 implements ArrayLike<number> { + constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Matrix3, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Matrix3 instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3; + /** + * Duplicates a Matrix3 instance. + * @param matrix - The matrix to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) + */ + static clone(matrix: Matrix3, result?: Matrix3): Matrix3; + /** + * Creates a Matrix3 from 9 consecutive elements in an array. + * @example + * // Create the Matrix3: + // [1.0, 2.0, 3.0] + // [1.0, 2.0, 3.0] + // [1.0, 2.0, 3.0] + + var v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0]; + var m = Cesium.Matrix3.fromArray(v); + + // Create same Matrix3 with using an offset into an array + var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0]; + var m2 = Cesium.Matrix3.fromArray(v2, 2); + * @param array - The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order. + * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix3 instance if one was not provided. + */ + static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3; + /** + * Creates a Matrix3 instance from a column-major order array. + * @param values - The column-major order array. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. + */ + static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3; + /** + * Creates a Matrix3 instance from a row-major order array. + The resulting matrix will be in column-major order. + * @param values - The row-major order array. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. + */ + static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3; + /** + * Computes a 3x3 rotation matrix from the provided quaternion. + * @param quaternion - the quaternion to use. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The 3x3 rotation matrix from this quaternion. + */ + static fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3; + /** + * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles ) + * @param headingPitchRoll - the headingPitchRoll to use. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The 3x3 rotation matrix from this headingPitchRoll. + */ + static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3; + /** + * Computes a Matrix3 instance representing a non-uniform scale. + * @example + * // Creates + // [7.0, 0.0, 0.0] + // [0.0, 8.0, 0.0] + // [0.0, 0.0, 9.0] + var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); + * @param scale - The x, y, and z scale factors. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. + */ + static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3; + /** + * Computes a Matrix3 instance representing a uniform scale. + * @example + * // Creates + // [2.0, 0.0, 0.0] + // [0.0, 2.0, 0.0] + // [0.0, 0.0, 2.0] + var m = Cesium.Matrix3.fromUniformScale(2.0); + * @param scale - The uniform scale factor. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. + */ + static fromUniformScale(scale: number, result?: Matrix3): Matrix3; + /** + * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. + * @example + * // Creates + // [0.0, -9.0, 8.0] + // [9.0, 0.0, -7.0] + // [-8.0, 7.0, 0.0] + var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); + * @param vector - the vector on the left hand side of the cross product operation. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. + */ + static fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3; + /** + * Creates a rotation matrix around the x-axis. + * @example + * // Rotate a point 45 degrees counterclockwise around the x-axis. + var p = new Cesium.Cartesian3(5, 6, 7); + var m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0)); + var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); + * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. + */ + static fromRotationX(angle: number, result?: Matrix3): Matrix3; + /** + * Creates a rotation matrix around the y-axis. + * @example + * // Rotate a point 45 degrees counterclockwise around the y-axis. + var p = new Cesium.Cartesian3(5, 6, 7); + var m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0)); + var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); + * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. + */ + static fromRotationY(angle: number, result?: Matrix3): Matrix3; + /** + * Creates a rotation matrix around the z-axis. + * @example + * // Rotate a point 45 degrees counterclockwise around the z-axis. + var p = new Cesium.Cartesian3(5, 6, 7); + var m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0)); + var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); + * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix3 instance if one was not provided. + */ + static fromRotationZ(angle: number, result?: Matrix3): Matrix3; + /** + * Creates an Array from the provided Matrix3 instance. + The array will be in column-major order. + * @param matrix - The matrix to use.. + * @param [result] - The Array onto which to store the result. + * @returns The modified Array parameter or a new Array instance if one was not provided. + */ + static toArray(matrix: Matrix3, result?: number[]): number[]; + /** + * Computes the array index of the element at the provided row and column. + * @example + * var myMatrix = new Cesium.Matrix3(); + var column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0); + var column1Row0 = myMatrix[column1Row0Index] + myMatrix[column1Row0Index] = 10.0; + * @param row - The zero-based index of the row. + * @param column - The zero-based index of the column. + * @returns The index of the element at the provided row and column. + */ + static getElementIndex(row: number, column: number): number; + /** + * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance. + * @param matrix - The matrix to use. + * @param index - The zero-based index of the column to retrieve. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3; + /** + * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance. + * @param matrix - The matrix to use. + * @param index - The zero-based index of the column to set. + * @param cartesian - The Cartesian whose values will be assigned to the specified column. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3; + /** + * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance. + * @param matrix - The matrix to use. + * @param index - The zero-based index of the row to retrieve. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3; + /** + * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance. + * @param matrix - The matrix to use. + * @param index - The zero-based index of the row to set. + * @param cartesian - The Cartesian whose values will be assigned to the specified row. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3; + /** + * Extracts the non-uniform scale assuming the matrix is an affine transformation. + * @param matrix - The matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3; + /** + * Computes the maximum scale assuming the matrix is an affine transformation. + The maximum scale is the maximum length of the column vectors. + * @param matrix - The matrix. + * @returns The maximum scale. + */ + static getMaximumScale(matrix: Matrix3): number; + /** + * Computes the product of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + /** + * Computes the sum of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + /** + * Computes the difference of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + /** + * Computes the product of a matrix and a column vector. + * @param matrix - The matrix. + * @param cartesian - The column. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the product of a matrix and a scalar. + * @param matrix - The matrix. + * @param scalar - The number to multiply by. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3; + /** + * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix. + * @example + * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m); + Cesium.Matrix3.multiplyByScale(m, scale, m); + * @param matrix - The matrix on the left-hand side. + * @param scale - The non-uniform scale on the right-hand side. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3; + /** + * Creates a negated copy of the provided matrix. + * @param matrix - The matrix to negate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static negate(matrix: Matrix3, result: Matrix3): Matrix3; + /** + * Computes the transpose of the provided matrix. + * @param matrix - The matrix to transpose. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static transpose(matrix: Matrix3, result: Matrix3): Matrix3; + /** + * Extracts the rotation assuming the matrix is an affine transformation. + * @param matrix - The matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter + */ + static getRotation(matrix: Matrix3, result: Matrix3): Matrix3; + /** + * Computes the eigenvectors and eigenvalues of a symmetric matrix. + <p> + Returns a diagonal matrix and unitary matrix such that: + <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code> + </p> + <p> + The values along the diagonal of the diagonal matrix are the eigenvalues. The columns + of the unitary matrix are the corresponding eigenvectors. + </p> + * @example + * var a = //... symetric matrix + var result = { + unitary : new Cesium.Matrix3(), + diagonal : new Cesium.Matrix3() + }; + Cesium.Matrix3.computeEigenDecomposition(a, result); + + var unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3()); + var b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3()); + Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a + + var lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue + var v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector + var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) + * @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric. + * @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result. + * @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively. + */ + static computeEigenDecomposition(matrix: Matrix3, result?: any): any; + /** + * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements. + * @param matrix - The matrix with signed elements. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static abs(matrix: Matrix3, result: Matrix3): Matrix3; + /** + * Computes the determinant of the provided matrix. + * @param matrix - The matrix to use. + * @returns The value of the determinant of the matrix. + */ + static determinant(matrix: Matrix3): number; + /** + * Computes the inverse of the provided matrix. + * @param matrix - The matrix to invert. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static inverse(matrix: Matrix3, result: Matrix3): Matrix3; + /** + * Computes the inverse transpose of a matrix. + * @param matrix - The matrix to transpose and invert. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static inverseTranspose(matrix: Matrix3, result: Matrix3): Matrix3; + /** + * Compares the provided matrices componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first matrix. + * @param [right] - The second matrix. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: Matrix3, right?: Matrix3): boolean; + /** + * Compares the provided matrices componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [left] - The first matrix. + * @param [right] - The second matrix. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean; + /** + * An immutable Matrix3 instance initialized to the identity matrix. + */ + static readonly IDENTITY: Matrix3; + /** + * An immutable Matrix3 instance initialized to the zero matrix. + */ + static readonly ZERO: Matrix3; + /** + * The index into Matrix3 for column 0, row 0. + */ + static readonly COLUMN0ROW0: number; + /** + * The index into Matrix3 for column 0, row 1. + */ + static readonly COLUMN0ROW1: number; + /** + * The index into Matrix3 for column 0, row 2. + */ + static readonly COLUMN0ROW2: number; + /** + * The index into Matrix3 for column 1, row 0. + */ + static readonly COLUMN1ROW0: number; + /** + * The index into Matrix3 for column 1, row 1. + */ + static readonly COLUMN1ROW1: number; + /** + * The index into Matrix3 for column 1, row 2. + */ + static readonly COLUMN1ROW2: number; + /** + * The index into Matrix3 for column 2, row 0. + */ + static readonly COLUMN2ROW0: number; + /** + * The index into Matrix3 for column 2, row 1. + */ + static readonly COLUMN2ROW1: number; + /** + * The index into Matrix3 for column 2, row 2. + */ + static readonly COLUMN2ROW2: number; + /** + * Gets the number of items in the collection. + */ + length: number; + /** + * Duplicates the provided Matrix3 instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix3 instance if one was not provided. + */ + clone(result?: Matrix3): Matrix3; + /** + * Compares this matrix to the provided matrix componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side matrix. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: Matrix3): boolean; + /** + * Compares this matrix to the provided matrix componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [right] - The right hand side matrix. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: Matrix3, epsilon?: number): boolean; + /** + * Creates a string representing this Matrix with each row being + on a separate line and in the format '(column0, column1, column2)'. + * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'. + */ + toString(): string; +} + +export interface Matrix4 extends ArrayLike<number> { +} + +/** + * A 4x4 matrix, indexable as a column-major order array. +Constructor parameters are in row-major order for code readability. + * @param [column0Row0 = 0.0] - The value for column 0, row 0. + * @param [column1Row0 = 0.0] - The value for column 1, row 0. + * @param [column2Row0 = 0.0] - The value for column 2, row 0. + * @param [column3Row0 = 0.0] - The value for column 3, row 0. + * @param [column0Row1 = 0.0] - The value for column 0, row 1. + * @param [column1Row1 = 0.0] - The value for column 1, row 1. + * @param [column2Row1 = 0.0] - The value for column 2, row 1. + * @param [column3Row1 = 0.0] - The value for column 3, row 1. + * @param [column0Row2 = 0.0] - The value for column 0, row 2. + * @param [column1Row2 = 0.0] - The value for column 1, row 2. + * @param [column2Row2 = 0.0] - The value for column 2, row 2. + * @param [column3Row2 = 0.0] - The value for column 3, row 2. + * @param [column0Row3 = 0.0] - The value for column 0, row 3. + * @param [column1Row3 = 0.0] - The value for column 1, row 3. + * @param [column2Row3 = 0.0] - The value for column 2, row 3. + * @param [column3Row3 = 0.0] - The value for column 3, row 3. + */ +export class Matrix4 implements ArrayLike<number> { + constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column3Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column3Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number, column3Row2?: number, column0Row3?: number, column1Row3?: number, column2Row3?: number, column3Row3?: number); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Matrix4, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4; + /** + * Duplicates a Matrix4 instance. + * @param matrix - The matrix to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined) + */ + static clone(matrix: Matrix4, result?: Matrix4): Matrix4; + /** + * Creates a Matrix4 from 16 consecutive elements in an array. + * @example + * // Create the Matrix4: + // [1.0, 2.0, 3.0, 4.0] + // [1.0, 2.0, 3.0, 4.0] + // [1.0, 2.0, 3.0, 4.0] + // [1.0, 2.0, 3.0, 4.0] + + var v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0]; + var m = Cesium.Matrix4.fromArray(v); + + // Create same Matrix4 with using an offset into an array + var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0]; + var m2 = Cesium.Matrix4.fromArray(v2, 2); + * @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order. + * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if one was not provided. + */ + static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance from a column-major order array. + * @param values - The column-major order array. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance from a row-major order array. + The resulting matrix will be in column-major order. + * @param values - The row-major order array. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance from a Matrix3 representing the rotation + and a Cartesian3 representing the translation. + * @param rotation - The upper left portion of the matrix representing the rotation. + * @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance from a translation, rotation, and scale (TRS) + representation with the rotation represented as a quaternion. + * @example + * var result = Cesium.Matrix4.fromTranslationQuaternionRotationScale( + new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation + Cesium.Quaternion.IDENTITY, // rotation + new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale + result); + * @param translation - The translation transformation. + * @param rotation - The rotation transformation. + * @param scale - The non-uniform scale transformation. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4; + /** + * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance. + * @param translationRotationScale - The instance. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromTranslationRotationScale(translationRotationScale: TranslationRotationScale, result?: Matrix4): Matrix4; + /** + * Creates a Matrix4 instance from a Cartesian3 representing the translation. + * @param translation - The upper right portion of the matrix representing the translation. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance representing a non-uniform scale. + * @example + * // Creates + // [7.0, 0.0, 0.0, 0.0] + // [0.0, 8.0, 0.0, 0.0] + // [0.0, 0.0, 9.0, 0.0] + // [0.0, 0.0, 0.0, 1.0] + var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); + * @param scale - The x, y, and z scale factors. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance representing a uniform scale. + * @example + * // Creates + // [2.0, 0.0, 0.0, 0.0] + // [0.0, 2.0, 0.0, 0.0] + // [0.0, 0.0, 2.0, 0.0] + // [0.0, 0.0, 0.0, 1.0] + var m = Cesium.Matrix4.fromUniformScale(2.0); + * @param scale - The uniform scale factor. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromUniformScale(scale: number, result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance from a Camera. + * @param camera - The camera to use. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new Matrix4 instance if one was not provided. + */ + static fromCamera(camera: Camera, result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance representing a perspective transformation matrix. + * @param fovY - The field of view along the Y axis in radians. + * @param aspectRatio - The aspect ratio. + * @param near - The distance to the near plane in meters. + * @param far - The distance to the far plane in meters. + * @param result - The object in which the result will be stored. + * @returns The modified result parameter. + */ + static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance representing an orthographic transformation matrix. + * @param left - The number of meters to the left of the camera that will be in view. + * @param right - The number of meters to the right of the camera that will be in view. + * @param bottom - The number of meters below of the camera that will be in view. + * @param top - The number of meters above of the camera that will be in view. + * @param near - The distance to the near plane in meters. + * @param far - The distance to the far plane in meters. + * @param result - The object in which the result will be stored. + * @returns The modified result parameter. + */ + static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance representing an off center perspective transformation. + * @param left - The number of meters to the left of the camera that will be in view. + * @param right - The number of meters to the right of the camera that will be in view. + * @param bottom - The number of meters below of the camera that will be in view. + * @param top - The number of meters above of the camera that will be in view. + * @param near - The distance to the near plane in meters. + * @param far - The distance to the far plane in meters. + * @param result - The object in which the result will be stored. + * @returns The modified result parameter. + */ + static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance representing an infinite off center perspective transformation. + * @param left - The number of meters to the left of the camera that will be in view. + * @param right - The number of meters to the right of the camera that will be in view. + * @param bottom - The number of meters below of the camera that will be in view. + * @param top - The number of meters above of the camera that will be in view. + * @param near - The distance to the near plane in meters. + * @param result - The object in which the result will be stored. + * @returns The modified result parameter. + */ + static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, result: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates. + * @example + * // Create viewport transformation using an explicit viewport and depth range. + var m = Cesium.Matrix4.computeViewportTransformation({ + x : 0.0, + y : 0.0, + width : 1024.0, + height : 768.0 + }, 0.0, 1.0, new Cesium.Matrix4()); + * @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1. + * @param [nearDepthRange = 0.0] - The near plane distance in window coordinates. + * @param [farDepthRange = 1.0] - The far plane distance in window coordinates. + * @param [result] - The object in which the result will be stored. + * @returns The modified result parameter. + */ + static computeViewportTransformation(viewport?: any, nearDepthRange?: number, farDepthRange?: number, result?: Matrix4): Matrix4; + /** + * Computes a Matrix4 instance that transforms from world space to view space. + * @param position - The position of the camera. + * @param direction - The forward direction. + * @param up - The up direction. + * @param right - The right direction. + * @param result - The object in which the result will be stored. + * @returns The modified result parameter. + */ + static computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4; + /** + * Computes an Array from the provided Matrix4 instance. + The array will be in column-major order. + * @example + * //create an array from an instance of Matrix4 + // m = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + var a = Cesium.Matrix4.toArray(m); + + // m remains the same + //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] + * @param matrix - The matrix to use.. + * @param [result] - The Array onto which to store the result. + * @returns The modified Array parameter or a new Array instance if one was not provided. + */ + static toArray(matrix: Matrix4, result?: number[]): number[]; + /** + * Computes the array index of the element at the provided row and column. + * @example + * var myMatrix = new Cesium.Matrix4(); + var column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0); + var column1Row0 = myMatrix[column1Row0Index]; + myMatrix[column1Row0Index] = 10.0; + * @param row - The zero-based index of the row. + * @param column - The zero-based index of the column. + * @returns The index of the element at the provided row and column. + */ + static getElementIndex(row: number, column: number): number; + /** + * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance. + * @example + * //returns a Cartesian4 instance with values from the specified column + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + //Example 1: Creates an instance of Cartesian + var a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4()); + * @example + * //Example 2: Sets values for Cartesian instance + var a = new Cesium.Cartesian4(); + Cesium.Matrix4.getColumn(m, 2, a); + + // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; + * @param matrix - The matrix to use. + * @param index - The zero-based index of the column to retrieve. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4; + /** + * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance. + * @example + * //creates a new Matrix4 instance with new column values from the Cartesian4 instance + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4()); + + // m remains the same + // a = [10.0, 11.0, 99.0, 13.0] + // [14.0, 15.0, 98.0, 17.0] + // [18.0, 19.0, 97.0, 21.0] + // [22.0, 23.0, 96.0, 25.0] + * @param matrix - The matrix to use. + * @param index - The zero-based index of the column to set. + * @param cartesian - The Cartesian whose values will be assigned to the specified column. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4; + /** + * Computes a new matrix that replaces the translation in the rightmost column of the provided + matrix with the provided translation. This assumes the matrix is an affine transformation + * @param matrix - The matrix to use. + * @param translation - The translation that replaces the translation of the provided matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static setTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4; + /** + * Computes a new matrix that replaces the scale with the provided scale. This assumes the matrix is an affine transformation + * @param matrix - The matrix to use. + * @param scale - The scale that replaces the scale of the provided matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static setScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4; + /** + * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance. + * @example + * //returns a Cartesian4 instance with values from the specified column + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + //Example 1: Returns an instance of Cartesian + var a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4()); + * @example + * //Example 2: Sets values for a Cartesian instance + var a = new Cesium.Cartesian4(); + Cesium.Matrix4.getRow(m, 2, a); + + // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; + * @param matrix - The matrix to use. + * @param index - The zero-based index of the row to retrieve. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4; + /** + * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance. + * @example + * //create a new Matrix4 instance with new row values from the Cartesian4 instance + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4()); + + // m remains the same + // a = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [99.0, 98.0, 97.0, 96.0] + // [22.0, 23.0, 24.0, 25.0] + * @param matrix - The matrix to use. + * @param index - The zero-based index of the row to set. + * @param cartesian - The Cartesian whose values will be assigned to the specified row. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4; + /** + * Extracts the non-uniform scale assuming the matrix is an affine transformation. + * @param matrix - The matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter + */ + static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3; + /** + * Computes the maximum scale assuming the matrix is an affine transformation. + The maximum scale is the maximum length of the column vectors in the upper-left + 3x3 matrix. + * @param matrix - The matrix. + * @returns The maximum scale. + */ + static getMaximumScale(matrix: Matrix4): number; + /** + * Computes the product of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + /** + * Computes the sum of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + /** + * Computes the difference of two matrices. + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + /** + * Computes the product of two matrices assuming the matrices are + affine transformation matrices, where the upper left 3x3 elements + are a rotation matrix, and the upper three elements in the fourth + column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. + The matrix is not verified to be in the proper form. + This method is faster than computing the product for general 4x4 + matrices using {@link Matrix4.multiply}. + * @example + * var m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0); + var m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0)); + var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); + * @param left - The first matrix. + * @param right - The second matrix. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + /** + * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>) + by a 3x3 rotation matrix. This is an optimization + for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations. + * @example + * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m); + Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); + * @param matrix - The matrix on the left-hand side. + * @param rotation - The 3x3 rotation matrix on the right-hand side. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4; + /** + * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>) + by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization + for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations. + * @example + * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m); + Cesium.Matrix4.multiplyByTranslation(m, position, m); + * @param matrix - The matrix on the left-hand side. + * @param translation - The translation on the right-hand side. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4; + /** + * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>) + by an implicit uniform scale matrix. This is an optimization + for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where + <code>m</code> must be an affine matrix. + This function performs fewer allocations and arithmetic operations. + * @example + * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m); + Cesium.Matrix4.multiplyByUniformScale(m, scale, m); + * @param matrix - The affine matrix on the left-hand side. + * @param scale - The uniform scale on the right-hand side. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4; + /** + * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>) + by an implicit non-uniform scale matrix. This is an optimization + for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where + <code>m</code> must be an affine matrix. + This function performs fewer allocations and arithmetic operations. + * @example + * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m); + Cesium.Matrix4.multiplyByScale(m, scale, m); + * @param matrix - The affine matrix on the left-hand side. + * @param scale - The non-uniform scale on the right-hand side. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4; + /** + * Computes the product of a matrix and a column vector. + * @param matrix - The matrix. + * @param cartesian - The vector. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4; + /** + * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector} + with a {@link Cartesian4} with a <code>w</code> component of zero. + * @example + * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0); + var result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3()); + // A shortcut for + // Cartesian3 p = ... + // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); + * @param matrix - The matrix. + * @param cartesian - The point. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector} + with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}. + * @example + * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0); + var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); + * @param matrix - The matrix. + * @param cartesian - The point. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + /** + * Computes the product of a matrix and a scalar. + * @example + * //create a Matrix4 instance which is a scaled version of the supplied Matrix4 + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4()); + + // m remains the same + // a = [-20.0, -22.0, -24.0, -26.0] + // [-28.0, -30.0, -32.0, -34.0] + // [-36.0, -38.0, -40.0, -42.0] + // [-44.0, -46.0, -48.0, -50.0] + * @param matrix - The matrix. + * @param scalar - The number to multiply by. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4; + /** + * Computes a negated copy of the provided matrix. + * @example + * //create a new Matrix4 instance which is a negation of a Matrix4 + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.negate(m, new Cesium.Matrix4()); + + // m remains the same + // a = [-10.0, -11.0, -12.0, -13.0] + // [-14.0, -15.0, -16.0, -17.0] + // [-18.0, -19.0, -20.0, -21.0] + // [-22.0, -23.0, -24.0, -25.0] + * @param matrix - The matrix to negate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static negate(matrix: Matrix4, result: Matrix4): Matrix4; + /** + * Computes the transpose of the provided matrix. + * @example + * //returns transpose of a Matrix4 + // m = [10.0, 11.0, 12.0, 13.0] + // [14.0, 15.0, 16.0, 17.0] + // [18.0, 19.0, 20.0, 21.0] + // [22.0, 23.0, 24.0, 25.0] + + var a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4()); + + // m remains the same + // a = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + * @param matrix - The matrix to transpose. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static transpose(matrix: Matrix4, result: Matrix4): Matrix4; + /** + * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements. + * @param matrix - The matrix with signed elements. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static abs(matrix: Matrix4, result: Matrix4): Matrix4; + /** + * Compares the provided matrices componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @example + * //compares two Matrix4 instances + + // a = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + + // b = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + + if(Cesium.Matrix4.equals(a,b)) { + console.log("Both matrices are equal"); + } else { + console.log("They are not equal"); + } + + //Prints "Both matrices are equal" on the console + * @param [left] - The first matrix. + * @param [right] - The second matrix. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: Matrix4, right?: Matrix4): boolean; + /** + * Compares the provided matrices componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @example + * //compares two Matrix4 instances + + // a = [10.5, 14.5, 18.5, 22.5] + // [11.5, 15.5, 19.5, 23.5] + // [12.5, 16.5, 20.5, 24.5] + // [13.5, 17.5, 21.5, 25.5] + + // b = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + + if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){ + console.log("Difference between both the matrices is less than 0.1"); + } else { + console.log("Difference between both the matrices is not less than 0.1"); + } + + //Prints "Difference between both the matrices is not less than 0.1" on the console + * @param [left] - The first matrix. + * @param [right] - The second matrix. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Matrix4, right?: Matrix4, epsilon?: number): boolean; + /** + * Gets the translation portion of the provided matrix, assuming the matrix is a affine transformation matrix. + * @param matrix - The matrix to use. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3; + /** + * Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is an affine transformation matrix. + * @example + * // returns a Matrix3 instance from a Matrix4 instance + + // m = [10.0, 14.0, 18.0, 22.0] + // [11.0, 15.0, 19.0, 23.0] + // [12.0, 16.0, 20.0, 24.0] + // [13.0, 17.0, 21.0, 25.0] + + var b = new Cesium.Matrix3(); + Cesium.Matrix4.getMatrix3(m,b); + + // b = [10.0, 14.0, 18.0] + // [11.0, 15.0, 19.0] + // [12.0, 16.0, 20.0] + * @param matrix - The matrix to use. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3; + /** + * Computes the inverse of the provided matrix using Cramers Rule. + If the determinant is zero, the matrix can not be inverted, and an exception is thrown. + If the matrix is an affine transformation matrix, it is more efficient + to invert it with {@link Matrix4.inverseTransformation}. + * @param matrix - The matrix to invert. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static inverse(matrix: Matrix4, result: Matrix4): Matrix4; + /** + * Computes the inverse of the provided matrix assuming it is + an affine transformation matrix, where the upper left 3x3 elements + are a rotation matrix, and the upper three elements in the fourth + column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. + The matrix is not verified to be in the proper form. + This method is faster than computing the inverse for a general 4x4 + matrix using {@link Matrix4.inverse}. + * @param matrix - The matrix to invert. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4; + /** + * Computes the inverse transpose of a matrix. + * @param matrix - The matrix to transpose and invert. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static inverseTranspose(matrix: Matrix4, result: Matrix4): Matrix4; + /** + * An immutable Matrix4 instance initialized to the identity matrix. + */ + static readonly IDENTITY: Matrix4; + /** + * An immutable Matrix4 instance initialized to the zero matrix. + */ + static readonly ZERO: Matrix4; + /** + * The index into Matrix4 for column 0, row 0. + */ + static readonly COLUMN0ROW0: number; + /** + * The index into Matrix4 for column 0, row 1. + */ + static readonly COLUMN0ROW1: number; + /** + * The index into Matrix4 for column 0, row 2. + */ + static readonly COLUMN0ROW2: number; + /** + * The index into Matrix4 for column 0, row 3. + */ + static readonly COLUMN0ROW3: number; + /** + * The index into Matrix4 for column 1, row 0. + */ + static readonly COLUMN1ROW0: number; + /** + * The index into Matrix4 for column 1, row 1. + */ + static readonly COLUMN1ROW1: number; + /** + * The index into Matrix4 for column 1, row 2. + */ + static readonly COLUMN1ROW2: number; + /** + * The index into Matrix4 for column 1, row 3. + */ + static readonly COLUMN1ROW3: number; + /** + * The index into Matrix4 for column 2, row 0. + */ + static readonly COLUMN2ROW0: number; + /** + * The index into Matrix4 for column 2, row 1. + */ + static readonly COLUMN2ROW1: number; + /** + * The index into Matrix4 for column 2, row 2. + */ + static readonly COLUMN2ROW2: number; + /** + * The index into Matrix4 for column 2, row 3. + */ + static readonly COLUMN2ROW3: number; + /** + * The index into Matrix4 for column 3, row 0. + */ + static readonly COLUMN3ROW0: number; + /** + * The index into Matrix4 for column 3, row 1. + */ + static readonly COLUMN3ROW1: number; + /** + * The index into Matrix4 for column 3, row 2. + */ + static readonly COLUMN3ROW2: number; + /** + * The index into Matrix4 for column 3, row 3. + */ + static readonly COLUMN3ROW3: number; + /** + * Gets the number of items in the collection. + */ + length: number; + /** + * Duplicates the provided Matrix4 instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if one was not provided. + */ + clone(result?: Matrix4): Matrix4; + /** + * Compares this matrix to the provided matrix componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side matrix. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: Matrix4): boolean; + /** + * Compares this matrix to the provided matrix componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [right] - The right hand side matrix. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: Matrix4, epsilon?: number): boolean; + /** + * Computes a string representing this Matrix with each row being + on a separate line and in the format '(column0, column1, column2, column3)'. + * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'. + */ + toString(): string; +} + +/** + * A stable merge sort. + * @example + * // Assume array contains BoundingSpheres in world coordinates. +// Sort them in ascending order of distance from the camera. +var position = camera.positionWC; +Cesium.mergeSort(array, function(a, b, position) { + return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position); +}, position); + * @param array - The array to sort. + * @param comparator - The function to use to compare elements in the array. + * @param [userDefinedObject] - Any item to pass as the third parameter to <code>comparator</code>. + */ +export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void; + +/** + * A function used to compare two items while performing a merge sort. + * @example + * function compareNumbers(a, b, userDefinedObject) { + return a - b; +} + * @param a - An item in the array. + * @param b - An item in the array. + * @param [userDefinedObject] - An object that was passed to {@link mergeSort}. + */ +export type mergeSortComparator = (a: any, b: any, userDefinedObject?: any) => number; + +/** + * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space. + * @param [near = 0.0] - The lower bound of the camera range. + * @param [nearValue = 0.0] - The value at the lower bound of the camera range. + * @param [far = 1.0] - The upper bound of the camera range. + * @param [farValue = 0.0] - The value at the upper bound of the camera range. + */ +export class NearFarScalar { + constructor(near?: number, nearValue?: number, far?: number, farValue?: number); + /** + * The lower bound of the camera range. + */ + near: number; + /** + * The value at the lower bound of the camera range. + */ + nearValue: number; + /** + * The upper bound of the camera range. + */ + far: number; + /** + * The value at the upper bound of the camera range. + */ + farValue: number; + /** + * Duplicates a NearFarScalar instance. + * @param nearFarScalar - The NearFarScalar to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined) + */ + static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar; + /** + * Compares the provided NearFarScalar and returns <code>true</code> if they are equal, + <code>false</code> otherwise. + * @param [left] - The first NearFarScalar. + * @param [right] - The second NearFarScalar. + * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>. + */ + static equals(left?: NearFarScalar, right?: NearFarScalar): boolean; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. + */ + clone(result?: NearFarScalar): NearFarScalar; + /** + * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal, + <code>false</code> otherwise. + * @param [right] - The right hand side NearFarScalar. + * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>. + */ + equals(right?: NearFarScalar): boolean; +} + +/** + * Converts an object representing a set of name/value pairs into a query string, +with names and values encoded properly for use in a URL. Values that are arrays +will produce multiple values with the same name. + * @example + * var str = Cesium.objectToQuery({ + key1 : 'some value', + key2 : 'a/b', + key3 : ['x', 'y'] +}); + * @param obj - The object containing data to encode. + * @returns An encoded query string. + */ +export function objectToQuery(obj: any): string; + +/** + * Creates an Occluder derived from an object's position and radius, as well as the camera position. +The occluder can be used to determine whether or not other objects are visible or hidden behind the +visible horizon defined by the occluder and camera position. + * @example + * // Construct an occluder one unit away from the origin with a radius of one. +var cameraPosition = Cesium.Cartesian3.ZERO; +var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1); +var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition); + * @param occluderBoundingSphere - The bounding sphere surrounding the occluder. + * @param cameraPosition - The coordinate of the viewer/camera. + */ +export class Occluder { + constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3); + /** + * The position of the occluder. + */ + position: Cartesian3; + /** + * The radius of the occluder. + */ + radius: number; + /** + * The position of the camera. + */ + cameraPosition: Cartesian3; + /** + * Creates an occluder from a bounding sphere and the camera position. + * @param occluderBoundingSphere - The bounding sphere surrounding the occluder. + * @param cameraPosition - The coordinate of the viewer/camera. + * @param [result] - The object onto which to store the result. + * @returns The occluder derived from an object's position and radius, as well as the camera position. + */ + static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder; + /** + * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder. + * @example + * var cameraPosition = new Cesium.Cartesian3(0, 0, 0); + var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25); + var occluder = new Cesium.Occluder(littleSphere, cameraPosition); + var point = new Cesium.Cartesian3(0, 0, -3); + occluder.isPointVisible(point); //returns true + * @param occludee - The point surrounding the occludee object. + * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>. + */ + isPointVisible(occludee: Cartesian3): boolean; + /** + * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder. + * @example + * var cameraPosition = new Cesium.Cartesian3(0, 0, 0); + var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25); + var occluder = new Cesium.Occluder(littleSphere, cameraPosition); + var bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1); + occluder.isBoundingSphereVisible(bigSphere); //returns true + * @param occludee - The bounding sphere surrounding the occludee object. + * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>. + */ + isBoundingSphereVisible(occludee: BoundingSphere): boolean; + /** + * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible). + * @example + * var sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5); + var sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5); + var cameraPosition = new Cesium.Cartesian3(0, 0, 0); + var occluder = new Cesium.Occluder(sphere1, cameraPosition); + occluder.computeVisibility(sphere2); //returns Visibility.NONE + * @param occludeeBS - The bounding sphere of the occludee. + * @returns Visibility.NONE if the occludee is not visible, + Visibility.PARTIAL if the occludee is partially visible, or + Visibility.FULL if the occludee is fully visible. + */ + computeVisibility(occludeeBS: BoundingSphere): Visibility; + /** + * Computes a point that can be used as the occludee position to the visibility functions. + Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around + an object that is used for visibility; however it is also possible to compute a point that if + seen/not seen would also indicate if an object is visible/not visible. This function is better + called for objects that do not move relative to the occluder and is large, such as a chunk of + terrain. You are better off not calling this and using the object's bounding sphere for objects + such as a satellite or ground vehicle. + * @example + * var cameraPosition = new Cesium.Cartesian3(0, 0, 0); + var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2); + var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition); + var positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)]; + var tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions); + var occludeePosition = tileOccluderSphere.center; + var occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions); + * @param occluderBoundingSphere - The bounding sphere surrounding the occluder. + * @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located. + * @param positions - List of altitude points on the horizon near the surface of the occluder. + * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code> + which is a boolean value. + */ + static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any; + /** + * Computes a point that can be used as the occludee position to the visibility functions from a rectangle. + * @param rectangle - The rectangle used to create a bounding sphere. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle. + * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code> + which is a boolean value. + */ + static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any; +} + +/** + * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server. + * @example + * // Configure a Viewer to use the OpenCage Geocoder +var viewer = new Cesium.Viewer('cesiumContainer', { + geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>') +}); + * @param url - The endpoint to the OpenCage server. + * @param apiKey - The OpenCage API Key. + * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt): + * @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return. + * @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging. + * @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in. + * @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard). + * @param [options.jsonp] - Wraps the returned JSON with a function name. + * @param [options.language] - An IETF format language code. + * @param [options.limit] - The maximum number of results we should return. + * @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned. + * @param [options.no_annotations] - When set to 1 results will not contain annotations. + * @param [options.no_dedupe] - When set to 1 results will not be deduplicated. + * @param [options.no_record] - When set to 1 the query contents are not logged. + * @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging. + * @param [options.proximity] - Provides the geocoder with a hint to bias results in favour of those closer to the specified location (For example: 41.40139,2.12870). + */ +export class OpenCageGeocoderService { + constructor(url: Resource | string, apiKey: string, params?: { + abbrv?: number + }); + /** + * The Resource used to access the OpenCage endpoint. + */ + readonly url: Resource; + /** + * Optional params passed to OpenCage in order to customize geocoding + */ + readonly params: any; + /** + * @param query - The query to be sent to the geocoder service + */ + geocode(query: string): Promise<GeocoderService.Result[]>; +} + +/** + * Creates an instance of an OrientedBoundingBox. +An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases. + * @example + * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale. +var center = new Cesium.Cartesian3(1.0, 0.0, 0.0); +var halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3()); + +var obb = new Cesium.OrientedBoundingBox(center, halfAxes); + * @param [center = Cartesian3.ZERO] - The center of the box. + * @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box. + Equivalently, the transformation matrix, to rotate and scale a 0x0x0 + cube centered at the origin. + */ +export class OrientedBoundingBox { + constructor(center?: Cartesian3, halfAxes?: Matrix3); + /** + * The center of the box. + */ + center: Cartesian3; + /** + * The transformation matrix, to rotate the box to the right position. + */ + halfAxes: Matrix3; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: OrientedBoundingBox, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox; + /** + * Computes an instance of an OrientedBoundingBox of the given positions. + This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis). + Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf + * @example + * // Compute an object oriented bounding box enclosing two points. + var box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]); + * @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided. + */ + static fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox; + /** + * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}. + There are no guarantees about the orientation of the bounding box. + * @param rectangle - The cartographic rectangle on the surface of the ellipsoid. + * @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile. + * @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle is defined. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. + */ + static fromRectangle(rectangle: Rectangle, minimumHeight?: number, maximumHeight?: number, ellipsoid?: Ellipsoid, result?: OrientedBoundingBox): OrientedBoundingBox; + /** + * Duplicates a OrientedBoundingBox instance. + * @param box - The bounding box to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined) + */ + static clone(box: OrientedBoundingBox, result?: OrientedBoundingBox): OrientedBoundingBox; + /** + * Determines which side of a plane the oriented bounding box is located. + * @param box - The oriented bounding box to test. + * @param plane - The plane to test against. + * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane + the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is + on the opposite side, and {@link Intersect.INTERSECTING} if the box + intersects the plane. + */ + static intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect; + /** + * Computes the estimated distance squared from the closest point on a bounding box to a point. + * @example + * // Sort bounding boxes from back to front + boxes.sort(function(a, b) { + return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC); + }); + * @param box - The box. + * @param cartesian - The point + * @returns The estimated distance squared from the bounding sphere to the point. + */ + static distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number; + /** + * The distances calculated by the vector from the center of the bounding box to position projected onto direction. + <br> + If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the + closest and farthest planes from position that intersect the bounding box. + * @param box - The bounding box to calculate the distance to. + * @param position - The position to calculate the distance from. + * @param direction - The direction from position. + * @param [result] - A Interval to store the nearest and farthest distances. + * @returns The nearest and farthest distances on the bounding box from position in direction. + */ + static computePlaneDistances(box: OrientedBoundingBox, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval; + /** + * Determines whether or not a bounding box is hidden from view by the occluder. + * @param box - The bounding box surrounding the occludee object. + * @param occluder - The occluder. + * @returns <code>true</code> if the box is not visible; otherwise <code>false</code>. + */ + static isOccluded(box: OrientedBoundingBox, occluder: Occluder): boolean; + /** + * Determines which side of a plane the oriented bounding box is located. + * @param plane - The plane to test against. + * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane + the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is + on the opposite side, and {@link Intersect.INTERSECTING} if the box + intersects the plane. + */ + intersectPlane(plane: Plane): Intersect; + /** + * Computes the estimated distance squared from the closest point on a bounding box to a point. + * @example + * // Sort bounding boxes from back to front + boxes.sort(function(a, b) { + return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC); + }); + * @param cartesian - The point + * @returns The estimated distance squared from the bounding sphere to the point. + */ + distanceSquaredTo(cartesian: Cartesian3): number; + /** + * The distances calculated by the vector from the center of the bounding box to position projected onto direction. + <br> + If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the + closest and farthest planes from position that intersect the bounding box. + * @param position - The position to calculate the distance from. + * @param direction - The direction from position. + * @param [result] - A Interval to store the nearest and farthest distances. + * @returns The nearest and farthest distances on the bounding box from position in direction. + */ + computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval; + /** + * Determines whether or not a bounding box is hidden from view by the occluder. + * @param occluder - The occluder. + * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>. + */ + isOccluded(occluder: Occluder): boolean; + /** + * Compares the provided OrientedBoundingBox componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param left - The first OrientedBoundingBox. + * @param right - The second OrientedBoundingBox. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left: OrientedBoundingBox, right: OrientedBoundingBox): boolean; + /** + * Duplicates this OrientedBoundingBox instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided. + */ + clone(result?: OrientedBoundingBox): OrientedBoundingBox; + /** + * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side OrientedBoundingBox. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: OrientedBoundingBox): boolean; +} + +/** + * The viewing frustum is defined by 6 planes. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. + * @example + * var maxRadii = ellipsoid.maximumRadius; + +var frustum = new Cesium.OrthographicFrustum(); +frustum.near = 0.01 * maxRadii; +frustum.far = 50.0 * maxRadii; + * @param [options] - An object with the following properties: + * @param [options.width] - The width of the frustum in meters. + * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height. + * @param [options.near = 1.0] - The distance of the near plane. + * @param [options.far = 500000000.0] - The distance of the far plane. + */ +export class OrthographicFrustum { + constructor(options?: { + width?: number + aspectRatio?: number + near?: number + far?: number + }); + /** + * The horizontal width of the frustum in meters. + */ + width: number; + /** + * The aspect ratio of the frustum's width to it's height. + */ + aspectRatio: number; + /** + * The distance of the near plane. + */ + near: number; + /** + * The distance of the far plane. + */ + far: number; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: OrthographicFrustum, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: OrthographicFrustum): OrthographicFrustum; + /** + * Gets the orthographic projection matrix computed from the view frustum. + */ + readonly projectionMatrix: Matrix4; + /** + * Creates a culling volume for this frustum. + * @example + * // Check if a bounding volume intersects the frustum. + var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + var intersect = cullingVolume.computeVisibility(boundingVolume); + * @param position - The eye position. + * @param direction - The view direction. + * @param up - The up direction. + * @returns A culling volume at the given position and orientation. + */ + computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume; + /** + * Returns the pixel's width and height in meters. + * @example + * // Example 1 + // Get the width and height of a pixel. + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2()); + * @param drawingBufferWidth - The width of the drawing buffer. + * @param drawingBufferHeight - The height of the drawing buffer. + * @param distance - The distance to the near plane in meters. + * @param pixelRatio - The scaling factor from pixel space to coordinate space. + * @param result - The object onto which to store the result. + * @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively. + */ + getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2; + /** + * Returns a duplicate of a OrthographicFrustum instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided. + */ + clone(result?: OrthographicFrustum): OrthographicFrustum; + /** + * Compares the provided OrthographicFrustum componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The right hand side OrthographicFrustum. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(other?: OrthographicFrustum): boolean; + /** + * Compares the provided OrthographicFrustum componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param other - The right hand side OrthographicFrustum. + * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(other: OrthographicFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean; +} + +/** + * The viewing frustum is defined by 6 planes. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. + * @example + * var maxRadii = ellipsoid.maximumRadius; + +var frustum = new Cesium.OrthographicOffCenterFrustum(); +frustum.right = maxRadii * Cesium.Math.PI; +frustum.left = -c.frustum.right; +frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth); +frustum.bottom = -c.frustum.top; +frustum.near = 0.01 * maxRadii; +frustum.far = 50.0 * maxRadii; + * @param [options] - An object with the following properties: + * @param [options.left] - The left clipping plane distance. + * @param [options.right] - The right clipping plane distance. + * @param [options.top] - The top clipping plane distance. + * @param [options.bottom] - The bottom clipping plane distance. + * @param [options.near = 1.0] - The near clipping plane distance. + * @param [options.far = 500000000.0] - The far clipping plane distance. + */ +export class OrthographicOffCenterFrustum { + constructor(options?: { + left?: number + right?: number + top?: number + bottom?: number + near?: number + far?: number + }); + /** + * The left clipping plane. + */ + left: number; + /** + * The right clipping plane. + */ + right: number; + /** + * The top clipping plane. + */ + top: number; + /** + * The bottom clipping plane. + */ + bottom: number; + /** + * The distance of the near plane. + */ + near: number; + /** + * The distance of the far plane. + */ + far: number; + /** + * Gets the orthographic projection matrix computed from the view frustum. + */ + readonly projectionMatrix: Matrix4; + /** + * Creates a culling volume for this frustum. + * @example + * // Check if a bounding volume intersects the frustum. + var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + var intersect = cullingVolume.computeVisibility(boundingVolume); + * @param position - The eye position. + * @param direction - The view direction. + * @param up - The up direction. + * @returns A culling volume at the given position and orientation. + */ + computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume; + /** + * Returns the pixel's width and height in meters. + * @example + * // Example 1 + // Get the width and height of a pixel. + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2()); + * @param drawingBufferWidth - The width of the drawing buffer. + * @param drawingBufferHeight - The height of the drawing buffer. + * @param distance - The distance to the near plane in meters. + * @param pixelRatio - The scaling factor from pixel space to coordinate space. + * @param result - The object onto which to store the result. + * @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively. + */ + getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2; + /** + * Returns a duplicate of a OrthographicOffCenterFrustum instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided. + */ + clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum; + /** + * Compares the provided OrthographicOffCenterFrustum componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The right hand side OrthographicOffCenterFrustum. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(other?: OrthographicOffCenterFrustum): boolean; + /** + * Compares the provided OrthographicOffCenterFrustum componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param other - The right hand side OrthographicOffCenterFrustum. + * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean; +} + +export namespace Packable { + /** + * The number of elements used to pack the object into an array. + */ + var packedLength: number + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + */ + function pack(value: any, array: number[], startingIndex?: number): void; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Object instance if one was not provided. + */ + function unpack(array: number[], startingIndex?: number, result?: any): any; +} + +/** + * Static interface for types which can store their values as packed +elements in an array. These methods and properties are expected to be +defined on a constructor function. + */ +export interface Packable { +} + +/** + * Static interface for {@link Packable} types which are interpolated in a +different representation than their packed value. These methods and +properties are expected to be defined on a constructor function. + */ +export namespace PackableForInterpolation { + /** + * The number of elements used to store the object into an array in its interpolatable form. + */ + var packedInterpolationLength: number + /** + * Converts a packed array into a form suitable for interpolation. + * @param packedArray - The packed array. + * @param [startingIndex = 0] - The index of the first element to be converted. + * @param [lastIndex = packedArray.length] - The index of the last element to be converted. + * @param [result] - The object into which to store the result. + */ + function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void; + /** + * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}. + * @param array - The array previously packed for interpolation. + * @param sourceArray - The original packed array. + * @param [startingIndex = 0] - The startingIndex used to convert the array. + * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Object instance if one was not provided. + */ + function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any; +} + +/** + * Provides geocoding via a {@link https://pelias.io/|Pelias} server. + * @example + * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/ +var viewer = new Cesium.Viewer('cesiumContainer', { + geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({ + url: 'https://api.geocode.earth/v1/', + queryParameters: { + api_key: '<Your geocode.earth API key>' + } + })) +}); + * @param url - The endpoint to the Pelias server. + */ +export class PeliasGeocoderService { + constructor(url: Resource | string); + /** + * The Resource used to access the Pelias endpoint. + */ + readonly url: Resource; + /** + * @param query - The query to be sent to the geocoder service + * @param [type = GeocodeType.SEARCH] - The type of geocode to perform. + */ + geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>; +} + +/** + * The viewing frustum is defined by 6 planes. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. + * @example + * var frustum = new Cesium.PerspectiveFrustum({ + fov : Cesium.Math.PI_OVER_THREE, + aspectRatio : canvas.clientWidth / canvas.clientHeight + near : 1.0, + far : 1000.0 +}); + * @param [options] - An object with the following properties: + * @param [options.fov] - The angle of the field of view (FOV), in radians. + * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height. + * @param [options.near = 1.0] - The distance of the near plane. + * @param [options.far = 500000000.0] - The distance of the far plane. + * @param [options.xOffset = 0.0] - The offset in the x direction. + * @param [options.yOffset = 0.0] - The offset in the y direction. + */ +export class PerspectiveFrustum { + constructor(options?: { + fov?: number + aspectRatio?: number + near?: number + far?: number + xOffset?: number + yOffset?: number + }); + /** + * The angle of the field of view (FOV), in radians. This angle will be used + as the horizontal FOV if the width is greater than the height, otherwise + it will be the vertical FOV. + */ + fov: number; + /** + * The aspect ratio of the frustum's width to it's height. + */ + aspectRatio: number; + /** + * The distance of the near plane. + */ + near: number; + /** + * The distance of the far plane. + */ + far: number; + /** + * Offsets the frustum in the x direction. + */ + xOffset: number; + /** + * Offsets the frustum in the y direction. + */ + yOffset: number; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: PerspectiveFrustum, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: PerspectiveFrustum): PerspectiveFrustum; + /** + * Gets the perspective projection matrix computed from the view frustum. + */ + readonly projectionMatrix: Matrix4; + /** + * The perspective projection matrix computed from the view frustum with an infinite far plane. + */ + readonly infiniteProjectionMatrix: Matrix4; + /** + * Gets the angle of the vertical field of view, in radians. + */ + readonly fovy: number; + /** + * Creates a culling volume for this frustum. + * @example + * // Check if a bounding volume intersects the frustum. + var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + var intersect = cullingVolume.computeVisibility(boundingVolume); + * @param position - The eye position. + * @param direction - The view direction. + * @param up - The up direction. + * @returns A culling volume at the given position and orientation. + */ + computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume; + /** + * Returns the pixel's width and height in meters. + * @example + * // Example 1 + // Get the width and height of a pixel. + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2()); + * @example + * // Example 2 + // Get the width and height of a pixel if the near plane was set to 'distance'. + // For example, get the size of a pixel of an image on a billboard. + var position = camera.position; + var direction = camera.direction; + var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive + var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector + var distance = Cesium.Cartesian3.magnitude(toCenterProj); + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2()); + * @param drawingBufferWidth - The width of the drawing buffer. + * @param drawingBufferHeight - The height of the drawing buffer. + * @param distance - The distance to the near plane in meters. + * @param pixelRatio - The scaling factor from pixel space to coordinate space. + * @param result - The object onto which to store the result. + * @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively. + */ + getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2; + /** + * Returns a duplicate of a PerspectiveFrustum instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided. + */ + clone(result?: PerspectiveFrustum): PerspectiveFrustum; + /** + * Compares the provided PerspectiveFrustum componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The right hand side PerspectiveFrustum. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(other?: PerspectiveFrustum): boolean; + /** + * Compares the provided PerspectiveFrustum componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param other - The right hand side PerspectiveFrustum. + * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(other: PerspectiveFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean; +} + +/** + * The viewing frustum is defined by 6 planes. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. + * @example + * var frustum = new Cesium.PerspectiveOffCenterFrustum({ + left : -1.0, + right : 1.0, + top : 1.0, + bottom : -1.0, + near : 1.0, + far : 100.0 +}); + * @param [options] - An object with the following properties: + * @param [options.left] - The left clipping plane distance. + * @param [options.right] - The right clipping plane distance. + * @param [options.top] - The top clipping plane distance. + * @param [options.bottom] - The bottom clipping plane distance. + * @param [options.near = 1.0] - The near clipping plane distance. + * @param [options.far = 500000000.0] - The far clipping plane distance. + */ +export class PerspectiveOffCenterFrustum { + constructor(options?: { + left?: number + right?: number + top?: number + bottom?: number + near?: number + far?: number + }); + /** + * Defines the left clipping plane. + */ + left: number; + /** + * Defines the right clipping plane. + */ + right: number; + /** + * Defines the top clipping plane. + */ + top: number; + /** + * Defines the bottom clipping plane. + */ + bottom: number; + /** + * The distance of the near plane. + */ + near: number; + /** + * The distance of the far plane. + */ + far: number; + /** + * Gets the perspective projection matrix computed from the view frustum. + */ + readonly projectionMatrix: Matrix4; + /** + * Gets the perspective projection matrix computed from the view frustum with an infinite far plane. + */ + readonly infiniteProjectionMatrix: Matrix4; + /** + * Creates a culling volume for this frustum. + * @example + * // Check if a bounding volume intersects the frustum. + var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + var intersect = cullingVolume.computeVisibility(boundingVolume); + * @param position - The eye position. + * @param direction - The view direction. + * @param up - The up direction. + * @returns A culling volume at the given position and orientation. + */ + computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume; + /** + * Returns the pixel's width and height in meters. + * @example + * // Example 1 + // Get the width and height of a pixel. + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2()); + * @example + * // Example 2 + // Get the width and height of a pixel if the near plane was set to 'distance'. + // For example, get the size of a pixel of an image on a billboard. + var position = camera.position; + var direction = camera.direction; + var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive + var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector + var distance = Cesium.Cartesian3.magnitude(toCenterProj); + var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2()); + * @param drawingBufferWidth - The width of the drawing buffer. + * @param drawingBufferHeight - The height of the drawing buffer. + * @param distance - The distance to the near plane in meters. + * @param pixelRatio - The scaling factor from pixel space to coordinate space. + * @param result - The object onto which to store the result. + * @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively. + */ + getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2; + /** + * Returns a duplicate of a PerspectiveOffCenterFrustum instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided. + */ + clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum; + /** + * Compares the provided PerspectiveOffCenterFrustum componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The right hand side PerspectiveOffCenterFrustum. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(other?: PerspectiveOffCenterFrustum): boolean; + /** + * Compares the provided PerspectiveOffCenterFrustum componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param other - The right hand side PerspectiveOffCenterFrustum. + * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing. + * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(other: PerspectiveOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean; +} + +/** + * A utility class for generating custom map pins as canvas elements. +<br /><br /> +<div align='center'> +<img src='Images/PinBuilder.png' width='500'/><br /> +Example pins generated using both the maki icon set, which ships with Cesium, and single character text. +</div> + */ +export class PinBuilder { + constructor(); + /** + * Creates an empty pin of the specified color and size. + * @param color - The color of the pin. + * @param size - The size of the pin, in pixels. + * @returns The canvas element that represents the generated pin. + */ + fromColor(color: Color, size: number): HTMLCanvasElement; + /** + * Creates a pin with the specified icon, color, and size. + * @param url - The url of the image to be stamped onto the pin. + * @param color - The color of the pin. + * @param size - The size of the pin, in pixels. + * @returns The canvas element or a Promise to the canvas element that represents the generated pin. + */ + fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>; + /** + * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size. + * @param id - The id of the maki icon to be stamped onto the pin. + * @param color - The color of the pin. + * @param size - The size of the pin, in pixels. + * @returns The canvas element or a Promise to the canvas element that represents the generated pin. + */ + fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>; + /** + * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible + while still being contained completely within the pin. + * @param text - The text to be stamped onto the pin. + * @param color - The color of the pin. + * @param size - The size of the pin, in pixels. + * @returns The canvas element that represents the generated pin. + */ + fromText(text: string, color: Color, size: number): HTMLCanvasElement; +} + +/** + * The format of a pixel, i.e., the number of components it has and what they represent. + */ +export enum PixelFormat { + /** + * A pixel format containing a depth value. + */ + DEPTH_COMPONENT = WebGLConstants.DEPTH_COMPONENT, + /** + * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}. + */ + DEPTH_STENCIL = WebGLConstants.DEPTH_STENCIL, + /** + * A pixel format containing an alpha channel. + */ + ALPHA = WebGLConstants.ALPHA, + /** + * A pixel format containing red, green, and blue channels. + */ + RGB = WebGLConstants.RGB, + /** + * A pixel format containing red, green, blue, and alpha channels. + */ + RGBA = WebGLConstants.RGBA, + /** + * A pixel format containing a luminance (intensity) channel. + */ + LUMINANCE = WebGLConstants.LUMINANCE, + /** + * A pixel format containing luminance (intensity) and alpha channels. + */ + LUMINANCE_ALPHA = WebGLConstants.LUMINANCE_ALPHA, + /** + * A pixel format containing red, green, and blue channels that is DXT1 compressed. + */ + RGB_DXT1 = WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT, + /** + * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed. + */ + RGBA_DXT1 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT, + /** + * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed. + */ + RGBA_DXT3 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT, + /** + * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed. + */ + RGBA_DXT5 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT, + /** + * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed. + */ + RGB_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG, + /** + * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed. + */ + RGB_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG, + /** + * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed. + */ + RGBA_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, + /** + * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed. + */ + RGBA_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, + /** + * A pixel format containing red, green, and blue channels that is ETC1 compressed. + */ + RGB_ETC1 = WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL +} + +/** + * A plane in Hessian Normal Form defined by +<pre> +ax + by + cz + d = 0 +</pre> +where (a, b, c) is the plane's <code>normal</code>, d is the signed +<code>distance</code> to the plane, and (x, y, z) is any point on +the plane. + * @example + * // The plane x=0 +var plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0); + * @param normal - The plane's normal (normalized). + * @param distance - The shortest distance from the origin to the plane. The sign of +<code>distance</code> determines which side of the plane the origin +is on. If <code>distance</code> is positive, the origin is in the half-space +in the direction of the normal; if negative, the origin is in the half-space +opposite to the normal; if zero, the plane passes through the origin. + */ +export class Plane { + constructor(normal: Cartesian3, distance: number); + /** + * The plane's normal. + */ + normal: Cartesian3; + /** + * The shortest distance from the origin to the plane. The sign of + <code>distance</code> determines which side of the plane the origin + is on. If <code>distance</code> is positive, the origin is in the half-space + in the direction of the normal; if negative, the origin is in the half-space + opposite to the normal; if zero, the plane passes through the origin. + */ + distance: number; + /** + * Creates a plane from a normal and a point on the plane. + * @example + * var point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0); + var normal = ellipsoid.geodeticSurfaceNormal(point); + var tangentPlane = Cesium.Plane.fromPointNormal(point, normal); + * @param point - The point on the plane. + * @param normal - The plane's normal (normalized). + * @param [result] - The object onto which to store the result. + * @returns A new plane instance or the modified result parameter. + */ + static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane; + /** + * Creates a plane from the general equation + * @param coefficients - The plane's normal (normalized). + * @param [result] - The object onto which to store the result. + * @returns A new plane instance or the modified result parameter. + */ + static fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane; + /** + * Computes the signed shortest distance of a point to a plane. + The sign of the distance determines which side of the plane the point + is on. If the distance is positive, the point is in the half-space + in the direction of the normal; if negative, the point is in the half-space + opposite to the normal; if zero, the plane passes through the point. + * @param plane - The plane. + * @param point - The point. + * @returns The signed shortest distance of the point to the plane. + */ + static getPointDistance(plane: Plane, point: Cartesian3): number; + /** + * Projects a point onto the plane. + * @param plane - The plane to project the point onto + * @param point - The point to project onto the plane + * @param [result] - The result point. If undefined, a new Cartesian3 will be created. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. + */ + static projectPointOntoPlane(plane: Plane, point: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Transforms the plane by the given transformation matrix. + * @param plane - The plane. + * @param transform - The transformation matrix. + * @param [result] - The object into which to store the result. + * @returns The plane transformed by the given transformation matrix. + */ + static transform(plane: Plane, transform: Matrix4, result?: Plane): Plane; + /** + * Duplicates a Plane instance. + * @param plane - The plane to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Plane instance if one was not provided. + */ + static clone(plane: Plane, result?: Plane): Plane; + /** + * Compares the provided Planes by normal and distance and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param left - The first plane. + * @param right - The second plane. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left: Plane, right: Plane): boolean; + /** + * A constant initialized to the XY plane passing through the origin, with normal in positive Z. + */ + static readonly ORIGIN_XY_PLANE: Plane; + /** + * A constant initialized to the YZ plane passing through the origin, with normal in positive X. + */ + static readonly ORIGIN_YZ_PLANE: Plane; + /** + * A constant initialized to the ZX plane passing through the origin, with normal in positive Y. + */ + static readonly ORIGIN_ZX_PLANE: Plane; +} + +/** + * Describes geometry representing a plane centered at the origin, with a unit width and length. + * @example + * var planeGeometry = new Cesium.PlaneGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_ONLY +}); + * @param [options] - Object with the following properties: + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ +export class PlaneGeometry { + constructor(options?: { + vertexFormat?: VertexFormat + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: PlaneGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new PlaneGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: PlaneGeometry): PlaneGeometry; + /** + * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere. + * @param planeGeometry - A description of the plane. + * @returns The computed vertices and indices. + */ + static createGeometry(planeGeometry: PlaneGeometry): Geometry | undefined; +} + +/** + * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length. + */ +export class PlaneOutlineGeometry { + constructor(); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @returns The array that was packed into + */ + static pack(value: PlaneOutlineGeometry, array: number[]): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: PlaneOutlineGeometry): PlaneOutlineGeometry; + /** + * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere. + * @returns The computed vertices and indices. + */ + static createGeometry(): Geometry | undefined; +} + +/** + * Determines if a point is inside a triangle. + * @example + * // Returns true +var p = new Cesium.Cartesian2(0.25, 0.25); +var b = Cesium.pointInsideTriangle(p, + new Cesium.Cartesian2(0.0, 0.0), + new Cesium.Cartesian2(1.0, 0.0), + new Cesium.Cartesian2(0.0, 1.0)); + * @param point - The point to test. + * @param p0 - The first point of the triangle. + * @param p1 - The second point of the triangle. + * @param p2 - The third point of the triangle. + * @returns <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>. + */ +export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean; + +/** + * A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. + * @example + * // 1. create a polygon from points +var polygon = new Cesium.PolygonGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + ) +}); +var geometry = Cesium.PolygonGeometry.createGeometry(polygon); + +// 2. create a nested polygon with holes +var polygonWithHole = new Cesium.PolygonGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -109.0, 30.0, + -95.0, 30.0, + -95.0, 40.0, + -109.0, 40.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -107.0, 31.0, + -107.0, 39.0, + -97.0, 39.0, + -97.0, 31.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -105.0, 33.0, + -99.0, 33.0, + -99.0, 37.0, + -105.0, 37.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -103.0, 34.0, + -101.0, 34.0, + -101.0, 36.0, + -103.0, 36.0 + ]) + )] + )] + )] + ) +}); +var geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole); + +// 3. create extruded polygon +var extrudedPolygon = new Cesium.PolygonGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + ), + extrudedHeight: 300000 +}); +var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon); + * @param options - Object with the following properties: + * @param options.polygonHierarchy - A polygon hierarchy that can include holes. + * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface. + * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height. + * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open. + * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open. + * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}. + */ +export class PolygonGeometry { + constructor(options: { + polygonHierarchy: PolygonHierarchy + height?: number + extrudedHeight?: number + vertexFormat?: VertexFormat + stRotation?: number + ellipsoid?: Ellipsoid + granularity?: number + perPositionHeight?: boolean + closeTop?: boolean + closeBottom?: boolean + arcType?: ArcType + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. + * @example + * // create a polygon from points + var polygon = Cesium.PolygonGeometry.fromPositions({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + }); + var geometry = Cesium.PolygonGeometry.createGeometry(polygon); + * @param options - Object with the following properties: + * @param options.positions - An array of positions that defined the corner points of the polygon. + * @param [options.height = 0.0] - The height of the polygon. + * @param [options.extrudedHeight] - The height of the polygon extrusion. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height. + * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open. + * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open. + * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}. + */ + static fromPositions(options: { + positions: Cartesian3[] + height?: number + extrudedHeight?: number + vertexFormat?: VertexFormat + stRotation?: number + ellipsoid?: Ellipsoid + granularity?: number + perPositionHeight?: boolean + closeTop?: boolean + closeBottom?: boolean + arcType?: ArcType + }): PolygonGeometry; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + */ + static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void; + /** + * Returns the bounding rectangle given the provided options + * @param options - Object with the following properties: + * @param options.polygonHierarchy - A polygon hierarchy that can include holes. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions sampled. + * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [result] - An object in which to store the result. + * @returns The result rectangle + */ + static computeRectangle(options: { + polygonHierarchy: PolygonHierarchy + granularity?: number + arcType?: ArcType + ellipsoid?: Ellipsoid + }, result?: Rectangle): Rectangle; + /** + * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere. + * @param polygonGeometry - A description of the polygon. + * @returns The computed vertices and indices. + */ + static createGeometry(polygonGeometry: PolygonGeometry): Geometry | undefined; +} + +/** + * An hierarchy of linear rings which define a polygon and its holes. +The holes themselves may also have holes which nest inner polygons. + * @param [positions] - A linear ring defining the outer boundary of the polygon or hole. + * @param [holes] - An array of polygon hierarchies defining holes in the polygon. + */ +export class PolygonHierarchy { + constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]); + /** + * A linear ring defining the outer boundary of the polygon or hole. + */ + positions: Cartesian3[]; + /** + * An array of polygon hierarchies defining holes in the polygon. + */ + holes: PolygonHierarchy[]; +} + +/** + * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. + * @example + * // 1. create a polygon outline from points +var polygon = new Cesium.PolygonOutlineGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + ) +}); +var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon); + +// 2. create a nested polygon with holes outline +var polygonWithHole = new Cesium.PolygonOutlineGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -109.0, 30.0, + -95.0, 30.0, + -95.0, 40.0, + -109.0, 40.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -107.0, 31.0, + -107.0, 39.0, + -97.0, 39.0, + -97.0, 31.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -105.0, 33.0, + -99.0, 33.0, + -99.0, 37.0, + -105.0, 37.0 + ]), + [new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -103.0, 34.0, + -101.0, 34.0, + -101.0, 36.0, + -103.0, 36.0 + ]) + )] + )] + )] + ) +}); +var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole); + +// 3. create extruded polygon outline +var extrudedPolygon = new Cesium.PolygonOutlineGeometry({ + polygonHierarchy : new Cesium.PolygonHierarchy( + Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + ), + extrudedHeight: 300000 +}); +var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon); + * @param options - Object with the following properties: + * @param options.polygonHierarchy - A polygon hierarchy that can include holes. + * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface. + * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height. + * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}. + */ +export class PolygonOutlineGeometry { + constructor(options: { + polygonHierarchy: PolygonHierarchy + height?: number + extrudedHeight?: number + vertexFormat?: VertexFormat + ellipsoid?: Ellipsoid + granularity?: number + perPositionHeight?: boolean + arcType?: ArcType + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: PolygonOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry; + /** + * A description of a polygon outline from an array of positions. + * @example + * // create a polygon from points + var polygon = Cesium.PolygonOutlineGeometry.fromPositions({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0, + -75.0, 30.0, + -70.0, 30.0, + -68.0, 40.0 + ]) + }); + var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon); + * @param options - Object with the following properties: + * @param options.positions - An array of positions that defined the corner points of the polygon. + * @param [options.height = 0.0] - The height of the polygon. + * @param [options.extrudedHeight] - The height of the polygon extrusion. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height. + * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}. + */ + static fromPositions(options: { + positions: Cartesian3[] + height?: number + extrudedHeight?: number + ellipsoid?: Ellipsoid + granularity?: number + perPositionHeight?: boolean + arcType?: ArcType + }): PolygonOutlineGeometry; + /** + * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere. + * @param polygonGeometry - A description of the polygon outline. + * @returns The computed vertices and indices. + */ + static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry | undefined; +} + +/** + * A description of a polyline modeled as a line strip; the first two positions define a line segment, +and each additional position defines a line segment from the previous position. The polyline is capable of +displaying with a material. + * @example + * // A polyline with two connected line segments +var polyline = new Cesium.PolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0, + 5.0, 5.0 + ]), + width : 10.0 +}); +var geometry = Cesium.PolylineGeometry.createGeometry(polyline); + * @param options - Object with the following properties: + * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip. + * @param [options.width = 1.0] - The width in pixels. + * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors. + * @param [options.colorsPerVertex = false] - A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices. + * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + */ +export class PolylineGeometry { + constructor(options: { + positions: Cartesian3[] + width?: number + colors?: Color[] + colorsPerVertex?: boolean + arcType?: ArcType + granularity?: number + vertexFormat?: VertexFormat + ellipsoid?: Ellipsoid + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: PolylineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new PolylineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry; + /** + * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere. + * @param polylineGeometry - A description of the polyline. + * @returns The computed vertices and indices. + */ + static createGeometry(polylineGeometry: PolylineGeometry): Geometry | undefined; +} + +/** + * A description of a polyline with a volume (a 2D shape extruded along a polyline). + * @example + * function computeCircle(radius) { + var positions = []; + for (var i = 0; i < 360; i++) { + var radians = Cesium.Math.toRadians(i); + positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians))); + } + return positions; +} + +var volume = new Cesium.PolylineVolumeGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_ONLY, + polylinePositions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0 + ]), + shapePositions : computeCircle(100000.0) +}); + * @param options - Object with the following properties: + * @param options.polylinePositions - An array of {@link Cartesian3} positions that define the center of the polyline volume. + * @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners. + */ +export class PolylineVolumeGeometry { + constructor(options: { + polylinePositions: Cartesian3[] + shapePositions: Cartesian2[] + ellipsoid?: Ellipsoid + granularity?: number + vertexFormat?: VertexFormat + cornerType?: CornerType + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: PolylineVolumeGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry; + /** + * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere. + * @param polylineVolumeGeometry - A description of the polyline volume. + * @returns The computed vertices and indices. + */ + static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined; +} + +/** + * A description of a polyline with a volume (a 2D shape extruded along a polyline). + * @example + * function computeCircle(radius) { + var positions = []; + for (var i = 0; i < 360; i++) { + var radians = Cesium.Math.toRadians(i); + positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians))); + } + return positions; +} + +var volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({ + polylinePositions : Cesium.Cartesian3.fromDegreesArray([ + -72.0, 40.0, + -70.0, 35.0 + ]), + shapePositions : computeCircle(100000.0) +}); + * @param options - Object with the following properties: + * @param options.polylinePositions - An array of positions that define the center of the polyline volume. + * @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners. + */ +export class PolylineVolumeOutlineGeometry { + constructor(options: { + polylinePositions: Cartesian3[] + shapePositions: Cartesian2[] + ellipsoid?: Ellipsoid + granularity?: number + cornerType?: CornerType + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry; + /** + * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere. + * @param polylineVolumeOutlineGeometry - A description of the polyline volume outline. + * @returns The computed vertices and indices. + */ + static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined; +} + +/** + * The type of a geometric primitive, i.e., points, lines, and triangles. + */ +export enum PrimitiveType { + /** + * Points primitive where each vertex (or index) is a separate point. + */ + POINTS = WebGLConstants.POINTS, + /** + * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected. + */ + LINES = WebGLConstants.LINES, + /** + * Line loop primitive where each vertex (or index) after the first connects a line to + the previous vertex, and the last vertex implicitly connects to the first. + */ + LINE_LOOP = WebGLConstants.LINE_LOOP, + /** + * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex. + */ + LINE_STRIP = WebGLConstants.LINE_STRIP, + /** + * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges. + */ + TRIANGLES = WebGLConstants.TRIANGLES, + /** + * Triangle strip primitive where each vertex (or index) after the first two connect to + the previous two vertices forming a triangle. For example, this can be used to model a wall. + */ + TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP, + /** + * Triangle fan primitive where each vertex (or index) after the first two connect to + the previous vertex and the first vertex forming a triangle. For example, this can be used + to model a cone or circle. + */ + TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN +} + +/** + * Base class for proxying requested made by {@link Resource}. + */ +export class Proxy { + constructor(); + /** + * Get the final URL to use to request a given resource. + * @param resource - The resource to request. + * @returns proxied resource + */ + getURL(resource: string): string; +} + +/** + * Defines functions for 2nd order polynomial functions of one variable with only real coefficients. + */ +export namespace QuadraticRealPolynomial { + /** + * Provides the discriminant of the quadratic equation from the supplied coefficients. + * @param a - The coefficient of the 2nd order monomial. + * @param b - The coefficient of the 1st order monomial. + * @param c - The coefficient of the 0th order monomial. + * @returns The value of the discriminant. + */ + function computeDiscriminant(a: number, b: number, c: number): number; + /** + * Provides the real valued roots of the quadratic polynomial with the provided coefficients. + * @param a - The coefficient of the 2nd order monomial. + * @param b - The coefficient of the 1st order monomial. + * @param c - The coefficient of the 0th order monomial. + * @returns The real valued roots. + */ + function computeRealRoots(a: number, b: number, c: number): number[]; +} + +/** + * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized +mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed +as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner +of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile +and 32767 at the maximum height in the tile. + * @example + * var data = new Cesium.QuantizedMeshTerrainData({ + minimumHeight : -100, + maximumHeight : 2101, + quantizedVertices : new Uint16Array([// order is SW NW SE NE + // longitude + 0, 0, 32767, 32767, + // latitude + 0, 32767, 0, 32767, + // heights + 16384, 0, 32767, 16384]), + indices : new Uint16Array([0, 3, 1, + 0, 2, 3]), + boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000), + orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())), + horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0), + westIndices : [0, 1], + southIndices : [0, 1], + eastIndices : [2, 3], + northIndices : [1, 3], + westSkirtHeight : 1.0, + southSkirtHeight : 1.0, + eastSkirtHeight : 1.0, + northSkirtHeight : 1.0 +}); + * @param options - Object with the following properties: + * @param options.quantizedVertices - The buffer containing the quantized mesh. + * @param options.indices - The indices specifying how the quantized vertices are linked + together into triangles. Each three indices specifies one triangle. + * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid. + * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid. + * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh. + * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh. + * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point + is below the horizon, the entire tile is assumed to be below the horizon as well. + The point is expressed in ellipsoid-scaled coordinates. + * @param options.westIndices - The indices of the vertices on the western edge of the tile. + * @param options.southIndices - The indices of the vertices on the southern edge of the tile. + * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile. + * @param options.northIndices - The indices of the vertices on the northern edge of the tile. + * @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile. + * @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile. + * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile. + * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile. + * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist. + If a child's bit is set, geometry will be requested for that tile as well when it + is needed. If the bit is cleared, the child tile is not requested and geometry is + instead upsampled from the parent. The bit values are as follows: + <table> + <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr> + <tr><td>0</td><td>1</td><td>Southwest</td></tr> + <tr><td>1</td><td>2</td><td>Southeast</td></tr> + <tr><td>2</td><td>4</td><td>Northwest</td></tr> + <tr><td>3</td><td>8</td><td>Northeast</td></tr> + </table> + * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance; + otherwise, false. + * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding + * @param [options.waterMask] - The buffer containing the watermask. + * @param [options.credits] - Array of credits for this tile. + */ +export class QuantizedMeshTerrainData { + constructor(options: { + quantizedVertices: Uint16Array + indices: Uint16Array | Uint32Array + minimumHeight: number + maximumHeight: number + boundingSphere: BoundingSphere + orientedBoundingBox?: OrientedBoundingBox + horizonOcclusionPoint: Cartesian3 + westIndices: number[] + southIndices: number[] + eastIndices: number[] + northIndices: number[] + westSkirtHeight: number + southSkirtHeight: number + eastSkirtHeight: number + northSkirtHeight: number + childTileMask?: number + createdByUpsampling?: boolean + encodedNormals?: Uint8Array + waterMask?: Uint8Array + credits?: Credit[] + }); + /** + * An array of credits for this tile. + */ + credits: Credit[]; + /** + * The water mask included in this terrain data, if any. A water mask is a rectangular + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + */ + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + /** + * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the + vertices in this instance, interpolated if necessary. + * @param tilingScheme - The tiling scheme of this terrain data. + * @param thisX - The X coordinate of this tile in the tiling scheme. + * @param thisY - The Y coordinate of this tile in the tiling scheme. + * @param thisLevel - The level of this tile in the tiling scheme. + * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. + * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. + * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. + * @returns A promise for upsampled heightmap terrain data for the descendant tile, + or undefined if too many asynchronous upsample operations are in progress and the request has been + deferred. + */ + upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<QuantizedMeshTerrainData> | undefined; + /** + * Computes the terrain height at a specified longitude and latitude. + * @param rectangle - The rectangle covered by this terrain data. + * @param longitude - The longitude in radians. + * @param latitude - The latitude in radians. + * @returns The terrain height at the specified position. The position is clamped to + the rectangle, so expect incorrect results for positions far outside the rectangle. + */ + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + /** + * Determines if a given child tile is available, based on the + {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed + to be one of the four children of this tile. If non-child tile coordinates are + given, the availability of the southeast child tile is returned. + * @param thisX - The tile X coordinate of this (the parent) tile. + * @param thisY - The tile Y coordinate of this (the parent) tile. + * @param childX - The tile X coordinate of the child tile to check for availability. + * @param childY - The tile Y coordinate of the child tile to check for availability. + * @returns True if the child tile is available; otherwise, false. + */ + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + /** + * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution + terrain data. If this value is false, the data was obtained from some other source, such + as by downloading it from a remote server. This method should return true for instances + returned from a call to {@link HeightmapTerrainData#upsample}. + * @returns True if this instance was created by upsampling; otherwise, false. + */ + wasCreatedByUpsampling(): boolean; +} + +/** + * Defines functions for 4th order polynomial functions of one variable with only real coefficients. + */ +export namespace QuarticRealPolynomial { + /** + * Provides the discriminant of the quartic equation from the supplied coefficients. + * @param a - The coefficient of the 4th order monomial. + * @param b - The coefficient of the 3rd order monomial. + * @param c - The coefficient of the 2nd order monomial. + * @param d - The coefficient of the 1st order monomial. + * @param e - The coefficient of the 0th order monomial. + * @returns The value of the discriminant. + */ + function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number; + /** + * Provides the real valued roots of the quartic polynomial with the provided coefficients. + * @param a - The coefficient of the 4th order monomial. + * @param b - The coefficient of the 3rd order monomial. + * @param c - The coefficient of the 2nd order monomial. + * @param d - The coefficient of the 1st order monomial. + * @param e - The coefficient of the 0th order monomial. + * @returns The real valued roots. + */ + function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[]; +} + +/** + * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space. + * @param [x = 0.0] - The X component. + * @param [y = 0.0] - The Y component. + * @param [z = 0.0] - The Z component. + * @param [w = 0.0] - The W component. + */ +export class Quaternion { + constructor(x?: number, y?: number, z?: number, w?: number); + /** + * The X component. + */ + x: number; + /** + * The Y component. + */ + y: number; + /** + * The Z component. + */ + z: number; + /** + * The W component. + */ + w: number; + /** + * Computes a quaternion representing a rotation around an axis. + * @param axis - The axis of rotation. + * @param angle - The angle in radians to rotate around the axis. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Quaternion instance if one was not provided. + */ + static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion; + /** + * Computes a Quaternion from the provided Matrix3 instance. + * @param matrix - The rotation matrix. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Quaternion instance if one was not provided. + */ + static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion; + /** + * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the + negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about + the positive x axis. + * @param headingPitchRoll - The rotation expressed as a heading, pitch and roll. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Quaternion instance if none was provided. + */ + static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Quaternion, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Quaternion instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion; + /** + * The number of elements used to store the object into an array in its interpolatable form. + */ + static packedInterpolationLength: number; + /** + * Converts a packed array into a form suitable for interpolation. + * @param packedArray - The packed array. + * @param [startingIndex = 0] - The index of the first element to be converted. + * @param [lastIndex = packedArray.length] - The index of the last element to be converted. + * @param [result] - The object into which to store the result. + */ + static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void; + /** + * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}. + * @param array - The array previously packed for interpolation. + * @param sourceArray - The original packed array. + * @param [firstIndex = 0] - The firstIndex used to convert the array. + * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Quaternion instance if one was not provided. + */ + static unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion; + /** + * Duplicates a Quaternion instance. + * @param quaternion - The quaternion to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined) + */ + static clone(quaternion: Quaternion, result?: Quaternion): Quaternion; + /** + * Computes the conjugate of the provided quaternion. + * @param quaternion - The quaternion to conjugate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion; + /** + * Computes magnitude squared for the provided quaternion. + * @param quaternion - The quaternion to conjugate. + * @returns The magnitude squared. + */ + static magnitudeSquared(quaternion: Quaternion): number; + /** + * Computes magnitude for the provided quaternion. + * @param quaternion - The quaternion to conjugate. + * @returns The magnitude. + */ + static magnitude(quaternion: Quaternion): number; + /** + * Computes the normalized form of the provided quaternion. + * @param quaternion - The quaternion to normalize. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static normalize(quaternion: Quaternion, result: Quaternion): Quaternion; + /** + * Computes the inverse of the provided quaternion. + * @param quaternion - The quaternion to normalize. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static inverse(quaternion: Quaternion, result: Quaternion): Quaternion; + /** + * Computes the componentwise sum of two quaternions. + * @param left - The first quaternion. + * @param right - The second quaternion. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + /** + * Computes the componentwise difference of two quaternions. + * @param left - The first quaternion. + * @param right - The second quaternion. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + /** + * Negates the provided quaternion. + * @param quaternion - The quaternion to be negated. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static negate(quaternion: Quaternion, result: Quaternion): Quaternion; + /** + * Computes the dot (scalar) product of two quaternions. + * @param left - The first quaternion. + * @param right - The second quaternion. + * @returns The dot product. + */ + static dot(left: Quaternion, right: Quaternion): number; + /** + * Computes the product of two quaternions. + * @param left - The first quaternion. + * @param right - The second quaternion. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + /** + * Multiplies the provided quaternion componentwise by the provided scalar. + * @param quaternion - The quaternion to be scaled. + * @param scalar - The scalar to multiply with. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion; + /** + * Divides the provided quaternion componentwise by the provided scalar. + * @param quaternion - The quaternion to be divided. + * @param scalar - The scalar to divide by. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion; + /** + * Computes the axis of rotation of the provided quaternion. + * @param quaternion - The quaternion to use. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3; + /** + * Computes the angle of rotation of the provided quaternion. + * @param quaternion - The quaternion to use. + * @returns The angle of rotation. + */ + static computeAngle(quaternion: Quaternion): number; + /** + * Computes the linear interpolation or extrapolation at t using the provided quaternions. + * @param start - The value corresponding to t at 0.0. + * @param end - The value corresponding to t at 1.0. + * @param t - The point along t at which to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + /** + * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions. + * @param start - The value corresponding to t at 0.0. + * @param end - The value corresponding to t at 1.0. + * @param t - The point along t at which to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + /** + * The logarithmic quaternion function. + * @param quaternion - The unit quaternion. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static log(quaternion: Quaternion, result: Cartesian3): Cartesian3; + /** + * The exponential quaternion function. + * @param cartesian - The cartesian. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static exp(cartesian: Cartesian3, result: Quaternion): Quaternion; + /** + * Computes an inner quadrangle point. + <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p> + * @param q0 - The first quaternion. + * @param q1 - The second quaternion. + * @param q2 - The third quaternion. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion; + /** + * Computes the spherical quadrangle interpolation between quaternions. + * @example + * // 1. compute the squad interpolation between two quaternions on a curve + var s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion()); + var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion()); + var q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion()); + + // 2. compute the squad interpolation as above but where the first quaternion is a end point. + var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion()); + var q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion()); + * @param q0 - The first quaternion. + * @param q1 - The second quaternion. + * @param s0 - The first inner quadrangle. + * @param s1 - The second inner quadrangle. + * @param t - The time in [0,1] used to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion; + /** + * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions. + This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>. + * @param start - The value corresponding to t at 0.0. + * @param end - The value corresponding to t at 1.0. + * @param t - The point along t at which to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter. + */ + static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + /** + * Computes the spherical quadrangle interpolation between quaternions. + An implementation that is faster than {@link Quaternion#squad}, but less accurate. + * @param q0 - The first quaternion. + * @param q1 - The second quaternion. + * @param s0 - The first inner quadrangle. + * @param s1 - The second inner quadrangle. + * @param t - The time in [0,1] used to interpolate. + * @param result - The object onto which to store the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion; + /** + * Compares the provided quaternions componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first quaternion. + * @param [right] - The second quaternion. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + static equals(left?: Quaternion, right?: Quaternion): boolean; + /** + * Compares the provided quaternions componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [left] - The first quaternion. + * @param [right] - The second quaternion. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Quaternion, right?: Quaternion, epsilon?: number): boolean; + /** + * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0). + */ + static readonly ZERO: Quaternion; + /** + * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0). + */ + static readonly IDENTITY: Quaternion; + /** + * Duplicates this Quaternion instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Quaternion instance if one was not provided. + */ + clone(result?: Quaternion): Quaternion; + /** + * Compares this and the provided quaternion componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side quaternion. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(right?: Quaternion): boolean; + /** + * Compares this and the provided quaternion componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [right] - The right hand side quaternion. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: Quaternion, epsilon?: number): boolean; + /** + * Returns a string representing this quaternion in the format (x, y, z, w). + * @returns A string representing this Quaternion. + */ + toString(): string; +} + +/** + * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve. +The generated curve is in the class C<sup>1</sup>. + * @param options - Object with the following properties: + * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. + The values are in no way connected to the clock time. They are the parameterization for the curve. + * @param options.points - The array of {@link Quaternion} control points. + */ +export class QuaternionSpline { + constructor(options: { + times: number[] + points: Quaternion[] + }); + /** + * An array of times for the control points. + */ + readonly times: number[]; + /** + * An array of {@link Quaternion} control points. + */ + readonly points: Quaternion[]; + /** + * Finds an index <code>i</code> in <code>times</code> such that the parameter + <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>. + * @param time - The time. + * @returns The index for the element at the start of the interval. + */ + findTimeInterval(time: number): number; + /** + * Wraps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, wrapped around to the updated animation. + */ + wrapTime(time: number): number; + /** + * Clamps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, clamped to the animation period. + */ + clampTime(time: number): number; + /** + * Evaluates the curve at a given time. + * @param time - The time at which to evaluate the curve. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance of the point on the curve at the given time. + */ + evaluate(time: number, result?: Quaternion): Quaternion; +} + +/** + * Parses a query string into an object, where the keys and values of the object are the +name/value pairs from the query string, decoded. If a name appears multiple times, +the value in the object will be an array of values. + * @example + * var obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y'); +// obj will be: +// { +// key1 : 'some value', +// key2 : 'a/b', +// key3 : ['x', 'y'] +// } + * @param queryString - The query string. + * @returns An object containing the parameters parsed from the query string. + */ +export function queryToObject(queryString: string): any; + +/** + * A queue that can enqueue items at the end, and dequeue items from the front. + */ +export class Queue { + constructor(); + /** + * The length of the queue. + */ + readonly length: number; + /** + * Enqueues the specified item. + * @param item - The item to enqueue. + */ + enqueue(item: any): void; + /** + * Dequeues an item. Returns undefined if the queue is empty. + * @returns The the dequeued item. + */ + dequeue(): any; + /** + * Returns the item at the front of the queue. Returns undefined if the queue is empty. + * @returns The item at the front of the queue. + */ + peek(): any; + /** + * Check whether this queue contains the specified item. + * @param item - The item to search for. + */ + contains(item: any): void; + /** + * Remove all items from the queue. + */ + clear(): void; + /** + * Sort the items in the queue in-place. + * @param compareFunction - A function that defines the sort order. + */ + sort(compareFunction: Queue.Comparator): void; +} + +export namespace Queue { + /** + * A function used to compare two items while sorting a queue. + * @example + * function compareNumbers(a, b) { + return a - b; + } + * @param a - An item in the array. + * @param b - An item in the array. + */ + type Comparator = (a: any, b: any) => number; +} + +/** + * Represents a ray that extends infinitely from the provided origin in the provided direction. + * @param [origin = Cartesian3.ZERO] - The origin of the ray. + * @param [direction = Cartesian3.ZERO] - The direction of the ray. + */ +export class Ray { + constructor(origin?: Cartesian3, direction?: Cartesian3); + /** + * The origin of the ray. + */ + origin: Cartesian3; + /** + * The direction of the ray. + */ + direction: Cartesian3; + /** + * Duplicates a Ray instance. + * @param ray - The ray to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined) + */ + static clone(ray: Ray, result?: Ray): Ray; + /** + * Computes the point along the ray given by r(t) = o + t*d, + where o is the origin of the ray and d is the direction. + * @example + * //Get the first intersection point of a ray and an ellipsoid. + var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid); + var point = Cesium.Ray.getPoint(ray, intersection.start); + * @param ray - The ray. + * @param t - A scalar value. + * @param [result] - The object in which the result will be stored. + * @returns The modified result parameter, or a new instance if none was provided. + */ + static getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3; +} + +/** + * A two dimensional region specified as longitude and latitude coordinates. + * @param [west = 0.0] - The westernmost longitude, in radians, in the range [-Pi, Pi]. + * @param [south = 0.0] - The southernmost latitude, in radians, in the range [-Pi/2, Pi/2]. + * @param [east = 0.0] - The easternmost longitude, in radians, in the range [-Pi, Pi]. + * @param [north = 0.0] - The northernmost latitude, in radians, in the range [-Pi/2, Pi/2]. + */ +export class Rectangle { + constructor(west?: number, south?: number, east?: number, north?: number); + /** + * The westernmost longitude in radians in the range [-Pi, Pi]. + */ + west: number; + /** + * The southernmost latitude in radians in the range [-Pi/2, Pi/2]. + */ + south: number; + /** + * The easternmost longitude in radians in the range [-Pi, Pi]. + */ + east: number; + /** + * The northernmost latitude in radians in the range [-Pi/2, Pi/2]. + */ + north: number; + /** + * Gets the width of the rectangle in radians. + */ + readonly width: number; + /** + * Gets the height of the rectangle in radians. + */ + readonly height: number; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: Rectangle, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Rectangle instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle; + /** + * Computes the width of a rectangle in radians. + * @param rectangle - The rectangle to compute the width of. + * @returns The width. + */ + static computeWidth(rectangle: Rectangle): number; + /** + * Computes the height of a rectangle in radians. + * @param rectangle - The rectangle to compute the height of. + * @returns The height. + */ + static computeHeight(rectangle: Rectangle): number; + /** + * Creates a rectangle given the boundary longitude and latitude in degrees. + * @example + * var rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0); + * @param [west = 0.0] - The westernmost longitude in degrees in the range [-180.0, 180.0]. + * @param [south = 0.0] - The southernmost latitude in degrees in the range [-90.0, 90.0]. + * @param [east = 0.0] - The easternmost longitude in degrees in the range [-180.0, 180.0]. + * @param [north = 0.0] - The northernmost latitude in degrees in the range [-90.0, 90.0]. + * @param [result] - The object onto which to store the result, or undefined if a new instance should be created. + * @returns The modified result parameter or a new Rectangle instance if none was provided. + */ + static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle; + /** + * Creates a rectangle given the boundary longitude and latitude in radians. + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + * @param [west = 0.0] - The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param [south = 0.0] - The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param [east = 0.0] - The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param [north = 0.0] - The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param [result] - The object onto which to store the result, or undefined if a new instance should be created. + * @returns The modified result parameter or a new Rectangle instance if none was provided. + */ + static fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle; + /** + * Creates the smallest possible Rectangle that encloses all positions in the provided array. + * @param cartographics - The list of Cartographic instances. + * @param [result] - The object onto which to store the result, or undefined if a new instance should be created. + * @returns The modified result parameter or a new Rectangle instance if none was provided. + */ + static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle; + /** + * Creates the smallest possible Rectangle that encloses all positions in the provided array. + * @param cartesians - The list of Cartesian instances. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid the cartesians are on. + * @param [result] - The object onto which to store the result, or undefined if a new instance should be created. + * @returns The modified result parameter or a new Rectangle instance if none was provided. + */ + static fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle; + /** + * Duplicates a Rectangle. + * @param rectangle - The rectangle to clone. + * @param [result] - The object onto which to store the result, or undefined if a new instance should be created. + * @returns The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined) + */ + static clone(rectangle: Rectangle, result?: Rectangle): Rectangle; + /** + * Compares the provided Rectangles componentwise and returns + <code>true</code> if they pass an absolute or relative tolerance test, + <code>false</code> otherwise. + * @param [left] - The first Rectangle. + * @param [right] - The second Rectangle. + * @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing. + * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. + */ + static equalsEpsilon(left?: Rectangle, right?: Rectangle, absoluteEpsilon?: number): boolean; + /** + * Duplicates this Rectangle. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Rectangle instance if none was provided. + */ + clone(result?: Rectangle): Rectangle; + /** + * Compares the provided Rectangle with this Rectangle componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The Rectangle to compare. + * @returns <code>true</code> if the Rectangles are equal, <code>false</code> otherwise. + */ + equals(other?: Rectangle): boolean; + /** + * Compares the provided rectangles and returns <code>true</code> if they are equal, + <code>false</code> otherwise. + * @param [left] - The first Rectangle. + * @param [right] - The second Rectangle. + * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>. + */ + static equals(left?: Rectangle, right?: Rectangle): boolean; + /** + * Compares the provided Rectangle with this Rectangle componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [other] - The Rectangle to compare. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @returns <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(other?: Rectangle, epsilon?: number): boolean; + /** + * Checks a Rectangle's properties and throws if they are not in valid ranges. + * @param rectangle - The rectangle to validate + */ + static validate(rectangle: Rectangle): void; + /** + * Computes the southwest corner of a rectangle. + * @param rectangle - The rectangle for which to find the corner + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if none was provided. + */ + static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic; + /** + * Computes the northwest corner of a rectangle. + * @param rectangle - The rectangle for which to find the corner + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if none was provided. + */ + static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic; + /** + * Computes the northeast corner of a rectangle. + * @param rectangle - The rectangle for which to find the corner + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if none was provided. + */ + static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic; + /** + * Computes the southeast corner of a rectangle. + * @param rectangle - The rectangle for which to find the corner + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if none was provided. + */ + static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic; + /** + * Computes the center of a rectangle. + * @param rectangle - The rectangle for which to find the center + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartographic instance if none was provided. + */ + static center(rectangle: Rectangle, result?: Cartographic): Cartographic; + /** + * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are + latitude and longitude in radians and produces a correct intersection, taking into account the fact that + the same angle can be represented with multiple values as well as the wrapping of longitude at the + anti-meridian. For a simple intersection that ignores these factors and can be used with projected + coordinates, see {@link Rectangle.simpleIntersection}. + * @param rectangle - On rectangle to find an intersection + * @param otherRectangle - Another rectangle to find an intersection + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. + */ + static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined; + /** + * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function + does not attempt to put the angular coordinates into a consistent range or to account for crossing the + anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude + and longitude (i.e. projected coordinates). + * @param rectangle - On rectangle to find an intersection + * @param otherRectangle - Another rectangle to find an intersection + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. + */ + static simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined; + /** + * Computes a rectangle that is the union of two rectangles. + * @param rectangle - A rectangle to enclose in rectangle. + * @param otherRectangle - A rectangle to enclose in a rectangle. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Rectangle instance if none was provided. + */ + static union(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle; + /** + * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic. + * @param rectangle - A rectangle to expand. + * @param cartographic - A cartographic to enclose in a rectangle. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Rectangle instance if one was not provided. + */ + static expand(rectangle: Rectangle, cartographic: Cartographic, result?: Rectangle): Rectangle; + /** + * Returns true if the cartographic is on or inside the rectangle, false otherwise. + * @param rectangle - The rectangle + * @param cartographic - The cartographic to test. + * @returns true if the provided cartographic is inside the rectangle, false otherwise. + */ + static contains(rectangle: Rectangle, cartographic: Cartographic): boolean; + /** + * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to + {@link BoundingSphere#fromPoints}. Sampling is necessary to account + for rectangles that cover the poles or cross the equator. + * @param rectangle - The rectangle to subsample. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use. + * @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid. + * @param [result] - The array of Cartesians onto which to store the result. + * @returns The modified result parameter or a new Array of Cartesians instances if none was provided. + */ + static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[]; + /** + * The largest possible rectangle. + */ + static readonly MAX_VALUE: Rectangle; +} + +/** + * A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}. + * @example + * // 1. create a rectangle +var rectangle = new Cesium.RectangleGeometry({ + ellipsoid : Cesium.Ellipsoid.WGS84, + rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), + height : 10000.0 +}); +var geometry = Cesium.RectangleGeometry.createGeometry(rectangle); + +// 2. create an extruded rectangle without a top +var rectangle = new Cesium.RectangleGeometry({ + ellipsoid : Cesium.Ellipsoid.WGS84, + rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), + height : 10000.0, + extrudedHeight: 300000 +}); +var geometry = Cesium.RectangleGeometry.createGeometry(rectangle); + * @param options - Object with the following properties: + * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface. + * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise. + * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. + * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface. + */ +export class RectangleGeometry { + constructor(options: { + rectangle: Rectangle + vertexFormat?: VertexFormat + ellipsoid?: Ellipsoid + granularity?: number + height?: number + rotation?: number + stRotation?: number + extrudedHeight?: number + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: RectangleGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new RectangleGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry; + /** + * Computes the bounding rectangle based on the provided options + * @param options - Object with the following properties: + * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise. + * @param [result] - An object in which to store the result. + * @returns The result rectangle + */ + static computeRectangle(options: { + rectangle: Rectangle + ellipsoid?: Ellipsoid + granularity?: number + rotation?: number + }, result?: Rectangle): Rectangle; + /** + * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere. + * @param rectangleGeometry - A description of the rectangle. + * @returns The computed vertices and indices. + */ + static createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined; +} + +/** + * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin. + * @example + * var rectangle = new Cesium.RectangleOutlineGeometry({ + ellipsoid : Cesium.Ellipsoid.WGS84, + rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0), + height : 10000.0 +}); +var geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle); + * @param options - Object with the following properties: + * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface. + * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise. + * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface. + */ +export class RectangleOutlineGeometry { + constructor(options: { + rectangle: Rectangle + ellipsoid?: Ellipsoid + granularity?: number + height?: number + rotation?: number + extrudedHeight?: number + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: RectangleOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Quaternion instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: RectangleOutlineGeometry): RectangleOutlineGeometry; + /** + * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere. + * @param rectangleGeometry - A description of the rectangle outline. + * @returns The computed vertices and indices. + */ + static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry | undefined; +} + +/** + * Constants for identifying well-known reference frames. + */ +export enum ReferenceFrame { + /** + * The fixed frame. + */ + FIXED = 0, + /** + * The inertial frame. + */ + INERTIAL = 1 +} + +/** + * Stores information for making a request. In general this does not need to be constructed directly. + * @param [options] - An object with the following properties: + * @param [options.url] - The url to request. + * @param [options.requestFunction] - The function that makes the actual data request. + * @param [options.cancelFunction] - The function that is called when the request is cancelled. + * @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame. + * @param [options.priority = 0.0] - The initial priority of the request. + * @param [options.throttle = false] - Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority. + * @param [options.throttleByServer = false] - Whether to throttle the request by server. + * @param [options.type = RequestType.OTHER] - The type of request. + */ +export class Request { + constructor(options?: { + url?: string + requestFunction?: Request.RequestCallback + cancelFunction?: Request.CancelCallback + priorityFunction?: Request.PriorityCallback + priority?: number + throttle?: boolean + throttleByServer?: boolean + type?: RequestType + }); + /** + * The URL to request. + */ + url: string; + /** + * The function that makes the actual data request. + */ + requestFunction: Request.RequestCallback; + /** + * The function that is called when the request is cancelled. + */ + cancelFunction: Request.CancelCallback; + /** + * The function that is called to update the request's priority, which occurs once per frame. + */ + priorityFunction: Request.PriorityCallback; + /** + * Priority is a unit-less value where lower values represent higher priority. + For world-based objects, this is usually the distance from the camera. + A request that does not have a priority function defaults to a priority of 0. + + If priorityFunction is defined, this value is updated every frame with the result of that call. + */ + priority: number; + /** + * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the + request will be throttled and sent based on priority. + */ + readonly throttle: boolean; + /** + * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections + for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value + to <code>true</code> is preferable for requests going through HTTP/1 servers. + */ + readonly throttleByServer: boolean; + /** + * Type of request. + */ + readonly type: RequestType; + /** + * The current state of the request. + */ + readonly state: RequestState; + /** + * Duplicates a Request instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Resource instance if one was not provided. + */ + clone(result?: Request): Request; +} + +export namespace Request { + /** + * The function that makes the actual data request. + */ + type RequestCallback = () => Promise<void>; + /** + * The function that is called when the request is cancelled. + */ + type CancelCallback = () => void; + /** + * The function that is called to update the request's priority, which occurs once per frame. + */ + type PriorityCallback = () => number; +} + +/** + * A browser-independent function to request a new animation frame. This is used to create +an application's draw loop as shown in the example below. + * @example + * // Create a draw loop using requestAnimationFrame. The +// tick callback function is called for every animation frame. +function tick() { + scene.render(); + Cesium.requestAnimationFrame(tick); +} +tick(); + * @param callback - The function to call when the next frame should be drawn. + * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request. + */ +export function requestAnimationFrame(callback: requestAnimationFrameCallback): number; + +/** + * A function that will be called when the next frame should be drawn. + * @param timestamp - A timestamp for the frame, in milliseconds. + */ +export type requestAnimationFrameCallback = (timestamp: number) => void; + +/** + * An event that is raised when a request encounters an error. + * @param [statusCode] - The HTTP error status code, such as 404. + * @param [response] - The response included along with the error. + * @param [responseHeaders] - The response headers, represented either as an object literal or as a + string in the format returned by XMLHttpRequest's getAllResponseHeaders() function. + */ +export class RequestErrorEvent { + constructor(statusCode?: number, response?: any, responseHeaders?: string | any); + /** + * The HTTP error status code, such as 404. If the error does not have a particular + HTTP code, this property will be undefined. + */ + statusCode: number; + /** + * The response included along with the error. If the error does not include a response, + this property will be undefined. + */ + response: any; + /** + * The headers included in the response, represented as an object literal of key/value pairs. + If the error does not include any headers, this property will be undefined. + */ + responseHeaders: any; + /** + * Creates a string representing this RequestErrorEvent. + * @returns A string representing the provided RequestErrorEvent. + */ + toString(): string; +} + +/** + * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability +to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position, +a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the +number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired. + */ +export namespace RequestScheduler { + /** + * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit. + */ + var maximumRequests: number + /** + * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically + listed in {@link requestsByServer} do not observe this limit. + */ + var maximumRequestsPerServer: number + /** + * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code> + * @example + * RequestScheduler.requestsByServer = { + 'api.cesium.com:443': 18, + 'assets.cesium.com:443': 18 + }; + */ + var requestsByServer: any + /** + * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control. + */ + var throttleRequests: boolean +} + +/** + * State of the request. + */ +export enum RequestState { + /** + * Initial unissued state. + */ + UNISSUED = 0, + /** + * Issued but not yet active. Will become active when open slots are available. + */ + ISSUED = 1, + /** + * Actual http request has been sent. + */ + ACTIVE = 2, + /** + * Request completed successfully. + */ + RECEIVED = 3, + /** + * Request was cancelled, either explicitly or automatically because of low priority. + */ + CANCELLED = 4, + /** + * Request failed. + */ + FAILED = 5 +} + +/** + * An enum identifying the type of request. Used for finer grained logging and priority sorting. + */ +export enum RequestType { + /** + * Terrain request. + */ + TERRAIN = 0, + /** + * Imagery request. + */ + IMAGERY = 1, + /** + * 3D Tiles request. + */ + TILES3D = 2, + /** + * Other request. + */ + OTHER = 3 +} + +/** + * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests. + * @example + * function refreshTokenRetryCallback(resource, error) { + if (error.statusCode === 403) { + // 403 status code means a new token should be generated + return getNewAccessToken() + .then(function(token) { + resource.queryParameters.access_token = token; + return true; + }) + .otherwise(function() { + return false; + }); + } + + return false; +} + +var resource = new Resource({ + url: 'http://server.com/path/to/resource.json', + proxy: new DefaultProxy('/proxy/'), + headers: { + 'X-My-Header': 'valueOfHeader' + }, + queryParameters: { + 'access_token': '123-435-456-000' + }, + retryCallback: refreshTokenRetryCallback, + retryAttempts: 1 +}); + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + */ +export class Resource { + constructor(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + }); + /** + * Additional HTTP headers that will be sent with the request. + */ + headers: any; + /** + * A Request object that will be used. Intended for internal use only. + */ + request: Request; + /** + * A proxy to be used when loading the resource. + */ + proxy: Proxy; + /** + * Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried. + */ + retryCallback: (...params: any[]) => any; + /** + * The number of times the retryCallback should be called before giving up. + */ + retryAttempts: number; + /** + * Returns true if blobs are supported. + */ + static readonly isBlobSupported: boolean; + /** + * Query parameters appended to the url. + */ + readonly queryParameters: any; + /** + * The key/value pairs used to replace template parameters in the url. + */ + readonly templateValues: any; + /** + * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set. + */ + url: string; + /** + * The file extension of the resource. + */ + readonly extension: string; + /** + * True if the Resource refers to a data URI. + */ + isDataUri: boolean; + /** + * True if the Resource refers to a blob URI. + */ + isBlobUri: boolean; + /** + * True if the Resource refers to a cross origin URL. + */ + isCrossOriginUrl: boolean; + /** + * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys. + */ + hasHeaders: boolean; + /** + * Override Object#toString so that implicit string conversion gives the + complete URL represented by this Resource. + * @returns The URL represented by this Resource + */ + toString(): string; + /** + * Returns the url, optional with the query string and processed by a proxy. + * @param [query = false] - If true, the query string is included. + * @param [proxy = false] - If true, the url is processed by the proxy object, if defined. + * @returns The url with all the requested components. + */ + getUrlComponent(query?: boolean, proxy?: boolean): string; + /** + * Combines the specified object and the existing query parameters. This allows you to add many parameters at once, + as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value. + * @param params - The query parameters + * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined. + */ + setQueryParameters(params: any, useAsDefault?: boolean): void; + /** + * Combines the specified object and the existing query parameters. This allows you to add many parameters at once, + as opposed to adding them one at a time to the queryParameters property. + * @param params - The query parameters + */ + appendQueryParameters(params: any): void; + /** + * Combines the specified object and the existing template values. This allows you to add many values at once, + as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended. + * @param template - The template values + * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined. + */ + setTemplateValues(template: any, useAsDefault?: boolean): void; + /** + * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options. + * @param options - An object with the following properties + * @param [options.url] - The url that will be resolved relative to the url of the current instance. + * @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance. + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The function to call when loading the resource fails. + * @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.preserveQueryParameters = false] - If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource. + * @returns The resource derived from the current one. + */ + getDerivedResource(options: { + url?: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + preserveQueryParameters?: boolean + }): Resource; + /** + * Duplicates a Resource instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Resource instance if one was not provided. + */ + clone(result?: Resource): Resource; + /** + * Returns the base path of the Resource. + * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri + * @returns The base URI of the resource + */ + getBaseUri(includeQuery?: boolean): string; + /** + * Appends a forward slash to the URL. + */ + appendForwardSlash(): void; + /** + * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to + an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * // load a single URL asynchronously + resource.fetchArrayBuffer().then(function(arrayBuffer) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetchArrayBuffer(): Promise<ArrayBuffer> | undefined; + /** + * Creates a Resource and calls fetchArrayBuffer() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static fetchArrayBuffer(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + }): Promise<ArrayBuffer> | undefined; + /** + * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to + a Blob once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * // load a single URL asynchronously + resource.fetchBlob().then(function(blob) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetchBlob(): Promise<Blob> | undefined; + /** + * Creates a Resource and calls fetchBlob() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static fetchBlob(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + }): Promise<Blob> | undefined; + /** + * Asynchronously loads the given image resource. Returns a promise that will resolve to + an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if <code>preferImageBitmap</code> is true and the browser supports <code>createImageBitmap</code> or otherwise an + {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load. + * @example + * // load a single image asynchronously + resource.fetchImage().then(function(image) { + // use the loaded image + }).otherwise(function(error) { + // an error occurred + }); + + // load several images in parallel + when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) { + // images is an array containing all the loaded images + }); + * @param [options] - An object with the following properties. + * @param [options.preferBlob = false] - If true, we will load the image via a blob. + * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned. + * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetchImage(options?: { + preferBlob?: boolean + preferImageBitmap?: boolean + flipY?: boolean + }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined; + /** + * Creates a Resource and calls fetchImage() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.flipY = false] - Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports <code>createImageBitmap</code>. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.preferBlob = false] - If true, we will load the image via a blob. + * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static fetchImage(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + flipY?: boolean + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + preferBlob?: boolean + preferImageBitmap?: boolean + }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined; + /** + * Asynchronously loads the given resource as text. Returns a promise that will resolve to + a String once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * // load text from a URL, setting a custom header + var resource = new Resource({ + url: 'http://someUrl.com/someJson.txt', + headers: { + 'X-Custom-Header' : 'some value' + } + }); + resource.fetchText().then(function(text) { + // Do something with the text + }).otherwise(function(error) { + // an error occurred + }); + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetchText(): Promise<string> | undefined; + /** + * Creates a Resource and calls fetchText() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static fetchText(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + }): Promise<string> | undefined; + /** + * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to + a JSON object once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function + adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not + already specified. + * @example + * resource.fetchJson().then(function(jsonData) { + // Do something with the JSON object + }).otherwise(function(error) { + // an error occurred + }); + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetchJson(): Promise<any> | undefined; + /** + * Creates a Resource and calls fetchJson() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static fetchJson(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + }): Promise<any> | undefined; + /** + * Asynchronously loads the given resource as XML. Returns a promise that will resolve to + an XML Document once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * // load XML from a URL, setting a custom header + Cesium.loadXML('http://someUrl.com/someXML.xml', { + 'X-Custom-Header' : 'some value' + }).then(function(document) { + // Do something with the document + }).otherwise(function(error) { + // an error occurred + }); + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetchXML(): Promise<XMLDocument> | undefined; + /** + * Creates a Resource and calls fetchXML() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static fetchXML(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + }): Promise<XMLDocument> | undefined; + /** + * Requests a resource using JSONP. + * @example + * // load a data asynchronously + resource.fetchJsonp().then(function(data) { + // use the loaded data + }).otherwise(function(error) { + // an error occurred + }); + * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetchJsonp(callbackParameterName?: string): Promise<any> | undefined; + /** + * Creates a Resource from a URL and calls fetchJsonp() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static fetchJsonp(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + callbackParameterName?: string + }): Promise<any> | undefined; + /** + * Asynchronously loads the given resource. Returns a promise that will resolve to + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use + the more specific functions eg. fetchJson, fetchBlob, etc. + * @example + * resource.fetch() + .then(function(body) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); + * @param [options] - Object with the following properties: + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.headers] - Additional HTTP headers to send with the request, if any. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + fetch(options?: { + responseType?: string + headers?: any + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Creates a Resource from a URL and calls fetch() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static fetch(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + responseType?: string + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Asynchronously deletes the given resource. Returns a promise that will resolve to + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * resource.delete() + .then(function(body) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); + * @param [options] - Object with the following properties: + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.headers] - Additional HTTP headers to send with the request, if any. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + delete(options?: { + responseType?: string + headers?: any + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Creates a Resource from a URL and calls delete() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.data] - Data that is posted with the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static delete(options: { + url: string + data?: any + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + responseType?: string + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Asynchronously gets headers the given resource. Returns a promise that will resolve to + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * resource.head() + .then(function(headers) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); + * @param [options] - Object with the following properties: + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.headers] - Additional HTTP headers to send with the request, if any. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + head(options?: { + responseType?: string + headers?: any + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Creates a Resource from a URL and calls head() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static head(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + responseType?: string + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Asynchronously gets options the given resource. Returns a promise that will resolve to + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * resource.options() + .then(function(headers) { + // use the data + }).otherwise(function(error) { + // an error occurred + }); + * @param [options] - Object with the following properties: + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.headers] - Additional HTTP headers to send with the request, if any. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + options(options?: { + responseType?: string + headers?: any + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Creates a Resource from a URL and calls options() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static options(options: { + url: string + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + responseType?: string + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Asynchronously posts data to the given resource. Returns a promise that will resolve to + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * resource.post(data) + .then(function(result) { + // use the result + }).otherwise(function(error) { + // an error occurred + }); + * @param data - Data that is posted with the resource. + * @param [options] - Object with the following properties: + * @param [options.data] - Data that is posted with the resource. + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.headers] - Additional HTTP headers to send with the request, if any. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + post(data: any, options?: { + data?: any + responseType?: string + headers?: any + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Creates a Resource from a URL and calls post() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param options.data - Data that is posted with the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static post(options: { + url: string + data: any + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + responseType?: string + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Asynchronously puts data to the given resource. Returns a promise that will resolve to + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * resource.put(data) + .then(function(result) { + // use the result + }).otherwise(function(error) { + // an error occurred + }); + * @param data - Data that is posted with the resource. + * @param [options] - Object with the following properties: + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.headers] - Additional HTTP headers to send with the request, if any. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + put(data: any, options?: { + responseType?: string + headers?: any + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Creates a Resource from a URL and calls put() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param options.data - Data that is posted with the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static put(options: { + url: string + data: any + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + responseType?: string + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Asynchronously patches data to the given resource. Returns a promise that will resolve to + the result once loaded, or reject if the resource failed to load. The data is loaded + using XMLHttpRequest, which means that in order to make requests to another origin, + the server must have Cross-Origin Resource Sharing (CORS) headers enabled. + * @example + * resource.patch(data) + .then(function(result) { + // use the result + }).otherwise(function(error) { + // an error occurred + }); + * @param data - Data that is posted with the resource. + * @param [options] - Object with the following properties: + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.headers] - Additional HTTP headers to send with the request, if any. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + patch(data: any, options?: { + responseType?: string + headers?: any + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * Creates a Resource from a URL and calls patch() on it. + * @param options - A url or an object with the following properties + * @param options.url - The url of the resource. + * @param options.data - Data that is posted with the resource. + * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource. + * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). + * @param [options.headers = {}] - Additional HTTP headers that will be sent. + * @param [options.proxy] - A proxy to be used when loading the resource. + * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried. + * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up. + * @param [options.request] - A Request object that will be used. Intended for internal use only. + * @param [options.responseType] - The type of response. This controls the type of item returned. + * @param [options.overrideMimeType] - Overrides the MIME type returned by the server. + * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority. + */ + static patch(options: { + url: string + data: any + queryParameters?: any + templateValues?: any + headers?: any + proxy?: Proxy + retryCallback?: Resource.RetryCallback + retryAttempts?: number + request?: Request + responseType?: string + overrideMimeType?: string + }): Promise<any> | undefined; + /** + * A resource instance initialized to the current browser location + */ + static readonly DEFAULT: Resource; +} + +export namespace Resource { + /** + * A function that returns the value of the property. + * @param [resource] - The resource that failed to load. + * @param [error] - The error that occurred during the loading of the resource. + */ + type RetryCallback = (resource?: Resource, error?: Error) => boolean | Promise<boolean>; +} + +/** + * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g., +out of memory, could not compile shader, etc. If a function may throw this +exception, the calling code should be prepared to catch it. +<br /><br /> +On the other hand, a {@link DeveloperError} indicates an exception due +to a developer error, e.g., invalid argument, that usually indicates a bug in the +calling code. + * @param [message] - The error message for this exception. + */ +export class RuntimeError extends Error { + constructor(message?: string); + /** + * 'RuntimeError' indicating that this exception was thrown due to a runtime error. + */ + readonly name: string; + /** + * The explanation for why this exception was thrown. + */ + readonly message: string; + /** + * The stack trace of this exception, if available. + */ + readonly stack: string; +} + +/** + * Initiates a terrain height query for an array of {@link Cartographic} positions by +requesting tiles from a terrain provider, sampling, and interpolating. The interpolation +matches the triangles used to render the terrain at the specified level. The query +happens asynchronously, so this function returns a promise that is resolved when +the query completes. Each point height is modified in place. If a height can not be +determined because no terrain data is available for the specified level at that location, +or another error occurs, the height is set to undefined. As is typical of the +{@link Cartographic} type, the supplied height is a height above the reference ellipsoid +(such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other +words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the +terrain level of detail as input, if you need to get the altitude of the terrain as precisely +as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}. + * @example + * // Query the terrain height of two Cartographic positions +var terrainProvider = Cesium.createWorldTerrain(); +var positions = [ + Cesium.Cartographic.fromDegrees(86.925145, 27.988257), + Cesium.Cartographic.fromDegrees(87.0, 28.0) +]; +var promise = Cesium.sampleTerrain(terrainProvider, 11, positions); +Cesium.when(promise, function(updatedPositions) { + // positions[0].height and positions[1].height have been updated. + // updatedPositions is just a reference to positions. +}); + * @param terrainProvider - The terrain provider from which to query heights. + * @param level - The terrain level-of-detail from which to query terrain heights. + * @param positions - The positions to update with terrain heights. + * @returns A promise that resolves to the provided list of positions when terrain the query has completed. + */ +export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise<Cartographic[]>; + +/** + * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset. + * @example + * // Query the terrain height of two Cartographic positions +var terrainProvider = Cesium.createWorldTerrain(); +var positions = [ + Cesium.Cartographic.fromDegrees(86.925145, 27.988257), + Cesium.Cartographic.fromDegrees(87.0, 28.0) +]; +var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions); +Cesium.when(promise, function(updatedPositions) { + // positions[0].height and positions[1].height have been updated. + // updatedPositions is just a reference to positions. +}); + * @param terrainProvider - The terrain provider from which to query heights. + * @param positions - The positions to update with terrain heights. + * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This + promise will reject if the terrain provider's `availability` property is undefined. + */ +export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise<Cartographic[]>; + +/** + * Handles user input events. Custom functions can be added to be executed on +when the user enters input. + * @param [element = document] - The element to add events to. + */ +export class ScreenSpaceEventHandler { + constructor(element?: HTMLCanvasElement); + /** + * Set a function to be executed on an input event. + * @param action - Function to be executed when the input event occurs. + * @param type - The ScreenSpaceEventType of input event. + * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code> + event occurs. + */ + setInputAction(action: (...params: any[]) => any, type: number, modifier?: number): void; + /** + * Returns the function to be executed on an input event. + * @param type - The ScreenSpaceEventType of input event. + * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code> + event occurs. + * @returns The function to be executed on an input event. + */ + getInputAction(type: number, modifier?: number): (...params: any[]) => any; + /** + * Removes the function to be executed on an input event. + * @param type - The ScreenSpaceEventType of input event. + * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code> + event occurs. + */ + removeInputAction(type: number, modifier?: number): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Removes listeners held by this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * handler = handler && handler.destroy(); + */ + destroy(): void; + /** + * The amount of time, in milliseconds, that mouse events will be disabled after + receiving any touch events, such that any emulated mouse events will be ignored. + */ + static mouseEmulationIgnoreMilliseconds: number; + /** + * The amount of time, in milliseconds, before a touch on the screen becomes a + touch and hold. + */ + static touchHoldDelayMilliseconds: number; +} + +/** + * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down. + */ +export enum ScreenSpaceEventType { + /** + * Represents a mouse left button down event. + */ + LEFT_DOWN = 0, + /** + * Represents a mouse left button up event. + */ + LEFT_UP = 1, + /** + * Represents a mouse left click event. + */ + LEFT_CLICK = 2, + /** + * Represents a mouse left double click event. + */ + LEFT_DOUBLE_CLICK = 3, + /** + * Represents a mouse left button down event. + */ + RIGHT_DOWN = 5, + /** + * Represents a mouse right button up event. + */ + RIGHT_UP = 6, + /** + * Represents a mouse right click event. + */ + RIGHT_CLICK = 7, + /** + * Represents a mouse middle button down event. + */ + MIDDLE_DOWN = 10, + /** + * Represents a mouse middle button up event. + */ + MIDDLE_UP = 11, + /** + * Represents a mouse middle click event. + */ + MIDDLE_CLICK = 12, + /** + * Represents a mouse move event. + */ + MOUSE_MOVE = 15, + /** + * Represents a mouse wheel event. + */ + WHEEL = 16, + /** + * Represents the start of a two-finger event on a touch surface. + */ + PINCH_START = 17, + /** + * Represents the end of a two-finger event on a touch surface. + */ + PINCH_END = 18, + /** + * Represents a change of a two-finger event on a touch surface. + */ + PINCH_MOVE = 19 +} + +/** + * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown. + * @example + * var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.BoxGeometry({ + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL, + minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0), + maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0) + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()), + id : 'box', + attributes : { + show : new Cesium.ShowGeometryInstanceAttribute(false) + } +}); + * @param [show = true] - Determines if the geometry instance will be shown. + */ +export class ShowGeometryInstanceAttribute { + constructor(show?: boolean); + /** + * The values for the attributes stored in a typed array. + */ + value: Uint8Array; + /** + * The datatype of each component in the attribute, e.g., individual elements in + {@link ColorGeometryInstanceAttribute#value}. + */ + readonly componentDatatype: ComponentDatatype; + /** + * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}. + */ + readonly componentsPerAttribute: number; + /** + * When <code>true</code> and <code>componentDatatype</code> is an integer format, + indicate that the components should be mapped to the range [0, 1] (unsigned) + or [-1, 1] (signed) when they are accessed as floating-point for rendering. + */ + readonly normalize: boolean; + /** + * Converts a boolean show to a typed array that can be used to assign a show attribute. + * @example + * var attributes = primitive.getGeometryInstanceAttributes('an id'); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show); + * @param show - The show value. + * @param [result] - The array to store the result in, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. + */ + static toValue(show: boolean, result?: Uint8Array): Uint8Array; +} + +/** + * Contains functions for finding the Cartesian coordinates of the sun and the moon in the +Earth-centered inertial frame. + */ +export namespace Simon1994PlanetaryPositions { + /** + * Computes the position of the Sun in the Earth-centered inertial frame + * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used. + * @param [result] - The object onto which to store the result. + * @returns Calculated sun position + */ + function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3; + /** + * Computes the position of the Moon in the Earth-centered inertial frame + * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used. + * @param [result] - The object onto which to store the result. + * @returns Calculated moon position + */ + function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3; +} + +/** + * A description of a polyline modeled as a line strip; the first two positions define a line segment, +and each additional position defines a line segment from the previous position. + * @example + * // A polyline with two connected line segments +var polyline = new Cesium.SimplePolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0, + 5.0, 5.0 + ]) +}); +var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline); + * @param options - Object with the following properties: + * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip. + * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors. + * @param [options.colorsPerVertex = false] - A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices. + * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference. + */ +export class SimplePolylineGeometry { + constructor(options: { + positions: Cartesian3[] + colors?: Color[] + colorsPerVertex?: boolean + arcType?: ArcType + granularity?: number + ellipsoid?: Ellipsoid + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: SimplePolylineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new SimplePolylineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry; + /** + * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere. + * @param simplePolylineGeometry - A description of the polyline. + * @returns The computed vertices and indices. + */ + static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined; +} + +/** + * A description of a sphere centered at the origin. + * @example + * var sphere = new Cesium.SphereGeometry({ + radius : 100.0, + vertexFormat : Cesium.VertexFormat.POSITION_ONLY +}); +var geometry = Cesium.SphereGeometry.createGeometry(sphere); + * @param [options] - Object with the following properties: + * @param [options.radius = 1.0] - The radius of the sphere. + * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks. + * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices. + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ +export class SphereGeometry { + constructor(options?: { + radius?: number + stackPartitions?: number + slicePartitions?: number + vertexFormat?: VertexFormat + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: SphereGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new SphereGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry; + /** + * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere. + * @param sphereGeometry - A description of the sphere. + * @returns The computed vertices and indices. + */ + static createGeometry(sphereGeometry: SphereGeometry): Geometry | undefined; +} + +/** + * A description of the outline of a sphere. + * @example + * var sphere = new Cesium.SphereOutlineGeometry({ + radius : 100.0, + stackPartitions : 6, + slicePartitions: 5 +}); +var geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere); + * @param [options] - Object with the following properties: + * @param [options.radius = 1.0] - The radius of the sphere. + * @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines). + * @param [options.slicePartitions = 8] - The count of slices for the sphere (Equal to the number of radial lines). + * @param [options.subdivisions = 200] - The number of points per line, determining the granularity of the curvature . + */ +export class SphereOutlineGeometry { + constructor(options?: { + radius?: number + stackPartitions?: number + slicePartitions?: number + subdivisions?: number + }); + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: SphereOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new SphereOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry; + /** + * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere. + * @param sphereGeometry - A description of the sphere outline. + * @returns The computed vertices and indices. + */ + static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry | undefined; +} + +/** + * A set of curvilinear 3-dimensional coordinates. + * @param [clock = 0.0] - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis. + * @param [cone = 0.0] - The angular coordinate measured from the positive z-axis and toward the negative z-axis. + * @param [magnitude = 1.0] - The linear coordinate measured from the origin. + */ +export class Spherical { + constructor(clock?: number, cone?: number, magnitude?: number); + /** + * The clock component. + */ + clock: number; + /** + * The cone component. + */ + cone: number; + /** + * The magnitude component. + */ + magnitude: number; + /** + * Converts the provided Cartesian3 into Spherical coordinates. + * @param cartesian3 - The Cartesian3 to be converted to Spherical. + * @param [result] - The object in which the result will be stored, if undefined a new instance will be created. + * @returns The modified result parameter, or a new instance if one was not provided. + */ + static fromCartesian3(cartesian3: Cartesian3, result?: Spherical): Spherical; + /** + * Creates a duplicate of a Spherical. + * @param spherical - The spherical to clone. + * @param [result] - The object to store the result into, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined) + */ + static clone(spherical: Spherical, result?: Spherical): Spherical; + /** + * Computes the normalized version of the provided spherical. + * @param spherical - The spherical to be normalized. + * @param [result] - The object to store the result into, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. + */ + static normalize(spherical: Spherical, result?: Spherical): Spherical; + /** + * Returns true if the first spherical is equal to the second spherical, false otherwise. + * @param left - The first Spherical to be compared. + * @param right - The second Spherical to be compared. + * @returns true if the first spherical is equal to the second spherical, false otherwise. + */ + static equals(left: Spherical, right: Spherical): boolean; + /** + * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise. + * @param left - The first Spherical to be compared. + * @param right - The second Spherical to be compared. + * @param [epsilon = 0.0] - The epsilon to compare against. + * @returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise. + */ + static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean; + /** + * Returns true if this spherical is equal to the provided spherical, false otherwise. + * @param other - The Spherical to be compared. + * @returns true if this spherical is equal to the provided spherical, false otherwise. + */ + equals(other: Spherical): boolean; + /** + * Creates a duplicate of this Spherical. + * @param [result] - The object to store the result into, if undefined a new instance will be created. + * @returns The modified result parameter or a new instance if result was undefined. + */ + clone(result?: Spherical): Spherical; + /** + * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise. + * @param other - The Spherical to be compared. + * @param epsilon - The epsilon to compare against. + * @returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise. + */ + equalsEpsilon(other: Spherical, epsilon: number): boolean; + /** + * Returns a string representing this instance in the format (clock, cone, magnitude). + * @returns A string representing this instance. + */ + toString(): string; +} + +/** + * Creates a curve parameterized and evaluated by time. This type describes an interface +and is not intended to be instantiated directly. + */ +export class Spline { + constructor(); + /** + * An array of times for the control points. + */ + times: number[]; + /** + * An array of control points. + */ + points: Cartesian3[] | Quaternion[]; + /** + * Evaluates the curve at a given time. + * @param time - The time at which to evaluate the curve. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance of the point on the curve at the given time. + */ + evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[]; + /** + * Finds an index <code>i</code> in <code>times</code> such that the parameter + <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>. + * @param time - The time. + * @param startIndex - The index from which to start the search. + * @returns The index for the element at the start of the interval. + */ + findTimeInterval(time: number, startIndex: number): number; + /** + * Wraps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, wrapped around the animation period. + */ + wrapTime(time: number): number; + /** + * Clamps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, clamped to the animation period. + */ + clampTime(time: number): number; +} + +/** + * Subdivides an array into a number of smaller, equal sized arrays. + * @param array - The array to divide. + * @param numberOfArrays - The number of arrays to divide the provided array into. + */ +export function subdivideArray(array: any[], numberOfArrays: number): void; + +/** + * A wrapper around a web worker that allows scheduling tasks for a given worker, +returning results asynchronously via a promise. + +The Worker is not constructed until a task is scheduled. + * @param workerPath - The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder. + * @param [maximumActiveTasks = Number.POSITIVE_INFINITY] - The maximum number of active tasks. Once exceeded, + scheduleTask will not queue any more tasks, allowing + work to be rescheduled in future frames. + */ +export class TaskProcessor { + constructor(workerPath: string, maximumActiveTasks?: number); + /** + * Schedule a task to be processed by the web worker asynchronously. If there are currently more + tasks active than the maximum set by the constructor, will immediately return undefined. + Otherwise, returns a promise that will resolve to the result posted back by the worker when + finished. + * @example + * var taskProcessor = new Cesium.TaskProcessor('myWorkerPath'); + var promise = taskProcessor.scheduleTask({ + someParameter : true, + another : 'hello' + }); + if (!Cesium.defined(promise)) { + // too many active tasks - try again later + } else { + Cesium.when(promise, function(result) { + // use the result of the task + }); + } + * @param parameters - Any input data that will be posted to the worker. + * @param [transferableObjects] - An array of objects contained in parameters that should be + transferred to the worker instead of copied. + * @returns Either a promise that will resolve to the result when available, or undefined + if there are too many active tasks, + */ + scheduleTask(parameters: any, transferableObjects?: object[]): Promise<object> | undefined; + /** + * Posts a message to a web worker with configuration to initialize loading + and compiling a web assembly module asychronously, as well as an optional + fallback JavaScript module to use if Web Assembly is not supported. + * @param [webAssemblyOptions] - An object with the following properties: + * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module. + * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file. + * @param [webAssemblyOptions.fallbackModulePath] - The path of the fallback JavaScript module to use if web assembly is not supported. + * @returns A promise that resolves to the result when the web worker has loaded and compiled the web assembly module and is ready to process tasks. + */ + initWebAssemblyModule(webAssemblyOptions?: { + modulePath?: string + wasmBinaryFile?: string + fallbackModulePath?: string + }): Promise<object>; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys this object. This will immediately terminate the Worker. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + */ + destroy(): void; +} + +/** + * Terrain data for a single tile. This type describes an +interface and is not intended to be instantiated directly. + */ +export class TerrainData { + constructor(); + /** + * An array of credits for this tile. + */ + credits: Credit[]; + /** + * The water mask included in this terrain data, if any. A water mask is a rectangular + Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. + Values in between 0 and 255 are allowed as well to smoothly blend between land and water. + */ + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + /** + * Computes the terrain height at a specified longitude and latitude. + * @param rectangle - The rectangle covered by this terrain data. + * @param longitude - The longitude in radians. + * @param latitude - The latitude in radians. + * @returns The terrain height at the specified position. If the position + is outside the rectangle, this method will extrapolate the height, which is likely to be wildly + incorrect for positions far outside the rectangle. + */ + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + /** + * Determines if a given child tile is available, based on the + {@link TerrainData#childTileMask}. The given child tile coordinates are assumed + to be one of the four children of this tile. If non-child tile coordinates are + given, the availability of the southeast child tile is returned. + * @param thisX - The tile X coordinate of this (the parent) tile. + * @param thisY - The tile Y coordinate of this (the parent) tile. + * @param childX - The tile X coordinate of the child tile to check for availability. + * @param childY - The tile Y coordinate of the child tile to check for availability. + * @returns True if the child tile is available; otherwise, false. + */ + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + /** + * Upsamples this terrain data for use by a descendant tile. + * @param tilingScheme - The tiling scheme of this terrain data. + * @param thisX - The X coordinate of this tile in the tiling scheme. + * @param thisY - The Y coordinate of this tile in the tiling scheme. + * @param thisLevel - The level of this tile in the tiling scheme. + * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling. + * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling. + * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling. + * @returns A promise for upsampled terrain data for the descendant tile, + or undefined if too many asynchronous upsample operations are in progress and the request has been + deferred. + */ + upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<TerrainData> | undefined; + /** + * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution + terrain data. If this value is false, the data was obtained from some other source, such + as by downloading it from a remote server. This method should return true for instances + returned from a call to {@link TerrainData#upsample}. + * @returns True if this instance was created by upsampling; otherwise, false. + */ + wasCreatedByUpsampling(): boolean; +} + +/** + * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is +organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an +interface and is not intended to be instantiated directly. + */ +export class TerrainProvider { + constructor(); + /** + * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + errorEvent: Event; + /** + * Gets the credit to display when this terrain provider is active. Typically this is used to credit + the source of the terrain. This function should + not be called before {@link TerrainProvider#ready} returns true. + */ + credit: Credit; + /** + * Gets the tiling scheme used by the provider. This function should + not be called before {@link TerrainProvider#ready} returns true. + */ + tilingScheme: TilingScheme; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets a value indicating whether or not the provider includes a water mask. The water mask + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link TerrainProvider#ready} returns true. + */ + hasWaterMask: boolean; + /** + * Gets a value indicating whether or not the requested tiles include vertex normals. + This function should not be called before {@link TerrainProvider#ready} returns true. + */ + hasVertexNormals: boolean; + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + at points and in rectangles. This function should not be called before + {@link TerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. + */ + availability: TileAvailability; + /** + * Gets a list of indices for a triangle mesh representing a regular grid. Calling + this function multiple times with the same grid width and height returns the + same list of indices. The total number of vertices must be less than or equal + to 65536. + * @param width - The number of vertices in the regular grid in the horizontal direction. + * @param height - The number of vertices in the regular grid in the vertical direction. + * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less. + */ + static getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array; + /** + * Specifies the quality of terrain created from heightmaps. A value of 1.0 will + ensure that adjacent heightmap vertices are separated by no more than + {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly. + A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the + screen pixels between adjacent heightmap vertices and thus rendering more quickly. + */ + static heightmapTerrainQuality: number; + /** + * Determines an appropriate geometric error estimate when the geometry comes from a heightmap. + * @param ellipsoid - The ellipsoid to which the terrain is attached. + * @param tileImageWidth - The width, in pixels, of the heightmap associated with a single tile. + * @param numberOfTilesAtLevelZero - The number of tiles in the horizontal direction at tile level zero. + * @returns An estimated geometric error. + */ + static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number; + /** + * Requests the geometry for a given tile. This function should not be called before + {@link TerrainProvider#ready} returns true. The result must include terrain data and + may optionally include a water mask and an indication of which child tiles are available. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the requested geometry. If this method + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. + */ + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined; + /** + * Gets the maximum geometric error allowed in a tile at a given level. This function should not be + called before {@link TerrainProvider#ready} returns true. + * @param level - The tile level for which to get the maximum geometric error. + * @returns The maximum geometric error. + */ + getLevelMaximumGeometricError(level: number): number; + /** + * Determines whether data for a tile is available to be loaded. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if not supported by the terrain provider, otherwise true or false. + */ + getTileDataAvailable(x: number, y: number, level: number): boolean; + /** + * Makes sure we load availability data for a tile + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + */ + loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>; +} + +/** + * Reports the availability of tiles in a {@link TilingScheme}. + * @param tilingScheme - The tiling scheme in which to report availability. + * @param maximumLevel - The maximum tile level that is potentially available. + */ +export class TileAvailability { + constructor(tilingScheme: TilingScheme, maximumLevel: number); + /** + * Marks a rectangular range of tiles in a particular level as being available. For best performance, + add your ranges in order of increasing level. + * @param level - The level. + * @param startX - The X coordinate of the first available tiles at the level. + * @param startY - The Y coordinate of the first available tiles at the level. + * @param endX - The X coordinate of the last available tiles at the level. + * @param endY - The Y coordinate of the last available tiles at the level. + */ + addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void; + /** + * Determines the level of the most detailed tile covering the position. This function + usually completes in time logarithmic to the number of rectangles added with + {@link TileAvailability#addAvailableTileRange}. + * @param position - The position for which to determine the maximum available level. The height component is ignored. + * @returns The level of the most detailed tile covering the position. + */ + computeMaximumLevelAtPosition(position: Cartographic): number; + /** + * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed + tiles may be available in parts of the rectangle, but not the whole thing. The return value of this + function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function + usually completes in time logarithmic to the number of rectangles added with + {@link TileAvailability#addAvailableTileRange}. + * @param rectangle - The rectangle. + * @returns The best available level for the entire rectangle. + */ + computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number; + /** + * Determines if a particular tile is available. + * @param level - The tile level to check. + * @param x - The X coordinate of the tile to check. + * @param y - The Y coordinate of the tile to check. + * @returns True if the tile is available; otherwise, false. + */ + isTileAvailable(level: number, x: number, y: number): boolean; + /** + * Computes a bit mask indicating which of a tile's four children exist. + If a child's bit is set, a tile is available for that child. If it is cleared, + the tile is not available. The bit values are as follows: + <table> + <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr> + <tr><td>0</td><td>1</td><td>Southwest</td></tr> + <tr><td>1</td><td>2</td><td>Southeast</td></tr> + <tr><td>2</td><td>4</td><td>Northwest</td></tr> + <tr><td>3</td><td>8</td><td>Northeast</td></tr> + </table> + * @param level - The level of the parent tile. + * @param x - The X coordinate of the parent tile. + * @param y - The Y coordinate of the parent tile. + * @returns The bit mask indicating child availability. + */ + computeChildMaskForTile(level: number, x: number, y: number): number; +} + +/** + * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}. + * @param provider - The imagery or terrain provider that experienced the error. + * @param message - A message describing the error. + * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error + is not specific to a particular tile. + * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error + is not specific to a particular tile. + * @param [level] - The level of the tile that experienced the error, or undefined if the error + is not specific to a particular tile. + * @param [timesRetried = 0] - The number of times this operation has been retried. + * @param [error] - The error or exception that occurred, if any. + */ +export class TileProviderError { + constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error); + /** + * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error. + */ + provider: ImageryProvider | TerrainProvider; + /** + * The message describing the error. + */ + message: string; + /** + * The X coordinate of the tile that experienced the error. If the error is not specific + to a particular tile, this property will be undefined. + */ + x: number; + /** + * The Y coordinate of the tile that experienced the error. If the error is not specific + to a particular tile, this property will be undefined. + */ + y: number; + /** + * The level-of-detail of the tile that experienced the error. If the error is not specific + to a particular tile, this property will be undefined. + */ + level: number; + /** + * The number of times this operation has been retried. + */ + timesRetried: number; + /** + * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider + will set the initial value of this property before raising the event, but any listeners + can change it. The value after the last listener is invoked will be acted upon. + */ + retry: boolean; + /** + * The error or exception that occurred, if any. + */ + error: Error; + /** + * Handles an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by + logging the error to the console if the event has no listeners. This method also tracks the number + of times the operation has been retried and will automatically retry if requested to do so by the + event listeners. + * @param previousError - The error instance returned by this function the last + time it was called for this error, or undefined if this is the first time this error has + occurred. + * @param provider - The imagery or terrain provider that encountered the error. + * @param event - The event to raise to inform listeners of the error. + * @param message - The message describing the error. + * @param x - The X coordinate of the tile that experienced the error, or undefined if the + error is not specific to a particular tile. + * @param y - The Y coordinate of the tile that experienced the error, or undefined if the + error is not specific to a particular tile. + * @param level - The level-of-detail of the tile that experienced the error, or undefined if the + error is not specific to a particular tile. + * @param retryFunction - The function to call to retry the operation. If undefined, the + operation will not be retried. + * @param [errorDetails] - The error or exception that occurred, if any. + * @returns The error instance that was passed to the event listeners and that + should be passed to this function the next time it is called for the same error in order + to track retry counts. + */ + static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError; + /** + * Handles success of an operation by resetting the retry count of a previous error, if any. This way, + if the error occurs again in the future, the listeners will be informed that it has not yet been retried. + * @param previousError - The previous error, or undefined if this operation has + not previously resulted in an error. + */ + static handleSuccess(previousError: TileProviderError): void; +} + +export namespace TileProviderError { + /** + * A function that will be called to retry the operation. + */ + type RetryFunction = () => void; +} + +/** + * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero, +the coarsest, least-detailed level, the number of tiles is configurable. +At level of detail one, each of the level zero tiles has four children, two in each direction. +At level of detail two, each of the level one tiles has four children, two in each direction. +This continues for as many levels as are present in the geometry or imagery source. + */ +export class TilingScheme { + constructor(); + /** + * Gets the ellipsoid that is tiled by the tiling scheme. + */ + ellipsoid: Ellipsoid; + /** + * Gets the rectangle, in radians, covered by this tiling scheme. + */ + rectangle: Rectangle; + /** + * Gets the map projection used by the tiling scheme. + */ + projection: MapProjection; + /** + * Gets the total number of tiles in the X direction at a specified level-of-detail. + * @param level - The level-of-detail. + * @returns The number of tiles in the X direction at the given level. + */ + getNumberOfXTilesAtLevel(level: number): number; + /** + * Gets the total number of tiles in the Y direction at a specified level-of-detail. + * @param level - The level-of-detail. + * @returns The number of tiles in the Y direction at the given level. + */ + getNumberOfYTilesAtLevel(level: number): number; + /** + * Transforms a rectangle specified in geodetic radians to the native coordinate system + of this tiling scheme. + * @param rectangle - The rectangle to transform. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the native rectangle if 'result' + is undefined. + */ + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + /** + * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates + of the tiling scheme. + * @param x - The integer x coordinate of the tile. + * @param y - The integer y coordinate of the tile. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the rectangle + if 'result' is undefined. + */ + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + /** + * Converts tile x, y coordinates and level to a cartographic rectangle in radians. + * @param x - The integer x coordinate of the tile. + * @param y - The integer y coordinate of the tile. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the rectangle + if 'result' is undefined. + */ + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + /** + * Calculates the tile x, y coordinates of the tile containing + a given cartographic position. + * @param position - The position. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the tile x, y coordinates + if 'result' is undefined. + */ + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; +} + +/** + * An interval defined by a start and a stop time; optionally including those times as part of the interval. +Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}. + * @example + * // Create an instance that spans August 1st, 1980 and is associated +// with a Cartesian position. +var timeInterval = new Cesium.TimeInterval({ + start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'), + stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'), + isStartIncluded : true, + isStopIncluded : false, + data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082) +}); + * @example + * // Create two instances from ISO 8601 intervals with associated numeric data +// then compute their intersection, summing the data they contain. +var left = Cesium.TimeInterval.fromIso8601({ + iso8601 : '2000/2010', + data : 2 +}); + +var right = Cesium.TimeInterval.fromIso8601({ + iso8601 : '1995/2005', + data : 3 +}); + +//The result of the below intersection will be an interval equivalent to +//var intersection = Cesium.TimeInterval.fromIso8601({ +// iso8601 : '2000/2005', +// data : 5 +//}); +var intersection = new Cesium.TimeInterval(); +Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) { + return leftData + rightData; +}); + * @example + * // Check if an interval contains a specific time. +var dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z'); +var containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck); + * @param [options] - Object with the following properties: + * @param [options.start = new JulianDate()] - The start time of the interval. + * @param [options.stop = new JulianDate()] - The stop time of the interval. + * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise. + * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise. + * @param [options.data] - Arbitrary data associated with this interval. + */ +export class TimeInterval { + constructor(options?: { + start?: JulianDate + stop?: JulianDate + isStartIncluded?: boolean + isStopIncluded?: boolean + data?: any + }); + /** + * Gets or sets the start time of this interval. + */ + start: JulianDate; + /** + * Gets or sets the stop time of this interval. + */ + stop: JulianDate; + /** + * Gets or sets the data associated with this interval. + */ + data: any; + /** + * Gets or sets whether or not the start time is included in this interval. + */ + isStartIncluded: boolean; + /** + * Gets or sets whether or not the stop time is included in this interval. + */ + isStopIncluded: boolean; + /** + * Gets whether or not this interval is empty. + */ + readonly isEmpty: boolean; + /** + * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval. + * @param options - Object with the following properties: + * @param options.iso8601 - An ISO 8601 interval. + * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise. + * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise. + * @param [options.data] - Arbitrary data associated with this interval. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fromIso8601(options: { + iso8601: string + isStartIncluded?: boolean + isStopIncluded?: boolean + data?: any + }, result?: TimeInterval): TimeInterval; + /** + * Creates an ISO8601 representation of the provided interval. + * @param timeInterval - The interval to be converted. + * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used. + * @returns The ISO8601 representation of the provided interval. + */ + static toIso8601(timeInterval: TimeInterval, precision?: number): string; + /** + * Duplicates the provided instance. + * @param [timeInterval] - The instance to clone. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval; + /** + * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [left] - The first instance. + * @param [right] - The second instance. + * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. + * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>. + */ + static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean; + /** + * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of + each other. That is, in order for the dates to be considered equal (and for + this function to return <code>true</code>), the absolute value of the difference between them, in + seconds, must be less than <code>epsilon</code>. + * @param [left] - The first instance. + * @param [right] - The second instance. + * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances. + * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. + * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>. + */ + static equalsEpsilon(left?: TimeInterval, right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean; + /** + * Computes the intersection of two intervals, optionally merging their data. + * @param left - The first interval. + * @param [right] - The second interval. + * @param [result] - An existing instance to use for the result. + * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. + * @returns The modified result parameter. + */ + static intersect(left: TimeInterval, right?: TimeInterval, result?: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval; + /** + * Checks if the specified date is inside the provided interval. + * @param timeInterval - The interval. + * @param julianDate - The date to check. + * @returns <code>true</code> if the interval contains the specified date, <code>false</code> otherwise. + */ + static contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean; + /** + * Duplicates this instance. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + clone(result?: TimeInterval): TimeInterval; + /** + * Compares this instance against the provided instance componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side interval. + * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean; + /** + * Compares this instance against the provided instance componentwise and returns + <code>true</code> if they are within the provided epsilon, + <code>false</code> otherwise. + * @param [right] - The right hand side interval. + * @param [epsilon = 0] - The epsilon to use for equality testing. + * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. + * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. + */ + equalsEpsilon(right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean; + /** + * Creates a string representing this TimeInterval in ISO8601 format. + * @returns A string representing this TimeInterval in ISO8601 format. + */ + toString(): string; + /** + * An immutable empty interval. + */ + static readonly EMPTY: TimeInterval; +} + +export namespace TimeInterval { + /** + * Function interface for merging interval data. + * @param leftData - The first data instance. + * @param rightData - The second data instance. + */ + type MergeCallback = (leftData: any, rightData: any) => any; + /** + * Function interface for comparing interval data. + * @param leftData - The first data instance. + * @param rightData - The second data instance. + */ + type DataComparer = (leftData: any, rightData: any) => boolean; +} + +/** + * A non-overlapping collection of {@link TimeInterval} instances sorted by start time. + * @param [intervals] - An array of intervals to add to the collection. + */ +export class TimeIntervalCollection { + constructor(intervals?: TimeInterval[]); + /** + * Gets an event that is raised whenever the collection of intervals change. + */ + readonly changedEvent: Event; + /** + * Gets the start time of the collection. + */ + readonly start: JulianDate; + /** + * Gets whether or not the start time is included in the collection. + */ + readonly isStartIncluded: boolean; + /** + * Gets the stop time of the collection. + */ + readonly stop: JulianDate; + /** + * Gets whether or not the stop time is included in the collection. + */ + readonly isStopIncluded: boolean; + /** + * Gets the number of intervals in the collection. + */ + readonly length: number; + /** + * Gets whether or not the collection is empty. + */ + readonly isEmpty: boolean; + /** + * Compares this instance against the provided instance componentwise and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side collection. + * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean; + /** + * Gets the interval at the specified index. + * @param index - The index of the interval to retrieve. + * @returns The interval at the specified index, or <code>undefined</code> if no interval exists as that index. + */ + get(index: number): TimeInterval | undefined; + /** + * Removes all intervals from the collection. + */ + removeAll(): void; + /** + * Finds and returns the interval that contains the specified date. + * @param date - The date to search for. + * @returns The interval containing the specified date, <code>undefined</code> if no such interval exists. + */ + findIntervalContainingDate(date: JulianDate): TimeInterval | undefined; + /** + * Finds and returns the data for the interval that contains the specified date. + * @param date - The date to search for. + * @returns The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists. + */ + findDataForIntervalContainingDate(date: JulianDate): any; + /** + * Checks if the specified date is inside this collection. + * @param julianDate - The date to check. + * @returns <code>true</code> if the collection contains the specified date, <code>false</code> otherwise. + */ + contains(julianDate: JulianDate): boolean; + /** + * Finds and returns the index of the interval in the collection that contains the specified date. + * @param date - The date to search for. + * @returns The index of the interval that contains the specified date, if no such interval exists, + it returns a negative number which is the bitwise complement of the index of the next interval that + starts after the date, or if no interval starts after the specified date, the bitwise complement of + the length of the collection. + */ + indexOf(date: JulianDate): number; + /** + * Returns the first interval in the collection that matches the specified parameters. + All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition. + * @param [options] - Object with the following properties: + * @param [options.start] - The start time of the interval. + * @param [options.stop] - The stop time of the interval. + * @param [options.isStartIncluded] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise. + * @param [options.isStopIncluded] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise. + * @returns The first interval in the collection that matches the specified parameters. + */ + findInterval(options?: { + start?: JulianDate + stop?: JulianDate + isStartIncluded?: boolean + isStopIncluded?: boolean + }): TimeInterval | undefined; + /** + * Adds an interval to the collection, merging intervals that contain the same data and + splitting intervals of different data as needed in order to maintain a non-overlapping collection. + The data in the new interval takes precedence over any existing intervals in the collection. + * @param interval - The interval to add. + * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. + */ + addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void; + /** + * Removes the specified interval from this interval collection, creating a hole over the specified interval. + The data property of the input interval is ignored. + * @param interval - The interval to remove. + * @returns <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection. + */ + removeInterval(interval: TimeInterval): boolean; + /** + * Creates a new instance that is the intersection of this collection and the provided collection. + * @param other - The collection to intersect with. + * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used. + * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used. + * @returns A new TimeIntervalCollection which is the intersection of this collection and the provided collection. + */ + intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection; + /** + * Creates a new instance from a JulianDate array. + * @param options - Object with the following properties: + * @param options.julianDates - An array of ISO 8601 dates. + * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise. + * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise. + * @param [options.leadingInterval = false] - <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise. + * @param [options.trailingInterval = false] - <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise. + * @param [options.dataCallback] - A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fromJulianDateArray(options: { + julianDates: JulianDate[] + isStartIncluded?: boolean + isStopIncluded?: boolean + leadingInterval?: boolean + trailingInterval?: boolean + dataCallback?: (...params: any[]) => any + }, result?: TimeIntervalCollection): TimeIntervalCollection; + /** + * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration). + * @param options - Object with the following properties: + * @param options.iso8601 - An ISO 8601 interval. + * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise. + * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise. + * @param [options.leadingInterval = false] - <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise. + * @param [options.trailingInterval = false] - <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise. + * @param [options.dataCallback] - A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fromIso8601(options: { + iso8601: string + isStartIncluded?: boolean + isStopIncluded?: boolean + leadingInterval?: boolean + trailingInterval?: boolean + dataCallback?: (...params: any[]) => any + }, result?: TimeIntervalCollection): TimeIntervalCollection; + /** + * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array. + * @param options - Object with the following properties: + * @param options.iso8601Dates - An array of ISO 8601 dates. + * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise. + * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise. + * @param [options.leadingInterval = false] - <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise. + * @param [options.trailingInterval = false] - <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise. + * @param [options.dataCallback] - A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fromIso8601DateArray(options: { + iso8601Dates: string[] + isStartIncluded?: boolean + isStopIncluded?: boolean + leadingInterval?: boolean + trailingInterval?: boolean + dataCallback?: (...params: any[]) => any + }, result?: TimeIntervalCollection): TimeIntervalCollection; + /** + * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array. + * @param options - Object with the following properties: + * @param options.epoch - An date that the durations are relative to. + * @param options.iso8601Durations - An array of ISO 8601 durations. + * @param [options.relativeToPrevious = false] - <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch. + * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise. + * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise. + * @param [options.leadingInterval = false] - <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise. + * @param [options.trailingInterval = false] - <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise. + * @param [options.dataCallback] - A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection. + * @param [result] - An existing instance to use for the result. + * @returns The modified result parameter or a new instance if none was provided. + */ + static fromIso8601DurationArray(options: { + epoch: JulianDate + iso8601Durations: string + relativeToPrevious?: boolean + isStartIncluded?: boolean + isStopIncluded?: boolean + leadingInterval?: boolean + trailingInterval?: boolean + dataCallback?: (...params: any[]) => any + }, result?: TimeIntervalCollection): TimeIntervalCollection; +} + +/** + * Provides the type of time standards which JulianDate can take as input. + */ +export enum TimeStandard { + /** + * Represents the coordinated Universal Time (UTC) time standard. + + UTC is related to TAI according to the relationship + <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap + seconds which have been introduced as of the time in TAI. + */ + UTC = 0, + /** + * Represents the International Atomic Time (TAI) time standard. + TAI is the principal time standard to which the other time standards are related. + */ + TAI = 1 +} + +/** + * Contains functions for transforming positions to various reference frames. + */ +export namespace Transforms { + /** + * Generates a function that computes a 4x4 transformation matrix from a reference frame + centered at the provided origin to the provided ellipsoid's fixed reference frame. + * @param firstAxis - name of the first axis of the local reference frame. Must be + 'east', 'north', 'up', 'west', 'south' or 'down'. + * @param secondAxis - name of the second axis of the local reference frame. Must be + 'east', 'north', 'up', 'west', 'south' or 'down'. + * @returns The function that will computes a + 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters, + */ + function localFrameToFixedFrameGenerator(firstAxis: string, secondAxis: string): Transforms.LocalFrameToFixedFrame; + /** + * Computes a 4x4 transformation matrix from a reference frame + centered at the provided origin to the provided ellipsoid's fixed reference frame. + * @param origin - The center point of the local reference frame. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [result] - The object onto which to store the result. + */ + type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4; + /** + * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes + centered at the provided origin to the provided ellipsoid's fixed reference frame. + The local axes are defined as: + <ul> + <li>The <code>x</code> axis points in the local east direction.</li> + <li>The <code>y</code> axis points in the local north direction.</li> + <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li> + </ul> + * @example + * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame. + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center); + * @param origin - The center point of the local reference frame. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if none was provided. + */ + function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + /** + * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes + centered at the provided origin to the provided ellipsoid's fixed reference frame. + The local axes are defined as: + <ul> + <li>The <code>x</code> axis points in the local north direction.</li> + <li>The <code>y</code> axis points in the local east direction.</li> + <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li> + </ul> + * @example + * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame. + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var transform = Cesium.Transforms.northEastDownToFixedFrame(center); + * @param origin - The center point of the local reference frame. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if none was provided. + */ + function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + /** + * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes + centered at the provided origin to the provided ellipsoid's fixed reference frame. + The local axes are defined as: + <ul> + <li>The <code>x</code> axis points in the local north direction.</li> + <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li> + <li>The <code>z</code> axis points in the local east direction.</li> + </ul> + * @example + * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame. + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var transform = Cesium.Transforms.northUpEastToFixedFrame(center); + * @param origin - The center point of the local reference frame. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if none was provided. + */ + function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + /** + * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes + centered at the provided origin to the provided ellipsoid's fixed reference frame. + The local axes are defined as: + <ul> + <li>The <code>x</code> axis points in the local north direction.</li> + <li>The <code>y</code> axis points in the local west direction.</li> + <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li> + </ul> + * @example + * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame. + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var transform = Cesium.Transforms.northWestUpToFixedFrame(center); + * @param origin - The center point of the local reference frame. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if none was provided. + */ + function northWestUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + /** + * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles + centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north + direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles + are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. + * @example + * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame. + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var heading = -Cesium.Math.PI_OVER_TWO; + var pitch = Cesium.Math.PI_OVER_FOUR; + var roll = 0.0; + var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); + var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); + * @param origin - The center point of the local reference frame. + * @param headingPitchRoll - The heading, pitch, and roll. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation + matrix from a reference frame to the provided ellipsoid's fixed reference frame + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if none was provided. + */ + function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Matrix4): Matrix4; + /** + * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles + centered at the provided origin. Heading is the rotation from the local north + direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles + are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. + * @example + * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame. + var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var heading = -Cesium.Math.PI_OVER_TWO; + var pitch = Cesium.Math.PI_OVER_FOUR; + var roll = 0.0; + var hpr = new HeadingPitchRoll(heading, pitch, roll); + var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); + * @param origin - The center point of the local reference frame. + * @param headingPitchRoll - The heading, pitch, and roll. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation + matrix from a reference frame to the provided ellipsoid's fixed reference frame + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Quaternion instance if none was provided. + */ + function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Quaternion): Quaternion; + /** + * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north + direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles + are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis. + * @param transform - The transform + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation + matrix from a reference frame to the provided ellipsoid's fixed reference frame + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new HeadingPitchRoll instance if none was provided. + */ + function fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: HeadingPitchRoll): HeadingPitchRoll; + /** + * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the + pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC. + * @example + * //Set the view to the inertial frame. + scene.postUpdate.addEventListener(function(scene, time) { + var now = Cesium.JulianDate.now(); + var offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3()); + var transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now)); + var inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4()); + Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset); + camera.lookAtTransform(transform, offset); + }); + * @param date - The time at which to compute the rotation matrix. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix3 instance if none was provided. + */ + function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; + /** + * Preloads the data necessary to transform between the ICRF and Fixed axes, in either + direction, over a given interval. This function returns a promise that, when resolved, + indicates that the preload has completed. + * @example + * var interval = new Cesium.TimeInterval(...); + when(Cesium.Transforms.preloadIcrfFixed(interval), function() { + // the data is now loaded + }); + * @param timeInterval - The interval to preload. + * @returns A promise that, when resolved, indicates that the preload has completed + and evaluation of the transformation between the fixed and ICRF axes will + no longer return undefined for a time inside the interval. + */ + function preloadIcrfFixed(timeInterval: TimeInterval): Promise<void>; + /** + * Computes a rotation matrix to transform a point or vector from the International Celestial + Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF) + at a given time. This function may return undefined if the data necessary to + do the transformation is not yet loaded. + * @example + * scene.postUpdate.addEventListener(function(scene, time) { + // View in ICRF. + var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time); + if (Cesium.defined(icrfToFixed)) { + var offset = Cesium.Cartesian3.clone(camera.position); + var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed); + camera.lookAtTransform(transform, offset); + } + }); + * @param date - The time at which to compute the rotation matrix. + * @param [result] - The object onto which to store the result. If this parameter is + not specified, a new instance is created and returned. + * @returns The rotation matrix, or undefined if the data necessary to do the + transformation is not yet loaded. + */ + function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; + /** + * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF) + to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes + at a given time. This function may return undefined if the data necessary to + do the transformation is not yet loaded. + * @example + * // Transform a point from the ICRF axes to the Fixed axes. + var now = Cesium.JulianDate.now(); + var pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now); + var pointInInertial = new Cesium.Cartesian3(); + if (Cesium.defined(fixedToIcrf)) { + pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial); + } + * @param date - The time at which to compute the rotation matrix. + * @param [result] - The object onto which to store the result. If this parameter is + not specified, a new instance is created and returned. + * @returns The rotation matrix, or undefined if the data necessary to do the + transformation is not yet loaded. + */ + function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3; + /** + * Transform a point from model coordinates to window coordinates. + * @param modelViewProjectionMatrix - The 4x4 model-view-projection matrix. + * @param viewportTransformation - The 4x4 viewport transformation. + * @param point - The point to transform. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Cartesian2 instance if none was provided. + */ + function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2; + /** + * Transform a position and velocity to a rotation matrix. + * @param position - The position to transform. + * @param velocity - The velocity vector to transform. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix3 instance if none was provided. + */ + function rotationMatrixFromPositionVelocity(position: Cartesian3, velocity: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix3): Matrix3; +} + +/** + * An affine transformation defined by a translation, rotation, and scale. + * @param [translation = Cartesian3.ZERO] - A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node. + * @param [rotation = Quaternion.IDENTITY] - A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node. + * @param [scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node. + */ +export class TranslationRotationScale { + constructor(translation?: Cartesian3, rotation?: Quaternion, scale?: Cartesian3); + /** + * Gets or sets the (x, y, z) translation to apply to the node. + */ + translation: Cartesian3; + /** + * Gets or sets the (x, y, z, w) rotation to apply to the node. + */ + rotation: Quaternion; + /** + * Gets or sets the (x, y, z) scaling to apply to the node. + */ + scale: Cartesian3; + /** + * Compares this instance against the provided instance and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [right] - The right hand side TranslationRotationScale. + * @returns <code>true</code> if they are equal, <code>false</code> otherwise. + */ + equals(right?: TranslationRotationScale): boolean; +} + +/** + * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve +a system of linear equations where the coefficient matrix is a tridiagonal matrix. + */ +export namespace TridiagonalSystemSolver { + /** + * Solves a tridiagonal system of linear equations. + * @example + * var lowerDiagonal = [1.0, 1.0, 1.0, 1.0]; + var diagonal = [2.0, 4.0, 4.0, 4.0, 2.0]; + var upperDiagonal = [1.0, 1.0, 1.0, 1.0]; + var rightHandSide = [ + new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0), + new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0), + new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0), + new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0), + new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0) + ]; + + var solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide); + * @param diagonal - An array with length <code>n</code> that contains the diagonal of the coefficient matrix. + * @param lower - An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix. + * @param upper - An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix. + * @param right - An array of Cartesians with length <code>n</code> that is the right side of the system of equations. + * @returns An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations. + */ + function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[]; +} + +/** + * A singleton that contains all of the servers that are trusted. Credentials will be sent with +any requests to these servers. + */ +export namespace TrustedServers { + /** + * Adds a trusted server to the registry + * @example + * // Add a trusted server + TrustedServers.add('my.server.com', 80); + * @param host - The host to be added. + * @param port - The port used to access the host. + */ + function add(host: string, port: number): void; + /** + * Removes a trusted server from the registry + * @example + * // Remove a trusted server + TrustedServers.remove('my.server.com', 80); + * @param host - The host to be removed. + * @param port - The port used to access the host. + */ + function remove(host: string, port: number): void; + /** + * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url. + * @example + * // Add server + TrustedServers.add('my.server.com', 81); + + // Check if server is trusted + if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) { + // my.server.com:81 is trusted + } + if (TrustedServers.contains('https://my.server.com/path/to/file.png')) { + // my.server.com isn't trusted + } + * @param url - The url to be tested against the trusted list + * @returns Returns true if url is trusted, false otherwise. + */ + function contains(url: string): boolean; + /** + * Clears the registry + * @example + * // Remove a trusted server + TrustedServers.clear(); + */ + function clear(): void; +} + +/** + * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided +to a {@link Geometry} to request that certain properties be computed, e.g., just position, +position and normal, etc. + * @example + * // Create a vertex format with position and 2D texture coordinate attributes. +var format = new Cesium.VertexFormat({ + position : true, + st : true +}); + * @param [options] - An object with boolean properties corresponding to VertexFormat properties as shown in the code example. + */ +export class VertexFormat { + constructor(options?: any); + /** + * When <code>true</code>, the vertex has a 3D position attribute. + <p> + 64-bit floating-point (for precision). 3 components per attribute. + </p> + */ + position: boolean; + /** + * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting. + <p> + 32-bit floating-point. 3 components per attribute. + </p> + */ + normal: boolean; + /** + * When <code>true</code>, the vertex has a 2D texture coordinate attribute. + <p> + 32-bit floating-point. 2 components per attribute + </p> + */ + st: boolean; + /** + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. + <p> + 32-bit floating-point. 3 components per attribute. + </p> + */ + bitangent: boolean; + /** + * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. + <p> + 32-bit floating-point. 3 components per attribute. + </p> + */ + tangent: boolean; + /** + * When <code>true</code>, the vertex has an RGB color attribute. + <p> + 8-bit unsigned byte. 3 components per attribute. + </p> + */ + color: boolean; + /** + * An immutable vertex format with only a position attribute. + */ + static readonly POSITION_ONLY: VertexFormat; + /** + * An immutable vertex format with position and normal attributes. + This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}. + */ + static readonly POSITION_AND_NORMAL: VertexFormat; + /** + * An immutable vertex format with position, normal, and st attributes. + This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport} + is <code>TEXTURED/code>. + */ + static readonly POSITION_NORMAL_AND_ST: VertexFormat; + /** + * An immutable vertex format with position and st attributes. + This is compatible with {@link EllipsoidSurfaceAppearance}. + */ + static readonly POSITION_AND_ST: VertexFormat; + /** + * An immutable vertex format with position and color attributes. + */ + static readonly POSITION_AND_COLOR: VertexFormat; + /** + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. + */ + static readonly ALL: VertexFormat; + /** + * An immutable vertex format with position, normal, and st attributes. + This is compatible with most appearances and materials; however + normal and st attributes are not always required. When this is + known in advance, another <code>VertexFormat</code> should be used. + */ + static readonly DEFAULT: VertexFormat; + /** + * The number of elements used to pack the object into an array. + */ + static packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: VertexFormat, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new VertexFormat instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat; + /** + * Duplicates a VertexFormat instance. + * @param vertexFormat - The vertex format to duplicate. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) + */ + static clone(vertexFormat: VertexFormat, result?: VertexFormat): VertexFormat; +} + +/** + * Synchronizes a video element with a simulation clock. + * @param [options] - Object with the following properties: + * @param [options.clock] - The clock instance used to drive the video. + * @param [options.element] - The video element to be synchronized. + * @param [options.epoch = Iso8601.MINIMUM_VALUE] - The simulation time that marks the start of the video. + * @param [options.tolerance = 1.0] - The maximum amount of time, in seconds, that the clock and video can diverge. + */ +export class VideoSynchronizer { + constructor(options?: { + clock?: Clock + element?: HTMLVideoElement + epoch?: JulianDate + tolerance?: number + }); + /** + * Gets or sets the simulation time that marks the start of the video. + */ + epoch: JulianDate; + /** + * Gets or sets the amount of time in seconds the video's currentTime + and the clock's currentTime can diverge before a video seek is performed. + Lower values make the synchronization more accurate but video + performance might suffer. Higher values provide better performance + but at the cost of accuracy. + */ + tolerance: number; + /** + * Gets or sets the clock used to drive the video element. + */ + clock: Clock; + /** + * Gets or sets the video element to synchronize. + */ + element: HTMLVideoElement; + /** + * Destroys and resources used by the object. Once an object is destroyed, it should not be used. + */ + destroy(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; +} + +/** + * This enumerated type is used in determining to what extent an object, the occludee, +is visible during horizon culling. An occluder may fully block an occludee, in which case +it has no visibility, may partially block an occludee from view, or may not block it at all, +leading to full visibility. + */ +export enum Visibility { + /** + * Represents that no part of an object is visible. + */ + NONE = -1, + /** + * Represents that part, but not all, of an object is visible + */ + PARTIAL = 0, + /** + * Represents that an object is visible in its entirety. + */ + FULL = 1 +} + +/** + * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps +retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}. + * @example + * var terrainProvider = new Cesium.VRTheWorldTerrainProvider({ + url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/' +}); +viewer.terrainProvider = terrainProvider; + * @param options - Object with the following properties: + * @param options.url - The URL of the VR-TheWorld TileMap. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid. If this parameter is not + specified, the WGS84 ellipsoid is used. + * @param [options.credit] - A credit for the data source, which is displayed on the canvas. + */ +export class VRTheWorldTerrainProvider { + constructor(options: { + url: Resource | string + ellipsoid?: Ellipsoid + credit?: Credit | string + }); + /** + * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + errorEvent: Event; + /** + * Gets the credit to display when this terrain provider is active. Typically this is used to credit + the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true. + */ + credit: Credit; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link VRTheWorldTerrainProvider#ready} returns true. + */ + tilingScheme: GeographicTilingScheme; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets a value indicating whether or not the provider includes a water mask. The water mask + indicates which areas of the globe are water rather than land, so they can be rendered + as a reflective surface with animated waves. This function should not be + called before {@link VRTheWorldTerrainProvider#ready} returns true. + */ + hasWaterMask: boolean; + /** + * Gets a value indicating whether or not the requested tiles include vertex normals. + This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true. + */ + hasVertexNormals: boolean; + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + at points and in rectangles. This function should not be called before + {@link TerrainProvider#ready} returns true. This property may be undefined if availability + information is not available. + */ + availability: TileAvailability; + /** + * Requests the geometry for a given tile. This function should not be called before + {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain + data and indicates that all child tiles are available. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the requested geometry. If this method + returns undefined instead of a promise, it is an indication that too many requests are already + pending and the request will be retried later. + */ + requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined; + /** + * Gets the maximum geometric error allowed in a tile at a given level. + * @param level - The tile level for which to get the maximum geometric error. + * @returns The maximum geometric error. + */ + getLevelMaximumGeometricError(level: number): number; + /** + * Determines whether data for a tile is available to be loaded. + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if not supported, otherwise true or false. + */ + getTileDataAvailable(x: number, y: number, level: number): boolean; + /** + * Makes sure we load availability data for a tile + * @param x - The X coordinate of the tile for which to request geometry. + * @param y - The Y coordinate of the tile for which to request geometry. + * @param level - The level of the tile for which to request geometry. + * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded + */ + loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>; +} + +/** + * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points, +which extrude down to the ground. Optionally, they can extrude downwards to a specified height. + * @example + * // create a wall that spans from ground level to 10000 meters +var wall = new Cesium.WallGeometry({ + positions : Cesium.Cartesian3.fromDegreesArrayHeights([ + 19.0, 47.0, 10000.0, + 19.0, 48.0, 10000.0, + 20.0, 48.0, 10000.0, + 20.0, 47.0, 10000.0, + 19.0, 47.0, 10000.0 + ]) +}); +var geometry = Cesium.WallGeometry.createGeometry(wall); + * @param options - Object with the following properties: + * @param options.positions - An array of Cartesian objects, which are the points of the wall. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the + wall at <code>positions</code>. If undefined, the height of each position in used. + * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the + wall at <code>positions</code>. If undefined, the height at each position is 0.0. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ +export class WallGeometry { + constructor(options: { + positions: Cartesian3[] + granularity?: number + maximumHeights?: number[] + minimumHeights?: number[] + ellipsoid?: Ellipsoid + vertexFormat?: VertexFormat + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: WallGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new WallGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry; + /** + * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points, + which extrude down to the ground. Optionally, they can extrude downwards to a specified height. + * @example + * // create a wall that spans from 10000 meters to 20000 meters + var wall = Cesium.WallGeometry.fromConstantHeights({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 19.0, 47.0, + 19.0, 48.0, + 20.0, 48.0, + 20.0, 47.0, + 19.0, 47.0, + ]), + minimumHeight : 20000.0, + maximumHeight : 10000.0 + }); + var geometry = Cesium.WallGeometry.createGeometry(wall); + * @param options - Object with the following properties: + * @param options.positions - An array of Cartesian objects, which are the points of the wall. + * @param [options.maximumHeight] - A constant that defines the maximum height of the + wall at <code>positions</code>. If undefined, the height of each position in used. + * @param [options.minimumHeight] - A constant that defines the minimum height of the + wall at <code>positions</code>. If undefined, the height at each position is 0.0. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation + * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed. + */ + static fromConstantHeights(options: { + positions: Cartesian3[] + maximumHeight?: number + minimumHeight?: number + ellipsoid?: Ellipsoid + vertexFormat?: VertexFormat + }): WallGeometry; + /** + * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere. + * @param wallGeometry - A description of the wall. + * @returns The computed vertices and indices. + */ + static createGeometry(wallGeometry: WallGeometry): Geometry | undefined; +} + +/** + * A description of a wall outline. A wall is defined by a series of points, +which extrude down to the ground. Optionally, they can extrude downwards to a specified height. + * @example + * // create a wall outline that spans from ground level to 10000 meters +var wall = new Cesium.WallOutlineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArrayHeights([ + 19.0, 47.0, 10000.0, + 19.0, 48.0, 10000.0, + 20.0, 48.0, 10000.0, + 20.0, 47.0, 10000.0, + 19.0, 47.0, 10000.0 + ]) +}); +var geometry = Cesium.WallOutlineGeometry.createGeometry(wall); + * @param options - Object with the following properties: + * @param options.positions - An array of Cartesian objects, which are the points of the wall. + * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the + wall at <code>positions</code>. If undefined, the height of each position in used. + * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the + wall at <code>positions</code>. If undefined, the height at each position is 0.0. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation + */ +export class WallOutlineGeometry { + constructor(options: { + positions: Cartesian3[] + granularity?: number + maximumHeights?: number[] + minimumHeights?: number[] + ellipsoid?: Ellipsoid + }); + /** + * The number of elements used to pack the object into an array. + */ + packedLength: number; + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + static pack(value: WallOutlineGeometry, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new WallOutlineGeometry instance if one was not provided. + */ + static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry; + /** + * A description of a walloutline. A wall is defined by a series of points, + which extrude down to the ground. Optionally, they can extrude downwards to a specified height. + * @example + * // create a wall that spans from 10000 meters to 20000 meters + var wall = Cesium.WallOutlineGeometry.fromConstantHeights({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 19.0, 47.0, + 19.0, 48.0, + 20.0, 48.0, + 20.0, 47.0, + 19.0, 47.0, + ]), + minimumHeight : 20000.0, + maximumHeight : 10000.0 + }); + var geometry = Cesium.WallOutlineGeometry.createGeometry(wall); + * @param options - Object with the following properties: + * @param options.positions - An array of Cartesian objects, which are the points of the wall. + * @param [options.maximumHeight] - A constant that defines the maximum height of the + wall at <code>positions</code>. If undefined, the height of each position in used. + * @param [options.minimumHeight] - A constant that defines the minimum height of the + wall at <code>positions</code>. If undefined, the height at each position is 0.0. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation + */ + static fromConstantHeights(options: { + positions: Cartesian3[] + maximumHeight?: number + minimumHeight?: number + ellipsoid?: Ellipsoid + }): WallOutlineGeometry; + /** + * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere. + * @param wallGeometry - A description of the wall outline. + * @returns The computed vertices and indices. + */ + static createGeometry(wallGeometry: WallOutlineGeometry): Geometry | undefined; +} + +/** + * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This +projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using +the spherical (rather than ellipsoidal) equations. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid. + */ +export class WebMercatorProjection { + constructor(ellipsoid?: Ellipsoid); + /** + * Gets the {@link Ellipsoid}. + */ + readonly ellipsoid: Ellipsoid; + /** + * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude + in the range -PI/2 to PI/2. + * @param mercatorAngle - The angle to convert. + * @returns The geodetic latitude in radians. + */ + static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number; + /** + * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator + angle in the range -PI to PI. + * @param latitude - The geodetic latitude in radians. + * @returns The Mercator angle. + */ + static geodeticLatitudeToMercatorAngle(latitude: number): number; + /** + * The maximum latitude (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 + to cut it off sooner because it grows exponentially with increasing latitude. + The logic behind this particular cutoff value, which is the one used by + Google Maps, Bing Maps, and Esri, is that it makes the projection + square. That is, the rectangle is equal in the X and Y directions. + + The constant value is computed by calling: + WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI) + */ + static MaximumLatitude: number; + /** + * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator + X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height + is copied unmodified to the Z coordinate. + * @param cartographic - The cartographic coordinates in radians. + * @param [result] - The instance to which to copy the result, or undefined if a + new instance should be created. + * @returns The equivalent web mercator X, Y, Z coordinates, in meters. + */ + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + /** + * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic} + containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the + height. + * @param cartesian - The web mercator Cartesian position to unrproject with height (z) in meters. + * @param [result] - The instance to which to copy the result, or undefined if a + new instance should be created. + * @returns The equivalent cartographic coordinates. + */ + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; +} + +/** + * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is +the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online. + * @param [options] - Object with the following properties: + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to +the WGS84 ellipsoid. + * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of + the tile tree. + * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of + the tile tree. + * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the + tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire + globe is covered in the longitude direction and an equal distance is covered in the latitude + direction, resulting in a square projection. + * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the + tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire + globe is covered in the longitude direction and an equal distance is covered in the latitude + direction, resulting in a square projection. + */ +export class WebMercatorTilingScheme { + constructor(options?: { + ellipsoid?: Ellipsoid + numberOfLevelZeroTilesX?: number + numberOfLevelZeroTilesY?: number + rectangleSouthwestInMeters?: Cartesian2 + rectangleNortheastInMeters?: Cartesian2 + }); + /** + * Gets the ellipsoid that is tiled by this tiling scheme. + */ + ellipsoid: Ellipsoid; + /** + * Gets the rectangle, in radians, covered by this tiling scheme. + */ + rectangle: Rectangle; + /** + * Gets the map projection used by this tiling scheme. + */ + projection: MapProjection; + /** + * Gets the total number of tiles in the X direction at a specified level-of-detail. + * @param level - The level-of-detail. + * @returns The number of tiles in the X direction at the given level. + */ + getNumberOfXTilesAtLevel(level: number): number; + /** + * Gets the total number of tiles in the Y direction at a specified level-of-detail. + * @param level - The level-of-detail. + * @returns The number of tiles in the Y direction at the given level. + */ + getNumberOfYTilesAtLevel(level: number): number; + /** + * Transforms a rectangle specified in geodetic radians to the native coordinate system + of this tiling scheme. + * @param rectangle - The rectangle to transform. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the native rectangle if 'result' + is undefined. + */ + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + /** + * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates + of the tiling scheme. + * @param x - The integer x coordinate of the tile. + * @param y - The integer y coordinate of the tile. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the rectangle + if 'result' is undefined. + */ + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + /** + * Converts tile x, y coordinates and level to a cartographic rectangle in radians. + * @param x - The integer x coordinate of the tile. + * @param y - The integer y coordinate of the tile. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the rectangle + if 'result' is undefined. + */ + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + /** + * Calculates the tile x, y coordinates of the tile containing + a given cartographic position. + * @param position - The position. + * @param level - The tile level-of-detail. Zero is the least detailed. + * @param [result] - The instance to which to copy the result, or undefined if a new instance + should be created. + * @returns The specified 'result', or a new object containing the tile x, y coordinates + if 'result' is undefined. + */ + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; +} + +/** + * A spline that linearly interpolates over an array of weight values used by morph targets. + * @example + * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ]; +var weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets +var spline = new Cesium.WeightSpline({ + times : times, + weights : weights +}); + +var p0 = spline.evaluate(times[0]); + * @param options - Object with the following properties: + * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. + The values are in no way connected to the clock time. They are the parameterization for the curve. + * @param options.weights - The array of floating-point control weights given. The weights are ordered such + that all weights for the targets are given in chronological order and order in which they appear in + the glTF from which the morph targets come. This means for 2 targets, weights = [w(0,0), w(0,1), w(1,0), w(1,1) ...] + where i and j in w(i,j) are the time indices and target indices, respectively. + */ +export class WeightSpline { + constructor(options: { + times: number[] + weights: number[] + }); + /** + * An array of times for the control weights. + */ + readonly times: number[]; + /** + * An array of floating-point array control weights. + */ + readonly weights: number[]; + /** + * Finds an index <code>i</code> in <code>times</code> such that the parameter + <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>. + * @param time - The time. + * @returns The index for the element at the start of the interval. + */ + findTimeInterval(time: number): number; + /** + * Wraps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, wrapped around to the updated animation. + */ + wrapTime(time: number): number; + /** + * Clamps the given time to the period covered by the spline. + * @param time - The time. + * @returns The time, clamped to the animation period. + */ + clampTime(time: number): number; + /** + * Evaluates the curve at a given time. + * @param time - The time at which to evaluate the curve. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance of the point on the curve at the given time. + */ + evaluate(time: number, result?: number[]): number[]; +} + +/** + * Winding order defines the order of vertices for a triangle to be considered front-facing. + */ +export enum WindingOrder { + /** + * Vertices are in clockwise order. + */ + CLOCKWISE = WebGLConstants.CW, + /** + * Vertices are in counter-clockwise order. + */ + COUNTER_CLOCKWISE = WebGLConstants.CCW +} + +/** + * Writes the given text into a new canvas. The canvas will be sized to fit the text. +If text is blank, returns undefined. + * @param text - The text to write. + * @param [options] - Object with the following properties: + * @param [options.font = '10px sans-serif'] - The CSS font to use. + * @param [options.textBaseline = 'bottom'] - The baseline of the text. + * @param [options.fill = true] - Whether to fill the text. + * @param [options.stroke = false] - Whether to stroke the text. + * @param [options.fillColor = Color.WHITE] - The fill color. + * @param [options.strokeColor = Color.BLACK] - The stroke color. + * @param [options.strokeWidth = 1] - The stroke width. + * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas. + * @param [options.padding = 0] - The pixel size of the padding to add around the text. + * @returns A new canvas with the given text drawn into it. The dimensions object + from measureText will also be added to the returned canvas. If text is + blank, returns undefined. + */ +export function writeTextToCanvas(text: string, options?: { + font?: string + textBaseline?: string + fill?: boolean + stroke?: boolean + fillColor?: Color + strokeColor?: Color + strokeWidth?: number + backgroundColor?: Color + padding?: number +}): HTMLCanvasElement | undefined; + +export namespace BillboardGraphics { + /** + * Initialization options for the BillboardGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the billboard. + * @property [image] - A Property specifying the Image, URI, or Canvas to use for the billboard. + * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the image size. + * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset. + * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset. + * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}. + * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. + * @property [color = Color.WHITE] - A Property specifying the tint {@link Color} of the image. + * @property [rotation = 0] - A numeric Property specifying the rotation about the alignedAxis. + * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the unit vector axis of rotation. + * @property [sizeInMeters] - A boolean Property specifying whether this billboard's size should be measured in meters. + * @property [width] - A numeric Property specifying the width of the billboard in pixels, overriding the native size. + * @property [height] - A numeric Property specifying the height of the billboard in pixels, overriding the native size. + * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance from the camera. + * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera. + * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera. + * @property [imageSubRegion] - A Property specifying a {@link BoundingRectangle} that defines a sub-region of the image to use for the billboard, rather than the entire image, measured in pixels from the bottom-left. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this billboard will be displayed. + * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to. + */ + type ConstructorOptions = { + show?: Property | boolean + image?: Property | string | HTMLCanvasElement + scale?: Property | number + pixelOffset?: Property | Cartesian2 + eyeOffset?: Property | Cartesian3 + horizontalOrigin?: Property | HorizontalOrigin + verticalOrigin?: Property | VerticalOrigin + heightReference?: Property | HeightReference + color?: Property | Color + rotation?: Property | number + alignedAxis?: Property | Cartesian3 + sizeInMeters?: Property | boolean + width?: Property | number + height?: Property | number + scaleByDistance?: Property | NearFarScalar + translucencyByDistance?: Property | NearFarScalar + pixelOffsetScaleByDistance?: Property | NearFarScalar + imageSubRegion?: Property | BoundingRectangle + distanceDisplayCondition?: Property | DistanceDisplayCondition + disableDepthTestDistance?: Property | number + }; +} + +/** + * Describes a two dimensional icon located at the position of the containing {@link Entity}. +<p> +<div align='center'> +<img src='Images/Billboard.png' width='400' height='300' /><br /> +Example billboards +</div> +</p> + * @param [options] - Object describing initialization options + */ +export class BillboardGraphics { + constructor(options?: BillboardGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the billboard. + */ + show: Property | undefined; + /** + * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard. + */ + image: Property | undefined; + /** + * Gets or sets the numeric Property specifying the uniform scale to apply to the image. + A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it. + <p> + <div align='center'> + <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/> + From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>. + </div> + </p> + */ + scale: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space + from the origin of this billboard. This is commonly used to align multiple billboards and labels at + the same position, e.g., an image and text. The screen space origin is the top, left corner of the + canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom. + <p> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td> + <td align='center'><code>b.pixeloffset = new Cartesian2(50, 25);</code><br/><img src='Images/Billboard.setPixelOffset.x50y-25.png' width='250' height='188' /></td> + </tr></table> + The billboard's origin is indicated by the yellow point. + </div> + </p> + */ + pixelOffset: Property | undefined; + /** + * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates. + Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's + right, <code>y</code> points up, and <code>z</code> points into the screen. + <p> + An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to + arrange a billboard above its corresponding 3D model. + </p> + Below, the billboard is positioned at the center of the Earth but an eye offset makes it always + appear on top of the Earth regardless of the viewer's or Earth's orientation. + <p> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td> + <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td> + </tr></table> + <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code> + </div> + </p> + */ + eyeOffset: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HorizontalOrigin}. + */ + horizontalOrigin: Property | undefined; + /** + * Gets or sets the Property specifying the {@link VerticalOrigin}. + */ + verticalOrigin: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>. + This has two common use cases. First, the same white texture may be used by many different billboards, + each with a different color, to create colored billboards. Second, the color's alpha component can be + used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard + transparent, and <code>1.0</code> makes the billboard opaque. + <p> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td> + <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td> + </tr></table> + </div> + </p> + */ + color: Property | undefined; + /** + * Gets or sets the numeric Property specifying the rotation of the image + counter clockwise from the <code>alignedAxis</code>. + */ + rotation: Property | undefined; + /** + * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation + in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen. + */ + alignedAxis: Property | undefined; + /** + * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters. + */ + sizeInMeters: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the billboard in pixels. + When undefined, the native width is used. + */ + width: Property | undefined; + /** + * Gets or sets the numeric Property specifying the height of the billboard in pixels. + When undefined, the native height is used. + */ + height: Property | undefined; + /** + * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera. + A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's scale remains clamped to the nearest bound. + */ + scaleByDistance: Property | undefined; + /** + * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera. + A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's translucency remains clamped to the nearest bound. + */ + translucencyByDistance: Property | undefined; + /** + * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera. + A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound. + */ + pixelOffsetScaleByDistance: Property | undefined; + /** + * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a + sub-region of the <code>image</code> to use for the billboard, rather than the entire image, + measured in pixels from the bottom-left. + */ + imageSubRegion: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + */ + disableDepthTestDistance: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: BillboardGraphics): BillboardGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: BillboardGraphics): void; +} + +/** + * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}. + * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities. + * @param entityCollection - The entityCollection to visualize. + */ +export class BillboardVisualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + /** + * Updates the primitives created by this visualizer to match their + Entity counterpart at the given time. + * @param time - The time to update to. + * @returns This function always returns true. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes and destroys all primitives created by this instance. + */ + destroy(): void; +} + +/** + * A {@link GeometryUpdater} for boxes. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class BoxGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; +} + +export namespace BoxGraphics { + /** + * Initialization options for the BoxGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the box. + * @property [dimensions] - A {@link Cartesian3} Property specifying the length, width, and height of the box. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to. + * @property [fill = true] - A boolean Property specifying whether the box is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the box. + * @property [outline = false] - A boolean Property specifying whether the box is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the box casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this box will be displayed. + */ + type ConstructorOptions = { + show?: Property | boolean + dimensions?: Property | Cartesian3 + heightReference?: Property | HeightReference + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + }; +} + +/** + * Describes a box. The center position and orientation are determined by the containing {@link Entity}. + * @param [options] - Object describing initialization options + */ +export class BoxGraphics { + constructor(options?: BoxGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the box. + */ + show: Property | undefined; + /** + * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box. + */ + dimensions: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the box is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the material used to fill the box. + */ + material: MaterialProperty | undefined; + /** + * Gets or sets the Property specifying whether the box is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Get or sets the enum Property specifying whether the box + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: BoxGraphics): BoxGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: BoxGraphics): void; +} + +/** + * A {@link Property} whose value is lazily evaluated by a callback function. + * @param callback - The function to be called when the property is evaluated. + * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change. + */ +export class CallbackProperty { + constructor(callback: CallbackProperty.Callback, isConstant: boolean); + /** + * Gets a value indicating if this property is constant. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever setCallback is called. + */ + readonly definitionChanged: Event; + /** + * Gets the value of the property. + * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied or is unsupported. + */ + getValue(time?: JulianDate, result?: any): any; + /** + * Sets the callback to be used. + * @param callback - The function to be called when the property is evaluated. + * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change. + */ + setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +export namespace CallbackProperty { + /** + * A function that returns the value of the property. + * @param [time] - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + */ + type Callback = (time?: JulianDate, result?: any) => any; +} + +export namespace Cesium3DTilesetGraphics { + /** + * Initialization options for the Cesium3DTilesetGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the tileset. + * @property [uri] - A string or Resource Property specifying the URI of the tileset. + * @property [maximumScreenSpaceError] - A number or Property specifying the maximum screen space error used to drive level of detail refinement. + */ + type ConstructorOptions = { + show?: Property | boolean + uri?: Property | string | Resource + maximumScreenSpaceError?: Property | number + }; +} + +/** + * A 3D Tiles tileset represented by an {@link Entity}. +The tileset modelMatrix is determined by the containing Entity position and orientation +or is left unset if position is undefined. + * @param [options] - Object describing initialization options + */ +export class Cesium3DTilesetGraphics { + constructor(options?: Cesium3DTilesetGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the model. + */ + show: Property | undefined; + /** + * Gets or sets the string Property specifying the URI of the glTF asset. + */ + uri: Property | undefined; + /** + * Gets or sets the maximum screen space error used to drive level of detail refinement. + */ + maximumScreenSpaceError: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: Cesium3DTilesetGraphics): Cesium3DTilesetGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: Cesium3DTilesetGraphics): void; +} + +/** + * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}. + * @param scene - The scene the primitives will be rendered in. + * @param entityCollection - The entityCollection to visualize. + */ +export class Cesium3DTilesetVisualizer { + constructor(scene: Scene, entityCollection: EntityCollection); + /** + * Updates models created this visualizer to match their + Entity counterpart at the given time. + * @param time - The time to update to. + * @returns This function always returns true. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes and destroys all primitives created by this instance. + */ + destroy(): void; +} + +/** + * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms. + * @param [options] - Object with the following properties: + * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}. + * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}. + * @param [options.repeat = new Cartesian2(2.0, 2.0)] - A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction. + */ +export class CheckerboardMaterialProperty { + constructor(options?: { + evenColor?: Property | Color + oddColor?: Property | Color + repeat?: Property | Cartesian2 + }); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the Property specifying the first {@link Color}. + */ + evenColor: Property | undefined; + /** + * Gets or sets the Property specifying the second {@link Color}. + */ + oddColor: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction. + */ + repeat: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms. + * @param [color = Color.WHITE] - The {@link Color} Property to be used. + */ +export class ColorMaterialProperty { + constructor(color?: Property | Color); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the {@link Color} {@link Property}. + */ + color: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * Non-destructively composites multiple {@link EntityCollection} instances into a single collection. +If a Entity with the same ID exists in multiple collections, it is non-destructively +merged into a single new entity instance. If an entity has the same property in multiple +collections, the property of the Entity in the last collection of the list it +belongs to is used. CompositeEntityCollection can be used almost anywhere that a +EntityCollection is used. + * @param [collections] - The initial list of EntityCollection instances to merge. + * @param [owner] - The data source (or composite entity collection) which created this collection. + */ +export class CompositeEntityCollection { + constructor(collections?: EntityCollection[], owner?: DataSource | CompositeEntityCollection); + /** + * Gets the event that is fired when entities are added or removed from the collection. + The generated event is a {@link EntityCollection.collectionChangedEventCallback}. + */ + readonly collectionChanged: Event; + /** + * Gets a globally unique identifier for this collection. + */ + readonly id: string; + /** + * Gets the array of Entity instances in the collection. + This array should not be modified directly. + */ + readonly values: Entity[]; + /** + * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it. + */ + readonly owner: DataSource | CompositeEntityCollection; + /** + * Adds a collection to the composite. + * @param collection - the collection to add. + * @param [index] - the index to add the collection at. If omitted, the collection will + added on top of all existing collections. + */ + addCollection(collection: EntityCollection, index?: number): void; + /** + * Removes a collection from this composite, if present. + * @param collection - The collection to remove. + * @returns true if the collection was in the composite and was removed, + false if the collection was not in the composite. + */ + removeCollection(collection: EntityCollection): boolean; + /** + * Removes all collections from this composite. + */ + removeAllCollections(): void; + /** + * Checks to see if the composite contains a given collection. + * @param collection - the collection to check for. + * @returns true if the composite contains the collection, false otherwise. + */ + containsCollection(collection: EntityCollection): boolean; + /** + * Returns true if the provided entity is in this collection, false otherwise. + * @param entity - The entity. + * @returns true if the provided entity is in this collection, false otherwise. + */ + contains(entity: Entity): boolean; + /** + * Determines the index of a given collection in the composite. + * @param collection - The collection to find the index of. + * @returns The index of the collection in the composite, or -1 if the collection does not exist in the composite. + */ + indexOfCollection(collection: EntityCollection): number; + /** + * Gets a collection by index from the composite. + * @param index - the index to retrieve. + */ + getCollection(index: number): void; + /** + * Gets the number of collections in this composite. + */ + getCollectionsLength(): void; + /** + * Raises a collection up one position in the composite. + * @param collection - the collection to move. + */ + raiseCollection(collection: EntityCollection): void; + /** + * Lowers a collection down one position in the composite. + * @param collection - the collection to move. + */ + lowerCollection(collection: EntityCollection): void; + /** + * Raises a collection to the top of the composite. + * @param collection - the collection to move. + */ + raiseCollectionToTop(collection: EntityCollection): void; + /** + * Lowers a collection to the bottom of the composite. + * @param collection - the collection to move. + */ + lowerCollectionToBottom(collection: EntityCollection): void; + /** + * Prevents {@link EntityCollection#collectionChanged} events from being raised + until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which + point a single event will be raised that covers all suspended operations. + This allows for many items to be added and removed efficiently. + While events are suspended, recompositing of the collections will + also be suspended, as this can be a costly operation. + This function can be safely called multiple times as long as there + are corresponding calls to {@link EntityCollection#resumeEvents}. + */ + suspendEvents(): void; + /** + * Resumes raising {@link EntityCollection#collectionChanged} events immediately + when an item is added or removed. Any modifications made while while events were suspended + will be triggered as a single event when this function is called. This function also ensures + the collection is recomposited if events are also resumed. + This function is reference counted and can safely be called multiple times as long as there + are corresponding calls to {@link EntityCollection#resumeEvents}. + */ + resumeEvents(): void; + /** + * Computes the maximum availability of the entities in the collection. + If the collection contains a mix of infinitely available data and non-infinite data, + It will return the interval pertaining to the non-infinite data only. If all + data is infinite, an infinite interval will be returned. + * @returns The availability of entities in the collection. + */ + computeAvailability(): TimeInterval; + /** + * Gets an entity with the specified id. + * @param id - The id of the entity to retrieve. + * @returns The entity with the provided id or undefined if the id did not exist in the collection. + */ + getById(id: string): Entity | undefined; +} + +/** + * A {@link CompositeProperty} which is also a {@link MaterialProperty}. + */ +export class CompositeMaterialProperty { + constructor(); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever setValue is called with data different + than the current value. + */ + readonly definitionChanged: Event; + /** + * Gets the interval collection. + */ + intervals: TimeIntervalCollection; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link CompositeProperty} which is also a {@link PositionProperty}. + * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. + */ +export class CompositePositionProperty { + constructor(referenceFrame?: ReferenceFrame); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever setValue is called with data different + than the current value. + */ + readonly definitionChanged: Event; + /** + * Gets the interval collection. + */ + intervals: TimeIntervalCollection; + /** + * Gets or sets the reference frame which this position presents itself as. + Each PositionProperty making up this object has it's own reference frame, + so this property merely exposes a "preferred" reference frame for clients + to use. + */ + referenceFrame: ReferenceFrame; + /** + * Gets the value of the property at the provided time in the fixed frame. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Gets the value of the property at the provided time and in the provided reference frame. + * @param time - The time for which to retrieve the value. + * @param referenceFrame - The desired referenceFrame of the result. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the +data property of each {@link TimeInterval} is another Property instance which is +evaluated at the provided time. + * @example + * var constantProperty = ...; +var sampledProperty = ...; + +//Create a composite property from two previously defined properties +//where the property is valid on August 1st, 2012 and uses a constant +//property for the first half of the day and a sampled property for the +//remaining half. +var composite = new Cesium.CompositeProperty(); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z', + data : constantProperty +})); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z', + isStartIncluded : false, + isStopIncluded : false, + data : sampledProperty +})); + */ +export class CompositeProperty { + constructor(); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever setValue is called with data different + than the current value. + */ + readonly definitionChanged: Event; + /** + * Gets the interval collection. + */ + intervals: TimeIntervalCollection; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link PositionProperty} whose value does not change in respect to the +{@link ReferenceFrame} in which is it defined. + * @param [value] - The property value. + * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. + */ +export class ConstantPositionProperty { + constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets the reference frame in which the position is defined. + */ + referenceFrame: ReferenceFrame; + /** + * Gets the value of the property at the provided time in the fixed frame. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Sets the value of the property. + * @param value - The property value. + * @param [referenceFrame = this.referenceFrame] - The reference frame in which the position is defined. + */ + setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void; + /** + * Gets the value of the property at the provided time and in the provided reference frame. + * @param time - The time for which to retrieve the value. + * @param referenceFrame - The desired referenceFrame of the result. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link Property} whose value does not change with respect to simulation time. + * @param [value] - The property value. + */ +export class ConstantProperty { + constructor(value?: any); + /** + * Gets a value indicating if this property is constant. + This property always returns <code>true</code>. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever setValue is called with data different + than the current value. + */ + readonly definitionChanged: Event; + /** + * Gets the value of the property. + * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time?: JulianDate, result?: any): any; + /** + * Sets the value of the property. + * @param value - The property value. + */ + setValue(value: any): void; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; + /** + * Gets this property's value. + * @returns This property's value. + */ + valueOf(): any; + /** + * Creates a string representing this property's value. + * @returns A string representing the property's value. + */ + toString(): string; +} + +/** + * A {@link GeometryUpdater} for corridors. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class CorridorGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; +} + +export namespace CorridorGraphics { + /** + * Initialization options for the CorridorGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the corridor. + * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor. + * @property [width] - A numeric Property specifying the distance between the edges of the corridor. + * @property [height = 0] - A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. + * @property [extrudedHeight] - A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface. + * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to. + * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners. + * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the distance between each latitude and longitude. + * @property [fill = true] - A boolean Property specifying whether the corridor is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the corridor. + * @property [outline = false] - A boolean Property specifying whether the corridor is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the corridor casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this corridor will be displayed. + * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground. + * @property [zIndex] - A Property specifying the zIndex of the corridor, used for ordering. Only has an effect if height and extrudedHeight are undefined, and if the corridor is static. + */ + type ConstructorOptions = { + show?: Property | boolean + positions?: Property | Cartesian3 + width?: Property | number + height?: Property | number + heightReference?: Property | HeightReference + extrudedHeight?: Property | number + extrudedHeightReference?: Property | HeightReference + cornerType?: Property | CornerType + granularity?: Property | number + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + classificationType?: Property | ClassificationType + zIndex?: ConstantProperty | number + }; +} + +/** + * Describes a corridor, which is a shape defined by a centerline and width that +conforms to the curvature of the globe. It can be placed on the surface or at altitude +and can optionally be extruded into a volume. + * @param [options] - Object describing initialization options + */ +export class CorridorGraphics { + constructor(options?: CorridorGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the corridor. + */ + show: Property | undefined; + /** + * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor. + */ + positions: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the corridor. + */ + width: Property | undefined; + /** + * Gets or sets the numeric Property specifying the altitude of the corridor. + */ + height: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the numeric Property specifying the altitude of the corridor extrusion. + Setting this property creates a corridor shaped volume starting at height and ending + at this altitude. + */ + extrudedHeight: Property | undefined; + /** + * Gets or sets the Property specifying the extruded {@link HeightReference}. + */ + extrudedHeightReference: Property | undefined; + /** + * Gets or sets the {@link CornerType} Property specifying how corners are styled. + */ + cornerType: Property | undefined; + /** + * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point. + */ + granularity: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the Property specifying the material used to fill the corridor. + */ + material: MaterialProperty | undefined; + /** + * Gets or sets the Property specifying whether the corridor is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Get or sets the enum Property specifying whether the corridor + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground. + */ + classificationType: Property | undefined; + /** + * Gets or sets the zIndex Property specifying the ordering of the corridor. Only has an effect if the coridor is static and neither height or exturdedHeight are specified. + */ + zIndex: ConstantProperty | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: CorridorGraphics): CorridorGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: CorridorGraphics): void; +} + +/** + * A {@link DataSource} implementation which can be used to manually manage a group of entities. + * @example + * var dataSource = new Cesium.CustomDataSource('myData'); + +var entity = dataSource.entities.add({ + position : Cesium.Cartesian3.fromDegrees(1, 2, 0), + billboard : { + image : 'image.png' + } +}); + +viewer.dataSources.add(dataSource); + * @param [name] - A human-readable name for this instance. + */ +export class CustomDataSource { + constructor(name?: string); + /** + * Gets or sets a human-readable name for this instance. + */ + name: string; + /** + * Gets or sets the clock for this instance. + */ + clock: DataSourceClock; + /** + * Gets the collection of {@link Entity} instances. + */ + entities: EntityCollection; + /** + * Gets or sets whether the data source is currently loading data. + */ + isLoading: boolean; + /** + * Gets an event that will be raised when the underlying data changes. + */ + changedEvent: Event; + /** + * Gets an event that will be raised if an error is encountered during processing. + */ + errorEvent: Event; + /** + * Gets an event that will be raised when the data source either starts or stops loading. + */ + loadingEvent: Event; + /** + * Gets whether or not this data source should be displayed. + */ + show: boolean; + /** + * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. + */ + clustering: EntityCluster; + /** + * Updates the data source to the provided time. This function is optional and + is not required to be implemented. It is provided for data sources which + retrieve data based on the current animation time or scene state. + If implemented, update will be called by {@link DataSourceDisplay} once a frame. + * @param time - The simulation time. + * @returns True if this data source is ready to be displayed at the provided time, false otherwise. + */ + update(time: JulianDate): boolean; +} + +/** + * A {@link GeometryUpdater} for cylinders. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class CylinderGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; +} + +export namespace CylinderGraphics { + /** + * Initialization options for the CylinderGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the cylinder. + * @property [length] - A numeric Property specifying the length of the cylinder. + * @property [topRadius] - A numeric Property specifying the radius of the top of the cylinder. + * @property [bottomRadius] - A numeric Property specifying the radius of the bottom of the cylinder. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to. + * @property [fill = true] - A boolean Property specifying whether the cylinder is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the cylinder. + * @property [outline = false] - A boolean Property specifying whether the cylinder is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. + * @property [slices = 128] - The number of edges around the perimeter of the cylinder. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the cylinder casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this cylinder will be displayed. + */ + type ConstructorOptions = { + show?: Property | boolean + length?: Property | number + topRadius?: Property | number + bottomRadius?: Property | number + heightReference?: Property | HeightReference + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + numberOfVerticalLines?: Property | number + slices?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + }; +} + +/** + * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius. +The center position and orientation are determined by the containing {@link Entity}. + * @param [options] - Object describing initialization options + */ +export class CylinderGraphics { + constructor(options?: CylinderGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the cylinder. + */ + show: Property | undefined; + /** + * Gets or sets the numeric Property specifying the length of the cylinder. + */ + length: Property | undefined; + /** + * Gets or sets the numeric Property specifying the radius of the top of the cylinder. + */ + topRadius: Property | undefined; + /** + * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder. + */ + bottomRadius: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the Property specifying the material used to fill the cylinder. + */ + material: MaterialProperty | undefined; + /** + * Gets or sets the boolean Property specifying whether the cylinder is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline. + */ + numberOfVerticalLines: Property | undefined; + /** + * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder. + */ + slices: Property | undefined; + /** + * Get or sets the enum Property specifying whether the cylinder + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: CylinderGraphics): CylinderGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: CylinderGraphics): void; +} + +export namespace CzmlDataSource { + /** + * Initialization options for the `load` method. + * @property [sourceUri] - Overrides the url to use for resolving relative links. + * @property [credit] - A credit for the data source, which is displayed on the canvas. + */ + type LoadOptions = { + sourceUri?: Resource | string + credit?: Credit | string + }; +} + +/** + * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}. + * @param [name] - An optional name for the data source. This value will be overwritten if a loaded document contains a name. + */ +export class CzmlDataSource { + constructor(name?: string); + /** + * Creates a Promise to a new instance loaded with the provided CZML data. + * @param czml - A url or CZML object to be processed. + * @param [options] - An object specifying configuration options + * @returns A promise that resolves to the new instance once the data is processed. + */ + static load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>; + /** + * Gets a human-readable name for this instance. + */ + name: string; + /** + * Gets the clock settings defined by the loaded CZML. If no clock is explicitly + defined in the CZML, the combined availability of all objects is returned. If + only static data exists, this value is undefined. + */ + clock: DataSourceClock; + /** + * Gets the collection of {@link Entity} instances. + */ + entities: EntityCollection; + /** + * Gets a value indicating if the data source is currently loading data. + */ + isLoading: boolean; + /** + * Gets an event that will be raised when the underlying data changes. + */ + changedEvent: Event; + /** + * Gets an event that will be raised if an error is encountered during processing. + */ + errorEvent: Event; + /** + * Gets an event that will be raised when the data source either starts or stops loading. + */ + loadingEvent: Event; + /** + * Gets whether or not this data source should be displayed. + */ + show: boolean; + /** + * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. + */ + clustering: EntityCluster; + /** + * Gets the credit that will be displayed for the data source + */ + credit: Credit; + /** + * Gets the array of CZML processing functions. + */ + static updaters: any[]; + /** + * Processes the provided url or CZML object without clearing any existing data. + * @param czml - A url or CZML object to be processed. + * @param [options] - An object with the following properties: + * @param [options.sourceUri] - Overrides the url to use for resolving relative links. + * @returns A promise that resolves to this instances once the data is processed. + */ + process(czml: Resource | string | any, options?: { + sourceUri?: string + }): Promise<CzmlDataSource>; + /** + * Loads the provided url or CZML object, replacing any existing data. + * @param czml - A url or CZML object to be processed. + * @param [options] - An object specifying configuration options + * @returns A promise that resolves to this instances once the data is processed. + */ + load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>; + /** + * Updates the data source to the provided time. This function is optional and + is not required to be implemented. It is provided for data sources which + retrieve data based on the current animation time or scene state. + If implemented, update will be called by {@link DataSourceDisplay} once a frame. + * @param time - The simulation time. + * @returns True if this data source is ready to be displayed at the provided time, false otherwise. + */ + update(time: JulianDate): boolean; + /** + * A helper function used by custom CZML updater functions + which creates or updates a {@link Property} from a CZML packet. + * @param type - The constructor function for the property being processed. + * @param object - The object on which the property will be added or updated. + * @param propertyName - The name of the property on the object. + * @param packetData - The CZML packet being processed. + * @param interval - A constraining interval for which the data is valid. + * @param sourceUri - The originating uri of the data being processed. + * @param entityCollection - The collection being processsed. + */ + static processPacketData(type: (...params: any[]) => any, object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; + /** + * A helper function used by custom CZML updater functions + which creates or updates a {@link PositionProperty} from a CZML packet. + * @param object - The object on which the property will be added or updated. + * @param propertyName - The name of the property on the object. + * @param packetData - The CZML packet being processed. + * @param interval - A constraining interval for which the data is valid. + * @param sourceUri - The originating uri of the data being processed. + * @param entityCollection - The collection being processsed. + */ + static processPositionPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; + /** + * A helper function used by custom CZML updater functions + which creates or updates a {@link MaterialProperty} from a CZML packet. + * @param object - The object on which the property will be added or updated. + * @param propertyName - The name of the property on the object. + * @param packetData - The CZML packet being processed. + * @param interval - A constraining interval for which the data is valid. + * @param sourceUri - The originating uri of the data being processed. + * @param entityCollection - The collection being processsed. + */ + static processMaterialPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; +} + +/** + * Defines the interface for data sources, which turn arbitrary data into a +{@link EntityCollection} for generic consumption. This object is an interface +for documentation purposes and is not intended to be instantiated directly. + */ +export class DataSource { + constructor(); + /** + * Gets a human-readable name for this instance. + */ + name: string; + /** + * Gets the preferred clock settings for this data source. + */ + clock: DataSourceClock; + /** + * Gets the collection of {@link Entity} instances. + */ + entities: EntityCollection; + /** + * Gets a value indicating if the data source is currently loading data. + */ + isLoading: boolean; + /** + * Gets an event that will be raised when the underlying data changes. + */ + changedEvent: Event; + /** + * Gets an event that will be raised if an error is encountered during processing. + */ + errorEvent: Event; + /** + * Gets an event that will be raised when the value of isLoading changes. + */ + loadingEvent: Event; + /** + * Gets whether or not this data source should be displayed. + */ + show: boolean; + /** + * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. + */ + clustering: EntityCluster; + /** + * Updates the data source to the provided time. This function is optional and + is not required to be implemented. It is provided for data sources which + retrieve data based on the current animation time or scene state. + If implemented, update will be called by {@link DataSourceDisplay} once a frame. + * @param time - The simulation time. + * @returns True if this data source is ready to be displayed at the provided time, false otherwise. + */ + update(time: JulianDate): boolean; +} + +/** + * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied +to the {@link Clock} when the DataSource is loaded. + */ +export class DataSourceClock { + constructor(); + /** + * Gets the event that is raised whenever a new property is assigned. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the desired start time of the clock. + See {@link Clock#startTime}. + */ + startTime: JulianDate; + /** + * Gets or sets the desired stop time of the clock. + See {@link Clock#stopTime}. + */ + stopTime: JulianDate; + /** + * Gets or sets the desired current time when this data source is loaded. + See {@link Clock#currentTime}. + */ + currentTime: JulianDate; + /** + * Gets or sets the desired clock range setting. + See {@link Clock#clockRange}. + */ + clockRange: ClockRange; + /** + * Gets or sets the desired clock step setting. + See {@link Clock#clockStep}. + */ + clockStep: ClockStep; + /** + * Gets or sets the desired clock multiplier. + See {@link Clock#multiplier}. + */ + multiplier: number; + /** + * Duplicates a DataSourceClock instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: DataSourceClock): DataSourceClock; + /** + * Returns true if this DataSourceClock is equivalent to the other + * @param other - The other DataSourceClock to compare to. + * @returns <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>. + */ + equals(other: DataSourceClock): boolean; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: DataSourceClock): void; + /** + * Gets the value of this clock instance as a {@link Clock} object. + * @returns The modified result parameter or a new instance if one was not provided. + */ + getValue(): Clock; +} + +/** + * A collection of {@link DataSource} instances. + */ +export class DataSourceCollection { + constructor(); + /** + * Gets the number of data sources in this collection. + */ + readonly length: number; + /** + * An event that is raised when a data source is added to the collection. + Event handlers are passed the data source that was added. + */ + readonly dataSourceAdded: Event; + /** + * An event that is raised when a data source is removed from the collection. + Event handlers are passed the data source that was removed. + */ + readonly dataSourceRemoved: Event; + /** + * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source + that was moved, its new index after the move, and its old index prior to the move. + */ + readonly dataSourceMoved: Event; + /** + * Adds a data source to the collection. + * @param dataSource - A data source or a promise to a data source to add to the collection. + When passing a promise, the data source will not actually be added + to the collection until the promise resolves successfully. + * @returns A Promise that resolves once the data source has been added to the collection. + */ + add(dataSource: DataSource | Promise<DataSource>): Promise<DataSource>; + /** + * Removes a data source from this collection, if present. + * @param dataSource - The data source to remove. + * @param [destroy = false] - Whether to destroy the data source in addition to removing it. + * @returns true if the data source was in the collection and was removed, + false if the data source was not in the collection. + */ + remove(dataSource: DataSource, destroy?: boolean): boolean; + /** + * Removes all data sources from this collection. + * @param [destroy = false] - whether to destroy the data sources in addition to removing them. + */ + removeAll(destroy?: boolean): void; + /** + * Checks to see if the collection contains a given data source. + * @param dataSource - The data source to check for. + * @returns true if the collection contains the data source, false otherwise. + */ + contains(dataSource: DataSource): boolean; + /** + * Determines the index of a given data source in the collection. + * @param dataSource - The data source to find the index of. + * @returns The index of the data source in the collection, or -1 if the data source does not exist in the collection. + */ + indexOf(dataSource: DataSource): number; + /** + * Gets a data source by index from the collection. + * @param index - the index to retrieve. + * @returns The data source at the specified index. + */ + get(index: number): DataSource; + /** + * Gets a data source by name from the collection. + * @param name - The name to retrieve. + * @returns A list of all data sources matching the provided name. + */ + getByName(name: string): DataSource[]; + /** + * Raises a data source up one position in the collection. + * @param dataSource - The data source to move. + */ + raise(dataSource: DataSource): void; + /** + * Lowers a data source down one position in the collection. + * @param dataSource - The data source to move. + */ + lower(dataSource: DataSource): void; + /** + * Raises a data source to the top of the collection. + * @param dataSource - The data source to move. + */ + raiseToTop(dataSource: DataSource): void; + /** + * Lowers a data source to the bottom of the collection. + * @param dataSource - The data source to move. + */ + lowerToBottom(dataSource: DataSource): void; + /** + * Returns true if this object was destroyed; otherwise, false. + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns true if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the resources held by all data sources in this collection. Explicitly destroying this + object allows for deterministic release of WebGL resources, instead of relying on the garbage + collector. Once this object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy(); + */ + destroy(): void; +} + +/** + * Visualizes a collection of {@link DataSource} instances. + * @param options - Object with the following properties: + * @param options.scene - The scene in which to display the data. + * @param options.dataSourceCollection - The data sources to display. + * @param [options.visualizersCallback = DataSourceDisplay.defaultVisualizersCallback] - A function which creates an array of visualizers used for visualization. + If undefined, all standard visualizers are used. + */ +export class DataSourceDisplay { + constructor(options: { + scene: Scene + dataSourceCollection: DataSourceCollection + visualizersCallback?: DataSourceDisplay.VisualizersCallback + }); + /** + * Gets or sets the default function which creates an array of visualizers used for visualization. + By default, this function uses all standard visualizers. + */ + static defaultVisualizersCallback(): void; + /** + * Gets the scene associated with this display. + */ + scene: Scene; + /** + * Gets the collection of data sources to display. + */ + dataSources: DataSourceCollection; + /** + * Gets the default data source instance which can be used to + manually create and visualize entities not tied to + a specific data source. This instance is always available + and does not appear in the list dataSources collection. + */ + defaultDataSource: CustomDataSource; + /** + * Gets a value indicating whether or not all entities in the data source are ready + */ + readonly ready: boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * dataSourceDisplay = dataSourceDisplay.destroy(); + */ + destroy(): void; + /** + * Updates the display to the provided time. + * @param time - The simulation time. + * @returns True if all data sources are ready to be displayed, false otherwise. + */ + update(time: JulianDate): boolean; +} + +export namespace DataSourceDisplay { + /** + * A function which creates an array of visualizers used for visualization. + * @example + * function createVisualizers(scene, dataSource) { + return [new Cesium.BillboardVisualizer(scene, dataSource.entities)]; + } + * @param scene - The scene to create visualizers for. + * @param dataSource - The data source to create visualizers for. + */ + type VisualizersCallback = (scene: Scene, dataSource: DataSource) => Visualizer[]; +} + +/** + * A {@link GeometryUpdater} for ellipses. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class EllipseGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Gets a value indicating if the geometry should be drawn on terrain. + */ + readonly onTerrain: boolean; +} + +export namespace EllipseGraphics { + /** + * Initialization options for the EllipseGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the ellipse. + * @property [semiMajorAxis] - The numeric Property specifying the semi-major axis. + * @property [semiMinorAxis] - The numeric Property specifying the semi-minor axis. + * @property [height = 0] - A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. + * @property [extrudedHeight] - A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface. + * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to. + * @property [rotation = 0.0] - A numeric property specifying the rotation of the ellipse counter-clockwise from north. + * @property [stRotation = 0.0] - A numeric property specifying the rotation of the ellipse texture counter-clockwise from north. + * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the ellipse. + * @property [fill = true] - A boolean Property specifying whether the ellipse is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipse. + * @property [outline = false] - A boolean Property specifying whether the ellipse is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipse casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipse will be displayed. + * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground. + * @property [zIndex = 0] - A property specifying the zIndex of the Ellipse. Used for ordering ground geometry. Only has an effect if the ellipse is constant and neither height or exturdedHeight are specified. + */ + type ConstructorOptions = { + show?: Property | boolean + semiMajorAxis?: Property | number + semiMinorAxis?: Property | number + height?: Property | number + heightReference?: Property | HeightReference + extrudedHeight?: Property | number + extrudedHeightReference?: Property | HeightReference + rotation?: Property | number + stRotation?: Property | number + granularity?: Property | number + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + numberOfVerticalLines?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + classificationType?: Property | ClassificationType + zIndex?: ConstantProperty | number + }; +} + +/** + * Describes an ellipse defined by a center point and semi-major and semi-minor axes. +The ellipse conforms to the curvature of the globe and can be placed on the surface or +at altitude and can optionally be extruded into a volume. +The center point is determined by the containing {@link Entity}. + * @param [options] - Object describing initialization options + */ +export class EllipseGraphics { + constructor(options?: EllipseGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the ellipse. + */ + show: Property | undefined; + /** + * Gets or sets the numeric Property specifying the semi-major axis. + */ + semiMajorAxis: Property | undefined; + /** + * Gets or sets the numeric Property specifying the semi-minor axis. + */ + semiMinorAxis: Property | undefined; + /** + * Gets or sets the numeric Property specifying the altitude of the ellipse. + */ + height: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion. + Setting this property creates volume starting at height and ending at this altitude. + */ + extrudedHeight: Property | undefined; + /** + * Gets or sets the Property specifying the extruded {@link HeightReference}. + */ + extrudedHeightReference: Property | undefined; + /** + * Gets or sets the numeric property specifying the rotation of the ellipse counter-clockwise from north. + */ + rotation: Property | undefined; + /** + * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north. + */ + stRotation: Property | undefined; + /** + * Gets or sets the numeric Property specifying the angular distance between points on the ellipse. + */ + granularity: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the Property specifying the material used to fill the ellipse. + */ + material: MaterialProperty | undefined; + /** + * Gets or sets the Property specifying whether the ellipse is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline. + */ + numberOfVerticalLines: Property | undefined; + /** + * Get or sets the enum Property specifying whether the ellipse + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground. + */ + classificationType: Property | undefined; + /** + * Gets or sets the zIndex Property specifying the ellipse ordering. Only has an effect if the ellipse is constant and neither height or extrudedHeight are specified + */ + zIndex: ConstantProperty | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: EllipseGraphics): EllipseGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: EllipseGraphics): void; +} + +/** + * A {@link GeometryUpdater} for ellipsoids. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class EllipsoidGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance + * @param [modelMatrixResult] - Used to store the result of the model matrix calculation + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance + * @param [modelMatrixResult] - Used to store the result of the model matrix calculation + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance; +} + +export namespace EllipsoidGraphics { + /** + * Initialization options for the EllipsoidGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the ellipsoid. + * @property [radii] - A {@link Cartesian3} Property specifying the radii of the ellipsoid. + * @property [innerRadii] - A {@link Cartesian3} Property specifying the inner radii of the ellipsoid. + * @property [minimumClock = 0.0] - A Property specifying the minimum clock angle of the ellipsoid. + * @property [maximumClock = 2*PI] - A Property specifying the maximum clock angle of the ellipsoid. + * @property [minimumCone = 0.0] - A Property specifying the minimum cone angle of the ellipsoid. + * @property [maximumCone = PI] - A Property specifying the maximum cone angle of the ellipsoid. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to. + * @property [fill = true] - A boolean Property specifying whether the ellipsoid is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipsoid. + * @property [outline = false] - A boolean Property specifying whether the ellipsoid is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [stackPartitions = 64] - A Property specifying the number of stacks. + * @property [slicePartitions = 64] - A Property specifying the number of radial slices. + * @property [subdivisions = 128] - A Property specifying the number of samples per outline ring, determining the granularity of the curvature. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipsoid casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipsoid will be displayed. + */ + type ConstructorOptions = { + show?: Property | boolean + radii?: Property | Cartesian3 + innerRadii?: Property | Cartesian3 + minimumClock?: Property | number + maximumClock?: Property | number + minimumCone?: Property | number + maximumCone?: Property | number + heightReference?: Property | HeightReference + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + stackPartitions?: Property | number + slicePartitions?: Property | number + subdivisions?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + }; +} + +/** + * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}. + * @param [options] - Object describing initialization options + */ +export class EllipsoidGraphics { + constructor(options?: EllipsoidGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the ellipsoid. + */ + show: Property | undefined; + /** + * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid. + */ + radii: Property | undefined; + /** + * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid. + */ + innerRadii: Property | undefined; + /** + * Gets or sets the Property specifying the minimum clock angle of the ellipsoid. + */ + minimumClock: Property | undefined; + /** + * Gets or sets the Property specifying the maximum clock angle of the ellipsoid. + */ + maximumClock: Property | undefined; + /** + * Gets or sets the Property specifying the minimum cone angle of the ellipsoid. + */ + minimumCone: Property | undefined; + /** + * Gets or sets the Property specifying the maximum cone angle of the ellipsoid. + */ + maximumCone: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the Property specifying the material used to fill the ellipsoid. + */ + material: MaterialProperty; + /** + * Gets or sets the Property specifying whether the ellipsoid is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Gets or sets the Property specifying the number of stacks. + */ + stackPartitions: Property | undefined; + /** + * Gets or sets the Property specifying the number of radial slices per 360 degrees. + */ + slicePartitions: Property | undefined; + /** + * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature. + */ + subdivisions: Property | undefined; + /** + * Get or sets the enum Property specifying whether the ellipsoid + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: EllipsoidGraphics): EllipsoidGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: EllipsoidGraphics): void; +} + +export namespace Entity { + /** + * Initialization options for the Entity constructor + * @property [id] - A unique identifier for this object. If none is provided, a GUID is generated. + * @property [name] - A human readable name to display to users. It does not have to be unique. + * @property [availability] - The availability, if any, associated with this object. + * @property [show] - A boolean value indicating if the entity and its children are displayed. + * @property [description] - A string Property specifying an HTML description for this entity. + * @property [position] - A Property specifying the entity position. + * @property [orientation] - A Property specifying the entity orientation. + * @property [viewFrom] - A suggested initial offset for viewing this object. + * @property [parent] - A parent entity to associate with this entity. + * @property [billboard] - A billboard to associate with this entity. + * @property [box] - A box to associate with this entity. + * @property [corridor] - A corridor to associate with this entity. + * @property [cylinder] - A cylinder to associate with this entity. + * @property [ellipse] - A ellipse to associate with this entity. + * @property [ellipsoid] - A ellipsoid to associate with this entity. + * @property [label] - A options.label to associate with this entity. + * @property [model] - A model to associate with this entity. + * @property [tileset] - A 3D Tiles tileset to associate with this entity. + * @property [path] - A path to associate with this entity. + * @property [plane] - A plane to associate with this entity. + * @property [point] - A point to associate with this entity. + * @property [polygon] - A polygon to associate with this entity. + * @property [polyline] - A polyline to associate with this entity. + * @property [properties] - Arbitrary properties to associate with this entity. + * @property [polylineVolume] - A polylineVolume to associate with this entity. + * @property [rectangle] - A rectangle to associate with this entity. + * @property [wall] - A wall to associate with this entity. + */ + type ConstructorOptions = { + id?: string + name?: string + availability?: TimeIntervalCollection + show?: boolean + description?: Property | string + position?: PositionProperty | Cartesian3 + orientation?: Property + viewFrom?: Property + parent?: Entity + billboard?: BillboardGraphics | BillboardGraphics.ConstructorOptions + box?: BoxGraphics | BoxGraphics.ConstructorOptions + corridor?: CorridorGraphics | CorridorGraphics.ConstructorOptions + cylinder?: CylinderGraphics | CylinderGraphics.ConstructorOptions + ellipse?: EllipseGraphics | EllipseGraphics.ConstructorOptions + ellipsoid?: EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions + label?: LabelGraphics | LabelGraphics.ConstructorOptions + model?: ModelGraphics | ModelGraphics.ConstructorOptions + tileset?: Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions + path?: PathGraphics | PathGraphics.ConstructorOptions + plane?: PlaneGraphics | PlaneGraphics.ConstructorOptions + point?: PointGraphics | PointGraphics.ConstructorOptions + polygon?: PolygonGraphics | PolygonGraphics.ConstructorOptions + polyline?: PolylineGraphics | PolylineGraphics.ConstructorOptions + properties?: PropertyBag | { + [key: string]: any + } + polylineVolume?: PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions + rectangle?: RectangleGraphics | RectangleGraphics.ConstructorOptions + wall?: WallGraphics | WallGraphics.ConstructorOptions + }; +} + +/** + * Entity instances aggregate multiple forms of visualization into a single high-level object. +They can be created manually and added to {@link Viewer#entities} or be produced by +data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}. + * @param [options] - Object describing initialization options + */ +export class Entity { + constructor(options?: Entity.ConstructorOptions); + /** + * Gets or sets the entity collection that this entity belongs to. + */ + entityCollection: EntityCollection; + /** + * The availability, if any, associated with this object. + If availability is undefined, it is assumed that this object's + other properties will return valid data for any provided time. + If availability exists, the objects other properties will only + provide valid data if queried within the given interval. + */ + availability: TimeIntervalCollection | undefined; + /** + * Gets the unique ID associated with this object. + */ + id: string; + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the name of the object. The name is intended for end-user + consumption and does not need to be unique. + */ + name: string | undefined; + /** + * Gets or sets whether this entity should be displayed. When set to true, + the entity is only displayed if the parent entity's show property is also true. + */ + show: boolean; + /** + * Gets whether this entity is being displayed, taking into account + the visibility of any ancestor entities. + */ + isShowing: boolean; + /** + * Gets or sets the parent object. + */ + parent: Entity | undefined; + /** + * Gets the names of all properties registered on this instance. + */ + propertyNames: string[]; + /** + * Gets or sets the billboard. + */ + billboard: BillboardGraphics | undefined; + /** + * Gets or sets the box. + */ + box: BoxGraphics | undefined; + /** + * Gets or sets the corridor. + */ + corridor: CorridorGraphics | undefined; + /** + * Gets or sets the cylinder. + */ + cylinder: CylinderGraphics | undefined; + /** + * Gets or sets the description. + */ + description: Property | undefined; + /** + * Gets or sets the ellipse. + */ + ellipse: EllipseGraphics | undefined; + /** + * Gets or sets the ellipsoid. + */ + ellipsoid: EllipsoidGraphics | undefined; + /** + * Gets or sets the label. + */ + label: LabelGraphics | undefined; + /** + * Gets or sets the model. + */ + model: ModelGraphics | undefined; + /** + * Gets or sets the tileset. + */ + tileset: Cesium3DTilesetGraphics | undefined; + /** + * Gets or sets the orientation. + */ + orientation: Property | undefined; + /** + * Gets or sets the path. + */ + path: PathGraphics | undefined; + /** + * Gets or sets the plane. + */ + plane: PlaneGraphics | undefined; + /** + * Gets or sets the point graphic. + */ + point: PointGraphics | undefined; + /** + * Gets or sets the polygon. + */ + polygon: PolygonGraphics | undefined; + /** + * Gets or sets the polyline. + */ + polyline: PolylineGraphics | undefined; + /** + * Gets or sets the polyline volume. + */ + polylineVolume: PolylineVolumeGraphics | undefined; + /** + * Gets or sets the bag of arbitrary properties associated with this entity. + */ + properties: PropertyBag | undefined; + /** + * Gets or sets the position. + */ + position: PositionProperty | undefined; + /** + * Gets or sets the rectangle. + */ + rectangle: RectangleGraphics | undefined; + /** + * Gets or sets the suggested initial offset when tracking this object. + The offset is typically defined in the east-north-up reference frame, + but may be another frame depending on the object's velocity. + */ + viewFrom: Property | undefined; + /** + * Gets or sets the wall. + */ + wall: WallGraphics | undefined; + /** + * Given a time, returns true if this object should have data during that time. + * @param time - The time to check availability for. + * @returns true if the object should have data during the provided time, false otherwise. + */ + isAvailable(time: JulianDate): boolean; + /** + * Adds a property to this object. Once a property is added, it can be + observed with {@link Entity#definitionChanged} and composited + with {@link CompositeEntityCollection} + * @param propertyName - The name of the property to add. + */ + addProperty(propertyName: string): void; + /** + * Removed a property previously added with addProperty. + * @param propertyName - The name of the property to remove. + */ + removeProperty(propertyName: string): void; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: Entity): void; + /** + * Computes the model matrix for the entity's transform at specified time. Returns undefined if orientation or position + are undefined. + * @param time - The time to retrieve model matrix for. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position or orientation are undefined. + */ + computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4; + /** + * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles. + If this feature is not supported, Entities with non-color materials but no `height` will + instead be rendered as if height is 0. + * @param scene - The current scene. + * @returns Whether or not the current scene supports materials for entities on terrain. + */ + static supportsMaterialsforEntitiesOnTerrain(scene: Scene): boolean; + /** + * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles. + If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at + the provided heights and using the `arcType` parameter instead of clamped to the ground. + * @param scene - The current scene. + * @returns Whether or not the current scene supports polylines on terrain or 3D TIles. + */ + static supportsPolylinesOnTerrain(scene: Scene): boolean; +} + +/** + * Defines how screen space objects (billboards, points, labels) are clustered. + * @param [options] - An object with the following properties: + * @param [options.enabled = false] - Whether or not to enable clustering. + * @param [options.pixelRange = 80] - The pixel range to extend the screen space bounding box. + * @param [options.minimumClusterSize = 2] - The minimum number of screen space objects that can be clustered. + * @param [options.clusterBillboards = true] - Whether or not to cluster the billboards of an entity. + * @param [options.clusterLabels = true] - Whether or not to cluster the labels of an entity. + * @param [options.clusterPoints = true] - Whether or not to cluster the points of an entity. + * @param [options.show = true] - Determines if the entities in the cluster will be shown. + */ +export class EntityCluster { + constructor(options?: { + enabled?: boolean + pixelRange?: number + minimumClusterSize?: number + clusterBillboards?: boolean + clusterLabels?: boolean + clusterPoints?: boolean + show?: boolean + }); + /** + * Determines if entities in this collection will be shown. + */ + show: boolean; + /** + * Gets or sets whether clustering is enabled. + */ + enabled: boolean; + /** + * Gets or sets the pixel range to extend the screen space bounding box. + */ + pixelRange: number; + /** + * Gets or sets the minimum number of screen space objects that can be clustered. + */ + minimumClusterSize: number; + /** + * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}. + */ + clusterEvent: Event; + /** + * Gets or sets whether clustering billboard entities is enabled. + */ + clusterBillboards: boolean; + /** + * Gets or sets whether clustering labels entities is enabled. + */ + clusterLabels: boolean; + /** + * Gets or sets whether clustering point entities is enabled. + */ + clusterPoints: boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed + from a data source collection and added to another. + </p> + */ + destroy(): void; +} + +export namespace EntityCluster { + /** + * A event listener function used to style clusters. + * @example + * // The default cluster values. + dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) { + cluster.label.show = true; + cluster.label.text = entities.length.toLocaleString(); + }); + * @param clusteredEntities - An array of the entities contained in the cluster. + * @param cluster - An object containing billboard, label, and point properties. The values are the same as + billboard, label and point entities, but must be the values of the ConstantProperty. + */ + type newClusterCallback = (clusteredEntities: Entity[], cluster: any) => void; +} + +/** + * An observable collection of {@link Entity} instances where each entity has a unique id. + * @param [owner] - The data source (or composite entity collection) which created this collection. + */ +export class EntityCollection { + constructor(owner?: DataSource | CompositeEntityCollection); + /** + * Prevents {@link EntityCollection#collectionChanged} events from being raised + until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which + point a single event will be raised that covers all suspended operations. + This allows for many items to be added and removed efficiently. + This function can be safely called multiple times as long as there + are corresponding calls to {@link EntityCollection#resumeEvents}. + */ + suspendEvents(): void; + /** + * Resumes raising {@link EntityCollection#collectionChanged} events immediately + when an item is added or removed. Any modifications made while while events were suspended + will be triggered as a single event when this function is called. + This function is reference counted and can safely be called multiple times as long as there + are corresponding calls to {@link EntityCollection#resumeEvents}. + */ + resumeEvents(): void; + /** + * The signature of the event generated by {@link EntityCollection#collectionChanged}. + * @param collection - The collection that triggered the event. + * @param added - The array of {@link Entity} instances that have been added to the collection. + * @param removed - The array of {@link Entity} instances that have been removed from the collection. + * @param changed - The array of {@link Entity} instances that have been modified. + */ + static collectionChangedEventCallback(collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]): void; + /** + * Gets the event that is fired when entities are added or removed from the collection. + The generated event is a {@link EntityCollection.collectionChangedEventCallback}. + */ + readonly collectionChanged: Event; + /** + * Gets a globally unique identifier for this collection. + */ + readonly id: string; + /** + * Gets the array of Entity instances in the collection. + This array should not be modified directly. + */ + readonly values: Entity[]; + /** + * Gets whether or not this entity collection should be + displayed. When true, each entity is only displayed if + its own show property is also true. + */ + show: boolean; + /** + * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it. + */ + readonly owner: DataSource | CompositeEntityCollection; + /** + * Computes the maximum availability of the entities in the collection. + If the collection contains a mix of infinitely available data and non-infinite data, + it will return the interval pertaining to the non-infinite data only. If all + data is infinite, an infinite interval will be returned. + * @returns The availability of entities in the collection. + */ + computeAvailability(): TimeInterval; + /** + * Add an entity to the collection. + * @param entity - The entity to be added. + * @returns The entity that was added. + */ + add(entity: Entity | Entity.ConstructorOptions): Entity; + /** + * Removes an entity from the collection. + * @param entity - The entity to be removed. + * @returns true if the item was removed, false if it did not exist in the collection. + */ + remove(entity: Entity): boolean; + /** + * Returns true if the provided entity is in this collection, false otherwise. + * @param entity - The entity. + * @returns true if the provided entity is in this collection, false otherwise. + */ + contains(entity: Entity): boolean; + /** + * Removes an entity with the provided id from the collection. + * @param id - The id of the entity to remove. + * @returns true if the item was removed, false if no item with the provided id existed in the collection. + */ + removeById(id: string): boolean; + /** + * Removes all Entities from the collection. + */ + removeAll(): void; + /** + * Gets an entity with the specified id. + * @param id - The id of the entity to retrieve. + * @returns The entity with the provided id or undefined if the id did not exist in the collection. + */ + getById(id: string): Entity | undefined; + /** + * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist. + * @param id - The id of the entity to retrieve or create. + * @returns The new or existing object. + */ + getOrCreateEntity(id: string): Entity; +} + +/** + * A utility object for tracking an entity with the camera. + * @param entity - The entity to track with the camera. + * @param scene - The scene to use. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use for orienting the camera. + */ +export class EntityView { + constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid); + /** + * The entity to track with the camera. + */ + entity: Entity; + /** + * The scene in which to track the object. + */ + scene: Scene; + /** + * The ellipsoid to use for orienting the camera. + */ + ellipsoid: Ellipsoid; + /** + * The bounding sphere of the object. + */ + boundingSphere: BoundingSphere; + /** + * Gets or sets a camera offset that will be used to + initialize subsequent EntityViews. + */ + static defaultOffset3D: Cartesian3; + /** + * Should be called each animation frame to update the camera + to the latest settings. + * @param time - The current animation time. + * @param [boundingSphere] - bounding sphere of the object. + */ + update(time: JulianDate, boundingSphere?: BoundingSphere): void; +} + +/** + * @property kml - The generated KML. + * @property externalFiles - An object dictionary of external files + */ +export type exportKmlResultKml = { + kml: string + externalFiles: { + [key: string]: Blob + } +}; + +/** + * @property kmz - The generated kmz file. + */ +export type exportKmlResultKmz = { + kmz: Blob +}; + +/** + * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries +will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For +example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at +options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties +that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using +the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported +as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary +color is used. Canvas objects are exported as PNG images. + * @example + * Cesium.exportKml({ + entities: entityCollection + }) + .then(function(result) { + // The XML string is in result.kml + + var externalFiles = result.externalFiles + for(var file in externalFiles) { + // file is the name of the file used in the KML document as the href + // externalFiles[file] is a blob with the contents of the file + } + }); + * @param options - An object with the following properties: + * @param options.entities - The EntityCollection to export as KML. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for the output file. + * @param [options.modelCallback] - A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection. + * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML. + * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability. + * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML. + * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file. + * @returns A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true. + */ +export function exportKml(options: { + entities: EntityCollection + ellipsoid?: Ellipsoid + modelCallback?: exportKmlModelCallback + time?: JulianDate + defaultAvailability?: TimeInterval + sampleDuration?: number + kmz?: boolean +}): Promise<exportKmlResultKml | exportKmlResultKmz>; + +/** + * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document. +It can also be used to add additional files to the <code>externalFiles</code> object, which is the list of files embedded in the exported KMZ, +or otherwise returned with the KML string when exporting. + * @param model - The ModelGraphics instance for an Entity. + * @param time - The time that any properties should use to get the value. + * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob. + */ +export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string; + +export namespace GeoJsonDataSource { + /** + * Initialization options for the `load` method. + * @property [sourceUri] - Overrides the url to use for resolving relative links. + * @property [markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels. + * @property [markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point. + * @property [markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point. + * @property [stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines. + * @property [strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines. + * @property [fill = GeoJsonDataSource.fill] - The default color for polygon interiors. + * @property [clampToGround = GeoJsonDataSource.clampToGround] - true if we want the geometry features (polygons or linestrings) clamped to the ground. + * @property [credit] - A credit for the data source, which is displayed on the canvas. + */ + type LoadOptions = { + sourceUri?: string + markerSize?: number + markerSymbol?: string + markerColor?: Color + stroke?: Color + strokeWidth?: number + fill?: Color + clampToGround?: boolean + credit?: Credit | string + }; + /** + * This callback is displayed as part of the GeoJsonDataSource class. + * @param properties - The properties of the feature. + * @param nameProperty - The property key that Cesium estimates to have the name of the feature. + */ + type describe = (properties: any, nameProperty: string) => void; +} + +/** + * A {@link DataSource} which processes both +{@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data. +{@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they +are present. + * @example + * var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', { + stroke: Cesium.Color.HOTPINK, + fill: Cesium.Color.PINK, + strokeWidth: 3, + markerSymbol: '?' +})); + * @param [name] - The name of this data source. If undefined, a name will be taken from + the name of the GeoJSON file. + */ +export class GeoJsonDataSource { + constructor(name?: string); + /** + * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data. + * @param data - A url, GeoJSON object, or TopoJSON object to be loaded. + * @param [options] - An object specifying configuration options + * @returns A promise that will resolve when the data is loaded. + */ + static load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>; + /** + * Gets or sets the default size of the map pin created for each point, in pixels. + */ + static markerSize: number; + /** + * Gets or sets the default symbol of the map pin created for each point. + This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character, + or blank if no symbol is to be used. + */ + static markerSymbol: string; + /** + * Gets or sets the default color of the map pin created for each point. + */ + static markerColor: Color; + /** + * Gets or sets the default color of polylines and polygon outlines. + */ + static stroke: Color; + /** + * Gets or sets the default width of polylines and polygon outlines. + */ + static strokeWidth: number; + /** + * Gets or sets default color for polygon interiors. + */ + static fill: Color; + /** + * Gets or sets default of whether to clamp to the ground. + */ + static clampToGround: boolean; + /** + * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate + and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which + supported the EPSG type can be added to this list as well, by specifying the complete EPSG name, + for example 'EPSG:4326'. + */ + static crsNames: any; + /** + * Gets an object that maps the href property of a crs link to a callback function + which takes the crs properties object and returns a Promise that resolves + to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian. + Items in this object take precedence over those defined in <code>crsLinkHrefs</code>, assuming + the link has a type specified. + */ + static crsLinkHrefs: any; + /** + * Gets an object that maps the type property of a crs link to a callback function + which takes the crs properties object and returns a Promise that resolves + to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian. + Items in <code>crsLinkHrefs</code> take precedence over this object. + */ + static crsLinkTypes: any; + /** + * Gets or sets a human-readable name for this instance. + */ + name: string; + /** + * This DataSource only defines static data, therefore this property is always undefined. + */ + clock: DataSourceClock; + /** + * Gets the collection of {@link Entity} instances. + */ + entities: EntityCollection; + /** + * Gets a value indicating if the data source is currently loading data. + */ + isLoading: boolean; + /** + * Gets an event that will be raised when the underlying data changes. + */ + changedEvent: Event; + /** + * Gets an event that will be raised if an error is encountered during processing. + */ + errorEvent: Event; + /** + * Gets an event that will be raised when the data source either starts or stops loading. + */ + loadingEvent: Event; + /** + * Gets whether or not this data source should be displayed. + */ + show: boolean; + /** + * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. + */ + clustering: EntityCluster; + /** + * Gets the credit that will be displayed for the data source + */ + credit: Credit; + /** + * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data. + * @param data - A url, GeoJSON object, or TopoJSON object to be loaded. + * @param [options] - An object with the following properties: + * @param [options.sourceUri] - Overrides the url to use for resolving relative links. + * @param [options.describe = GeoJsonDataSource.defaultDescribeProperty] - A function which returns a Property object (or just a string), + which converts the properties into an html description. + * @param [options.markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels. + * @param [options.markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point. + * @param [options.markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point. + * @param [options.stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines. + * @param [options.strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines. + * @param [options.fill = GeoJsonDataSource.fill] - The default color for polygon interiors. + * @param [options.clampToGround = GeoJsonDataSource.clampToGround] - true if we want the features clamped to the ground. + * @param [options.credit] - A credit for the data source, which is displayed on the canvas. + * @returns a promise that will resolve when the GeoJSON is loaded. + */ + load(data: Resource | string | any, options?: { + sourceUri?: string + describe?: GeoJsonDataSource.describe + markerSize?: number + markerSymbol?: string + markerColor?: Color + stroke?: Color + strokeWidth?: number + fill?: Color + clampToGround?: boolean + credit?: Credit | string + }): Promise<GeoJsonDataSource>; + /** + * Updates the data source to the provided time. This function is optional and + is not required to be implemented. It is provided for data sources which + retrieve data based on the current animation time or scene state. + If implemented, update will be called by {@link DataSourceDisplay} once a frame. + * @param time - The simulation time. + * @returns True if this data source is ready to be displayed at the provided time, false otherwise. + */ + update(time: JulianDate): boolean; +} + +/** + * An abstract class for updating geometry entities. + * @param options - An object with the following properties: + * @param options.entity - The entity containing the geometry to be visualized. + * @param options.scene - The scene where visualization is taking place. + * @param options.geometryOptions - Options for the geometry + * @param options.geometryPropertyName - The geometry property name + * @param options.observedPropertyNames - The entity properties this geometry cares about + */ +export class GeometryUpdater { + constructor(options: { + entity: Entity + scene: Scene + geometryOptions: any + geometryPropertyName: string + observedPropertyNames: string[] + }); + /** + * Gets the unique ID associated with this updater + */ + readonly id: string; + /** + * Gets the entity associated with this geometry. + */ + readonly entity: Entity; + /** + * Gets a value indicating if the geometry has a fill component. + */ + readonly fillEnabled: boolean; + /** + * Gets a value indicating if fill visibility varies with simulation time. + */ + readonly hasConstantFill: boolean; + /** + * Gets the material property used to fill the geometry. + */ + readonly fillMaterialProperty: MaterialProperty; + /** + * Gets a value indicating if the geometry has an outline component. + */ + readonly outlineEnabled: boolean; + /** + * Gets a value indicating if the geometry has an outline component. + */ + readonly hasConstantOutline: boolean; + /** + * Gets the {@link Color} property for the geometry outline. + */ + readonly outlineColorProperty: Property; + /** + * Gets the constant with of the geometry outline, in pixels. + This value is only valid if isDynamic is false. + */ + readonly outlineWidth: number; + /** + * Gets the property specifying whether the geometry + casts or receives shadows from light sources. + */ + readonly shadowsProperty: Property; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed. + */ + readonly distanceDisplayConditionProperty: Property; + /** + * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground. + */ + readonly classificationTypeProperty: Property; + /** + * Gets a value indicating if the geometry is time-varying. + If true, all visualization is delegated to a DynamicGeometryUpdater + returned by GeometryUpdater#createDynamicUpdater. + */ + readonly isDynamic: boolean; + /** + * Gets a value indicating if the geometry is closed. + This property is only valid for static geometry. + */ + readonly isClosed: boolean; + /** + * Gets an event that is raised whenever the public properties + of this updater change. + */ + readonly geometryChanged: boolean; + /** + * Checks if the geometry is outlined at the provided time. + * @param time - The time for which to retrieve visibility. + * @returns true if geometry is outlined at the provided time, false otherwise. + */ + isOutlineVisible(time: JulianDate): boolean; + /** + * Checks if the geometry is filled at the provided time. + * @param time - The time for which to retrieve visibility. + * @returns true if geometry is filled at the provided time, false otherwise. + */ + isFilled(time: JulianDate): boolean; + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys and resources used by the object. Once an object is destroyed, it should not be used. + */ + destroy(): void; +} + +/** + * A general purpose visualizer for geometry represented by {@link Primitive} instances. + * @param scene - The scene the primitives will be rendered in. + * @param entityCollection - The entityCollection to visualize. + * @param [primitives = scene.primitives] - A collection to add primitives related to the entities + * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities + */ +export class GeometryVisualizer { + constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection); + /** + * Updates all of the primitives created by this visualizer to match their + Entity counterpart at the given time. + * @param time - The time to update to. + * @returns True if the visualizer successfully updated to the provided time, + false if the visualizer is waiting for asynchronous primitives to be created. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes and destroys all primitives created by this instance. + */ + destroy(): void; +} + +/** + * A {@link MaterialProperty} that maps to grid {@link Material} uniforms. + * @param [options] - Object with the following properties: + * @param [options.color = Color.WHITE] - A Property specifying the grid {@link Color}. + * @param [options.cellAlpha = 0.1] - A numeric Property specifying cell alpha values. + * @param [options.lineCount = new Cartesian2(8, 8)] - A {@link Cartesian2} Property specifying the number of grid lines along each axis. + * @param [options.lineThickness = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the thickness of grid lines along each axis. + * @param [options.lineOffset = new Cartesian2(0.0, 0.0)] - A {@link Cartesian2} Property specifying starting offset of grid lines along each axis. + */ +export class GridMaterialProperty { + constructor(options?: { + color?: Property | Color + cellAlpha?: Property | number + lineCount?: Property | Cartesian2 + lineThickness?: Property | Cartesian2 + lineOffset?: Property | Cartesian2 + }); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the Property specifying the grid {@link Color}. + */ + color: Property | undefined; + /** + * Gets or sets the numeric Property specifying cell alpha values. + */ + cellAlpha: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis. + */ + lineCount: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis. + */ + lineThickness: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis. + */ + lineOffset: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * An abstract class for updating ground geometry entities. + * @param options - An object with the following properties: + * @param options.entity - The entity containing the geometry to be visualized. + * @param options.scene - The scene where visualization is taking place. + * @param options.geometryOptions - Options for the geometry + * @param options.geometryPropertyName - The geometry property name + * @param options.observedPropertyNames - The entity properties this geometry cares about + */ +export class GroundGeometryUpdater { + constructor(options: { + entity: Entity + scene: Scene + geometryOptions: any + geometryPropertyName: string + observedPropertyNames: string[] + }); + /** + * Gets the zindex + */ + readonly zIndex: number; + /** + * Destroys and resources used by the object. Once an object is destroyed, it should not be used. + */ + destroy(): void; +} + +/** + * A {@link MaterialProperty} that maps to image {@link Material} uniforms. + * @param [options] - Object with the following properties: + * @param [options.image] - A Property specifying the Image, URL, Canvas, or Video. + * @param [options.repeat = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the number of times the image repeats in each direction. + * @param [options.color = Color.WHITE] - The color applied to the image + * @param [options.transparent = false] - Set to true when the image has transparency (for example, when a png has transparent sections) + */ +export class ImageMaterialProperty { + constructor(options?: { + image?: Property | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement + repeat?: Property | Cartesian2 + color?: Property | Color + transparent?: Property | boolean + }); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the Property specifying Image, URL, Canvas, or Video to use. + */ + image: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction. + */ + repeat: Property | undefined; + /** + * Gets or sets the Color Property specifying the desired color applied to the image. + */ + color: Property | undefined; + /** + * Gets or sets the Boolean Property specifying whether the image has transparency + */ + transparent: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * Representation of <Camera> from KML + * @param position - camera position + * @param headingPitchRoll - camera orientation + */ +export class KmlCamera { + constructor(position: Cartesian3, headingPitchRoll: HeadingPitchRoll); +} + +export namespace KmlDataSource { + /** + * Initialization options for the `load` method. + * @property camera - The camera that is used for viewRefreshModes and sending camera properties to network links. + * @property canvas - The canvas that is used for sending viewer properties to network links. + * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features. + * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. + * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations. + * @property [credit] - A credit for the data source, which is displayed on the canvas. + */ + type LoadOptions = { + camera: Camera + canvas: HTMLCanvasElement + sourceUri?: string + clampToGround?: boolean + ellipsoid?: Ellipsoid + credit?: Credit | string + }; +} + +/** + * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML). +<p> +KML support in Cesium is incomplete, but a large amount of the standard, +as well as Google's <code>gx</code> extension namespace, is supported. See Github issue +{@link https://github.com/CesiumGS/cesium/issues/873|#873} for a +detailed list of what is and isn't support. Cesium will also write information to the +console when it encounters most unsupported features. +</p> +<p> +Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code> +is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity} +under the <code>kml</code> property. +</p> + * @example + * var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz', + { + camera: viewer.scene.camera, + canvas: viewer.scene.canvas + }) +); + * @param options - An object with the following properties: + * @param options.camera - The camera that is used for viewRefreshModes and sending camera properties to network links. + * @param options.canvas - The canvas that is used for sending viewer properties to network links. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations. + * @param [options.credit] - A credit for the data source, which is displayed on the canvas. + */ +export class KmlDataSource { + constructor(options: { + camera: Camera + canvas: HTMLCanvasElement + ellipsoid?: Ellipsoid + credit?: Credit | string + }); + /** + * Creates a Promise to a new instance loaded with the provided KML data. + * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document. + * @param [options] - An object specifying configuration options + * @returns A promise that will resolve to a new KmlDataSource instance once the KML is loaded. + */ + static load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise<KmlDataSource>; + /** + * Gets or sets a human-readable name for this instance. + This will be automatically be set to the KML document name on load. + */ + name: string; + /** + * Gets the clock settings defined by the loaded KML. This represents the total + availability interval for all time-dynamic data. If the KML does not contain + time-dynamic data, this value is undefined. + */ + clock: DataSourceClock; + /** + * Gets the collection of {@link Entity} instances. + */ + entities: EntityCollection; + /** + * Gets a value indicating if the data source is currently loading data. + */ + isLoading: boolean; + /** + * Gets an event that will be raised when the underlying data changes. + */ + changedEvent: Event; + /** + * Gets an event that will be raised if an error is encountered during processing. + */ + errorEvent: Event; + /** + * Gets an event that will be raised when the data source either starts or stops loading. + */ + loadingEvent: Event; + /** + * Gets an event that will be raised when the data source refreshes a network link. + */ + refreshEvent: Event; + /** + * Gets an event that will be raised when the data source finds an unsupported node type. + */ + unsupportedNodeEvent: Event; + /** + * Gets whether or not this data source should be displayed. + */ + show: boolean; + /** + * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources. + */ + clustering: EntityCluster; + /** + * Gets the credit that will be displayed for the data source + */ + credit: Credit; + /** + * Asynchronously loads the provided KML data, replacing any existing data. + * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document. + * @param [options] - An object with the following properties: + * @param [options.sourceUri] - Overrides the url to use for resolving relative links and other KML network features. + * @param [options.clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. If true, lines will use corridors so use Entity.corridor instead of Entity.polyline. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations. + * @returns A promise that will resolve to this instances once the KML is loaded. + */ + load(data: Resource | string | Document | Blob, options?: { + sourceUri?: Resource | string + clampToGround?: boolean + ellipsoid?: Ellipsoid + }): Promise<KmlDataSource>; + /** + * Updates any NetworkLink that require updating. + * @param time - The simulation time. + * @returns True if this data source is ready to be displayed at the provided time, false otherwise. + */ + update(time: JulianDate): boolean; +} + +/** + * Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}. + */ +export class KmlFeatureData { + constructor(); + /** + * Gets the atom syndication format author field. + */ + author: KmlFeatureData.Author; + /** + * Gets the link. + */ + link: KmlFeatureData.Link; + /** + * Gets the unstructured address field. + */ + address: string; + /** + * Gets the phone number. + */ + phoneNumber: string; + /** + * Gets the snippet. + */ + snippet: string; + /** + * Gets the extended data, parsed into a JSON object. + Currently only the <code>Data</code> property is supported. + <code>SchemaData</code> and custom data are ignored. + */ + extendedData: string; +} + +export namespace KmlFeatureData { + /** + * @property name - Gets the name. + * @property uri - Gets the URI. + * @property age - Gets the email. + */ + type Author = { + name: string + uri: string + age: number + }; + /** + * @property href - Gets the href. + * @property hreflang - Gets the language of the linked resource. + * @property rel - Gets the link relation. + * @property type - Gets the link type. + * @property title - Gets the link title. + * @property length - Gets the link length. + */ + type Link = { + href: string + hreflang: string + rel: string + type: string + title: string + length: string + }; +} + +/** + * @param position - camera position + * @param headingPitchRange - camera orientation + */ +export class KmlLookAt { + constructor(position: Cartesian3, headingPitchRange: HeadingPitchRange); +} + +/** + * @param name - name parsed from KML + * @param id - id parsed from KML + * @param playlist - array with KMLTourFlyTos, KMLTourWaits and KMLTourSoundCues + */ +export class KmlTour { + constructor(name: string, id: string, playlist: any[]); + /** + * Id of kml gx:Tour entry + */ + id: string; + /** + * Tour name + */ + name: string; + /** + * Index of current entry from playlist + */ + playlistIndex: number; + /** + * Array of playlist entries + */ + playlist: any[]; + /** + * Event will be called when tour starts to play, + before any playlist entry starts to play. + */ + tourStart: Event; + /** + * Event will be called when all playlist entries are + played, or tour playback being canceled. + + If tour playback was terminated, event callback will + be called with terminated=true parameter. + */ + tourEnd: Event; + /** + * Event will be called when entry from playlist starts to play. + + Event callback will be called with curent entry as first parameter. + */ + entryStart: Event; + /** + * Event will be called when entry from playlist ends to play. + + Event callback will be called with following parameters: + 1. entry - entry + 2. terminated - true if playback was terminated by calling {@link KmlTour#stop} + */ + entryEnd: Event; + /** + * Add entry to this tour playlist. + * @param entry - an entry to add to the playlist. + */ + addPlaylistEntry(entry: KmlTourFlyTo | KmlTourWait): void; + /** + * Play this tour. + * @param viewer - viewer widget. + * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo} + options for FlyTo playlist entries. + */ + play(viewer: Viewer, cameraOptions?: any): void; + /** + * Stop curently playing tour. + */ + stop(): void; +} + +/** + * @param duration - entry duration + * @param flyToMode - KML fly to mode: bounce, smooth, etc + * @param view - KmlCamera or KmlLookAt + */ +export class KmlTourFlyTo { + constructor(duration: number, flyToMode: string, view: KmlCamera | KmlLookAt); + /** + * Play this playlist entry + * @param done - function which will be called when playback ends + * @param camera - Cesium camera + * @param [cameraOptions] - which will be merged with camera flyTo options. See {@link Camera#flyTo} + */ + play(done: KmlTourFlyTo.DoneCallback, camera: Camera, cameraOptions?: any): void; + /** + * Stop execution of curent entry. Cancel camera flyTo + */ + stop(): void; + /** + * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} + depends on this.view type. + * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo} + * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options + */ + getCameraOptions(cameraOptions: any): any; +} + +export namespace KmlTourFlyTo { + /** + * A function that will be executed when the flight completes. + * @param terminated - true if {@link KmlTourFlyTo#stop} was + called before entry done playback. + */ + type DoneCallback = (terminated: boolean) => void; +} + +/** + * @param duration - entry duration + */ +export class KmlTourWait { + constructor(duration: number); + /** + * Play this playlist entry + * @param done - function which will be called when playback ends + */ + play(done: KmlTourWait.DoneCallback): void; + /** + * Stop execution of curent entry, cancel curent timeout + */ + stop(): void; +} + +export namespace KmlTourWait { + /** + * A function which will be called when playback ends. + * @param terminated - true if {@link KmlTourWait#stop} was + called before entry done playback. + */ + type DoneCallback = (terminated: boolean) => void; +} + +export namespace LabelGraphics { + /** + * Initialization options for the LabelGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the label. + * @property [text] - A Property specifying the text. Explicit newlines '\n' are supported. + * @property [font = '30px sans-serif'] - A Property specifying the CSS font. + * @property [style = LabelStyle.FILL] - A Property specifying the {@link LabelStyle}. + * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the text. + * @property [showBackground = false] - A boolean Property specifying the visibility of the background behind the label. + * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A Property specifying the background {@link Color}. + * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels. + * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset. + * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset. + * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}. + * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. + * @property [fillColor = Color.WHITE] - A Property specifying the fill {@link Color}. + * @property [outlineColor = Color.BLACK] - A Property specifying the outline {@link Color}. + * @property [outlineWidth = 1.0] - A numeric Property specifying the outline width. + * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera. + * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera. + * @property [scaleByDistance] - A {@link NearFarScalar} Property used to set scale based on distance from the camera. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this label will be displayed. + * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to. + */ + type ConstructorOptions = { + show?: Property | boolean + text?: Property | string + font?: Property | string + style?: Property | LabelStyle + scale?: Property | number + showBackground?: Property | boolean + backgroundColor?: Property | Color + backgroundPadding?: Property | Cartesian2 + pixelOffset?: Property | Cartesian2 + eyeOffset?: Property | Cartesian3 + horizontalOrigin?: Property | HorizontalOrigin + verticalOrigin?: Property | VerticalOrigin + heightReference?: Property | HeightReference + fillColor?: Property | Color + outlineColor?: Property | Color + outlineWidth?: Property | number + translucencyByDistance?: Property | NearFarScalar + pixelOffsetScaleByDistance?: Property | NearFarScalar + scaleByDistance?: Property | NearFarScalar + distanceDisplayCondition?: Property | DistanceDisplayCondition + disableDepthTestDistance?: Property | number + }; +} + +/** + * Describes a two dimensional label located at the position of the containing {@link Entity}. +<p> +<div align='center'> +<img src='Images/Label.png' width='400' height='300' /><br /> +Example labels +</div> +</p> + * @param [options] - Object describing initialization options + */ +export class LabelGraphics { + constructor(options?: LabelGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the label. + */ + show: Property | undefined; + /** + * Gets or sets the string Property specifying the text of the label. + Explicit newlines '\n' are supported. + */ + text: Property | undefined; + /** + * Gets or sets the string Property specifying the font in CSS syntax. + */ + font: Property | undefined; + /** + * Gets or sets the Property specifying the {@link LabelStyle}. + */ + style: Property | undefined; + /** + * Gets or sets the numeric Property specifying the uniform scale to apply to the image. + A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it. + <p> + <div align='center'> + <img src='Images/Label.setScale.png' width='400' height='300' /><br/> + From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, + and <code>2.0</code>. + </div> + </p> + */ + scale: Property | undefined; + /** + * Gets or sets the boolean Property specifying the visibility of the background behind the label. + */ + showBackground: Property | undefined; + /** + * Gets or sets the Property specifying the background {@link Color}. + */ + backgroundColor: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical + background padding in pixels. + */ + backgroundPadding: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space + from the origin of this label. This is commonly used to align multiple labels and labels at + the same position, e.g., an image and text. The screen space origin is the top, left corner of the + canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom. + <p> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td> + <td align='center'><code>l.pixeloffset = new Cartesian2(25, 75);</code><br/><img src='Images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td> + </tr></table> + The label's origin is indicated by the yellow point. + </div> + </p> + */ + pixelOffset: Property | undefined; + /** + * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates. + Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's + right, <code>y</code> points up, and <code>z</code> points into the screen. + <p> + An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to + arrange a label above its corresponding 3D model. + </p> + Below, the label is positioned at the center of the Earth but an eye offset makes it always + appear on top of the Earth regardless of the viewer's or Earth's orientation. + <p> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td> + <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td> + </tr></table> + <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br /> + </div> + </p> + */ + eyeOffset: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HorizontalOrigin}. + */ + horizontalOrigin: Property | undefined; + /** + * Gets or sets the Property specifying the {@link VerticalOrigin}. + */ + verticalOrigin: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the Property specifying the fill {@link Color}. + */ + fillColor: Property | undefined; + /** + * Gets or sets the Property specifying the outline {@link Color}. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the outline width. + */ + outlineWidth: Property | undefined; + /** + * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera. + A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's translucency remains clamped to the nearest bound. + */ + translucencyByDistance: Property | undefined; + /** + * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera. + A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's pixel offset remains clamped to the nearest bound. + */ + pixelOffsetScaleByDistance: Property | undefined; + /** + * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera. + A label's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, + scaleByDistance will be disabled. + */ + scaleByDistance: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + */ + disableDepthTestDistance: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: LabelGraphics): LabelGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: LabelGraphics): void; +} + +/** + * A {@link Visualizer} which maps the {@link LabelGraphics} instance +in {@link Entity#label} to a {@link Label}. + * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities. + * @param entityCollection - The entityCollection to visualize. + */ +export class LabelVisualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + /** + * Updates the primitives created by this visualizer to match their + Entity counterpart at the given time. + * @param time - The time to update to. + * @returns This function always returns true. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes and destroys all primitives created by this instance. + */ + destroy(): void; +} + +/** + * The interface for all {@link Property} objects that represent {@link Material} uniforms. +This type defines an interface and cannot be instantiated directly. + */ +export class MaterialProperty { + constructor(); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +export namespace ModelGraphics { + /** + * Initialization options for the ModelGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the model. + * @property [uri] - A string or Resource Property specifying the URI of the glTF asset. + * @property [scale = 1.0] - A numeric Property specifying a uniform linear scale. + * @property [minimumPixelSize = 0.0] - A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom. + * @property [maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize. + * @property [incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded. + * @property [runAnimations = true] - A boolean Property specifying if glTF animations specified in the model should be started. + * @property [clampAnimations = true] - A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes. + * @property [shadows = ShadowMode.ENABLED] - An enum Property specifying whether the model casts or receives shadows from light sources. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. + * @property [silhouetteColor = Color.RED] - A Property specifying the {@link Color} of the silhouette. + * @property [silhouetteSize = 0.0] - A numeric Property specifying the size of the silhouette in pixels. + * @property [color = Color.WHITE] - A Property specifying the {@link Color} that blends with the model's rendered color. + * @property [colorBlendMode = ColorBlendMode.HIGHLIGHT] - An enum Property specifying how the color blends with the model. + * @property [colorBlendAmount = 0.5] - A numeric Property specifying the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. + * @property [imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - A property specifying the contribution from diffuse and specular image-based lighting. + * @property [lightColor] - A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this model will be displayed. + * @property [nodeTransformations] - An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation. + * @property [articulations] - An object, where keys are composed of an articulation name, a single space, and a stage name, and the values are numeric properties. + * @property [clippingPlanes] - A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. + */ + type ConstructorOptions = { + show?: Property | boolean + uri?: Property | string | Resource + scale?: Property | number + minimumPixelSize?: Property | number + maximumScale?: Property | number + incrementallyLoadTextures?: Property | boolean + runAnimations?: Property | boolean + clampAnimations?: Property | boolean + shadows?: Property | ShadowMode + heightReference?: Property | HeightReference + silhouetteColor?: Property | Color + silhouetteSize?: Property | number + color?: Property | Color + colorBlendMode?: Property | ColorBlendMode + colorBlendAmount?: Property | number + imageBasedLightingFactor?: Property | Cartesian2 + lightColor?: Property | Color + distanceDisplayCondition?: Property | DistanceDisplayCondition + nodeTransformations?: PropertyBag | { + [key: string]: TranslationRotationScale + } + articulations?: PropertyBag | { + [key: string]: number + } + clippingPlanes?: Property | ClippingPlaneCollection + }; +} + +/** + * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL. +The position and orientation of the model is determined by the containing {@link Entity}. +<p> +Cesium includes support for glTF geometry, materials, animations, and skinning. +Cameras and lights are not currently supported. +</p> + * @param [options] - Object describing initialization options + */ +export class ModelGraphics { + constructor(options?: ModelGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the model. + */ + show: Property | undefined; + /** + * Gets or sets the string Property specifying the URI of the glTF asset. + */ + uri: Property | undefined; + /** + * Gets or sets the numeric Property specifying a uniform linear scale + for this model. Values greater than 1.0 increase the size of the model while + values less than 1.0 decrease it. + */ + scale: Property | undefined; + /** + * Gets or sets the numeric Property specifying the approximate minimum + pixel size of the model regardless of zoom. This can be used to ensure that + a model is visible even when the viewer zooms out. When <code>0.0</code>, + no minimum size is enforced. + */ + minimumPixelSize: Property | undefined; + /** + * Gets or sets the numeric Property specifying the maximum scale + size of a model. This property is used as an upper limit for + {@link ModelGraphics#minimumPixelSize}. + */ + maximumScale: Property | undefined; + /** + * Get or sets the boolean Property specifying whether textures + may continue to stream in after the model is loaded. + */ + incrementallyLoadTextures: Property | undefined; + /** + * Gets or sets the boolean Property specifying if glTF animations should be run. + */ + runAnimations: Property | undefined; + /** + * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes. + */ + clampAnimations: Property | undefined; + /** + * Get or sets the enum Property specifying whether the model + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the silhouette. + */ + silhouetteColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the size of the silhouette in pixels. + */ + silhouetteSize: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color. + */ + color: Property | undefined; + /** + * Gets or sets the enum Property specifying how the color blends with the model. + */ + colorBlendMode: Property | undefined; + /** + * A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX. + A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with + any value in-between resulting in a mix of the two. + */ + colorBlendAmount: Property | undefined; + /** + * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color. + */ + imageBasedLightingFactor: Property | undefined; + /** + * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead. + */ + lightColor: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are + names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. + The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation. + */ + nodeTransformations: PropertyBag; + /** + * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are + composed as the name of the articulation, a single space, and the name of the stage. + */ + articulations: PropertyBag; + /** + * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. + */ + clippingPlanes: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: ModelGraphics): ModelGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: ModelGraphics): void; +} + +/** + * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}. + * @param scene - The scene the primitives will be rendered in. + * @param entityCollection - The entityCollection to visualize. + */ +export class ModelVisualizer { + constructor(scene: Scene, entityCollection: EntityCollection); + /** + * Updates models created this visualizer to match their + Entity counterpart at the given time. + * @param time - The time to update to. + * @returns This function always returns true. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes and destroys all primitives created by this instance. + */ + destroy(): void; +} + +/** + * A {@link Property} that produces {@link TranslationRotationScale} data. + * @param [options] - Object with the following properties: + * @param [options.translation = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node. + * @param [options.rotation = Quaternion.IDENTITY] - A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node. + * @param [options.scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node. + */ +export class NodeTransformationProperty { + constructor(options?: { + translation?: Property | Cartesian3 + rotation?: Property | Quaternion + scale?: Property | Cartesian3 + }); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node. + */ + translation: Property | undefined; + /** + * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node. + */ + rotation: Property | undefined; + /** + * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node. + */ + scale: Property | undefined; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: TranslationRotationScale): TranslationRotationScale; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +export namespace PathGraphics { + /** + * Initialization options for the PathGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the path. + * @property [leadTime] - A Property specifying the number of seconds in front the object to show. + * @property [trailTime] - A Property specifying the number of seconds behind of the object to show. + * @property [width = 1.0] - A numeric Property specifying the width in pixels. + * @property [resolution = 60] - A numeric Property specifying the maximum number of seconds to step when sampling the position. + * @property [material = Color.WHITE] - A Property specifying the material used to draw the path. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this path will be displayed. + */ + type ConstructorOptions = { + show?: Property | boolean + leadTime?: Property | number + trailTime?: Property | number + width?: Property | number + resolution?: Property | number + material?: MaterialProperty | Color + distanceDisplayCondition?: Property | DistanceDisplayCondition + }; +} + +/** + * Describes a polyline defined as the path made by an {@link Entity} as it moves over time. + * @param [options] - Object describing initialization options + */ +export class PathGraphics { + constructor(options?: PathGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the path. + */ + show: Property | undefined; + /** + * Gets or sets the Property specifying the number of seconds in front of the object to show. + */ + leadTime: Property | undefined; + /** + * Gets or sets the Property specifying the number of seconds behind the object to show. + */ + trailTime: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width in pixels. + */ + width: Property | undefined; + /** + * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position. + */ + resolution: Property | undefined; + /** + * Gets or sets the Property specifying the material used to draw the path. + */ + material: MaterialProperty; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: PathGraphics): PathGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: PathGraphics): void; +} + +/** + * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}. + * @param scene - The scene the primitives will be rendered in. + * @param entityCollection - The entityCollection to visualize. + */ +export class PathVisualizer { + constructor(scene: Scene, entityCollection: EntityCollection); + /** + * Updates all of the primitives created by this visualizer to match their + Entity counterpart at the given time. + * @param time - The time to update to. + * @returns This function always returns true. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes and destroys all primitives created by this instance. + */ + destroy(): void; +} + +/** + * A {@link GeometryUpdater} for planes. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class PlaneGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; +} + +export namespace PlaneGraphics { + /** + * Initialization options for the PlaneGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the plane. + * @property [plane] - A {@link Plane} Property specifying the normal and distance for the plane. + * @property [dimensions] - A {@link Cartesian2} Property specifying the width and height of the plane. + * @property [fill = true] - A boolean Property specifying whether the plane is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the plane. + * @property [outline = false] - A boolean Property specifying whether the plane is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the plane casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this plane will be displayed. + */ + type ConstructorOptions = { + show?: Property | boolean + plane?: Property | Plane + dimensions?: Property | Cartesian2 + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + }; +} + +/** + * Describes a plane. The center position and orientation are determined by the containing {@link Entity}. + * @param [options] - Object describing initialization options + */ +export class PlaneGraphics { + constructor(options?: PlaneGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the plane. + */ + show: Property | undefined; + /** + * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane. + */ + plane: Property | undefined; + /** + * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane. + */ + dimensions: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the plane is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the material used to fill the plane. + */ + material: MaterialProperty; + /** + * Gets or sets the Property specifying whether the plane is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Get or sets the enum Property specifying whether the plane + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: PlaneGraphics): PlaneGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: PlaneGraphics): void; +} + +export namespace PointGraphics { + /** + * Initialization options for the PointGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the point. + * @property [pixelSize = 1] - A numeric Property specifying the size in pixels. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. + * @property [color = Color.WHITE] - A Property specifying the {@link Color} of the point. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 0] - A numeric Property specifying the the outline width in pixels. + * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance. + * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this point will be displayed. + * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to. + */ + type ConstructorOptions = { + show?: Property | boolean + pixelSize?: Property | number + heightReference?: Property | HeightReference + color?: Property | Color + outlineColor?: Property | Color + outlineWidth?: Property | number + scaleByDistance?: Property | NearFarScalar + translucencyByDistance?: Property | NearFarScalar + distanceDisplayCondition?: Property | DistanceDisplayCondition + disableDepthTestDistance?: Property | number + }; +} + +/** + * Describes a graphical point located at the position of the containing {@link Entity}. + * @param [options] - Object describing initialization options + */ +export class PointGraphics { + constructor(options?: PointGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the point. + */ + show: Property | undefined; + /** + * Gets or sets the numeric Property specifying the size in pixels. + */ + pixelSize: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the point. + */ + color: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the the outline width in pixels. + */ + outlineWidth: Property | undefined; + /** + * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance. + If undefined, a constant size is used. + */ + scaleByDistance: Property | undefined; + /** + * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera. + A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the points's translucency remains clamped to the nearest bound. + */ + translucencyByDistance: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + */ + disableDepthTestDistance: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: PointGraphics): PointGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: PointGraphics): void; +} + +/** + * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}. + * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities. + * @param entityCollection - The entityCollection to visualize. + */ +export class PointVisualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + /** + * Updates the primitives created by this visualizer to match their + Entity counterpart at the given time. + * @param time - The time to update to. + * @returns This function always returns true. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes and destroys all primitives created by this instance. + */ + destroy(): void; +} + +/** + * A {@link GeometryUpdater} for polygons. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class PolygonGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; +} + +export namespace PolygonGraphics { + /** + * Initialization options for the PolygonGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the polygon. + * @property [hierarchy] - A Property specifying the {@link PolygonHierarchy}. + * @property [height = 0] - A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. + * @property [extrudedHeight] - A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface. + * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to. + * @property [stRotation = 0.0] - A numeric property specifying the rotation of the polygon texture counter-clockwise from north. + * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point. + * @property [fill = true] - A boolean Property specifying whether the polygon is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the polygon. + * @property [outline = false] - A boolean Property specifying whether the polygon is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [perPositionHeight = false] - A boolean specifying whether or not the height of each position is used. + * @property [closeTop = true] - When false, leaves off the top of an extruded polygon open. + * @property [closeBottom = true] - When false, leaves off the bottom of an extruded polygon open. + * @property [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polygon casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polygon will be displayed. + * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground. + * @property [zIndex = 0] - A property specifying the zIndex used for ordering ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified. + */ + type ConstructorOptions = { + show?: Property | boolean + hierarchy?: Property | PolygonHierarchy + height?: Property | number + heightReference?: Property | HeightReference + extrudedHeight?: Property | number + extrudedHeightReference?: Property | HeightReference + stRotation?: Property | number + granularity?: Property | number + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + perPositionHeight?: Property | boolean + closeTop?: boolean | boolean + closeBottom?: boolean | boolean + arcType?: Property | ArcType + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + classificationType?: Property | ClassificationType + zIndex?: ConstantProperty | number + }; +} + +/** + * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes. +The polygon conforms to the curvature of the globe and can be placed on the surface or +at altitude and can optionally be extruded into a volume. + * @param [options] - Object describing initialization options + */ +export class PolygonGraphics { + constructor(options?: PolygonGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the polygon. + */ + show: Property | undefined; + /** + * Gets or sets the Property specifying the {@link PolygonHierarchy}. + */ + hierarchy: Property | undefined; + /** + * Gets or sets the numeric Property specifying the constant altitude of the polygon. + */ + height: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the numeric Property specifying the altitude of the polygon extrusion. + If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude. + If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude. + */ + extrudedHeight: Property | undefined; + /** + * Gets or sets the Property specifying the extruded {@link HeightReference}. + */ + extrudedHeightReference: Property | undefined; + /** + * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north. + */ + stRotation: Property | undefined; + /** + * Gets or sets the numeric Property specifying the angular distance between points on the polygon. + */ + granularity: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the Property specifying the material used to fill the polygon. + */ + material: MaterialProperty; + /** + * Gets or sets the Property specifying whether the polygon is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Gets or sets the boolean specifying whether or not the the height of each position is used. + If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position. + If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}. + */ + perPositionHeight: Property | undefined; + /** + * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included. + */ + closeTop: Property | undefined; + /** + * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included. + */ + closeBottom: Property | undefined; + /** + * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use. + */ + arcType: Property | undefined; + /** + * Get or sets the enum Property specifying whether the polygon + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground. + */ + classificationType: Property | undefined; + /** + * Gets or sets the zIndex Prperty specifying the ordering of ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified. + */ + zIndex: ConstantProperty | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: PolygonGraphics): PolygonGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: PolygonGraphics): void; +} + +/** + * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms. + * @param [color = Color.WHITE] - The {@link Color} Property to be used. + */ +export class PolylineArrowMaterialProperty { + constructor(color?: Property | Color); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the {@link Color} {@link Property}. + */ + color: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms. + * @param [options] - Object with the following properties: + * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line. + * @param [options.gapColor = Color.TRANSPARENT] - A Property specifying the {@link Color} of the gaps in the line. + * @param [options.dashLength = 16.0] - A numeric Property specifying the length of the dash pattern in pixels. + * @param [options.dashPattern = 255.0] - A numeric Property specifying a 16 bit pattern for the dash + */ +export class PolylineDashMaterialProperty { + constructor(options?: { + color?: Property | Color + gapColor?: Property | Color + dashLength?: Property | number + dashPattern?: Property | number + }); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the Property specifying the {@link Color} of the line. + */ + color: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the gaps in the line. + */ + gapColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the length of a dash cycle + */ + dashLength: Property | undefined; + /** + * Gets or sets the numeric Property specifying a dash pattern + */ + dashPattern: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link GeometryUpdater} for polylines. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class PolylineGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Gets the unique ID associated with this updater + */ + readonly id: string; + /** + * Gets the entity associated with this geometry. + */ + readonly entity: Entity; + /** + * Gets a value indicating if the geometry has a fill component. + */ + readonly fillEnabled: boolean; + /** + * Gets a value indicating if fill visibility varies with simulation time. + */ + readonly hasConstantFill: boolean; + /** + * Gets the material property used to fill the geometry. + */ + readonly fillMaterialProperty: MaterialProperty; + /** + * Gets the material property used to fill the geometry when it fails the depth test. + */ + readonly depthFailMaterialProperty: MaterialProperty; + /** + * Gets a value indicating if the geometry has an outline component. + */ + readonly outlineEnabled: boolean; + /** + * Gets a value indicating if outline visibility varies with simulation time. + */ + readonly hasConstantOutline: boolean; + /** + * Gets the {@link Color} property for the geometry outline. + */ + readonly outlineColorProperty: Property; + /** + * Gets the property specifying whether the geometry + casts or receives shadows from light sources. + */ + readonly shadowsProperty: Property; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed. + */ + readonly distanceDisplayConditionProperty: Property; + /** + * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground. + */ + readonly classificationTypeProperty: Property; + /** + * Gets a value indicating if the geometry is time-varying. + If true, all visualization is delegated to the {@link DynamicGeometryUpdater} + returned by GeometryUpdater#createDynamicUpdater. + */ + readonly isDynamic: boolean; + /** + * Gets a value indicating if the geometry is closed. + This property is only valid for static geometry. + */ + readonly isClosed: boolean; + /** + * Gets an event that is raised whenever the public properties + of this updater change. + */ + readonly geometryChanged: boolean; + /** + * Gets a value indicating if the path of the line. + */ + readonly arcType: ArcType; + /** + * Gets a value indicating if the geometry is clamped to the ground. + Returns false if polylines on terrain is not supported. + */ + readonly clampToGround: boolean; + /** + * Gets the zindex + */ + readonly zIndex: number; + /** + * Checks if the geometry is outlined at the provided time. + * @param time - The time for which to retrieve visibility. + * @returns true if geometry is outlined at the provided time, false otherwise. + */ + isOutlineVisible(time: JulianDate): boolean; + /** + * Checks if the geometry is filled at the provided time. + * @param time - The time for which to retrieve visibility. + * @returns true if geometry is filled at the provided time, false otherwise. + */ + isFilled(time: JulianDate): boolean; + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys and resources used by the object. Once an object is destroyed, it should not be used. + */ + destroy(): void; +} + +/** + * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms. + * @param [options] - Object with the following properties: + * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line. + * @param [options.glowPower = 0.25] - A numeric Property specifying the strength of the glow, as a percentage of the total line width. + * @param [options.taperPower = 1.0] - A numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used. + */ +export class PolylineGlowMaterialProperty { + constructor(options?: { + color?: Property | Color + glowPower?: Property | number + taperPower?: Property | number + }); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the Property specifying the {@link Color} of the line. + */ + color: Property | undefined; + /** + * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0). + */ + glowPower: Property | undefined; + /** + * Gets or sets the numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used. + */ + taperPower: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +export namespace PolylineGraphics { + /** + * Initialization options for the PolylineGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the polyline. + * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the line strip. + * @property [width = 1.0] - A numeric Property specifying the width in pixels. + * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE. + * @property [material = Color.WHITE] - A Property specifying the material used to draw the polyline. + * @property [depthFailMaterial] - A property specifying the material used to draw the polyline when it is below the terrain. + * @property [arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. + * @property [clampToGround = false] - A boolean Property specifying whether the Polyline should be clamped to the ground. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polyline casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polyline will be displayed. + * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground. + * @property [zIndex = 0] - A Property specifying the zIndex used for ordering ground geometry. Only has an effect if `clampToGround` is true and polylines on terrain is supported. + */ + type ConstructorOptions = { + show?: Property | boolean + positions?: Property | Cartesian3[] + width?: Property | number + granularity?: Property | number + material?: MaterialProperty | Color + depthFailMaterial?: MaterialProperty | Color + arcType?: Property | ArcType + clampToGround?: Property | boolean + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + classificationType?: Property | ClassificationType + zIndex?: Property | number + }; +} + +/** + * Describes a polyline. The first two positions define a line segment, +and each additional position defines a line segment from the previous position. The segments +can be linear connected points, great arcs, or clamped to terrain. + * @param [options] - Object describing initialization options + */ +export class PolylineGraphics { + constructor(options?: PolylineGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the polyline. + */ + show: Property | undefined; + /** + * Gets or sets the Property specifying the array of {@link Cartesian3} + positions that define the line strip. + */ + positions: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width in pixels. + */ + width: Property | undefined; + /** + * Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE and clampToGround is false. + */ + granularity: Property | undefined; + /** + * Gets or sets the Property specifying the material used to draw the polyline. + */ + material: MaterialProperty; + /** + * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test. + <p> + Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, + there may be artifacts. + </p> + */ + depthFailMaterial: MaterialProperty; + /** + * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected. + */ + arcType: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the polyline + should be clamped to the ground. + */ + clampToGround: Property | undefined; + /** + * Get or sets the enum Property specifying whether the polyline + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground. + */ + classificationType: Property | undefined; + /** + * Gets or sets the zIndex Property specifying the ordering of the polyline. Only has an effect if `clampToGround` is true and polylines on terrain is supported. + */ + zIndex: ConstantProperty | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: PolylineGraphics): PolylineGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: PolylineGraphics): void; +} + +/** + * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms. + * @param [options] - Object with the following properties: + * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line. + * @param [options.outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @param [options.outlineWidth = 1.0] - A numeric Property specifying the width of the outline, in pixels. + */ +export class PolylineOutlineMaterialProperty { + constructor(options?: { + color?: Property | Color + outlineColor?: Property | Color + outlineWidth?: Property | number + }); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the Property specifying the {@link Color} of the line. + */ + color: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A visualizer for polylines represented by {@link Primitive} instances. + * @param scene - The scene the primitives will be rendered in. + * @param entityCollection - The entityCollection to visualize. + * @param [primitives = scene.primitives] - A collection to add primitives related to the entities + * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities + */ +export class PolylineVisualizer { + constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection); + /** + * Updates all of the primitives created by this visualizer to match their + Entity counterpart at the given time. + * @param time - The time to update to. + * @returns True if the visualizer successfully updated to the provided time, + false if the visualizer is waiting for asynchronous primitives to be created. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes and destroys all primitives created by this instance. + */ + destroy(): void; +} + +/** + * A {@link GeometryUpdater} for polyline volumes. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class PolylineVolumeGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; +} + +export namespace PolylineVolumeGraphics { + /** + * Initialization options for the PolylineVolumeGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the volume. + * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the line strip. + * @property [shape] - A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded. + * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners. + * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point. + * @property [fill = true] - A boolean Property specifying whether the volume is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the volume. + * @property [outline = false] - A boolean Property specifying whether the volume is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the volume casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this volume will be displayed. + */ + type ConstructorOptions = { + show?: Property | boolean + positions?: Property | Cartesian3[] + shape?: Property | Cartesian2[] + cornerType?: Property | CornerType + granularity?: Property | number + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + }; +} + +/** + * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it. +The resulting volume conforms to the curvature of the globe. + * @param [options] - Object describing initialization options + */ +export class PolylineVolumeGraphics { + constructor(options?: PolylineVolumeGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the volume. + */ + show: Property | undefined; + /** + * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip. + */ + positions: Property | undefined; + /** + * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded. + */ + shape: Property | undefined; + /** + * Gets or sets the {@link CornerType} Property specifying the style of the corners. + */ + cornerType: Property | undefined; + /** + * Gets or sets the numeric Property specifying the angular distance between points on the volume. + */ + granularity: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the volume is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the Property specifying the material used to fill the volume. + */ + material: MaterialProperty; + /** + * Gets or sets the Property specifying whether the volume is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Get or sets the enum Property specifying whether the volume + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: PolylineVolumeGraphics): void; +} + +/** + * The interface for all {@link Property} objects that define a world +location as a {@link Cartesian3} with an associated {@link ReferenceFrame}. +This type defines an interface and cannot be instantiated directly. + */ +export class PositionProperty { + constructor(); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets the reference frame that the position is defined in. + */ + referenceFrame: ReferenceFrame; + /** + * Gets the value of the property at the provided time in the fixed frame. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: Cartesian3): Cartesian3; + /** + * Gets the value of the property at the provided time and in the provided reference frame. + * @param time - The time for which to retrieve the value. + * @param referenceFrame - The desired referenceFrame of the result. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link Property} whose value is an array whose items are the computed value +of other PositionProperty instances. + * @param [value] - An array of Property instances. + * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. + */ +export class PositionPropertyArray { + constructor(value?: Property[], referenceFrame?: ReferenceFrame); + /** + * Gets a value indicating if this property is constant. This property + is considered constant if all property items in the array are constant. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever setValue is called with data different + than the current value or one of the properties in the array also changes. + */ + readonly definitionChanged: Event; + /** + * Gets the reference frame in which the position is defined. + */ + referenceFrame: ReferenceFrame; + /** + * Gets the value of the property. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: Cartesian3[]): Cartesian3[]; + /** + * Gets the value of the property at the provided time and in the provided reference frame. + * @param time - The time for which to retrieve the value. + * @param referenceFrame - The desired referenceFrame of the result. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3[]): Cartesian3[]; + /** + * Sets the value of the property. + * @param value - An array of Property instances. + */ + setValue(value: Property[]): void; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * The interface for all properties, which represent a value that can optionally vary over time. +This type defines an interface and cannot be instantiated directly. + */ +export class Property { + constructor(); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link Property} whose value is an array whose items are the computed value +of other property instances. + * @param [value] - An array of Property instances. + */ +export class PropertyArray { + constructor(value?: Property[]); + /** + * Gets a value indicating if this property is constant. This property + is considered constant if all property items in the array are constant. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever setValue is called with data different + than the current value or one of the properties in the array also changes. + */ + readonly definitionChanged: Event; + /** + * Gets the value of the property. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter, which is an array of values produced by evaluating each of the contained properties at the given time or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: object[]): object[]; + /** + * Sets the value of the property. + * @param value - An array of Property instances. + */ + setValue(value: Property[]): void; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +export interface PropertyBag extends DictionaryLike { +} + +/** + * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties. + * @param [value] - An object, containing key-value mapping of property names to properties. + * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property. + */ +export class PropertyBag implements DictionaryLike { + constructor(value?: any, createPropertyCallback?: (...params: any[]) => any); + /** + * Gets the names of all properties registered on this instance. + */ + propertyNames: any[]; + /** + * Gets a value indicating if this property is constant. This property + is considered constant if all property items in this object are constant. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the set of properties contained in this + object changes, or one of the properties itself changes. + */ + readonly definitionChanged: Event; + /** + * Determines if this object has defined a property with the given name. + * @param propertyName - The name of the property to check for. + * @returns True if this object has defined a property with the given name, false otherwise. + */ + hasProperty(propertyName: string): boolean; + /** + * Adds a property to this object. + * @param propertyName - The name of the property to add. + * @param [value] - The value of the new property, if provided. + * @param [createPropertyCallback] - A function that will be called when the value of this new property is set to a value that is not a Property. + */ + addProperty(propertyName: string, value?: any, createPropertyCallback?: (...params: any[]) => any): void; + /** + * Removed a property previously added with addProperty. + * @param propertyName - The name of the property to remove. + */ + removeProperty(propertyName: string): void; + /** + * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall + result will be an object, mapping property names to those values. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + Note that any properties in result which are not part of this PropertyBag will be left as-is. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property. + */ + merge(source: any, createPropertyCallback?: (...params: any[]) => any): void; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link GeometryUpdater} for rectangles. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class RectangleGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; +} + +export namespace RectangleGraphics { + /** + * Initialization options for the RectangleGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the rectangle. + * @property [coordinates] - The Property specifying the {@link Rectangle}. + * @property [height = 0] - A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface. + * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to. + * @property [extrudedHeight] - A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface. + * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to. + * @property [rotation = 0.0] - A numeric property specifying the rotation of the rectangle clockwise from north. + * @property [stRotation = 0.0] - A numeric property specifying the rotation of the rectangle texture counter-clockwise from north. + * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the rectangle. + * @property [fill = true] - A boolean Property specifying whether the rectangle is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the rectangle. + * @property [outline = false] - A boolean Property specifying whether the rectangle is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the rectangle casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this rectangle will be displayed. + * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. + * @property [zIndex = 0] - A Property specifying the zIndex used for ordering ground geometry. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified. + */ + type ConstructorOptions = { + show?: Property | boolean + coordinates?: Property | Rectangle + height?: Property | number + heightReference?: Property | HeightReference + extrudedHeight?: Property | number + extrudedHeightReference?: Property | HeightReference + rotation?: Property | number + stRotation?: Property | number + granularity?: Property | number + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + classificationType?: Property | ClassificationType + zIndex?: Property | number + }; +} + +/** + * Describes graphics for a {@link Rectangle}. +The rectangle conforms to the curvature of the globe and can be placed on the surface or +at altitude and can optionally be extruded into a volume. + * @param [options] - Object describing initialization options + */ +export class RectangleGraphics { + constructor(options?: RectangleGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the rectangle. + */ + show: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Rectangle}. + */ + coordinates: Property | undefined; + /** + * Gets or sets the numeric Property specifying the altitude of the rectangle. + */ + height: Property | undefined; + /** + * Gets or sets the Property specifying the {@link HeightReference}. + */ + heightReference: Property | undefined; + /** + * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion. + Setting this property creates volume starting at height and ending at this altitude. + */ + extrudedHeight: Property | undefined; + /** + * Gets or sets the Property specifying the extruded {@link HeightReference}. + */ + extrudedHeightReference: Property | undefined; + /** + * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north. + */ + rotation: Property | undefined; + /** + * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north. + */ + stRotation: Property | undefined; + /** + * Gets or sets the numeric Property specifying the angular distance between points on the rectangle. + */ + granularity: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the Property specifying the material used to fill the rectangle. + */ + material: MaterialProperty; + /** + * Gets or sets the Property specifying whether the rectangle is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Get or sets the enum Property specifying whether the rectangle + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. + */ + classificationType: Property | undefined; + /** + * Gets or sets the zIndex Property specifying the ordering of the rectangle. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified. + */ + zIndex: ConstantProperty | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: RectangleGraphics): RectangleGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: RectangleGraphics): void; +} + +/** + * A {@link Property} which transparently links to another property on a provided object. + * @example + * var collection = new Cesium.EntityCollection(); + +//Create a new entity and assign a billboard scale. +var object1 = new Cesium.Entity({id:'object1'}); +object1.billboard = new Cesium.BillboardGraphics(); +object1.billboard.scale = new Cesium.ConstantProperty(2.0); +collection.add(object1); + +//Create a second entity and reference the scale from the first one. +var object2 = new Cesium.Entity({id:'object2'}); +object2.model = new Cesium.ModelGraphics(); +object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']); +collection.add(object2); + +//Create a third object, but use the fromString helper function. +var object3 = new Cesium.Entity({id:'object3'}); +object3.billboard = new Cesium.BillboardGraphics(); +object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale'); +collection.add(object3); + +//You can refer to an entity with a # or . in id and property names by escaping them. +var object4 = new Cesium.Entity({id:'#object.4'}); +object4.billboard = new Cesium.BillboardGraphics(); +object4.billboard.scale = new Cesium.ConstantProperty(2.0); +collection.add(object4); + +var object5 = new Cesium.Entity({id:'object5'}); +object5.billboard = new Cesium.BillboardGraphics(); +object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale'); +collection.add(object5); + * @param targetCollection - The entity collection which will be used to resolve the reference. + * @param targetId - The id of the entity which is being referenced. + * @param targetPropertyNames - The names of the property on the target entity which we will use. + */ +export class ReferenceProperty { + constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string[]); + /** + * Gets a value indicating if this property is constant. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever the referenced property's definition is changed. + */ + readonly definitionChanged: Event; + /** + * Gets the reference frame that the position is defined in. + This property is only valid if the referenced property is a {@link PositionProperty}. + */ + readonly referenceFrame: ReferenceFrame; + /** + * Gets the id of the entity being referenced. + */ + readonly targetId: string; + /** + * Gets the collection containing the entity being referenced. + */ + readonly targetCollection: EntityCollection; + /** + * Gets the array of property names used to retrieve the referenced property. + */ + readonly targetPropertyNames: string[]; + /** + * Gets the resolved instance of the underlying referenced property. + */ + readonly resolvedProperty: Property | undefined; + /** + * Creates a new instance given the entity collection that will + be used to resolve it and a string indicating the target entity id and property. + The format of the string is "objectId#foo.bar", where # separates the id from + property path and . separates sub-properties. If the reference identifier or + or any sub-properties contains a # . or \ they must be escaped. + * @returns A new instance of ReferenceProperty. + */ + static fromString(targetCollection: EntityCollection, referenceString: string): ReferenceProperty; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Gets the value of the property at the provided time and in the provided reference frame. + This method is only valid if the property being referenced is a {@link PositionProperty}. + * @param time - The time for which to retrieve the value. + * @param referenceFrame - The desired referenceFrame of the result. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + /** + * Gets the {@link Material} type at the provided time. + This method is only valid if the property being referenced is a {@link MaterialProperty}. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +export namespace Rotation { + /** + * The number of elements used to pack the object into an array. + */ + var packedLength: number + /** + * Stores the provided instance into the provided array. + * @param value - The value to pack. + * @param array - The array to pack into. + * @param [startingIndex = 0] - The index into the array at which to start packing the elements. + * @returns The array that was packed into + */ + function pack(value: Rotation, array: number[], startingIndex?: number): number[]; + /** + * Retrieves an instance from a packed array. + * @param array - The packed array. + * @param [startingIndex = 0] - The starting index of the element to be unpacked. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Rotation instance if one was not provided. + */ + function unpack(array: number[], startingIndex?: number, result?: Rotation): Rotation; + /** + * Converts a packed array into a form suitable for interpolation. + * @param packedArray - The packed array. + * @param [startingIndex = 0] - The index of the first element to be converted. + * @param [lastIndex = packedArray.length] - The index of the last element to be converted. + * @param [result] - The object into which to store the result. + */ + function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void; + /** + * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}. + * @param array - The array previously packed for interpolation. + * @param sourceArray - The original packed array. + * @param [firstIndex = 0] - The firstIndex used to convert the array. + * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array. + * @param [result] - The object into which to store the result. + * @returns The modified result parameter or a new Rotation instance if one was not provided. + */ + function unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Rotation): Rotation; +} + +/** + * Represents a {@link Packable} number that always interpolates values +towards the shortest angle of rotation. This object is never used directly +but is instead passed to the constructor of {@link SampledProperty} +in order to represent a two-dimensional angle of rotation. + * @example + * var time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00'); +var time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00'); +var time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00'); + +var property = new Cesium.SampledProperty(Cesium.Rotation); +property.addSample(time1, 0); +property.addSample(time3, Cesium.Math.toRadians(350)); + +//Getting the value at time2 will equal 355 degrees instead +//of 175 degrees (which is what you get if you construct +//a SampledProperty(Number) instead. Note, the actual +//return value is in radians, not degrees. +property.getValue(time2); + */ +export interface Rotation { +} + +/** + * A {@link SampledProperty} which is also a {@link PositionProperty}. + * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. + * @param [numberOfDerivatives = 0] - The number of derivatives that accompany each position; i.e. velocity, acceleration, etc... + */ +export class SampledPositionProperty { + constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets the reference frame in which the position is defined. + */ + referenceFrame: ReferenceFrame; + /** + * Gets the degree of interpolation to perform when retrieving a value. Call <code>setInterpolationOptions</code> to set this. + */ + readonly interpolationDegree: number; + /** + * Gets the interpolation algorithm to use when retrieving a value. Call <code>setInterpolationOptions</code> to set this. + */ + readonly interpolationAlgorithm: InterpolationAlgorithm; + /** + * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc. + */ + numberOfDerivatives: number; + /** + * Gets or sets the type of extrapolation to perform when a value + is requested at a time after any available samples. + */ + forwardExtrapolationType: ExtrapolationType; + /** + * Gets or sets the amount of time to extrapolate forward before + the property becomes undefined. A value of 0 will extrapolate forever. + */ + forwardExtrapolationDuration: number; + /** + * Gets or sets the type of extrapolation to perform when a value + is requested at a time before any available samples. + */ + backwardExtrapolationType: ExtrapolationType; + /** + * Gets or sets the amount of time to extrapolate backward + before the property becomes undefined. A value of 0 will extrapolate forever. + */ + backwardExtrapolationDuration: number; + /** + * Gets the position at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: Cartesian3): Cartesian3; + /** + * Gets the position at the provided time and in the provided reference frame. + * @param time - The time for which to retrieve the value. + * @param referenceFrame - The desired referenceFrame of the result. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + /** + * Sets the algorithm and degree to use when interpolating a position. + * @param [options] - Object with the following properties: + * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged. + * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged. + */ + setInterpolationOptions(options?: { + interpolationAlgorithm?: InterpolationAlgorithm + interpolationDegree?: number + }): void; + /** + * Adds a new sample. + * @param time - The sample time. + * @param position - The position at the provided time. + * @param [derivatives] - The array of derivative values at the provided time. + */ + addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void; + /** + * Adds multiple samples via parallel arrays. + * @param times - An array of JulianDate instances where each index is a sample time. + * @param positions - An array of Cartesian3 position instances, where each value corresponds to the provided time index. + * @param [derivatives] - An array where each value is another array containing derivatives for the corresponding time index. + */ + addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void; + /** + * Adds samples as a single packed array where each new sample is represented as a date, + followed by the packed representation of the corresponding value and derivatives. + * @param packedSamples - The array of packed samples. + * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds. + */ + addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void; + /** + * Removes a sample at the given time, if present. + * @param time - The sample time. + * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise. + */ + removeSample(time: JulianDate): boolean; + /** + * Removes all samples for the given time interval. + * @param time - The time interval for which to remove all samples. + */ + removeSamples(time: TimeInterval): void; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link Property} whose value is interpolated for a given time from the +provided set of samples and specified interpolation algorithm and degree. + * @example + * //Create a linearly interpolated Cartesian2 +var property = new Cesium.SampledProperty(Cesium.Cartesian2); + +//Populate it with data +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0)); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7)); + +//Retrieve an interpolated value +var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z')); + * @example + * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation +var property = new Cesium.SampledProperty(Number); +property.setInterpolationOptions({ + interpolationDegree : 3, + interpolationAlgorithm : Cesium.HermitePolynomialApproximation +}); + +//Populate it with data +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0); +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0); + +//Samples can be added in any order. +property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2); + +//Retrieve an interpolated value +var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z')); + * @param type - The type of property. + * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types. + */ +export class SampledProperty { + constructor(type: number | Packable, derivativeTypes?: Packable[]); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets the type of property. + */ + type: any; + /** + * Gets the derivative types used by this property. + */ + derivativeTypes: Packable[]; + /** + * Gets the degree of interpolation to perform when retrieving a value. + */ + interpolationDegree: number; + /** + * Gets the interpolation algorithm to use when retrieving a value. + */ + interpolationAlgorithm: InterpolationAlgorithm; + /** + * Gets or sets the type of extrapolation to perform when a value + is requested at a time after any available samples. + */ + forwardExtrapolationType: ExtrapolationType; + /** + * Gets or sets the amount of time to extrapolate forward before + the property becomes undefined. A value of 0 will extrapolate forever. + */ + forwardExtrapolationDuration: number; + /** + * Gets or sets the type of extrapolation to perform when a value + is requested at a time before any available samples. + */ + backwardExtrapolationType: ExtrapolationType; + /** + * Gets or sets the amount of time to extrapolate backward + before the property becomes undefined. A value of 0 will extrapolate forever. + */ + backwardExtrapolationDuration: number; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Sets the algorithm and degree to use when interpolating a value. + * @param [options] - Object with the following properties: + * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged. + * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged. + */ + setInterpolationOptions(options?: { + interpolationAlgorithm?: InterpolationAlgorithm + interpolationDegree?: number + }): void; + /** + * Adds a new sample. + * @param time - The sample time. + * @param value - The value at the provided time. + * @param [derivatives] - The array of derivatives at the provided time. + */ + addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void; + /** + * Adds an array of samples. + * @param times - An array of JulianDate instances where each index is a sample time. + * @param values - The array of values, where each value corresponds to the provided times index. + * @param [derivativeValues] - An array where each item is the array of derivatives at the equivalent time index. + */ + addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void; + /** + * Adds samples as a single packed array where each new sample is represented as a date, + followed by the packed representation of the corresponding value and derivatives. + * @param packedSamples - The array of packed samples. + * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds. + */ + addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void; + /** + * Removes a sample at the given time, if present. + * @param time - The sample time. + * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise. + */ + removeSample(time: JulianDate): boolean; + /** + * Removes all samples for the given time interval. + * @param time - The time interval for which to remove all samples. + */ + removeSamples(time: TimeInterval): void; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms. + * @param [options] - Object with the following properties: + * @param [options.orientation = StripeOrientation.HORIZONTAL] - A Property specifying the {@link StripeOrientation}. + * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}. + * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}. + * @param [options.offset = 0] - A numeric Property specifying how far into the pattern to start the material. + * @param [options.repeat = 1] - A numeric Property specifying how many times the stripes repeat. + */ +export class StripeMaterialProperty { + constructor(options?: { + orientation?: Property | StripeOrientation + evenColor?: Property | Color + oddColor?: Property | Color + offset?: Property | number + repeat?: Property | number + }); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the Property specifying the {@link StripeOrientation}/ + */ + orientation: Property | undefined; + /** + * Gets or sets the Property specifying the first {@link Color}. + */ + evenColor: Property | undefined; + /** + * Gets or sets the Property specifying the second {@link Color}. + */ + oddColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the point into the pattern + to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning + of the odd color, 2.0 being the even color again, and any multiple or fractional values + being in between. + */ + offset: Property | undefined; + /** + * Gets or sets the numeric Property specifying how many times the stripes repeat. + */ + repeat: Property | undefined; + /** + * Gets the {@link Material} type at the provided time. + * @param time - The time for which to retrieve the type. + * @returns The type of material. + */ + getType(time: JulianDate): string; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * Defined the orientation of stripes in {@link StripeMaterialProperty}. + */ +export enum StripeOrientation { + /** + * Horizontal orientation. + */ + HORIZONTAL = 0, + /** + * Vertical orientation. + */ + VERTICAL = 1 +} + +/** + * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}. + * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined. + */ +export class TimeIntervalCollectionPositionProperty { + constructor(referenceFrame?: ReferenceFrame); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is considered to have changed if a call to getValue would return + a different result for the same time. + */ + readonly definitionChanged: Event; + /** + * Gets the interval collection. + */ + intervals: TimeIntervalCollection; + /** + * Gets the reference frame in which the position is defined. + */ + referenceFrame: ReferenceFrame; + /** + * Gets the value of the property at the provided time in the fixed frame. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Gets the value of the property at the provided time and in the provided reference frame. + * @param time - The time for which to retrieve the value. + * @param referenceFrame - The desired referenceFrame of the result. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the +data property of each {@link TimeInterval} represents the value at time. + * @example + * //Create a Cartesian2 interval property which contains data on August 1st, 2012 +//and uses a different value every 6 hours. +var composite = new Cesium.TimeIntervalCollectionProperty(); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z', + isStartIncluded : true, + isStopIncluded : false, + data : new Cesium.Cartesian2(2.0, 3.4) +})); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z', + isStartIncluded : true, + isStopIncluded : false, + data : new Cesium.Cartesian2(12.0, 2.7) +})); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z', + isStartIncluded : true, + isStopIncluded : false, + data : new Cesium.Cartesian2(5.0, 12.4) +})); +composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({ + iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z', + isStartIncluded : true, + isStopIncluded : true, + data : new Cesium.Cartesian2(85.0, 4.1) +})); + */ +export class TimeIntervalCollectionProperty { + constructor(); + /** + * Gets a value indicating if this property is constant. A property is considered + constant if getValue always returns the same result for the current definition. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + The definition is changed whenever setValue is called with data different + than the current value. + */ + readonly definitionChanged: Event; + /** + * Gets the interval collection. + */ + intervals: TimeIntervalCollection; + /** + * Gets the value of the property at the provided time. + * @param time - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time: JulianDate, result?: any): any; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link Property} which evaluates to a {@link Quaternion} rotation +based on the velocity of the provided {@link PositionProperty}. + * @example + * //Create an entity with position and orientation. +var position = new Cesium.SampledProperty(); +position.addSamples(...); +var entity = viewer.entities.add({ + position : position, + orientation : new Cesium.VelocityOrientationProperty(position) +})); + * @param [position] - The position property used to compute the orientation. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine which way is up. + */ +export class VelocityOrientationProperty { + constructor(position?: PositionProperty, ellipsoid?: Ellipsoid); + /** + * Gets a value indicating if this property is constant. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the position property used to compute orientation. + */ + position: Property | undefined; + /** + * Gets or sets the ellipsoid used to determine which way is up. + */ + ellipsoid: Property | undefined; + /** + * Gets the value of the property at the provided time. + * @param [time] - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time?: JulianDate, result?: Quaternion): Quaternion; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * A {@link Property} which evaluates to a {@link Cartesian3} vector +based on the velocity of the provided {@link PositionProperty}. + * @example + * //Create an entity with a billboard rotated to match its velocity. +var position = new Cesium.SampledProperty(); +position.addSamples(...); +var entity = viewer.entities.add({ + position : position, + billboard : { + image : 'image.png', + alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector + } +})); + * @param [position] - The position property used to compute the velocity. + * @param [normalize = true] - Whether to normalize the computed velocity vector. + */ +export class VelocityVectorProperty { + constructor(position?: PositionProperty, normalize?: boolean); + /** + * Gets a value indicating if this property is constant. + */ + readonly isConstant: boolean; + /** + * Gets the event that is raised whenever the definition of this property changes. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the position property used to compute the velocity vector. + */ + position: Property | undefined; + /** + * Gets or sets whether the vector produced by this property + will be normalized or not. + */ + normalize: boolean; + /** + * Gets the value of the property at the provided time. + * @param [time] - The time for which to retrieve the value. + * @param [result] - The object to store the value into, if omitted, a new instance is created and returned. + * @returns The modified result parameter or a new instance if the result parameter was not supplied. + */ + getValue(time?: JulianDate, result?: Cartesian3): Cartesian3; + /** + * Compares this property to the provided property and returns + <code>true</code> if they are equal, <code>false</code> otherwise. + * @param [other] - The other property. + * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise. + */ + equals(other?: Property): boolean; +} + +/** + * Defines the interface for visualizers. Visualizers are plug-ins to +{@link DataSourceDisplay} that render data associated with +{@link DataSource} instances. +This object is an interface for documentation purposes and is not intended +to be instantiated directly. + */ +export class Visualizer { + constructor(); + /** + * Updates the visualization to the provided time. + * @param time - The time. + * @returns True if the display was updated to the provided time, + false if the visualizer is waiting for an asynchronous operation to + complete before data can be updated. + */ + update(time: JulianDate): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Removes all visualization and cleans up any resources associated with this instance. + */ + destroy(): void; +} + +/** + * A {@link GeometryUpdater} for walls. +Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}. + * @param entity - The entity containing the geometry to be visualized. + * @param scene - The scene where visualization is taking place. + */ +export class WallGeometryUpdater { + constructor(entity: Entity, scene: Scene); + /** + * Creates the geometry instance which represents the fill of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the filled portion of the geometry. + */ + createFillGeometryInstance(time: JulianDate): GeometryInstance; + /** + * Creates the geometry instance which represents the outline of the geometry. + * @param time - The time to use when retrieving initial attribute values. + * @returns The geometry instance representing the outline portion of the geometry. + */ + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; +} + +export namespace WallGraphics { + /** + * Initialization options for the WallGraphics constructor + * @property [show = true] - A boolean Property specifying the visibility of the wall. + * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the top of the wall. + * @property [minimumHeights] - A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface. + * @property [maximumHeights] - A Property specifying an array of heights to be used for the top of the wall instead of the height of each position. + * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point. + * @property [fill = true] - A boolean Property specifying whether the wall is filled with the provided material. + * @property [material = Color.WHITE] - A Property specifying the material used to fill the wall. + * @property [outline = false] - A boolean Property specifying whether the wall is outlined. + * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline. + * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline. + * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the wall casts or receives shadows from light sources. + * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this wall will be displayed. + */ + type ConstructorOptions = { + show?: Property | boolean + positions?: Property | Cartesian3[] + minimumHeights?: Property | number[] + maximumHeights?: Property | number[] + granularity?: Property | number + fill?: Property | boolean + material?: MaterialProperty | Color + outline?: Property | boolean + outlineColor?: Property | Color + outlineWidth?: Property | number + shadows?: Property | ShadowMode + distanceDisplayCondition?: Property | DistanceDisplayCondition + }; +} + +/** + * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights. +The wall conforms to the curvature of the globe and can be placed along the surface or at altitude. + * @param [options] - Object describing initialization options + */ +export class WallGraphics { + constructor(options?: WallGraphics.ConstructorOptions); + /** + * Gets the event that is raised whenever a property or sub-property is changed or modified. + */ + readonly definitionChanged: Event; + /** + * Gets or sets the boolean Property specifying the visibility of the wall. + */ + show: Property | undefined; + /** + * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall. + */ + positions: Property | undefined; + /** + * Gets or sets the Property specifying an array of heights to be used for the bottom of the wall instead of the surface of the globe. + If defined, the array must be the same length as {@link Wall#positions}. + */ + minimumHeights: Property | undefined; + /** + * Gets or sets the Property specifying an array of heights to be used for the top of the wall instead of the height of each position. + If defined, the array must be the same length as {@link Wall#positions}. + */ + maximumHeights: Property | undefined; + /** + * Gets or sets the numeric Property specifying the angular distance between points on the wall. + */ + granularity: Property | undefined; + /** + * Gets or sets the boolean Property specifying whether the wall is filled with the provided material. + */ + fill: Property | undefined; + /** + * Gets or sets the Property specifying the material used to fill the wall. + */ + material: MaterialProperty; + /** + * Gets or sets the Property specifying whether the wall is outlined. + */ + outline: Property | undefined; + /** + * Gets or sets the Property specifying the {@link Color} of the outline. + */ + outlineColor: Property | undefined; + /** + * Gets or sets the numeric Property specifying the width of the outline. + */ + outlineWidth: Property | undefined; + /** + * Get or sets the enum Property specifying whether the wall + casts or receives shadows from light sources. + */ + shadows: Property | undefined; + /** + * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed. + */ + distanceDisplayCondition: Property | undefined; + /** + * Duplicates this instance. + * @param [result] - The object onto which to store the result. + * @returns The modified result parameter or a new instance if one was not provided. + */ + clone(result?: WallGraphics): WallGraphics; + /** + * Assigns each unassigned property on this object to the value + of the same property on the provided source object. + * @param source - The object to be merged into this object. + */ + merge(source: WallGraphics): void; +} + +/** + * The data type of a pixel. + */ +export enum PixelDatatype { + UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE, + UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT, + UNSIGNED_INT = WebGLConstants.UNSIGNED_INT, + FLOAT = WebGLConstants.FLOAT, + HALF_FLOAT = WebGLConstants.HALF_FLOAT_OES, + UNSIGNED_INT_24_8 = WebGLConstants.UNSIGNED_INT_24_8, + UNSIGNED_SHORT_4_4_4_4 = WebGLConstants.UNSIGNED_SHORT_4_4_4_4, + UNSIGNED_SHORT_5_5_5_1 = WebGLConstants.UNSIGNED_SHORT_5_5_5_1, + UNSIGNED_SHORT_5_6_5 = WebGLConstants.UNSIGNED_SHORT_5_6_5 +} + +/** + * Enumerates all possible filters used when magnifying WebGL textures. + */ +export enum TextureMagnificationFilter { + /** + * Samples the texture by returning the closest pixel. + */ + NEAREST = WebGLConstants.NEAREST, + /** + * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering. + */ + LINEAR = WebGLConstants.LINEAR +} + +/** + * Enumerates all possible filters used when minifying WebGL textures. + */ +export enum TextureMinificationFilter { + /** + * Samples the texture by returning the closest pixel. + */ + NEAREST = WebGLConstants.NEAREST, + /** + * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering. + */ + LINEAR = WebGLConstants.LINEAR, + /** + * Selects the nearest mip level and applies nearest sampling within that level. + <p> + Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. + </p> + */ + NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST, + /** + * Selects the nearest mip level and applies linear sampling within that level. + <p> + Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. + </p> + */ + LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST, + /** + * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results. + <p> + This option provides a good balance of visual quality and speed when sampling from a mipmapped texture. + </p> + <p> + Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. + </p> + */ + NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR, + /** + * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results. + <p> + This option provides a good balance of visual quality and speed when sampling from a mipmapped texture. + </p> + <p> + Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture. + </p> + */ + LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR +} + +/** + * An appearance defines the full GLSL vertex and fragment shaders and the +render state used to draw a {@link Primitive}. All appearances implement +this base <code>Appearance</code> interface. + * @param [options] - Object with the following properties: + * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled. + * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled. + * @param [options.material = Material.ColorType] - The material used to determine the fragment color. + * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. + * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. + * @param [options.renderState] - Optional render state to override the default render state. + */ +export class Appearance { + constructor(options?: { + translucent?: boolean + closed?: boolean + material?: Material + vertexShaderSource?: string + fragmentShaderSource?: string + renderState?: any + }); + /** + * The material used to determine the fragment color. Unlike other {@link Appearance} + properties, this is not read-only, so an appearance's material can change on the fly. + */ + material: Material; + /** + * When <code>true</code>, the geometry is expected to appear translucent. + */ + translucent: boolean; + /** + * The GLSL source code for the vertex shader. + */ + readonly vertexShaderSource: string; + /** + * The GLSL source code for the fragment shader. The full fragment shader + source is built procedurally taking into account the {@link Appearance#material}. + Use {@link Appearance#getFragmentShaderSource} to get the full source. + */ + readonly fragmentShaderSource: string; + /** + * The WebGL fixed-function state to use when rendering the geometry. + */ + readonly renderState: any; + /** + * When <code>true</code>, the geometry is expected to be closed. + */ + readonly closed: boolean; + /** + * Procedurally creates the full GLSL fragment shader source for this appearance + taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}. + * @returns The full GLSL fragment shader source. + */ + getFragmentShaderSource(): string; + /** + * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}. + * @returns <code>true</code> if the appearance is translucent. + */ + isTranslucent(): boolean; + /** + * Creates a render state. This is not the final render state instance; instead, + it can contain a subset of render state properties identical to the render state + created in the context. + * @returns The render state. + */ + getRenderState(): any; +} + +export namespace ArcGisMapServerImageryProvider { + /** + * Initialization options for the ArcGisMapServerImageryProvider constructor + * @property url - The URL of the ArcGIS MapServer service. + * @property [token] - The ArcGIS token used to authenticate with the ArcGIS MapServer service. + * @property [tileDiscardPolicy] - The policy that determines if a tile + is invalid and should be discarded. If this value is not specified, a default + {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a + {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case, + we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200), + (80,110), and (160, 130). If all of these pixels are transparent, the discard check is + disabled and no tiles are discarded. If any of them have a non-transparent color, any + tile that has the same values in these pixel locations is discarded. The end result of + these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure + that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this + parameter. + * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached + tiles are used if they are available. If false, any pre-cached tiles are ignored and the + 'export' service is used. + * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown. + * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke + the Identify service on the MapServer and return the features included in the response. If false, + {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) + without communicating with the server. Set this property to false if you don't want this provider's features to + be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. This parameter is ignored when accessing + a tiled layer. + * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles. + This parameter is ignored when accessing a tiled server. + * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified and used, + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. + * @property [credit] - A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server. + * @property [tileWidth = 256] - The width of each tile in pixels. This parameter is ignored when accessing a tiled server. + * @property [tileHeight = 256] - The height of each tile in pixels. This parameter is ignored when accessing a tiled server. + * @property [maximumLevel] - The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing + a tiled server. + */ + type ConstructorOptions = { + url: Resource | string + token?: string + tileDiscardPolicy?: TileDiscardPolicy + usePreCachedTilesIfAvailable?: boolean + layers?: string + enablePickFeatures?: boolean + rectangle?: Rectangle + tilingScheme?: TilingScheme + ellipsoid?: Ellipsoid + credit?: Credit | string + tileWidth?: number + tileHeight?: number + maximumLevel?: number + }; +} + +/** + * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are +used, if available. + * @example + * var esri = new Cesium.ArcGisMapServerImageryProvider({ + url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer' +}); + * @param options - Object describing initialization options + */ +export class ArcGisMapServerImageryProvider { + constructor(options: ArcGisMapServerImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will + invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false, + {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) + without communicating with the server. + */ + enablePickFeatures: boolean; + /** + * Gets the URL of the ArcGIS MapServer. + */ + readonly url: string; + /** + * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service. + */ + readonly token: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether this imagery provider is using pre-cached tiles from the + ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function + will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does + not have pre-cached tiles. + */ + readonly usingPrecachedTiles: boolean; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the comma-separated list of layer IDs to show. + */ + layers: string; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link ArcGisMapServerImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * /** + Asynchronously determines what features, if any, are located at a given longitude and latitude within + a tile. This function should not be called before {@link ImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +/** + * An enum describing the x, y, and z axes and helper conversion functions. + */ +export enum Axis { + /** + * Denotes the x-axis. + */ + X = 0, + /** + * Denotes the y-axis. + */ + Y = 1, + /** + * Denotes the z-axis. + */ + Z = 2 +} + +/** + * A viewport-aligned image positioned in the 3D scene, that is created +and rendered using a {@link BillboardCollection}. A billboard is created and its initial +properties are set by calling {@link BillboardCollection#add}. +<br /><br /> +<div align='center'> +<img src='Images/Billboard.png' width='400' height='300' /><br /> +Example billboards +</div> + */ +export class Billboard { + constructor(); + /** + * Determines if this billboard will be shown. Use this to hide or show a billboard, instead + of removing it and re-adding it to the collection. + */ + show: boolean; + /** + * Gets or sets the Cartesian position of this billboard. + */ + position: Cartesian3; + /** + * Gets or sets the height reference of this billboard. + */ + heightReference: HeightReference; + /** + * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used + to align multiple billboards and labels at the same position, e.g., an image and text. The + screen space origin is the top, left corner of the canvas; <code>x</code> increases from + left to right, and <code>y</code> increases from top to bottom. + <br /><br /> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td> + <td align='center'><code>b.pixeloffset = new Cartesian2(50, 25);</code><br/><img src='Images/Billboard.setPixelOffset.x50y-25.png' width='250' height='188' /></td> + </tr></table> + The billboard's origin is indicated by the yellow point. + </div> + */ + pixelOffset: Cartesian2; + /** + * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera. + A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined, + scaleByDistance will be disabled. + * @example + * // Example 1. + // Set a billboard's scaleByDistance to scale by 1.5 when the + // camera is 1500 meters from the billboard and disappear as + // the camera distance approaches 8.0e6 meters. + b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0); + * @example + * // Example 2. + // disable scaling by distance + b.scaleByDistance = undefined; + */ + scaleByDistance: NearFarScalar; + /** + * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera. + A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined, + translucencyByDistance will be disabled. + * @example + * // Example 1. + // Set a billboard's translucency to 1.0 when the + // camera is 1500 meters from the billboard and disappear as + // the camera distance approaches 8.0e6 meters. + b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); + * @example + * // Example 2. + // disable translucency by distance + b.translucencyByDistance = undefined; + */ + translucencyByDistance: NearFarScalar; + /** + * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera. + A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined, + pixelOffsetScaleByDistance will be disabled. + * @example + * // Example 1. + // Set a billboard's pixel offset scale to 0.0 when the + // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels + // in the y direction the camera distance approaches 8.0e6 meters. + b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0); + b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0); + * @example + * // Example 2. + // disable pixel offset by distance + b.pixelOffsetScaleByDistance = undefined; + */ + pixelOffsetScaleByDistance: NearFarScalar; + /** + * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed + coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and + <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates, + which is typically meters. + <br /><br /> + An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to + arrange a billboard above its corresponding 3D model. + <br /><br /> + Below, the billboard is positioned at the center of the Earth but an eye offset makes it always + appear on top of the Earth regardless of the viewer's or Earth's orientation. + <br /><br /> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td> + <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td> + </tr></table> + <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br /> + </div> + */ + eyeOffset: Cartesian3; + /** + * Gets or sets the horizontal origin of this billboard, which determines if the billboard is + to the left, center, or right of its anchor position. + <br /><br /> + <div align='center'> + <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br /> + </div> + * @example + * // Use a bottom, left origin + b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; + b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; + */ + horizontalOrigin: HorizontalOrigin; + /** + * Gets or sets the vertical origin of this billboard, which determines if the billboard is + to the above, below, or at the center of its anchor position. + <br /><br /> + <div align='center'> + <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br /> + </div> + * @example + * // Use a bottom, left origin + b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT; + b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM; + */ + verticalOrigin: VerticalOrigin; + /** + * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels. + A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than + <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks + the billboard. + <br /><br /> + <div align='center'> + <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/> + From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, + and <code>2.0</code>. + </div> + */ + scale: number; + /** + * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First, + the same white texture may be used by many different billboards, each with a different color, to create + colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below. + An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque. + <br /><br /> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td> + <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td> + </tr></table> + </div> + <br /> + The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>, + <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code> + (no intensity) to <code>1.0</code> (full intensity). + * @example + * // Example 1. Assign yellow. + b.color = Cesium.Color.YELLOW; + * @example + * // Example 2. Make a billboard 50% translucent. + b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5); + */ + color: Color; + /** + * Gets or sets the rotation angle in radians. + */ + rotation: number; + /** + * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards. + The default is the zero vector, which means the billboard is aligned to the screen up vector. + * @example + * // Example 1. + // Have the billboard up vector point north + billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z; + * @example + * // Example 2. + // Have the billboard point east. + billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z; + billboard.rotation = -Cesium.Math.PI_OVER_TWO; + * @example + * // Example 3. + // Reset the aligned axis + billboard.alignedAxis = Cesium.Cartesian3.ZERO; + */ + alignedAxis: Cartesian3; + /** + * Gets or sets a width for the billboard. If undefined, the image width will be used. + */ + width: number; + /** + * Gets or sets a height for the billboard. If undefined, the image height will be used. + */ + height: number; + /** + * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters; + otherwise, the size is in pixels. + */ + sizeInMeters: boolean; + /** + * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed. + */ + distanceDisplayCondition: DistanceDisplayCondition; + /** + * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + */ + disableDepthTestDistance: number; + /** + * Gets or sets the user-defined object returned when the billboard is picked. + */ + id: any; + /** + * <p> + Gets or sets the image to be used for this billboard. If a texture has already been created for the + given image, the existing texture is used. + </p> + <p> + This property can be set to a loaded Image, a URL which will be loaded as an Image automatically, + a canvas, or another billboard's image property (from the same billboard collection). + </p> + * @example + * // load an image from a URL + b.image = 'some/image/url.png'; + + // assuming b1 and b2 are billboards in the same billboard collection, + // use the same image for both billboards. + b2.image = b1.image; + */ + image: string; + /** + * When <code>true</code>, this billboard is ready to render, i.e., the image + has been downloaded and the WebGL resources are created. + */ + readonly ready: boolean; + /** + * <p> + Sets the image to be used for this billboard. If a texture has already been created for the + given id, the existing texture is used. + </p> + <p> + This function is useful for dynamically creating textures that are shared across many billboards. + Only the first billboard will actually call the function and create the texture, while subsequent + billboards created with the same id will simply re-use the existing texture. + </p> + <p> + To load an image from a URL, setting the {@link Billboard#image} property is more convenient. + </p> + * @example + * // create a billboard image dynamically + function drawImage(id) { + // create and draw an image using a canvas + var canvas = document.createElement('canvas'); + var context2D = canvas.getContext('2d'); + // ... draw image + return canvas; + } + // drawImage will be called to create the texture + b.setImage('myImage', drawImage); + + // subsequent billboards created in the same collection using the same id will use the existing + // texture, without the need to create the canvas or draw the image + b2.setImage('myImage', drawImage); + * @param id - The id of the image. This can be any string that uniquely identifies the image. + * @param image - The image to load. This parameter + can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically, + or a function which will be called to create the image if it hasn't been loaded already. + */ + setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void; + /** + * Uses a sub-region of the image with the given id as the image for this billboard, + measured in pixels from the bottom-left. + * @param id - The id of the image to use. + * @param subRegion - The sub-region of the image. + */ + setImageSubRegion(id: string, subRegion: BoundingRectangle): void; + /** + * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets. + The screen space origin is the top, left corner of the canvas; <code>x</code> increases from + left to right, and <code>y</code> increases from top to bottom. + * @example + * console.log(b.computeScreenSpacePosition(scene).toString()); + * @param scene - The scene. + * @param [result] - The object onto which to store the result. + * @returns The screen-space position of the billboard. + */ + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + /** + * Determines if this billboard equals another billboard. Billboards are equal if all their properties + are equal. Billboards in different collections can be equal. + * @param other - The billboard to compare for equality. + * @returns <code>true</code> if the billboards are equal; otherwise, <code>false</code>. + */ + equals(other: Billboard): boolean; +} + +export namespace Billboard { + /** + * A function that creates an image. + * @param id - The identifier of the image to load. + */ + type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise<HTMLImageElement | HTMLCanvasElement>; +} + +/** + * A renderable collection of billboards. Billboards are viewport-aligned +images positioned in the 3D scene. +<br /><br /> +<div align='center'> +<img src='Images/Billboard.png' width='400' height='300' /><br /> +Example billboards +</div> +<br /><br /> +Billboards are added and removed from the collection using {@link BillboardCollection#add} +and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures +for images with the same identifier. + * @example + * // Create a billboard collection with two billboards +var billboards = scene.primitives.add(new Cesium.BillboardCollection()); +billboards.add({ + position : new Cesium.Cartesian3(1.0, 2.0, 3.0), + image : 'url/to/image' +}); +billboards.add({ + position : new Cesium.Cartesian3(4.0, 5.0, 6.0), + image : 'url/to/another/image' +}); + * @param [options] - Object with the following properties: + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe. + * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default +is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent, +setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. + * @param [options.show = true] - Determines if the billboards in the collection will be shown. + */ +export class BillboardCollection { + constructor(options?: { + modelMatrix?: Matrix4 + debugShowBoundingVolume?: boolean + scene?: Scene + blendOption?: BlendOption + show?: boolean + }); + /** + * Determines if billboards in this collection will be shown. + */ + show: boolean; + /** + * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates. + When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. + * @example + * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); + billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); + billboards.add({ + image : 'url/to/image', + position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center + }); + billboards.add({ + image : 'url/to/image', + position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east + }); + billboards.add({ + image : 'url/to/image', + position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north + }); + billboards.add({ + image : 'url/to/image', + position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up + }); + */ + modelMatrix: Matrix4; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the primitive. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the texture atlas for this BillboardCollection as a fullscreen quad. + </p> + */ + debugShowTextureAtlas: boolean; + /** + * The billboard blending option. The default is used for rendering both opaque and translucent billboards. + However, if either all of the billboards are completely opaque or all are completely translucent, + setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve + performance by up to 2x. + */ + blendOption: BlendOption; + /** + * Returns the number of billboards in this collection. This is commonly used with + {@link BillboardCollection#get} to iterate over all the billboards + in the collection. + */ + length: number; + /** + * Creates and adds a billboard with the specified initial properties to the collection. + The added billboard is returned so it can be modified or removed from the collection later. + * @example + * // Example 1: Add a billboard, specifying all the default values. + var b = billboards.add({ + show : true, + position : Cesium.Cartesian3.ZERO, + pixelOffset : Cesium.Cartesian2.ZERO, + eyeOffset : Cesium.Cartesian3.ZERO, + heightReference : Cesium.HeightReference.NONE, + horizontalOrigin : Cesium.HorizontalOrigin.CENTER, + verticalOrigin : Cesium.VerticalOrigin.CENTER, + scale : 1.0, + image : 'url/to/image', + imageSubRegion : undefined, + color : Cesium.Color.WHITE, + id : undefined, + rotation : 0.0, + alignedAxis : Cesium.Cartesian3.ZERO, + width : undefined, + height : undefined, + scaleByDistance : undefined, + translucencyByDistance : undefined, + pixelOffsetScaleByDistance : undefined, + sizeInMeters : false, + distanceDisplayCondition : undefined + }); + * @example + * // Example 2: Specify only the billboard's cartographic position. + var b = billboards.add({ + position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) + }); + * @param [options] - A template describing the billboard's properties as shown in Example 1. + * @returns The billboard that was added to the collection. + */ + add(options?: any): Billboard; + /** + * Removes a billboard from the collection. + * @example + * var b = billboards.add(...); + billboards.remove(b); // Returns true + * @param billboard - The billboard to remove. + * @returns <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection. + */ + remove(billboard: Billboard): boolean; + /** + * Removes all billboards from the collection. + * @example + * billboards.add(...); + billboards.add(...); + billboards.removeAll(); + */ + removeAll(): void; + /** + * Check whether this collection contains a given billboard. + * @param [billboard] - The billboard to check for. + * @returns true if this collection contains the billboard, false otherwise. + */ + contains(billboard?: Billboard): boolean; + /** + * Returns the billboard in the collection at the specified index. Indices are zero-based + and increase as billboards are added. Removing a billboard shifts all billboards after + it to the left, changing their indices. This function is commonly used with + {@link BillboardCollection#length} to iterate over all the billboards + in the collection. + * @example + * // Toggle the show property of every billboard in the collection + var len = billboards.length; + for (var i = 0; i < len; ++i) { + var b = billboards.get(i); + b.show = !b.show; + } + * @param index - The zero-based index of the billboard. + * @returns The billboard at the specified index. + */ + get(index: number): Billboard; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * billboards = billboards && billboards.destroy(); + */ + destroy(): void; +} + +export namespace BingMapsImageryProvider { + /** + * Initialization options for the BingMapsImageryProvider constructor + * @property url - The url of the Bing Maps server hosting the imagery. + * @property key - The Bing Maps key for your application, which can be + created at {@link https://www.bingmapsportal.com/}. + * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'. + By default, tiles are loaded using the same protocol as the page. + * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load. + * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not + all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} + for information on the supported cultures. + * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property [tileDiscardPolicy] - The policy that determines if a tile + is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy} + will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles. + To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter. + */ + type ConstructorOptions = { + url: Resource | string + key: string + tileProtocol?: string + mapStyle?: BingMapsStyle + culture?: string + ellipsoid?: Ellipsoid + tileDiscardPolicy?: TileDiscardPolicy + }; +} + +/** + * Provides tiled imagery using the Bing Maps Imagery REST API. + * @example + * var bing = new Cesium.BingMapsImageryProvider({ + url : 'https://dev.virtualearth.net', + key : 'get-yours-at-https://www.bingmapsportal.com/', + mapStyle : Cesium.BingMapsStyle.AERIAL +}); + * @param options - Object describing initialization options + */ +export class BingMapsImageryProvider { + constructor(options: BingMapsImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the name of the BingMaps server url hosting the imagery. + */ + readonly url: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the Bing Maps key. + */ + readonly key: string; + /** + * Gets the type of Bing Maps imagery to load. + */ + readonly mapStyle: BingMapsStyle; + /** + * The culture to use when requesting Bing Maps imagery. Not + all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx} + for information on the supported cultures. + */ + readonly culture: string; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage + and texture upload time. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link BingMapsImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Picking features is not currently supported by this imagery provider, so this function simply returns + undefined. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; + /** + * Converts a tiles (x, y, level) position into a quadkey used to request an image + from a Bing Maps server. + * @param x - The tile's x coordinate. + * @param y - The tile's y coordinate. + * @param level - The tile's zoom level. + */ + static tileXYToQuadKey(x: number, y: number, level: number): void; + /** + * Converts a tile's quadkey used to request an image from a Bing Maps server into the + (x, y, level) position. + * @param quadkey - The tile's quad key + */ + static quadKeyToTileXY(quadkey: string): void; + /** + * Gets or sets the URL to the Bing logo for display in the credit. + */ + static logoUrl: string; +} + +/** + * The types of imagery provided by Bing Maps. + */ +export enum BingMapsStyle { + /** + * Aerial imagery. + */ + AERIAL = 'Aerial', + /** + * Aerial imagery with a road overlay. + */ + AERIAL_WITH_LABELS = 'AerialWithLabels', + /** + * Aerial imagery with a road overlay. + */ + AERIAL_WITH_LABELS_ON_DEMAND = 'AerialWithLabelsOnDemand', + /** + * Roads without additional imagery. + */ + ROAD = 'Road', + /** + * Roads without additional imagery. + */ + ROAD_ON_DEMAND = 'RoadOnDemand', + /** + * A dark version of the road maps. + */ + CANVAS_DARK = 'CanvasDark', + /** + * A lighter version of the road maps. + */ + CANVAS_LIGHT = 'CanvasLight', + /** + * A grayscale version of the road maps. + */ + CANVAS_GRAY = 'CanvasGray', + /** + * Ordnance Survey imagery. This imagery is visible only for the London, UK area. + */ + ORDNANCE_SURVEY = 'OrdnanceSurvey', + /** + * Collins Bart imagery. + */ + COLLINS_BART = 'CollinsBart' +} + +/** + * Determines how two pixels' values are combined. + */ +export enum BlendEquation { + /** + * Pixel values are added componentwise. This is used in additive blending for translucency. + */ + ADD = WebGLConstants.FUNC_ADD, + /** + * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency. + */ + SUBTRACT = WebGLConstants.FUNC_SUBTRACT, + /** + * Pixel values are subtracted componentwise (destination - source). + */ + REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT, + /** + * Pixel values are given to the minimum function (min(source, destination)). + + This equation operates on each pixel color component. + */ + MIN = WebGLConstants.MIN, + /** + * Pixel values are given to the maximum function (max(source, destination)). + + This equation operates on each pixel color component. + */ + MAX = WebGLConstants.MAX +} + +/** + * Determines how blending factors are computed. + */ +export enum BlendFunction { + /** + * The blend factor is zero. + */ + ZERO = WebGLConstants.ZERO, + /** + * The blend factor is one. + */ + ONE = WebGLConstants.ONE, + /** + * The blend factor is the source color. + */ + SOURCE_COLOR = WebGLConstants.SRC_COLOR, + /** + * The blend factor is one minus the source color. + */ + ONE_MINUS_SOURCE_COLOR = WebGLConstants.ONE_MINUS_SRC_COLOR, + /** + * The blend factor is the destination color. + */ + DESTINATION_COLOR = WebGLConstants.DST_COLOR, + /** + * The blend factor is one minus the destination color. + */ + ONE_MINUS_DESTINATION_COLOR = WebGLConstants.ONE_MINUS_DST_COLOR, + /** + * The blend factor is the source alpha. + */ + SOURCE_ALPHA = WebGLConstants.SRC_ALPHA, + /** + * The blend factor is one minus the source alpha. + */ + ONE_MINUS_SOURCE_ALPHA = WebGLConstants.ONE_MINUS_SRC_ALPHA, + /** + * The blend factor is the destination alpha. + */ + DESTINATION_ALPHA = WebGLConstants.DST_ALPHA, + /** + * The blend factor is one minus the destination alpha. + */ + ONE_MINUS_DESTINATION_ALPHA = WebGLConstants.ONE_MINUS_DST_ALPHA, + /** + * The blend factor is the constant color. + */ + CONSTANT_COLOR = WebGLConstants.CONSTANT_COLOR, + /** + * The blend factor is one minus the constant color. + */ + ONE_MINUS_CONSTANT_COLOR = WebGLConstants.ONE_MINUS_CONSTANT_COLOR, + /** + * The blend factor is the constant alpha. + */ + CONSTANT_ALPHA = WebGLConstants.CONSTANT_ALPHA, + /** + * The blend factor is one minus the constant alpha. + */ + ONE_MINUS_CONSTANT_ALPHA = WebGLConstants.ONE_MINUS_CONSTANT_ALPHA, + /** + * The blend factor is the saturated source alpha. + */ + SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE +} + +/** + * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the +<code>enabled</code> flag to define the full blending state for combining source and +destination fragments when rendering. +<p> +This is a helper when using custom render states with {@link Appearance#renderState}. +</p> + */ +export namespace BlendingState { + /** + * Blending is disabled. + */ + const DISABLED: any + /** + * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>. + */ + const ALPHA_BLEND: any + /** + * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>. + */ + const PRE_MULTIPLIED_ALPHA_BLEND: any + /** + * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>. + */ + const ADDITIVE_BLEND: any +} + +/** + * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene. + */ +export enum BlendOption { + /** + * The billboards, points, or labels in the collection are completely opaque. + */ + OPAQUE = 0, + /** + * The billboards, points, or labels in the collection are completely translucent. + */ + TRANSLUCENT = 1, + /** + * The billboards, points, or labels in the collection are both opaque and translucent. + */ + OPAQUE_AND_TRANSLUCENT = 2 +} + +/** + * A ParticleEmitter that emits particles within a box. +Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box. + * @param dimensions - The width, height and depth dimensions of the box. + */ +export class BoxEmitter { + constructor(dimensions: Cartesian3); + /** + * The width, height and depth dimensions of the box in meters. + */ + dimensions: Cartesian3; +} + +/** + * The camera is defined by a position, orientation, and view frustum. +<br /><br /> +The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors. +<br /><br /> +The viewing frustum is defined by 6 planes. +Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components +define the unit vector normal to the plane, and the w component is the distance of the +plane from the origin/camera position. + * @example + * // Create a camera looking down the negative z-axis, positioned at the origin, +// with a field of view of 60 degrees, and 1:1 aspect ratio. +var camera = new Cesium.Camera(scene); +camera.position = new Cesium.Cartesian3(); +camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3()); +camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y); +camera.frustum.fov = Cesium.Math.PI_OVER_THREE; +camera.frustum.near = 1.0; +camera.frustum.far = 2.0; + * @param scene - The scene. + */ +export class Camera { + constructor(scene: Scene); + /** + * The position of the camera. + */ + position: Cartesian3; + /** + * The view direction of the camera. + */ + direction: Cartesian3; + /** + * The up direction of the camera. + */ + up: Cartesian3; + /** + * The right direction of the camera. + */ + right: Cartesian3; + /** + * The region of space in view. + */ + frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum; + /** + * The default amount to move the camera when an argument is not + provided to the move methods. + */ + defaultMoveAmount: number; + /** + * The default amount to rotate the camera when an argument is not + provided to the look methods. + */ + defaultLookAmount: number; + /** + * The default amount to rotate the camera when an argument is not + provided to the rotate methods. + */ + defaultRotateAmount: number; + /** + * The default amount to move the camera when an argument is not + provided to the zoom methods. + */ + defaultZoomAmount: number; + /** + * If set, the camera will not be able to rotate past this axis in either direction. + */ + constrainedAxis: Cartesian3; + /** + * The factor multiplied by the the map size used to determine where to clamp the camera position + when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable. + */ + maximumZoomFactor: number; + /** + * The amount the camera has to change before the <code>changed</code> event is raised. The value is a percentage in the [0, 1] range. + */ + percentageChanged: number; + /** + * The default rectangle the camera will view on creation. + */ + static DEFAULT_VIEW_RECTANGLE: Rectangle; + /** + * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle. + A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero + will move it further away from the extent, and a value less than zero will move it close to the extent. + */ + static DEFAULT_VIEW_FACTOR: number; + /** + * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere. + */ + static DEFAULT_OFFSET: HeadingPitchRange; + /** + * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix. + */ + readonly transform: Matrix4; + /** + * Gets the inverse camera transform. + */ + readonly inverseTransform: Matrix4; + /** + * Gets the view matrix. + */ + readonly viewMatrix: Matrix4; + /** + * Gets the inverse view matrix. + */ + readonly inverseViewMatrix: Matrix4; + /** + * Gets the {@link Cartographic} position of the camera, with longitude and latitude + expressed in radians and height in meters. In 2D and Columbus View, it is possible + for the returned longitude and latitude to be outside the range of valid longitudes + and latitudes when the camera is outside the map. + */ + readonly positionCartographic: Cartographic; + /** + * Gets the position of the camera in world coordinates. + */ + readonly positionWC: Cartesian3; + /** + * Gets the view direction of the camera in world coordinates. + */ + readonly directionWC: Cartesian3; + /** + * Gets the up direction of the camera in world coordinates. + */ + readonly upWC: Cartesian3; + /** + * Gets the right direction of the camera in world coordinates. + */ + readonly rightWC: Cartesian3; + /** + * Gets the camera heading in radians. + */ + readonly heading: number; + /** + * Gets the camera pitch in radians. + */ + readonly pitch: number; + /** + * Gets the camera roll in radians. + */ + readonly roll: number; + /** + * Gets the event that will be raised at when the camera starts to move. + */ + readonly moveStart: Event; + /** + * Gets the event that will be raised when the camera has stopped moving. + */ + readonly moveEnd: Event; + /** + * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>. + */ + readonly changed: Event; + /** + * Sets the camera position, orientation and transform. + * @example + * // 1. Set position with a top-down view + viewer.camera.setView({ + destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0) + }); + + // 2 Set view with heading, pitch and roll + viewer.camera.setView({ + destination : cartesianPosition, + orientation: { + heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) + pitch : Cesium.Math.toRadians(-90), // default value (looking down) + roll : 0.0 // default value + } + }); + + // 3. Change heading, pitch and roll with the camera position remaining the same. + viewer.camera.setView({ + orientation: { + heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north) + pitch : Cesium.Math.toRadians(-90), // default value (looking down) + roll : 0.0 // default value + } + }); + + + // 4. View rectangle with a top-down view + viewer.camera.setView({ + destination : Cesium.Rectangle.fromDegrees(west, south, east, north) + }); + + // 5. Set position with an orientation using unit vectors. + viewer.camera.setView({ + destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), + orientation : { + direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734), + up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339) + } + }); + * @param options - Object with the following properties: + * @param [options.destination] - The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view. + * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point + towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive + y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. + * @param [options.endTransform] - Transform matrix representing the reference frame of the camera. + * @param [options.convert] - Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>. + */ + setView(options: { + destination?: Cartesian3 | Rectangle + orientation?: any + endTransform?: Matrix4 + convert?: boolean + }): void; + /** + * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set + the default view for the 3D scene. The home view for 2D and columbus view shows the + entire map. + * @param [duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. See {@link Camera#flyTo} + */ + flyHome(duration?: number): void; + /** + * Transform a vector or point from world coordinates to the camera's reference frame. + * @param cartesian - The vector or point to transform. + * @param [result] - The object onto which to store the result. + * @returns The transformed vector or point. + */ + worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + /** + * Transform a point from world coordinates to the camera's reference frame. + * @param cartesian - The point to transform. + * @param [result] - The object onto which to store the result. + * @returns The transformed point. + */ + worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Transform a vector from world coordinates to the camera's reference frame. + * @param cartesian - The vector to transform. + * @param [result] - The object onto which to store the result. + * @returns The transformed vector. + */ + worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Transform a vector or point from the camera's reference frame to world coordinates. + * @param cartesian - The vector or point to transform. + * @param [result] - The object onto which to store the result. + * @returns The transformed vector or point. + */ + cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + /** + * Transform a point from the camera's reference frame to world coordinates. + * @param cartesian - The point to transform. + * @param [result] - The object onto which to store the result. + * @returns The transformed point. + */ + cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Transform a vector from the camera's reference frame to world coordinates. + * @param cartesian - The vector to transform. + * @param [result] - The object onto which to store the result. + * @returns The transformed vector. + */ + cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + /** + * Translates the camera's position by <code>amount</code> along <code>direction</code>. + * @param direction - The direction to move. + * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>. + */ + move(direction: Cartesian3, amount?: number): void; + /** + * Translates the camera's position by <code>amount</code> along the camera's view vector. + When in 2D mode, this will zoom in the camera instead of translating the camera's position. + * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>. + */ + moveForward(amount?: number): void; + /** + * Translates the camera's position by <code>amount</code> along the opposite direction + of the camera's view vector. + When in 2D mode, this will zoom out the camera instead of translating the camera's position. + * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>. + */ + moveBackward(amount?: number): void; + /** + * Translates the camera's position by <code>amount</code> along the camera's up vector. + * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>. + */ + moveUp(amount?: number): void; + /** + * Translates the camera's position by <code>amount</code> along the opposite direction + of the camera's up vector. + * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>. + */ + moveDown(amount?: number): void; + /** + * Translates the camera's position by <code>amount</code> along the camera's right vector. + * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>. + */ + moveRight(amount?: number): void; + /** + * Translates the camera's position by <code>amount</code> along the opposite direction + of the camera's right vector. + * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>. + */ + moveLeft(amount?: number): void; + /** + * Rotates the camera around its up vector by amount, in radians, in the opposite direction + of its right vector if not in 2D mode. + * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>. + */ + lookLeft(amount?: number): void; + /** + * Rotates the camera around its up vector by amount, in radians, in the direction + of its right vector if not in 2D mode. + * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>. + */ + lookRight(amount?: number): void; + /** + * Rotates the camera around its right vector by amount, in radians, in the direction + of its up vector if not in 2D mode. + * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>. + */ + lookUp(amount?: number): void; + /** + * Rotates the camera around its right vector by amount, in radians, in the opposite direction + of its up vector if not in 2D mode. + * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>. + */ + lookDown(amount?: number): void; + /** + * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code> + * @param axis - The axis to rotate around. + * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>. + */ + look(axis: Cartesian3, angle?: number): void; + /** + * Rotate the camera counter-clockwise around its direction vector by amount, in radians. + * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>. + */ + twistLeft(amount?: number): void; + /** + * Rotate the camera clockwise around its direction vector by amount, in radians. + * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>. + */ + twistRight(amount?: number): void; + /** + * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance + of the camera's position to the center of the camera's reference frame remains the same. + * @param axis - The axis to rotate around given in world coordinates. + * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>. + */ + rotate(axis: Cartesian3, angle?: number): void; + /** + * Rotates the camera around the center of the camera's reference frame by angle downwards. + * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>. + */ + rotateDown(angle?: number): void; + /** + * Rotates the camera around the center of the camera's reference frame by angle upwards. + * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>. + */ + rotateUp(angle?: number): void; + /** + * Rotates the camera around the center of the camera's reference frame by angle to the right. + * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>. + */ + rotateRight(angle?: number): void; + /** + * Rotates the camera around the center of the camera's reference frame by angle to the left. + * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>. + */ + rotateLeft(angle?: number): void; + /** + * Zooms <code>amount</code> along the camera's view vector. + * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>. + */ + zoomIn(amount?: number): void; + /** + * Zooms <code>amount</code> along the opposite direction of + the camera's view vector. + * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>. + */ + zoomOut(amount?: number): void; + /** + * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and + Columbus view, this is the distance to the map. + * @returns The magnitude of the position. + */ + getMagnitude(): number; + /** + * Sets the camera position and orientation using a target and offset. The target must be given in + world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target. + If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset + is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. + + In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north. + * @example + * // 1. Using a cartesian offset + var center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0); + viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0)); + + // 2. Using a HeadingPitchRange offset + var center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0); + var heading = Cesium.Math.toRadians(50.0); + var pitch = Cesium.Math.toRadians(-20.0); + var range = 5000.0; + viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range)); + * @param target - The target position in world coordinates. + * @param offset - The offset from the target in the local east-north-up reference frame centered at the target. + */ + lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void; + /** + * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range. + If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset + is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. + + In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the + target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north. + * @example + * // 1. Using a cartesian offset + var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0)); + viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0)); + + // 2. Using a HeadingPitchRange offset + var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0)); + var heading = Cesium.Math.toRadians(50.0); + var pitch = Cesium.Math.toRadians(-20.0); + var range = 5000.0; + viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range)); + * @param transform - The transformation matrix defining the reference frame. + * @param [offset] - The offset from the target in a reference frame centered at the target. + */ + lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void; + /** + * Get the camera position needed to view a rectangle on an ellipsoid or map + * @param rectangle - The rectangle to view. + * @param [result] - The camera position needed to view the rectangle + * @returns The camera position needed to view the rectangle + */ + getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3; + /** + * Pick an ellipsoid or map. + * @example + * var canvas = viewer.scene.canvas; + var center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0); + var ellipsoid = viewer.scene.globe.ellipsoid; + var result = viewer.camera.pickEllipsoid(center, ellipsoid); + * @param windowPosition - The x and y coordinates of a pixel. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to pick. + * @param [result] - The object onto which to store the result. + * @returns If the ellipsoid or map was picked, + returns the point on the surface of the ellipsoid or map in world + coordinates. If the ellipsoid or map was not picked, returns undefined. + */ + pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined; + /** + * Create a ray from the camera position through the pixel at <code>windowPosition</code> + in world coordinates. + * @param windowPosition - The x and y coordinates of a pixel. + * @param [result] - The object onto which to store the result. + * @returns Returns the {@link Cartesian3} position and direction of the ray. + */ + getPickRay(windowPosition: Cartesian2, result?: Ray): Ray; + /** + * Return the distance from the camera to the front of the bounding sphere. + * @param boundingSphere - The bounding sphere in world coordinates. + * @returns The distance to the bounding sphere. + */ + distanceToBoundingSphere(boundingSphere: BoundingSphere): number; + /** + * Return the pixel size in meters. + * @param boundingSphere - The bounding sphere in world coordinates. + * @param drawingBufferWidth - The drawing buffer width. + * @param drawingBufferHeight - The drawing buffer height. + * @returns The pixel size in meters. + */ + getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number; + /** + * Cancels the current camera flight and leaves the camera at its current location. + If no flight is in progress, this this function does nothing. + */ + cancelFlight(): void; + /** + * Completes the current camera flight and moves the camera immediately to its final destination. + If no flight is in progress, this this function does nothing. + */ + completeFlight(): void; + /** + * Flies the camera from its current position to a new position. + * @example + * // 1. Fly to a position with a top-down view + viewer.camera.flyTo({ + destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0) + }); + + // 2. Fly to a Rectangle with a top-down view + viewer.camera.flyTo({ + destination : Cesium.Rectangle.fromDegrees(west, south, east, north) + }); + + // 3. Fly to a position with an orientation using unit vectors. + viewer.camera.flyTo({ + destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), + orientation : { + direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734), + up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339) + } + }); + + // 4. Fly to a position with an orientation using heading, pitch and roll. + viewer.camera.flyTo({ + destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0), + orientation : { + heading : Cesium.Math.toRadians(175.0), + pitch : Cesium.Math.toRadians(-35.0), + roll : 0.0 + } + }); + * @param options - Object with the following properties: + * @param options.destination - The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view. + * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point + towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive + y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. + * @param [options.duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. + * @param [options.complete] - The function to execute when the flight is complete. + * @param [options.cancel] - The function to execute if the flight is cancelled. + * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed. + * @param [options.maximumHeight] - The maximum height at the peak of the flight. + * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport. + * @param [options.flyOverLongitude] - There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude. + * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight. + * @param [options.convert] - Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>. + * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight. + */ + flyTo(options: { + destination: Cartesian3 | Rectangle + orientation?: any + duration?: number + complete?: Camera.FlightCompleteCallback + cancel?: Camera.FlightCancelledCallback + endTransform?: Matrix4 + maximumHeight?: number + pitchAdjustHeight?: number + flyOverLongitude?: number + flyOverLongitudeWeight?: number + convert?: boolean + easingFunction?: EasingFunction.Callback + }): void; + /** + * Sets the camera so that the current view contains the provided bounding sphere. + + <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. + The heading and the pitch angles are defined in the local east-north-up reference frame. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is + zero, a range will be computed such that the whole bounding sphere is visible.</p> + + <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the range. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north.</p> + * @param boundingSphere - The bounding sphere to view, in world coordinates. + * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target. + */ + viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void; + /** + * Flies the camera to a location where the current view contains the provided bounding sphere. + + <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. + The heading and the pitch angles are defined in the local east-north-up reference frame. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is + zero, a range will be computed such that the whole bounding sphere is visible.</p> + + <p>In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the range. The heading will be aligned to local north.</p> + * @param boundingSphere - The bounding sphere to view, in world coordinates. + * @param [options] - Object with the following properties: + * @param [options.duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. + * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target. + * @param [options.complete] - The function to execute when the flight is complete. + * @param [options.cancel] - The function to execute if the flight is cancelled. + * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed. + * @param [options.maximumHeight] - The maximum height at the peak of the flight. + * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport. + * @param [options.flyOverLongitude] - There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude. + * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight. + * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight. + */ + flyToBoundingSphere(boundingSphere: BoundingSphere, options?: { + duration?: number + offset?: HeadingPitchRange + complete?: Camera.FlightCompleteCallback + cancel?: Camera.FlightCancelledCallback + endTransform?: Matrix4 + maximumHeight?: number + pitchAdjustHeight?: number + flyOverLongitude?: number + flyOverLongitudeWeight?: number + easingFunction?: EasingFunction.Callback + }): void; + /** + * Computes the approximate visible rectangle on the ellipsoid. + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that you want to know the visible region. + * @param [result] - The rectangle in which to store the result + * @returns The visible rectangle or undefined if the ellipsoid isn't visible at all. + */ + computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined; + /** + * Switches the frustum/projection to perspective. + + This function is a no-op in 2D which must always be orthographic. + */ + switchToPerspectiveFrustum(): void; + /** + * Switches the frustum/projection to orthographic. + + This function is a no-op in 2D which will always be orthographic. + */ + switchToOrthographicFrustum(): void; +} + +export namespace Camera { + /** + * A function that will execute when a flight completes. + */ + type FlightCompleteCallback = () => void; + /** + * A function that will execute when a flight is cancelled. + */ + type FlightCancelledCallback = () => void; +} + +/** + * Aggregates input events. For example, suppose the following inputs are received between frames: +left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into +one event with a start and end position of the mouse. + * @param [canvas = document] - The element to handle events for. + */ +export class CameraEventAggregator { + constructor(canvas?: HTMLCanvasElement); + /** + * Gets the current mouse position. + */ + currentMousePosition: Cartesian2; + /** + * Gets whether any mouse button is down, a touch has started, or the wheel has been moved. + */ + anyButtonDown: boolean; + /** + * Gets if a mouse button down or touch has started and has been moved. + * @param type - The camera event type. + * @param [modifier] - The keyboard modifier. + * @returns Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code> + */ + isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean; + /** + * Gets the aggregated start and end position of the current event. + * @param type - The camera event type. + * @param [modifier] - The keyboard modifier. + * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>. + */ + getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any; + /** + * Gets the start and end position of the last move event (not the aggregated event). + * @param type - The camera event type. + * @param [modifier] - The keyboard modifier. + * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>. + */ + getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any | undefined; + /** + * Gets whether the mouse button is down or a touch has started. + * @param type - The camera event type. + * @param [modifier] - The keyboard modifier. + * @returns Whether the mouse button is down or a touch has started. + */ + isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean; + /** + * Gets the mouse position that started the aggregation. + * @param type - The camera event type. + * @param [modifier] - The keyboard modifier. + * @returns The mouse position. + */ + getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2; + /** + * Gets the time the button was pressed or the touch was started. + * @param type - The camera event type. + * @param [modifier] - The keyboard modifier. + * @returns The time the button was pressed or the touch was started. + */ + getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date; + /** + * Gets the time the button was released or the touch was ended. + * @param type - The camera event type. + * @param [modifier] - The keyboard modifier. + * @returns The time the button was released or the touch was ended. + */ + getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date; + /** + * Signals that all of the events have been handled and the aggregator should be reset to handle new events. + */ + reset(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Removes mouse listeners held by this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * handler = handler && handler.destroy(); + */ + destroy(): void; +} + +/** + * Enumerates the available input for interacting with the camera. + */ +export enum CameraEventType { + /** + * A left mouse button press followed by moving the mouse and releasing the button. + */ + LEFT_DRAG = 0, + /** + * A right mouse button press followed by moving the mouse and releasing the button. + */ + RIGHT_DRAG = 1, + /** + * A middle mouse button press followed by moving the mouse and releasing the button. + */ + MIDDLE_DRAG = 2, + /** + * Scrolling the middle mouse button. + */ + WHEEL = 3, + /** + * A two-finger touch on a touch surface. + */ + PINCH = 4 +} + +/** + * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded; +the content is loaded on-demand when needed based on the view. +<p> +Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}. +</p> + */ +export class Cesium3DTile { + constructor(); + /** + * The local transform of this tile. + */ + transform: Matrix4; + /** + * The final computed transform of this tile. + */ + readonly computedTransform: Matrix4; + /** + * The error, in meters, introduced if this tile is rendered and its children are not. + This is used to compute screen space error, i.e., the error measured in pixels. + */ + readonly geometricError: number; + /** + * Gets the tile's children. + */ + readonly children: Cesium3DTile[]; + /** + * This tile's parent or <code>undefined</code> if this tile is the root. + <p> + When a tile's content points to an external tileset JSON file, the external tileset's + root tile's parent is not <code>undefined</code>; instead, the parent references + the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged. + </p> + */ + readonly parent: Cesium3DTile; + /** + * The time in seconds after the tile's content is ready when the content expires and new content is requested. + */ + expireDuration: number; + /** + * The date when the content expires and new content is requested. + */ + expireDate: JulianDate; + /** + * The tileset containing this tile. + */ + readonly tileset: Cesium3DTileset; + /** + * The tile's content. This represents the actual tile's payload, + not the content's metadata in the tileset JSON file. + */ + readonly content: Cesium3DTileContent; + /** + * Get the bounding sphere derived from the tile's bounding volume. + */ + readonly boundingSphere: BoundingSphere; + /** + * Returns the <code>extras</code> property in the tileset JSON for this tile, which contains application specific metadata. + Returns <code>undefined</code> if <code>extras</code> does not exist. + */ + readonly extras: any; +} + +/** + * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from +the original feature, e.g. glTF material or per-point color in the tile. +<p> +When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the +<code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported. +</p> +<p> +A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the +tileset's color blend mode. +</p> +<pre><code> +"techniques": { + "technique0": { + "parameters": { + "diffuse": { + "semantic": "_3DTILESDIFFUSE", + "type": 35666 + } + } + } +} +</code></pre> + */ +export enum Cesium3DTileColorBlendMode { + /** + * Multiplies the source color by the feature color. + */ + HIGHLIGHT = 0, + /** + * Replaces the source color with the feature color. + */ + REPLACE = 1, + /** + * Blends the source color and feature color together. + */ + MIX = 2 +} + +/** + * The content of a tile in a {@link Cesium3DTileset}. +<p> +Derived classes of this interface provide access to individual features in the tile. +Access derived objects through {@link Cesium3DTile#content}. +</p> +<p> +This type describes an interface and is not intended to be instantiated directly. +</p> + */ +export class Cesium3DTileContent { + constructor(); + /** + * Gets the number of features in the tile. + */ + readonly featuresLength: number; + /** + * Gets the number of points in the tile. + <p> + Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which + equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic. + </p> + */ + readonly pointsLength: number; + /** + * Gets the number of triangles in the tile. + */ + readonly trianglesLength: number; + /** + * Gets the tile's geometry memory in bytes. + */ + readonly geometryByteLength: number; + /** + * Gets the tile's texture memory in bytes. + */ + readonly texturesByteLength: number; + /** + * Gets the amount of memory used by the batch table textures, in bytes. + */ + readonly batchTableByteLength: number; + /** + * Gets the array of {@link Cesium3DTileContent} objects that represent the + content a composite's inner tiles, which can also be composites. + */ + readonly innerContents: any[]; + /** + * Gets the promise that will be resolved when the tile's content is ready to render. + */ + readonly readyPromise: Promise<Cesium3DTileContent>; + /** + * Gets the tileset for this tile. + */ + readonly tileset: Cesium3DTileset; + /** + * Gets the tile containing this content. + */ + readonly tile: Cesium3DTile; + /** + * Gets the url of the tile's content. + */ + readonly url: string; + /** + * Determines if the tile's batch table has a property. If it does, each feature in + the tile will have the property. + * @param batchId - The batchId for the feature. + * @param name - The case-sensitive name of the property. + * @returns <code>true</code> if the property exists; otherwise, <code>false</code>. + */ + hasProperty(batchId: number, name: string): boolean; + /** + * Returns the {@link Cesium3DTileFeature} object for the feature with the + given <code>batchId</code>. This object is used to get and modify the + feature's properties. + <p> + Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table. + </p> + * @param batchId - The batchId for the feature. + * @returns The corresponding {@link Cesium3DTileFeature} object. + */ + getFeature(batchId: number): Cesium3DTileFeature; +} + +/** + * A feature of a {@link Cesium3DTileset}. +<p> +Provides access to a feature's properties stored in the tile's batch table, as well +as the ability to show/hide a feature and change its highlight color via +{@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively. +</p> +<p> +Modifications to a <code>Cesium3DTileFeature</code> object have the lifetime of the tile's +content. If the tile's content is unloaded, e.g., due to it going out of view and needing +to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any +modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications. +</p> +<p> +Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature} +or picking using {@link Scene#pick} and {@link Scene#pickPosition}. +</p> + * @example + * // On mouse over, display all the properties for a feature in the console log. +handler.setInputAction(function(movement) { + var feature = scene.pick(movement.endPosition); + if (feature instanceof Cesium.Cesium3DTileFeature) { + var propertyNames = feature.getPropertyNames(); + var length = propertyNames.length; + for (var i = 0; i < length; ++i) { + var propertyName = propertyNames[i]; + console.log(propertyName + ': ' + feature.getProperty(propertyName)); + } + } +}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + */ +export class Cesium3DTileFeature { + constructor(); + /** + * Gets or sets if the feature will be shown. This is set for all features + when a style's show is evaluated. + */ + show: boolean; + /** + * Gets or sets the highlight color multiplied with the feature's color. When + this is white, the feature's color is not changed. This is set for all features + when a style's color is evaluated. + */ + color: Color; + /** + * Gets the tileset containing the feature. + */ + readonly tileset: Cesium3DTileset; + /** + * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns + the tileset containing the feature. + */ + readonly primitive: Cesium3DTileset; + /** + * Returns whether the feature contains this property. This includes properties from this feature's + class and inherited classes when using a batch table hierarchy. + * @param name - The case-sensitive name of the property. + * @returns Whether the feature contains this property. + */ + hasProperty(name: string): boolean; + /** + * Returns an array of property names for the feature. This includes properties from this feature's + class and inherited classes when using a batch table hierarchy. + * @param [results] - An array into which to store the results. + * @returns The names of the feature's properties. + */ + getPropertyNames(results?: string[]): string[]; + /** + * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's + class and inherited classes when using a batch table hierarchy. + * @example + * // Display all the properties for a feature in the console log. + var propertyNames = feature.getPropertyNames(); + var length = propertyNames.length; + for (var i = 0; i < length; ++i) { + var propertyName = propertyNames[i]; + console.log(propertyName + ': ' + feature.getProperty(propertyName)); + } + * @param name - The case-sensitive name of the property. + * @returns The value of the property or <code>undefined</code> if the property does not exist. + */ + getProperty(name: string): any; + /** + * Sets the value of the feature's property with the given name. + <p> + If a property with the given name doesn't exist, it is created. + </p> + * @example + * var height = feature.getProperty('Height'); // e.g., the height of a building + * @example + * var name = 'clicked'; + if (feature.getProperty(name)) { + console.log('already clicked'); + } else { + feature.setProperty(name, true); + console.log('first click'); + } + * @param name - The case-sensitive name of the property. + * @param value - The value of the property that will be copied. + */ + setProperty(name: string, value: any): void; +} + +/** + * A point feature of a {@link Cesium3DTileset}. +<p> +Provides access to a feature's properties stored in the tile's batch table, as well +as the ability to show/hide a feature and change its point properties +</p> +<p> +Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's +content. If the tile's content is unloaded, e.g., due to it going out of view and needing +to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any +modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications. +</p> +<p> +Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature} +or picking using {@link Scene#pick} and {@link Scene#pickPosition}. +</p> + * @example + * // On mouse over, display all the properties for a feature in the console log. +handler.setInputAction(function(movement) { + var feature = scene.pick(movement.endPosition); + if (feature instanceof Cesium.Cesium3DTilePointFeature) { + var propertyNames = feature.getPropertyNames(); + var length = propertyNames.length; + for (var i = 0; i < length; ++i) { + var propertyName = propertyNames[i]; + console.log(propertyName + ': ' + feature.getProperty(propertyName)); + } + } +}, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + */ +export class Cesium3DTilePointFeature { + constructor(); + /** + * Gets or sets if the feature will be shown. This is set for all features + when a style's show is evaluated. + */ + show: boolean; + /** + * Gets or sets the color of the point of this feature. + <p> + Only applied when <code>image</code> is <code>undefined</code>. + </p> + */ + color: Color; + /** + * Gets or sets the point size of this feature. + <p> + Only applied when <code>image</code> is <code>undefined</code>. + </p> + */ + pointSize: number; + /** + * Gets or sets the point outline color of this feature. + <p> + Only applied when <code>image</code> is <code>undefined</code>. + </p> + */ + pointOutlineColor: Color; + /** + * Gets or sets the point outline width in pixels of this feature. + <p> + Only applied when <code>image</code> is <code>undefined</code>. + </p> + */ + pointOutlineWidth: number; + /** + * Gets or sets the label color of this feature. + <p> + The color will be applied to the label if <code>labelText</code> is defined. + </p> + */ + labelColor: Color; + /** + * Gets or sets the label outline color of this feature. + <p> + The outline color will be applied to the label if <code>labelText</code> is defined. + </p> + */ + labelOutlineColor: Color; + /** + * Gets or sets the outline width in pixels of this feature. + <p> + The outline width will be applied to the point if <code>labelText</code> is defined. + </p> + */ + labelOutlineWidth: number; + /** + * Gets or sets the font of this feature. + <p> + Only applied when the <code>labelText</code> is defined. + </p> + */ + font: string; + /** + * Gets or sets the fill and outline style of this feature. + <p> + Only applied when <code>labelText</code> is defined. + </p> + */ + labelStyle: LabelStyle; + /** + * Gets or sets the text for this feature. + */ + labelText: string; + /** + * Gets or sets the background color of the text for this feature. + <p> + Only applied when <code>labelText</code> is defined. + </p> + */ + backgroundColor: Color; + /** + * Gets or sets the background padding of the text for this feature. + <p> + Only applied when <code>labelText</code> is defined. + </p> + */ + backgroundPadding: Cartesian2; + /** + * Gets or sets whether to display the background of the text for this feature. + <p> + Only applied when <code>labelText</code> is defined. + </p> + */ + backgroundEnabled: boolean; + /** + * Gets or sets the near and far scaling properties for this feature. + */ + scaleByDistance: NearFarScalar; + /** + * Gets or sets the near and far translucency properties for this feature. + */ + translucencyByDistance: NearFarScalar; + /** + * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed. + */ + distanceDisplayCondition: DistanceDisplayCondition; + /** + * Gets or sets the height offset in meters of this feature. + */ + heightOffset: number; + /** + * Gets or sets whether the anchor line is displayed. + <p> + Only applied when <code>heightOffset</code> is defined. + </p> + */ + anchorLineEnabled: boolean; + /** + * Gets or sets the color for the anchor line. + <p> + Only applied when <code>heightOffset</code> is defined. + </p> + */ + anchorLineColor: Color; + /** + * Gets or sets the image of this feature. + */ + image: string; + /** + * Gets or sets the distance where depth testing will be disabled. + */ + disableDepthTestDistance: number; + /** + * Gets or sets the horizontal origin of this point, which determines if the point is + to the left, center, or right of its anchor position. + */ + horizontalOrigin: HorizontalOrigin; + /** + * Gets or sets the vertical origin of this point, which determines if the point is + to the bottom, center, or top of its anchor position. + */ + verticalOrigin: VerticalOrigin; + /** + * Gets or sets the horizontal origin of this point's text, which determines if the point's text is + to the left, center, or right of its anchor position. + */ + labelHorizontalOrigin: HorizontalOrigin; + /** + * Get or sets the vertical origin of this point's text, which determines if the point's text is + to the bottom, center, top, or baseline of it's anchor point. + */ + labelVerticalOrigin: VerticalOrigin; + /** + * Gets the tileset containing the feature. + */ + readonly tileset: Cesium3DTileset; + /** + * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns + the tileset containing the feature. + */ + readonly primitive: Cesium3DTileset; + /** + * Returns whether the feature contains this property. This includes properties from this feature's + class and inherited classes when using a batch table hierarchy. + * @param name - The case-sensitive name of the property. + * @returns Whether the feature contains this property. + */ + hasProperty(name: string): boolean; + /** + * Returns an array of property names for the feature. This includes properties from this feature's + class and inherited classes when using a batch table hierarchy. + * @param [results] - An array into which to store the results. + * @returns The names of the feature's properties. + */ + getPropertyNames(results?: string[]): string[]; + /** + * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's + class and inherited classes when using a batch table hierarchy. + * @example + * // Display all the properties for a feature in the console log. + var propertyNames = feature.getPropertyNames(); + var length = propertyNames.length; + for (var i = 0; i < length; ++i) { + var propertyName = propertyNames[i]; + console.log(propertyName + ': ' + feature.getProperty(propertyName)); + } + * @param name - The case-sensitive name of the property. + * @returns The value of the property or <code>undefined</code> if the property does not exist. + */ + getProperty(name: string): any; + /** + * Sets the value of the feature's property with the given name. + <p> + If a property with the given name doesn't exist, it is created. + </p> + * @example + * var height = feature.getProperty('Height'); // e.g., the height of a building + * @example + * var name = 'clicked'; + if (feature.getProperty(name)) { + console.log('already clicked'); + } else { + feature.setProperty(name, true); + console.log('first click'); + } + * @param name - The case-sensitive name of the property. + * @param value - The value of the property that will be copied. + */ + setProperty(name: string, value: any): void; +} + +/** + * A {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification|3D Tiles tileset}, +used for streaming massive heterogeneous 3D geospatial datasets. + * @example + * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({ + url : 'http://localhost:8002/tilesets/Seattle/tileset.json' +})); + * @example + * // Common setting for the skipLevelOfDetail optimization +var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({ + url : 'http://localhost:8002/tilesets/Seattle/tileset.json', + skipLevelOfDetail : true, + baseScreenSpaceError : 1024, + skipScreenSpaceErrorFactor : 16, + skipLevels : 1, + immediatelyLoadDesiredLevelOfDetail : false, + loadSiblings : false, + cullWithChildrenBounds : true +})); + * @example + * // Common settings for the dynamicScreenSpaceError optimization +var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({ + url : 'http://localhost:8002/tilesets/Seattle/tileset.json', + dynamicScreenSpaceError : true, + dynamicScreenSpaceErrorDensity : 0.00278, + dynamicScreenSpaceErrorFactor : 4.0, + dynamicScreenSpaceErrorHeightFalloff : 0.25 +})); + * @param options - Object with the following properties: + * @param options.url - The url to a tileset JSON file. + * @param [options.show = true] - Determines if the tileset will be shown. + * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the tileset's root tile. + * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the tileset casts or receives shadows from light sources. + * @param [options.maximumScreenSpaceError = 16] - The maximum screen space error used to drive level of detail refinement. + * @param [options.maximumMemoryUsage = 512] - The maximum amount of memory in MB that can be used by the tileset. + * @param [options.cullWithChildrenBounds = true] - Optimization option. Whether to cull tiles using the union of their children bounding volumes. + * @param [options.cullRequestsWhileMoving = true] - Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets. + * @param [options.cullRequestsWhileMovingMultiplier = 60.0] - Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling. + * @param [options.preloadWhenHidden = false] - Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them. + * @param [options.preloadFlightDestinations = true] - Optimization option. Preload tiles at the camera's flight destination while the camera is in flight. + * @param [options.preferLeaves = false] - Optimization option. Prefer loading of leaves first. + * @param [options.dynamicScreenSpaceError = false] - Optimization option. Reduce the screen space error for tiles that are further away from the camera. + * @param [options.dynamicScreenSpaceErrorDensity = 0.00278] - Density used to adjust the dynamic screen space error, similar to fog density. + * @param [options.dynamicScreenSpaceErrorFactor = 4.0] - A factor used to increase the computed dynamic screen space error. + * @param [options.dynamicScreenSpaceErrorHeightFalloff = 0.25] - A ratio of the tileset's height at which the density starts to falloff. + * @param [options.progressiveResolutionHeightFraction = 0.3] - Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load. + * @param [options.foveatedScreenSpaceError = true] - Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded. + * @param [options.foveatedConeSize = 0.1] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect. + * @param [options.foveatedMinimumScreenSpaceErrorRelaxation = 0.0] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. + * @param [options.foveatedInterpolationCallback = Math.lerp] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError} + * @param [options.foveatedTimeDelay = 0.2] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view. + * @param [options.skipLevelOfDetail = false] - Optimization option. Determines if level of detail skipping should be applied during the traversal. + * @param [options.baseScreenSpaceError = 1024] - When <code>skipLevelOfDetail</code> is <code>true</code>, the screen space error that must be reached before skipping levels of detail. + * @param [options.skipScreenSpaceErrorFactor = 16] - When <code>skipLevelOfDetail</code> is <code>true</code>, a multiplier defining the minimum screen space error to skip. Used in conjunction with <code>skipLevels</code> to determine which tiles to load. + * @param [options.skipLevels = 1] - When <code>skipLevelOfDetail</code> is <code>true</code>, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with <code>skipScreenSpaceErrorFactor</code> to determine which tiles to load. + * @param [options.immediatelyLoadDesiredLevelOfDetail = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded. + * @param [options.loadSiblings = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal. + * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset. + * @param [options.classificationType] - Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations. + * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid determining the size and shape of the globe. + * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting. + * @param [options.imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - Scales the diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox. + * @param [options.lightColor] - The light color when shading models. When <code>undefined</code> the scene's light color is used instead. + * @param [options.luminanceAtZenith = 0.2] - The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map. + * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. + * @param [options.specularEnvironmentMaps] - A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps. + * @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled. + * @param [options.vectorClassificationOnly = false] - Indicates that only the tileset's vector tiles should be used for classification. + * @param [options.debugHeatmapTilePropertyName] - The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value. + * @param [options.debugFreezeFrame = false] - For debugging only. Determines if only the tiles from last frame should be used for rendering. + * @param [options.debugColorizeTiles = false] - For debugging only. When true, assigns a random color to each tile. + * @param [options.debugWireframe = false] - For debugging only. When true, render's each tile's content as a wireframe. + * @param [options.debugShowBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile. + * @param [options.debugShowContentBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile's content. + * @param [options.debugShowViewerRequestVolume = false] - For debugging only. When true, renders the viewer request volume for each tile. + * @param [options.debugShowGeometricError = false] - For debugging only. When true, draws labels to indicate the geometric error of each tile. + * @param [options.debugShowRenderingStatistics = false] - For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile. + * @param [options.debugShowMemoryUsage = false] - For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile. + * @param [options.debugShowUrl = false] - For debugging only. When true, draws labels to indicate the url of each tile. + */ +export class Cesium3DTileset { + constructor(options: { + url: Resource | string | Promise<Resource> | Promise<string> + show?: boolean + modelMatrix?: Matrix4 + shadows?: ShadowMode + maximumScreenSpaceError?: number + maximumMemoryUsage?: number + cullWithChildrenBounds?: boolean + cullRequestsWhileMoving?: boolean + cullRequestsWhileMovingMultiplier?: number + preloadWhenHidden?: boolean + preloadFlightDestinations?: boolean + preferLeaves?: boolean + dynamicScreenSpaceError?: boolean + dynamicScreenSpaceErrorDensity?: number + dynamicScreenSpaceErrorFactor?: number + dynamicScreenSpaceErrorHeightFalloff?: number + progressiveResolutionHeightFraction?: number + foveatedScreenSpaceError?: boolean + foveatedConeSize?: number + foveatedMinimumScreenSpaceErrorRelaxation?: number + foveatedInterpolationCallback?: Cesium3DTileset.foveatedInterpolationCallback + foveatedTimeDelay?: number + skipLevelOfDetail?: boolean + baseScreenSpaceError?: number + skipScreenSpaceErrorFactor?: number + skipLevels?: number + immediatelyLoadDesiredLevelOfDetail?: boolean + loadSiblings?: boolean + clippingPlanes?: ClippingPlaneCollection + classificationType?: ClassificationType + ellipsoid?: Ellipsoid + pointCloudShading?: any + imageBasedLightingFactor?: Cartesian2 + lightColor?: Cartesian3 + luminanceAtZenith?: number + sphericalHarmonicCoefficients?: Cartesian3[] + specularEnvironmentMaps?: string + backFaceCulling?: boolean + vectorClassificationOnly?: boolean + debugHeatmapTilePropertyName?: string + debugFreezeFrame?: boolean + debugColorizeTiles?: boolean + debugWireframe?: boolean + debugShowBoundingVolume?: boolean + debugShowContentBoundingVolume?: boolean + debugShowViewerRequestVolume?: boolean + debugShowGeometricError?: boolean + debugShowRenderingStatistics?: boolean + debugShowMemoryUsage?: boolean + debugShowUrl?: boolean + }); + /** + * Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets. + */ + cullRequestsWhileMoving: boolean; + /** + * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling. + */ + cullRequestsWhileMovingMultiplier: number; + /** + * Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load. + */ + progressiveResolutionHeightFraction: number; + /** + * Optimization option. Prefer loading of leaves first. + */ + preferLeaves: boolean; + /** + * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them. + */ + preloadWhenHidden: boolean; + /** + * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight. + */ + preloadFlightDestinations: boolean; + /** + * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further + away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer + tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance. + The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking + at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region. + */ + dynamicScreenSpaceError: boolean; + /** + * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the + screen space error for tiles around the edge of the screen. Screen space error returns to normal once all + the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded. + */ + foveatedScreenSpaceError: boolean; + /** + * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone, + interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. + */ + foveatedInterpolationCallback: Cesium3DTileset.foveatedInterpolationCallback; + /** + * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control + how long in seconds to wait after the camera stops moving before deferred tiles start loading in. + This time delay prevents requesting tiles around the edges of the screen when the camera is moving. + Setting this to 0.0 will immediately request all tiles in any given view. + */ + foveatedTimeDelay: number; + /** + * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this + value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion. + The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically. + This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles + beyond a certain distance all roughly having an error of 1.0. + <p> + The dynamic error is in the range [0.0, 1.0) and is multiplied by <code>dynamicScreenSpaceErrorFactor</code> to produce the + final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error. + </p> + <p> + Increasing <code>dynamicScreenSpaceErrorDensity</code> has the effect of moving the error midpoint closer to the camera. + It is analogous to moving fog closer to the camera. + </p> + */ + dynamicScreenSpaceErrorDensity: number; + /** + * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles + are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled. + */ + dynamicScreenSpaceErrorFactor: number; + /** + * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the + full computed density is applied, otherwise the density falls off. This has the effect of higher density at + street level views. + <p> + Valid values are between 0.0 and 1.0. + </p> + */ + dynamicScreenSpaceErrorHeightFalloff: number; + /** + * Determines whether the tileset casts or receives shadows from light sources. + <p> + Enabling shadows has a performance impact. A tileset that casts shadows must be rendered twice, once from the camera and again from the light's point of view. + </p> + <p> + Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>. + </p> + */ + shadows: ShadowMode; + /** + * Determines if the tileset will be shown. + */ + show: boolean; + /** + * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from + the original feature, e.g. glTF material or per-point color in the tile. + */ + colorBlendMode: Cesium3DTileColorBlendMode; + /** + * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is <code>MIX</code>. + A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between + resulting in a mix of the source color and feature color. + */ + colorBlendAmount: number; + /** + * Options for controlling point size based on geometric error and eye dome lighting. + */ + pointCloudShading: PointCloudShading; + /** + * The event fired to indicate progress of loading new tiles. This event is fired when a new tile + is requested, when a requested tile is finished downloading, and when a downloaded tile has been + processed and is ready to render. + <p> + The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles + processing, <code>numberOfTilesProcessing</code> are passed to the event listener. + </p> + <p> + This event is fired at the end of the frame after the scene is rendered. + </p> + * @example + * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) { + if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) { + console.log('Stopped loading'); + return; + } + + console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing); + }); + */ + loadProgress: Event; + /** + * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset + is completely loaded for this view. + <p> + This event is fired at the end of the frame after the scene is rendered. + </p> + * @example + * tileset.allTilesLoaded.addEventListener(function() { + console.log('All tiles are loaded'); + }); + */ + allTilesLoaded: Event; + /** + * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event + is fired once when all tiles in the initial view are loaded. + <p> + This event is fired at the end of the frame after the scene is rendered. + </p> + * @example + * tileset.initialTilesLoaded.addEventListener(function() { + console.log('Initial tiles are loaded'); + }); + */ + initialTilesLoaded: Event; + /** + * The event fired to indicate that a tile's content was loaded. + <p> + The loaded {@link Cesium3DTile} is passed to the event listener. + </p> + <p> + This event is fired during the tileset traversal while the frame is being rendered + so that updates to the tile take effect in the same frame. Do not create or modify + Cesium entities or primitives during the event listener. + </p> + * @example + * tileset.tileLoad.addEventListener(function(tile) { + console.log('A tile was loaded.'); + }); + */ + tileLoad: Event; + /** + * The event fired to indicate that a tile's content was unloaded. + <p> + The unloaded {@link Cesium3DTile} is passed to the event listener. + </p> + <p> + This event is fired immediately before the tile's content is unloaded while the frame is being + rendered so that the event listener has access to the tile's content. Do not create + or modify Cesium entities or primitives during the event listener. + </p> + * @example + * tileset.tileUnload.addEventListener(function(tile) { + console.log('A tile was unloaded from the cache.'); + }); + */ + tileUnload: Event; + /** + * The event fired to indicate that a tile's content failed to load. + <p> + If there are no event listeners, error messages will be logged to the console. + </p> + <p> + The error object passed to the listener contains two properties: + <ul> + <li><code>url</code>: the url of the failed tile.</li> + <li><code>message</code>: the error message.</li> + </ul> + * @example + * tileset.tileFailed.addEventListener(function(error) { + console.log('An error occurred loading tile: ' + error.url); + console.log('Error: ' + error.message); + }); + */ + tileFailed: Event; + /** + * This event fires once for each visible tile in a frame. This can be used to manually + style a tileset. + <p> + The visible {@link Cesium3DTile} is passed to the event listener. + </p> + <p> + This event is fired during the tileset traversal while the frame is being rendered + so that updates to the tile take effect in the same frame. Do not create or modify + Cesium entities or primitives during the event listener. + </p> + * @example + * tileset.tileVisible.addEventListener(function(tile) { + if (tile.content instanceof Cesium.Batched3DModel3DTileContent) { + console.log('A Batched 3D Model tile is visible.'); + } + }); + * @example + * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible. + tileset.style = new Cesium.Cesium3DTileStyle({ + color : 'color("red")' + }); + tileset.tileVisible.addEventListener(function(tile) { + var content = tile.content; + var featuresLength = content.featuresLength; + for (var i = 0; i < featuresLength; i+=2) { + content.getFeature(i).color = Cesium.Color.fromRandom(); + } + }); + */ + tileVisible: Event; + /** + * Optimization option. Determines if level of detail skipping should be applied during the traversal. + <p> + The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require + all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped + entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when + using this optimization. + </p> + */ + skipLevelOfDetail: boolean; + /** + * The screen space error that must be reached before skipping levels of detail. + <p> + Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>. + </p> + */ + baseScreenSpaceError: number; + /** + * Multiplier defining the minimum screen space error to skip. + For example, if a tile has screen space error of 100, no tiles will be loaded unless they + are leaves or have a screen space error <code><= 100 / skipScreenSpaceErrorFactor</code>. + <p> + Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>. + </p> + */ + skipScreenSpaceErrorFactor: number; + /** + * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. + For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2. + <p> + Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>. + </p> + */ + skipLevels: number; + /** + * When true, only tiles that meet the maximum screen space error will ever be downloaded. + Skipping factors are ignored and just the desired tiles are loaded. + <p> + Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>. + </p> + */ + immediatelyLoadDesiredLevelOfDetail: boolean; + /** + * Determines whether siblings of visible tiles are always downloaded during traversal. + This may be useful for ensuring that tiles are already available when the viewer turns left/right. + <p> + Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>. + </p> + */ + loadSiblings: boolean; + /** + * The light color when shading models. When <code>undefined</code> the scene's light color is used instead. + <p> + For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code> will make the + model much darker. Here, increasing the intensity of the light source will make the model brighter. + </p> + */ + lightColor: Cartesian3; + /** + * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map. + This is used when {@link Cesium3DTileset#specularEnvironmentMaps} and {@link Cesium3DTileset#sphericalHarmonicCoefficients} are not defined. + */ + luminanceAtZenith: number; + /** + * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance + computed from the atmosphere color is used. + <p> + There are nine <code>Cartesian3</code> coefficients. + The order of the coefficients is: L<sub>00</sub>, L<sub>1-1</sub>, L<sub>10</sub>, L<sub>11</sub>, L<sub>2-2</sub>, L<sub>2-1</sub>, L<sub>20</sub>, L<sub>21</sub>, L<sub>22</sub> + </p> + + These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of + {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be + supplied to {@link Cesium3DTileset#specularEnvironmentMaps}. + */ + sphericalHarmonicCoefficients: Cartesian3[]; + /** + * A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps. + */ + specularEnvironmentMaps: string; + /** + * Whether to cull back-facing geometry. When true, back face culling is determined + by the glTF material's doubleSided property; when false, back face culling is disabled. + */ + backFaceCulling: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + Determines if only the tiles from last frame should be used for rendering. This + effectively "freezes" the tileset to the previous frame so it is possible to zoom + out and see what was rendered. + </p> + */ + debugFreezeFrame: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, assigns a random color to each tile. This is useful for visualizing + what features belong to what tiles, especially with additive refinement where features + from parent tiles may be interleaved with features from child tiles. + </p> + */ + debugColorizeTiles: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, renders each tile's content as a wireframe. + </p> + */ + debugWireframe: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, renders the bounding volume for each visible tile. The bounding volume is + white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the + screen space error and are still refining to their descendants are yellow. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, renders the bounding volume for each visible tile's content. The bounding volume is + blue if the tile has a content bounding volume; otherwise it is red. + </p> + */ + debugShowContentBoundingVolume: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, renders the viewer request volume for each tile. + </p> + */ + debugShowViewerRequestVolume: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, draws labels to indicate the geometric error of each tile. + </p> + */ + debugShowGeometricError: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, draws labels to indicate the number of commands, points, triangles and features of each tile. + </p> + */ + debugShowRenderingStatistics: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, draws labels to indicate the geometry and texture memory usage of each tile. + </p> + */ + debugShowMemoryUsage: boolean; + /** + * This property is for debugging only; it is not optimized for production use. + <p> + When true, draws labels to indicate the url of each tile. + </p> + */ + debugShowUrl: boolean; + /** + * Function for examining vector lines as they are being streamed. + */ + examineVectorLinesFunction: (...params: any[]) => any; + /** + * Gets the tileset's asset object property, which contains metadata about the tileset. + <p> + See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-asset|asset schema reference} + in the 3D Tiles spec for the full set of properties. + </p> + */ + readonly asset: any; + /** + * Gets the tileset's extensions object property. + */ + readonly extensions: any; + /** + * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset. + */ + clippingPlanes: ClippingPlaneCollection; + /** + * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties. + <p> + See the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification#reference-properties|properties schema reference} + in the 3D Tiles spec for the full set of properties. + </p> + * @example + * console.log('Maximum building height: ' + tileset.properties.height.maximum); + console.log('Minimum building height: ' + tileset.properties.height.minimum); + */ + readonly properties: any; + /** + * When <code>true</code>, the tileset's root tile is loaded and the tileset is ready to render. + This is set to <code>true</code> right before {@link Cesium3DTileset#readyPromise} is resolved. + */ + readonly ready: boolean; + /** + * Gets the promise that will be resolved when the tileset's root tile is loaded and the tileset is ready to render. + <p> + This promise is resolved at the end of the frame before the first frame the tileset is rendered in. + </p> + * @example + * tileset.readyPromise.then(function(tileset) { + // tile.properties is not defined until readyPromise resolves. + var properties = tileset.properties; + if (Cesium.defined(properties)) { + for (var name in properties) { + console.log(properties[name]); + } + } + }); + */ + readonly readyPromise: Promise<Cesium3DTileset>; + /** + * When <code>true</code>, all tiles that meet the screen space error this frame are loaded. The tileset is + completely loaded for this view. + */ + readonly tilesLoaded: boolean; + /** + * The resource used to fetch the tileset JSON file + */ + readonly resource: Resource; + /** + * The base path that non-absolute paths in tileset JSON file are relative to. + */ + readonly basePath: string; + /** + * The style, defined using the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, + applied to each feature in the tileset. + <p> + Assign <code>undefined</code> to remove the style, which will restore the visual + appearance of the tileset to its default when no style was applied. + </p> + <p> + The style is applied to a tile before the {@link Cesium3DTileset#tileVisible} + event is raised, so code in <code>tileVisible</code> can manually set a feature's + properties (e.g. color and show) after the style is applied. When + a new style is assigned any manually set properties are overwritten. + </p> + * @example + * tileset.style = new Cesium.Cesium3DTileStyle({ + color : { + conditions : [ + ['${Height} >= 100', 'color("purple", 0.5)'], + ['${Height} >= 50', 'color("red")'], + ['true', 'color("blue")'] + ] + }, + show : '${Height} > 0', + meta : { + description : '"Building id ${id} has height ${Height}."' + } + }); + */ + style: Cesium3DTileStyle | undefined; + /** + * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile + refines to its descendants, and therefore plays a major role in balancing performance with visual quality. + <p> + A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a + radius equal to the tile's <b>geometric error</b> were rendered at the tile's position. If this value exceeds + <code>maximumScreenSpaceError</code> the tile refines to its descendants. + </p> + <p> + Depending on the tileset, <code>maximumScreenSpaceError</code> may need to be tweaked to achieve the right balance. + Higher values provide better performance but lower visual quality. + </p> + */ + maximumScreenSpaceError: number; + /** + * The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from + geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also + includes per-point metadata. + <p> + Tiles not in view are unloaded to enforce this. + </p> + <p> + If decreasing this value results in unloading tiles, the tiles are unloaded the next frame. + </p> + <p> + If tiles sized more than <code>maximumMemoryUsage</code> are needed + to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError}, + for the current view, then the memory usage of the tiles loaded will exceed + <code>maximumMemoryUsage</code>. For example, if the maximum is 256 MB, but + 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When + these tiles go out of view, they will be unloaded. + </p> + */ + maximumMemoryUsage: number; + /** + * The root tile. + */ + readonly root: Cesium3DTile; + /** + * The tileset's bounding sphere. + * @example + * var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ + url : 'http://localhost:8002/tilesets/Seattle/tileset.json' + })); + + tileset.readyPromise.then(function(tileset) { + // Set the camera to view the newly added tileset + viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0)); + }); + */ + readonly boundingSphere: BoundingSphere; + /** + * A 4x4 transformation matrix that transforms the entire tileset. + * @example + * // Adjust a tileset's height from the globe's surface. + var heightOffset = 20.0; + var boundingSphere = tileset.boundingSphere; + var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center); + var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0); + var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset); + var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3()); + tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); + */ + modelMatrix: Matrix4; + /** + * Returns the time, in milliseconds, since the tileset was loaded and first updated. + */ + readonly timeSinceLoad: number; + /** + * The total amount of GPU memory in bytes used by the tileset. This value is estimated from + geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also + includes per-point metadata. + */ + readonly totalMemoryUsageInBytes: number; + /** + * Determines whether terrain, 3D Tiles or both will be classified by this tileset. + <p> + This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data + must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets. + </p> + <p> + When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF: + <ul> + <li>POSITION and _BATCHID semantics are required.</li> + <li>All indices with the same batch id must occupy contiguous sections of the index buffer.</li> + <li>All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.</li> + <li>The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.</li> + <li>Only one node is supported.</li> + <li>Only one mesh per node is supported.</li> + <li>Only one primitive per mesh is supported.</li> + </ul> + </p> + */ + readonly classificationType: ClassificationType; + /** + * Gets an ellipsoid describing the shape of the globe. + */ + readonly ellipsoid: Ellipsoid; + /** + * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. + Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. + Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, essentially disabling the effect. + */ + foveatedConeSize: number; + /** + * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. + The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}. + */ + foveatedMinimumScreenSpaceErrorRelaxation: number; + /** + * Returns the <code>extras</code> property at the top-level of the tileset JSON, which contains application specific metadata. + Returns <code>undefined</code> if <code>extras</code> does not exist. + */ + readonly extras: any; + /** + * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final + diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources. + */ + imageBasedLightingFactor: Cartesian2; + /** + * Indicates that only the tileset's vector tiles should be used for classification. + */ + vectorClassificationOnly: boolean; + /** + * Provides a hook to override the method used to request the tileset json + useful when fetching tilesets from remote servers + * @param tilesetUrl - The url of the json file to be fetched + * @returns A promise that resolves with the fetched json data + */ + static loadJson(tilesetUrl: Resource | string): Promise<object>; + /** + * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all + features to re-evaluate the style in the next frame each is visible. + */ + makeStyleDirty(): void; + /** + * Unloads all tiles that weren't selected the previous frame. This can be used to + explicitly manage the tile cache and reduce the total number of tiles loaded below + {@link Cesium3DTileset#maximumMemoryUsage}. + <p> + Tile unloads occur at the next frame to keep all the WebGL delete calls + within the render loop. + </p> + */ + trimLoadedTiles(): void; + /** + * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>. + * @param extensionName - The name of the extension to check. + * @returns <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>. + */ + hasExtension(extensionName: string): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * tileset = tileset && tileset.destroy(); + */ + destroy(): void; +} + +export namespace Cesium3DTileset { + /** + * Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, + interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}. + * @param p - The start value to interpolate. + * @param q - The end value to interpolate. + * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>. + */ + type foveatedInterpolationCallback = (p: number, q: number, time: number) => number; +} + +/** + * A style that is applied to a {@link Cesium3DTileset}. +<p> +Evaluates an expression defined using the +{@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. +</p> + * @example + * tileset.style = new Cesium.Cesium3DTileStyle({ + color : { + conditions : [ + ['${Height} >= 100', 'color("purple", 0.5)'], + ['${Height} >= 50', 'color("red")'], + ['true', 'color("blue")'] + ] + }, + show : '${Height} > 0', + meta : { + description : '"Building id ${id} has height ${Height}."' + } +}); + * @example + * tileset.style = new Cesium.Cesium3DTileStyle({ + color : 'vec4(${Temperature})', + pointSize : '${Temperature} * 2.0' +}); + * @param [style] - The url of a style or an object defining a style. + */ +export class Cesium3DTileStyle { + constructor(style?: Resource | string | any); + /** + * Gets the object defining the style using the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. + */ + readonly style: any; + /** + * When <code>true</code>, the style is ready and its expressions can be evaluated. When + a style is constructed with an object, as opposed to a url, this is <code>true</code> immediately. + */ + readonly ready: boolean; + /** + * Gets the promise that will be resolved when the the style is ready and its expressions can be evaluated. + */ + readonly readyPromise: Promise<Cesium3DTileStyle>; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>show</code> property. Alternatively a boolean, string, or object defining a show style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return or convert to a <code>Boolean</code>. + </p> + <p> + This expression is applicable to all tile formats. + </p> + * @example + * var style = new Cesium3DTileStyle({ + show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)' + }); + style.show.evaluate(feature); // returns true or false depending on the feature's properties + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override show expression with a custom function + style.show = { + evaluate : function(feature) { + return true; + } + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override show expression with a boolean + style.show = true; + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override show expression with a string + style.show = '${Height} > 0'; + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override show expression with a condition + style.show = { + conditions: [ + ['${height} > 2', 'false'], + ['true', 'true'] + ]; + }; + */ + show: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>color</code> property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Color</code>. + </p> + <p> + This expression is applicable to all tile formats. + </p> + * @example + * var style = new Cesium3DTileStyle({ + color : '(${Temperature} > 90) ? color("red") : color("white")' + }); + style.color.evaluateColor(feature, result); // returns a Cesium.Color object + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override color expression with a custom function + style.color = { + evaluateColor : function(feature, result) { + return Cesium.Color.clone(Cesium.Color.WHITE, result); + } + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override color expression with a string + style.color = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override color expression with a condition + style.color = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + color: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointSize</code> property. Alternatively a string or object defining a point size style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Number</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile or a Point Cloud tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + pointSize : '(${Temperature} > 90) ? 2.0 : 1.0' + }); + style.pointSize.evaluate(feature); // returns a Number + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointSize expression with a custom function + style.pointSize = { + evaluate : function(feature) { + return 1.0; + } + }; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointSize expression with a number + style.pointSize = 1.0; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointSize expression with a string + style.pointSize = '${height} / 10'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointSize expression with a condition + style.pointSize = { + conditions : [ + ['${height} > 2', '1.0'], + ['true', '2.0'] + ] + }; + */ + pointSize: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointOutlineColor</code> property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Color</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointOutlineColor expression with a string + style.pointOutlineColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointOutlineColor expression with a condition + style.pointOutlineColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + pointOutlineColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointOutlineWidth</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Number</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointOutlineWidth expression with a string + style.pointOutlineWidth = '5'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override pointOutlineWidth expression with a condition + style.pointOutlineWidth = { + conditions : [ + ['${height} > 2', '5'], + ['true', '0'] + ] + }; + */ + pointOutlineWidth: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelColor</code> property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Color</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelColor expression with a string + style.labelColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelColor expression with a condition + style.labelColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + labelColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelOutlineColor</code> property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Color</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelOutlineColor expression with a string + style.labelOutlineColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelOutlineColor expression with a condition + style.labelOutlineColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + labelOutlineColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelOutlineWidth</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Number</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelOutlineWidth expression with a string + style.labelOutlineWidth = '5'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelOutlineWidth expression with a condition + style.labelOutlineWidth = { + conditions : [ + ['${height} > 2', '5'], + ['true', '0'] + ] + }; + */ + labelOutlineWidth: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>font</code> property. Alternatively a string or object defining a string style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>String</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"' + }); + style.font.evaluate(feature); // returns a String + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override font expression with a custom function + style.font = { + evaluate : function(feature) { + return '24px Helvetica'; + } + }; + */ + font: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>label style</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>LabelStyle</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL + }); + style.labelStyle.evaluate(feature); // returns a LabelStyle + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelStyle expression with a custom function + style.labelStyle = { + evaluate : function(feature) { + return LabelStyle.FILL; + } + }; + */ + labelStyle: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelText</code> property. Alternatively a string or object defining a string style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>String</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + labelText : '(${Temperature} > 90) ? ">90" : "<=90"' + }); + style.labelText.evaluate(feature); // returns a String + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelText expression with a custom function + style.labelText = { + evaluate : function(feature) { + return 'Example label text'; + } + }; + */ + labelText: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundColor</code> property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Color</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundColor expression with a string + style.backgroundColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundColor expression with a condition + style.backgroundColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + backgroundColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundPadding</code> property. Alternatively a string or object defining a vec2 style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Cartesian2</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundPadding expression with a string + style.backgroundPadding = 'vec2(5.0, 7.0)'; + style.backgroundPadding.evaluate(feature); // returns a Cartesian2 + */ + backgroundPadding: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundEnabled</code> property. Alternatively a string or object defining a boolean style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Boolean</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundEnabled expression with a string + style.backgroundEnabled = 'true'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override backgroundEnabled expression with a condition + style.backgroundEnabled = { + conditions : [ + ['${height} > 2', 'true'], + ['true', 'false'] + ] + }; + */ + backgroundEnabled: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>scaleByDistance</code> property. Alternatively a string or object defining a vec4 style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Cartesian4</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override scaleByDistance expression with a string + style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)'; + style.scaleByDistance.evaluate(feature); // returns a Cartesian4 + */ + scaleByDistance: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>translucencyByDistance</code> property. Alternatively a string or object defining a vec4 style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Cartesian4</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override translucencyByDistance expression with a string + style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)'; + style.translucencyByDistance.evaluate(feature); // returns a Cartesian4 + */ + translucencyByDistance: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>distanceDisplayCondition</code> property. Alternatively a string or object defining a vec2 style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Cartesian2</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override distanceDisplayCondition expression with a string + style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)'; + style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2 + */ + distanceDisplayCondition: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>heightOffset</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Number</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override heightOffset expression with a string + style.heightOffset = '2.0'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override heightOffset expression with a condition + style.heightOffset = { + conditions : [ + ['${height} > 2', '4.0'], + ['true', '2.0'] + ] + }; + */ + heightOffset: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>anchorLineEnabled</code> property. Alternatively a string or object defining a boolean style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Boolean</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override anchorLineEnabled expression with a string + style.anchorLineEnabled = 'true'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override anchorLineEnabled expression with a condition + style.anchorLineEnabled = { + conditions : [ + ['${height} > 2', 'true'], + ['true', 'false'] + ] + }; + */ + anchorLineEnabled: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>anchorLineColor</code> property. Alternatively a string or object defining a color style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Color</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override anchorLineColor expression with a string + style.anchorLineColor = 'color("blue")'; + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override anchorLineColor expression with a condition + style.anchorLineColor = { + conditions : [ + ['${height} > 2', 'color("cyan")'], + ['true', 'color("blue")'] + ] + }; + */ + anchorLineColor: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>image</code> property. Alternatively a string or object defining a string style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>String</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"' + }); + style.image.evaluate(feature); // returns a String + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override image expression with a custom function + style.image = { + evaluate : function(feature) { + return '/url/to/image'; + } + }; + */ + image: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>disableDepthTestDistance</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>Number</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override disableDepthTestDistance expression with a string + style.disableDepthTestDistance = '1000.0'; + style.disableDepthTestDistance.evaluate(feature); // returns a Number + */ + disableDepthTestDistance: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>horizontalOrigin</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>HorizontalOrigin</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + horizontalOrigin : HorizontalOrigin.LEFT + }); + style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override horizontalOrigin expression with a custom function + style.horizontalOrigin = { + evaluate : function(feature) { + return HorizontalOrigin.CENTER; + } + }; + */ + horizontalOrigin: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>verticalOrigin</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>VerticalOrigin</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + verticalOrigin : VerticalOrigin.TOP + }); + style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override verticalOrigin expression with a custom function + style.verticalOrigin = { + evaluate : function(feature) { + return VerticalOrigin.CENTER; + } + }; + */ + verticalOrigin: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelHorizontalOrigin</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>HorizontalOrigin</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + labelHorizontalOrigin : HorizontalOrigin.LEFT + }); + style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelHorizontalOrigin expression with a custom function + style.labelHorizontalOrigin = { + evaluate : function(feature) { + return HorizontalOrigin.CENTER; + } + }; + */ + labelHorizontalOrigin: StyleExpression; + /** + * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelVerticalOrigin</code> property. Alternatively a string or object defining a number style can be used. + The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter. + <p> + The expression must return a <code>VerticalOrigin</code>. + </p> + <p> + This expression is only applicable to point features in a Vector tile. + </p> + * @example + * var style = new Cesium3DTileStyle({ + labelVerticalOrigin : VerticalOrigin.TOP + }); + style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin + * @example + * var style = new Cesium.Cesium3DTileStyle(); + // Override labelVerticalOrigin expression with a custom function + style.labelVerticalOrigin = { + evaluate : function(feature) { + return VerticalOrigin.CENTER; + } + }; + */ + labelVerticalOrigin: StyleExpression; + /** + * Gets or sets the object containing application-specific expression that can be explicitly + evaluated, e.g., for display in a UI. + * @example + * var style = new Cesium3DTileStyle({ + meta : { + description : '"Building id ${id} has height ${Height}."' + } + }); + style.meta.description.evaluate(feature); // returns a String with the substituted variables + */ + meta: StyleExpression; +} + +/** + * A ParticleEmitter that emits particles from a circle. +Particles will be positioned within a circle and have initial velocities going along the z vector. + * @param [radius = 1.0] - The radius of the circle in meters. + */ +export class CircleEmitter { + constructor(radius?: number); + /** + * The radius of the circle in meters. + */ + radius: number; + /** + * The angle of the cone in radians. + */ + angle: number; +} + +/** + * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted. +<p> +A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including +{@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, +and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix +and match most of them and add a new geometry or appearance independently of each other. +Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using +ClassificationPrimitive directly. +For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead. +</p> +<p> +For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there +will be rendering artifacts for some viewing angles. +</p> +<p> +Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}. +</p> +<p> +Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}, +are also valid if they are extruded volumes; otherwise, they will not be rendered. +</p> + * @param [options] - Object with the following properties: + * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one. + * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute. + * @param [options.show = true] - Determines if this primitive will be shown. + * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches. + * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time. + * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory. + * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory. + * @param [options.allowPicking = true] - When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. + * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first. + * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on + creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>. + */ +export class ClassificationPrimitive { + constructor(options?: { + geometryInstances?: any[] | GeometryInstance + appearance?: Appearance + show?: boolean + vertexCacheOptimize?: boolean + interleave?: boolean + compressVertices?: boolean + releaseGeometryInstances?: boolean + allowPicking?: boolean + asynchronous?: boolean + classificationType?: ClassificationType + debugShowBoundingVolume?: boolean + debugShowShadowVolume?: boolean + }); + /** + * The geometry instance rendered with this primitive. This may + be <code>undefined</code> if <code>options.releaseGeometryInstances</code> + is <code>true</code> when the primitive is constructed. + <p> + Changing this property after the primitive is rendered has no effect. + </p> + <p> + Because of the rendering technique used, all geometry instances must be the same color. + If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown + on the first attempt to render. + </p> + */ + readonly geometryInstances: any[] | GeometryInstance; + /** + * Determines if the primitive will be shown. This affects all geometry + instances in the primitive. + */ + show: boolean; + /** + * Determines whether terrain, 3D Tiles or both will be classified. + */ + classificationType: ClassificationType; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the primitive. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the shadow volume for each geometry in the primitive. + </p> + */ + debugShowShadowVolume: boolean; + /** + * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches. + */ + readonly vertexCacheOptimize: boolean; + /** + * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. + */ + readonly interleave: boolean; + /** + * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory. + */ + readonly releaseGeometryInstances: boolean; + /** + * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. + */ + readonly allowPicking: boolean; + /** + * Determines if the geometry instances will be created and batched on a web worker. + */ + readonly asynchronous: boolean; + /** + * When <code>true</code>, geometry vertices are compressed, which will save memory. + */ + readonly compressVertices: boolean; + /** + * Determines if the primitive is complete and ready to render. If this property is + true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update} + is called. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves when the primitive is ready to render. + */ + readonly readyPromise: Promise<ClassificationPrimitive>; + /** + * Determines if ClassificationPrimitive rendering is supported. + * @param scene - The scene. + * @returns <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code> + */ + static isSupported(scene: Scene): boolean; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. + * @example + * var attributes = primitive.getGeometryInstanceAttributes('an id'); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); + * @param id - The id of the {@link GeometryInstance}. + * @returns The typed array in the attribute's format or undefined if the is no instance with id. + */ + getGeometryInstanceAttributes(id: any): any; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + * @example + * e = e && e.destroy(); + */ + destroy(): void; +} + +/** + * Whether a classification affects terrain, 3D Tiles or both. + */ +export enum ClassificationType { + /** + * Only terrain will be classified. + */ + TERRAIN = 0, + /** + * Only 3D Tiles will be classified. + */ + CESIUM_3D_TILE = 1, + /** + * Both terrain and 3D Tiles will be classified. + */ + BOTH = 2 +} + +/** + * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}. +Compatible with mathematics functions in {@link Plane} + * @param normal - The plane's normal (normalized). + * @param distance - The shortest distance from the origin to the plane. The sign of +<code>distance</code> determines which side of the plane the origin +is on. If <code>distance</code> is positive, the origin is in the half-space +in the direction of the normal; if negative, the origin is in the half-space +opposite to the normal; if zero, the plane passes through the origin. + */ +export class ClippingPlane { + constructor(normal: Cartesian3, distance: number); + /** + * The shortest distance from the origin to the plane. The sign of + <code>distance</code> determines which side of the plane the origin + is on. If <code>distance</code> is positive, the origin is in the half-space + in the direction of the normal; if negative, the origin is in the half-space + opposite to the normal; if zero, the plane passes through the origin. + */ + distance: number; + /** + * The plane's normal. + */ + normal: Cartesian3; + /** + * Create a ClippingPlane from a Plane object. + * @param plane - The plane containing parameters to copy + * @param [result] - The object on which to store the result + * @returns The ClippingPlane generated from the plane's parameters. + */ + static fromPlane(plane: Plane, result?: ClippingPlane): ClippingPlane; + /** + * Clones the ClippingPlane without setting its ownership. + * @param clippingPlane - The ClippingPlane to be cloned + * @param [result] - The object on which to store the cloned parameters. + * @returns a clone of the input ClippingPlane + */ + static clone(clippingPlane: ClippingPlane, result?: ClippingPlane): ClippingPlane; +} + +/** + * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the +outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe. +<p> +In general the clipping planes' coordinates are relative to the object they're attached to, so a plane with distance set to 0 will clip +through the center of the object. +</p> +<p> +For 3D Tiles, the root tile's transform is used to position the clipping planes. If a transform is not defined, the root tile's {@link Cesium3DTile#boundingSphere} is used instead. +</p> + * @example + * // This clipping plane's distance is positive, which means its normal +// is facing the origin. This will clip everything that is behind +// the plane, which is anything with y coordinate < -5. +var clippingPlanes = new Cesium.ClippingPlaneCollection({ + planes : [ + new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0) + ], +}); +// Create an entity and attach the ClippingPlaneCollection to the model. +var entity = viewer.entities.add({ + position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000), + model : { + uri : 'model.gltf', + minimumPixelSize : 128, + maximumScale : 20000, + clippingPlanes : clippingPlanes + } +}); +viewer.zoomTo(entity); + * @param [options] - Object with the following properties: + * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane. + * @param [options.enabled = true] - Determines whether the clipping planes are active. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system. + * @param [options.unionClippingRegions = false] - If true, a region will be clipped if it is on the outside of any plane in the collection. Otherwise, a region will only be clipped if it is on the outside of every plane. + * @param [options.edgeColor = Color.WHITE] - The color applied to highlight the edge along which an object is clipped. + * @param [options.edgeWidth = 0.0] - The width, in pixels, of the highlight applied to the edge along which an object is clipped. + */ +export class ClippingPlaneCollection { + constructor(options?: { + planes?: ClippingPlane[] + enabled?: boolean + modelMatrix?: Matrix4 + unionClippingRegions?: boolean + edgeColor?: Color + edgeWidth?: number + }); + /** + * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes + original coordinate system. + */ + modelMatrix: Matrix4; + /** + * The color applied to highlight the edge along which an object is clipped. + */ + edgeColor: Color; + /** + * The width, in pixels, of the highlight applied to the edge along which an object is clipped. + */ + edgeWidth: number; + /** + * An event triggered when a new clipping plane is added to the collection. Event handlers + are passed the new plane and the index at which it was added. + */ + planeAdded: Event; + /** + * An event triggered when a new clipping plane is removed from the collection. Event handlers + are passed the new plane and the index from which it was removed. + */ + planeRemoved: Event; + /** + * Returns the number of planes in this collection. This is commonly used with + {@link ClippingPlaneCollection#get} to iterate over all the planes + in the collection. + */ + readonly length: number; + /** + * If true, a region will be clipped if it is on the outside of any plane in the + collection. Otherwise, a region will only be clipped if it is on the + outside of every plane. + */ + unionClippingRegions: boolean; + /** + * If true, clipping will be enabled. + */ + enabled: boolean; + /** + * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering + on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify + how modify the clipping behavior of multiple planes. + * @param plane - The ClippingPlane to add to the collection. + */ + add(plane: ClippingPlane): void; + /** + * Returns the plane in the collection at the specified index. Indices are zero-based + and increase as planes are added. Removing a plane shifts all planes after + it to the left, changing their indices. This function is commonly used with + {@link ClippingPlaneCollection#length} to iterate over all the planes + in the collection. + * @param index - The zero-based index of the plane. + * @returns The ClippingPlane at the specified index. + */ + get(index: number): ClippingPlane; + /** + * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane. + * @param [clippingPlane] - The ClippingPlane to check for. + * @returns true if this collection contains the ClippingPlane, false otherwise. + */ + contains(clippingPlane?: ClippingPlane): boolean; + /** + * Removes the first occurrence of the given ClippingPlane from the collection. + * @returns <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection. + */ + remove(clippingPlane: ClippingPlane): boolean; + /** + * Removes all planes from the collection. + */ + removeAll(): void; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + build the resources for clipping planes. + <p> + Do not call this function directly. + </p> + */ + update(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * clippingPlanes = clippingPlanes && clippingPlanes.destroy(); + */ + destroy(): void; +} + +/** + * Defines different modes for blending between a target color and a primitive's source color. + +HIGHLIGHT multiplies the source color by the target color +REPLACE replaces the source color with the target color +MIX blends the source color and target color together + */ +export enum ColorBlendMode { + HIGHLIGHT = 0, + REPLACE = 1, + MIX = 2 +} + +/** + * An expression for a style applied to a {@link Cesium3DTileset}. +<p> +Evaluates a conditions expression defined using the +{@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. +</p> +<p> +Implements the {@link StyleExpression} interface. +</p> + * @example + * var expression = new Cesium.ConditionsExpression({ + conditions : [ + ['${Area} > 10, 'color("#FF0000")'], + ['${id} !== "1"', 'color("#00FF00")'], + ['true', 'color("#FFFFFF")'] + ] +}); +expression.evaluateColor(feature, result); // returns a Cesium.Color object + * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language. + * @param [defines] - Defines in the style. + */ +export class ConditionsExpression { + constructor(conditionsExpression?: any, defines?: any); + /** + * Gets the conditions expression defined in the 3D Tiles Styling language. + */ + readonly conditionsExpression: any; + /** + * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of + the expression in the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript + primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code> + object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>, + a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is + a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. + * @param feature - The feature whose properties may be used as variables in the expression. + * @param [result] - The object onto which to store the result. + * @returns The result of evaluating the expression. + */ + evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; + /** + * Evaluates the result of a Color expression, using the values defined by a feature. + <p> + This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object. + </p> + * @param feature - The feature whose properties may be used as variables in the expression. + * @param [result] - The object in which to store the result + * @returns The modified result parameter or a new Color instance if one was not provided. + */ + evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color; +} + +/** + * A ParticleEmitter that emits particles within a cone. +Particles will be positioned at the tip of the cone and have initial velocities going towards the base. + * @param [angle = Cesium.Math.toRadians(30.0)] - The angle of the cone in radians. + */ +export class ConeEmitter { + constructor(angle?: number); +} + +/** + * @property height - The height. + * @property color - The color at this height. + */ +export type createElevationBandMaterialEntry = { + height: number + color: Color +}; + +/** + * @property entries - A list of elevation entries. They will automatically be sorted from lowest to highest. If there is only one entry and <code>extendsDownards</code> and <code>extendUpwards</code> are both <code>false</code>, they will both be set to <code>true</code>. + * @property [extendDownwards = false] - If <code>true</code>, the band's minimum elevation color will extend infinitely downwards. + * @property [extendUpwards = false] - If <code>true</code>, the band's maximum elevation color will extend infinitely upwards. + */ +export type createElevationBandMaterialBand = { + entries: createElevationBandMaterialEntry[] + extendDownwards?: boolean + extendUpwards?: boolean +}; + +/** + * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights. + +The shader does a binary search over all the heights to find out which colors are above and below a given height, and +interpolates between them for the final color. This material supports hundreds of entries relatively cheaply. + * @example + * scene.globe.material = Cesium.createElevationBandMaterial({ + scene : scene, + layers : [{ + entries : [{ + height : 4200.0, + color : new Cesium.Color(0.0, 0.0, 0.0, 1.0) + }, { + height : 8848.0, + color : new Cesium.Color(1.0, 1.0, 1.0, 1.0) + }], + extendDownwards : true, + extendUpwards : true, + }, { + entries : [{ + height : 7000.0, + color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) + }, { + height : 7100.0, + color : new Cesium.Color(1.0, 0.0, 0.0, 0.5) + }] + }] +}); + * @param options - Object with the following properties: + * @param options.scene - The scene where the visualization is taking place. + * @param options.layers - A list of bands ordered from lowest to highest precedence. + * @returns A new {@link Material} instance. + */ +export function createElevationBandMaterial(options: { + scene: Scene + layers: createElevationBandMaterialBand[] +}): Material; + +/** + * Creates a {@link Cesium3DTileset} instance for the +{@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings} +tileset. + * @example + * // Create Cesium OSM Buildings with default styling +var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.scene.primitives.add(Cesium.createOsmBuildings()); + * @example + * // Create Cesium OSM Buildings with a custom style highlighting +// schools and hospitals. +viewer.scene.primitives.add(Cesium.createOsmBuildings({ + style: new Cesium.Cesium3DTileStyle({ + color: { + conditions: [ + ["${feature['building']} === 'hospital'", "color('#0000FF')"], + ["${feature['building']} === 'school'", "color('#00FF00')"], + [true, "color('#ffffff')"] + ] + } + }) +})); + * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor + may be specified here. In addition to those, the following properties are supported: + * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings + that do not have a color. This parameter is ignored if <code>options.style</code> is specified. + * @param [options.style] - The style to use with the tileset. If not + specified, a default style is used which gives each building or building part a + color inferred from its OpenStreetMap <code>tags</code>. If no color can be inferred, + <code>options.defaultColor</code> is used. + */ +export function createOsmBuildings(options?: { + defaultColor?: Color + style?: Cesium3DTileStyle +}): Cesium3DTileset; + +/** + * Creates a {@link Primitive} to visualize well-known vector vertex attributes: +<code>normal</code>, <code>tangent</code>, and <code>bitangent</code>. Normal +is red; tangent is green; and bitangent is blue. If an attribute is not +present, it is not drawn. + * @example + * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({ + geometry : instance.geometry, + length : 100000.0, + modelMatrix : instance.modelMatrix +})); + * @param options - Object with the following properties: + * @param options.geometry - The <code>Geometry</code> instance with the attribute. + * @param [options.length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates. + * @returns A new <code>Primitive</code> instance with geometry for the vectors. + */ +export function createTangentSpaceDebugPrimitive(options: { + geometry: Geometry + length?: number + modelMatrix?: Matrix4 +}): Primitive; + +/** + * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps. + * @example + * // Create Cesium World Terrain with default settings +var viewer = new Cesium.Viewer('cesiumContainer', { + imageryProvider : Cesium.createWorldImagery(); +}); + * @example + * // Create Cesium World Terrain with water and normals. +var viewer = new Cesium.Viewer('cesiumContainer', { + imageryProvider : Cesium.createWorldImagery({ + style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS + }) +}); + * @param [options] - Object with the following properties: + * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported. + */ +export function createWorldImagery(options?: { + style?: IonWorldImageryStyle +}): IonImageryProvider; + +/** + * The credit display is responsible for displaying credits on screen. + * @example + * var creditDisplay = new Cesium.CreditDisplay(creditContainer); + * @param container - The HTML element where credits will be displayed + * @param [delimiter = ' • '] - The string to separate text credits + * @param [viewport = document.body] - The HTML element that will contain the credits popup + */ +export class CreditDisplay { + constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement); + /** + * The HTML element where credits will be displayed. + */ + container: HTMLElement; + /** + * Adds a credit to the list of current credits to be displayed in the credit container + * @param credit - The credit to display + */ + addCredit(credit: Credit): void; + /** + * Adds credits that will persist until they are removed + * @param credit - The credit to added to defaults + */ + addDefaultCredit(credit: Credit): void; + /** + * Removes a default credit + * @param credit - The credit to be removed from defaults + */ + removeDefaultCredit(credit: Credit): void; + /** + * Updates the credit display before a new frame is rendered. + */ + update(): void; + /** + * Resets the credit display to a beginning of frame state, clearing out current credits. + */ + beginFrame(): void; + /** + * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container. + */ + endFrame(): void; + /** + * Destroys the resources held by this object. Destroying an object allows for deterministic + release of resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + */ + destroy(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Gets or sets the Cesium logo credit. + */ + static cesiumCredit: Credit; +} + +/** + * Determines which triangles, if any, are culled. + */ +export enum CullFace { + /** + * Front-facing triangles are culled. + */ + FRONT = WebGLConstants.FRONT, + /** + * Back-facing triangles are culled. + */ + BACK = WebGLConstants.BACK, + /** + * Both front-facing and back-facing triangles are culled. + */ + FRONT_AND_BACK = WebGLConstants.FRONT_AND_BACK +} + +/** + * Visualizes a vertex attribute by displaying it as a color for debugging. +<p> +Components for well-known unit-length vectors, i.e., <code>normal</code>, +<code>tangent</code>, and <code>bitangent</code>, are scaled and biased +from [-1.0, 1.0] to (-1.0, 1.0). +</p> + * @example + * var primitive = new Cesium.Primitive({ + geometryInstances : // ... + appearance : new Cesium.DebugAppearance({ + attributeName : 'normal' + }) +}); + * @param options - Object with the following properties: + * @param options.attributeName - The name of the attribute to visualize. + * @param [options.perInstanceAttribute = false] - Boolean that determines whether this attribute is a per-instance geometry attribute. + * @param [options.glslDatatype = 'vec3'] - The GLSL datatype of the attribute. Supported datatypes are <code>float</code>, <code>vec2</code>, <code>vec3</code>, and <code>vec4</code>. + * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. + * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. + * @param [options.renderState] - Optional render state to override the default render state. + */ +export class DebugAppearance { + constructor(options: { + attributeName: string + perInstanceAttribute?: boolean + glslDatatype?: string + vertexShaderSource?: string + fragmentShaderSource?: string + renderState?: any + }); + /** + * This property is part of the {@link Appearance} interface, but is not + used by {@link DebugAppearance} since a fully custom fragment shader is used. + */ + material: Material; + /** + * When <code>true</code>, the geometry is expected to appear translucent. + */ + translucent: boolean; + /** + * The GLSL source code for the vertex shader. + */ + readonly vertexShaderSource: string; + /** + * The GLSL source code for the fragment shader. The full fragment shader + source is built procedurally taking into account the {@link DebugAppearance#material}. + Use {@link DebugAppearance#getFragmentShaderSource} to get the full source. + */ + readonly fragmentShaderSource: string; + /** + * The WebGL fixed-function state to use when rendering the geometry. + */ + readonly renderState: any; + /** + * When <code>true</code>, the geometry is expected to be closed. + */ + readonly closed: boolean; + /** + * The name of the attribute being visualized. + */ + readonly attributeName: string; + /** + * The GLSL datatype of the attribute being visualized. + */ + readonly glslDatatype: string; + /** + * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just + {@link DebugAppearance#fragmentShaderSource}. + * @returns The full GLSL fragment shader source. + */ + getFragmentShaderSource(): string; + /** + * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}. + * @returns <code>true</code> if the appearance is translucent. + */ + isTranslucent(): boolean; + /** + * Creates a render state. This is not the final render state instance; instead, + it can contain a subset of render state properties identical to the render state + created in the context. + * @returns The render state. + */ + getRenderState(): any; +} + +/** + * Draws the outline of the camera's view frustum. + * @example + * primitives.add(new Cesium.DebugCameraPrimitive({ + camera : camera, + color : Cesium.Color.YELLOW +})); + * @param options - Object with the following properties: + * @param options.camera - The camera. + * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values. + * @param [options.color = Color.CYAN] - The color of the debug outline. + * @param [options.updateOnChange = true] - Whether the primitive updates when the underlying camera changes. + * @param [options.show = true] - Determines if this primitive will be shown. + * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}. + */ +export class DebugCameraPrimitive { + constructor(options: { + camera: Camera + frustumSplits?: number[] + color?: Color + updateOnChange?: boolean + show?: boolean + id?: any + }); + /** + * Determines if this primitive will be shown. + */ + show: boolean; + /** + * User-defined value returned when the primitive is picked. + */ + id: any; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + * @example + * p = p && p.destroy(); + */ + destroy(): void; +} + +/** + * Draws the axes of a reference frame defined by a matrix that transforms to world +coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is +a primitives <code>modelMatrix</code>. +<p> +The X axis is red; Y is green; and Z is blue. +</p> +<p> +This is for debugging only; it is not optimized for production use. +</p> + * @example + * primitives.add(new Cesium.DebugModelMatrixPrimitive({ + modelMatrix : primitive.modelMatrix, // primitive to debug + length : 100000.0, + width : 10.0 +})); + * @param [options] - Object with the following properties: + * @param [options.length = 10000000.0] - The length of the axes in meters. + * @param [options.width = 2.0] - The width of the axes in pixels. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize. + * @param [options.show = true] - Determines if this primitive will be shown. + * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick} + */ +export class DebugModelMatrixPrimitive { + constructor(options?: { + length?: number + width?: number + modelMatrix?: Matrix4 + show?: boolean + id?: any + }); + /** + * The length of the axes in meters. + */ + length: number; + /** + * The width of the axes in pixels. + */ + width: number; + /** + * Determines if this primitive will be shown. + */ + show: boolean; + /** + * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize. + */ + modelMatrix: Matrix4; + /** + * User-defined value returned when the primitive is picked. + */ + id: any; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + * @example + * p = p && p.destroy(); + */ + destroy(): void; +} + +/** + * Determines the function used to compare two depths for the depth test. + */ +export enum DepthFunction { + /** + * The depth test never passes. + */ + NEVER = WebGLConstants.NEVER, + /** + * The depth test passes if the incoming depth is less than the stored depth. + */ + LESS = WebGLConstants.LESS, + /** + * The depth test passes if the incoming depth is equal to the stored depth. + */ + EQUAL = WebGLConstants.EQUAL, + /** + * The depth test passes if the incoming depth is less than or equal to the stored depth. + */ + LESS_OR_EQUAL = WebGLConstants.LEQUAL, + /** + * The depth test passes if the incoming depth is greater than the stored depth. + */ + GREATER = WebGLConstants.GREATER, + /** + * The depth test passes if the incoming depth is not equal to the stored depth. + */ + NOT_EQUAL = WebGLConstants.NOTEQUAL, + /** + * The depth test passes if the incoming depth is greater than or equal to the stored depth. + */ + GREATER_OR_EQUAL = WebGLConstants.GEQUAL, + /** + * The depth test always passes. + */ + ALWAYS = WebGLConstants.ALWAYS +} + +/** + * A light that gets emitted in a single direction from infinitely far away. + * @param options - Object with the following properties: + * @param options.direction - The direction in which light gets emitted. + * @param [options.color = Color.WHITE] - The color of the light. + * @param [options.intensity = 1.0] - The intensity of the light. + */ +export class DirectionalLight { + constructor(options: { + direction: Cartesian3 + color?: Color + intensity?: number + }); + /** + * The direction in which light gets emitted. + */ + direction: Cartesian3; + /** + * The color of the light. + */ + color: Color; + /** + * The intensity of the light. + */ + intensity: number; +} + +/** + * A policy for discarding tile images that contain no data (and so aren't actually images). +This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is +expected to be used in place of any empty tile images by the image loading code. + */ +export class DiscardEmptyTileImagePolicy { + constructor(); + /** + * Determines if the discard policy is ready to process images. + * @returns True if the discard policy is ready to process images; otherwise, false. + */ + isReady(): boolean; + /** + * Given a tile image, decide whether to discard that image. + * @param image - An image to test. + * @returns True if the image should be discarded; otherwise, false. + */ + shouldDiscardImage(image: HTMLImageElement): boolean; + /** + * Default value for representing an empty image. + */ + static readonly EMPTY_IMAGE: HTMLImageElement; +} + +/** + * A policy for discarding tile images that match a known image containing a +"missing" image. + * @param options - Object with the following properties: + * @param options.missingImageUrl - The URL of the known missing image. + * @param options.pixelsToCheck - An array of {@link Cartesian2} pixel positions to + compare against the missing image. + * @param [options.disableCheckIfAllPixelsAreTransparent = false] - If true, the discard check will be disabled + if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the + discard check will proceed no matter the values of the pixelsToCheck. + */ +export class DiscardMissingTileImagePolicy { + constructor(options: { + missingImageUrl: Resource | string + pixelsToCheck: Cartesian2[] + disableCheckIfAllPixelsAreTransparent?: boolean + }); + /** + * Determines if the discard policy is ready to process images. + * @returns True if the discard policy is ready to process images; otherwise, false. + */ + isReady(): boolean; + /** + * Given a tile image, decide whether to discard that image. + * @param image - An image to test. + * @returns True if the image should be discarded; otherwise, false. + */ + shouldDiscardImage(image: HTMLImageElement): boolean; +} + +/** + * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry} +and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance} +with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires +fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>, +<code>tangent</code>, and <code>bitangent</code>. + * @example + * var primitive = new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.PolygonGeometry({ + vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, + // ... + }) + }), + appearance : new Cesium.EllipsoidSurfaceAppearance({ + material : Cesium.Material.fromType('Stripe') + }) +}); + * @param [options] - Object with the following properties: + * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account. + * @param [options.faceForward = options.aboveGround] - When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. + * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled. + * @param [options.aboveGround = false] - When <code>true</code>, the geometry is expected to be on the ellipsoid's surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled. + * @param [options.material = Material.ColorType] - The material used to determine the fragment color. + * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. + * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. + * @param [options.renderState] - Optional render state to override the default render state. + */ +export class EllipsoidSurfaceAppearance { + constructor(options?: { + flat?: boolean + faceForward?: boolean + translucent?: boolean + aboveGround?: boolean + material?: Material + vertexShaderSource?: string + fragmentShaderSource?: string + renderState?: any + }); + /** + * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance} + properties, this is not read-only, so an appearance's material can change on the fly. + */ + material: Material; + /** + * When <code>true</code>, the geometry is expected to appear translucent. + */ + translucent: boolean; + /** + * The GLSL source code for the vertex shader. + */ + readonly vertexShaderSource: string; + /** + * The GLSL source code for the fragment shader. The full fragment shader + source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material}, + {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}. + Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source. + */ + readonly fragmentShaderSource: string; + /** + * The WebGL fixed-function state to use when rendering the geometry. + <p> + The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance} + instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent} + and {@link EllipsoidSurfaceAppearance#aboveGround}. + </p> + */ + readonly renderState: any; + /** + * When <code>true</code>, the geometry is expected to be closed so + {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled. + If the viewer enters the geometry, it will not be visible. + */ + readonly closed: boolean; + /** + * The {@link VertexFormat} that this appearance instance is compatible with. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. + */ + readonly vertexFormat: VertexFormat; + /** + * When <code>true</code>, flat shading is used in the fragment shader, + which means lighting is not taking into account. + */ + readonly flat: boolean; + /** + * When <code>true</code>, the fragment shader flips the surface normal + as needed to ensure that the normal faces the viewer to avoid + dark spots. This is useful when both sides of a geometry should be + shaded like {@link WallGeometry}. + */ + readonly faceForward: boolean; + /** + * When <code>true</code>, the geometry is expected to be on the ellipsoid's + surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} + has backface culling enabled. + */ + readonly aboveGround: boolean; + /** + * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances + are compatible with, which requires only <code>position</code> and <code>st</code> + attributes. Other attributes are procedurally computed in the fragment shader. + */ + static readonly VERTEX_FORMAT: VertexFormat; + /** + * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance}, + this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat}, + and {@link EllipsoidSurfaceAppearance#faceForward}. + * @returns The full GLSL fragment shader source. + */ + getFragmentShaderSource(): string; + /** + * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}. + * @returns <code>true</code> if the appearance is translucent. + */ + isTranslucent(): boolean; + /** + * Creates a render state. This is not the final render state instance; instead, + it can contain a subset of render state properties identical to the render state + created in the context. + * @returns The render state. + */ + getRenderState(): any; +} + +/** + * An expression for a style applied to a {@link Cesium3DTileset}. +<p> +Evaluates an expression defined using the +{@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. +</p> +<p> +Implements the {@link StyleExpression} interface. +</p> + * @example + * var expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'); +expression.evaluate(feature); // returns true or false depending on the feature's properties + * @example + * var expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")'); +expression.evaluateColor(feature, result); // returns a Cesium.Color object + * @param [expression] - The expression defined using the 3D Tiles Styling language. + * @param [defines] - Defines in the style. + */ +export class Expression { + constructor(expression?: string, defines?: any); + /** + * Gets the expression defined in the 3D Tiles Styling language. + */ + readonly expression: string; + /** + * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of + the expression in the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript + primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code> + object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>, + a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is + a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. + * @param feature - The feature whose properties may be used as variables in the expression. + * @param [result] - The object onto which to store the result. + * @returns The result of evaluating the expression. + */ + evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; + /** + * Evaluates the result of a Color expression, optionally using the provided feature's properties. + <p> + This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object. + </p> + * @param feature - The feature whose properties may be used as variables in the expression. + * @param [result] - The object in which to store the result + * @returns The modified result parameter or a new Color instance if one was not provided. + */ + evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color; +} + +/** + * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional +performance improvements by rendering less geometry and dispatching less terrain requests. + */ +export class Fog { + constructor(); + /** + * <code>true</code> if fog is enabled, <code>false</code> otherwise. + */ + enabled: boolean; + /** + * A scalar that determines the density of the fog. Terrain that is in full fog are culled. + The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero. + The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of + 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled. + Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered. + */ + density: number; + /** + * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce + the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased + for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably + lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon. + */ + screenSpaceErrorFactor: number; + /** + * The minimum brightness of the fog color from lighting. A value of 0.0 can cause the fog to be completely black. A value of 1.0 will not affect + the brightness at all. + */ + minimumBrightness: number; +} + +/** + * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is +lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised. +To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene} +instead of constructing an instance explicitly. + * @param [options] - Object with the following properties: + * @param options.scene - The Scene instance for which to monitor performance. + * @param [options.samplingWindow = 5.0] - The length of the sliding window over which to compute the average frame rate, in seconds. + * @param [options.quietPeriod = 2.0] - The length of time to wait at startup and each time the page becomes visible (i.e. when the user + switches back to the tab) before starting to measure performance, in seconds. + * @param [options.warmupPeriod = 5.0] - The length of the warmup period, in seconds. During the warmup period, a separate + (usually lower) frame rate is required. + * @param [options.minimumFrameRateDuringWarmup = 4] - The minimum frames-per-second that are required for acceptable performance during + the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the + lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. + * @param [options.minimumFrameRateAfterWarmup = 8] - The minimum frames-per-second that are required for acceptable performance after + the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the + lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any. + */ +export class FrameRateMonitor { + constructor(options?: { + scene: Scene + samplingWindow?: number + quietPeriod?: number + warmupPeriod?: number + minimumFrameRateDuringWarmup?: number + minimumFrameRateAfterWarmup?: number + }); + /** + * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds. + */ + samplingWindow: number; + /** + * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user + switches back to the tab) before starting to measure performance, in seconds. + */ + quietPeriod: number; + /** + * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate + (usually lower) frame rate is required. + */ + warmupPeriod: number; + /** + * Gets or sets the minimum frames-per-second that are required for acceptable performance during + the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> during the <code>warmupPeriod</code>, the + <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any. + */ + minimumFrameRateDuringWarmup: number; + /** + * Gets or sets the minimum frames-per-second that are required for acceptable performance after + the end of the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> after the <code>warmupPeriod</code>, the + <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any. + */ + minimumFrameRateAfterWarmup: number; + /** + * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene} + needs to create a new frame rate monitor, and for any settings that are not passed to the + {@link FrameRateMonitor} constructor. + */ + static defaultSettings: any; + /** + * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have + a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}. + * @param scene - The scene for which to get the {@link FrameRateMonitor}. + * @returns The scene's {@link FrameRateMonitor}. + */ + static fromScene(scene: Scene): FrameRateMonitor; + /** + * Gets the {@link Scene} instance for which to monitor performance. + */ + scene: Scene; + /** + * Gets the event that is raised when a low frame rate is detected. The function will be passed + the {@link Scene} instance as its first parameter and the average number of frames per second + over the sampling window as its second parameter. + */ + lowFrameRate: Event; + /** + * Gets the event that is raised when the frame rate returns to a normal level after having been low. + The function will be passed the {@link Scene} instance as its first parameter and the average + number of frames per second over the sampling window as its second parameter. + */ + nominalFrameRate: Event; + /** + * Gets the most recently computed average frames-per-second over the last <code>samplingWindow</code>. + This property may be undefined if the frame rate has not been computed. + */ + lastFramesPerSecond: number; + /** + * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause} + must be called once for each time this function is called. + */ + pause(): void; + /** + * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called + multiple times, this function must be called the same number of times in order to + actually resume monitoring. + */ + unpause(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Unsubscribes this instance from all events it is listening to. + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + */ + destroy(): void; +} + +/** + * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server. + * @param type - The type of response to expect from a GetFeatureInfo request. Valid + values are 'json', 'xml', 'html', or 'text'. + * @param [format] - The info format to request from the WMS server. This is usually a + MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json' + using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'. + * @param [callback] - A function to invoke with the GetFeatureInfo response from the WMS server + in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified, + a default function for the type of response is used. + */ +export class GetFeatureInfoFormat { + constructor(type: string, format?: string, callback?: (...params: any[]) => any); +} + +/** + * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider}) +and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}. + * @param [ellipsoid = Ellipsoid.WGS84] - Determines the size and shape of the +globe. + */ +export class Globe { + constructor(ellipsoid?: Ellipsoid); + /** + * Determines if the globe will be shown. + */ + show: boolean; + /** + * The maximum screen-space error used to drive level-of-detail refinement. Higher + values will provide better performance but lower visual quality. + */ + maximumScreenSpaceError: number; + /** + * The size of the terrain tile cache, expressed as a number of tiles. Any additional + tiles beyond this number will be freed, as long as they aren't needed for rendering + this frame. A larger number will consume more memory but will show detail faster + when, for example, zooming out and then back in. + */ + tileCacheSize: number; + /** + * Gets or sets the number of loading descendant tiles that is considered "too many". + If a tile has too many loading descendants, that tile will be loaded and rendered before any of + its descendants are loaded and rendered. This means more feedback for the user that something + is happening at the cost of a longer overall load time. Setting this to 0 will cause each + tile level to be loaded successively, significantly increasing load time. Setting it to a large + number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make + detail appear all at once after a long wait. + */ + loadingDescendantLimit: number; + /** + * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded. + Setting this to true optimizes the zoom-out experience and provides more detail in + newly-exposed areas when panning. The down side is that it requires loading more tiles. + */ + preloadAncestors: boolean; + /** + * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded. + Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even + if they are culled. Setting this to true may provide a better panning experience at the + cost of loading more tiles. + */ + preloadSiblings: boolean; + /** + * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not + highlighted at all. The alpha value is used to alpha blend with the tile's + actual color. Because terrain fill tiles do not represent the actual terrain surface, + it may be useful in some applications to indicate visually that they are not to be trusted. + */ + fillHighlightColor: Color; + /** + * Enable lighting the globe with the scene's light source. + */ + enableLighting: boolean; + /** + * Enable dynamic lighting effects on atmosphere and fog. This only takes effect + when <code>enableLighting</code> is <code>true</code>. + */ + dynamicAtmosphereLighting: boolean; + /** + * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's + light direction. This only takes effect when <code>enableLighting</code> and + <code>dynamicAtmosphereLighting</code> are <code>true</code>. + */ + dynamicAtmosphereLightingFromSun: boolean; + /** + * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>. + */ + showGroundAtmosphere: boolean; + /** + * The distance where everything becomes lit. This only takes effect + when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>. + */ + lightingFadeOutDistance: number; + /** + * The distance where lighting resumes. This only takes effect + when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>. + */ + lightingFadeInDistance: number; + /** + * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere. + This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and + <code>dynamicAtmosphereLighting</code> are <code>true</code>. + */ + nightFadeOutDistance: number; + /** + * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere. + This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and + <code>dynamicAtmosphereLighting</code> are <code>true</code>. + */ + nightFadeInDistance: number; + /** + * True if an animated wave effect should be shown in areas of the globe + covered by water; otherwise, false. This property is ignored if the + <code>terrainProvider</code> does not provide a water mask. + */ + showWaterEffect: boolean; + /** + * True if primitives such as billboards, polylines, labels, etc. should be depth-tested + against the terrain surface, or false if such primitives should always be drawn on top + of terrain unless they're on the opposite side of the globe. The disadvantage of depth + testing primitives against terrain is that slight numerical noise or terrain level-of-detail + switched can sometimes make a primitive that should be on the surface disappear underneath it. + */ + depthTestAgainstTerrain: boolean; + /** + * Determines whether the globe casts or receives shadows from light sources. Setting the globe + to cast shadows may impact performance since the terrain is rendered again from the light's perspective. + Currently only terrain that is in view casts shadows. By default the globe does not cast shadows. + */ + shadows: ShadowMode; + /** + * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). + A hue shift of 1.0 indicates a complete rotation of the hues available. + */ + atmosphereHueShift: number; + /** + * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). + A saturation shift of -1.0 is monochrome. + */ + atmosphereSaturationShift: number; + /** + * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). + A brightness shift of -1.0 is complete darkness, which will let space show through. + */ + atmosphereBrightnessShift: number; + /** + * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles. + Skirts are always hidden when the camera is underground or translucency is enabled. + */ + showSkirts: boolean; + /** + * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled. + */ + backFaceCulling: boolean; + /** + * Gets an ellipsoid describing the shape of this globe. + */ + ellipsoid: Ellipsoid; + /** + * Gets the collection of image layers that will be rendered on this globe. + */ + imageryLayers: ImageryLayerCollection; + /** + * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed. + */ + readonly imageryLayersUpdatedEvent: Event; + /** + * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty, + all terrain and imagery for the current view have been loaded. + */ + readonly tilesLoaded: boolean; + /** + * Gets or sets the color of the globe when no imagery is available. + */ + baseColor: Color; + /** + * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane. + */ + clippingPlanes: ClippingPlaneCollection; + /** + * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area. + Defaults to the maximum extent of cartographic coordinates. + */ + cartographicLimitRectangle: Rectangle; + /** + * The normal map to use for rendering waves in the ocean. Setting this property will + only have an effect if the configured terrain provider includes a water mask. + */ + oceanNormalMapUrl: string; + /** + * The terrain provider providing surface geometry for this globe. + */ + terrainProvider: TerrainProvider; + /** + * Gets an event that's raised when the terrain provider is changed + */ + readonly terrainProviderChanged: Event; + /** + * Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty, + all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue. + */ + tileLoadProgressEvent: Event; + /** + * Gets or sets the material appearance of the Globe. This can be one of several built-in {@link Material} objects or a custom material, scripted with + {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. + */ + material: Material; + /** + * The color to render the back side of the globe when the camera is underground or the globe is translucent, + blended with the globe color based on the camera's distance. + <br /><br /> + To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>. + */ + undergroundColor: Color; + /** + * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color. + The alpha will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the alpha remains clamped to the nearest bound. If undefined, + the underground color will not be blended with the globe color. + <br /> <br /> + When the camera is above the ellipsoid the distance is computed from the nearest + point on the ellipsoid instead of the camera's position. + */ + undergroundColorAlphaByDistance: NearFarScalar; + /** + * Properties for controlling globe translucency. + */ + translucency: GlobeTranslucency; + /** + * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates. + * @example + * // find intersection of ray through a pixel and the globe + var ray = viewer.camera.getPickRay(windowCoordinates); + var intersection = globe.pick(ray, scene); + * @param ray - The ray to test for intersection. + * @param scene - The scene. + * @param [result] - The object onto which to store the result. + * @returns The intersection or <code>undefined</code> if none was found. + */ + pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3 | undefined; + /** + * Get the height of the surface at a given cartographic. + * @param cartographic - The cartographic for which to find the height. + * @returns The height of the cartographic or undefined if it could not be found. + */ + getHeight(cartographic: Cartographic): number | undefined; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * globe = globe && globe.destroy(); + */ + destroy(): void; +} + +/** + * Properties for controlling globe translucency. + */ +export class GlobeTranslucency { + constructor(); + /** + * When true, the globe is rendered as a translucent surface. + <br /><br /> + The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers}, + and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by + {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and + {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces. + When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry + is considered front facing. + <br /><br /> + Translucency is disabled by default. + */ + enabled: boolean; + /** + * A constant translucency to apply to front faces of the globe. + <br /><br /> + {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. + * @example + * // Set front face translucency to 0.5. + globe.translucency.frontFaceAlpha = 0.5; + globe.translucency.enabled = true; + */ + frontFaceAlpha: number; + /** + * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera. + The translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, + frontFaceAlphaByDistance will be disabled. + <br /><br /> + {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. + * @example + * // Example 1. + // Set front face translucency to 0.5 when the + // camera is 1500 meters from the surface and 1.0 + // as the camera distance approaches 8.0e6 meters. + globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0); + globe.translucency.enabled = true; + * @example + * // Example 2. + // Disable front face translucency by distance + globe.translucency.frontFaceAlphaByDistance = undefined; + */ + frontFaceAlphaByDistance: NearFarScalar; + /** + * A constant translucency to apply to back faces of the globe. + <br /><br /> + {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. + * @example + * // Set back face translucency to 0.5. + globe.translucency.backFaceAlpha = 0.5; + globe.translucency.enabled = true; + */ + backFaceAlpha: number; + /** + * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera. + The translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the translucency remains clamped to the nearest bound. If undefined, + backFaceAlphaByDistance will be disabled. + <br /><br /> + {@link GlobeTranslucency#enabled} must be set to true for this option to take effect. + * @example + * // Example 1. + // Set back face translucency to 0.5 when the + // camera is 1500 meters from the surface and 1.0 + // as the camera distance approaches 8.0e6 meters. + globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0); + globe.translucency.enabled = true; + * @example + * // Example 2. + // Disable back face translucency by distance + globe.translucency.backFaceAlphaByDistance = undefined; + */ + backFaceAlphaByDistance: NearFarScalar; + /** + * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area. + Defaults to the maximum extent of cartographic coordinates. + */ + rectangle: Rectangle; +} + +export namespace GoogleEarthEnterpriseImageryProvider { + /** + * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor + * @property url - The url of the Google Earth Enterprise server hosting the imagery. + * @property metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider. + * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property [tileDiscardPolicy] - The policy that determines if a tile + is invalid and should be discarded. If this value is not specified, a default + is to discard tiles that fail to download. + * @property [credit] - A credit for the data source, which is displayed on the canvas. + */ + type ConstructorOptions = { + url: Resource | string + metadata: GoogleEarthEnterpriseMetadata + ellipsoid?: Ellipsoid + tileDiscardPolicy?: TileDiscardPolicy + credit?: Credit | string + }; +} + +/** + * Provides tiled imagery using the Google Earth Enterprise REST API. + +Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise, + {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API. + * @example + * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d'); +var gee = new Cesium.GoogleEarthEnterpriseImageryProvider({ + metadata : geeMetadata +}); + * @param options - Object describing initialization options + */ +export class GoogleEarthEnterpriseImageryProvider { + constructor(options: GoogleEarthEnterpriseImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the name of the Google Earth Enterprise server url hosting the imagery. + */ + readonly url: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage + and texture upload time. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Picking features is not currently supported by this imagery provider, so this function simply returns + undefined. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +export namespace GoogleEarthEnterpriseMapsProvider { + /** + * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor + * @property url - The url of the Google Earth server hosting the imagery. + * @property channel - The channel (id) to be used when requesting data from the server. + The channel number can be found by looking at the json file located at: + earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may + differ depending on your Google Earth Enterprise server configuration. Look for the "id" that + is associated with a "ImageryMaps" requestType. There may be more than one id available. + Example: + { + layers: [ + { + id: 1002, + requestType: "ImageryMaps" + }, + { + id: 1007, + requestType: "VectorMapsRaster" + } + ] + } + * @property [path = "/default_map"] - The path of the Google Earth server hosting the imagery. + * @property [maximumLevel] - The maximum level-of-detail supported by the Google Earth + Enterprise server, or undefined if there is no limit. + * @property [tileDiscardPolicy] - The policy that determines if a tile + is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass + a {@link NeverTileDiscardPolicy} for this parameter. + * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + */ + type ConstructorOptions = { + url: Resource | string + channel: number + path?: string + maximumLevel?: number + tileDiscardPolicy?: TileDiscardPolicy + ellipsoid?: Ellipsoid + }; +} + +/** + * Provides tiled imagery using the Google Earth Imagery API. + +Notes: This imagery provider does not work with the public Google Earth servers. It works with the + Google Earth Enterprise Server. + + By default the Google Earth Enterprise server does not set the + {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either + use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf + and add the 'Header set Access-Control-Allow-Origin "*"' option to the '<Directory />' and + '<Directory "/opt/google/gehttpd/htdocs">' directives. + + This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it + is necessary to use {@link GoogleEarthEnterpriseImageryProvider} + * @example + * var google = new Cesium.GoogleEarthEnterpriseMapsProvider({ + url : 'https://earth.localdomain', + channel : 1008 +}); + * @param options - Object describing initialization options + */ +export class GoogleEarthEnterpriseMapsProvider { + constructor(options: GoogleEarthEnterpriseMapsProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the URL of the Google Earth MapServer. + */ + readonly url: string; + /** + * Gets the url path of the data on the Google Earth server. + */ + readonly path: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the imagery channel (id) currently being used. + */ + readonly channel: number; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the version of the data used by this provider. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly version: number; + /** + * Gets the type of data that is being requested from the provider. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly requestType: string; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Picking features is not currently supported by this imagery provider, so this function simply returns + undefined. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; + /** + * Gets or sets the URL to the Google Earth logo for display in the credit. + */ + static logoUrl: string; +} + +export namespace GridImageryProvider { + /** + * Initialization options for the GridImageryProvider constructor + * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles. + * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. + * @property [cells = 8] - The number of grids cells. + * @property [color = Color(1.0, 1.0, 1.0, 0.4)] - The color to draw grid lines. + * @property [glowColor = Color(0.0, 1.0, 0.0, 0.05)] - The color to draw glow for grid lines. + * @property [glowWidth = 6] - The width of lines used for rendering the line glow effect. + * @property [backgroundColor = Color(0.0, 0.5, 0.0, 0.2)] - Background fill color. + * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes. + * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes. + * @property [canvasSize = 256] - The size of the canvas used for rendering. + */ + type ConstructorOptions = { + tilingScheme?: TilingScheme + ellipsoid?: Ellipsoid + cells?: number + color?: Color + glowColor?: Color + glowWidth?: number + backgroundColor?: Color + tileWidth?: number + tileHeight?: number + canvasSize?: number + }; +} + +/** + * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow. +May be useful for custom rendering effects or debugging terrain. + * @param options - Object describing initialization options + */ +export class GridImageryProvider { + constructor(options: GridImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link GridImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link GridImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link GridImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link GridImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link GridImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link GridImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link GridImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Draws a grid of lines into a canvas. + */ + _drawGrid(): void; + /** + * Render a grid into a canvas with background and glow + */ + _createGridCanvas(): void; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link GridImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Picking features is not currently supported by this imagery provider, so this function simply returns + undefined. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +/** + * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}. +<p> +Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}. +</p> + * @example + * // 1. Draw a polyline on terrain with a basic color material + +var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.GroundPolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -112.1340164450331, 36.05494287836128, + -112.08821010582645, 36.097804071380715 + ]), + width : 4.0 + }), + id : 'object returned when this instance is picked and to get/set per-instance attributes' +}); + +scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({ + geometryInstances : instance, + appearance : new Cesium.PolylineMaterialAppearance() +})); + +// 2. Draw a looped polyline on terrain with per-instance color and a distance display condition. +// Distance display conditions for polylines on terrain are based on an approximate terrain height +// instead of true terrain height. + +var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.GroundPolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -112.1340164450331, 36.05494287836128, + -112.08821010582645, 36.097804071380715, + -112.13296079730024, 36.168769146801104 + ]), + loop : true, + width : 4.0 + }), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)), + distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000) + }, + id : 'object returned when this instance is picked and to get/set per-instance attributes' +}); + +scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({ + geometryInstances : instance, + appearance : new Cesium.PolylineColorAppearance() +})); + * @param [options] - Object with the following properties: + * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry + * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}. + * @param [options.show = true] - Determines if this primitive will be shown. + * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time. + * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory. + * @param [options.allowPicking = true] - When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. + * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first. + * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on creation to have effect. + */ +export class GroundPolylinePrimitive { + constructor(options?: { + geometryInstances?: any[] | GeometryInstance + appearance?: Appearance + show?: boolean + interleave?: boolean + releaseGeometryInstances?: boolean + allowPicking?: boolean + asynchronous?: boolean + classificationType?: ClassificationType + debugShowBoundingVolume?: boolean + debugShowShadowVolume?: boolean + }); + /** + * The geometry instances rendered with this primitive. This may + be <code>undefined</code> if <code>options.releaseGeometryInstances</code> + is <code>true</code> when the primitive is constructed. + <p> + Changing this property after the primitive is rendered has no effect. + </p> + */ + readonly geometryInstances: any[] | GeometryInstance; + /** + * The {@link Appearance} used to shade this primitive. Each geometry + instance is shaded with the same appearance. Some appearances, like + {@link PolylineColorAppearance} allow giving each instance unique + properties. + */ + appearance: Appearance; + /** + * Determines if the primitive will be shown. This affects all geometry + instances in the primitive. + */ + show: boolean; + /** + * Determines whether terrain, 3D Tiles or both will be classified. + */ + classificationType: ClassificationType; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the primitive. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. + */ + readonly interleave: boolean; + /** + * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory. + */ + readonly releaseGeometryInstances: boolean; + /** + * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. + */ + readonly allowPicking: boolean; + /** + * Determines if the geometry instances will be created and batched on a web worker. + */ + readonly asynchronous: boolean; + /** + * Determines if the primitive is complete and ready to render. If this property is + true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update} + is called. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves when the primitive is ready to render. + */ + readonly readyPromise: Promise<GroundPolylinePrimitive>; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + If true, draws the shadow volume for each geometry in the primitive. + </p> + */ + readonly debugShowShadowVolume: boolean; + /** + * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the + GroundPolylinePrimitive synchronously. + * @returns A promise that will resolve once the terrain heights have been loaded. + */ + static initializeTerrainHeights(): Promise<void>; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. + * @example + * var attributes = primitive.getGeometryInstanceAttributes('an id'); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); + * @param id - The id of the {@link GeometryInstance}. + * @returns The typed array in the attribute's format or undefined if the is no instance with id. + */ + getGeometryInstanceAttributes(id: any): any; + /** + * Checks if the given Scene supports GroundPolylinePrimitives. + GroundPolylinePrimitives require support for the WEBGL_depth_texture extension. + * @param scene - The current scene. + * @returns Whether or not the current scene supports GroundPolylinePrimitives. + */ + static isSupported(scene: Scene): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + * @example + * e = e && e.destroy(); + */ + destroy(): void; +} + +/** + * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}. +<p> +A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including +{@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, +and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix +and match most of them and add a new geometry or appearance independently of each other. +</p> +<p> +Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors +or materials besides PerInstanceColorAppearance. +</p> +<p> +Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping +textures to terrain - for that use case, use {@link SingleTileImageryProvider}. +</p> +<p> +For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there +will be rendering artifacts for some viewing angles. +</p> +<p> +Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}. +</p> + * @example + * // Example 1: Create primitive with a single instance +var rectangleInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) + }), + id : 'rectangle', + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) + } +}); +scene.primitives.add(new Cesium.GroundPrimitive({ + geometryInstances : rectangleInstance +})); + +// Example 2: Batch instances +var color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color. +var rectangleInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0) + }), + id : 'rectangle', + attributes : { + color : color + } +}); +var ellipseInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.EllipseGeometry({ + center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0), + semiMinorAxis : 300000.0, + semiMajorAxis : 400000.0 + }), + id : 'ellipse', + attributes : { + color : color + } +}); +scene.primitives.add(new Cesium.GroundPrimitive({ + geometryInstances : [rectangleInstance, ellipseInstance] +})); + * @param [options] - Object with the following properties: + * @param [options.geometryInstances] - The geometry instances to render. + * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute. + * @param [options.show = true] - Determines if this primitive will be shown. + * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches. + * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time. + * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory. + * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory. + * @param [options.allowPicking = true] - When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. + * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first. + * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on + creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>. + */ +export class GroundPrimitive { + constructor(options?: { + geometryInstances?: any[] | GeometryInstance + appearance?: Appearance + show?: boolean + vertexCacheOptimize?: boolean + interleave?: boolean + compressVertices?: boolean + releaseGeometryInstances?: boolean + allowPicking?: boolean + asynchronous?: boolean + classificationType?: ClassificationType + debugShowBoundingVolume?: boolean + debugShowShadowVolume?: boolean + }); + /** + * The {@link Appearance} used to shade this primitive. Each geometry + instance is shaded with the same appearance. Some appearances, like + {@link PerInstanceColorAppearance} allow giving each instance unique + properties. + */ + appearance: Appearance; + /** + * The geometry instances rendered with this primitive. This may + be <code>undefined</code> if <code>options.releaseGeometryInstances</code> + is <code>true</code> when the primitive is constructed. + <p> + Changing this property after the primitive is rendered has no effect. + </p> + */ + readonly geometryInstances: any[] | GeometryInstance; + /** + * Determines if the primitive will be shown. This affects all geometry + instances in the primitive. + */ + show: boolean; + /** + * Determines whether terrain, 3D Tiles or both will be classified. + */ + classificationType: ClassificationType; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the primitive. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the shadow volume for each geometry in the primitive. + </p> + */ + debugShowShadowVolume: boolean; + /** + * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches. + */ + readonly vertexCacheOptimize: boolean; + /** + * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. + */ + readonly interleave: boolean; + /** + * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory. + */ + readonly releaseGeometryInstances: boolean; + /** + * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. + */ + readonly allowPicking: boolean; + /** + * Determines if the geometry instances will be created and batched on a web worker. + */ + readonly asynchronous: boolean; + /** + * When <code>true</code>, geometry vertices are compressed, which will save memory. + */ + readonly compressVertices: boolean; + /** + * Determines if the primitive is complete and ready to render. If this property is + true, the primitive will be rendered the next time that {@link GroundPrimitive#update} + is called. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves when the primitive is ready to render. + */ + readonly readyPromise: Promise<GroundPrimitive>; + /** + * Determines if GroundPrimitive rendering is supported. + * @param scene - The scene. + * @returns <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code> + */ + static isSupported(scene: Scene): boolean; + /** + * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the + GroundPrimitive synchronously. + * @returns A promise that will resolve once the terrain heights have been loaded. + */ + static initializeTerrainHeights(): Promise<void>; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. + * @example + * var attributes = primitive.getGeometryInstanceAttributes('an id'); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); + * @param id - The id of the {@link GeometryInstance}. + * @returns The typed array in the attribute's format or undefined if the is no instance with id. + */ + getGeometryInstanceAttributes(id: any): any; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + * @example + * e = e && e.destroy(); + */ + destroy(): void; + /** + * Checks if the given Scene supports materials on GroundPrimitives. + Materials on GroundPrimitives require support for the WEBGL_depth_texture extension. + * @param scene - The current scene. + * @returns Whether or not the current scene supports materials on GroundPrimitives. + */ + static supportsMaterials(scene: Scene): boolean; +} + +/** + * Represents the position relative to the terrain. + */ +export enum HeightReference { + /** + * The position is absolute. + */ + NONE = 0, + /** + * The position is clamped to the terrain. + */ + CLAMP_TO_GROUND = 1, + /** + * The position height is the height above the terrain. + */ + RELATIVE_TO_GROUND = 2 +} + +/** + * The horizontal location of an origin relative to an object, e.g., a {@link Billboard} +or {@link Label}. For example, setting the horizontal origin to <code>LEFT</code> +or <code>RIGHT</code> will display a billboard to the left or right (in screen space) +of the anchor position. +<br /><br /> +<div align='center'> +<img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br /> +</div> + */ +export enum HorizontalOrigin { + /** + * The origin is at the horizontal center of the object. + */ + CENTER = 0, + /** + * The origin is on the left side of the object. + */ + LEFT = 1, + /** + * The origin is on the right side of the object. + */ + RIGHT = -1 +} + +/** + * An imagery layer that displays tiled image data from a single imagery provider +on a {@link Globe}. + * @param imageryProvider - The imagery provider to use. + * @param [options] - Object with the following properties: + * @param [options.rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle + can limit the visible portion of the imagery provider. + * @param [options.alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0. + This can either be a simple number or a function with the signature + <code>function(frameState, layer, x, y, level)</code>. The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the alpha is required, and it is expected to return + the alpha value to use for the tile. + * @param [options.nightAlpha = 1.0] - The alpha blending value of this layer on the night side of the globe, from 0.0 to 1.0. + This can either be a simple number or a function with the signature + <code>function(frameState, layer, x, y, level)</code>. The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the alpha is required, and it is expected to return + the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>. + * @param [options.dayAlpha = 1.0] - The alpha blending value of this layer on the day side of the globe, from 0.0 to 1.0. + This can either be a simple number or a function with the signature + <code>function(frameState, layer, x, y, level)</code>. The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the alpha is required, and it is expected to return + the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>. + * @param [options.brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery + color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter. + This can either be a simple number or a function with the signature + <code>function(frameState, layer, x, y, level)</code>. The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the brightness is required, and it is expected to return + the brightness value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. + * @param [options.contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color. + Less than 1.0 reduces the contrast while greater than 1.0 increases it. + This can either be a simple number or a function with the signature + <code>function(frameState, layer, x, y, level)</code>. The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the contrast is required, and it is expected to return + the contrast value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. + * @param [options.hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color. + This can either be a simple number or a function with the signature + <code>function(frameState, layer, x, y, level)</code>. The function is passed the + current frame state, this layer, and the x, y, and level coordinates + of the imagery tile for which the hue is required, and it is expected to return + the contrast value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. + * @param [options.saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color. + Less than 1.0 reduces the saturation while greater than 1.0 increases it. + This can either be a simple number or a function with the signature + <code>function(frameState, layer, x, y, level)</code>. The function is passed the + current frame state, this layer, and the x, y, and level coordinates + of the imagery tile for which the saturation is required, and it is expected to return + the contrast value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. + * @param [options.gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color. + This can either be a simple number or a function with the signature + <code>function(frameState, layer, x, y, level)</code>. The function is passed the + current frame state, this layer, and the x, y, and level coordinates of the + imagery tile for which the gamma is required, and it is expected to return + the gamma value to use for the tile. The function is executed for every + frame and for every tile, so it must be fast. + * @param [options.splitDirection = ImagerySplitDirection.NONE] - The {@link ImagerySplitDirection} split to apply to this layer. + * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The + texture minification filter to apply to this layer. Possible values + are <code>TextureMinificationFilter.LINEAR</code> and + <code>TextureMinificationFilter.NEAREST</code>. + * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The + texture minification filter to apply to this layer. Possible values + are <code>TextureMagnificationFilter.LINEAR</code> and + <code>TextureMagnificationFilter.NEAREST</code>. + * @param [options.show = true] - True if the layer is shown; otherwise, false. + * @param [options.maximumAnisotropy = maximum supported] - The maximum anisotropy level to use + for texture filtering. If this parameter is not specified, the maximum anisotropy supported + by the WebGL stack will be used. Larger values make the imagery look better in horizon + views. + * @param [options.minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer, + or undefined to show it at all levels. Level zero is the least-detailed level. + * @param [options.maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer, + or undefined to show it at all levels. Level zero is the least-detailed level. + * @param [options.cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer. + * @param [options.colorToAlpha] - Color to be used as alpha. + * @param [options.colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha. + */ +export class ImageryLayer { + constructor(imageryProvider: ImageryProvider, options?: { + rectangle?: Rectangle + alpha?: number | ((...params: any[]) => any) + nightAlpha?: number | ((...params: any[]) => any) + dayAlpha?: number | ((...params: any[]) => any) + brightness?: number | ((...params: any[]) => any) + contrast?: number | ((...params: any[]) => any) + hue?: number | ((...params: any[]) => any) + saturation?: number | ((...params: any[]) => any) + gamma?: number | ((...params: any[]) => any) + splitDirection?: ImagerySplitDirection | ((...params: any[]) => any) + minificationFilter?: TextureMinificationFilter + magnificationFilter?: TextureMagnificationFilter + show?: boolean + maximumAnisotropy?: number + minimumTerrainLevel?: number + maximumTerrainLevel?: number + cutoutRectangle?: Rectangle + colorToAlpha?: Color + colorToAlphaThreshold?: number + }); + /** + * The alpha blending value of this layer, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + alpha: number; + /** + * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and + 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>. + */ + nightAlpha: number; + /** + * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and + 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>. + */ + dayAlpha: number; + /** + * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + brightness: number; + /** + * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + contrast: number; + /** + * The hue of this layer in radians. 0.0 uses the unmodified imagery color. + */ + hue: number; + /** + * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + saturation: number; + /** + * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color. + */ + gamma: number; + /** + * The {@link ImagerySplitDirection} to apply to this layer. + */ + splitDirection: ImagerySplitDirection; + /** + * The {@link TextureMinificationFilter} to apply to this layer. + Possible values are {@link TextureMinificationFilter.LINEAR} (the default) + and {@link TextureMinificationFilter.NEAREST}. + + To take effect, this property must be set immediately after adding the imagery layer. + Once a texture is loaded it won't be possible to change the texture filter used. + */ + minificationFilter: TextureMinificationFilter; + /** + * The {@link TextureMagnificationFilter} to apply to this layer. + Possible values are {@link TextureMagnificationFilter.LINEAR} (the default) + and {@link TextureMagnificationFilter.NEAREST}. + + To take effect, this property must be set immediately after adding the imagery layer. + Once a texture is loaded it won't be possible to change the texture filter used. + */ + magnificationFilter: TextureMagnificationFilter; + /** + * Determines if this layer is shown. + */ + show: boolean; + /** + * Rectangle cutout in this layer of imagery. + */ + cutoutRectangle: Rectangle; + /** + * Color value that should be set to transparent. + */ + colorToAlpha: Color; + /** + * Normalized (0-1) threshold for color-to-alpha. + */ + colorToAlphaThreshold: number; + /** + * Gets the imagery provider for this layer. + */ + readonly imageryProvider: ImageryProvider; + /** + * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the + {@link ImageryProvider}, only a portion of the imagery provider is shown. + */ + readonly rectangle: Rectangle; + /** + * This value is used as the default brightness for the imagery layer if one is not provided during construction + or by the imagery provider. This value does not modify the brightness of the imagery. + */ + static DEFAULT_BRIGHTNESS: number; + /** + * This value is used as the default contrast for the imagery layer if one is not provided during construction + or by the imagery provider. This value does not modify the contrast of the imagery. + */ + static DEFAULT_CONTRAST: number; + /** + * This value is used as the default hue for the imagery layer if one is not provided during construction + or by the imagery provider. This value does not modify the hue of the imagery. + */ + static DEFAULT_HUE: number; + /** + * This value is used as the default saturation for the imagery layer if one is not provided during construction + or by the imagery provider. This value does not modify the saturation of the imagery. + */ + static DEFAULT_SATURATION: number; + /** + * This value is used as the default gamma for the imagery layer if one is not provided during construction + or by the imagery provider. This value does not modify the gamma of the imagery. + */ + static DEFAULT_GAMMA: number; + /** + * This value is used as the default split for the imagery layer if one is not provided during construction + or by the imagery provider. + */ + static DEFAULT_SPLIT: ImagerySplitDirection; + /** + * This value is used as the default texture minification filter for the imagery layer if one is not provided + during construction or by the imagery provider. + */ + static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter; + /** + * This value is used as the default texture magnification filter for the imagery layer if one is not provided + during construction or by the imagery provider. + */ + static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter; + /** + * This value is used as the default threshold for color-to-alpha if one is not provided + during construction or by the imagery provider. + */ + static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number; + /** + * Gets a value indicating whether this layer is the base layer in the + {@link ImageryLayerCollection}. The base layer is the one that underlies all + others. It is special in that it is treated as if it has global rectangle, even if + it actually does not, by stretching the texels at the edges over the entire + globe. + * @returns true if this is the base layer; otherwise, false. + */ + isBaseLayer(): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * imageryLayer = imageryLayer && imageryLayer.destroy(); + */ + destroy(): void; + /** + * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle, + producing the overall bounds of imagery that can be produced by this layer. + * @example + * // Zoom to an imagery layer. + imageryLayer.getViewableRectangle().then(function (rectangle) { + return camera.flyTo({ + destination: rectangle + }); + }); + * @returns A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer. + */ + getViewableRectangle(): Promise<Rectangle>; +} + +/** + * An ordered collection of imagery layers. + */ +export class ImageryLayerCollection { + constructor(); + /** + * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that + was added and the index at which it was added. + */ + layerAdded: Event; + /** + * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that + was removed and the index from which it was removed. + */ + layerRemoved: Event; + /** + * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that + was moved, its new index after the move, and its old index prior to the move. + */ + layerMoved: Event; + /** + * An event that is raised when a layer is shown or hidden by setting the + {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer, + the index of the layer in the collection, and a flag that is true if the layer is now + shown or false if it is now hidden. + */ + layerShownOrHidden: Event; + /** + * Gets the number of layers in this collection. + */ + length: number; + /** + * Adds a layer to the collection. + * @param layer - the layer to add. + * @param [index] - the index to add the layer at. If omitted, the layer will + be added on top of all existing layers. + */ + add(layer: ImageryLayer, index?: number): void; + /** + * Creates a new layer using the given ImageryProvider and adds it to the collection. + * @param imageryProvider - the imagery provider to create a new layer for. + * @param [index] - the index to add the layer at. If omitted, the layer will + added on top of all existing layers. + * @returns The newly created layer. + */ + addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer; + /** + * Removes a layer from this collection, if present. + * @param layer - The layer to remove. + * @param [destroy = true] - whether to destroy the layers in addition to removing them. + * @returns true if the layer was in the collection and was removed, + false if the layer was not in the collection. + */ + remove(layer: ImageryLayer, destroy?: boolean): boolean; + /** + * Removes all layers from this collection. + * @param [destroy = true] - whether to destroy the layers in addition to removing them. + */ + removeAll(destroy?: boolean): void; + /** + * Checks to see if the collection contains a given layer. + * @param layer - the layer to check for. + * @returns true if the collection contains the layer, false otherwise. + */ + contains(layer: ImageryLayer): boolean; + /** + * Determines the index of a given layer in the collection. + * @param layer - The layer to find the index of. + * @returns The index of the layer in the collection, or -1 if the layer does not exist in the collection. + */ + indexOf(layer: ImageryLayer): number; + /** + * Gets a layer by index from the collection. + * @param index - the index to retrieve. + * @returns The imagery layer at the given index. + */ + get(index: number): ImageryLayer; + /** + * Raises a layer up one position in the collection. + * @param layer - the layer to move. + */ + raise(layer: ImageryLayer): void; + /** + * Lowers a layer down one position in the collection. + * @param layer - the layer to move. + */ + lower(layer: ImageryLayer): void; + /** + * Raises a layer to the top of the collection. + * @param layer - the layer to move. + */ + raiseToTop(layer: ImageryLayer): void; + /** + * Lowers a layer to the bottom of the collection. + * @param layer - the layer to move. + */ + lowerToBottom(layer: ImageryLayer): void; + /** + * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery + layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected + by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}. + * @example + * var pickRay = viewer.camera.getPickRay(windowPosition); + var featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene); + if (!Cesium.defined(featuresPromise)) { + console.log('No features picked.'); + } else { + Cesium.when(featuresPromise, function(features) { + // This function is called asynchronously when the list if picked features is available. + console.log('Number of features: ' + features.length); + if (features.length > 0) { + console.log('First feature name: ' + features[0].name); + } + }); + } + * @param ray - The ray to test for intersection. + * @param scene - The scene. + * @returns A promise that resolves to an array of features intersected by the pick ray. + If it can be quickly determined that no features are intersected (for example, + because no active imagery providers support {@link ImageryProvider#pickFeatures} + or because the pick ray does not intersect the surface), this function will + return undefined. + */ + pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise<ImageryLayerFeatureInfo[]> | undefined; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns true if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this + object allows for deterministic release of WebGL resources, instead of relying on the garbage + collector. + <br /><br /> + Once this object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * layerCollection = layerCollection && layerCollection.destroy(); + */ + destroy(): void; +} + +/** + * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer. + */ +export class ImageryLayerFeatureInfo { + constructor(); + /** + * Gets or sets the name of the feature. + */ + name: string | undefined; + /** + * Gets or sets an HTML description of the feature. The HTML is not trusted and should + be sanitized before display to the user. + */ + description: string | undefined; + /** + * Gets or sets the position of the feature, or undefined if the position is not known. + */ + position: Cartographic | undefined; + /** + * Gets or sets the raw data describing the feature. The raw data may be in any + number of formats, such as GeoJSON, KML, etc. + */ + data: any | undefined; + /** + * Gets or sets the image layer of the feature. + */ + imageryLayer: any | undefined; + /** + * Configures the name of this feature by selecting an appropriate property. The name will be obtained from + one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title', + 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If + the name cannot be obtained from any of these sources, the existing name will be left unchanged. + * @param properties - An object literal containing the properties of the feature. + */ + configureNameFromProperties(properties: any): void; + /** + * Configures the description of this feature by creating an HTML table of properties and their values. + * @param properties - An object literal containing the properties of the feature. + */ + configureDescriptionFromProperties(properties: any): void; +} + +/** + * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an +interface and is not intended to be instantiated directly. + */ +export class ImageryProvider { + constructor(); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the rectangle, in radians, of the imagery provided by the instance. This function should + not be called before {@link ImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link ImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link ImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link ImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link ImageryProvider#ready} returns true. Generally, + a minimum level should only be used when the rectangle of the imagery is small + enough that the number of tiles at the minimum level is small. An imagery + provider with more than a few tiles at the minimum level will lead to + rendering problems. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by the provider. This function should + not be called before {@link ImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link ImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should + not be called before {@link ImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link ImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Asynchronously determines what features, if any, are located at a given longitude and latitude within + a tile. This function should not be called before {@link ImageryProvider#ready} returns true. + This function is optional, so it may not exist on all ImageryProviders. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; + /** + * Loads an image from a given URL. If the server referenced by the URL already has + too many requests pending, this function will instead return undefined, indicating + that the request should be retried later. + * @param imageryProvider - The imagery provider for the URL. + * @param url - The URL of the image. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + static loadImage(imageryProvider: ImageryProvider, url: Resource | string): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; +} + +/** + * The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}. + */ +export enum ImagerySplitDirection { + /** + * Display the ImageryLayer to the left of the {@link Scene#imagerySplitPosition}. + */ + LEFT = -1, + /** + * Always display the ImageryLayer. + */ + NONE = 0, + /** + * Display the ImageryLayer to the right of the {@link Scene#imagerySplitPosition}. + */ + RIGHT = 1 +} + +export namespace IonImageryProvider { + /** + * Initialization options for the TileMapServiceImageryProvider constructor + * @property assetId - An ion imagery asset ID + * @property [accessToken = Ion.defaultAccessToken] - The access token to use. + * @property [server = Ion.defaultServer] - The resource to the Cesium ion API server. + */ + type ConstructorOptions = { + assetId: number + accessToken?: string + server?: string | Resource + }; +} + +/** + * Provides tiled imagery using the Cesium ion REST API. + * @example + * viewer.imageryLayers.addImageryProvider(new Cesium.IonImageryProvider({ assetId : 23489024 })); + * @param options - Object describing initialization options + */ +export class IonImageryProvider { + constructor(options: IonImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the rectangle, in radians, of the imagery provided by the instance. This function should + not be called before {@link IonImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link IonImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link IonImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link IonImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link IonImageryProvider#ready} returns true. Generally, + a minimum level should only be used when the rectangle of the imagery is small + enough that the number of tiles at the minimum level is small. An imagery + provider with more than a few tiles at the minimum level will lead to + rendering problems. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by the provider. This function should + not be called before {@link IonImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link IonImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should + not be called before {@link IonImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link IonImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Asynchronously determines what features, if any, are located at a given longitude and latitude within + a tile. This function should not be called before {@link IonImageryProvider#ready} returns true. + This function is optional, so it may not exist on all ImageryProviders. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +/** + * The types of imagery provided by {@link createWorldImagery}. + */ +export enum IonWorldImageryStyle { + /** + * Aerial imagery. + */ + AERIAL = 2, + /** + * Aerial imagery with a road overlay. + */ + AERIAL_WITH_LABELS = 3, + /** + * Roads without additional imagery. + */ + ROAD = 4 +} + +/** + * A Label draws viewport-aligned text positioned in the 3D scene. This constructor +should not be used directly, instead create labels by calling {@link LabelCollection#add}. + */ +export class Label { + constructor(); + /** + * Determines if this label will be shown. Use this to hide or show a label, instead + of removing it and re-adding it to the collection. + */ + show: boolean; + /** + * Gets or sets the Cartesian position of this label. + */ + position: Cartesian3; + /** + * Gets or sets the height reference of this billboard. + */ + heightReference: HeightReference; + /** + * Gets or sets the text of this label. + */ + text: string; + /** + * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property. + */ + font: string; + /** + * Gets or sets the fill color of this label. + */ + fillColor: Color; + /** + * Gets or sets the outline color of this label. + */ + outlineColor: Color; + /** + * Gets or sets the outline width of this label. + */ + outlineWidth: number; + /** + * Determines if a background behind this label will be shown. + */ + showBackground: boolean; + /** + * Gets or sets the background color of this label. + */ + backgroundColor: Color; + /** + * Gets or sets the background padding, in pixels, of this label. The <code>x</code> value + controls horizontal padding, and the <code>y</code> value controls vertical padding. + */ + backgroundPadding: Cartesian2; + /** + * Gets or sets the style of this label. + */ + style: LabelStyle; + /** + * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used + to align multiple labels and billboards at the same position, e.g., an image and text. The + screen space origin is the top, left corner of the canvas; <code>x</code> increases from + left to right, and <code>y</code> increases from top to bottom. + <br /><br /> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td> + <td align='center'><code>l.pixeloffset = new Cartesian2(25, 75);</code><br/><img src='Images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td> + </tr></table> + The label's origin is indicated by the yellow point. + </div> + */ + pixelOffset: Cartesian2; + /** + * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera. + A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined, + translucencyByDistance will be disabled. + * @example + * // Example 1. + // Set a label's translucencyByDistance to 1.0 when the + // camera is 1500 meters from the label and disappear as + // the camera distance approaches 8.0e6 meters. + text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); + * @example + * // Example 2. + // disable translucency by distance + text.translucencyByDistance = undefined; + */ + translucencyByDistance: NearFarScalar; + /** + * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera. + A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined, + pixelOffsetScaleByDistance will be disabled. + * @example + * // Example 1. + // Set a label's pixel offset scale to 0.0 when the + // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels + // in the y direction the camera distance approaches 8.0e6 meters. + text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0); + text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0); + * @example + * // Example 2. + // disable pixel offset by distance + text.pixelOffsetScaleByDistance = undefined; + */ + pixelOffsetScaleByDistance: NearFarScalar; + /** + * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera. + A label's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined, + scaleByDistance will be disabled. + * @example + * // Example 1. + // Set a label's scaleByDistance to scale by 1.5 when the + // camera is 1500 meters from the label and disappear as + // the camera distance approaches 8.0e6 meters. + label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0); + * @example + * // Example 2. + // disable scaling by distance + label.scaleByDistance = undefined; + */ + scaleByDistance: NearFarScalar; + /** + * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed + coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and + <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates, + which is typically meters. + <br /><br /> + An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to + arrange a label above its corresponding 3D model. + <br /><br /> + Below, the label is positioned at the center of the Earth but an eye offset makes it always + appear on top of the Earth regardless of the viewer's or Earth's orientation. + <br /><br /> + <div align='center'> + <table border='0' cellpadding='5'><tr> + <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td> + <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td> + </tr></table> + <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br /> + </div> + */ + eyeOffset: Cartesian3; + /** + * Gets or sets the horizontal origin of this label, which determines if the label is drawn + to the left, center, or right of its anchor position. + <br /><br /> + <div align='center'> + <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br /> + </div> + * @example + * // Use a top, right origin + l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT; + l.verticalOrigin = Cesium.VerticalOrigin.TOP; + */ + horizontalOrigin: HorizontalOrigin; + /** + * Gets or sets the vertical origin of this label, which determines if the label is + to the above, below, or at the center of its anchor position. + <br /><br /> + <div align='center'> + <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br /> + </div> + * @example + * // Use a top, right origin + l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT; + l.verticalOrigin = Cesium.VerticalOrigin.TOP; + */ + verticalOrigin: VerticalOrigin; + /** + * Gets or sets the uniform scale that is multiplied with the label's size in pixels. + A scale of <code>1.0</code> does not change the size of the label; a scale greater than + <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks + the label. + <br /><br /> + Applying a large scale value may pixelate the label. To make text larger without pixelation, + use a larger font size when calling {@link Label#font} instead. + <br /><br /> + <div align='center'> + <img src='Images/Label.setScale.png' width='400' height='300' /><br/> + From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, + and <code>2.0</code>. + </div> + */ + scale: number; + /** + * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size + of the desired font compared to the generated glyph size. + */ + totalScale: number; + /** + * Gets or sets the condition specifying at what distance from the camera that this label will be displayed. + */ + distanceDisplayCondition: DistanceDisplayCondition; + /** + * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + */ + disableDepthTestDistance: number; + /** + * Gets or sets the user-defined value returned when the label is picked. + */ + id: any; + /** + * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets. + The screen space origin is the top, left corner of the canvas; <code>x</code> increases from + left to right, and <code>y</code> increases from top to bottom. + * @example + * console.log(l.computeScreenSpacePosition(scene).toString()); + * @param scene - The scene the label is in. + * @param [result] - The object onto which to store the result. + * @returns The screen-space position of the label. + */ + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + /** + * Determines if this label equals another label. Labels are equal if all their properties + are equal. Labels in different collections can be equal. + * @param other - The label to compare for equality. + * @returns <code>true</code> if the labels are equal; otherwise, <code>false</code>. + */ + equals(other: Label): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages + * @example + * // Example 1. + // Set a label's rightToLeft before init + Cesium.Label.enableRightToLeftDetection = true; + var myLabelEntity = viewer.entities.add({ + label: { + id: 'my label', + text: 'זה טקסט בעברית \n ועכשיו יורדים שורה', + } + }); + * @example + * // Example 2. + var myLabelEntity = viewer.entities.add({ + label: { + id: 'my label', + text: 'English text' + } + }); + // Set a label's rightToLeft after init + Cesium.Label.enableRightToLeftDetection = true; + myLabelEntity.text = 'טקסט חדש'; + */ + static enableRightToLeftDetection: boolean; +} + +/** + * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene. +Each label can have a different font, color, scale, etc. +<br /><br /> +<div align='center'> +<img src='Images/Label.png' width='400' height='300' /><br /> +Example labels +</div> +<br /><br /> +Labels are added and removed from the collection using {@link LabelCollection#add} +and {@link LabelCollection#remove}. + * @example + * // Create a label collection with two labels +var labels = scene.primitives.add(new Cesium.LabelCollection()); +labels.add({ + position : new Cesium.Cartesian3(1.0, 2.0, 3.0), + text : 'A label' +}); +labels.add({ + position : new Cesium.Cartesian3(4.0, 5.0, 6.0), + text : 'Another label' +}); + * @param [options] - Object with the following properties: + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe. + * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default +is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent, +setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. + * @param [options.show = true] - Determines if the labels in the collection will be shown. + */ +export class LabelCollection { + constructor(options?: { + modelMatrix?: Matrix4 + debugShowBoundingVolume?: boolean + scene?: Scene + blendOption?: BlendOption + show?: boolean + }); + /** + * Determines if labels in this collection will be shown. + */ + show: boolean; + /** + * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates. + When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. + * @example + * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); + labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); + labels.add({ + position : new Cesium.Cartesian3(0.0, 0.0, 0.0), + text : 'Center' + }); + labels.add({ + position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0), + text : 'East' + }); + labels.add({ + position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0), + text : 'North' + }); + labels.add({ + position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0), + text : 'Up' + }); + */ + modelMatrix: Matrix4; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the primitive. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * The label blending option. The default is used for rendering both opaque and translucent labels. + However, if either all of the labels are completely opaque or all are completely translucent, + setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve + performance by up to 2x. + */ + blendOption: BlendOption; + /** + * Returns the number of labels in this collection. This is commonly used with + {@link LabelCollection#get} to iterate over all the labels + in the collection. + */ + length: number; + /** + * Creates and adds a label with the specified initial properties to the collection. + The added label is returned so it can be modified or removed from the collection later. + * @example + * // Example 1: Add a label, specifying all the default values. + var l = labels.add({ + show : true, + position : Cesium.Cartesian3.ZERO, + text : '', + font : '30px sans-serif', + fillColor : Cesium.Color.WHITE, + outlineColor : Cesium.Color.BLACK, + outlineWidth : 1.0, + showBackground : false, + backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8), + backgroundPadding : new Cesium.Cartesian2(7, 5), + style : Cesium.LabelStyle.FILL, + pixelOffset : Cesium.Cartesian2.ZERO, + eyeOffset : Cesium.Cartesian3.ZERO, + horizontalOrigin : Cesium.HorizontalOrigin.LEFT, + verticalOrigin : Cesium.VerticalOrigin.BASELINE, + scale : 1.0, + translucencyByDistance : undefined, + pixelOffsetScaleByDistance : undefined, + heightReference : HeightReference.NONE, + distanceDisplayCondition : undefined + }); + * @example + * // Example 2: Specify only the label's cartographic position, + // text, and font. + var l = labels.add({ + position : Cesium.Cartesian3.fromRadians(longitude, latitude, height), + text : 'Hello World', + font : '24px Helvetica', + }); + * @param [options] - A template describing the label's properties as shown in Example 1. + * @returns The label that was added to the collection. + */ + add(options?: any): Label; + /** + * Removes a label from the collection. Once removed, a label is no longer usable. + * @example + * var l = labels.add(...); + labels.remove(l); // Returns true + * @param label - The label to remove. + * @returns <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection. + */ + remove(label: Label): boolean; + /** + * Removes all labels from the collection. + * @example + * labels.add(...); + labels.add(...); + labels.removeAll(); + */ + removeAll(): void; + /** + * Check whether this collection contains a given label. + * @param label - The label to check for. + * @returns true if this collection contains the label, false otherwise. + */ + contains(label: Label): boolean; + /** + * Returns the label in the collection at the specified index. Indices are zero-based + and increase as labels are added. Removing a label shifts all labels after + it to the left, changing their indices. This function is commonly used with + {@link LabelCollection#length} to iterate over all the labels + in the collection. + * @example + * // Toggle the show property of every label in the collection + var len = labels.length; + for (var i = 0; i < len; ++i) { + var l = billboards.get(i); + l.show = !l.show; + } + * @param index - The zero-based index of the billboard. + * @returns The label at the specified index. + */ + get(index: number): Label; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * labels = labels && labels.destroy(); + */ + destroy(): void; +} + +/** + * Describes how to draw a label. + */ +export enum LabelStyle { + /** + * Fill the text of the label, but do not outline. + */ + FILL = 0, + /** + * Outline the text of the label, but do not fill. + */ + OUTLINE = 1, + /** + * Fill and outline the text of the label. + */ + FILL_AND_OUTLINE = 2 +} + +/** + * A light source. This type describes an interface and is not intended to be instantiated directly. + */ +export class Light { + constructor(); + /** + * The color of the light. + */ + color: Color; + /** + * The intensity of the light. + */ + intensity: number; +} + +export namespace MapboxImageryProvider { + /** + * Initialization options for the MapboxImageryProvider constructor + * @property [url = 'https://api.mapbox.com/v4/'] - The Mapbox server url. + * @property mapId - The Mapbox Map ID. + * @property accessToken - The public access token for the imagery. + * @property [format = 'png'] - The format of the image request. + * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying + this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely + to result in rendering problems. + * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. + * @property [credit] - A credit for the data source, which is displayed on the canvas. + */ + type ConstructorOptions = { + url?: string + mapId: string + accessToken: string + format?: string + ellipsoid?: Ellipsoid + minimumLevel?: number + maximumLevel?: number + rectangle?: Rectangle + credit?: Credit | string + }; +} + +/** + * Provides tiled imagery hosted by Mapbox. + * @example + * // Mapbox tile provider +var mapbox = new Cesium.MapboxImageryProvider({ + mapId: 'mapbox.streets', + accessToken: 'thisIsMyAccessToken' +}); + * @param options - Object describing initialization options + */ +export class MapboxImageryProvider { + constructor(options: MapboxImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the URL of the Mapbox server. + */ + readonly url: string; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the rectangle, in radians, of the imagery provided by the instance. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. Generally, + a minimum level should only be used when the rectangle of the imagery is small + enough that the number of tiles at the minimum level is small. An imagery + provider with more than a few tiles at the minimum level will lead to + rendering problems. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by the provider. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link MapboxImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Asynchronously determines what features, if any, are located at a given longitude and latitude within + a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true. + This function is optional, so it may not exist on all ImageryProviders. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +export namespace MapboxStyleImageryProvider { + /** + * Initialization options for the MapboxStyleImageryProvider constructor + * @property [url = 'https://api.mapbox.com/styles/v1/'] - The Mapbox server url. + * @property [username = 'mapbox'] - The username of the map account. + * @property styleId - The Mapbox Style ID. + * @property accessToken - The public access token for the imagery. + * @property [tilesize = 512] - The size of the image tiles. + * @property [scaleFactor] - Determines if tiles are rendered at a @2x scale factor. + * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying + this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely + to result in rendering problems. + * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. + * @property [credit] - A credit for the data source, which is displayed on the canvas. + */ + type ConstructorOptions = { + url?: Resource | string + username?: string + styleId: string + accessToken: string + tilesize?: number + scaleFactor?: boolean + ellipsoid?: Ellipsoid + minimumLevel?: number + maximumLevel?: number + rectangle?: Rectangle + credit?: Credit | string + }; +} + +/** + * Provides tiled imagery hosted by Mapbox. + * @example + * // Mapbox style provider +var mapbox = new Cesium.MapboxStyleImageryProvider({ + styleId: 'streets-v11', + accessToken: 'thisIsMyAccessToken' +}); + * @param options - Object describing initialization options + */ +export class MapboxStyleImageryProvider { + constructor(options: MapboxStyleImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the URL of the Mapbox server. + */ + readonly url: string; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the rectangle, in radians, of the imagery provided by the instance. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally, + a minimum level should only be used when the rectangle of the imagery is small + enough that the number of tiles at the minimum level is small. An imagery + provider with more than a few tiles at the minimum level will lead to + rendering problems. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by the provider. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link MapboxStyleImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Asynchronously determines what features, if any, are located at a given longitude and latitude within + a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true. + This function is optional, so it may not exist on all ImageryProviders. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +/** + * Describes how the map will operate in 2D. + */ +export enum MapMode2D { + /** + * The 2D map can be rotated about the z axis. + */ + ROTATE = 0, + /** + * The 2D map can be scrolled infinitely in the horizontal direction. + */ + INFINITE_SCROLL = 1 +} + +/** + * A Material defines surface appearance through a combination of diffuse, specular, +normal, emission, and alpha components. These values are specified using a +JSON schema called Fabric which gets parsed and assembled into glsl shader code +behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page} +for more details on Fabric. +<br /><br /> +<style type="text/css"> + #materialDescriptions code { + font-weight: normal; + font-family: Consolas, 'Lucida Console', Monaco, monospace; + color: #A35A00; + } + #materialDescriptions ul, #materialDescriptions ul ul { + list-style-type: none; + } + #materialDescriptions ul ul { + margin-bottom: 10px; + } + #materialDescriptions ul ul li { + font-weight: normal; + color: #000000; + text-indent: -2em; + margin-left: 2em; + } + #materialDescriptions ul li { + font-weight: bold; + color: #0053CF; + } +</style> + +Base material types and their uniforms: +<div id='materialDescriptions'> +<ul> + <li>Color</li> + <ul> + <li><code>color</code>: rgba color object.</li> + </ul> + <li>Image</li> + <ul> + <li><code>image</code>: path to image.</li> + <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> + </ul> + <li>DiffuseMap</li> + <ul> + <li><code>image</code>: path to image.</li> + <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li> + <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> + </ul> + <li>AlphaMap</li> + <ul> + <li><code>image</code>: path to image.</li> + <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li> + <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> + </ul> + <li>SpecularMap</li> + <ul> + <li><code>image</code>: path to image.</li> + <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li> + <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> + </ul> + <li>EmissionMap</li> + <ul> + <li><code>image</code>: path to image.</li> + <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li> + <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> + </ul> + <li>BumpMap</li> + <ul> + <li><code>image</code>: path to image.</li> + <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li> + <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> + <li><code>strength</code>: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li> + </ul> + <li>NormalMap</li> + <ul> + <li><code>image</code>: path to image.</li> + <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li> + <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> + <li><code>strength</code>: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li> + </ul> + <li>Grid</li> + <ul> + <li><code>color</code>: rgba color object for the whole material.</li> + <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li> + <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li> + <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li> + <li><code>lineOffset</code>: Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li> + </ul> + <li>Stripe</li> + <ul> + <li><code>horizontal</code>: Boolean that determines if the stripes are horizontal or vertical.</li> + <li><code>evenColor</code>: rgba color object for the stripe's first color.</li> + <li><code>oddColor</code>: rgba color object for the stripe's second color.</li> + <li><code>offset</code>: Number that controls at which point into the pattern to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning of the odd color, 2.0 being the even color again, and any multiple or fractional values being in between.</li> + <li><code>repeat</code>: Number that controls the total number of stripes, half light and half dark.</li> + </ul> + <li>Checkerboard</li> + <ul> + <li><code>lightColor</code>: rgba color object for the checkerboard's light alternating color.</li> + <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li> + <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows respectively.</li> + </ul> + <li>Dot</li> + <ul> + <li><code>lightColor</code>: rgba color object for the dot color.</li> + <li><code>darkColor</code>: rgba color object for the background color.</li> + <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows of dots respectively.</li> + </ul> + <li>Water</li> + <ul> + <li><code>baseWaterColor</code>: rgba color object base color of the water.</li> + <li><code>blendColor</code>: rgba color object used when blending from water to non-water areas.</li> + <li><code>specularMap</code>: Single channel texture used to indicate areas of water.</li> + <li><code>normalMap</code>: Normal map for water normal perturbation.</li> + <li><code>frequency</code>: Number that controls the number of waves.</li> + <li><code>normalMap</code>: Normal map for water normal perturbation.</li> + <li><code>animationSpeed</code>: Number that controls the animations speed of the water.</li> + <li><code>amplitude</code>: Number that controls the amplitude of water waves.</li> + <li><code>specularIntensity</code>: Number that controls the intensity of specular reflections.</li> + </ul> + <li>RimLighting</li> + <ul> + <li><code>color</code>: diffuse color and alpha.</li> + <li><code>rimColor</code>: diffuse color and alpha of the rim.</li> + <li><code>width</code>: Number that determines the rim's width.</li> + </ul> + <li>Fade</li> + <ul> + <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li> + <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li> + <li><code>maximumDistance</code>: Number between 0.0 and 1.0 where the <code>fadeInColor</code> becomes the <code>fadeOutColor</code>. A value of 0.0 gives the entire material a color of <code>fadeOutColor</code> and a value of 1.0 gives the the entire material a color of <code>fadeInColor</code></li> + <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li> + <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li> + <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li> + </ul> + <li>PolylineArrow</li> + <ul> + <li><code>color</code>: diffuse color and alpha.</li> + </ul> + <li>PolylineDash</li> + <ul> + <li><code>color</code>: color for the line.</li> + <li><code>gapColor</code>: color for the gaps in the line.</li> + <li><code>dashLength</code>: Dash length in pixels.</li> + <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li> + </ul> + <li>PolylineGlow</li> + <ul> + <li><code>color</code>: color and maximum alpha for the glow on the line.</li> + <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li> + <li><code>taperPower</code>: strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.</li> + </ul> + <li>PolylineOutline</li> + <ul> + <li><code>color</code>: diffuse color and alpha for the interior of the line.</li> + <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li> + <li><code>outlineWidth</code>: width of the outline in pixels.</li> + </ul> + <li>ElevationContour</li> + <ul> + <li><code>color</code>: color and alpha for the contour line.</li> + <li><code>spacing</code>: spacing for contour lines in meters.</li> + <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li> + </ul> + <li>ElevationRamp</li> + <ul> + <li><code>image</code>: color ramp image to use for coloring the terrain.</li> + <li><code>minimumHeight</code>: minimum height for the ramp.</li> + <li><code>maximumHeight</code>: maximum height for the ramp.</li> + </ul> + <li>SlopeRamp</li> + <ul> + <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li> + </ul> + <li>AspectRamp</li> + <ul> + <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li> + </ul> + <li>ElevationBand</li> + <ul> + <li><code>heights</code>: image of heights sorted from lowest to highest.</li> + <li><code>colors</code>: image of colors at the corresponding heights.</li> +</ul> +</ul> +</ul> +</div> + * @example + * // Create a color material with fromType: +polygon.material = Cesium.Material.fromType('Color'); +polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); + +// Create the default material: +polygon.material = new Cesium.Material(); + +// Create a color material with full Fabric notation: +polygon.material = new Cesium.Material({ + fabric : { + type : 'Color', + uniforms : { + color : new Cesium.Color(1.0, 1.0, 0.0, 1.0) + } + } +}); + * @param [options] - Object with the following properties: + * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials. + * @param [options.translucent = true] - When <code>true</code> or a function that returns <code>true</code>, the geometry + with this material is expected to appear translucent. + * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures. + * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures. + * @param options.fabric - The fabric JSON used to generate the material. + */ +export class Material { + constructor(options?: { + strict?: boolean + translucent?: boolean | ((...params: any[]) => any) + minificationFilter?: TextureMinificationFilter + magnificationFilter?: TextureMagnificationFilter + fabric: any + }); + /** + * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID. + */ + type: string; + /** + * The glsl shader source for this material. + */ + shaderSource: string; + /** + * Maps sub-material names to Material objects. + */ + materials: any; + /** + * Maps uniform names to their values. + */ + uniforms: any; + /** + * When <code>true</code> or a function that returns <code>true</code>, + the geometry is expected to appear translucent. + */ + translucent: boolean | ((...params: any[]) => any); + /** + * Creates a new material using an existing material type. + <br /><br /> + Shorthand for: new Material({fabric : {type : type}}); + * @example + * var material = Cesium.Material.fromType('Color', { + color : new Cesium.Color(1.0, 0.0, 0.0, 1.0) + }); + * @param type - The base material type. + * @param [uniforms] - Overrides for the default uniforms. + * @returns New material object. + */ + static fromType(type: string, uniforms?: any): Material; + /** + * Gets whether or not this material is translucent. + * @returns <code>true</code> if this material is translucent, <code>false</code> otherwise. + */ + isTranslucent(): boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * material = material && material.destroy(); + */ + destroy(): void; + /** + * Gets or sets the default texture uniform value. + */ + static DefaultImageId: string; + /** + * Gets or sets the default cube map texture uniform value. + */ + static DefaultCubeMapId: string; + /** + * Gets the name of the color material. + */ + static readonly ColorType: string; + /** + * Gets the name of the image material. + */ + static readonly ImageType: string; + /** + * Gets the name of the diffuce map material. + */ + static readonly DiffuseMapType: string; + /** + * Gets the name of the alpha map material. + */ + static readonly AlphaMapType: string; + /** + * Gets the name of the specular map material. + */ + static readonly SpecularMapType: string; + /** + * Gets the name of the emmision map material. + */ + static readonly EmissionMapType: string; + /** + * Gets the name of the bump map material. + */ + static readonly BumpMapType: string; + /** + * Gets the name of the normal map material. + */ + static readonly NormalMapType: string; + /** + * Gets the name of the grid material. + */ + static readonly GridType: string; + /** + * Gets the name of the stripe material. + */ + static readonly StripeType: string; + /** + * Gets the name of the checkerboard material. + */ + static readonly CheckerboardType: string; + /** + * Gets the name of the dot material. + */ + static readonly DotType: string; + /** + * Gets the name of the water material. + */ + static readonly WaterType: string; + /** + * Gets the name of the rim lighting material. + */ + static readonly RimLightingType: string; + /** + * Gets the name of the fade material. + */ + static readonly FadeType: string; + /** + * Gets the name of the polyline arrow material. + */ + static readonly PolylineArrowType: string; + /** + * Gets the name of the polyline glow material. + */ + static readonly PolylineDashType: string; + /** + * Gets the name of the polyline glow material. + */ + static readonly PolylineGlowType: string; + /** + * Gets the name of the polyline outline material. + */ + static readonly PolylineOutlineType: string; + /** + * Gets the name of the elevation contour material. + */ + static readonly ElevationContourType: string; + /** + * Gets the name of the elevation contour material. + */ + static readonly ElevationRampType: string; + /** + * Gets the name of the slope ramp material. + */ + static readonly SlopeRampMaterialType: string; + /** + * Gets the name of the aspect ramp material. + */ + static readonly AspectRampMaterialType: string; + /** + * Gets the name of the elevation band material. + */ + static readonly ElevationBandType: string; +} + +/** + * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example) +that supports shading with materials. + * @example + * var primitive = new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.WallGeometry({ + * materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat, + // ... + }) + }), + appearance : new Cesium.MaterialAppearance({ + material : Cesium.Material.fromType('Color'), + faceForward : true + }) + +}); + * @param [options] - Object with the following properties: + * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account. + * @param [options.faceForward = !options.closed] - When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. + * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled. + * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled. + * @param [options.materialSupport = MaterialAppearance.MaterialSupport.TEXTURED] - The type of materials that will be supported. + * @param [options.material = Material.ColorType] - The material used to determine the fragment color. + * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. + * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. + * @param [options.renderState] - Optional render state to override the default render state. + */ +export class MaterialAppearance { + constructor(options?: { + flat?: boolean + faceForward?: boolean + translucent?: boolean + closed?: boolean + materialSupport?: MaterialAppearance.MaterialSupportType + material?: Material + vertexShaderSource?: string + fragmentShaderSource?: string + renderState?: any + }); + /** + * The material used to determine the fragment color. Unlike other {@link MaterialAppearance} + properties, this is not read-only, so an appearance's material can change on the fly. + */ + material: Material; + /** + * When <code>true</code>, the geometry is expected to appear translucent. + */ + translucent: boolean; + /** + * The GLSL source code for the vertex shader. + */ + readonly vertexShaderSource: string; + /** + * The GLSL source code for the fragment shader. The full fragment shader + source is built procedurally taking into account {@link MaterialAppearance#material}, + {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}. + Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source. + */ + readonly fragmentShaderSource: string; + /** + * The WebGL fixed-function state to use when rendering the geometry. + <p> + The render state can be explicitly defined when constructing a {@link MaterialAppearance} + instance, or it is set implicitly via {@link MaterialAppearance#translucent} + and {@link MaterialAppearance#closed}. + </p> + */ + readonly renderState: any; + /** + * When <code>true</code>, the geometry is expected to be closed so + {@link MaterialAppearance#renderState} has backface culling enabled. + If the viewer enters the geometry, it will not be visible. + */ + readonly closed: boolean; + /** + * The type of materials supported by this instance. This impacts the required + {@link VertexFormat} and the complexity of the vertex and fragment shaders. + */ + readonly materialSupport: MaterialAppearance.MaterialSupportType; + /** + * The {@link VertexFormat} that this appearance instance is compatible with. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. + */ + readonly vertexFormat: VertexFormat; + /** + * When <code>true</code>, flat shading is used in the fragment shader, + which means lighting is not taking into account. + */ + readonly flat: boolean; + /** + * When <code>true</code>, the fragment shader flips the surface normal + as needed to ensure that the normal faces the viewer to avoid + dark spots. This is useful when both sides of a geometry should be + shaded like {@link WallGeometry}. + */ + readonly faceForward: boolean; + /** + * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance}, + this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material}, + {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}. + * @returns The full GLSL fragment shader source. + */ + getFragmentShaderSource(): string; + /** + * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}. + * @returns <code>true</code> if the appearance is translucent. + */ + isTranslucent(): boolean; + /** + * Creates a render state. This is not the final render state instance; instead, + it can contain a subset of render state properties identical to the render state + created in the context. + * @returns The render state. + */ + getRenderState(): any; +} + +export namespace MaterialAppearance { + type MaterialSupportType = { + vertexFormat: VertexFormat + vertexShaderSource: string + fragmentShaderSource: string + }; + /** + * Determines the type of {@link Material} that is supported by a + {@link MaterialAppearance} instance. This is a trade-off between + flexibility (a wide array of materials) and memory/performance + (required vertex format and GLSL shader complexity. + */ + namespace MaterialSupport { + /** + * Only basic materials, which require just <code>position</code> and + <code>normal</code> vertex attributes, are supported. + */ + const BASIC: MaterialAppearance.MaterialSupportType + /** + * Materials with textures, which require <code>position</code>, + <code>normal</code>, and <code>st</code> vertex attributes, + are supported. The vast majority of materials fall into this category. + */ + const TEXTURED: MaterialAppearance.MaterialSupportType + /** + * All materials, including those that work in tangent space, are supported. + This requires <code>position</code>, <code>normal</code>, <code>st</code>, + <code>tangent</code>, and <code>bitangent</code> vertex attributes. + */ + const ALL: MaterialAppearance.MaterialSupportType + } +} + +/** + * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL. +<p> +Cesium includes support for geometry and materials, glTF animations, and glTF skinning. +In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable +with {@link Model#getNode}. glTF cameras and lights are not currently supported. +</p> +<p> +An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be +created at runtime and passed to this constructor function. In either case, the +{@link Model#readyPromise} is resolved when the model is ready to render, i.e., +when the external binary, image, and shader files are downloaded and the WebGL +resources are created. +</p> +<p> +Cesium supports glTF assets with the following extensions: +<ul> +<li> +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)} +</li><li> +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)} +</li><li> +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)} +</li><li> +{@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations} +</li><li> +{@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)} +</li><li> +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression} +</li><li> +{@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness} +</li><li> +{@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit} +</li><li> +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl} +</li><li> +{@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform} +</li> +</ul> +</p> +<p> +For high-precision rendering, Cesium supports the {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} extension, which introduces the +CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated +relative to a local origin. +</p> + * @param [options] - Object with the following properties: + * @param [options.gltf] - A glTF JSON object, or a binary glTF buffer. + * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to. + * @param [options.show = true] - Determines if the model primitive will be shown. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates. + * @param [options.scale = 1.0] - A uniform scale applied to this model. + * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom. + * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize. + * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}. + * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}. + * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded. + * @param [options.asynchronous = true] - Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded. + * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified. + * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model. + * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe. + * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain. + * @param [options.scene] - Must be passed in for models that use the height reference property. + * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed. + * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color. + * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model. + * @param [options.colorBlendAmount = 0.5] - Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. + * @param [options.silhouetteColor = Color.RED] - The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts. + * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels. + * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model. + * @param [options.dequantizeInShader = true] - Determines if a {@link https://github.com/google/draco|Draco} encoded model is dequantized on the GPU. This decreases total memory usage for encoded models. + * @param [options.imageBasedLightingFactor = Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox. + * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead. + * @param [options.luminanceAtZenith = 0.2] - The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map. + * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. + * @param [options.specularEnvironmentMaps] - A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps. + * @param [options.credit] - A credit for the data source, which is displayed on the canvas. + * @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if {@link Model#color} is translucent or {@link Model#silhouetteSize} is greater than 0.0. + */ +export class Model { + constructor(options?: { + gltf?: any | ArrayBuffer | Uint8Array + basePath?: Resource | string + show?: boolean + modelMatrix?: Matrix4 + scale?: number + minimumPixelSize?: number + maximumScale?: number + id?: any + allowPicking?: boolean + incrementallyLoadTextures?: boolean + asynchronous?: boolean + clampAnimations?: boolean + shadows?: ShadowMode + debugShowBoundingVolume?: boolean + debugWireframe?: boolean + heightReference?: HeightReference + scene?: Scene + distanceDisplayCondition?: DistanceDisplayCondition + color?: Color + colorBlendMode?: ColorBlendMode + colorBlendAmount?: number + silhouetteColor?: Color + silhouetteSize?: number + clippingPlanes?: ClippingPlaneCollection + dequantizeInShader?: boolean + imageBasedLightingFactor?: Cartesian2 + lightColor?: Cartesian3 + luminanceAtZenith?: number + sphericalHarmonicCoefficients?: Cartesian3[] + specularEnvironmentMaps?: string + credit?: Credit | string + backFaceCulling?: boolean + }); + /** + * Determines if the model primitive will be shown. + */ + show: boolean; + /** + * The silhouette color. + */ + silhouetteColor: Color; + /** + * The size of the silhouette in pixels. + */ + silhouetteSize: number; + /** + * The 4x4 transformation matrix that transforms the model from model to world coordinates. + When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. + * @example + * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); + m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); + */ + modelMatrix: Matrix4; + /** + * A uniform scale applied to this model before the {@link Model#modelMatrix}. + Values greater than <code>1.0</code> increase the size of the model; values + less than <code>1.0</code> decrease. + */ + scale: number; + /** + * The approximate minimum pixel size of the model regardless of zoom. + This can be used to ensure that a model is visible even when the viewer + zooms out. When <code>0.0</code>, no minimum size is enforced. + */ + minimumPixelSize: number; + /** + * The maximum scale size for a model. This can be used to give + an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model + is never an unreasonable scale. + */ + maximumScale: number; + /** + * User-defined object returned when the model is picked. + */ + id: any; + /** + * Returns the height reference of the model + */ + heightReference: HeightReference; + /** + * The currently playing glTF animations. + */ + activeAnimations: ModelAnimationCollection; + /** + * Determines if the model's animations should hold a pose over frames where no keyframes are specified. + */ + clampAnimations: boolean; + /** + * Determines whether the model casts or receives shadows from light sources. + */ + shadows: ShadowMode; + /** + * A color that blends with the model's rendered color. + */ + color: Color; + /** + * Defines how the color blends with the model. + */ + colorBlendMode: ColorBlendMode; + /** + * Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. + A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with + any value in-between resulting in a mix of the two. + */ + colorBlendAmount: number; + /** + * Whether to cull back-facing geometry. When true, back face culling is + determined by the material's doubleSided property; when false, back face + culling is disabled. Back faces are not culled if {@link Model#color} is + translucent or {@link Model#silhouetteSize} is greater than 0.0. + */ + backFaceCulling: boolean; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds + to one draw command. A glTF mesh has an array of primitives, often of length one. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the model in wireframe. + </p> + */ + debugWireframe: boolean; + /** + * The object for the glTF JSON, including properties with default values omitted + from the JSON provided to this model. + */ + readonly gltf: any; + /** + * The base path that paths in the glTF JSON are relative to. The base + path is the same path as the path containing the .gltf file + minus the .gltf file, when binary, image, and shader files are + in the same directory as the .gltf. When this is <code>''</code>, + the app's base path is used. + */ + readonly basePath: string; + /** + * The model's bounding sphere in its local coordinate system. This does not take into + account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}. + * @example + * // Center in WGS84 coordinates + var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3()); + */ + readonly boundingSphere: BoundingSphere; + /** + * When <code>true</code>, this model is ready to render, i.e., the external binary, image, + and shader files were downloaded and the WebGL resources were created. This is set to + <code>true</code> right before {@link Model#readyPromise} is resolved. + */ + readonly ready: boolean; + /** + * Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary, image, + and shader files were downloaded and the WebGL resources were created. + <p> + This promise is resolved at the end of the frame before the first frame the model is rendered in. + </p> + * @example + * // Play all animations at half-speed when the model is ready to render + Cesium.when(model.readyPromise).then(function(model) { + model.activeAnimations.addAll({ + multiplier : 0.5 + }); + }).otherwise(function(error){ + window.alert(error); + }); + */ + readonly readyPromise: Promise<Model>; + /** + * Determines if model WebGL resource creation will be spread out over several frames or + block until completion once all glTF files are loaded. + */ + readonly asynchronous: boolean; + /** + * When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. + */ + readonly allowPicking: boolean; + /** + * Determine if textures may continue to stream in after the model is loaded. + */ + readonly incrementallyLoadTextures: boolean; + /** + * Return the number of pending texture loads. + */ + readonly pendingTextureLoads: number; + /** + * Gets or sets the condition specifying at what distance from the camera that this model will be displayed. + */ + distanceDisplayCondition: DistanceDisplayCondition; + /** + * The {@link ClippingPlaneCollection} used to selectively disable rendering the model. + */ + clippingPlanes: ClippingPlaneCollection; + /** + * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final + diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources. + */ + imageBasedLightingFactor: Cartesian2; + /** + * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead. + <p> + For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cesium.Cartesian2(0.0, 0.0)</code> will make the + model much darker. Here, increasing the intensity of the light source will make the model brighter. + </p> + */ + lightColor: Cartesian3; + /** + * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map. + This is used when {@link Model#specularEnvironmentMaps} and {@link Model#sphericalHarmonicCoefficients} are not defined. + */ + luminanceAtZenith: number; + /** + * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance + computed from the atmosphere color is used. + <p> + There are nine <code>Cartesian3</code> coefficients. + The order of the coefficients is: L<sub>00</sub>, L<sub>1-1</sub>, L<sub>10</sub>, L<sub>11</sub>, L<sub>2-2</sub>, L<sub>2-1</sub>, L<sub>20</sub>, L<sub>21</sub>, L<sub>22</sub> + </p> + + These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of + {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be + supplied to {@link Model#specularEnvironmentMaps}. + */ + sphericalHarmonicCoefficients: Cartesian3[]; + /** + * A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps. + */ + specularEnvironmentMaps: string; + /** + * Gets the credit that will be displayed for the model + */ + credit: Credit; + /** + * Determines if silhouettes are supported. + * @param scene - The scene. + * @returns <code>true</code> if silhouettes are supported; otherwise, returns <code>false</code> + */ + static silhouetteSupported(scene: Scene): boolean; + /** + * <p> + Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image, + and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved. + </p> + <p> + The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension. + </p> + <p> + Cesium supports glTF assets with the following extensions: + <ul> + <li> + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)} + </li><li> + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)} + </li><li> + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)} + </li><li> + {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations} + </li><li> + {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)} + </li><li> + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression} + </li><li> + {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness} + </li><li> + {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit} + </li><li> + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl} + </li><li> + {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform} + </li> + </ul> + </p> + <p> + For high-precision rendering, Cesium supports the {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} extension, which introduces the + CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated + relative to a local origin. + </p> + * @example + * // Example 1. Create a model from a glTF asset + var model = scene.primitives.add(Cesium.Model.fromGltf({ + url : './duck/duck.gltf' + })); + * @example + * // Example 2. Create model and provide all properties and events + var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); + var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); + + var model = scene.primitives.add(Cesium.Model.fromGltf({ + url : './duck/duck.gltf', + show : true, // default + modelMatrix : modelMatrix, + scale : 2.0, // double size + minimumPixelSize : 128, // never smaller than 128 pixels + maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize) + allowPicking : false, // not pickable + debugShowBoundingVolume : false, // default + debugWireframe : false + })); + + model.readyPromise.then(function(model) { + // Play all animations when the model is ready to render + model.activeAnimations.addAll(); + }); + * @param options - Object with the following properties: + * @param options.url - The url to the .gltf file. + * @param [options.basePath] - The base path that paths in the glTF JSON are relative to. + * @param [options.show = true] - Determines if the model primitive will be shown. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates. + * @param [options.scale = 1.0] - A uniform scale applied to this model. + * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom. + * @param [options.maximumScale] - The maximum scale for the model. + * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}. + * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}. + * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded. + * @param [options.asynchronous = true] - Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded. + * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified. + * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model. + * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe. + * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain. + * @param [options.scene] - Must be passed in for models that use the height reference property. + * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed. + * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color. + * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model. + * @param [options.colorBlendAmount = 0.5] - Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. + * @param [options.silhouetteColor = Color.RED] - The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts. + * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels. + * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model. + * @param [options.dequantizeInShader = true] - Determines if a {@link https://github.com/google/draco|Draco} encoded model is dequantized on the GPU. This decreases total memory usage for encoded models. + * @param [options.credit] - A credit for the model, which is displayed on the canvas. + * @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if {@link Model#color} is translucent or {@link Model#silhouetteSize} is greater than 0.0. + * @returns The newly created model. + */ + static fromGltf(options: { + url: Resource | string + basePath?: Resource | string + show?: boolean + modelMatrix?: Matrix4 + scale?: number + minimumPixelSize?: number + maximumScale?: number + id?: any + allowPicking?: boolean + incrementallyLoadTextures?: boolean + asynchronous?: boolean + clampAnimations?: boolean + shadows?: ShadowMode + debugShowBoundingVolume?: boolean + debugWireframe?: boolean + heightReference?: HeightReference + scene?: Scene + distanceDisplayCondition?: DistanceDisplayCondition + color?: Color + colorBlendMode?: ColorBlendMode + colorBlendAmount?: number + silhouetteColor?: Color + silhouetteSize?: number + clippingPlanes?: ClippingPlaneCollection + dequantizeInShader?: boolean + credit?: Credit | string + backFaceCulling?: boolean + }): Model; + /** + * Returns the glTF node with the given <code>name</code> property. This is used to + modify a node's transform for animation outside of glTF animations. + * @example + * // Apply non-uniform scale to node LOD3sp + var node = model.getNode('LOD3sp'); + node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix); + * @param name - The glTF name of the node. + * @returns The node or <code>undefined</code> if no node with <code>name</code> exists. + */ + getNode(name: string): ModelNode; + /** + * Returns the glTF mesh with the given <code>name</code> property. + * @param name - The glTF name of the mesh. + * @returns The mesh or <code>undefined</code> if no mesh with <code>name</code> exists. + */ + getMesh(name: string): ModelMesh; + /** + * Returns the glTF material with the given <code>name</code> property. + * @param name - The glTF name of the material. + * @returns The material or <code>undefined</code> if no material with <code>name</code> exists. + */ + getMaterial(name: string): ModelMaterial; + /** + * Sets the current value of an articulation stage. After setting one or multiple stage values, call + Model.applyArticulations() to cause the node matrices to be recalculated. + * @param articulationStageKey - The name of the articulation, a space, and the name of the stage. + * @param value - The numeric value of this stage of the articulation. + */ + setArticulationStage(articulationStageKey: string, value: number): void; + /** + * Applies any modified articulation stages to the matrix of each node that participates + in any articulation. Note that this will overwrite any nodeTransformations on participating nodes. + */ + applyArticulations(): void; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * model = model && model.destroy(); + */ + destroy(): void; +} + +/** + * An active glTF animation. A glTF asset can contain animations. An active animation +is an animation that is currently playing or scheduled to be played because it was +added to a model's {@link ModelAnimationCollection}. An active animation is an +instance of an animation; for example, there can be multiple active animations +for the same glTF animation, each with a different start time. +<p> +Create this by calling {@link ModelAnimationCollection#add}. +</p> + */ +export class ModelAnimation { + constructor(); + /** + * When <code>true</code>, the animation is removed after it stops playing. + This is slightly more efficient that not removing it, but if, for example, + time is reversed, the animation is not played again. + */ + removeOnStop: boolean; + /** + * The event fired when this animation is started. This can be used, for + example, to play a sound or start a particle system, when the animation starts. + <p> + This event is fired at the end of the frame after the scene is rendered. + </p> + * @example + * animation.start.addEventListener(function(model, animation) { + console.log('Animation started: ' + animation.name); + }); + */ + start: Event; + /** + * The event fired when on each frame when this animation is updated. The + current time of the animation, relative to the glTF animation time span, is + passed to the event, which allows, for example, starting new animations at a + specific time relative to a playing animation. + <p> + This event is fired at the end of the frame after the scene is rendered. + </p> + * @example + * animation.update.addEventListener(function(model, animation, time) { + console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time); + }); + */ + update: Event; + /** + * The event fired when this animation is stopped. This can be used, for + example, to play a sound or start a particle system, when the animation stops. + <p> + This event is fired at the end of the frame after the scene is rendered. + </p> + * @example + * animation.stop.addEventListener(function(model, animation) { + console.log('Animation stopped: ' + animation.name); + }); + */ + stop: Event; + /** + * The glTF animation name that identifies this animation. + */ + readonly name: string; + /** + * The scene time to start playing this animation. When this is <code>undefined</code>, + the animation starts at the next frame. + */ + readonly startTime: JulianDate; + /** + * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing. + */ + readonly delay: number; + /** + * The scene time to stop playing this animation. When this is <code>undefined</code>, + the animation is played for its full duration and perhaps repeated depending on + {@link ModelAnimation#loop}. + */ + readonly stopTime: JulianDate; + /** + * Values greater than <code>1.0</code> increase the speed that the animation is played relative + to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of + <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene + clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation + will play in one second even if <code>multiplier</code> is <code>1.0</code>. + */ + readonly multiplier: number; + /** + * When <code>true</code>, the animation is played in reverse. + */ + readonly reverse: boolean; + /** + * Determines if and how the animation is looped. + */ + readonly loop: ModelAnimationLoop; +} + +/** + * A collection of active model animations. Access this using {@link Model#activeAnimations}. + */ +export class ModelAnimationCollection { + constructor(); + /** + * The event fired when an animation is added to the collection. This can be used, for + example, to keep a UI in sync. + * @example + * model.activeAnimations.animationAdded.addEventListener(function(model, animation) { + console.log('Animation added: ' + animation.name); + }); + */ + animationAdded: Event; + /** + * The event fired when an animation is removed from the collection. This can be used, for + example, to keep a UI in sync. + * @example + * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) { + console.log('Animation removed: ' + animation.name); + }); + */ + animationRemoved: Event; + /** + * The number of animations in the collection. + */ + readonly length: number; + /** + * Creates and adds an animation with the specified initial properties to the collection. + <p> + This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync. + </p> + * @example + * // Example 1. Add an animation by name + model.activeAnimations.add({ + name : 'animation name' + }); + + // Example 2. Add an animation by index + model.activeAnimations.add({ + index : 0 + }); + * @example + * // Example 3. Add an animation and provide all properties and events + var startTime = Cesium.JulianDate.now(); + + var animation = model.activeAnimations.add({ + name : 'another animation name', + startTime : startTime, + delay : 0.0, // Play at startTime (default) + stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()), + removeOnStop : false, // Do not remove when animation stops (default) + multiplier : 2.0, // Play at double speed + reverse : true, // Play in reverse + loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation + }); + + animation.start.addEventListener(function(model, animation) { + console.log('Animation started: ' + animation.name); + }); + animation.update.addEventListener(function(model, animation, time) { + console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time); + }); + animation.stop.addEventListener(function(model, animation) { + console.log('Animation stopped: ' + animation.name); + }); + * @param options - Object with the following properties: + * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>. + * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>. + * @param [options.startTime] - The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame. + * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing. + * @param [options.stopTime] - The scene time to stop playing the animation. When this is <code>undefined</code>, the animation is played for its full duration. + * @param [options.removeOnStop = false] - When <code>true</code>, the animation is removed after it stops playing. + * @param [options.multiplier = 1.0] - Values greater than <code>1.0</code> increase the speed that the animation is played relative to the scene clock speed; values less than <code>1.0</code> decrease the speed. + * @param [options.reverse = false] - When <code>true</code>, the animation is played in reverse. + * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped. + * @returns The animation that was added to the collection. + */ + add(options: { + name?: string + index?: number + startTime?: JulianDate + delay?: number + stopTime?: JulianDate + removeOnStop?: boolean + multiplier?: number + reverse?: boolean + loop?: ModelAnimationLoop + }): ModelAnimation; + /** + * Creates and adds an animation with the specified initial properties to the collection + for each animation in the model. + <p> + This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync. + </p> + * @example + * model.activeAnimations.addAll({ + multiplier : 0.5, // Play at half-speed + loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations + }); + * @param [options] - Object with the following properties: + * @param [options.startTime] - The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame. + * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing. + * @param [options.stopTime] - The scene time to stop playing the animations. When this is <code>undefined</code>, the animations are played for its full duration. + * @param [options.removeOnStop = false] - When <code>true</code>, the animations are removed after they stop playing. + * @param [options.multiplier = 1.0] - Values greater than <code>1.0</code> increase the speed that the animations play relative to the scene clock speed; values less than <code>1.0</code> decrease the speed. + * @param [options.reverse = false] - When <code>true</code>, the animations are played in reverse. + * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped. + * @returns An array of {@link ModelAnimation} objects, one for each animation added to the collection. If there are no glTF animations, the array is empty. + */ + addAll(options?: { + startTime?: JulianDate + delay?: number + stopTime?: JulianDate + removeOnStop?: boolean + multiplier?: number + reverse?: boolean + loop?: ModelAnimationLoop + }): ModelAnimation[]; + /** + * Removes an animation from the collection. + <p> + This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync. + </p> + <p> + An animation can also be implicitly removed from the collection by setting {@link ModelAnimation#removeOnStop} to + <code>true</code>. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed. + </p> + * @example + * var a = model.activeAnimations.add({ + name : 'animation name' + }); + model.activeAnimations.remove(a); // Returns true + * @param animation - The animation to remove. + * @returns <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection. + */ + remove(animation: ModelAnimation): boolean; + /** + * Removes all animations from the collection. + <p> + This raises the {@link ModelAnimationCollection#animationRemoved} event for each + animation so, for example, a UI can stay in sync. + </p> + */ + removeAll(): void; + /** + * Determines whether this collection contains a given animation. + * @param animation - The animation to check for. + * @returns <code>true</code> if this collection contains the animation, <code>false</code> otherwise. + */ + contains(animation: ModelAnimation): boolean; + /** + * Returns the animation in the collection at the specified index. Indices are zero-based + and increase as animations are added. Removing an animation shifts all animations after + it to the left, changing their indices. This function is commonly used to iterate over + all the animations in the collection. + * @example + * // Output the names of all the animations in the collection. + var animations = model.activeAnimations; + var length = animations.length; + for (var i = 0; i < length; ++i) { + console.log(animations.get(i).name); + } + * @param index - The zero-based index of the animation. + * @returns The animation at the specified index. + */ + get(index: number): ModelAnimation; +} + +/** + * Determines if and how a glTF animation is looped. + */ +export enum ModelAnimationLoop { + /** + * Play the animation once; do not loop it. + */ + NONE = 0, + /** + * Loop the animation playing it from the start immediately after it stops. + */ + REPEAT = 1, + /** + * Loop the animation. First, playing it forward, then in reverse, then forward, and so on. + */ + MIRRORED_REPEAT = 2 +} + +/** + * A model's material with modifiable parameters. A glTF material +contains parameters defined by the material's technique with values +defined by the technique and potentially overridden by the material. +This class allows changing these values at runtime. +<p> +Use {@link Model#getMaterial} to create an instance. +</p> + */ +export class ModelMaterial { + constructor(); + /** + * The value of the <code>name</code> property of this material. + */ + readonly name: string; + /** + * The index of the material. + */ + readonly id: string; + /** + * Assigns a value to a material parameter. The type for <code>value</code> + depends on the glTF type of the parameter. It will be a floating-point + number, Cartesian, or matrix. + * @example + * material.setValue('diffuse', new Cesium.Cartesian4(1.0, 0.0, 0.0, 1.0)); // vec4 + material.setValue('shininess', 256.0); // scalar + * @param name - The name of the parameter. + * @param [value] - The value to assign to the parameter. + */ + setValue(name: string, value?: any): void; + /** + * Returns the value of the parameter with the given <code>name</code>. The type of the + returned object depends on the glTF type of the parameter. It will be a floating-point + number, Cartesian, or matrix. + * @param name - The name of the parameter. + * @returns The value of the parameter or <code>undefined</code> if the parameter does not exist. + */ + getValue(name: string): any; +} + +/** + * A model's mesh and its materials. +<p> +Use {@link Model#getMesh} to create an instance. +</p> + */ +export class ModelMesh { + constructor(); + /** + * The value of the <code>name</code> property of this mesh. + */ + readonly name: string; + /** + * The index of the mesh. + */ + readonly id: string; + /** + * An array of {@link ModelMaterial} instances indexed by the mesh's + primitive indices. + */ + readonly materials: ModelMaterial[]; +} + +/** + * A model node with a transform for user-defined animations. A glTF asset can +contain animations that target a node's transform. This class allows +changing a node's transform externally so animation can be driven by another +source, not just an animation in the glTF asset. +<p> +Use {@link Model#getNode} to create an instance. +</p> + * @example + * var node = model.getNode('LOD3sp'); +node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix); + */ +export class ModelNode { + constructor(); + /** + * The value of the <code>name</code> property of this node. + */ + readonly name: string; + /** + * The index of the node. + */ + readonly id: string; + /** + * Determines if this node and its children will be shown. + */ + show: boolean; + /** + * The node's 4x4 matrix transform from its local coordinates to + its parent's. + <p> + For changes to take effect, this property must be assigned to; + setting individual elements of the matrix will not work. + </p> + */ + matrix: Matrix4; + /** + * Gets the node's original 4x4 matrix transform from its local coordinates to + its parent's, without any node transformations or articulations applied. + */ + originalMatrix: Matrix4; +} + +/** + * Draws the Moon in 3D. + * @example + * scene.moon = new Cesium.Moon(); + * @param [options] - Object with the following properties: + * @param [options.show = true] - Determines whether the moon will be rendered. + * @param [options.textureUrl = buildModuleUrl('Assets/Textures/moonSmall.jpg')] - The moon texture. + * @param [options.ellipsoid = Ellipsoid.MOON] - The moon ellipsoid. + * @param [options.onlySunLighting = true] - Use the sun as the only light source. + */ +export class Moon { + constructor(options?: { + show?: boolean + textureUrl?: string + ellipsoid?: Ellipsoid + onlySunLighting?: boolean + }); + /** + * Determines if the moon will be shown. + */ + show: boolean; + /** + * The moon texture. + */ + textureUrl: string; + /** + * Use the sun as the only light source. + */ + onlySunLighting: boolean; + /** + * Get the ellipsoid that defines the shape of the moon. + */ + readonly ellipsoid: Ellipsoid; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * moon = moon && moon.destroy(); + */ + destroy(): void; +} + +/** + * A {@link TileDiscardPolicy} specifying that tile images should never be discard. + */ +export class NeverTileDiscardPolicy { + constructor(); + /** + * Determines if the discard policy is ready to process images. + * @returns True if the discard policy is ready to process images; otherwise, false. + */ + isReady(): boolean; + /** + * Given a tile image, decide whether to discard that image. + * @param image - An image to test. + * @returns True if the image should be discarded; otherwise, false. + */ + shouldDiscardImage(image: HTMLImageElement): boolean; +} + +export namespace OpenStreetMapImageryProvider { + /** + * Initialization options for the OpenStreetMapImageryProvider constructor + * @property [url = 'https://a.tile.openstreetmap.org'] - The OpenStreetMap server url. + * @property [fileExtension = 'png'] - The file extension for images on the server. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. + * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. + * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property [credit = 'MapQuest, Open Street Map and contributors, CC-BY-SA'] - A credit for the data source, which is displayed on the canvas. + */ + type ConstructorOptions = { + url?: string + fileExtension?: string + rectangle?: Rectangle + minimumLevel?: number + maximumLevel?: number + ellipsoid?: Ellipsoid + credit?: Credit | string + }; +} + +/** + * An imagery provider that provides tiled imagery hosted by OpenStreetMap +or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run +servers, so you must conform to their +{@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}. + * @example + * var osm = new Cesium.OpenStreetMapImageryProvider({ + url : 'https://a.tile.openstreetmap.org/' +}); + * @param options - Object describing initialization options + */ +export class OpenStreetMapImageryProvider extends UrlTemplateImageryProvider { + constructor(options: OpenStreetMapImageryProvider.ConstructorOptions); +} + +/** + * A particle emitted by a {@link ParticleSystem}. + * @param options - An object with the following properties: + * @param [options.mass = 1.0] - The mass of the particle in kilograms. + * @param [options.position = Cartesian3.ZERO] - The initial position of the particle in world coordinates. + * @param [options.velocity = Cartesian3.ZERO] - The velocity vector of the particle in world coordinates. + * @param [options.life = Number.MAX_VALUE] - The life of the particle in seconds. + * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard. + * @param [options.startColor = Color.WHITE] - The color of a particle when it is born. + * @param [options.endColor = Color.WHITE] - The color of a particle when it dies. + * @param [options.startScale = 1.0] - The scale of the particle when it is born. + * @param [options.endScale = 1.0] - The scale of the particle when it dies. + * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - The dimensions, width by height, to scale the particle image in pixels. + */ +export class Particle { + constructor(options: { + mass?: number + position?: Cartesian3 + velocity?: Cartesian3 + life?: number + image?: any + startColor?: Color + endColor?: Color + startScale?: number + endScale?: number + imageSize?: Cartesian2 + }); + /** + * The mass of the particle in kilograms. + */ + mass: number; + /** + * The positon of the particle in world coordinates. + */ + position: Cartesian3; + /** + * The velocity of the particle in world coordinates. + */ + velocity: Cartesian3; + /** + * The life of the particle in seconds. + */ + life: number; + /** + * The image to use for the particle. + */ + image: any; + /** + * The color of the particle when it is born. + */ + startColor: Color; + /** + * The color of the particle when it dies. + */ + endColor: Color; + /** + * the scale of the particle when it is born. + */ + startScale: number; + /** + * The scale of the particle when it dies. + */ + endScale: number; + /** + * The dimensions, width by height, to scale the particle image in pixels. + */ + imageSize: Cartesian2; + /** + * Gets the age of the particle in seconds. + */ + age: number; + /** + * Gets the age normalized to a value in the range [0.0, 1.0]. + */ + normalizedAge: number; +} + +/** + * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime. + * @param [options] - An object with the following properties: + * @param [options.time = 0.0] - The time in seconds after the beginning of the particle system's lifetime that the burst will occur. + * @param [options.minimum = 0.0] - The minimum number of particles emmitted in the burst. + * @param [options.maximum = 50.0] - The maximum number of particles emitted in the burst. + */ +export class ParticleBurst { + constructor(options?: { + time?: number + minimum?: number + maximum?: number + }); + /** + * The time in seconds after the beginning of the particle system's lifetime that the burst will occur. + */ + time: number; + /** + * The minimum number of particles emitted. + */ + minimum: number; + /** + * The maximum number of particles emitted. + */ + maximum: number; + /** + * <code>true</code> if the burst has been completed; <code>false</code> otherwise. + */ + complete: boolean; +} + +/** + * <p> +An object that initializes a {@link Particle} from a {@link ParticleSystem}. +</p> +<p> +This type describes an interface and is not intended to be instantiated directly. +</p> + */ +export class ParticleEmitter { + constructor(); +} + +/** + * A ParticleSystem manages the updating and display of a collection of particles. + * @param [options] - Object with the following properties: + * @param [options.show = true] - Whether to display the particle system. + * @param [options.updateCallback] - The callback function to be called each frame to update a particle. + * @param [options.emitter = new CircleEmitter(0.5)] - The particle emitter for this system. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system from model to world coordinates. + * @param [options.emitterModelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system. + * @param [options.emissionRate = 5] - The number of particles to emit per second. + * @param [options.bursts] - An array of {@link ParticleBurst}, emitting bursts of particles at periodic times. + * @param [options.loop = true] - Whether the particle system should loop its bursts when it is complete. + * @param [options.scale = 1.0] - Sets the scale to apply to the image of the particle for the duration of its particleLife. + * @param [options.startScale] - The initial scale to apply to the image of the particle at the beginning of its life. + * @param [options.endScale] - The final scale to apply to the image of the particle at the end of its life. + * @param [options.color = Color.WHITE] - Sets the color of a particle for the duration of its particleLife. + * @param [options.startColor] - The color of the particle at the beginning of its life. + * @param [options.endColor] - The color of the particle at the end of its life. + * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard. + * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - If set, overrides the minimumImageSize and maximumImageSize inputs that scale the particle image's dimensions in pixels. + * @param [options.minimumImageSize] - Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels. + * @param [options.maximumImageSize] - Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels. + * @param [options.sizeInMeters] - Sets if the size of particles is in meters or pixels. <code>true</code> to size the particles in meters; otherwise, the size is in pixels. + * @param [options.speed = 1.0] - If set, overrides the minimumSpeed and maximumSpeed inputs with this value. + * @param [options.minimumSpeed] - Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen. + * @param [options.maximumSpeed] - Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen. + * @param [options.lifetime = Number.MAX_VALUE] - How long the particle system will emit particles, in seconds. + * @param [options.particleLife = 5.0] - If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value. + * @param [options.minimumParticleLife] - Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen. + * @param [options.maximumParticleLife] - Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen. + * @param [options.mass = 1.0] - Sets the minimum and maximum mass of particles in kilograms. + * @param [options.minimumMass] - Sets the minimum bound for the mass of a particle in kilograms. A particle's actual mass will be chosen as a random amount above this value. + * @param [options.maximumMass] - Sets the maximum mass of particles in kilograms. A particle's actual mass will be chosen as a random amount below this value. + */ +export class ParticleSystem { + constructor(options?: { + show?: boolean + updateCallback?: ParticleSystem.updateCallback + emitter?: ParticleEmitter + modelMatrix?: Matrix4 + emitterModelMatrix?: Matrix4 + emissionRate?: number + bursts?: ParticleBurst[] + loop?: boolean + scale?: number + startScale?: number + endScale?: number + color?: Color + startColor?: Color + endColor?: Color + image?: any + imageSize?: Cartesian2 + minimumImageSize?: Cartesian2 + maximumImageSize?: Cartesian2 + sizeInMeters?: boolean + speed?: number + minimumSpeed?: number + maximumSpeed?: number + lifetime?: number + particleLife?: number + minimumParticleLife?: number + maximumParticleLife?: number + mass?: number + minimumMass?: number + maximumMass?: number + }); + /** + * Whether to display the particle system. + */ + show: boolean; + /** + * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time + */ + updateCallback: ParticleSystem.updateCallback; + /** + * Whether the particle system should loop it's bursts when it is complete. + */ + loop: boolean; + /** + * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard. + */ + image: any; + /** + * The particle emitter for this + */ + emitter: ParticleEmitter; + /** + * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times. + */ + bursts: ParticleBurst[]; + /** + * The 4x4 transformation matrix that transforms the particle system from model to world coordinates. + */ + modelMatrix: Matrix4; + /** + * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system. + */ + emitterModelMatrix: Matrix4; + /** + * The color of the particle at the beginning of its life. + */ + startColor: Color; + /** + * The color of the particle at the end of its life. + */ + endColor: Color; + /** + * The initial scale to apply to the image of the particle at the beginning of its life. + */ + startScale: number; + /** + * The final scale to apply to the image of the particle at the end of its life. + */ + endScale: number; + /** + * The number of particles to emit per second. + */ + emissionRate: number; + /** + * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen. + */ + minimumSpeed: number; + /** + * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen. + */ + maximumSpeed: number; + /** + * Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen. + */ + minimumParticleLife: number; + /** + * Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen. + */ + maximumParticleLife: number; + /** + * Sets the minimum mass of particles in kilograms. + */ + minimumMass: number; + /** + * Sets the maximum mass of particles in kilograms. + */ + maximumMass: number; + /** + * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels. + */ + minimumImageSize: Cartesian2; + /** + * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels. + */ + maximumImageSize: Cartesian2; + /** + * Gets or sets if the particle size is in meters or pixels. <code>true</code> to size particles in meters; otherwise, the size is in pixels. + */ + sizeInMeters: boolean; + /** + * How long the particle system will emit particles, in seconds. + */ + lifetime: number; + /** + * Fires an event when the particle system has reached the end of its lifetime. + */ + complete: Event; + /** + * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise. + */ + isComplete: boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + */ + destroy(): void; +} + +export namespace ParticleSystem { + /** + * A function used to modify attributes of the particle at each time step. This can include force modifications, + color, sizing, etc. + * @example + * function applyGravity(particle, dt) { + var position = particle.position; + var gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3()); + Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector); + particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity); + } + * @param particle - The particle being updated. + * @param dt - The time in seconds since the last update. + */ + type updateCallback = (particle: Particle, dt: number) => void; +} + +/** + * An appearance for {@link GeometryInstance} instances with color attributes. +This allows several geometry instances, each with a different color, to +be drawn with the same {@link Primitive} as shown in the second example below. + * @example + * // A solid white line segment +var primitive = new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.SimplePolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0 + ]) + }), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0)) + } + }), + appearance : new Cesium.PerInstanceColorAppearance({ + flat : true, + translucent : false + }) +}); + +// Two rectangles in a primitive, each with a different color +var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0) + }), + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5) + } +}); + +var anotherInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0) + }), + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5) + } +}); + +var rectanglePrimitive = new Cesium.Primitive({ + geometryInstances : [instance, anotherInstance], + appearance : new Cesium.PerInstanceColorAppearance() +}); + * @param [options] - Object with the following properties: + * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account. + * @param [options.faceForward = !options.closed] - When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}. + * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled. + * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled. + * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. + * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. + * @param [options.renderState] - Optional render state to override the default render state. + */ +export class PerInstanceColorAppearance { + constructor(options?: { + flat?: boolean + faceForward?: boolean + translucent?: boolean + closed?: boolean + vertexShaderSource?: string + fragmentShaderSource?: string + renderState?: any + }); + /** + * This property is part of the {@link Appearance} interface, but is not + used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used. + */ + material: Material; + /** + * When <code>true</code>, the geometry is expected to appear translucent so + {@link PerInstanceColorAppearance#renderState} has alpha blending enabled. + */ + translucent: boolean; + /** + * The GLSL source code for the vertex shader. + */ + readonly vertexShaderSource: string; + /** + * The GLSL source code for the fragment shader. + */ + readonly fragmentShaderSource: string; + /** + * The WebGL fixed-function state to use when rendering the geometry. + <p> + The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance} + instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent} + and {@link PerInstanceColorAppearance#closed}. + </p> + */ + readonly renderState: any; + /** + * When <code>true</code>, the geometry is expected to be closed so + {@link PerInstanceColorAppearance#renderState} has backface culling enabled. + If the viewer enters the geometry, it will not be visible. + */ + readonly closed: boolean; + /** + * The {@link VertexFormat} that this appearance instance is compatible with. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. + */ + readonly vertexFormat: VertexFormat; + /** + * When <code>true</code>, flat shading is used in the fragment shader, + which means lighting is not taking into account. + */ + readonly flat: boolean; + /** + * When <code>true</code>, the fragment shader flips the surface normal + as needed to ensure that the normal faces the viewer to avoid + dark spots. This is useful when both sides of a geometry should be + shaded like {@link WallGeometry}. + */ + readonly faceForward: boolean; + /** + * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances + are compatible with. This requires only <code>position</code> and <code>normal</code> + attributes. + */ + static readonly VERTEX_FORMAT: VertexFormat; + /** + * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances + are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>. + This requires only a <code>position</code> attribute. + */ + static readonly FLAT_VERTEX_FORMAT: VertexFormat; + /** + * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance}, + this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat}, + and {@link PerInstanceColorAppearance#faceForward}. + * @returns The full GLSL fragment shader source. + */ + getFragmentShaderSource(): string; + /** + * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}. + * @returns <code>true</code> if the appearance is translucent. + */ + isTranslucent(): boolean; + /** + * Creates a render state. This is not the final render state instance; instead, + it can contain a subset of render state properties identical to the render state + created in the context. + * @returns The render state. + */ + getRenderState(): any; +} + +/** + * Options for performing point attenuation based on geometric error when rendering +point clouds using 3D Tiles. + * @param [options] - Object with the following properties: + * @param [options.attenuation = false] - Perform point attenuation based on geometric error. + * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error. + * @param [options.maximumAttenuation] - Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError. + * @param [options.baseResolution] - Average base resolution for the dataset in meters. Substitute for Geometric Error when not available. + * @param [options.eyeDomeLighting = true] - When true, use eye dome lighting when drawing with point attenuation. + * @param [options.eyeDomeLightingStrength = 1.0] - Increasing this value increases contrast on slopes and edges. + * @param [options.eyeDomeLightingRadius = 1.0] - Increase the thickness of contours from eye dome lighting. + * @param [options.backFaceCulling = false] - Determines whether back-facing points are hidden. This option works only if data has normals included. + * @param [options.normalShading = true] - Determines whether a point cloud that contains normals is shaded by the scene's light source. + */ +export class PointCloudShading { + constructor(options?: { + attenuation?: boolean + geometricErrorScale?: number + maximumAttenuation?: number + baseResolution?: number + eyeDomeLighting?: boolean + eyeDomeLightingStrength?: number + eyeDomeLightingRadius?: number + backFaceCulling?: boolean + normalShading?: boolean + }); + /** + * Perform point attenuation based on geometric error. + */ + attenuation: boolean; + /** + * Scale to be applied to the geometric error before computing attenuation. + */ + geometricErrorScale: number; + /** + * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used. + */ + maximumAttenuation: number; + /** + * Average base resolution for the dataset in meters. + Used in place of geometric error when geometric error is 0. + If undefined, an approximation will be computed for each tile that has geometric error of 0. + */ + baseResolution: number; + /** + * Use eye dome lighting when drawing with point attenuation + Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0, + otherwise eye dome lighting is ignored. + */ + eyeDomeLighting: boolean; + /** + * Eye dome lighting strength (apparent contrast) + */ + eyeDomeLightingStrength: number; + /** + * Thickness of contours from eye dome lighting + */ + eyeDomeLightingRadius: number; + /** + * Determines whether back-facing points are hidden. + This option works only if data has normals included. + */ + backFaceCulling: boolean; + /** + * Determines whether a point cloud that contains normals is shaded by the scene's light source. + */ + normalShading: boolean; + /** + * Determines if point cloud shading is supported. + * @param scene - The scene. + * @returns <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code> + */ + static isSupported(scene: Scene): boolean; +} + +/** + * A graphical point positioned in the 3D scene, that is created +and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial +properties are set by calling {@link PointPrimitiveCollection#add}. + */ +export class PointPrimitive { + constructor(); + /** + * Determines if this point will be shown. Use this to hide or show a point, instead + of removing it and re-adding it to the collection. + */ + show: boolean; + /** + * Gets or sets the Cartesian position of this point. + */ + position: Cartesian3; + /** + * Gets or sets near and far scaling properties of a point based on the point's distance from the camera. + A point's scale will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the point's scale remains clamped to the nearest bound. This scale + multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined, + scaleByDistance will be disabled. + * @example + * // Example 1. + // Set a pointPrimitive's scaleByDistance to scale to 15 when the + // camera is 1500 meters from the pointPrimitive and disappear as + // the camera distance approaches 8.0e6 meters. + p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0); + * @example + * // Example 2. + // disable scaling by distance + p.scaleByDistance = undefined; + */ + scaleByDistance: NearFarScalar; + /** + * Gets or sets near and far translucency properties of a point based on the point's distance from the camera. + A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and + {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds + of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}. + Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined, + translucencyByDistance will be disabled. + * @example + * // Example 1. + // Set a point's translucency to 1.0 when the + // camera is 1500 meters from the point and disappear as + // the camera distance approaches 8.0e6 meters. + p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0); + * @example + * // Example 2. + // disable translucency by distance + p.translucencyByDistance = undefined; + */ + translucencyByDistance: NearFarScalar; + /** + * Gets or sets the inner size of the point in pixels. + */ + pixelSize: number; + /** + * Gets or sets the inner color of the point. + The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>, + <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code> + (no intensity) to <code>1.0</code> (full intensity). + * @example + * // Example 1. Assign yellow. + p.color = Cesium.Color.YELLOW; + * @example + * // Example 2. Make a pointPrimitive 50% translucent. + p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5); + */ + color: Color; + /** + * Gets or sets the outline color of the point. + */ + outlineColor: Color; + /** + * Gets or sets the outline width in pixels. This width adds to pixelSize, + increasing the total size of the point. + */ + outlineWidth: number; + /** + * Gets or sets the condition specifying at what distance from the camera that this point will be displayed. + */ + distanceDisplayCondition: DistanceDisplayCondition; + /** + * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. + When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied. + */ + disableDepthTestDistance: number; + /** + * Gets or sets the user-defined value returned when the point is picked. + */ + id: any; + /** + * Computes the screen-space position of the point's origin. + The screen space origin is the top, left corner of the canvas; <code>x</code> increases from + left to right, and <code>y</code> increases from top to bottom. + * @example + * console.log(p.computeScreenSpacePosition(scene).toString()); + * @param scene - The scene. + * @param [result] - The object onto which to store the result. + * @returns The screen-space position of the point. + */ + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + /** + * Determines if this point equals another point. Points are equal if all their properties + are equal. Points in different collections can be equal. + * @param other - The point to compare for equality. + * @returns <code>true</code> if the points are equal; otherwise, <code>false</code>. + */ + equals(other: PointPrimitive): boolean; +} + +/** + * A renderable collection of points. +<br /><br /> +Points are added and removed from the collection using {@link PointPrimitiveCollection#add} +and {@link PointPrimitiveCollection#remove}. + * @example + * // Create a pointPrimitive collection with two points +var points = scene.primitives.add(new Cesium.PointPrimitiveCollection()); +points.add({ + position : new Cesium.Cartesian3(1.0, 2.0, 3.0), + color : Cesium.Color.YELLOW +}); +points.add({ + position : new Cesium.Cartesian3(4.0, 5.0, 6.0), + color : Cesium.Color.CYAN +}); + * @param [options] - Object with the following properties: + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default +is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent, +setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x. + * @param [options.show = true] - Determines if the primitives in the collection will be shown. + */ +export class PointPrimitiveCollection { + constructor(options?: { + modelMatrix?: Matrix4 + debugShowBoundingVolume?: boolean + blendOption?: BlendOption + show?: boolean + }); + /** + * Determines if primitives in this collection will be shown. + */ + show: boolean; + /** + * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates. + When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. + * @example + * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883); + pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); + pointPrimitives.add({ + color : Cesium.Color.ORANGE, + position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center + }); + pointPrimitives.add({ + color : Cesium.Color.YELLOW, + position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east + }); + pointPrimitives.add({ + color : Cesium.Color.GREEN, + position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north + }); + pointPrimitives.add({ + color : Cesium.Color.CYAN, + position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up + }); + */ + modelMatrix: Matrix4; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the primitive. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * The point blending option. The default is used for rendering both opaque and translucent points. + However, if either all of the points are completely opaque or all are completely translucent, + setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve + performance by up to 2x. + */ + blendOption: BlendOption; + /** + * Returns the number of points in this collection. This is commonly used with + {@link PointPrimitiveCollection#get} to iterate over all the points + in the collection. + */ + length: number; + /** + * Creates and adds a point with the specified initial properties to the collection. + The added point is returned so it can be modified or removed from the collection later. + * @example + * // Example 1: Add a point, specifying all the default values. + var p = pointPrimitives.add({ + show : true, + position : Cesium.Cartesian3.ZERO, + pixelSize : 10.0, + color : Cesium.Color.WHITE, + outlineColor : Cesium.Color.TRANSPARENT, + outlineWidth : 0.0, + id : undefined + }); + * @example + * // Example 2: Specify only the point's cartographic position. + var p = pointPrimitives.add({ + position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height) + }); + * @param [options] - A template describing the point's properties as shown in Example 1. + * @returns The point that was added to the collection. + */ + add(options?: any): PointPrimitive; + /** + * Removes a point from the collection. + * @example + * var p = pointPrimitives.add(...); + pointPrimitives.remove(p); // Returns true + * @param pointPrimitive - The point to remove. + * @returns <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection. + */ + remove(pointPrimitive: PointPrimitive): boolean; + /** + * Removes all points from the collection. + * @example + * pointPrimitives.add(...); + pointPrimitives.add(...); + pointPrimitives.removeAll(); + */ + removeAll(): void; + /** + * Check whether this collection contains a given point. + * @param [pointPrimitive] - The point to check for. + * @returns true if this collection contains the point, false otherwise. + */ + contains(pointPrimitive?: PointPrimitive): boolean; + /** + * Returns the point in the collection at the specified index. Indices are zero-based + and increase as points are added. Removing a point shifts all points after + it to the left, changing their indices. This function is commonly used with + {@link PointPrimitiveCollection#length} to iterate over all the points + in the collection. + * @example + * // Toggle the show property of every point in the collection + var len = pointPrimitives.length; + for (var i = 0; i < len; ++i) { + var p = pointPrimitives.get(i); + p.show = !p.show; + } + * @param index - The zero-based index of the point. + * @returns The point at the specified index. + */ + get(index: number): PointPrimitive; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * pointPrimitives = pointPrimitives && pointPrimitives.destroy(); + */ + destroy(): void; +} + +/** + * A renderable polyline. Create this by calling {@link PolylineCollection#add} + * @param options - Object with the following properties: + * @param [options.show = true] - <code>true</code> if this polyline will be shown; otherwise, <code>false</code>. + * @param [options.width = 1.0] - The width of the polyline in pixels. + * @param [options.loop = false] - Whether a line segment will be added between the last and first line positions to make this line a loop. + * @param [options.material = Material.ColorType] - The material. + * @param [options.positions] - The positions. + * @param [options.id] - The user-defined object to be returned when this polyline is picked. + * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this polyline will be displayed. + * @param polylineCollection - The renderable polyline collection. + */ +export class Polyline { + constructor(options: { + show?: boolean + width?: number + loop?: boolean + material?: Material + positions?: Cartesian3[] + id?: any + distanceDisplayCondition?: DistanceDisplayCondition + }, polylineCollection: PolylineCollection); + /** + * Determines if this polyline will be shown. Use this to hide or show a polyline, instead + of removing it and re-adding it to the collection. + */ + show: boolean; + /** + * Gets or sets the positions of the polyline. + * @example + * polyline.positions = Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 10.0, 0.0, + 0.0, 20.0 + ]); + */ + positions: Cartesian3[]; + /** + * Gets or sets the surface appearance of the polyline. This can be one of several built-in {@link Material} objects or a custom material, scripted with + {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. + */ + material: Material; + /** + * Gets or sets the width of the polyline. + */ + width: number; + /** + * Gets or sets whether a line segment will be added between the first and last polyline positions. + */ + loop: boolean; + /** + * Gets or sets the user-defined value returned when the polyline is picked. + */ + id: any; + /** + * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed. + */ + distanceDisplayCondition: DistanceDisplayCondition; +} + +/** + * A renderable collection of polylines. +<br /><br /> +<div align="center"> +<img src="Images/Polyline.png" width="400" height="300" /><br /> +Example polylines +</div> +<br /><br /> +Polylines are added and removed from the collection using {@link PolylineCollection#add} +and {@link PolylineCollection#remove}. + * @example + * // Create a polyline collection with two polylines +var polylines = new Cesium.PolylineCollection(); +polylines.add({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -75.10, 39.57, + -77.02, 38.53, + -80.50, 35.14, + -80.12, 25.46]), + width : 2 +}); + +polylines.add({ + positions : Cesium.Cartesian3.fromDegreesArray([ + -73.10, 37.57, + -75.02, 36.53, + -78.50, 33.14, + -78.12, 23.46]), + width : 4 +}); + * @param [options] - Object with the following properties: + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param [options.show = true] - Determines if the polylines in the collection will be shown. + */ +export class PolylineCollection { + constructor(options?: { + modelMatrix?: Matrix4 + debugShowBoundingVolume?: boolean + show?: boolean + }); + /** + * Determines if polylines in this collection will be shown. + */ + show: boolean; + /** + * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates. + When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. + */ + modelMatrix: Matrix4; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the primitive. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * Returns the number of polylines in this collection. This is commonly used with + {@link PolylineCollection#get} to iterate over all the polylines + in the collection. + */ + length: number; + /** + * Creates and adds a polyline with the specified initial properties to the collection. + The added polyline is returned so it can be modified or removed from the collection later. + * @example + * // Example 1: Add a polyline, specifying all the default values. + var p = polylines.add({ + show : true, + positions : ellipsoid.cartographicArrayToCartesianArray([ + * Cesium.Cartographic.fromDegrees(-75.10, 39.57), + * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]), + width : 1 + }); + * @param [options] - A template describing the polyline's properties as shown in Example 1. + * @returns The polyline that was added to the collection. + */ + add(options?: any): Polyline; + /** + * Removes a polyline from the collection. + * @example + * var p = polylines.add(...); + polylines.remove(p); // Returns true + * @param polyline - The polyline to remove. + * @returns <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection. + */ + remove(polyline: Polyline): boolean; + /** + * Removes all polylines from the collection. + * @example + * polylines.add(...); + polylines.add(...); + polylines.removeAll(); + */ + removeAll(): void; + /** + * Determines if this collection contains the specified polyline. + * @param polyline - The polyline to check for. + * @returns true if this collection contains the polyline, false otherwise. + */ + contains(polyline: Polyline): boolean; + /** + * Returns the polyline in the collection at the specified index. Indices are zero-based + and increase as polylines are added. Removing a polyline shifts all polylines after + it to the left, changing their indices. This function is commonly used with + {@link PolylineCollection#length} to iterate over all the polylines + in the collection. + * @example + * // Toggle the show property of every polyline in the collection + var len = polylines.length; + for (var i = 0; i < len; ++i) { + var p = polylines.get(i); + p.show = !p.show; + } + * @param index - The zero-based index of the polyline. + * @returns The polyline at the specified index. + */ + get(index: number): Polyline; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * polylines = polylines && polylines.destroy(); + */ + destroy(): void; +} + +/** + * An appearance for {@link GeometryInstance} instances with color attributes and +{@link PolylineGeometry} or {@link GroundPolylineGeometry}. +This allows several geometry instances, each with a different color, to +be drawn with the same {@link Primitive}. + * @example + * // A solid white line segment +var primitive = new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.PolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0 + ]), + width : 10.0, + vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT + }), + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0)) + } + }), + appearance : new Cesium.PolylineColorAppearance({ + translucent : false + }) +}); + * @param [options] - Object with the following properties: + * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled. + * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. + * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. + * @param [options.renderState] - Optional render state to override the default render state. + */ +export class PolylineColorAppearance { + constructor(options?: { + translucent?: boolean + vertexShaderSource?: string + fragmentShaderSource?: string + renderState?: any + }); + /** + * This property is part of the {@link Appearance} interface, but is not + used by {@link PolylineColorAppearance} since a fully custom fragment shader is used. + */ + material: Material; + /** + * When <code>true</code>, the geometry is expected to appear translucent so + {@link PolylineColorAppearance#renderState} has alpha blending enabled. + */ + translucent: boolean; + /** + * The GLSL source code for the vertex shader. + */ + readonly vertexShaderSource: string; + /** + * The GLSL source code for the fragment shader. + */ + readonly fragmentShaderSource: string; + /** + * The WebGL fixed-function state to use when rendering the geometry. + <p> + The render state can be explicitly defined when constructing a {@link PolylineColorAppearance} + instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}. + </p> + */ + readonly renderState: any; + /** + * When <code>true</code>, the geometry is expected to be closed so + {@link PolylineColorAppearance#renderState} has backface culling enabled. + This is always <code>false</code> for <code>PolylineColorAppearance</code>. + */ + readonly closed: boolean; + /** + * The {@link VertexFormat} that this appearance instance is compatible with. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. + */ + readonly vertexFormat: VertexFormat; + /** + * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances + are compatible with. This requires only a <code>position</code> attribute. + */ + static readonly VERTEX_FORMAT: VertexFormat; + /** + * Procedurally creates the full GLSL fragment shader source. + * @returns The full GLSL fragment shader source. + */ + getFragmentShaderSource(): string; + /** + * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}. + * @returns <code>true</code> if the appearance is translucent. + */ + isTranslucent(): boolean; + /** + * Creates a render state. This is not the final render state instance; instead, + it can contain a subset of render state properties identical to the render state + created in the context. + * @returns The render state. + */ + getRenderState(): any; +} + +/** + * An appearance for {@link PolylineGeometry} that supports shading with materials. + * @example + * var primitive = new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : new Cesium.PolylineGeometry({ + positions : Cesium.Cartesian3.fromDegreesArray([ + 0.0, 0.0, + 5.0, 0.0 + ]), + width : 10.0, + vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT + }) + }), + appearance : new Cesium.PolylineMaterialAppearance({ + material : Cesium.Material.fromType('Color') + }) +}); + * @param [options] - Object with the following properties: + * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled. + * @param [options.material = Material.ColorType] - The material used to determine the fragment color. + * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader. + * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader. + * @param [options.renderState] - Optional render state to override the default render state. + */ +export class PolylineMaterialAppearance { + constructor(options?: { + translucent?: boolean + material?: Material + vertexShaderSource?: string + fragmentShaderSource?: string + renderState?: any + }); + /** + * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance} + properties, this is not read-only, so an appearance's material can change on the fly. + */ + material: Material; + /** + * When <code>true</code>, the geometry is expected to appear translucent so + {@link PolylineMaterialAppearance#renderState} has alpha blending enabled. + */ + translucent: boolean; + /** + * The GLSL source code for the vertex shader. + */ + readonly vertexShaderSource: string; + /** + * The GLSL source code for the fragment shader. + */ + readonly fragmentShaderSource: string; + /** + * The WebGL fixed-function state to use when rendering the geometry. + <p> + The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance} + instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent} + and {@link PolylineMaterialAppearance#closed}. + </p> + */ + readonly renderState: any; + /** + * When <code>true</code>, the geometry is expected to be closed so + {@link PolylineMaterialAppearance#renderState} has backface culling enabled. + This is always <code>false</code> for <code>PolylineMaterialAppearance</code>. + */ + readonly closed: boolean; + /** + * The {@link VertexFormat} that this appearance instance is compatible with. + A geometry can have more vertex attributes and still be compatible - at a + potential performance cost - but it can't have less. + */ + readonly vertexFormat: VertexFormat; + /** + * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances + are compatible with. This requires <code>position</code> and <code>st</code> attributes. + */ + static readonly VERTEX_FORMAT: VertexFormat; + /** + * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance}, + this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}. + * @returns The full GLSL fragment shader source. + */ + getFragmentShaderSource(): string; + /** + * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}. + * @returns <code>true</code> if the appearance is translucent. + */ + isTranslucent(): boolean; + /** + * Creates a render state. This is not the final render state instance; instead, + it can contain a subset of render state properties identical to the render state + created in the context. + * @returns The render state. + */ + getRenderState(): any; +} + +/** + * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage. + * @example + * // Simple stage to change the color +var fs = + 'uniform sampler2D colorTexture;\n' + + 'varying vec2 v_textureCoordinates;\n' + + 'uniform float scale;\n' + + 'uniform vec3 offset;\n' + + 'void main() {\n' + + ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' + + ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' + + '}\n'; +scene.postProcessStages.add(new Cesium.PostProcessStage({ + fragmentShader : fs, + uniforms : { + scale : 1.1, + offset : function() { + return new Cesium.Cartesian3(0.1, 0.2, 0.3); + } + } +})); + * @example + * // Simple stage to change the color of what is selected. +// If czm_selected returns true, the current fragment belongs to geometry in the selected array. +var fs = + 'uniform sampler2D colorTexture;\n' + + 'varying vec2 v_textureCoordinates;\n' + + 'uniform vec4 highlight;\n' + + 'void main() {\n' + + ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' + + ' if (czm_selected()) {\n' + + ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' + + ' gl_FragColor = vec4(highlighted, 1.0);\n' + + ' } else { \n' + + ' gl_FragColor = color;\n' + + ' }\n' + + '}\n'; +var stage = scene.postProcessStages.add(new Cesium.PostProcessStage({ + fragmentShader : fs, + uniforms : { + highlight : function() { + return new Cesium.Color(1.0, 0.0, 0.0, 0.5); + } + } +})); +stage.selected = [cesium3DTileFeature]; + * @param options - An object with the following properties: + * @param options.fragmentShader - The fragment shader to use. The default <code>sampler2D</code> uniforms are <code>colorTexture</code> and <code>depthTexture</code>. The color texture is the output of rendering the scene or the previous stage. The depth texture is the output from rendering the scene. The shader should contain one or both uniforms. There is also a <code>vec2</code> varying named <code>v_textureCoordinates</code> that can be used to sample the textures. + * @param [options.uniforms] - An object whose properties will be used to set the shaders uniforms. The properties can be constant values or a function. A constant value can also be a URI, data URI, or HTML element to use as a texture. + * @param [options.textureScale = 1.0] - A number in the range (0.0, 1.0] used to scale the texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport. + * @param [options.forcePowerOfTwo = false] - Whether or not to force the texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions. + * @param [options.sampleMode = PostProcessStageSampleMode.NEAREST] - How to sample the input color texture. + * @param [options.pixelFormat = PixelFormat.RGBA] - The color pixel format of the output texture. + * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - The pixel data type of the output texture. + * @param [options.clearColor = Color.BLACK] - The color to clear the output texture to. + * @param [options.scissorRectangle] - The rectangle to use for the scissor test. + * @param [options.name = createGuid()] - The unique name of this post-process stage for reference by other stages in a composite. If a name is not supplied, a GUID will be generated. + */ +export class PostProcessStage { + constructor(options: { + fragmentShader: string + uniforms?: any + textureScale?: number + forcePowerOfTwo?: boolean + sampleMode?: PostProcessStageSampleMode + pixelFormat?: PixelFormat + pixelDatatype?: PixelDatatype + clearColor?: Color + scissorRectangle?: BoundingRectangle + name?: string + }); + /** + * Whether or not to execute this post-process stage when ready. + */ + enabled: boolean; + /** + * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code> + and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures + to load. + */ + readonly ready: boolean; + /** + * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}. + */ + readonly name: string; + /** + * The fragment shader to use when execute this post-process stage. + <p> + The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>, + or both. + </p> + <p> + The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling + the texture uniforms. + </p> + */ + readonly fragmentShader: string; + /** + * An object whose properties are used to set the uniforms of the fragment shader. + <p> + The object property values can be either a constant or a function. The function will be called + each frame before the post-process stage is executed. + </p> + <p> + A constant value can also be a URI to an image, a data URI, or an HTML element that can be used as a texture, such as HTMLImageElement or HTMLCanvasElement. + </p> + <p> + If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be + the name of another stage in a composite. This will set the uniform to the output texture the stage with that name. + </p> + */ + readonly uniforms: any; + /** + * A number in the range (0.0, 1.0] used to scale the output texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport. + */ + readonly textureScale: number; + /** + * Whether or not to force the output texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions. + */ + readonly forcePowerOfTwo: number; + /** + * How to sample the input color texture. + */ + readonly sampleMode: PostProcessStageSampleMode; + /** + * The color pixel format of the output texture. + */ + readonly pixelFormat: PixelFormat; + /** + * The pixel data type of the output texture. + */ + readonly pixelDatatype: PixelDatatype; + /** + * The color to clear the output texture to. + */ + readonly clearColor: Color; + /** + * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test. + */ + readonly scissorRectangle: BoundingRectangle; + /** + * The features selected for applying the post-process. + <p> + In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process + stage to that fragment. For example: + <code> + if (czm_selected(v_textureCoordinates)) { + // apply post-process stage + } else { + gl_FragColor = texture2D(colorTexture, v_textureCordinates); + } + </code> + </p> + */ + selected: any[]; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + */ + destroy(): void; +} + +/** + * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s. +<p> +The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered +to by the previous stage in the collection. +</p> +<p> +If the ambient occlusion or bloom stages are enabled, they will execute before all other stages. +</p> +<p> +If the FXAA stage is enabled, it will execute after all other stages. +</p> + */ +export class PostProcessStageCollection { + constructor(); + /** + * Determines if all of the post-process stages in the collection are ready to be executed. + */ + readonly ready: boolean; + /** + * A post-process stage for Fast Approximate Anti-aliasing. + <p> + When enabled, this stage will execute after all others. + </p> + */ + readonly fxaa: PostProcessStage; + /** + * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture. + <p> + Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the + surface receives light and regardless of the light's position. + </p> + <p> + The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>, + <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>, + <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>. + </p> + <ul> + <li><code>intensity</code> is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is <code>3.0</code>.</li> + + <li><code>bias</code> is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value, + sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is <code>0.1</code>.</li> + + <li><code>lengthCap</code> is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value, + sampling stops in the current direction. The default value is <code>0.26</code>.</li> + + <li><code>stepSize</code> is a scalar value indicating the distance to the next texel sample in the current direction. The default value is <code>1.95</code>.</li> + + <li><code>frustumLength</code> is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment. + The default value is <code>1000.0</code>.</li> + + <li><code>ambientOcclusionOnly</code> is a boolean value. When <code>true</code>, only the shadows generated are written to the output. When <code>false</code>, the input texture is modulated + with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is <code>false</code>.</li> + </ul> + <p> + <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}. + The blur is applied to the shadows generated from the image to make them smoother. + </p> + <p> + When enabled, this stage will execute before all others. + </p> + */ + readonly ambientOcclusion: PostProcessStageComposite; + /** + * A post-process stage for a bloom effect. + <p> + A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker. + </p> + <p> + This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>, + <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>. + </p> + <ul> + <li><code>contrast</code> is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is <code>128.0</code>.</li> + + <li><code>brightness</code> is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is + added to the brightness. The default value is <code>-0.3</code>.</li> + + <li><code>glowOnly</code> is a boolean value. When <code>true</code>, only the glow effect will be shown. When <code>false</code>, the glow will be added to the input texture. + The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li> + </ul> + <p> + <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}. + The blur is applied to the shadows generated from the image to make them smoother. + </p> + <p> + When enabled, this stage will execute before all others. + </p> + */ + readonly bloom: PostProcessStageComposite; + /** + * The number of post-process stages in this collection. + */ + readonly length: number; + /** + * Adds the post-process stage to the collection. + * @param stage - The post-process stage to add to the collection. + * @returns The post-process stage that was added to the collection. + */ + add(stage: PostProcessStage | PostProcessStageComposite): PostProcessStage | PostProcessStageComposite; + /** + * Removes a post-process stage from the collection and destroys it. + * @param stage - The post-process stage to remove from the collection. + * @returns Whether the post-process stage was removed. + */ + remove(stage: PostProcessStage | PostProcessStageComposite): boolean; + /** + * Returns whether the collection contains a post-process stage. + * @param stage - The post-process stage. + * @returns Whether the collection contains the post-process stage. + */ + contains(stage: PostProcessStage | PostProcessStageComposite): boolean; + /** + * Gets the post-process stage at <code>index</code>. + * @param index - The index of the post-process stage. + * @returns The post-process stage at index. + */ + get(index: number): PostProcessStage | PostProcessStageComposite; + /** + * Removes all post-process stages from the collection and destroys them. + */ + removeAll(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + */ + destroy(): void; +} + +/** + * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically. +<p> +All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>. +If <code>inputPreviousStageTexture</code> is <code>true</code>, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. +If <code>inputPreviousStageTexture</code> is <code>false</code>, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene +or the output texture of the previous stage. +</p> + * @example + * // Example 1: separable blur filter +// The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage. +// The input to blurYDirection is the texture rendered to by blurXDirection. +scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ + stages : [blurXDirection, blurYDirection] +})); + * @example + * // Example 2: referencing the output of another post-process stage +scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ + inputPreviousStageTexture : false, + stages : [ + // The same as Example 1. + new Cesium.PostProcessStageComposite({ + inputPreviousStageTexture : true + stages : [blurXDirection, blurYDirection], + name : 'blur' + }), + // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false + new Cesium.PostProcessStage({ + fragmentShader : compositeShader, + uniforms : { + blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to). + } + }) + ] +}); + * @example + * // Example 3: create a uniform alias +var uniforms = {}; +Cesium.defineProperties(uniforms, { + filterSize : { + get : function() { + return blurXDirection.uniforms.filterSize; + }, + set : function(value) { + blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value; + } + } +}); +scene.postProcessStages.add(new Cesium.PostProcessStageComposite({ + stages : [blurXDirection, blurYDirection], + uniforms : uniforms +})); + * @param options - An object with the following properties: + * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order. + * @param [options.inputPreviousStageTexture = true] - Whether to execute each post-process stage where the input to one stage is the output of the previous. Otherwise, the input to each contained stage is the output of the stage that executed before the composite. + * @param [options.name = createGuid()] - The unique name of this post-process stage for reference by other composites. If a name is not supplied, a GUID will be generated. + * @param [options.uniforms] - An alias to the uniforms of post-process stages. + */ +export class PostProcessStageComposite { + constructor(options: { + stages: any[] + inputPreviousStageTexture?: boolean + name?: string + uniforms?: any + }); + /** + * Determines if this post-process stage is ready to be executed. + */ + readonly ready: boolean; + /** + * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite. + */ + readonly name: string; + /** + * Whether or not to execute this post-process stage when ready. + */ + enabled: boolean; + /** + * An alias to the uniform values of the post-process stages. May be <code>undefined</code>; in which case, get each stage to set uniform values. + */ + uniforms: any; + /** + * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>. + If <code>inputPreviousStageTexture</code> is <code>true</code>, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it. + If <code>inputPreviousStageTexture</code> is <code>false</code>, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene + or the output texture of the previous stage. + */ + readonly inputPreviousStageTexture: boolean; + /** + * The number of post-process stages in this composite. + */ + readonly length: number; + /** + * The features selected for applying the post-process. + */ + selected: any[]; + /** + * Gets the post-process stage at <code>index</code> + * @param index - The index of the post-process stage or composite. + * @returns The post-process stage or composite at index. + */ + get(index: number): PostProcessStage | PostProcessStageComposite; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + */ + destroy(): void; +} + +/** + * Contains functions for creating common post-process stages. + */ +export namespace PostProcessStageLibrary { + /** + * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage. + <p> + This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>. + </p> + <p> + <code>delta</code> and <code>sigma</code> are used to compute the weights of a Gaussian filter. The equation is <code>exp((-0.5 * delta * delta) / (sigma * sigma))</code>. + The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>. + <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>. + </p> + * @returns A post-process stage that applies a Gaussian blur to the input texture. + */ + function createBlurStage(): PostProcessStageComposite; + /** + * Creates a post-process stage that applies a depth of field effect. + <p> + Depth of field simulates camera focus. Objects in the scene that are in focus + will be clear whereas objects not in focus will be blurred. + </p> + <p> + This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>. + </p> + <p> + <code>focalDistance</code> is the distance in meters from the camera to set the camera focus. + </p> + <p> + <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}. + The blur is applied to the areas out of focus. + </p> + * @returns A post-process stage that applies a depth of field effect. + */ + function createDepthOfFieldStage(): PostProcessStageComposite; + /** + * Whether or not a depth of field stage is supported. + <p> + This stage requires the WEBGL_depth_texture extension. + </p> + * @param scene - The scene. + * @returns Whether this post process stage is supported. + */ + function isDepthOfFieldSupported(scene: Scene): boolean; + /** + * Creates a post-process stage that detects edges. + <p> + Writes the color to the output texture with alpha set to 1.0 when it is on an edge. + </p> + <p> + This stage has the following uniforms: <code>color</code> and <code>length</code> + </p> + <ul> + <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li> + <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li> + </ul> + <p> + This stage is not supported in 2D. + </p> + * @example + * // multiple silhouette effects + var yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage(); + yellowEdge.uniforms.color = Cesium.Color.YELLOW; + yellowEdge.selected = [feature0]; + + var greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage(); + greenEdge.uniforms.color = Cesium.Color.LIME; + greenEdge.selected = [feature1]; + + // draw edges around feature0 and feature1 + postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]); + * @returns A post-process stage that applies an edge detection effect. + */ + function createEdgeDetectionStage(): PostProcessStageComposite; + /** + * Whether or not an edge detection stage is supported. + <p> + This stage requires the WEBGL_depth_texture extension. + </p> + * @param scene - The scene. + * @returns Whether this post process stage is supported. + */ + function isEdgeDetectionSupported(scene: Scene): boolean; + /** + * Creates a post-process stage that applies a silhouette effect. + <p> + A silhouette effect composites the color from the edge detection pass with input color texture. + </p> + <p> + This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code> + </p> + <p> + <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}. + <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>. + </p> + * @param [edgeDetectionStages] - An array of edge detection post process stages. + * @returns A post-process stage that applies a silhouette effect. + */ + function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite; + /** + * Whether or not a silhouette stage is supported. + <p> + This stage requires the WEBGL_depth_texture extension. + </p> + * @param scene - The scene. + * @returns Whether this post process stage is supported. + */ + function isSilhouetteSupported(scene: Scene): boolean; + /** + * Whether or not an ambient occlusion stage is supported. + <p> + This stage requires the WEBGL_depth_texture extension. + </p> + * @param scene - The scene. + * @returns Whether this post process stage is supported. + */ + function isAmbientOcclusionSupported(scene: Scene): boolean; + /** + * Creates a post-process stage that renders the input texture with black and white gradations. + <p> + This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel. + </p> + * @returns A post-process stage that renders the input texture with black and white gradations. + */ + function createBlackAndWhiteStage(): PostProcessStage; + /** + * Creates a post-process stage that saturates the input texture. + <p> + This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel. + </p> + * @returns A post-process stage that saturates the input texture. + */ + function createBrightnessStage(): PostProcessStage; + /** + * Creates a post-process stage that adds a night vision effect to the input texture. + * @returns A post-process stage that adds a night vision effect to the input texture. + */ + function createNightVisionStage(): PostProcessStage; + /** + * Creates a post-process stage that applies an effect simulating light flaring a camera lens. + <p> + This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>, + <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>. + <ul> + <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li> + <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li> + <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li> + <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li> + <li><code>ghostDispersal</code> is a scalar indicating how far the halo effect is from the center of the texture. The default value is <code>0.4</code>.</li> + <li><code>haloWidth</code> is a scalar representing the width of the halo from the ghost dispersal. The default value is <code>0.4</code>.</li> + <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li> + <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li> + </ul> + </p> + * @returns A post-process stage for applying a lens flare effect. + */ + function createLensFlareStage(): PostProcessStage; +} + +/** + * Determines how input texture to a {@link PostProcessStage} is sampled. + */ +export enum PostProcessStageSampleMode { + /** + * Samples the texture by returning the closest texel. + */ + NEAREST = 0, + /** + * Samples the texture through bi-linear interpolation of the four nearest texels. + */ + LINEAR = 1 +} + +/** + * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance} +as shown in example 1 below, or from an array of instances, even if the geometry is from different +geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2. +<p> +A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including +{@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement, +and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix +and match most of them and add a new geometry or appearance independently of each other. +</p> +<p> +Combining multiple instances into one primitive is called batching, and significantly improves performance for static data. +Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using +per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color. +</p> +<p> +{@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples +show geometry that will be created on a web worker by using the descriptions of the geometry. The third example +shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method. +</p> + * @example + * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern +var instance = new Cesium.GeometryInstance({ + geometry : new Cesium.EllipseGeometry({ + center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0), + semiMinorAxis : 500000.0, + semiMajorAxis : 1000000.0, + rotation : Cesium.Math.PI_OVER_FOUR, + vertexFormat : Cesium.VertexFormat.POSITION_AND_ST + }), + id : 'object returned when this instance is picked and to get/set per-instance attributes' +}); +scene.primitives.add(new Cesium.Primitive({ + geometryInstances : instance, + appearance : new Cesium.EllipsoidSurfaceAppearance({ + material : Cesium.Material.fromType('Checkerboard') + }) +})); + * @example + * // 2. Draw different instances each with a unique color +var rectangleInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.RectangleGeometry({ + rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0), + vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT + }), + id : 'rectangle', + attributes : { + color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5) + } +}); +var ellipsoidInstance = new Cesium.GeometryInstance({ + geometry : new Cesium.EllipsoidGeometry({ + radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0), + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL + }), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()), + id : 'ellipsoid', + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) + } +}); +scene.primitives.add(new Cesium.Primitive({ + geometryInstances : [rectangleInstance, ellipsoidInstance], + appearance : new Cesium.PerInstanceColorAppearance() +})); + * @example + * // 3. Create the geometry on the main thread. +scene.primitives.add(new Cesium.Primitive({ + geometryInstances : new Cesium.GeometryInstance({ + geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({ + radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0), + vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL + })), + modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame( + Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()), + id : 'ellipsoid', + attributes : { + color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA) + } + }), + appearance : new Cesium.PerInstanceColorAppearance() +})); + * @param [options] - Object with the following properties: + * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render. + * @param [options.appearance] - The appearance used to render the primitive. + * @param [options.depthFailAppearance] - The appearance used to shade this primitive when it fails the depth test. + * @param [options.show = true] - Determines if this primitive will be shown. + * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates. + * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches. + * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time. + * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory. + * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory. + * @param [options.allowPicking = true] - When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. + * @param [options.cull = true] - When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands based on their bounding volume. Set this to <code>false</code> for a small performance gain if you are manually culling the primitive. + * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. + * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param [options.shadows = ShadowMode.DISABLED] - Determines whether this primitive casts or receives shadows from light sources. + */ +export class Primitive { + constructor(options?: { + geometryInstances?: GeometryInstance[] | GeometryInstance + appearance?: Appearance + depthFailAppearance?: Appearance + show?: boolean + modelMatrix?: Matrix4 + vertexCacheOptimize?: boolean + interleave?: boolean + compressVertices?: boolean + releaseGeometryInstances?: boolean + allowPicking?: boolean + cull?: boolean + asynchronous?: boolean + debugShowBoundingVolume?: boolean + shadows?: ShadowMode + }); + /** + * The geometry instances rendered with this primitive. This may + be <code>undefined</code> if <code>options.releaseGeometryInstances</code> + is <code>true</code> when the primitive is constructed. + <p> + Changing this property after the primitive is rendered has no effect. + </p> + */ + readonly geometryInstances: GeometryInstance[] | GeometryInstance; + /** + * The {@link Appearance} used to shade this primitive. Each geometry + instance is shaded with the same appearance. Some appearances, like + {@link PerInstanceColorAppearance} allow giving each instance unique + properties. + */ + appearance: Appearance; + /** + * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry + instance is shaded with the same appearance. Some appearances, like + {@link PerInstanceColorAppearance} allow giving each instance unique + properties. + + <p> + When using an appearance that requires a color attribute, like PerInstanceColorAppearance, + add a depthFailColor per-instance attribute instead. + </p> + + <p> + Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, + there may be artifacts. + </p> + */ + depthFailAppearance: Appearance; + /** + * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates. + When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates. + Local reference frames can be used by providing a different transformation matrix, like that returned + by {@link Transforms.eastNorthUpToFixedFrame}. + + <p> + This property is only supported in 3D mode. + </p> + * @example + * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0); + p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin); + */ + modelMatrix: Matrix4; + /** + * Determines if the primitive will be shown. This affects all geometry + instances in the primitive. + */ + show: boolean; + /** + * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands + based on their bounding volume. Set this to <code>false</code> for a small performance gain + if you are manually culling the primitive. + */ + cull: boolean; + /** + * This property is for debugging only; it is not for production use nor is it optimized. + <p> + Draws the bounding sphere for each draw command in the primitive. + </p> + */ + debugShowBoundingVolume: boolean; + /** + * Determines whether this primitive casts or receives shadows from light sources. + */ + shadows: ShadowMode; + /** + * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches. + */ + readonly vertexCacheOptimize: boolean; + /** + * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance. + */ + readonly interleave: boolean; + /** + * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory. + */ + readonly releaseGeometryInstances: boolean; + /** + * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. * + */ + readonly allowPicking: boolean; + /** + * Determines if the geometry instances will be created and batched on a web worker. + */ + readonly asynchronous: boolean; + /** + * When <code>true</code>, geometry vertices are compressed, which will save memory. + */ + readonly compressVertices: boolean; + /** + * Determines if the primitive is complete and ready to render. If this property is + true, the primitive will be rendered the next time that {@link Primitive#update} + is called. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves when the primitive is ready to render. + */ + readonly readyPromise: Promise<Primitive>; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns the modifiable per-instance attributes for a {@link GeometryInstance}. + * @example + * var attributes = primitive.getGeometryInstanceAttributes('an id'); + attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA); + attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true); + attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0); + attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY); + * @param id - The id of the {@link GeometryInstance}. + * @returns The typed array in the attribute's format or undefined if the is no instance with id. + */ + getGeometryInstanceAttributes(id: any): any; + /** + * Returns true if this object was destroyed; otherwise, false. + <p> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + </p> + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <p> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + </p> + * @example + * e = e && e.destroy(); + */ + destroy(): void; +} + +/** + * A collection of primitives. This is most often used with {@link Scene#primitives}, +but <code>PrimitiveCollection</code> is also a primitive itself so collections can +be added to collections forming a hierarchy. + * @example + * var billboards = new Cesium.BillboardCollection(); +var labels = new Cesium.LabelCollection(); + +var collection = new Cesium.PrimitiveCollection(); +collection.add(billboards); + +scene.primitives.add(collection); // Add collection +scene.primitives.add(labels); // Add regular primitive + * @param [options] - Object with the following properties: + * @param [options.show = true] - Determines if the primitives in the collection will be shown. + * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed. + */ +export class PrimitiveCollection { + constructor(options?: { + show?: boolean + destroyPrimitives?: boolean + }); + /** + * Determines if primitives in this collection will be shown. + */ + show: boolean; + /** + * Determines if primitives in the collection are destroyed when they are removed by + {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly + by {@link PrimitiveCollection#removeAll}. + * @example + * // Example 1. Primitives are destroyed by default. + var primitives = new Cesium.PrimitiveCollection(); + var labels = primitives.add(new Cesium.LabelCollection()); + primitives = primitives.destroy(); + var b = labels.isDestroyed(); // true + * @example + * // Example 2. Do not destroy primitives in a collection. + var primitives = new Cesium.PrimitiveCollection(); + primitives.destroyPrimitives = false; + var labels = primitives.add(new Cesium.LabelCollection()); + primitives = primitives.destroy(); + var b = labels.isDestroyed(); // false + labels = labels.destroy(); // explicitly destroy + */ + destroyPrimitives: boolean; + /** + * Gets the number of primitives in the collection. + */ + readonly length: number; + /** + * Adds a primitive to the collection. + * @example + * var billboards = scene.primitives.add(new Cesium.BillboardCollection()); + * @param primitive - The primitive to add. + * @param [index] - The index to add the layer at. If omitted, the primitive will be added at the bottom of all existing primitives. + * @returns The primitive added to the collection. + */ + add(primitive: any, index?: number): any; + /** + * Removes a primitive from the collection. + * @example + * var billboards = scene.primitives.add(new Cesium.BillboardCollection()); + scene.primitives.remove(billboards); // Returns true + * @param [primitive] - The primitive to remove. + * @returns <code>true</code> if the primitive was removed; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection. + */ + remove(primitive?: any): boolean; + /** + * Removes all primitives in the collection. + */ + removeAll(): void; + /** + * Determines if this collection contains a primitive. + * @param [primitive] - The primitive to check for. + * @returns <code>true</code> if the primitive is in the collection; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection. + */ + contains(primitive?: any): boolean; + /** + * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn + on the globe surface, this visually moves the primitive up one. + * @param [primitive] - The primitive to raise. + */ + raise(primitive?: any): void; + /** + * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn + on the globe surface, this visually moves the primitive to the top. + * @param [primitive] - The primitive to raise the top. + */ + raiseToTop(primitive?: any): void; + /** + * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn + on the globe surface, this visually moves the primitive down one. + * @param [primitive] - The primitive to lower. + */ + lower(primitive?: any): void; + /** + * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn + on the globe surface, this visually moves the primitive to the bottom. + * @param [primitive] - The primitive to lower to the bottom. + */ + lowerToBottom(primitive?: any): void; + /** + * Returns the primitive in the collection at the specified index. + * @example + * // Toggle the show property of every primitive in the collection. + var primitives = scene.primitives; + var length = primitives.length; + for (var i = 0; i < length; ++i) { + var p = primitives.get(i); + p.show = !p.show; + } + * @param index - The zero-based index of the primitive to return. + * @returns The primitive at the <code>index</code>. + */ + get(index: number): any; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this + collection allows for deterministic release of WebGL resources, instead of relying on the garbage + collector to destroy this collection. + <br /><br /> + Since destroying a collection destroys all the contained primitives, only destroy a collection + when you are sure no other code is still using any of the contained primitives. + <br /><br /> + Once this collection is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * primitives = primitives && primitives.destroy(); + */ + destroy(): void; +} + +/** + * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally, +a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}. +<p> +<em><code>contextOptions</code> parameter details:</em> +</p> +<p> +The default values are: +<code> +{ + webgl : { + alpha : false, + depth : true, + stencil : false, + antialias : true, + powerPreference: 'high-performance', + premultipliedAlpha : true, + preserveDrawingBuffer : false, + failIfMajorPerformanceCaveat : false + }, + allowTextureFilterAnisotropic : true +} +</code> +</p> +<p> +The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes} +object used to create the WebGL context. +</p> +<p> +<code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default +of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set +<code>webgl.alpha</code> to true. +</p> +<p> +The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}. +</p> +<p> +<code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the +WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views. +</p> + * @example + * // Create scene without anisotropic texture filtering +var scene = new Cesium.Scene({ + canvas : canvas, + contextOptions : { + allowTextureFilterAnisotropic : false + } +}); + * @param [options] - Object with the following properties: + * @param options.canvas - The HTML canvas element to create the scene for. + * @param [options.contextOptions] - Context and WebGL creation properties. See details above. + * @param [options.creditContainer] - The HTML element in which the credits will be displayed. + * @param [options.creditViewport] - The HTML element in which to display the credit popup. If not specified, the viewport will be a added as a sibling of the canvas. + * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes. + * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency. + * @param [options.scene3DOnly = false] - If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View. + * @param [options.terrainExaggeration = 1.0] - A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid. + * @param [options.shadows = false] - Determines if shadows are cast by light sources. + * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. + * @param [options.requestRenderMode = false] - If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + * @param [options.maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + */ +export class Scene { + constructor(options?: { + canvas: HTMLCanvasElement + contextOptions?: any + creditContainer?: Element + creditViewport?: Element + mapProjection?: MapProjection + orderIndependentTranslucency?: boolean + scene3DOnly?: boolean + terrainExaggeration?: number + shadows?: boolean + mapMode2D?: MapMode2D + requestRenderMode?: boolean + maximumRenderTimeChange?: number + }); + /** + * Exceptions occurring in <code>render</code> are always caught in order to raise the + <code>renderError</code> event. If this property is true, the error is rethrown + after the event is raised. If this property is false, the <code>render</code> function + returns normally after raising the event. + */ + rethrowRenderErrors: boolean; + /** + * Determines whether or not to instantly complete the + scene transition animation on user input. + */ + completeMorphOnUserInput: boolean; + /** + * The event fired at the beginning of a scene transition. + */ + morphStart: Event; + /** + * The event fired at the completion of a scene transition. + */ + morphComplete: Event; + /** + * The {@link SkyBox} used to draw the stars. + */ + skyBox: SkyBox; + /** + * The sky atmosphere drawn around the globe. + */ + skyAtmosphere: SkyAtmosphere; + /** + * The {@link Sun}. + */ + sun: Sun; + /** + * Uses a bloom filter on the sun when enabled. + */ + sunBloom: boolean; + /** + * The {@link Moon} + */ + moon: Moon; + /** + * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined. + */ + backgroundColor: Color; + /** + * The current morph transition time between 2D/Columbus View and 3D, + with 0.0 being 2D or Columbus View and 1.0 being 3D. + */ + morphTime: number; + /** + * The far-to-near ratio of the multi-frustum when using a normal depth buffer. + <p> + This value is used to create the near and far values for each frustum of the multi-frustum. It is only used + when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is + <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}. + </p> + */ + farToNearRatio: number; + /** + * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer. + <p> + This value is used to create the near and far values for each frustum of the multi-frustum. It is only used + when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is + <code>false</code>, use {@link Scene#farToNearRatio}. + </p> + */ + logarithmicDepthFarToNearRatio: number; + /** + * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close + to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the + other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface. + */ + nearToFarDistance2D: number; + /** + * This property is for debugging only; it is not for production use. + <p> + A function that determines what commands are executed. As shown in the examples below, + the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the + command should be executed. + </p> + <p> + The default is <code>undefined</code>, indicating that all commands are executed. + </p> + * @example + * // Do not execute any commands. + scene.debugCommandFilter = function(command) { + return false; + }; + + // Execute only the billboard's commands. That is, only draw the billboard. + var billboards = new Cesium.BillboardCollection(); + scene.debugCommandFilter = function(command) { + return command.owner === billboards; + }; + */ + debugCommandFilter: (...params: any[]) => any; + /** + * This property is for debugging only; it is not for production use. + <p> + When <code>true</code>, commands are randomly shaded. This is useful + for performance analysis to see what parts of a scene or model are + command-dense and could benefit from batching. + </p> + */ + debugShowCommands: boolean; + /** + * This property is for debugging only; it is not for production use. + <p> + When <code>true</code>, commands are shaded based on the frustums they + overlap. Commands in the closest frustum are tinted red, commands in + the next closest are green, and commands in the farthest frustum are + blue. If a command overlaps more than one frustum, the color components + are combined, e.g., a command overlapping the first two frustums is tinted + yellow. + </p> + */ + debugShowFrustums: boolean; + /** + * This property is for debugging only; it is not for production use. + <p> + Displays frames per second and time between frames. + </p> + */ + debugShowFramesPerSecond: boolean; + /** + * This property is for debugging only; it is not for production use. + <p> + Displays depth information for the indicated frustum. + </p> + */ + debugShowGlobeDepth: boolean; + /** + * This property is for debugging only; it is not for production use. + <p> + Indicates which frustum will have depth information displayed. + </p> + */ + debugShowDepthFrustum: number; + /** + * This property is for debugging only; it is not for production use. + <p> + When <code>true</code>, draws outlines to show the boundaries of the camera frustums + </p> + */ + debugShowFrustumPlanes: boolean; + /** + * When <code>true</code>, enables picking using the depth buffer. + */ + useDepthPicking: boolean; + /** + * When <code>true</code>, enables picking translucent geometry using the depth buffer. Note that {@link Scene#useDepthPicking} must also be true for enabling this to work. + + <p> + Render must be called between picks. + <br>There is a decrease in performance when enabled. There are extra draw calls to write depth for + translucent geometry. + </p> + * @example + * // picking the position of a translucent primitive + viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { + var pickedFeature = viewer.scene.pick(movement.position); + if (!Cesium.defined(pickedFeature)) { + // nothing picked + return; + } + viewer.scene.render(); + var worldPosition = viewer.scene.pickPosition(movement.position); + }, Cesium.ScreenSpaceEventType.LEFT_CLICK); + */ + pickTranslucentDepth: boolean; + /** + * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional + performance improvements by rendering less geometry and dispatching less terrain requests. + */ + fog: Fog; + /** + * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows. + */ + shadowMap: ShadowMap; + /** + * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and + unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}. + */ + invertClassification: boolean; + /** + * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>. + <p>When the color's alpha is less than 1.0, the unclassified portions of the 3D Tiles will not blend correctly with the classified positions of the 3D Tiles.</p> + <p>Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.</p> + */ + invertClassificationColor: Color; + /** + * The focal length for use when with cardboard or WebVR. + */ + focalLength: number; + /** + * The eye separation distance in meters for use with cardboard or WebVR. + */ + eyeSeparation: number; + /** + * Post processing effects applied to the final render. + */ + postProcessStages: PostProcessStageCollection; + /** + * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene. + Enabling improves performance of the application, but requires using {@link Scene#requestRender} + to render a new frame explicitly in this mode. This will be necessary in many cases after making changes + to the scene in other parts of the API. + */ + requestRenderMode: boolean; + /** + * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in + simulation time allowed before a render is requested. Lower values increase the number of frames rendered + and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to + the simulation time will never request a render. + This value impacts the rate of rendering for changes in the scene like lighting, entity property updates, + and animations. + */ + maximumRenderTimeChange: number; + /** + * The spherical harmonic coefficients for image-based lighting of PBR models. + */ + sphericalHarmonicCoefficients: Cartesian3[]; + /** + * The url to the KTX file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models. + */ + specularEnvironmentMaps: string; + /** + * The light source for shading. Defaults to a directional light from the Sun. + */ + light: Light; + /** + * Gets the canvas element to which this scene is bound. + */ + readonly canvas: HTMLCanvasElement; + /** + * The drawingBufferHeight of the underlying GL context. + */ + readonly drawingBufferHeight: number; + /** + * The drawingBufferHeight of the underlying GL context. + */ + readonly drawingBufferWidth: number; + /** + * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one. + */ + readonly maximumAliasedLineWidth: number; + /** + * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16. + */ + readonly maximumCubeMapSize: number; + /** + * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported. + */ + readonly pickPositionSupported: boolean; + /** + * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported. + */ + readonly sampleHeightSupported: boolean; + /** + * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported. + */ + readonly clampToHeightSupported: boolean; + /** + * Returns <code>true</code> if the {@link Scene#invertClassification} is supported. + */ + readonly invertClassificationSupported: boolean; + /** + * Returns <code>true</code> if specular environment maps are supported. + */ + readonly specularEnvironmentMapsSupported: boolean; + /** + * Gets or sets the depth-test ellipsoid. + */ + globe: Globe; + /** + * Gets the collection of primitives. + */ + readonly primitives: PrimitiveCollection; + /** + * Gets the collection of ground primitives. + */ + readonly groundPrimitives: PrimitiveCollection; + /** + * Gets or sets the camera. + */ + readonly camera: Camera; + /** + * Gets the controller for camera input handling. + */ + readonly screenSpaceCameraController: ScreenSpaceCameraController; + /** + * Get the map projection to use in 2D and Columbus View modes. + */ + readonly mapProjection: MapProjection; + /** + * Gets the collection of image layers that will be rendered on the globe. + */ + readonly imageryLayers: ImageryLayerCollection; + /** + * The terrain provider providing surface geometry for the globe. + */ + terrainProvider: TerrainProvider; + /** + * Gets an event that's raised when the terrain provider is changed + */ + readonly terrainProviderChanged: Event; + /** + * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event + receive the Scene instance as the first parameter and the current time as the second parameter. + */ + readonly preUpdate: Event; + /** + * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered. + Subscribers to the event receive the Scene instance as the first parameter and the current time as the second + parameter. + */ + readonly postUpdate: Event; + /** + * Gets the event that will be raised when an error is thrown inside the <code>render</code> function. + The Scene instance and the thrown error are the only two parameters passed to the event handler. + By default, errors are not rethrown after this event is raised, but that can be changed by setting + the <code>rethrowRenderErrors</code> property. + */ + readonly renderError: Event; + /** + * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered. + Subscribers to the event receive the Scene instance as the first parameter and the current time as the second + parameter. + */ + readonly preRender: Event; + /** + * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event + receive the Scene instance as the first parameter and the current time as the second parameter. + */ + readonly postRender: Event; + /** + * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been + rendered. + */ + readonly lastRenderTime: JulianDate; + /** + * This property is for debugging only; it is not for production use. + <p> + When {@link Scene.debugShowFrustums} is <code>true</code>, this contains + properties with statistics about the number of command execute per frustum. + <code>totalCommands</code> is the total number of commands executed, ignoring + overlap. <code>commandsInFrustums</code> is an array with the number of times + commands are executed redundantly, e.g., how many commands overlap two or + three frustums. + </p> + */ + readonly debugFrustumStatistics: any; + /** + * Gets whether or not the scene is optimized for 3D only viewing. + */ + readonly scene3DOnly: boolean; + /** + * Gets whether or not the scene has order independent translucency enabled. + Note that this only reflects the original construction option, and there are + other factors that could prevent OIT from functioning on a given system configuration. + */ + readonly orderIndependentTranslucency: boolean; + /** + * Gets the unique identifier for this scene. + */ + readonly id: string; + /** + * Gets or sets the current mode of the scene. + */ + mode: SceneMode; + /** + * Gets the scalar used to exaggerate the terrain. + */ + readonly terrainExaggeration: number; + /** + * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes. + Used for cardboard and WebVR. + */ + useWebVR: boolean; + /** + * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. + */ + readonly mapMode2D: MapMode2D; + /** + * Gets or sets the position of the Imagery splitter within the viewport. Valid values are between 0.0 and 1.0. + */ + imagerySplitPosition: number; + /** + * The distance from the camera at which to disable the depth test of billboards, labels and points + to, for example, prevent clipping against terrain. When set to zero, the depth test should always + be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance + property of a billboard, label or point will override this value. + */ + minimumDisableDepthTestDistance: number; + /** + * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum, + increasing performance. This property relies on fragmentDepth being supported. + */ + logarithmicDepthBuffer: boolean; + /** + * The value used for gamma correction. This is only used when rendering with high dynamic range. + */ + gamma: number; + /** + * Whether or not to use high dynamic range rendering. + */ + highDynamicRange: boolean; + /** + * Whether or not high dynamic range rendering is supported. + */ + readonly highDynamicRangeSupported: boolean; + /** + * Whether or not the camera is underneath the globe. + */ + readonly cameraUnderground: boolean; + /** + * Determines if a compressed texture format is supported. + * @param format - The texture format. May be the name of the format or the WebGL extension name, e.g. s3tc or WEBGL_compressed_texture_s3tc. + * @returns Whether or not the format is supported. + */ + getCompressedTextureFormatSupported(format: string): boolean; + /** + * Update and render the scene. It is usually not necessary to call this function + directly because {@link CesiumWidget} or {@link Viewer} do it automatically. + * @param [time] - The simulation time at which to render. + */ + render(time?: JulianDate): void; + /** + * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>. + The render rate will not exceed the {@link CesiumWidget#targetFrameRate}. + */ + requestRender(): void; + /** + * Returns an object with a `primitive` property that contains the first (top) primitive in the scene + at a particular window coordinate or undefined if nothing is at the location. Other properties may + potentially be set depending on the type of primitive and may be used to further identify the picked object. + <p> + When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object. + </p> + * @example + * // On mouse over, color the feature yellow. + handler.setInputAction(function(movement) { + var feature = scene.pick(movement.endPosition); + if (feature instanceof Cesium.Cesium3DTileFeature) { + feature.color = Cesium.Color.YELLOW; + } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + * @param windowPosition - Window coordinates to perform picking on. + * @param [width = 3] - Width of the pick rectangle. + * @param [height = 3] - Height of the pick rectangle. + * @returns Object containing the picked primitive. + */ + pick(windowPosition: Cartesian2, width?: number, height?: number): any; + /** + * Returns the cartesian position reconstructed from the depth buffer and window position. + <p> + The position reconstructed from the depth buffer in 2D may be slightly different from those + reconstructed in 3D and Columbus view. This is caused by the difference in the distribution + of depth values of perspective and orthographic projection. + </p> + <p> + Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of + translucent primitives; otherwise, this essentially picks through translucent primitives. + </p> + * @param windowPosition - Window coordinates to perform picking on. + * @param [result] - The object on which to restore the result. + * @returns The cartesian position. + */ + pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3; + /** + * Returns a list of objects, each containing a `primitive` property, for all primitives at + a particular window coordinate position. Other properties may also be set depending on the + type of primitive and may be used to further identify the picked object. The primitives in + the list are ordered by their visual order in the scene (front to back). + * @example + * var pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0)); + * @param windowPosition - Window coordinates to perform picking on. + * @param [limit] - If supplied, stop drilling after collecting this many picks. + * @param [width = 3] - Width of the pick rectangle. + * @param [height = 3] - Height of the pick rectangle. + * @returns Array of objects, each containing 1 picked primitives. + */ + drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[]; + /** + * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no + scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to + the globe, 3D Tiles, or primitives in the scene. + <p> + This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height + from all other primitives regardless of their visibility. + </p> + * @example + * var position = new Cesium.Cartographic(-1.31968, 0.698874); + var height = viewer.scene.sampleHeight(position); + console.log(height); + * @param position - The cartographic position to sample height from. + * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from. + * @param [width = 0.1] - Width of the intersection volume in meters. + * @returns The height. This may be <code>undefined</code> if there was no scene geometry to sample height from. + */ + sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number; + /** + * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the + clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp + objects to the globe, 3D Tiles, or primitives in the scene. + <p> + This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to + all other primitives regardless of their visibility. + </p> + * @example + * // Clamp an entity to the underlying scene geometry + var position = entity.position.getValue(Cesium.JulianDate.now()); + entity.position = viewer.scene.clampToHeight(position); + * @param cartesian - The cartesian position. + * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to. + * @param [width = 0.1] - Width of the intersection volume in meters. + * @param [result] - An optional object to return the clamped position. + * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. This may be <code>undefined</code> if there was no scene geometry to clamp to. + */ + clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3; + /** + * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions + using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored. + Returns a promise that is resolved when the query completes. Each point height is modified in place. + If a height cannot be determined because no geometry can be sampled at that location, or another error occurs, + the height is set to undefined. + * @example + * var positions = [ + new Cesium.Cartographic(-1.31968, 0.69887), + new Cesium.Cartographic(-1.10489, 0.83923) + ]; + var promise = viewer.scene.sampleHeightMostDetailed(positions); + promise.then(function(updatedPosition) { + // positions[0].height and positions[1].height have been updated. + // updatedPositions is just a reference to positions. + } + * @param positions - The cartographic positions to update with sampled heights. + * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from. + * @param [width = 0.1] - Width of the intersection volume in meters. + * @returns A promise that resolves to the provided list of positions when the query has completed. + */ + sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise<Cartographic[]>; + /** + * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions + using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when + the query completes. Each position is modified in place. If a position cannot be clamped because no geometry + can be sampled at that location, or another error occurs, the element in the array is set to undefined. + * @example + * var cartesians = [ + entities[0].position.getValue(Cesium.JulianDate.now()), + entities[1].position.getValue(Cesium.JulianDate.now()) + ]; + var promise = viewer.scene.clampToHeightMostDetailed(cartesians); + promise.then(function(updatedCartesians) { + entities[0].position = updatedCartesians[0]; + entities[1].position = updatedCartesians[1]; + } + * @param cartesians - The cartesian positions to update with clamped positions. + * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to. + * @param [width = 0.1] - Width of the intersection volume in meters. + * @returns A promise that resolves to the provided list of positions when the query has completed. + */ + clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise<Cartesian3[]>; + /** + * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an + HTML element at the same screen position as an object in the scene. + * @example + * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves. + var scene = widget.scene; + var ellipsoid = scene.globe.ellipsoid; + var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); + handler.setInputAction(function(movement) { + console.log(scene.cartesianToCanvasCoordinates(position)); + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + * @param position - The position in cartesian coordinates. + * @param [result] - An optional object to return the input position transformed to canvas coordinates. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid. + */ + cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2; + /** + * Instantly completes an active transition. + */ + completeMorph(): void; + /** + * Asynchronously transitions the scene to 2D. + * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete. + */ + morphTo2D(duration?: number): void; + /** + * Asynchronously transitions the scene to Columbus View. + * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete. + */ + morphToColumbusView(duration?: number): void; + /** + * Asynchronously transitions the scene to 3D. + * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete. + */ + morphTo3D(duration?: number): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * scene = scene && scene.destroy(); + */ + destroy(): void; +} + +/** + * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view. + */ +export enum SceneMode { + /** + * Morphing between mode, e.g., 3D to 2D. + */ + MORPHING = 0, + /** + * Columbus View mode. A 2.5D perspective view where the map is laid out + flat and objects with non-zero height are drawn above it. + */ + COLUMBUS_VIEW = 1, + /** + * 2D mode. The map is viewed top-down with an orthographic projection. + */ + SCENE2D = 2, + /** + * 3D mode. A traditional 3D perspective view of the globe. + */ + SCENE3D = 3 +} + +/** + * Functions that do scene-dependent transforms between rendering-related coordinate systems. + */ +export namespace SceneTransforms { + /** + * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an + HTML element at the same screen position as an object in the scene. + * @example + * // Output the window position of longitude/latitude (0, 0) every time the mouse moves. + var scene = widget.scene; + var ellipsoid = scene.globe.ellipsoid; + var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); + handler.setInputAction(function(movement) { + console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position)); + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + * @param scene - The scene. + * @param position - The position in WGS84 (world) coordinates. + * @param [result] - An optional object to return the input position transformed to window coordinates. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid. + */ + function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2; + /** + * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different + results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays. + * @example + * // Output the window position of longitude/latitude (0, 0) every time the mouse moves. + var scene = widget.scene; + var ellipsoid = scene.globe.ellipsoid; + var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0); + var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); + handler.setInputAction(function(movement) { + console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position)); + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); + * @param scene - The scene. + * @param position - The position in WGS84 (world) coordinates. + * @param [result] - An optional object to return the input position transformed to window coordinates. + * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid. + */ + function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2; +} + +/** + * Modifies the camera position and orientation based on mouse input to a canvas. + * @param scene - The scene. + */ +export class ScreenSpaceCameraController { + constructor(scene: Scene); + /** + * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom, + enableRotate, enableTilt, and enableLook. If false, all inputs are disabled. + + NOTE: This setting is for temporary use cases, such as camera flights and + drag-selection of regions (see Picking demo). It is typically set to false at the + start of such events, and set true on completion. To keep inputs disabled + past the end of camera flights, you must use the other booleans (enableTranslate, + enableZoom, enableRotate, enableTilt, and enableLook). + */ + enableInputs: boolean; + /** + * If true, allows the user to pan around the map. If false, the camera stays locked at the current position. + This flag only applies in 2D and Columbus view modes. + */ + enableTranslate: boolean; + /** + * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid. + */ + enableZoom: boolean; + /** + * If true, allows the user to rotate the world which translates the user's position. + This flag only applies in 2D and 3D. + */ + enableRotate: boolean; + /** + * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading. + This flag only applies in 3D and Columbus view. + */ + enableTilt: boolean; + /** + * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating + or rotating. This flag only applies in 3D and Columbus view modes. + */ + enableLook: boolean; + /** + * A parameter in the range <code>[0, 1)</code> used to determine how long + the camera will continue to spin because of inertia. + With value of zero, the camera will have no inertia. + */ + inertiaSpin: number; + /** + * A parameter in the range <code>[0, 1)</code> used to determine how long + the camera will continue to translate because of inertia. + With value of zero, the camera will have no inertia. + */ + inertiaTranslate: number; + /** + * A parameter in the range <code>[0, 1)</code> used to determine how long + the camera will continue to zoom because of inertia. + With value of zero, the camera will have no inertia. + */ + inertiaZoom: number; + /** + * A parameter in the range <code>[0, 1)</code> used to limit the range + of various user inputs to a percentage of the window width/height per animation frame. + This helps keep the camera under control in low-frame-rate situations. + */ + maximumMovementRatio: number; + /** + * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view. + */ + bounceAnimationTime: number; + /** + * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0. + */ + minimumZoomDistance: number; + /** + * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity. + */ + maximumZoomDistance: number; + /** + * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes. + <p> + The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code> + and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier}, + or an array of any of the preceding. + </p> + */ + translateEventTypes: CameraEventType | any[] | undefined; + /** + * The input that allows the user to zoom in/out. + <p> + The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code> + and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier}, + or an array of any of the preceding. + </p> + */ + zoomEventTypes: CameraEventType | any[] | undefined; + /** + * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes. + <p> + The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code> + and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier}, + or an array of any of the preceding. + </p> + */ + rotateEventTypes: CameraEventType | any[] | undefined; + /** + * The input that allows the user to tilt in 3D and Columbus view or twist in 2D. + <p> + The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code> + and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier}, + or an array of any of the preceding. + </p> + */ + tiltEventTypes: CameraEventType | any[] | undefined; + /** + * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes. + <p> + The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code> + and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier}, + or an array of any of the preceding. + </p> + */ + lookEventTypes: CameraEventType | any[] | undefined; + /** + * The minimum height the camera must be before picking the terrain instead of the ellipsoid. + */ + minimumPickingTerrainHeight: number; + /** + * The minimum height the camera must be before testing for collision with terrain. + */ + minimumCollisionTerrainHeight: number; + /** + * The minimum height the camera must be before switching from rotating a track ball to + free look when clicks originate on the sky or in space. + */ + minimumTrackBallHeight: number; + /** + * Enables or disables camera collision detection with terrain. + */ + enableCollisionDetection: boolean; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Removes mouse listeners held by this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * controller = controller && controller.destroy(); + */ + destroy(): void; +} + +/** + * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly. + +<p> +The normalOffset bias pushes the shadows forward slightly, and may be disabled +for applications that require ultra precise shadows. +</p> + * @param options - An object containing the following properties: + * @param options.lightCamera - A camera representing the light source. + * @param [options.enabled = true] - Whether the shadow map is enabled. + * @param [options.isPointLight = false] - Whether the light source is a point light. Point light shadows do not use cascades. + * @param [options.pointLightRadius = 100.0] - Radius of the point light. + * @param [options.cascadesEnabled = true] - Use multiple shadow maps to cover different partitions of the view frustum. + * @param [options.numberOfCascades = 4] - The number of cascades to use for the shadow map. Supported values are one and four. + * @param [options.maximumDistance = 5000.0] - The maximum distance used for generating cascaded shadows. Lower values improve shadow quality. + * @param [options.size = 2048] - The width and height, in pixels, of each shadow map. + * @param [options.softShadows = false] - Whether percentage-closer-filtering is enabled for producing softer shadows. + * @param [options.darkness = 0.3] - The shadow darkness. + * @param [options.normalOffset = true] - Whether a normal bias is applied to shadows. + */ +export class ShadowMap { + constructor(options: { + lightCamera: Camera + enabled?: boolean + isPointLight?: boolean + pointLightRadius?: boolean + cascadesEnabled?: boolean + numberOfCascades?: number + maximumDistance?: number + size?: number + softShadows?: boolean + darkness?: number + normalOffset?: boolean + }); + /** + * Determines the darkness of the shadows. + */ + darkness: number; + /** + * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows. + */ + maximumDistance: number; + /** + * Determines if the shadow map will be shown. + */ + enabled: boolean; + /** + * Determines if a normal bias will be applied to shadows. + */ + normalOffset: boolean; + /** + * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance. + */ + softShadows: boolean; + /** + * The width and height, in pixels, of each shadow map. + */ + size: number; +} + +/** + * Specifies whether the object casts or receives shadows from light sources when +shadows are enabled. + */ +export enum ShadowMode { + /** + * The object does not cast or receive shadows. + */ + DISABLED = 0, + /** + * The object casts and receives shadows. + */ + ENABLED = 1, + /** + * The object casts shadows only. + */ + CAST_ONLY = 2, + /** + * The object receives shadows only. + */ + RECEIVE_ONLY = 3 +} + +export namespace SingleTileImageryProvider { + /** + * Initialization options for the SingleTileImageryProvider constructor + * @property url - The url for the tile. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. + * @property [credit] - A credit for the data source, which is displayed on the canvas. + * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + */ + type ConstructorOptions = { + url: Resource | string + rectangle?: Rectangle + credit?: Credit | string + ellipsoid?: Ellipsoid + }; +} + +/** + * Provides a single, top-level imagery tile. The single image is assumed to use a +{@link GeographicTilingScheme}. + * @param options - Object describing initialization options + */ +export class SingleTileImageryProvider { + constructor(options: SingleTileImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the URL of the single, top-level imagery tile. + */ + readonly url: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link SingleTileImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Picking features is not currently supported by this imagery provider, so this function simply returns + undefined. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +/** + * An atmosphere drawn around the limb of the provided ellipsoid. Based on +{@link https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter16.html|Accurate Atmospheric Scattering} +in GPU Gems 2. +<p> +This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view. +</p> + * @example + * scene.skyAtmosphere = new Cesium.SkyAtmosphere(); + * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around. + */ +export class SkyAtmosphere { + constructor(ellipsoid?: Ellipsoid); + /** + * Determines if the atmosphere is shown. + */ + show: boolean; + /** + * Compute atmosphere per-fragment instead of per-vertex. + This produces better looking atmosphere with a slight performance penalty. + */ + perFragmentAtmosphere: boolean; + /** + * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). + A hue shift of 1.0 indicates a complete rotation of the hues available. + */ + hueShift: number; + /** + * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). + A saturation shift of -1.0 is monochrome. + */ + saturationShift: number; + /** + * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). + A brightness shift of -1.0 is complete darkness, which will let space show through. + */ + brightnessShift: number; + /** + * Gets the ellipsoid the atmosphere is drawn around. + */ + readonly ellipsoid: Ellipsoid; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy(); + */ + destroy(): void; +} + +/** + * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes. +<p> +This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of +the sky box must not exceed {@link Scene#maximumCubeMapSize}. +</p> + * @example + * scene.skyBox = new Cesium.SkyBox({ + sources : { + positiveX : 'skybox_px.png', + negativeX : 'skybox_nx.png', + positiveY : 'skybox_py.png', + negativeY : 'skybox_ny.png', + positiveZ : 'skybox_pz.png', + negativeZ : 'skybox_nz.png' + } +}); + * @param options - Object with the following properties: + * @param [options.sources] - The source URL or <code>Image</code> object for each of the six cube map faces. See the example below. + * @param [options.show = true] - Determines if this primitive will be shown. + */ +export class SkyBox { + constructor(options: { + sources?: any + show?: boolean + }); + /** + * The sources used to create the cube map faces: an object + with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>, + <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties. + These can be either URLs or <code>Image</code> objects. + */ + sources: any; + /** + * Determines if the sky box will be shown. + */ + show: boolean; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * skyBox = skyBox && skyBox.destroy(); + */ + destroy(): void; +} + +/** + * A ParticleEmitter that emits particles within a sphere. +Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere. + * @param [radius = 1.0] - The radius of the sphere in meters. + */ +export class SphereEmitter { + constructor(radius?: number); + /** + * The radius of the sphere in meters. + */ + radius: number; +} + +/** + * Determines the function used to compare stencil values for the stencil test. + */ +export enum StencilFunction { + /** + * The stencil test never passes. + */ + NEVER = WebGLConstants.NEVER, + /** + * The stencil test passes when the masked reference value is less than the masked stencil value. + */ + LESS = WebGLConstants.LESS, + /** + * The stencil test passes when the masked reference value is equal to the masked stencil value. + */ + EQUAL = WebGLConstants.EQUAL, + /** + * The stencil test passes when the masked reference value is less than or equal to the masked stencil value. + */ + LESS_OR_EQUAL = WebGLConstants.LEQUAL, + /** + * The stencil test passes when the masked reference value is greater than the masked stencil value. + */ + GREATER = WebGLConstants.GREATER, + /** + * The stencil test passes when the masked reference value is not equal to the masked stencil value. + */ + NOT_EQUAL = WebGLConstants.NOTEQUAL, + /** + * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value. + */ + GREATER_OR_EQUAL = WebGLConstants.GEQUAL, + /** + * The stencil test always passes. + */ + ALWAYS = WebGLConstants.ALWAYS +} + +/** + * Determines the action taken based on the result of the stencil test. + */ +export enum StencilOperation { + /** + * Sets the stencil buffer value to zero. + */ + ZERO = WebGLConstants.ZERO, + /** + * Does not change the stencil buffer. + */ + KEEP = WebGLConstants.KEEP, + /** + * Replaces the stencil buffer value with the reference value. + */ + REPLACE = WebGLConstants.REPLACE, + /** + * Increments the stencil buffer value, clamping to unsigned byte. + */ + INCREMENT = WebGLConstants.INCR, + /** + * Decrements the stencil buffer value, clamping to zero. + */ + DECREMENT = WebGLConstants.DECR, + /** + * Bitwise inverts the existing stencil buffer value. + */ + INVERT = WebGLConstants.INVERT, + /** + * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range. + */ + INCREMENT_WRAP = WebGLConstants.INCR_WRAP, + /** + * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero. + */ + DECREMENT_WRAP = WebGLConstants.DECR_WRAP +} + +/** + * An expression for a style applied to a {@link Cesium3DTileset}. +<p> +Derived classes of this interface evaluate expressions in the +{@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}. +</p> +<p> +This type describes an interface and is not intended to be instantiated directly. +</p> + */ +export class StyleExpression { + constructor(); + /** + * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of + the expression in the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language} + is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript + primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code> + object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>, + a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is + a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned. + * @param feature - The feature whose properties may be used as variables in the expression. + * @param [result] - The object onto which to store the result. + * @returns The result of evaluating the expression. + */ + evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color; + /** + * Evaluates the result of a Color expression, optionally using the provided feature's properties. + <p> + This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object. + </p> + * @param feature - The feature whose properties may be used as variables in the expression. + * @param [result] - The object in which to store the result. + * @returns The modified result parameter or a new Color instance if one was not provided. + */ + evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color; +} + +/** + * Draws a sun billboard. +<p>This is only supported in 3D and Columbus view.</p> + * @example + * scene.sun = new Cesium.Sun(); + */ +export class Sun { + constructor(); + /** + * Determines if the sun will be shown. + */ + show: boolean; + /** + * Gets or sets a number that controls how "bright" the Sun's lens flare appears + to be. Zero shows just the Sun's disc without any flare. + Use larger values for a more pronounced flare around the Sun. + */ + glowFactor: number; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * sun = sun && sun.destroy(); + + + */ + destroy(): void; +} + +/** + * A directional light source that originates from the Sun. + * @param [options] - Object with the following properties: + * @param [options.color = Color.WHITE] - The light's color. + * @param [options.intensity = 2.0] - The light's intensity. + */ +export class SunLight { + constructor(options?: { + color?: Color + intensity?: number + }); + /** + * The color of the light. + */ + color: Color; + /** + * The intensity of the light. + */ + intensity: number; +} + +export namespace TileCoordinatesImageryProvider { + /** + * Initialization options for the TileCoordinatesImageryProvider constructor + * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles. + * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. + * @property [color = Color.YELLOW] - The color to draw the tile box and label. + * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes. + * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes. + */ + type ConstructorOptions = { + tilingScheme?: TilingScheme + ellipsoid?: Ellipsoid + color?: Color + tileWidth?: number + tileHeight?: number + }; +} + +/** + * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws +a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for +debugging terrain and imagery rendering problems. + * @param [options] - Object describing initialization options + */ +export class TileCoordinatesImageryProvider { + constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage + and texture upload time. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link TileCoordinatesImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Picking features is not currently supported by this imagery provider, so this function simply returns + undefined. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +/** + * A policy for discarding tile images according to some criteria. This type describes an +interface and is not intended to be instantiated directly. + */ +export class TileDiscardPolicy { + constructor(); + /** + * Determines if the discard policy is ready to process images. + * @returns True if the discard policy is ready to process images; otherwise, false. + */ + isReady(): boolean; + /** + * Given a tile image, decide whether to discard that image. + * @param image - An image to test. + * @returns True if the image should be discarded; otherwise, false. + */ + shouldDiscardImage(image: HTMLImageElement): boolean; +} + +export namespace TileMapServiceImageryProvider { + /** + * Initialization options for the TileMapServiceImageryProvider constructor + * @property [url = '.'] - Path to image tiles on server. + * @property [fileExtension = 'png'] - The file extension for images on the server. + * @property [credit = ''] - A credit for the data source, which is displayed on the canvas. + * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying + this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely + to result in rendering problems. + * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. + * @property [tilingScheme] - The tiling scheme specifying how the ellipsoidal + surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} + is used. + * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. + * @property [tileWidth = 256] - Pixel width of image tiles. + * @property [tileHeight = 256] - Pixel height of image tiles. + * @property [flipXY] - Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml. + Specifying this option will do the same, allowing for loading of these incorrect tilesets. + */ + type ConstructorOptions = { + url?: Resource | string | Promise<Resource> | Promise<string> + fileExtension?: string + credit?: Credit | string + minimumLevel?: number + maximumLevel?: number + rectangle?: Rectangle + tilingScheme?: TilingScheme + ellipsoid?: Ellipsoid + tileWidth?: number + tileHeight?: number + flipXY?: boolean + }; +} + +/** + * An imagery provider that provides tiled imagery as generated by +{@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc. + * @example + * var tms = new Cesium.TileMapServiceImageryProvider({ + url : '../images/cesium_maptiler/Cesium_Logo_Color', + fileExtension: 'png', + maximumLevel: 4, + rectangle: new Cesium.Rectangle( + Cesium.Math.toRadians(-120.0), + Cesium.Math.toRadians(20.0), + Cesium.Math.toRadians(-60.0), + Cesium.Math.toRadians(40.0)) +}); + * @param options - Object describing initialization options + */ +export class TileMapServiceImageryProvider extends UrlTemplateImageryProvider { + constructor(options: TileMapServiceImageryProvider.ConstructorOptions); +} + +/** + * Provides functionality for ImageryProviders that have time dynamic imagery + * @param options - Object with the following properties: + * @param options.clock - A Clock instance that is used when determining the value for the time dimension. Required when <code>options.times</code> is specified. + * @param options.times - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values. + * @param options.requestImageFunction - A function that will request imagery tiles. + * @param options.reloadFunction - A function that will be called when all imagery tiles need to be reloaded. + */ +export class TimeDynamicImagery { + constructor(options: { + clock: Clock + times: TimeIntervalCollection + requestImageFunction: (...params: any[]) => any + reloadFunction: (...params: any[]) => any + }); + /** + * Gets or sets a clock that is used to get keep the time used for time dynamic parameters. + */ + clock: Clock; + /** + * Gets or sets a time interval collection. + */ + times: TimeIntervalCollection; + /** + * Gets the current interval. + */ + currentInterval: TimeInterval; + /** + * Gets the tile from the cache if its available. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if the tile is not in the cache. + */ + getFromCache(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement> | undefined; + /** + * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will + just add the tile to a list to preload when we approach the next interval. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + */ + checkApproachingInterval(x: number, y: number, level: number, request?: Request): void; +} + +/** + * Provides playback of time-dynamic point cloud data. +<p> +Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed. +If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently +small or the clock is sufficiently slow then no frames will be skipped. +</p> + * @param options - Object with the following properties: + * @param options.clock - A {@link Clock} instance that is used when determining the value for the time dimension. + * @param options.intervals - A {@link TimeIntervalCollection} with its data property being an object containing a <code>uri</code> to a 3D Tiles Point Cloud tile and an optional <code>transform</code>. + * @param [options.show = true] - Determines if the point cloud will be shown. + * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the point cloud. + * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the point cloud casts or receives shadows from light sources. + * @param [options.maximumMemoryUsage = 256] - The maximum amount of memory in MB that can be used by the point cloud. + * @param [options.shading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting. + * @param [options.style] - The style, defined using the {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, applied to each point in the point cloud. + * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud. + */ +export class TimeDynamicPointCloud { + constructor(options: { + clock: Clock + intervals: TimeIntervalCollection + show?: boolean + modelMatrix?: Matrix4 + shadows?: ShadowMode + maximumMemoryUsage?: number + shading?: any + style?: Cesium3DTileStyle + clippingPlanes?: ClippingPlaneCollection + }); + /** + * Determines if the point cloud will be shown. + */ + show: boolean; + /** + * A 4x4 transformation matrix that transforms the point cloud. + */ + modelMatrix: Matrix4; + /** + * Determines whether the point cloud casts or receives shadows from light sources. + <p> + Enabling shadows has a performance impact. A point cloud that casts shadows must be rendered twice, once from the camera and again from the light's point of view. + </p> + <p> + Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>. + </p> + */ + shadows: ShadowMode; + /** + * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames. + <p> + Frames that are not being loaded or rendered are unloaded to enforce this. + </p> + <p> + If decreasing this value results in unloading tiles, the tiles are unloaded the next frame. + </p> + */ + maximumMemoryUsage: number; + /** + * Options for controlling point size based on geometric error and eye dome lighting. + */ + shading: PointCloudShading; + /** + * The style, defined using the + {@link https://github.com/CesiumGS/3d-tiles/tree/master/specification/Styling|3D Tiles Styling language}, + applied to each point in the point cloud. + <p> + Assign <code>undefined</code> to remove the style, which will restore the visual + appearance of the point cloud to its default when no style was applied. + </p> + * @example + * pointCloud.style = new Cesium.Cesium3DTileStyle({ + color : { + conditions : [ + ['${Classification} === 0', 'color("purple", 0.5)'], + ['${Classification} === 1', 'color("red")'], + ['true', '${COLOR}'] + ] + }, + show : '${Classification} !== 2' + }); + */ + style: Cesium3DTileStyle; + /** + * The event fired to indicate that a frame failed to load. A frame may fail to load if the + request for its uri fails or processing fails due to invalid content. + <p> + If there are no event listeners, error messages will be logged to the console. + </p> + <p> + The error object passed to the listener contains two properties: + <ul> + <li><code>uri</code>: the uri of the failed frame.</li> + <li><code>message</code>: the error message.</li> + </ul> + * @example + * pointCloud.frameFailed.addEventListener(function(error) { + console.log('An error occurred loading frame: ' + error.uri); + console.log('Error: ' + error.message); + }); + */ + frameFailed: Event; + /** + * The event fired to indicate that a new frame was rendered. + <p> + The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener. + </p> + * @example + * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) { + viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere); + }); + */ + frameChanged: Event; + /** + * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud. + */ + clippingPlanes: ClippingPlaneCollection; + /** + * The total amount of GPU memory in bytes used by the point cloud. + */ + readonly totalMemoryUsageInBytes: number; + /** + * The bounding sphere of the frame being rendered. Returns <code>undefined</code> if no frame is being rendered. + */ + readonly boundingSphere: BoundingSphere; + /** + * Gets the promise that will be resolved when the point cloud renders a frame for the first time. + */ + readonly readyPromise: Promise<TimeDynamicPointCloud>; + /** + * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all + points to re-evaluate the style in the next frame. + */ + makeStyleDirty(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * pointCloud = pointCloud && pointCloud.destroy(); + */ + destroy(): void; +} + +export namespace UrlTemplateImageryProvider { + /** + * Initialization options for the UrlTemplateImageryProvider constructor + * @property [options] - Object with the following properties: + * @property url - The URL template to use to request tiles. It has the following keywords: + <ul> + <li><code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li> + <li><code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li> + <li><code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li> + <li><code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li> + <li><code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li> + <li><code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li> + <li><code>{reverseZ}</code>: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.</li> + <li><code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li> + <li><code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li> + <li><code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li> + <li><code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li> + <li><code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li> + <li><code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li> + <li><code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li> + <li><code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li> + <li><code>{width}</code>: The width of each tile in pixels.</li> + <li><code>{height}</code>: The height of each tile in pixels.</li> + </ul> + * @property [pickFeaturesUrl] - The URL template to use to pick features. If this property is not specified, + {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no + features picked. The URL template supports all of the keywords supported by the <code>url</code> + parameter, plus the following: + <ul> + <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li> + <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li> + <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li> + <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li> + <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li> + <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li> + <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li> + <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li> + <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li> + </ul> + * @property [urlSchemeZeroPadding] - Gets the URL scheme zero padding for each tile coordinate. The format is '000' where + each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting: + urlSchemeZeroPadding : { '{x}' : '0000'} + will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. + It the passed object has the following keywords: + <ul> + <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li> + <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li> + <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li> + <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li> + <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li> + <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li> + </ul> + * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template. + If this parameter is a single string, each character in the string is a subdomain. If it is + an array, each element in the array is a subdomain. + * @property [credit = ''] - A credit for the data source, which is displayed on the canvas. + * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying + this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely + to result in rendering problems. + * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image. + * @property [tilingScheme = WebMercatorTilingScheme] - The tiling scheme specifying how the ellipsoidal + surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme} + is used. + * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. + * @property [tileWidth = 256] - Pixel width of image tiles. + * @property [tileHeight = 256] - Pixel height of image tiles. + * @property [hasAlphaChannel = true] - true if the images provided by this imagery provider + include an alpha channel; otherwise, false. If this property is false, an alpha channel, if + present, will be ignored. If this property is true, any images without an alpha channel will + be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are potentially reduced. + * @property [getFeatureInfoFormats] - The formats in which to get feature information at a + specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this + parameter is not specified, feature picking is disabled. + * @property [enablePickFeatures = true] - If true, {@link UrlTemplateImageryProvider#pickFeatures} will + request the <code>pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false, + {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable + features) without communicating with the server. Set this property to false if you know your data + source does not support picking features or if you don't want this provider's features to be pickable. Note + that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures} + property. + * @property [customTags] - Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values. + */ + type ConstructorOptions = { + options?: Promise<object> | any + url: Resource | string + pickFeaturesUrl?: Resource | string + urlSchemeZeroPadding?: any + subdomains?: string | string[] + credit?: Credit | string + minimumLevel?: number + maximumLevel?: number + rectangle?: Rectangle + tilingScheme?: TilingScheme + ellipsoid?: Ellipsoid + tileWidth?: number + tileHeight?: number + hasAlphaChannel?: boolean + getFeatureInfoFormats?: GetFeatureInfoFormat[] + enablePickFeatures?: boolean + customTags?: any + }; +} + +/** + * Provides imagery by requesting tiles using a specified URL template. + * @example + * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project +var tms = new Cesium.UrlTemplateImageryProvider({ + url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg', + credit : '© Analytical Graphics, Inc.', + tilingScheme : new Cesium.GeographicTilingScheme(), + maximumLevel : 5 +}); +// Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme. +var positron = new Cesium.UrlTemplateImageryProvider({ + url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', + credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.' +}); +// Access a Web Map Service (WMS) server. +var wms = new Cesium.UrlTemplateImageryProvider({ + url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' + + 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' + + 'styles=&service=WMS&version=1.1.1&request=GetMap&' + + 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' + + 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' + + 'width=256&height=256', + rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013) +}); +// Using custom tags in your template url. +var custom = new Cesium.UrlTemplateImageryProvider({ + url : 'https://yoururl/{Time}/{z}/{y}/{x}.png', + customTags : { + Time: function(imageryProvider, x, y, level) { + return '20171231' + } + } +}); + * @param options - Object describing initialization options + */ +export class UrlTemplateImageryProvider { + constructor(options: UrlTemplateImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will + request the <code>options.pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false, + {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable + features) without communicating with the server. Set this property to false if you know your data + source does not support picking features or if you don't want this provider's features to be pickable. + */ + enablePickFeatures: boolean; + /** + * Gets the URL template to use to request tiles. It has the following keywords: + <ul> + <li> <code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li> + <li> <code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li> + <li> <code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li> + <li> <code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li> + <li> <code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li> + <li> <code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li> + <li> <code>{reverseZ}</code>: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.</li> + <li> <code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li> + <li> <code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li> + <li> <code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li> + <li> <code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li> + <li> <code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li> + <li> <code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li> + <li> <code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li> + <li> <code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li> + <li> <code>{width}</code>: The width of each tile in pixels.</li> + <li> <code>{height}</code>: The height of each tile in pixels.</li> + </ul> + */ + readonly url: string; + /** + * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on + the left with zeros to match the width of the passed string of zeros. e.g. Setting: + urlSchemeZeroPadding : { '{x}' : '0000'} + will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL. + It has the following keywords: + <ul> + <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li> + <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li> + <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li> + <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li> + <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li> + <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li> + </ul> + */ + readonly urlSchemeZeroPadding: any; + /** + * Gets the URL template to use to use to pick features. If this property is not specified, + {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no + features picked. The URL template supports all of the keywords supported by the + {@link UrlTemplateImageryProvider#url} property, plus the following: + <ul> + <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li> + <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li> + <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li> + <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li> + <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li> + <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li> + <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li> + <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li> + <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li> + </ul> + */ + readonly pickFeaturesUrl: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link UrlTemplateImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link UrlTemplateImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit. + This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link UrlTemplateImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link UrlTemplateImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link UrlTemplateImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link UrlTemplateImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. This function should + not be called before {@link ImageryProvider#ready} returns true. + */ + readonly hasAlphaChannel: boolean; + /** + * Reinitializes this instance. Reinitializing an instance already in use is supported, but it is not + recommended because existing tiles provided by the imagery provider will not be updated. + * @param options - Any of the options that may be passed to the {@link UrlTemplateImageryProvider} constructor. + */ + reinitialize(options: Promise<object> | any): void; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link UrlTemplateImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Asynchronously determines what features, if any, are located at a given longitude and latitude within + a tile. This function should not be called before {@link ImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +/** + * The vertical location of an origin relative to an object, e.g., a {@link Billboard} +or {@link Label}. For example, setting the vertical origin to <code>TOP</code> +or <code>BOTTOM</code> will display a billboard above or below (in screen space) +the anchor position. +<br /><br /> +<div align='center'> +<img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br /> +</div> + */ +export enum VerticalOrigin { + /** + * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>. + */ + CENTER = 0, + /** + * The origin is at the bottom of the object. + */ + BOTTOM = 1, + /** + * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object. + */ + BASELINE = 2, + /** + * The origin is at the top of the object. + */ + TOP = -1 +} + +/** + * A viewport aligned quad. + * @example + * var viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40)); +viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0); + * @param [rectangle] - The {@link BoundingRectangle} defining the quad's position within the viewport. + * @param [material] - The {@link Material} defining the surface appearance of the viewport quad. + */ +export class ViewportQuad { + constructor(rectangle?: BoundingRectangle, material?: Material); + /** + * Determines if the viewport quad primitive will be shown. + */ + show: boolean; + /** + * The BoundingRectangle defining the quad's position within the viewport. + * @example + * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40); + */ + rectangle: BoundingRectangle; + /** + * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with + {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}. + <p> + The default material is <code>Material.ColorType</code>. + </p> + * @example + * // 1. Change the color of the default material to yellow + viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); + + // 2. Change material to horizontal stripes + viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType); + */ + material: Material; + /** + * Called when {@link Viewer} or {@link CesiumWidget} render the scene to + get the draw commands needed to render this primitive. + <p> + Do not call this function directly. This is documented just to + list the exceptions that may be propagated when the scene is rendered: + </p> + */ + update(): void; + /** + * Returns true if this object was destroyed; otherwise, false. + <br /><br /> + If this object was destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. + * @returns True if this object was destroyed; otherwise, false. + */ + isDestroyed(): boolean; + /** + * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic + release of WebGL resources, instead of relying on the garbage collector to destroy this object. + <br /><br /> + Once an object is destroyed, it should not be used; calling any function other than + <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore, + assign the return value (<code>undefined</code>) to the object as done in the example. + * @example + * quad = quad && quad.destroy(); + */ + destroy(): void; +} + +export namespace WebMapServiceImageryProvider { + /** + * Initialization options for the WebMapServiceImageryProvider constructor + * @property url - The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}. + * @property layers - The layers to include, separated by commas. + * @property [parameters = WebMapServiceImageryProvider.DefaultParameters] - Additional parameters to pass to the WMS server in the GetMap URL. + * @property [getFeatureInfoParameters = WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] - Additional parameters to pass to the WMS server in the GetFeatureInfo URL. + * @property [enablePickFeatures = true] - If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke + the GetFeatureInfo operation on the WMS server and return the features included in the response. If false, + {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features) + without communicating with the server. Set this property to false if you know your WMS server does not support + GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically + overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property. + * @property [getFeatureInfoFormats = WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats + in which to try WMS GetFeatureInfo requests. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. + * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles. + * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified, + this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither + parameter is specified, the WGS84 ellipsoid is used. + * @property [tileWidth = 256] - The width of each tile in pixels. + * @property [tileHeight = 256] - The height of each tile in pixels. + * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when + specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is + likely to result in rendering problems. + * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + If not specified, there is no limit. + * @property [crs] - CRS specification, for use with WMS specification >= 1.3.0. + * @property [srs] - SRS specification, for use with WMS specification 1.1.0 or 1.1.1 + * @property [credit] - A credit for the data source, which is displayed on the canvas. + * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template. + If this parameter is a single string, each character in the string is a subdomain. If it is + an array, each element in the array is a subdomain. + * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified. + * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values. + */ + type ConstructorOptions = { + url: Resource | string + layers: string + parameters?: any + getFeatureInfoParameters?: any + enablePickFeatures?: boolean + getFeatureInfoFormats?: GetFeatureInfoFormat[] + rectangle?: Rectangle + tilingScheme?: TilingScheme + ellipsoid?: Ellipsoid + tileWidth?: number + tileHeight?: number + minimumLevel?: number + maximumLevel?: number + crs?: string + srs?: string + credit?: Credit | string + subdomains?: string | string[] + clock?: Clock + times?: TimeIntervalCollection + }; +} + +/** + * Provides tiled imagery hosted by a Web Map Service (WMS) server. + * @example + * var provider = new Cesium.WebMapServiceImageryProvider({ + url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer', + layers : '0', + proxy: new Cesium.DefaultProxy('/proxy/') +}); + +viewer.imageryLayers.addImageryProvider(provider); + * @param options - Object describing initialization options + */ +export class WebMapServiceImageryProvider { + constructor(options: WebMapServiceImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the URL of the WMS server. + */ + readonly url: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the names of the WMS layers, separated by commas. + */ + readonly layers: string; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will + invoke the <code>GetFeatureInfo</code> service on the WMS server and attempt to interpret the features included in the response. If false, + {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable + features) without communicating with the server. Set this property to false if you know your data + source does not support picking features or if you don't want this provider's features to be pickable. + */ + enablePickFeatures: boolean; + /** + * Gets or sets a clock that is used to get keep the time used for time dynamic parameters. + */ + clock: Clock; + /** + * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each + TimeInterval is an object containing the keys and values of the properties that are used during + tile requests. + */ + times: TimeIntervalCollection; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link WebMapServiceImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Asynchronously determines what features, if any, are located at a given longitude and latitude within + a tile. This function should not be called before {@link ImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; + /** + * The default parameters to include in the WMS URL to obtain images. The values are as follows: + service=WMS + version=1.1.1 + request=GetMap + styles= + format=image/jpeg + */ + static readonly DefaultParameters: any; + /** + * The default parameters to include in the WMS URL to get feature information. The values are as follows: + service=WMS + version=1.1.1 + request=GetFeatureInfo + */ + static readonly GetFeatureInfoDefaultParameters: any; +} + +export namespace WebMapTileServiceImageryProvider { + /** + * Initialization options for the WebMapTileServiceImageryProvider constructor + * @property url - The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: {style}, {TileMatrixSet}, {TileMatrix}, {TileRow}, {TileCol}. The first two are optional if actual values are hardcoded or not required by the server. The {s} keyword may be used to specify subdomains. + * @property [format = 'image/jpeg'] - The MIME type for images to retrieve from the server. + * @property layer - The layer name for WMTS requests. + * @property style - The style name for WMTS requests. + * @property tileMatrixSetID - The identifier of the TileMatrixSet to use for WMTS requests. + * @property [tileMatrixLabels] - A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level. + * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified. + * @property [times] - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values. + * @property [dimensions] - A object containing static dimensions and their values. + * @property [tileWidth = 256] - The tile width in pixels. + * @property [tileHeight = 256] - The tile height in pixels. + * @property [tilingScheme] - The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet. + * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle covered by the layer. + * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. + * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit. + * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used. + * @property [credit] - A credit for the data source, which is displayed on the canvas. + * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template. + If this parameter is a single string, each character in the string is a subdomain. If it is + an array, each element in the array is a subdomain. + */ + type ConstructorOptions = { + url: Resource | string + format?: string + layer: string + style: string + tileMatrixSetID: string + tileMatrixLabels?: any[] + clock?: Clock + times?: TimeIntervalCollection + dimensions?: any + tileWidth?: number + tileHeight?: number + tilingScheme?: TilingScheme + rectangle?: Rectangle + minimumLevel?: number + maximumLevel?: number + ellipsoid?: Ellipsoid + credit?: Credit | string + subdomains?: string | string[] + }; +} + +/** + * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers. +This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding. + * @example + * // Example 1. USGS shaded relief tiles (KVP) +var shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({ + url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS', + layer : 'USGSShadedReliefOnly', + style : 'default', + format : 'image/jpeg', + tileMatrixSetID : 'default028mm', + // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...], + maximumLevel: 19, + credit : new Cesium.Credit('U. S. Geological Survey') +}); +viewer.imageryLayers.addImageryProvider(shadedRelief1); + * @example + * // Example 2. USGS shaded relief tiles (RESTful) +var shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({ + url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg', + layer : 'USGSShadedReliefOnly', + style : 'default', + format : 'image/jpeg', + tileMatrixSetID : 'default028mm', + maximumLevel: 19, + credit : new Cesium.Credit('U. S. Geological Survey') +}); +viewer.imageryLayers.addImageryProvider(shadedRelief2); + * @example + * // Example 3. NASA time dynamic weather data (RESTful) +var times = Cesium.TimeIntervalCollection.fromIso8601({ + iso8601: '2015-07-30/2017-06-16/P1D', + dataCallback: function dataCallback(interval, index) { + return { + Time: Cesium.JulianDate.toIso8601(interval.start) + }; + } +}); +var weather = new Cesium.WebMapTileServiceImageryProvider({ + url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png', + layer : 'AMSR2_Snow_Water_Equivalent', + style : 'default', + tileMatrixSetID : '2km', + maximumLevel : 5, + format : 'image/png', + clock: clock, + times: times, + credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS') +}); +viewer.imageryLayers.addImageryProvider(weather); + * @param options - Object describing initialization options + */ +export class WebMapTileServiceImageryProvider { + constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions); + /** + * The default alpha blending value of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultAlpha: number | undefined; + /** + * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultNightAlpha: number | undefined; + /** + * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and + 1.0 representing fully opaque. + */ + defaultDayAlpha: number | undefined; + /** + * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 + makes the imagery darker while greater than 1.0 makes it brighter. + */ + defaultBrightness: number | undefined; + /** + * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces + the contrast while greater than 1.0 increases it. + */ + defaultContrast: number | undefined; + /** + * The default hue of this provider in radians. 0.0 uses the unmodified imagery color. + */ + defaultHue: number | undefined; + /** + * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the + saturation while greater than 1.0 increases it. + */ + defaultSaturation: number | undefined; + /** + * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color. + */ + defaultGamma: number | undefined; + /** + * The default texture minification filter to apply to this provider. + */ + defaultMinificationFilter: TextureMinificationFilter; + /** + * The default texture magnification filter to apply to this provider. + */ + defaultMagnificationFilter: TextureMagnificationFilter; + /** + * Gets the URL of the service hosting the imagery. + */ + readonly url: string; + /** + * Gets the proxy used by this provider. + */ + readonly proxy: Proxy; + /** + * Gets the width of each tile, in pixels. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + */ + readonly tileWidth: number; + /** + * Gets the height of each tile, in pixels. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + */ + readonly tileHeight: number; + /** + * Gets the maximum level-of-detail that can be requested. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + */ + readonly maximumLevel: number | undefined; + /** + * Gets the minimum level-of-detail that can be requested. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + */ + readonly minimumLevel: number; + /** + * Gets the tiling scheme used by this provider. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + */ + readonly tilingScheme: TilingScheme; + /** + * Gets the rectangle, in radians, of the imagery provided by this instance. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + */ + readonly rectangle: Rectangle; + /** + * Gets the tile discard policy. If not undefined, the discard policy is responsible + for filtering out "missing" tiles via its shouldDiscardImage function. If this function + returns undefined, no tiles are filtered. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + */ + readonly tileDiscardPolicy: TileDiscardPolicy; + /** + * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing + to the event, you will be notified of the error and can potentially recover from it. Event listeners + are passed an instance of {@link TileProviderError}. + */ + readonly errorEvent: Event; + /** + * Gets the mime type of images returned by this imagery provider. + */ + readonly format: string; + /** + * Gets a value indicating whether or not the provider is ready for use. + */ + readonly ready: boolean; + /** + * Gets a promise that resolves to true when the provider is ready for use. + */ + readonly readyPromise: Promise<boolean>; + /** + * Gets the credit to display when this imagery provider is active. Typically this is used to credit + the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + */ + readonly credit: Credit; + /** + * Gets a value indicating whether or not the images provided by this imagery provider + include an alpha channel. If this property is false, an alpha channel, if present, will + be ignored. If this property is true, any images without an alpha channel will be treated + as if their alpha is 1.0 everywhere. When this property is false, memory usage + and texture upload time are reduced. + */ + readonly hasAlphaChannel: boolean; + /** + * Gets or sets a clock that is used to get keep the time used for time dynamic parameters. + */ + clock: Clock; + /** + * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each + TimeInterval is an object containing the keys and values of the properties that are used during + tile requests. + */ + times: TimeIntervalCollection; + /** + * Gets or sets an object that contains static dimensions and their values. + */ + dimensions: any; + /** + * Gets the credits to be displayed when a given tile is displayed. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level; + * @returns The credits to be displayed when the tile is displayed. + */ + getTileCredits(x: number, y: number, level: number): Credit[]; + /** + * Requests the image for a given tile. This function should + not be called before {@link WebMapTileServiceImageryProvider#ready} returns true. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param [request] - The request object. Intended for internal use only. + * @returns A promise for the image that will resolve when the image is available, or + undefined if there are too many active requests to the server, and the request + should be retried later. The resolved image may be either an + Image or a Canvas DOM object. + */ + requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined; + /** + * Picking features is not currently supported by this imagery provider, so this function simply returns + undefined. + * @param x - The tile X coordinate. + * @param y - The tile Y coordinate. + * @param level - The tile level. + * @param longitude - The longitude at which to pick features. + * @param latitude - The latitude at which to pick features. + * @returns A promise for the picked features that will resolve when the asynchronous + picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo} + instances. The array may be empty if no features are found at the given location. + It may also be undefined if picking is not supported. + */ + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined; +} + +/** + * <span style="display: block; text-align: center;"> +<img src="Images/AnimationWidget.png" width="211" height="142" alt="" /> +<br />Animation widget +</span> +<br /><br /> +The Animation widget provides buttons for play, pause, and reverse, along with the +current time and date, surrounded by a "shuttle ring" for controlling the speed of animation. +<br /><br /> +The "shuttle ring" concept is borrowed from video editing, where typically a +"jog wheel" can be rotated to move past individual animation frames very slowly, and +a surrounding shuttle ring can be twisted to control direction and speed of fast playback. +Cesium typically treats time as continuous (not broken into pre-defined animation frames), +so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and +very slow playback. Click and drag the shuttle ring pointer itself (shown above in green), +or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction. +<br /><br /> +The Animation widget also provides a "realtime" button (in the upper-left) that keeps +animation time in sync with the end user's system clock, typically displaying +"today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or +{@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime. + * @example + * // In HTML head, include a link to Animation.css stylesheet, +// and in the body, include: <div id="animationContainer"></div> + +var clock = new Cesium.Clock(); +var clockViewModel = new Cesium.ClockViewModel(clock); +var viewModel = new Cesium.AnimationViewModel(clockViewModel); +var widget = new Cesium.Animation('animationContainer', viewModel); + +function tick() { + clock.tick(); + Cesium.requestAnimationFrame(tick); +} +Cesium.requestAnimationFrame(tick); + * @param container - The DOM element or ID that will contain the widget. + * @param viewModel - The view model used by this widget. + */ +export class Animation { + constructor(container: Element | string, viewModel: AnimationViewModel); + /** + * Gets the parent container. + */ + readonly container: Element; + /** + * Gets the view model. + */ + readonly viewModel: AnimationViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the animation widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; + /** + * Resizes the widget to match the container size. + This function should be called whenever the container size is changed. + */ + resize(): void; + /** + * Updates the widget to reflect any modified CSS rules for theming. + * @example + * //Switch to the cesium-lighter theme. + document.body.className = 'cesium-lighter'; + animation.applyThemeChanges(); + */ + applyThemeChanges(): void; +} + +/** + * The view model for the {@link Animation} widget. + * @param clockViewModel - The ClockViewModel instance to use. + */ +export class AnimationViewModel { + constructor(clockViewModel: ClockViewModel); + /** + * Gets or sets whether the shuttle ring is currently being dragged. This property is observable. + */ + shuttleRingDragging: boolean; + /** + * Gets or sets whether dragging the shuttle ring should cause the multiplier + to snap to the defined tick values rather than interpolating between them. + This property is observable. + */ + snapToTicks: boolean; + /** + * Gets the string representation of the current time. This property is observable. + */ + timeLabel: string; + /** + * Gets the string representation of the current date. This property is observable. + */ + dateLabel: string; + /** + * Gets the string representation of the current multiplier. This property is observable. + */ + multiplierLabel: string; + /** + * Gets or sets the current shuttle ring angle. This property is observable. + */ + shuttleRingAngle: number; + /** + * Gets or sets the default date formatter used by new instances. + */ + static defaultDateFormatter: AnimationViewModel.DateFormatter; + /** + * Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring. + */ + static defaultTicks: number[]; + /** + * Gets or sets the default time formatter used by new instances. + */ + static defaultTimeFormatter: AnimationViewModel.TimeFormatter; + /** + * Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring. + * @returns The array of known clock multipliers associated with the shuttle ring. + */ + getShuttleRingTicks(): number[]; + /** + * Sets the array of positive known clock multipliers to associate with the shuttle ring. + These values will have negative equivalents created for them and sets both the minimum + and maximum range of values for the shuttle ring as well as the values that are snapped + to when a single click is made. The values need not be in order, as they will be sorted + automatically, and duplicate values will be removed. + * @param positiveTicks - The list of known positive clock multipliers to associate with the shuttle ring. + */ + setShuttleRingTicks(positiveTicks: number[]): void; + /** + * Gets a command that decreases the speed of animation. + */ + slower: Command; + /** + * Gets a command that increases the speed of animation. + */ + faster: Command; + /** + * Gets the clock view model. + */ + clockViewModel: ClockViewModel; + /** + * Gets the pause toggle button view model. + */ + pauseViewModel: ToggleButtonViewModel; + /** + * Gets the reverse toggle button view model. + */ + playReverseViewModel: ToggleButtonViewModel; + /** + * Gets the play toggle button view model. + */ + playForwardViewModel: ToggleButtonViewModel; + /** + * Gets the realtime toggle button view model. + */ + playRealtimeViewModel: ToggleButtonViewModel; + /** + * Gets or sets the function which formats a date for display. + */ + dateFormatter: AnimationViewModel.DateFormatter; + /** + * Gets or sets the function which formats a time for display. + */ + timeFormatter: AnimationViewModel.TimeFormatter; +} + +export namespace AnimationViewModel { + /** + * A function that formats a date for display. + * @param date - The date to be formatted + * @param viewModel - The AnimationViewModel instance requesting formatting. + */ + type DateFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string; + /** + * A function that formats a time for display. + * @param date - The date to be formatted + * @param viewModel - The AnimationViewModel instance requesting formatting. + */ + type TimeFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string; +} + +/** + * <span style="display: block; text-align: center;"> +<img src="Images/BaseLayerPicker.png" width="264" height="287" alt="" /> +<br />BaseLayerPicker with its drop-panel open. +</span> +<br /><br /> +The BaseLayerPicker is a single button widget that displays a panel of available imagery and +terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted +as the base layer of the imagery collection; removing the existing base. When terrain is selected, +it replaces the current terrain provider. Each item in the available providers list contains a name, +a representative icon, and a tooltip to display more information when hovered. The list is initially +empty, and must be configured before use, as illustrated in the below example. + * @example + * // In HTML head, include a link to the BaseLayerPicker.css stylesheet, +// and in the body, include: <div id="baseLayerPickerContainer" +// style="position:absolute;top:24px;right:24px;width:38px;height:38px;"></div> + +//Create the list of available providers we would like the user to select from. +//This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image. +var imageryViewModels = []; +imageryViewModels.push(new Cesium.ProviderViewModel({ + name : 'Open\u00adStreet\u00adMap', + iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'), + tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \ +map of the world.\nhttp://www.openstreetmap.org', + creationFunction : function() { + return new Cesium.OpenStreetMapImageryProvider({ + url : 'https://a.tile.openstreetmap.org/' + }); + } + })); + + imageryViewModels.push(new Cesium.ProviderViewModel({ + name : 'Earth at Night', + iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'), + tooltip : 'The lights of cities and villages trace the outlines of civilization \ +in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.', + creationFunction : function() { + return new Cesium.IonImageryProvider({ assetId: 3812 }); + } + })); + + imageryViewModels.push(new Cesium.ProviderViewModel({ + name : 'Natural Earth\u00a0II', + iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'), + tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/', + creationFunction : function() { + return new Cesium.TileMapServiceImageryProvider({ + url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + }); + } + })); + +//Create a CesiumWidget without imagery, if you haven't already done so. +var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false }); + +//Finally, create the baseLayerPicker widget using our view models. +var layers = cesiumWidget.imageryLayers; +var baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', { + globe : cesiumWidget.scene.globe, + imageryProviderViewModels : imageryViewModels +}); + * @param container - The parent HTML container node or ID for this widget. + * @param options - Object with the following properties: + * @param options.globe - The Globe to use. + * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery. + * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used. + * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain. + * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used. + */ +export class BaseLayerPicker { + constructor(container: Element | string, options: { + globe: Globe + imageryProviderViewModels?: ProviderViewModel[] + selectedImageryProviderViewModel?: ProviderViewModel + terrainProviderViewModels?: ProviderViewModel[] + selectedTerrainProviderViewModel?: ProviderViewModel + }); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: BaseLayerPickerViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link BaseLayerPicker}. + * @param options - Object with the following properties: + * @param options.globe - The Globe to use. + * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery. + * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used. + * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain. + * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used. + */ +export class BaseLayerPickerViewModel { + constructor(options: { + globe: Globe + imageryProviderViewModels?: ProviderViewModel[] + selectedImageryProviderViewModel?: ProviderViewModel + terrainProviderViewModels?: ProviderViewModel[] + selectedTerrainProviderViewModel?: ProviderViewModel + }); + /** + * Gets or sets an array of ProviderViewModel instances available for imagery selection. + This property is observable. + */ + imageryProviderViewModels: ProviderViewModel[]; + /** + * Gets or sets an array of ProviderViewModel instances available for terrain selection. + This property is observable. + */ + terrainProviderViewModels: ProviderViewModel[]; + /** + * Gets or sets whether the imagery selection drop-down is currently visible. + */ + dropDownVisible: boolean; + /** + * Gets the button tooltip. This property is observable. + */ + buttonTooltip: string; + /** + * Gets the button background image. This property is observable. + */ + buttonImageUrl: string; + /** + * Gets or sets the currently selected imagery. This property is observable. + */ + selectedImagery: ProviderViewModel; + /** + * Gets or sets the currently selected terrain. This property is observable. + */ + selectedTerrain: ProviderViewModel; + /** + * Gets the command to toggle the visibility of the drop down. + */ + toggleDropDown: Command; + /** + * Gets the globe. + */ + globe: Globe; +} + +/** + * A view model that represents each item in the {@link BaseLayerPicker}. + * @param options - The object containing all parameters. + * @param options.name - The name of the layer. + * @param options.tooltip - The tooltip to show when the item is moused over. + * @param options.iconUrl - An icon representing the layer. + * @param [options.category] - A category for the layer. + * @param options.creationFunction - A function or Command + that creates one or more providers which will be added to the globe when this item is selected. + */ +export class ProviderViewModel { + constructor(options: { + name: string + tooltip: string + iconUrl: string + category?: string + creationFunction: ProviderViewModel.CreationFunction | Command + }); + /** + * Gets the display name. This property is observable. + */ + name: string; + /** + * Gets the tooltip. This property is observable. + */ + tooltip: string; + /** + * Gets the icon. This property is observable. + */ + iconUrl: string; + /** + * Gets the Command that creates one or more providers which will be added to + the globe when this item is selected. + */ + readonly creationCommand: Command; + /** + * Gets the category + */ + readonly category: string; +} + +export namespace ProviderViewModel { + /** + * A function which creates one or more providers. + */ + type CreationFunction = () => ImageryProvider | TerrainProvider | ImageryProvider[] | TerrainProvider[]; +} + +/** + * Inspector widget to aid in debugging 3D Tiles + * @param container - The DOM element or ID that will contain the widget. + * @param scene - the Scene instance to use. + */ +export class Cesium3DTilesInspector { + constructor(container: Element | string, scene: Scene); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: Cesium3DTilesInspectorViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link Cesium3DTilesInspector}. + * @param scene - The scene instance to use. + * @param performanceContainer - The container for the performance display + */ +export class Cesium3DTilesInspectorViewModel { + constructor(scene: Scene, performanceContainer: HTMLElement); + /** + * Gets or sets the flag to enable performance display. This property is observable. + */ + performance: boolean; + /** + * Gets or sets the flag to show statistics. This property is observable. + */ + showStatistics: boolean; + /** + * Gets or sets the flag to show pick statistics. This property is observable. + */ + showPickStatistics: boolean; + /** + * Gets or sets the flag to show the inspector. This property is observable. + */ + inspectorVisible: boolean; + /** + * Gets or sets the flag to show the tileset section. This property is observable. + */ + tilesetVisible: boolean; + /** + * Gets or sets the flag to show the display section. This property is observable. + */ + displayVisible: boolean; + /** + * Gets or sets the flag to show the update section. This property is observable. + */ + updateVisible: boolean; + /** + * Gets or sets the flag to show the logging section. This property is observable. + */ + loggingVisible: boolean; + /** + * Gets or sets the flag to show the style section. This property is observable. + */ + styleVisible: boolean; + /** + * Gets or sets the flag to show the tile info section. This property is observable. + */ + tileDebugLabelsVisible: boolean; + /** + * Gets or sets the flag to show the optimization info section. This property is observable. + */ + optimizationVisible: boolean; + /** + * Gets or sets the JSON for the tileset style. This property is observable. + */ + styleString: string; + /** + * Gets the names of the properties in the tileset. This property is observable. + */ + readonly properties: string[]; + /** + * Gets or sets the flag to enable dynamic screen space error. This property is observable. + */ + dynamicScreenSpaceError: boolean; + /** + * Gets or sets the color blend mode. This property is observable. + */ + colorBlendMode: Cesium3DTileColorBlendMode; + /** + * Gets or sets the flag to enable picking. This property is observable. + */ + picking: boolean; + /** + * Gets or sets the flag to colorize tiles. This property is observable. + */ + colorize: boolean; + /** + * Gets or sets the flag to draw with wireframe. This property is observable. + */ + wireframe: boolean; + /** + * Gets or sets the flag to show bounding volumes. This property is observable. + */ + showBoundingVolumes: boolean; + /** + * Gets or sets the flag to show content volumes. This property is observable. + */ + showContentBoundingVolumes: boolean; + /** + * Gets or sets the flag to show request volumes. This property is observable. + */ + showRequestVolumes: boolean; + /** + * Gets or sets the flag to suspend updates. This property is observable. + */ + freezeFrame: boolean; + /** + * Gets or sets the flag to show debug labels only for the currently picked tile. This property is observable. + */ + showOnlyPickedTileDebugLabel: boolean; + /** + * Gets or sets the flag to show tile geometric error. This property is observable. + */ + showGeometricError: boolean; + /** + * Displays the number of commands, points, triangles and features used per tile. This property is observable. + */ + showRenderingStatistics: boolean; + /** + * Displays the memory used per tile. This property is observable. + */ + showMemoryUsage: boolean; + /** + * Gets or sets the flag to show the tile url. This property is observable. + */ + showUrl: boolean; + /** + * Gets or sets the maximum screen space error. This property is observable. + */ + maximumScreenSpaceError: number; + /** + * Gets or sets the dynamic screen space error density. This property is observable. + */ + dynamicScreenSpaceErrorDensity: number; + /** + * Gets or sets the dynamic screen space error density slider value. + This allows the slider to be exponential because values tend to be closer to 0 than 1. + This property is observable. + */ + dynamicScreenSpaceErrorDensitySliderValue: number; + /** + * Gets or sets the dynamic screen space error factor. This property is observable. + */ + dynamicScreenSpaceErrorFactor: number; + /** + * Gets or sets the flag to enable point cloud shading. This property is observable. + */ + pointCloudShading: boolean; + /** + * Gets or sets the geometric error scale. This property is observable. + */ + geometricErrorScale: number; + /** + * Gets or sets the maximum attenuation. This property is observable. + */ + maximumAttenuation: number; + /** + * Gets or sets the base resolution. This property is observable. + */ + baseResolution: number; + /** + * Gets or sets the flag to enable eye dome lighting. This property is observable. + */ + eyeDomeLighting: boolean; + /** + * Gets or sets the eye dome lighting strength. This property is observable. + */ + eyeDomeLightingStrength: number; + /** + * Gets or sets the eye dome lighting radius. This property is observable. + */ + eyeDomeLightingRadius: number; + /** + * Gets or sets the pick state + */ + pickActive: boolean; + /** + * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal. + This property is observable. + */ + skipLevelOfDetail: boolean; + /** + * Gets or sets the multiplier defining the minimum screen space error to skip. This property is observable. + */ + skipScreenSpaceErrorFactor: number; + /** + * Gets or sets the screen space error that must be reached before skipping levels of detail. This property is observable. + */ + baseScreenSpaceError: number; + /** + * Gets or sets the constant defining the minimum number of levels to skip when loading tiles. This property is observable. + */ + skipLevels: number; + /** + * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded. + This property is observable. + */ + immediatelyLoadDesiredLevelOfDetail: boolean; + /** + * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal. + This property is observable + */ + loadSiblings: boolean; + /** + * Gets the scene + */ + readonly scene: Scene; + /** + * Gets the performance container + */ + readonly performanceContainer: HTMLElement; + /** + * Gets the statistics text. This property is observable. + */ + readonly statisticsText: string; + /** + * Gets the pick statistics text. This property is observable. + */ + readonly pickStatisticsText: string; + /** + * Gets the available blend modes + */ + readonly colorBlendModes: object[]; + /** + * Gets the editor error message + */ + readonly editorError: string; + /** + * Gets or sets the tileset of the view model. + */ + tileset: Cesium3DTileset; + /** + * Gets the current feature of the view model. + */ + feature: Cesium3DTileFeature; + /** + * Gets the current tile of the view model + */ + tile: Cesium3DTile; + /** + * Toggles the pick tileset mode + */ + togglePickTileset(): void; + /** + * Toggles the inspector visibility + */ + toggleInspector(): void; + /** + * Toggles the visibility of the tileset section + */ + toggleTileset(): void; + /** + * Toggles the visibility of the display section + */ + toggleDisplay(): void; + /** + * Toggles the visibility of the update section + */ + toggleUpdate(): void; + /** + * Toggles the visibility of the logging section + */ + toggleLogging(): void; + /** + * Toggles the visibility of the style section + */ + toggleStyle(): void; + /** + * Toggles the visibility of the tile Debug Info section + */ + toggleTileDebugLabels(): void; + /** + * Toggles the visibility of the optimization section + */ + toggleOptimization(): void; + /** + * Trims tile cache + */ + trimTilesCache(): void; + /** + * Compiles the style in the style editor. + */ + compileStyle(): void; + /** + * Handles key press events on the style editor. + */ + styleEditorKeyPress(): void; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; + /** + * Generates an HTML string of the statistics + * @param tileset - The tileset + * @param isPick - Whether this is getting the statistics for the pick pass + * @returns The formatted statistics + */ + static getStatistics(tileset: Cesium3DTileset, isPick: boolean): string; +} + +/** + * Inspector widget to aid in debugging + * @param container - The DOM element or ID that will contain the widget. + * @param scene - The Scene instance to use. + */ +export class CesiumInspector { + constructor(container: Element | string, scene: Scene); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: CesiumInspectorViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link CesiumInspector}. + * @param scene - The scene instance to use. + * @param performanceContainer - The instance to use for performance container. + */ +export class CesiumInspectorViewModel { + constructor(scene: Scene, performanceContainer: Element); + /** + * Gets or sets the show frustums state. This property is observable. + */ + frustums: boolean; + /** + * Gets or sets the show frustum planes state. This property is observable. + */ + frustumPlanes: boolean; + /** + * Gets or sets the show performance display state. This property is observable. + */ + performance: boolean; + /** + * Gets or sets the shader cache text. This property is observable. + */ + shaderCacheText: string; + /** + * Gets or sets the show primitive bounding sphere state. This property is observable. + */ + primitiveBoundingSphere: boolean; + /** + * Gets or sets the show primitive reference frame state. This property is observable. + */ + primitiveReferenceFrame: boolean; + /** + * Gets or sets the filter primitive state. This property is observable. + */ + filterPrimitive: boolean; + /** + * Gets or sets the show tile bounding sphere state. This property is observable. + */ + tileBoundingSphere: boolean; + /** + * Gets or sets the filter tile state. This property is observable. + */ + filterTile: boolean; + /** + * Gets or sets the show wireframe state. This property is observable. + */ + wireframe: boolean; + /** + * Gets or sets the show globe depth state. This property is observable. + */ + globeDepth: boolean; + /** + * Gets or sets the show pick depth state. This property is observable. + */ + pickDepth: boolean; + /** + * Gets or sets the index of the depth frustum to display. This property is observable. + */ + depthFrustum: number; + /** + * Gets or sets the suspend updates state. This property is observable. + */ + suspendUpdates: boolean; + /** + * Gets or sets the show tile coordinates state. This property is observable. + */ + tileCoordinates: boolean; + /** + * Gets or sets the frustum statistic text. This property is observable. + */ + frustumStatisticText: string; + /** + * Gets or sets the selected tile information text. This property is observable. + */ + tileText: string; + /** + * Gets if a primitive has been selected. This property is observable. + */ + hasPickedPrimitive: boolean; + /** + * Gets if a tile has been selected. This property is observable + */ + hasPickedTile: boolean; + /** + * Gets if the picking primitive command is active. This property is observable. + */ + pickPrimitiveActive: boolean; + /** + * Gets if the picking tile command is active. This property is observable. + */ + pickTileActive: boolean; + /** + * Gets or sets if the cesium inspector drop down is visible. This property is observable. + */ + dropDownVisible: boolean; + /** + * Gets or sets if the general section is visible. This property is observable. + */ + generalVisible: boolean; + /** + * Gets or sets if the primitive section is visible. This property is observable. + */ + primitivesVisible: boolean; + /** + * Gets or sets if the terrain section is visible. This property is observable. + */ + terrainVisible: boolean; + /** + * Gets or sets the index of the depth frustum text. This property is observable. + */ + depthFrustumText: string; + /** + * Gets the scene to control. + */ + scene: Scene; + /** + * Gets the container of the PerformanceDisplay + */ + performanceContainer: Element; + /** + * Gets the command to toggle the visibility of the drop down. + */ + toggleDropDown: Command; + /** + * Gets the command to toggle the visibility of a BoundingSphere for a primitive + */ + showPrimitiveBoundingSphere: Command; + /** + * Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive + */ + showPrimitiveReferenceFrame: Command; + /** + * Gets the command to toggle a filter that renders only a selected primitive + */ + doFilterPrimitive: Command; + /** + * Gets the command to increment the depth frustum index to be shown + */ + incrementDepthFrustum: Command; + /** + * Gets the command to decrement the depth frustum index to be shown + */ + decrementDepthFrustum: Command; + /** + * Gets the command to toggle the visibility of tile coordinates + */ + showTileCoordinates: Command; + /** + * Gets the command to toggle the visibility of a BoundingSphere for a selected tile + */ + showTileBoundingSphere: Command; + /** + * Gets the command to toggle a filter that renders only a selected tile + */ + doFilterTile: Command; + /** + * Gets the command to expand and collapse the general section + */ + toggleGeneral: Command; + /** + * Gets the command to expand and collapse the primitives section + */ + togglePrimitives: Command; + /** + * Gets the command to expand and collapse the terrain section + */ + toggleTerrain: Command; + /** + * Gets the command to pick a primitive + */ + pickPrimitive: Command; + /** + * Gets the command to pick a tile + */ + pickTile: Command; + /** + * Gets the command to pick a tile + */ + selectParent: Command; + /** + * Gets the command to pick a tile + */ + selectNW: Command; + /** + * Gets the command to pick a tile + */ + selectNE: Command; + /** + * Gets the command to pick a tile + */ + selectSW: Command; + /** + * Gets the command to pick a tile + */ + selectSE: Command; + /** + * Gets or sets the current selected primitive + */ + primitive: Command; + /** + * Gets or sets the current selected tile + */ + tile: Command; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * A widget containing a Cesium scene. + * @example + * // For each example, include a link to CesiumWidget.css stylesheet in HTML head, +// and in the body, include: <div id="cesiumContainer"></div> + +//Widget with no terrain and default Bing Maps imagery provider. +var widget = new Cesium.CesiumWidget('cesiumContainer'); + +//Widget with ion imagery and Cesium World Terrain. +var widget = new Cesium.CesiumWidget('cesiumContainer', { + imageryProvider : Cesium.createWorldImagery(), + terrainProvider : Cesium.createWorldTerrain(), + skyBox : new Cesium.SkyBox({ + sources : { + positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg', + negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg', + positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg', + negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg', + positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg', + negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg' + } + }), + // Show Columbus View map with Web Mercator projection + sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, + mapProjection : new Cesium.WebMercatorProjection() +}); + * @param container - The DOM element or ID that will contain the widget. + * @param [options] - Object with the following properties: + * @param [options.clock = new Clock()] - The clock to use to control current time. + * @param [options.imageryProvider = createWorldImagery()] - The imagery provider to serve as the base layer. If set to <code>false</code>, no imagery provider will be added. + * @param [options.terrainProvider = new EllipsoidTerrainProvider] - The terrain provider. + * @param [options.skyBox] - The skybox used to render the stars. When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added. + * @param [options.skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off. + * @param [options.sceneMode = SceneMode.SCENE3D] - The initial scene mode. + * @param [options.scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory. + * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency. + * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes. + * @param [options.globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added. + * @param [options.useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise. + * @param [options.useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>. + * @param [options.targetFrameRate] - The target frame rate when using the default render loop. + * @param [options.showRenderLoopErrors = true] - If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs. + * @param [options.contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}. + * @param [options.creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added + to the bottom of the widget itself. + * @param [options.creditViewport] - The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. + * @param [options.terrainExaggeration = 1.0] - A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid. + * @param [options.shadows = false] - Determines if shadows are cast by light sources. + * @param [options.terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources. + * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. + * @param [options.requestRenderMode = false] - If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + * @param [options.maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + */ +export class CesiumWidget { + constructor(container: Element | string, options?: { + clock?: Clock + imageryProvider?: ImageryProvider | false + terrainProvider?: TerrainProvider + skyBox?: SkyBox | false + skyAtmosphere?: SkyAtmosphere | false + sceneMode?: SceneMode + scene3DOnly?: boolean + orderIndependentTranslucency?: boolean + mapProjection?: MapProjection + globe?: Globe | false + useDefaultRenderLoop?: boolean + useBrowserRecommendedResolution?: boolean + targetFrameRate?: number + showRenderLoopErrors?: boolean + contextOptions?: any + creditContainer?: Element | string + creditViewport?: Element | string + terrainExaggeration?: number + shadows?: boolean + terrainShadows?: ShadowMode + mapMode2D?: MapMode2D + requestRenderMode?: boolean + maximumRenderTimeChange?: number + }); + /** + * Gets the parent container. + */ + readonly container: Element; + /** + * Gets the canvas. + */ + readonly canvas: HTMLCanvasElement; + /** + * Gets the credit container. + */ + readonly creditContainer: Element; + /** + * Gets the credit viewport + */ + readonly creditViewport: Element; + /** + * Gets the scene. + */ + readonly scene: Scene; + /** + * Gets the collection of image layers that will be rendered on the globe. + */ + readonly imageryLayers: ImageryLayerCollection; + /** + * The terrain provider providing surface geometry for the globe. + */ + terrainProvider: TerrainProvider; + /** + * Gets the camera. + */ + readonly camera: Camera; + /** + * Gets the clock. + */ + readonly clock: Clock; + /** + * Gets the screen space event handler. + */ + readonly screenSpaceEventHandler: ScreenSpaceEventHandler; + /** + * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code> + is true. If undefined, the browser's {@link requestAnimationFrame} implementation + determines the frame rate. If defined, this value must be greater than 0. A value higher + than the underlying requestAnimationFrame implementation will have no effect. + */ + targetFrameRate: number; + /** + * Gets or sets whether or not this widget should control the render loop. + If set to true the widget will use {@link requestAnimationFrame} to + perform rendering and resizing of the widget, as well as drive the + simulation clock. If set to false, you must manually call the + <code>resize</code>, <code>render</code> methods as part of a custom + render loop. If an error occurs during rendering, {@link Scene}'s + <code>renderError</code> event will be raised and this property + will be set to false. It must be set back to true to continue rendering + after the error. + */ + useDefaultRenderLoop: boolean; + /** + * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve + performance on less powerful devices while values greater than 1.0 will render at a higher + resolution and then scale down, resulting in improved visual fidelity. + For example, if the widget is laid out at a size of 640x480, setting this value to 0.5 + will cause the scene to be rendered at 320x240 and then scaled up while setting + it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down. + */ + resolutionScale: number; + /** + * Boolean flag indicating if the browser's recommended resolution is used. + If true, the browser's device pixel ratio is ignored and 1.0 is used instead, + effectively rendering based on CSS pixels instead of device pixels. This can improve + performance on less powerful devices that have high pixel density. When false, rendering + will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether + this flag is true or false. + */ + useBrowserRecommendedResolution: boolean; + /** + * Show an error panel to the user containing a title and a longer error message, + which can be dismissed using an OK button. This panel is displayed automatically + when a render loop error occurs, if showRenderLoopErrors was not false when the + widget was constructed. + * @param title - The title to be displayed on the error panel. This string is interpreted as text. + * @param [message] - A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML. + * @param [error] - The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text. + */ + showErrorPanel(title: string, message?: string, error?: string): void; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; + /** + * Updates the canvas size, camera aspect ratio, and viewport size. + This function is called automatically as needed unless + <code>useDefaultRenderLoop</code> is set to false. + */ + resize(): void; + /** + * Renders the scene. This function is called automatically + unless <code>useDefaultRenderLoop</code> is set to false; + */ + render(): void; +} + +/** + * A view model which exposes a {@link Clock} for user interfaces. + * @param [clock] - The clock object wrapped by this view model, if undefined a new instance will be created. + */ +export class ClockViewModel { + constructor(clock?: Clock); + /** + * Gets the current system time. + This property is observable. + */ + systemTime: JulianDate; + /** + * Gets or sets the start time of the clock. + See {@link Clock#startTime}. + This property is observable. + */ + startTime: JulianDate; + /** + * Gets or sets the stop time of the clock. + See {@link Clock#stopTime}. + This property is observable. + */ + stopTime: JulianDate; + /** + * Gets or sets the current time. + See {@link Clock#currentTime}. + This property is observable. + */ + currentTime: JulianDate; + /** + * Gets or sets the clock multiplier. + See {@link Clock#multiplier}. + This property is observable. + */ + multiplier: number; + /** + * Gets or sets the clock step setting. + See {@link Clock#clockStep}. + This property is observable. + */ + clockStep: ClockStep; + /** + * Gets or sets the clock range setting. + See {@link Clock#clockRange}. + This property is observable. + */ + clockRange: ClockRange; + /** + * Gets or sets whether the clock can animate. + See {@link Clock#canAnimate}. + This property is observable. + */ + canAnimate: boolean; + /** + * Gets or sets whether the clock should animate. + See {@link Clock#shouldAnimate}. + This property is observable. + */ + shouldAnimate: boolean; + /** + * Gets the underlying Clock. + */ + clock: Clock; + /** + * Updates the view model with the contents of the underlying clock. + Can be called to force an update of the viewModel if the underlying + clock has changed and <code>Clock.tick</code> has not yet been called. + */ + synchronize(): void; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the view model. Should be called to + properly clean up the view model when it is no longer needed. + */ + destroy(): void; +} + +/** + * A Command is a function with an extra <code>canExecute</code> observable property to determine +whether the command can be executed. When executed, a Command function will check the +value of <code>canExecute</code> and throw if false. + +This type describes an interface and is not intended to be instantiated directly. +See {@link createCommand} to create a command from a function. + */ +export class Command { + constructor(); + /** + * Gets whether this command can currently be executed. This property is observable. + */ + canExecute: boolean; + /** + * Gets an event which is raised before the command executes, the event + is raised with an object containing two properties: a <code>cancel</code> property, + which if set to false by the listener will prevent the command from being executed, and + an <code>args</code> property, which is the array of arguments being passed to the command. + */ + beforeExecute: Event; + /** + * Gets an event which is raised after the command executes, the event + is raised with the return value of the command as its only parameter. + */ + afterExecute: Event; +} + +/** + * Create a Command from a given function, for use with ViewModels. + +A Command is a function with an extra <code>canExecute</code> observable property to determine +whether the command can be executed. When executed, a Command function will check the +value of <code>canExecute</code> and throw if false. It also provides events for when +a command has been or is about to be executed. + * @param func - The function to execute. + * @param [canExecute = true] - A boolean indicating whether the function can currently be executed. + */ +export function createCommand(func: (...params: any[]) => any, canExecute?: boolean): void; + +/** + * A single button widget for toggling fullscreen mode. + * @param container - The DOM element or ID that will contain the widget. + * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode. + */ +export class FullscreenButton { + constructor(container: Element | string, fullscreenElement?: Element | string); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: FullscreenButtonViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link FullscreenButton}. + * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode. + * @param [container] - The DOM element or ID that will contain the widget. + */ +export class FullscreenButtonViewModel { + constructor(fullscreenElement?: Element | string, container?: Element | string); + /** + * Gets whether or not fullscreen mode is active. This property is observable. + */ + isFullscreen: boolean; + /** + * Gets or sets whether or not fullscreen functionality should be enabled. This property is observable. + */ + isFullscreenEnabled: boolean; + /** + * Gets the tooltip. This property is observable. + */ + tooltip: string; + /** + * Gets or sets the HTML element to place into fullscreen mode when the + corresponding button is pressed. + */ + fullscreenElement: Element; + /** + * Gets the Command to toggle fullscreen mode. + */ + command: Command; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the view model. Should be called to + properly clean up the view model when it is no longer needed. + */ + destroy(): void; +} + +/** + * A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is +performed using {@link https://cesium.com/cesium-ion/|Cesium ion}. + * @param options - Object with the following properties: + * @param options.container - The DOM element or ID that will contain the widget. + * @param options.scene - The Scene instance to use. + * @param [options.geocoderServices] - The geocoder services to be used + * @param [options.autoComplete = true] - True if the geocoder should query as the user types to autocomplete + * @param [options.flightDuration = 1.5] - The duration of the camera flight to an entered location, in seconds. + * @param [options.destinationFound = GeocoderViewModel.flyToDestination] - A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. + */ +export class Geocoder { + constructor(options: { + container: Element | string + scene: Scene + geocoderServices?: GeocoderService[] + autoComplete?: boolean + flightDuration?: number + destinationFound?: Geocoder.DestinationFoundFunction + }); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the parent container. + */ + searchSuggestionsContainer: Element; + /** + * Gets the view model. + */ + viewModel: GeocoderViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +export namespace Geocoder { + /** + * A function that handles the result of a successful geocode. + * @param viewModel - The view model. + * @param destination - The destination result of the geocode. + */ + type DestinationFoundFunction = (viewModel: GeocoderViewModel, destination: Cartesian3 | Rectangle) => void; +} + +/** + * The view model for the {@link Geocoder} widget. + * @param options - Object with the following properties: + * @param options.scene - The Scene instance to use. + * @param [options.geocoderServices] - Geocoder services to use for geocoding queries. + If more than one are supplied, suggestions will be gathered for the geocoders that support it, + and if no suggestion is selected the result from the first geocoder service wil be used. + * @param [options.flightDuration] - The duration of the camera flight to an entered location, in seconds. + * @param [options.destinationFound = GeocoderViewModel.flyToDestination] - A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination. + */ +export class GeocoderViewModel { + constructor(options: { + scene: Scene + geocoderServices?: GeocoderService[] + flightDuration?: number + destinationFound?: Geocoder.DestinationFoundFunction + }); + /** + * Gets or sets a value indicating if this instance should always show its text input field. + */ + keepExpanded: boolean; + /** + * True if the geocoder should query as the user types to autocomplete + */ + autoComplete: boolean; + /** + * Gets and sets the command called when a geocode destination is found + */ + destinationFound: Geocoder.DestinationFoundFunction; + /** + * Gets a value indicating whether a search is currently in progress. This property is observable. + */ + isSearchInProgress: boolean; + /** + * Gets or sets the text to search for. The text can be an address, or longitude, latitude, + and optional height, where longitude and latitude are in degrees and height is in meters. + */ + searchText: string; + /** + * Gets or sets the the duration of the camera flight in seconds. + A value of zero causes the camera to instantly switch to the geocoding location. + The duration will be computed based on the distance when undefined. + */ + flightDuration: number | undefined; + /** + * Gets the event triggered on flight completion. + */ + complete: Event; + /** + * Gets the scene to control. + */ + scene: Scene; + /** + * Gets the Command that is executed when the button is clicked. + */ + search: Command; + /** + * Gets the currently selected geocoder search suggestion + */ + selectedSuggestion: any; + /** + * Gets the list of geocoder search suggestions + */ + suggestions: object[]; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; + /** + * A function to fly to the destination found by a successful geocode. + */ + static flyToDestination: Geocoder.DestinationFoundFunction; +} + +/** + * A single button widget for returning to the default camera view of the current scene. + * @param container - The DOM element or ID that will contain the widget. + * @param scene - The Scene instance to use. + * @param [duration] - The time, in seconds, it takes to complete the camera flight home. + */ +export class HomeButton { + constructor(container: Element | string, scene: Scene, duration?: number); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: HomeButtonViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link HomeButton}. + * @param scene - The scene instance to use. + * @param [duration] - The duration of the camera flight in seconds. + */ +export class HomeButtonViewModel { + constructor(scene: Scene, duration?: number); + /** + * Gets or sets the tooltip. This property is observable. + */ + tooltip: string; + /** + * Gets the scene to control. + */ + scene: Scene; + /** + * Gets the Command that is executed when the button is clicked. + */ + command: Command; + /** + * Gets or sets the the duration of the camera flight in seconds. + A value of zero causes the camera to instantly switch to home view. + The duration will be computed based on the distance when undefined. + */ + duration: number | undefined; +} + +/** + * A widget for displaying information or a description. + * @param container - The DOM element or ID that will contain the widget. + */ +export class InfoBox { + constructor(container: Element | string); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: InfoBoxViewModel; + /** + * Gets the iframe used to display the description. + */ + frame: HTMLIFrameElement; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link InfoBox}. + */ +export class InfoBoxViewModel { + constructor(); + /** + * Gets or sets the maximum height of the info box in pixels. This property is observable. + */ + maxHeight: number; + /** + * Gets or sets whether the camera tracking icon is enabled. + */ + enableCamera: boolean; + /** + * Gets or sets the status of current camera tracking of the selected object. + */ + isCameraTracking: boolean; + /** + * Gets or sets the visibility of the info box. + */ + showInfo: boolean; + /** + * Gets or sets the title text in the info box. + */ + titleText: string; + /** + * Gets or sets the description HTML for the info box. + */ + description: string; + /** + * Gets the SVG path of the camera icon, which can change to be "crossed out" or not. + */ + cameraIconPath: string; + /** + * Gets the maximum height of sections within the info box, minus an offset, in CSS-ready form. + * @param offset - The offset in pixels. + */ + maxHeightOffset(offset: number): string; + /** + * Gets an {@link Event} that is fired when the user clicks the camera icon. + */ + cameraClicked: Event; + /** + * Gets an {@link Event} that is fired when the user closes the info box. + */ + closeClicked: Event; +} + +/** + * <p>The NavigationHelpButton is a single button widget for displaying instructions for +navigating the globe with the mouse.</p><p style="clear: both;"></p><br/> + * @example + * // In HTML head, include a link to the NavigationHelpButton.css stylesheet, +// and in the body, include: <div id="navigationHelpButtonContainer"></div> + +var navigationHelpButton = new Cesium.NavigationHelpButton({ + container : 'navigationHelpButtonContainer' +}); + * @param options - Object with the following properties: + * @param options.container - The DOM element or ID that will contain the widget. + * @param [options.instructionsInitiallyVisible = false] - True if the navigation instructions should initially be visible; otherwise, false. + */ +export class NavigationHelpButton { + constructor(options: { + container: Element | string + instructionsInitiallyVisible?: boolean + }); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: NavigationHelpButtonViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link NavigationHelpButton}. + */ +export class NavigationHelpButtonViewModel { + constructor(); + /** + * Gets or sets whether the instructions are currently shown. This property is observable. + */ + showInstructions: boolean; + /** + * Gets or sets the tooltip. This property is observable. + */ + tooltip: string; + /** + * Gets the Command that is executed when the button is clicked. + */ + command: Command; + /** + * Gets the Command that is executed when the mouse instructions should be shown. + */ + showClick: Command; + /** + * Gets the Command that is executed when the touch instructions should be shown. + */ + showTouch: Command; +} + +/** + * Monitors performance of the application and displays a message if poor performance is detected. + * @param [options] - Object with the following properties: + * @param options.container - The DOM element or ID that will contain the widget. + * @param options.scene - The {@link Scene} for which to monitor performance. + * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The + message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure + it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. + */ +export class PerformanceWatchdog { + constructor(options?: { + container: Element | string + scene: Scene + lowFrameRateMessage?: string + }); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: PerformanceWatchdogViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link PerformanceWatchdog}. + * @param [options] - Object with the following properties: + * @param options.scene - The Scene instance for which to monitor performance. + * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The + message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure + it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. + */ +export class PerformanceWatchdogViewModel { + constructor(options?: { + scene: Scene + lowFrameRateMessage?: string + }); + /** + * Gets or sets the message to display when a low frame rate is detected. This string will be interpreted as HTML. + */ + lowFrameRateMessage: string; + /** + * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user. If it has + been dismissed, the message will not be redisplayed, no matter the frame rate. + */ + lowFrameRateMessageDismissed: boolean; + /** + * Gets or sets a value indicating whether the low frame rate message is currently being displayed. + */ + showingLowFrameRateMessage: boolean; + /** + * Gets the {@link Scene} instance for which to monitor performance. + */ + scene: Scene; + /** + * Gets a command that dismisses the low frame rate message. Once it is dismissed, the message + will not be redisplayed. + */ + dismissMessage: Command; +} + +/** + * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections. + * @example + * // In HTML head, include a link to the ProjectionPicker.css stylesheet, +// and in the body, include: <div id="projectionPickerContainer"></div> +// Note: This code assumes you already have a Scene instance. + +var projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene); + * @param container - The DOM element or ID that will contain the widget. + * @param scene - The Scene instance to use. + */ +export class ProjectionPicker { + constructor(container: Element | string, scene: Scene); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: ProjectionPickerViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link ProjectionPicker}. + * @param scene - The Scene to switch projections. + */ +export class ProjectionPickerViewModel { + constructor(scene: Scene); + /** + * Gets or sets whether the button drop-down is currently visible. This property is observable. + */ + dropDownVisible: boolean; + /** + * Gets or sets the perspective projection tooltip. This property is observable. + */ + tooltipPerspective: string; + /** + * Gets or sets the orthographic projection tooltip. This property is observable. + */ + tooltipOrthographic: string; + /** + * Gets the currently active tooltip. This property is observable. + */ + selectedTooltip: string; + /** + * Gets or sets the current SceneMode. This property is observable. + */ + sceneMode: SceneMode; + /** + * Gets the scene + */ + scene: Scene; + /** + * Gets the command to toggle the drop down box. + */ + toggleDropDown: Command; + /** + * Gets the command to switch to a perspective projection. + */ + switchToPerspective: Command; + /** + * Gets the command to switch to orthographic projection. + */ + switchToOrthographic: Command; + /** + * Gets whether the scene is currently using an orthographic projection. + */ + isOrthographicProjection: Command; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the view model. + */ + destroy(): void; +} + +/** + * <img src="Images/sceneModePicker.png" style="float: left; margin-right: 10px;" width="44" height="116" /> +<p>The SceneModePicker is a single button widget for switching between scene modes; +shown to the left in its expanded state. Programatic switching of scene modes will +be automatically reflected in the widget as long as the specified Scene +is used to perform the change.</p><p style="clear: both;"></p><br/> + * @example + * // In HTML head, include a link to the SceneModePicker.css stylesheet, +// and in the body, include: <div id="sceneModePickerContainer"></div> +// Note: This code assumes you already have a Scene instance. + +var sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene); + * @param container - The DOM element or ID that will contain the widget. + * @param scene - The Scene instance to use. + * @param [duration = 2.0] - The time, in seconds, it takes for the scene to transition. + */ +export class SceneModePicker { + constructor(container: Element | string, scene: Scene, duration?: number); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: SceneModePickerViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link SceneModePicker}. + * @param scene - The Scene to morph + * @param [duration = 2.0] - The duration of scene morph animations, in seconds + */ +export class SceneModePickerViewModel { + constructor(scene: Scene, duration?: number); + /** + * Gets or sets the current SceneMode. This property is observable. + */ + sceneMode: SceneMode; + /** + * Gets or sets whether the button drop-down is currently visible. This property is observable. + */ + dropDownVisible: boolean; + /** + * Gets or sets the 2D tooltip. This property is observable. + */ + tooltip2D: string; + /** + * Gets or sets the 3D tooltip. This property is observable. + */ + tooltip3D: string; + /** + * Gets or sets the Columbus View tooltip. This property is observable. + */ + tooltipColumbusView: string; + /** + * Gets the currently active tooltip. This property is observable. + */ + selectedTooltip: string; + /** + * Gets the scene + */ + scene: Scene; + /** + * Gets or sets the the duration of scene mode transition animations in seconds. + A value of zero causes the scene to instantly change modes. + */ + duration: number; + /** + * Gets the command to toggle the drop down box. + */ + toggleDropDown: Command; + /** + * Gets the command to morph to 2D. + */ + morphTo2D: Command; + /** + * Gets the command to morph to 3D. + */ + morphTo3D: Command; + /** + * Gets the command to morph to Columbus View. + */ + morphToColumbusView: Command; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the view model. + */ + destroy(): void; +} + +/** + * A widget for displaying an indicator on a selected object. + * @param container - The DOM element or ID that will contain the widget. + * @param scene - The Scene instance to use. + */ +export class SelectionIndicator { + constructor(container: Element | string, scene: Scene); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: SelectionIndicatorViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link SelectionIndicator}. + * @param scene - The scene instance to use for screen-space coordinate conversion. + * @param selectionIndicatorElement - The element containing all elements that make up the selection indicator. + * @param container - The DOM element that contains the widget. + */ +export class SelectionIndicatorViewModel { + constructor(scene: Scene, selectionIndicatorElement: Element, container: Element); + /** + * Gets or sets the world position of the object for which to display the selection indicator. + */ + position: Cartesian3; + /** + * Gets or sets the visibility of the selection indicator. + */ + showSelection: boolean; + /** + * Gets the visibility of the position indicator. This can be false even if an + object is selected, when the selected object has no position. + */ + isVisible: boolean; + /** + * Gets or sets the function for converting the world position of the object to the screen space position. + * @example + * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) { + return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result); + }; + */ + computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition; + /** + * Updates the view of the selection indicator to match the position and content properties of the view model. + This function should be called as part of the render loop. + */ + update(): void; + /** + * Animate the indicator to draw attention to the selection. + */ + animateAppear(): void; + /** + * Animate the indicator to release the selection. + */ + animateDepart(): void; + /** + * Gets the HTML element containing the selection indicator. + */ + container: Element; + /** + * Gets the HTML element that holds the selection indicator. + */ + selectionIndicatorElement: Element; + /** + * Gets the scene being used. + */ + scene: Scene; +} + +export namespace SelectionIndicatorViewModel { + /** + * A function that converts the world position of an object to a screen space position. + * @param position - The position in WGS84 (world) coordinates. + * @param result - An object to return the input position transformed to window coordinates. + */ + type ComputeScreenSpacePosition = (position: Cartesian3, result: Cartesian2) => Cartesian2; +} + +/** + * A Knockout binding handler that creates a DOM element for a single SVG path. +This binding handler will be registered as cesiumSvgPath. + +<p> +The parameter to this binding is an object with the following properties: +</p> + +<ul> +<li>path: The SVG path as a string.</li> +<li>width: The width of the SVG path with no transformations applied.</li> +<li>height: The height of the SVG path with no transformations applied.</li> +<li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li> +</ul> + * @example + * // Create an SVG as a child of a div +<div data-bind="cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div> + +// parameters can be observable from the view model +<div data-bind="cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div> + +// or the whole object can be observable from the view model +<div data-bind="cesiumSvgPath: svgPathOptions"></div> + */ +export namespace SvgPathBindingHandler { + function register(): void; +} + +/** + * The Timeline is a widget for displaying and controlling the current scene time. + * @param container - The parent HTML container node for this widget. + * @param clock - The clock to use. + */ +export class Timeline { + constructor(container: Element, clock: Clock); + /** + * Gets the parent container. + */ + container: Element; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; + /** + * Sets the view to the provided times. + * @param startTime - The start time. + * @param stopTime - The stop time. + */ + zoomTo(startTime: JulianDate, stopTime: JulianDate): void; + /** + * Resizes the widget to match the container size. + */ + resize(): void; +} + +/** + * A view model which exposes the properties of a toggle button. + * @param command - The command which will be executed when the button is toggled. + * @param [options] - Object with the following properties: + * @param [options.toggled = false] - A boolean indicating whether the button should be initially toggled. + * @param [options.tooltip = ''] - A string containing the button's tooltip. + */ +export class ToggleButtonViewModel { + constructor(command: Command, options?: { + toggled?: boolean + tooltip?: string + }); + /** + * Gets or sets whether the button is currently toggled. This property is observable. + */ + toggled: boolean; + /** + * Gets or sets the button's tooltip. This property is observable. + */ + tooltip: string; + /** + * Gets the command which will be executed when the button is toggled. + */ + command: Command; +} + +export namespace Viewer { + /** + * Initialization options for the Viewer constructor + * @property [animation = true] - If set to false, the Animation widget will not be created. + * @property [baseLayerPicker = true] - If set to false, the BaseLayerPicker widget will not be created. + * @property [fullscreenButton = true] - If set to false, the FullscreenButton widget will not be created. + * @property [vrButton = false] - If set to true, the VRButton widget will be created. + * @property [geocoder = true] - If set to false, the Geocoder widget will not be created. + * @property [homeButton = true] - If set to false, the HomeButton widget will not be created. + * @property [infoBox = true] - If set to false, the InfoBox widget will not be created. + * @property [sceneModePicker = true] - If set to false, the SceneModePicker widget will not be created. + * @property [selectionIndicator = true] - If set to false, the SelectionIndicator widget will not be created. + * @property [timeline = true] - If set to false, the Timeline widget will not be created. + * @property [navigationHelpButton = true] - If set to false, the navigation help button will not be created. + * @property [navigationInstructionsInitiallyVisible = true] - True if the navigation instructions should initially be visible, or false if the should not be shown until the user explicitly clicks the button. + * @property [scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory. + * @property [shouldAnimate = false] - <code>true</code> if the clock should attempt to advance simulation time by default, <code>false</code> otherwise. This option takes precedence over setting {@link Viewer#clockViewModel}. + * @property [clockViewModel = new ClockViewModel(clock)] - The clock view model to use to control current time. + * @property [selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available base layer is used. This value is only valid if `baseLayerPicker` is set to true. + * @property [imageryProviderViewModels = createDefaultImageryProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true. + * @property [selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available base layer is used. This value is only valid if `baseLayerPicker` is set to true. + * @property [terrainProviderViewModels = createDefaultTerrainProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true. + * @property [imageryProvider = createWorldImagery()] - The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false. + * @property [terrainProvider = new EllipsoidTerrainProvider()] - The terrain provider to use + * @property [skyBox] - The skybox used to render the stars. When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added. + * @property [skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off. + * @property [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode when the full screen button is pressed. + * @property [useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise. + * @property [targetFrameRate] - The target frame rate when using the default render loop. + * @property [showRenderLoopErrors = true] - If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs. + * @property [useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>. + * @property [automaticallyTrackDataSourceClocks = true] - If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes. Set this to false if you want to configure the clock independently. + * @property [contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}. + * @property [sceneMode = SceneMode.SCENE3D] - The initial scene mode. + * @property [mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes. + * @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added. + * @property [orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency. + * @property [creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself. + * @property [creditViewport] - The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself. + * @property [dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided, + the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed. + * @property [terrainExaggeration = 1.0] - A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid. + * @property [shadows = false] - Determines if shadows are cast by light sources. + * @property [terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources. + * @property [mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction. + * @property [projectionPicker = false] - If set to true, the ProjectionPicker widget will be created. + * @property [requestRenderMode = false] - If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling reduces the CPU/GPU usage of your application and uses less battery on mobile, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + * @property [maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}. + */ + type ConstructorOptions = { + animation?: boolean + baseLayerPicker?: boolean + fullscreenButton?: boolean + vrButton?: boolean + geocoder?: boolean | GeocoderService[] + homeButton?: boolean + infoBox?: boolean + sceneModePicker?: boolean + selectionIndicator?: boolean + timeline?: boolean + navigationHelpButton?: boolean + navigationInstructionsInitiallyVisible?: boolean + scene3DOnly?: boolean + shouldAnimate?: boolean + clockViewModel?: ClockViewModel + selectedImageryProviderViewModel?: ProviderViewModel + imageryProviderViewModels?: ProviderViewModel[] + selectedTerrainProviderViewModel?: ProviderViewModel + terrainProviderViewModels?: ProviderViewModel[] + imageryProvider?: ImageryProvider + terrainProvider?: TerrainProvider + skyBox?: SkyBox | false + skyAtmosphere?: SkyAtmosphere | false + fullscreenElement?: Element | string + useDefaultRenderLoop?: boolean + targetFrameRate?: number + showRenderLoopErrors?: boolean + useBrowserRecommendedResolution?: boolean + automaticallyTrackDataSourceClocks?: boolean + contextOptions?: any + sceneMode?: SceneMode + mapProjection?: MapProjection + globe?: Globe | false + orderIndependentTranslucency?: boolean + creditContainer?: Element | string + creditViewport?: Element | string + dataSources?: DataSourceCollection + terrainExaggeration?: number + shadows?: boolean + terrainShadows?: ShadowMode + mapMode2D?: MapMode2D + projectionPicker?: boolean + requestRenderMode?: boolean + maximumRenderTimeChange?: number + }; + /** + * A function that augments a Viewer instance with additional functionality. + * @param viewer - The viewer instance. + * @param options - Options object to be passed to the mixin function. + */ + type ViewerMixin = (viewer: Viewer, options: any) => void; +} + +/** + * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package. +The widget can always be extended by using mixins, which add functionality useful for a variety of applications. + * @example + * //Initialize the viewer widget with several custom options and mixins. +var viewer = new Cesium.Viewer('cesiumContainer', { + //Start in Columbus Viewer + sceneMode : Cesium.SceneMode.COLUMBUS_VIEW, + //Use Cesium World Terrain + terrainProvider : Cesium.createWorldTerrain(), + //Hide the base layer picker + baseLayerPicker : false, + //Use OpenStreetMaps + imageryProvider : new Cesium.OpenStreetMapImageryProvider({ + url : 'https://a.tile.openstreetmap.org/' + }), + skyBox : new Cesium.SkyBox({ + sources : { + positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg', + negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg', + positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg', + negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg', + positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg', + negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg' + } + }), + // Show Columbus View map with Web Mercator projection + mapProjection : new Cesium.WebMercatorProjection() +}); + +//Add basic drag and drop functionality +viewer.extend(Cesium.viewerDragDropMixin); + +//Show a pop-up alert if we encounter an error when processing a dropped file +viewer.dropError.addEventListener(function(dropHandler, name, error) { + console.log(error); + window.alert(error); +}); + * @param container - The DOM element or ID that will contain the widget. + * @param [options] - Object describing initialization options + */ +export class Viewer { + constructor(container: Element | string, options?: Viewer.ConstructorOptions); + /** + * Gets the parent container. + */ + readonly container: Element; + /** + * Gets the DOM element for the area at the bottom of the window containing the + {@link CreditDisplay} and potentially other things. + */ + readonly bottomContainer: Element; + /** + * Gets the CesiumWidget. + */ + readonly cesiumWidget: CesiumWidget; + /** + * Gets the selection indicator. + */ + readonly selectionIndicator: SelectionIndicator; + /** + * Gets the info box. + */ + readonly infoBox: InfoBox; + /** + * Gets the Geocoder. + */ + readonly geocoder: Geocoder; + /** + * Gets the HomeButton. + */ + readonly homeButton: HomeButton; + /** + * Gets the SceneModePicker. + */ + readonly sceneModePicker: SceneModePicker; + /** + * Gets the ProjectionPicker. + */ + readonly projectionPicker: ProjectionPicker; + /** + * Gets the BaseLayerPicker. + */ + readonly baseLayerPicker: BaseLayerPicker; + /** + * Gets the NavigationHelpButton. + */ + readonly navigationHelpButton: NavigationHelpButton; + /** + * Gets the Animation widget. + */ + readonly animation: Animation; + /** + * Gets the Timeline widget. + */ + readonly timeline: Timeline; + /** + * Gets the FullscreenButton. + */ + readonly fullscreenButton: FullscreenButton; + /** + * Gets the VRButton. + */ + readonly vrButton: VRButton; + /** + * Gets the display used for {@link DataSource} visualization. + */ + readonly dataSourceDisplay: DataSourceDisplay; + /** + * Gets the collection of entities not tied to a particular data source. + This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}. + */ + readonly entities: EntityCollection; + /** + * Gets the set of {@link DataSource} instances to be visualized. + */ + readonly dataSources: DataSourceCollection; + /** + * Gets the canvas. + */ + readonly canvas: HTMLCanvasElement; + /** + * Gets the scene. + */ + readonly scene: Scene; + /** + * Determines if shadows are cast by light sources. + */ + shadows: boolean; + /** + * Determines if the terrain casts or shadows from light sources. + */ + terrainShadows: ShadowMode; + /** + * Get the scene's shadow map + */ + readonly shadowMap: ShadowMap; + /** + * Gets the collection of image layers that will be rendered on the globe. + */ + readonly imageryLayers: ImageryLayerCollection; + /** + * The terrain provider providing surface geometry for the globe. + */ + terrainProvider: TerrainProvider; + /** + * Gets the camera. + */ + readonly camera: Camera; + /** + * Gets the post-process stages. + */ + readonly postProcessStages: PostProcessStageCollection; + /** + * Gets the clock. + */ + readonly clock: Clock; + /** + * Gets the clock view model. + */ + readonly clockViewModel: ClockViewModel; + /** + * Gets the screen space event handler. + */ + readonly screenSpaceEventHandler: ScreenSpaceEventHandler; + /** + * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code> + is true. If undefined, the browser's {@link requestAnimationFrame} implementation + determines the frame rate. If defined, this value must be greater than 0. A value higher + than the underlying requestAnimationFrame implementation will have no effect. + */ + targetFrameRate: number; + /** + * Gets or sets whether or not this widget should control the render loop. + If set to true the widget will use {@link requestAnimationFrame} to + perform rendering and resizing of the widget, as well as drive the + simulation clock. If set to false, you must manually call the + <code>resize</code>, <code>render</code> methods + as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s + <code>renderError</code> event will be raised and this property + will be set to false. It must be set back to true to continue rendering + after the error. + */ + useDefaultRenderLoop: boolean; + /** + * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve + performance on less powerful devices while values greater than 1.0 will render at a higher + resolution and then scale down, resulting in improved visual fidelity. + For example, if the widget is laid out at a size of 640x480, setting this value to 0.5 + will cause the scene to be rendered at 320x240 and then scaled up while setting + it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down. + */ + resolutionScale: number; + /** + * Boolean flag indicating if the browser's recommended resolution is used. + If true, the browser's device pixel ratio is ignored and 1.0 is used instead, + effectively rendering based on CSS pixels instead of device pixels. This can improve + performance on less powerful devices that have high pixel density. When false, rendering + will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether + this flag is true or false. + */ + useBrowserRecommendedResolution: boolean; + /** + * Gets or sets whether or not data sources can temporarily pause + animation in order to avoid showing an incomplete picture to the user. + For example, if asynchronous primitives are being processed in the + background, the clock will not advance until the geometry is ready. + */ + allowDataSourcesToSuspendAnimation: boolean; + /** + * Gets or sets the Entity instance currently being tracked by the camera. + */ + trackedEntity: Entity | undefined; + /** + * Gets or sets the object instance for which to display a selection indicator. + + If a user interactively picks a Cesium3DTilesFeature instance, then this property + will contain a transient Entity instance with a property named "feature" that is + the instance that was picked. + */ + selectedEntity: Entity | undefined; + /** + * Gets the event that is raised when the selected entity changes. + */ + readonly selectedEntityChanged: Event; + /** + * Gets the event that is raised when the tracked entity changes. + */ + readonly trackedEntityChanged: Event; + /** + * Gets or sets the data source to track with the viewer's clock. + */ + clockTrackedDataSource: DataSource; + /** + * Extends the base viewer functionality with the provided mixin. + A mixin may add additional properties, functions, or other behavior + to the provided viewer instance. + * @param mixin - The Viewer mixin to add to this instance. + * @param [options] - The options object to be passed to the mixin function. + */ + extend(mixin: Viewer.ViewerMixin, options?: any): void; + /** + * Resizes the widget to match the container size. + This function is called automatically as needed unless + <code>useDefaultRenderLoop</code> is set to false. + */ + resize(): void; + /** + * This forces the widget to re-think its layout, including + widget sizes and credit placement. + */ + forceResize(): void; + /** + * Renders the scene. This function is called automatically + unless <code>useDefaultRenderLoop</code> is set to false; + */ + render(): void; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; + /** + * Asynchronously sets the camera to view the provided entity, entities, or data source. + If the data source is still in the process of loading or the visualization is otherwise still loading, + this method waits for the data to be ready before performing the zoom. + + <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. + The heading and the pitch angles are defined in the local east-north-up reference frame. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is + zero, a range will be computed such that the whole bounding sphere is visible.</p> + + <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the range. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north.</p> + * @param target - The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types. + * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame. + * @returns A Promise that resolves to true if the zoom was successful or false if the target is not currently visualized in the scene or the zoom was cancelled. + */ + zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, offset?: HeadingPitchRange): Promise<boolean>; + /** + * Flies the camera to the provided entity, entities, or data source. + If the data source is still in the process of loading or the visualization is otherwise still loading, + this method waits for the data to be ready before performing the flight. + + <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere. + The heading and the pitch angles are defined in the local east-north-up reference frame. + The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch + angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is + zero, a range will be computed such that the whole bounding sphere is visible.</p> + + <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the + target will be the range. The heading will be determined from the offset. If the heading cannot be + determined from the offset, the heading will be north.</p> + * @param target - The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types. + * @param [options] - Object with the following properties: + * @param [options.duration = 3.0] - The duration of the flight in seconds. + * @param [options.maximumHeight] - The maximum height at the peak of the flight. + * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target. + * @returns A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions + */ + flyTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, options?: { + duration?: number + maximumHeight?: number + offset?: HeadingPitchRange + }): Promise<boolean>; +} + +/** + * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget. +Rather than being called directly, this function is normally passed as +a parameter to {@link Viewer#extend}, as shown in the example below. + * @example + * var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin); + * @param viewer - The viewer instance. + */ +export function viewerCesium3DTilesInspectorMixin(viewer: Viewer): void; + +/** + * A mixin which adds the CesiumInspector widget to the Viewer widget. +Rather than being called directly, this function is normally passed as +a parameter to {@link Viewer#extend}, as shown in the example below. + * @example + * var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.extend(Cesium.viewerCesiumInspectorMixin); + * @param viewer - The viewer instance. + */ +export function viewerCesiumInspectorMixin(viewer: Viewer): void; + +/** + * A mixin which adds default drag and drop support for CZML files to the Viewer widget. +Rather than being called directly, this function is normally passed as +a parameter to {@link Viewer#extend}, as shown in the example below. + * @example + * // Add basic drag and drop support and pop up an alert window on error. +var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.extend(Cesium.viewerDragDropMixin); +viewer.dropError.addEventListener(function(viewerArg, source, error) { + window.alert('Error processing ' + source + ':' + error); +}); + * @param viewer - The viewer instance. + * @param [options] - Object with the following properties: + * @param [options.dropTarget = viewer.container] - The DOM element which will serve as the drop target. + * @param [options.clearOnDrop = true] - When true, dropping files will clear all existing data sources first, when false, new data sources will be loaded after the existing ones. + * @param [options.flyToOnDrop = true] - When true, dropping files will fly to the data source once it is loaded. + * @param [options.clampToGround = true] - When true, datasources are clamped to the ground. + * @param [options.proxy] - The proxy to be used for KML network links. + */ +export function viewerDragDropMixin(viewer: Viewer, options?: { + dropTarget?: Element | string + clearOnDrop?: boolean + flyToOnDrop?: boolean + clampToGround?: boolean + proxy?: Proxy +}): void; + +/** + * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget. +Rather than being called directly, this function is normally passed as +a parameter to {@link Viewer#extend}, as shown in the example below. + * @example + * var viewer = new Cesium.Viewer('cesiumContainer'); +viewer.extend(Cesium.viewerPerformanceWatchdogMixin, { + lowFrameRateMessage : 'Why is this going so <em>slowly</em>?' +}); + * @param viewer - The viewer instance. + * @param [options] - An object with properties. + * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The + message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure + it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. + */ +export function viewerPerformanceWatchdogMixin(viewer: Viewer, options?: { + lowFrameRateMessage?: string +}): void; + +/** + * A single button widget for toggling vr mode. + * @param container - The DOM element or ID that will contain the widget. + * @param scene - The scene. + * @param [vrElement = document.body] - The element or id to be placed into vr mode. + */ +export class VRButton { + constructor(container: Element | string, scene: Scene, vrElement?: Element | string); + /** + * Gets the parent container. + */ + container: Element; + /** + * Gets the view model. + */ + viewModel: VRButtonViewModel; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the widget. Should be called if permanently + removing the widget from layout. + */ + destroy(): void; +} + +/** + * The view model for {@link VRButton}. + * @param scene - The scene. + * @param [vrElement = document.body] - The element or id to be placed into VR mode. + */ +export class VRButtonViewModel { + constructor(scene: Scene, vrElement?: Element | string); + /** + * Gets whether or not VR mode is active. + */ + isVRMode: boolean; + /** + * Gets or sets whether or not VR functionality should be enabled. + */ + isVREnabled: boolean; + /** + * Gets the tooltip. This property is observable. + */ + tooltip: string; + /** + * Gets or sets the HTML element to place into VR mode when the + corresponding button is pressed. + */ + vrElement: Element; + /** + * Gets the Command to toggle VR mode. + */ + command: Command; + /** + * @returns true if the object has been destroyed, false otherwise. + */ + isDestroyed(): boolean; + /** + * Destroys the view model. Should be called to + properly clean up the view model when it is no longer needed. + */ + destroy(): void; +} +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e754e65 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "lib": ["esnext", "dom"], + "types": ["vite/client"] + }, + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/vite.config.js b/vite.config.ts similarity index 100% rename from vite.config.js rename to vite.config.ts